PolygonBuilder class

PolygonBuilder class

A helper class to build polygon for Mesh

The PolygonBuilder type exposes the following members:

Constructors

ConstructorDescription
initInitializes a new instance of the PolygonBuilder class.

Methods

MethodDescription
beginBegins to add a new polygon
add_vertexAdds a vertex index to the polygon
endFinishes the polygon creation

Example

from aspose.threed.entities import Mesh, PolygonBuilder

mesh = Mesh()
builder = PolygonBuilder(mesh)
builder.begin()
builder.add_vertex(0)
builder.add_vertex(1)
builder.add_vertex(2)
builder.end()

Equals to :

from aspose.threed.entities import Mesh

mesh = Mesh()
indices = [0, 1, 2]
mesh.create_polygon(indices)

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

See Also