Grasshopper

algorithmic modeling for Rhino

The intention of the research was to create the Mandelbrot Set by using custom ghPython component in Grasshopper.

Views: 229

Comment

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

Comment by Benjamin Felbrich on October 19, 2016 at 9:24am

@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

Comment by Kim hauer on October 18, 2016 at 7:33pm

I think what you are doing is a great exerciser in understanding the math that produces the Mundelbrot Fractal implementation in ghPython. But it hardly matches even FractalInt I used 20 years ago. Or whats currently capable in the Fractal programming World.

Comment by Daniel González Abalde on October 18, 2016 at 8:10am

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

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service