create_polygon method

create_polygon

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


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

create_polygon

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


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

create_polygon

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

create_polygon

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

See Also