61 lines
1,010 B
OpenSCAD
61 lines
1,010 B
OpenSCAD
use <scad-common.scad>;
|
|
|
|
module display(view) {
|
|
$sc_view=view;
|
|
children();
|
|
}
|
|
|
|
module view(view) {
|
|
if($sc_view == undef || $sc_view == view) {
|
|
children();
|
|
}
|
|
}
|
|
|
|
module display_if(view) {
|
|
if($sc_view == view) {
|
|
children();
|
|
}
|
|
}
|
|
|
|
module vmove(x=0,y=0,z=0) {
|
|
if($sc_view == undef || $sc_view == view) {
|
|
move(x,y,z) children();
|
|
} else {
|
|
children();
|
|
}
|
|
}
|
|
|
|
module side_view() {
|
|
view("side") rotate([0,0,90]) rotate([90,0,0]) children();
|
|
|
|
}
|
|
|
|
module top_view() {
|
|
view("top") children();
|
|
}
|
|
|
|
module front_view() {
|
|
view("front") rotate([90,0,0]) flip_z() children();
|
|
}
|
|
|
|
module vextrude(h=0) {
|
|
if($sc_view==undef) {
|
|
linear_extrude(h) children();
|
|
} else {
|
|
children();
|
|
}
|
|
}
|
|
|
|
module view_axis() {
|
|
square([20,1]);
|
|
move(x=20) text("x");
|
|
square([1,20]);
|
|
move(y=20) text("y");
|
|
move(z=10) square([1,1]);
|
|
}
|
|
|
|
module display_axis() {
|
|
front_view() color("blue") view_axis();
|
|
side_view() color("red") view_axis();
|
|
top_view() view_axis();
|
|
}
|