Open3D (C++ API)
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions
open3d::geometry::TriangleMesh Class Reference

#include <TriangleMesh.h>

Inheritance diagram for open3d::geometry::TriangleMesh:
open3d::geometry::Geometry3D open3d::geometry::Geometry

Public Types

enum  SimplificationContraction { SimplificationContraction::Average, SimplificationContraction::Quadric }
 
enum  FilterScope { FilterScope::All, FilterScope::Color, FilterScope::Normal, FilterScope::Vertex }
 
- Public Types inherited from open3d::geometry::Geometry3D
enum  RotationType {
  RotationType::XYZ, RotationType::YZX, RotationType::ZXY, RotationType::XZY,
  RotationType::ZYX, RotationType::YXZ, RotationType::AxisAngle
}
 
- Public Types inherited from open3d::geometry::Geometry
enum  GeometryType {
  GeometryType::Unspecified = 0, GeometryType::PointCloud = 1, GeometryType::VoxelGrid = 2, GeometryType::Octree = 3,
  GeometryType::LineSet = 4, GeometryType::TriangleMesh = 5, GeometryType::HalfEdgeTriangleMesh = 6, GeometryType::Image = 7,
  GeometryType::RGBDImage = 8, GeometryType::TetraMesh = 9, GeometryType::OrientedBoundingBox = 10, GeometryType::AxisAlignedBoundingBox = 11
}
 

Public Member Functions

 TriangleMesh ()
 
 ~TriangleMesh () override
 
TriangleMeshClear () override
 
bool IsEmpty () const override
 
Eigen::Vector3d GetMinBound () const override
 
Eigen::Vector3d GetMaxBound () const override
 
Eigen::Vector3d GetCenter () const override
 
AxisAlignedBoundingBox GetAxisAlignedBoundingBox () const override
 
OrientedBoundingBox GetOrientedBoundingBox () const override
 
TriangleMeshTransform (const Eigen::Matrix4d &transformation) override
 
TriangleMeshTranslate (const Eigen::Vector3d &translation, bool relative=true) override
 
TriangleMeshScale (const double scale, bool center=true) override
 
TriangleMeshRotate (const Eigen::Vector3d &rotation, bool center=true, RotationType type=RotationType::XYZ) override
 
TriangleMeshoperator+= (const TriangleMesh &mesh)
 
TriangleMesh operator+ (const TriangleMesh &mesh) const
 
TriangleMeshComputeTriangleNormals (bool normalized=true)
 Function to compute triangle normals, usually called before rendering. More...
 
TriangleMeshComputeVertexNormals (bool normalized=true)
 Function to compute vertex normals, usually called before rendering. More...
 
TriangleMeshComputeAdjacencyList ()
 Function to compute adjacency list, call before adjacency list is needed. More...
 
TriangleMeshRemoveDuplicatedVertices ()
 
TriangleMeshRemoveDuplicatedTriangles ()
 
TriangleMeshRemoveUnreferencedVertices ()
 
TriangleMeshRemoveDegenerateTriangles ()
 
TriangleMeshRemoveNonManifoldEdges ()
 
std::shared_ptr< TriangleMeshFilterSharpen (int number_of_iterations, double strength, FilterScope scope=FilterScope::All) const
 
std::shared_ptr< TriangleMeshFilterSmoothSimple (int number_of_iterations, FilterScope scope=FilterScope::All) const
 
std::shared_ptr< TriangleMeshFilterSmoothLaplacian (int number_of_iterations, double lambda, FilterScope scope=FilterScope::All) const
 
std::shared_ptr< TriangleMeshFilterSmoothTaubin (int number_of_iterations, double lambda=0.5, double mu=-0.53, FilterScope scope=FilterScope::All) const
 
bool HasVertices () const
 
bool HasTriangles () const
 
bool HasVertexNormals () const
 
bool HasVertexColors () const
 
bool HasTriangleNormals () const
 
bool HasAdjacencyList () const
 
TriangleMeshNormalizeNormals ()
 
TriangleMeshPaintUniformColor (const Eigen::Vector3d &color)
 Assigns each vertex in the TriangleMesh the same color. More...
 
int EulerPoincareCharacteristic () const
 
std::vector< Eigen::Vector2i > GetNonManifoldEdges (bool allow_boundary_edges=true) const
 
bool IsEdgeManifold (bool allow_boundary_edges=true) const
 
std::vector< int > GetNonManifoldVertices () const
 
bool IsVertexManifold () const
 
std::vector< Eigen::Vector2i > GetSelfIntersectingTriangles () const
 
bool IsSelfIntersecting () const
 
bool IsBoundingBoxIntersecting (const TriangleMesh &other) const
 
bool IsIntersecting (const TriangleMesh &other) const
 
bool IsOrientable () const
 
bool IsWatertight () const
 
bool OrientTriangles ()
 
std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen::hash< Eigen::Vector2i > > GetEdgeToTrianglesMap () const
 
double GetTriangleArea (size_t triangle_idx) const
 
double GetSurfaceArea () const
 
double GetSurfaceArea (std::vector< double > &triangle_areas) const
 
Eigen::Vector4d GetTrianglePlane (size_t triangle_idx) const
 
std::shared_ptr< TriangleMeshComputeConvexHull () const
 Function that computes the convex hull of the triangle mesh using qhull. More...
 
std::shared_ptr< PointCloudSamplePointsUniformlyImpl (size_t number_of_points, std::vector< double > &triangle_areas, double surface_area) const
 
std::shared_ptr< PointCloudSamplePointsUniformly (size_t number_of_points) const
 
std::shared_ptr< PointCloudSamplePointsPoissonDisk (size_t number_of_points, double init_factor=5, const std::shared_ptr< PointCloud > pcl_init=nullptr) const
 
std::shared_ptr< TriangleMeshSubdivideMidpoint (int number_of_iterations) const
 
std::shared_ptr< TriangleMeshSubdivideLoop (int number_of_iterations) const
 
std::shared_ptr< TriangleMeshSimplifyVertexClustering (double voxel_size, TriangleMesh::SimplificationContraction contraction=TriangleMesh::SimplificationContraction::Average) const
 
std::shared_ptr< TriangleMeshSimplifyQuadricDecimation (int target_number_of_triangles) const
 
std::shared_ptr< TriangleMeshSelectDownSample (const std::vector< size_t > &indices) const
 
std::shared_ptr< TriangleMeshCrop (const Eigen::Vector3d &min_bound, const Eigen::Vector3d &max_bound) const
 
- Public Member Functions inherited from open3d::geometry::Geometry3D
 ~Geometry3D () override
 
- Public Member Functions inherited from open3d::geometry::Geometry
virtual ~Geometry ()
 
GeometryType GetGeometryType () const
 
int Dimension () const
 

Static Public Member Functions

static double ComputeTriangleArea (const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2)
 Function that computes the area of a mesh triangle. More...
 
static Eigen::Vector4d ComputeTrianglePlane (const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2)
 
static std::shared_ptr< TriangleMeshCreateFromPointCloudBallPivoting (const PointCloud &pcd, const std::vector< double > &radii)
 
static std::shared_ptr< TriangleMeshCreateTetrahedron (double radius=1.0)
 
static std::shared_ptr< TriangleMeshCreateOctahedron (double radius=1.0)
 
static std::shared_ptr< TriangleMeshCreateIcosahedron (double radius=1.0)
 
static std::shared_ptr< TriangleMeshCreateBox (double width=1.0, double height=1.0, double depth=1.0)
 
static std::shared_ptr< TriangleMeshCreateSphere (double radius=1.0, int resolution=20)
 
static std::shared_ptr< TriangleMeshCreateCylinder (double radius=1.0, double height=2.0, int resolution=20, int split=4)
 
static std::shared_ptr< TriangleMeshCreateCone (double radius=1.0, double height=2.0, int resolution=20, int split=1)
 
static std::shared_ptr< TriangleMeshCreateTorus (double torus_radius=1.0, double tube_radius=0.5, int radial_resolution=30, int tubular_resolution=20)
 
static std::shared_ptr< TriangleMeshCreateArrow (double cylinder_radius=1.0, double cone_radius=1.5, double cylinder_height=5.0, double cone_height=4.0, int resolution=20, int cylinder_split=4, int cone_split=1)
 
static std::shared_ptr< TriangleMeshCreateCoordinateFrame (double size=1.0, const Eigen::Vector3d &origin=Eigen::Vector3d(0.0, 0.0, 0.0))
 
static std::shared_ptr< TriangleMeshCreateMoebius (int length_split=70, int width_split=15, int twists=1, double radius=1, double flatness=1, double width=1, double scale=1)
 

Data Fields

std::vector< Eigen::Vector3d > vertices_
 
std::vector< Eigen::Vector3d > vertex_normals_
 
std::vector< Eigen::Vector3d > vertex_colors_
 
std::vector< Eigen::Vector3i > triangles_
 
std::vector< Eigen::Vector3d > triangle_normals_
 
std::vector< std::unordered_set< int > > adjacency_list_
 

Protected Member Functions

 TriangleMesh (Geometry::GeometryType type)
 
void FilterSmoothLaplacianHelper (std::shared_ptr< TriangleMesh > &mesh, const std::vector< Eigen::Vector3d > &prev_vertices, const std::vector< Eigen::Vector3d > &prev_vertex_normals, const std::vector< Eigen::Vector3d > &prev_vertex_colors, const std::vector< std::unordered_set< int >> &adjacency_list, double lambda, bool filter_vertex, bool filter_normal, bool filter_color) const
 
- Protected Member Functions inherited from open3d::geometry::Geometry3D
 Geometry3D (GeometryType type)
 
Eigen::Vector3d ComputeMinBound (const std::vector< Eigen::Vector3d > &points) const
 
Eigen::Vector3d ComputeMaxBound (const std::vector< Eigen::Vector3d > &points) const
 
Eigen::Vector3d ComputeCenter (const std::vector< Eigen::Vector3d > &points) const
 
void ResizeAndPaintUniformColor (std::vector< Eigen::Vector3d > &colors, const size_t size, const Eigen::Vector3d &color) const
 
void TransformPoints (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points) const
 
void TransformNormals (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &normals) const
 
void TranslatePoints (const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative) const
 
void ScalePoints (const double scale, std::vector< Eigen::Vector3d > &points, bool center) const
 
void RotatePoints (const Eigen::Vector3d &rotation, std::vector< Eigen::Vector3d > &points, bool center, RotationType type) const
 
void RotateNormals (const Eigen::Vector3d &rotation, std::vector< Eigen::Vector3d > &normals, bool center, RotationType type) const
 
Eigen::Matrix3d GetRotationMatrix (const Eigen::Vector3d &rotation, RotationType type=RotationType::XYZ) const
 
- Protected Member Functions inherited from open3d::geometry::Geometry
 Geometry (GeometryType type, int dimension)
 

Member Enumeration Documentation

◆ FilterScope

Indicates the scope of filter operations.

Parameters
Allindicates that all properties (color, normal, vertex position) are filtered.
Colorindicates that only the colors are filtered.
Normalindicates that only the normals are filtered.
Vertexindicates that only the vertex positions are filtered.
Enumerator
All 
Color 
Normal 
Vertex 

◆ SimplificationContraction

Indicates the method that is used for mesh simplification if multiple vertices are combined to a single one.

Parameters
Averageindicates that the average position is computed as output.
Quadricindicates that the distance to the adjacent triangle planes is minimized. Cf. "Simplifying Surfaces with Color and Texture using Quadric Error Metrics" by Garland and Heckbert.
Enumerator
Average 
Quadric 

Constructor & Destructor Documentation

◆ TriangleMesh() [1/2]

open3d::geometry::TriangleMesh::TriangleMesh ( )
inline

◆ ~TriangleMesh()

open3d::geometry::TriangleMesh::~TriangleMesh ( )
inlineoverride

◆ TriangleMesh() [2/2]

open3d::geometry::TriangleMesh::TriangleMesh ( Geometry::GeometryType  type)
inlineprotected

Member Function Documentation

◆ Clear()

TriangleMesh & open3d::geometry::TriangleMesh::Clear ( )
overridevirtual

◆ ComputeAdjacencyList()

TriangleMesh & open3d::geometry::TriangleMesh::ComputeAdjacencyList ( )

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

◆ ComputeConvexHull()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::ComputeConvexHull ( ) const

Function that computes the convex hull of the triangle mesh using qhull.

◆ ComputeTriangleArea()

double open3d::geometry::TriangleMesh::ComputeTriangleArea ( const Eigen::Vector3d &  p0,
const Eigen::Vector3d &  p1,
const Eigen::Vector3d &  p2 
)
static

Function that computes the area of a mesh triangle.

◆ ComputeTriangleNormals()

TriangleMesh & open3d::geometry::TriangleMesh::ComputeTriangleNormals ( bool  normalized = true)

Function to compute triangle normals, usually called before rendering.

◆ ComputeTrianglePlane()

Eigen::Vector4d open3d::geometry::TriangleMesh::ComputeTrianglePlane ( const Eigen::Vector3d &  p0,
const Eigen::Vector3d &  p1,
const Eigen::Vector3d &  p2 
)
static

Function that computes the plane equation from the three points. If the three points are co-linear, then this function returns the invalid plane (0, 0, 0, 0).

◆ ComputeVertexNormals()

TriangleMesh & open3d::geometry::TriangleMesh::ComputeVertexNormals ( bool  normalized = true)

Function to compute vertex normals, usually called before rendering.

◆ CreateArrow()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateArrow ( double  cylinder_radius = 1.0,
double  cone_radius = 1.5,
double  cylinder_height = 5.0,
double  cone_height = 4.0,
int  resolution = 20,
int  cylinder_split = 4,
int  cone_split = 1 
)
static

Factory function to create an arrow mesh (TriangleMeshFactory.cpp) The axis of the cone with

Parameters
cone_radiuswill be along the z-axis. The cylinder with
cylinder_radiusis from (0, 0, 0) to (0, 0, cylinder_height), and the cone is from (0, 0, cylinder_height) to (0, 0, cylinder_height + cone_height). The cone will be split into
resolutionsegments. The
cylinder_heightwill be split into
cylinder_splitsegments. The
cone_heightwill be split into
cone_splitsegments.

◆ CreateBox()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateBox ( double  width = 1.0,
double  height = 1.0,
double  depth = 1.0 
)
static

Factory function to create a box mesh (TriangleMeshFactory.cpp) The left bottom corner on the front will be placed at (0, 0, 0). The

Parameters
widthis x-directional length, and
heightand
depthare y- and z-directional lengths respectively.

◆ CreateCone()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateCone ( double  radius = 1.0,
double  height = 2.0,
int  resolution = 20,
int  split = 1 
)
static

Factory function to create a cone mesh (TriangleMeshFactory.cpp) The axis of the cone will be from (0, 0, 0) to (0, 0,

Parameters
height).The circle with
radiuswill be split into
resolutionsegments. The height will be split into
splitsegments.

◆ CreateCoordinateFrame()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateCoordinateFrame ( double  size = 1.0,
const Eigen::Vector3d &  origin = Eigen::Vector3d(0.0, 0.0, 0.0) 
)
static

Factory function to create a coordinate frame mesh (TriangleMeshFactory.cpp) The coordinate frame will be centered at

Parameters
originThe x, y, z axis will be rendered as red, green, and blue arrows respectively.
sizeis the length of the axes.

◆ CreateCylinder()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateCylinder ( double  radius = 1.0,
double  height = 2.0,
int  resolution = 20,
int  split = 4 
)
static

Factory function to create a cylinder mesh (TriangleMeshFactory.cpp) The axis of the cylinder will be from (0, 0, -height/2) to (0, 0, height/2). The circle with

Parameters
radiuswill be split into
resolutionsegments. The
heightwill be split into
splitsegments.

◆ CreateFromPointCloudBallPivoting()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateFromPointCloudBallPivoting ( const PointCloud pcd,
const std::vector< double > &  radii 
)
static

Function that computes a triangle mesh from a oriented PointCloud

Parameters
pcd.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 (cf.
radii)over the point cloud, whenever the ball touches three points a triangle is created.

◆ CreateIcosahedron()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateIcosahedron ( double  radius = 1.0)
static

Factory function to create an icosahedron mesh (trianglemeshfactory.cpp). the mesh centroid will be at (0,0,0) and

Parameters
radiusdefines the distance from the center to the mesh vertices.

◆ CreateMoebius()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateMoebius ( int  length_split = 70,
int  width_split = 15,
int  twists = 1,
double  radius = 1,
double  flatness = 1,
double  width = 1,
double  scale = 1 
)
static

Factory function to create a Moebius strip.

Parameters
length_splitdefines the number of segments along the Moebius strip,
width_splitdefines the number of segments along the width of the Moebius strip,
twistsdefines the number of twists of the strip,
radiusdefines the radius of the Moebius strip,
flatnesscontrols the height of the strip,
widthcontrols the width of the Moebius strip and
scaleis used to scale the entire Moebius strip.

◆ CreateOctahedron()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateOctahedron ( double  radius = 1.0)
static

Factory function to create an octahedron mesh (trianglemeshfactory.cpp). the mesh centroid will be at (0,0,0) and

Parameters
radiusdefines the distance from the center to the mesh vertices.

◆ CreateSphere()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateSphere ( double  radius = 1.0,
int  resolution = 20 
)
static

Factory function to create a sphere mesh (TriangleMeshFactory.cpp) The sphere with

Parameters
radiuswill be centered at (0, 0, 0). Its axis is aligned with z-axis. The longitudes will be split into
resolutionsegments. The latitudes will be split into
resolution* 2 segments.

◆ CreateTetrahedron()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateTetrahedron ( double  radius = 1.0)
static

Factory function to create a tetrahedron mesh (trianglemeshfactory.cpp). the mesh centroid will be at (0,0,0) and

Parameters
radiusdefines the distance from the center to the mesh vertices.

◆ CreateTorus()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateTorus ( double  torus_radius = 1.0,
double  tube_radius = 0.5,
int  radial_resolution = 30,
int  tubular_resolution = 20 
)
static

Factory function to create a torus mesh (TriangleMeshFactory.cpp) The torus will be centered at (0, 0, 0) and a radius of

Parameters
torus_radius.The tube of the torus will have a radius of
tube_radius.The number of segments in radial and tubular direction are
radial_resolutionand
tubular_resolutionrespectively.

◆ Crop()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::Crop ( const Eigen::Vector3d &  min_bound,
const Eigen::Vector3d &  max_bound 
) const

Function to crop

Parameters
inputtringlemesh into output tringlemesh All points with coordinates less than
min_boundor larger than
max_boundare clipped.

◆ EulerPoincareCharacteristic()

int open3d::geometry::TriangleMesh::EulerPoincareCharacteristic ( ) const

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.

◆ FilterSharpen()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::FilterSharpen ( int  number_of_iterations,
double  strength,
FilterScope  scope = FilterScope::All 
) const

Function to sharpen triangle mesh. The output value ($v_o$) is the input value ($v_i$) plus

Parameters
strengthtimes the input value minus the sum of he adjacent values. $v_o = v_i x strength (v_i * |N| - {n N} v_n)$.
number_of_iterationsdefines the number of repetitions of this operation.

◆ FilterSmoothLaplacian()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::FilterSmoothLaplacian ( int  number_of_iterations,
double  lambda,
FilterScope  scope = FilterScope::All 
) const

Function to smooth triangle mesh using Laplacian. $v_o = v_i (sum_{n 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

Parameters
lambdais the smoothing parameter.
number_of_iterationsdefines the number of repetitions of this operation.

◆ FilterSmoothLaplacianHelper()

void open3d::geometry::TriangleMesh::FilterSmoothLaplacianHelper ( std::shared_ptr< TriangleMesh > &  mesh,
const std::vector< Eigen::Vector3d > &  prev_vertices,
const std::vector< Eigen::Vector3d > &  prev_vertex_normals,
const std::vector< Eigen::Vector3d > &  prev_vertex_colors,
const std::vector< std::unordered_set< int >> &  adjacency_list,
double  lambda,
bool  filter_vertex,
bool  filter_normal,
bool  filter_color 
) const
protected

◆ FilterSmoothSimple()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::FilterSmoothSimple ( int  number_of_iterations,
FilterScope  scope = FilterScope::All 
) const

Function to smooth triangle mesh with simple neighbour average. $v_o = {v_i + {n 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_iterationsdefines the number of repetitions of this operation.

◆ FilterSmoothTaubin()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::FilterSmoothTaubin ( int  number_of_iterations,
double  lambda = 0.5,
double  mu = -0.53,
FilterScope  scope = FilterScope::All 
) const

Function to smooth triangle mesh using method of Taubin, "Curve and Surface Smoothing Without Shrinkage", 1995. Applies in each iteration two times FilterSmoothLaplacian, first with

Parameters
lambdaand second with
muas smoothing parameter. This method avoids shrinkage of the triangle mesh.
number_of_iterationsdefines the number of repetitions of this operation.

◆ GetAxisAlignedBoundingBox()

AxisAlignedBoundingBox open3d::geometry::TriangleMesh::GetAxisAlignedBoundingBox ( ) const
overridevirtual

◆ GetCenter()

Eigen::Vector3d open3d::geometry::TriangleMesh::GetCenter ( ) const
overridevirtual

◆ GetEdgeToTrianglesMap()

std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen::hash< Eigen::Vector2i > > open3d::geometry::TriangleMesh::GetEdgeToTrianglesMap ( ) const

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

◆ GetMaxBound()

Eigen::Vector3d open3d::geometry::TriangleMesh::GetMaxBound ( ) const
overridevirtual

◆ GetMinBound()

Eigen::Vector3d open3d::geometry::TriangleMesh::GetMinBound ( ) const
overridevirtual

◆ GetNonManifoldEdges()

std::vector< Eigen::Vector2i > open3d::geometry::TriangleMesh::GetNonManifoldEdges ( bool  allow_boundary_edges = true) const

Function that returns the non-manifold edges of the triangle mesh. If

Parameters
allow_boundary_edgesis set to false, than also boundary edges are returned

◆ GetNonManifoldVertices()

std::vector< int > open3d::geometry::TriangleMesh::GetNonManifoldVertices ( ) const

Function that returns a list of non-manifold vertex indices. A vertex is manifold if its star is edge‐manifold and edge‐connected. (Two or more faces connected only by a vertex and not by an edge.)

◆ GetOrientedBoundingBox()

OrientedBoundingBox open3d::geometry::TriangleMesh::GetOrientedBoundingBox ( ) const
overridevirtual

◆ GetSelfIntersectingTriangles()

std::vector< Eigen::Vector2i > open3d::geometry::TriangleMesh::GetSelfIntersectingTriangles ( ) const

Function that returns a list of triangles that are intersecting the mesh.

◆ GetSurfaceArea() [1/2]

double open3d::geometry::TriangleMesh::GetSurfaceArea ( ) const

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

◆ GetSurfaceArea() [2/2]

double open3d::geometry::TriangleMesh::GetSurfaceArea ( std::vector< double > &  triangle_areas) const

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

◆ GetTriangleArea()

double open3d::geometry::TriangleMesh::GetTriangleArea ( size_t  triangle_idx) const

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

◆ GetTrianglePlane()

Eigen::Vector4d open3d::geometry::TriangleMesh::GetTrianglePlane ( size_t  triangle_idx) const

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

◆ HasAdjacencyList()

bool open3d::geometry::TriangleMesh::HasAdjacencyList ( ) const
inline

◆ HasTriangleNormals()

bool open3d::geometry::TriangleMesh::HasTriangleNormals ( ) const
inline

◆ HasTriangles()

bool open3d::geometry::TriangleMesh::HasTriangles ( ) const
inline

◆ HasVertexColors()

bool open3d::geometry::TriangleMesh::HasVertexColors ( ) const
inline

◆ HasVertexNormals()

bool open3d::geometry::TriangleMesh::HasVertexNormals ( ) const
inline

◆ HasVertices()

bool open3d::geometry::TriangleMesh::HasVertices ( ) const
inline

◆ IsBoundingBoxIntersecting()

bool open3d::geometry::TriangleMesh::IsBoundingBoxIntersecting ( const TriangleMesh other) const

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

◆ IsEdgeManifold()

bool open3d::geometry::TriangleMesh::IsEdgeManifold ( bool  allow_boundary_edges = true) const

Function that checks if the given triangle mesh is edge-manifold. A mesh is edge­-manifold if each edge is bounding either one or two triangles. If allow_boundary_edges is set to false, then this function returns false if there exists boundary edges.

◆ IsEmpty()

bool open3d::geometry::TriangleMesh::IsEmpty ( ) const
overridevirtual

◆ IsIntersecting()

bool open3d::geometry::TriangleMesh::IsIntersecting ( const TriangleMesh other) const

Function that tests if the triangle mesh intersects another triangle mesh. Tests each triangle against each other triangle.

◆ IsOrientable()

bool open3d::geometry::TriangleMesh::IsOrientable ( ) const

Function that tests if the given triangle mesh is orientable, i.e. the triangles can oriented in such a way that all normals point towards the outside.

◆ IsSelfIntersecting()

bool open3d::geometry::TriangleMesh::IsSelfIntersecting ( ) const

Function that tests if the triangle mesh is self-intersecting. Tests each triangle pair for intersection.

◆ IsVertexManifold()

bool open3d::geometry::TriangleMesh::IsVertexManifold ( ) const

Function that checks if all vertices in the triangle mesh are manifold. A vertex is manifold if its star is edge‐manifold and edge‐connected. (Two or more faces connected only by a vertex and not by an edge.)

◆ IsWatertight()

bool open3d::geometry::TriangleMesh::IsWatertight ( ) const

Function that tests if the given triangle mesh is watertight by checking if it is vertex manifold and edge-manifold with no boundary edges, but not self-intersecting.

◆ NormalizeNormals()

TriangleMesh& open3d::geometry::TriangleMesh::NormalizeNormals ( )
inline

◆ operator+()

TriangleMesh open3d::geometry::TriangleMesh::operator+ ( const TriangleMesh mesh) const

◆ operator+=()

TriangleMesh & open3d::geometry::TriangleMesh::operator+= ( const TriangleMesh mesh)

◆ OrientTriangles()

bool open3d::geometry::TriangleMesh::OrientTriangles ( )

If the mesh is orientable then this function rearranges the triangles such that all normals point towards the outside/inside.

◆ PaintUniformColor()

TriangleMesh& open3d::geometry::TriangleMesh::PaintUniformColor ( const Eigen::Vector3d &  color)
inline

Assigns each vertex in the TriangleMesh the same color.

Parameters
color.

◆ RemoveDegenerateTriangles()

TriangleMesh & open3d::geometry::TriangleMesh::RemoveDegenerateTriangles ( )

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

◆ RemoveDuplicatedTriangles()

TriangleMesh & open3d::geometry::TriangleMesh::RemoveDuplicatedTriangles ( )

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

◆ RemoveDuplicatedVertices()

TriangleMesh & open3d::geometry::TriangleMesh::RemoveDuplicatedVertices ( )

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

◆ RemoveNonManifoldEdges()

TriangleMesh & open3d::geometry::TriangleMesh::RemoveNonManifoldEdges ( )

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.

◆ RemoveUnreferencedVertices()

TriangleMesh & open3d::geometry::TriangleMesh::RemoveUnreferencedVertices ( )

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

◆ Rotate()

TriangleMesh & open3d::geometry::TriangleMesh::Rotate ( const Eigen::Vector3d &  rotation,
bool  center = true,
RotationType  type = RotationType::XYZ 
)
overridevirtual

◆ SamplePointsPoissonDisk()

std::shared_ptr< PointCloud > open3d::geometry::TriangleMesh::SamplePointsPoissonDisk ( size_t  number_of_points,
double  init_factor = 5,
const std::shared_ptr< PointCloud pcl_init = nullptr 
) const

Function to sample

Parameters
number_of_pointspoints (blue noise). Based on the method presented in Yuksel, "Sample Elimination for Generating Poisson Disk Sample Sets", EUROGRAPHICS, 2015 The PointCloud
pcl_initis used for sample elimination if given, otherwise a PointCloud is first uniformly sampled with
init_number_of_pointsx
number_of_pointsnumber of points.

◆ SamplePointsUniformly()

std::shared_ptr< PointCloud > open3d::geometry::TriangleMesh::SamplePointsUniformly ( size_t  number_of_points) const

Function to sample

Parameters
number_of_pointspoints uniformly from the mesh

◆ SamplePointsUniformlyImpl()

std::shared_ptr< PointCloud > open3d::geometry::TriangleMesh::SamplePointsUniformlyImpl ( size_t  number_of_points,
std::vector< double > &  triangle_areas,
double  surface_area 
) const

Function to sample

Parameters
number_of_pointspoints uniformly from the mesh

◆ Scale()

TriangleMesh & open3d::geometry::TriangleMesh::Scale ( const double  scale,
bool  center = true 
)
overridevirtual

◆ SelectDownSample()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::SelectDownSample ( const std::vector< size_t > &  indices) const

Function to select points from

Parameters
inputTriangleMesh into
Returns
output TriangleMesh Vertices with indices in
Parameters
indicesare selected.

◆ SimplifyQuadricDecimation()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::SimplifyQuadricDecimation ( int  target_number_of_triangles) const

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

◆ SimplifyVertexClustering()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::SimplifyVertexClustering ( double  voxel_size,
TriangleMesh::SimplificationContraction  contraction = TriangleMesh::SimplificationContraction::Average 
) const

Function to simplify mesh using Vertex Clustering. The result can be a non-manifold mesh.

◆ SubdivideLoop()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::SubdivideLoop ( int  number_of_iterations) const

Function to subdivide triangle mesh using Loop's scheme. Cf. Charles T. Loop, "Smooth subdivision surfaces based on triangles",

  1. Each triangle is subdivided into four triangles per iteration.

◆ SubdivideMidpoint()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::SubdivideMidpoint ( int  number_of_iterations) const

Function to subdivide triangle mesh using the simple midpoint algorithm. Each triangle is subdivided into four triangles per iteration and the new vertices lie on the midpoint of the triangle edges.

◆ Transform()

TriangleMesh & open3d::geometry::TriangleMesh::Transform ( const Eigen::Matrix4d &  transformation)
overridevirtual

◆ Translate()

TriangleMesh & open3d::geometry::TriangleMesh::Translate ( const Eigen::Vector3d &  translation,
bool  relative = true 
)
overridevirtual

Field Documentation

◆ adjacency_list_

std::vector<std::unordered_set<int> > open3d::geometry::TriangleMesh::adjacency_list_

◆ triangle_normals_

std::vector<Eigen::Vector3d> open3d::geometry::TriangleMesh::triangle_normals_

◆ triangles_

std::vector<Eigen::Vector3i> open3d::geometry::TriangleMesh::triangles_

◆ vertex_colors_

std::vector<Eigen::Vector3d> open3d::geometry::TriangleMesh::vertex_colors_

◆ vertex_normals_

std::vector<Eigen::Vector3d> open3d::geometry::TriangleMesh::vertex_normals_

◆ vertices_

std::vector<Eigen::Vector3d> open3d::geometry::TriangleMesh::vertices_

The documentation for this class was generated from the following files: