Skip to content

OpenSCAD library to build more complex parts based on regular polyhedra. Includes geometry for Platonic solids and Archimedean solids.

Notifications You must be signed in to change notification settings

benjamin-edward-morgan/openscad-polyhedra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openscad-polyhedra

Polyhedra

Rotating gifs of each polyhedron

The arrays and utility functions included here can be used to place modules coincident with the vertices, edges and faces of the Platonic and Archimedean solids.

All polyhedra are centered at the origin and have an edge length of 1.

Included polyhedra:

  • tetrahedron
  • octahedron
  • hexahedron
  • icosahedron
  • dodecahedron
  • cubeoctahedron
  • truncated_tetrahedron
  • snub_cube
  • rhombicuboctahedron
  • truncated_hexahedron
  • truncated_octahedron
  • icosidodecahedron
  • snub_dodecahedron
  • rhombicosidodecahedron
  • truncated_cuboctahedron
  • truncated_icosahedron
  • truncated_dodecahedron
  • truncated_icosidodecahedron

Each shape includes an array of vertices, edges, adjacent_vertices, and faces.

Archimedean solids also include separate arrays of faces that are of the same polygon shape.

Example:

  • snub_dodecahedron_vertices - an array of 3-vectors
  • snub_dodecahedron_edges - an array of 2-tuples containing indexes into the vertices array, one tuple for each edge.
  • snub_dodecahedron_adjacent_vertices - an array of arrays, each containing indexes into the vertex array. For example, snub_dodecahedron_adjacent_vertices[3] is an array containing the indexes of vertices that are connected to snub_dodecahedron_vertices[3] by an edge
  • snub_dodecahedron_triangle_faces and snub_dodecahedron_pentagon_faces contain arrays with indices in the vertex array for each triangular and pentagonal face, respectively
  • snub_dodecahedron_faces contains all faces

Usage:

// add polyhedra.scad to your project and include it
include<polyhedra.scad>;

// to arrange modules at vertices
for(i=[0:len(snub_dodecahedron_vertices)-1])
    orient_vertex(
        snub_dodecahedron_vertices[i],
        snub_dodecahedron_vertices[snub_dodecahedron_adjacent_vertices[i][0]]
    )
    // your vertical module centered at the origin here. For example:
    sphere(r=0.2,$fn=64);


// to arrange modules along the edges
for(i=[0:len(snub_dodecahedron_edges)-1])
    orient_edge(
        snub_dodecahedron_vertices[snub_dodecahedron_edges[i][0]],
        snub_dodecahedron_vertices[snub_dodecahedron_edges[i][1]]
    )
    // your vertical module centered at the origin here. For example:
    cylinder(height=1,r=0.1,center=true,$fn=32);


// to arrange modules on the faces
for(i=[0:len(snub_dodecahedron_faces)-1])
    orient_face(
        map_verts(snub_dodecahedron_vertices, snub_dodecahedron_faces[i])
    )
    // your module on the x-y plane here, centered at the origin. For example:
    rotate(180/len(snub_dodecahedron_faces[i])-90)
    cylinder(r=0.3,h=0.02,$fn=len(snub_dodecahedron_faces[i]));


// to construct a solid
polyhedron(
    points = snub_dodecahedron_vertices,
    faces = snub_dodecahedron_faces
);

CC0
To the extent possible under law, Benjamin E Morgan has waived all copyright and related or neighboring rights to openscad-polyhedra. This work is published from: United States.

About

OpenSCAD library to build more complex parts based on regular polyhedra. Includes geometry for Platonic solids and Archimedean solids.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published