23 auto sv = this->getSparseVolume();
25 if (sv->stateSDFTopology()->isEmpty())
27 printf(
"SparseMarchingCubes: The import is empty! \n");
31 auto center = this->varTranslation()->getData();
32 auto eulerAngles = this->varRotation()->getData();
36 auto octree = sv->stateSDFTopology()->getDataPtr();
40 octree->getCellVertices(ceilVertices);
45 octree->getSignDistance(ceilVertices, sdfs, normals);
58 uint totalVNum = reduce.
accumulate(voxelVertNum.begin(), voxelVertNum.size());
61 scan.
exclusive(voxelVertNum.begin(), voxelVertNum.size());
67 this->stateField()->resize(totalVNum);
70 this->stateField()->getData(),
78 if (this->stateTriangleSet()->isEmpty()) {
82 auto triSet = this->stateTriangleSet()->getDataPtr();
83 triSet->setPoints(triangleVertices);
84 triSet->setTriangles(triangles);
86 this->stateVertices()->assign(triangleVertices);
92 triangleVertices.clear();
static void constructTrianglesForOctreeClipper(DArray< Real > &vertSDFs, DArray< Coord > &triangleVertices, DArray< TopologyModule::Triangle > &triangles, DArray< uint > &num, DArray< Coord > &cellVertices, DArray< Real > &sdfs, TPlane3D< Real > plane)
DYN_FUNC Vector< Real, 3 > rotate(const Vector< Real, 3 > &v) const
Rotate a vector by the quaternion, guarantee the quaternion is normalized before rotating the vector.