Hello, I started using Babylon.js for a new project and am impressed how easy it is to get started!
My goal is to create a gcode viewer (files used for 3d printing instructions). The gcode basically contains the path the printer takes and the problem is that these can get really big.
So I created a benchmark file with ~200 000 lines and tested several ways of creating meshes:
- New Tubes for every continuous line. This resulted in 25000 Meshes and less than 5 fps
- Then I tried using a linesystem, which was very fast with 500fps shown in the debug menu, although it is not really usable, because there is no shading on the lines.
- I tried creating 200000 instances of a cylinder, to simulate using manually arranged instances, but this also had less than 5 fps
- Then I tried merging the tube meshes using BABYLON.Mesh.MergeMeshes. This took more than 30 minutes, but resulted in extremly high framerates (~300fps). The loading time is unfortunately prohibitive.
- Then I created one Tube per layer (there were 200 layers), which resulted in good fps, but all the lines that should not be connected were connected to use just one tube.
So the problem is that merging the meshes takes extremely long, but I don’t want all lines to be connected, so I can’t use the tube command for more than one continous line. What I need would be a way to create tubes with missing segments, or maybe hide the extra segments by some other method. I didn’t find anything like this though.
Maybe I’ll try creating a custom version of CreateTube, which allows missing pieces, but as of now I didn’t really understand the inner workings of this method.
I also tried everything in the optimization guide, but everything except merging had no measurable impact.