Open3D (C++ API)
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TriangleMesh.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // The MIT License (MIT)
5 //
6 // Copyright (c) 2018 www.open3d.org
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 // ----------------------------------------------------------------------------
26 
27 #pragma once
28 
29 #include <Eigen/Core>
30 #include <memory>
31 #include <tuple>
32 #include <unordered_map>
33 #include <unordered_set>
34 #include <vector>
35 
36 #include "Open3D/Geometry/Image.h"
38 #include "Open3D/Utility/Helper.h"
39 
40 namespace open3d {
41 namespace geometry {
42 
43 class PointCloud;
44 class TetraMesh;
45 
46 class TriangleMesh : public MeshBase {
47 public:
49  TriangleMesh(const std::vector<Eigen::Vector3d> &vertices,
50  const std::vector<Eigen::Vector3i> &triangles)
52  triangles_(triangles) {}
53  ~TriangleMesh() override {}
54 
55 public:
56  virtual TriangleMesh &Clear() override;
57  virtual TriangleMesh &Transform(
58  const Eigen::Matrix4d &transformation) override;
59  virtual TriangleMesh &Rotate(const Eigen::Matrix3d &R,
60  bool center = true) override;
61 
62 public:
63  TriangleMesh &operator+=(const TriangleMesh &mesh);
64  TriangleMesh operator+(const TriangleMesh &mesh) const;
65 
66  bool HasTriangles() const {
67  return vertices_.size() > 0 && triangles_.size() > 0;
68  }
69 
70  bool HasTriangleNormals() const {
71  return HasTriangles() && triangles_.size() == triangle_normals_.size();
72  }
73 
74  bool HasAdjacencyList() const {
75  return vertices_.size() > 0 &&
76  adjacency_list_.size() == vertices_.size();
77  }
78 
79  bool HasTriangleUvs() const {
80  return HasTriangles() && triangle_uvs_.size() == 3 * triangles_.size();
81  }
82 
83  bool HasTexture() const { return !texture_.IsEmpty(); }
84 
87  for (size_t i = 0; i < triangle_normals_.size(); i++) {
88  triangle_normals_[i].normalize();
89  if (std::isnan(triangle_normals_[i](0))) {
90  triangle_normals_[i] = Eigen::Vector3d(0.0, 0.0, 1.0);
91  }
92  }
93  return *this;
94  }
95 
97  TriangleMesh &ComputeTriangleNormals(bool normalized = true);
98 
100  TriangleMesh &ComputeVertexNormals(bool normalized = true);
101 
104 
108 
112 
116 
121 
126 
131  TriangleMesh &MergeCloseVertices(double eps);
132 
139  std::shared_ptr<TriangleMesh> FilterSharpen(
140  int number_of_iterations,
141  double strength,
142  FilterScope scope = FilterScope::All) const;
143 
150  std::shared_ptr<TriangleMesh> FilterSmoothSimple(
151  int number_of_iterations,
152  FilterScope scope = FilterScope::All) const;
153 
162  std::shared_ptr<TriangleMesh> FilterSmoothLaplacian(
163  int number_of_iterations,
164  double lambda,
165  FilterScope scope = FilterScope::All) const;
166 
174  std::shared_ptr<TriangleMesh> FilterSmoothTaubin(
175  int number_of_iterations,
176  double lambda = 0.5,
177  double mu = -0.53,
178  FilterScope scope = FilterScope::All) const;
179 
183  int EulerPoincareCharacteristic() const;
184 
188  std::vector<Eigen::Vector2i> GetNonManifoldEdges(
189  bool allow_boundary_edges = true) const;
190 
195  bool IsEdgeManifold(bool allow_boundary_edges = true) const;
196 
200  std::vector<int> GetNonManifoldVertices() const;
201 
205  bool IsVertexManifold() const;
206 
209  std::vector<Eigen::Vector2i> GetSelfIntersectingTriangles() const;
210 
213  bool IsSelfIntersecting() const;
214 
217  bool IsBoundingBoxIntersecting(const TriangleMesh &other) const;
218 
221  bool IsIntersecting(const TriangleMesh &other) const;
222 
226  bool IsOrientable() const;
227 
231  bool IsWatertight() const;
232 
236  bool OrientTriangles();
237 
240  std::unordered_map<Eigen::Vector2i,
241  std::vector<int>,
243  GetEdgeToTrianglesMap() const;
244 
247  std::unordered_map<Eigen::Vector2i,
248  std::vector<int>,
250  GetEdgeToVerticesMap() const;
251 
253  static double ComputeTriangleArea(const Eigen::Vector3d &p0,
254  const Eigen::Vector3d &p1,
255  const Eigen::Vector3d &p2);
256 
259  double GetTriangleArea(size_t triangle_idx) const;
260 
261  static inline Eigen::Vector3i GetOrderedTriangle(int vidx0,
262  int vidx1,
263  int vidx2) {
264  if (vidx0 > vidx2) {
265  std::swap(vidx0, vidx2);
266  }
267  if (vidx0 > vidx1) {
268  std::swap(vidx0, vidx1);
269  }
270  if (vidx1 > vidx2) {
271  std::swap(vidx1, vidx2);
272  }
273  return Eigen::Vector3i(vidx0, vidx1, vidx2);
274  }
275 
278  double GetSurfaceArea() const;
279 
282  double GetSurfaceArea(std::vector<double> &triangle_areas) const;
283 
287  static Eigen::Vector4d ComputeTrianglePlane(const Eigen::Vector3d &p0,
288  const Eigen::Vector3d &p1,
289  const Eigen::Vector3d &p2);
290 
293  Eigen::Vector4d GetTrianglePlane(size_t triangle_idx) const;
294 
296  static inline Eigen::Vector2i GetOrderedEdge(int vidx0, int vidx1) {
297  return Eigen::Vector2i(std::min(vidx0, vidx1), std::max(vidx0, vidx1));
298  }
299 
302  std::shared_ptr<PointCloud> SamplePointsUniformlyImpl(
303  size_t number_of_points,
304  std::vector<double> &triangle_areas,
305  double surface_area) const;
306 
309  std::shared_ptr<PointCloud> SamplePointsUniformly(
310  size_t number_of_points) const;
311 
318  std::shared_ptr<PointCloud> SamplePointsPoissonDisk(
319  size_t number_of_points,
320  double init_factor = 5,
321  const std::shared_ptr<PointCloud> pcl_init = nullptr) const;
322 
326  std::shared_ptr<TriangleMesh> SubdivideMidpoint(
327  int number_of_iterations) const;
328 
332  std::shared_ptr<TriangleMesh> SubdivideLoop(int number_of_iterations) const;
333 
336  std::shared_ptr<TriangleMesh> SimplifyVertexClustering(
337  double voxel_size,
338  SimplificationContraction contraction =
340 
343  std::shared_ptr<TriangleMesh> SimplifyQuadricDecimation(
344  int target_number_of_triangles) const;
345 
349  std::shared_ptr<TriangleMesh> SelectDownSample(
350  const std::vector<size_t> &indices) const;
351 
355  std::shared_ptr<TriangleMesh> Crop(
356  const AxisAlignedBoundingBox &bbox) const;
357 
361  std::shared_ptr<TriangleMesh> Crop(const OrientedBoundingBox &bbox) const;
362 
369  std::tuple<std::vector<int>, std::vector<size_t>, std::vector<double>>
371 
378  void RemoveTrianglesByIndex(const std::vector<size_t> &triangle_indices);
379 
386  void RemoveTrianglesByMask(const std::vector<bool> &triangle_mask);
387 
394  void RemoveVerticesByIndex(const std::vector<size_t> &vertex_indices);
395 
402  void RemoveVerticesByMask(const std::vector<bool> &vertex_mask);
403 
414  std::shared_ptr<TriangleMesh> DeformAsRigidAsPossible(
415  const std::vector<int> &constraint_vertex_indices,
416  const std::vector<Eigen::Vector3d> &constraint_vertex_positions,
417  size_t max_iter) const;
418 
430  static std::shared_ptr<TriangleMesh> CreateFromPointCloudAlphaShape(
431  const PointCloud &pcd,
432  double alpha,
433  std::shared_ptr<TetraMesh> tetra_mesh = nullptr,
434  std::vector<size_t> *pt_map = nullptr);
435 
445  static std::shared_ptr<TriangleMesh> CreateFromPointCloudBallPivoting(
446  const PointCloud &pcd, const std::vector<double> &radii);
447 
469  static std::tuple<std::shared_ptr<TriangleMesh>, std::vector<double>>
471  size_t depth = 8,
472  size_t width = 0,
473  float scale = 1.1f,
474  bool linear_fit = false);
475 
479  static std::shared_ptr<TriangleMesh> CreateTetrahedron(double radius = 1.0);
480 
484  static std::shared_ptr<TriangleMesh> CreateOctahedron(double radius = 1.0);
485 
489  static std::shared_ptr<TriangleMesh> CreateIcosahedron(double radius = 1.0);
490 
495  static std::shared_ptr<TriangleMesh> CreateBox(double width = 1.0,
496  double height = 1.0,
497  double depth = 1.0);
498 
504  static std::shared_ptr<TriangleMesh> CreateSphere(double radius = 1.0,
505  int resolution = 20);
506 
512  static std::shared_ptr<TriangleMesh> CreateCylinder(double radius = 1.0,
513  double height = 2.0,
514  int resolution = 20,
515  int split = 4);
516 
521  static std::shared_ptr<TriangleMesh> CreateCone(double radius = 1.0,
522  double height = 2.0,
523  int resolution = 20,
524  int split = 1);
525 
531  static std::shared_ptr<TriangleMesh> CreateTorus(
532  double torus_radius = 1.0,
533  double tube_radius = 0.5,
534  int radial_resolution = 30,
535  int tubular_resolution = 20);
536 
547  static std::shared_ptr<TriangleMesh> CreateArrow(
548  double cylinder_radius = 1.0,
549  double cone_radius = 1.5,
550  double cylinder_height = 5.0,
551  double cone_height = 4.0,
552  int resolution = 20,
553  int cylinder_split = 4,
554  int cone_split = 1);
555 
560  static std::shared_ptr<TriangleMesh> CreateCoordinateFrame(
561  double size = 1.0,
562  const Eigen::Vector3d &origin = Eigen::Vector3d(0.0, 0.0, 0.0));
563 
572  static std::shared_ptr<TriangleMesh> CreateMoebius(int length_split = 70,
573  int width_split = 15,
574  int twists = 1,
575  double radius = 1,
576  double flatness = 1,
577  double width = 1,
578  double scale = 1);
579 
580 protected:
581  // Forward child class type to avoid indirect nonvirtual base
583 
585  std::shared_ptr<TriangleMesh> &mesh,
586  const std::vector<Eigen::Vector3d> &prev_vertices,
587  const std::vector<Eigen::Vector3d> &prev_vertex_normals,
588  const std::vector<Eigen::Vector3d> &prev_vertex_colors,
589  const std::vector<std::unordered_set<int>> &adjacency_list,
590  double lambda,
591  bool filter_vertex,
592  bool filter_normal,
593  bool filter_color) const;
594 
603  std::unordered_map<Eigen::Vector2i,
604  double,
607  const std::unordered_map<Eigen::Vector2i,
608  std::vector<int>,
610  &edges_to_vertices,
611  double min_weight = std::numeric_limits<double>::lowest()) const;
612 
613 public:
614  std::vector<Eigen::Vector3i> triangles_;
615  std::vector<Eigen::Vector3d> triangle_normals_;
616  std::vector<std::unordered_set<int>> adjacency_list_;
617  std::vector<Eigen::Vector2d> triangle_uvs_;
619 };
620 
621 } // namespace geometry
622 } // namespace open3d
static std::shared_ptr< TriangleMesh > CreateFromPointCloudBallPivoting(const PointCloud &pcd, const std::vector< double > &radii)
Definition: SurfaceReconstructionBallPivoting.cpp:749
bool IsSelfIntersecting() const
Definition: TriangleMesh.cpp:1329
std::shared_ptr< PointCloud > SamplePointsUniformlyImpl(size_t number_of_points, std::vector< double > &triangle_areas, double surface_area) const
Definition: TriangleMesh.cpp:427
std::vector< Eigen::Vector3i > triangles_
Definition: TriangleMesh.h:614
TriangleMesh & RemoveDuplicatedTriangles()
Definition: TriangleMesh.cpp:689
bool IsOrientable() const
Definition: TriangleMesh.cpp:1079
void RemoveVerticesByIndex(const std::vector< size_t > &vertex_indices)
This function removes the vertices with index in vertex_indices. Note that also all triangles associa...
Definition: TriangleMesh.cpp:1468
void RemoveVerticesByMask(const std::vector< bool > &vertex_mask)
This function removes the vertices that are masked in vertex_mask. Note that also all triangles assoc...
Definition: TriangleMesh.cpp:1485
bool HasTexture() const
Definition: TriangleMesh.h:83
Definition: Helper.h:90
std::shared_ptr< TriangleMesh > SubdivideLoop(int number_of_iterations) const
Definition: TriangleMeshSubdivide.cpp:116
std::shared_ptr< TriangleMesh > SelectDownSample(const std::vector< size_t > &indices) const
Definition: DownSample.cpp:169
The base geometry class.
Definition: Geometry.h:35
std::vector< int > GetNonManifoldVertices() const
Definition: TriangleMesh.cpp:1237
std::shared_ptr< TriangleMesh > FilterSmoothSimple(int number_of_iterations, FilterScope scope=FilterScope::All) const
Definition: TriangleMesh.cpp:224
TriangleMesh & MergeCloseVertices(double eps)
Definition: TriangleMesh.cpp:894
static std::shared_ptr< 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)
Definition: TriangleMeshFactory.cpp:443
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:130
std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen::hash< Eigen::Vector2i > > GetEdgeToTrianglesMap() const
Definition: TriangleMesh.cpp:1098
bool IsBoundingBoxIntersecting(const TriangleMesh &other) const
Definition: TriangleMesh.cpp:1333
TriangleMesh()
Definition: TriangleMesh.h:48
void RemoveTrianglesByIndex(const std::vector< size_t > &triangle_indices)
This function removes the triangles with index in triangle_indices. Call RemoveUnreferencedVertices t...
Definition: TriangleMesh.cpp:1428
std::shared_ptr< TriangleMesh > FilterSharpen(int number_of_iterations, double strength, FilterScope scope=FilterScope::All) const
Definition: TriangleMesh.cpp:153
Definition: MeshBase.h:45
MeshBase & NormalizeNormals()
Definition: MeshBase.h:97
A bounding box oriented along an arbitrary frame of reference.
Definition: BoundingVolume.h:44
Definition: PointCloud.h:50
bool IsEdgeManifold(bool allow_boundary_edges=true) const
Definition: TriangleMesh.cpp:1224
TriangleMesh & ComputeVertexNormals(bool normalized=true)
Function to compute vertex normals, usually called before rendering.
Definition: TriangleMesh.cpp:122
static std::shared_ptr< TriangleMesh > CreateSphere(double radius=1.0, int resolution=20)
Definition: TriangleMeshFactory.cpp:157
bool HasTriangleUvs() const
Definition: TriangleMesh.h:79
static 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:1133
static Eigen::Vector2i GetOrderedEdge(int vidx0, int vidx1)
Helper function to get an edge with ordered vertex indices.
Definition: TriangleMesh.h:296
static std::shared_ptr< TriangleMesh > CreateBox(double width=1.0, double height=1.0, double depth=1.0)
Definition: TriangleMeshFactory.cpp:120
Eigen::Vector4d GetTrianglePlane(size_t triangle_idx) const
Definition: TriangleMesh.cpp:1186
std::tuple< std::vector< int >, std::vector< size_t >, std::vector< double > > ClusterConnectedTriangles() const
Definition: TriangleMesh.cpp:1361
static std::shared_ptr< TriangleMesh > CreateCoordinateFrame(double size=1.0, const Eigen::Vector3d &origin=Eigen::Vector3d(0.0, 0.0, 0.0))
Definition: TriangleMeshFactory.cpp:402
std::vector< Eigen::Vector2i > GetSelfIntersectingTriangles() const
Definition: TriangleMesh.cpp:1297
TriangleMesh & operator+=(const TriangleMesh &mesh)
Definition: TriangleMesh.cpp:71
std::shared_ptr< TriangleMesh > FilterSmoothLaplacian(int number_of_iterations, double lambda, FilterScope scope=FilterScope::All) const
Definition: TriangleMesh.cpp:340
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)
Function that computes a triangle mesh from a oriented PointCloud pcd. This implements the Screened P...
Definition: SurfaceReconstructionPoisson.cpp:729
static std::shared_ptr< TriangleMesh > CreateCylinder(double radius=1.0, double height=2.0, int resolution=20, int split=4)
Definition: TriangleMeshFactory.cpp:202
int size
Definition: FilePCD.cpp:56
TriangleMesh & RemoveDegenerateTriangles()
Definition: TriangleMesh.cpp:784
std::shared_ptr< TriangleMesh > Crop(const AxisAlignedBoundingBox &bbox) const
Definition: DownSample.cpp:482
static std::shared_ptr< TriangleMesh > CreateTetrahedron(double radius=1.0)
Definition: TriangleMeshFactory.cpp:33
bool IsVertexManifold() const
Definition: TriangleMesh.cpp:1293
double voxel_size
Definition: FilePLY.cpp:285
bool IsIntersecting(const TriangleMesh &other) const
Definition: TriangleMesh.cpp:1338
std::unordered_map< Eigen::Vector2i, double, utility::hash_eigen::hash< Eigen::Vector2i > > ComputeEdgeWeightsCot(const std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen::hash< 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 t...
Definition: TriangleMesh.cpp:1532
TriangleMesh & ComputeAdjacencyList()
Function to compute adjacency list, call before adjacency list is needed.
Definition: TriangleMesh.cpp:139
Image texture_
Definition: TriangleMesh.h:618
bool IsWatertight() const
Definition: TriangleMesh.cpp:1084
TriangleMesh & NormalizeNormals()
Definition: TriangleMesh.h:85
TriangleMesh(const std::vector< Eigen::Vector3d > &vertices, const std::vector< Eigen::Vector3i > &triangles)
Definition: TriangleMesh.h:49
virtual TriangleMesh & Transform(const Eigen::Matrix4d &transformation) override
Apply transformation (4x4 matrix) to the geometry coordinates.
Definition: TriangleMesh.cpp:59
FilterScope
Definition: MeshBase.h:62
SimplificationContraction
Definition: MeshBase.h:54
virtual TriangleMesh & Clear() override
Clear all elements in the geometry.
Definition: TriangleMesh.cpp:49
std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen::hash< Eigen::Vector2i > > GetEdgeToVerticesMap() const
Definition: TriangleMesh.cpp:1117
virtual TriangleMesh & Rotate(const Eigen::Matrix3d &R, bool center=true) override
Apply rotation to the geometry coordinates and normals.
Definition: TriangleMesh.cpp:65
void RemoveTrianglesByMask(const std::vector< bool > &triangle_mask)
This function removes the triangles that are masked in triangle_mask. Call RemoveUnreferencedVertices...
Definition: TriangleMesh.cpp:1445
bool HasTriangles() const
Definition: TriangleMesh.h:66
TriangleMesh operator+(const TriangleMesh &mesh) const
Definition: TriangleMesh.cpp:103
static Eigen::Vector4d ComputeTrianglePlane(const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2)
Definition: TriangleMesh.cpp:1170
bool OrientTriangles()
Definition: TriangleMesh.cpp:1088
TriangleMesh & RemoveNonManifoldEdges()
Definition: TriangleMesh.cpp:814
static std::shared_ptr< TriangleMesh > CreateTorus(double torus_radius=1.0, double tube_radius=0.5, int radial_resolution=30, int tubular_resolution=20)
Definition: TriangleMeshFactory.cpp:307
char type
Definition: FilePCD.cpp:57
std::shared_ptr< TriangleMesh > SubdivideMidpoint(int number_of_iterations) const
Definition: TriangleMeshSubdivide.cpp:38
static std::shared_ptr< TriangleMesh > CreateFromPointCloudAlphaShape(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 ...
Definition: SurfaceReconstructionAlphaShape.cpp:41
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
Definition: TriangleMesh.cpp:290
static std::shared_ptr< 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)
Definition: TriangleMeshFactory.cpp:359
bool HasAdjacencyList() const
Definition: TriangleMesh.h:74
Eigen::Vector3d origin
Definition: FilePLY.cpp:284
static std::shared_ptr< TriangleMesh > CreateOctahedron(double radius=1.0)
Definition: TriangleMeshFactory.cpp:55
Definition: PinholeCameraIntrinsic.cpp:34
double GetTriangleArea(size_t triangle_idx) const
Definition: TriangleMesh.cpp:1142
std::vector< Eigen::Vector2i > GetNonManifoldEdges(bool allow_boundary_edges=true) const
Definition: TriangleMesh.cpp:1210
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:40
~TriangleMesh() override
Definition: TriangleMesh.h:53
std::shared_ptr< PointCloud > SamplePointsPoissonDisk(size_t number_of_points, double init_factor=5, const std::shared_ptr< PointCloud > pcl_init=nullptr) const
Definition: TriangleMesh.cpp:502
static std::shared_ptr< TriangleMesh > CreateIcosahedron(double radius=1.0)
Definition: TriangleMeshFactory.cpp:78
int height
Definition: FilePCD.cpp:69
int EulerPoincareCharacteristic() const
Definition: TriangleMesh.cpp:1194
std::vector< std::unordered_set< int > > adjacency_list_
Definition: TriangleMesh.h:616
std::vector< Eigen::Vector3d > triangle_normals_
Definition: TriangleMesh.h:615
TriangleMesh(Geometry::GeometryType type)
Definition: TriangleMesh.h:582
TriangleMesh & RemoveUnreferencedVertices()
Definition: TriangleMesh.cpp:741
bool HasTriangleNormals() const
Definition: TriangleMesh.h:70
std::vector< Eigen::Vector3d > vertices_
Definition: MeshBase.h:125
Definition: TriangleMesh.h:46
TriangleMesh & ComputeTriangleNormals(bool normalized=true)
Function to compute triangle normals, usually called before rendering.
Definition: TriangleMesh.cpp:107
TriangleMesh & RemoveDuplicatedVertices()
Definition: TriangleMesh.cpp:645
double GetSurfaceArea() const
Definition: TriangleMesh.cpp:1150
static Eigen::Vector3i GetOrderedTriangle(int vidx0, int vidx1, int vidx2)
Definition: TriangleMesh.h:261
static std::shared_ptr< TriangleMesh > CreateCone(double radius=1.0, double height=2.0, int resolution=20, int split=1)
Definition: TriangleMeshFactory.cpp:254
std::shared_ptr< TriangleMesh > SimplifyVertexClustering(double voxel_size, SimplificationContraction contraction=SimplificationContraction::Average) const
Definition: TriangleMeshSimplification.cpp:92
std::shared_ptr< TriangleMesh > SimplifyQuadricDecimation(int target_number_of_triangles) const
Definition: TriangleMeshSimplification.cpp:267
bool IsEmpty() const override
Returns true iff the geometry is empty.
Definition: Image.cpp:52
std::vector< Eigen::Vector2d > triangle_uvs_
Definition: TriangleMesh.h:617
The Image class stores image with customizable width, height, num of channels and bytes per channel...
Definition: Image.h:53
std::shared_ptr< TriangleMesh > FilterSmoothTaubin(int number_of_iterations, double lambda=0.5, double mu=-0.53, FilterScope scope=FilterScope::All) const
Definition: TriangleMesh.cpp:379
std::shared_ptr< PointCloud > SamplePointsUniformly(size_t number_of_points) const
Definition: TriangleMesh.cpp:484
std::shared_ptr< TriangleMesh > DeformAsRigidAsPossible(const std::vector< int > &constraint_vertex_indices, const std::vector< Eigen::Vector3d > &constraint_vertex_positions, size_t max_iter) const
This function deforms the mesh using the method by Sorkine and Alexa, "As-Rigid-As-Possible Surface M...
Definition: TriangleMeshDeformation.cpp:38
int width
Definition: FilePCD.cpp:68