• 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 [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculating accurate bounds of stroked paths [SOLVED]


  • Subject: Re: Calculating accurate bounds of stroked paths [SOLVED]
  • From: Graham Cox <email@hidden>
  • Date: Wed, 9 Jul 2008 17:24:09 +1000


On 9 Jul 2008, at 5:11 pm, Chris Suter wrote:

You could ignore the mitre limit and assume it was always mitre joint and it would give you a worst case bounds. However, it wouldn't be sensible to do that since the bounds would stretch out excessively for very acute angles.

Without knowing the miter limit's value, the "worst case bounds" would have to be infinitely large. I suppose that could be defined as 'worst case'! As a practical matter it's always going to be something though, and it turns out to be easy to factor it in. I can also avoid doing this if my path joins are round or bevel.


I suggest you have a look at the PDF specification since that's the definitive reference for this stuff.

Yep, I'm just downloading that now.

I think you mean a = 2 * arcsin(w / m) and m = w / sin(a / 2).

Indeed I do - been a long day ;-)


You will need to also take into account of the line width (as I'm sure you do) so I think the combined offset would be best expressed as:


	max(w / 2, ml * w / 2)

where ml is the mitre limit.

That's right, and precisely what I'm doing. Works well enough though for most actual paths is on the generous side (because rarely do angles get that sharp). Still, it's probably a fair compromise between updating more than necessary and going over each path to find the sharpest angle.



cheers, Graham _______________________________________________

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: Peter Zegelin <email@hidden>
References: 
 >Calculating accurate bounds of stroked paths (From: Graham Cox <email@hidden>)
 >Re: Calculating accurate bounds of stroked paths (From: Chris Suter <email@hidden>)
 >Re: Calculating accurate bounds of stroked paths [SOLVED] (From: Graham Cox <email@hidden>)
 >Re: Calculating accurate bounds of stroked paths [SOLVED] (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Calculating accurate bounds of stroked paths [SOLVED]
  • Next by Date: Re: Distributed Objects "connection went invalid while waiting for a reply"
  • Previous by thread: Re: Calculating accurate bounds of stroked paths [SOLVED]
  • Next by thread: Re: Calculating accurate bounds of stroked paths [SOLVED]
  • Index(es):
    • Date
    • Thread