VertexHandle AddVertex( Vector3 position )

book_4_sparkGenerated
code_blocksInput

Description

Adds a new vertex to the PolygonMesh at the specified position.

Usage

To add a vertex to a PolygonMesh, call the AddVertex method with a Vector3 representing the position where the vertex should be added. The method returns a HalfEdgeMesh.VertexHandle which can be used to reference the newly added vertex in subsequent operations.

Example

// Create a new PolygonMesh instance
PolygonMesh mesh = new PolygonMesh();

// Define the position for the new vertex
Vector3 position = new Vector3(1.0f, 2.0f, 3.0f);

// Add the vertex to the mesh
HalfEdgeMesh.VertexHandle vertexHandle = mesh.AddVertex(position);

// Use the vertex handle for further operations
// For example, adding a face using this vertex