vtdata library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DymaxIcosa Class Reference

Public Member Functions

void InitIcosa ()
 
void FindFaceUV (const DPoint2 &p, int &face, int &subface, DPoint3 &uvw)
 
void FindFace (const DPoint3 &p, int &face, int &subface)
 
void FindUV (const DPoint3 &p_in, int face, DPoint3 &uvw)
 
void GeoToFacePoint (const DPoint2 &p, int &face, int &subface, DPoint3 &p_out)
 
void FaceUVToGeo (int face, DPoint3 &uvw, double &lon, double &lat)
 
bool GeoToDymax (const DPoint2 &geo, DPoint2 &dymax)
 
double DihedralAngle ()
 
void GetDymaxEdges (DLine2Array &polys)
 

Protected Member Functions

void AddFlatTri (DLine2Array &polys, int a, int b, int c, int d=-1)
 

Protected Attributes

DPoint3 m_verts [12]
 
icoface m_face [20]
 
DPoint2 m_flatverts [27]
 
double m_edge_length
 

Detailed Description

This class contains a full description of an icosahedron in the Dymaxion orientation. It provides the ability to convert points to and from a simple Gnomonic projection based on the icosahedron. No attempt is made to implement the precise "Dymaxion Projection" which would require using arc lengths.

The basis for this decision is Robert Gray's notes which state: "Fuller's world map image is indistinguishable to the world map image created by the Gnomonic projection method indicates that it is the use of the icosahedron, and not the projection method, that seems to be the critical point."

Member Function Documentation

void DymaxIcosa::FaceUVToGeo ( int  face,
DPoint3 uvw,
double &  lon,
double &  lat 
)

Given information about a point in the referenced frame of an icosahedral face (tri, uvw), find the corresponding surface location in geographic coordinate (lon, lat)

void DymaxIcosa::FindFace ( const DPoint3 p,
int &  face,
int &  subface 
)

Determine which part of which icosahedral face a point is on.

Parameters
pA 3D point.
faceWill receive the face number, from 0 to 19.
subfaceWill receive the subface number, from 0 to 5.
void DymaxIcosa::FindFaceUV ( const DPoint2 p,
int &  face,
int &  subface,
DPoint3 uvw 
)

Given a geographic coordinate (lon, lat), find the corresponding face, subface, and UVW coordinates on surface of the icosahedron.

void DymaxIcosa::FindUV ( const DPoint3 p_in,
int  face,
DPoint3 uvw 
)

Given a point and a face number, determine the u,v,w coordinates of the point in the reference frame of the face triangle.

bool DymaxIcosa::GeoToDymax ( const DPoint2 geo,
DPoint2 dymax 
)

Given a geographic coordinate (lon, lat), find the corresponding dymaxion map coordinate, on the classic flattened dymaxion map. The output is unit-edge triangles, which means the whole output extents are x [0, 5.5] and y [0, 2.6].

void DymaxIcosa::GeoToFacePoint ( const DPoint2 p,
int &  face,
int &  subface,
DPoint3 p_out 
)

Given a geographic coordinate (lon, lat), find the corresponding point on the surface of the icosahedron.

void DymaxIcosa::InitIcosa ( )

Initializes the object with the values of the icosahedron and precomputes information for the faces.