open3d.utility.Vector3iVector

class open3d.utility.Vector3iVector

Convert int32 numpy array of shape (n, 3) to Open3D format..

Example usage

import open3d
import numpy as np

# Example mesh
# x, y coordinates:
# [0: (-1, 2)]__________[1: (1, 2)]
#             \        /\
#              \  (0) /  \
#               \    / (1)\
#                \  /      \
#      [2: (0, 0)]\/________\[3: (2, 0)]
#
# z coordinate: 0

mesh = open3d.geometry.TriangleMesh()
np_vertices = np.array([[-1, 2, 0],
                        [1, 2, 0],
                        [0, 0, 0],
                        [2, 0, 0]])
np_triangles = np.array([[0, 2, 1],
                         [1, 2, 3]]).astype(np.int32)
mesh.vertices = open3d.Vector3dVector(np_vertices)

# From numpy to Open3D
mesh.triangles = open3d.Vector3iVector(np_triangles)

# From Open3D to numpy
np_triangles = np.asarray(mesh.triangles)
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: open3d.cpu.pybind.utility.Vector3iVector) -> None

  2. __init__(self: open3d.cpu.pybind.utility.Vector3iVector, arg0: numpy.ndarray[int32]) -> None

  3. __init__(self: open3d.cpu.pybind.utility.Vector3iVector, arg0: open3d.cpu.pybind.utility.Vector3iVector) -> None

Copy constructor

  1. __init__(self: open3d.cpu.pybind.utility.Vector3iVector, arg0: iterable) -> None

append(self: open3d.cpu.pybind.utility.Vector3iVector, x: numpy.ndarray[int32[3, 1]]) → None

Add an item to the end of the list

clear(self: open3d.cpu.pybind.utility.Vector3iVector) → None

Clear the contents

count(self: open3d.cpu.pybind.utility.Vector3iVector, x: numpy.ndarray[int32[3, 1]]) → int

Return the number of times x appears in the list

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: open3d.cpu.pybind.utility.Vector3iVector, L: open3d.cpu.pybind.utility.Vector3iVector) -> None

Extend the list by appending all the items in the given list

  1. extend(self: open3d.cpu.pybind.utility.Vector3iVector, L: iterable) -> None

Extend the list by appending all the items in the given list

insert(self: open3d.cpu.pybind.utility.Vector3iVector, i: int, x: numpy.ndarray[int32[3, 1]]) → None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: open3d.cpu.pybind.utility.Vector3iVector) -> numpy.ndarray[int32[3, 1]]

Remove and return the last item

  1. pop(self: open3d.cpu.pybind.utility.Vector3iVector, i: int) -> numpy.ndarray[int32[3, 1]]

Remove and return the item at index i

remove(self: open3d.cpu.pybind.utility.Vector3iVector, x: numpy.ndarray[int32[3, 1]]) → None

Remove the first item from the list whose value is x. It is an error if there is no such item.