1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-03 12:22:46 +02:00

Compare commits

...

15 Commits

Author SHA1 Message Date
Chris Palmer
53d1ea93cd Can now specify a rotation angle for a geared_stepper's shaft. 2024-06-30 12:30:29 +01:00
Chris Palmer
7eaca85e96 Updated changelog. 2024-06-12 21:25:13 +01:00
Chris Palmer
b00709da82 Image edge pixel changes due to new PC. 2024-06-12 21:23:32 +01:00
Chris Palmer
c76be23867 Fixed thread bug on threaded inserts revealed by latest OpenSCAD snapshot. 2024-06-12 21:18:11 +01:00
Chris Palmer
f6f348b76e Fixed rocker slot height. 2024-06-12 21:15:44 +01:00
Chris
11a1f65158 Updated changelog. 2024-05-08 00:29:33 +01:00
Chris
870b396574 Revoved strailing comma in let() in splines.scad. 2024-05-08 00:22:19 +01:00
Chris Palmer
00c19b08f1 Updated changelog. 2024-04-21 15:45:15 +01:00
Chris Palmer
22bbb85899 Merge branch 'vshcryabets-pcb/rcwl0516' 2024-04-21 15:41:13 +01:00
Chris Palmer
c1fdb2e701 Dpdated images and readme. 2024-04-21 15:40:51 +01:00
Chris Palmer
728d5d32a9 Merge branch 'pcb/rcwl0516' of https://github.com/vshcryabets/NopSCADlib into vshcryabets-pcb/rcwl0516 2024-04-21 15:20:59 +01:00
Chris Palmer
771ba04e18 Updated changelog. 2024-04-21 15:19:33 +01:00
Chris Palmer
dbf930fd36 Added cubic splines and Catmull Rom splines. 2024-04-21 12:13:31 +01:00
Chris Palmer
97cea65f41 Cable clips can now use inserts or nut traps. 2024-04-21 12:08:40 +01:00
V.Shcriabets
cbe2c085b7 Add RCWL-0516 PCB 2024-04-20 12:59:16 +03:00
21 changed files with 332 additions and 100 deletions

View File

@@ -3,6 +3,40 @@
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
#### [v21.23.2](https://github.com/nophead/NopSCADlib/releases/tag/v21.23.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.23.1...v21.23.2 "diff with v21.23.1")
* 2024-06-12 [`b00709d`](https://github.com/nophead/NopSCADlib/commit/b00709da820e1241422b6e156b0c61157c18d63d "show commit") [C.P.](# "Chris Palmer") Image edge pixel changes due to new PC.
* 2024-06-12 [`c76be23`](https://github.com/nophead/NopSCADlib/commit/c76be2386715b80bbbc9a71c99214df7f3c71bc7 "show commit") [C.P.](# "Chris Palmer") Fixed thread bug on threaded inserts revealed by latest OpenSCAD snapshot.
* 2024-06-12 [`f6f348b`](https://github.com/nophead/NopSCADlib/commit/f6f348b76e7986927a571e1c07c3f866bcbeeafe "show commit") [C.P.](# "Chris Palmer") Fixed rocker slot height.
#### [v21.23.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.23.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.23.0...v21.23.1 "diff with v21.23.0")
* 2024-05-08 [`870b396`](https://github.com/nophead/NopSCADlib/commit/870b396574935603305462f1fea88564c909aad8 "show commit") [C.](# "Chris") Revoved strailing comma in `let()` in `splines.scad`.
### [v21.23.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.23.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.22.0...v21.23.0 "diff with v21.22.0")
* 2024-04-21 [`c1fdb2e`](https://github.com/nophead/NopSCADlib/commit/c1fdb2e701672b2404e34f224e77f21fb2ff34da "show commit") [C.P.](# "Chris Palmer") Dpdated images and readme.
* 2024-04-20 [`cbe2c08`](https://github.com/nophead/NopSCADlib/commit/cbe2c085b72d0e5d9f0c6485d5fa7df0e172a4cc "show commit") [V.](# "V.Shcriabets") Add RCWL-0516 PCB
### [v21.22.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.22.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.21.0...v21.22.0 "diff with v21.21.0")
* 2024-04-21 [`dbf930f`](https://github.com/nophead/NopSCADlib/commit/dbf930fd366c28aa9e581d9fe01e3654b882923a "show commit") [C.P.](# "Chris Palmer") Added cubic splines and Catmull Rom splines.
### [v21.21.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.21.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.20.0...v21.21.0 "diff with v21.20.0")
* 2024-04-21 [`97cea65`](https://github.com/nophead/NopSCADlib/commit/97cea65f41714acd31a3a3b968d8c133ce1a91d2 "show commit") [C.P.](# "Chris Palmer") Cable clips can now use inserts or nut traps.
### [v21.20.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.20.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.19.2...v21.20.0 "diff with v21.19.2")
* 2024-04-21 [`c7e912c`](https://github.com/nophead/NopSCADlib/commit/c7e912cd77e189ef729f94956245f1c6a9f72012 "show commit") [C.P.](# "Chris Palmer") A optional path can now be specified for tubing.
#### [v21.19.2](https://github.com/nophead/NopSCADlib/releases/tag/v21.19.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.19.1...v21.19.2 "diff with v21.19.1")
* 2024-04-21 [`f563645`](https://github.com/nophead/NopSCADlib/commit/f563645e45817a4f89ef3cb1be9d932310c485c6 "show commit") [C.P.](# "Chris Palmer") Corrected M2 `nut_trap_depth,` was too big.
#### [v21.19.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.19.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.19.0...v21.19.1 "diff with v21.19.0")
* 2024-04-21 [`2840cc2`](https://github.com/nophead/NopSCADlib/commit/2840cc2390a8e776add8ca3ef715abfc8d15dadc "show commit") [C.P.](# "Chris Palmer") Washer now uses `sweep.scad` instead of including it, leaking its interface.
### [v21.19.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.19.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.18.0...v21.19.0 "diff with v21.18.0")
* 2024-04-21 [`a5b2018`](https://github.com/nophead/NopSCADlib/commit/a5b20180083ba8d3014bc298cf0e28c20e6be437 "show commit") [C.P.](# "Chris Palmer") Added `offset_paths()` to `sweep.scad`.
`show_path()` now takes an optional radius.
### [v21.18.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.18.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.17.0...v21.18.0 "diff with v21.17.0")
* 2024-03-14 [`19dadcb`](https://github.com/nophead/NopSCADlib/commit/19dadcb58db0dd7408726c69d46cf2b7b26c764b "show commit") [C.P.](# "Chris Palmer") Updated images and readme.

View File

@@ -97,6 +97,7 @@ use <utils/hanging_hole.scad>
use <utils/fillet.scad>
use <utils/rounded_polygon.scad>
use <utils/rounded_triangle.scad>
use <utils/splines.scad>
use <utils/layout.scad>
use <utils/round.scad>
use <utils/offset.scad>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1001 KiB

After

Width:  |  Height:  |  Size: 1002 KiB

View File

@@ -18,7 +18,7 @@
//
//
//! Cable clips to order. Can be for one or two cables of different sizes. Can use an insert and a screw from below or a screw and nut either way up.
//! Cable clips to order. Can be for one or two cables of different sizes. Can use an insert and a screw from below or a screw and nut, nyloc or plain, either way up.
//
include <../core.scad>
use <../vitamins/wire.scad>
@@ -30,27 +30,29 @@ wall = 2;
function cable_clip_insert(screw, insert = true) = //! Insert type for clip, given screw.
is_list(insert) ? insert : insert ? screw_insert(screw, true) : false;
function cable_clip_width(screw, insert = false) = //! Width given the `screw` and possibly insert.
function cable_clip_width(screw, insert = false, nut = false) = //! Width given the `screw` and possibly insert or nut.
let(insert = cable_clip_insert(screw, insert))
insert ? 2 * (insert_hole_radius(insert) + wall) :
nut ? 2 * (nut_radius(screw_nut(screw)) + wall) :
max(wall + 2 * screw_clearance_radius(screw) + wall, washer_diameter(screw_washer(screw)));
function cable_clip_height(cable, screw = false, insert = false) = //! Height given the `cable`.
function cable_clip_height(cable, screw = false, insert = false, nut = false) = //! Height given the `cable`.
let(insert = cable_clip_insert(screw, insert))
max(cable_height(cable) + wall, insert ? insert_hole_length(insert) + 1 : 0);
max(cable_height(cable) + wall, insert ? insert_hole_length(insert) + 1 : 0, nut ? nut_trap_depth(screw_nut(screw)) + wall : 0);
function cable_clip_extent(screw, cable, insert = false) = cable_clip_width(screw, insert) / 2 + cable_width(cable) + wall; //! How far it extends from the screw.
function cable_clip_offset(screw, cable, insert = false) = cable_clip_width(screw, insert) / 2 + cable_width(cable) / 2; //! The offset of the cable from the screw.
function cable_clip_extent(screw, cable, insert = false, nut = false) = cable_clip_width(screw, insert, nut) / 2 + cable_width(cable) + wall; //! How far it extends from the screw.
function cable_clip_offset(screw, cable, insert = false, nut = false) = cable_clip_width(screw, insert, nut) / 2 + cable_width(cable) / 2; //! The offset of the cable from the screw.
module single_cable_clip(screw, cable, h = 0, insert = false) {
module single_cable_clip(screw, cable, h = 0, insert = false, nut = false) {
insert = cable_clip_insert(screw, insert);
height = cable_clip_width(screw, insert);
depth = h ? h : cable_clip_height(cable, screw, insert);
height = cable_clip_width(screw, insert, nut);
depth = h ? h : cable_clip_height(cable, screw, insert, nut);
w = cable_width(cable);
width = wall + w + height;
hole_x = wall + w + height / 2;
rad = min(wall + cable_wire_size(cable) / 2, depth / 2);
r = extrusion_width - eps;
the_nut = screw_nut(screw);
translate([-hole_x, 0])
difference() {
linear_extrude(height)
@@ -84,63 +86,69 @@ module single_cable_clip(screw, cable, h = 0, insert = false) {
rotate([90, 0, 0])
if(insert)
insert_hole(insert, 10, horizontal = true);
else
if(nut) {
translate_z(depth - wall - nut_trap_depth(the_nut))
nut_trap(screw, the_nut, horizontal = true);
nut_trap(screw, the_nut, horizontal = true);
}
else
teardrop_plus(h = 2 * depth + 1, r = screw_clearance_radius(screw), center = true);
}
}
module double_cable_clip(screw, cable1, cable2, insert = false) {
h = max(cable_clip_height(cable1, screw, insert), cable_clip_height(cable2, screw, insert));
module double_cable_clip(screw, cable1, cable2, insert = false, nut = false) {
h = max(cable_clip_height(cable1, screw, insert, nut), cable_clip_height(cable2, screw, insert, nut));
union() {
single_cable_clip(screw, cable1, h, insert);
single_cable_clip(screw, cable1, h, insert, nut);
mirror([1,0,0]) single_cable_clip(screw, cable2, h, insert);
mirror([1,0,0]) single_cable_clip(screw, cable2, h, insert, nut);
}
}
module cable_clip(screw, cable1, cable2 = 0, insert = false) { //! Create the STL for a single cable or two cable clip
function clip_str(screw) = str("cable_clip_", screw_radius(screw) * 20, insert ? "I" : "");
module cable_clip(screw, cable1, cable2 = 0, insert = false, nut = false) { //! Create the STL for a single cable or two cable clip
function clip_str(screw) = str("cable_clip_", screw_radius(screw) * 20, insert ? "I" : nut ? "N" : "");
function cable_str(cable) = str("_", cable_wires(cable), "_", round(cable_wire_size(cable) * 10));
if(cable2) {
stl(str(clip_str(screw), cable_str(cable1), cable_str(cable2)));
double_cable_clip(screw, cable1, cable2, insert);
}
else {
stl(str(clip_str(screw), cable_str(cable1)));
single_cable_clip(screw, cable1, h = 0, insert = insert);
}
assert(!(insert && nut), "insert and nut mutually exclusive");
if(cable2)
stl(str(clip_str(screw), cable_str(cable1), cable_str(cable2)))
double_cable_clip(screw, cable1, cable2, insert, nut);
else
stl(str(clip_str(screw), cable_str(cable1)))
single_cable_clip(screw, cable1, h = 0, insert = insert, nut = nut);
}
module cable_clip_assembly(screw, thickness, cable1, cable2 = 0, flip = false, insert = false) { //! Cable clip with the fasteners
flip = flip || insert; // Screw must be below if using an insert
module cable_clip_assembly(screw, thickness, cable1, cable2 = 0, flip = false, insert = false, nut = false, nyloc = true) { //! Cable clip with the fasteners
flip = flip || insert || nut; // Screw must be below if using an insert or nut
insert = cable_clip_insert(screw, insert);
height = max(cable_clip_height(cable1, screw, insert), cable2 ? cable_clip_height(cable2, screw, insert) : 0);
height = max(cable_clip_height(cable1, screw, insert, nut), cable2 ? cable_clip_height(cable2, screw, insert, nut) : 0);
stl_colour(pp1_colour) render()
translate([0, cable_clip_width(screw, insert) / 2])
translate([0, cable_clip_width(screw, insert, nut) / 2])
rotate([90, 0, 0])
cable_clip(screw, cable1, cable2, insert);
cable_clip(screw, cable1, cable2, insert, nut);
nut = screw_nut(screw);
screw_len = screw_length(screw, height + thickness, 2, nyloc = !insert, insert = insert);
the_nut = screw_nut(screw);
screw_len = nut ? screw_length(screw, thickness + wall, nyloc ? 1 : 2, nyloc = nyloc, nut = !nyloc)
: screw_length(screw, thickness + height, 2, nut = !nyloc && !insert, nyloc = !insert && nyloc, insert = insert);
translate_z(height)
if(flip)
if(insert)
insert(insert);
else
nut_and_washer(nut, true);
if(nut)
translate_z(-height + wall)
nut(the_nut, nyloc);
else
nut_and_washer(the_nut, nyloc);
else
screw_and_washer(screw, screw_len);
translate_z(-thickness)
vflip()
if(flip)
screw_and_washer(screw, screw_len, insert);
screw_and_washer(screw, screw_len, insert || !nyloc);
else
nut_and_washer(nut, true);
nut_and_washer(the_nut, nyloc);
}

View File

@@ -40,10 +40,10 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
<tr><td> <a href = "#dip">DIP</a> </td><td> <a href = "#opengrab">Opengrab</a> </td><td> <a href = "#springs">Springs</a> </td><td> <a href = "#led_bezel">LED_bezel</a> </td><td> <a href = "#rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#d_connectors">D_connectors</a> </td><td> <a href = "#pcb">PCB</a> </td><td> <a href = "#stepper_motors">Stepper_motors</a> </td><td> <a href = "#pcb_mount">PCB_mount</a> </td><td> <a href = "#rounded_triangle">Rounded_triangle</a> </td><td></td></tr>
<tr><td> <a href = "#displays">Displays</a> </td><td> <a href = "#pcbs">PCBs</a> </td><td> <a href = "#swiss_clips">Swiss_clips</a> </td><td> <a href = "#psu_shroud">PSU_shroud</a> </td><td> <a href = "#sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#psus">PSUs</a> </td><td> <a href = "#terminals">Terminals</a> </td><td> <a href = "#pocket_handle">Pocket_handle</a> </td><td> <a href = "#sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#extrusions">Extrusions</a> </td><td> <a href = "#panel_meters">Panel_meters</a> </td><td> <a href = "#toggles">Toggles</a> </td><td> <a href = "#press_fit">Press_fit</a> </td><td> <a href = "#thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#fans">Fans</a> </td><td> <a href = "#photo_interrupters">Photo_interrupters</a> </td><td> <a href = "#transformers">Transformers</a> </td><td> <a href = "#printed_box">Printed_box</a> </td><td> <a href = "#tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#fastons">Fastons</a> </td><td> <a href = "#pillars">Pillars</a> </td><td> <a href = "#ttracks">Ttracks</a> </td><td> <a href = "#printed_pulleys">Printed_pulleys</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#psus">PSUs</a> </td><td> <a href = "#terminals">Terminals</a> </td><td> <a href = "#pocket_handle">Pocket_handle</a> </td><td> <a href = "#splines">Splines</a> </td><td></td></tr>
<tr><td> <a href = "#extrusions">Extrusions</a> </td><td> <a href = "#panel_meters">Panel_meters</a> </td><td> <a href = "#toggles">Toggles</a> </td><td> <a href = "#press_fit">Press_fit</a> </td><td> <a href = "#sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#fans">Fans</a> </td><td> <a href = "#photo_interrupters">Photo_interrupters</a> </td><td> <a href = "#transformers">Transformers</a> </td><td> <a href = "#printed_box">Printed_box</a> </td><td> <a href = "#thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#fastons">Fastons</a> </td><td> <a href = "#pillars">Pillars</a> </td><td> <a href = "#ttracks">Ttracks</a> </td><td> <a href = "#printed_pulleys">Printed_pulleys</a> </td><td> <a href = "#tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#fuseholder">Fuseholder</a> </td><td> <a href = "#pillow_blocks">Pillow_blocks</a> </td><td> <a href = "#tubings">Tubings</a> </td><td> <a href = "#ribbon_clamp">Ribbon_clamp</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#gear_motors">Gear_motors</a> </td><td> <a href = "#pin_headers">Pin_headers</a> </td><td> <a href = "#variacs">Variacs</a> </td><td> <a href = "#ssr_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#geared_steppers">Geared_steppers</a> </td><td> <a href = "#potentiometers">Potentiometers</a> </td><td> <a href = "#veroboard">Veroboard</a> </td><td> <a href = "#screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
@@ -1459,7 +1459,7 @@ Geared tin can steppers
### Modules
| Module | Description |
|:--- |:--- |
| `geared_stepper(type)` | Draw the specified geared stepper |
| `geared_stepper(type, angle = 0)` | Draw the specified geared stepper with optional shaft angle. |
| `geared_stepper_screw_positions(type)` | Place children at the screw positions |
![geared_steppers](tests/png/geared_steppers.png)
@@ -2884,6 +2884,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `pcb(Melzi)` | Melzi electronics - not shown |
| 6 | | Micro SD card |
| 1 | | Micro SD card - not shown |
| 1 | `pcb(RCWL-0516)` | Microwave Radar Sensor |
| 1 | `molex_254(2)` | Molex KK header 2 way - not shown |
| 1 | `molex_254(3)` | Molex KK header 3 way - not shown |
| 20 | `nut(M2_nut, nyloc = true)` | Nut M2 x 1.6mm nyloc |
@@ -2911,8 +2912,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 8 | `screw(M2_cap_screw, 20)` | Screw M2 cap x 20mm |
| 4 | `screw(M2_cap_screw, 25)` | Screw M2 cap x 25mm |
| 2 | `screw(M2p5_cap_screw, 20)` | Screw M2.5 cap x 20mm |
| 4 | `screw(M2p5_cap_screw, 25)` | Screw M2.5 cap x 25mm |
| 4 | `screw(M2p5_cap_screw, 30)` | Screw M2.5 cap x 30mm |
| 8 | `screw(M2p5_cap_screw, 30)` | Screw M2.5 cap x 30mm |
| 12 | `screw(M2p5_cap_screw, 35)` | Screw M2.5 cap x 35mm |
| 4 | `screw(M2p5_dome_screw, 25)` | Screw M2.5 dome x 25mm |
| 4 | `screw(M2p5_pan_screw, 20)` | Screw M2.5 pan x 20mm |
@@ -2920,8 +2920,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 19 | `screw(M3_cap_screw, 16)` | Screw M3 cap x 16mm |
| 13 | `screw(M3_cap_screw, 20)` | Screw M3 cap x 20mm |
| 4 | `screw(M3_cap_screw, 25)` | Screw M3 cap x 25mm |
| 8 | `screw(M3_cap_screw, 30)` | Screw M3 cap x 30mm |
| 3 | `screw(M3_cap_screw, 35)` | Screw M3 cap x 35mm |
| 11 | `screw(M3_cap_screw, 35)` | Screw M3 cap x 35mm |
| 4 | `screw(M4_cap_screw, 20)` | Screw M4 cap x 20mm |
| 4 | `screw(M4_cap_screw, 25)` | Screw M4 cap x 25mm |
| 1 | `pcb(XIAO)` | Seeeduino XIAO |
@@ -2941,24 +2940,24 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| Qty | Filename |
| ---:|:--- |
| 4 | pcb_spacer20100.stl |
| 4 | pcb_spacer20140.stl |
| 4 | pcb_spacer20150.stl |
| 4 | pcb_spacer2070.stl |
| 4 | pcb_spacer2080.stl |
| 4 | pcb_spacer2090.stl |
| 2 | pcb_spacer25100.stl |
| 4 | pcb_spacer25130.stl |
| 4 | pcb_spacer25160.stl |
| 2 | pcb_spacer25110.stl |
| 4 | pcb_spacer25140.stl |
| 4 | pcb_spacer25170.stl |
| 4 | pcb_spacer25180_2.stl |
| 4 | pcb_spacer25180.stl |
| 4 | pcb_spacer25190_2.stl |
| 4 | pcb_spacer25230.stl |
| 4 | pcb_spacer25200_2.stl |
| 4 | pcb_spacer25240.stl |
| 4 | pcb_spacer25250.stl |
| 4 | pcb_spacer25260.stl |
| 4 | pcb_spacer2580.stl |
| 4 | pcb_spacer30120.stl |
| 4 | pcb_spacer30200.stl |
| 4 | pcb_spacer30130.stl |
| 4 | pcb_spacer30210.stl |
| 3 | pcb_spacer30220.stl |
| 4 | pcb_spacer30220.stl |
| 3 | pcb_spacer30230.stl |
| 10 | pcb_spacer3050.stl |
| 9 | pcb_spacer3060.stl |
| 9 | pcb_spacer3070.stl |
@@ -5365,7 +5364,7 @@ fixing_blocks along the sides.
---
<a name="cable_clip"></a>
## Cable_clip
Cable clips to order. Can be for one or two cables of different sizes. Can use an insert and a screw from below or a screw and nut either way up.
Cable clips to order. Can be for one or two cables of different sizes. Can use an insert and a screw from below or a screw and nut, nyloc or plain, either way up.
[printed/cable_clip.scad](printed/cable_clip.scad) Implementation.
@@ -5374,17 +5373,17 @@ Cable clips to order. Can be for one or two cables of different sizes. Can use a
### Functions
| Function | Description |
|:--- |:--- |
| `cable_clip_extent(screw, cable, insert = false)` | How far it extends from the screw. |
| `cable_clip_height(cable, screw = false, insert = false)` | Height given the `cable`. |
| `cable_clip_extent(screw, cable, insert = false, nut = false)` | How far it extends from the screw. |
| `cable_clip_height(cable, screw = false, insert = false, nut = false)` | Height given the `cable`. |
| `cable_clip_insert(screw, insert = true)` | Insert type for clip, given screw. |
| `cable_clip_offset(screw, cable, insert = false)` | The offset of the cable from the screw. |
| `cable_clip_width(screw, insert = false)` | Width given the `screw` and possibly insert. |
| `cable_clip_offset(screw, cable, insert = false, nut = false)` | The offset of the cable from the screw. |
| `cable_clip_width(screw, insert = false, nut = false)` | Width given the `screw` and possibly insert or nut. |
### Modules
| Module | Description |
|:--- |:--- |
| `cable_clip(screw, cable1, cable2 = 0, insert = false)` | Create the STL for a single cable or two cable clip |
| `cable_clip_assembly(screw, thickness, cable1, cable2 = 0, flip = false, insert = false)` | Cable clip with the fasteners |
| `cable_clip(screw, cable1, cable2 = 0, insert = false, nut = false)` | Create the STL for a single cable or two cable clip |
| `cable_clip_assembly(screw, thickness, cable1, cable2 = 0, flip = false, insert = false, nut = false, nyloc = true)` | Cable clip with the fasteners |
![cable_clip](tests/png/cable_clip.png)
@@ -5393,10 +5392,10 @@ Cable clips to order. Can be for one or two cables of different sizes. Can use a
| ---:|:--- |:---|
| 2 | `insert(CNCKM3)` | Heatfit insert M3 x 3mm |
| 5 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
| 2 | `screw(M3_dome_screw, 10)` | Screw M3 dome x 10mm |
| 3 | `screw(M3_dome_screw, 10)` | Screw M3 dome x 10mm |
| 1 | `screw(M3_dome_screw, 12)` | Screw M3 dome x 12mm |
| 4 | `screw(M3_dome_screw, 16)` | Screw M3 dome x 16mm |
| 12 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 3 | `screw(M3_dome_screw, 16)` | Screw M3 dome x 16mm |
| 11 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 2 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm |
### Printed
@@ -5404,10 +5403,10 @@ Cable clips to order. Can be for one or two cables of different sizes. Can use a
| ---:|:--- |
| 1 | cable_clip_30I_10_13.stl |
| 1 | cable_clip_30I_5_14_6_14.stl |
| 1 | cable_clip_30N_7_14_8_14.stl |
| 1 | cable_clip_30_1_14_2_14.stl |
| 1 | cable_clip_30_1_60.stl |
| 1 | cable_clip_30_3_14_4_14.stl |
| 1 | cable_clip_30_7_14_8_14.stl |
| 1 | cable_clip_30_9_14.stl |
@@ -7420,6 +7419,32 @@ A sector of a circle between two angles.
![sector](tests/png/sector.png)
<a href="#top">Top</a>
---
<a name="splines"></a>
## Splines
Cubic splines that interpolate between a list of 2D points passing through all of them.
Translated from the Python version at <https://community.alteryx.com/t5/Engine-Works/Creating-a-Cubic-Spline-in-Python-and-Alteryx/ba-p/581173>.
Note the x values of the points must be strictly increasing.
Catmull-Rom splines are well behaved but the ends points are control points and the curve only goes from the second point to the penultimate point.
Coded from <https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline#Code_example_in_Python>.
No restrictions on points and they can be 3D.
[utils/splines.scad](utils/splines.scad) Implementation.
[tests/splines.scad](tests/splines.scad) Code for this example.
### Functions
| Function | Description |
|:--- |:--- |
| `catmull_rom_spline(points, n, alpha = 0.5)` | Interpolate n new points between the specified points with a Catmull-Rom spline, alpha = 0.5 for centripetal, 0 for uniform and 1 for chordal. |
| `cubic_spline(points, N = 100)` | Interpolate the list of points given to produce N points on a cubic spline that passes through points given. |
![splines](tests/png/splines.png)
<a href="#top">Top</a>
---

View File

@@ -20,33 +20,39 @@
include <../core.scad>
use <../printed/cable_clip.scad>
use <../vitamins/wire.scad>
use <../utils/layout.scad>
screw = M3_dome_screw;
sheet_thickness = 3;
cables = [
[10, inch(0.05), true], 0, for(i = [1 : 9]) [i, 1.4], 0, [1, 6], 0,
];
screw = M3_dome_screw;
clips = [for(i = [0 : ceil(len(cables) / 2) - 1]) let(c1= cables[2 * i], c2 = cables[2 * i + 1]) [c1, c2]];
function use_insert(i) = in([0, 3], i);
function use_nut(i) = in([4], i);
clip_lengths = [for(i = [0 : len(clips) - 1])
let(c = clips[i], c1 = c.x, c2 = c.y, ins = use_insert(i), nut = use_nut(i))
cable_clip_extent(screw, c1, insert = ins, nut = nut) + (c2 ? cable_clip_extent(screw, c2, insert = ins, nut = nut) : cable_clip_width(screw, insert = ins, nut = nut) / 2)];
module cable_clips() {
for(i = [0 : ceil(len(cables) / 2) - 1]) {
cable1 = cables[2 * i];
cable2 = cables[2 * i + 1];
translate([i * 21 + (!cable2 ? cable_clip_offset(screw, cable1) / 2 : 0), 0]) {
insert = in([0, 3], i);
layout(clip_lengths, 3, true) let(cable1 = clips[$i].x, cable2 = clips[$i].y) {
insert = use_insert($i);
nut = use_nut($i);
translate([cable_clip_extent(screw, cable1, insert = insert, nut = nut) - clip_lengths[$i] / 2, 0]) {
if($preview) {
cable_clip_assembly(screw, sheet_thickness, cable1, cable2, insert = insert, flip = i == 1);
cable_clip_assembly(screw, sheet_thickness, cable1, cable2, insert = insert, nut = nut, flip = $i == 1);
for(j = [0 : 1])
let(cable = cables[2 * i + j])
let(cable = clips[$i][j])
if(cable)
let(positions = cable_bundle_positions(cable))
for(i = [0 : len(positions) - 1])
let(p = positions[i])
translate([p.x + [-1, 1][j] * cable_clip_offset(screw, cable, insert = insert), 0, p.y])
translate([p.x + [-1, 1][j] * cable_clip_offset(screw, cable, insert = insert, nut = nut), 0, p.y])
rotate([90, 0, 0])
color([grey(20), "blue", "red", "orange", "yellow", "green", "brown", "purple", "grey", "white"][i])
cylinder(d = cable_wire_size(cable), h = 30, center = true);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 KiB

After

Width:  |  Height:  |  Size: 241 KiB

BIN
tests/png/splines.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

38
tests/splines.scad Normal file
View File

@@ -0,0 +1,38 @@
//
// NopSCADlib Copyright Chris Palmer 2024
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
include <../utils/core/core.scad>
use <../utils/splines.scad>
use <../utils/sweep.scad>
points = [[0, 1.5], [2, 2], [3, 1], [4, -2], [5, 1], [6, 2], [7, 3]];
module splines() {
cm_spline = catmull_rom_spline(points, 100 / len(points), 0.5);
color("green") show_path(cm_spline, 0.01);
cu_spline = cubic_spline(points, 100);
color("blue") show_path(cu_spline, 0.01);
for(p = points)
translate(p) color("red")
cylinder($fn = 64, r = 0.03, h = 0.02, center = true);
}
rotate([70, 0, 315]) splines();

101
utils/splines.scad Normal file
View File

@@ -0,0 +1,101 @@
//
// NopSCADlib Copyright Chris Palmer 2024
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
//! Cubic splines that interpolate between a list of 2D points passing through all of them.
//! Translated from the Python version at <https://community.alteryx.com/t5/Engine-Works/Creating-a-Cubic-Spline-in-Python-and-Alteryx/ba-p/581173>.
//! Note the x values of the points must be strictly increasing.
//!
//! Catmull-Rom splines are well behaved but the ends points are control points and the curve only goes from the second point to the penultimate point.
//! Coded from <https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline#Code_example_in_Python>.
//! No restrictions on points and they can be 3D.
//
include <../utils/core/core.scad>
use <maths.scad>
use <sweep.scad>
function cubic_spline(points, N = 100) = let( //! Interpolate the list of points given to produce N points on a cubic spline that passes through points given.
N = N - 1,
n = len(points),
ass1 = assert(n >= 3, "must be at least 3 points")0,
dx = [for(i = [0 : n - 2]) points[i + 1].x - points[i].x], // x deltas
ass2 = assert(min(dx) > 0, "X must strictly increase")0,
//
// A and C are diagonals above and below the main diagonal B, which is all 2's
//
A = [for(i = [0 : n - 3]) dx[i] / (dx[i] + dx[i + 1]), 0],
C = [0, for(i = [0 : n - 3]) dx[i + 1] / (dx[i] + dx[i + 1]), 0],
//
// D are the target values on the right hand side of the equation
//
D = [0, for(i = [1 : n - 2]) 6 * ((points[i + 1].y - points[i].y) / dx[i] - (points[i].y - points[i - 1].y) / dx[i - 1]) / (dx[i] + dx[i - 1]), 0],
//
// Solve the tridiagonal equation using the Thomas algorithm
//
c = [for(i = 1, c = 0; i < n; c = C[i] / (2 - c * A[i - 1]), i = i + 1) c, 0],
d = [for(i = 1, d = 0; i < n; d = (D[i] - d * A[i - 1]) / (2 - c[i - 1] * A[i - 1]), i = i + 1) d, 0],
M = [for(i = n - 2, x = 0; i >= 0; x = d[i] - c[i] * x, i = i - 1) x, 0],
//
// Calculate the coefficients of each cubic curve
//
coefficients = [for(i = [0 : n - 2], dx2 = sqr(dx[i]), j = n - 1 - i)
[(M[j - 1] - M[j]) * dx2 / 6,
M[j] * dx2 / 2,
points[i + 1].y - points[i].y - (M[j - 1] + 2 * M[j]) * dx2 / 6,
points[i].y]
],
//
// Use the coefficients to interpolate between the points
//
x0 = points[0].x,
x1 = points[n - 1].x,
spline = [for(i = 0, j = 0, z = 0, x = x0; i <= N + 1;
x = x0 + (x1 - x0) * i / N,
j = i < N - 1 && x > points[j + 1].x ? j + 1 : j,
z = (x - points[j].x) / dx[j],
i = i + 1,
C = coefficients[j]
) if(i) [x, (((C[0] * z) + C[1]) * z + C[2]) * z + C[3]]
]
) spline;
function tj(ti, pi, pj, alpha = 0.5) = ti + pow(norm(pi - pj), alpha);
function catmull_rom_segment(P0, P1, P2, P3, n, alpha = 0.5, last = false) = let(
t0 = 0,
t1 = tj(t0, P0, P1, alpha),
t2 = tj(t1, P1, P2, alpha),
t3 = tj(t2, P2, P3, alpha),
end = last ? n : n - 1,
points = [for(i = [0 : end], t = t1 + (t2 - t1) * i / n) let(
A1 = (t1 - t) / (t1 - t0) * P0 + (t - t0) / (t1 - t0) * P1,
A2 = (t2 - t) / (t2 - t1) * P1 + (t - t1) / (t2 - t1) * P2,
A3 = (t3 - t) / (t3 - t2) * P2 + (t - t2) / (t3 - t2) * P3,
B1 = (t2 - t) / (t2 - t0) * A1 + (t - t0) / (t2 - t0) * A2,
B2 = (t3 - t) / (t3 - t1) * A2 + (t - t1) / (t3 - t1) * A3
) (t2 - t) / (t2 - t1) * B1 + (t - t1) / (t2 - t1) * B2]
) points;
function catmull_rom_spline(points, n, alpha = 0.5) = let( //! Interpolate n new points between the specified points with a Catmull-Rom spline, alpha = 0.5 for centripetal, 0 for uniform and 1 for chordal.
segs = len(points) - 3
) [for(i = [0 : segs - 1]) each catmull_rom_segment(points[i], points[i + 1], points[i + 2], points[i + 3], n, alpha, last = i == segs - 1)];

View File

@@ -47,7 +47,7 @@ thread_colour_factor = 0.8; // 60 degree threads appear too bright due to the an
function thread_profile(h, crest, angle, overlap = 0.1) = //! Create thread profile path
let(base = crest + 2 * (h + overlap) * tan(angle / 2))
[[-base / 2, -overlap, 0], [-crest / 2, h, 0], [crest / 2, h, 0], [base / 2, -overlap, 0]];
[[-base / 2, -overlap, 0], [-crest / 2, h, 0], if(crest) [crest / 2, h, 0], [base / 2, -overlap, 0]];
module thread(dia, pitch, length, profile, center = true, top = -1, bot = -1, starts = 1, solid = true, female = false, colour = undef) { //! Create male or female thread, ends can be tapered, chamfered or square
assert(is_undef(colour) || is_list(colour), "Thread colour must be in [r, g, b] form");

View File

@@ -52,7 +52,7 @@ module geared_stepper_screw_positions(type) //! Place children at the screw posi
motor_colour = "#9BA2AC";
gearbox_colour = "#FFF7EE";
module geared_stepper(type) { //! Draw the specified geared stepper
module geared_stepper(type, angle = 0) { //! Draw the specified geared stepper with optional shaft angle.
vitamin(str("geared_stepper(", type[0], "): Geared stepper - ", type[1]));
radius = gs_diameter(type) / 2;
@@ -125,6 +125,7 @@ module geared_stepper(type) { //! Draw the specified geared stepper
f = gs_shaft_flat(type);
two_flats = f < 0;
vflip()
rotate(angle)
color(two_flats ? brass : gearbox_colour) {
d = gs_shaft_d(type);
h = gs_shaft_length(type);

View File

@@ -212,13 +212,10 @@ module threaded_insert(type) { //! Draw specified threaded insert, for use in wo
thread_l = insert_length(type) - z; // - insert_ring1_h(type);
vitamin(str("threaded_insert(", type[0], "): Threaded insert M", insert_screw_diameter(type), " x ", length, "mm"));
union() {
color(silver)
difference() {
render() difference() {
base_insert(type);
translate_z(-socket/2 + 0.01)
cylinder(r=socket, $fn = 6, h=socket/2);
@@ -245,5 +242,4 @@ module threaded_insert(type) { //! Draw specified threaded insert, for use in wo
female = false,
colour = silver);
}
}

View File

@@ -1202,6 +1202,28 @@ ESP_12F = pcb("ESP_12F", "ESP-12F ESP8266 WiFi module", [24, 16, 0.8],
]
);
RCWL0516 = pcb(
"RCWL-0516", "Microwave Radar Sensor",
size = [36, 17.3, 1.2],
colour = "#17682d",
hole_d = 1.7,
holes = [
[ inch(0.05), inch(0.05) ],
[ -inch(0.05), inch(0.05) ],
[ -inch(0.05), -inch(0.05) ],
[ inch(0.05), -inch(0.05) ],
[ -inch(0.65), -inch(0.05) ],
[ -inch(0.65), inch(0.05) ],
],
grid = [inch(0.05), inch(0.13), 1, 5, silver, inch(0.1), inch(0.1)],
components = [
[inch(0.18), inch(0.13), 90,"smd_cap", CAP1206, 0.5],
[inch(0.18), inch(0.32), 90,"smd_cap", CAP1206, 0.5],
[inch(0.18), inch(0.54), 90,"smd_cap", CAP1206, 0.5],
[inch(0.45), inch(0.34), 0,"smd_soic", SOIC16, "RCWL9196"],
]
);
tiny_buck = pcb("tiny_buck", "Ultra Small 3A buck regulator", [20, 11, 1.6],
hole_d = 1.2,
land_d = [2, 2],
@@ -1226,7 +1248,7 @@ tiny_pcbs = [ESP_201, ESP_01M, XIAO, ESP_12F, MP1584EN, ESP_01,tiny_buck, LIPO_f
big_pcbs = [BTT_RELAY_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_E3_TURBO, BTT_SKR_V1_4_TURBO, DuetE, Duex5];
pcbs = [KY_040, TP4056, L9110S, ZC_A0591, MT3608, RAMPSEndstop, ArduinoNano, HW803_1WAY_RELAY, Feather405, RPI_Pico, ESP32_DOIT_V1, RPI0, EnviroPlus, ArduinoUno3, ArduinoLeonardo, WD2002SJ, OPZ2, PanelDue_v3, RPI3A, RPI3, RPI4];
pcbs = [KY_040, TP4056, L9110S, ZC_A0591, RCWL0516, MT3608,RAMPSEndstop, ArduinoNano, HW803_1WAY_RELAY, Feather405, RPI_Pico, ESP32_DOIT_V1, RPI0, EnviroPlus, ArduinoUno3, ArduinoLeonardo, WD2002SJ, OPZ2, PanelDue_v3, RPI3A, RPI3, RPI4];
pcbs_not_shown = [Melzi, Duex2, PSU12V1A, Keyes5p1, PI_IO, ExtruderPCB];

View File

@@ -35,8 +35,8 @@ neon_spades = [[spade4p8, 7.3, 0, -7, 0],
//
// w h t
//
small_rocker = ["small_rocker", "Rocker Switch PRASA1-16F-BB0BW", 13, 19.8, 15, 21, 2, 12.8, 18.5, 11.8, 2.5, -1, 3.8, small_spades];
neon_indicator = ["neon_indicator", "Neon Indicator H8630FBNAL", 13, 19.8, 15, 21, 2, 12.8, 18.5, 12.5, 2.5, 0, 0.3, neon_spades];
small_rocker = ["small_rocker", "Rocker Switch PRASA1-16F-BB0BW", 13, 19.25, 15, 21, 2, 12.8, 18.5, 11.8, 2.5, -1, 3.8, small_spades];
neon_indicator = ["neon_indicator", "Neon Indicator H8630FBNAL", 13, 19.25, 15, 21, 2, 12.8, 18.5, 12.5, 2.5, 0, 0.3, neon_spades];
rockers = [small_rocker, neon_indicator];