Differences between repairMesh on assembly level and on part level

We have issues with many big exterior parts being badly oriented after import in Studio and SDK (import of Creo View data) and I tried an alternative, instead of running


pxz.algo.repairMesh([root], 0.1, True, True)`

I tried to process each part separately

partoccs = pxz.scene.getPartOccurrences(root)
pxz.algo.repairMesh(partoccs, 0.1, True, True)

and it resulted in visibly a much better result, there are still some badly oriented parts/polygons but generally on smaller parts - any explanation for the differences in these approaches?

Also, is there any way to identify parts with bad orientation using the SDK so they can be processed separately like this case? Typical case is that we have surface parts that might need to be duplicated/moved to ensure both a front face and a back face.

Hello, there is no difference in the two approaches: internally Algo::RepairMesh calls GetPartOccurrences. It probably resulted in a better result by chance. If the model has no clear dominant orientation it could produce different results in different calls due to lack of determinism.

I suggest you have a look to other orientation algorithms and check if one is better suited to your model?

1 Like

Faces orientation is a subjective concept. The RepairMesh is trying to orient the faces “outside”, but depending on the topology of the model, the result can vary.
The function algo.orientPolygonFacesAdvanced given above uses the same mechanism as Remove Occluded Geometries, you should have a look! Basically cameras are scattered around (or inside) the models to give the faces orientation algorithm a hint on the final faces direction. You should give it a try!