remove nil and noop

This commit is contained in:
Adrian Mariano 2021-11-15 23:55:57 -05:00
parent 886d316532
commit 6b20232f99
3 changed files with 9 additions and 29 deletions

View file

@ -1885,7 +1885,8 @@ module show_anchors(s=10, std=true, custom=true) {
anchor_arrow(s, color="cyan"); anchor_arrow(s, color="cyan");
} }
color("black") color("black")
noop($tags="anchor-arrow") { // tags("anchor-arrow")
{
xrot(two_d? 0 : 90) { xrot(two_d? 0 : 90) {
back(s/3) { back(s/3) {
yrot_copies(n=2) yrot_copies(n=2)
@ -1897,13 +1898,14 @@ module show_anchors(s=10, std=true, custom=true) {
} }
} }
} }
color([1, 1, 1, 0.4]) color([1, 1, 1, 1])
noop($tags="anchor-arrow") { tags("anchor-arrow")
{
xrot(two_d? 0 : 90) { xrot(two_d? 0 : 90) {
back(s/3) { back(s/3) {
zcopies(s/21) cube([s/4.5*len(anchor[0]), s/3, 0.01], center=true); cube([s/4.5*len(anchor[0]), s/3, 0.01], center=true);
} }
} }
} }
} }
} }
@ -1953,7 +1955,7 @@ module anchor_arrow(s=10, color=[0.333,0.333,1], flag=true, $tags="anchor-arrow"
// Example: // Example:
// anchor_arrow2d(s=20); // anchor_arrow2d(s=20);
module anchor_arrow2d(s=15, color=[0.333,0.333,1], $tags="anchor-arrow") { module anchor_arrow2d(s=15, color=[0.333,0.333,1], $tags="anchor-arrow") {
noop() color(color) stroke([[0,0],[0,s]], width=s/10, endcap1="butt", endcap2="arrow2"); color(color) stroke([[0,0],[0,s]], width=s/10, endcap1="butt", endcap2="arrow2");
} }
@ -1971,7 +1973,7 @@ module anchor_arrow2d(s=15, color=[0.333,0.333,1], $tags="anchor-arrow") {
// expose_anchors() cube(50, center=true) show_anchors(); // expose_anchors() cube(50, center=true) show_anchors();
module expose_anchors(opacity=0.2) { module expose_anchors(opacity=0.2) {
show("anchor-arrow") show("anchor-arrow")
children(); children();
hide("anchor-arrow") hide("anchor-arrow")
color(is_undef($color)? [0,0,0] : color(is_undef($color)? [0,0,0] :
is_string($color)? $color : is_string($color)? $color :

View file

@ -2304,27 +2304,6 @@ module path_text(path, text, font, size, thickness, lettersize, offset=0, revers
// Section: Miscellaneous // Section: Miscellaneous
// Module: nil()
//
// Description:
// Useful when you MUST pass a child to a module, but you want it to be nothing.
module nil() union(){}
// Module: noop()
//
// Description:
// Passes through the children passed to it, with no action at all. Useful while debugging when
// you want to replace a command. This is an attachable non-object.
//
// Arguments:
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#spin). Default: `0`
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#orient). Default: `UP`
module noop(spin=0, orient=UP) attachable(CENTER,spin,orient, d=0.01) {nil(); children();}
// Module: interior_fillet() // Module: interior_fillet()
// //
// Description: // Description:

View file

@ -535,7 +535,6 @@ module npt_threaded_rod(
higbee=r1*PI/2 higbee=r1*PI/2
); );
if (hollow) cylinder(l=l+1, d=size*INCH, center=true); if (hollow) cylinder(l=l+1, d=size*INCH, center=true);
else nil();
} }
children(); children();
} }