cloudViewer.geometry.ccCone#

class cloudViewer.geometry.ccCone#

The 3D cone primitive.

class Type#

Enum class for Geometry types.

BBOX = <Type.BBOX: 35184372088835>#
BOX = <Type.BOX: 524809>#
CAMERA_SENSOR = <Type.CAMERA_SENSOR: 4294975489>#
CONE = <Type.CONE: 262665>#
CUSTOM_H_OBJECT = <Type.CUSTOM_H_OBJECT: 129>#
CYLINDER = <Type.CYLINDER: 393737>#
DISH = <Type.DISH: 1049097>#
EXTRU = <Type.EXTRU: 2097673>#
FACET = <Type.FACET: 8388609>#
GBL_SENSOR = <Type.GBL_SENSOR: 134225921>#
IMAGE = <Type.IMAGE: 4097>#
IMAGE2 = <Type.IMAGE2: 562949953421315>#
LABEL_2D = <Type.LABEL_2D: 35>#
LINESET = <Type.LINESET: 2251799813685249>#
MATERIAL_SET = <Type.MATERIAL_SET: 16777222>#
MESH = <Type.MESH: 513>#
MESH_GROUP = <Type.MESH_GROUP: 517>#
OLD_CYLINDER_ID = <Type.OLD_CYLINDER_ID: 131593>#
ORIENTED_BBOX = <Type.ORIENTED_BBOX: 70368744177667>#
PLANE = <Type.PLANE: 16905>#
POINT_CLOUD = <Type.POINT_CLOUD: 257>#
POINT_KDTREE = <Type.POINT_KDTREE: 4194307>#
POINT_OCTREE = <Type.POINT_OCTREE: 1027>#
POINT_OCTREE2 = <Type.POINT_OCTREE2: 140737488355331>#
POLY_LINE = <Type.POLY_LINE: 2049>#
PRIMITIVE = <Type.PRIMITIVE: 521>#
QUADRIC = <Type.QUADRIC: 8589935113>#
RGBD_IMAGE = <Type.RGBD_IMAGE: 1125899906842627>#
SENSOR = <Type.SENSOR: 8193>#
SPHERE = <Type.SPHERE: 33289>#
SUB_MESH = <Type.SUB_MESH: 515>#
TETRA_MESH = <Type.TETRA_MESH: 27021597764222977>#
TORUS = <Type.TORUS: 66057>#
VIEWPORT_2D_LABEL = <Type.VIEWPORT_2D_LABEL: 99>#
VIEWPORT_2D_OBJECT = <Type.VIEWPORT_2D_OBJECT: 67>#
VOXEL_GRID = <Type.VOXEL_GRID: 281474976710657>#
property name#
property value#
static New(*args, **kwargs)#

Overloaded function.

  1. New(objectType: typing.SupportsInt, name: str = None) -> cloudViewer.geometry.ccHObject

  2. New(pluginId: QString, classId: QString, name: str = None) -> cloudViewer.geometry.ccHObject

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: cloudViewer.geometry.ccCone) -> None

Default constructor

  1. __init__(self: cloudViewer.geometry.ccCone, arg0: cloudViewer.geometry.ccCone) -> None

Copy constructor

  1. __init__(self: cloudViewer.geometry.ccCone, name: str = ‘Cone’) -> None

Simplified constructor

  1. __init__(self: cloudViewer.geometry.ccCone, bottom_radius: typing.SupportsFloat, top_radius: typing.SupportsFloat, height: typing.SupportsFloat, x_off: typing.SupportsFloat = 0, y_off: typing.SupportsFloat = 0, trans_matrix: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[4, 4]”] = array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), precision: typing.SupportsInt = 24, name: str = ‘Cone’) -> None

Cone axis corresponds to the ‘Z’ dimension by default: -param bottom_radius cone bottom radius; -param top_radius cone top radius; -param height cone height (transformation should point to the axis center); -param x_off displacement of axes along X-axis (Snout mode); -param y_off displacement of axes along Y-axis (Snout mode); -param trans_matrix optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation); -param precision drawing precision (angular step = 360/precision); -param name primitive name.

add_child(self, child, dependencyFlags=24, insertIndex=-1)#

Adds a child.

Parameters:
  • child (cloudViewer.geometry.ccHObject) – child instance geometry

  • dependencyFlags (SupportsInt, optional, default=24) – dependency flags

  • insertIndex (SupportsInt, optional, default=-1) – insertion index (if <0, child is simply appended to the children list)

Returns:

bool

add_material_index(self, material_index)#

Adds triangle material index for next triangle.

Parameters:

material_index (SupportsInt) –

Returns:

None

add_texture_coord_indexes(self, i1, i2, i3)#

Adds a triplet of tex coords indexes for next triangle.

Parameters:
Returns:

None

add_triangle_normal_indexes(self, arg0, arg1, arg2)#

Adds a triplet of normal indexes for next triangle.

Parameters:
Returns:

None

add_triangles(self, triangles)#

int array of shape (num_triangles, 3), use numpy.asarray() to access data: List of triangles denoted by the index of points forming the triangle.

Parameters:

triangles (cloudViewer.utility.Vector3iVector) –

Returns:

None

are_triangle_normals_enabled(self)#

Returns whether per triangle normals are enabled.

Returns:

bool

capacity(self)#

Returns max capacity.

Returns:

int

clear(self)#

Release internal memory.

Returns:

None

clear_triangle_normals(self)#

Removes per-triangle normals.

Returns:

None

clone(self)#

Clones primitive.

Returns:

cloudViewer.geometry.ccGenericPrimitive

clone_mesh(self, cloud=None)#

Returns a complete clone of the mesh.

Parameters:

cloud (cloudViewer.geometry.ccGenericPointCloud, optional, default=None) –

Returns:

cloudViewer.geometry.ccMesh

cluster_connected_triangles(self)#

Function that clusters connected triangles, i.e., triangles that are connected via edges are assigned the same cluster index. This function retuns an array that contains the cluster index per triangle, a second array contains the number of triangles per cluster, and a third vector contains the surface area per cluster.

Returns:

tuple[cloudViewer.utility.IntVector, list[int], cloudViewer.utility.DoubleVector]

colors_shown(self)#

Returns whether colors are shown or not.

Returns:

bool

compute_adjacency_list(self)#

Function to compute adjacency list, call before adjacency list is needed

Returns:

cloudViewer.geometry.ccMesh

compute_convex_hull(self)#

Computes the convex hull of the triangle mesh.

Returns:

tuple[cloudViewer.geometry.ccMesh, list[int]]

compute_interpolation_weights(self, triangle_index, point)#

Returns the (barycentric) interpolation weights for a given triangle.

Parameters:
Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

compute_normals(self, per_vertex)#

Computes normals.

Parameters:

per_vertex (bool) –

Returns:

bool

static compute_triangle_area(p0: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'], p1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'], p2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) float#

Function that computes the area of a mesh triangle.

compute_triangle_normals(self, normalized=True)#

Function to compute triangle normals, usually called before rendering

Parameters:

normalized (bool, optional, default=True) –

Returns:

cloudViewer.geometry.ccMesh

static compute_triangle_plane(p0: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'], p1: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]'], p2: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[4, 1]']#

Function that computes the plane equation from the three points.

compute_vertex_normals(self, normalized=True)#

Function to compute vertex normals, usually called before rendering

Parameters:

normalized (bool, optional, default=True) –

Returns:

cloudViewer.geometry.ccMesh

convert_materials_to_vertex_colors(self)#

Converts materials to vertex colors.

Returns:

bool

static create_arrow(cylinder_radius=1.0, cone_radius=1.5, cylinder_height=5.0, cone_height=4.0, resolution=20, cylinder_split=4, cone_split=1)#

Factory function to create an arrow mesh

Parameters:
  • cylinder_radius (SupportsFloat, optional, default=1.0) – The radius of the cylinder.

  • cone_radius (SupportsFloat, optional, default=1.5) – The radius of the cone.

  • cylinder_height (SupportsFloat, optional, default=5.0) – The height of the cylinder. The cylinder is from (0, 0, 0) to (0, 0, cylinder_height)

  • cone_height (SupportsFloat, optional, default=4.0) – The height of the cone. The axis of the cone will be from (0, 0, cylinder_height) to (0, 0, cylinder_height + cone_height)

  • resolution (SupportsInt, optional, default=20) – The cone will be split into resolution segments.

  • cylinder_split (SupportsInt, optional, default=4) – The cylinder_height will be split into cylinder_split segments.

  • cone_split (SupportsInt, optional, default=1) – The cone_height will be split into cone_split segments.

Returns:

cloudViewer.geometry.ccMesh

static create_box(width=1.0, height=1.0, depth=1.0, create_uv_map=False, map_texture_to_each_face=False)#

Factory function to create a box. The left bottom corner on the front will be placed at (0, 0, 0), and default UV map, maps the entire texture to each face.

Parameters:
  • width (SupportsFloat, optional, default=1.0) – x-directional length.

  • height (SupportsFloat, optional, default=1.0) – y-directional length.

  • depth (SupportsFloat, optional, default=1.0) – z-directional length.

  • create_uv_map (bool, optional, default=False) – Add default uv map to the mesh.

  • map_texture_to_each_face (bool, optional, default=False) – Map entire texture to each face.

Returns:

cloudViewer.geometry.ccMesh

static create_cone(radius=1.0, height=2.0, resolution=20, split=1, create_uv_map=False)#

Factory function to create a cone mesh.

Parameters:
  • radius (SupportsFloat, optional, default=1.0) – The radius of the cone.

  • height (SupportsFloat, optional, default=2.0) – The height of the cone. The axis of the cone will be from (0, 0, 0) to (0, 0, height).

  • resolution (SupportsInt, optional, default=20) – The circle will be split into resolution segments

  • split (SupportsInt, optional, default=1) – The height will be split into split segments.

  • create_uv_map (bool, optional, default=False) – Add default uv map to the mesh.

Returns:

cloudViewer.geometry.ccMesh

static create_coordinate_frame(size=1.0, origin)#

Factory function to create a coordinate frame mesh. The coordinate frame will be centered at origin. The x, y, z axis will be rendered as red, green, and blue arrows respectively.

Parameters:
  • size (SupportsFloat, optional, default=1.0) – The size of the coordinate frame.

  • origin (Annotated[numpy.typing.ArrayLike, numpy.float64,) – The origin of the cooridnate frame.

Returns:

cloudViewer.geometry.ccMesh

static create_cylinder(radius=1.0, height=2.0, resolution=20, split=4, create_uv_map=False)#

Factory function to create a cylinder mesh.

Parameters:
  • radius (SupportsFloat, optional, default=1.0) – The radius of the cylinder.

  • height (SupportsFloat, optional, default=2.0) – The height of the cylinder. The axis of the cylinder will be from (0, 0, -height/2) to (0, 0, height/2).

  • resolution (SupportsInt, optional, default=20) – The circle will be split into resolution segments

  • split (SupportsInt, optional, default=4) – The height will be split into split segments.

  • create_uv_map (bool, optional, default=False) – Add default uv map to the mesh.

Returns:

cloudViewer.geometry.ccMesh

static create_from_point_cloud_alpha_shape(*args, **kwargs)#

Overloaded function.

  1. create_from_point_cloud_alpha_shape(pcd, alpha)

    Alpha shapes are a generalization of the convex hull. With decreasing alpha value the shape schrinks and creates cavities. See Edelsbrunner and Muecke, “Three-Dimensional Alpha Shapes”, 1994.

Parameters:
  • pcd (cloudViewer.geometry.ccPointCloud) – PointCloud from whicht the TriangleMesh surface is reconstructed.

  • alpha (SupportsFloat) – Parameter to controll the shape. A very big value will give a shape close to the convex hull.

Returns:

cloudViewer.geometry.ccMesh

  1. create_from_point_cloud_alpha_shape(pcd, alpha, tetra_mesh, pt_map)

    Alpha shapes are a generalization of the convex hull. With decreasing alpha value the shape schrinks and creates cavities. See Edelsbrunner and Muecke, “Three-Dimensional Alpha Shapes”, 1994.

Parameters:
  • pcd (cloudViewer.geometry.ccPointCloud) – PointCloud from whicht the TriangleMesh surface is reconstructed.

  • alpha (SupportsFloat) – Parameter to controll the shape. A very big value will give a shape close to the convex hull.

  • tetra_mesh (cloudViewer::geometry::TetraMesh) – If not None, than uses this to construct the alpha shape. Otherwise, TetraMesh is computed from pcd.

  • pt_map (collections.abc.Sequence[SupportsInt]) – Optional map from tetra_mesh vertex indices to pcd points.

Returns:

cloudViewer.geometry.ccMesh

static create_from_point_cloud_ball_pivoting(pcd, radii)#

Function that computes a triangle mesh from a oriented PointCloud. This implements the Ball Pivoting algorithm proposed in F. Bernardini et al., “The ball-pivoting algorithm for surface reconstruction”, 1999. The implementation is also based on the algorithms outlined in Digne, “An Analysis and Implementation of a Parallel Ball Pivoting Algorithm”, 2014. The surface reconstruction is done by rolling a ball with a given radius over the point cloud, whenever the ball touches three points a triangle is created.

Parameters:
Returns:

cloudViewer.geometry.ccMesh

static create_from_point_cloud_poisson(pcd, depth=8, width=0, scale=1.1, linear_fit=False, point_weight=2.0, samples_per_node=1.5, boundary_type=2, n_threads=-1)#

Function that computes a triangle mesh from a oriented PointCloud pcd. This implements the Screened Poisson Reconstruction proposed in Kazhdan and Hoppe, “Screened Poisson Surface Reconstruction”, 2013. This function uses the original implementation by Kazhdan. See https://github.com/mkazhdan/PoissonRecon

Parameters:
  • pcd (cloudViewer.geometry.ccPointCloud) – PointCloud from which the TriangleMesh surface is reconstructed. Has to contain normals.

  • depth (SupportsInt, optional, default=8) – Maximum depth of the tree that will be used for surface reconstruction. Running at depth d corresponds to solving on a grid whose resolution is no larger than 2^d x 2^d x 2^d. Note that since the reconstructor adapts the octree to the sampling density, the specified reconstruction depth is only an upper bound.

  • width (SupportsInt, optional, default=0) – Specifies the target width of the finest level octree cells. This parameter is ignored if depth is specified

  • scale (SupportsFloat, optional, default=1.1) – Specifies the ratio between the diameter of the cube used for reconstruction and the diameter of the samples’ bounding cube.

  • linear_fit (bool, optional, default=False) – If true, the reconstructor use linear interpolation to estimate the positions of iso-vertices.

  • point_weight (SupportsFloat, optional, default=2.0) – The importance that interpolation of the point samples is given in the formulation of the screened Poisson equation.The results of the original (unscreened) Poisson Reconstructioncan be obtained by setting this value to 0

  • samples_per_node (SupportsFloat, optional, default=1.5) – The minimum number of sample points that should fall withinan octree node as the octree construction is adapted to sampling density.This parameter specifies the minimum number of points that should fallwithin an octree node. For noise-free samples, small values in the range [1.0 - 5.0]can be used. For more noisy samples, larger values in the range [15.0 - 20.0]may be needed to provide a smoother, noise-reduced, reconstruction.

  • boundary_type (SupportsInt, optional, default=2) – Boundary type for the finite elements

  • n_threads (SupportsInt, optional, default=-1) – Number of threads used for reconstruction. Set to -1 to automatically determine it.

Returns:

tuple[cloudViewer.geometry.ccMesh, cloudViewer.utility.DoubleVector]

static create_icosahedron(radius=1.0, create_uv_map=False)#

Factory function to create a icosahedron. The centroid of the mesh will be placed at (0, 0, 0) and the vertices have a distance of radius to the center.

Parameters:
  • radius (SupportsFloat, optional, default=1.0) – Distance from centroid to mesh vetices.

  • create_uv_map (bool, optional, default=False) – Add default uv map to the mesh.

Returns:

cloudViewer.geometry.ccMesh

create_internal_cloud(self)#

Sets the associated vertices cloud (warning)

Returns:

bool

create_mesh_from_selection(self, remove_selected_faces)#

Creates a new mesh with the selected vertices only.

Parameters:

remove_selected_faces (bool) –

Returns:

cloudViewer.geometry.ccMesh

static create_mobius(length_split=70, width_split=15, twists=1, radius=1, flatness=1, width=1, scale=1)#

Factory function to create a Mobius strip.

Parameters:
  • length_split (SupportsInt, optional, default=70) – The number of segments along the Mobius strip.

  • width_split (SupportsInt, optional, default=15) – The number of segments along the width of the Mobius strip.

  • twists (SupportsInt, optional, default=1) – Number of twists of the Mobius strip.

  • radius (SupportsFloat, optional, default=1) – The radius of the Mobius strip.

  • flatness (SupportsFloat, optional, default=1) – Controls the flatness/height of the Mobius strip.

  • width (SupportsFloat, optional, default=1) – Width of the Mobius strip.

  • scale (SupportsFloat, optional, default=1) – Scale the complete Mobius strip.

Returns:

cloudViewer.geometry.ccMesh

static create_octahedron(radius=1.0, create_uv_map=False)#

Factory function to create a octahedron. The centroid of the mesh will be placed at (0, 0, 0) and the vertices have a distance of radius to the center.

Parameters:
  • radius (SupportsFloat, optional, default=1.0) – Distance from centroid to mesh vetices.

  • create_uv_map (bool, optional, default=False) – Add default uv map to the mesh.

Returns:

cloudViewer.geometry.ccMesh

static create_plane(width=1.0, height=1.0, create_uv_map=False)#

Factory function to create a plane. The center of the plane will be placed at (0, 0, 0).

Parameters:
  • width (SupportsFloat, optional, default=1.0) – The width of this plane.

  • height (SupportsFloat, optional, default=1.0) – The height of this plane.

  • create_uv_map (bool, optional, default=False) – Add default uv map to the mesh.

Returns:

cloudViewer.geometry.ccMesh

static create_sphere(radius=1.0, resolution=20, create_uv_map=False)#

Factory function to create a sphere mesh centered at (0, 0, 0).

Parameters:
  • radius (SupportsFloat, optional, default=1.0) – The radius of the sphere.

  • resolution (SupportsInt, optional, default=20) – The resolution of the sphere. The longitues will be split into resolution segments (i.e. there are resolution + 1 latitude lines including the north and south pole). The latitudes will be split into `2 * resolution segments (i.e. there are 2 * resolution longitude lines.)

  • create_uv_map (bool, optional, default=False) – Add default uv map to the mesh.

Returns:

cloudViewer.geometry.ccMesh

static create_tetrahedron(radius=1.0, create_uv_map=False)#

Factory function to create a tetrahedron. The centroid of the mesh will be placed at (0, 0, 0) and the vertices have a distance of radius to the center.

Parameters:
  • radius (SupportsFloat, optional, default=1.0) – Distance from centroid to mesh vetices.

  • create_uv_map (bool, optional, default=False) – Add default uv map to the mesh.

Returns:

cloudViewer.geometry.ccMesh

static create_torus(torus_radius=1.0, tube_radius=0.5, radial_resolution=30, tubular_resolution=20)#

Factory function to create a torus mesh.

Parameters:
  • torus_radius (SupportsFloat, optional, default=1.0) – The radius from the center of the torus to the center of the tube.

  • tube_radius (SupportsFloat, optional, default=0.5) – The radius of the torus tube.

  • radial_resolution (SupportsInt, optional, default=30) – The number of segments along the radial direction.

  • tubular_resolution (SupportsInt, optional, default=20) – The number of segments along the tubular direction.

Returns:

cloudViewer.geometry.ccMesh

crop(*args, **kwargs)#

Overloaded function.

  1. crop(self, bounding_box)

    Function to crop input TriangleMesh into output TriangleMesh

Parameters:

bounding_box (ccBBox) – ccBBox to crop points

Returns:

cloudViewer.geometry.ccMesh

  1. crop(self, bounding_box)

    Function to crop input TriangleMesh into output TriangleMesh

Parameters:

bounding_box (ecvOrientedBBox) – ccBBox to crop points

Returns:

cloudViewer.geometry.ccMesh

deform_as_rigid_as_possible(self, constraint_vertex_indices, constraint_vertex_positions, max_iter, energy=<DeformAsRigidAsPossibleEnergy.Spokes: 0>, smoothed_alpha=0.01)#

This function deforms the mesh using the method by Sorkine and Alexa, ‘As-Rigid-As-Possible Surface Modeling’, 2007

Parameters:
  • constraint_vertex_indices (cloudViewer.utility.IntVector) – Indices of the triangle vertices that should be constrained by the vertex positions in constraint_vertex_positions.

  • constraint_vertex_positions (cloudViewer.utility.Vector3dVector) – Vertex positions used for the constraints.

  • max_iter (SupportsInt) – Maximum number of iterations to minimize energy functional.

  • (cloudViewer.geometry.DeformAsRigidAsPossibleEnergy (energy) – 0>): Energy model that is minimized in the deformation process

  • optional – 0>): Energy model that is minimized in the deformation process

  • default=<DeformAsRigidAsPossibleEnergy.Spokes – 0>): Energy model that is minimized in the deformation process

  • smoothed_alpha (SupportsFloat, optional, default=0.01) – trade-off parameter for the smoothed energy functional for the regularization term.

Returns:

cloudViewer.geometry.ccMesh

enable_gl_transformation(self, state)#

Enables/disables associated GL transformation.

Parameters:

state (bool) –

Returns:

None

enable_stippling(self, state)#

Enables polygon stippling.

Parameters:

state (bool) –

Returns:

None

enable_temp_color(self, state)#

Set temporary color activation state.

Parameters:

state (bool) –

Returns:

None

euler_poincare_characteristic(self)#

Function that computes the Euler-Poincaré characteristic, i.e., V + F - E, where V is the number of vertices, F is the number of triangles, and E is the number of edges.

Returns:

int

filter_children(self, recursive=False, filter=<Type.???: 0>, strict=False)#

Collects the children corresponding to a certain pattern.

Parameters:
  • recursive (bool, optional, default=False) – specifies if the search should be recursive

  • (typing.SupportsInt (filter) – 0>): pattern for children selection

  • optional – 0>): pattern for children selection

  • default=<Type.??? – 0>): pattern for children selection

  • strict (bool, optional, default=False) – whether the search is strict on the type (i.e ‘isA’) or not (i.e. ‘isKindOf’)

Returns:

list[cloudViewer.geometry.ccHObject]

filter_sharpen(self, number_of_iterations=1, strength=1, filter_scope=<FilterScope.All: 0>)#

Function to sharpen triangle mesh. The output value (\(v_o\)) is the input value (\(v_i\)) plus strength times the input value minus he sum of he adjacent values. \(v_o = v_i x strength (v_i * |N| - \sum_{n \in N} v_n)\)

Parameters:
  • number_of_iterations (SupportsInt, optional, default=1) – Number of repetitions of this operation

  • strength (SupportsFloat, optional, default=1) – Filter parameter.

  • (cloudViewer.geometry.FilterScope (filter_scope) – 0>)

  • optional – 0>)

  • default=<FilterScope.All – 0>)

Returns:

cloudViewer.geometry.ccMesh

filter_smooth_laplacian(self, number_of_iterations=1, lambda=0.5, filter_scope=<FilterScope.All: 0>)#

Function to smooth triangle mesh using Laplacian. \(v_o = v_i \cdot \lambda (sum_{n \in N} w_n v_n - v_i)\), with \(v_i\) being the input value, \(v_o\) the output value, \(N\) is the set of adjacent neighbours, \(w_n\) is the weighting of the neighbour based on the inverse distance (closer neighbours have higher weight), and lambda is the smoothing parameter.

Parameters:
  • number_of_iterations (SupportsInt, optional, default=1) – Number of repetitions of this operation

  • lambda (SupportsFloat, optional, default=0.5) – Filter parameter.

  • (cloudViewer.geometry.FilterScope (filter_scope) – 0>)

  • optional – 0>)

  • default=<FilterScope.All – 0>)

Returns:

cloudViewer.geometry.ccMesh

filter_smooth_simple(self, number_of_iterations=1, filter_scope=<FilterScope.All: 0>)#

Function to smooth triangle mesh with simple neighbor average. \(v_o = \frac{v_i + \sum_{n \in N} v_n)}{|N| + 1}\), with \(v_i\) being the input value, \(v_o\) the output value, and \(N\) is the set of adjacent neighbours.

Parameters:
  • number_of_iterations (SupportsInt, optional, default=1) – Number of repetitions of this operation

  • (cloudViewer.geometry.FilterScope (filter_scope) – 0>)

  • optional – 0>)

  • default=<FilterScope.All – 0>)

Returns:

cloudViewer.geometry.ccMesh

filter_smooth_taubin(self, number_of_iterations=1, lambda=0.5, mu=-0.53, filter_scope=<FilterScope.All: 0>)#

Function to smooth triangle mesh using method of Taubin, “Curve and Surface Smoothing Without Shrinkage”, 1995. Applies in each iteration two times filter_smooth_laplacian, first with filter parameter lambda and second with filter parameter mu as smoothing parameter. This method avoids shrinkage of the triangle mesh.

Parameters:
  • number_of_iterations (SupportsInt, optional, default=1) – Number of repetitions of this operation

  • lambda (SupportsFloat, optional, default=0.5) – Filter parameter.

  • mu (SupportsFloat, optional, default=-0.53) – Filter parameter.

  • (cloudViewer.geometry.FilterScope (filter_scope) – 0>)

  • optional – 0>)

  • default=<FilterScope.All – 0>)

Returns:

cloudViewer.geometry.ccMesh

find(self, unique_id)#

Finds an entity in this object hierarchy.

Parameters:

unique_id (SupportsInt) –

Returns:

cloudViewer.geometry.ccHObject

flip_triangles(self)#

Flips the triangle.

Returns:

None

from_file(self, filename, dataVersion, flags)#

Loads data from binary stream.

Parameters:
  • filename (str) –

  • dataVersion (SupportsInt) – file version

  • flags (SupportsInt) – deserialization flags (see ccSerializableObject::DeserializationFlags)

Returns:

bool

get_associated_cloud(self)#

Returns the associated cloud.

Returns:

cloudViewer.geometry.ccGenericPointCloud

get_axis_aligned_bounding_box(self)#

Returns an axis-aligned bounding box of the geometry.

Returns:

ccBBox

get_bbox_corner(self)#

Returns the mesh bounding-box.

Returns:

tuple[typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”], typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]]

get_bottom_center(self)#

Returns cone axis bottom end point after applying transformation

Returns:

None

get_bottom_radius(self)#

Returns cone bottom radius.

Returns:

float

get_center(self)#

Returns the center of the geometry coordinates.

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

get_child(self, childPos)#

Returns the ith child.

Parameters:

childPos (SupportsInt) – child position

Returns:

cloudViewer.geometry.ccHObject

get_children_number(self)#

Returns the number of children.

Returns:

int

get_class_id(self)#

Returns class ID.

Returns:

int

get_color_from_material(self, triangle_index, point, interpolate_color_if_no_texture)#

Returns RGB color from a given triangle material/texture.

Parameters:
  • triangle_index (SupportsInt) – triIndex triangle index

  • point (Annotated[numpy.typing.ArrayLike, numpy.float64,) – point where to grab color (should be inside the triangle!)

  • interpolate_color_if_no_texture (bool) – whether to return the color interpolated from the RGB field if no texture/material is associated to the given triangles

Returns:

tuple[bool, typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]]

get_drawing_precision(self)#

Returns drawing precision (or 0 if feature is not supported).

Returns:

int

get_edge_to_triangles_map(self)#

Function that returns a map from edges (vertex0, vertex1) to the triangle indices the given edge belongs to.

Returns:

dict[typing.Annotated[numpy.typing.NDArray[numpy.int32], “[2, 1]”], cloudViewer.utility.IntVector]

get_edge_to_vertices_map(self)#

Function that returns a map from edges (vertex0, vertex1) to the vertex (vertex2) indices the given edge belongs to.

Returns:

dict[typing.Annotated[numpy.typing.NDArray[numpy.int32], “[2, 1]”], cloudViewer.utility.IntVector]

static get_eigne_ordered_triangle(vidx0: SupportsInt, vidx1: SupportsInt, vidx2: SupportsInt) Annotated[numpy.typing.NDArray[numpy.int32], '[3, 1]']#

Returns eigne ordered triangle.

get_glTransformation_history(self)#

Returns the transformation ‘history’ matrix.

Returns:

ccGLMatrix

get_gl_transformation(self)#

Returns associated GL transformation.

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float32], “[4, 4]”]

get_height(self)#

Returns cone height.

Returns:

float

get_large_center(self)#

Returns cone axis end point associated with whichever radii is larger

Returns:

None

get_large_radius(self)#

Returns whichever cone radii is larger

Returns:

float

get_max_2Dbound(self)#

Returns max 2d bounds for geometry coordinates.

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[2, 1]”]

get_max_bound(self)#

Returns max bounds for geometry coordinates.

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

get_min_2Dbound(self)#

Returns min 2d bounds for geometry coordinates.

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[2, 1]”]

get_min_bound(self)#

Returns min bounds for geometry coordinates.

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

get_name(self)#

Returns object name.

Returns:

str

get_next_triangle(self)#

Returns the next triangle (relatively to the global iterator position).

Returns:

cloudViewer::GenericTriangle

get_next_vertice_indexes(self)#

Returns the indexes of the vertices of the next triangle (relatively to the global iterator position).

Returns:

cloudViewer.geometry.VerticesIndexes

get_non_manifold_edges(self, allow_boundary_edges=True)#

Get list of non-manifold edges.

Parameters:

allow_boundary_edges (bool, optional, default=True) – If true, than non-manifold edges are defined as edges with more than two adjacent triangles, otherwise each edge that is not adjacent to two triangles is defined as non-manifold.

Returns:

cloudViewer.utility.Vector2iVector

get_non_manifold_vertices(self)#

Returns a list of indices to non-manifold vertices.

Returns:

cloudViewer.utility.IntVector

get_opacity(self)#

Get opacity.

Returns:

float

static get_ordered_edge(vidx0: SupportsInt, vidx1: SupportsInt) Annotated[numpy.typing.NDArray[numpy.int32], '[2, 1]']#

Helper function to get an edge with ordered vertex indices.

get_oriented_bounding_box(self)#

Returns an oriented bounding box of the geometry.

Returns:

ecvOrientedBBox

get_own_bounding_box(self, withGLFeatures=False)#

Returns an axis-aligned bounding box of the geometry.

Parameters:

withGLFeatures (bool, optional, default=False) – whether use openGL features.

Returns:

ccBBox

get_parent(self)#

Returns parent object.

Returns:

cloudViewer.geometry.ccHObject

static get_rotation_matrix_from_axis_angle(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
static get_rotation_matrix_from_euler_angle(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
static get_rotation_matrix_from_quaternion(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[4, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
static get_rotation_matrix_from_xyz(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
static get_rotation_matrix_from_xzy(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
static get_rotation_matrix_from_yxz(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
static get_rotation_matrix_from_yzx(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
static get_rotation_matrix_from_zxy(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
static get_rotation_matrix_from_zyx(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
get_self_intersecting_triangles(self)#

Returns a list of indices to triangles that intersect the mesh.

Returns:

cloudViewer.utility.Vector2iVector

get_small_center(self)#

Returns cone axis end point associated with whichever radii is smaller

Returns:

None

get_small_radius(self)#

Returns whichever cone radii is smaller

Returns:

float

get_surface_area(*args, **kwargs)#

Overloaded function.

  1. get_surface_area(self: cloudViewer.geometry.ccMesh) -> float

Function that computes the surface area of the mesh, i.e. the sum of the individual triangle surfaces.

  1. get_surface_area(self: cloudViewer.geometry.ccMesh, triangle_areas: cloudViewer.utility.DoubleVector) -> float

Function that computes the surface area of the mesh, i.e. the sum of the individual triangle surfaces.

get_temp_color(self)#

Returns current temporary (unique) color.

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

get_top_center(self)#

Returns cone axis top end point after applying transformation

Returns:

None

get_top_radius(self)#

Returns cone top radius.

Returns:

float

get_transformation(self)#

Returns the transformation that is currently applied to the vertices.

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[4, 4]”]

get_transformation_history(self)#

inherited methods (ccHObject).

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[4, 4]”]

get_triangle(self, index)#

get triangle indices by index

Parameters:

index (SupportsInt) –

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.int32], “[3, 1]”]

get_triangle_area(self, triangle_index)#

Function that computes the area of a mesh triangle identified by the triangle index.

Parameters:

triangle_index (SupportsInt) –

Returns:

float

get_triangle_normal(self, index)#

get triangle indices by index

Parameters:

index (SupportsInt) –

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

get_triangle_normal_indexes(self, triangle_index)#

Returns a compressed normal indexes for a given triangle index (if any).

Parameters:

triangle_index (SupportsInt) –

Returns:

int

get_triangle_normals(self)#

int array of shape (num_triangles, 3), use numpy.asarray() to access data: List of triangles denoted by the index of points forming the triangle.

Returns:

cloudViewer.utility.Vector3dVector

get_triangle_plane(self)#
Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[4, 1]”]

get_triangle_vertices(self, triangle_index)#

Returns the vertices of a given triangle.

Parameters:

triangle_index (SupportsInt) –

Returns:

tuple[typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”], typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”], typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]]

get_triangles(self)#

int array of shape (num_triangles, 3), use numpy.asarray() to access data: List of triangles denoted by the index of points forming the triangle.

Returns:

cloudViewer.utility.Vector3iVector

get_type_name(self)#

Returns type name (sphere, cylinder, etc.)

Returns:

str

get_unique_id(self)#

Returns object unique ID.

Returns:

int

get_vertex_color(self, index)#

get vertex color by given index.

Parameters:

index (SupportsInt) –

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

get_vertex_color_from_material(self, triangle_index, vertex_index, return_color_if_no_texture)#

Returns RGB color of a vertex from a given triangle material/texture.

Parameters:
  • triangle_index (SupportsInt) – triIndex triangle index

  • vertex_index (SupportsInt) – vertex index inside triangle (i.e. 0, 1 or 2!)

  • return_color_if_no_texture (bool) – whether to return the color from the vertex RGB field if no texture/material is associated to the given triangle

Returns:

tuple[bool, typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]]

get_vertex_colors(self)#

float64 array of shape (num_vertices, 3), range [0, 1] , use numpy.asarray() to access data: RGB colors of vertices.

Returns:

cloudViewer.utility.Vector3dVector

get_vertex_normal(self, index)#

get vertex normal by given index.

Parameters:

index (SupportsInt) –

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

get_vertex_normals(self)#

float64 array of shape (num_vertices, 3), use numpy.asarray() to access data: Vertex normals.

Returns:

cloudViewer.utility.Vector3dVector

get_vertice(self, index)#

get vertex coordinate by given index.

Parameters:

index (SupportsInt) –

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

get_vertice_indexes(self, triangle_index)#

Returns the indexes of the vertices of a given triangle.

Parameters:

triangle_index (SupportsInt) –

Returns:

cloudViewer.geometry.VerticesIndexes

get_vertices(self)#

float64 array of shape (num_vertices, 3), use numpy.asarray() to access data: Vertex coordinates.

Returns:

cloudViewer.utility.Vector3dVector

get_volume(self)#

Function that computes the volume of the mesh, under the condition that it is watertight and orientable.

Returns:

float

has_adjacency_list(self)#

Returns True if the mesh contains adjacency normals.

Returns:

bool

has_colors(self)#

Returns whether colors are enabled or not.

Returns:

bool

has_displayed_scalar_field(self)#

Returns whether an active scalar field is available or not.

Returns:

bool

has_drawing_precision(self)#

Whether drawing is dependent on ‘precision’ parameter.

Returns:

bool

has_material_indexes(self)#

Returns whether this mesh as per-triangle material index.

Returns:

bool

has_materials(self)#

Returns whether the mesh has materials/textures.

Returns:

bool

has_normals(self)#

Returns whether normals are enabled or not.

Returns:

bool

has_scalar_fields(self)#

Returns whether one or more scalar fields are instantiated.

Returns:

bool

has_textures(self)#

Returns True if the mesh contains a texture image.

Returns:

bool

has_triangle_material_ids(self)#

Returns True if the mesh contains material ids.

Returns:

bool

has_triangle_normals(self)#

Returns whether the mesh has per-triangle normals.

Returns:

bool

has_triangle_uvs(self)#

Returns True if the mesh contains uv coordinates.

Returns:

bool

has_triangles(self)#

Returns True if the mesh contains triangles.

Returns:

bool

has_vertex_colors(self)#

Returns True if the mesh contains vertex colors.

Returns:

bool

has_vertex_normals(self)#

Returns True if the mesh contains vertex normals.

Returns:

bool

has_vertices(self)#

Returns True if the mesh contains vertices.

Returns:

bool

import_parameters_from(self, source)#

Imports the parameters from another mesh.

Parameters:

source (cloudViewer.geometry.ccGenericMesh) –

Returns:

None

interpolate_colors(self, triangle_index, point)#

Interpolates RGB colors inside a given triangle.

Parameters:
  • triangle_index (SupportsInt) – triIndex triangle index

  • point (Annotated[numpy.typing.ArrayLike, numpy.float64,) – point where to interpolate (should be inside the triangle!)

Returns:

tuple[bool, typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]]

interpolate_normals(self, triangle_index, point)#

Interpolates normal(s) inside a given triangle.

Parameters:
  • triangle_index (SupportsInt) – triIndex triangle index

  • point (Annotated[numpy.typing.ArrayLike, numpy.float64,) – point where to interpolate (should be inside the triangle!)

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

is_a(self, type)#

Returns whether the geometry is a type pointed.

Parameters:

type (SupportsInt) –

Returns:

bool

is_bbox_intersecting(self, other)#

Function that tests if the bounding boxes of the triangle meshes are intersecting.

Parameters:

other (cloudViewer.geometry.ccMesh) –

Returns:

bool

is_color_overriden(self)#

Returns whether colors are currently overridden by a temporary (unique) color.

Returns:

bool

is_custom(self)#

Returns whether the geometry is custom.

Returns:

bool

is_edge_manifold(self, allow_boundary_edges=True)#

Tests if the triangle mesh is edge manifold.

Parameters:

allow_boundary_edges (bool, optional, default=True) – If true, than non-manifold edges are defined as edges with more than two adjacent triangles, otherwise each edge that is not adjacent to two triangles is defined as non-manifold.

Returns:

bool

is_empty(self)#

Returns True if the geometry is empty.

Returns:

bool

is_gl_trans_enabled(self)#

Returns whether a GL transformation is enabled or not.

Returns:

bool

is_group(self)#

Returns whether the instance is a group.

Returns:

bool

is_hierarchy(self)#

Returns whether the geometry is hierarchy.

Returns:

bool

is_intersecting(self, arg0)#

Tests if the triangle mesh is intersecting the other triangle mesh.

Parameters:

arg0 (cloudViewer.geometry.ccMesh) –

Returns:

bool

is_kind_of(self, type)#

Returns whether the geometry is kind of the type pointed.

Parameters:

type (SupportsInt) –

Returns:

bool

is_leaf(self)#

Returns whether the geometry is leaf.

Returns:

bool

is_orientable(self)#

Tests if the triangle mesh is orientable.

Returns:

bool

is_selected(self)#

Returns whether entity is selected or not.

Returns:

bool

is_self_intersecting(self)#

Tests if the triangle mesh is self-intersecting.

Returns:

bool

is_serializable(self)#

Returns whether the instance is a serializable.

Returns:

bool

is_shown_as_points(self)#

Returns whether the mesh is displayed as wired or with plain facets.

Returns:

bool

is_shown_as_wire(self)#

Returns whether the mesh is displayed as wired or with plain facets.

Returns:

bool

is_snout_mode(self)#

Returns true if the Cone was created in snout mode.

Returns:

bool

is_vertex_manifold(self)#

Tests if all vertices of the triangle mesh are manifold.

Returns:

bool

is_visible(self)#

Returns whether entity is visible or not.

Returns:

bool

is_visiblity_locked(self)#

Returns whether visibility is locked or not.

Returns:

bool

is_watertight(self)#

Tests if the triangle mesh is watertight.

Returns:

bool

laplacian_smooth(self, iterations=100, factor=0.009999999776482582)#

Laplacian smoothing.

Parameters:
  • iterations (SupportsInt, optional, default=100) –

  • factor (SupportsFloat, optional, default=0.009999999776482582) –

Returns:

bool

lock_visibility(self, state)#

Locks/unlocks visibility.

Parameters:

state (bool) –

Returns:

None

materials_shown(self)#

Sets whether textures/material should be displayed or not.

Returns:

bool

merge(self, input_mesh, create_submesh)#

Returns vertices number.

Parameters:
Returns:

bool

merge_close_vertices(self, eps)#

Function that will merge close by vertices to a single one. The vertex position, normal and color will be the average of the vertices. The parameter eps defines the maximum distance of close by vertices. This function might help to close triangle soups.

Parameters:

eps (SupportsFloat) – Parameter that defines the distance between close vertices.

Returns:

cloudViewer.geometry.ccMesh

minimum_file_version(self: cloudViewer.geometry.ccHObject) int#

Returns the minimum file version required to save this object

name_3d_shown(self)#

Returns whether name is displayed in 3D or not.

Returns:

bool

normalize_normals(self)#

Normalize both triangle normals and vertex normals to length 1.

Returns:

cloudViewer.geometry.ccMesh

normals_shown(self)#

Returns whether normals are shown or not.

Returns:

bool

orient_triangles(self)#

If the mesh is orientable this function orients all triangles such that all normals point towards the same direction.

Returns:

bool

paint_uniform_color(self, arg0)#

Assigns each vertex in the TriangleMesh the same color.

Parameters:

arg0 (Annotated[numpy.typing.ArrayLike, numpy.float64,) –

Returns:

cloudViewer.geometry.ccMesh

partial_clone(self: cloudViewer.geometry.ccMesh, triangle_indices: collections.abc.Sequence[SupportsInt]) cloudViewer.geometry.ccMesh#

Creates a partial clone from selected triangles. Automatically handles vertex remapping, normals, materials, and texture coordinates.

place_iterator_at_beginning(self)#

Places the mesh iterator at the beginning.

Returns:

None

process_scalar_field(self, process_type)#

Applies process to the mesh scalar field (the one associated to its vertices in fact).

Parameters:

process_type (cloudViewer.geometry.MeshScalarFieldProcessType) –

Returns:

bool

refresh_bbox(self)#

Forces bounding-box update.

Returns:

None

remove_all_children(self)#

Clear all children in the geometry.

Returns:

None

remove_child(*args, **kwargs)#

Overloaded function.

  1. remove_child(self: cloudViewer.geometry.ccHObject, child: cloudViewer.geometry.ccHObject) -> None

Removes a specific child.

  1. remove_child(self: cloudViewer.geometry.ccHObject, pos: typing.SupportsInt) -> None

Removes a specific child given its index.

remove_degenerate_triangles(self)#

Function that removes degenerate triangles, i.e., triangles that references a single vertex multiple times in a single triangle. They are usually the product of removing duplicated vertices.

Returns:

cloudViewer.geometry.ccMesh

remove_duplicated_triangles(self)#

Function that removes duplicated triangles, i.e., removes triangles that reference the same three vertices, independent of their order.

Returns:

cloudViewer.geometry.ccMesh

remove_duplicated_vertices(self)#

Function that removes duplicated verties, i.e., vertices that have identical coordinates.

Returns:

cloudViewer.geometry.ccMesh

remove_material_indexes(self)#

Removes any per-triangle material indexes.

Returns:

None

remove_non_manifold_edges(self)#

Function that removes all non-manifold edges, by successively deleting triangles with the smallest surface area adjacent to the non-manifold edge until the number of adjacent triangles to the edge is <= 2.

Returns:

cloudViewer.geometry.ccMesh

remove_texture_coord_indexes(self)#

Remove per-triangle tex coords indexes.

Returns:

None

remove_triangle_normal_indexes(self)#

Removes any per-triangle triplets of normal indexes.

Returns:

None

remove_triangles(self, index)#

Removes triangles.

Parameters:

index (SupportsInt) –

Returns:

None

remove_triangles_by_index(self, triangle_indices)#

This function removes the triangles with index in triangle_indices. Call remove_unreferenced_vertices to clean up vertices afterwards.

Parameters:

triangle_indices (collections.abc.Sequence[SupportsInt]) – 1D array of triangle indices that should be removed from the TriangleMesh.

Returns:

None

remove_triangles_by_mask(self, triangle_mask)#

This function removes the triangles where triangle_mask is set to true. Call remove_unreferenced_vertices to clean up vertices afterwards.

Parameters:

triangle_mask (collections.abc.Sequence[bool]) – 1D bool array, True values indicate triangles that should be removed.

Returns:

None

remove_unreferenced_vertices(self)#

This function removes vertices from the triangle mesh that are not referenced in any triangle of the mesh.

Returns:

cloudViewer.geometry.ccMesh

remove_vertices_by_index(self, vertex_indices)#

This function removes the vertices with index in vertex_indices. Note that also all triangles associated with the vertices are removed.

Parameters:

vertex_indices (collections.abc.Sequence[SupportsInt]) – 1D array of vertex indices that should be removed from the TriangleMesh.

Returns:

None

remove_vertices_by_mask(self, vertex_mask)#

This function removes the vertices that are masked in vertex_mask. Note that also all triangles associated with the vertices are removed.

Parameters:

vertex_mask (collections.abc.Sequence[bool]) – 1D bool array, True values indicate vertices that should be removed.

Returns:

None

reserve(self, triangles_number)#

Reserves the memory to store the vertex indexes (3 per triangle).

Parameters:

triangles_number (SupportsInt) –

Returns:

bool

reserve_material_indexes(self)#

Reserves memory to store per-triangle material index.

Returns:

bool

reserve_texture_coord_indexes(self)#

Reserves memory to store per-triangle triplets of tex coords indexes.

Returns:

bool

reserve_triangle_normal_indexes(self)#

Reserves memory to store per-triangle triplets of normal indexes.

Returns:

bool

reset_glTransformation_history(self)#

Resets the transformation ‘history’ matrix.

Returns:

None

reset_gl_transformation(self)#

Resets associated GL transformation.

Returns:

None

resize(self, triangles_number)#

If the new number of elements is smaller than the actual size,the overflooding elements will be deleted.

Parameters:

triangles_number (SupportsInt) –

Returns:

bool

rotate(*args, **kwargs)#

Overloaded function.

  1. rotate(self, R)

    Apply rotation to the geometry coordinates and normals.

Parameters:

R (Annotated[numpy.typing.ArrayLike, numpy.float64,) – The rotation matrix

Returns:

cloudViewer.geometry.ccHObject

  1. rotate(self, R, center)

    Apply rotation to the geometry coordinates and normals.

Parameters:
  • R (Annotated[numpy.typing.ArrayLike, numpy.float64,) – The rotation matrix

  • center (Annotated[numpy.typing.ArrayLike, numpy.float64,) – Rotation center used for transformation

Returns:

cloudViewer.geometry.ccHObject

rotate_gl(self, rotation)#

Multiplies (left) current GL transformation by a rotation matrix.

Parameters:

rotation (Annotated[numpy.typing.ArrayLike, numpy.float64,) –

Returns:

None

sample_points(self, density_based, sampling_parameter, with_normals, with_rgb, with_texture)#

Samples points on a mesh.

Parameters:
Returns:

cloudViewer.geometry.ccPointCloud

sample_points_poisson_disk(self, number_of_points, init_factor=5, pcl=None, use_triangle_normal=False, seed=-1)#

Function to sample points from the mesh, where each point has approximately the same distance to the neighbouring points (blue noise). Method is based on Yuksel, “Sample Elimination for Generating Poisson Disk Sample Sets”, EUROGRAPHICS, 2015.

Parameters:
  • number_of_points (SupportsInt) – Number of points that should be sampled.

  • init_factor (SupportsFloat, optional, default=5) – Factor for the initial uniformly sampled PointCloud. This init PointCloud is used for sample elimination.

  • pcl (cloudViewer.geometry.ccPointCloud, optional, default=None) – Initial PointCloud that is used for sample elimination. If this parameter is provided the init_factor is ignored.

  • use_triangle_normal (bool, optional, default=False) – If True assigns the triangle normals instead of the interpolated vertex normals to the returned points. The triangle normals will be computed and added to the mesh if necessary.

  • seed (SupportsInt, optional, default=-1) – Seed value used in the random generator, set to -1 to use a random seed value with each function call.

Returns:

cloudViewer.geometry.ccPointCloud

sample_points_uniformly(self, number_of_points=100, use_triangle_normal=False, seed=-1)#

Function to uniformly sample points from the mesh.

Parameters:
  • number_of_points (SupportsInt, optional, default=100) – Number of points that should be uniformly sampled.

  • use_triangle_normal (bool, optional, default=False) – If True assigns the triangle normals instead of the interpolated vertex normals to the returned points. The triangle normals will be computed and added to the mesh if necessary.

  • seed (SupportsInt, optional, default=-1) – Seed value used in the random generator, set to -1 to use a random seed value with each function call.

Returns:

cloudViewer.geometry.ccPointCloud

scale(*args, **kwargs)#

Overloaded function.

  1. scale(self, scale)

    Apply scaling to the geometry coordinates.

Parameters:

scale (SupportsFloat) –

Returns:

cloudViewer.geometry.ccHObject

  1. scale(self, scale, center)

    Apply scaling to the geometry coordinates.

Parameters:
  • scale (SupportsFloat) –

  • center (Annotated[numpy.typing.ArrayLike, numpy.float64,) – Scale center used for transformation

Returns:

cloudViewer.geometry.ccHObject

select_by_index(self, indices, cleanup=True)#

Function to select mesh from input triangle mesh into output triangle mesh. input: The input triangle mesh. indices: Indices of vertices to be selected.

Parameters:
  • indices (collections.abc.Sequence[SupportsInt]) – Indices of vertices to be selected.

  • cleanup (bool, optional, default=True) – If true calls number of mesh cleanup functions to remove unreferenced vertices and degenerate triangles

Returns:

cloudViewer.geometry.ccMesh

set_associated_cloud(self, cloud)#

Sets the associated vertices cloud (warning)

Parameters:

cloud (cloudViewer.geometry.ccGenericPointCloud) –

Returns:

None

set_bottom_radius(self, radius)#

Sets cone bottom radius.

Parameters:

radius (SupportsFloat) – changes primitive content (calls ccGenericPrimitive::updateRepresentation).

Returns:

None

set_color(self, color)#

Sets primitive color (shortcut).

Parameters:

color (Annotated[numpy.typing.ArrayLike, numpy.float64,) – rgb color.

Returns:

None

set_drawing_precision(self, steps)#

Sets drawing precision.

Parameters:

steps (SupportsInt) – Warnings: - steps should always be >= ccGenericPrimitive::MIN_DRAWING_PRECISION- changes primitive content(calls ccGenericPrimitive::updateRepresentation)- may fail if not enough memory!- param steps drawing precisionreturn success(false if not enough memory)

Returns:

bool

set_glTransformation_history(self, mat)#

Sets the transformation ‘history’ matrix (handle with care!).

Parameters:

mat (ccGLMatrix) – transformation ‘history’ matrix

Returns:

None

set_gl_transformation(self, transformation)#

Associates entity with a GL transformation (rotation + translation).

Parameters:

transformation (Annotated[numpy.typing.ArrayLike, numpy.float64,) –

Returns:

None

set_height(self, height)#

Sets cone height

Parameters:

height (SupportsFloat) – changes primitive content (calls ccGenericPrimitive::updateRepresentation).

Returns:

None

set_lineWidth_recursive(self, width)#

Sets the line width.

Parameters:

width (SupportsFloat) – line width

Returns:

None

set_material_index(self, triangle_index, material_index)#

Adds triangle material index for next triangle.

Parameters:
Returns:

None

set_name(self, arg0)#

Sets object name.

Parameters:

arg0 (str) –

Returns:

None

set_opacity(self, opacity)#

Set opacity activation state.

Parameters:

opacity (SupportsFloat) –

Returns:

None

set_pointSize_recursive(self, pSize)#

Sets the point size.

Parameters:

pSize (SupportsInt) – point size

Returns:

None

set_selected(self, state)#

Selects/Unselects entity.

Parameters:

state (bool) –

Returns:

None

set_temp_color(self, color, auto_activate=True)#

Sets current temporary (unique).

Parameters:
  • color (Annotated[numpy.typing.ArrayLike, numpy.float64,) – rgb color

  • auto_activate (bool, optional, default=True) – auto activates temporary color

Returns:

None

set_texture_coord_indexes(self, triangle_index, i1, i2, i3)#

Sets a triplet of tex coords indexes for a given triangle.

Parameters:
Returns:

None

set_top_radius(self, radius)#

Sets cone top radius.

Parameters:

radius (SupportsFloat) – changes primitive content (calls ccGenericPrimitive::updateRepresentation).

Returns:

None

set_triangle(self, index, triangle)#

set triangle indices by index

Parameters:
Returns:

None

set_triangle_normal(self, index, triangle_normal)#

set triangle normal by index

Parameters:
Returns:

bool

set_triangle_normal_indexes(*args, **kwargs)#

Overloaded function.

  1. set_triangle_normal_indexes(self, triangle_index, value)

    Adds a triplet of normal indexes for next triangle.

Parameters:
Returns:

bool

  1. set_triangle_normal_indexes(self, triangle_index, i1, i2, i3)

    Adds a triplet of normal indexes for next triangle.

Parameters:
Returns:

None

set_triangle_normals(self, triangle_normals)#

int array of shape (num_triangles, 3), use numpy.asarray() to access data: List of triangles denoted by the index of points forming the triangle.

Parameters:

triangle_normals (cloudViewer.utility.Vector3dVector) –

Returns:

bool

set_triangles(self, triangles)#

int array of shape (num_triangles, 3), use numpy.asarray() to access data: List of triangles denoted by the index of points forming the triangle.

Parameters:

triangles (cloudViewer.utility.Vector3iVector) –

Returns:

None

set_unique_id(self, ID)#

Changes unique ID.

Parameters:

ID (SupportsInt) –

Returns:

None

set_vertex_color(self, index, color)#

set vertex color by given index.

Parameters:
Returns:

None

set_vertex_colors(*args, **kwargs)#

Overloaded function.

  1. set_vertex_colors(self, colors)

    float64 array of shape (num_vertices, 3), range [0, 1] , use numpy.asarray() to access data: RGB colors of vertices.

Parameters:

colors (cloudViewer.utility.Vector3dVector) –

Returns:

None

  1. set_vertex_colors(self, cloud)

    Sets the associated vertices cloud (warning)

Parameters:

cloud (Annotated[numpy.typing.ArrayLike, numpy.float64,) –

Returns:

None

set_vertex_normal(self, index, normal)#

set vertex normal by given index.

Parameters:
Returns:

None

set_vertex_normals(self, normals)#

float64 array of shape (num_vertices, 3), use numpy.asarray() to access data: Vertex normals.

Parameters:

normals (cloudViewer.utility.Vector3dVector) –

Returns:

None

set_vertice(self, index, vertice)#

set vertex coordinate by given index.

Parameters:
Returns:

None

set_vertices(self, vertices)#

float64 array of shape (num_vertices, 3), use numpy.asarray() to access data: Vertex coordinates.

Parameters:

vertices (cloudViewer.utility.Vector3dVector) –

Returns:

None

set_visible(self, state)#

Sets entity visibility.

Parameters:

state (bool) –

Returns:

None

sf_shown(self)#

Returns whether active scalar field is visible.

Returns:

bool

shift_triangle_indexes(self, shift)#

Shifts all triangles indexes.

Parameters:

shift (SupportsInt) –

Returns:

None

show_3d_name(self, state)#

Sets whether name should be displayed in 3D.

Parameters:

state (bool) –

Returns:

None

show_colors(self, state)#

Sets colors visibility.

Parameters:

state (bool) –

Returns:

None

show_materials(self, state)#

Sets whether textures should be displayed or not.

Parameters:

state (bool) –

Returns:

None

show_normals(self, state)#

Sets normals visibility.

Parameters:

state (bool) –

Returns:

None

show_points(self, state)#

Sets whether mesh should be displayed as a point cloud or with plain facets.

Parameters:

state (bool) –

Returns:

None

show_sf(self, state)#

Sets active scalar field visibility.

Parameters:

state (bool) –

Returns:

None

show_triangle_norms(self, state)#

Sets whether to show or not per-triangle normals.

Parameters:

state (bool) –

Returns:

None

show_wired(self, state)#

Sets whether mesh should be displayed as a wire or with plain facets.

Parameters:

state (bool) –

Returns:

None

shrink_triangles(self)#

Removes unused triangle capacity.

Returns:

None

shrink_vertexes(self)#

Removes unused vertex capacity.

Returns:

None

simplify_quadric_decimation(self, target_number_of_triangles, maximum_error=inf, boundary_weight=1.0)#

Function to simplify mesh using Quadric Error Metric Decimation by Garland and Heckbert

Parameters:
  • target_number_of_triangles (SupportsInt) – The number of triangles that the simplified mesh should have. It is not guranteed that this number will be reached.

  • maximum_error (SupportsFloat, optional, default=inf) – The maximum error where a vertex is allowed to be merged

  • boundary_weight (SupportsFloat, optional, default=1.0) – A weight applied to edge vertices used to preserve boundaries

Returns:

cloudViewer.geometry.ccMesh

simplify_vertex_clustering(self, voxel_size, contraction=<SimplificationContraction.Average: 0>)#

Function to simplify mesh using vertex clustering.

Parameters:
  • voxel_size (SupportsFloat) – The size of the voxel within vertices are pooled.

  • (cloudViewer.geometry.SimplificationContraction (contraction) – 0>): Method to aggregate vertex information. Average computes a simple average, Quadric minimizes the distance to the adjacent planes.

  • optional – 0>): Method to aggregate vertex information. Average computes a simple average, Quadric minimizes the distance to the adjacent planes.

  • default=<SimplificationContraction.Average – 0>): Method to aggregate vertex information. Average computes a simple average, Quadric minimizes the distance to the adjacent planes.

Returns:

cloudViewer.geometry.ccMesh

size(self)#

Returns the number of triangles.

Returns:

int

stippling_enabled(self)#

Returns whether polygon stippling is enabled or not.

Returns:

bool

subdivide(self, max_area)#

Subdivides mesh (so as to ensure that all triangles are falls below ‘max_area’).

Parameters:

max_area (SupportsFloat) –

Returns:

cloudViewer.geometry.ccMesh

subdivide_loop(self, number_of_iterations=1)#

Function subdivide mesh using Loop’s algorithm. Loop, “Smooth subdivision surfaces based on triangles”, 1987.

Parameters:

number_of_iterations (SupportsInt, optional, default=1) – Number of iterations. A single iteration splits each triangle into four triangles.

Returns:

cloudViewer.geometry.ccMesh

subdivide_midpoint(self, number_of_iterations=1)#

Function subdivide mesh using midpoint algorithm.

Parameters:

number_of_iterations (SupportsInt, optional, default=1) – Number of iterations. A single iteration splits each triangle into four triangles that cover the same surface.

Returns:

cloudViewer.geometry.ccMesh

swap_triangles(self, first_index, second_index)#

Swaps two triangles.

Parameters:
Returns:

None

to_file(self, filename, data_version)#

Saves data to binary stream.

Parameters:
Returns:

bool

toggle_colors(self)#

Toggles colors display state.

Returns:

None

toggle_materials(self)#

Toggles material display state.

Returns:

None

toggle_normals(self)#

Toggles normals display state.

Returns:

None

toggle_sf(self)#

Toggles SF display state.

Returns:

None

toggle_show_name(self)#

Toggles name in 3D display state.

Returns:

None

toggle_visibility(self)#

Toggles visibility.

Returns:

None

transform(self, arg0)#

Apply transformation (4x4 matrix) to the geometry coordinates.

Parameters:

arg0 (Annotated[numpy.typing.ArrayLike, numpy.float64,) –

Returns:

cloudViewer.geometry.ccHObject

transform_triangle_normals(self, transformation)#

Transforms the mesh per-triangle normals.

Parameters:

transformation (Annotated[numpy.typing.ArrayLike, numpy.float64,) –

Returns:

None

translate(self, translation, relative=True)#

Apply translation to the geometry coordinates.

Parameters:
  • translation (Annotated[numpy.typing.ArrayLike, numpy.float64,) – A 3D vector to transform the geometry

  • relative (bool, optional, default=True) – If true, the translation vector is directly added to the geometry coordinates. Otherwise, the center is moved to the translation vector.

Returns:

cloudViewer.geometry.ccHObject

translate_gl(self, translation)#

Translates current GL transformation by a rotation matrix.

Parameters:

translation (Annotated[numpy.typing.ArrayLike, numpy.float64,) –

Returns:

None

triangle(self, index)#

get triangle indices by index

Parameters:

index (SupportsInt) –

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.int32], “[3, 1]”]

triangle_normal(self, index)#

get triangle indices by index

Parameters:

index (SupportsInt) –

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

triangle_normals(self)#

int array of shape (num_triangles, 3), use numpy.asarray() to access data: List of triangles denoted by the index of points forming the triangle.

Returns:

cloudViewer.utility.Vector3dVector

triangle_norms_shown(self)#

Returns whether per-triangle normals are shown or not .

Returns:

bool

triangles(self)#

int array of shape (num_triangles, 3), use numpy.asarray() to access data: List of triangles denoted by the index of points forming the triangle.

Returns:

cloudViewer.utility.Vector3iVector

static triangulate(cloud, type, update_normals=False, max_edge_length=0, dim=2)#

Creates a Delaunay 2.5D mesh from a point cloud See cloudViewer::PointProjectionTools::computeTriangulation.

Parameters:
Returns:

cloudViewer.geometry.ccMesh

static triangulate_two_polylines(poly1: ccPolyline, poly2: ccPolyline) cloudViewer.geometry.ccMesh#

Creates a Delaunay 2.5D mesh from two polylines.

vertex_color(self, index)#

get vertex color by given index.

Parameters:

index (SupportsInt) –

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

vertex_colors(self)#

float64 array of shape (num_vertices, 3), range [0, 1] , use numpy.asarray() to access data: RGB colors of vertices.

Returns:

cloudViewer.utility.Vector3dVector

vertex_normal(self, index)#

get vertex normal by given index.

Parameters:

index (SupportsInt) –

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

vertex_normals(self)#

float64 array of shape (num_vertices, 3), use numpy.asarray() to access data: Vertex normals.

Returns:

cloudViewer.utility.Vector3dVector

vertice(self, index)#

get vertex coordinate by given index.

Parameters:

index (SupportsInt) –

Returns:

typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]

vertice_size(self)#

Returns vertices number.

Returns:

int

vertices(self)#

float64 array of shape (num_vertices, 3), use numpy.asarray() to access data: Vertex coordinates.

Returns:

cloudViewer.utility.Vector3dVector

BBOX = <Type.BBOX: 35184372088835>#
BOX = <Type.BOX: 524809>#
CAMERA_SENSOR = <Type.CAMERA_SENSOR: 4294975489>#
CONE = <Type.CONE: 262665>#
CUSTOM_H_OBJECT = <Type.CUSTOM_H_OBJECT: 129>#
CYLINDER = <Type.CYLINDER: 393737>#
DISH = <Type.DISH: 1049097>#
EXTRU = <Type.EXTRU: 2097673>#
FACET = <Type.FACET: 8388609>#
GBL_SENSOR = <Type.GBL_SENSOR: 134225921>#
IMAGE = <Type.IMAGE: 4097>#
IMAGE2 = <Type.IMAGE2: 562949953421315>#
LABEL_2D = <Type.LABEL_2D: 35>#
LINESET = <Type.LINESET: 2251799813685249>#
MATERIAL_SET = <Type.MATERIAL_SET: 16777222>#
MESH = <Type.MESH: 513>#
MESH_GROUP = <Type.MESH_GROUP: 517>#
OLD_CYLINDER_ID = <Type.OLD_CYLINDER_ID: 131593>#
ORIENTED_BBOX = <Type.ORIENTED_BBOX: 70368744177667>#
PLANE = <Type.PLANE: 16905>#
POINT_CLOUD = <Type.POINT_CLOUD: 257>#
POINT_KDTREE = <Type.POINT_KDTREE: 4194307>#
POINT_OCTREE = <Type.POINT_OCTREE: 1027>#
POINT_OCTREE2 = <Type.POINT_OCTREE2: 140737488355331>#
POLY_LINE = <Type.POLY_LINE: 2049>#
PRIMITIVE = <Type.PRIMITIVE: 521>#
QUADRIC = <Type.QUADRIC: 8589935113>#
RGBD_IMAGE = <Type.RGBD_IMAGE: 1125899906842627>#
SENSOR = <Type.SENSOR: 8193>#
SPHERE = <Type.SPHERE: 33289>#
SUB_MESH = <Type.SUB_MESH: 515>#
TETRA_MESH = <Type.TETRA_MESH: 27021597764222977>#
TORUS = <Type.TORUS: 66057>#
VIEWPORT_2D_LABEL = <Type.VIEWPORT_2D_LABEL: 99>#
VIEWPORT_2D_OBJECT = <Type.VIEWPORT_2D_OBJECT: 67>#
VOXEL_GRID = <Type.VOXEL_GRID: 281474976710657>#
property adjacency_list#

The set adjacency_list[i] contains the indices of adjacent vertices of vertex i.

Type:

List of Sets

property textures#

The texture images.

Type:

cloudViewer.geometry.Image

property triangle_material_ids#

material index associated with each triangle

Type:

int array of shape (num_trianges, 1), use numpy.asarray() to access data

property triangle_uvs#

List of uvs denoted by the index of points forming the triangle.

Type:

float64 array of shape (3 * num_triangles, 2), use numpy.asarray() to access data