geodesic geometry library in C
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
OpenGL
bin
geodesic.c
geodesic.h
makefile
net.c
net.h
platonic.c
platonic.h
readme.md
tween.c

readme.md

geodesic geometry

R. Buckminster Fuller method 1 spheres and domes from icosahedra or octahedra

try it out

make then make run

picture

files

  • geodesic.h + .c data
  • OpenGL/mesh.h + .c rendering, and more mesh data for rendering

geodesic.h / .c

types

 // sphere
geodesicSphere icosahedronSphere(int v);
geodesicSphere octahedronSphere(int v);
geodesicSphere tetrahedronSphere(int v);
 // dome
geodesicDome icosahedronDome(int v, float crop);
geodesicDome octahedronDome(int v, float crop);
geodesicDome tetrahedronDome(int v, float crop);

usage

geodesicSphere icosphere = icosahedron(3)  // 3v icosahedron
geodesicDome dome = icosahedronDome(3, 5/9);  // 3v 5/9 dome

now you have access to points, lines, face, as well as normals data. For domes, there's also more complicated data involved in slicing the sphere into a dome including number of slice meridians, triangle count on each row, relationship of face to row number.

mesh.h / .c

initialize

geodesicMeshTriangles mesh = makeMeshTriangles(&icosphere, .75){
geodesicMeshNormals normals = makeMeshNormals(&icosphere);

draw

// draw geodesic objects
drawGeodesicTriangles(&icosphere);
drawDomeMeshTriangles(&dome, &domeTriangleMesh);

// draw mesh objects
drawGeodesicExtrudedTriangles(&mesh);
drawGeodesicVertexNormalLines(&normals);
drawGeodesicFaceNormalLines(&normals);

memory

delete geometry when you are done

deleteGeodesicSphere(&geodesic);
deleteGeodesicDome(&dome);

deleteMeshNormals(&normals);
deleteMeshTriangles(&mesh);

picture