I have done this for implicit surfaces and especially for cylinders and spheres.
Triangulation cylinder with holes
Triangulation sphere with holes
This should be easy to do for a cuboid, as the surface is planar on each side.
However, if you want to insert cylinders into the holes, as with a borehole, it will be a bit more complicated.
It is then similar to the inner geometry.
Inner Geometry (Triangulation)
Example where you can follow the triangulation with the slider: InnerGeometryTHREEi_03
See also
hofk (Klaus Hoffmeister) ยท GitHub