Open3D (C++ API)  0.12.0
Data Structures | Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions
open3d::geometry::TriangleMesh Class Reference

Triangle mesh contains vertices and triangles represented by the indices to the vertices. More...

#include <TriangleMesh.h>

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

Data Structures

struct  Material
 

Public Member Functions

 TriangleMesh ()
 Default Constructor. More...
 
 TriangleMesh (const std::vector< Eigen::Vector3d > &vertices, const std::vector< Eigen::Vector3i > &triangles)
 Parameterized Constructor. More...
 
 ~TriangleMesh () override
 
virtual TriangleMeshClear () override
 Clear all elements in the geometry. More...
 
virtual TriangleMeshTransform (const Eigen::Matrix4d &transformation) override
 Apply transformation (4x4 matrix) to the geometry coordinates. More...
 
virtual TriangleMeshRotate (const Eigen::Matrix3d &R, const Eigen::Vector3d &center) override
 Apply rotation to the geometry coordinates and normals. Given a rotation matrix $R$, and center $c$, a given point $p$ is transformed according to $R (p - c) + c$. More...
 
TriangleMeshoperator+= (const TriangleMesh &mesh)
 
TriangleMesh operator+ (const TriangleMesh &mesh) const
 
bool HasTriangles () const
 Returns true if the mesh contains triangles. More...
 
bool HasTriangleNormals () const
 Returns true if the mesh contains triangle normals. More...
 
bool HasAdjacencyList () const
 Returns true if the mesh contains adjacency normals. More...
 
bool HasTriangleUvs () const
 
bool HasTextures () const
 Returns true if the mesh has texture. More...
 
bool HasMaterials () const
 
bool HasTriangleMaterialIds () const
 
TriangleMeshNormalizeNormals ()
 Normalize both triangle normals and vertex normals to length 1. More...
 
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 ()
 Function that removes duplicated verties, i.e., vertices that have identical coordinates. More...
 
TriangleMeshRemoveDuplicatedTriangles ()
 Function that removes duplicated triangles, i.e., removes triangles that reference the same three vertices, independent of their order. More...
 
TriangleMeshRemoveUnreferencedVertices ()
 This function removes vertices from the triangle mesh that are not referenced in any triangle of the mesh. More...
 
TriangleMeshRemoveDegenerateTriangles ()
 Function that removes degenerate triangles, i.e., triangles that reference a single vertex multiple times in a single triangle. More...
 
TriangleMeshRemoveNonManifoldEdges ()
 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. More...
 
TriangleMeshMergeCloseVertices (double eps)
 Function that will merge close by vertices to a single one. The vertex position, normal and color will be the average of the vertices. More...
 
std::shared_ptr< TriangleMeshFilterSharpen (int number_of_iterations, double strength, FilterScope scope=FilterScope::All) const
 Function to sharpen triangle mesh. More...
 
std::shared_ptr< TriangleMeshFilterSmoothSimple (int number_of_iterations, FilterScope scope=FilterScope::All) const
 Function to smooth triangle mesh with simple neighbour average. More...
 
std::shared_ptr< TriangleMeshFilterSmoothLaplacian (int number_of_iterations, double lambda, FilterScope scope=FilterScope::All) const
 Function to smooth triangle mesh using Laplacian. More...
 
std::shared_ptr< TriangleMeshFilterSmoothTaubin (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 lambda and second with mu as smoothing parameter. This method avoids shrinkage of the triangle mesh. 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< Eigen::Vector2i > > GetEdgeToTrianglesMap () const
 
std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen< Eigen::Vector2i > > GetEdgeToVerticesMap () const
 
double GetTriangleArea (size_t triangle_idx) const
 
double GetSurfaceArea () const
 
double GetSurfaceArea (std::vector< double > &triangle_areas) const
 
double GetVolume () const
 
Eigen::Vector4d GetTrianglePlane (size_t triangle_idx) const
 
std::shared_ptr< PointCloudSamplePointsUniformlyImpl (size_t number_of_points, std::vector< double > &triangle_areas, double surface_area, bool use_triangle_normal, int seed)
 
std::shared_ptr< PointCloudSamplePointsUniformly (size_t number_of_points, bool use_triangle_normal=false, int seed=-1)
 
std::shared_ptr< PointCloudSamplePointsPoissonDisk (size_t number_of_points, double init_factor=5, const std::shared_ptr< PointCloud > pcl_init=nullptr, bool use_triangle_normal=false, int seed=-1)
 
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, SimplificationContraction contraction=SimplificationContraction::Average) const
 
std::shared_ptr< TriangleMeshSimplifyQuadricDecimation (int target_number_of_triangles, double maximum_error, double boundary_weight) const
 
std::shared_ptr< TriangleMeshSelectByIndex (const std::vector< size_t > &indices, bool cleanup=true) const
 
std::shared_ptr< TriangleMeshCrop (const AxisAlignedBoundingBox &bbox) const
 
std::shared_ptr< TriangleMeshCrop (const OrientedBoundingBox &bbox) const
 
std::tuple< std::vector< int >, std::vector< size_t >, std::vector< double > > ClusterConnectedTriangles () const
 Function that clusters connected triangles, i.e., triangles that are connected via edges are assigned the same cluster index. More...
 
void RemoveTrianglesByIndex (const std::vector< size_t > &triangle_indices)
 This function removes the triangles with index in triangle_indices. Call RemoveUnreferencedVertices to clean up vertices afterwards. More...
 
void RemoveTrianglesByMask (const std::vector< bool > &triangle_mask)
 This function removes the triangles that are masked in triangle_mask. Call RemoveUnreferencedVertices to clean up vertices afterwards. More...
 
void RemoveVerticesByIndex (const std::vector< size_t > &vertex_indices)
 This function removes the vertices with index in vertex_indices. Note that also all triangles associated with the vertices are removeds. More...
 
void RemoveVerticesByMask (const std::vector< bool > &vertex_mask)
 This function removes the vertices that are masked in vertex_mask. Note that also all triangles associated with the vertices are removed. More...
 
std::shared_ptr< TriangleMeshDeformAsRigidAsPossible (const std::vector< int > &constraint_vertex_indices, const std::vector< Eigen::Vector3d > &constraint_vertex_positions, size_t max_iter, DeformAsRigidAsPossibleEnergy energy=DeformAsRigidAsPossibleEnergy::Spokes, double smoothed_alpha=0.01) const
 This function deforms the mesh using the method by Sorkine and Alexa, "As-Rigid-As-Possible Surface Modeling", 2007. More...
 
- Public Member Functions inherited from open3d::geometry::MeshBase
 MeshBase ()
 Default Constructor. More...
 
 ~MeshBase () override
 
virtual bool IsEmpty () const override
 Returns true iff the geometry is empty. More...
 
virtual Eigen::Vector3d GetMinBound () const override
 Returns min bounds for geometry coordinates. More...
 
virtual Eigen::Vector3d GetMaxBound () const override
 Returns max bounds for geometry coordinates. More...
 
virtual Eigen::Vector3d GetCenter () const override
 Returns the center of the geometry coordinates. More...
 
virtual AxisAlignedBoundingBox GetAxisAlignedBoundingBox () const override
 Returns an axis-aligned bounding box of the geometry. More...
 
virtual OrientedBoundingBox GetOrientedBoundingBox () const override
 Returns an oriented bounding box of the geometry. More...
 
virtual MeshBaseTranslate (const Eigen::Vector3d &translation, bool relative=true) override
 Apply translation to the geometry coordinates. More...
 
virtual MeshBaseScale (const double scale, const Eigen::Vector3d &center) override
 Apply scaling to the geometry coordinates. Given a scaling factor $s$, and center $c$, a given point $p$ is transformed according to $s (p - c) + c$. More...
 
MeshBaseoperator+= (const MeshBase &mesh)
 
MeshBase operator+ (const MeshBase &mesh) const
 
bool HasVertices () const
 Returns True if the mesh contains vertices. More...
 
bool HasVertexNormals () const
 Returns True if the mesh contains vertex normals. More...
 
bool HasVertexColors () const
 Returns True if the mesh contains vertex colors. More...
 
MeshBaseNormalizeNormals ()
 Normalize vertex normals to length 1. More...
 
MeshBasePaintUniformColor (const Eigen::Vector3d &color)
 Assigns each vertex in the TriangleMesh the same color. More...
 
std::tuple< std::shared_ptr< TriangleMesh >, std::vector< size_t > > ComputeConvexHull () const
 Function that computes the convex hull of the triangle mesh using qhull. More...
 
- Public Member Functions inherited from open3d::geometry::Geometry3D
 ~Geometry3D () override
 
virtual Geometry3DRotate (const Eigen::Matrix3d &R)
 
- Public Member Functions inherited from open3d::geometry::Geometry
virtual ~Geometry ()
 
GeometryType GetGeometryType () const
 Returns one of registered geometry types. More...
 
int Dimension () const
 Returns whether the geometry is 2D or 3D. More...
 
std::string GetName () const
 
void SetName (const std::string &name)
 

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::Vector3i GetOrderedTriangle (int vidx0, int vidx1, int vidx2)
 
static Eigen::Vector4d ComputeTrianglePlane (const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2)
 
static Eigen::Vector2i GetOrderedEdge (int vidx0, int vidx1)
 Helper function to get an edge with ordered vertex indices. More...
 
static std::shared_ptr< TriangleMeshCreateFromPointCloudAlphaShape (const PointCloud &pcd, double alpha, std::shared_ptr< TetraMesh > tetra_mesh=nullptr, std::vector< size_t > *pt_map=nullptr)
 Alpha shapes are a generalization of the convex hull. With decreasing alpha value the shape schrinks and creates cavities. See Edelsbrunner and Muecke, "Three-Dimensional Alpha Shapes", 1994. More...
 
static std::shared_ptr< TriangleMeshCreateFromPointCloudBallPivoting (const PointCloud &pcd, const std::vector< double > &radii)
 
static std::tuple< std::shared_ptr< TriangleMesh >, std::vector< double > > CreateFromPointCloudPoisson (const PointCloud &pcd, size_t depth=8, size_t width=0, float scale=1.1f, bool linear_fit=false, int n_threads=-1)
 Function that computes a triangle mesh from an oriented PointCloud pcd. This implements the Screened Poisson Reconstruction proposed in Kazhdan and Hoppe, "Screened Poisson Surface Reconstruction", 2013. This function uses the original implementation by Kazhdan. See https://github.com/mkazhdan/PoissonRecon. More...
 
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)
 
- Static Public Member Functions inherited from open3d::geometry::Geometry3D
static Eigen::Matrix3d GetRotationMatrixFromXYZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XYZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYZX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YZX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZXY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZXY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromXZY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XZY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZYX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZYX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYXZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YXZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromAxisAngle (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from AxisAngle RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromQuaternion (const Eigen::Vector4d &rotation)
 Get Rotation Matrix from Quaternion. More...
 

Data Fields

std::vector< Eigen::Vector3i > triangles_
 List of triangles denoted by the index of points forming the triangle. More...
 
std::vector< Eigen::Vector3d > triangle_normals_
 Triangle normals. More...
 
std::vector< std::unordered_set< int > > adjacency_list_
 
std::vector< Eigen::Vector2d > triangle_uvs_
 List of uv coordinates per triangle. More...
 
std::unordered_map< std::string, Materialmaterials_
 
std::vector< int > triangle_material_ids_
 List of material ids. More...
 
std::vector< Imagetextures_
 Textures of the image. More...
 
- Data Fields inherited from open3d::geometry::MeshBase
std::vector< Eigen::Vector3d > vertices_
 Vertex coordinates. More...
 
std::vector< Eigen::Vector3d > vertex_normals_
 Vertex normals. More...
 
std::vector< Eigen::Vector3d > vertex_colors_
 RGB colors of vertices. More...
 

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
 
std::unordered_map< Eigen::Vector2i, double, utility::hash_eigen< Eigen::Vector2i > > ComputeEdgeWeightsCot (const std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen< Eigen::Vector2i >> &edges_to_vertices, double min_weight=std::numeric_limits< double >::lowest()) const
 Function that computes for each edge in the triangle mesh and passed as parameter edges_to_vertices the cot weight. More...
 
- Protected Member Functions inherited from open3d::geometry::MeshBase
 MeshBase (Geometry::GeometryType type)
 
 MeshBase (Geometry::GeometryType type, const std::vector< Eigen::Vector3d > &vertices)
 
- Protected Member Functions inherited from open3d::geometry::Geometry3D
 Geometry3D (GeometryType type)
 Parameterized Constructor. More...
 
Eigen::Vector3d ComputeMinBound (const std::vector< Eigen::Vector3d > &points) const
 Compute min bound of a list points. More...
 
Eigen::Vector3d ComputeMaxBound (const std::vector< Eigen::Vector3d > &points) const
 Compute max bound of a list points. More...
 
Eigen::Vector3d ComputeCenter (const std::vector< Eigen::Vector3d > &points) const
 Computer center of a list of points. More...
 
void ResizeAndPaintUniformColor (std::vector< Eigen::Vector3d > &colors, const size_t size, const Eigen::Vector3d &color) const
 Resizes the colors vector and paints a uniform color. More...
 
void TransformPoints (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points) const
 Transforms all points with the transformation matrix. More...
 
void TransformNormals (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &normals) const
 Transforms the normals with the transformation matrix. More...
 
void TranslatePoints (const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative) const
 Apply translation to the geometry coordinates. More...
 
void ScalePoints (const double scale, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center) const
 Scale the coordinates of all points by the scaling factor scale. More...
 
void RotatePoints (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center) const
 Rotate all points with the rotation matrix R. More...
 
void RotateNormals (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &normals) const
 Rotate all normals with the rotation matrix R. More...
 
- Protected Member Functions inherited from open3d::geometry::Geometry
 Geometry (GeometryType type, int dimension)
 Parameterized Constructor. More...
 

Additional Inherited Members

- Public Types inherited from open3d::geometry::MeshBase
enum  SimplificationContraction { SimplificationContraction::Average, SimplificationContraction::Quadric }
 Indicates the method that is used for mesh simplification if multiple vertices are combined to a single one. More...
 
enum  FilterScope { FilterScope::All, FilterScope::Color, FilterScope::Normal, FilterScope::Vertex }
 Indicates the scope of filter operations. More...
 
enum  DeformAsRigidAsPossibleEnergy { DeformAsRigidAsPossibleEnergy::Spokes, DeformAsRigidAsPossibleEnergy::Smoothed }
 
- 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::MeshBase = 5, GeometryType::TriangleMesh = 6, GeometryType::HalfEdgeTriangleMesh = 7,
  GeometryType::Image = 8, GeometryType::RGBDImage = 9, GeometryType::TetraMesh = 10, GeometryType::OrientedBoundingBox = 11,
  GeometryType::AxisAlignedBoundingBox = 12
}
 Specifies possible geometry types. More...
 

Detailed Description

Triangle mesh contains vertices and triangles represented by the indices to the vertices.

Optionally, the mesh may also contain triangle normals, vertex normals and vertex colors.

Constructor & Destructor Documentation

◆ TriangleMesh() [1/3]

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

Default Constructor.

◆ TriangleMesh() [2/3]

open3d::geometry::TriangleMesh::TriangleMesh ( const std::vector< Eigen::Vector3d > &  vertices,
const std::vector< Eigen::Vector3i > &  triangles 
)
inline

Parameterized Constructor.

Parameters
verticeslist of vertices.
triangleslist of triangles.

◆ ~TriangleMesh()

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

◆ TriangleMesh() [3/3]

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

Member Function Documentation

◆ Clear()

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

Clear all elements in the geometry.

Reimplemented from open3d::geometry::MeshBase.

◆ ClusterConnectedTriangles()

std::tuple< std::vector< int >, std::vector< size_t >, std::vector< double > > open3d::geometry::TriangleMesh::ClusterConnectedTriangles ( ) const

Function that clusters connected triangles, i.e., triangles that are connected via edges are assigned the same cluster index.

Returns
A vector that contains the cluster index per triangle, a second vector contains the number of triangles per cluster, and a third vector contains the surface area per cluster.

◆ ComputeAdjacencyList()

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

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

◆ ComputeEdgeWeightsCot()

std::unordered_map< Eigen::Vector2i, double, utility::hash_eigen< Eigen::Vector2i > > open3d::geometry::TriangleMesh::ComputeEdgeWeightsCot ( const std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen< Eigen::Vector2i >> &  edges_to_vertices,
double  min_weight = std::numeric_limits<double>::lowest() 
) const
protected

Function that computes for each edge in the triangle mesh and passed as parameter edges_to_vertices the cot weight.

Parameters
edges_to_verticesmap from edge to vector of neighbouring vertices.
min_weightminimum weight returned. Weights smaller than this get clamped.
Returns
cot weight per edge.

◆ 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 cone_radius will be along the z-axis. The cylinder with cylinder_radius is 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 resolution segments. The cylinder_height will be split into cylinder_split segments. The cone_height will be split into cone_split segments.

Parameters
cylinder_radiusdefines the radius of the cylinder.
cone_radiusdefines the radius of the cone.
cylinder_heightdefines the height of the cylinder. The cylinder is from (0, 0, 0) to (0, 0, cylinder_height)
cone_heightdefines the height of the cone. The axis of the cone will be from (0, 0, cylinder_height) to (0, 0, cylinder_height + cone_height).
resolutiondefines the cone will be split into resolution segments.
cylinder_splitdefines the cylinder_height will be split into cylinder_split segments.
cone_splitdefines the cone_height will be split into cone_split segments.

◆ 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).

Parameters
widthis x-directional length.
heightis y-directional length.
depthis z-directional length.

◆ 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, height). The circle with radius will be split into resolution segments. The height will be split into split segments.

Parameters
radiusdefines the radius of the cone.
heightdefines the height of the cone.
resolutiondefines that the circle will be split into resolution segments
splitdefines that the height will be split into split segments.

◆ 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). arrows respectively.

Parameters
sizeis the length of the axes.
sizedefines the size of the coordinate frame.
origindefines the origin of the coordinate frame.

◆ 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 radius will be split into resolution segments. The height will be split into split segments.

Parameters
radiusdefines the radius of the cylinder.
heightdefines the height of the cylinder.
resolutiondefines that the circle will be split into resolution segments
splitdefines that the height will be split into split segments.

◆ CreateFromPointCloudAlphaShape()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::CreateFromPointCloudAlphaShape ( const PointCloud pcd,
double  alpha,
std::shared_ptr< TetraMesh tetra_mesh = nullptr,
std::vector< size_t > *  pt_map = nullptr 
)
static

Alpha shapes are a generalization of the convex hull. With decreasing alpha value the shape schrinks and creates cavities. See Edelsbrunner and Muecke, "Three-Dimensional Alpha Shapes", 1994.

Parameters
pcdPointCloud for what the alpha shape should be computed.
alphaparameter to control the shape. A very big value will give a shape close to the convex hull.
tetra_meshIf not a nullptr, then uses this to construct the alpha shape. Otherwise, ComputeDelaunayTetrahedralization is called.
pt_mapOptional map from tetra_mesh vertex indices to pcd points.
Returns
TriangleMesh of the alpha shape.

◆ 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 an oriented PointCloud 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.

Parameters
pcddefines the PointCloud from which the TriangleMesh surface is reconstructed. Has to contain normals.
radiidefines the radii of the ball that are used for the surface reconstruction.

◆ CreateFromPointCloudPoisson()

std::tuple< std::shared_ptr< TriangleMesh >, std::vector< double > > open3d::geometry::TriangleMesh::CreateFromPointCloudPoisson ( const PointCloud pcd,
size_t  depth = 8,
size_t  width = 0,
float  scale = 1.1f,
bool  linear_fit = false,
int  n_threads = -1 
)
static

Function that computes a triangle mesh from an oriented PointCloud pcd. This implements the Screened Poisson Reconstruction proposed in Kazhdan and Hoppe, "Screened Poisson Surface Reconstruction", 2013. This function uses the original implementation by Kazhdan. See https://github.com/mkazhdan/PoissonRecon.

Parameters
pcdPointCloud with normals and optionally colors.
depthMaximum depth of the tree that will be used for surface reconstruction. Running at depth d corresponds to solving on a grid whose resolution is no larger than 2^d x 2^d x 2^d. Note that since the reconstructor adapts the octree to the sampling density, the specified reconstruction depth is only an upper bound.
widthSpecifies the target width of the finest level octree cells. This parameter is ignored if depth is specified.
scaleSpecifies the ratio between the diameter of the cube used for reconstruction and the diameter of the samples' bounding cube.
linear_fitIf true, the reconstructor use linear interpolation to estimate the positions of iso-vertices.
n_threadsNumber of threads used for reconstruction. Set to -1 to automatically determine it.
Returns
The estimated TriangleMesh, and per vertex densitie values that can be used to to trim the mesh.

◆ 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.
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.
radiusdefines the distance from centroid to mesh vetices.

◆ 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 radius will be centered at (0, 0, 0). Its axis is aligned with z-axis.

Parameters
radiusdefines radius of the sphere.
resolutiondefines the resolution of the sphere. The longitudes will be split into resolution segments (i.e. there are resolution + 1 latitude lines including the north and south pole). The latitudes will be split into `2 * resolution segments (i.e. there are 2 * resolution longitude lines.)

◆ 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.
radiusdefines the distance from centroid to mesh vetices.

◆ 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 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_resolution and tubular_resolution respectively.

Parameters
torus_radiusdefines the radius from the center of the torus to the center of the tube.
tube_radiusdefines the radius of the torus tube.
radial_resolutiondefines the he number of segments along the radial direction.
tubular_resolutiondefines the number of segments along the tubular direction.

◆ Crop() [1/2]

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::Crop ( const AxisAlignedBoundingBox bbox) const

Function to crop pointcloud into output pointcloud All points with coordinates outside the bounding box

Parameters
bboxare clipped.
bboxdefines the input Axis Aligned Bounding Box.

◆ Crop() [2/2]

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::Crop ( const OrientedBoundingBox bbox) const

Function to crop pointcloud into output pointcloud All points with coordinates outside the bounding box

Parameters
bboxare clipped.
bboxdefines the input Oriented Bounding Box.

◆ DeformAsRigidAsPossible()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::DeformAsRigidAsPossible ( const std::vector< int > &  constraint_vertex_indices,
const std::vector< Eigen::Vector3d > &  constraint_vertex_positions,
size_t  max_iter,
DeformAsRigidAsPossibleEnergy  energy = DeformAsRigidAsPossibleEnergy::Spokes,
double  smoothed_alpha = 0.01 
) const

This function deforms the mesh using the method by Sorkine and Alexa, "As-Rigid-As-Possible Surface Modeling", 2007.

Parameters
constraint_vertex_indicesIndices of the triangle vertices that should be constrained by the vertex positions in constraint_vertex_positions.
constraint_vertex_positionsVertex positions used for the constraints.
max_itermaximum number of iterations to minimize energy functional.
energyenergy model that should be optimized
smoothed_alphaalpha parameter of the smoothed ARAP model
Returns
The deformed TriangleMesh

◆ 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 strength times the input value minus the sum of he adjacent values. $v_o = v_i + strength (v_i * |N| - \sum_{n \in N} v_n)$.

Parameters
number_of_iterationsdefines the number of repetitions of this operation.
strength- The strength of the filter.

◆ 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 \cdot \lambda (\sum_{n \in 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),

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

◆ 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 = \frac{v_i + \sum_{n \in 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 lambda and second with mu as smoothing parameter. This method avoids shrinkage of the triangle mesh.

Parameters
number_of_iterationsdefines the number of repetitions of this operation.
lambdais the filter parameter
muis the filter parameter

◆ GetEdgeToTrianglesMap()

std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen< 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.

◆ GetEdgeToVerticesMap()

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

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

◆ 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, then 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.)

◆ GetOrderedEdge()

static Eigen::Vector2i open3d::geometry::TriangleMesh::GetOrderedEdge ( int  vidx0,
int  vidx1 
)
inlinestatic

Helper function to get an edge with ordered vertex indices.

◆ GetOrderedTriangle()

static Eigen::Vector3i open3d::geometry::TriangleMesh::GetOrderedTriangle ( int  vidx0,
int  vidx1,
int  vidx2 
)
inlinestatic

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

◆ GetVolume()

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

Function that computes the volume of the mesh, under the condition that it is watertight and orientable. See Zhang and Chen, "Efficient feature extraction for 2D/3D objects in mesh representation", 2001.

◆ HasAdjacencyList()

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

Returns true if the mesh contains adjacency normals.

◆ HasMaterials()

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

◆ HasTextures()

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

Returns true if the mesh has texture.

◆ HasTriangleMaterialIds()

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

◆ HasTriangleNormals()

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

Returns true if the mesh contains triangle normals.

◆ HasTriangles()

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

Returns true if the mesh contains triangles.

◆ HasTriangleUvs()

bool open3d::geometry::TriangleMesh::HasTriangleUvs ( ) 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.

◆ 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 be 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.

◆ MergeCloseVertices()

TriangleMesh & open3d::geometry::TriangleMesh::MergeCloseVertices ( double  eps)

Function that will merge close by vertices to a single one. The vertex position, normal and color will be the average of the vertices.

Parameters
epsdefines the maximum distance of close by vertices. This function might help to close triangle soups.

◆ NormalizeNormals()

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

Normalize both triangle normals and vertex normals to length 1.

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

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

◆ RemoveTrianglesByIndex()

void open3d::geometry::TriangleMesh::RemoveTrianglesByIndex ( const std::vector< size_t > &  triangle_indices)

This function removes the triangles with index in triangle_indices. Call RemoveUnreferencedVertices to clean up vertices afterwards.

Parameters
triangle_indicesIndices of the triangles that should be removed.

◆ RemoveTrianglesByMask()

void open3d::geometry::TriangleMesh::RemoveTrianglesByMask ( const std::vector< bool > &  triangle_mask)

This function removes the triangles that are masked in triangle_mask. Call RemoveUnreferencedVertices to clean up vertices afterwards.

Parameters
triangle_maskMask of triangles that should be removed. Should have same size as triangles_.

◆ RemoveUnreferencedVertices()

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

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

◆ RemoveVerticesByIndex()

void open3d::geometry::TriangleMesh::RemoveVerticesByIndex ( const std::vector< size_t > &  vertex_indices)

This function removes the vertices with index in vertex_indices. Note that also all triangles associated with the vertices are removeds.

Parameters
vertex_indicesIndices of the vertices that should be removed.

◆ RemoveVerticesByMask()

void open3d::geometry::TriangleMesh::RemoveVerticesByMask ( const std::vector< bool > &  vertex_mask)

This function removes the vertices that are masked in vertex_mask. Note that also all triangles associated with the vertices are removed.

Parameters
vertex_maskMask of vertices that should be removed. Should have same size as vertices_.

◆ Rotate()

TriangleMesh & open3d::geometry::TriangleMesh::Rotate ( const Eigen::Matrix3d &  R,
const Eigen::Vector3d &  center 
)
overridevirtual

Apply rotation to the geometry coordinates and normals. Given a rotation matrix $R$, and center $c$, a given point $p$ is transformed according to $R (p - c) + c$.

Parameters
RA 3x3 rotation matrix
centerRotation center that is used for the rotation.

Reimplemented from open3d::geometry::MeshBase.

◆ 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,
bool  use_triangle_normal = false,
int  seed = -1 
)

Function to sample number_of_points points (blue noise). Based on the method presented in Yuksel, "Sample Elimination for Generating Poisson Disk Sample Sets", EUROGRAPHICS, 2015 The PointCloud pcl_init is used for sample elimination if given, otherwise a PointCloud is first uniformly sampled with init_number_of_points x number_of_points number of points. use_triangle_normal Set to true to assign the triangle normals to the returned points instead of the interpolated vertex normals. The triangle normals will be computed and added to the mesh if necessary. seed Sets the seed value used in the random generator, set to -1 to use a random seed value with each function call.

◆ SamplePointsUniformly()

std::shared_ptr< PointCloud > open3d::geometry::TriangleMesh::SamplePointsUniformly ( size_t  number_of_points,
bool  use_triangle_normal = false,
int  seed = -1 
)

Function to sample

Parameters
number_of_pointspoints uniformly from the mesh.
use_triangle_normalSet to true to assign the triangle normals to the returned points instead of the interpolated vertex normals. The triangle normals will be computed and added to the mesh if necessary.
seedSets the seed value used in the random generator, set to -1 to use a random seed value with each function call.

◆ SamplePointsUniformlyImpl()

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

Function to sample

Parameters
number_of_pointspoints uniformly from the mesh.

◆ SelectByIndex()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::SelectByIndex ( const std::vector< size_t > &  indices,
bool  cleanup = true 
) const

Function to select points from input TriangleMesh into output TriangleMesh Vertices with indices in indices are selected.

Parameters
indicesdefines Indices of vertices to be selected.
cleanupIf true it automatically calls TriangleMesh::RemoveDuplicatedVertices, TriangleMesh::RemoveDuplicatedTriangles, TriangleMesh::RemoveUnreferencedVertices, and TriangleMesh::RemoveDegenerateTriangles

◆ SimplifyQuadricDecimation()

std::shared_ptr< TriangleMesh > open3d::geometry::TriangleMesh::SimplifyQuadricDecimation ( int  target_number_of_triangles,
double  maximum_error = std::numeric_limits<double>::infinity(),
double  boundary_weight = 1.0 
) const

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

Parameters
target_number_of_trianglesdefines the number of triangles that the simplified mesh should have. It is not guaranteed that this number will be reached.
maximum_errordefines the maximum error where a vertex is allowed to be merged
boundary_weighta weight applied to edge vertices used to preserve boundaries

◆ SimplifyVertexClustering()

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

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

Parameters
voxel_size- The size of the voxel within vertices are pooled.
contraction- Method to aggregate vertex information. Average computes a simple average, Quadric minimizes the distance to the adjacent planes.

◆ 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.
    Parameters
    number_of_iterationsdefines a single iteration splits each triangle into four triangles that cover the same surface.

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

Parameters
number_of_iterationsdefines a single iteration splits each triangle into four triangles that cover the same surface.

◆ Transform()

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

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

Reimplemented from open3d::geometry::MeshBase.

Field Documentation

◆ adjacency_list_

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

The set adjacency_list[i] contains the indices of adjacent vertices of vertex i.

◆ materials_

std::unordered_map<std::string, Material> open3d::geometry::TriangleMesh::materials_

◆ textures_

std::vector<Image> open3d::geometry::TriangleMesh::textures_

Textures of the image.

◆ triangle_material_ids_

std::vector<int> open3d::geometry::TriangleMesh::triangle_material_ids_

List of material ids.

◆ triangle_normals_

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

Triangle normals.

◆ triangle_uvs_

std::vector<Eigen::Vector2d> open3d::geometry::TriangleMesh::triangle_uvs_

List of uv coordinates per triangle.

◆ triangles_

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

List of triangles denoted by the index of points forming the triangle.


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