Export scene as an SVG

Is it possible to export an SVG image of the current scene?

Hello and welcome!

It is possible to export PNG image - Render Scenes To .png Files | Babylon.js Documentation

Then you may convert PNG to SVG with some other library like png-to-svg - npm


that library doesn’t look like it actually converts png to svg.

Even if it did, I have doubts about the quality. I really want decent paths created from the scene.

Say for example this basic scene


It would be great to get paths made from all the edges

cc @labris

a little better


Unfortunately, any raster to vector libraries never gives clean results that you would want in an svg. I just thought that since the scene is drawn using “maths” (to put it simply) it would lend itself well to turning into an svg, which is also made up of mathematical elements (compared to say jpeg)…though I guess not!

Any scene drawn on a canvas will be rasterized, which means it’s not just “lines” anymore when displayed on screen. I guess something that could be done is to export the scene to a GLB and convert into STL which does describe geometry in a “path” format STL files explained | Learn about the STL file format | Adobe, through that will still be 3D.

1 Like