Three js app to speckle

Hi community,
I’m playing with the idea of having a three js app to create geometry and objects with metadata.
I’d like to transfer these to our speckle server and im currently using a python API using specklepy to receive the threejs JSON, deconstruct it and reconstruct Bases and Meshes using your python SDK ready to send.
I do have the feeling that there might be an easier way to parse threejs geometry and send it directly to the speckle server from the client.
Any ideas on how to go about this?
Thanks!

5 Likes

Sounds interesting! :speckle: :fire:

Are you going to be doing this as an always-on pipeline, or is this a one time migration. If it is the latter then, efficiency may not be the driver.

If the former, perhaps there would be benefit to make this a real-time process whereby your apps deals with ‘native’ Speckle objects in the first place, no migration needed.

If you ‘interrogate’ a JSON Speckle object that you receive from the server, the method to create the same from your threejs generated objects should be clearer. If you take a look in the viewer repo for how the process is done in reverse via the the relationship of SpeckleMesh to (threejs)Mesh

This is only for the creation of Speckle objects that represent your apps geometry, and not into Revit Walls or ArchiCad windows etc.

1 Like