PeriDyno 1.0.0
Loading...
Searching...
No Matches
PoissonPlane.h
Go to the documentation of this file.
1
16
17#pragma once
18#include "Node.h"
19
20#include "Topology/PointSet.h"
22
23
24namespace dyno
25{
26 template<typename TDataType>
28 {
30
31 public:
32 typedef typename TDataType::Real Real;
33 typedef typename TDataType::Coord Coord;
35
36 void ConstructGrid();
37
38 bool collisionJudge(Vec2f point);
39
40 DEF_VAR(Real, SamplingDistance, 0.015, "Sampling distance");
41
42 DEF_VAR(Vec2f, Upper, Vec2f(0.2f, 0.2f), "");
43
44 DEF_VAR(Vec2f, Lower, Vec2f(0.1f, 0.1f), "");
45
46 void compute() override;
47
48 std::vector<Vec2f> getPoints()
49 {
50 return points;
51 }
52
53
54 protected:
55
56 Vec2u searchGrid(Vec2f point);
57
58 int indexTransform(uint i, uint j);
59
61
62 std::vector<int> m_grid;
63
65
66 int gnum; //total number of grids
67
68 int nx, ny, nz; //grid number
69
70 float dx; //resolution of grid
71
72 std::vector<Vec2f> points;
73
74 unsigned int desired_points = 150; //desired points number
75
77 };
78
79
80
81
83
84}
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
DEF_VAR(Real, SamplingDistance, 0.015, "Sampling distance")
std::vector< int > m_grid
std::vector< Vec2f > getPoints()
bool collisionJudge(Vec2f point)
Vec2u searchGrid(Vec2f point)
DEF_VAR(Vec2f, Lower, Vec2f(0.1f, 0.1f), "")
TDataType::Real Real
void compute() override
DEF_VAR(Vec2f, Upper, Vec2f(0.2f, 0.2f), "")
int indexTransform(uint i, uint j)
unsigned int desired_points
DECLARE_TCLASS(PoissonPlane, TDataType)
TDataType::Coord Coord
std::vector< Vec2f > points
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Vector< float, 2 > Vec2f
Definition Vector2D.h:81
Vector< uint32_t, 2 > Vec2u
Definition Vector2D.h:83
unsigned int uint
Definition VkProgram.h:14