Commit c9f794b8 authored by William Wadsworth's avatar William Wadsworth
Browse files

c270 camera mount component bulge

parent 7a54cec3
Loading
Loading
Loading
Loading
+39 −13
Original line number Diff line number Diff line
@@ -32,6 +32,9 @@ module c270_cutout(beam_r=4.3, beam_h=4.5, cover=true){
    //top of PCB at (0,0,0)

    inner_w = c270_dims().x;
    in_h_main = 3.5;
    in_h_tall = 6.5;
    block_h = 15;

    mirror([0,0,1]){ //parts cut out of the mount are z<0
        //beam clearance
@@ -41,24 +44,35 @@ module c270_cutout(beam_r=4.3, beam_h=4.5, cover=true){
                cylinder(r=beam_r, h=2*tiny(), center=true);
            }
        }

        // with a cover below the camera, make the cut-out a bit longer
        cut_pos = (cover)? 27 : 25;
        cut_length = 37;
        cut_end = (cover)? 45.5 : 43.5;
        cut_mid = cut_end - cut_length / 2;
        cut_length_tall = cut_end - abs(c270_y_offset()) - 2;
        cut_mid_tall = cut_end - cut_length_tall / 2;

        difference(){
            union(){
                // component clearance, cable end
                translate([0, cut_pos, 15-3.5]){
                translate([0, cut_mid, block_h-in_h_main]){
                    rotate_y(180){
                        round_top_cube([inner_w, 37, block_h], 1.5, center=true);
                    }
                }
                translate([0, cut_mid_tall, block_h-in_h_tall]){
                    rotate_y(180){
                        round_top_cube([inner_w, 37, 15],1.5,center=true);
                        round_top_cube([inner_w, cut_length_tall, block_h], 1.5, center=true);
                    }
                }
                // component clearance, sensor end
                hull(){
                    translate([0, 5, 4]){
                        cube([inner_w, 18, 15], center=true);
                    z = block_h/2 - in_h_main;
                    translate([0, 3, z]){
                        cube([inner_w, 16, block_h], center=true);
                    }
                    translate([0, -4, 4]){
                        cube([9, 9.5*2, 15], center=true);
                    translate([0, -4, z]){
                        cube([9, 9.5*2, block_h], center=true);
                    }
                }
            }
@@ -110,12 +124,12 @@ module c270_camera_mount(screwhole=true){
    h = c270_dims().y;
    w = c270_dims().x + 1.5;
    //wider_ section around lens
    h_w = 26;
    h_w = 2*abs(c270_y_offset());
    w_w = c270_dims().x + 2.5;

    y_offset = c270_y_offset();
    // extra room for cable if the mount has a cover below
    // when the screwholes are present from below
    // Extra room for cable if the mount has a cover below,
    // which is when the screwholes are not present from below.
    y_excess = (screwhole)? 0 : c270_mount_y_excess();

    mount_height = key_lookup("mount_height", c270_camera_dict());
@@ -123,13 +137,25 @@ module c270_camera_mount(screwhole=true){
        union(){
            // Cube over sensor for hulling to the lens mount, slightly raised
            // because the spheres making the round top are cut off in the STL representation
            translate([-w_w/2, y_offset-2, -mount_height]){
                round_top_cube([w_w, h_w+4, mount_height+2*tiny()], 2, $fn=16);
            rounding = 2;
            translate([-w_w/2, y_offset-rounding, -mount_height]){
                round_top_cube([w_w, h_w+rounding, mount_height+2*tiny()], rounding, $fn=16);
            }
            // Cube over the rest of the board, slightly lower down so that it
            // is not used for the lens mount.
            translate([-w/2, y_offset+y_excess, -mount_height]){
                round_top_cube([w, h, mount_height-2*tiny()], 2, $fn=16);
                round_top_cube([w, h, mount_height-2*tiny()], rounding, $fn=16);
            }
            // Cube over the end of the board, slightly higher up to give
            // more space for large components.
            start_pos = -y_offset + tiny();
            end_pos = h - (-y_offset) + y_excess;
            length = abs(end_pos - start_pos);
            centre = start_pos + (end_pos - start_pos) / 2;
            echo(y_offset, y_excess, h);
            echo(start_pos, end_pos, length, centre);
            translate([0, centre, -mount_height]){
                round_top_cube([w, length, mount_height + 3], 2, center=true, $fn=16);
            }
        }
        translate_z(-mount_height){
+19 −1
Original line number Diff line number Diff line
@@ -88,10 +88,28 @@ module lens_gripper(lens_r=10, h=6, lens_h=3.5, base_r=undef, t=0.65, solid=fals
    trylinder_gripper(inner_r=lens_r, h=h, grip_h=lens_h, base_r=base_r, t=t, solid=solid, flare=flare);
}


/* A thin slice of the top of the camera mount

Used to hull() the RMS optics module or the lens spacer onto the body.

The area of the top slice is restricted to an area around the optical axis, to avoid massive hull.

:param optics_config: optics configuration dictionary - defined in optics_configurations.scad
*/
module camera_mount_top_slice(optics_config){
    // A thin slice of the top of the camera mount
    
    camera_type = key_lookup("camera_type", optics_config);
    top_area = (camera_type == "arducam_b0196")? 40 :
                    (camera_type == "logitech_c270")? 2 * abs(c270_y_offset()) : 100;

    thick_section(h=tiny(), center=false, shift=false){
        intersection(){
            camera_mount(optics_config);
            rotate_z(45){
                cube(top_area, center=true);
            }
        }
    }
}