mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-30 08:59:10 +02:00
The wire() module can now draw wires if a path is specified.
This commit is contained in:
@@ -4545,7 +4545,7 @@ Utilities for adding wires to the BOM and optionally drawing them and cable bund
|
|||||||
| `cable_tie_holes(cable_r, h = 100)` | Holes to thread a ziptie through a panel to make a cable tie. |
|
| `cable_tie_holes(cable_r, h = 100)` | Holes to thread a ziptie through a panel to make a cable tie. |
|
||||||
| `mouse_hole(cable, h = 100, teardrop = false)` | A mouse hole to allow a panel to go over a wire bundle. |
|
| `mouse_hole(cable, h = 100, teardrop = false)` | A mouse hole to allow a panel to go over a wire bundle. |
|
||||||
| `ribbon_cable(ways, length)` | Add ribbon cable to the BOM |
|
| `ribbon_cable(ways, length)` | Add ribbon cable to the BOM |
|
||||||
| `wire(colour, strands, length, strand = 0.2)` | Add stranded wire to the BOM |
|
| `wire(colour, strands, length, strand = 0.2, d = 0, path = [])` | Add stranded wire to the BOM and draw it if diameter and path specified |
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
@@ -25,8 +25,12 @@ use <../utils/sweep.scad>
|
|||||||
use <../utils/maths.scad>
|
use <../utils/maths.scad>
|
||||||
include <zipties.scad>
|
include <zipties.scad>
|
||||||
|
|
||||||
module wire(colour, strands, length, strand = 0.2) //! Add stranded wire to the BOM
|
module wire(colour, strands, length, strand = 0.2, d = 0, path = []) { //! Add stranded wire to the BOM and draw it if diameter and path specified
|
||||||
vitamin(str(": Wire ", colour, " ", strands, "/", strand, "mm strands, length ",length, "mm"));
|
vitamin(str(": Wire ", colour, " ", strands, "/", strand, "mm strands, length ", ceil(length + path_length(path)), "mm"));
|
||||||
|
|
||||||
|
if(path && d)
|
||||||
|
color(colour) sweep(path, circle_points(r = d / 2));
|
||||||
|
}
|
||||||
|
|
||||||
module ribbon_cable(ways, length) //! Add ribbon cable to the BOM
|
module ribbon_cable(ways, length) //! Add ribbon cable to the BOM
|
||||||
vitamin(str(": Ribbon cable ", ways, " way ", length, "mm"));
|
vitamin(str(": Ribbon cable ", ways, " way ", length, "mm"));
|
||||||
|
Reference in New Issue
Block a user