SVG to CadQuery - Error closing when Arc is present

26 views
Skip to first unread message

Diego Aguilera

unread,
Aug 20, 2024, 4:51:38 PM8/20/24
to CadQuery
Hello,
I'm trying to expand on Dov started to translate SVGs to 3D files.
https://groups.google.com/g/cadquery/c/AQCm40ong9c/m/SbisvrOvAwAJ

Bezier Curves and Lines work fine. Arcs are more difficult because the SVG parameters are different than those needed for CadQuery (Ellipse Arc).

I have seen some issues with Dov's code and have tried implementing different libraries to aid in the conversion. All three generally give the same values.

Any SVG without an arc translates into 3D without any errors.

A simple SVG with an arc (arc.svg) works fine with any of the translation methods (Dov, svgpathtool, or svg.path).

Any "complex" SVG (noun-pig-3851380.svg) always fails when closing the path.

Can you provide any guidance on what this error message means? I assumed it's was a gap in the wire, but looking at the "last EndPoint" and "Start", they always match. See below.


Paths Found: 8 
Path Index: 0 
path is continuous? False 
Start Path 
Setting path_start 
Arc 1 - Last EndPoint: None - Start: (364+293j) - End: (372.36+295.68j) 
Arc 2 - Last EndPoint: (372.36+295.68j) - Start: (372.36+295.68j) - End: (377.68+294.82j) 
Arc 3 - Last EndPoint: (377.68+294.82j) - Start: (377.68+294.82j) - End: (394.47+272.44j) 
Cubic Bezier - Last EndPoint: (394.47+272.44j) - Start: (394.47+272.44j) - End: (388.91+259.81j) 
Cubic Bezier - Last EndPoint: (388.91+259.81j) - Start: (388.91+259.81j) - End: (363.49+266.68j) 
Cubic Bezier - Last EndPoint: (363.49+266.68j) - Start: (363.49+266.68j) - End: (364+293j) 
Closing - End Point: (364+293j) - startPoint:(364+293j)

Screenshot from 2024-08-20 16-48-33.png



Reply all
Reply to author
Forward
0 new messages