Is there a template to develop new importers?
I am working to an importer/converter for the ancient format .VST for VISTA software; how could I add it to Online3dViewer, once ready? Is there a template to start from, or a tutorial?
I started with VisualBasic but now I am porting to JS.
There are two components here:
- Your importer in a separate repository.
- You should make it available as a node.js package with a browser-ready bundle.
- The best way is to make it able to generate a three.js compatible json file, so you can use the
ConvertThreeGeometryToMeshfunction when implementing the importer in the viewer.
- The importer in Online 3D Viewer:
- See this document for details: https://github.com/kovacsv/Online3DViewer/wiki/Implement-a-New-Importer.
- It should reference your importer with the
LoadExternalLibrarycall. - The result json can be easily converted to the internal model format.
Further readings:
- Architectural documentation: https://github.com/kovacsv/Online3DViewer/wiki/Architectural-Documentation
- Rhino importer for reference: https://github.com/kovacsv/Online3DViewer/blob/master/source/engine/import/importer3dm.js
Unfortunately I am not a node.js programmer, isn't it possible to add a pure-javascript (browser-side) converter?
You can implement your own importer as a pure js library, and if it's ready I'm happy to help with the integration.
I am just at the beginning, I'll keep you informed. What should it return? An array of vertex? An object?
The easiest is if you use this format: https://github.com/mrdoob/three.js/wiki/JSON-Geometry-format-4