- class itom.polygonMesh(mesh=None, polygons=None)¶
Constructor for a polygon mesh.
This constructor either creates an empty polygon mesh, a shallow copy of another polygon mesh (
meshparameter 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).
another polygon mesh instance (shallow or deep copy depending on argument
polygonsmust be any object, that can be converted to an one-dimensional array-like structure with a data type
uint32. This polygon mesh is then created from the given
meshwith the polygons only, whose index is contained in this
polygonsis given, but
None. This is not possible.
Prints out data of this mesh to the command line.
- static fromCloudAndPolygons(cloud, polygons) polygonMesh ¶
Creates a polygon mesh from a given cloud and polygons.
is the input point cloud.
- polygonsarray_like or
M x Nint32 array-like array with the indices of the polygons. The array contains information about
Mpolygons. Every row gives the indices of the vertices of the cloud belonging to this polygon (usually in counter-clockwise order, if one looks on the polygon from outside.
- static fromOrganizedCloud(cloud, triangulationType=1) polygonMesh ¶
Creates a polygon mesh from an organized cloud.
Since the input
cloudis organized, the neighbouring points in space are known in all directions. This allows automatically defining the vertices for polygons, such that a closed polygon mesh can be created, that is the hull of this given
cloud. This is done by this method.
cloudis not organized (see
- static fromTopography(topography, triangulationType=1) polygonMesh ¶
Creates a polygon mesh from a
topographydataObject whose values are the z-components.
The polygons are created either as rectangles (quads) or triangles. However, some mesh processing methods only support meshes with triangles.
This method is the same than calling
the topography data object. The grid of the data object, defined by its size, the
axisOffsetsvalues indicate the x- and y-coordinates of each point, while the z-coordinate is given by the corresponding value of this object. This polygon mesh is then created based on these points by adding polygons between either 3 neighbouring points (
triangulationType = 1), or four points (
triangulationType = 0).
is the type of the mesh triangulation: 0: each polygon consists of quads (four corner points), 1: each polygon is described by a triangle and three corner points.
- getCloud(newPointType=point.PointInvalid) pointCloud ¶
Returns the point cloud of this polygon mesh converted to the desired type
newPointTypeis not given or
point.PointInvalid, the type of the internal
pointCloudis guessed with respect to available types.
the point type value of the desired type, the point cloud should be converted too (default: point.PointInvalid)
- getPolygons() dataObject ¶
Returns a dataObject with the relevant information of the polygons in this mesh.
M x Nint32
dataObjectwith the description of the polygons.
Mis the number of polygons,
Nthe biggest number of vertices. Hence, each polygon is passed in one row of this object. The point indices (vertices), that describe this polygon.