Seeking Assistance with 3D Helix Mesh Configurations and Performance Issues

Hello everyone,
I’m currently working on a project for a leading power transmission and material handling company. We have an internal web-based configurator that we use to design our components. One of my tasks is to provide real-time 3D visualizations of these components as they are being configured. This way, our team can have a clear understanding of what the final configuration will look like.

However, I’ve encountered a couple of challenges that I’m hoping to get some insights on:

  1. Mesh Cutouts: I’ve been working on a helix mesh (for which I’ve previously received some excellent help from this community - thank you!). The current challenge is creating what we refer to as an “integral ribbon flight”, which involves making cutouts on the mesh. I’ve been trying to use a CSG operation for this, but the cutouts aren’t being subtracted correctly. Interestingly, when I reverse the helix to make it a left-hand (counter-clockwise) configuration, the operation seems to work better, but it’s still not perfect.

  2. Performance: The second issue is related to the speed of the operation. The current process is too slow for my end goal, which involves modeling an entire conveyor that could potentially include multiple meshes along with many other components.

I’m hoping to get some insights on what might be causing these issues. Specifically, I’m looking for ways to improve the cutout operation and enhance the overall performance of the modeling process.
Any suggestions or guidance would be greatly appreciated. Thank you in advance for your assistance.

Hey! Unfortunately, CSG is really rudimentary for now. We do not have a good way to apply booleans and this is a place that I would love to improve in the future.

For your performance question, this is mostly an algorithm question. How can you optimize your code?

Completely crazy idea: can you run a headless Blender server to generate the object so Babylon will render it but the generation happens in the cloud

So I did a bit of a deep dive and as you can see the code is quite heavy on the CPU:

My first recommendation would be to try to optimize the hell out of the process as I believe this is maybe not well optimized (yet ;))

Unfortunately, I don’t believe that’s an option at this time. We already have servers for our CAD integration, and for me to ask for another one to 3D render objects as a “preview” would be quite the uphill battle. We also don’t currently have a seat of blender that I’m aware of.

Generating the helix itself is quite fast, from what I’ve seen everything is fast until the CSG.subtract() method. By optimizing, are you referring to how I am generating the Helix and that could be done in a way that is easier for the CSG subtract operation? If so, if there further documentation somewhere on how to best setup for success with those CSG union/subtract operations?

Oh I see! I thought the perf problem was on the Helix, CSG is not something you can optimize besides making it works on smaller meshes but I bet this is not an option here.

Do you mind sharing what are the cutouts you need? (like before / after)
Trying to think about a smart way to get them without CSG (but not a lot of hope)

Here you go! This is out of our CAD system, but gives you the visual. This is what we call an Integral Ribbon Flight. The other 2 types of cutouts on these are a “Cut” flight, and a “Cut and Fold” flight. The Cut and Fold is probably the most complicated of the 3, but the Integral Ribbon is where I started on the weird ones.


Ok random idea: we do the cut on the first loop and then we duplicate / merge
so CSG will happen only once on a tiny portion

Like on the first rotation of the helix?

Do you mean only create 1rotation of the helix, then cutout, duplicate and merge?

Or

Do you mean only cut out 1 spiral of the helix at a time, and duplicate and merge the cutouts?

Or

Door #3 and I’m way off, haha!

I think option 2. What we want is to reduce the number of subtract and to reduce the number of faces for csg

Is using an external lib an option? There may exist some javascript library specifically designed for CSG operations (like GitHub - jscad/OpenJSCAD.org: JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.), that will likely be faster than our implementation.

1 Like

CSG is indeed very old and unoptimized code. If you want to contribute and try and implement it in a better way, let me know, I may be able to help.

1 Like

I wouldn’t even know where to begin on improving the CSG code unfortuantely.

Hi, just an idea reading the topic, maybe you could create 1 rotation of the helix, then cutout, and after that you don’t need to duplicate/merge you could create Instances.

And maybe for the cutout a custom parametric shape would be more performant than CSG.

I tried cutting out a single helix. That seems to be similarly slow to compute, I didn’t even try to replicate it down the length of the helix. It seems that subtracting a mesh across the helix “in general” is very difficult for it, and doesn’t do it properly even when it finishes.