discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] Please can you make this fractal recursive for me?

P
Parkinbot
Sun, Dec 18, 2016 3:15 AM

Here is some nicer code. Now your basic object to enter recursion is the
cylinder primitive.
Do you want each tetraeder to grow into each direction in such a way?

$fn=3;
f();
module f(w = 100)
{
h = w*(1+1/3);  // regular tetraeder
rotate([0, 0, 60])
cylinder(h, 0, w, center = true);
for (i=[0:10])
let(pf = pow(1.5,i))
translate([0, 0, h/2*(1/pf-1)])
cylinder(h/pf,w/pf, 0);
}

--
View this message in context: http://forum.openscad.org/Please-can-you-make-this-fractal-recursive-for-me-tp19607p19621.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Here is some nicer code. Now your basic object to enter recursion is the cylinder primitive. Do you want each tetraeder to grow into each direction in such a way? > $fn=3; > f(); > module f(w = 100) > { > h = w*(1+1/3); // regular tetraeder > rotate([0, 0, 60]) > cylinder(h, 0, w, center = true); > for (i=[0:10]) > let(pf = pow(1.5,i)) > translate([0, 0, h/2*(1/pf-1)]) > cylinder(h/pf,w/pf, 0); > } -- View this message in context: http://forum.openscad.org/Please-can-you-make-this-fractal-recursive-for-me-tp19607p19621.html Sent from the OpenSCAD mailing list archive at Nabble.com.