Node: Tetrahedron Net, Previous: Tetrahedron Constructors and Setting Functions, Up: Tetrahedron



Net

vector<Reg_Polygon*> get_net (const real triangle_diameter) Static function
Returns the net of the Tetrahedron, i.e., the two-dimensional pattern of triangles that can be folded into a model of a tetrahedron.1 The net lies in the x-z plane. The triangles have enclosing circles of diameter triangle_diameter. The center of the middle triangle is at the origin.
          vector<Reg_Polygon*> vrp = Tetrahedron::get_net(2);
          for (vector<Reg_Polygon*>::iterator iter = vrp.begin();
               iter != vrp.end();
               ++iter)
            {
              (**iter).draw();
            }
          


[Figure 189. Not displayed.]

Fig. 189.

This function is used in the non-default constructor. See Polyhedron Reference; Regular Platonic Polyhedra; Tetrahedron; Constructors and Setting Functions. The constructor starts with the net and rotates three of the triangles about the adjacent vertices of the middle triangle. Currently, all of the Polyhedron constructors work this way. However, this is not ideal, because rotation uses the sine and cosine functions, which cause inaccuracies to creep in. I think there must be a better way of constructing Polyhedra, but I haven't found one yet.

The Polyhedron constructors are also especially sensitive to changes made to Transform::align_with_axis(). I have already had to rewrite them twice, and since Transform::align_with_axis() may need to be changed or rewritten again, it's possible that the Polyhedron constructors will have to be, too. It has also occurred in the past, that the Polyhedra were constructed correctly on one platform, using a particular compiler, but not on another platform, using a different compiler.

void draw_net (const real triangle_diameter, [bool make_tabs = true]) Static function
Draws the net for a Tetrahedron in the x-y plane. The triangles have enclosing circles of diameter triangle_diameter. The origin is used as the center of the middle triangle. The centers of the triangles are numbered. If the argument make_tabs is used, tabs for gluing and/or sewing a cardboard model of the Tetrahedron together will be drawn, too. The dots on the tabs mark where to stick the needle through, when sewing the model together (I've had good results with sewing).
          Tetrahedron::draw_net(3, true);
          


[Figure 190. Not displayed.]

Fig. 190.

The net is drawn in the x-y plane, because it currently doesn't work to draw it in the x-z plane. I haven't gotten around to fixing this problem yet.


Footnotes

  1. Albrecht Dürer invented this method of constructing polyhedra.