cloudViewer.geometry.ccPointCloud#

class cloudViewer.geometry.ccPointCloud#

ccPointCloud class. A point cloud consists of point coordinates, and optionally point colors and point normals.

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.ccPointCloud) -> None

Default constructor

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

Copy constructor

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

  2. __init__(self: cloudViewer.geometry.ccPointCloud, points: cloudViewer.utility.Vector3dVector, name: str = ‘cloud’) -> None

Create a PointCloud from points

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_grey_color(self, grey)#

Pushes a grey color on stack (shortcut).

Parameters:

grey (SupportsInt) –

Returns:

None

add_sf(*args, **kwargs)#

Overloaded function.

  1. add_sf(self, unique_name)

    Creates a new scalar field and registers it.

Parameters:

unique_name (str) –

Returns:

int

  1. add_sf(self, sf)

    Creates a new scalar field and registers it.

Parameters:

sf (cloudViewer.utility.ccScalarField) –

Returns:

int

append(self, input_cloud, start_count, ignore_children=False)#

Appends a cloud to this one

Parameters:
Returns:

cloudViewer.geometry.ccPointCloud

capacity(self)#

Returns cloud capacity (i.e. reserved size).

Returns:

int

clear(self)#

Clears the entity from all its points and features.

Returns:

None

clone(self, ignore_children=False)#

Clones this entity.

Parameters:

ignore_children (bool, optional, default=False) –

Returns:

cloudViewer.geometry.ccGenericPointCloud

clone_this(self, ignore_children=True)#

All the main features of the entity are cloned, except from the octree and the points visibility information.

Parameters:

ignore_children (bool, optional, default=True) –

Returns:

cloudViewer.geometry.ccPointCloud

cluster_dbscan(self, eps, min_points, print_progress=False)#

Cluster PointCloud using the DBSCAN algorithm Ester et al., ‘A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise’, 1996. Returns a list of point labels, -1 indicates noise according to the algorithm.

Parameters:
  • eps (SupportsFloat) – Density parameter that is used to find neighboring points.

  • min_points (SupportsInt) – Minimum number of points to form a cluster.

  • print_progress (bool, optional, default=False) – If true the progress is visualized in the console.

Returns:

cloudViewer.utility.IntVector

color(self, index)#

get point color by given index.

Parameters:

index (SupportsInt) –

Returns:

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

colorize(self, r, g, b)#

Multiplies all color components of all points by coefficients.

Parameters:
Returns:

bool

colors(self)#

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

Returns:

cloudViewer.utility.Vector3dVector

colors_have_changed(self)#

Notify a modification of color/scalar field display parameters or contents.

Returns:

None

colors_shown(self)#

Returns whether colors are shown or not.

Returns:

bool

compute_closest_points(self, other_cloud, octree_level=0)#

Computes the closest point of this cloud relatively to another cloud

Parameters:
Returns:

cloudViewer.geometry.ReferenceCloud

compute_convex_hull(self)#

Computes the convex hull of the point cloud.

Returns:

tuple[ccMesh, list[int]]

compute_gravity_center(self)#

Returns the cloud gravity center

Returns:

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

compute_mahalanobis_distance(self)#

Function to compute the Mahalanobis distance for points in a point cloud. See: https://en.wikipedia.org/wiki/Mahalanobis_distance.

Returns:

cloudViewer.utility.DoubleVector

compute_mean_and_covariance(self)#

Function to compute the mean and covariance matrix of a point cloud.

Returns:

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

compute_nearest_neighbor_distance(self)#

Function to compute the distance from a point to its nearest neighbor in the point cloud

Returns:

cloudViewer.utility.DoubleVector

compute_point_cloud_distance(self, target)#

For each point in the source point cloud, compute the distance to the target point cloud.

Parameters:

target (cloudViewer.geometry.ccPointCloud) – The target point cloud.

Returns:

cloudViewer.utility.DoubleVector

compute_resolution(self)#

Function to compute the point cloud resolution.

Returns:

float

convert_current_sf_to_colors(self, mix_with_existing_color=False)#

Converts current scalar field (values & display parameters) to RGB colors.

Parameters:

mix_with_existing_color (bool, optional, default=False) –

Returns:

bool

convert_normal_to_dipdir_sfs(self)#

Converts normals to two scalar fields: ‘dip’ and ‘dip direction’.

Returns:

tuple[cloudViewer.utility.ccScalarField, cloudViewer.utility.ccScalarField]

convert_normal_to_rgb(self)#

Converts normals to RGB colors.

Returns:

bool

convert_rgb_to_grey_scale(self)#

Converts RGB to grey scale colors.

Returns:

bool

create_cloud_from_visibility_selection(self, remove_selected_points=False, vis_table, silent=False)#

Creates a new point cloud with only the ‘visible’ points (as defined by the visibility array).

Parameters:
  • remove_selected_points (bool, optional, default=False) –

  • vis_table (std::vector) – ()

  • silent (bool, optional, default=False) –

Returns:

cloudViewer.geometry.ccGenericPointCloud

static create_from_depth_image(depth, intrinsic, extrinsic, depth_scale=1000.0, depth_trunc=1000.0, stride=1, project_valid_depth_only=True)#
Factory function to create a pointcloud from a depth image and a

camera. Given depth value d at (u, v) image coordinate, the corresponding 3d point is:

  • z = d / depth_scale

  • x = (u - cx) * z / fx

  • y = (v - cy) * z / fy

Parameters:
  • depth (cloudViewer::geometry::Image) – The input depth image can be either a float image, or a uint16_t image.

  • intrinsic (cloudViewer.camera.PinholeCameraIntrinsic) – Intrinsic parameters of the camera.

  • extrinsic (Annotated[numpy.typing.ArrayLike, numpy.float64,) –

  • depth_scale (SupportsFloat, optional, default=1000.0) – The depth is scaled by 1 / depth_scale.

  • depth_trunc (SupportsFloat, optional, default=1000.0) – Truncated at depth_trunc distance.

  • stride (SupportsInt, optional, default=1) – Sampling factor to support coarse point cloud extraction.

  • project_valid_depth_only (bool, optional, default=True) –

Returns:

cloudViewer.geometry.ccPointCloud

static create_from_rgbd_image(image, intrinsic, extrinsic, project_valid_depth_only=True)#
Factory function to create a pointcloud from an RGB-D image and a camera. Given depth value d at (u, v) image coordinate, the corresponding 3d point is: - z = d / depth_scale
  • x = (u - cx) * z / fx

  • y = (v - cy) * z / fy

Parameters:
  • image (cloudViewer::geometry::RGBDImage) – The input image.

  • intrinsic (cloudViewer.camera.PinholeCameraIntrinsic) – Intrinsic parameters of the camera.

  • extrinsic (Annotated[numpy.typing.ArrayLike, numpy.float64,) –

  • project_valid_depth_only (bool, optional, default=True) –

Returns:

cloudViewer.geometry.ccPointCloud

crop(*args, **kwargs)#

Overloaded function.

  1. crop(self, bounding_box)

    Function to crop input pointcloud into output pointcloud

Parameters:

bounding_box (ccBBox) – ccBBox to crop points

Returns:

cloudViewer.geometry.ccPointCloud

  1. crop(self, bounding_box)

    Function to crop input pointcloud into output pointcloud

Parameters:

bounding_box (ecvOrientedBBox) – ccBBox to crop points

Returns:

cloudViewer.geometry.ccPointCloud

crop_2d(self, polyline, ortho_dim, inside=True)#

Crops the cloud inside (or outside) a 2D polyline

Parameters:
Returns:

cloudViewer.geometry.ccPointCloud

delete_all_sfs(self)#

Deletes all scalar fields associated to this cloud.

Returns:

None

delete_sf(self, index)#

Deletes a specific scalar field.

Parameters:

index (SupportsInt) –

Returns:

None

enable_gl_transformation(self, state)#

Enables/disables associated GL transformation.

Parameters:

state (bool) –

Returns:

None

enable_scalar_field(self)#

Enables the scalar field associated to the cloud.

Returns:

bool

enable_temp_color(self, state)#

Set temporary color activation state.

Parameters:

state (bool) –

Returns:

None

enhance_rgb_with_intensity_sf(self, sf_index, use_intensity_range=False, min_intensity=0.0, max_intensity=1.0)#

Enhances the RGB colors with the current scalar field (assuming it’s intensities).

Parameters:
Returns:

bool

estimate_covariances(self, search_param=geometry::KDTreeSearchParamKNN with knn = 30)#

Function to compute the covariance matrix for each point in the point cloud

Parameters:

search_param (cloudViewer.geometry.KDTreeSearchParam, optional, default=geometry::KDTreeSearchParamKNN with knn = 30) – The KDTree search parameters for neighborhood search.

Returns:

None

estimate_normals(self, search_param=geometry::KDTreeSearchParamKNN with knn = 30, fast_normal_computation=True)#

Function to compute the normals of a point cloud. Normals are oriented with respect to the input point cloud if normals exist

Parameters:
  • search_param (cloudViewer.geometry.KDTreeSearchParam, optional, default=geometry::KDTreeSearchParamKNN with knn = 30) – The KDTree search parameters for neighborhood search.

  • fast_normal_computation (bool, optional, default=True) – If true, the normal estiamtion uses a non-iterative method to extract the eigenvector from the covariance matrix. This is faster, but is not as numerical stable.

Returns:

bool

static estimate_point_covariances(input, search_param=geometry::KDTreeSearchParamKNN with knn = 30)#

Static function to compute the covariance matrix for each point in the given point cloud, doesn’t change the input

Parameters:
Returns:

cloudViewer.utility.Matrix3dVector

execute_ransac(self: cloudViewer.geometry.ccPointCloud, params: cloudViewer.geometry.RansacParams = geometry::RansacParams with epsilon = 0.005000 and bitmapEpsilon = 0.010000 and supportPoints = 500 and maxNormalDev_deg = 25.000000 and probability = 0.010000 and randomColor = 1 and minRadius = 0.000000 and maxRadius = 1000000.000000, print_progress: bool = False) list[cloudViewer.geometry.RansacResult]#

Cluster ccPointCloud using the RANSAC algorithm, Wrapper to Schnabel et al. library for automatic shape detection in point cloud ,Efficient RANSAC for Point - Cloud Shape Detection, Ruwen Schnabel, Roland Wahl, Returns a list of ransac point labels and shape entity(ccGenericPrimitive)

export_coord_to_sf(self, export_x=False, export_y=False, export_z=False)#

Exports the specified coordinate dimension(s) to scalar field(s).

Parameters:
  • export_x (bool, optional, default=False) –

  • export_y (bool, optional, default=False) –

  • export_z (bool, optional, default=False) –

Returns:

bool

export_normal_to_sf(self, export_x=False, export_y=False, export_z=False)#

Exports the specified normal dimension(s) to scalar field(s).

Parameters:
  • export_x (bool, optional, default=False) –

  • export_y (bool, optional, default=False) –

  • export_z (bool, optional, default=False) –

Returns:

bool

farthest_point_down_sample(self: cloudViewer.geometry.ccPointCloud, num_samples: SupportsInt, start_index: SupportsInt = 0) cloudViewer.geometry.ccPointCloud#

Index to start downsampling from. Valid index is a non-negative number less than number of points in the input pointcloud.

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_points_by_sf(*args, **kwargs)#

Overloaded function.

  1. filter_points_by_sf(self, min_val, max_val, outside=False)

    Filters out points whose scalar values falls into an interval.

Parameters:
Returns:

cloudViewer.geometry.ccPointCloud

  1. filter_points_by_sf(self, values, outside=False)

    Filters out points whose scalar values falls into an interval.

Parameters:
Returns:

cloudViewer.geometry.ccPointCloud

find(self, unique_id)#

Finds an entity in this object hierarchy.

Parameters:

unique_id (SupportsInt) –

Returns:

cloudViewer.geometry.ccHObject

static from(*args, **kwargs)#

Overloaded function.

  1. from(cloud: cloudViewer.geometry.GenericIndexedCloud, source_cloud: cloudViewer.geometry.ccGenericPointCloud = None) -> cloudViewer.geometry.ccPointCloud

‘GenericCloud’ is a very simple and light interface from cloudViewer. It ismeant to give access to points coordinates of any cloud(on the condition it implements the GenericCloud interface of course). See cloudViewer documentation for more information about GenericClouds.As the GenericCloud interface is very simple, only points are imported.Note : throws an ‘int’ exception in case of error(see CTOR_ERRORS)-param cloud a GenericCloud structure-param source_cloud cloud from which main parameters will be imported(optional)

  1. from(source_cloud: cloudViewer.geometry.ccPointCloud, indices: collections.abc.Sequence[typing.SupportsInt]) -> cloudViewer.geometry.ccPointCloud

Function to select points from input ccPointCloud into output ccPointCloud.Points with indices in param indices are selected

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_axis_aligned_bounding_box(self)#

Returns an axis-aligned bounding box of the geometry.

Returns:

ccBBox

get_bounding_box(self)#

Returns the cloud bounding box.

Returns:

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

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(self, index)#

get point color by given index.

Parameters:

index (SupportsInt) –

Returns:

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

get_colors(self)#

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

Returns:

cloudViewer.utility.Vector3dVector

get_current_displayed_sf(self)#

Returns the currently displayed scalar (or 0 if none).

Returns:

cloudViewer.utility.ccScalarField

get_current_input_sf(self)#

Returns the scalar field currently associated to the cloud input.

Returns:

cloudViewer.utility.ScalarField

get_current_input_sf_index(self)#

Returns current INPUT scalar field index (or -1 if none).

Returns:

int

get_current_output_sf(self)#

Returns the scalar field currently associated to the cloud output.

Returns:

cloudViewer.utility.ScalarField

get_current_output_sf_index(self)#

Returns current OUTPUT scalar field index (or -1 if none).

Returns:

int

get_current_sf_index(self)#

Returns the currently displayed scalar field index (or -1 if none).

Returns:

int

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_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_point(self)#

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

Returns:

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

get_normal(self, index)#

get point normal by given index.

Parameters:

index (SupportsInt) –

Returns:

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

get_normals(self)#

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

Returns:

cloudViewer.utility.Vector3dVector

get_opacity(self)#

Get opacity.

Returns:

float

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

get_point(self, index)#

get point coordinate by given index.

Parameters:

index (SupportsInt) –

Returns:

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

get_point_color(self, point_index)#

Returns color corresponding to a given point.

Parameters:

point_index (SupportsInt) –

Returns:

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

get_point_displayed_distance(self, point_index)#

Returns scalar value associated to a given point.

Parameters:

point_index (SupportsInt) –

Returns:

float

get_point_normal(self, point_index)#

Returns normal corresponding to a given point.

Parameters:

point_index (SupportsInt) –

Returns:

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

get_point_normal_index(self, point_index)#

Returns compressed normal corresponding to a given point.

Parameters:

point_index (SupportsInt) –

Returns:

int

get_point_persistent(self, index)#

Returns the ith point as a persistent point).

Parameters:

index (SupportsInt) –

Returns:

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

get_point_scalar_value_color(self, point_index)#

Returns color corresponding to a given point associated scalar value.

Parameters:

point_index (SupportsInt) –

Returns:

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

get_point_size(self)#

Returns current point size

Returns:

int

get_points(self)#

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

Returns:

cloudViewer.utility.Vector3dVector

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_scalar_value(self, point_index)#

Returns the ith point associated scalar value.

Parameters:

point_index (SupportsInt) –

Returns:

float

get_scalar_value_color(self, value)#

Returns color corresponding to a given scalar value.

Parameters:

value (SupportsFloat) –

Returns:

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

get_sf_by_index(self, index)#

Returns a pointer to a specific scalar field.

Parameters:

index (SupportsInt) –

Returns:

cloudViewer.utility.ScalarField

get_sf_index_by_name(self, name)#

Returns the index of a scalar field represented by its name.

Parameters:

name (str) –

Returns:

int

get_sf_name(self, index)#

Returns the name of a specific scalar field.

Parameters:

index (SupportsInt) –

Returns:

str

get_temp_color(self)#

Returns current temporary (unique) color.

Returns:

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

get_unique_id(self)#

Returns object unique ID.

Returns:

int

get_visibility_array(*args, **kwargs)#

Overloaded function.

  1. get_visibility_array(self, )

    <unsigned char, std::allocator<unsigned char> >

Returns associated visibility array.

Parameters:

()

Returns:

std::vector

  1. get_visibility_array(self, )

    <unsigned char, std::allocator<unsigned char> >

Returns associated visibility array (const version).

Parameters:

()

Returns:

std::vector

get_visible_points(self, vis_table, silent=False)#

Returns a ReferenceCloud equivalent to the visibility array.

Parameters:
  • vis_table (std::vector) – ()

  • silent (bool, optional, default=False) –

Returns:

cloudViewer.geometry.ReferenceCloud

has_colors(self)#

Returns whether colors are enabled or not.

Returns:

bool

has_covariances(self: cloudViewer.geometry.ccPointCloud) bool#

Returns True if the point cloud contains covariances.

has_displayed_scalar_field(self)#

Returns whether an active scalar field is available or not.

Returns:

bool

has_normals(self)#

Returns whether normals are enabled or not.

Returns:

bool

has_points(self)#

Returns whether has points.

Returns:

bool

has_scalar_fields(self)#

Returns whether one or more scalar fields are instantiated.

Returns:

bool

has_sensor(self)#

Returns whether the mesh as an associated sensor or not.

Returns:

bool

hidden_point_removal(self, camera_location, radius)#

Removes hidden points from a point cloud and returns a mesh of the remaining points. Based on Katz et al. ‘Direct Visibility of Point Sets’, 2007. Additional information about the choice of radius for noisy point clouds can be found in Mehra et. al. ‘Visibility of Noisy Point Cloud Data’, 2010.

Parameters:
  • camera_location (Annotated[numpy.typing.ArrayLike, numpy.float64,) – All points not visible from that location will be removed

  • radius (SupportsFloat) – The radius of the sperical projection

Returns:

tuple[ccMesh, list[int]]

hide_points_by_sf(*args, **kwargs)#

Overloaded function.

  1. hide_points_by_sf(self, min_val, max_val)

    Hides points whose scalar values falls into an interval.

Parameters:
Returns:

None

  1. hide_points_by_sf(self, values)

    Hides points whose scalar values falls into an interval.

Parameters:

values (cloudViewer.utility.DoubleVector) –

Returns:

None

import_parameters_from(self, source)#

Imports the parameters from another cloud

Parameters:

source (cloudViewer.geometry.ccGenericPointCloud) –

Returns:

None

interpolate_colors_from(self, other_cloud, octree_level=0)#

Interpolate colors from another cloud (nearest neighbor only)

Parameters:
Returns:

bool

invalidate_bbox(self)#

Invalidates bounding box.

Returns:

None

invert_normals(self)#

Inverts normals (if any).

Returns:

None

invert_visibility_array(self)#

Inverts the visibility array

Returns:

None

is_a(self, type)#

Returns whether the geometry is a type pointed.

Parameters:

type (SupportsInt) –

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_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_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_scalar_field_enabled(self)#

Returns true if the scalar field is enabled, false otherwise.

Returns:

bool

is_selected(self)#

Returns whether entity is selected or not.

Returns:

bool

is_serializable(self)#

Returns whether the instance is a serializable.

Returns:

bool

is_visibility_table_instantiated(self)#

Returns whether the visibility array is allocated or not

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

lock_visibility(self, state)#

Locks/unlocks visibility.

Parameters:

state (bool) –

Returns:

None

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

normal(self, index)#

get point normal by given index.

Parameters:

index (SupportsInt) –

Returns:

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

normalize_normals(self)#

Normalize point normals to length 1.

Returns:

cloudViewer.geometry.ccPointCloud

normals(self)#

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

Returns:

cloudViewer.utility.Vector3dVector

normals_have_changed(self)#

Notify a modification of normals display parameters or contents.

Returns:

None

normals_shown(self)#

Returns whether normals are shown or not.

Returns:

bool

orient_normals_consistent_tangent_plane(self, k)#

Function to orient the normals with respect to consistent tangent planes

Parameters:

k (SupportsInt) – Number of k nearest neighbors used in constructing the Riemannian graph used to propogate normal orientation.

Returns:

None

orient_normals_to_align_with_direction(self, orientation_reference)#

Function to orient the normals of a point cloud

Parameters:

orientation_reference (Annotated[numpy.typing.ArrayLike, numpy.float64,) – Normals are oriented with respect to orientation_reference.

Returns:

bool

orient_normals_towards_camera_location(self, camera_location)#

Function to orient the normals of a point cloud

Parameters:

camera_location (Annotated[numpy.typing.ArrayLike, numpy.float64,) – Normals are oriented with towards the camera_location.

Returns:

bool

paint_uniform_color(self, color)#

Assigns each point in the PointCloud the same color.

Parameters:

color (Annotated[numpy.typing.ArrayLike, numpy.float64,) – RGB color for the PointCloud.

Returns:

cloudViewer.geometry.ccPointCloud

partial_clone(self, selection)#

Creates a new point cloud object from a ReferenceCloud (selection).

Parameters:

selection (cloudViewer.geometry.ReferenceCloud) –

Returns:

cloudViewer.geometry.ccPointCloud

place_iterator_at_beginning(self)#

Sets the cloud iterator at the beginning.

Returns:

None

point(self, index)#

get point coordinate by given index.

Parameters:

index (SupportsInt) –

Returns:

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

points(self)#

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

Returns:

cloudViewer.utility.Vector3dVector

points_have_changed(self)#

Notify a modification of points display parameters or contents.

Returns:

None

random_down_sample(self, sampling_ratio)#

Function to downsample input pointcloud into output pointcloud randomly. The sample is generated by randomly sampling the indexes from the point cloud.

Parameters:

sampling_ratio (SupportsFloat) – Sampling ratio, the ratio of number of selected points to total number of points[0-1]

Returns:

cloudViewer.geometry.ccPointCloud

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_non_finite_points(self, remove_nan=True, remove_infinite=True)#

Function to remove non-finite points from the PointCloud

Parameters:
  • remove_nan (bool, optional, default=True) – Remove NaN values from the PointCloud

  • remove_infinite (bool, optional, default=True) – Remove infinite values from the PointCloud

Returns:

cloudViewer.geometry.ccPointCloud

remove_points(self, index)#

Remove points.

Parameters:

index (SupportsInt) –

Returns:

None

remove_radius_outlier(self, nb_points, radius)#

Function to remove points that have less than nb_points in a given sphere of a given radius

Parameters:
Returns:

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

remove_statistical_outlier(self, nb_neighbors, std_ratio)#

Function to remove points that are further away from their neighbors in average

Parameters:
  • nb_neighbors (SupportsInt) – Number of neighbors around the target point.

  • std_ratio (SupportsFloat) – Standard deviation ratio.

Returns:

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

rename_sf(self, index, name)#

Renames a specific scalar field.

Parameters:
Returns:

bool

reserve(self, points_number)#

Reserves memory for all the active features.

Parameters:

points_number (SupportsInt) –

Returns:

bool

reserve_colors(self)#

Reserves memory to store the RGB colors.

Returns:

bool

reserve_norms(self)#

Reserves memory to store the compressed normals.

Returns:

bool

reserve_points(self, points_number)#

Reserves memory to store the points coordinates.

Parameters:

points_number (SupportsInt) –

Returns:

bool

reset(self)#

Clears the cloud database.

Returns:

None

reset_glTransformation_history(self)#

Resets the transformation ‘history’ matrix.

Returns:

None

reset_gl_transformation(self)#

Resets associated GL transformation.

Returns:

None

reset_visibility_array(self)#

Resets the associated visibility array

Returns:

bool

resize(self, points_number)#

Resizes all the active features arrays.

Parameters:

points_number (SupportsInt) –

Returns:

bool

resize_colors(self, fill_with_white=False)#

Resizes the RGB colors array.

Parameters:

fill_with_white (bool, optional, default=False) –

Returns:

bool

resize_norms(self)#

Resizes the compressed normals array.

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

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

segment_plane(self, distance_threshold, ransac_n, num_iterations)#

Segments a plane in the point cloud using the RANSAC algorithm.

Parameters:
  • distance_threshold (SupportsFloat) – Max distance a point can be from the plane model, and still be considered an inlier.

  • ransac_n (SupportsInt) – Number of initial points to be considered inliers in each iteration.

  • num_iterations (SupportsInt) – Number of iterations.

Returns:

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

select_by_index(self, indices, invert=False)#

Function to select points from input pointcloud into output pointcloud.

Parameters:
Returns:

cloudViewer.geometry.ccPointCloud

set_color(self, index, color)#

set point color by given index.

Parameters:
Returns:

None

set_color_by_banding(self, dim, frequency)#

Assigns color to points by ‘banding’.

Parameters:
Returns:

bool

set_color_with_current_sf(self, mix_with_existing_color=False)#

Sets RGB colors with current scalar field (values & parameters).

Parameters:

mix_with_existing_color (bool, optional, default=False) –

Returns:

bool

set_colors(self, colors)#

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

Parameters:

colors (cloudViewer.utility.Vector3dVector) –

Returns:

None

set_current_displayed_sf(self, index)#

Sets the currently displayed scalar field.

Parameters:

index (SupportsInt) –

Returns:

None

set_current_input_sf_index(self, index)#

Sets the INPUT scalar field index (or -1 if none).

Parameters:

index (SupportsInt) –

Returns:

None

set_current_output_sf_index(self, index)#

Sets the OUTPUT scalar field index (or -1 if none).

Parameters:

index (SupportsInt) –

Returns:

None

set_current_sf(self, index)#

Sets both the INPUT & OUTPUT scalar field.

Parameters:

index (SupportsInt) –

Returns:

None

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_lineWidth_recursive(self, width)#

Sets the line width.

Parameters:

width (SupportsFloat) – line width

Returns:

None

set_name(self, arg0)#

Sets object name.

Parameters:

arg0 (str) –

Returns:

None

set_normal(self, index, normal)#

set point normal by given index.

Parameters:
Returns:

None

set_normals(self, normals)#

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

Parameters:

normals (cloudViewer.utility.Vector3dVector) –

Returns:

None

set_opacity(self, opacity)#

Set opacity activation state.

Parameters:

opacity (SupportsFloat) –

Returns:

None

set_point(self, index, point)#

set point coordinate by given index.

Parameters:
Returns:

None

set_pointSize_recursive(self, pSize)#

Sets the point size.

Parameters:

pSize (SupportsInt) – point size

Returns:

None

set_point_size(self, size)#

Sets point size

Parameters:

size (SupportsInt) –

Returns:

None

set_points(self, points)#

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

Parameters:

points (cloudViewer.utility.Vector3dVector) –

Returns:

None

set_scalar_value(self, point_index, value)#

Sets the ith point associated scalar value.

Parameters:
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_unique_id(self, ID)#

Changes unique ID.

Parameters:

ID (SupportsInt) –

Returns:

None

set_visible(self, state)#

Sets entity visibility.

Parameters:

state (bool) –

Returns:

None

sf_color_scale_shown(self)#

Returns whether color scale should be displayed or not.

Returns:

bool

sf_shown(self)#

Returns whether active scalar field is visible.

Returns:

bool

sfs_count(self)#

Returns the number of associated (and active) scalar fields.

Returns:

int

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_normals(self, state)#

Sets normals visibility.

Parameters:

state (bool) –

Returns:

None

show_sf(self, state)#

Sets active scalar field visibility.

Parameters:

state (bool) –

Returns:

None

show_sf_color_scale(self, state)#

Sets whether color scale should be displayed or not.

Parameters:

state (bool) –

Returns:

None

shrink(self)#

Removes unused capacity.

Returns:

None

size(self)#

Returns the number of points.

Returns:

int

test_visibility(self, point)#

Returns a given point visibility state (relatively to a sensor for instance).

Parameters:

point (Annotated[numpy.typing.ArrayLike, numpy.float64,) – the 3D point to test, return visibility (default: POINT_VISIBLE)Generic method to request a point visibility (should be overloaded if this functionality is required).The point visibility is such as defined in Daniel Girardeau - Montaut’s PhD manuscript (see Chapter 2, section 2 - 3 - 3).In this case, a ground based laser sensor model should be used to determine it.This method is called before performing any point - to - cloud comparison.If the result is notPOINT_VISIBLE, then the comparison won’t be performed and the scalar field value associatedto this point will be this visibility value.

Returns:

int

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

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

unalloacte_colors(self)#

Erases the cloud colors.

Returns:

None

unalloacte_norms(self)#

Erases the cloud normals.

Returns:

None

unalloacte_points(self)#

Erases the cloud points.

Returns:

None

unallocate_visibility_array(self)#

Erases the points visibility information

Returns:

None

uniform_down_sample(self, every_k_points)#

Function to downsample input pointcloud into output pointcloud uniformly. The sample is performed in the order of the points with the 0-th point always chosen, not at random.

Parameters:

every_k_points (SupportsInt) – Sample rate, the selected point indices are [0, k, 2k, …]

Returns:

cloudViewer.geometry.ccPointCloud

voxel_down_sample(self, voxel_size)#

Function to downsample input pointcloud into output pointcloud with a voxel. Normals and colors are averaged if they exist.

Parameters:

voxel_size (SupportsFloat) – Voxel size to downsample into.

Returns:

cloudViewer.geometry.ccPointCloud

voxel_down_sample_and_trace(self, voxel_size, min_bound, max_bound, approximate_class=False)#

Function to downsample using ccPointCloud::VoxelDownSample. Also records point cloud index before down sampling

Parameters:
  • voxel_size (SupportsFloat) – Voxel size to downsample into.

  • min_bound (Annotated[numpy.typing.ArrayLike, numpy.float64,) – Minimum coordinate of voxel boundaries

  • max_bound (Annotated[numpy.typing.ArrayLike, numpy.float64,) – Maximum coordinate of voxel boundaries

  • approximate_class (bool, optional, default=False) –

Returns:

tuple[cloudViewer.geometry.ccPointCloud, typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”], list[cloudViewer.utility.IntVector]]

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 covariances#

Points covariances.

Type:

float64 array of shape (num_points, 3, 3), use numpy.asarray() to access data