|
template<typename Point > |
static bool | mesh2TriangulatedSurface (const Mesh< Point > &mesh, TriangulatedSurface< Point > &trisurf) |
|
template<typename Point > |
static bool | mesh2PolygonalSurface (const Mesh< Point > &mesh, PolygonalSurface< Point > &polysurf) |
|
template<typename Point > |
static void | polygonalSurface2TriangulatedSurface (const PolygonalSurface< Point > &polysurf, TriangulatedSurface< Point > &trisurf, bool centroid=true) |
|
template<typename DigitalSurfaceContainer , typename CellEmbedder , typename VertexMap > |
static void | digitalSurface2DualTriangulatedSurface (const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, TriangulatedSurface< typename CellEmbedder::Value > &trisurf, VertexMap &vertexmap) |
|
template<typename DigitalSurfaceContainer , typename CellEmbedder , typename VertexMap > |
static void | digitalSurface2DualPolygonalSurface (const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, PolygonalSurface< typename CellEmbedder::Value > &polysurf, VertexMap &vertexmap) |
|
template<typename DigitalSurfaceContainer , typename CellEmbedder , typename CellMap > |
static bool | digitalSurface2PrimalPolygonalSurface (const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, PolygonalSurface< typename CellEmbedder::Value > &polysurf, CellMap &cellmap) |
|
template<typename DigitalSurfaceContainer , typename CellEmbedder , typename CellMap > |
static bool | digitalSurface2PrimalSurfaceMesh (const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, SurfaceMesh< typename CellEmbedder::Value, typename CellEmbedder::Value > &polysurf, CellMap &cellmap) |
|
template<typename Point > |
static void | triangulatedSurface2Mesh (const TriangulatedSurface< Point > &trisurf, Mesh< Point > &mesh) |
|
template<typename Point > |
static void | polygonalSurface2Mesh (const PolygonalSurface< Point > &polysurf, Mesh< Point > &mesh) |
|
template<typename RealPoint , typename RealVector > |
static void | surfaceMesh2Mesh (const SurfaceMesh< RealPoint, RealVector > &smesh, Mesh< RealPoint > &mesh, const std::vector< Color > &cols={}) |
|
template<typename Point > |
static bool | exportOBJ (std::ostream &output, const TriangulatedSurface< Point > &trisurf) |
|
template<typename Point > |
static bool | exportOBJ (std::ostream &output, const PolygonalSurface< Point > &polysurf) |
|
template<typename TTriangulatedOrPolygonalSurface > |
static bool | exportOBJwithFaceNormalAndColor (std::ostream &output_obj, const std::string &mtl_filename, const TTriangulatedOrPolygonalSurface &polysurf, const std::vector< typename TTriangulatedOrPolygonalSurface::Point > &normals, const std::vector< Color > &diffuse_colors, const Color &ambient_color=Color(32, 32, 32), const Color &diffuse_color=Color(200, 200, 255), const Color &specular_color=Color::White) |
|
static bool | exportMTLNewMaterial (std::ostream &output_mtl, unsigned long idxMaterial, const Color &ambient_color, const Color &diffuse_color, const Color &specular_color) |
|
Aim: Static class that provides builder and converters between meshes.
Description of template class 'MeshHelpers'
Definition at line 63 of file MeshHelpers.h.
template<typename DigitalSurfaceContainer , typename CellEmbedder , typename VertexMap >
static void DGtal::MeshHelpers::digitalSurface2DualTriangulatedSurface |
( |
const DigitalSurface< DigitalSurfaceContainer > & |
dsurf, |
|
|
const CellEmbedder & |
cembedder, |
|
|
TriangulatedSurface< typename CellEmbedder::Value > & |
trisurf, |
|
|
VertexMap & |
vertexmap |
|
) |
| |
|
static |
Builds a triangulated surface (class TriangulatedSurface) from the dual graph of a 2-dimensional digital surface in K^3 (class DigitalSurface).
- Note
- that a triangulated surface contains only triangles, so faces of the input dual graph of the digital surface mesh are triangulated by adding a new vertex at the barycenter of the face vertices.
- Template Parameters
-
DigitalSurfaceContainer | the container chosen for the digital surface. |
CellEmbedder | the embedder chosen for the digital surface. |
- Parameters
-
[in] | dsurf | the input digital surface. |
[in] | cembedder | the embedder for 2-cells of the digital surface, which are vertices in the output triangulated surface. |
[out] | trisurf | the output triangulated surface mesh. |
[out] | vertexmap | the output mapping between a Vertex of dsurf and an Index in trisurf. |
Referenced by laplacian(), main(), and DGtal::Shortcuts< TKSpace >::makeTriangulatedSurface().
template<typename
Point >
Builds a triangulated surface (class TriangulatedSurface) from a mesh (class Mesh). Note that a triangulated surface contains only triangles, so polygonal faces (0,1,2,3,4,...) of the input mesh are (naively) triangulated (triangles (0,1,2), (0,2,3), (0,3,4), etc). Furthermore, the output triangulated surface rebuilds a topology between faces.
- Template Parameters
-
Point | the type for points. |
- Parameters
-
[in] | mesh | the input mesh. |
[out] | trisurf | the output triangulated surface mesh. |
- Returns
- 'true' on success, 'false' if the input mesh was not a combinatorial surface.
Referenced by DGtal::Shortcuts< TKSpace >::makeTriangulatedSurface(), and SCENARIO().
template<typename
Point >
Builds a polygonal surface from a triangulated surface. Polygonal faces are triangulated according to centroid: when 'true', creates a vertex in each non triangular face, otherwise creates triangles (0,i,i+1) in face (0, 1, ..., n) for i < n-1.
- Template Parameters
-
Point | the type for points. |
- Parameters
-
[in] | polysurf | the input polygonal surface mesh. |
[out] | trisurf | the output triangulated surface. |
[in] | centroid | when 'true' creates a vertex in the middle of non triangular faces and a fan around it, otherwise naively subdivides the face as a fan around the first vertex. |
- Note
- The vertices of trisurf are the same as the one of polysurf, except if there are newly created vertices (centroid case) which are put at the end.
-
Be very careful with "Naive" subdivision, since it may create non-manifold edges on general polygonal surfaces. Indeed, take the closed surface made of faces (0, 1, 2, 3) and (3, 2, 1, 0). Depending on how faces are triangulated, it is still a valid combinatorial triangulated 2-manifold (e.g. (0,1,2,3) gives (0,1,2) and (2,0,3) and (3,2,1,0) gives (3,2,1) and (1,3,0)) or a non-valid one (e.g. (0,1,2,3) gives (0,1,2) and (2,0,3) and (3,2,1,0) gives (3,2,0) and (0,2,1): then edge {2,0} is shared by four faces).
Referenced by DGtal::Shortcuts< TKSpace >::makeTriangulatedSurface().