create_polygon method
Contents
[
Hide
]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):
...
Parameter | Type | Description |
---|---|---|
indices | list | Array 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):
...
Parameter | Type | Description |
---|---|---|
indices | list | Array of the polygon indices, each index points to a control point that forms the polygon. |
offset | int | The offset of the first polygon index |
length | int | The 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):
...
Parameter | Type | Description |
---|---|---|
v1 | int | Index of the first vertex |
v2 | int | Index of the second vertex |
v3 | int | Index 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):
...
Parameter | Type | Description |
---|---|---|
v1 | int | Index of the first vertex |
v2 | int | Index of the second vertex |
v3 | int | Index of the third vertex |
v4 | int | Index 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
- module
aspose.threed.entities
- class
Mesh
- class
PolygonBuilder