AA Summer DLab was a 2 week workshop where with the direction of Dave Pigram and Ezio Blasetti we focused on generative processes utilizing RhinoScript. Although I knew how to read the language, this was my first exposure to these generative techniques. This marks the beginning of a search to know more.

In the workshop, students designed chandeliers utilizing generative algorithms. My group explored the potential for light based parameters in a  DLA, diffusion limited aggregation, system.

The first script uses a surface (based on the luminance of a ceiling plan) to aggregate a ceiling plane with “smart” light nodes and develop connections between them based on the amount of light in a given region.

Option Explicit
‘Script written by <Michael McCune,Stephen Crawford, Karol Seamus Mac Gairbheith>
‘Script version Wednesday, August 06, 2008 5:42:24 PM
‘Light based Diffusion Limited Aggregation

Call Main()
Sub Main()

‘declaraions
Dim dblDistance, arrSeeds(), arrSeedThresholds(),arrMinLightPt
Dim i,j,k,l,m

‘because there is nothing in the array, set it at minus one to trick the computer that when we add 1 futher below the first slot will be 0
ReDim arrSeeds(-1)
ReDim arrSeedThresholds(-1)

‘user iputs
Dim dblScaleFactor : dblScaleFactor = Rhino.GetReal(“What is the distance scale factor between seed and emmitter?”,1,.0001,100)
If IsNull(dblScaleFactor) Then Exit Sub

Dim dblVelocityScaler : dblVelocityScaler = Rhino.GetReal(“Velociy Scaler?”,1,.01,1000)
If IsNull(strObject) Then Exit Sub

Dim dblRand : dblRand = Rhino.GetReal(“What is degree of randomness to the movement of the emmitter?”,.2,.01,100)
If IsNull(dblRand) Then Exit Sub

Dim intConnections : intConnections = Rhino.GetReal(“What is the max conections between seed and attractor?”,4,3,10)
If IsNull(intConnections) Then Exit Sub

Dim intStep : intStep = Rhino.GetReal(“How many times do you want to do cycle?”,1000,1)
If IsNull(intStep) Then Exit Sub

Dim intNumberOfStarterEmmitters: intNumberOfStarterEmmitters = Rhino.GetReal(“How many Emmitters to Start With?”,20,1,1000)

Dim strObject : strObject = Rhino.GetObject(“give me a surface to populate with dots”,24)
If IsNull(strObject) Then Exit Sub

‘Call Rhino.EnableRedraw(False)

‘Create Bounding Box so the attractors will not wonder off!!
Dim arrSBox : arrSBox =  Rhino.BoundingBox (strObject)
Dim arrBBox : arrBBox =  arrSBox

arrBBox(0) = array(arrSBox(0)(0),arrSBox(0)(1),-.1)
arrBBox(1) = array(arrSBox(1)(0),arrSBox(1)(1),-.1)
arrBBox(2) = array(arrSBox(2)(0),arrSBox(2)(1),-.1)
arrBBox(3) = array(arrSBox(3)(0),arrSBox(3)(1),-.1)
arrBBox(4) = array(arrSBox(4)(0),arrSBox(4)(1),9)
arrBBox(5) = array(arrSBox(5)(0),arrSBox(5)(1),9)
arrBBox(6) = array(arrSBox(6)(0),arrSBox(6)(1),9)
arrBBox(7) = array(arrSBox(7)(0),arrSBox(7)(1),9)

‘Create the first seed
arrMinLightPt = GetMinLightPt (strObject)
ReDim arrSeeds(0)
arrSeeds(0)            =     Rhino.AddPoint(array(arrMinLightPt(0),arrMinLightPt(1),0))
Call Rhino.ObjectLayer(arrSeeds(0), “Attractors”)

‘find the corresponding Threshold
ReDim arrSeedThresholds(0)
arrSeedThresholds(0) = GetThreshold(strObject,Rhino.PointCoordinates(arrSeeds(0)),dblScaleFactor)
‘Call Rhino.Print(arrSeedThresholds(0))

‘place intnumber of emmitters randomly to start with
For l = 0 To intNumberOfStarterEmmitters
Dim arrNewPt2 : arrNewPt2 = array(28*(rnd-0.5), 28*(rnd-0.5),0)
arrNewPt2 = ConstrainToBBox(arrNewPt2, arrBBox)
Rhino.AddPoint arrNewPt2
Call Rhino.ObjectLayer(arrNewPt2, “Emmitters”)
Next

‘start loop for each iteration
For j = 0 To intStep

Dim arrEmmitters : arrEmmitters = Rhino.ObjectsByLayer(“Emmitters”)

‘cycle through each arrEmmitters

For i = 0 To (Ubound(arrEmmitters)-1)
If IsNull(arrEmmitters) Then
Exit For
End If
‘Find the attractors with more than x connections, then place those in an “expired” layer
‘Call SortPoints()

Dim arrPointxyzEmmitter

arrPointxyzEmmitter = Rhino.PointCoordinates(arrEmmitters(i))

‘make the emmitters move
‘RandomizeRandomize
Dim rndDirectionX : rndDirectionX = rnd-0.5
Dim rndDirectionY : rndDirectionY = rnd-0.5
Dim rndDirectionZ : rndDirectionZ = rnd-0.5
‘Dim rndDirectionZ : rndDirectionZ = rnd-0.5

‘get a threshold factor to apply to the speed at which the particles move
Dim dblThresholdFactor
dblThresholdFactor = GetThreshold(strObject,arrPointxyzEmmitter,dblVelocityScaler)

‘Rhino.Print(dblThresholdFactor)

Dim arrNewPt : arrNewPt = array(arrPointxyzEmmitter(0)+3*rndDirectionX, arrPointxyzEmmitter(1)+3*rndDirectionY, 0)
arrNewPt = ConstrainToBBox(arrNewPt, arrBBox)
rhino.DeleteObject arrEmmitters(i)
arrEmmitters(i) = Rhino.AddPoint (arrNewPt)
‘Call Rhino.PointCoordinates (arrEmmitters(i) , arrNewPt)

Dim arrLineCounter : arrLineCounter = Rhino.ObjectsByLayer(“Lines”)

‘start loop for each arrAttrctors
For k=0 To Ubound(arrSeeds)
‘measure distance between emmitter and seed
Dim arrPointxyzAttractor : arrPointxyzAttractor = Rhino.PointCoordinates(arrSeeds(k))
dblDistance = Rhino.Distance(arrPointxyzAttractor,arrNewPt )

If dblDistance < arrSeedThresholds(k) Then
‘If dblDistance > 1.67 And dblDistance < 8.4 Then

‘Rhino.Print dblDistance
‘draw a line from seed to emmitter
Dim strLine : strLine = Rhino.AddLine(arrPointxyzAttractor,arrNewPt)
If Not IsNull(strLine) Then
Call Rhino.ObjectLayer(strLine, “Lines”)
End If
‘switch the emmitter to the attrctor layer
Call Rhino.ObjectLayer(arrEmmitters(i), “Attractors”)
ReDim Preserve arrSeeds(Ubound(arrSeeds)+1) ‘store the name of the new seed (previously an emmiter) in an array
arrSeeds(Ubound(arrSeeds)) = arrEmmitters(i)
‘claculatethe threshold for the new seed and store it in a corresponding array
ReDim Preserve arrSeedThresholds(Ubound(arrSeedThresholds)+1)
arrSeedThresholds(Ubound(arrSeedThresholds)) = GetThreshold(strObject,Rhino.PointCoordinates(arrSeeds(k)),dblScaleFactor)

‘End If
End If
Next
Dim arrCleanedSeeds : arrCleanedSeeds = SortPointsAfterDave(arrSeeds)
Dim arrCleanSeed
ReDim arrSeeds(-1)
For Each arrCleanSeed In arrCleanedSeeds
ReDim Preserve arrSeeds(Ubound(arrSeeds)+1) ‘store the name of the new seed (previously an emmiter) in an array
arrSeeds(Ubound(arrSeeds)) = arrCleanSeed
Next
Dim arrLineCounter2 : arrLineCounter2 = Rhino.ObjectsByLayer(“Lines”)

If Ubound(arrLineCounter) < Ubound(arrLineCounter2) Then

‘create a new emmitter (particle)
arrNewPt2 = array(28*(rnd-0.5), 28*(rnd-0.5), 0*(rnd-0.5))
arrNewPt2 = ConstrainToBBox(arrNewPt2, arrBBox)
For m = 0 To Ubound (arrSeeds)
Dim arrSeedsx: arrPointxyzAttractor = Rhino.PointCoordinates(arrSeeds(k))
dblDistance = Rhino.Distance(arrNewPt2,arrSeeds(m))
If dblDistance > 1.67 Then
Rhino.AddPoint arrNewPt2
Call Rhino.ObjectLayer(arrNewPt2, “Emmitters”)
Else ReLoop
End If
Next

End If

Next

Next

‘Call AverageDistLoft

Call Rhino.EnableRedraw(True)

End Sub

Function GetNumberOfSeedsWithinDist(strSeed,dblDistanceThreshold)
‘Gets the number of seeds within a distance of a seed. that number of seeds should then be multiplied by the z direction of the point

Dim i,arrPointxyzSeed, arrSeeds
Dim arrNumberOfSeedsWithinDistance()
ReDim arrNumberOfSeedsWithinDistance(-1)

ReDim arrNumberOfSeedsWithinDistance(0)
arrNumberOfSeedsWithinDistance(0) = 1
arrSeeds = Rhino.ObjectsByLayer(“ExpiredAttractors”)

‘loop through each seed
For    i=0 To Ubound(arrSeeds)
‘get the x,y,z of the seeds
arrPointxyzSeed = Rhino.PointCoordinates(arrSeeds(i))

‘loop through the rest of the seeds
For j=0 To Ubound(arrSeeds)

‘get the x,y,z of the seeds
arrPointxyzOtherSeed = Rhino.PointCoordinates(arrSeeds(j))

‘measure distance between seed and seed
dblDistance     = Rhino.Distance(arrPointxyzAttractor,arrPointxyzOtherSeed )
If dblDistance < dblDistanceThreshold Then

ReDim Preserve arrNumberOfSeedsWithinDistance(Ubound(arrNumberOfSeedsWithinDistance)+1) ‘store the name of the new seed (previously an emmiter) in an array
arrNumberOfSeedsWithinDistance(Ubound(arrNumberOfSeedsWithinDistance)) = arrSeeds(j)

End If

Next
Next

dblDistanceThreshold = arrSeeds(Ubound)

GetNumberOfSeedsWithinDist = dblDistanceThreshold

End Function

Function GetThreshold(strObject,arrSeedPt,dblScaleFactor)

GetThreshold = Null

Dim dblThresholdFactor, dblHeightofLine, arrIntersectingPoint, strTempIntersectingLine, arrIntersectingBrepsReturn, arrBrepClosestPointRtn

dblHeightofLine = 100

strTempIntersectingLine      = Rhino.AddLine(arrSeedPt,array(arrSeedPt(0),arrSeedPt(1),arrSeedPt(2)+dblHeightofLine))
arrIntersectingBrepsReturn  = Rhino.IntersectBreps(strTempIntersectingLine,strObject)

Call Rhino.DeleteObject(strTempIntersectingLine)

‘if there is no intersection, then use closest point on surface instead
If isNull(arrIntersectingBrepsReturn) Then
arrBrepClosestPointRtn     =    Rhino.BrepClosestPoint(strObject,arrSeedPt)
arrIntersectingPoint     =    arrBrepClosestPointRtn(0)
Else
arrIntersectingPoint     = Rhino.PointCoordinates(arrIntersectingBrepsReturn(2))
End If

dblThresholdFactor = (dblScaleFactor)*arrIntersectingPoint(2) ‘use the Z value of the point on the heighfield surface

GetThreshold = dblThresholdFactor

End Function

Sub SortPoints()
Dim intConnections

intConnections = 4

Dim arrSeeds   : arrSeeds      = Rhino.ObjectsByLayer(“Attractors”)
If IsNull(arrSeeds) Then Exit Sub
Dim arrIDLines      : arrIDLines           = Rhino.ObjectsByLayer(“Lines”)
‘Dim arrLines : arrLines = Rhino.PointCoordinates(arrIDLines)
If IsNull(arrIDLines) Then Exit Sub
Dim i,j

For j = 0 To Ubound (arrIDLines)
Dim arrLineStPt         : arrLineStPt         = Rhino.CurveStartPoint (arrIDLines(j))
Dim arrLineEndPt        : arrLineEndPt        = Rhino.CurveEndPoint (arrIDLines(j))
Dim intcounterConections : intcounterConections = 0

For i = 0 To Ubound (arrSeeds)
If intcounterConections > intConnections Then
Call Rhino.ObjectLayer (arrSeeds(i) , “ExpiredAttractors”)
Exit For
End If
Dim arrPointxyzAttraction : arrPointxyzAttraction = Rhino.PointCoordinates(arrSeeds(i))
If arrPointxyzAttraction(0) = arrLineStPt(0) Or arrPointxyzAttraction(0) = arrLineEndPt(0) Then
If arrPointxyzAttraction(1) = arrLineStPt(1) Or arrPointxyzAttraction(1) = arrLineEndPt(1) Then
intcounterConections = intcounterConections + 1
End If
End If
Next

Next

End Sub

Function SortPointsAfterDave(arrSeeds)
Dim intConnections :    intConnections = 4
Dim arrSeedsClean()
ReDim arrSeedsClean(-1)
‘Dim arrSeeds   : arrSeeds      = Rhino.ObjectsByLayer(“Attractors”)
If IsNull(arrSeeds) Then Exit Function
Dim arrIDLines      : arrIDLines           = Rhino.ObjectsByLayer(“Lines”)
‘Dim arrLines : arrLines = Rhino.PointCoordinates(arrIDLines)
If IsNull(arrIDLines) Then Exit Function
Dim i,j
For i = 0 To Ubound (arrSeeds)
Dim intcounterConections : intcounterConections = 0
Dim arrPointxyzAttraction : arrPointxyzAttraction = Rhino.PointCoordinates(arrSeeds(i))
For j = 0 To Ubound (arrIDLines)
Dim arrLineStPt         : arrLineStPt         = Rhino.CurveStartPoint (arrIDLines(j))
Dim arrLineEndPt        : arrLineEndPt        = Rhino.CurveEndPoint (arrIDLines(j))
If     Rhino.PointCompare (arrPointxyzAttraction, arrLineStPt) Then
intcounterConections = intcounterConections + 1
End If
If     Rhino.PointCompare (arrPointxyzAttraction, arrLineEndPt) Then
intcounterConections = intcounterConections + 1
End If
Next
‘prompt intcounterConections
If intcounterConections < intConnections Then
‘Call Rhino.ObjectLayer (arrSeeds(i) , “ExpiredAttractors”)

Dim strTestPt
Dim TestCounter : TestCounter = 0
For Each strTestPt In arrSeedsClean
Dim arrTestPt : arrTestPt =  Rhino.PointCoordinates(strTestPt)
Dim blnTest : blnTest = Rhino.PointCompare (arrTestPt, arrPointxyzAttraction)
If blnTest Then
testCounter = TestCounter+1
End If
Next            ‘
If TestCounter=0 Then
ReDim Preserve arrSeedsClean(Ubound(arrSeedsClean)+1) ‘store the name of the new seed (previously an emmiter) in an array
arrSeedsClean(Ubound(arrSeedsClean)) = arrSeeds(i)
End If
Else
‘prompt “why am i here?”
‘            Dim strDot : strDot = rhino.AddTextDot (“expired”, arrPointxyzAttraction)
‘            Call Rhino.ObjectLayer (arrSeeds(i) , “ExpiredAttractors”)
‘            Call Rhino.ObjectLayer (strDot , “ExpiredAttractors”)
End If
Next
SortPointsAfterDave = arrSeedsClean
End Function

Function GetMinLightPt (strObject)

GetMinLightPt = Null

Dim i, arrSurfacePoints, dblLowestZ, arrLowestPt

arrSurfacePoints = Rhino.SurfacePoints(strObject)

dblLowestZ = 9999999999999999

For i = 0 To Ubound(arrSurfacePoints)

If arrSurfacePoints(i)(2) < dblLowestZ Then

dblLowestZ = arrSurfacePoints(i)(2)
arrLowestPt = arrSurfacePoints(i)

End If

Next

GetMinLightPt = arrLowestPt

End Function

Function ConstrainToBBox(arrNewPt, arrBBox)
ConstrainToBBox = Null
‘    Dim arrNewAttractors : arrNewAttractors = arrNewPt
Dim arrPoint00              : arrPoint00 = arrBBox(0)
Dim arrPoint01              : arrPoint01 = arrBBox(1)
Dim arrPoint03              : arrPoint03 = arrBBox(3)
Dim arrPoint04              : arrPoint04 = arrBBox(4)
Dim arrXbound               : arrXbound  = arrPoint01(0) – arrPoint00(0)
Dim arrYbound               : arrYbound  = arrPoint03(1) – arrPoint00(1)
Dim arrZbound               : arrZbound  = arrPoint04(2) – arrPoint00(2)

If arrNewPt(0)>arrPoint01(0) Then
arrNewPt(0) = arrNewPt(0) – arrXbound
End If
If arrNewPt(0)<arrPoint00(0) Then
arrNewPt(0) = arrNewPt(0) + arrXbound
End If
If arrNewPt(1)>arrPoint03(1) Then
arrNewPt(1) = arrNewPt(1)- arrYbound
End If
If arrNewPt(1)<arrPoint00(1) Then
arrNewPt(1) = arrNewPt(1) + arrYbound
End If
If arrNewPt(2)>arrPoint04(2) Then
arrNewPt(2) = arrNewPt(2)- arrZbound
End If
If arrNewPt(2)<arrPoint00(2) Then
arrNewPt(2) = arrNewPt(2) + arrZbound
End If

ConstraintoBBox = arrNewPt
End Function

Function AverageDistLoft

‘Call an array of all lines and get start and end points
Dim arrObjects, arrStartPoint, dblDistance, dblScaleFactor
Dim arrEndPoint, arrMidPoint, SumOfAllDistances
Dim dblAverageDistanceStartPt, dblAverageDistanceEndPt
Dim i, j

dblScaleFactor = 100

arrObjects = Rhino.ObjectsByLayer(“Lines”)
‘get start, mid and end points

For i = 0 To Ubound(arrObjects)

If Rhino.IsCurve(arrObjects(i)) Then

arrStartPoint = Rhino.CurveStartPoint(arrObjects(i))
arrEndPoint = Rhino.CurveEndPoint(arrObjects(i))

‘reset the total for this line
SumOfAllDistances = 0

‘for the start point
For j = 0 To Ubound(arrObjects)

arrMidPoint = Rhino.CurveMidPoint(arrObjects(j))

dblDistance = Rhino.Distance(arrStartPoint,arrMidPoint)

SumOfAllDistances    = SumOfAllDistances + dblDistance

Next

dblAverageDistanceStartPt = SumOfAllDistances / (Ubound(arrObjects) + 1)

‘for the end point
SumOfAllDistances = 0

For j = 0 To Ubound(arrObjects)

arrMidPoint = Rhino.CurveMidPoint(arrObjects(j))

dblDistance = Rhino.Distance(arrEndPoint,arrMidPoint)

SumOfAllDistances    = SumOfAllDistances + dblDistance

Next

dblAverageDistanceEndPt = SumOfAllDistances / (Ubound(arrObjects) + 1)

End If

‘Dim strNewLine : strNewLine = Rhino.AddLine(array(arrStartPoint(0),arrStartPoint(1),dblAverageDistanceStartPt/dblScaleFactor), array(arrEndPoint(0),arrEndPoint(1),dblAverageDistanceEndPt/dblScaleFactor))
Dim strNewLine : strNewLine = Rhino.AddLine(array(arrStartPoint(0),arrStartPoint(1),dblScaleFactor/dblAverageDistanceStartPt), array(arrEndPoint(0),arrEndPoint(1),dblScaleFactor/dblAverageDistanceEndPt))

‘add loft surface between 2 sets of lines

‘Rhino.AddLoftSrf array(arrObjects(i),strNewLine)

Next
End Function

The second script lofts surfaces based on the density of light nodes. The denser the thicker and further the members are from the ceiling. The script also prepares the file for laser cutting by unrolling the surfaces, labeling, and giving the lengths of the light nodes.

Option Explicit
‘Script written by Michael McCune
‘Script version Tuesday, August 12, 2008 1:07:43 PM
‘Lofts line based on density of points
‘Unrolls for laser cutting and labeling

Call Main()
Sub Main()
Dim intSpread : intSpread = Rhino.GetReal(“Space between unrolled surfaces”,1, 1,100)

Call LoftSurfacesBasedOnDensity (intSpread)
End Sub

Function LoftSurfacesBasedOnDensity (intSpread)

Dim arrIDLines      : arrIDLines           = Rhino.ObjectsByLayer(“Lines2″)
Dim dblDistanceThreshold : dblDistanceThreshold = 2
Dim intcounterConectionsST, intcounterConectionsEnd, intcounterLines
Dim dblDistanceStPt, dblDistanceEndPt
‘Dim arrLines : arrLines = Rhino.PointCoordinates(arrIDLines)
If IsNull(arrIDLines) Then Exit Function

Dim i,j,k
Dim x : x = 0

For i = 0 To Ubound (arrIDLines)
Dim arrLineStPt         : arrLineStPt         = Rhino.CurveStartPoint (arrIDLines(i))
Dim arrLineEndPt        : arrLineEndPt        = Rhino.CurveEndPoint (arrIDLines(i))

intcounterConectionsST = 0
intcounterConectionsEnd = 0
intcounterLines = 0

For j = 0 To Ubound (arrIDLines)

Dim arrLineMidPtOther         : arrLineMidPtOther         = Rhino.CurveMidPoint (arrIDLines(j))

dblDistanceStPt     = Rhino.Distance(arrLineStPt,arrLineMidPtOther )
dblDistanceEndPt    = Rhino.Distance(arrLineEndPt,arrLineMidPtOther )

If dblDistanceStPt < dblDistanceThreshold   Then
If dblDistanceStPt > 0 Then
intcounterConectionsST = intcounterConectionsST + 1
End If
End If

If dblDistanceEndPt < dblDistanceThreshold  Then
If dblDistanceEndPt > 0 Then
intcounterConectionsEnd = intcounterConectionsEnd + 1
End If
End If
Next

Call Rhino.Print(intcounterConectionsST)
Call Rhino.Print(intcounterConectionsEnd)

Dim arrNewLineStPt  : arrNewLineStPt   = array(arrLineStPt(0), arrLineStPt(1), arrLineStPt(2) + (intcounterConectionsST/5))
Dim arrNewLineEndPt : arrNewLineEndPt  = array(arrLineEndPt(0), arrLineEndPt(1), arrLineEndPt(2) + (intcounterConectionsEnd/5))

Dim arrNewLoftLineStPt  : arrNewLoftLineStPt   = array(arrLineStPt(0), arrLineStPt(1), (arrLineStPt(2) + (intcounterConectionsST/5))+ (((intcounterConectionsST/20)*.8)+.1))
Dim arrNewLoftLineEndPt : arrNewLoftLineEndPt  = array(arrLineEndPt(0), arrLineEndPt(1), (arrLineEndPt(2) + (intcounterConectionsEnd/5))+ (((intcounterConectionsEnd/20)*.8)+.1))

Dim strNewLines : strNewLines = Rhino.AddLine (arrNewLineStPt, arrNewLineEndPt)

Dim strNewLoftLines : strNewLoftLines = Rhino.AddLine (arrNewLoftLineStPt, arrNewLoftLineEndPt)

Dim SurfaceLoft : SurfaceLoft = Rhino.AddLoftSrf (array(strNewLines,strNewLoftLines))

‘Call rhino.DeleteObjects(arrIDLines(i))
‘Call rhino.DeleteObjects (arrNewLoftLines(j))

Dim dblLineLength : dblLineLength = Rhino.CurveLength(strNewLines)
Dim dblExtend  : dblExtend  = .2
Dim dblRadious : dblRadious = .1

arrNewLineStPt       = Rhino.CurveStartPoint(strNewLines)
arrNewLineEndPt      = Rhino.CurveEndPoint(strNewLines)
arrNewLoftLineStPt   = Rhino.CurveStartPoint(strNewLoftLines)
arrNewLoftLineEndPt  = Rhino.CurveEndPoint(strNewLoftLines)

‘redraw to xyplane
Dim arrNewLinesxy           : arrNewLinesxy              = Rhino.AddLine (array(x,arrNewLineStPt(2),0), array(x + dblLineLength,arrNewLineEndPt(2),0))

Dim arrNewLoftLinesxy       : arrNewLoftLinesxy          = Rhino.AddLine (array(x,arrNewLoftLineStPt(2),0), array(x + dblLineLength,arrNewLoftLineEndPt(2),0))

‘Dim arrNewLinesxyStSt       : arrNewLinesxyStSt          = Rhino.AddLine (array(x,arrNewLineStPt(2),0),array(x,arrNewLoftLineStPt(2),0))

Dim arrNewLinesxyStSt       : arrNewLinesxyStSt          = Rhino.AddLine (array(x+dblRadious,arrNewLineStPt(2)-dblExtend,0),array(x+dblRadious,arrNewLoftLineStPt(2)+dblExtend,0))

‘Dim arrNewLoftLinesxyEndEnd : arrNewLoftLinesxyEndEnd    = Rhino.AddLine (array(x + dblLineLength,arrNewLineEndPt(2),0),array(x + dblLineLength,arrNewLoftLineEndPt(2),0))

Dim arrNewLoftLinesxyEndEnd : arrNewLoftLinesxyEndEnd    = Rhino.AddLine (array(x-dblRadious + dblLineLength,arrNewLineEndPt(2)-dblExtend,0),array(x-dblRadious + dblLineLength,arrNewLoftLineEndPt(2)+dblExtend,0))

x = x + dblLineLength + intSpread

Dim arrMidPt         : arrMidPt         = Rhino.CurveMidPoint (arrIDLines(i))
Dim arrMidPt2         : arrMidPt2         = Rhino.CurveMidPoint (arrNewLinesxy)

‘label peices and corresponding point in plan
Dim strText : strText = Rhino.AddText (CStr(i), array(arrMidPt(0),arrMidPt(1)+ .01,0),.1)
Dim strText2 : strText2 = Rhino.AddText (CStr(i), array(arrMidPt2(0),arrMidPt2(1)+ .02    ,0),.03    )

Next

End Function