bool BridgeEdges( HalfEdgeHandle hEdgeA, HalfEdgeHandle hEdgeB, HalfEdgeMesh.FaceHandle& hOutNewFace )

book_4_sparkGenerated
code_blocksInput

Description

The BridgeEdges method in the PolygonMesh class is used to create a face that connects two specified edges. This operation is only valid if both edges are open and belong to different faces. The method returns a boolean indicating whether the operation was successful, and outputs a handle to the newly created face.

Usage

To use the BridgeEdges method, you need to provide two half-edge handles that you want to connect. Ensure that these edges are open and belong to different faces. The method will output a handle to the new face created by bridging these edges.

Example

// Example usage of BridgeEdges method
HalfEdgeMesh.HalfEdgeHandle edgeA = ...; // Obtain a handle to the first open edge
HalfEdgeMesh.HalfEdgeHandle edgeB = ...; // Obtain a handle to the second open edge
HalfEdgeMesh.FaceHandle newFace;

PolygonMesh mesh = new PolygonMesh();
bool success = mesh.BridgeEdges(edgeA, edgeB, out newFace);

if (success)
{
    // The edges were successfully bridged, and newFace is the handle to the new face
}
else
{
    // The operation failed, possibly because the edges were not open or belonged to the same face
}