[OpenSCAD] Questions from a new user

Clifford Wolf clifford at clifford.at
Thu Mar 11 10:34:45 CET 2010


On Thu, Mar 11, 2010 at 08:34:03AM +0000, Giles Bathgate wrote:
> yes there is an undocumented ternary operator the syntax is as you say
> the only thing I have found is sometimes you need extra brackets
> e.g.    (a==1) ? "True" : "False"
> or	(a>7) ? (d/2) : (d/3);

this is a bug. I've fixed that now in the subversion trunk.

I've also added a short description of the operator to the "math operators"
section in the documentation wiki.

> >  Alternatively, is there a function syntax similar to:
> >         function <name>([<formal arguments>]) {
> >           <body>
> >         }
> > where the function body can contain an if-else tree with return
> > <expression> statements?
> I don't think there is yet.

ack. there is nothing like that.

regarding the third question: there is a plan to add an interface to
convert objects and even modules to values. this way we could implement
functions like volume() or boundary() that can analyse an object and return
descriptive values about the object. but this is not implemented atm.

 - clifford

perl -le '$_=1;(1x$_)!~/^(11+)\1+$/&&print${_}while$_++<1000'|fmt

More information about the Openscad mailing list