Testing Waters
  • Scrapbook
  • Projects
    • Bamiyan Cultural Center
    • Bauhaus Museum
    • Better Hebbal
    • Bicycle Station
    • Cross Laminated Timber
    • Facade
    • Flowing Fabrication
    • Form from Images
    • Guggenheim Helsinki
    • National War Museum
    • National War Memorial
    • Indflorescence
    • Rectangular Compartments
    • Retail Space Layout
    • Noise Barrier : Swedevia Airport
    • Walden
    • Wilson Garden
  • Patterns
    • Area Graph
    • Array along Curve
    • Fibbonacci and Factorial
    • Gyroid
    • Hexagonal Pattern From Image
    • Hexagonal Grid
    • Koch Star
    • Mandelbrot Set
    • Pattern
    • Pattern
    • Pattern
    • Phyllotaxis
    • Random Strip Widths
    • Skewed Surface
    • Staggered Checkerboard
    • Triangle subdivision
    • Vector Field
    • Voronoi
    • Waves
    • Weave
  • Geometry
    • Boundary Curve
    • Bridging parallel curves
    • British Museum Great Court
    • Catenary
    • Delete Adjacent
    • Geodesic Sphere
    • Group Branching Curves
    • Group Circles
    • Group curves
    • K Mean
    • Nurbs Surface Irregular
    • Overlapping Petals
    • Pair Nearest
    • Parametric Shapes
    • Platonic Solids
    • Polyline to PolyArc
    • Roman Surface
    • Sagrada Familia Schools Roof
    • Sine Curve
    • Sine Ribbon
    • Spherical Transformations
    • Split Rectangle
    • Tangential Circle through Point
    • Travelling Salesman Problem
    • Unaligned Bounding Box
  • Lists
    • Alter by Boolean Sequence
    • Color by distance
    • Consecutive Points
    • Distancing
    • Divide Equally
    • Geometry from Image
    • Image based Point Density
    • Isovists
    • Reduce Color Palette
    • Replace Consecutive
    • Replace Multiple
    • Replace Recurring
    • Shadow Area
    • Shortest Path
    • Solar Analysis
    • Topography Analysis
  • Motion
    • Adjacency
    • Animate Sphere
    • Cellular Automation
    • Cloth
    • Hypotrochoid
    • Manakin
    • Rolling Spiral
    • Tan Curve
    • Trammel of Archemedes
    • Image to Integer
  • Articles
    • A Conceptual Approach to Integrating Computational Methods in Early Stage Design
    • Design Script's ambiguous and versatile Replication Guides <1>
    • Design Script's ambiguous and versatile Replication Guides <2>
Powered by GitBook
On this page
  1. Geometry

Platonic Solids

Regular Polyhedron

PreviousParametric ShapesNextPolyline to PolyArc

Last updated 4 years ago

Platonic solid, any of the five geometric solids whose faces are all identical, regular polygons meeting at the same three-dimensional angles. Also known as the five regular polyhedra, they consist of the tetrahedron (or pyramid), hexahedron (or cube), octahedron, dodecahedron, and icosahedron.

h = (1+Math.Sqrt(5))/2-1;
phd01 = Dictionary.ByKeysValues(["Tetrahedron","Hexahedron","Octahedron","Dodecahedron","Icosahedron"],
[[1,1,1,1,-1,-1,-1,1,-1,-1,-1,1],[1,1,1,1,1,-1,1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1],
[0,0,1,0,0,-1,0,1,0,0,-1,0,1,0,0,-1,0,0],[0,h,1/h,0,h,-1/h,0,-h,1/h,0,-h,-1/h,h,1/h,0,h,-1/h,0,-h,1/h,0,
-h,-1/h,0,1/h,0,h,1/h,0,-h,-1/h,0,h,-1/h,0,-h,1,1,1,1,1,-1,1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1],
[0,1,1/h,0,1,-1/h,0,-1,1/h,0,-1,-1/h,1,1/h,0,1,-1/h,0,-1,1/h,0,-1,-1/h,0,1/h,0,1,1/h,0,-1,-1/h,0,1,-1/h,0,-1]]);

xyz01 = List.Transpose(List.Chop(phd01.ValueAtKey(p),3));
pnt01 = Point.ByCoordinates(xyz01[0],xyz01[1],xyz01[2]);
phd02 = Dictionary.ByKeysValues(["Tetrahedron","Hexahedron","Octahedron","Dodecahedron","Icosahedron"],[[3,4],[4,6],[3,8],[5,16],[3,20]]);
pnt02 = List.Combinations(pnt01,phd02.ValueAtKey(p)[0],false);
bln01 = List.AllTrue(pnt02.DoesIntersect(Circle.ByBestFitThroughPoints(pnt02))<1>);
pnt03 = List.FilterByBoolMask(pnt02,bln01)["in"];
rad01 = Math.Round(Circle.ByBestFitThroughPoints(pnt03).Radius,6);
pnt04 = List.GroupByKey(pnt03,rad01);
pnt05 = List.FirstItem(List.SortByKey(pnt04["groups"],pnt04["unique keys"])["sortedList"]);
pln01 = Plane.ByBestFitThroughPoints(pnt05);
dir01 = Vector.ByTwoPoints(pln01.Origin,pnt05);
ang01 = Math.Round(dir01.AngleAboutAxis(pln01.XAxis,pln01.Normal),3);
srf01 = List.SortByKey(pnt05<1>,ang01<1>)["sortedList"];
sld01 = PolySurface.ByJoinedSurfaces(Surface.ByPerimeterPoints(srf01)).ExtractSolids();

Only edges are obtained with a slightly altered approach

h = (1+Math.Sqrt(5))/2-1;
phd01 = Dictionary.ByKeysValues(["Tetrahedron","Hexahedron","Octahedron","Dodecahedron","Icosahedron"],
[[1,1,1,1,-1,-1,-1,1,-1,-1,-1,1],[1,1,1,1,1,-1,1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1],
[0,0,1,0,0,-1,0,1,0,0,-1,0,1,0,0,-1,0,0],[0,h,1/h,0,h,-1/h,0,-h,1/h,0,-h,-1/h,h,1/h,0,h,-1/h,0,-h,1/h,0,
-h,-1/h,0,1/h,0,h,1/h,0,-h,-1/h,0,h,-1/h,0,-h,1,1,1,1,1,-1,1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1],
[0,1,1/h,0,1,-1/h,0,-1,1/h,0,-1,-1/h,1,1/h,0,1,-1/h,0,-1,1/h,0,-1,-1/h,0,1/h,0,1,1/h,0,-1,-1/h,0,1,-1/h,0,-1]]);

xyz01 = List.Transpose(List.Chop(phd01.ValueAtKey(p),3));
pnt01 = Point.ByCoordinates(xyz01[0],xyz01[1],xyz01[2]);
pnt02 = List.Combinations(pnt01,2,false);
dst01 = Math.Round(List.FirstItem(pnt02<1>).DistanceTo(List.LastItem(pnt02<1>)),3);
pnt03 = List.SortByKey(pnt02,dst01);
pnt04 = List.GroupByKey(pnt03["sortedList"],pnt03["sortedKeys"])["groups"];
edg01 = Line.ByBestFitThroughPoints(List.FirstItem(pnt04));
Platonic Solids
Platonic Solid Frame