Grasshopper

algorithmic modeling for Rhino

Hi,
I am trying to get this little VB component to draw a series of curves through the input points, to create a pattern.
the VB component does not work yet, any ideas?
thanks,
Peter

Views: 784

Attachments:

Replies to This Discussion

Not sure what you are exactly trying to do but there are quite a few issues you need to sort out. Could you send a screenshot of what you want to achieve?

Here's a VB that takes a list of curves and outputs a point list that you can send a curve through. Would probably be good to read the second edition primer for a VB intro as you seem to be implementing RhinoScript rather than VB.

Sub RunScript(ByVal divNum As Integer, ByVal arrCrv As List(Of OnCurve))
Dim arrPt As New List (Of On3dPoint)
Dim tStep As Double = 1 / divNum

Dim crv As OnCurve

For Each crv In ArrCrv
'Normalise Domain
crv.SetDomain(0, 1)

For i As Double = 0 To 1 Step tStep
arrPt.Add(crv.PointAt(i))
Next
Next

A = arrPt
End Sub
HI Dirk,

thanks.
actually I was hopeing that I would to embed rhinoscript whithin grasshopper. maybe got that wrong. did a little rhinoscript in the meantime which works ok, but is not ideal ...
I started doing it in grasshopper but ran into problems accessing individual points that where coming out of the "devidecurve" operator and which I am using as control points to feed the curves through ...
any ideas how to do this in grasshopper?!?
thanks,
Peter
Attachments:
Peter,

your elevation seems difficult to understand with relation to a curve interpolating points. Firstly, how did you divide the curves as your point divisions don't seem to be equal? Where are the 6 curves that you originally were referencing?

You can collect points in a list and then access points using the Logic > List Item component. You could also sort the points within a VB script but it's still very vague as to what you're doing.
Hi Dirk,

hope the attached is more clear.
I made a little rhino script which works fine, but would prefer to be able to do it in Grasshopper.

thanks,
Peter
Attachments:
Peter, you basically want to transpose a 2d list. You could even just loft the curves as a surface and extract isocurves from it.

Here's a VB that takes the list of curves and makes a datatree for each point across the curve list.

Sub RunScript(ByVal divNum As Integer, ByVal arrCrv As List(Of OnCurve))
Dim ptTree As New DataTree(Of On3dPoint)

For j As Double = 0 To DivNum
Dim path As New EH_Path(j)
For i As Int32 = 0 To arrCrv.Count() - 1
ptTree.Add(arrCrv(i).PointAt(j / DivNum), path)
Next
Next

A = ptTree

End Sub

Attachments:
Thanks dirk, that works fine!
I used to do the extraction of isocurves method but was looking for better way!
best regards,

Peter

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service