On 2017-10-20 09:29, ashuan wrote:
> <name> = <return value>; // << or return <return value> or result <return
> value> or ...
All OpenSCAD modules can "return" is geometry.
OpenSCAD functions can return values including vectors and strings, but
coding inside functions is rather different to in modules. You'll
probably want to make heavy use of the let () element, and either the ?
: method of choosing what to return or the new ifelse described here.
In OpenSCAD a *module* is generally used to define objects but *functions*
operate on values an return values. So you need a function. Luckily OpenSCAD
already has a built-in function search that we can use in your case. Below
is an example that may be applicable to your situation.