# Matching two solids

I'm trying to use OCC to build 3D models that will be meshed and then simulated in a thermal solver. The program is building some solids (each solid having an associated material -- e.g. copper, aluminum, insulator, etc.); then, common faces are extracted and these solids are good for meshing. The problem is that the solids are destructed and then rebuilt from shells with common faces, so the association with materials is lost. I'm looking for a way to match the initial solids with the reconstructed ones -- they are the same except that their shells have been replaced.

Is there some method that takes two solids and checks whether they are the same (i.e. occupy the same volume in space -- not that they point to the same shape)?

Since these solids are not overlapping, I was thinking to associate with each solid a point that's known to be inside; then, for the reconstructed solids I can see which of these points is within which solid and figure out the mapping. The problem is: what point should I choose? Center of mass does not always work (think of a box with a hole in the middle). Is there some property of a solid that gives me always a point that's inside the solid?

Thanks.

Hello Tiberiu,

I believe you can compare solids by their volume & inertia matrix -- they characterize the shape and should be clearly different in different solids, though very close in similar ones.

Andrey

Hi Andrey,

thank you very much for the idea. I'll have to run some tests and see. It's very likely that I'll have solids that are very similar in volume (think, for example, capacitors on a board, a lot of them look the same). However, they are placed in different parts of the board -- does that mean that their moment of inertia is different? It might be the case that I'll need to use center of mass to, since moment of inertia is in reference to the center of mass (I believe).

Thanks.