Open3D (C++ API)
Public Types | Public Member Functions | Data Fields | Protected Member Functions
open3d::geometry::MeshBase Class Reference

MeshBash Class. More...

#include <MeshBase.h>

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

Public Types

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

Public Member Functions

 MeshBase ()
 Default Constructor. More...
 
 ~MeshBase () override
 
virtual MeshBaseClear () override
 Clear all elements in the geometry. More...
 
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 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
 
- 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)
 

Data Fields

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

 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

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

Detailed Description

MeshBash Class.

Triangle mesh contains vertices. Optionally, the mesh may also contain vertex normals and vertex colors.

Member Enumeration Documentation

◆ DeformAsRigidAsPossibleEnergy

Energy model that is minimized in the DeformAsRigidAsPossible method.

Parameters
Spokesis the original energy as formulated in Sorkine and Alexa, "As-Rigid-As-Possible Surface Modeling", 2007.
Smoothedadds a rotation smoothing term to the rotations.
Enumerator
Spokes 
Smoothed 

◆ 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

◆ MeshBase() [1/3]

open3d::geometry::MeshBase::MeshBase ( )
inline

Default Constructor.

◆ ~MeshBase()

open3d::geometry::MeshBase::~MeshBase ( )
inlineoverride

◆ MeshBase() [2/3]

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

◆ MeshBase() [3/3]

open3d::geometry::MeshBase::MeshBase ( Geometry::GeometryType  type,
const std::vector< Eigen::Vector3d > &  vertices 
)
inlineprotected

Member Function Documentation

◆ Clear()

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

◆ ComputeConvexHull()

std::tuple< std::shared_ptr< TriangleMesh >, std::vector< size_t > > open3d::geometry::MeshBase::ComputeConvexHull ( ) const

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

◆ GetAxisAlignedBoundingBox()

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

Returns an axis-aligned bounding box of the geometry.

Implements open3d::geometry::Geometry3D.

◆ GetCenter()

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

Returns the center of the geometry coordinates.

Implements open3d::geometry::Geometry3D.

◆ GetMaxBound()

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

Returns max bounds for geometry coordinates.

Implements open3d::geometry::Geometry3D.

◆ GetMinBound()

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

Returns min bounds for geometry coordinates.

Implements open3d::geometry::Geometry3D.

◆ GetOrientedBoundingBox()

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

Returns an oriented bounding box of the geometry.

Implements open3d::geometry::Geometry3D.

◆ HasVertexColors()

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

Returns True if the mesh contains vertex colors.

◆ HasVertexNormals()

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

Returns True if the mesh contains vertex normals.

◆ HasVertices()

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

Returns True if the mesh contains vertices.

◆ IsEmpty()

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

Returns true iff the geometry is empty.

Implements open3d::geometry::Geometry3D.

◆ NormalizeNormals()

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

Normalize vertex normals to length 1.

◆ operator+()

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

◆ operator+=()

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

◆ PaintUniformColor()

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

Assigns each vertex in the TriangleMesh the same color.

Parameters
colorRGB colors of vertices.

◆ Rotate()

MeshBase & open3d::geometry::MeshBase::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.

Implements open3d::geometry::Geometry3D.

Reimplemented in open3d::geometry::TriangleMesh.

◆ Scale()

MeshBase & open3d::geometry::MeshBase::Scale ( const double  scale,
const Eigen::Vector3d &  center 
)
overridevirtual

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

Parameters
scaleThe scale parameter that is multiplied to the points/vertices of the geometry.
centerScale center that is used to resize the geometry.

Implements open3d::geometry::Geometry3D.

◆ Transform()

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

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

Implements open3d::geometry::Geometry3D.

Reimplemented in open3d::geometry::TriangleMesh.

◆ Translate()

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

Apply translation to the geometry coordinates.

Parameters
translationA 3D vector to transform the geometry.
relativeIf true, the translation is directly applied to the geometry. Otherwise, the geometry center is moved to the translation.

Implements open3d::geometry::Geometry3D.

Field Documentation

◆ vertex_colors_

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

RGB colors of vertices.

◆ vertex_normals_

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

Vertex normals.

◆ vertices_

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

Vertex coordinates.


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