I tried trim_with_solid
method to drill a hole into a 3D model:
igl::copyleft::cgal::trim_with_solid(m_VA, m_FA, m_VB, m_FB, m_V, m_F, m_D, m_J);
But for hollowed 3D models with inner and outer walls, the hole is not closed:
As posted here, a possible solution might be to use CSG operations of:
igl::copyleft::cgal::mesh_boolean
// or
igl::copyleft::cgal::CSGTree
However, the CSG operations need the input meshes to be manifold.
I couldn't figure out if libigl has any tool to make a mesh manifold. Is there such a tool? Is there any other library which might help?
Eventually, I implemented the hole drilling feature by this Go package: https://github.com/reactivego/csg
Along with some tricks to make it fast:
It's assumed that the user usually creates holes for the flat/simple regions on the 3D model surface. So, these flat/simple regions are less likely to have faulty triangles. Accordingly, the following workaround might be proposed:
20%
.
The above workaround was great. The hole drilling is fast and reliable.