mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-04 12:45:30 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a9e479d971 | ||
|
47b01af1ea | ||
|
fe19eba237 | ||
|
235f7b86e3 |
1
lib.scad
1
lib.scad
@@ -29,6 +29,7 @@ include <vitamins/batteries.scad>
|
||||
include <vitamins/blowers.scad>
|
||||
include <vitamins/bulldogs.scad>
|
||||
include <vitamins/buttons.scad>
|
||||
include <vitamins/cameras.scad>
|
||||
include <vitamins/components.scad>
|
||||
include <vitamins/displays.scad>
|
||||
include <vitamins/extrusions.scad>
|
||||
|
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 811 KiB After Width: | Height: | Size: 812 KiB |
@@ -385,7 +385,7 @@ sk_brackets_y = extrusion_brackets_y + 80;
|
||||
kp_pillow_blocks_y = sk_brackets_y + 50;
|
||||
scs_bearing_blocks_y = kp_pillow_blocks_y + 60;
|
||||
|
||||
translate([x4 + 150, belts_y + 58]) {
|
||||
translate([x4 + 200, belts_y + 58]) {
|
||||
belt_test();
|
||||
|
||||
translate([0, 60])
|
||||
|
@@ -447,7 +447,8 @@ PCB cameras.
|
||||
### Properties
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| ```camera_connector(type)``` | The flex connector block for the camera itself |
|
||||
| ```camera_connector_pos(type)``` | The flex connector block for the camera itself's position |
|
||||
| ```camera_connector_size(type)``` | The flex connector block for the camera itself's size |
|
||||
| ```camera_lens(type)``` | Stack of lens parts, can be round, rectanular or rounded rectangular, with optional tapered aperture |
|
||||
| ```camera_lens_offset(type)``` | Offset of the lens center from the PCB centre |
|
||||
| ```camera_pcb(type)``` | The PCB part of the camera |
|
||||
@@ -456,6 +457,7 @@ PCB cameras.
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```camera(type)``` | Draw specified PCB camera |
|
||||
| ```camera_lens(type, offset = 0)``` | Draw the lens stack, with optional offset for making a clearance hole |
|
||||
|
||||

|
||||
|
||||
@@ -463,6 +465,7 @@ PCB cameras.
|
||||
| Qty | Module call | BOM entry |
|
||||
| ---:|:--- |:---|
|
||||
| 1 | ```camera(rpi_camera_v1)``` | Raspberry Pi camera V1 |
|
||||
| 1 | ```camera(rpi_camera_v2)``` | Raspberry Pi camera V2 |
|
||||
| 1 | ```camera(rpi_camera)``` | Raspberry Pi focusable camera |
|
||||
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 74 KiB |
Binary file not shown.
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 172 KiB |
@@ -23,10 +23,38 @@
|
||||
include <../utils/core/core.scad>
|
||||
use <pcb.scad>
|
||||
|
||||
function camera_pcb(type) = type[2]; //! The PCB part of the camera
|
||||
function camera_lens_offset(type) = type[3]; //! Offset of the lens center from the PCB centre
|
||||
function camera_lens(type) = type[4]; //! Stack of lens parts, can be round, rectanular or rounded rectangular, with optional tapered aperture
|
||||
function camera_connector(type) = type[5]; //! The flex connector block for the camera itself
|
||||
function camera_pcb(type) = type[2]; //! The PCB part of the camera
|
||||
function camera_lens_offset(type) = type[3]; //! Offset of the lens center from the PCB centre
|
||||
function camera_lens(type) = type[4]; //! Stack of lens parts, can be round, rectanular or rounded rectangular, with optional tapered aperture
|
||||
function camera_connector_pos(type) = type[5]; //! The flex connector block for the camera itself's position
|
||||
function camera_connector_size(type)= type[6]; //! The flex connector block for the camera itself's size
|
||||
|
||||
module camera_lens(type, offset = 0) //! Draw the lens stack, with optional offset for making a clearance hole
|
||||
color(grey(20))
|
||||
translate(camera_lens_offset(type))
|
||||
for(p = camera_lens(type)) {
|
||||
size = p[0];
|
||||
r = p[1] + offset;
|
||||
app = p[2];
|
||||
if(size.x)
|
||||
rounded_rectangle(size + [2 * offset, 2 * offset, round_to_layer(offset)], r, center = false);
|
||||
else
|
||||
translate_z(size.y)
|
||||
rotate_extrude()
|
||||
difference() {
|
||||
square([r, size.z + round_to_layer(offset)]);
|
||||
|
||||
if(app)
|
||||
translate([0, size.z])
|
||||
hull() {
|
||||
translate([0, -eps])
|
||||
square([app.y, eps * 2]);
|
||||
|
||||
translate([0, -app.z])
|
||||
square([app.x, app.z]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module camera(type) { //! Draw specified PCB camera
|
||||
vitamin(str("camera(", type[0], "): ", type[1]));
|
||||
@@ -36,36 +64,14 @@ module camera(type) { //! Draw specified PCB camera
|
||||
pcb(pcb);
|
||||
|
||||
translate_z(pcb_thickness(pcb)) {
|
||||
color(grey(20))
|
||||
translate(camera_lens_offset(type))
|
||||
for(p = camera_lens(type)) {
|
||||
size = p[0];
|
||||
r = p[1];
|
||||
app = p[2];
|
||||
if(size.x)
|
||||
rounded_rectangle(size, r, center = false);
|
||||
else
|
||||
translate_z(size.y)
|
||||
rotate_extrude()
|
||||
difference() {
|
||||
square([r, size.z]);
|
||||
camera_lens(type);
|
||||
|
||||
if(app)
|
||||
translate([0, size.z])
|
||||
hull() {
|
||||
translate([0, -eps])
|
||||
square([app.y, eps * 2]);
|
||||
|
||||
translate([0, -app.z])
|
||||
square([app.x, app.z]);
|
||||
}
|
||||
}
|
||||
}
|
||||
conn = camera_connector(type);
|
||||
conn = camera_connector_size(type);
|
||||
if(conn) {
|
||||
pos = camera_connector_pos(type);
|
||||
color(grey(20))
|
||||
translate(conn[0])
|
||||
rounded_rectangle(conn[1], 0.5, center = false);
|
||||
translate(pos)
|
||||
rounded_rectangle(conn, 0.5, center = false);
|
||||
|
||||
flex = [5, 0.1];
|
||||
color("orange")
|
||||
@@ -74,8 +80,8 @@ module camera(type) { //! Draw specified PCB camera
|
||||
translate(camera_lens_offset(type) + [0, camera_lens(type)[0][0].y / 2])
|
||||
cube([flex.x, eps, flex.y], center = true);
|
||||
|
||||
translate_z(conn[1].z - flex.y)
|
||||
translate(conn[0] - [0, conn[1].y / 2])
|
||||
translate_z(conn.z - flex.y)
|
||||
translate([camera_lens_offset(type).x, pos.y] - [0, conn.y / 2])
|
||||
cube([flex.x, eps, flex.y], center = true);
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ rpi_camera_v1_pcb = ["", "", 25, 24, 1, 0, 2.1, 0, "green", false, [[2, -2], [-
|
||||
[
|
||||
[12, 3.25, 0, "-flat_flex", true],
|
||||
[-4.5, -5, 0, "smd_led", LED0603, "red"],
|
||||
[-5.5, -4, 0, "smd_res", RES0603, "10K"],
|
||||
[-5.5, -4, 0, "smd_res", RES0603, "1K2"],
|
||||
],
|
||||
[]];
|
||||
|
||||
@@ -32,7 +32,22 @@ rpi_camera_v1 = ["rpi_camera_v1", "Raspberry Pi camera V1", rpi_camera_v1_pcb, [
|
||||
[[0, 0, 4], 7.5 / 2],
|
||||
[[0, 0, 5], 5.5 / 2, [1.5/2, 2/2, 0.5]],
|
||||
],
|
||||
[[0, 12 - 1.5 - 2.5], [8, 5, 1]]
|
||||
[0, 12 - 1.5 - 2.5], [8, 5, 1]
|
||||
];
|
||||
|
||||
rpi_camera_v2_pcb = ["", "", 25, 23.862, 1, 2, 2.2, 0, "green", false, [[2, -2], [-2, -2], [2, -14.5], [-2, -14.5]],
|
||||
[
|
||||
[12.5, 2.75, 0, "-flat_flex", true],
|
||||
],
|
||||
[]];
|
||||
|
||||
rpi_camera_v2 = ["rpi_camera_v2", "Raspberry Pi camera V2", rpi_camera_v2_pcb, [0, 9.6 - 12],
|
||||
[
|
||||
[[8.5, 8.5, 3], 0],
|
||||
[[0, 0, 4], 7.5 / 2],
|
||||
[[0, 0, 5], 5.5 / 2, [1.5/2, 2/2, 0.5]],
|
||||
],
|
||||
[-13.8 + 12.5, 23.862 / 2 - 4.7], [8.5, 4, 1]
|
||||
];
|
||||
|
||||
rpi_camera_pcb = ["", "", 36, 36, 1.6, 0, 3.2, 0, "green", false, [[3.5, -3.5], [-3.5, -3.5], [3.5, 3.5], [-3.5, 3.5]],
|
||||
@@ -50,9 +65,9 @@ rpi_camera = ["rpi_camera", "Raspberry Pi focusable camera", rpi_camera_pcb, [0,
|
||||
[[0, 0, 12], 6],
|
||||
[[0, 11, 4.3], 14 / 2, [8/2, 11/2, 1]],
|
||||
],
|
||||
[[0, 18 - 1.5 - 2.5], [8, 5, 1]]
|
||||
[0, 18 - 1.5 - 2.5], [8, 5, 1.6]
|
||||
];
|
||||
|
||||
cameras = [rpi_camera_v1, rpi_camera];
|
||||
cameras = [rpi_camera_v1, rpi_camera, rpi_camera_v2];
|
||||
|
||||
use <camera.scad>
|
||||
|
@@ -638,14 +638,13 @@ module flex(cutout = false) { //! Draw flexistrip connector
|
||||
|
||||
translate([0, -w / 2 + slot_offset + slot_w / 2])
|
||||
square([slot_l, slot_w], center = true);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
small_ff = [[11.8, 0.9], [17, 1.4, 1.2], [12, 1.6, 1.2], [16, 1.1, 1.2]];
|
||||
large_ff = [[16, 1.25], [22, 1.5, 2.25],[16, 4.0, 2.5], [21, 0, 2.5]];
|
||||
large_ff = [[16, 1.25], [22, 1.5, 2.5], [16, 4.0, 2.5], [21, 0, 2.5]];
|
||||
|
||||
function ff_slot(type) = type[0]; //! Flat flex slot size
|
||||
function ff_latch(type) = type[1]; //! Flat flex latch size
|
||||
@@ -683,8 +682,8 @@ module flat_flex(type, cutout = false) { //! Draw flat flexistrip connector as u
|
||||
}
|
||||
|
||||
color(grey(80))
|
||||
translate([-back.x / 2, -w / 2 + back.y])
|
||||
cube([back.x, mid.y, mid.z - eps]);
|
||||
translate([-back.x / 2, -w / 2 + back.y + eps])
|
||||
cube([back.x, mid.y - 2 * eps, mid.z - eps]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user