Aug '08 - Aug '09
so, following out midreview (which went very well for me), i've been looking into ways of introducing apertures into the surfaces of my project. our critics suggested "gills" as a method, so i've been hacking away at grasshopper and rhinoscript in an attempt to make it work...
so far, i've got a decent rhinoscript that does what i want it to:
it takes two curves with an equal number of control points, and draws a new curve with most of the points from curve1, substituting every Nth point from curve2.
which is great, and with a little elbow grease i can get something like this:
so, that's all well and good, but i wish i could control it parametrically, and i'm intrigued by Grasshopper's new support of VB script... which, unfortunately, i know nothing about.
so, i've posted to the google grasshopper group in hopes of getting this figured out, but i wonder if anyone here has a little more experience in this....
my main issue is translating my working rhinoscript into a working VB component in GH....
here's the rhinoscript that generated the images above... if anyone has any ideas how to get this working in VB please let me know, or join the discussion on the GH google group....
Dim strCrv1 : strCrv1 = Rhino.GetObject("Pick Curve 1", 4, True)
If IsNull(strCrv1) Then Exit Sub
If Rhino.IsCurveClosed(strCrv1) Then Exit Sub
Dim strCrv2 : strCrv2 = Rhino.GetObject("Pick Curve 2", 4, True)
If IsNull(strCrv2) Then Exit Sub
If Rhino.IsCurveClosed(strCrv2) Then Exit Sub
Dim strCrv3 : strCrv3 = DrawCurve3(strCrv1, strCrv2)
Function DrawCurve3(ByVal strCrv1, ByVal strCrv2)
Dim arrCrv1pts : arrCrv1pts = Rhino.CurvePoints(strCrv1)
Dim arrCrv2pts : arrCrv2pts = Rhino.CurvePoints(strCrv2)
Dim arrCrv3pts : arrCrv3pts = arrCrv1pts
Dim N : N=5
For i = 1 To UBound(arrCrv2pts) - 1
Dim iOverN : iOverN = (i/n)
Dim intiOverN : intiOverN = Int(iOverN)
If intiOverN = iOverN Then
arrCrv3pts(i) = arrCrv2pts(i)
arrCrv3pts(i) = arrCrv1pts(i)
strCrv3 = Rhino.AddCurve (arrCrv3pts, 2)