discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

a stupid syntax error I can't see

DR
Drew Rogge
Sat, Aug 6, 2016 11:12 PM

What version of OpenSCAD are you using? The following works on version 2015.03-1 on a Mac:

module rfsphere(counter,geometry,growth,xoffset,yoffset,size)
{
if(counter>0)
{
angle = (360/geometry);
ratio = (1 / (geometry / 2));
newcounter = counter - 1;
newgeometry = geometry + growth;
newsize = size * ratio;
for(i=[1:1:geometry])
{
xoffset = xoffset + (size * sin(anglei));
yoffset = yoffset + (size * cos(angle
i));
translate([xoffset,yoffset,0])
{
sphere(newsize, $fn=100);
}
rfsphere(newcounter, newgeometry, growth, xoffset, yoffset, newsize);
}
}
}

rfsphere(5, 1, 2, 3, 4, 5);

On 8/6/16 3:27 PM, DanS wrote:

Thanks, that gets rid of those syntax errors and I'll try to remember no
assignments inside if statements.

--
View this message in context: http://forum.openscad.org/a-stupid-syntax-error-I-can-t-see-tp18036p18077.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
Drew Rogge
drew@dasrogges.com

Phone: 8934OOO629OO4829631OOOOOOO

What version of OpenSCAD are you using? The following works on version 2015.03-1 on a Mac: module rfsphere(counter,geometry,growth,xoffset,yoffset,size) { if(counter>0) { angle = (360/geometry); ratio = (1 / (geometry / 2)); newcounter = counter - 1; newgeometry = geometry + growth; newsize = size * ratio; for(i=[1:1:geometry]) { xoffset = xoffset + (size * sin(angle*i)); yoffset = yoffset + (size * cos(angle*i)); translate([xoffset,yoffset,0]) { sphere(newsize, $fn=100); } rfsphere(newcounter, newgeometry, growth, xoffset, yoffset, newsize); } } } rfsphere(5, 1, 2, 3, 4, 5); On 8/6/16 3:27 PM, DanS wrote: > Thanks, that gets rid of those syntax errors and I'll try to remember no > assignments inside if statements. > > > > -- > View this message in context: http://forum.openscad.org/a-stupid-syntax-error-I-can-t-see-tp18036p18077.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Drew Rogge drew@dasrogges.com Phone: 8934OOO629OO4829631OOOOOOO
D
DanS
Sat, Aug 6, 2016 11:16 PM

2014.03

I should probably update
Trying to debug it as it isn't doing what I wanted (found a bunch of
mistakes so far, recursion is always messy though).

--
View this message in context: http://forum.openscad.org/a-stupid-syntax-error-I-can-t-see-tp18036p18079.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

2014.03 I should probably update Trying to debug it as it isn't doing what I wanted (found a bunch of mistakes so far, recursion is always messy though). -- View this message in context: http://forum.openscad.org/a-stupid-syntax-error-I-can-t-see-tp18036p18079.html Sent from the OpenSCAD mailing list archive at Nabble.com.
DR
Drew Rogge
Sun, Aug 7, 2016 1:28 AM

Yeah, upgrading would be a good thing. I think you could do what you're trying to do by using the
"assign" statement in the version you're using. The assign statement has been deprecated in later versions so it's probably best to not start using it.

On 8/6/16 4:16 PM, DanS wrote:

2014.03

I should probably update
Trying to debug it as it isn't doing what I wanted (found a bunch of
mistakes so far, recursion is always messy though).

--
View this message in context: http://forum.openscad.org/a-stupid-syntax-error-I-can-t-see-tp18036p18079.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
Drew Rogge
drew@dasrogges.com

Phone: 8934OOO629OO4829631OOOOOOO

Yeah, upgrading would be a good thing. I think you could do what you're trying to do by using the "assign" statement in the version you're using. The assign statement has been deprecated in later versions so it's probably best to not start using it. On 8/6/16 4:16 PM, DanS wrote: > 2014.03 > > I should probably update > Trying to debug it as it isn't doing what I wanted (found a bunch of > mistakes so far, recursion is always messy though). > > > > -- > View this message in context: http://forum.openscad.org/a-stupid-syntax-error-I-can-t-see-tp18036p18079.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Drew Rogge drew@dasrogges.com Phone: 8934OOO629OO4829631OOOOOOO
D
DanS
Sun, Aug 7, 2016 2:56 AM

After debugging I can get fractals and quazi fractals out of the code.  Some
of them look rather odd:

http://forum.openscad.org/file/n18081/quazifractal.png

--
View this message in context: http://forum.openscad.org/a-stupid-syntax-error-I-can-t-see-tp18036p18081.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

After debugging I can get fractals and quazi fractals out of the code. Some of them look rather odd: <http://forum.openscad.org/file/n18081/quazifractal.png> -- View this message in context: http://forum.openscad.org/a-stupid-syntax-error-I-can-t-see-tp18036p18081.html Sent from the OpenSCAD mailing list archive at Nabble.com.