Weird faces after Boolean modifier

I’m having a weird face issue when using a Boolean modifier to cut out holes in a cube. I say “weird face” because the face doesn’t seem to actually have edges and is not selectable but is visible.

I wrote some sample code to recreate this behavior. It repeatedly cuts out multiple square holes from a larger cube using the Boolean modifier as a Difference operation. The problem doesn’t happen every time. If I manually apply the Boolean modifiers instead of programmatically, I do not seem to get the problem. So the problem only presents itself to me when done through code.

I know the weird face will be less likely to happen if I subdivide the big cube first but I don’t want to do that. Using Limited Dissolve with an angle of 1 degree sometimes solves the problem but not always, even when I increase the angle. Recalculating normals never fixes the problem.

So what is this weird face with no edges?
Is there a way to solve this problem (programmatically) that doesn’t involve subdividing the big cube?

Below is example code written as a plugin and a blend file with the problematic object. I was able to reproduce the problem (randomly) when Number of X = 3 and Number of Z = 3, though it can also show up at other values. I’m on Windows 7, using Blender 2.75a.

Python script: https://www.dropbox.com/s/gwlpqrqoybaq0rh/bugTestScript.zip?dl=0
Blend file: http://www.pasteall.org/blend/37834




Try triangulating the faces. There are many convex polygons that make that strange unselectable triangles. In fact, the triangle you mention is in fact a quad that connects the 3 vertices of the hole with a vertex on the corner of the box.
Even then, the triangulation may triangulate the wrong way, and I don’t know a way to programmatically detect and correct that (although it’s correctable manually).

Or just add triangulate modifier.

I should have said this in the original post:
I have already tried several things that add more verts and faces (on both the main object and the one to remove) such as subdivide, triangulate, and loop cut and slide. However, these methods do not solve the problem. They simply make it more difficult to recreate, find, and fix since there are many more unneeded verts/faces. These smaller faces will still create improper faces just as the original larger ones do (as one might expect the size of the face does not seem to make the problem disappear).

You could also just merge the two vertices at the hole corner



Or select all vertices and X / Limited Dissolve


No need to resort to boolean

Create 6 edge loops on both sides


Extrude the squares



there.

@Richard Marklew
Merging the two vertices is not an option as I want to fix this issue programmatically, not manually.
As I mentioned in my original post, Limited Dissolve does not always work for me. It works for maybe 90% of the time but there are some triangles that refuse to go away using Limited Dissolve, for which I do not have an explanation for.

@fdfxd
My example was only a simplified version of what I want to do. I want to cut out more complicated shapes later, on the outside and in the inside which is why I’m using Boolean operations so edge loops and extrusion won’t work for me.

I’ve gone through the bmesh’s faces and the face with the problem looks correct (vertices in the correct order) so it would seem that the geometry is stored correctly. I think this is a problem internal to Blender when it sends N-gon to the graphics card as it’ll have to convert this N-gon to a quad or tri.

For now, since the geometry looks correct, I think I’m going to ignore the weird face when doing the Boolean operations and fix any face issues at the end when all operations are done.

Hi, guys! I have a different problem related with the boolean modifier.

I want to make a hole in the surfboard that appears ont the photo and when I use the Boolean Difference modifier something extrange happens.

I removed doubles and checked normals, but I can´t solve the issue. First, I add the modifier, I check the option “Difference” and I select the cylinder and, instead of making a hole, a strange shape appears on the surfboard.

Thank you for your help :smiley:

Attachments

Tabla de surf.blend (439 KB)