Boolean Improvements

P.S., I am continuing to update the builds at https://builder.blender.org/download/newboolean/

There have been a number of bug fixes since I first posted about the builds.

4 Likes

Concretely, these are bugs reported against the old boolean that are fixed by the new one:

T47011, T46988, T47087, T47108, T54024, T55466, T58814, T61845, T68144

(see https://developer.blender.org/T47030 for a roundup list of these. The remaining unfixed ones are all about cases where the inputs are not closed volumes.)

6 Likes

Hi Howard,

  • A face on one side of the boolean is exactly coplanar with a face on the other side (that is, they are in the same plane and overlap).

I tested this yesterday and it works pretty well but at the same time the performance decreases.

  • An edge on one side of the boolean exactly overlaps or intersects an edge or vertex on the other side.
  • Cases of very small features or very oblique intersections causing the old (floating-point based) code to get confused about the final topology, and thus produce a non-watertight closed volume.
  • It does not yet try at all to handle the case of non-closed-solid input meshes. The old boolean didn’t promise anything in that area, but sometimes works (if one is lucky with the direction of the ray used to decide inside/outside).

I’ve never had these problems with the old boolean system.

Thanks for the hard work. It would be nice to have better performances, especially when working with subD meshes.

Also it would be very useful to add a “BooleanModifier.show_in_editmode” which was mentioned in my previous post and perhaps adding a “bevel after boolean” operation as an extra option to the modifier.

Let me know your thoughts.

I apologize if this has been answered. Will the new Boolean improvements include the ability to create 2D Booleans? That is, the ability to Boolean coplanar 2D objects like a square and a circle?

IMO, this would be a great addition for those who are used to more traditional 2D path and outline workflows, like those who use CAD packages or programs like SketchUp.

I also think it helps new users with their modeling strategies.

Thanks for all the great work, Howard!

3 Likes

@giuseppebufalo I will get back to working on performance when I am closer to certain that the functionality is working perfectly. Right now it is not. I will try to look at the show_in_editmode thing soon, since it is likely to be easy to fix.

@chippwalters You are not the first to ask for this, so it is something I will consider. The code for 2D intersection is there. I would just have to do a 2D inside/outside test and then hook this up to the code. I was thinking: if I detect that all the meshes are in the same plane, then just do a 2D boolean instead. But I need to make sure the 3D boolean is as good as I can make it before adding new functionality like this.

23 Likes

Just because this was mentioned here: I did a Win build with the ‘Booleanmodifier.show_in_editmode’ feature made accessible.

Discuss over here, win build included: Boolean 'show_in_editor' property

Sry for the brief highjack!

3 Likes

Thanks for figuring that out @rbx775!

2 Likes

The patch is quite trivial.
Its basically just a flag in line 397 of MOD_boolean.c :

/* flags */ eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsEditmode,

But I sure stepped through the code like a monkey, because I overlooked it at first. :wink:

3 Likes

There are new builds up at https://builder.blender.org/download/newboolean/ .

  • Fixed a crashing bug
  • Incorporated rbx755’s patch to allow the modifier to be seen in edit mode
  • Put in initial support of having a non-closed-volume operand, so that, for example, using a difference of a plane to cut a plane slice should be possible.

Unfortunately the current Mac build is likely crippled - there is a bug currently in master where you can’t select things in edit mode (or can’t see the selections), and since I had merged in master, I have that bug too. Sorry. When the bug in master is fixed, I’ll put up a new build.

9 Likes

Hi Howard_Trickey,
I have tested this latest build and it works very well for 3D models.
Booleans with flat objects do not work, but it is appreciated that it may end up doing so since the cuts are produced correctly, although the correct face is not always eliminated.
Anyway, I have found an exception, I upload a video for you to see the problem.
Thanks.

3 Likes

Thanks @wevon. I wasn’t intending it to work for the Boolean of two flat objects yet. Maybe in the future.

It would help me find the problem you showed in the video if you could upload the .blend file with those objects in it.

2 Likes

https://drive.google.com/file/d/1c37AIAZ9Rtd3HE2F9rc4130XIU3dvOqZ/view?usp=sharing

Here it is, if there is any permission problem let me know.

1 Like

I need permission. Request sent.

I know performance is still a WIP and may never get back to the level of the old one but would you be interested in a small artificial file I have that shows a difference of 60fps (old) vs. 5fps (new)? Of course the new one is completely correct while the old is broken at certain points in the animation so there’s that :slight_smile:

I just discovered a big performance problem, on a kind of mesh that I didn’t try when doing my first pass performance tuning. I know how to fix it and am doing it now. I would be happy to see your file, though, in case it tickles a different performance problem.

4 Likes

Here is newboolean-animtest.blend - just hit play on the timeline and observe the fps.

Thanks for the file. It is one of the cases that is affected by the performance bug i found, so I hope it will be faster after I fix that.

11 Likes

I really hope that with the new booleans system that some developer will add booleans support to the Add Primitives tool. Would make for a great new workflow that you only get to see in add-ons for Blender. :partying_face:

4 Likes

I improved the performance of cases where dense meshes intersect subdivided planes. In one test case, this made the code run 50 times faster. But in most cases, the improvement is modest. In deadpin’s animation test, the framerate doubled on my machine, but is still 6 times slower than the old BMesh Boolean.

New builds with this change are available on the buildbot page.

17 Likes

Hello Howard_Trickey,

testing today’s version I have seen that my problem persists, although if I create a similar mesh from scratch, the problem disappears, so I would not worry anymore unless more users find something similar.

Anyway, I will give you a new test that I have done, in which I have created a similar typology on the opposite side and at first it is not affected by failure. If I separate and then weld the faces that originally produced the failure, they are fixed but the failure is transferred to the opposite side.

I guess it had to do with the numbering of vertices. I show it to you in case it is recurrent, but as you can see the same geometry structure is sometimes solved well. Maybe my mesh is corrupt, and no one else finds the problem.

Thanks for the attention, I guess you got the file.

3 Likes