[OpenSCAD] OpenSCAD Digest, Vol 23, Issue 11

William Adams william_a_adams at msn.com
Sun Oct 23 18:47:43 CEST 2011


But of course RapCAD can do this! It sure would be useful if functions could have bodies, and recursion.  But, plenty can be done without it. You just have to leave typical notions of programming behind, and just do your loops as part of a module, where instead of returning a result, you code up an object directly. Another way OpenScad could be extended is if the child() module could give you access to the various attributes of an object.  In particular the points mesh.  Then I could stuff anything into the points mesh, and read it somewhere else.  This is similar to what GLSL did in the early days where 'texture' was just another name for 'random memory'. -- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams
 

 Date: Sun, 23 Oct 2011 16:55:36 +0100
From: nop.head at gmail.com
To: openscad at rocklinux.org
Subject: Re: [OpenSCAD] OpenSCAD Digest, Vol 23, Issue 11

Surely it's an AP: function toto(k) = (k+1) * k / 2;
But that steps round the issue that there are no loops inside functions.

On 23 October 2011 16:46, Giles Bathgate <giles.bathgate at gmail.com> wrote:

> function toto(k) { return k + 1; }



Syntax error you want:



  function toto(k) = k+1;



Regards



Giles

_______________________________________________

OpenSCAD mailing list

OpenSCAD at rocklinux.org

http://rocklinux.net/mailman/listinfo/openscad




_______________________________________________
OpenSCAD mailing list
OpenSCAD at rocklinux.org
http://rocklinux.net/mailman/listinfo/openscad 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rocklinux.net/pipermail/openscad/attachments/20111023/40388c4e/attachment.html


More information about the OpenSCAD mailing list