#include <polymesh.hpp>
Inherits renderstack::shapes::polymesh.
Public Member Functions | |
truncated_cube (double r=1.0) |
Definition at line 132 of file polymesh.hpp.
renderstack::shapes::truncated_cube::truncated_cube | ( | double | r = 1.0 |
) |
Definition at line 1181 of file polymesh.cpp.
01182 { 01183 double a = (1.0 + sq2) / (2.0 * sqrt(5.0 / 2.0 + sq2)); 01184 double b = 1.0 / (2.0 * sqrt(5.0 / 2.0 + sq2)); 01185 01186 push_point( r * b, r * a, r * a); 01187 push_point( r * a, r * b, r * a); 01188 push_point( r * a, -r * b, r * a); 01189 push_point( r * b, -r * a, r * a); 01190 push_point(-r * b, -r * a, r * a); 01191 push_point(-r * a, -r * b, r * a); 01192 push_point(-r * a, r * b, r * a); 01193 push_point(-r * b, r * a, r * a); 01194 push_point( r * a, r * a, r * b); 01195 push_point( r * a, -r * a, r * b); 01196 push_point(-r * a, -r * a, r * b); 01197 push_point(-r * a, r * a, r * b); 01198 push_point( r * a, r * a, -r * b); 01199 push_point( r * a, -r * a, -r * b); 01200 push_point(-r * a, -r * a, -r * b); 01201 push_point(-r * a, r * a, -r * b); 01202 push_point( r * b, r * a, -r * a); 01203 push_point( r * a, r * b, -r * a); 01204 push_point( r * a, -r * b, -r * a); 01205 push_point( r * b, -r * a, -r * a); 01206 push_point(-r * b, -r * a, -r * a); 01207 push_point(-r * a, -r * b, -r * a); 01208 push_point(-r * a, r * b, -r * a); 01209 push_point(-r * b, r * a, -r * a); 01210 01211 make_polygon( 0, 1, 8 ); 01212 make_polygon( 2, 3, 9 ); 01213 make_polygon( 4, 5, 10 ); 01214 make_polygon( 6, 7, 11 ); 01215 make_polygon( 16, 17, 12 ); 01216 make_polygon( 18, 19, 13 ); 01217 make_polygon( 20, 21, 14 ); 01218 make_polygon( 22, 23, 15 ); 01219 01220 make_polygon( 0, 1, 2, 3, 4, 5, 6, 7 ); 01221 make_polygon( 1, 2, 9, 13, 18, 17, 12, 8 ); 01222 make_polygon( 3, 4, 10, 14, 20, 19, 13, 9 ); 01223 make_polygon( 5, 6, 11, 15, 22, 21, 14, 10 ); 01224 make_polygon( 7, 0, 8, 12, 16, 23, 15, 11 ); 01225 make_polygon( 16, 17, 18, 19, 20, 21, 22, 23 ); 01226 01227 build_mesh_from_geometry(); 01228 }