open3d.geometry.LineSet

class open3d.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.

HalfEdgeTriangleMesh = <Type.HalfEdgeTriangleMesh: 7>
Image = <Type.Image: 8>
LineSet = <Type.LineSet: 4>
PointCloud = <Type.PointCloud: 1>
RGBDImage = <Type.RGBDImage: 9>
TetraMesh = <Type.TetraMesh: 10>
TriangleMesh = <Type.TriangleMesh: 6>
Unspecified = <Type.Unspecified: 0>
VoxelGrid = <Type.VoxelGrid: 2>
property value
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: open3d.cpu.pybind.geometry.LineSet) -> None

Default constructor

  1. __init__(self: open3d.cpu.pybind.geometry.LineSet, arg0: open3d.cpu.pybind.geometry.LineSet) -> None

Copy constructor

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

Create a LineSet from given points and line indices

clear(self)

Clear all elements in the geometry.

Returns

open3d.geometry.Geometry

static create_camera_visualization(*args, **kwargs)

Overloaded function.

  1. create_camera_visualization(view_width_px: int, view_height_px: int, intrinsic: numpy.ndarray[numpy.float64[3, 3]], extrinsic: numpy.ndarray[numpy.float64[4, 4]], scale: float = 1.0) -> open3d.cpu.pybind.geometry.LineSet

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

  1. create_camera_visualization(intrinsic: open3d.cpu.pybind.camera.PinholeCameraIntrinsic, extrinsic: numpy.ndarray[numpy.float64[4, 4]], scale: float = 1.0) -> open3d.cpu.pybind.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 (open3d.geometry.AxisAlignedBoundingBox) – The input bounding box.

Returns

open3d.geometry.LineSet

static create_from_oriented_bounding_box(box)

Factory function to create a LineSet from an OrientedBoundingBox.

Parameters

box (open3d.geometry.OrientedBoundingBox) – The input bounding box.

Returns

open3d.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

open3d.geometry.LineSet

static create_from_tetra_mesh(mesh)

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

Parameters

mesh (open3d.geometry.TetraMesh) – The input tetra mesh.

Returns

open3d.geometry.LineSet

static create_from_triangle_mesh(mesh)

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

Parameters

mesh (open3d.geometry.TriangleMesh) – The input triangle mesh.

Returns

open3d.geometry.LineSet

dimension(self)

Returns whether the geometry is 2D or 3D.

Returns

int

get_axis_aligned_bounding_box(self)

Returns an axis-aligned bounding box of the geometry.

Returns

open3d.geometry.AxisAlignedBoundingBox

get_center(self)

Returns the center of the geometry coordinates.

Returns

numpy.ndarray[numpy.float64[3, 1]]

get_geometry_type(self)

Returns one of registered geometry types.

Returns

open3d.geometry.Geometry.GeometryType

get_line_coordinate(self, line_index)
Parameters

line_index (int) – Index of the line.

Returns

Tuple[numpy.ndarray[numpy.float64[3, 1]], numpy.ndarray[numpy.float64[3, 1]]]

get_max_bound(self)

Returns max bounds for geometry coordinates.

Returns

numpy.ndarray[numpy.float64[3, 1]]

get_min_bound(self)

Returns min bounds for geometry coordinates.

Returns

numpy.ndarray[numpy.float64[3, 1]]

get_oriented_bounding_box(self)

Returns an oriented bounding box of the geometry.

Returns

open3d.geometry.OrientedBoundingBox

static get_rotation_matrix_from_axis_angle(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_quaternion(rotation: numpy.ndarray[numpy.float64[4, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_xyz(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_xzy(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_yxz(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_yzx(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_zxy(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_zyx(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
has_colors(self)

Returns True if the object’s lines contain colors.

Returns

bool

has_lines(self)

Returns True if the object contains lines.

Returns

bool

has_points(self)

Returns True if the object contains points.

Returns

bool

is_empty(self)

Returns True iff the geometry is empty.

Returns

bool

paint_uniform_color(self, color)

Assigns each line in the line set the same color.

Parameters

color (numpy.ndarray[numpy.float64[3, 1]]) – Color for the LineSet.

Returns

open3d.geometry.LineSet

rotate(*args, **kwargs)

Overloaded function.

  1. rotate(self, R)

    Apply rotation to the geometry coordinates and normals.

Parameters

R (numpy.ndarray[numpy.float64[3, 3]]) – The rotation matrix

Returns

open3d.geometry.Geometry3D

  1. rotate(self, R, center)

    Apply rotation to the geometry coordinates and normals.

Parameters
  • R (numpy.ndarray[numpy.float64[3, 3]]) – The rotation matrix

  • center (numpy.ndarray[numpy.float64[3, 1]]) – Rotation center used for transformation.

Returns

open3d.geometry.Geometry3D

scale(*args, **kwargs)

Overloaded function.

  1. scale(self, scale, center)

    Apply scaling to the geometry coordinates.

Parameters
  • scale (float) – The scale parameter that is multiplied to the points/vertices of the geometry.

  • center (numpy.ndarray[numpy.float64[3, 1]]) – Scale center used for transformation.

Returns

open3d.geometry.Geometry3D

  1. scale(self, scale, center)

    Apply scaling to the geometry coordinates.

Parameters
  • scale (float) – The scale parameter that is multiplied to the points/vertices of the geometry.

  • center (numpy.ndarray[numpy.float64[3, 1]]) – Scale center used for transformation.

Returns

open3d.geometry.Geometry3D

transform(self, arg0)

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

Parameters

arg0 (numpy.ndarray[numpy.float64[4, 4]]) –

Returns

open3d.geometry.Geometry3D

translate(self, translation, relative=True)

Apply translation to the geometry coordinates.

Parameters
  • translation (numpy.ndarray[numpy.float64[3, 1]]) – 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

open3d.geometry.Geometry3D

HalfEdgeTriangleMesh = <Type.HalfEdgeTriangleMesh: 7>
Image = <Type.Image: 8>
LineSet = <Type.LineSet: 4>
PointCloud = <Type.PointCloud: 1>
RGBDImage = <Type.RGBDImage: 9>
TetraMesh = <Type.TetraMesh: 10>
TriangleMesh = <Type.TriangleMesh: 6>
Unspecified = <Type.Unspecified: 0>
VoxelGrid = <Type.VoxelGrid: 2>
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