diff options
Diffstat (limited to 'body')
| -rw-r--r-- | body/body.scad | 430 | ||||
| -rw-r--r-- | body/holes.scad | 4 | ||||
| -rw-r--r-- | body/laser_holder.scad | 6 | ||||
| -rw-r--r-- | body/m12_lense_holder.scad | 32 | ||||
| -rw-r--r-- | body/veye_imx287.scad | 25 |
5 files changed, 433 insertions, 64 deletions
diff --git a/body/body.scad b/body/body.scad index 982745a..15faa18 100644 --- a/body/body.scad +++ b/body/body.scad @@ -8,15 +8,135 @@ include <noctua_nf_a4x20.scad> include <radxa_zero_3e.scad> include <veye_imx287.scad> +// main frame size +// in scanner coords +// inner height is a bit random +// TODO: choose constant size to use one frame for +// many similar ranges +main_frame_height_y = 150; +main_frame_width_x = 34; +main_frame_depth_z = 56; + // wall and wall thickness +$sbfwo = $scannerBodyFrontWallOffsetMm; $wawt = -$scannerBodyFrontWallOffsetMm + $scannerBodyWallThicknessMm; +wt = $scannerBodyWallThicknessMm; +wzo = $scannerBodyFrontWallOffsetMm; + +module cam_and_lense_new() +{ + lhs = laser_holder_size(); + + // screw insert diameter + id = 4; + // cam and lense holder mount plate z size (scanner coords) + //calhmpzs = 20; + calhmpzs = 8; + // cam and lense holder mount plate y height (scanner coords) + //calhmpyh = 13; + //calhmpyh = 25.714; + calhmpyh = 20; + // cam and lense holder mount plate z offset (scanner coords) + //calhmpzo = 5.07; + calhmpzo = -0.93; + //tpw = $m12_lense_holder_size; + tpw = veye_imx287_pcb_w; + + color("pink", 0.6) + union() + { + //color("green", 0.3) + difference() + { + //color("blue", 0.3) + hull() + { + translate([0, 0, $lenseYPosMm]) + rotate([-$opticalAxisAngleDegrees, 0, 0]) + translate([0, -$lenseSensorDistanceMm, 0]) + rotate([$sensorLenseAngleDegrees, 0, 0]) + veye_imx287_mount_plate_outer(); + + translate([0, 0, $lenseYPosMm]) + rotate([-$opticalAxisAngleDegrees, 0, 0]) + { + //color("blue", 0.3) + { + + m12_lense_holder_base(); + color("blue", 0.3) + %m12_lense_holder(); + } + } + } + + hull() + translate([0, 0, $lenseYPosMm]) + rotate([-$opticalAxisAngleDegrees, 0, 0]) + { + m12_lense_circle(); + translate([0, -$lenseSensorDistanceMm, 0]) + rotate([$sensorLenseAngleDegrees, 0, 0]) + veye_imx287_mount_plate_inner(); + } + } + + // top part + hull() + { + // lense holder helper + { + //color("red", 0.3) + translate([0, 0, $lenseYPosMm]) + rotate([-$opticalAxisAngleDegrees, 0, 0]) + //translate([0, -$lenseSensorDistanceMm, 0]) + //rotate([$sensorLenseAngleDegrees, 0, 0]) + m12_lense_holder_top(); + } + + // cam holder helper + { + pcb_w = veye_imx287_pcb_w; + pcb_h = veye_imx287_pcb_h; + //color("yellow", 0.5) + translate([0, 0, $lenseYPosMm]) + rotate([-$opticalAxisAngleDegrees, 0, 0]) + translate([0, -$lenseSensorDistanceMm, 0]) + rotate([$sensorLenseAngleDegrees, 0, 0]) + //cube([pcb_w + $tiny_padding * 2, 1, 1]); + veye_imx287_mount_plate_outer_top(); + } + + // wall near body + { + //color("orange", 0.3) + translate([-pcb_w / 2, -$sbfwo, 116]) + rotate([90, 0, 0]) + cube([pcb_w, 14, 1]); + } + } + } +} module cam_and_lense() { + lhs = laser_holder_size(); + + // screw insert diameter + id = 4; + // cam and lense holder mount plate z size (scanner coords) + calhmpzs = 20; + // cam and lense holder mount plate y height (scanner coords) + calhmpyh = 13; + // cam and lense holder mount plate z offset (scanner coords) + calhmpzo = 5.07; + //tpw = $m12_lense_holder_size; + tpw = veye_imx287_pcb_w; + translate([0, 0, $lenseYPosMm]) - rotate([-$opticalAxisAngleDegrees, 0, 0]) + %rotate([-$opticalAxisAngleDegrees, 0, 0]) { - //color("black", 0.6) + //color("orange", 0.6) m12_lense_holder(); %m12_lense(); //color("red", 0.3) @@ -25,12 +145,12 @@ module cam_and_lense() translate([0, -$lenseSensorDistanceMm, 0]) rotate([$sensorLenseAngleDegrees, 0, 0]) { - color("yellow", 0.3) + //color("yellow", 0.3) veye_imx287_natural(); } color("green", 0.5) - difference() + *difference() { // outer area //color("blue", 0.8) @@ -60,6 +180,168 @@ module cam_and_lense() } } } + + color("green", 0.3) + *hull() + { + translate([0, 0, $lenseYPosMm]) + rotate([-$opticalAxisAngleDegrees, 0, 0]) + { + color("green", 0.3) + { + + m12_lense_holder_base(); + { + + translate([0, -$lenseSensorDistanceMm, 0]) + rotate([$sensorLenseAngleDegrees, 0, 0]) + veye_imx287_mount_plate_outer(); + } + } + } + + // cam and lense mount plate + color("red", 0.5) + translate([ + 0, + calhmpzo, + //0, + -$tiny_padding - lhs[2] / 2 + main_frame_height_y]) + cube([ + //veye_imx287_pcb_h / 2, + tpw, + //calhmpzs, + //tpw / 2, + $tiny_padding, + $tiny_padding + ], + center = true); + } + + color("green", 0.3) + *hull() + { + color("red", 0.5) + translate([ + 0, + calhmpzo, + //0, + -$tiny_padding - lhs[2] / 2 + main_frame_height_y]) + cube([ + //veye_imx287_pcb_h / 2, + tpw, + //calhmpzs, + //tpw / 2, + $tiny_padding, + $tiny_padding + ], + center = true); + } + + + // AAAAAAAAAAAAA + //union() + color("blue", 0.3) + hull() + { + translate([0, 0, $lenseYPosMm]) + rotate([-$opticalAxisAngleDegrees, 0, 0]) + translate([0, -$lenseSensorDistanceMm, 0]) + rotate([$sensorLenseAngleDegrees, 0, 0]) + veye_imx287_mount_plate_outer(); + + translate([0, 0, $lenseYPosMm]) + rotate([-$opticalAxisAngleDegrees, 0, 0]) + { + color("blue", 0.3) + { + + m12_lense_holder_base(); + } + } + // second top plate height + stph = 5; + translate([ + 0, + //-4.917, + -3.85, + //0, + -$tiny_padding - lhs[2] / 2 + main_frame_height_y + -stph / 2 + ]) + *cube([ + veye_imx287_pcb_h,// - veye_imx287_mount_plate_corner_radius * 2, + //tpw, + //calhmpzs, + //tpw / 2, + $tiny_padding, + //$tiny_padding + stph + ], + center = true); + } + + { + // cam and lense mount plate + color("orange", 0.5) + translate([ + 0, + calhmpzo, + //0, + -$tiny_padding - + lhs[2] / 2 + + main_frame_height_y - + calhmpyh / 2]) + cube([ + //veye_imx287_pcb_h / 2, + tpw, + //calhmpzs, + //tpw / 2, + //10, 10 + calhmpzs, + //$tiny_padding, + //$tiny_padding + calhmpyh + ], + center = true); + + translate([0, 0, $lenseYPosMm]) + rotate([-$opticalAxisAngleDegrees, 0, 0]) + { + color("red", 0.3) + { + + m12_lense_holder_base(); + } + } + } + + // cam and lense holder screw holes + *union() + { + // multipliers are in scanner coords + for (x_mult = [-1, 1], z = [0, -16]) + { + /*translate([ + -lhs[0] * 1 / 3 * x_mult, + //-lhs[1] / 2 * z_mult +- 4, + z, + -lhs[2] / 2]) + */ + translate([ + veye_imx287_pcb_h / 3 * x_mult, + //calhmpzs / 2, + calhmpzo, + -lhs[2] / 2 + main_frame_height_y]) + screw_hole( + m = m2, + id = id, + il = hole_insert_height * 2, + hd = m2_head_diameter, + hh = m2_head_height, + hs = hole_side_top); + } + } } module cam_and_lense_holder() @@ -79,7 +361,7 @@ module camera_hole() front_glass_hole(gw = 26.6, gh = 19.6, gt = 2, gcr = 1); } -module laser_hole() +module laser_glass_hole() { // TODO: calc Y (scanner coords) offset instead of // hardcoding it @@ -90,6 +372,31 @@ module laser_hole() front_glass_hole(gw = 14, gh = 6, gt = 2, gcr = 1); } +module laser_holder_screw_holes() +{ + lzo = -$laserZOffsetMm; + ll = $laserBodyLengthMm; + lhs = laser_holder_size(); + id = 4; + + // multipliers are in scanner coords + for (x_mult = [-1, 1], z = [0, -16]) + { + translate([ + -lhs[0] * 1 / 3 * x_mult, + //-lhs[1] / 2 * z_mult +- 4, + z, + -lhs[2] / 2]) + screw_hole( + m = m2, + id = id, + il = hole_insert_height * 2, + hd = m2_head_diameter, + hh = m2_head_height, + hs = hole_side_bottom); + } +} + module visualize_yz_range() { lenseY = $lenseYPosMm; @@ -167,49 +474,11 @@ module visualize_range() ); } -cam_and_lense(); -camera_hole(); -laser_hole(); -//visualize_yz_range(); -//visualize_xz_range(); -visualize_range(); - -// laser -translate([0, -$laserZOffsetMm, 0]) -{ - %laser_body(); - laser_holder(); -} - -// radxa -translate([0, 0, 20]) -translate([ - 0, - -$scannerBodyFrontWallOffsetMm - 5, - radxa_zero_3e_pcb_h - 10]) -rotate([90, 0, 0]) -//radxa_zero_3e_with_protoboard(); -radxa_zero_3e_with_protoboard_and_connectors(); - -// noctua fan -//translate([0, -$laserBodyLengthMm, $lenseYPosMm + 20]) -translate([0, -$scannerBodyFrontWallOffsetMm, 40]) -*noctua_nf_a4x20(); // main frame module scanner_main_frame() { lhs = laser_holder_size(); - wt = $scannerBodyWallThicknessMm; - wzo = $scannerBodyFrontWallOffsetMm; - - // in scanner coords - // inner height is a bit random - // TODO: choose constant size to use one frame for - // many similar ranges - main_frame_height_y = 150; - main_frame_width_x = 34; - main_frame_depth_z = 56; // inner height, width, depth and radius ih = main_frame_height_y; @@ -254,18 +523,73 @@ module scanner_main_frame() // TODO: and now add some stands for screwing left/right covers // TODO: simplify inner cut cube after implementing this: // rounded corners won't be needed anymore - - // add outer m12 connectors - translate([0, -wzo - id, 20 + m12_male_conn_body_thick_part_d + 5]) - m12_female_connector(); - - translate([0, -wzo - id, 20]) - m12_male_connector(); - + // chinese fan //translate([0, -$scannerBodyFrontWallOffsetMm, 40]) translate([0, ld3007ms_t - wzo - id, 80]) - %ld3007ms(); + *ld3007ms(); } -%scanner_main_frame();
\ No newline at end of file +module m12_connectors() +{ + // inner height, width, depth and radius + ih = main_frame_height_y; + iw = main_frame_width_x; + id = main_frame_depth_z; + ir = wt; + + { + // add outer m12 connectors + //scale([1.05, 1, 1.05]) + translate([0, -wzo - id + $tiny_padding, 20 + m12_male_conn_body_thick_part_d + 5]) + m12_female_connector(); + + translate([0, -wzo - id + $tiny_padding, 20]) + m12_male_connector(); + } +} + +module laser_with_holder() +{ + translate([0, -$laserZOffsetMm, 0]) + { + %laser_body(); + %laser_holder(); + } +} + +module radxa() +{ + translate([0, 0, 20]) + translate([ + 0, + -$scannerBodyFrontWallOffsetMm - 5, + radxa_zero_3e_pcb_h - 10]) + rotate([90, 0, 0]) + //radxa_zero_3e_with_protoboard(); + radxa_zero_3e_with_protoboard_and_connectors(); +} + +module other() +{ + //cam_and_lense(); + cam_and_lense_new(); + + //visualize_yz_range(); + //visualize_xz_range(); + visualize_range(); + + laser_with_holder(); + radxa(); +} + +*other(); + +difference() +{ + scanner_main_frame(); + camera_hole(); + laser_glass_hole(); + laser_holder_screw_holes(); + m12_connectors(); +}
\ No newline at end of file diff --git a/body/holes.scad b/body/holes.scad index ce61604..f464570 100644 --- a/body/holes.scad +++ b/body/holes.scad @@ -138,8 +138,8 @@ module screw_hole(m, id, il, hd, hh, hs, wt = $scannerBodyWallThicknessMm) fhh = hh + hhd; echo("hh:", hh); echo("fhh:", fhh); - translate([0, 0, wt - fhh]) - cylinder($fn = dToFn(fhd), d = fhd, h = fhh); + translate([0, 0, wt - fhh - $tiny_padding]) + cylinder($fn = dToFn(fhd), d = fhd, h = fhh + $tiny_padding * 2); } } } diff --git a/body/laser_holder.scad b/body/laser_holder.scad index 34a6466..f5c4562 100644 --- a/body/laser_holder.scad +++ b/body/laser_holder.scad @@ -74,7 +74,7 @@ module laser_holder_bottom_holes( } } -module laser_holder_holes(d = default_laser_d, l = default_laser_l, d_padding = 0.5) +module laser_holder_holes_(d = default_laser_d, l = default_laser_l, d_padding = 0.5) { union() { @@ -86,7 +86,7 @@ module laser_holder_holes(d = default_laser_d, l = default_laser_l, d_padding = translate([0, -l * 2 / 3, 0]) laser_holder_tension_hole(d=d); // bottom holes - laser_holder_bottom_holes(); + //laser_holder_bottom_holes(); } } @@ -98,7 +98,7 @@ module laser_holder(d = default_laser_d, l = default_laser_l, d_padding = 0.5) difference() { laser_holder_wo_holes(); - laser_holder_holes(d=d, l=l, d_padding = d_padding); + laser_holder_holes_(d=d, l=l, d_padding = d_padding); } } diff --git a/body/m12_lense_holder.scad b/body/m12_lense_holder.scad index 64165a8..5907720 100644 --- a/body/m12_lense_holder.scad +++ b/body/m12_lense_holder.scad @@ -1,4 +1,5 @@ use <helpers.scad> +include <veye_imx287.scad> // m12 cam holder size $m12_lense_holder_size = 13; @@ -60,7 +61,30 @@ module m12_lense_holder_wo_holes( module m12_lense_holder_base() { - m12_lense_holder_wo_holes(th = 0.001, bh = 0.001); + //m12_lense_holder_wo_holes(th = 0.001, bh = 0.001); + $S = $m12_lense_holder_size; + //$cube_size = [$S, $S, 1]; + $cube_size = [veye_imx287_pcb_w, $S, 1]; + + rotate([-90, 0, 0]) + { + // bottom cube + translate([0, 0, -$cube_size[2] / 2]) + cube($cube_size, center = true); + } +} + +module m12_lense_holder_top() +{ + $S = $m12_lense_holder_size; + + rotate([-90, 0, 0]) + { + // bottom cube + $size = [veye_imx287_pcb_w, 1, 1]; + translate([0, -$S / 2 - 1 / 2, -1 / 2]) + cube($size, center = true); + } } module m12_lense_holder_holes() @@ -102,5 +126,7 @@ module m12_lense_holder() } } -//m12_lense_holder(); -//m12_lense_holder_wo_holes();
\ No newline at end of file +*m12_lense_holder(); +*m12_lense_holder_wo_holes(); +*m12_lense_holder_base(); +*m12_lense_holder_top();
\ No newline at end of file diff --git a/body/veye_imx287.scad b/body/veye_imx287.scad index 85ebcf6..dd08c0b 100644 --- a/body/veye_imx287.scad +++ b/body/veye_imx287.scad @@ -119,7 +119,8 @@ module veye_imx287_mount_plate_outer() cr = veye_imx287_mount_plate_corner_radius; translate(veye_imx287_mount_plate_offset()) - hull() + color("green", 0.1) + *hull() { for ( dx = [w / 2 - cr, -w / 2 + cr], @@ -131,6 +132,22 @@ module veye_imx287_mount_plate_outer() cylinder($fn = dToFn(cr * 2), r = cr, h = t); } } + + color("blue", 0.5) + translate([0, 1 / 2 - imx287_thickness + $tiny_padding, 0]) + cube([w, 1, h], center = true); +} + +module veye_imx287_mount_plate_outer_top() +{ + w = veye_imx287_pcb_w; + h = veye_imx287_pcb_h; + t = veye_imx287_mount_plate_thickness; + cr = veye_imx287_mount_plate_corner_radius; + + color("pink", 0.5) + translate([0, 1 / 2 - imx287_thickness + $tiny_padding, h / 2 + 1 / 2]) + cube([w, 1, 1], center = true); } // inner area to cut @@ -212,12 +229,12 @@ module veye_imx287_mount_plate() } } -color("yellow", 0.1) +color("yellow", 0.4) *veye_imx287_natural(); color("green", 0.4) *veye_imx287_mount_plate(); -color("red", 0.1) +color("red", 0.4) *veye_imx287_mount_plate_outer(); color("green", 0.3) *veye_imx287_mount_plate_inner(); @@ -230,3 +247,5 @@ color("green", 0.3) veye_imx287_mount_plate_inner(); } +*veye_imx287_mount_plate_outer(); +*veye_imx287_mount_plate_outer_top();
\ No newline at end of file |
