31 #include <unordered_map> 32 #include <unordered_set> 66 void Clear()
override;
203 for (
size_t i = 0; i <
vertices_.size(); i++) {
217 bool allow_boundary_edges =
true)
const;
262 std::unordered_map<Eigen::Vector2i,
294 const Eigen::Vector3d &p1,
295 const Eigen::Vector3d &p2);
301 const Eigen::Vector3d &p1,
302 const Eigen::Vector3d &p2);
309 size_t number_of_points);
319 size_t number_of_points,
320 double init_factor = 5,
321 const std::shared_ptr<PointCloud> pcl_init =
nullptr);
327 int number_of_iterations);
333 int number_of_iterations);
346 const TriangleMesh &input,
int target_number_of_triangles);
352 const TriangleMesh &input,
const std::vector<size_t> &indices);
359 const Eigen::Vector3d &min_bound,
360 const Eigen::Vector3d &max_bound);
391 int resolution = 20);
416 std::shared_ptr<TriangleMesh>
CreateMeshTorus(
double torus_radius = 1.0,
417 double tube_radius = 0.5,
418 int radial_resolution = 30,
419 int tubular_resolution = 20);
431 std::shared_ptr<TriangleMesh>
CreateMeshArrow(
double cylinder_radius = 1.0,
432 double cone_radius = 1.5,
433 double cylinder_height = 5.0,
434 double cone_height = 4.0,
436 int cylinder_split = 4,
445 const Eigen::Vector3d &origin = Eigen::Vector3d(0.0, 0.0, 0.0));
456 int width_split = 15,
std::shared_ptr< TriangleMesh > CreateMeshSphere(double radius=1.0, int resolution=20)
Definition: TriangleMeshFactory.cpp:160
void ComputeVertexNormals(bool normalized=true)
Function to compute vertex normals, usually called before rendering.
Definition: TriangleMesh.cpp:228
std::vector< Eigen::Vector3d > vertex_colors_
Definition: TriangleMesh.h:286
std::shared_ptr< TriangleMesh > CreateMeshMoebius(int length_split=70, int width_split=15, int twists=1, double radius=1, double flatness=1, double width=1, double scale=1)
Definition: TriangleMeshFactory.cpp:469
bool IsSelfIntersecting() const
Definition: TriangleMesh.cpp:1242
std::vector< Eigen::Vector3i > triangles_
Definition: TriangleMesh.h:287
bool IsOrientable() const
Definition: TriangleMesh.cpp:1003
std::shared_ptr< TriangleMesh > CreateMeshOctahedron(double radius=1.0)
Definition: TriangleMeshFactory.cpp:55
virtual void RemoveDuplicatedVertices()
Definition: TriangleMesh.cpp:672
Eigen::Vector3d GetMaxBound() const override
Definition: TriangleMesh.cpp:77
void PaintUniformColor(const Eigen::Vector3d &color)
Assigns each vertex in the TriangleMesh the same color.
Definition: TriangleMesh.h:201
std::shared_ptr< TriangleMesh > CropTriangleMesh(const TriangleMesh &input, const Eigen::Vector3d &min_bound, const Eigen::Vector3d &max_bound)
Definition: DownSample.cpp:490
Definition: Geometry.h:32
std::vector< int > GetNonManifoldVertices() const
Definition: TriangleMesh.cpp:1149
void ComputeTriangleNormals(bool normalized=true)
Function to compute triangle normals, usually called before rendering.
Definition: TriangleMesh.cpp:215
std::shared_ptr< TriangleMesh > CreateMeshArrow(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)
Definition: TriangleMeshFactory.cpp:375
void Clear() override
Definition: TriangleMesh.cpp:44
virtual void RemoveDuplicatedTriangles()
Definition: TriangleMesh.cpp:714
std::vector< Eigen::Vector3d > vertices_
Definition: TriangleMesh.h:284
std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen::hash< Eigen::Vector2i > > GetEdgeToTrianglesMap() const
Definition: TriangleMesh.cpp:1018
std::shared_ptr< TriangleMesh > ComputeMeshConvexHull(const TriangleMesh &mesh)
Function that computes the convex hull of the triangle mesh using qhull.
Definition: TriangleMesh.cpp:1273
bool IsBoundingBoxIntersecting(const TriangleMesh &other) const
Definition: TriangleMesh.cpp:1246
virtual void RemoveUnreferencedVertices()
Definition: TriangleMesh.cpp:759
TriangleMesh()
Definition: TriangleMesh.h:62
bool HasVertices() const
Definition: TriangleMesh.h:160
void FilterSmoothSimple(int number_of_iterations, FilterScope scope=FilterScope::All)
Definition: TriangleMesh.cpp:376
void FilterSharpen(int number_of_iterations, double strength, FilterScope scope=FilterScope::All)
Definition: TriangleMesh.cpp:317
Definition: TriangleMeshSimplification.cpp:42
bool IsEdgeManifold(bool allow_boundary_edges=true) const
Definition: TriangleMesh.cpp:1136
Eigen::Vector4d GetTrianglePlane(size_t triangle_idx) const
Definition: TriangleMesh.cpp:1090
bool IsEmpty() const override
Definition: TriangleMesh.cpp:53
std::shared_ptr< TriangleMesh > CreateMeshCone(double radius=1.0, double height=2.0, int resolution=20, int split=1)
Definition: TriangleMeshFactory.cpp:262
std::vector< Eigen::Vector2i > GetSelfIntersectingTriangles() const
Definition: TriangleMesh.cpp:1209
RotationType
Definition: Geometry3D.h:40
TriangleMesh & Rotate(const Eigen::Vector3d &rotation, bool center=true, RotationType type=RotationType::XYZ) override
Definition: TriangleMesh.cpp:143
TriangleMesh & operator+=(const TriangleMesh &mesh)
Definition: TriangleMesh.cpp:165
int size
Definition: FilePCD.cpp:55
void NormalizeNormals()
Definition: TriangleMesh.h:185
TriangleMesh & Scale(const double scale, bool center=true) override
Definition: TriangleMesh.cpp:130
std::shared_ptr< TriangleMesh > SimplifyVertexClustering(const TriangleMesh &input, double voxel_size, TriangleMesh::SimplificationContraction contraction=TriangleMesh::SimplificationContraction::Average)
Definition: TriangleMeshSimplification.cpp:92
bool IsVertexManifold() const
Definition: TriangleMesh.cpp:1205
FilterScope
Definition: TriangleMesh.h:60
std::shared_ptr< PointCloud > SelectDownSample(const PointCloud &input, const std::vector< size_t > &indices, bool invert)
Definition: DownSample.cpp:144
bool IsIntersecting(const TriangleMesh &other) const
Definition: TriangleMesh.cpp:1251
std::shared_ptr< PointCloud > SamplePointsUniformly(const TriangleMesh &input, size_t number_of_points, std::vector< double > &triangle_areas, double surface_area)
Definition: TriangleMesh.cpp:257
Definition: Geometry3D.h:38
double ComputeTriangleArea(const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2)
Function that computes the area of a mesh triangle.
Definition: TriangleMesh.cpp:1037
TriangleMesh & Transform(const Eigen::Matrix4d &transformation) override
Definition: TriangleMesh.cpp:99
std::shared_ptr< TriangleMesh > CreateMeshTetrahedron(double radius=1.0)
Definition: TriangleMeshFactory.cpp:33
std::shared_ptr< TriangleMesh > CreateMeshCylinder(double radius=1.0, double height=2.0, int resolution=20, int split=4)
Definition: TriangleMeshFactory.cpp:207
virtual void RemoveDegenerateTriangles()
Definition: TriangleMesh.cpp:800
std::vector< Eigen::Vector3d > vertex_normals_
Definition: TriangleMesh.h:285
bool HasTriangles() const
Definition: TriangleMesh.h:162
TriangleMesh operator+(const TriangleMesh &mesh) const
Definition: TriangleMesh.cpp:211
std::shared_ptr< TriangleMesh > SimplifyQuadricDecimation(const TriangleMesh &input, int target_number_of_triangles)
Definition: TriangleMeshSimplification.cpp:268
std::shared_ptr< TriangleMesh > CreateMeshBox(double width=1.0, double height=1.0, double depth=1.0)
Definition: TriangleMeshFactory.cpp:120
std::shared_ptr< TriangleMesh > SubdivideLoop(const TriangleMesh &input, int number_of_iterations)
Definition: TriangleMeshSubdivide.cpp:112
bool OrientTriangles()
Definition: TriangleMesh.cpp:1008
virtual void RemoveNonManifoldEdges()
Definition: TriangleMesh.cpp:824
char type
Definition: FilePCD.cpp:56
bool HasAdjacencyList() const
Definition: TriangleMesh.h:180
std::shared_ptr< TriangleMesh > CreateMeshCoordinateFrame(double size=1.0, const Eigen::Vector3d &origin=Eigen::Vector3d(0.0, 0.0, 0.0))
Definition: TriangleMeshFactory.cpp:424
void FilterSmoothTaubin(int number_of_iterations, double lambda=0.5, double mu=-0.53, FilterScope scope=FilterScope::All)
Definition: TriangleMesh.cpp:492
Definition: PinholeCameraIntrinsic.cpp:34
double GetTriangleArea(size_t triangle_idx) const
Definition: TriangleMesh.cpp:1046
std::vector< Eigen::Vector2i > GetNonManifoldEdges(bool allow_boundary_edges=true) const
Definition: TriangleMesh.cpp:1122
GeometryType
Definition: Geometry.h:34
~TriangleMesh() override
Definition: TriangleMesh.h:63
int height
Definition: FilePCD.cpp:68
Eigen::Vector4d ComputeTrianglePlane(const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2)
Definition: TriangleMesh.cpp:1074
int EulerPoincareCharacteristic() const
Definition: TriangleMesh.cpp:1098
std::vector< std::unordered_set< int > > adjacency_list_
Definition: TriangleMesh.h:289
std::vector< Eigen::Vector3d > triangle_normals_
Definition: TriangleMesh.h:288
bool HasVertexColors() const
Definition: TriangleMesh.h:171
bool HasVertexNormals() const
Definition: TriangleMesh.h:166
TriangleMesh(Geometry::GeometryType type)
Definition: TriangleMesh.h:157
Eigen::Vector3d GetMinBound() const override
Definition: TriangleMesh.cpp:55
bool HasTriangleNormals() const
Definition: TriangleMesh.h:176
Definition: TriangleMesh.h:43
double GetSurfaceArea() const
Definition: TriangleMesh.cpp:1054
TriangleMesh & Translate(const Eigen::Vector3d &translation) override
Definition: TriangleMesh.cpp:123
void ComputeAdjacencyList()
Function to compute adjacency list, call before adjacency list is needed.
Definition: TriangleMesh.cpp:244
std::shared_ptr< TriangleMesh > CreateMeshTorus(double torus_radius=1.0, double tube_radius=0.5, int radial_resolution=30, int tubular_resolution=20)
Definition: TriangleMeshFactory.cpp:319
std::shared_ptr< TriangleMesh > SubdivideMidpoint(const TriangleMesh &input, int number_of_iterations)
Definition: TriangleMeshSubdivide.cpp:38
std::shared_ptr< PointCloud > SamplePointsPoissonDisk(const TriangleMesh &input, size_t number_of_points, double init_factor, const std::shared_ptr< PointCloud > pcl_init)
Definition: TriangleMesh.cpp:522
std::shared_ptr< TriangleMesh > CreateMeshIcosahedron(double radius=1.0)
Definition: TriangleMeshFactory.cpp:78
void FilterSmoothLaplacian(int number_of_iterations, double lambda, FilterScope scope=FilterScope::All)
Definition: TriangleMesh.cpp:430
int width
Definition: FilePCD.cpp:67
SimplificationContraction
Definition: TriangleMesh.h:52