ODA Facet Modeler: Split Faces of Bodies

Roman Martens

July 09, 2021

This article contains information on how to split a face of a body.

Sometimes, you have a face of a body that consists of two loops - inner and outer loops. And you might want to split that face into two, so that each of the resulting faces consists of one loop. To perform such an operation, use the splitFace() method:

void Body::splitFace(Face* pFace,
                     const OdGePlane& pPlane,
                     std::vector* pNewOuter = NULL,
                     std::vector* pNewInner = NULL);

This method splits the face of a body by its plane, preserving the original topology.

Example

The cube in the picture below has a hole in the the middle, so the whole body consists of 10 faces.

 

The cube

 

The top face consists of two loops - external and internal loops. All the neighboring faces consist of external loops with four edges.

 

The top face

 

The red plane in the image below is the splitting plane, and the red vector is its normal.

 

the splitting plane

 

After splitting, the body has 11 faces (the original top face is removed, and the new two faces are added). Each the new face has an external loop (green polylines n1-n8 and s1-s8). Edges e4 and e5 are paired with edges n1 and s1 respectively. And the neighboring face consists of one loop with five edges.

 

It's possible to get the resulting faces according to their position relative to the splitting plane.

 

It's possible to get the resulting faces according to their position relative to the splitting plane.

The pNewOuter optional parameter contains the faces pointed to by the plane normal vector (face defined by the n1-n8 loop).

The pNewInner optional parameter contains all faces pointed to by the opposite vector (face defined by the s1-s8 loop).