Antiprism 0.23
Public Member Functions

pyramid Class Reference

Make a pyramid. More...

#include <polygons.h>

Inheritance diagram for pyramid:
Inheritance graph
[legend]
Collaboration diagram for pyramid:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 pyramid (int N, int D=1)
 Constructor.
 pyramid (polygon &pgon)
 Constructor.
bool set_twist_angle (double ang=NAN, char *=0)
 Set the twist angle of the polygon based polyhedron.
bool set_edge2 (double e2, char *msg=0)
 Set the edge length of the non-polygon edges.
void make_poly_part (geom_if &geom)
 Make a part of (or a complete) polygon-based polyhedron.

Detailed Description

Make a pyramid.


Constructor & Destructor Documentation

pyramid::pyramid ( int  N,
int  D = 1 
) [inline]

Constructor.

Base polygon in form {N/D} (with N/D not necessarily in lowest form.)

Parameters:
Nnumber of sides to the (compound) polygon.
Dthe number of vertices stepped by an edge (default 1)
pyramid::pyramid ( polygon pgon) [inline]

Constructor.

Parameters:
pgonpolygon to base the polyhedron on.

Member Function Documentation

void pyramid::make_poly_part ( geom_if geom) [virtual]

Make a part of (or a complete) polygon-based polyhedron.

Make a non-compound polyhedron, using num_sides and step for {n/d}. If parts is greater than 1 then polygon::make_poly will make a compound by repeating this polyhedron parts times.

Parameters:
geoma geometry to return the polyhedron.

Reimplemented from polygon.

Reimplemented in dipyramid.

bool pyramid::set_edge2 ( double  len2,
char *  msg = 0 
) [virtual]

Set the edge length of the non-polygon edges.

These are the vertical edges of a prism, the slanting edges of a pyramid, etc.

Parameters:
len2the edge length of the non-polygon edges.
msga string with length at least MSG_SZ to hold the error message if the edge length was not valid.
Returns:
true if the edge length was valid, otherwise false and msg contains the error messge.

Reimplemented from polygon.

bool pyramid::set_twist_angle ( double  ang = NAN,
char *  msg = 0 
) [inline, virtual]

Set the twist angle of the polygon based polyhedron.

Some polyhedra can be transformed by a twist, controlled by this angle. NAN indicates that no twist should be considered.

Parameters:
angthe angle of twist (default: NAN for no twist).
msga string with length at least MSG_SZ to hold the error message if the edge length was not valid.
Returns:
true if the polyhedron could be twisted, otherwise false and msg contains the error messge.

Reimplemented from polygon.


The documentation for this class was generated from the following files: