algorithmic modeling for Rhino
The intention of the research was to create the Mandelbrot Set by using custom ghPython component in Grasshopper.
Tags:
Albums: Julia Set + Mandelbrot Set
Comment
@Kim. I think comparing a ghPython implementation for fractals with high level engines developed by computer scientists isn't really a fair comparison ;) Those are two different worlds
Hey, since your work, Have you considered doing a generic component for these things? I guess we're talking about a Itereted function system (IFS).
You can use the gh parser and use a function as a parameter.
A quick example in VB:
Private Sub RunScript(ByVal Exp As String, ByVal iter As Integer, ByVal t0 As Double, ByRef A As Object)
Try
Dim pts As New list(Of point3d)
Dim Pt As New point3d(1, 1, 0)
Exp = Exp.Replace(" ", "")
Dim func As String() = Exp.Split(",")
Dim parser As New grasshopper.Kernel.Expressions.GH_ExpressionParser()
Dim i As New Integer
Do While i < iter
parser.ClearVariables()
If Exp.contains("x") Then parser.AddVariable("x", Pt.X)
If Exp.contains("y") Then parser.AddVariable("y", Pt.Y)
If Exp.contains("z") Then parser.AddVariable("z", Pt.Z)
If Exp.contains("i") Then parser.AddVariable("i", i)
If Exp.contains("iter") Then parser.AddVariable("iter", iter)
If Exp.contains("t0") Then parser.AddVariable("t0", t0)
Pt.X = parser.Evaluate(func(0))._Double
Pt.Y = parser.Evaluate(func(1))._Double
Pt.Z = parser.Evaluate(func(2))._Double
pts.add(pt)
i += 1
Loop
A = pts
Catch ex As exception
Print(ex.ToString)
End Try
End Sub
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by
You need to be a member of Grasshopper to add comments!