Commit f2298b68 authored by Julian Stirling's avatar Julian Stirling 🐧
Browse files

Merge branch 'camera-platform-labels' into 'master'

Put camera platform labels in dict

Closes #474

See merge request !544
parents a955f9fe 46dd11a2
Loading
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -447,9 +447,8 @@ function camera_board_thickness(optics_config) = key_lookup("board_thickness", o
:param params: The microscope parameter dictionary
:param optics_config: Optics configuration dictionary
:param base_r: Radius of the base central point of the mount body
:param message: Message to be printed on the base (used to denote upright versions)
*/
module camera_platform(params, optics_config, base_r, message=""){
module camera_platform(params, optics_config, base_r){
    assert(key_lookup("optics_type", optics_config)=="spacer", "Use spacer optics configuration to create a camera_platform.");

    // platform height is 5mm below the lens spacer (board is 1mm thick mounting posts are 4mm tall)
@@ -457,7 +456,7 @@ module camera_platform(params, optics_config, base_r, message=""){
    assert(platform_h > upper_z_flex_z(params), "Platform height too low for z-axis mounting");

    camera_rotation = key_lookup("rotation", optics_config);

    message = key_lookup("message", optics_config);
    // Make a camera platform with a fitting wedge on the side and a platform on the top
    difference(){
        union(){
+7 −3
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ function rms_infinity_f50d13_config(camera_type = "picamera_2", beamsplitter=fal
*/
function pilens_config(camera_type = "picamera_2", upright=false) = let(
    rotation = upright ? 45+180 : 45,
    message = upright ? "upright" : "",
    config_dict = [["optics_type", "spacer"],
                   ["camera_type", camera_type],
                   ["lens_r", 3],
@@ -87,7 +88,8 @@ function pilens_config(camera_type = "picamera_2", upright=false) = let(
                   ["lens_spacing", 17], // Minimum 17 for spacer to build correctly
                   ["mounting_post_height",4],
                   ["board_thickness",1],
                   ["rotation", rotation]] // camera rotation about z
                   ["rotation", rotation], // camera rotation about z
                   ["message", message]]
) config_dict;


@@ -106,7 +108,8 @@ function c270lens_config(camera_type = "logitech_c270") = let(
                   ["lens_spacing", 17], // Minimum 13 for spacer to build correctly
                   ["mounting_post_height",4],
                   ["board_thickness",1],
                   ["rotation", 180]] // camera rotation about z
                   ["rotation", 180], // camera rotation about z
                   ["message", "C270"]]
) config_dict;


@@ -125,5 +128,6 @@ function b0196lens_config(camera_type = "arducam_b0196") = let(
                   ["lens_spacing", 17], // Minimum 17 for spacer to build correctly
                   ["mounting_post_height",4],
                   ["board_thickness",1],
                   ["rotation", -45]] // camera rotation about z
                   ["rotation", -45], // camera rotation about z
                   ["message", "B0196"]]
) config_dict;
+1 −1
Original line number Diff line number Diff line
@@ -14,5 +14,5 @@ camera_platform_stl();
module camera_platform_stl(){
    params = default_params();
    optics_config = pilens_config(upright=true);
    camera_platform(params, optics_config, base_r=5, message="upright");
    camera_platform(params, optics_config, base_r=5);
}
+1 −2
Original line number Diff line number Diff line
@@ -206,9 +206,8 @@ module assemble_lens_spacer(frame, camera_type="pi_camera"){
module rendered_camera_platform(camera_type="pi_camera", upright=false){
    params = render_params();
    optics_config = (camera_type == "c270") ? c270lens_config() : pilens_config(upright=upright);
    message = (upright)? "upright" : "";
    coloured_render(optics_module_colour()){
        camera_platform(params, optics_config, 5, message=message);
        camera_platform(params, optics_config, 5);
    }
}