PeriDyno
1.0.0
Loading...
Searching...
No Matches
D:
Peridyno
peridyno
src
Dynamics
Cuda
Volume
Module
VolumeToGridCell.cpp
Go to the documentation of this file.
1
#include "
VolumeToGridCell.h
"
2
3
#include "
MarchingCubesHelper.h
"
4
5
namespace
dyno
6
{
7
template
<
typename
TDataType>
8
VolumeToGridCell<TDataType>::VolumeToGridCell
()
9
:
TopologyMapping
()
10
{
11
12
}
13
14
template
<
typename
TDataType>
15
VolumeToGridCell<TDataType>::~VolumeToGridCell
()
16
{
17
18
}
19
20
template
<
typename
TDataType>
21
bool
VolumeToGridCell<TDataType>::apply
()
22
{
23
Real
iso = this->varIsoValue()->getValue();
24
25
auto
vol = this->inVolume()->getDataPtr();
26
27
DArray<Coord>
ceilVertices;
28
29
vol->getCellVertices0(ceilVertices);
30
31
DArray<Real>
sdfs;
32
DArray<Coord>
normals;
33
34
vol->getSignDistanceMLS(ceilVertices, sdfs, normals,
false
);
35
36
// //DArray3D<Real> distances(nx + 1, ny + 1, nz + 1);
37
// DArray<uint> voxelVertNum(ceilVertices.size() / 8);
38
//
39
// MarchingCubesHelper<TDataType>::countVerticeNumberForOctree(
40
// voxelVertNum,
41
// ceilVertices,
42
// sdfs,
43
// iso);
44
//
45
// Reduction<uint> reduce;
46
// uint totalVNum = reduce.accumulate(voxelVertNum.begin(), voxelVertNum.size());
47
//
48
// Scan<uint> scan;
49
// scan.exclusive(voxelVertNum.begin(), voxelVertNum.size());
50
//
51
// DArray<Coord> triangleVertices(totalVNum);
52
//
53
// DArray<TopologyModule::Triangle> triangles(totalVNum / 3);
54
//
55
// MarchingCubesHelper<TDataType>::constructTrianglesForOctree(
56
// triangleVertices,
57
// triangles,
58
// voxelVertNum,
59
// ceilVertices,
60
// sdfs,
61
// iso);
62
//
63
// if (this->outTriangleSet()->isEmpty()) {
64
// this->outTriangleSet()->allocate();
65
// }
66
//
67
// auto triSet = this->outTriangleSet()->getDataPtr();
68
// triSet->setPoints(triangleVertices);
69
// triSet->setTriangles(triangles);
70
// triSet->update();
71
//
72
// sdfs.clear();
73
// normals.clear();
74
// voxelVertNum.clear();
75
// ceilVertices.clear();
76
// triangleVertices.clear();
77
// triangles.clear();
78
79
return
true
;
80
}
81
82
DEFINE_CLASS
(
VolumeToGridCell
);
83
}
MarchingCubesHelper.h
DEFINE_CLASS
#define DEFINE_CLASS(name)
Definition
Object.h:140
VolumeToGridCell.h
dyno::TopologyMapping::TopologyMapping
TopologyMapping()
Definition
TopologyMapping.cpp:6
dyno::VolumeToGridCell
Definition
VolumeToGridCell.h:12
dyno::VolumeToGridCell::Real
TDataType::Real Real
Definition
VolumeToGridCell.h:15
dyno::VolumeToGridCell::VolumeToGridCell
VolumeToGridCell()
Definition
VolumeToGridCell.cpp:8
dyno::VolumeToGridCell::apply
bool apply() override
Definition
VolumeToGridCell.cpp:21
dyno::VolumeToGridCell::~VolumeToGridCell
~VolumeToGridCell() override
Definition
VolumeToGridCell.cpp:15
dyno
This is an implementation of AdditiveCCD based on peridyno.
Definition
Array.h:25
dyno::DArray
Array< T, DeviceType::GPU > DArray
Definition
Array.inl:89
Generated by
1.13.2