Re:3D Wireframes Using SVG
by th0ma5 on Monday July 08, 2019 @04:36PM
(#20386510)
Anyone know of something that vectorizes STLs or OBJs into a 2D perhaps ortho perspective?
[ Parent
| on HN ]
The `Lightness' subproject under LumberSharp does (among many other things) this: https://github.com/daeken/LumberSharp
I built this out to translate 3d models or signed distance fields to SVGs for pen plotting purposes. You can see an example here, generated from a few lines of distance field code: https://scontent-atl3-1.cdninstagram.com/vp/9212f4c15cf30583...
And another generated from an STL I generated with OpenSCAD (part of an Egg sculpture series I did for 3d printing): https://scontent-atl3-1.cdninstagram.com/vp/d3fdf208c687551a...
When I did 3D printing, I racked my brain how to render STL files to SVG. Blender (can import STL and) seems to be able to render to SVG with a plugin (https://blender.stackexchange.com/questions/23661/render-3d-...) but I was never so happy about the results. This small Python code is really so much better!
You don't actually need a plugin -- Blender comes with this feature built-in. It's called "Freestyle" rendering.
https://docs.blender.org/manual/en/latest/render/freestyle/i...
Maybe you can do this with gl2ps [1]. You can read the STL file with python-occ [2] and then export it to vector format (it uses gl2ps for this).