Class Vert
Represents a vertex in the mesh decimation algorithm. Stores vertex data and relationships for edge collapse operations.
Namespace: NWH.DWP2.MeshDecimation
Assembly: NWH.DWP2.dll
Syntax
public class Vert
Constructors
| Edit this page View SourceVert(Vector3, int, bool)
Initializes a new vertex with position, ID, and selection status.
Declaration
public Vert(Vector3 position, int id, bool selected)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | 3D position of the vertex. |
| int | id | Unique identifier. |
| bool | selected | Whether the vertex is selected. |
Fields
| Edit this page View Sourcecollapse
Target vertex for edge collapse operation.
Declaration
public Vert collapse
Field Value
| Type | Description |
|---|---|
| Vert |
cost
Edge collapse cost for this vertex.
Declaration
public float cost
Field Value
| Type | Description |
|---|---|
| float |
deleted
Whether this vertex has been deleted.
Declaration
public bool deleted
Field Value
| Type | Description |
|---|---|
| bool |
face
List of triangles that use this vertex.
Declaration
public List<Tri> face
Field Value
| Type | Description |
|---|---|
| List<Tri> |
id
Unique identifier for this vertex.
Declaration
public int id
Field Value
| Type | Description |
|---|---|
| int |
neighbor
List of neighboring vertices connected by edges.
Declaration
public List<Vert> neighbor
Field Value
| Type | Description |
|---|---|
| List<Vert> |
position
3D position of the vertex.
Declaration
public Vector3 position
Field Value
| Type | Description |
|---|---|
| Vector3 |
selected
Whether this vertex is marked as selected (prevents collapse if locked).
Declaration
public bool selected
Field Value
| Type | Description |
|---|---|
| bool |
Methods
| Edit this page View SourceAddFace(Tri)
Adds a triangle to this vertex's face list.
Declaration
public void AddFace(Tri f)
Parameters
| Type | Name | Description |
|---|---|---|
| Tri | f | Triangle to add. |
AddNeighbor(Vert)
Adds a vertex to the neighbor list if not already present.
Declaration
public void AddNeighbor(Vert v)
Parameters
| Type | Name | Description |
|---|---|---|
| Vert | v | Vertex to add as neighbor. |
IsBorder()
Checks if this vertex is on the mesh border. A vertex is on the border if any of its edges is shared by only one triangle.
Declaration
public bool IsBorder()
Returns
| Type | Description |
|---|---|
| bool | True if the vertex is on the border, false otherwise. |
RemoveFace(Tri)
Removes a triangle from this vertex's face list.
Declaration
public void RemoveFace(Tri f)
Parameters
| Type | Name | Description |
|---|---|---|
| Tri | f | Triangle to remove. |
RemoveIfNonNeighbor(Vert)
Removes a vertex from the neighbor list if they no longer share any faces.
Declaration
public void RemoveIfNonNeighbor(Vert v)
Parameters
| Type | Name | Description |
|---|---|---|
| Vert | v | Vertex to potentially remove from neighbors. |
RemoveVert()
Removes this vertex and breaks all neighbor connections.
Declaration
public void RemoveVert()