Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVG vector image to Three.js Shapes?

Tags:

three.js

svg

2d

I want to display a 2D vector map on three.js webgl canvas (with wireframe material). Map is originally from dwg format, would be converted to svg.

But havent find any SVG importers for three.js.

Is there an svg loader/importer? Or some other method of displaying vector maps?

(I tried converting it to a mesh in 3ds max and export to .obj, but it looses some non-closed paths and some objects get triangulated surface, which doesnt look good in wireframe material)

Ideally the map would be imported/converted to shapes and viewable as in here (the middle layer with "pure shapes", no extra vertices etc) http://mrdoob.github.com/three.js/examples/webgl_geometry_shapes.html

thanks!

like image 815
AdvancedTech Avatar asked Feb 14 '13 11:02

AdvancedTech


1 Answers

Try to use "SVGLoader" (http://threejs.org/docs/#Reference/Loaders/SVGLoader), you need to add that feature because it is not in THREE.js r71, so, here it is "https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/SVGLoader.js"

like image 128
Darius Miliauskas Avatar answered Oct 06 '22 00:10

Darius Miliauskas