scaddy/utils.scad
Tony Tkacik 85ceeaee95 Initial Drop of Scaddy.
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
2017-12-01 13:55:57 +01:00

33 lines
722 B
OpenSCAD

include <config.scad>;
function circle_details(r) = max(CURVE_POLYGON_MINIMUM,round(3.1415*r*2/CURVE_POLYGON_LENGTH));
function select(sel,vec) = [ for (i=sel) vec[i]];
function default(val,comp) = val != undef ? val : comp;
module construct() {
module construct_get(name) {
$construct_get=name;
children();
}
difference() {
construct_get("add") children();
construct_get("remove") children();
}
}
module add() {
//check_parent("construct_get", "add", "could be used only as child of construct()");
if($construct_get=="add")
children();
}
module remove() {
echo("remove",parent_module(1));
if($construct_get=="remove")
children();
}