[cairo] Derivation of the mitre limit

Chris Wilson chris at chris-wilson.co.uk
Wed Sep 26 03:33:00 PDT 2007


I was reviewing https://bugs.freedesktop.org/show_bug.cgi?id=7245,
cairo_stroke_extents() gives wrong result for arcs in some cases, when I
left scratching my head over the detailed comment that derives the
condition for the mitre limit (cairo-path-stroke.c, line 276).

Namely the first identity where it is stated sec(theta) = 1/sin(theta).
Eeek, surely you meant sec(theta) = 1/cos(theta) - and I double checked
against my trigonometric identities booklet and
http://mathworld.wolfram.com/Secant.html.

After that the correction is fairly straight-forward as we can use the
identity 2·cos²(psi/2) = 1+cos(psi) in place of the original
2·sin²(psi/2) = 1-cos(psi) with the result 2 <= ml² (1 + in · out).

Fixing the minus sign fixes Bug 7245 but generates a new failure with
random-intersections, so can someone (looks at Carl ;-) double check
my working and update the reference image if necessary.
--
Chris Wilson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-cairo-path-stroke-Correct-the-mitre-limit-derivati.patch
Type: text/x-diff
Size: 0 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20070926/fabc5432/attachment.patch 


More information about the cairo mailing list