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. Patterns

Hexagonal Grid

PreviousHexagonal Pattern From ImageNextKoch Star

Last updated 4 years ago

//Hexagon Points Grid
s = 1;
a = s/(2*Math.Tan(30));
p1 = Point.ByCoordinates((0..#15..s*3)<1>,(0..#25..a*2)<2>);
p2 = List.Flatten(p1<1>.Translate([0,s*1.5]<2>,[0,a]<2>,0),1);
p3 = Polygon.RegularPolygon(Circle.ByCenterPointRadius(p2,s),6).Points;
d1 = (15*s*3)/((Math.Pow(p3.DistanceTo(Point.ByCoordinates(15*s*3/2,25*a*2/2)),0.75))+0.2);
p4 = Polygon.ByPoints(p3.Translate(Vector.ZAxis(),-d1+35));
//Hexagon Points Grid
s = 10;
a = s/(2*Math.Tan(30));
p1 = Point.ByCoordinates((0..#15..s*3)<1>,(0..#25..a*2)<2>);
p2 = List.Flatten(p1<1>.Translate([0,s*1.5]<2>,[0,a]<2>,0),1);
p3 = Polygon.RegularPolygon(Circle.ByCenterPointRadius(p2,s),6);
p4 = p3.Points;

//Attractor 1
v1 = Vector.ByTwoPoints(p3,a1);
v2 = v1.Scale(2/Math.Pow(v1.Length,0.25));
p5 = p4.Translate(v2);

//Attractor 2
v3 = Vector.ByTwoPoints(p4,a2);
v4 = v3.Scale(2/Math.Pow(v3.Length,0.25));
p6 = p5.Translate(v4);

Hexagonal Grid on Surface

//Square Dimensions
wdt1 = 5000;

uDv1 = 15;
vDv1 = 20;

//Surface
srf1 = Surface.ByPatch(Rectangle.ByWidthLength(wdt1,wdt1));
rem1 = Math.DivRem(uDv1,3);
uDv2 = rem1==2?uDv1+1:uDv1+2;
uDv3 = rem1==3?uDv1:uDv2;
pt01 = srf1.PointAtParameter((0..1..#uDv3)<1>,(0..1..#vDv1)<2>);
pt02 = List.TakeEveryNthItem(List.TakeEveryNthItem(pt01<1>,4,-2),2,1);
pt03 = List.TakeEveryNthItem(List.TakeEveryNthItem(pt01<1>,4,-1),2,1);
pt04 = List.TakeEveryNthItem(List.TakeEveryNthItem(pt01<1>,4,-3),2,0);
pt05 = List.TakeEveryNthItem(List.TakeEveryNthItem(pt01<1>,4,0),2,0);

//Polygons
pt11 = [List.DropItems(pt02,-1),
List.DropItems(pt03,-1),pt05,
List.DropItems(pt03,1),
List.DropItems(pt02,1),pt04];
pt12 = List.Transpose(List.Transpose(pt11)<1>);

pt13 = [List.DropItems(List.DropItems(pt05<1>,-1),-1),
List.DropItems(List.DropItems(pt04<1>,1),-1),
List.DropItems(List.DropItems(List.DropItems(pt02<1>,1),1),-1),
List.DropItems(List.DropItems(pt04<1>,1),1),
List.DropItems(List.DropItems(pt05<1>,-1),1),
List.DropItems(List.DropItems(List.DropItems(pt03<1>,-1),1),-1)];
pt14 = List.Transpose(List.Transpose(pt13)<1>);

pg11 = Polygon.ByPoints([pt12,pt14]);];
//Surface
srf1 = Surface.ByRevolve(NurbsCurve.ByPoints(Point.ByCoordinates
([20,18,18,22,22],0,[0,2,5,10,15])),Point.Origin(),Vector.ZAxis(),0,-180);

uDv1 = 25;
vDv1 = 52;

29KB
hexagon_on_surface.dyn