#include <polymesh.hpp>
Inherits renderstack::shapes::polymesh.
Public Member Functions | |
icosahedron (double r=1.0) |
Definition at line 113 of file polymesh.hpp.
renderstack::shapes::icosahedron::icosahedron | ( | double | r = 1.0 |
) |
Definition at line 1102 of file polymesh.cpp.
01103 { 01104 double a = 2.0 / (1.0 + sq5); 01105 double b = sqrt((3.0 + sq5) / (1.0 + sq5)); 01106 a /= b; 01107 01108 push_point( 0, r * a, r / b ); 01109 push_point( 0, r * a, -r / b ); 01110 push_point( 0, -r * a, r / b ); 01111 push_point( 0, -r * a, -r / b ); 01112 push_point( r * a, r / b, 0 ); 01113 push_point( r * a, -r / b, 0 ); 01114 push_point( -r * a, r / b, 0 ); 01115 push_point( -r * a, -r / b, 0 ); 01116 push_point( r / b, 0, r * a ); 01117 push_point( r / b, 0, -r * a ); 01118 push_point( -r / b, 0, r * a ); 01119 push_point( -r / b, 0, -r * a ); 01120 01121 make_polygon( 1, 4, 6); 01122 make_polygon( 0, 6, 4); 01123 make_polygon( 0, 2, 10); 01124 make_polygon( 0, 8, 2); 01125 make_polygon( 1, 3, 9); 01126 make_polygon( 1, 11, 3); 01127 make_polygon( 2, 5, 7); 01128 make_polygon( 3, 7, 5); 01129 make_polygon( 6, 10, 11); 01130 make_polygon( 7, 11, 10); 01131 make_polygon( 4, 9, 8); 01132 make_polygon( 5, 8, 9); 01133 make_polygon( 0, 10, 6); 01134 make_polygon( 0, 4, 8); 01135 make_polygon( 1, 6, 11); 01136 make_polygon( 1, 9, 4); 01137 make_polygon( 3, 11, 7); 01138 make_polygon( 3, 5, 9); 01139 make_polygon( 2, 7, 10); 01140 make_polygon( 2, 8, 5); 01141 01142 build_mesh_from_geometry(); 01143 }