Mesh intersections script. Clean results. NO PATCHING NEEDED

The title has been misleading. I was refering to ‘intersection’ as the point where things meet in space, not as ‘intersection’ in set theory, sorry.

The reason I released this script in such immature state was that I wanted to show that a clean quad mesh is possible in a boolean tool, rather than all that garbage that the old Blender boolean tool does. Thanks to a simple face filler, quads are created whenever possible and triangles only when necessary. You don’t have to patch or recompile Blender to make this script work.

For now put your meshes in only one object, not in two, you will not get any results if you select two objects. Use only simple objects just to see the great low-polygon results!!

I didn’t conceive it as a modeling tool, I was actually prototyping a generic tool to help create objects any using basic descriptions and random attributes. But then adding detail requires intersection of volumes, specially if you are carving into your object.

IT IS VERY EXPERIMENTAL, HAS BUGS, RANDOM ERRORS OCCUR. I am not a programmer.
Here you can get it: http://kokcito.freeserverhost.net/cruce.046.4.py

Can’t test it at the moment because am at work and no real internet connection at home. But it sounds very promising, perhaps if all the current works on better Booleans could me merged (either by python, by plugin or by hardcoding).

Hope to read more about this soon :slight_smile:

Yay! Looking forward to trying this one out when I get home.
However, I think this is actually union rather than intersection.

Don’t suppose you intend to extend this into difference?
Sorry - being greedy.

Caleb

the url does not work…

any chance of a join/union script? that would produce clean quadmeshes?

I guess the thread title is confusing, I was refering to intersections as the point where things meet, collide or converge in space, not about intersection like in a Venn’s diagram.

It looks like your approach is similiar to mine. I separate faces and edges, then find the intersections, whereas you use the faces to find intersections with other face’s edges. That’s more work for your intersection detection loop as it will find stuff twice, but on the other hand I think it makes it more easy to build the new edges. (avoiding a case I have of four nested loops that I am trying to reduce somehow) The math used is a little different… your intersection detection I think may be a little more efficient since you detect if it is inside the mesh rect/triangle early on by handling things one axis at a time. (though to me to, just on intuition, it seems that shouldn’t work…maybe I’ll have to think about it more) Otherwise the only significant difference I guess is that I keep track of what is inside and outside to do the actual boolean part.

Interesting…filling was not a priority for me. Like you mentioned, it gets complicated when you introduce shapes with holes in them and such. Though your filling is better it seems than mine. I’ll have to look into what you are doing, as maybe I can work with it. Unfortunately your function names aren’t all that descriptive to me, and I can’t read the comments. Could you maybe elaborate on it?

Basically my filling is:

If there are holes, pass it on to blender’s intenal fill function.
If not, use mine.
Find which verticies are part of the inside or outside (in all cases, these would be the cut up edges of the original face), and make another set of verticies on edges shared by inside and outside parts. (new edges cut into the face from the intersecting object)
These separate lists are no encourage it to make it so that when all the intersection points are select, no actual faces should be selected. The goal is to make the mesh more manageable for modelling afterwards using extrusions and such. This way either the outside or inside parts of the new mesh can be cleanly selected.
The face is subdivided by connecting one vertex from one set to a vertex of the other set, making sure that the subdivision is valid (doesn’t go outside the new face). It tries to make the subdivision where two verticies are closest together. This is in an attempt to produce cleaner meshes by avoiding creating an edge for two verticies that are far appart and then needing to have a bunch of little edges cramed into a small space because they can’t cross the big edge added earlier. (If there is anything wrong with that logic, let me know)

Then the function calls itself recusively on the two subdivided parts. If it can create two sets of edges that are inside/outside and both, it just uses all edges. If it hits a list of 3 verticies or 4 convex verticies, it stops and makes a face.