I am trying to convert .svg file to 3d (.obj file) using javafx.
I can able to convert primitives like Shape - Cylinder, Box etc to Mesh. Is it possible to convert SVGPath to convert to any particular Mesh.
I am trying to convert .svg file to 3d (.obj file) using javafx.
I can able to convert primitives like Shape - Cylinder, Box etc to Mesh. Is it possible to convert SVGPath to convert to any particular Mesh.
Copyright © 2021 Jogjafile Inc.
The open source library FXyz has exactly what you are looking for: a
SVG3DMeshclass that given a 2DSVGPath(or a string with its content) will return a 3D TriangleMesh, extruding the 2D shape to a certain height.Later on you can export that mesh to a obj file.
This is a code snippet of how you can use it:
You can show the mesh:
or show a solid 3D object with the color you want:
For exporting the mesh to obj:
it will generate svg.obj and svg.mtl.