boolean_union produces a non-manifold mesh
See original GitHub issueDescribe the bug, what’s wrong, and what you expected.
boolean_union produces non-manifold meshes, preventing further processing operations.
Steps to reproduce the bug.
import pyvista
sphere_center = (2.4623486548662186, 15.274176120758057, 2.042705088853836)
cone_center = (1.7672341, 16.30967, 1.2092979)
cone_direction = (-0.4634096920490265, 0.6903295516967773, -0.5556047558784485)
cone = pyvista.Cone(center=cone_center, direction=cone_direction, height=3, radius=1, resolution=8).triangulate()
sphere = pyvista.Sphere(center=sphere_center, radius=1).triangulate()
cylinder = pyvista.Cylinder(center=(sphere_center[0], sphere_center[1]/2, sphere_center[2]), direction=(0, 1, 0), radius=0.5, height=sphere_center[1]).triangulate()
result = sphere.boolean_union(cylinder).triangulate().boolean_union(cone).clean()
result.clip_closed_surface((0, 1, 0), (0, 15.274176120758057, 0)) # This fails due to a non-manifold mesh
Saving the result shows that it is, indeed, non-manifold. See the screenshots section.
System Information
--------------------------------------------------------------------------------
Date: Tue Jun 14 12:19:43 2022 BST
OS : Linux
CPU(s) : 24
Machine : x86_64
Architecture : 64bit
Environment : Python
GPU Details : error
Python 3.9.11 (main, Mar 17 2022, 07:20:01) [GCC 11.2.0]
pyvista : 0.34.1
vtk : 9.1.0
numpy : 1.21.5
imageio : 2.19.2
appdirs : 1.4.4
scooby : 0.5.12
matplotlib : 3.5.1
PyQt5 : Version unknown
scipy : 1.7.3
--------------------------------------------------------------------------------
Screenshots
The result of the above code is this non-manifold mesh:
A triangle that should be cut off at the end isn’t, which makes it cut into the interior of the mesh.
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Boolean Union modifier on manifold object produces non ...
Boolean Union modifier on manifold object produces non-manifold object ... A mesh (vertices, edges, faces) can be manifold or non-manifold because that ...
Read more >Boolean Modifier Union produces non manifold edges
I'm working on a sculpted model, that will be 3d printed... the problem is, I had 4 objects (the head, the two eyes,...
Read more >Boolean Union on Structure of Extruded Cubes failed Non ...
yes he was able to select all MeshtoNurb and then BU, in my case i get a boolean union failed and the error...
Read more >Straightforward boolean operations produce non-manifold ...
Boolean operations will sometimes produce non-manifold errors like missing faces, even if all meshes involved are manifold and share no common vertices, ...
Read more >Boolean operation of two stls with internal shape
If you really need such a non manifold mesh you need to do the boolean union and boolean intersection in some other application...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It installs alongside
vtk
from conda-forge (it just links against the VTK libs at compile-time).That’s awesome! Will it be possible to install alongside conda-forge vtk/pyvista, or does vtk itself need a custom re-compile?
Yeah the trade-off CGAL has is you can handle cell/point data however you want but you have to implement it yourself by subclassing
PMP::Corefinement::Default_visitor
. I have an example here for keeping track of which of the two original meshes the corefined face originates from, but I’m not good enough at C++ / too lazy to make it work for all properties in general.Also of interest is this recent arxiv paper; looks like the authors will be releasing the source code when the paper is published.