3 #include <sofa/defaulttype/VecTypes.h>
4 #include <SofaCaribou/Topology/IsoSurface.h>
6 namespace SofaCaribou::topology {
9 template <
class T =
void* >
10 using Data = sofa::core::objectmodel::Data<T>;
17 : p_radius(initData(&p_radius, 1.,
"radius",
"Radius of the cylinder."))
18 , p_length(initData(&p_length, 5.,
"length",
"Length of the cylinder."))
19 , p_center(initData(&p_center, Coord(0, 0, 0),
"center",
"Coordinates at the center of the cylinder."))
22 inline Real iso_value(
const Eigen::Matrix<Real, 3, 1> & x)
const final {
23 const auto & r = p_radius.getValue();
24 Eigen::Map<const Eigen::Matrix<Real, 3, 1>> c (p_center.getValue().data());
26 const auto d = x.block<2,1>(0,0) - c.block<2,1>(0,0);
27 return d.squaredNorm() - r*r;