Hi folks, I was just playing with OpenSCAD today to try to learn how it works. So, just for grins, I created a Dragon Curve model to see how well recursion would work for making moderately complicated 3D prints. (I didn't actually write it recursive but that's neither here nor there.) I was able to go 13 steps to model an 8192 element curve maybe 3 or 4 inches wide altogether. But when I took another step to a 16384 element model I got a segmentation fault on my 4 GB machine. Now I shouldn't complain about that since it was my own damn fault for trying such a thing. Still if OpenSCAD data structures are so large that a few 10s or 100s of thousands of them can blow out a 4 Gig machine, it is going to severely limit its utility in the future. I don't know if this is related to the MPFR versus hardware floatingpoint thing. If so, as I promised not to belabor that point, forget it. But I thought you should know. Dan 
Administrator

On Jun 19, 2010, at 05:19 AM, Dan Zuras 3D wrote:
> I was able to go 13 steps to model an 8192 element > curve maybe 3 or 4 inches wide altogether. But when > I took another step to a 16384 element model I got a > segmentation fault on my 4 GB machine. > The OpenSCAD data structures themselves are relatvely compact, but I have no idea what kind of monster is being build by the CGAL library while performing CSG calculations.. You might have triggered a bug unrelated to memory usage, so please post your model in question (or try with the latest svn sources which catch more typical exceptions thrown by CGAL). ~/= Marius  We are Elektropeople for a better living. 
> Subject: Re: [OpenSCAD] OpenSCAD only for small things?
> From: Marius Kintel <[hidden email]> > Date: Sun, 27 Jun 2010 03:43:47 +0200 > To: Dan Zuras 3D <[hidden email]>, > [hidden email] > > On Jun 19, 2010, at 05:19 AM, Dan Zuras 3D wrote: > > > I was able to go 13 steps to model an 8192 element > > curve maybe 3 or 4 inches wide altogether. But when > > I took another step to a 16384 element model I got a > > segmentation fault on my 4 GB machine. > >=20 > > The OpenSCAD data structures themselves are relatvely compact, but I = > have no idea what kind of monster is being build by the CGAL library = > while performing CSG calculations.. > > You might have triggered a bug unrelated to memory usage, so please post = > your model in question (or try with the latest svn sources which catch = > more typical exceptions thrown by CGAL). > > ~/=3D Marius > >  > We are Elektropeople for a better living. > Thank you. It is just a doodle, really. I was only exploring how things work. I discovered that OpenSCAD will not allow recursion with it. So I wrote down the recursion directly. As is, the code works. Uncomment the routine at the bottom to reveal the problem. Even the working version takes a lot of time & memory. Not something I expected for something so small. Well, small relative to the abilities of such a machine, anyway. Good luck, Dan module dragon1(s) union() { scale([1/10,1/10]) circle(r = 2*s); translate([0,s/5]) square([s,2*s/5]); translate([s,0]) scale([1/10,1/10]) circle(r = 2*s); } module dragon2(s) union() { dragon1(s); translate([s,s]) rotate(a = [0,0,90]) dragon1(s); } module dragon4(s) union() { dragon2(s); translate([0,2*s]) rotate(a = [0,0,90]) dragon2(s); } module dragon8(s) union() { dragon4(s); translate([2*s,2*s]) rotate(a = [0,0,90]) dragon4(s); } module dragon16(s) union() { dragon8(s); translate([4*s,0]) rotate(a = [0,0,90]) dragon8(s); } module dragon32(s) union() { dragon16(s); translate([4*s,4*s]) rotate(a = [0,0,90]) dragon16(s); } module dragon64(s) union() { dragon32(s); translate([0,8*s]) rotate(a = [0,0,90]) dragon32(s); } module dragon128(s) union() { dragon64(s); translate([8*s,8*s]) rotate(a = [0,0,90]) dragon64(s); } module dragon256(s) union() { dragon128(s); translate([16*s,0]) rotate(a = [0,0,90]) dragon128(s); } module dragon512(s) union() { dragon256(s); translate([16*s,16*s]) rotate(a = [0,0,90]) dragon256(s); } module dragon1024(s) union() { dragon512(s); translate([0,32*s]) rotate(a = [0,0,90]) dragon512(s); } module dragon2048(s) union() { dragon1024(s); translate([32*s,32*s]) rotate(a = [0,0,90]) dragon1024(s); } module dragon4096(s) union() { dragon2048(s); translate([64*s,0]) rotate(a = [0,0,90]) dragon2048(s); } module dragon8192(s) union() { dragon4096(s); translate([64*s,64*s]) rotate(a = [0,0,90]) dragon4096(s); } //module dragon16384(s) union() { // dragon8192(s); // translate([0,128*s]) rotate(a = [0,0,90]) dragon8192(s); //} translate([30,10]) dragon8192(1); // dragon16384(1); 
Free forum by Nabble  Edit this page 