PeriDyno 1.0.0
Loading...
Searching...
No Matches
PointsBehindMesh.h
Go to the documentation of this file.
1
16
17#pragma once
18#include "Samplers/Sampler.h"
19#include "Topology/PolygonSet.h"
20#include "Topology/TriangleSet.h"
21#include "NormalVisualization.h"
22#include "Collision/NeighborPointQuery.h"
23#include "Algorithm/Scan.h"
24
25namespace dyno
26{
27
28 /*
29 * @brief£şThe node is to generate Points benhind triangle meshes.
30 *
31 * @Implementation:
32 * #Step1: Square plane regions are generating for each triangle mesh;
33 * #Step2: Caculate the basic vectors for every square plane region, and generate the candinite points in the square plane region;
34 * #Step3: Determine whether the candidate points are inside the triangular facet, and delete the points outside the relative meshes;
35 * #Step4: Use remaining candidate points as seeds, and multi-layer Points are generated by expanding along the direction of mesh normals;
36 * #Step5: Remove the points that are too close;
37 * #Step6: Finished.
38 */
39
40
41 template<typename TDataType>
42 class PointsBehindMesh : public Sampler<TDataType>
43 {
45
46 public:
47 typedef typename TDataType::Real Real;
48 typedef typename TDataType::Coord Coord;
49 typedef typename TDataType::Matrix Matrix;
51
53 ~PointsBehindMesh() override {};
54
55 DEF_VAR(Real, Thickness, Real(0.2), "");
56
57 DEF_VAR(Real, SamplingDistance, Real(0.05), "");
58
59 DEF_VAR(bool, GeneratingDirection, true, "");
60
62
63 DEF_ARRAY_STATE(Coord, Position, DeviceType::GPU, "");
64
66
67 DEF_ARRAY_STATE(Coord, PointNormal, DeviceType::GPU, "Normal Vector of the point set");
68
69 DEF_VAR_OUT(bool, PointGrowthDirection, "");
70
71 DEF_ARRAY_STATE(int, PointBelongTriangleIndex, DeviceType::GPU, "");
72
73 DEF_VAR_OUT(Real, SamplingDistance, "");
74
75 protected:
76 void resetStates() override;
77
78 private:
79
80
82
84
86
88
90
92
94
96
98
100
102
104
105 std::shared_ptr<NeighborPointQuery<TDataType>> m_NeighborPointQuery;
106
108 };
109
111}
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
DEF_VAR(Real, Thickness, Real(0.2), "")
DArray< int > mPointOfTriangleId
DEF_VAR_OUT(bool, PointGrowthDirection, "")
DArray< Coord > msquare_1
DEF_VAR_OUT(Real, SamplingDistance, "")
DArray< int > mThickPointSize
DArray< Coord > mTriangleNormal
DArray< Coord > mBasicVector_y
TDataType::Matrix Matrix
DArray< Coord > msquare_2
DArray< Coord > mThinPoints
DArray< Coord > msquare_3
DArray< Coord > mThickPoints
DArray< Triangle > mTriangleTempt
DArray< Coord > mBasicVector_z
DEF_VAR(bool, GeneratingDirection, true, "")
TopologyModule::Triangle Triangle
std::shared_ptr< NeighborPointQuery< TDataType > > m_NeighborPointQuery
DEF_ARRAY_STATE(Coord, Position, DeviceType::GPU, "")
DArray< int > mSeedOfTriangleId
DArray< Coord > mBasicVector_x
DArray< Coord > mVerticesTempt
void resetStates() override
DEF_ARRAY_STATE(Coord, PointNormal, DeviceType::GPU, "Normal Vector of the point set")
DEF_VAR(Real, SamplingDistance, Real(0.05), "")
DEF_INSTANCE_STATE(TriangleSet< TDataType >, Plane, "")
DArray< bool > mRemovingFlag
DArray< Coord > msquare_4
DEF_INSTANCE_IN(TriangleSet< TDataType >, TriangleSet, "")
DECLARE_TCLASS(PointsBehindMesh, TDataType)
DEF_ARRAY_STATE(int, PointBelongTriangleIndex, DeviceType::GPU, "")
Vector< PointType, 3 > Triangle
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89