Page 1 of 1
Navigating adjacent faces
Posted: Tue Nov 26, 2024 2:33 am
by Kersten Nielsen
Hi,
I need to do computations on a shell of a solid by stepping over its faces. Is there a way to get the adjacent face when a point is close to an edge?
Thank you very much for any answer!
Kersten
Re: Navigating adjacent faces
Posted: Wed Feb 19, 2025 4:14 am
by Mike Zubovic
Hello Kersten.
Sorry for the late answer.
I assume the point is 3D. If not (it is a uv point), it is easy to get from the face's surface.
There are two problems:
1. Find the nearest edge and the nearest point on it.
One way to do it is to search geometrically: Loop through the wires and the edges. For each edge get its 3D curve (IBRepEdge_DG.GetCurve()).
ICurve_DG.GetNearestPoint() returns the nearest point and the distance. Select the edge with the smallest distance. This solves the first problem.
2. For an edge the opposite face can be obtained with IBRepEdge_DG.GetOtherFace(theInitialFace)
Regards