Re: Calculating accurate bounds of stroked paths [SOLVED]
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