build123d icon indicating copy to clipboard operation
build123d copied to clipboard

Circle SVG imported as multiple ellipses

Open MatthiasJ1 opened this issue 2 years ago • 1 comments

circle_svg = StringIO("""
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <circle cx="50" cy="50" r="50" />
</svg>
""")

circle = import_svg(circle_svg)
v = circle.vertices()
print(circle.edges()[0].geom_type())
circle.edges()[0].geom_type() = 'ELLIPSE'
Screenshot

MatthiasJ1 avatar Feb 01 '24 09:02 MatthiasJ1

build123d uses the svg importer from here: https://github.com/snoyer/ocpsvg. Try raising the issue there.

gumyr avatar Feb 01 '24 22:02 gumyr

The underlying issue has been handled in ocpsvg and it looks like it fixed this issue in build123d

print([e.geom_type for e in import_svg(StringIO('<svg><circle r="1"/></svg>')).edges()])
[<GeomType.CIRCLE>]

maybe @MatthiasJ1 can confirm and close if applicable

snoyer avatar Oct 11 '24 11:10 snoyer

I get GeomType.CIRCLE with ocpsvg 0.2.1. Closing the issue. Thanks @snoyer!

gumyr avatar Oct 11 '24 19:10 gumyr