27 #include <DGtal/base/Common.h>
28 #include <DGtal/helpers/StdDefs.h>
29 #include <DGtal/helpers/Shortcuts.h>
30 #include <DGtal/helpers/ShortcutsGeometry.h>
31 #include <DGtal/shapes/SurfaceMesh.h>
32 #include <DGtal/geometry/surfaces/DigitalSurfaceRegularization.h>
33 #include <DGtal/dec/PolygonalCalculus.h>
35 #include <polyscope/polyscope.h>
36 #include <polyscope/surface_mesh.h>
37 #include <polyscope/point_cloud.h>
38 #include <polyscope/curve_network.h>
40 #include <Eigen/Dense>
41 #include <Eigen/Sparse>
43 using namespace DGtal;
80 std::vector<PolygonalCalculus<SH3::RealPoint,SH3::RealVector>::Real3dPoint> normals;
81 std::vector<PolygonalCalculus<SH3::RealPoint,SH3::RealVector>::Real3dPoint> vectorArea;
82 std::vector<PolygonalCalculus<SH3::RealPoint,SH3::RealVector>::Real3dPoint> centroids;
83 std::vector<double> faceArea;
88 gradients.push_back( grad );
91 cogradients.push_back( cograd );
96 vectorArea.push_back({vA(0) , vA(1), vA(2)});
104 psMesh->addFaceVectorQuantity(
"Gradients", gradients);
105 psMesh->addFaceVectorQuantity(
"co-Gradients", cogradients);
106 psMesh->addFaceVectorQuantity(
"Normals", normals);
107 psMesh->addFaceScalarQuantity(
"Face area", faceArea);
108 psMesh->addFaceVectorQuantity(
"Vector area", vectorArea);
110 psBoundary->addEdgeScalarQuantity(
"d0*phi", dPhi);
111 psBoundary->addEdgeScalarQuantity(
"A*phi", av);
114 polyscope::registerPointCloud(
"Centroids", centroids);
120 psMesh->addFaceVectorQuantity(
"A vector", someV);
123 psBoundary->addEdgeScalarQuantity(
"flat (1-form)", flat);
127 psMesh->addFaceVectorQuantity(
"Sharp", sharpRes);
132 std::vector<RealPoint> positions={ {0,0,0},{20,0,0}, {20,10,0}, {10,8,5}, {0,15,1} };
133 std::vector<std::vector<size_t>> faces={ {0,1,2,3,4} };
140 psVertices = polyscope::registerPointCloud(
"Vertices", positions);
142 std::vector<std::array<size_t,2>> edges={{0,1},{1,2},{2,3},{3,4},{4,0} };
143 psBoundary = polyscope::registerCurveNetwork(
"Edges", positions, edges);
148 psMesh = polyscope::registerSurfaceMesh(
"Single face", positions, faces);
Implements differential operators on polygonal surfaces from .
DenseMatrix D(const Face f) const
Real3dVector faceNormalAsDGtalVector(const Face f) const
Real3dPoint centroidAsDGtalPoint(const Face f) const
Vector vectorArea(const Face f) const
DenseMatrix sharp(const Face f) const
double faceArea(const Face f) const
DenseMatrix coGradient(const Face f) const
DenseMatrix gradient(const Face f) const
MySurfaceMesh::Face Face
Face type.
LinAlg::DenseVector Vector
Type of Vector.
DenseMatrix A(const Face f) const
DenseMatrix flat(const Face f) const
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
SurfaceMesh< RealPoint, RealVector > SurfMesh
PolygonalCalculus< SH3::RealPoint, SH3::RealVector >::Vector phiEigen
SurfMesh::Vertices Vertices
polyscope::CurveNetwork * psBoundary
polyscope::SurfaceMesh * psMesh
Shortcuts< Z3i::KSpace > SH3
ShortcutsGeometry< Z3i::KSpace > SHG3
polyscope::PointCloud * psVertices
DigitalPlane::Point Vector
Space::RealPoint RealPoint
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Represents an embedded mesh as faces and a list of vertices. Vertices may be shared among faces ...
std::vector< Vertex > Vertices
The type that defines a list/range of vertices (e.g. to define faces)
K init(Point(0, 0, 0), Point(512, 512, 512), true)