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

HalfEdgeTriangleMesh inherits TriangleMesh class with the addition of HalfEdge data structure for each half edge in the mesh as well as related functions. More...

#include <HalfEdgeTriangleMesh.h>

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

Data Structures

class  HalfEdge
 HalfEdge class contains vertex, triangle info about a half edge, as well as relations of next and twin half edge. More...
 

Public Member Functions

 HalfEdgeTriangleMesh ()
 Default Constructor. More...
 
virtual HalfEdgeTriangleMeshClear () override
 Clear all elements in the geometry. More...
 
bool HasHalfEdges () const
 Returns true if half-edges have already been computed. More...
 
std::vector< int > BoundaryHalfEdgesFromVertex (int vertex_index) const
 
std::vector< int > BoundaryVerticesFromVertex (int vertex_index) const
 
std::vector< std::vector< int > > GetBoundaries () const
 Returns a vector of boundaries. A boundary is a vector of vertices. More...
 
HalfEdgeTriangleMeshoperator+= (const HalfEdgeTriangleMesh &mesh)
 
HalfEdgeTriangleMesh operator+ (const HalfEdgeTriangleMesh &mesh) const
 
- 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
 
virtual OrientedBoundingBox GetOrientedBoundingBox (bool robust=false) const override
 
virtual OrientedBoundingBox GetMinimalOrientedBoundingBox (bool robust=false) const override
 
virtual MeshBaseTransform (const Eigen::Matrix4d &transformation) override
 Apply transformation (4x4 matrix) to the geometry coordinates. 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...
 
virtual MeshBaseRotate (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...
 
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 std::shared_ptr< HalfEdgeTriangleMeshCreateFromTriangleMesh (const TriangleMesh &mesh)
 
- 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 in the mesh. More...
 
std::vector< Eigen::Vector3d > triangle_normals_
 List of triangle normals in the mesh. More...
 
std::vector< HalfEdgehalf_edges_
 List of HalfEdge in the mesh. More...
 
std::vector< std::vector< int > > ordered_half_edge_from_vertex_
 
- 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

 HalfEdgeTriangleMesh (Geometry::GeometryType type)
 Parameterized Constructor. More...
 
int NextHalfEdgeFromVertex (int init_half_edge_index) const
 
int NextHalfEdgeOnBoundary (int curr_half_edge_index) const
 
- 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 TransformCovariances (const Eigen::Matrix4d &transformation, std::vector< Eigen::Matrix3d > &covariances) const
 Transforms all covariance matrices with the transformation. 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...
 
void RotateCovariances (const Eigen::Matrix3d &R, std::vector< Eigen::Matrix3d > &covariances) const
 Rotate all covariance matrices 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 class  SimplificationContraction { Average , Quadric }
 Indicates the method that is used for mesh simplification if multiple vertices are combined to a single one. More...
 
enum class  FilterScope { All , Color , Normal , Vertex }
 Indicates the scope of filter operations. More...
 
enum class  DeformAsRigidAsPossibleEnergy { Spokes , Smoothed }
 
- Public Types inherited from open3d::geometry::Geometry
enum class  GeometryType {
  Unspecified = 0 , PointCloud = 1 , VoxelGrid = 2 , Octree = 3 ,
  LineSet = 4 , MeshBase = 5 , TriangleMesh = 6 , HalfEdgeTriangleMesh = 7 ,
  Image = 8 , RGBDImage = 9 , TetraMesh = 10 , OrientedBoundingBox = 11 ,
  AxisAlignedBoundingBox = 12
}
 Specifies possible geometry types. More...
 

Detailed Description

HalfEdgeTriangleMesh inherits TriangleMesh class with the addition of HalfEdge data structure for each half edge in the mesh as well as related functions.

Constructor & Destructor Documentation

◆ HalfEdgeTriangleMesh() [1/2]

open3d::geometry::HalfEdgeTriangleMesh::HalfEdgeTriangleMesh ( )
inline

Default Constructor.

Creates an empty instance with GeometryType of HalfEdgeTriangleMesh.

◆ HalfEdgeTriangleMesh() [2/2]

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

Parameterized Constructor.

Creates an empty instance with GeometryType of specified type.

Parameters
typeSpecifies GeometryType for the HalfEdgeTriangleMesh.

Member Function Documentation

◆ BoundaryHalfEdgesFromVertex()

std::vector< int > open3d::geometry::HalfEdgeTriangleMesh::BoundaryHalfEdgesFromVertex ( int  vertex_index) const

Query manifold boundary half edges from a starting vertex If query vertex is not on boundary, empty vector will be returned.

◆ BoundaryVerticesFromVertex()

std::vector< int > open3d::geometry::HalfEdgeTriangleMesh::BoundaryVerticesFromVertex ( int  vertex_index) const

Query manifold boundary vertices from a starting vertex If query vertex is not on boundary, empty vector will be returned.

◆ Clear()

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

Clear all elements in the geometry.

Reimplemented from open3d::geometry::MeshBase.

◆ CreateFromTriangleMesh()

std::shared_ptr< HalfEdgeTriangleMesh > open3d::geometry::HalfEdgeTriangleMesh::CreateFromTriangleMesh ( const TriangleMesh mesh)
static

Convert HalfEdgeTriangleMesh from TriangleMesh. Throws exception if the input mesh is not manifold.

◆ GetBoundaries()

std::vector< std::vector< int > > open3d::geometry::HalfEdgeTriangleMesh::GetBoundaries ( ) const

Returns a vector of boundaries. A boundary is a vector of vertices.

◆ HasHalfEdges()

bool open3d::geometry::HalfEdgeTriangleMesh::HasHalfEdges ( ) const

Returns true if half-edges have already been computed.

◆ NextHalfEdgeFromVertex()

int open3d::geometry::HalfEdgeTriangleMesh::NextHalfEdgeFromVertex ( int  init_half_edge_index) const
protected

Returns the next half edge from starting vertex of the input half edge, in a counterclock wise manner. Returns -1 if when hitting a boundary. This is done by traversing to the next, next and twin half edge.

◆ NextHalfEdgeOnBoundary()

int open3d::geometry::HalfEdgeTriangleMesh::NextHalfEdgeOnBoundary ( int  curr_half_edge_index) const
protected

◆ operator+()

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

◆ operator+=()

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

Field Documentation

◆ half_edges_

std::vector<HalfEdge> open3d::geometry::HalfEdgeTriangleMesh::half_edges_

List of HalfEdge in the mesh.

◆ ordered_half_edge_from_vertex_

std::vector<std::vector<int> > open3d::geometry::HalfEdgeTriangleMesh::ordered_half_edge_from_vertex_

Counter-clockwise ordered half-edges started from each vertex. If the vertex is on boundary, the starting edge must be on boundary too.

◆ triangle_normals_

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

List of triangle normals in the mesh.

◆ triangles_

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

List of triangles in the mesh.


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