mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-05 23:17:26 +02:00
Drag chain screw positions no longer mirrored to allow teardrop holes.
Previously the lugs were mirrored but that caused mirrored teardrops in mating parts.
This commit is contained in:
@@ -88,16 +88,11 @@ module drag_chain_screw_positions(type, end) { //! Place children at the screw p
|
|||||||
R = os.z / 2;
|
R = os.z / 2;
|
||||||
x0 = end ? R + norm([drag_chain_cam_x(type), R - drag_chain_twall(type)]) + clearance + r : r;
|
x0 = end ? R + norm([drag_chain_cam_x(type), R - drag_chain_twall(type)]) + clearance + r : r;
|
||||||
x1 = end ? os.x - r : os.x - 2 * R - clearance - r;
|
x1 = end ? os.x - r : os.x - 2 * R - clearance - r;
|
||||||
for(i = [0 : 3]) {
|
for(i = [0 : 3], x = [x0, x1, x0, x1][i], y = [-1, -1, 1, 1][i])
|
||||||
x = i % 2;
|
|
||||||
y = bool2int(i > 1);
|
|
||||||
if(drag_chain_screw_lists(type)[bool2int(end)][i])
|
if(drag_chain_screw_lists(type)[bool2int(end)][i])
|
||||||
translate([(x0 + x1) / 2, 0])
|
translate([x, y * (s.y / 2 + r)])
|
||||||
mirror([x, 0])
|
let($a = [180, 0, 180, 0][i])
|
||||||
mirror([0, y])
|
children();
|
||||||
translate([(x1 - x0) / 2, s.y / 2 + r])
|
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function drag_chain_cam_x(type) = // how far the cam sticks out
|
function drag_chain_cam_x(type) = // how far the cam sticks out
|
||||||
@@ -108,7 +103,6 @@ function drag_chain_cam_x(type) = // how far the cam sticks out
|
|||||||
twall = drag_chain_twall(type)
|
twall = drag_chain_twall(type)
|
||||||
) min(sqrt(max(sqr(cam_r) - sqr(r - twall), 0)), r);
|
) min(sqrt(max(sqr(cam_r) - sqr(r - twall), 0)), r);
|
||||||
|
|
||||||
|
|
||||||
module drag_chain_link(type, start = false, end = false, check_kids = true) { //! One link of the chain, special case for start and end
|
module drag_chain_link(type, start = false, end = false, check_kids = true) { //! One link of the chain, special case for start and end
|
||||||
stl(str(drag_chain_name(type), "_drag_chain_link", start ? "_start" : end ? "_end" : ""));
|
stl(str(drag_chain_name(type), "_drag_chain_link", start ? "_start" : end ? "_end" : ""));
|
||||||
|
|
||||||
@@ -220,7 +214,8 @@ module drag_chain_link(type, start = false, end = false, check_kids = true) { //
|
|||||||
|
|
||||||
if(start || end) {
|
if(start || end) {
|
||||||
drag_chain_screw_positions(type, end)
|
drag_chain_screw_positions(type, end)
|
||||||
screw_lug(drag_chain_screw(type), os.z);
|
rotate($a)
|
||||||
|
screw_lug(drag_chain_screw(type), os.z);
|
||||||
|
|
||||||
if(check_kids) {
|
if(check_kids) {
|
||||||
custom = drag_chain_screw_lists(type)[bool2int(end)] == [0, 0, 0, 0];
|
custom = drag_chain_screw_lists(type)[bool2int(end)] == [0, 0, 0, 0];
|
||||||
@@ -232,7 +227,8 @@ module drag_chain_link(type, start = false, end = false, check_kids = true) { //
|
|||||||
if(start || end)
|
if(start || end)
|
||||||
translate_z(-eps)
|
translate_z(-eps)
|
||||||
drag_chain_screw_positions(type, end)
|
drag_chain_screw_positions(type, end)
|
||||||
poly_cylinder(r = screw_clearance_radius(drag_chain_screw(type)), h = os.z + 2 * eps, center = false);
|
rotate($a)
|
||||||
|
poly_cylinder(r = screw_clearance_radius(drag_chain_screw(type)), h = os.z + 2 * eps, center = false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user