3d-printing/tapo-ceiling-mount/tapo_ceiling_nut_fit_test.scad

69 lines
2.7 KiB
OpenSCAD

// ============================================
// Tapo Ceiling Mount - Nut Fit Test
// ============================================
// A small coupon with four captive-nut pockets side by side. Each pocket has
// its own across-flats offset from m4_nut_flats (see fit_test_tols). Notches in
// the front edge number the pockets: 1 notch = pocket 1, 4 notches = pocket 4.
// Each pocket copies the clamp pocket: same boss, wall, depth, lead-in chamfer
// and screw hole.
//
// Print it with the clamp material and settings. Press an M4 nut into each
// pocket. Choose the tightest pocket that takes the nut fully (thumb, pliers
// or a screw pull) and holds it upside down. Set nut_pocket_tol to its offset.
//
// Print it the same way as the clamps: pocket mouths on the bed. The exported
// STL (tapo_nut_fit_test_print) is already turned over. The web between the
// bosses prints as short bridges. No support material is needed.
parameters_only = false;
include <tapo_ceiling_mount_parameters.scad>;
/* [Nut Fit Test] */
// Across-flats offsets of pockets 1 to 4 from m4_nut_flats (mm).
fit_test_tols = [-0.25, -0.2, -0.15, -0.1];
// Floor thickness under each pocket (mm).
fit_test_floor = 2; // [1:0.2:4]
// Thickness of the web that joins the bosses (mm). Keep it under the floor so
// the pocket walls stand free, as on the clamp.
fit_test_web_t = 1.2; // [0.6:0.2:2]
ft_n = len(fit_test_tols);
ft_h = fit_test_floor + nut_pocket_depth;
ft_r = clamp_boss_d / 2;
ft_pitch = clamp_boss_d + 3;
ft_front = ft_r + 4;
for (i = [0 : ft_n - 1])
echo(str("Fit test pocket ", i + 1, ": offset ", fit_test_tols[i], " mm, ",
m4_nut_flats + fit_test_tols[i], " mm across flats"));
module tapo_nut_fit_test() {
difference() {
union() {
linear_extrude(fit_test_web_t)
round2d(2)
translate([-ft_r - 2, -ft_front])
square([(ft_n - 1) * ft_pitch + 2 * ft_r + 4, ft_front + ft_r + 2]);
for (i = [0 : ft_n - 1])
translate([i * ft_pitch, 0, 0])
cylinder(d = clamp_boss_d, h = ft_h);
}
for (i = [0 : ft_n - 1])
translate([i * ft_pitch, 0, 0]) {
clamp_nut_cut(m4_nut_flats + fit_test_tols[i], ft_h);
for (k = [0 : i])
translate([(k - i / 2) * 2 - 0.5, -ft_front - 1, -1])
cube([1, 3, fit_test_web_t + 2]);
}
}
}
// The coupon turned over, pocket mouths on the bed, like the printed clamps.
module tapo_nut_fit_test_print() {
intersection() {
translate([0, 0, ft_h - 1e-5]) mirror([0, 0, 1]) tapo_nut_fit_test();
translate([-500, -500, 0]) cube(1000);
}
}
tapo_nut_fit_test();