Saturday, January 27, 2007
The following is pretty basic script to take a curve to generate a straight line that has the same length with the original curve.
'this script is created to unroll sphere
'so that hopefully I chould unroll little bit advanced shape.
'Shpere should be ready
' -Circumference Max is 8'
' -Trimmed with 0 and 45 degree lines
' -Rebuilt Vertical Surf to U2, Vt
' -Extract wireframe
'Number of Division
t = 8
arrOrigin = array(0,0,0)
Dim halfSphereCircumference1, dblLength
halfSphereCircumference1 = Rhino.GetObject("Select a circumference curve", 4)
If IsNull(halfSphereCircumference1) Then Exit Sub
dblLength = Rhino.CurveLength(halfSphereCircumference1)
Rhino.Print "Curve length: " & CStr(dblLength)
'Draw Line and Divide
Dim strStraight, arrCircumferenceCurvePoints
strStraight = Rhino.AddLine (arrOrigin, array(0,dblLength,0))