Page 1 of 1

Face adjacency find out

Posted: Fri Oct 16, 2020 2:47 am
by Jack Zheng
Hello,
i'm trying to identify the adjacency between two IBRepFace_DG faces. Is there any API? I was thinking to search all faces in the solid and check same.
Is there better or more efficient way?

Thanks a lot.

Re: Face adjacency find out

Posted: Tue Oct 20, 2020 2:11 am
by Mike Gershon
Hello Jack

i-th neighbor can be accessed via (C#):
IBRepFace_DG face;
IShapeArray_DG edges = face.GetEdges();
IBRepEdge_DG edge = edges.GetAt(i) as IBRepEdge_DG;
IBRepFace_DG faceAdjacent = edge.GetOtherFace(face);

If there is more than one wire and/or you need to be more specific, use:
IBRepEdge_DG edge = face.GetWire(indexWire).GetEdge(i);
IBRepFace_DG faceAdjacent = edge.GetOtherFace(face);

In case of an open surface faceAdjacent can be null.

Good luck

Re: Face adjacency find out

Posted: Wed Oct 21, 2020 2:30 am
by Jack Zheng
Nice.
Thank You, Mike