remove inside information when merging two 3d objects

513 views Asked by At

Hi i'm currently working on a project where we have to combine multiple 3d objects. So for example place them next to each other and some times they also intersect.

I'm looking for an algorithm/library or any idea that would reduce this new merged object to only consist of the outside faces. (Our 3d objects currently are .stl files but we are not bound to this format)

We've tried combining these objects with numpy-stl but it seems like this library does not have any optimisation that would help with this problem. We also tried using the boolean merge from pymesh but this takes very much time with detailed objects.

We want to loose all information that is inside the object and only keep the information that is outside. So for example if you would put this combined 3d object in water, we only want the faces that would be touched by the water.

We prefer python but any algorythm that could be implemented in python would bring us forward.

We appreciate every answer :)

1

There are 1 answers

10
A.Comer On

LibIGL appears to have Python bindings. I would suggest thresholding the ambient occlusion of each facet. For example, maybe delete all facets with an occlusion value higher than 0.8

https://libigl.github.io/libigl-python-bindings/igl_docs/#ambient_occlusion

The inputs to this function are the vertices, the facet indexing into the vertices, the position of the facet centroids, and the normals for each facet. The output is the ambient occlusion for each facet, which is a value between 0 and 1. A value of 0 means the facet is fully visible, and a value of 1 means it is completely shadowed.