mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2025-03-29 22:50:51 -04:00
Added groove to linear_rail.
This commit is contained in:
parent
ad719dad5a
commit
a487ca0f20
@ -133,20 +133,36 @@ module rail(type, length) { //! Draw the specified rail
|
|||||||
vitamin(str("rail(", type[0], ", ", length, "): Linear rail ", type[0], " x ", length, "mm"));
|
vitamin(str("rail(", type[0], ", ", length, "): Linear rail ", type[0], " x ", length, "mm"));
|
||||||
|
|
||||||
color(grey90) {
|
color(grey90) {
|
||||||
linear_extrude(height = height - rail_bore_depth(type)) difference() {
|
linear_extrude(height - rail_bore_depth(type)) difference() {
|
||||||
square([length, width], center = true);
|
square([length, width], center = true);
|
||||||
|
|
||||||
rail_hole_positions(type, length)
|
rail_hole_positions(type, length)
|
||||||
circle(d = rail_hole(type));
|
circle(d = rail_hole(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
translate_z(rail_height(type) - rail_bore_depth(type))
|
translate_z(rail_height(type) - rail_bore_depth(type)) {
|
||||||
linear_extrude(height = rail_bore_depth(type)) difference() {
|
h1 = rail_bore_depth(type) > 2 ? rail_bore_depth(type) / 3 : rail_bore_depth(type) / 2;
|
||||||
square([length, width], center = true);
|
h0 = rail_bore_depth(type) > 2 ? (rail_bore_depth(type) - h1) / 2 : 0;
|
||||||
|
h2 = rail_bore_depth(type) - h1 - h0;
|
||||||
|
|
||||||
|
linear_extrude(h0) difference() {
|
||||||
|
square([length, width], center = true);
|
||||||
rail_hole_positions(type, length)
|
rail_hole_positions(type, length)
|
||||||
circle(d = rail_bore(type));
|
circle(d = rail_bore(type));
|
||||||
}
|
}
|
||||||
|
translate_z(h0)
|
||||||
|
linear_extrude(h1) difference() {
|
||||||
|
w1 = max(width - 2, rail_bore(type));
|
||||||
|
square([length, w1], center = true);
|
||||||
|
rail_hole_positions(type, length)
|
||||||
|
circle(d = rail_bore(type));
|
||||||
|
}
|
||||||
|
translate_z(h0 + h1)
|
||||||
|
linear_extrude(h2) difference() {
|
||||||
|
square([length, width], center = true);
|
||||||
|
rail_hole_positions(type, length)
|
||||||
|
circle(d = rail_bore(type));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user