32#include "ConfigExamples.h"
33#include "DGtal/helpers/StdDefs.h"
34#include "DGtal/base/Common.h"
35#include "DGtal/geometry/surfaces/estimation/MaximalSegmentSliceEstimation.h"
36#include "DGtal/helpers/Shortcuts.h"
37#include "DGtal/io/viewers/PolyscopeViewer.h"
52 auto pointels = SH3::getPrimalVertices(
K, s,
true);
58 static const RealPoint shift(-0.5, -0.5, -0.5);
60 return p + 0.5 * u + 0.5 * v + shift;
67 auto params = SH3::defaultParameters();
68 params(
"polynomial",
"ellipsoid")(
"gridstep",
"1.0");
69 auto implicit_shape = SH3::makeImplicitShape3D ( params );
70 auto digitized_shape = SH3::makeDigitizedImplicitShape3D( implicit_shape, params );
71 auto K = SH3::getKSpace( params );
72 auto binary_image = SH3::makeBinaryImage( digitized_shape, params );
74 auto surfels = SH3::getSurfelRange(
surface);
76 double gridstep = params[
"gridstep"].as<
double>();
84 estimator.
init(gridstep, surfels.begin(), surfels.end());
88 std::vector<Estimator::Quantity> quantities;
89 estimator.eval(surfels.begin(), surfels.end(), std::back_inserter(quantities));
94 for (std::size_t i = 0; i < surfels.size(); ++i)
96 const Surfel& s = surfels[i];
97 const Estimator::Quantity& normal = quantities[i];
102 viewer.drawColor(fillColor);
106 viewer.drawLine(origin, origin + 1.5 * n);
Structure representing an RGB triple with alpha component.
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
Point uCoords(const Cell &c) const
Return its digital coordinates.
void init(Scalar const &h, SurfelConstIterator itb, SurfelConstIterator ite)
PointVector< dim, double, std::array< double, dim > > getNormalized() const
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
LightDigitalSurface::SCell SCell
CountedPtr< SH3::DigitalSurface > surface
CountedPtr< SH3::BinaryImage > binary_image
SH3::DigitalSurface Surface
RealPoint centerSurfel(KSpace const &K, SH3::SCell const &s)
PlaneProbingParallelepipedEstimator< DigitalPlane, ProbingMode::R1 > Estimator
KhalimskySpaceND< 3, Integer > KSpace
DGtal is the top-level namespace which contains all DGtal functions and types.
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.