Can i use xml3d with stl models?

308 Views Asked by At

I'd really like to use STL models with XML3d. Is there a way to convert back and forth between these formats?

3

There are 3 best solutions below

0
On

You can convert STL files to XML3D using the Blender exporter for instance: https://github.com/ksons/xml3d-blender-exporter

Another option is to write a plug-in for STL files that allow to reference STL files from <mesh> and <data> elements:

<mesh src="foo/bar.stl"/>

This would be very similar to the existing plug-ins for MeshLab/JSON and OpenCTM files:

0
On

We've just released a new converter that uses the Open Asset Import Library to convert many 3D formats (including STL) to XML3D's asset format:

https://github.com/csvurt/assimp2xml3d

It can't convert from XML3D back to other formats, but this might be something we add in the future.

0
On

There is a plug-in for STL file now: https://github.com/xml3d/xml3d-stl-plugin

It allows using STL files as simple as:

<mesh src="../path/to/model.stl"></mesh>