Boolean Improvements

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

@wevon I tried your earlier file on my latest code. It crashed in a Debug build, but may have produced garbage in Release mode. After I fixed that, I was not able to reproduce the problem shown in your earlier video.

I’ll upload the fix to that crash and rebuild the binaries now.

8 Likes

I read on blender-code chat channel you build your boolean branch some minute ago, i test it and find one first problem, subdivided monkey in difference with beveled cube have expected result in fast mode but wrong (IMO) in Exact mode. Below my zipped .blend file

HowardTrickey_newboolean_difference_0659560a101b-N01.zip.xml (158.3 KB) (delete .xml extension to have proper file)

I find that Intersect and Union feature are swapped in Exact over Fast mode and Union in Exact make difference from target object over boolean object (cube = target object, monkey = boolean object)

I am sorry if this is wrong place to make this report, if so, i want be redirect in proper place

Thanks for the file and report. I will look into this. Much appreciated.

The monkey is not a closed volume object and I only recently added code to handle that case, and it hasn’t had much testing yet.

To others reading the thread: I am very close to merging this to master (for 2.91 alpha). It would be nice to find any remaining big problems before I do that.

11 Likes

Some good news / bad news.

Good news is that it seems fine for a small set of examples I tested locally, including the animtest I posted a bit ago.

I also took another look at https://developer.blender.org/T79873. All of the “array” variations work once you switch the existing booleans to Exact mode. When loading the file be sure to rotate the view down so you see the ends of the board planks. The subdivided ones are a bit slow though; not interactive. The “instance” ones are still broken but I’m not sure if instances are supposed to work.

Bad news is that the newboolean branch cannot open the 2.78 demo file – free from blender cloud [link]. It’s a pretty large test of modifiers in general including boolean. It’s sitting there spinning on the CPU for >4 minutes now without opening (~33% usage of 12 cores). This is somewhat unexpected since the Booleans should be defaulted to “Fast” mode; perhaps something else is amiss.

1 Like

It is supposed to default to using non-exact if opening a file of modifiers pre this version. I was kind of hoping that I didn’t have to do a “do_versions” (the internal code mechanism for ensuring this) but it looks like I do. Thanks for the heads up. As to why it is so slow, I suspect it might have non-manifold/non-closed volumes in it, which uses a code path that can be very slow in certain circumstances.

1 Like

I fixed the problem with loading that old file (“fixed” meaning it will load with “Fast” mode, not “Exact” mode for booleans; there’s an actual assert failure when loading it with Exact, which I will look into). I haven’t fixed any other bugs since the last builds.

I have now merged newboolean into master, so future updates will take place there.

20 Likes

what’s happening here? same problem as the previous version?

1 Like

Unless you are able to build Blender yourself, there is no official way to test this stuff. The Blender builder page hasn’t updated since the 25th of August and Howard just committed the patch over a day ago.

The MacOS and Linux 2.91 builds were updated yesterday at https://builder.blender.org/download/

The Windows one has indeed not been updated since Aug 25. There’s a failing importer test and the maintainer for that is on vacation. I believe the policy now is not to update the nightly builds on that website if there are failing tests, but am not positive about that.

Update: apparently the tests have been fixed, but someone has to kick the builders into life again.

6 Likes

The Windows builder was brought up again, so now there are fresh builds available at the daily build download site. The latest builds have some speed improvements I did over the weekend.

6 Likes

are these new changes inside the 2.91 or the newboolean branch ? which one shall we test?

I think blender has some problem with auto smooth normals especially when using subdivision surfaces and edge creasing, you can also see this clearly when using the boolean modifier. I don’t know if this has been fixed in the new version of the modifier. Perhaps the auto smooth normals need to be fixed first?

I think they are in 2.91 https://builder.blender.org/download/

Yes, confirming that set9 is correct. Please test the 2.91 alpha builds from now on.

2 Likes

newboolean cant removing Intersecting geometry (on gif blender 2.77 vs 2.91. On 2.77 - comes out one-piece mesh. On 2.91 - nothing)
Boolean_Carve
But its function very need for modeling and 3d printing. If its impossible with new algorithm - maybe create new modifier for only remove Intersecting geometry on old Carve?

The problem is that the Boolean modifier (and tool) by default does not do self-intersection on each “side” of the Boolean - just intersections between one side and the other.

The new algorithm does in fact do what you want; I just have to expose the UI option to consider self intersections. I intend to do this before the 2.91 release.

You can see what the new algorithm does using the Face > Intersect (Boolean) tool. Join all your cubes into one object, then in Edit mode select everything, the use that tool. In the Redo panel, tick the “self” box. (No need to intersect with a box; just doing any Boolean operation on the whole mesh, with self ticked, will do self-intersections and remove the “inside” stuff. Make sure the normals are all in the right direction.)

7 Likes

wow) its work) dreams come true). But there are still difficulties - sometimes some edges (or faces, i dont know) are not cut.