Re: Calculating accurate bounds of stroked paths [SOLVED]

2008-07-09 Thread Graham Cox
On 9 Jul 2008, at 4:02 pm, Chris Suter wrote: so you can get a worst case bounds by ignoring the mitre limit. No you can't. If the stroke width is 'w' then you can outset the bounds by w/2 to enclose the path for straight edges and angles = 90 degrees. When there is a more acute angle

Re: Calculating accurate bounds of stroked paths [SOLVED]

2008-07-09 Thread Graham Cox
On 9 Jul 2008, at 4:37 pm, Graham Cox wrote: Thus the angle 'a' of the corner is equal to 2*sin(w/m) That of course should be 'arcsin', not 'sin' Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: Calculating accurate bounds of stroked paths [SOLVED]

2008-07-09 Thread Chris Suter
Hi Graham, On 09/07/2008, at 4:37 PM, Graham Cox wrote: On 9 Jul 2008, at 4:02 pm, Chris Suter wrote: so you can get a worst case bounds by ignoring the mitre limit. No you can't. If the stroke width is 'w' then you can outset the bounds by w/2 to enclose the path for straight edges and

Re: Calculating accurate bounds of stroked paths [SOLVED]

2008-07-09 Thread Graham Cox
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

Re: Calculating accurate bounds of stroked paths [SOLVED]

2008-07-09 Thread Peter Zegelin
On 09/07/2008, at 5:24 PM, Graham Cox wrote: snip 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