PolygonBuilder

PolygonBuilder class

A helper class to build polygon for Mesh

public sealed class PolygonBuilder

Constructors

Name Description
PolygonBuilder(Mesh) Initializes a new instance of the PolygonBuilder class.

Methods

Name Description
AddVertex(int) Adds a vertex index to the polygon
Begin() Begins to add a new polygon
End() Finishes the polygon creation

Examples

PolygonBuilder builder = new PolygonBuilder(mesh);
builder.Begin();
builder.AddVertex(0);
builder.AddVertex(1);
builder.AddVertex(2);
Builder.End();

Equals to :

int[] indices = new int[] {0, 1, 2};
mesh.CreatePolygon(indices);

If all indices are ready to use, CreatePolygon is preferred, otherwise PolygonBuilder would be a better choice.

See Also