src/CXXTests/test_r3d_utils.cc
//------------------------------------------------------------------------------
// Return an icosahedron. (polyhedron)
//------------------------------------------------------------------------------
Return an icosahedron. (polyhedron)
Return an icosahedron . ( polyhedron )
Dim<3>::FacetedVolume construct_icosahedron_polyhedron() {
  typedef Dim<3>::Vector Vector;
  const unsigned nverts = 12;
  const unsigned nfaces = 20;
  vector<vector<unsigned> > facets = {
    {0, 11, 5},
    {0, 5, 1},
    {0, 1, 7},
    {0, 7, 10},
    {0, 10, 11},
    {1, 5, 9},
    {5, 11, 4},
    {11, 10, 2},
    {10, 7, 6},
    {7, 1, 8},
    {3, 9, 4},
    {3, 4, 2},
    {3, 2, 6},
    {3, 6, 8},
    {3, 8, 9},
    {4, 9, 5},
    {2, 4, 11},
    {6, 2, 10},
    {8, 6, 7},
    {9, 8, 1},
  };
  const double t = (1.0 + sqrt(5.0)) / 2.0;
  vector<Vector> verts = {           
    Vector(-1,  t,   0),
    Vector( 1,  t,   0),
    Vector(-1, -t,   0),
    Vector( 1, -t,   0),
    Vector( 0, -1,   t),
    Vector( 0,  1,   t),
    Vector( 0, -1,  -t),
    Vector( 0,  1,  -t),
    Vector( t,  0,  -1),
    Vector( t,  0,   1),
    Vector(-t,  0,  -1),
    Vector(-t,  0,   1)
  };
  return Dim<3>::FacetedVolume(verts, facets);
}
Dim < 3 > :: FacetedVolume construct_icosahedron_polyhedron ( ) { typedef Dim < 3 > :: Vector Vector ; const unsigned nverts = 12 ; const unsigned nfaces = 20 ; vector < vector < unsigned > > facets = { { 0 , 11 , 5 } , { 0 , 5 , 1 } , { 0 , 1 , 7 } , { 0 , 7 , 10 } , { 0 , 10 , 11 } , { 1 , 5 , 9 } , { 5 , 11 , 4 } , { 11 , 10 , 2 } , { 10 , 7 , 6 } , { 7 , 1 , 8 } , { 3 , 9 , 4 } , { 3 , 4 , 2 } , { 3 , 2 , 6 } , { 3 , 6 , 8 } , { 3 , 8 , 9 } , { 4 , 9 , 5 } , { 2 , 4 , 11 } , { 6 , 2 , 10 } , { 8 , 6 , 7 } , { 9 , 8 , 1 } , } ; const double t = ( 1.0 + sqrt ( 5.0 ) ) / 2.0 ; vector < Vector > verts = { Vector ( -1 , t , 0 ) , Vector ( 1 , t , 0 ) , Vector ( -1 , - t , 0 ) , Vector ( 1 , - t , 0 ) , Vector ( 0 , -1 , t ) , Vector ( 0 , 1 , t ) , Vector ( 0 , -1 , - t ) , Vector ( 0 , 1 , - t ) , Vector ( t , 0 , -1 ) , Vector ( t , 0 , 1 ) , Vector ( - t , 0 , -1 ) , Vector ( - t , 0 , 1 ) } ; return Dim < 3 > :: FacetedVolume ( verts , facets ) ; }
Return an icosahedron.
Return an icosahedron .
// 5 faces around point 0 // 5 adjacent faces // 5 faces around point 3 // 5 adjacent faces // Array of vertex coordinates.