5 lines rna_modifier.c . Adds a 4th enum option for Knife.
1 line DNA_modifier_types.h . Also, for adding 4th option for Knife.
6 lines MOD_boolean.c. Keeping full object and then later deleting faces leaving the cut.
The target object would be a mesh, I’d just want to be able to use a curve (extruded, so it has polygons) as a boolean source.
This is currently possible by converting the curve to mesh, but I’d want that to be non-destructive!
The most computationally intensive parts of newboolean are already multithreaded. It only kicks in for fairly high density meshes, and I probably have some tuning to do on the multithreading parameters to find the sweet spot. The old boolean also has multithreading in the part that discovers initial potential overlaps of triangles.
Here, you see an extruded curve acting as a boolean (difference) on a cube, while also being used in an array and curve modifier on the cylinder. This way, the pillars will always appear around the subtracted pipe!
To achieve this, right now I had to duplicate the curve and convert it to mesh to be able to use it in the boolean modifier. A destructive process, that means whenever the spline changes, I have to repeat all these steps
Having the Boolean modifier do this on the fly when an input is a curve shouldn’t be too hard. My first priority it is to get existing functionality to work really well, but after that, I might look into this.
That’s great to hear! From a layman’s perspective, that mesh data seems like it already has to exist somewhere, so I’m hoping it’s a relatively easy process.
This is something I find myself wanting to do a lot (the example up there could be used to create a canal for instance, or a panel seam with rivets, or a street!)
How many threads does it use? I created a pretty complex mesh that’s taking over a minute to do the boolean operation calculation. It seems to be using one thread for blender main process and spawns one extra thread during the boolean operation. It seems to be only using 1 extra thread.
I see the challenge on determining how many threads to spawn… no use spawning lots of threads for a simple object…
I’m using a 24 core Ryzen - would be really nice to see all threads maxed out during the boolean calculation Maybe some sort of ratio for number of triangles in object to number of cores available? so it uses only one core for simple meshes and lots of cores for complex meshes?
It is supposed to use all the available cores/threads, if the number of tasks is above a certain threshold (which I have set to 100 right now). A task is: finding the exact intersection between two triangles that are already known to possibly intersect by bounding box tests. (Also there are two other parallelized groups of work, but I am just giving you the idea here.) There is a kind of automatic chunking of tasks that I haven’t looked into to see if it is doing the right thing. It sounds like it isn’t. It is tunable with parameters i can set. I will look into this. I also have a 24 core Ryzen that I want to see maxed out!
P.S., If the mesh you created is not completely closed volumes then another part of the code kicks in that can be pretty slow. I only recently added that and have not optimized or parallelized it.