4

I'm trying to figure out the surface area of a mesh that is the result of various CSG union operations between an arbitrary number of other meshes by summing up the same property of each one of it's faces (triangles, in this case) but the result is far greater than expected. I believe that this is happening because the mesh that results from the CSG union operations have internal faces, but I'm trying to find only the surface area of it's exterior.

Is there any technique to remove the inner faces of a triangulated mesh, or maybe some way to just ignore these ones while calculating it's surface area?

Currently I'm using Net3dBool to perform the CSG operations. The code that performs the intersection is on the file BooleanModeller.cs, on the getIntersection method, wich calls the composeSolid method.

  • 1
    If your Constructive Solid Geometry method allows intersection as well as union, then you can use this to find the internal area, and subtract that from the total to give the external area. Would that make a useful answer? – trichoplax is on Codidact now Jun 07 '17 at 15:01
  • 1
    This would depend on all the initial meshes having no internal triangles. If you can guarantee this then the method will work. For example, a hollow ball constructed from two concentric spheres would not give correct results when intersected with another sphere. However, if the construction is using only unions, then intersections can be used to subtract the area of the internal triangles. – trichoplax is on Codidact now Jun 07 '17 at 15:08
  • I think that this could be the answer, but for example, if one of the meshes is inside the other the one that's inside should be completely ignored. Would that be the case? I tried to use intersection as stated and found the same results. – Liordino Neto Jun 07 '17 at 19:50
  • 1
    If your intersection method returns the surface that encloses the volume enclosed by both the first mesh and the second mesh, then the intersection of the two meshes you describe will simply be the entire inner mesh, which is precisely the triangles that you wish to exclude. So it sounds like either your intersection method works differently, or there is a separate problem causing overcounting. Could you include your code so we can analyse it? – trichoplax is on Codidact now Jun 08 '17 at 09:15
  • Sure! Currently I'm using Net3dBool to perform the CSG operations. The code that performs the intersection is on the file BooleanModeller.cs, on the getIntersection method, wich calls the composeSolid method. Thanks! – Liordino Neto Jun 08 '17 at 12:13
  • @trichoplax I think that you're right, and the library that I'm using is computing something wrong on the CSG operations. Just for testing I tried the method powered by Carve used in Blender and it gave the results that I expected, so I'll try to use another library (maybe Carve itself) to do the operations and will answer the question acordingly if it works. Thanks! – Liordino Neto Jun 20 '17 at 13:03
  • Thanks for the update, and a self answer if it works would be great! – trichoplax is on Codidact now Jun 20 '17 at 18:38

0 Answers0