ivutils
|
‘Polyhedron_3’ - creates a polygon bounded by planes.
Important members and methods of the class:
this->init(Plane3Vector planes)
- creates a polygon bounded by planes.Example
Plane_3 * box_planes = new Plane_3[6]; // create a set of 6 planes box_planes[0].init ( Vector_3(0,0,1), Vector_3(0,0,-6) ); // bottom box_planes[1].init ( Vector_3(0,0,-1), Vector_3(0,0,-2) ); // top box_planes[2].init ( Vector_3(0,1,0), Vector_3(0,-5,0) ); // side 1 box_planes[3].init ( Vector_3(0,-1.0), Vector_3(0,5.0) ); // side 2 box_planes[4].init ( Vector_3(1,0,0), Vector_3(-5,0,0) ); // side 3 box_planes[5].init ( Vector_3(-1,0,0), Vector_3(5,0,0) ); // side 4 Polyhedron_3 box_poly(box_planes, box_planes+6);// create a body based on planes task.addObject(emMedium(1.45), &box_poly, 0); // place this body on the grid Vector_3 origin (0,0,0), n (0,0,1), l (0,0,2), x (1,0,0), y (0,1,0); double r = 2, h = 3; Cylinder<Circle> cyl(origin, n, x, y, &cir);