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

tidy lens spacer code

parent c9f794b8
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -26,11 +26,12 @@ function c270_near_third_hole_pos() = [5,-9.5,0];
function c270_far_third_hole_pos() = [-6,42.3,0];


module c270_cutout(beam_r=4.3, beam_h=4.5, cover=true){
module c270_cutout(beam_r=4.3, cover=true){
    //cut-out to fit Logitech C270 webcam
    //optical axis at (0,0)
    //top of PCB at (0,0,0)

    mount_h = key_lookup("mount_height", c270_camera_dict());
    inner_w = c270_dims().x;
    in_h_main = 3.5;
    in_h_tall = 6.5;
@@ -40,7 +41,7 @@ module c270_cutout(beam_r=4.3, beam_h=4.5, cover=true){
        //beam clearance
        hull(){
            cube([8,8,6], center=true);
            translate_z(-beam_h){
            translate_z(-mount_h){
                cylinder(r=beam_r, h=2*tiny(), center=true);
            }
        }
@@ -309,14 +310,16 @@ module c270_cable_exit(){
}

module c270_counterbore(){
    camera_mount_height = key_lookup("mount_height", c270_camera_dict());
    lens_base = camera_mount_height + 5;
    translate_z(c270_camera_bottom_z()-1){
        at_c270_hole_pattern(){
            cylinder(r=1.1, h=9, $fn=12);
            cylinder(r=1.1, h=lens_base, $fn=12);
        }
    }
    translate_z(c270_camera_bottom_z()+1){
        at_c270_hole_pattern(){
            cylinder(r=2.1, h=9, $fn=12);
            cylinder(r=2.1, h=lens_base-1, $fn=12);
        }
    }
}
+1 −4
Original line number Diff line number Diff line
@@ -441,10 +441,7 @@ module lens_spacer(params, optics_config){
                }
                union(){
                    // cut out the optical path
                    z_offset_lens_spacer_optical_path = is_c270_spacer(optics_config) ?
                                                                    2.8: // to match the light trap to the mount aperture, C270
                                                                    0; // to match the light trap to the mount aperture, Picam 2 and B0196
                    optical_path(optics_config, lens_assembly_z, camera_mount_top_z=z_offset_lens_spacer_optical_path);
                    optical_path(optics_config, lens_assembly_z, camera_mount_top_z=camera_mount_height-tiny());
                    // cut out counterbores
                    translate_z(camera_mount_height){
                        camera_mount_counterbore(optics_config);