create_polygon method

create_polygon(self, indices)

Creates a new polygon with all vertices defined in indices. To create polygon vertex by vertex, please use PolygonBuilder.


def create_polygon(self, indices):
    ...
ParameterTypeDescription
indiceslistArray of the polygon indices, each index points to a control point that forms the polygon.

Example

from aspose.threed.entities import Mesh

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

create_polygon(self, indices, offset, length)

Creates a new polygon with all vertices defined in indices. To create polygon vertex by vertex, please use PolygonBuilder.


def create_polygon(self, indices, offset, length):
    ...
ParameterTypeDescription
indiceslistArray of the polygon indices, each index points to a control point that forms the polygon.
offsetintThe offset of the first polygon index
lengthintThe length of the indices

Example

The following code shows how to create a new polygon with control point’s indices.

from aspose.threed.entities import Mesh

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

create_polygon(self, v1, v2, v3)

Create a polygon with 3 vertices(triangle)


def create_polygon(self, v1, v2, v3):
    ...
ParameterTypeDescription
v1intIndex of the first vertex
v2intIndex of the second vertex
v3intIndex of the third vertex

Example

The following code shows how to create a new polygon with control point’s indices.

from aspose.threed.entities import Mesh

mesh = Mesh()
mesh.create_polygon(0, 1, 2)

create_polygon(self, v1, v2, v3, v4)

Create a polygon with 4 vertices(quad)


def create_polygon(self, v1, v2, v3, v4):
    ...
ParameterTypeDescription
v1intIndex of the first vertex
v2intIndex of the second vertex
v3intIndex of the third vertex
v4intIndex of the fourth vertex

Example

The following code shows how to create a new polygon with control point’s indices.

from aspose.threed.entities import Mesh

mesh = Mesh()
mesh.create_polygon(0, 1, 2, 3)

See Also