discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

svg import

RW
Raymond West
Sat, Mar 26, 2022 12:24 PM

Hi,

I've ben experimenting with svg file import. It seems that openscad does
not render svg text.

e.g.

<svg xmlns = "http://www.w3.org/2000/svg" > <style>.small{ font: 12px sans-serif; fill: black; }</style> <text x = "212.000" y = "173.000" class = "small">not in openscad</text> </svg>

displays fine in a browser, or image viewer, but not in openscad. Is
there any simple way around this, or any other 'gotchas' with openscad
and svg

Thanks

Ray

Hi, I've ben experimenting with svg file import. It seems that openscad does not render svg text. e.g. <svg xmlns = "http://www.w3.org/2000/svg" > <style>.small{ font: 12px sans-serif; fill: black; }</style> <text x = "212.000" y = "173.000" class = "small">not in openscad</text> </svg> displays fine in a browser, or image viewer, but not in openscad. Is there any simple way around this, or any other 'gotchas' with openscad and svg Thanks Ray
TP
Torsten Paul
Sat, Mar 26, 2022 12:38 PM

On 26.03.22 13:24, Raymond West wrote:

I've ben experimenting with svg file import. It seems that
openscad does not render svg text.

Yes, correct, as documented in the manual:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/SVG_Import#Limitations

And also as written there, there will never be a perfect
import, simply because the format supports raster graphic
features that are impossible to translate to geometry. It
even includes JavaScript support for animation and other
things.

For text, the workaround can be to convert the text to a
path in Inkscape (I suppose other tools support that too)

That said, text support is possible but quite complicated
due to the full SVG text specification being very strange.
I started implementing this, if it will ever be finished, I
don't know.

ciao,
Torsten.

On 26.03.22 13:24, Raymond West wrote: > I've ben experimenting with svg file import. It seems that > openscad does not render svg text. > Yes, correct, as documented in the manual: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/SVG_Import#Limitations And also as written there, there will *never* be a perfect import, simply because the format supports raster graphic features that are impossible to translate to geometry. It even includes JavaScript support for animation and other things. For text, the workaround can be to convert the text to a path in Inkscape (I suppose other tools support that too) That said, text support is possible but quite complicated due to the full SVG text specification being very strange. I started implementing this, if it will ever be finished, I don't know. ciao, Torsten.