• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Calculating accurate bounds of stroked paths
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculating accurate bounds of stroked paths


  • Subject: Re: Calculating accurate bounds of stroked paths
  • From: Chris Suter <email@hidden>
  • Date: Wed, 9 Jul 2008 16:02:51 +1000

Hi Graham,

On 08/07/2008, at 10:16 PM, Graham Cox wrote:

A close second best would be a rect that was the worst case bounds for a given stroke width (it wouldn't need to know the actual path, just its basic bounds), which thus assumed that all angles were acute enough to trigger the mitre conversion. Even that is proving hard to figure, as I'm probably not really understand the miter limit calculation. The docs state:

Well, the miter limit is simply the point at which the join is converted to a bevel join and a bevel join will always have a smaller bounding box than a mitre join so you can get a worst case bounds by ignoring the mitre limit.


"The miter limit helps you avoid spikes at the junction of two line segments connected by a miter join (NSMiterLineJoinStyle). If the ratio of the miter length—the diagonal length of the miter join—to the line thickness exceeds the miter limit, the joint is converted to a bevel join. The default miter limit value is 10, which converts miters whose angle at the joint is less than 11 degrees."

So what *is it*? A value in degrees? Or a ratio of two sides of a triangle? What triangle, exactly? How can I tell just how far out I need to outset the rect to make sure I'm always just outside the edge of any mitred corner?

You should have a look at the PDF specification (you can easily get hold of it). It explains exactly what it is.


-- Chris

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Calculating accurate bounds of stroked paths [SOLVED]
      • From: Graham Cox <email@hidden>
    • Re: Calculating accurate bounds of stroked paths
      • From: Peter Zegelin <email@hidden>
References: 
 >Calculating accurate bounds of stroked paths (From: Graham Cox <email@hidden>)

  • Prev by Date: Redrawing CALayer subclass when super layer is scaled
  • Next by Date: Making a text cell in a table editable
  • Previous by thread: Re: Calculating accurate bounds of stroked paths
  • Next by thread: Re: Calculating accurate bounds of stroked paths
  • Index(es):
    • Date
    • Thread