18 auto shape = this->getShape();
20 if (shape ==
nullptr)
return;
22 auto shapeType = shape->getShapeType();
27 if (model ==
nullptr)
return;
29 auto box = model->outCube()->getValue();
34 Coord ext = box.extent;
35 Coord center = box.center;
37 Real s = std::max(
Real(0.001), this->varSamplingDistance()->getData());
43 std::vector<Coord> points;
44 for (
int i = -nx; i <= nx; i++)
46 for (
int j = -ny; j <= ny; j++)
48 for (
int k = -nz; k <= nz; k++)
50 Coord p = center + (i * s) * u + (j * s) * v + (k * s) * w;
56 auto ptSet = this->statePointSet()->getDataPtr();
58 ptSet->setPoints(points);
66 if (model ==
nullptr)
return;
68 auto sphere = model->outSphere()->getValue();
69 Real r = sphere.radius;
70 Coord center = sphere.center;
71 Real distance = this->varSamplingDistance()->getValue();
73 std::vector<Coord> points;
74 for (
Real x = center[0] - r; x < center[0] + r; x += distance) {
75 for (
Real y = center[1] - r; y < center[1] + r; y += distance) {
76 for (
Real z = center[2] - r; z < center[2] + r; z += distance)
78 Real h = (
Coord(x, y, z) - center).norm();
81 points.push_back(
Coord(x, y, z));
87 auto ptSet = this->statePointSet()->getDataPtr();
88 ptSet->setPoints(points);