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

Bridging parallel curves

Orthogonal Spacing of beams along Parallel two Curves

PreviousBoundary CurveNextBritish Museum Great Court

Last updated 4 years ago

Spacing based on maximum distance between consecutive beams

//Two Parallel Curves

a1 = Arc.ByCenterPointStartPointSweepAngle
(Point.ByCoordinates(0,10000),Point.Origin(),
90,Vector.ZAxis());
l1 = Line.ByStartPointDirectionLength
(a1.EndPoint,Vector.YAxis(),20000);
a2 = Arc.ByCenterPointStartPointSweepAngle
(Point.ByCoordinates(20000,30000),
l1.EndPoint,-90,Vector.ZAxis());
a3 = a1.Offset(5000);
l2 = l1.Offset(-5000);
a4 = a2.Offset(-5000);
p1 = PolyCurve.ByJoinedCurves([a1,l1,a2]);
p2 = PolyCurve.ByJoinedCurves([a3,l2,a4]);
n1 = NurbsCurve.ByPoints(p1.PointAtParameter(0..1..#100));
n2 = NurbsCurve.ByPoints(p2.PointAtParameter(0..1..#100));
//Orthogonal Beams

max = 1000;
pt1 = br2(cr1,cr2,max);
pt2 = cr2.ClosestPointTo(pt1);
ln1 = Line.ByStartPointEndPoint(pt1,pt2);
[cr1,cr2,ln1];

//Points Spacing - Curve 1
d11 = List.DropItems(List.Sublists(pt1,0..1,1),-1);
d12 = Math.Round(List.FirstItem(d11<1>).DistanceTo(List.LastItem(d11<1>)));


//Points Spacing - Curve 2
d11 = List.DropItems(List.Sublists(pt2,0..1,1),-1);
d12 = Math.Round(List.FirstItem(d11<1>).DistanceTo(List.LastItem(d11<1>)));
def br1(c1,c2,p1,s1)
{
	r1 = c1.ParameterAtPoint(p1);
	p2 = c2.ClosestPointTo(p1);
	r2 = c2.ParameterAtPoint(p2);
	p3 = c2.PointAtChordLength(s1,r2,true);
	p4 = c1.ClosestPointTo(p3);
	d1 = p1.DistanceTo(p4);
	p5 = d1<=s1?p4:c1.PointAtChordLength(s1,r1,true);
	pr = d1<=s1?c2.ParameterAtPoint(p5):c1.ParameterAtPoint(p5);
	return = [p5,pr];
};

def br2(c1,c2,s1)
{
	return = [Imperative]
	{
		n = 0;
		ct = 0;
		q = Math.Ceiling(c1.Length/s1);
		p1 = c1.StartPoint;
		p3 = [];
		while (ct < 1)
		{
			p3[n] = List.FirstItem(br1(c1,c2,p1,s1));
			ct = List.LastItem(br1(c1,c2,p1,s1));
			p1 = p3[n];
			n = n + 1;
		}
		return = p3;
	}
};

Spacing based on maximum area between consecutive beams

// Orthogonal Beams

//Max are in sqm
max = 10;
//Reduce beam spacing increment (mm) for greater accuracy
spc = 100;

pt1 = br2(cr1,cr2,spc);
pt2 = cr2.ClosestPointTo(pt1);
ln1 = Line.ByStartPointEndPoint(pt1,pt2);
ln2 = List.DropItems(List.Sublists(ln1,0..1,1),-1);
ar1 = Surface.ByLoft(ln2).Area/1000000;
ar2 = Math.Sum(List.TakeItems(ar1,1..List.Count(ar1)));
ln3 = List.GroupByKey(List.RestOfItems(ln1),Math.Ceiling(ar2/max))["groups"];

// Beams spaced with desired area between them
ln4 = List.AddItemToFront(List.FirstItem(ln1),List.LastItem(ln3<1>));
[cr1,cr2,ln4];

//Area between two beams
ar3 = Math.Round(Surface.ByLoft(List.DropItems(List.Sublists(ln4,0..1,1),-1)).Area/1000000);
def br1(c1,c2,p1,s1)
{
	r1 = c1.ParameterAtPoint(p1);
	p2 = c2.ClosestPointTo(p1);
	r2 = c2.ParameterAtPoint(p2);
	p3 = c2.PointAtChordLength(s1,r2,true);
	p4 = c1.ClosestPointTo(p3);
	d1 = p1.DistanceTo(p4);
	p5 = d1<=s1?p4:c1.PointAtChordLength(s1,r1,true);
	pr = d1<=s1?c2.ParameterAtPoint(p5):c1.ParameterAtPoint(p5);
	return = [p5,pr];
};

def br2(c1,c2,s1)
{
	return = [Imperative]
	{
		n = 0;
		ct = 0;
		q = Math.Ceiling(c1.Length/s1);
		p1 = c1.StartPoint;
		p3 = [];
		while (ct < 1)
		{
			p3[n] = List.FirstItem(br1(c1,c2,p1,s1));
			ct = List.LastItem(br1(c1,c2,p1,s1));
			p1 = p3[n];
			n = n + 1;
		}
		return = List.Flatten([c1.StartPoint,p3],-1);
	}
};
15KB
Path-Area.dyn
15KB
Path-20190217.dyn