weave this by jonbailey
March.4.2009, 4:42 pm
Filed under: Script

weave_03

Rhino VisualBasic Script – Weaving Structure ((needs modified)). Psuedo code for our structural rvb script is in the works. – Jon.

Option Explicit
‘Script written by
‘Script copyrighted by
‘Script version 10 May 2008 22:03:20
Call Main()
Sub Main()
‘input
Dim strsurface
strsurface = Rhino.GetObject(“sel my surface”)
If isNull (strsurface) Then Exit Sub
‘direction input!!!
Dim ptBase, ptEnd
ptBase = Rhino.GetPoint(“” sel the base point “)
If isNull (ptBase) Then Exit Sub
ptEnd = Rhino.GetPoint(” sel the base point”)
If isNull (ptEnd) Then Exit Sub
‘declare variables
Dim udom1, vdom1, uparam1, vparam1, arrpt1
Dim i, j, y, udiv1, vdiv1
‘the divisions on the surface
udiv1 = 30
vdiv1 = 30
‘here i create my array
ReDim colec2d1(udiv1, vdiv1)
‘here i am capturing the domain of the surface
udom1 = Rhino.SurfaceDomain(strsurface,0)
vdom1 = Rhino.SurfaceDomain(strsurface,1)
‘my nested looping
For i = 0 To udiv1
For j = 0 To vdiv1
uparam1 = udom1(0) + i * ((udom1(1) – udom1(0))/udiv1)
vparam1 = vdom1(0) + j * ((vdom1(1) – vdom1(0))/vdiv1)
‘here i transform to the R2 dimension to R3 dimension
arrpt1 = Rhino.EvaluateSurface(strsurface, array(uparam1, vparam1))
‘store the array
colec2d1(i,j) = arrpt1
Next
Next
‘declare sec variables
Dim udom, vdom, uparam, vparam, arrpt
Dim udiv, vdiv
‘the divisions on the surface
udiv = 300
vdiv = 300
‘here i create my array
ReDim colec2d(udiv, vdiv)
‘here i am capturing the domain of the surface
udom = Rhino.SurfaceDomain(strsurface,0)
vdom = Rhino.SurfaceDomain(strsurface,1)
‘my nested looping
For i = 0 To udiv
For j = 0 To vdiv
uparam = udom(0) + rnd * (udom(1) – udom(0))
vparam = vdom(0) + rnd * (vdom(1) – vdom(0))
‘here i transform to the R2 dimension to R3 dimension
arrpt = Rhino.EvaluateSurface(strsurface, array(uparam, vparam))
‘store the array
colec2d(i,j) = arrpt
Next
Next
Dim colec1, colec2a
For j = 0 To vdiv1 – 1
‘colec of two points
colec1 = array (colec2d1(0,j), colec2d1(udiv1,j))
Dim curve1: curve1 = micrv1(strsurface, colec1)
Call crazypipes1(curve1, ptBase, ptEnd)
Next
Dim colec, colec2
For j = 0 To vdiv – 1
‘colec of two points
colec = array (colec2d(0,j), colec2d(udiv,j))
Dim curve: curve = micrv(strsurface, colec)
Call crazypipes(curve, ptBase, ptEnd)
Next
Call rhino.deleteobject (strsurface)
End Sub
Function micrv1(strsurface, colec1)
Dim curve1: curve1 = Rhino.AddInterpCrvOnSrf (strsurface, colec1)
micrv1 = curve1
End Function
Function crazypipes1(crv, bs, en)
Dim dom, param, arrpt, i
arrpt = Rhino.DivideCurve(crv, 10, False)
ReDim colecCrv(Ubound(arrpt))
For i = 0 To Ubound(arrpt)
Dim dblParameter: dblParameter = Rhino.CurveClosestPoint (crv, arrpt(i))
Dim plane: plane = Rhino.CurvePerpFrame (crv, dblParameter)
Dim angle: angle = rhino.Angle2(array(bs, en), array(bs, arrpt(i)))
Rhino.print (angle(0))
If angle(0) < 60 Then
colecCrv(i) = Rhino.AddCircle (plane, angle(0)*0.01)
Else
colecCrv(i) = Rhino.AddCircle(plane, angle(0)*0.01)
End If
Next
If IsArray (colecCrv) Then
Call Rhino.AddLoftSrf(colecCrv)
End If
End Function
Function micrv(strsurface, colec)
Dim curve: curve = Rhino.AddInterpCrvOnSrf (strsurface, colec)
micrv = curve
End Function
Function crazypipes(crv, bs, en)
Dim dom, param, arrpt, i
arrpt = Rhino.DivideCurve(crv, 10, False)
ReDim colecCrv(Ubound(arrpt))
For i = 0 To Ubound(arrpt)
Dim dblParameter: dblParameter = Rhino.CurveClosestPoint (crv, arrpt(i))
Dim plane: plane = Rhino.CurvePerpFrame (crv, dblParameter)
Dim angle: angle = rhino.Angle2(array(bs, en), array(bs, arrpt(i)))
Rhino.print (angle(0))
If angle(0) < 60 Then
colecCrv(i) = Rhino.AddCircle (plane, 0.1*angle(0))
Else
colecCrv(i) = Rhino.AddCircle(plane, 0.1*angle(0))
End If
Next
If IsArray (colecCrv) Then
Call Rhino.AddLoftSrf(colecCrv)
End If
End Function

weave_04

Advertisements

2 Comments so far
Leave a comment

This weaving process is what we now show on our literal model, and was the original weaving idea for the structure. The end result of how our new weaving process takes place, should we choose the weaving process by the bending of steel strips, will be structural different. This script does not take into account the amount of strain being placed on structure; which our structure will address, as it informs the density of the weave. Areas of the “path”, where low amounts of load are, will be less dense in structure; this rendering does not show that.

Comment by jonbailey

diggin it

Comment by lowder




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s



%d bloggers like this: