Page 1 of 1

MVG -- path closed if joinstyle is "round"

Posted: 2010-08-28T23:56:53-07:00
by wolfdieter
This command generates "bild.gif" with opened triangle:

Code: Select all

convert -size 400x300 xc:wheat\
	-fill white\
	-stroke red\
	-strokewidth 10\
	-draw "stroke-linejoin miter\
		path 'M 10,10 L 50,100 90,10'"\
	bild.gif
If you switch to "stroke-linejoin: round", then the triangle is closed.
This happens also with arbitrary, program-generated bezier paths.
Any workaround known?

(Platform: Ubuntu)

Re: MVG -- path closed if joinstyle is "round"

Posted: 2010-08-29T10:47:32-07:00
by fmw42
what is the question? how to close a triangle? one solution is to just add another point that is the same as the first. do I misunderstand? see http://www.w3.org/TR/SVG/ or http://www.imagemagick.org/script/magic ... aphics.php

Re: MVG -- path closed if joinstyle is "round"

Posted: 2010-08-30T23:40:36-07:00
by anthony
To close the path add a 'z' to the end of the SVG path string...

Code: Select all

 convert -size 120x120 xc:wheat   -fill white   -stroke red   -strokewidth 10  \
      -draw "stroke-linejoin round  path 'M 10,10 L 50,100 90,10 z'" \
       bild_closed.gif
that produces a nice closed figure with rounded ends. The third line being provided by the 'z'.
Image

What is NOT correct is that your code draws three lines when only two were specified
and no 'closer was given!!!!!!

Code: Select all

  convert -size 120x120 xc:wheat   -fill white   -stroke red   -strokewidth 10  \
      -draw "stroke-linejoin round  path 'M 10,10 L 50,100 90,10'" \
       bild.gif
THIS IS A BUG -- three lines draw but only two specified.
Image

This may also be related to a bug previously reported but unfixed.
http://www.imagemagick.org/Usage/bugs/testing/#polyline

Re: MVG -- path closed if joinstyle is "round"

Posted: 2010-08-31T16:22:10-07:00
by magick
We can reproduce the problem you reported and have a patch in ImageMagick 6.6.4-0 Beta available sometime tomorrow. Thanks.