diff options
Diffstat (limited to 'body')
| -rw-r--r-- | body/.body.scad.swp | bin | 12288 -> 0 bytes | |||
| -rw-r--r-- | body/body.scad | 45 | ||||
| -rw-r--r-- | body/helpers.scad | 2 | ||||
| -rw-r--r-- | body/holes.scad | 108 | ||||
| -rw-r--r-- | body/m12_lense_holder.scad | 20 | ||||
| -rw-r--r-- | body/m12_lense_holder_adapter.scad | 13 | ||||
| -rw-r--r-- | body/veye_imx287.scad | 151 |
7 files changed, 283 insertions, 56 deletions
diff --git a/body/.body.scad.swp b/body/.body.scad.swp Binary files differdeleted file mode 100644 index 9104a06..0000000 --- a/body/.body.scad.swp +++ /dev/null diff --git a/body/body.scad b/body/body.scad index 6414cde..904c002 100644 --- a/body/body.scad +++ b/body/body.scad @@ -16,15 +16,54 @@ module cam_and_lense() translate([0, 0, $lenseYPosMm]) rotate([-$opticalAxisAngleDegrees, 0, 0]) { + //color("black", 0.6) m12_lense_holder(); %m12_lense(); + //color("red", 0.3) + //%m12_lense_circle(); translate([0, -$lenseSensorDistanceMm, 0]) rotate([$sensorLenseAngleDegrees, 0, 0]) - veye_imx287_natural(); + { + color("yellow", 0.3) + *veye_imx287_natural(); + } + + difference() + { + // outer area + color("blue", 0.8) + hull() + { + + m12_lense_holder_base(); + { + + translate([0, -$lenseSensorDistanceMm, 0]) + rotate([$sensorLenseAngleDegrees, 0, 0]) + veye_imx287_mount_plate_outer(); + } + } + + // inner area to cut + color("red", 0.3) + hull() + { + m12_lense_circle(); + translate([0, -$lenseSensorDistanceMm, 0]) + rotate([$sensorLenseAngleDegrees, 0, 0]) + veye_imx287_mount_plate_inner(); + } + } } } +module cam_and_lense_holder() +{ + color("red", 0.3) + m12_lense_circle(); +} + module camera_hole() { // TODO: calc Y (scanner coords) offset instead of @@ -84,7 +123,7 @@ module visualize_range() xs = $actualXStartMm; xe = $actualXEndMm; - // lense center + // lense center lc = [0, 0, lenseY]; // x start left xsl = [-xs / 2, zBase, 0]; @@ -116,7 +155,7 @@ module visualize_range() //polyhedron(points, faces); - color("red", 0.3) + color("red", 0.4) polyhedron( [lc, xsl, xsr, xel, xer], //[ff, rf, bkf] diff --git a/body/helpers.scad b/body/helpers.scad index 28c246c..428d060 100644 --- a/body/helpers.scad +++ b/body/helpers.scad @@ -1,6 +1,6 @@ use <design.scad> -$tiny_padding = 0.1; +$tiny_padding = 0.01; // calculate cylinder/circle "Fragments Number" based on diameter function diameterToFn(d, mult = 4) = (d * PI * mult); diff --git a/body/holes.scad b/body/holes.scad new file mode 100644 index 0000000..0512fda --- /dev/null +++ b/body/holes.scad @@ -0,0 +1,108 @@ +include <design.scad> +include <helpers.scad> + +// `Heat` in module name means heat brass threaded insert + +// in scanner coords: +// Z facing towards laser beam +// X facing right on laser beam plane +// Y facing top (for scanner body) +hole_side_front = 0; +hole_side_back = 1; +hole_side_top = 2; +hole_side_bottom = 3; +hole_side_left = 4; +hole_side_right = 5; + +// some draft here, don't pay attention: +// id - insert diameter +// il - insert length (unused?) +// m - screw deameter, like M2 +// r - glass corner radius +// hole_side - see hole_side_* values above. affects hole +// initial position. unused here, glass is always facing Z+ +// in scanner coords +// TODO: cleanup unused params +//module glass_hole(id, il, m, r, hole_side) + +// gw - glass width +// gh - glass height +// gt - glass thickness +// gcr - glass corner radius +module glass_hole(gw, gh, gt, gcr) +{ + wt = $scannerBodyWallThicknessMm; + padding_around_glass = 0.4; + padding_under_glass = 1; + + pag = padding_around_glass; + pug = padding_under_glass; + + // visualize glass + color("yellow", 0.5) + hull() + { + for (x_mult = [-1, 1], y_mult = [-1, 1]) + { + translate([ + (-gw / 2 + gcr) * x_mult, + (-gh / 2 + gcr) * y_mult, + 0]) + cylinder($fn = dToFn(gcr * 2), r = gcr, h = gt); + } + } + + // area to cut around glass + // TODO: create a module for such rounded rects + color("blue", 0.5) + hull() + { + w = gw + pag * 2; + h = gh + pag * 2; + // I'm not sure it's needed, but epoxy should + // have some thickness as well, and this padding should + // protect the glass a bit (the glass will not protrude + // from the scanner body) + t = gt + pag + $tiny_padding; + + for (x_mult = [-1, 1], y_mult = [-1, 1]) + { + translate([ + (-w / 2 + gcr) * x_mult, + (-h / 2 + gcr) * y_mult, + // cut without artifacts + -$tiny_padding]) + cylinder($fn = dToFn(gcr * 2), r = gcr, h = t); + } + } + + // area to cut under glass + color("blue", 0.5) + hull() + { + w = gw - pug * 2; + h = gh - pug * 2; + // cut without artifacts + // area in front of glass is already taken + // into account above + t = wt + $tiny_padding; + + for (x_mult = [-1, 1], y_mult = [-1, 1]) + { + translate([ + (-w / 2 + gcr) * x_mult, + (-h / 2 + gcr) * y_mult, + 0]) + cylinder($fn = dToFn(gcr * 2), r = gcr, h = t); + } + } +} + +// see `glass_hole` docs for params details +module front_glass_hole(gw, gh, gt, gcr) +{ + rotate([90, 0, 0]) + glass_hole(gw, gh, gt, gcr); +} + +//front_glass_hole(gw = 26.6, gh = 19.6, gt = 2, gcr = 1);
\ No newline at end of file diff --git a/body/m12_lense_holder.scad b/body/m12_lense_holder.scad index 05ff757..64165a8 100644 --- a/body/m12_lense_holder.scad +++ b/body/m12_lense_holder.scad @@ -20,10 +20,14 @@ $m12_lense_holder_r_hole_offset = [$m12_lense_holder_d_btw_holes / 2, 0, 0]; $m12_lense_holder_lense_hole_diameter = 12; // m12 lense holder without holes -module m12_lense_holder_wo_holes() +// th - height of top round part of m12 lense holder +//module m12_lense_holder_wo_holes(th = $m12_lense_holder_top_h) +module m12_lense_holder_wo_holes( + th = $m12_lense_holder_top_h, + bh = $m12_lense_holder_bottom_h) { $S = $m12_lense_holder_size; - $cube_size = [$S, $S, $m12_lense_holder_bottom_h]; + $cube_size = [$S, $S, bh]; rotate([-90, 0, 0]) { @@ -33,7 +37,7 @@ module m12_lense_holder_wo_holes() // top cylinder translate([0, 0, $cube_size[2]]) - cylinder($fn=diameterToFn($S), h = $m12_lense_holder_top_h, d = $S); + cylinder($fn=diameterToFn($S), h = th, d = $S); // screw holes, outer body to cut from hull() @@ -41,18 +45,24 @@ module m12_lense_holder_wo_holes() translate($m12_lense_holder_l_hole_offset) cylinder( $fn = diameterToFn($m12_lense_holder_sh_outer_d), - h = $m12_lense_holder_bottom_h, + h = bh, d = $m12_lense_holder_sh_outer_d); translate($m12_lense_holder_r_hole_offset) cylinder( $fn = diameterToFn($m12_lense_holder_sh_outer_d), - h = $m12_lense_holder_bottom_h, + h = bh, d = $m12_lense_holder_sh_outer_d); } } } + +module m12_lense_holder_base() +{ + m12_lense_holder_wo_holes(th = 0.001, bh = 0.001); +} + module m12_lense_holder_holes() { rotate([-90, 0, 0]) diff --git a/body/m12_lense_holder_adapter.scad b/body/m12_lense_holder_adapter.scad index 09d7656..bc743a0 100644 --- a/body/m12_lense_holder_adapter.scad +++ b/body/m12_lense_holder_adapter.scad @@ -26,5 +26,16 @@ module m12_lense() cylinder($fn = diameterToFn(d), d = d, h = l); } +module m12_lense_circle() +{ + //d = $lenseBodyMaxDiameterMm; + m12d = 12; + d = m12d; + + rotate([-90, 0, 0]) + cylinder($fn = diameterToFn(d), d = d, h = -$tiny_padding); +} + //m12_lense_holder_to_cut(); -//%m12_lense();
\ No newline at end of file +//%m12_lense(); +//m12_lense_circle();
\ No newline at end of file diff --git a/body/veye_imx287.scad b/body/veye_imx287.scad index 5594c20..ed2c7da 100644 --- a/body/veye_imx287.scad +++ b/body/veye_imx287.scad @@ -6,6 +6,16 @@ veye_imx287_pcb_h = 29; veye_imx287_pcb_thickness = 1.6; veye_imx287_pcb_stack_h = 11; imx287_thickness = 1.3; +veye_imx287_mount_plate_corner_radius = 2; +veye_imx287_mount_plate_thickness = 2; +veye_imx287_mount_plate_frame_w = 6; + +function veye_imx287_mount_plate_offset() = + // sensor has non-zero thickness, so put holder + // closer to pcb (but avoid artifacts) + [0, -imx287_thickness + $tiny_padding, 0] + + // move to zero + [0, veye_imx287_mount_plate_thickness / 2, 0]; module veye_imx287_wo_holes() { @@ -101,16 +111,88 @@ module veye_imx287_natural() } } +module veye_imx287_mount_plate_outer() +{ + w = veye_imx287_pcb_w; + h = veye_imx287_pcb_h; + t = veye_imx287_mount_plate_thickness; + cr = veye_imx287_mount_plate_corner_radius; + + translate(veye_imx287_mount_plate_offset()) + hull() + { + for ( + dx = [w / 2 - cr, -w / 2 + cr], + dy = [h / 2 - cr, -h / 2 + cr]) + { + translate([dx, 0, dy]) + translate([0, t / 2, 0]) + rotate([90, 0, 0]) + cylinder($fn = dToFn(cr * 2), r = cr, h = t); + } + } +} + +// inner area to cut +module veye_imx287_mount_plate_inner() +{ + w = veye_imx287_pcb_w; + h = veye_imx287_pcb_h; + frame_w = veye_imx287_mount_plate_frame_w; + iw = w - frame_w; + ih = h - frame_w; + t = veye_imx287_mount_plate_thickness; + cr = veye_imx287_mount_plate_corner_radius; + + translate(veye_imx287_mount_plate_offset()) + hull() + { + for ( + dx = [iw / 2 - cr, -iw / 2 + cr], + dy = [iw / 2 - cr, -iw / 2 + cr]) + { + translate([dx, 0, dy]) + translate([0, t / 2 + $tiny_padding, 0]) + rotate([90, 0, 0]) + cylinder( + $fn = dToFn(cr * 2), + r = cr, + h = t + $tiny_padding * 2); + } + } +} + +// screw holes +module veye_imx287_mount_plate_holes() +{ + // holes + hd = 2.05; + hh = 10; + + // distance between holes + h_delta = 25; + + translate(veye_imx287_mount_plate_offset()) + for ( + dx = [h_delta / 2, -h_delta / 2], + dy = [h_delta / 2, -h_delta / 2]) + { + translate([dx, 0, dy]) + translate([0, hh / 2, 0]) + rotate([90, 0, 0]) + cylinder($fn = dToFn(hd), d = hd, h = hh); + } +} + module veye_imx287_mount_plate() { w = veye_imx287_pcb_w; h = veye_imx287_pcb_h; - frame_w = 6; + frame_w = veye_imx287_mount_plate_frame_w; iw = w - frame_w; ih = h - frame_w; - t = 2; - corner_radius = 2; - cr = corner_radius; + t = veye_imx287_mount_plate_thickness; + cr = veye_imx287_mount_plate_corner_radius; // holes hd = 2.05; @@ -119,55 +201,32 @@ module veye_imx287_mount_plate() h_delta = 25; hr = hd / 2; - // sensor has non-zero thickness, so put holder - // closer to pcb - translate([0, -imx287_thickness, 0]) - // move to zero - translate([0, t / 2, 0]) difference() { // outer shape - hull() - { - for ( - dx = [w / 2 - cr, -w / 2 + cr], - dy = [w / 2 - cr, -w / 2 + cr]) - { - translate([dx, 0, dy]) - translate([0, t / 2, 0]) - rotate([90, 0, 0]) - cylinder($fn = dToFn(cr * 2), r = cr, h = t); - } - } + veye_imx287_mount_plate_outer(); // to cut - hull() - { - for ( - dx = [iw / 2 - cr, -iw / 2 + cr], - dy = [iw / 2 - cr, -iw / 2 + cr]) - { - translate([dx, 0, dy]) - translate([0, t, 0]) - rotate([90, 0, 0]) - cylinder($fn = dToFn(cr * 2), r = cr, h = t * 2); - } - } + veye_imx287_mount_plate_inner(); // holes - { - for ( - dx = [h_delta / 2, -h_delta / 2], - dy = [h_delta / 2, -h_delta / 2]) - { - translate([dx, 0, dy]) - translate([0, hh / 2, 0]) - rotate([90, 0, 0]) - cylinder($fn = dToFn(hd), d = hd, h = hh); - } - } + veye_imx287_mount_plate_holes(); } } -color("yellow", 0.3) +color("yellow", 0.1) *veye_imx287_natural(); +color("green", 0.4) +*veye_imx287_mount_plate(); + +color("red", 0.1) +%veye_imx287_mount_plate_outer(); color("green", 0.3) -*veye_imx287_mount_plate();
\ No newline at end of file +%veye_imx287_mount_plate_inner(); + +*difference() +{ + //color("brown", 0.4) + veye_imx287_mount_plate_outer(); + //color("blue", 0.4) + veye_imx287_mount_plate_inner(); +} + |
