mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-24 06:01:29 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
235f7b86e3 | ||
|
92d7e18b16 | ||
|
6a7226120f | ||
|
8aa00cd041 |
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 803 KiB After Width: | Height: | Size: 811 KiB |
18
readme.md
18
readme.md
@@ -447,7 +447,8 @@ PCB cameras.
|
|||||||
### Properties
|
### Properties
|
||||||
| Function | Description |
|
| 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(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_lens_offset(type)``` | Offset of the lens center from the PCB centre |
|
||||||
| ```camera_pcb(type)``` | The PCB part of the camera |
|
| ```camera_pcb(type)``` | The PCB part of the camera |
|
||||||
@@ -2103,6 +2104,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
|||||||
| ```pcb_coord(type, p)``` | Convert offsets from the edge to coordinates relative to the centre |
|
| ```pcb_coord(type, p)``` | Convert offsets from the edge to coordinates relative to the centre |
|
||||||
| ```pcb_grid_pos(type, x, y, z = 0)``` | Returns a pcb grid position |
|
| ```pcb_grid_pos(type, x, y, z = 0)``` | Returns a pcb grid position |
|
||||||
| ```pcb_screw(type, cap = hs_cap)``` | Mounting screw type |
|
| ```pcb_screw(type, cap = hs_cap)``` | Mounting screw type |
|
||||||
|
| ```pcb_size(type)``` | Length, width and thickness in a vector |
|
||||||
|
|
||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
@@ -2235,6 +2237,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
|||||||
| ```pcb_coord(type, p)``` | Convert offsets from the edge to coordinates relative to the centre |
|
| ```pcb_coord(type, p)``` | Convert offsets from the edge to coordinates relative to the centre |
|
||||||
| ```pcb_grid_pos(type, x, y, z = 0)``` | Returns a pcb grid position |
|
| ```pcb_grid_pos(type, x, y, z = 0)``` | Returns a pcb grid position |
|
||||||
| ```pcb_screw(type, cap = hs_cap)``` | Mounting screw type |
|
| ```pcb_screw(type, cap = hs_cap)``` | Mounting screw type |
|
||||||
|
| ```pcb_size(type)``` | Length, width and thickness in a vector |
|
||||||
|
|
||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
@@ -2652,24 +2655,27 @@ Linear rails with carriages.
|
|||||||
### Vitamins
|
### Vitamins
|
||||||
| Qty | Module call | BOM entry |
|
| Qty | Module call | BOM entry |
|
||||||
| ---:|:--- |:---|
|
| ---:|:--- |:---|
|
||||||
| 1 | ```rail(MGN15, 260)``` | Linear rail MGN15 x 260mm |
|
| 1 | ```rail(MGN12, 200)``` | Linear rail MGN12 x 200mm |
|
||||||
|
| 1 | ```rail(MGN12H, 200)``` | Linear rail MGN12H x 200mm |
|
||||||
|
| 1 | ```rail(MGN15, 200)``` | Linear rail MGN15 x 200mm |
|
||||||
| 1 | ```rail(MGN5, 200)``` | Linear rail MGN5 x 200mm |
|
| 1 | ```rail(MGN5, 200)``` | Linear rail MGN5 x 200mm |
|
||||||
| 1 | ```rail(MGN7, 200)``` | Linear rail MGN7 x 200mm |
|
| 1 | ```rail(MGN7, 200)``` | Linear rail MGN7 x 200mm |
|
||||||
| 1 | ```rail(MGN9, 200)``` | Linear rail MGN9 x 200mm |
|
| 1 | ```rail(MGN9, 200)``` | Linear rail MGN9 x 200mm |
|
||||||
| 1 | ```rail(SSR15, 200)``` | Linear rail SSR15 x 200mm |
|
| 1 | ```rail(SSR15, 200)``` | Linear rail SSR15 x 200mm |
|
||||||
| 26 | ```nut(M2_nut, nyloc = true)``` | Nut M2 x 1.6mm nyloc |
|
| 26 | ```nut(M2_nut, nyloc = true)``` | Nut M2 x 1.6mm nyloc |
|
||||||
| 17 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
| 31 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||||
| 4 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
|
| 4 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
|
||||||
| 11 | ```screw(M2_cap_screw, 10)``` | Screw M2 cap x 10mm |
|
| 11 | ```screw(M2_cap_screw, 10)``` | Screw M2 cap x 10mm |
|
||||||
| 15 | ```screw(M2_cs_cap_screw, 10)``` | Screw M2 cs cap x 10mm |
|
| 15 | ```screw(M2_cs_cap_screw, 10)``` | Screw M2 cs cap x 10mm |
|
||||||
| 8 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
|
| 8 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
|
||||||
| 5 | ```screw(M3_cap_screw, 16)``` | Screw M3 cap x 16mm |
|
| 12 | ```screw(M3_cap_screw, 12)``` | Screw M3 cap x 12mm |
|
||||||
|
| 3 | ```screw(M3_cap_screw, 16)``` | Screw M3 cap x 16mm |
|
||||||
| 2 | ```screw(M3_cs_cap_screw, 12)``` | Screw M3 cs cap x 12mm |
|
| 2 | ```screw(M3_cs_cap_screw, 12)``` | Screw M3 cs cap x 12mm |
|
||||||
| 2 | ```screw(M3_cs_cap_screw, 16)``` | Screw M3 cs cap x 16mm |
|
| 6 | ```screw(M3_cs_cap_screw, 16)``` | Screw M3 cs cap x 16mm |
|
||||||
| 2 | ```screw(M4_cap_screw, 16)``` | Screw M4 cap x 16mm |
|
| 2 | ```screw(M4_cap_screw, 16)``` | Screw M4 cap x 16mm |
|
||||||
| 2 | ```screw(M4_cs_cap_screw, 20)``` | Screw M4 cs cap x 20mm |
|
| 2 | ```screw(M4_cs_cap_screw, 20)``` | Screw M4 cs cap x 20mm |
|
||||||
| 26 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
|
| 26 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
|
||||||
| 17 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
| 31 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
|
||||||
| 4 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
|
| 4 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Binary file not shown.
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 128 KiB |
@@ -25,10 +25,10 @@ use <../vitamins/nut.scad>
|
|||||||
sheet = 3;
|
sheet = 3;
|
||||||
|
|
||||||
module rails()
|
module rails()
|
||||||
layout([for(l = rails) carriage_width(rail_carriage(l))], 25)
|
layout([for(l = rails) carriage_width(rail_carriage(l))], 20)
|
||||||
rotate(-90) {
|
rotate(-90) {
|
||||||
rail = rails[$i];
|
rail = rails[$i];
|
||||||
length = rail == MGN15 ? 260 : 200;
|
length = 200;
|
||||||
screw = rail_screw(rail);
|
screw = rail_screw(rail);
|
||||||
nut = screw_nut(screw);
|
nut = screw_nut(screw);
|
||||||
washer = screw_washer(screw);
|
washer = screw_washer(screw);
|
||||||
|
@@ -26,29 +26,23 @@ use <pcb.scad>
|
|||||||
function camera_pcb(type) = type[2]; //! The PCB part of the camera
|
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_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_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_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(type) { //! Draw specified PCB camera
|
module camera_lens(type, offset = 0)
|
||||||
vitamin(str("camera(", type[0], "): ", type[1]));
|
|
||||||
pcb = camera_pcb(type);
|
|
||||||
|
|
||||||
not_on_bom()
|
|
||||||
pcb(pcb);
|
|
||||||
|
|
||||||
translate_z(pcb_thickness(pcb)) {
|
|
||||||
color(grey(20))
|
color(grey(20))
|
||||||
translate(camera_lens_offset(type))
|
translate(camera_lens_offset(type))
|
||||||
for(p = camera_lens(type)) {
|
for(p = camera_lens(type)) {
|
||||||
size = p[0];
|
size = p[0];
|
||||||
r = p[1];
|
r = p[1] + offset;
|
||||||
app = p[2];
|
app = p[2];
|
||||||
if(size.x)
|
if(size.x)
|
||||||
rounded_rectangle(size, r, center = false);
|
rounded_rectangle(size + [2 * offset, 2 * offset, round_to_layer(offset)], r, center = false);
|
||||||
else
|
else
|
||||||
translate_z(size.y)
|
translate_z(size.y)
|
||||||
rotate_extrude()
|
rotate_extrude()
|
||||||
difference() {
|
difference() {
|
||||||
square([r, size.z]);
|
square([r, size.z + round_to_layer(offset)]);
|
||||||
|
|
||||||
if(app)
|
if(app)
|
||||||
translate([0, size.z])
|
translate([0, size.z])
|
||||||
@@ -61,11 +55,23 @@ module camera(type) { //! Draw specified PCB camera
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
conn = camera_connector(type);
|
|
||||||
|
module camera(type) { //! Draw specified PCB camera
|
||||||
|
vitamin(str("camera(", type[0], "): ", type[1]));
|
||||||
|
pcb = camera_pcb(type);
|
||||||
|
|
||||||
|
not_on_bom()
|
||||||
|
pcb(pcb);
|
||||||
|
|
||||||
|
translate_z(pcb_thickness(pcb)) {
|
||||||
|
camera_lens(type);
|
||||||
|
|
||||||
|
conn = camera_connector_size(type);
|
||||||
if(conn) {
|
if(conn) {
|
||||||
|
pos = camera_connector_pos(type);
|
||||||
color(grey(20))
|
color(grey(20))
|
||||||
translate(conn[0])
|
translate(pos)
|
||||||
rounded_rectangle(conn[1], 0.5, center = false);
|
rounded_rectangle(conn, 0.5, center = false);
|
||||||
|
|
||||||
flex = [5, 0.1];
|
flex = [5, 0.1];
|
||||||
color("orange")
|
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])
|
translate(camera_lens_offset(type) + [0, camera_lens(type)[0][0].y / 2])
|
||||||
cube([flex.x, eps, flex.y], center = true);
|
cube([flex.x, eps, flex.y], center = true);
|
||||||
|
|
||||||
translate_z(conn[1].z - flex.y)
|
translate_z(conn.z - flex.y)
|
||||||
translate(conn[0] - [0, conn[1].y / 2])
|
translate(pos - [0, conn.y / 2])
|
||||||
cube([flex.x, eps, flex.y], center = true);
|
cube([flex.x, eps, flex.y], center = true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,8 +21,8 @@ include <smds.scad>
|
|||||||
rpi_camera_v1_pcb = ["", "", 25, 24, 1, 0, 2.1, 0, "green", false, [[2, -2], [-2, -2], [2, 9.6], [-2, 9.6]],
|
rpi_camera_v1_pcb = ["", "", 25, 24, 1, 0, 2.1, 0, "green", false, [[2, -2], [-2, -2], [2, 9.6], [-2, 9.6]],
|
||||||
[
|
[
|
||||||
[12, 3.25, 0, "-flat_flex", true],
|
[12, 3.25, 0, "-flat_flex", true],
|
||||||
[-4.5, -4, 0, "smd_led", LED0603, "red"],
|
[-4.5, -5, 0, "smd_led", LED0603, "red"],
|
||||||
[-5.5, -3, 0, "smd_res", RES0603, "10K"],
|
[-5.5, -4, 0, "smd_res", RES0603, "1K2"],
|
||||||
],
|
],
|
||||||
[]];
|
[]];
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ rpi_camera_v1 = ["rpi_camera_v1", "Raspberry Pi camera V1", rpi_camera_v1_pcb, [
|
|||||||
[[0, 0, 4], 7.5 / 2],
|
[[0, 0, 4], 7.5 / 2],
|
||||||
[[0, 0, 5], 5.5 / 2, [1.5/2, 2/2, 0.5]],
|
[[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_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]],
|
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,7 +50,7 @@ rpi_camera = ["rpi_camera", "Raspberry Pi focusable camera", rpi_camera_pcb, [0,
|
|||||||
[[0, 0, 12], 6],
|
[[0, 0, 12], 6],
|
||||||
[[0, 11, 4.3], 14 / 2, [8/2, 11/2, 1]],
|
[[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];
|
||||||
|
@@ -53,6 +53,8 @@ function pcb_accessories(type) = type[12]; //! List of accessories to go on the
|
|||||||
function pcb_grid(type) = type[13]; //! Grid if a perfboard
|
function pcb_grid(type) = type[13]; //! Grid if a perfboard
|
||||||
function pcb_polygon(type) = type[14]; //! Optional outline polygon for odd shaped boards
|
function pcb_polygon(type) = type[14]; //! Optional outline polygon for odd shaped boards
|
||||||
function pcb_screw(type, cap = hs_cap) = Len(type[15]) ? type[15] : find_screw(cap, screw_smaller_than(pcb_hole_d(type))); //! Mounting screw type
|
function pcb_screw(type, cap = hs_cap) = Len(type[15]) ? type[15] : find_screw(cap, screw_smaller_than(pcb_hole_d(type))); //! Mounting screw type
|
||||||
|
function pcb_size(type) = [pcb_length(type), pcb_width(type), pcb_thickness(type)]; //! Length, width and thickness in a vector
|
||||||
|
|
||||||
|
|
||||||
function pcb_grid_pos(type, x, y, z = 0) = //! Returns a pcb grid position
|
function pcb_grid_pos(type, x, y, z = 0) = //! Returns a pcb grid position
|
||||||
[-pcb_length(type) / 2 + pcb_grid(type).x + 2.54 * x,
|
[-pcb_length(type) / 2 + pcb_grid(type).x + 2.54 * x,
|
||||||
|
@@ -25,6 +25,7 @@ MGN5_carriage = [ 16, 9.6, 12, 6, 1.5, 0, 8 , M2_cap_screw ];
|
|||||||
MGN7_carriage = [ 23, 14.3, 17, 8, 1.5, 8, 12, M2_cap_screw ];
|
MGN7_carriage = [ 23, 14.3, 17, 8, 1.5, 8, 12, M2_cap_screw ];
|
||||||
MGN9_carriage = [ 29.7, 20.8, 20, 10, 2, 10, 15, M3_cap_screw ];
|
MGN9_carriage = [ 29.7, 20.8, 20, 10, 2, 10, 15, M3_cap_screw ];
|
||||||
MGN12_carriage = [ 34.7, 21.7, 27, 13, 3, 15, 20, M3_cap_screw ];
|
MGN12_carriage = [ 34.7, 21.7, 27, 13, 3, 15, 20, M3_cap_screw ];
|
||||||
|
MGN12H_carriage= [ 45.4, 32.4, 27, 13, 3, 20, 20, M3_cap_screw ];
|
||||||
MGN15_carriage = [ 43.3, 27.7, 32, 16, 4, 20, 25, M3_cap_screw ];
|
MGN15_carriage = [ 43.3, 27.7, 32, 16, 4, 20, 25, M3_cap_screw ];
|
||||||
SSR15_carriage = [ 40.3, 23.3, 34, 24, 4.5, 0, 26, M4_cap_screw ];
|
SSR15_carriage = [ 40.3, 23.3, 34, 24, 4.5, 0, 26, M4_cap_screw ];
|
||||||
//
|
//
|
||||||
@@ -36,9 +37,10 @@ MGN5 = [ "MGN5", 5, 3.6, 5, 15, 3.5, 2.4, 0.8, M2_cs_cap_screw, MGN5_carriag
|
|||||||
MGN7 = [ "MGN7", 7, 5, 5, 15, 4.3, 2.4, 2.6, M2_cap_screw, MGN7_carriage, M2_cs_cap_screw ];
|
MGN7 = [ "MGN7", 7, 5, 5, 15, 4.3, 2.4, 2.6, M2_cap_screw, MGN7_carriage, M2_cs_cap_screw ];
|
||||||
MGN9 = [ "MGN9", 9, 6, 7.5, 20, 6.0, 3.5, 3.5, M3_cap_screw, MGN9_carriage, M3_cs_cap_screw ];
|
MGN9 = [ "MGN9", 9, 6, 7.5, 20, 6.0, 3.5, 3.5, M3_cap_screw, MGN9_carriage, M3_cs_cap_screw ];
|
||||||
MGN12= [ "MGN12", 12, 8, 10, 25, 6.0, 3.5, 4.5, M3_cap_screw, MGN12_carriage, M3_cs_cap_screw ];
|
MGN12= [ "MGN12", 12, 8, 10, 25, 6.0, 3.5, 4.5, M3_cap_screw, MGN12_carriage, M3_cs_cap_screw ];
|
||||||
|
MGN12H=[ "MGN12H",12, 8, 10, 25, 6.0, 3.5, 4.5, M3_cap_screw, MGN12H_carriage,M3_cs_cap_screw ];
|
||||||
MGN15= [ "MGN15", 15, 10, 10, 40, 6.0, 3.5, 5.0, M3_cap_screw, MGN15_carriage, M3_cs_cap_screw ];
|
MGN15= [ "MGN15", 15, 10, 10, 40, 6.0, 3.5, 5.0, M3_cap_screw, MGN15_carriage, M3_cs_cap_screw ];
|
||||||
SSR15= [ "SSR15", 15, 12.5,10, 60, 7.5, 4.5, 5.3, M4_cap_screw, SSR15_carriage, M4_cs_cap_screw ];
|
SSR15= [ "SSR15", 15, 12.5,10, 60, 7.5, 4.5, 5.3, M4_cap_screw, SSR15_carriage, M4_cs_cap_screw ];
|
||||||
|
|
||||||
rails = [MGN5, MGN7, MGN9, MGN15, SSR15];
|
rails = [MGN5, MGN7, MGN9, MGN12, MGN12H, MGN15, SSR15];
|
||||||
|
|
||||||
use <rail.scad>
|
use <rail.scad>
|
||||||
|
Reference in New Issue
Block a user