New Boolean

Like this?

I’m trying to learn C and I needed a knife cut.

You can get this by only changing.

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.

May be a better way to get this though.

3 Likes

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.

3 Likes

exciting - thanks for all your work on newboolean. It really allows blender to do new stuff that was not possible before.

1 Like

I’ll show another image to clarify:


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

2 Likes

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.

8 Likes

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!)

1 Like

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 :grin: 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?

1 Like

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!

3 Likes

It seems that we all have a 24 core ryzen that we want to punish with boolean work :slight_smile:
Had a look at the experimental build. Great work!

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.

2 Likes

Hi Howardt

Please, look at this file , there are 2 coplanar cylinders,
boolean is not working,
I think it should be working.

2 coplanar cylinders.blend (768.2 KB)

Thanks

mornin union testin

3 Likes

I will try to find time soon to look at the problems from jachtarfranko and masterxeon1001. Thanks for testing.

3 Likes

howard btw will be posible to have the boolean modifier visible in edit and cage mode finally?

I put in the change for seeing it in edit mode. I’m not sure if that does cage mode or not. The next builds I put up will let you test.

5 Likes

both are similar, in cage you can see the full wire frame, whereas in edit mode option you see it in object mode with editmode…

From what i understand: what users want is bisect, but as modifier

afaik bisecting is simpler case and thanks to that it could be much faster

i see thet there were attempts in implementing that:
https://developer.blender.org/D6128
https://developer.blender.org/D184

but they were abandoned

1 Like

yes please. it would be awesome to have bmesh.ops for booleans. it’s such a versatile feature.

bm_result = bmesh.ops.boolean(bm_a, bm_b, 'INTERSECT'|'DIFFERENCE'|'UNION')

would be heavenly. also for sverchok.

3 Likes

just wanted to say i waiting boolean modifier to work normaly for many years, super excited about this

THANKS @howardt : )

3 Likes