Grasshopper

generative modeling for Rhino

# Metaballs

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: 704

Tags: metaballs

### Related Videos

Comment

Join Grasshopper

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
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

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)

End Class

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

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

by 雷锋

by 雷锋

by 雷锋

• View All