MVG -- path closed if joinstyle is "round"

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
wolfdieter

MVG -- path closed if joinstyle is "round"

Post 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)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

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

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

We can reproduce the problem you reported and have a patch in ImageMagick 6.6.4-0 Beta available sometime tomorrow. Thanks.
Post Reply