cloudViewer.geometry.LineSet#

class cloudViewer.geometry.LineSet#

LineSet define a sets of lines in 3D. A typical application is to display the point cloud correspondence pairs.

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

Default constructor

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

Copy constructor

  1. __init__(self: cloudViewer.geometry.LineSet, points: cloudViewer.utility.Vector3dVector, lines: cloudViewer.utility.Vector2iVector) -> None

Create a LineSet from given points and line indices

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

colors_shown(self)#

Returns whether colors are shown or not.

Returns:

bool

static create_camera_visualization(*args, **kwargs)#

Overloaded function.

  1. create_camera_visualization(view_width_px: typing.SupportsInt, view_height_px: typing.SupportsInt, intrinsic: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[3, 3]”], extrinsic: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[4, 4]”], scale: typing.SupportsFloat = 1.0) -> cloudViewer.geometry.LineSet

Factory function to create a LineSet from intrinsic and extrinsic camera matrices

  1. create_camera_visualization(intrinsic: cloudViewer.camera.PinholeCameraIntrinsic, extrinsic: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[4, 4]”], scale: typing.SupportsFloat = 1.0) -> cloudViewer.geometry.LineSet

Factory function to create a LineSet from intrinsic and extrinsic camera matrices

static create_from_axis_aligned_bounding_box(box)#

Factory function to create a LineSet from an AxisAlignedBoundingBox.

Parameters:

box (ccBBox) – The input bounding box.

Returns:

cloudViewer.geometry.LineSet

static create_from_oriented_bounding_box(box)#

Factory function to create a LineSet from an OrientedBoundingBox.

Parameters:

box (ecvOrientedBBox) – The input bounding box.

Returns:

cloudViewer.geometry.LineSet

static create_from_point_cloud_correspondences(cloud0, cloud1, correspondences)#

Factory function to create a LineSet from two pointclouds and a correspondence set.

Parameters:
Returns:

cloudViewer.geometry.LineSet

static create_from_tetra_mesh(mesh)#

Factory function to create a LineSet from edges of a tetra mesh.

Parameters:

mesh (cloudViewer::geometry::TetraMesh) – The input tetra mesh.

Returns:

cloudViewer.geometry.LineSet

static create_from_triangle_mesh(mesh)#

Factory function to create a LineSet from edges of a triangle mesh.

Parameters:

mesh (ccMesh) – The input triangle mesh.

Returns:

cloudViewer.geometry.LineSet

enable_gl_transformation(self, state)#

Enables/disables associated GL transformation.

Parameters:

state (bool) –

Returns:

None

enable_temp_color(self, state)#

Set temporary color activation state.

Parameters:

state (bool) –

Returns:

None

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]

find(self, unique_id)#

Finds an entity in this object hierarchy.

Parameters:

unique_id (SupportsInt) –

Returns:

cloudViewer.geometry.ccHObject

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_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_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_line_coordinate(self, line_index)#
Parameters:

line_index (SupportsInt) – Index of the line.

Returns:

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

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_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

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_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

has_colors(self)#

Returns True if the object’s lines contain colors.

Returns:

bool

has_displayed_scalar_field(self)#

Returns whether an active scalar field is available or not.

Returns:

bool

has_lines(self)#

Returns True if the object contains lines.

Returns:

bool

has_normals(self)#

Returns whether normals are enabled or not.

Returns:

bool

has_points(self)#

Returns True if the object contains points.

Returns:

bool

has_scalar_fields(self)#

Returns whether one or more scalar fields are instantiated.

Returns:

bool

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

Returns whether entity is selected or not.

Returns:

bool

is_serializable(self)#

Returns whether the instance is a serializable.

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

normals_shown(self)#

Returns whether normals are shown or not.

Returns:

bool

paint_uniform_color(self, color)#

Assigns each line in the line set the same color.

Parameters:

color (Annotated[numpy.typing.ArrayLike, numpy.float64,) – Color for the LineSet.

Returns:

cloudViewer.geometry.LineSet

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.

reset_glTransformation_history(self)#

Resets the transformation ‘history’ matrix.

Returns:

None

reset_gl_transformation(self)#

Resets associated GL transformation.

Returns:

None

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

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

Returns whether active scalar field is visible.

Returns:

bool

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

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

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

RGB colors of lines.

Type:

float64 array of shape (num_lines, 3), range [0, 1] , use numpy.asarray() to access data

property lines#

Lines denoted by the index of points forming the line.

Type:

int array of shape (num_lines, 2), use numpy.asarray() to access data

property points#

Points coordinates.

Type:

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