I would like to use SVG directly in my OpenSCAD model by generating the SVG string/code, because several components are more easily expressed in SVG than using the objects available in OpenSCAD (specifically paths that involve curves). I am aware that SVG files can be imported, however, this does not allow me to generate the code, which is one of the main requirements for my models. Is there any good way to do this?
Nathan Sokalski
njsokalski@hotmail.commailto:njsokalski@hotmail.com
On 9/27/2023 6:52 PM, Nathan Sokalski wrote:
I would like to use SVG directly in my OpenSCAD model by generating
the SVG string/code, because several components are more easily
expressed in SVG than using the objects available in OpenSCAD
(specifically paths that involve curves). I am aware that SVG files
can be imported, however, this does not allow me to generate the code,
which is one of the main requirements for my models. Is there any good
way to do this?
First, note that SVG can represent shapes that OpenSCAD can't handle.
OpenSCAD only works in 2D and 3D closed figures, while SVG can represent
things like line segments.
Second... well, sort of. There are libraries that can do stuff that is
sort of SVG-like.
https://github.com/BelfrySCAD/BOSL2/wiki/drawing.scad
... especially the turtle() function.
Have a look at pathbuilder listed at https://openscad.org/libraries.html
ciao,
Torsten.