Are there MATLAB functions or scripts to perform boolean operations on triangulated solids?

21 views (last 30 days)
It is a very specific question. There is no need for more details.

Answers (2)

Matt J
Matt J about 1 hour ago
Edited: Matt J about 1 hour ago
If you mean you want to take intersections and unions of meshes, then no, there are no MathWorks-authored commands to do that. However, there are FEX files that let you convert a mesh to a binary volume and back, e.g.,
so you might be able to do it by transfering to the binary image domain if you can tolerate some discretization error.
  1 Comment
Jahir Pabon
Jahir Pabon 8 minutes ago
Thank you Matt. What you propose, though a bit cumbersome, sounds like a possible alternative. I would like to preserve the simplicity of the original triangulations. But if there is nothing else in the Matlab world I will give that a try.

Sign in to comment.


John D'Errico
John D'Errico 14 minutes ago
Are there such codes in MATLAB? Yes. I wrote them. intersect, union. In 2-d and in 3-d. (Not sure if I wrote a setdiff variant. Probably not, as the problem I was working on would not need them.) Are they publically available? No. Sorry. The codes belong to my client. I'm not sure they are still in use, but I don't own them.
You want them to retain the original "simplicity" of the triangulations? Sorry, but no. The result tends to get quite complicated near the boundaries.
Could you write something? They were not that terrible to implement. Kind of slow if the tessellations were large, but that always happens. You can start with these operations on a pair of tetrahedra.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!