9.12. polygonMesh¶
-
class
itom.
polygonMesh
(mesh=None, polygons=None) → creates a polygon mesh.¶ This constructor either creates an empty polygon mesh, a shallow copy of another polygon mesh (mesh parameter only) or a deep copy of another polygon mesh where only the polygons, given by the list of indices in the parameter ‘polygons’, are taken. In this case, the containing cloud is reduced and no longer organized (height=1, dense=false)
- Parameters
mesh : {polygonMesh}, optional
another polygon mesh instance (shallow or deep copy depending on polygons-parameter)
polygons : {sequence or array-like}, optional
If given, polygons must be a sequence or one-dimensional array-like structure, where all values can be transformed into unsigned integer values. Polygons must contain a list of indices pointing to all polygon from the given mesh that should be copied to this new instance.
-
data
()¶ prints content of polygon mesh
-
static
fromCloudAndPolygons
(cloud, polygons) → creates a polygon mesh from cloud and polygons.¶ - Parameters
cloud : {pointCloud}
the input point cloud
polygons : {array-like, MxN}
an array-like matrix with the indices of the polygons. The array contains M polygons and every row gives the indices of the vertices of the cloud belonging to the polygon.
-
static
fromOrganizedCloud
(cloud, triangulationType=1) → creates a polygon mesh from an organized cloud using triangles.¶ The polygons are created as triangles. Triangles are also created for non-finite points.
- Parameters
cloud : {pointCloud}
the input point cloud (must be organized, see attribute organized of a cloud)
triangulationType : {int}
type of triangulation. 0: quads, 1 : triangles [default]
-
static
fromTopography
(topography, triangulationType=1) → creates a polygon mesh from a dataObject whose values are the z-components.¶ The polygons are created either as rectangles (quads) or triangles. Some other algorithms only support meshes with triangles. This method is the same than calling polygonMesh.fromOrganizedCloud(pointCloud.fromTopography(topography)).
- Parameters
topography : {dataObject}
the input data object. The grid of the data object including its axisScales and axisOffsets value indicate the X and Y values whereas the Z values are given by the data object
triangulationType : {int}
type of triangulation. 0: quads, 1: triangles [default]
-
getCloud
(pointType=point.PointInvalid) → returns the point cloud of this polygon mesh converted to the desired type.¶ If the pointType is not given or point.PointInvalid, the type of the internal pointCloud is guessed with respect to available types.
- Parameters
pointType : {int, enum point.PointXXX}, optional
the point type value of the desired type, the point cloud should be converted too (default: point.PointInvalid)
-
getPolygons
() → returns MxN int32 dataObject with the polygon description. M is the number of polygons and N is the biggest number of vertices.¶
-
name
()¶
-
nrOfPolygons
¶ returns the number of polygons in this mesh