ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
meshbase.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include <GenericMesh.h>
9 #include <ecvMeshBase.h>
10 #include <ecvPointCloud.h>
11 
12 #include "pybind/docstring.h"
15 
16 #ifdef CV_WINDOWS
17 #pragma warning(disable : 4715)
18 #endif
19 
20 using namespace cloudViewer;
21 namespace cloudViewer {
22 namespace geometry {
23 
24 void pybind_meshbase(py::module& m) {
25  py::native_enum<cloudViewer::TRIANGULATION_TYPES>(
26  m, "TriangulationType", "enum.Enum",
27  "Method for mesh triangulation types.")
28  .value("DELAUNAY_2D_AXIS_ALIGNED",
30  "Triangulation types.")
31  .value("DELAUNAY_2D_BEST_LS_PLANE",
33  "Triangulation types.")
34  .export_values()
35  .finalize();
36  py::class_<GenericMesh, PyGenericMesh<GenericMesh>,
37  std::shared_ptr<GenericMesh>>
38  meshbase(m, "GenericMesh",
39  "GenericMesh class. Triangle mesh contains vertices. "
40  "Optionally, the mesh "
41  "may also contain vertex normals and vertex colors.");
42 
43  py::native_enum<GenericMesh::SimplificationContraction>(
44  m, "SimplificationContraction", "enum.Enum",
45  "Method for mesh simplification contraction.")
47  "The vertex positions are computed by the averaging.")
49  "The vertex positions are computed by minimizing the "
50  "distance to the adjacent triangle planes.")
51  .export_values()
52  .finalize();
53  py::native_enum<GenericMesh::FilterScope>(m, "FilterScope", "enum.Enum",
54  "Scope for mesh filtering.")
55  .value("All", GenericMesh::FilterScope::All,
56  "All properties (color, normal, vertex position) are "
57  "filtered.")
58  .value("Color", GenericMesh::FilterScope::Color,
59  "Only the color values are filtered.")
60  .value("Normal", GenericMesh::FilterScope::Normal,
61  "Only the normal values are filtered.")
62  .value("Vertex", GenericMesh::FilterScope::Vertex,
63  "Only the vertex positions are filtered.")
64  .export_values()
65  .finalize();
66  py::native_enum<GenericMesh::DeformAsRigidAsPossibleEnergy>(
67  m, "DeformAsRigidAsPossibleEnergy", "enum.Enum",
68  "Energy model for the as-rigid-as-possible mesh deformation.")
70  "Is the original energy as formulated in orkine and Alexa, "
71  "\"As-Rigid-As-Possible Surface Modeling\", 2007.")
72  .value("Smoothed",
74  "Adds a rotation smoothing term to the rotations.")
75  .export_values()
76  .finalize();
77 
78  meshbase.def("__repr__",
79  [](const GenericMesh& mesh) {
80  return std::string("GenericMesh with ") +
81  std::to_string(mesh.size()) + " triangles";
82  })
83  .def("size", &GenericMesh::size, "Returns the number of triangles.")
84  .def("has_triangles", &GenericMesh::hasTriangles,
85  "Returns whether triangles are empty.")
86  .def(
87  "get_bbox_corner",
88  [](GenericMesh& mesh) {
89  CCVector3 bbMin, bbMax;
90  mesh.getBoundingBox(bbMin, bbMax);
91  return std::make_tuple(CCVector3d::fromArray(bbMin),
92  CCVector3d::fromArray(bbMax));
93  },
94  "Returns the mesh bounding-box.")
95  .def(
96  "get_next_triangle",
97  [](GenericMesh& mesh) {
98  if (mesh._getNextTriangle()) {
99  return std::ref(*mesh._getNextTriangle());
100  } else {
102  "[GenericMesh] does not have next "
103  "triangle!");
104  }
105  },
106  "Returns the next triangle (relatively to the global "
107  "iterator position).")
108  .def("place_iterator_at_beginning",
110  "Places the mesh iterator at the beginning.");
111 
112  docstring::ClassMethodDocInject(m, "GenericMesh", "size");
113  docstring::ClassMethodDocInject(m, "GenericMesh", "has_triangles");
114  docstring::ClassMethodDocInject(m, "GenericMesh", "get_bbox_corner");
115  docstring::ClassMethodDocInject(m, "GenericMesh", "get_next_triangle");
116  docstring::ClassMethodDocInject(m, "GenericMesh",
117  "place_iterator_at_beginning");
118 
119  py::class_<GenericTriangle, std::shared_ptr<GenericTriangle>>
120  genericTriangle(m, "GenericTriangle",
121  "GenericTriangle, a generic triangle interface.");
122  genericTriangle
123  .def(
124  "get_A",
125  [](const GenericTriangle& triangle) {
126  return CCVector3d::fromArray(*triangle._getA());
127  },
128  "Returns the first vertex (A).")
129  .def(
130  "get_B",
131  [](const GenericTriangle& triangle) {
132  return CCVector3d::fromArray(*triangle._getB());
133  },
134  "Returns second vertex (B).")
135  .def(
136  "get_C",
137  [](const GenericTriangle& triangle) {
138  return CCVector3d::fromArray(*triangle._getC());
139  },
140  "Returns the third vertex (C).");
141 
142  docstring::ClassMethodDocInject(m, "GenericTriangle", "get_A");
143  docstring::ClassMethodDocInject(m, "GenericTriangle", "get_B");
144  docstring::ClassMethodDocInject(m, "GenericTriangle", "get_C");
145 
146  py::class_<cloudViewer::VerticesIndexes,
147  std::shared_ptr<cloudViewer::VerticesIndexes>>
148  verticesindexes(m, "VerticesIndexes",
149  "VerticesIndexes, Triangle described by the "
150  "indexes of its 3 vertices.");
151  py::detail::bind_default_constructor<cloudViewer::VerticesIndexes>(
152  verticesindexes);
153  py::detail::bind_copy_functions<cloudViewer::VerticesIndexes>(
154  verticesindexes);
155  verticesindexes.def(py::init<>())
156  .def(py::init([](unsigned i1, unsigned i2, unsigned i3) {
157  return new cloudViewer::VerticesIndexes(i1, i2, i3);
158  }),
159  "Constructor with specified indexes", "i1"_a, "i2"_a, "i3"_a);
160 
163  std::shared_ptr<cloudViewer::GenericIndexedMesh>,
165  genericIndexedMesh(
166  m, "GenericIndexedMesh",
167  "GenericIndexedMesh with index-based vertex access.");
168  genericIndexedMesh
169  .def("__repr__",
170  [](const cloudViewer::GenericIndexedMesh& mesh) {
171  return std::string("GenericIndexedMesh with ") +
172  std::to_string(mesh.size()) + " triangles";
173  })
174  .def(
175  "get_triangle",
177  size_t triangle_index) {
178  if (mesh._getTriangle(
179  static_cast<unsigned>(triangle_index))) {
180  return std::ref(*mesh._getTriangle(
181  static_cast<unsigned>(triangle_index)));
182  } else {
184  "[cloudViewer::GenericIndexedMesh] does "
185  "not have triangle!");
186  }
187  },
188  "Returns the ith triangle.", "triangle_index"_a)
189  .def(
190  "get_vertice_indexes",
192  size_t triangle_index) {
193  if (mesh.getTriangleVertIndexes(
194  static_cast<unsigned>(triangle_index))) {
195  return std::ref(*mesh.getTriangleVertIndexes(
196  static_cast<unsigned>(triangle_index)));
197  } else {
199  "[cloudViewer::GenericIndexedMesh] does "
200  "not have vertice indexes!");
201  }
202  },
203  "Returns the indexes of the vertices of a given triangle.",
204  "triangle_index"_a)
205  .def(
206  "get_triangle_vertices",
207  [](const cloudViewer::GenericIndexedMesh& mesh,
208  size_t triangle_index) {
209  CCVector3 A, B, C;
210  mesh.getTriangleVertices(
211  static_cast<unsigned>(triangle_index), A, B, C);
212  return std::make_tuple(CCVector3d::fromArray(A),
215  },
216  "Returns the vertices of a given triangle.",
217  "triangle_index"_a)
218  .def(
219  "get_next_vertice_indexes",
221  if (mesh.getNextTriangleVertIndexes()) {
222  return std::ref(*mesh.getNextTriangleVertIndexes());
223  } else {
225  "[cloudViewer::GenericIndexedMesh] does "
226  "not have next vertice indexes!");
227  }
228  },
229  "Returns the indexes of the vertices of the next triangle "
230  "(relatively to the global iterator position).");
231 
232  docstring::ClassMethodDocInject(m, "GenericIndexedMesh", "get_triangle");
233  docstring::ClassMethodDocInject(m, "GenericIndexedMesh",
234  "get_triangle_vertices");
235  docstring::ClassMethodDocInject(m, "GenericIndexedMesh",
236  "get_vertice_indexes");
237  docstring::ClassMethodDocInject(m, "GenericIndexedMesh",
238  "get_next_vertice_indexes");
239 
240  py::class_<ccGenericMesh, PyGeometry<ccGenericMesh>,
241  std::shared_ptr<ccGenericMesh>, cloudViewer::GenericIndexedMesh,
242  ccHObject>
243  genericMesh(m, "ccGenericMesh", py::multiple_inheritance(),
244  "ccGenericMesh class. Generic mesh interface.");
245  genericMesh
246  .def("__repr__",
247  [](const ccGenericMesh& mesh) {
248  return std::string("ccGenericMesh with ") +
249  std::to_string(mesh.size()) + " triangles";
250  })
251  .def(
252  "get_associated_cloud",
253  [](const ccGenericMesh& mesh) {
254  if (mesh.getAssociatedCloud()) {
255  return std::ref(*mesh.getAssociatedCloud());
256  } else {
258  "[ccGenericMesh] does not have associated "
259  "cloud!");
260  }
261  },
262  "Returns the associated cloud.")
263  .def("refresh_bbox", &ccGenericMesh::refreshBB,
264  "Forces bounding-box update.")
265  .def("capacity", &ccGenericMesh::capacity, "Returns max capacity.")
266  .def("has_materials", &ccGenericMesh::hasMaterials,
267  "Returns whether the mesh has materials/textures.")
268  .def("has_textures", &ccGenericMesh::hasTextures,
269  "Returns whether textures are available for this mesh.")
270  .def("has_triangle_normals", &ccGenericMesh::hasTriNormals,
271  "Returns whether the mesh has per-triangle normals.")
272  .def(
273  "get_triangle_normal_indexes",
274  [](const ccGenericMesh& mesh, unsigned triangle_index) {
275  int i1, i2, i3;
276  mesh.getTriangleNormalIndexes(triangle_index, i1, i2,
277  i3);
278  return std::make_tuple(i1, i2, i3);
279  },
280  "Returns a triplet of normal indexes for a given triangle "
281  "(if any).",
282  "triangle_index"_a)
283  .def(
284  "get_triangle_normals",
285  [](const ccGenericMesh& mesh, unsigned triangle_index) {
286  Eigen::Vector3d Na, Nb, Nc;
287  mesh.getTriangleNormals(triangle_index, Na, Nb, Nc);
288  return std::make_tuple(Na, Nb, Nc);
289  },
290  "Returns a given triangle normal.", "triangle_index"_a)
291  .def(
292  "interpolate_normals",
293  [](ccGenericMesh& mesh, unsigned triangle_index,
294  const Eigen::Vector3d& point) {
296  mesh.interpolateNormals(triangle_index, point, normal);
298  },
299  "Interpolates normal(s) inside a given triangle.",
300  "triangle_index"_a, "point"_a)
301  .def(
302  "compute_interpolation_weights",
303  [](const ccGenericMesh& mesh, unsigned triangle_index,
304  const Eigen::Vector3d& point) {
305  CCVector3d weights;
306  mesh.computeInterpolationWeights(triangle_index, point,
307  weights);
308  return CCVector3d::fromArray(weights);
309  },
310  "Returns the (barycentric) interpolation weights for a "
311  "given triangle.",
312  "triangle_index"_a, "point"_a)
313  .def(
314  "interpolate_colors",
315  [](ccGenericMesh& mesh, unsigned triangle_index,
316  const Eigen::Vector3d& point) {
318  bool success = mesh.interpolateColors(triangle_index,
319  point, color);
320  return std::make_tuple(success,
322  },
323  "Interpolates RGB colors inside a given triangle.",
324  "triangle_index"_a, "point"_a)
325  .def(
326  "get_color_from_material",
327  [](ccGenericMesh& mesh, unsigned triangle_index,
328  const Eigen::Vector3d& point,
329  bool interpolate_color_if_no_texture) {
331  bool success = mesh.getColorFromMaterial(
332  triangle_index, point, color,
333  interpolate_color_if_no_texture);
334  return std::make_tuple(success,
336  },
337  "Returns RGB color from a given triangle material/texture.",
338  "triangle_index"_a, "point"_a,
339  "interpolate_color_if_no_texture"_a)
340  .def(
341  "get_vertex_color_from_material",
342  [](ccGenericMesh& mesh, unsigned triangle_index,
343  unsigned char vertex_index,
344  bool return_color_if_no_texture) {
346  bool success = mesh.getVertexColorFromMaterial(
347  triangle_index, vertex_index, color,
348  return_color_if_no_texture);
349  return std::make_tuple(success,
351  },
352  "Returns RGB color of a vertex from a given triangle "
353  "material/texture.",
354  "triangle_index"_a, "vertex_index"_a,
355  "return_color_if_no_texture"_a)
356  .def("is_shown_as_wire", &ccGenericMesh::isShownAsWire,
357  "Returns whether the mesh is displayed as wired or with plain "
358  "facets.")
359  .def("show_wired", &ccGenericMesh::showWired,
360  "Sets whether mesh should be displayed as a wire or with "
361  "plain facets.",
362  "state"_a)
363  .def("is_shown_as_points", &ccGenericMesh::isShownAsPoints,
364  "Returns whether the mesh is displayed as wired or with plain "
365  "facets.")
366  .def("show_points", &ccGenericMesh::showPoints,
367  "Sets whether mesh should be displayed as a point cloud or "
368  "with plain facets.",
369  "state"_a)
370  .def("triangle_norms_shown", &ccGenericMesh::triNormsShown,
371  "Returns whether per-triangle normals are shown or not .")
372  .def("show_triangle_norms", &ccGenericMesh::showTriNorms,
373  "Sets whether to show or not per-triangle normals.", "state"_a)
374  .def("materials_shown", &ccGenericMesh::materialsShown,
375  "Sets whether textures/material should be displayed or not.")
376  .def("show_materials", &ccGenericMesh::showMaterials,
377  "Sets whether textures should be displayed or not.", "state"_a)
378  .def("stippling_enabled", &ccGenericMesh::stipplingEnabled,
379  "Returns whether polygon stippling is enabled or not.")
380  .def("enable_stippling", &ccGenericMesh::enableStippling,
381  "Enables polygon stippling.", "state"_a)
382  .def(
383  "sample_points",
384  [](ccGenericMesh& mesh, bool density_based,
385  double sampling_parameter, bool with_normals,
386  bool with_rgb, bool with_texture) {
387  ccPointCloud* cloud = mesh.samplePoints(
388  density_based, sampling_parameter, with_normals,
389  with_rgb, with_texture, nullptr);
390  return std::shared_ptr<ccPointCloud>(cloud);
391  },
392  "Samples points on a mesh.", "density_based"_a,
393  "sampling_parameter"_a, "with_normals"_a, "with_rgb"_a,
394  "with_texture"_a)
395  .def(
396  "import_parameters_from",
397  [](ccGenericMesh& mesh, const ccGenericMesh& source) {
398  mesh.importParametersFrom(&source);
399  },
400  "Imports the parameters from another mesh.", "source"_a);
401 
402  docstring::ClassMethodDocInject(m, "ccGenericMesh", "get_associated_cloud");
403  docstring::ClassMethodDocInject(m, "ccGenericMesh", "refresh_bbox");
404  docstring::ClassMethodDocInject(m, "ccGenericMesh", "capacity");
405  docstring::ClassMethodDocInject(m, "ccGenericMesh", "has_materials");
406  docstring::ClassMethodDocInject(m, "ccGenericMesh", "has_textures");
407  docstring::ClassMethodDocInject(m, "ccGenericMesh", "has_triangle_normals");
408  docstring::ClassMethodDocInject(m, "ccGenericMesh", "get_triangle_normals");
410  m, "ccGenericMesh", "get_triangle_normal_indexes",
411  {{"triangle_index", "triIndex triangle index"}});
413  m, "ccGenericMesh", "interpolate_normals",
414  {{"triangle_index", "triIndex triangle index"},
415  {"point",
416  "point where to interpolate (should be inside the triangle!)"}});
418  m, "ccGenericMesh", "interpolate_colors",
419  {{"triangle_index", "triIndex triangle index"},
420  {"point",
421  "point where to interpolate (should be inside the triangle!)"}});
422  docstring::ClassMethodDocInject(m, "ccGenericMesh",
423  "compute_interpolation_weights");
425  m, "ccGenericMesh", "get_color_from_material",
426  {{"triangle_index", "triIndex triangle index"},
427  {"point",
428  "point where to grab color (should be inside the triangle!)"},
429  {"interpolate_color_if_no_texture",
430  "whether to return the color interpolated from the RGB field if "
431  "no texture/material is associated to the given triangles"}});
433  m, "ccGenericMesh", "get_vertex_color_from_material",
434  {{"triangle_index", "triIndex triangle index"},
435  {"vertex_index", "vertex index inside triangle (i.e. 0, 1 or 2!)"},
436  {"return_color_if_no_texture",
437  "whether to return the color from the vertex RGB field if no "
438  "texture/material is associated to the given triangle"}});
439  docstring::ClassMethodDocInject(m, "ccGenericMesh", "is_shown_as_wire");
440  docstring::ClassMethodDocInject(m, "ccGenericMesh", "show_wired");
441  docstring::ClassMethodDocInject(m, "ccGenericMesh", "is_shown_as_points");
442  docstring::ClassMethodDocInject(m, "ccGenericMesh", "show_points");
443  docstring::ClassMethodDocInject(m, "ccGenericMesh", "triangle_norms_shown");
444  docstring::ClassMethodDocInject(m, "ccGenericMesh", "show_triangle_norms");
445  docstring::ClassMethodDocInject(m, "ccGenericMesh", "materials_shown");
446  docstring::ClassMethodDocInject(m, "ccGenericMesh", "show_materials");
447  docstring::ClassMethodDocInject(m, "ccGenericMesh", "stippling_enabled");
448  docstring::ClassMethodDocInject(m, "ccGenericMesh", "enable_stippling");
449  docstring::ClassMethodDocInject(m, "ccGenericMesh", "sample_points");
450  docstring::ClassMethodDocInject(m, "ccGenericMesh",
451  "import_parameters_from");
452 
453  py::class_<ecvMeshBase, PyGeometry<ecvMeshBase>,
454  std::shared_ptr<ecvMeshBase>, cloudViewer::GenericMesh,
455  ccHObject>
456  meshbase2(m, "ecvMeshBase",
457  "ecvMeshBase class. Triangle mesh contains vertices. "
458  "Optionally, the mesh "
459  "may also contain vertex normals and vertex colors.");
460  py::detail::bind_default_constructor<ecvMeshBase>(meshbase2);
461  py::detail::bind_copy_functions<ecvMeshBase>(meshbase2);
462 
463  meshbase2
464  .def("__repr__",
465  [](const ecvMeshBase& mesh) {
466  return std::string("ecvMeshBase with ") +
467  std::to_string(mesh.vertices_.size()) + " points";
468  })
469  .def(py::self + py::self)
470  .def(py::self += py::self)
471  .def("has_vertices", &ecvMeshBase::HasVertices,
472  "Returns ``True`` if the mesh contains vertices.")
473  .def("has_vertex_normals", &ecvMeshBase::HasVertexNormals,
474  "Returns ``True`` if the mesh contains vertex normals.")
475  .def("has_vertex_colors", &ecvMeshBase::HasVertexColors,
476  "Returns ``True`` if the mesh contains vertex colors.")
477  .def("normalize_normals", &ecvMeshBase::NormalizeNormals,
478  "Normalize vertex normals to length 1.")
479  .def("paint_uniform_color", &ecvMeshBase::PaintUniformColor,
480  "Assigns each vertex in the ecvMeshBase the same color.",
481  "color"_a)
482  .def("compute_convex_hull", &ecvMeshBase::ComputeConvexHull,
483  "Computes the convex hull of the triangle mesh.")
484  .def_readwrite("vertices", &ecvMeshBase::vertices_,
485  "``float64`` array of shape ``(num_vertices, 3)``, "
486  "use ``numpy.asarray()`` to access data: Vertex "
487  "coordinates.")
488  .def_readwrite("vertex_normals", &ecvMeshBase::vertex_normals_,
489  "``float64`` array of shape ``(num_vertices, 3)``, "
490  "use ``numpy.asarray()`` to access data: Vertex "
491  "normals.")
492  .def_readwrite(
493  "vertex_colors", &ecvMeshBase::vertex_colors_,
494  "``float64`` array of shape ``(num_vertices, 3)``, "
495  "range ``[0, 1]`` , use ``numpy.asarray()`` to access "
496  "data: RGB colors of vertices.");
497  docstring::ClassMethodDocInject(m, "ecvMeshBase", "has_vertex_colors");
499  m, "ecvMeshBase", "has_vertex_normals",
500  {{"normalized",
501  "Set to ``True`` to normalize the normal to length 1."}});
502  docstring::ClassMethodDocInject(m, "ecvMeshBase", "has_vertices");
503  docstring::ClassMethodDocInject(m, "ecvMeshBase", "normalize_normals");
504  docstring::ClassMethodDocInject(m, "ecvMeshBase", "paint_uniform_color",
505  {{"color", "RGB colors of vertices."}});
506  docstring::ClassMethodDocInject(m, "ecvMeshBase", "compute_convex_hull");
507 }
508 
509 void pybind_meshbase_methods(py::module& m) {}
510 
511 } // namespace geometry
512 } // namespace cloudViewer
double normal[3]
long vertex_index
math::float4 color
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
Definition: CVGeom.h:268
Generic mesh interface.
virtual void showPoints(bool state)
virtual bool materialsShown() const
Sets whether textures/material should be displayed or not.
virtual bool hasTextures() const =0
Returns whether textures are available for this mesh.
virtual void showWired(bool state)
Sets whether mesh should be displayed as a wire or with plain facets.
virtual bool triNormsShown() const
Returns whether per-triangle normals are shown or not.
virtual bool isShownAsWire() const
Returns whether the mesh is displayed as wired or with plain facets.
virtual bool hasTriNormals() const =0
Returns whether the mesh has per-triangle normals.
void enableStippling(bool state)
Enables polygon stippling.
virtual void showMaterials(bool state)
Sets whether textures should be displayed or not.
virtual bool isShownAsPoints() const
Returns whether the mesh is displayed as wired or with plain facets.
virtual unsigned capacity() const =0
Returns max capacity.
virtual void refreshBB()=0
Forces bounding-box update.
virtual bool stipplingEnabled() const
Returns whether polygon stippling is enabled or not.
virtual bool hasMaterials() const =0
virtual void showTriNorms(bool state)
Sets whether to show or not per-triangle normals.
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
A generic mesh with index-based vertex access.
virtual unsigned size() const =0
Returns the number of triangles.
virtual void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax)=0
Returns the mesh bounding-box.
virtual GenericTriangle * _getNextTriangle()=0
Returns the next triangle (relatively to the global iterator position)
virtual void placeIteratorAtBeginning()=0
Places the mesh iterator at the beginning.
virtual bool hasTriangles() const
Definition: GenericMesh.h:60
A generic triangle interface.
virtual const CCVector3 * _getA() const =0
Returns the first vertex (A)
virtual const CCVector3 * _getC() const =0
Returns the third vertex (C)
virtual const CCVector3 * _getB() const =0
Returns the second vertex (B)
ecvMeshBase & PaintUniformColor(const Eigen::Vector3d &color)
Assigns each vertex in the TriangleMesh the same color.
Definition: ecvMeshBase.h:115
bool HasVertices() const
Returns True if the mesh contains vertices.
Definition: ecvMeshBase.h:87
bool HasVertexColors() const
Returns True if the mesh contains vertex colors.
Definition: ecvMeshBase.h:96
std::tuple< std::shared_ptr< ccMesh >, std::vector< size_t > > ComputeConvexHull() const
Function that computes the convex hull of the triangle mesh using qhull.
bool HasVertexNormals() const
Returns True if the mesh contains vertex normals.
Definition: ecvMeshBase.h:90
ecvMeshBase & NormalizeNormals()
Normalize vertex normals to length 1.
Definition: ecvMeshBase.h:102
std::vector< Eigen::Vector3d > vertex_normals_
Vertex normals.
Definition: ecvMeshBase.h:134
std::vector< Eigen::Vector3d > vertices_
Vertex coordinates.
Definition: ecvMeshBase.h:132
std::vector< Eigen::Vector3d > vertex_colors_
RGB colors of vertices.
Definition: ecvMeshBase.h:136
RGB color structure.
Definition: ecvColorTypes.h:49
static Eigen::Vector3d ToEigen(const Type col[3])
Definition: ecvColorTypes.h:72
#define LogWarning(...)
Definition: Logging.h:72
void ClassMethodDocInject(py::module &pybind_module, const std::string &class_name, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
Definition: docstring.cpp:27
void pybind_meshbase_methods(py::module &m)
Definition: meshbase.cpp:509
void pybind_meshbase(py::module &m)
Definition: meshbase.cpp:24
Generic file read and write utility for python interface.
std::string to_string(const T &n)
Definition: Common.h:20
Triangle described by the indexes of its 3 vertices.
Definition: lsd.c:149