71 hilbert(tetra, 0,0,m_xsize,0,0,m_ysize,m_n);
76 tetra.move(btVector3(25.0, 0, 0));
78 const double density = 0.9;
79 const double radius = 0.5 / m_n;
83 spec.addBuilder(
"rod",
new tgRodInfo(rodConfig));
89 structureInfo.buildInto(*
this, world);
93 void hilbert(
tgStructure& tetra,
double x,
double y,
double xi,
double xj,
double yi,
double yj,
int n)
95 std::cout << x <<
" " << y <<
" " << xi <<
" " << xj <<
" " << yi <<
" " << yj << std::endl;
97 tgNode node(point(x + (xi + yi)/2, y + (xj + yj)/2));
100 hilbert(tetra, x, y, yi/2, yj/2, xi/2, xj/2, n-1);
101 hilbert(tetra, x+xi/2, y+xj/2 , xi/2, xj/2, yi/2, yj/2, n-1);
102 hilbert(tetra, x+xi/2+yi/2, y+xj/2+yj/2, xi/2, xj/2, yi/2, yj/2, n-1);
103 hilbert(tetra, x+xi/2+yi, y+xj/2+yj, -yi/2,-yj/2, -xi/2, -xj/2, n-1);
110 std::cout <<
"Nodes size is " << n << std::endl;
111 for(
int i = 1; i < n; i++) {
116 btVector3 point(
double x,
double y)
118 return btVector3(x, y, 0);
121 void makePair(btVector3 p1, btVector3 p2)
123 m_pairs.addPair(
tgPair(p1, p2,
"rod"));
Definition of class tgRodInfo.
virtual void setup(tgWorld &world)
Definition of tgSubject class.
const tgNodes & getNodes() const
Definition of class tgPairs.
Contains the definition of class tgModel.
void addPair(int fromNodeIdx, int toNodeIdx, std::string tags="")
Definition of class tgNodes.
Definition of class tgStructure.
Definition of class tgStructureInfo.
Contains the definition of class tgUtil and overloaded operator<<() free functions.
Contains the definition of class tgRod.
Definition of class tgBuildSpec.
void addNode(double x, double y, double z, std::string tags="")