bool ConnectEdges( IReadOnlyList<HalfEdgeHandle> edges, List<HalfEdgeHandle, &> newEdges )

book_4_sparkGenerated
code_blocksInput

Description

The ConnectEdges method in the PolygonMesh class is used to connect a series of specified edges by adding a vertex at the midpoint of each edge and then connecting these vertices. This operation is useful for creating new geometry by linking existing edges in a mesh.

Usage

To use the ConnectEdges method, you need to provide a list of edges that you want to connect. The method will output a list of new edges that are created as a result of this operation.

Parameters:

  • edges: A read-only list of HalfEdgeMesh.HalfEdgeHandle representing the edges to be connected.
  • newEdges: An output parameter that will contain the list of new HalfEdgeMesh.HalfEdgeHandle created by connecting the edges.

Returns: A Boolean indicating whether the operation was successful.

Example

// Example usage of ConnectEdges method
var polygonMesh = new PolygonMesh();
var edgesToConnect = new List<HalfEdgeMesh.HalfEdgeHandle> { edge1, edge2, edge3 };
var newEdges = new List<HalfEdgeMesh.HalfEdgeHandle>();

bool success = polygonMesh.ConnectEdges(edgesToConnect, out newEdges);

if (success)
{
    // The edges were successfully connected
    // newEdges now contains the handles to the newly created edges
}
else
{
    // The operation failed
}