[OpenSCAD] eval( ) ???

doug moen doug at moens.org
Tue May 12 22:17:20 EDT 2015


My feeling is that it's more important to have first class function
values, and eval() is a poor substitute.

FWIW, first class function values is part of the set of changes that I
am currently discussing with Marius.

Doug Moen.

On 12/05/2015, runsun <runsun at gmail.com> wrote:
> What do you guys think to have an eval() to evaluate code ?I am thinking
> that
> this would help in area where "function as a variable"  is needed, which
> openscad can't do.For example, we can have a module call Line from point P
> to Q :
>
>> module Line ( [P,Q],
> *
>> formula="sin(x)"
> *
>> ,
> *
>> scope=["x",[0,90,180,270]]
> *
>>   ){      formula to be converted to points :     points0 =
> *
>> eval( formula, scope )
> *
>>     (some other processings to use points0): points = ....    faces= ....
>>
>> polyhedron( points= points, faces=faces)}
>
> Once this is set, we can have all kinds of different shapes of Lines,
> generating from this single Line module.
>
>
>
>
> -----
>
> $  Runsun Pan, PhD
>
> $ -- OpenScad_DocTest: doc and unit test ( Github , Thingiverse  )
>
> $ -- hash parameter model: here , here
>
> $ -- Linux Mint 17.1 Rebecca x64  + OpenSCAD 2015.03.15/2015.04.01.nightly
>
>
>
>
> --
> View this message in context: http://forum.openscad.org/eval-tp12627.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list