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

Geodesic Sphere

Geodesic Sphere based on an Icosahedron

PreviousDelete AdjacentNextGroup Branching Curves

Last updated 3 years ago

// Radius
rad = 12;

// Division Depth
d = 9;

// Icosahedron
p = (1+Math.Sqrt(5))/2;
a = Point.ByCoordinates([0,0,0,0,p,-p,-p,p,1,-1,-1,1],[1,-1,-1,1,0,0,0,0,p,p,-p,-p],[p,p,-p,-p,1,1,-1,-1,0,0,0,0]);
b = [[a[0],a[8],a[9]],[a[0],a[9],a[5]],[a[0],a[5],a[1]],[a[0],a[1],a[4]],[a[0],a[4],a[8]],
[a[1],a[5],a[10]],[a[1],a[10],a[11]],[a[1],a[11],a[4]],[a[2],a[3],a[7]],[a[2],a[7],a[11]],
[a[2],a[11],a[10]],[a[2],a[10],a[6]],[a[2],a[6],a[3]],[a[3],a[6],a[9]],[a[3],a[9],a[8]],
[a[3],a[8],a[7]],[a[4],a[11],a[7]],[a[4],a[7],a[8]],[a[5],a[9],a[6]],[a[5],a[6],a[10]]];
tri = Surface.ByPerimeterPoints(b);

// Sub dividing equilateral faces
// Edges of equilateral surface
crv1 = tri.PerimeterCurves();
len1 = List.GetItemAtIndex(crv1<1>,0).Length;
n = d<1?1:d;
len2 = len1/n;

// Vertices of equilateral surface
pnt1 = List.GetItemAtIndex(crv1<1>,0).StartPoint;
pnt2 = List.GetItemAtIndex(crv1<1>,1).StartPoint;
pnt3 = List.GetItemAtIndex(crv1<1>,2).StartPoint;

dir1 = Vector.ByTwoPoints(pnt1,pnt2);
dir2 = Vector.ByTwoPoints(pnt1,pnt3);
dir3 = Vector.ByTwoPoints(pnt2,pnt3);

// Sub triangle 1
pnt4 = pnt1.Translate(dir1,len2);
pnt5 = pnt1.Translate(dir2,len2);
sub1 = Polygon.ByPoints(Transpose([pnt1,pnt4,pnt5]));

// Repeating sub triangle
n2 = (0..(n-1))*len2<1>;
sub2 = sub1.Translate(dir1,n2);
n3 = List.TakeItems(n2<1>,1..n);
sub3 = sub2.Translate(dir3,n3);

// Sub triangle 2
pnt6 = n<2?pnt1:pnt4.Translate(dir2,len2);
sub4 = Polygon.ByPoints(Transpose([pnt4,pnt5,pnt6]));
n4 = (0..(n-2))*len2<1>;
sub5 = sub4.Translate(dir1,n4);
n5 = List.TakeItems(n4<1>,1..n);
sub6 = sub5.Translate(dir3,n5);

sub21 = List.Flatten(List.TakeItems([sub3,sub6],n),-1);

plPnt1 = List.Flatten(sub21).Points;
plDir1 = Vector.ByTwoPoints(Point.Origin(),plPnt1);

sph = Sphere.ByCenterPointRadius(Point.Origin(),rad);
plPnt21 = List.Flatten(sph.ProjectInputOnto(plPnt1,plDir1)<1>,-1);
pl1 = Polygon.ByPoints(plPnt21);
sr1 = pl1.Patch();

sr2 = GeometryColor.ByGeometryColor(List.Transpose(List.Chop(sr1,4)),
Color.ByARGB(255,[115,105,25,200],[200,100,56,169],26));