Hi, community,
I have an idea to modify the loader to directly display point clouds without pulling data from the server. I’ve looked into how the ObjLoader is built, and it seems achievable. Moreover, the official Speckle docs mention that any loader can be built according to the example provided there.
I’ve spent some time testing and searching, and I believe the best approach would be to insert the PCDLoader or PlyLoader from three.js into a custom extended loader from the Speckle package. However, I haven’t achieved any significant results yet.
Could you please help me dive deeper into the logic of building such a PointCloud loader? I’d appreciate it if you could explain what’s going on and outline the most basic and easiest steps to achieve this.
I’ve based my question on this example from the official docs: OBJLoader - StackBlitz
In this example, the .obj model is located locally, and the loader uses it, so I was thinking of build the same loader for a point cloud (ply\pcd\xyz… whatever three.js support).
Do you think this is realistic?
It’s very much realistic. In fact here’s a live example of a minimalist PCD loader for the speckle viewer.
We’re piggybacking on the existing three.js PCD loader for all the actual parsing. The same principle can be applied for all available three.js loaders, pointcloud or otherwise. We’ve intentionally designed the speckle viewer loader system to be loose and flexible to the user’s needs.