PySpace icon indicating copy to clipboard operation
PySpace copied to clipboard

How to increase the transformation amount

Open coalaura opened this issue 6 years ago • 2 comments

I would like to render some of the fractals in more detail (More transformations) how would i do that?

coalaura avatar Nov 17 '19 02:11 coalaura

I have found that increasing the number of iterations makes the fractals more detailed. For example, in the Menger Sponge, this is the original code

obj = Object()

for _ in range(8):

    obj.add(FoldAbs())

    obj.add(FoldMenger())

    obj.add(FoldScaleTranslate(3, (-2,-2,0)))

    obj.add(FoldPlane((0,0,-1.0), -1.0))

obj.add(Box(2.0, color=(.2,.5,1)))

return obj

and here is a much more detailed piece.

obj = Object()

for _ in range(16):

    obj.add(FoldAbs())

    obj.add(FoldMenger())

    obj.add(FoldScaleTranslate(3, (-2,-2,0)))

    obj.add(FoldPlane((0,0,-1.0), -1.0))

obj.add(Box(2.0, color=(.2,.5,1)))

return obj

Notice how the 8 was made into 16.. That makes the amount of iterations of the fractal increase. Note that due to certain problems, when zoomed in enough, you can't add any more iterations. I'm not exactly sure how one could fix that issue though.

MCGamer00000 avatar Nov 30 '19 20:11 MCGamer00000

I know there are perturbation methods for zooming on 2d mandelbrot, not sure exactly how those translate to these fractals though. I think you would need to work out the math for these specific ones to implement deeper zooms

ksgustafson avatar Aug 06 '20 20:08 ksgustafson