Point Cloud Library (PCL) 1.15.1
Loading...
Searching...
No Matches
pcl::EarClipping Class Reference

The ear clipping triangulation algorithm. More...

#include <pcl/surface/ear_clipping.h>

Inheritance diagram for pcl::EarClipping:

Public Types

using Ptr = shared_ptr<EarClipping>
using ConstPtr = shared_ptr<const EarClipping>
Public Types inherited from pcl::MeshProcessing
using Ptr = shared_ptr<MeshProcessing>
using ConstPtr = shared_ptr<const MeshProcessing>
using PolygonMeshConstPtr = PolygonMesh::ConstPtr

Public Member Functions

 EarClipping ()=default
 Empty constructor.
Public Member Functions inherited from pcl::MeshProcessing
 MeshProcessing ()=default
 Constructor.
virtual ~MeshProcessing ()=default
 Destructor.
void setInputMesh (const pcl::PolygonMeshConstPtr &input)
 Set the input mesh that we want to process.
pcl::PolygonMeshConstPtr getInputMesh () const
 Get the input mesh to be processed.
void process (pcl::PolygonMesh &output)
 Process the input surface mesh and store the results.

Public Attributes

pcl::PolygonMeshConstPtr input_mesh_
 Input polygonal mesh.

Protected Member Functions

bool initCompute () override
 This method should get called before starting the actual computation.
void performProcessing (pcl::PolygonMesh &output) override
 The actual surface reconstruction method.
void triangulate (const Vertices &vertices, PolygonMesh &output)
 Triangulate one polygon.
float area (const Indices &vertices)
 Compute the signed area of a polygon.
bool isEar (int u, int v, int w, const Indices &vertices)
 Check if the triangle (u,v,w) is an ear.
bool isInsideTriangle (const Eigen::Vector3f &u, const Eigen::Vector3f &v, const Eigen::Vector3f &w, const Eigen::Vector3f &p)
 Check if p is inside the triangle (u,v,w).
float crossProduct (const Eigen::Vector2f &p1, const Eigen::Vector2f &p2) const
 Compute the cross product between 2D vectors.
Protected Member Functions inherited from pcl::MeshProcessing
virtual void deinitCompute ()
 UnInitialize computation.
virtual std::string getClassName () const
 Abstract class get name method.

Protected Attributes

pcl::PointCloud< pcl::PointXYZ >::Ptr points_
 a Pointer to the point cloud data.
Protected Attributes inherited from pcl::MeshProcessing
pcl::PolygonMeshConstPtr input_mesh_
 Input polygonal mesh.

Detailed Description

The ear clipping triangulation algorithm.

The code is inspired by Flavien Brebion implementation, which is in n^3 and does not handle holes.

Author
Nicolas Burrus

Definition at line 52 of file ear_clipping.h.

Member Typedef Documentation

◆ ConstPtr

using pcl::EarClipping::ConstPtr = shared_ptr<const EarClipping>

Definition at line 56 of file ear_clipping.h.

◆ Ptr

using pcl::EarClipping::Ptr = shared_ptr<EarClipping>

Definition at line 55 of file ear_clipping.h.

Constructor & Destructor Documentation

◆ EarClipping()

pcl::EarClipping::EarClipping ( )
default

Empty constructor.

Member Function Documentation

◆ area()

float pcl::EarClipping::area ( const Indices & vertices)
protected

Compute the signed area of a polygon.

Parameters
[in]verticesthe vertices representing the polygon

◆ crossProduct()

float pcl::EarClipping::crossProduct ( const Eigen::Vector2f & p1,
const Eigen::Vector2f & p2 ) const
inlineprotected

Compute the cross product between 2D vectors.

Parameters
[in]p1the first 2D vector
[in]p2the first 2D vector

Definition at line 116 of file ear_clipping.h.

◆ initCompute()

bool pcl::EarClipping::initCompute ( )
overrideprotectedvirtual

This method should get called before starting the actual computation.

Reimplemented from pcl::MeshProcessing.

◆ isEar()

bool pcl::EarClipping::isEar ( int u,
int v,
int w,
const Indices & vertices )
protected

Check if the triangle (u,v,w) is an ear.

Parameters
[in]uthe first triangle vertex
[in]vthe second triangle vertex
[in]wthe third triangle vertex
[in]verticesa set of input vertices

◆ isInsideTriangle()

bool pcl::EarClipping::isInsideTriangle ( const Eigen::Vector3f & u,
const Eigen::Vector3f & v,
const Eigen::Vector3f & w,
const Eigen::Vector3f & p )
protected

Check if p is inside the triangle (u,v,w).

Parameters
[in]uthe first triangle vertex
[in]vthe second triangle vertex
[in]wthe third triangle vertex
[in]pthe point to check

◆ performProcessing()

void pcl::EarClipping::performProcessing ( pcl::PolygonMesh & output)
overrideprotectedvirtual

The actual surface reconstruction method.

Parameters
[out]outputthe output polygonal mesh

Implements pcl::MeshProcessing.

◆ triangulate()

void pcl::EarClipping::triangulate ( const Vertices & vertices,
PolygonMesh & output )
protected

Triangulate one polygon.

Parameters
[in]verticesthe set of vertices
[out]outputthe resultant polygonal mesh

Member Data Documentation

◆ input_mesh_

Input polygonal mesh.

Definition at line 147 of file processing.h.

◆ points_

pcl::PointCloud<pcl::PointXYZ>::Ptr pcl::EarClipping::points_
protected

a Pointer to the point cloud data.

Definition at line 65 of file ear_clipping.h.


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