List Info

Thread: TraceArcPath - large radius




TraceArcPath - large radius
user name
2006-11-30 19:44:43
Hello.

TraceArcPath does not work well when you want to draw
an arc with a large radius. It might be good to add
a condition to convert such arcs to lines instead.

If arc goes from A to B with radius R, I propose the
following condition:

d = distance(A,B) / 2
if (d / R < 1e-4)
        TraceLine(...)

For R >> d, d/R is approximately the angle between
the line AB and the tangent on the arc in point
A or B.

MagickEpsilon might also work instead of 1e-4.

Here I assumed that the arc is part of a circle. If
it is part of an ellipse an appropriate R' might
be needed.

Marko Mahnič




Example with ImageMagick 6.3.0-6 Q8 (it does not happen
with Q16; the cause for the ghosts might be a rounding
error).
You can see the ghost line crossing the arc.

convert -density 600 -size 800x800 xc:white -fill none
-stroke black
-strokewidth 2.4 -draw largearc.pth ghost.png

--------- largearc.pth ---------------
path '
M500,409
L433,409
A535449000 535449000 203.738 0 1 431,410
L401,380
'




_______________________________________________
Magick-bugs mailing list
Magick-bugsimagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick-
bugs
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )