From 1dbba5a650f8dac2d05a5668008e61a5ec22ea4f Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Thu, 14 Mar 2024 20:58:02 +0000 Subject: [PATCH] Added camera_lens_height() function. --- readme.md | 5 +++++ vitamins/camera.scad | 3 +++ 2 files changed, 8 insertions(+) diff --git a/readme.md b/readme.md index d95ff2a..a2a7e37 100644 --- a/readme.md +++ b/readme.md @@ -779,6 +779,11 @@ PCB cameras. | `camera_lens_offset(type)` | Offset of the lens center from the PCB centre | | `camera_pcb(type)` | The PCB part of the camera | +### Functions +| Function | Description | +|:--- |:--- | +| `camera_lens_height(type)` | The height of the lens stack | + ### Modules | Module | Description | |:--- |:--- | diff --git a/vitamins/camera.scad b/vitamins/camera.scad index 3016e3e..fdf1c57 100644 --- a/vitamins/camera.scad +++ b/vitamins/camera.scad @@ -30,6 +30,9 @@ function camera_connector_pos(type) = type[5]; //! The flex connector block for function camera_connector_size(type)= type[6]; //! The flex connector block for the camera itself's size function camera_fov(type) = type[7]; //! The field of view of the camera lens +function camera_lens_height(type) = //! The height of the lens stack + let(lenses = camera_lens(type), lens = lenses[len(lenses) - 1][0]) lens.y + lens.z; + module camera_lens(type, offset = 0, show_lens = true) //! Draw the lens stack, with optional offset for making a clearance hole color(grey(20)) translate(camera_lens_offset(type))