1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-04 12:45:30 +02:00

Compare commits

..

4 Commits

Author SHA1 Message Date
Chris Palmer
4a55e8eb6c Added hflip(). 2019-06-14 21:38:12 +01:00
Chris Palmer
bf4f64e7bc Removed Z-fighting on 3D hot end 2019-06-14 17:48:29 +01:00
Chris Palmer
a51e96ec43 Nuts now show their thickness on the BOM so half nuts have a different description. 2019-06-14 17:13:12 +01:00
Chris Palmer
b719601a64 Fixed cable strip parameters and BOM desciption 2019-06-14 16:54:51 +01:00
7 changed files with 54 additions and 56 deletions

View File

@@ -373,20 +373,16 @@ When the sides are constrained then a circular model is more accurate.
### Modules
| Module | Description |
|:--- |:--- |
| ```bezier_cable_strip(ways, depth, length, travel, pos, below, extra)``` | Draw a cable strip using a Bezier curve |
| ```cable_strip(ways, depth, travel, x, extra = 15)``` | Draw a cable stripe with a semi circular fold |
| ```bezier_cable_strip(ways, depth, length, below, extra, pos = 0)``` | Draw a cable strip using a Bezier curve |
| ```cable_strip(ways, depth, travel, extra = 15, pos = 0)``` | Draw a cable stripe with a semi circular fold |
![cable_strips](tests/png/cable_strips.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```bezier_cable_strip(20, 50, 150, 100, -100, 100, 10)``` | Polypropylene strip 170mm x 26mm x 0.8mm |
| 1 | ```bezier_cable_strip(20, 50, 150, 100, 0, 100, 10)``` | Polypropylene strip 170mm x 26mm x 0.8mm |
| 1 | ```bezier_cable_strip(20, 50, 150, 100, 100, 100, 10)``` | Polypropylene strip 170mm x 26mm x 0.8mm |
| 1 | ```cable_strip(20, 25, 100, -100, 30)``` | Polypropylene strip 189mm x 24mm x 0.8mm |
| 1 | ```cable_strip(20, 25, 100, 0, 30)``` | Polypropylene strip 189mm x 24mm x 0.8mm |
| 1 | ```cable_strip(20, 25, 100, 100, 30)``` | Polypropylene strip 189mm x 24mm x 0.8mm |
| 3 | ```bezier_cable_strip(20, 50, 150, 100, 10)``` | Polypropylene strip 170mm x 26mm x 0.8mm |
| 3 | ```cable_strip(20, 25, 100, 30)``` | Polypropylene strip 189mm x 24mm x 0.8mm |
<a href="#top">Top</a>
@@ -641,9 +637,9 @@ Can draw three styles: solid, open frame and open frame with screw bosses.
| 1 | ```fan(fan70x15)``` | Fan 70mm x 15mm |
| 1 | ```fan(fan80x25)``` | Fan 80mm x 25mm |
| 1 | ```fan(fan80x38)``` | Fan 80mm x 38mm |
| 4 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 nyloc |
| 8 | ```nut(M3_nut, nyloc = true)``` | Nut M3 nyloc |
| 28 | ```nut(M4_nut, nyloc = true)``` | Nut M4 nyloc |
| 4 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 8 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 28 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 4 | ```screw(M2p5_pan_screw, 20)``` | Screw M2.5 pan x 20mm |
| 8 | ```screw(M3_dome_screw, 20)``` | Screw M3 dome x 20mm |
| 20 | ```screw(M4_dome_screw, 16)``` | Screw M4 dome x 16mm |
@@ -802,7 +798,7 @@ IEC mains inlets and outlet.
| 1 | ```iec(IEC_inlet)``` | IEC inlet |
| 1 | ```iec(IEC_inlet_atx)``` | IEC inlet for ATX |
| 1 | ```iec(IEC_outlet)``` | IEC outlet |
| 8 | ```nut(M3_nut, nyloc = true)``` | Nut M3 nyloc |
| 8 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 4 | ```screw(M3_cs_cap_screw, 10)``` | Screw M3 cs cap x 10mm |
| 4 | ```screw(M3_cs_cap_screw, 12)``` | Screw M3 cs cap x 12mm |
| 8 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
@@ -1316,7 +1312,7 @@ Random screw down modules. Currently just DROK buck converters.
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```mod(drok_buck)``` | Drok buck converter |
| 2 | ```nut(M4_nut, nyloc = true)``` | Nut M4 nyloc |
| 2 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 2 | ```screw(M4_dome_screw, 12)``` | Screw M4 dome x 12mm |
| 4 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
@@ -1366,23 +1362,23 @@ If a nut is given a child then it gets placed on its top surface.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```nut(M2_nut)``` | Nut M2 |
| 1 | ```nut(M2_nut, nyloc = true)``` | Nut M2 nyloc |
| 1 | ```nut(M2p5_nut)``` | Nut M2.5 |
| 1 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 nyloc |
| 1 | ```nut(M2p5_nut, nylon = true)``` | Nut M2.5 nylon |
| 1 | ```nut(M3_nut)``` | Nut M3 |
| 1 | ```nut(M3_nut, brass = true)``` | Nut M3 brass |
| 1 | ```nut(M3_nut, nyloc = true)``` | Nut M3 nyloc |
| 1 | ```nut(M4_nut)``` | Nut M4 |
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 nyloc |
| 1 | ```nut(M5_nut)``` | Nut M5 |
| 1 | ```nut(M5_nut, nyloc = true)``` | Nut M5 nyloc |
| 1 | ```nut(M6_nut)``` | Nut M6 |
| 1 | ```nut(M6_half_nut)``` | Nut M6 |
| 1 | ```nut(M6_nut, nyloc = true)``` | Nut M6 nyloc |
| 1 | ```nut(M8_nut)``` | Nut M8 |
| 1 | ```nut(M8_nut, nyloc = true)``` | Nut M8 nyloc |
| 1 | ```nut(M2_nut)``` | Nut M2 x 1.6mm |
| 1 | ```nut(M2_nut, nyloc = true)``` | Nut M2 x 1.6mm nyloc |
| 1 | ```nut(M2p5_nut)``` | Nut M2.5 x 2.2mm |
| 1 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 1 | ```nut(M2p5_nut, nylon = true)``` | Nut M2.5 x 2.2mm nylon |
| 1 | ```nut(M3_nut)``` | Nut M3 x 2.4mm |
| 1 | ```nut(M3_nut, brass = true)``` | Nut M3 x 2.4mm brass |
| 1 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 1 | ```nut(M4_nut)``` | Nut M4 x 3.2mm |
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 1 | ```nut(M5_nut)``` | Nut M5 x 4mm |
| 1 | ```nut(M5_nut, nyloc = true)``` | Nut M5 x 4mm nyloc |
| 1 | ```nut(M6_half_nut)``` | Nut M6 x 3mm |
| 1 | ```nut(M6_nut)``` | Nut M6 x 5mm |
| 1 | ```nut(M6_nut, nyloc = true)``` | Nut M6 x 5mm nyloc |
| 1 | ```nut(M8_nut)``` | Nut M8 x 6.5mm |
| 1 | ```nut(M8_nut, nyloc = true)``` | Nut M8 x 6.5mm nyloc |
| 1 | ```washer(M6_washer)``` | Washer M6 x 12.5mm x 1.5mm |
| 1 | ```wingnut(M4_wingnut)``` | Wingnut M4 |
@@ -1540,10 +1536,10 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 2 | | Micro SD card |
| 1 | ```molex_254(2)``` | Molex KK header 2 way |
| 1 | ```molex_254(3)``` | Molex KK header 3 way |
| 16 | ```nut(M2_nut, nyloc = true)``` | Nut M2 nyloc |
| 12 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 nyloc |
| 12 | ```nut(M3_nut, nyloc = true)``` | Nut M3 nyloc |
| 4 | ```nut(M4_nut, nyloc = true)``` | Nut M4 nyloc |
| 16 | ```nut(M2_nut, nyloc = true)``` | Nut M2 x 1.6mm nyloc |
| 12 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 12 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 4 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 1 | ```pcb(PI_IO)``` | PI_IO V2 |
| 1 | ```pcb(PSU12V1A)``` | PSU 12V 1A |
| 1 | ```pcb(PERF60x40)``` | Perfboard 60 x 40mm |
@@ -1841,9 +1837,9 @@ Linear rails with carriages.
| 1 | ```rail(MGN7, 200)``` | Linear rail MGN7 x 200mm |
| 1 | ```rail(MGN9, 200)``` | Linear rail MGN9 x 200mm |
| 1 | ```rail(SSR15, 200)``` | Linear rail SSR15 x 200mm |
| 26 | ```nut(M2_nut, nyloc = true)``` | Nut M2 nyloc |
| 17 | ```nut(M3_nut, nyloc = true)``` | Nut M3 nyloc |
| 4 | ```nut(M4_nut, nyloc = true)``` | Nut M4 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 |
| 4 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 11 | ```screw(M2_cap_screw, 10)``` | Screw M2 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 |
@@ -1899,7 +1895,7 @@ Ring terminals and earth assemblies for DiBond panels.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```nut(M3_nut, nyloc = true)``` | Nut M3 nyloc |
| 1 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 1 | ```ring_terminal(M3_ringterm)``` | Ring terminal 3mm |
| 1 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
| 2 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
@@ -2307,7 +2303,7 @@ Solid state relays.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | ```nut(M4_nut, nyloc = true)``` | Nut M4 nyloc |
| 4 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 4 | ```screw(M4_cap_screw, 16)``` | Screw M4 cap x 16mm |
| 1 | ```ssr(SSR25DA)``` | Solid state relay Fotek 25A |
| 1 | ```ssr(SSR10DA)``` | Solid state relay Robodigg 10A |
@@ -2635,7 +2631,7 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 2 | ```idc_transition(2p54header, 10)``` | IDC transition header 10 x 2 |
| 4 | ```nut(M3_nut, nyloc = true)``` | Nut M3 nyloc |
| 4 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 4 | ```screw(M3_dome_screw, 25)``` | Screw M3 dome x 25mm |
| 2 | ```terminal_254(10)``` | Terminal block 10 way 0.1" |
| 2 | ```veroboard(z_vb)``` | Veroboard 5 holes x 22strips |
@@ -3155,7 +3151,7 @@ Rubber door [sealing strip](#sealing_strip) is used to make it airtight and a [d
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | ```nut(M4_nut, nyloc = true)``` | Nut M4 nyloc |
| 4 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 2 | ```screw(M3_cap_screw, 35)``` | Screw M3 cap x 35mm |
| 4 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
| 4 | ```screw(M4_dome_screw, 16)``` | Screw M4 dome x 16mm |
@@ -3199,7 +3195,7 @@ Door latch for 6mm acrylic door for 3D printer. See [door_hinge](#door_hinge).
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 nyloc |
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 1 | ```screw(M4_hex_screw, 20)``` | Screw M4 hex x 20mm |
| 2 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
@@ -3372,7 +3368,7 @@ inserts don't grip well in rubber.
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 nyloc |
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 1 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 1 | ```screw(M4_cap_screw, 16)``` | Screw M4 cap x 16mm |
| 1 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
@@ -3564,7 +3560,7 @@ UK 13A socket and printed backbox with earth terminal for the panel it is mounte
| 4 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 1 | ```mains_socket(Contactum)``` | Mains socket 13A |
| 1 | ```mains_socket(MKLOGIC)``` | Mains socket 13A, switched |
| 2 | ```nut(M3_nut, nyloc = true)``` | Nut M3 nyloc |
| 2 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 2 | ```ring_terminal(M3_ringterm)``` | Ring terminal 3mm |
| 4 | ```screw(M3_cs_cap_screw, 20)``` | Screw M3 cs cap x 20mm |
| 2 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
@@ -4122,6 +4118,7 @@ Global constants, functions and modules. This file is used directly or indirectl
| ```circle4n(r, d = undef)``` | Circle with multiple of 4 vertices |
| ```ellipse(xr, yr)``` | Draw an ellipse |
| ```extrude_if(h, center = true)``` | Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D |
| ```hflip()``` | Invert children by doing a 180 glip around the Y axis |
| ```semi_circle(r, d = undef)``` | A semi circle in the positive Y domain |
| ```translate_z(z)``` | Shortcut for Z only translations |
| ```vflip()``` | Invert children by doing a 180 flip around the X axis |

View File

@@ -24,11 +24,11 @@ module cable_strips() {
depth = 50;
rotate(-90)
for(pos = [-100, 0, 100]) {
bezier_cable_strip(ways = 20, depth = depth, length = 150, travel = 100, pos = pos, below = 100, extra = 10);
bezier_cable_strip(ways = 20, depth = depth, length = 150, below = 100, extra = 10, pos = pos);
translate([0, depth * 2])
rotate([0, -90, 0])
cable_strip(ways =20, depth = depth / 2, travel = 100, x = pos, extra = 30);
cable_strip(ways =20, depth = depth / 2, travel = 100, extra = 30, pos = pos);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View File

@@ -32,6 +32,7 @@ function r2sides4n(r) = floor((r2sides(r) + 3) / 4) * 4;
module translate_z(z) translate([0, 0, z]) children(); //! Shortcut for Z only translations
module vflip() rotate([180, 0, 0]) children(); //! Invert children by doing a 180 flip around the X axis
module hflip() rotate([0, 180, 0]) children(); //! Invert children by doing a 180 glip around the Y axis
module ellipse(xr, yr) scale([1, yr / xr]) circle4n(xr); //! Draw an ellipse
module extrude_if(h, center = true) //! Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D

View File

@@ -44,14 +44,14 @@ function cable_strip_control_points(depth, min_z, pos) = let(z = min(min_z, min_
function bezier_cable_length(depth, min_z, pos) = //! Calculate a length that will achieve the desired minimum z
bezier_length(adjust_bezier_z(cable_strip_control_points(depth, min_z, pos), min_z));
module bezier_cable_strip(ways, depth, length, travel, pos, below, extra) { //! Draw a cable strip using a Bezier curve
module bezier_cable_strip(ways, depth, length, below, extra, pos = 0) { //! Draw a cable strip using a Bezier curve
width = ceil(ribbon_clamp_slot(ways) - 1);
thickness = cable_strip_thickness;
total = 2 * extra + length;
vitamin(str("bezier_cable_strip(", ways, ", ", depth, ", ", length, ", ", travel, ", ", pos, ", ", below, ", ", extra,
vitamin(str("bezier_cable_strip(", ways, ", ", depth, ", ", length, ", ", below, ", ", extra,
"): Polypropylene strip ", total, "mm x ", width, "mm x ", thickness, "mm"));
c = cable_strip_control_points(depth, -below + extra, pos);
@@ -71,7 +71,7 @@ module bezier_cable_strip(ways, depth, length, travel, pos, below, extra) { //!
function cable_strip_length(depth, travel, extra = 15) = ceil(travel / 2 + 2 * extra + PI * depth); //! Calculate circular cable strip length
module cable_strip(ways, depth, travel, x, extra = 15) { //! Draw a cable stripe with a semi circular fold
module cable_strip(ways, depth, travel, extra = 15, pos = 0) { //! Draw a cable stripe with a semi circular fold
width = ribbon_clamp_slot(ways);
@@ -79,15 +79,15 @@ module cable_strip(ways, depth, travel, x, extra = 15) { //! Draw a cable strip
radius = depth / 2;
top = travel / 4 + extra + x / 2;
bottom = travel / 4 + extra - x /2;
top = travel / 4 + extra + pos / 2;
bottom = travel / 4 + extra - pos /2;
length = max(top, bottom);
total = ceil(top + bottom + PI * depth);
w = floor(width - 2);
vitamin(str("cable_strip(", ways, ", ", depth, ", ", travel, ", ", x, arg(extra, 15), "): Polypropylene strip ", total, "mm x ", w, "mm x ", thickness, "mm"));
vitamin(str("cable_strip(", ways, ", ", depth, ", ", travel, arg(extra, 15), "): Polypropylene strip ", total, "mm x ", w, "mm x ", thickness, "mm"));
color(cable_strip_color) linear_extrude(height = w, center = true, convexity = 4)
difference() {
@@ -108,7 +108,7 @@ module cable_strip(ways, depth, travel, x, extra = 15) { //! Draw a cable strip
translate([0, -thickness / 2])
square([travel, thickness * 2]);
translate([x, depth - thickness - thickness / 2])
translate([pos, depth - thickness - thickness / 2])
square([travel, thickness * 2]);
}
}

View File

@@ -112,7 +112,7 @@ module e3d_fan_duct(type) {
module e3d_fan(type) {
e3d_fan_duct(type);
translate([fan_x_offset + 5, 0, 15])
translate([fan_x_offset + 5 + eps, 0, 15])
rotate([0, 90, 0])
not_on_bom()
fan(fan30x10);

View File

@@ -40,10 +40,10 @@ module nut(type, nyloc = false, brass = false, nylon = false) { //! Draw specifi
hole_rad = nut_size(type) / 2;
outer_rad = nut_radius(type);
thickness = nut_thickness(type);
nyloc_thickness = type[4];
nyloc_thickness = nut_thickness(type, true);
desc = nyloc ? "nyloc" : brass ? "brass" : nylon ? "nylon" : "";
vitamin(str("nut(", type[0], arg(nyloc, false, "nyloc"), arg(brass, false, "brass"), arg(nylon, false, "nylon"),
"): Nut M", nut_size(type), " ", desc));
"): Nut M", nut_size(type), " x ", thickness, "mm ", desc));
explode(nyloc ? 10 : 0)
color(brass ? brass_colour : nylon ? grey30: grey70) {