bool MergeEdges( HalfEdgeHandle hEdgeA, HalfEdgeHandle hEdgeB, HalfEdgeMesh.HalfEdgeHandle& hOutNewEdge )

book_4_sparkGenerated
code_blocksInput

Description

The MergeEdges method attempts to merge two specified half-edges within a polygon mesh. If successful, it outputs a new half-edge handle representing the merged edge.

Usage

To use the MergeEdges method, provide two half-edge handles that you wish to merge. The method will attempt to merge these edges and, if successful, will output a new half-edge handle representing the merged edge.

Parameters:

  • hEdgeA: The first half-edge handle to merge.
  • hEdgeB: The second half-edge handle to merge.
  • hOutNewEdge: An output parameter that will hold the handle of the new merged edge if the operation is successful.

Returns: A boolean value indicating whether the merge operation was successful.

Example

// Example of using MergeEdges
PolygonMesh mesh = new PolygonMesh();
HalfEdgeMesh.HalfEdgeHandle edgeA = ...; // Obtain a valid half-edge handle
HalfEdgeMesh.HalfEdgeHandle edgeB = ...; // Obtain another valid half-edge handle
HalfEdgeMesh.HalfEdgeHandle newEdge;

bool success = mesh.MergeEdges(edgeA, edgeB, out newEdge);

if (success)
{
    // The edges were successfully merged
    // newEdge now represents the merged edge
}
else
{
    // The merge operation failed
}