Grasshopper

algorithmic modeling for Rhino

Metaballs evaluated with new fields components and tiny custom script. Refined (just a little) with weaverbird. Initial mesh obtained with 3d convex hull (avaible with Starling).

Views: 744

Comment

You need to be a member of Grasshopper to add comments!

Comment by Andrew Heumann on August 21, 2012 at 12:58pm

Aha, the scaling was the step I was missing. I'll play around with this. All in all a pretty cool script - you've opened my eyes to the possibilities of scripting the field components!

Comment by Mateusz Zwierzycki on August 20, 2012 at 6:05pm

@Andrew : I use points from charges to generate initial 3d convex hull. Then its subdivided with split polygons wb component. You need to scale hull a little (1.2-1.5) to put vertices in some distance to charges.

Comment by Andrew Heumann on August 20, 2012 at 11:34am

Are you using the same points for the point charges as you are for your convex hull?

Comment by Mateusz Zwierzycki on August 20, 2012 at 12:08am

Hi Andrew, this is the code of custom component. You just need to provide initial mesh vertices (here subdivided convex hull) as P input. The "fac" and force.length values are really small and really sensitive, so youll probably need to play with it more.

Private Sub RunScript(ByVal F As Object, ByVal P As List(Of Point3d), ByVal fac As Object, ByVal run As Object, ByVal stopat As Object, ByRef A As Object)

If run = True Then
If counter = 0 Then
field.Elements.Addrange(f)
actpt.AddRange(p)
End If

For i As Integer = 0 To actpt.Count - 1 Step 1
Dim force As New Vector3d
force += field.SolveStep(actpt(i), fac, gh_differentialsolver.euler)
If force.Length * 1000 < stopat Then
actpt(i) -= (force * fac)
Else If force.length * 900 > stopat
actpt(i) += (force * fac)
Else

End If
Next
A = actpt
counter += 1
Else
counter = 0
field.Elements.Clear
actpt.Clear
A = p
End If
End Sub

'<Custom additional code>
Dim field As New GH_Field
Dim actpt As New List (Of point3d)
Dim counter As Integer
Dim somevec As New vector3d(0, 0, 1)
'</Custom additional code>

End Class

Comment by Andrew Heumann on August 19, 2012 at 6:24pm

This is awesome. Are you willing to share the definition?

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service