[OpenSCAD] Computing polygon by function?

William Adams william_a_adams at msn.com
Tue Aug 23 00:36:02 CEST 2011


My method for dealing with this in OpenScad has been to essentially create the solids within methods directly. For example, you might run into the same challenge for creating curves, like Bezier surfaces.  Rather than generating the vertices, and then generating the surface in a generic way, I just create the surface right there and then in the module that generates the vertex information. Other than that, What Giles lists in OpenScad is exactly what you need.   I've wanted that feature for a long time, but recently, I've kind of had a change of heart. Although it would be extremely beneficial to be able to do things like generate curves, and then feed them to a generic curve drawing routine, I have a different constraint I'm trying to live by. When you have the ability to extend your arrays to arbitrary lengths, you then have an inability to constrain the environment.  So, if I were to implement an OpenScad parser/renderer in firmware on a printer directly, for instance, having those wide open arrays might be a bit of a problem.  You don't really solve it by eliminating the capability as you can still generate infinite amounts of data in other ways, but it does make one thing that much simpler. At any rate, no way to do it in OpenScad directly, but you can get around it fairly easily by generating your curves/surfaces directly. -- William

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

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



http://internationalwilliam.spaces.msn.com/

 > Date: Mon, 22 Aug 2011 23:21:32 +0100
> From: giles.bathgate at gmail.com
> To: openscad at rocklinux.org
> Subject: Re: [OpenSCAD] Computing polygon by function?
> 
> On 22 August 2011 21:40, Michael Reifenberger <mike at reifenberger.com> wrote:
> > Hi,
> > thanks to all who replied so far!
> >
> > Unfortunately the quick-and-dirty way of generating the pre-calculated polygon
> > by matlab/octave/excel is exactly that what I wanted to avoid.
> > I want to keep the logic self-contained and flexible to be able to adapt
> > the solids for many different dimentions quickly.
> 
> Well there is always RapCAD, I have just implemented a concatenate (~)
> operator so you can for example do this:
> 
> function foo(){
>   r=[];
>   for(i=[0:5])
>   	r=r~[i];
> 
>   return r;
> }
> 
> echo(foo());
> 
> output:
> 
> [0,1,2,3,4,5]
> 
> Regards
> 
> Giles
> _______________________________________________
> 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/20110823/dc1e8a61/attachment.html


More information about the OpenSCAD mailing list