Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
79478104d6 | ||
|
38196e9f78 | ||
|
9666c018a0 | ||
|
8372655f25 | ||
|
f8a9c16360 | ||
|
38988bacfa | ||
|
f26ed7443d | ||
|
453b68aaf9 | ||
|
1ce7b64c73 | ||
|
9230fa78d7 | ||
|
a85c5cfa4b | ||
|
926dd8ca90 | ||
|
2ccfc1b506 | ||
|
fff0e9e3cb | ||
|
43b101ae1e | ||
|
f85fdca051 | ||
|
1fc2be04d5 | ||
|
e3ad32713d | ||
|
82980392c9 | ||
|
3961d7f1a4 | ||
|
1996189ab2 | ||
|
9f8c309643 | ||
|
3995f685dd | ||
|
e2ba69be46 |
36
CHANGELOG.md
@@ -3,6 +3,42 @@
|
||||
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
|
||||
|
||||
|
||||
### [v21.12.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.12.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.11.0...v21.12.0 "diff with v21.11.0")
|
||||
* 2024-02-05 [`38988ba`](https://github.com/nophead/NopSCADlib/commit/38988bacfa41dea19408b19cf06f134e51338ab0 "show commit") [C.P.](# "Chris Palmer") Updated images.
|
||||
|
||||
* 2024-02-04 [`8298039`](https://github.com/nophead/NopSCADlib/commit/82980392c9c9d13aa4619db888bd38c620b09ac0 "show commit") [J.R.](# "Jeroen Roos") Add extra MDF thicknesses
|
||||
|
||||
* 2024-02-05 [`1ce7b64`](https://github.com/nophead/NopSCADlib/commit/1ce7b64c73c77aa86f20c2b069ee031b30024818 "show commit") [C.P.](# "Chris Palmer") Updated image.
|
||||
|
||||
* 2024-02-04 [`f85fdca`](https://github.com/nophead/NopSCADlib/commit/f85fdca051a3cd11a35bfe2424c50cc4da018de4 "show commit") [J.R.](# "Jeroen Roos") Add generating SVG file for CNC usage
|
||||
|
||||
* Generate SVG files, like DXF files for CNC usage
|
||||
|
||||
* 2024-02-04 [`926dd8c`](https://github.com/nophead/NopSCADlib/commit/926dd8ca908030328d394dcc20e16ce036cbc51c "show commit") [C.P.](# "Chris Palmer") Reordered the PCB lists to fix the layout.
|
||||
Updated the images.
|
||||
|
||||
* 2024-02-02 [`3961d7f`](https://github.com/nophead/NopSCADlib/commit/3961d7f1a4d3fd04a2fb174735d52ad8f95ecf7a "show commit") [L.B.](# "Lukas Burger") add HW-803 5V 1 way relay module
|
||||
|
||||
* 2024-02-04 [`43b101a`](https://github.com/nophead/NopSCADlib/commit/43b101ae1eb063018b29eb97172722d1977c1c53 "show commit") [C.P.](# "Chris Palmer") Reordered the display list into reducing height for better layout.
|
||||
Updated the images.
|
||||
|
||||
* 2024-01-31 [`1996189`](https://github.com/nophead/NopSCADlib/commit/1996189ab232820a16cfa4a4b2d627cf508d6eb9 "show commit") [L.B.](# "Lukas Burger") update readme file
|
||||
|
||||
* 2024-01-30 [`9f8c309`](https://github.com/nophead/NopSCADlib/commit/9f8c3096435b7fea8a8870f07781a0f52adac7c3 "show commit") [L.B.](# "Lukas Burger") add display LCD2004A
|
||||
|
||||
* 2024-02-04 [`e3ad327`](https://github.com/nophead/NopSCADlib/commit/e3ad32713dbb5dfab3a14d70f9c6f5f8aaaa59d1 "show commit") [C.](# "Chris") Rename `pcb_utils.scad` to `PCB_utils.scad`
|
||||
|
||||
* Fixed the filename case of `PCB_utils.scad`.
|
||||
|
||||
* 2024-01-14 [`3995f68`](https://github.com/nophead/NopSCADlib/commit/3995f685dd31b087a2eec4cfe8b9f760f5eef3b9 "show commit") [C.P.](# "Chris Palmer") Removed debug `echo()`.
|
||||
|
||||
### [v21.11.0](https://github.com/nophead/NopSCADlib/releases/tag/v21.11.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v21.10.1...v21.11.0 "diff with v21.10.1")
|
||||
* 2024-01-14 [`41859ec`](https://github.com/nophead/NopSCADlib/commit/41859ec2245e3fee41cb9c79fb5a627193a4fec8 "show commit") [C.P.](# "Chris Palmer") Added `screw_thread_radius()` and `screw_angle()` functions.
|
||||
|
||||
* 2024-01-14 [`cd95ef9`](https://github.com/nophead/NopSCADlib/commit/cd95ef95abed30e4004905972c9abcacdad0dc5e "show commit") [C.P.](# "Chris Palmer") Added GT2x12, GT3x6, GT3x9 and GT3x12 belts.
|
||||
|
||||
* 2024-01-12 [`7a9e738`](https://github.com/nophead/NopSCADlib/commit/7a9e73830e16a843a14debb8d9b770243067cf63 "show commit") [C.P.](# "Chris Palmer") Belt part number is not always the same as the pitch.
|
||||
|
||||
#### [v21.10.1](https://github.com/nophead/NopSCADlib/releases/tag/v21.10.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v21.10.0...v21.10.1 "diff with v21.10.0")
|
||||
* 2023-12-01 [`ebe2dfd`](https://github.com/nophead/NopSCADlib/commit/ebe2dfd4fd8ba042b634030f7d463d0ba0d8c4cd "show commit") [C.P.](# "Chris Palmer") Fixed explode line position on short inserts.
|
||||
|
||||
|
@@ -41,13 +41,14 @@ pp1_colour = is_undef($pp1_colour) ? rr_green : $pp1_colour;// pri
|
||||
pp2_colour = is_undef($pp2_colour) ? crimson : $pp2_colour;// printed part colour 2
|
||||
pp3_colour = is_undef($pp3_colour) ? "SteelBlue" : $pp3_colour;// printed part colour 3
|
||||
pp4_colour = is_undef($pp4_colour) ? "darkorange" : $pp4_colour;// printed part colour 4
|
||||
|
||||
manifold = is_undef($manifold) ? false : $manifold; // Manifold library being used instead of cgal
|
||||
|
||||
// Minimum wall is about two filaments wide but we extrude it closer to get better bonding
|
||||
squeezed_wall = $preview ? 2 * extrusion_width - layer_height * (1 - PI / 4)
|
||||
: extrusion_width - layer_height / 2 + nozzle / 2 + extrusion_width / 2;
|
||||
|
||||
inf = 1e10; // very big
|
||||
inf = 1e10; // very big
|
||||
big = manifold ? 1e3 : inf; // Not too big for manifold
|
||||
eps = 1/128; // small fudge factor to stop CSG barfing on coincident faces.
|
||||
|
||||
fa = is_undef($vitamin_fa) ? 6 : $vitamin_fa; // Used for drawing vitamins, rather than printing.
|
||||
|
BIN
libtest.png
Before Width: | Height: | Size: 969 KiB After Width: | Height: | Size: 977 KiB |
@@ -226,7 +226,7 @@ translate([950, 1525])
|
||||
|
||||
inserts_y = 0;
|
||||
nuts_y = inserts_y + 20;
|
||||
washers_y = nuts_y + 120;
|
||||
washers_y = nuts_y + 140;
|
||||
screws_y = washers_y + 120;
|
||||
circlips_y = screws_y + 180;
|
||||
springs_y = circlips_y + 20;
|
||||
|
@@ -452,9 +452,10 @@ module box_screw_hole_positions(type) {
|
||||
children();
|
||||
}
|
||||
|
||||
module box_base_blank(type) { //! Generates a 2D template for the base sheet
|
||||
module box_base_blank(type, sheet = false) { //! Generates a 2D template for the base sheet, `sheet` can be set to override the type
|
||||
s = sheet ? sheet : box_base_sheet(type);
|
||||
difference() {
|
||||
sheet_2D(box_base_sheet(type), box_width(type), box_depth(type), box_sheet_r(type));
|
||||
sheet_2D(s, box_width(type), box_depth(type), box_sheet_r(type));
|
||||
|
||||
box_screw_hole_positions(type)
|
||||
drill(screw_clearance_radius(box_screw(type)), 0);
|
||||
|
54
readme.md
@@ -1091,6 +1091,7 @@ LCD displays.
|
||||
| 1 | `display(HDMI5)` | HDMI display 5" |
|
||||
| 1 | `display(TFT128x160)` | LCD TFT ST7735 display 128x160 |
|
||||
| 1 | `display(LCD1602A)` | LCD display 1602A |
|
||||
| 1 | `display(LCD2004A)` | LCD display 2004A |
|
||||
| 1 | `display(LCDS7282B)` | LCD display S-7282B |
|
||||
| 1 | `display(SSD1963_4p3)` | LCD display SSD1963 4.3" |
|
||||
|
||||
@@ -2347,6 +2348,7 @@ If a nut is given a child then it gets placed on its top surface.
|
||||
### Properties
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `nut_dome(type)` | Dome height and max thread depth if a domed acorn nut |
|
||||
| `nut_pitch(type)` | Pitch if not standard metric course thread |
|
||||
| `nut_radius(type)` | Radius across the corners |
|
||||
| `nut_size(type)` | Diameter of the corresponding screw |
|
||||
@@ -2359,8 +2361,10 @@ If a nut is given a child then it gets placed on its top surface.
|
||||
### Functions
|
||||
| Function | Description |
|
||||
|:--- |:--- |
|
||||
| `nut_dome_height(type)` | Height of the domed version |
|
||||
| `nut_flat_radius(type)` | Radius across the flats |
|
||||
| `nut_thickness(type, nyloc = false)` | Thickness of plain or nyloc version |
|
||||
| `nut_thread_depth(type)` | Max thread depth in domed version |
|
||||
| `nut_trap_flat_radius(nut, horizontal = false)` | Radius across the flats of a nut trap |
|
||||
| `nut_trap_radius(nut, horizontal = false)` | Radius across the corners of a nut trap |
|
||||
| `t_nut_tab(type)` | Sliding t-nut T dimensions |
|
||||
@@ -2368,7 +2372,7 @@ If a nut is given a child then it gets placed on its top surface.
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `nut(type, nyloc = false, brass = false, nylon = false)` | Draw specified nut |
|
||||
| `nut(type, nyloc = false, brass = false, nylon = false, dome = false)` | Draw specified nut |
|
||||
| `nut_and_washer(type, nyloc)` | Draw nut with corresponding washer |
|
||||
| `nut_square(type, brass = false, nylon = false)` | Draw specified square nut |
|
||||
| `nut_trap(screw, nut, depth = 0, horizontal = false, supported = false, h = 200)` | Make a nut trap |
|
||||
@@ -2389,24 +2393,29 @@ If a nut is given a child then it gets placed on its top surface.
|
||||
| 1 | `sliding_t_nut(M3_sliding_t_nut)` | Nut M3 sliding T |
|
||||
| 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, dome = true)` | Nut M3 x 2.4mm domed |
|
||||
| 1 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
|
||||
| 1 | `nut(M3nS_thin_nut)` | Nut M3nS 5.5 x 1.8mm |
|
||||
| 1 | `sliding_t_nut(M4_hammer_nut)` | Nut M4 hammer |
|
||||
| 1 | `sliding_t_nut(M4_sliding_t_nut)` | Nut M4 sliding T |
|
||||
| 1 | `nut(M4_nut)` | Nut M4 x 3.2mm |
|
||||
| 1 | `nut(M4_nut, dome = true)` | Nut M4 x 3.2mm domed |
|
||||
| 1 | `nut(M4_nut, nyloc = true)` | Nut M4 x 3.2mm nyloc |
|
||||
| 1 | `nut(M4nS_thin_nut)` | Nut M4nS 7 x 2.2mm |
|
||||
| 1 | `sliding_t_nut(M5_sliding_t_nut)` | Nut M5 sliding T |
|
||||
| 1 | `nut(M5_nut)` | Nut M5 x 4mm |
|
||||
| 1 | `nut(M5_nut, dome = true)` | Nut M5 x 4mm domed |
|
||||
| 1 | `nut(M5_nut, nyloc = true)` | Nut M5 x 4mm nyloc |
|
||||
| 1 | `nut(M5nS_thin_nut)` | Nut M5nS 8 x 2.7mm |
|
||||
| 1 | `sliding_t_nut(M6_sliding_t_nut)` | Nut M6 hammer |
|
||||
| 1 | `nut(M6_half_nut)` | Nut M6 x 3mm |
|
||||
| 1 | `nut(M6_nut)` | Nut M6 x 5mm |
|
||||
| 1 | `nut(M6_nut, dome = true)` | Nut M6 x 5mm domed |
|
||||
| 1 | `nut(M6_nut, nyloc = true)` | Nut M6 x 5mm nyloc |
|
||||
| 1 | `nut(M6nS_thin_nut)` | Nut M6nS 10 x 3.2mm |
|
||||
| 1 | `sliding_t_nut(M8_sliding_ball_t_nut)` | Nut M8 sliding T with spring loaded ball |
|
||||
| 1 | `nut(M8_nut)` | Nut M8 x 6.5mm |
|
||||
| 1 | `nut(M8_nut, dome = true)` | Nut M8 x 6.5mm domed |
|
||||
| 1 | `nut(M8_nut, nyloc = true)` | Nut M8 x 6.5mm nyloc |
|
||||
| 1 | `nut(M8nS_thin_nut)` | Nut M8nS 13 x 4mm |
|
||||
| 1 | `washer(M6_washer)` | Washer M6 x 12.5mm x 1.5mm |
|
||||
@@ -2848,6 +2857,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 1 | `pcb(ESP32_DOIT_V1)` | ESP32 DOIT DEV KIT V1 |
|
||||
| 1 | `pcb(EnviroPlus)` | Enviro+ |
|
||||
| 1 | `pcb(ExtruderPCB)` | Extruder connection PCB - not shown |
|
||||
| 1 | `pcb(HW803_1WAY_RELAY)` | HW-803 5V 1 way relay module |
|
||||
| 1 | `pcb(KY_040)` | KY-040 rotart encoder breakout |
|
||||
| 1 | `pcb(Keyes5p1)` | Keyes5.1 Arduino Uno expansion board - not shown |
|
||||
| 1 | `pcb(L9110S)` | L9110S 2-Channel motor driver module |
|
||||
@@ -2861,7 +2871,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 1 | `molex_254(3)` | Molex KK header 3 way - not shown |
|
||||
| 20 | `nut(M2_nut, nyloc = true)` | Nut M2 x 1.6mm nyloc |
|
||||
| 38 | `nut(M2p5_nut, nyloc = true)` | Nut M2.5 x 2.2mm nyloc |
|
||||
| 43 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
|
||||
| 47 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
|
||||
| 8 | `nut(M4_nut, nyloc = true)` | Nut M4 x 3.2mm nyloc |
|
||||
| 1 | `pcb(OPZ2)` | Orange Pi Zero 2 |
|
||||
| 1 | `pcb(PI_IO)` | PI_IO V2 - not shown |
|
||||
@@ -2884,14 +2894,17 @@ 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 |
|
||||
| 8 | `screw(M2p5_cap_screw, 25)` | Screw M2.5 cap x 25mm |
|
||||
| 4 | `screw(M2p5_cap_screw, 25)` | Screw M2.5 cap x 25mm |
|
||||
| 4 | `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 |
|
||||
| 8 | `screw(M2p5_pan_screw, 30)` | Screw M2.5 pan x 30mm |
|
||||
| 19 | `screw(M3_cap_screw, 16)` | Screw M3 cap x 16mm |
|
||||
| 13 | `screw(M3_cap_screw, 20)` | Screw M3 cap x 20mm |
|
||||
| 11 | `screw(M3_cap_screw, 30)` | Screw M3 cap x 30mm |
|
||||
| 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 |
|
||||
| 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 |
|
||||
@@ -2903,7 +2916,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| 1 | `pcb(WD2002SJ)` | WD2002SJ Buck Boost DC-DC converter |
|
||||
| 20 | `washer(M2_washer)` | Washer M2 x 5mm x 0.3mm |
|
||||
| 38 | `washer(M2p5_washer)` | Washer M2.5 x 5.9mm x 0.5mm |
|
||||
| 43 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
|
||||
| 47 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
|
||||
| 8 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
|
||||
| 1 | `pcb(ZC_A0591)` | ZC-A0591 ULN2003 driver PCB |
|
||||
|
||||
@@ -2911,23 +2924,24 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
|
||||
| Qty | Filename |
|
||||
| ---:|:--- |
|
||||
| 4 | pcb_spacer20100.stl |
|
||||
| 4 | pcb_spacer20130.stl |
|
||||
| 4 | pcb_spacer20140.stl |
|
||||
| 4 | pcb_spacer2070.stl |
|
||||
| 4 | pcb_spacer2080.stl |
|
||||
| 4 | pcb_spacer2090.stl |
|
||||
| 4 | pcb_spacer25120.stl |
|
||||
| 4 | pcb_spacer25150.stl |
|
||||
| 2 | pcb_spacer25100.stl |
|
||||
| 4 | pcb_spacer25130.stl |
|
||||
| 4 | pcb_spacer25160.stl |
|
||||
| 4 | pcb_spacer25170_2.stl |
|
||||
| 4 | pcb_spacer25170.stl |
|
||||
| 4 | pcb_spacer25180_2.stl |
|
||||
| 4 | pcb_spacer25220.stl |
|
||||
| 4 | pcb_spacer25190_2.stl |
|
||||
| 4 | pcb_spacer25230.stl |
|
||||
| 4 | pcb_spacer25240.stl |
|
||||
| 4 | pcb_spacer25250.stl |
|
||||
| 4 | pcb_spacer2580.stl |
|
||||
| 2 | pcb_spacer2590.stl |
|
||||
| 4 | pcb_spacer30190.stl |
|
||||
| 4 | pcb_spacer30120.stl |
|
||||
| 4 | pcb_spacer30200.stl |
|
||||
| 3 | pcb_spacer30210.stl |
|
||||
| 4 | pcb_spacer30210.stl |
|
||||
| 3 | pcb_spacer30220.stl |
|
||||
| 10 | pcb_spacer3050.stl |
|
||||
| 9 | pcb_spacer3060.stl |
|
||||
| 9 | pcb_spacer3070.stl |
|
||||
@@ -4012,6 +4026,8 @@ When woven sheets (e.g. carbon fibre) are rendered it is necessary to specify th
|
||||
| 1 | `sheet(MDF10, 30, 30, 2)` | Sheet MDF 30mm x 30mm x 10mm |
|
||||
| 1 | `sheet(MDF12, 30, 30, 2)` | Sheet MDF 30mm x 30mm x 12mm |
|
||||
| 1 | `sheet(MDF19, 30, 30, 2)` | Sheet MDF 30mm x 30mm x 19mm |
|
||||
| 1 | `sheet(MDF22, 30, 30, 2)` | Sheet MDF 30mm x 30mm x 22mm |
|
||||
| 1 | `sheet(MDF3, 30, 30, 2)` | Sheet MDF 30mm x 30mm x 3mm |
|
||||
| 1 | `sheet(MDF6, 30, 30, 2)` | Sheet MDF 30mm x 30mm x 6mm |
|
||||
| 1 | `sheet(PMMA1p25, 30, 30, 2)` | Sheet acrylic 30mm x 30mm x 1.25mm |
|
||||
| 1 | `sheet(PMMA10, 30, 30, 2)` | Sheet acrylic 30mm x 30mm x 10mm |
|
||||
@@ -5082,7 +5098,7 @@ The top bezel can have an optional child, which is subtracted to allow modificat
|
||||
| `box_back(type)` | Default back, can be overridden to customise |
|
||||
| `box_back_blank(type, sheet = false)` | Generates a 2D template for the back sheet, `sheet` can be set to override the type |
|
||||
| `box_base(type)` | Default base, can be overridden to customise |
|
||||
| `box_base_blank(type)` | Generates a 2D template for the base sheet |
|
||||
| `box_base_blank(type, sheet = false)` | Generates a 2D template for the base sheet, `sheet` can be set to override the type |
|
||||
| `box_bezel(type, bottom)` | Generates top and bottom bezel STLs |
|
||||
| `box_bezel_section(type, bottom, rows, cols, x, y)` | Generates interlocking sections of the bezel to allow it to be bigger than the printer |
|
||||
| `box_corner_profile(type)` | Generates the corner profile STL for 3D printing. |
|
||||
@@ -7436,7 +7452,7 @@ This is to prevent the global BOM page becoming too wide in large projects by ha
|
||||
The example below shows how to define a vitamin and incorporate it into an assembly with sub-assemblies and make an exploded view.
|
||||
The resulting flat BOM is shown but hierarchical BOMs are also generated for real projects.
|
||||
|
||||
If the code to make an STL or DXF is made a child of the `stl()` or `dxf()` module then the STL or DXF will be used in the assembly views generated by `views.py` instead of generating
|
||||
If the code to make an STL, DXF or SVG is made a child of the `stl()`, `dxf()` or `svg()` module then the STL, DXF or SVG will be used in the assembly views generated by `views.py` instead of generating
|
||||
it with code.
|
||||
This can speed up the generation of the build instructions greatly but isn't compatible with STLs that include support structures.
|
||||
|
||||
@@ -7475,8 +7491,10 @@ The `pose()` module allows assembly views in the readme to be posed differently
|
||||
| `pose_vflip(exploded = undef)` | Pose an STL or assembly for rendering to png by flipping around the X axis, `exploded = true for` just the exploded view or `false` for unexploded only. |
|
||||
| `stl(name)` | Name an stl that will appear on the BOM, there needs to a module named `<name>_stl` to make it |
|
||||
| `stl_colour(colour = pp1_colour, alpha = 1)` | Colour an stl where it is placed in an assembly. `alpha` can be used to make it appear transparent. |
|
||||
| `svg(name)` | Name an svg that will appear on the BOM, there needs to a module named `<name>_svg` to make it |
|
||||
| `use_dxf(name)` | Import a DXF to make a build panel |
|
||||
| `use_stl(name)` | Import an STL to make a build platter |
|
||||
| `use_svg(name)` | Import an SVG to make a build panel |
|
||||
| `vitamin(description)` | Describe a vitamin for the BOM entry and precede it with a module call that creates it, eg. "widget(42): Widget size 42" |
|
||||
|
||||

|
||||
@@ -7487,6 +7505,8 @@ The `pose()` module allows assembly views in the readme to be posed differently
|
||||
| 1 | `insert(F1BM3)` | Heatfit insert M3 x 5.8mm |
|
||||
| 1 | `widget(3)` | Rivet like thing for 3mm sheets |
|
||||
| 1 | `screw(M3_cap_screw, 8)` | Screw M3 cap x 8mm |
|
||||
| 4 | `screw(M3_cap_screw, 10)` | Screw M3 cap x 10mm |
|
||||
| 1 | `sheet(MDF6, 40, 40)` | Sheet MDF 40mm x 40mm x 6mm |
|
||||
| 1 | `sheet(PMMA3, 20, 20, 1)` | Sheet acrylic 20mm x 20mm x 3mm |
|
||||
| 1 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
|
||||
| 1 | `star_washer(M3_washer)` | Washer star M3 x 0.5mm |
|
||||
@@ -7499,6 +7519,7 @@ The `pose()` module allows assembly views in the readme to be posed differently
|
||||
### Routed
|
||||
| Qty | Filename |
|
||||
| ---:|:--- |
|
||||
| 1 | mdf.svg |
|
||||
| 1 | widget.dxf |
|
||||
|
||||
### Assemblies
|
||||
@@ -7526,7 +7547,7 @@ Original version by Doug Moen on the OpenSCAD forum
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| `box(xmin, ymin, zmin, xmax, ymax, zmax)` | Construct a box given its bounds |
|
||||
| `clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf, convexity = 1)` | Clip child to specified boundaries |
|
||||
| `clip(xmin = -big, ymin = -big, zmin = -big, xmax = big, ymax = big, zmax = big, convexity = 1)` | Clip child to specified boundaries |
|
||||
|
||||

|
||||
|
||||
@@ -7572,6 +7593,7 @@ See [global_defs.scad](../../global_defs.scad) for a list of global constants.
|
||||
| `extrude_if(h, center = true)` | Extrudes 2D object to 3D when `h` is nonzero, otherwise leaves it 2D |
|
||||
| `hflip(flip=true)` | Invert children by doing a 180° flip around the Y axis |
|
||||
| `render_if(render = true, convexity = 2)` | Renders an object if `render` is true, otherwise leaves it unrendered |
|
||||
| `render_manifold()` | Render if manifold to work around convexity bug in manifold |
|
||||
| `right_triangle(width, height, h, center = true)` | A right angled triangle with the 90° corner at the origin. 3D when `h` is nonzero, otherwise 2D |
|
||||
| `semi_circle(r, d = undef)` | A semi circle in the positive Y domain |
|
||||
| `translate_z(z)` | Shortcut for Z only translations |
|
||||
|
@@ -104,14 +104,14 @@ class BOM:
|
||||
|
||||
def add_part(self, s):
|
||||
args = []
|
||||
match = re.match(r'^(.*?\.stl|.*?\.dxf)\((.*)\)$', s) #look for name.stl(...) or name.dxf(...)
|
||||
match = re.match(r'^(.*?\.stl|.*?\.dxf|.*?\.svg)\((.*)\)$', s) #look for name.stl(...), name.dxf(...) or name.svg(...)
|
||||
if match:
|
||||
s = match.group(1)
|
||||
args = [match.group(2)]
|
||||
if s[-4:] == ".stl":
|
||||
parts = self.printed
|
||||
else:
|
||||
if s[-4:] == ".dxf":
|
||||
if s[-4:] == ".dxf" or s[-4:] == ".svg":
|
||||
parts = self.routed
|
||||
else:
|
||||
parts = self.vitamins
|
||||
|
@@ -35,7 +35,7 @@ def read_deps(dname):
|
||||
for line in lines:
|
||||
if line.startswith('\t'):
|
||||
dep = line[1 : -1].rstrip(' \\').replace('\\ ', ' ')
|
||||
if not os.path.basename(dep) in ['stl.scad', 'dxf.scad', 'svf.scad', 'png.scad', 'target.scad']:
|
||||
if not os.path.basename(dep) in ['stl.scad', 'dxf.scad', 'svg.scad', 'png.scad', 'target.scad']:
|
||||
deps.append(dep)
|
||||
return deps
|
||||
|
||||
|
@@ -39,7 +39,7 @@ def bom_to_parts(bom_dir, part_type, assembly = None):
|
||||
#
|
||||
part_files = []
|
||||
bom = assembly + '.txt' if assembly else "bom.txt"
|
||||
suffix = ".dxf" if part_type == 'svg' else '.' + part_type
|
||||
suffix = '.' + part_type
|
||||
with open(bom_dir + '/' + bom, "rt") as f:
|
||||
for line in f.readlines():
|
||||
words = line.split()
|
||||
@@ -106,7 +106,7 @@ def make_parts(target, part_type, parts = None):
|
||||
#
|
||||
# Find all the scad files
|
||||
#
|
||||
module_suffix = '_dxf' if part_type == 'svg' else '_' + part_type
|
||||
module_suffix = '_' + part_type
|
||||
for dir in source_dirs(bom_dir):
|
||||
if targets and os.path.isdir(dir):
|
||||
for filename in os.listdir(dir):
|
||||
@@ -141,7 +141,7 @@ def make_parts(target, part_type, parts = None):
|
||||
with open(part_maker_name, "w") as f:
|
||||
f.write("include <NopSCADlib/global_defs.scad>\n")
|
||||
f.write("use <%s/%s>\n" % (reltmp(dir, target), filename))
|
||||
f.write("%s();\n" % module);
|
||||
f.write("%s();\n" % module)
|
||||
t = time.time()
|
||||
openscad.run("-o", part_file, part_maker_name, "-D$bom=1", "-d", dname)
|
||||
times.add_time(part, t)
|
||||
|
@@ -39,7 +39,7 @@ if __name__ == '__main__':
|
||||
target = None if len(sys.argv) == 1 else sys.argv[1]
|
||||
set_config(target, usage)
|
||||
boms(target)
|
||||
for part in ['stl', 'dxf']:
|
||||
for part in ['stl', 'dxf', 'svg']:
|
||||
make_parts(target, part)
|
||||
render(target, part)
|
||||
plateup(target, part)
|
||||
|
@@ -26,6 +26,8 @@ import subprocess, sys
|
||||
|
||||
def run_list(args, silent = False, verbose = False):
|
||||
cmd = ["openscad"] + args + ["--hardwarnings"]
|
||||
if "-D$manifold=true" in args:
|
||||
cmd += ["--enable"] + ["manifold"]
|
||||
if not silent:
|
||||
for arg in cmd:
|
||||
print(arg, end=" ")
|
||||
|
@@ -26,8 +26,9 @@ def check_options(dir = '.'):
|
||||
global options, options_mtime
|
||||
options = {
|
||||
"show_threads": str(os.getenv("NOPSCADLIB_SHOW_THREADS")),
|
||||
"vitamin_fa": str(os.getenv("NOPSCADLIB_VITAMIN_FA")),
|
||||
"vitamin_fs": str(os.getenv("NOPSCADLIB_VITAMIN_FS"))
|
||||
"vitamin_fa" : str(os.getenv("NOPSCADLIB_VITAMIN_FA")),
|
||||
"vitamin_fs" : str(os.getenv("NOPSCADLIB_VITAMIN_FS")),
|
||||
"manifold" : str(os.getenv("NOPSCADLIB_MANIFOLD"))
|
||||
}
|
||||
options_fname = dir + '/options.json'
|
||||
try:
|
||||
|
@@ -31,8 +31,8 @@ import re
|
||||
import time
|
||||
import times
|
||||
|
||||
source_dirs = { "stl" : "platters", "dxf" : "panels" }
|
||||
target_dirs = { "stl" : "printed", "dxf" : "routed" }
|
||||
source_dirs = { "stl" : "platters", "dxf" : "panels", "svg" : "panels" }
|
||||
target_dirs = { "stl" : "printed", "dxf" : "routed", "svg" : "routed" }
|
||||
|
||||
def plateup(target, part_type, usage = None):
|
||||
#
|
||||
|
@@ -33,7 +33,7 @@ import json
|
||||
from tmpdir import *
|
||||
|
||||
def usage():
|
||||
print("\nusage:\n\trender [target_config] - Render images of the stl and dxf files.");
|
||||
print("\nusage:\n\trender [target_config] - Render images of the stl, dxf and svg files.");
|
||||
sys.exit(1)
|
||||
|
||||
def render(target, type):
|
||||
@@ -57,7 +57,7 @@ def render(target, type):
|
||||
with open(bom_file) as json_file:
|
||||
flat_bom = json.load(json_file)
|
||||
|
||||
things = { 'stl' : 'printed', 'dxf' : 'routed' }[type]
|
||||
things = { 'stl' : 'printed', 'dxf' : 'routed', 'svg' : 'routed' }[type]
|
||||
colours = {}
|
||||
for ass in flat_bom:
|
||||
for part in ass[things]:
|
||||
@@ -112,3 +112,4 @@ if __name__ == '__main__':
|
||||
target = sys.argv[1] if len(sys.argv) > 1 else None
|
||||
render(target, 'stl')
|
||||
render(target, 'dxf')
|
||||
render(target, 'svg')
|
||||
|
@@ -374,7 +374,12 @@ def views(target, do_assemblies = None):
|
||||
print('\n|%s' % ('---|' * n), file = doc_file)
|
||||
for j in range(n):
|
||||
part = keys[i - n + j + 1]
|
||||
print('|  %s' % (part, part.replace('.dxf','.png'), '|\n' if j == j - 1 else ''), end = '', file = doc_file)
|
||||
if (part[-4:] == ".dxf"):
|
||||
print('|  %s' % (part, part.replace('.dxf','.png'), '|\n' if j == j - 1 else ''), end = '', file = doc_file)
|
||||
elif (part[-4:] == ".svg"):
|
||||
print('|  %s' % (part, part.replace('.svg','.png'), '|\n' if j == j - 1 else ''), end = '', file = doc_file)
|
||||
else:
|
||||
print("Unkown file type ", part[-4:], " for file ", part)
|
||||
print('\n', file = doc_file)
|
||||
print('\n', file = doc_file)
|
||||
|
||||
|
@@ -25,11 +25,11 @@ include <../core.scad>
|
||||
include <../vitamins/sheets.scad>
|
||||
use <../vitamins/insert.scad>
|
||||
|
||||
screw = M3_cap_screw;
|
||||
screwM3 = M3_cap_screw;
|
||||
sheet = PMMA3;
|
||||
height = 10;
|
||||
|
||||
insert = screw_insert(screw);
|
||||
insert = screw_insert(screwM3);
|
||||
|
||||
module widget(thickness) {
|
||||
vitamin(str("widget(", thickness, "): Rivet like thing for ", thickness, "mm sheets"));
|
||||
@@ -46,7 +46,13 @@ module widget(thickness) {
|
||||
module widget_stl() {
|
||||
stl("widget")
|
||||
union() {
|
||||
rounded_rectangle([30, 30, 3], 2, true);
|
||||
difference() {
|
||||
rounded_rectangle([30, 30, 3], 2, true);
|
||||
for(x = [-10,10])
|
||||
for (y=[-10,10])
|
||||
translate([x,y,-1.5])
|
||||
cylinder(r=2, h=3.5);
|
||||
}
|
||||
|
||||
render() insert_boss(insert, height, 2.2);
|
||||
}
|
||||
@@ -57,7 +63,18 @@ module widget_dxf() {
|
||||
difference() {
|
||||
sheet_2D(sheet, 20, 20, 1);
|
||||
|
||||
drill(screw_clearance_radius(screw), 0);
|
||||
drill(screw_clearance_radius(screwM3), 0);
|
||||
}
|
||||
}
|
||||
|
||||
module mdf_svg() {
|
||||
svg("mdf")
|
||||
difference() {
|
||||
sheet_2D(MDF6, 40,40);
|
||||
for(x = [-10,10])
|
||||
for (y=[-10,10])
|
||||
translate([x,y,0])
|
||||
drill(screw_clearance_radius(screwM3), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,11 +102,23 @@ assembly("widget_top") {
|
||||
module widget_assembly()
|
||||
assembly("widget") {
|
||||
|
||||
widget_base_assembly(); // Note this is not exploded because it is sub-assembly
|
||||
translate_z(-6) {
|
||||
render_2D_sheet(MDF6)
|
||||
mdf_svg();
|
||||
|
||||
explode(0)
|
||||
for(x = [-10,10])
|
||||
for (y=[-10,10])
|
||||
translate([x,y,-10])
|
||||
screw(screwM3, 10);
|
||||
}
|
||||
|
||||
explode(3)
|
||||
widget_base_assembly(); // Note this is not exploded because it is sub-assembly
|
||||
|
||||
translate_z(height) {
|
||||
translate_z(sheet_thickness(sheet))
|
||||
screw_and_washer(screw, screw_length(screw, sheet_thickness(sheet) + 3, 2, longer = true), true);
|
||||
screw_and_washer(screwM3, screw_length(screwM3, sheet_thickness(sheet) + 3, 2, longer = true), true);
|
||||
|
||||
explode(5)
|
||||
translate_z(sheet_thickness(sheet) / 2 + eps)
|
||||
|
@@ -20,8 +20,10 @@ include <../utils/core/core.scad>
|
||||
|
||||
use <../vitamins/fuseholder.scad>
|
||||
|
||||
thickness = 6;
|
||||
|
||||
module fuseholders()
|
||||
fuseholder(6);
|
||||
fuseholder(thickness);
|
||||
|
||||
if($preview)
|
||||
let($show_threads = 1)
|
||||
|
@@ -25,7 +25,11 @@ module nuts() {
|
||||
translate([0, nyloc ? 20 : 0])
|
||||
nut(n, nyloc);
|
||||
|
||||
translate([0, 40]) {
|
||||
translate([0, 40])
|
||||
if(nut_dome(n))
|
||||
nut(n, dome = true);
|
||||
|
||||
translate([0, 60]) {
|
||||
if(n == M3_nut)
|
||||
nut(n, brass = true);
|
||||
|
||||
@@ -43,7 +47,7 @@ module nuts() {
|
||||
#nut_trap(M8_cap_screw, n, h = 30);
|
||||
}
|
||||
|
||||
translate([0, 60]) {
|
||||
translate([0, 80]) {
|
||||
if(n == M3_nut)
|
||||
sliding_t_nut(M3_sliding_t_nut);
|
||||
|
||||
@@ -61,7 +65,7 @@ module nuts() {
|
||||
sliding_t_nut(M8_sliding_ball_t_nut);
|
||||
}
|
||||
|
||||
translate([0, 80]) {
|
||||
translate([0, 100]) {
|
||||
if(n == M3_nut)
|
||||
sliding_t_nut(M3_hammer_nut);
|
||||
|
||||
@@ -69,7 +73,7 @@ module nuts() {
|
||||
sliding_t_nut(M4_hammer_nut);
|
||||
}
|
||||
|
||||
translate([0, 100]) {
|
||||
translate([0, 120]) {
|
||||
if(n == M3_nut)
|
||||
nut_square(M3nS_thin_nut);
|
||||
if(n == M4_nut)
|
||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 274 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 250 KiB After Width: | Height: | Size: 244 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 133 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 164 KiB |
Before Width: | Height: | Size: 191 KiB After Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
@@ -73,7 +73,7 @@ module polyholes() {
|
||||
// Alternating polyholes
|
||||
//
|
||||
translate([30, -40])
|
||||
alt_polyhole_stl();
|
||||
render_manifold() alt_polyhole_stl();
|
||||
//
|
||||
// Poly rings
|
||||
//
|
||||
|
@@ -57,7 +57,7 @@ module screws() {
|
||||
}
|
||||
}
|
||||
translate([20, 60, -15])
|
||||
polysink_stl();
|
||||
render_manifold() polysink_stl();
|
||||
}
|
||||
|
||||
if($preview)
|
||||
|
@@ -31,7 +31,7 @@
|
||||
//! The example below shows how to define a vitamin and incorporate it into an assembly with sub-assemblies and make an exploded view.
|
||||
//! The resulting flat BOM is shown but hierarchical BOMs are also generated for real projects.
|
||||
//!
|
||||
//! If the code to make an STL or DXF is made a child of the `stl()` or `dxf()` module then the STL or DXF will be used in the assembly views generated by `views.py` instead of generating
|
||||
//! If the code to make an STL, DXF or SVG is made a child of the `stl()`, `dxf()` or `svg()` module then the STL, DXF or SVG will be used in the assembly views generated by `views.py` instead of generating
|
||||
//! it with code.
|
||||
//! This can speed up the generation of the build instructions greatly but isn't compatible with STLs that include support structures.
|
||||
//!
|
||||
@@ -168,12 +168,32 @@ module dxf(name) { //! Name a dxf that will appear on the B
|
||||
}
|
||||
}
|
||||
|
||||
module svg(name) { //! Name an svg that will appear on the BOM, there needs to a module named `<name>_svg` to make it
|
||||
if(bom_mode() && is_undef($in_svg)) {
|
||||
if(is_undef($dxf_colour))
|
||||
echo(str("~", name, ".svg"));
|
||||
else
|
||||
echo(str("~", name, ".svg(colour='", $dxf_colour, "')"));
|
||||
}
|
||||
if($children)
|
||||
if(is_undef($pose))
|
||||
let($in_svg = true)
|
||||
children();
|
||||
else {
|
||||
path = is_undef($target) ? "/svgs/" : str("/", $target, "/svgs/");
|
||||
import(str($cwd, path, name, ".svg"));
|
||||
}
|
||||
}
|
||||
|
||||
module use_stl(name) //! Import an STL to make a build platter
|
||||
assert(false); // Here for documentation only, real version in core.scad
|
||||
|
||||
module use_dxf(name) //! Import a DXF to make a build panel
|
||||
assert(false); // Here for documentation only, real version in core.scad
|
||||
|
||||
module use_svg(name) //! Import an SVG to make a build panel
|
||||
assert(false); // Here for documentation only, real version in core.scad
|
||||
|
||||
function value_string(value) = is_string(value) ? str("\"", value, "\"") : str(value); //! Convert `value` to a string or quote it if it is already a string
|
||||
|
||||
function arg(value, default, name = "") = //! Create string for arg if not default, helper for `vitamin()`
|
||||
|
@@ -41,7 +41,7 @@ module box(xmin, ymin, zmin, xmax, ymax, zmax) //! Construct a box given its bou
|
||||
[0,2,3,1]] // left
|
||||
);
|
||||
|
||||
module clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf, convexity = 1) //! Clip child to specified boundaries
|
||||
module clip(xmin = -big, ymin = -big, zmin = -big, xmax = big, ymax = big, zmax = big, convexity = 1) //! Clip child to specified boundaries
|
||||
render(convexity = convexity) intersection() {
|
||||
children();
|
||||
|
||||
|
@@ -37,3 +37,9 @@ module use_dxf(name) { //! Import a DXF to make a build panel
|
||||
path = is_undef($target) ? "../dxfs/" : str($cwd, "/", $target, "/dxfs/");
|
||||
import(str(path, name, ".dxf"));
|
||||
}
|
||||
|
||||
module use_svg(name) { //! Import an SVG to make a build panel
|
||||
svg(name);
|
||||
path = is_undef($target) ? "../svgs/" : str($cwd, "/", $target, "/svgs/");
|
||||
import(str(path, name, ".svg"));
|
||||
}
|
||||
|
@@ -74,6 +74,10 @@ module render_if(render = true, convexity = 2) //! Renders an object if `re
|
||||
else
|
||||
children();
|
||||
|
||||
module render_manifold() //! Render if manifold to work around convexity bug in manifold
|
||||
render_if(manifold)
|
||||
children();
|
||||
|
||||
module extrude_if(h, center = true) //! Extrudes 2D object to 3D when `h` is nonzero, otherwise leaves it 2D
|
||||
if(h)
|
||||
linear_extrude(h, center = center, convexity = 5) // 3D
|
||||
|
@@ -47,11 +47,11 @@ module offset_3D(r, chamfer_base = false) { //! Offset 3D shape by specified rad
|
||||
else
|
||||
if(r < 0)
|
||||
render() difference() {
|
||||
cube(inf / 2, center = true);
|
||||
cube(big / 2, center = true);
|
||||
|
||||
minkowski() {
|
||||
difference() {
|
||||
cube(inf, center = true);
|
||||
cube(big, center = true);
|
||||
|
||||
children();
|
||||
}
|
||||
|
@@ -52,6 +52,6 @@ module cylindrical_wrap(r, h = eps) { //! Wrap a 2D child extruded to height `h`
|
||||
translate([(sides / 2 - i) * -dx, 0])
|
||||
children();
|
||||
|
||||
square([dx, inf], center = true);
|
||||
square([dx, big], center = true);
|
||||
}
|
||||
}
|
||||
|
@@ -54,6 +54,24 @@ LCD1602A = ["LCD1602A", "LCD display 1602A", 71.3, 24.3, 7.0, LCD1602APCB,
|
||||
[], // clearance need for the ts ribbon
|
||||
];
|
||||
|
||||
LCD2004APCB = pcb("", "", [98, 60, 1.65], hole_d = 2.9, land_d = 5, colour = "green",
|
||||
holes = [[-2.5, -2.5], [-2.5, 2.5], [2.5, 2.5], [2.5, -2.5]],
|
||||
components = [
|
||||
[49+19.05, - 2.5, 0, "2p54header", 16, 1]
|
||||
],
|
||||
grid = [
|
||||
49, 60 - 2.5, 16, 1, silver, inch(0.1), inch(0.1),
|
||||
]
|
||||
);
|
||||
|
||||
LCD2004A = ["LCD2004A", "LCD display 2004A", 97, 39.5, 9.0, LCD2004APCB,
|
||||
[0, 0, 0], // pcb offst
|
||||
[[-76 / 2, -26 / 2], [76 / 2, 26 / 2, 0.6]], // aperture
|
||||
[], // touch screen
|
||||
0, // thread length
|
||||
[], // clearance need for the ts ribbon
|
||||
];
|
||||
|
||||
LCDS7282BPCB = pcb("", "", [85, 36, 1.65], hole_d = 2.56, colour = "green",
|
||||
holes = [[-2.5, -2.5], [-2.5, 2.5], [2.5, 2.5], [2.5, -2.5]],
|
||||
components = [
|
||||
@@ -149,6 +167,6 @@ BigTreeTech_TFT35v3_0 = ["BigTreeTech_TFT35v3_0", "BigTreeTech TFT35 v3.0",
|
||||
];
|
||||
|
||||
|
||||
displays = [HDMI5, SSD1963_4p3, BigTreeTech_TFT35v3_0, LCD1602A, LCDS7282B, TFT128x160];
|
||||
displays = [HDMI5, SSD1963_4p3, LCD2004A, BigTreeTech_TFT35v3_0, LCD1602A, LCDS7282B, TFT128x160];
|
||||
|
||||
use <display.scad>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
//
|
||||
//! 20mm panel mount fuse holder.
|
||||
//
|
||||
include <../utils/core/core.scad>
|
||||
include <../core.scad>
|
||||
include <spades.scad>
|
||||
use <../utils/tube.scad>
|
||||
use <../utils/thread.scad>
|
||||
@@ -69,18 +69,10 @@ module fuseholder(thickness) { //! Fuseholder with nut in place for specified pa
|
||||
vflip()
|
||||
translate_z(thickness)
|
||||
explode(height, explode_children = true) {
|
||||
color(colour) {
|
||||
color(colour)
|
||||
tube(or = nut_d / 2, ir = thread_d / 2, h = nut_flange_t, center = false);
|
||||
|
||||
linear_extrude(nut_t)
|
||||
difference() {
|
||||
circle(d = nut_d, $fn = 6);
|
||||
|
||||
circle(d = thread_d);
|
||||
}
|
||||
}
|
||||
if(show_threads && exploded())
|
||||
female_metric_thread(thread_d, thread_p, nut_t, false, colour = colour);
|
||||
draw_nut(nut_d, thread_d, nut_t, thread_p, colour, show_threads && exploded() || thickness > thread);
|
||||
}
|
||||
//
|
||||
// Body
|
||||
|
@@ -149,18 +149,8 @@ module jack_4mm_plastic(colour, thickness, display_colour = false) { //! Draw a
|
||||
}
|
||||
translate_z(-thickness)
|
||||
explode(-length)
|
||||
vflip() {
|
||||
color(silver)
|
||||
linear_extrude(nut_t)
|
||||
difference() {
|
||||
circle(d = nut_d, $fn = 6);
|
||||
|
||||
circle(d = thread_d);
|
||||
}
|
||||
|
||||
if(show_threads)
|
||||
female_metric_thread(thread_d, thread_p, nut_t, false, colour = silver);
|
||||
}
|
||||
vflip()
|
||||
draw_nut(nut_d, thread_d, nut_t, thread_p, silver, show_threads);
|
||||
}
|
||||
|
||||
function jack_4mm_shielded_hole_radius() = 12 / 2; //! Panel hole radius for 4mm shielded jack
|
||||
@@ -282,14 +272,7 @@ module post_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm bind
|
||||
module nut() {
|
||||
nut_t = 2.3;
|
||||
|
||||
color(silver)
|
||||
linear_extrude(nut_t) difference() {
|
||||
circle(d = 6.3 / cos(30), $fn = 6);
|
||||
|
||||
circle(d = thread_d);
|
||||
}
|
||||
if(show_threads)
|
||||
female_metric_thread(thread_d, thread_p, nut_t, false, colour = silver);
|
||||
draw_nut(6.3 / cos(30), thread_d, nut_t, thread_p, silver, show_threads);
|
||||
|
||||
translate_z(nut_t)
|
||||
children();
|
||||
@@ -498,16 +481,6 @@ module power_jack(thickness) { //! Draw a power jack socket with nut positioned
|
||||
// Nut
|
||||
translate_z(-thickness)
|
||||
explode(-length)
|
||||
vflip() {
|
||||
color(silver)
|
||||
linear_extrude(nut_t)
|
||||
difference() {
|
||||
circle(d = nut_d, $fn = 6);
|
||||
|
||||
circle(d = thread_d);
|
||||
}
|
||||
|
||||
if(show_threads)
|
||||
female_metric_thread(thread_d, thread_p, nut_t, false, colour = silver);
|
||||
}
|
||||
vflip()
|
||||
draw_nut(nut_d, thread_d, nut_t, thread_p, silver, show_threads);
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@ function nut_thickness(type, nyloc = false) = nyloc ? type[4] : type[3]; //! Thi
|
||||
function nut_washer(type) = type[5]; //! Corresponding washer
|
||||
function nut_trap_depth(type) = type[6]; //! Depth of nut trap
|
||||
function nut_pitch(type) = type[7]; //! Pitch if not standard metric course thread
|
||||
function nut_dome(type) = type[8]; //! Dome height and max thread depth if a domed acorn nut
|
||||
|
||||
function nut_flat_radius(type) = nut_radius(type) * cos(30); //! Radius across the flats
|
||||
|
||||
@@ -44,36 +45,84 @@ function nut_square_size(type) = type[1]; //! Diameter of the corresponding
|
||||
function nut_square_width(type) = type[2]; //! Width of the square nut
|
||||
function nut_square_thickness(type) = type[3]; //! Thickness of the square nut
|
||||
|
||||
module nut(type, nyloc = false, brass = false, nylon = false) { //! Draw specified nut
|
||||
function nut_dome_height(type) = let(d = nut_dome(type)) d ? d[0] : nut_thickness(type); //! Height of the domed version
|
||||
function nut_thread_depth(type) = let(d = nut_dome(type)) d ? d[1] : nut_thickness(type); //! Max thread depth in domed version
|
||||
|
||||
module draw_nut(od, id, t, pitch, colour, show_thread, thread_h = undef ) {
|
||||
th = is_undef(thread_h) ? t : thread_h;
|
||||
|
||||
color(colour) {
|
||||
or = od / 2;
|
||||
fr = or * cos(30);
|
||||
|
||||
render_if(manifold) intersection() {
|
||||
linear_extrude(t, convexity = 5)
|
||||
difference() {
|
||||
circle(or, $fn = 6);
|
||||
|
||||
if(id)
|
||||
circle(d = id);
|
||||
}
|
||||
|
||||
if(manifold)
|
||||
rotate_extrude()
|
||||
hull() {
|
||||
h = (or - fr) * tan(30);
|
||||
|
||||
translate([0, -eps])
|
||||
square([fr, t + eps]);
|
||||
|
||||
translate([or, h])
|
||||
square([eps, t - 2 * h]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(show_thread && id)
|
||||
female_metric_thread(id, pitch,
|
||||
th,
|
||||
top = th > t ? 0 : manifold ? 1 : -1,
|
||||
bot = manifold ? 1 : -1,
|
||||
center = false, colour = colour);
|
||||
}
|
||||
|
||||
module nut(type, nyloc = false, brass = false, nylon = false, dome = false) { //! Draw specified nut
|
||||
thread_d = nut_size(type);
|
||||
thread_p = nut_pitch(type) ? nut_pitch(type) : metric_coarse_pitch(thread_d);
|
||||
hole_rad = thread_d / 2;
|
||||
outer_rad = nut_radius(type);
|
||||
thickness = nut_thickness(type);
|
||||
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"),
|
||||
desc = nyloc ? "nyloc" : brass ? "brass" : nylon ? "nylon" : dome ? "domed" : "";
|
||||
vitamin(str("nut(", type[0],
|
||||
arg(nyloc, false, "nyloc"),
|
||||
arg(brass, false, "brass"),
|
||||
arg(nylon, false, "nylon"),
|
||||
arg(dome, false, "dome"),
|
||||
"): Nut M", nut_size(type), " x ", thickness, "mm ", desc));
|
||||
|
||||
$fs = fs; $fa = fa;
|
||||
|
||||
colour = brass ? brass_colour : nylon ? grey(30): grey(70);
|
||||
explode(nyloc ? 10 : 0) {
|
||||
draw_nut(outer_rad * 2, thread_d, thickness, thread_p, colour, show_threads, dome ? nut_thread_depth(type) : thickness);
|
||||
|
||||
fr = nut_flat_radius(type);
|
||||
color(colour) {
|
||||
linear_extrude(thickness)
|
||||
difference() {
|
||||
circle(outer_rad, $fn = 6);
|
||||
|
||||
circle(hole_rad);
|
||||
}
|
||||
|
||||
if(nyloc)
|
||||
translate_z(-eps)
|
||||
rounded_cylinder(r = outer_rad * cos(30) , h = nyloc_thickness, r2 = (nyloc_thickness - thickness) / 2, ir = hole_rad);
|
||||
}
|
||||
translate_z(eps)
|
||||
rounded_cylinder(r = outer_rad * cos(30), h = nyloc_thickness - eps, r2 = (nyloc_thickness - thickness) / 2, ir = hole_rad);
|
||||
|
||||
if(show_threads)
|
||||
female_metric_thread(thread_d, thread_p, thickness, center = false, colour = colour);
|
||||
if(dome)
|
||||
translate_z(thickness)
|
||||
rotate_extrude()
|
||||
difference() {
|
||||
h = nut_dome_height(type) - thickness;
|
||||
r = fr - eps;
|
||||
rounded_corner(r, h, r);
|
||||
|
||||
square([thread_d / 2, nut_thread_depth(type) - thickness]);
|
||||
}
|
||||
}
|
||||
|
||||
if(nyloc)
|
||||
translate_z(thickness)
|
||||
|
@@ -28,25 +28,25 @@ M5_nut_depth = 4;
|
||||
M6_nut_depth = 5;
|
||||
M8_nut_depth = 6.5;
|
||||
|
||||
// s d t n w t t
|
||||
// c i h y a r h
|
||||
// r a i l s a r
|
||||
// e m c o h p e
|
||||
// s d t n w t t d d
|
||||
// c i h y a r h o o
|
||||
// r a i l s a r m m
|
||||
// e m c o h p e e e
|
||||
// w e k c e d
|
||||
// t n r d
|
||||
// e e t e p
|
||||
// r s h p i
|
||||
// s k t t
|
||||
// h c
|
||||
// h
|
||||
// t n r d h t
|
||||
// e e t e p e h
|
||||
// r s h p i i r
|
||||
// s k t t g e
|
||||
// h c h a
|
||||
// h t d
|
||||
M2_nut = ["M2_nut", 2, 4.9, 1.6, 2.4, M2_washer, M2_nut_trap_depth, 0];
|
||||
M2p5_nut = ["M2p5_nut", 2.5, 5.8, 2.2, 3.8, M2p5_washer, M2p5_nut_trap_depth, 0];
|
||||
M3_nut = ["M3_nut", 3, 6.4, 2.4, 4, M3_washer, M3_nut_trap_depth, 0];
|
||||
M4_nut = ["M4_nut", 4, 8.1, 3.2, 5, M4_washer, M4_nut_trap_depth, 0];
|
||||
M5_nut = ["M5_nut", 5, 9.2, 4, 6.25, M5_washer, M5_nut_depth, 0];
|
||||
M6_nut = ["M6_nut", 6, 11.5, 5, 8, M6_washer, M6_nut_depth, 0];
|
||||
M3_nut = ["M3_nut", 3, 6.4, 2.4, 4, M3_washer, M3_nut_trap_depth, 0, [6, 5.40]];
|
||||
M4_nut = ["M4_nut", 4, 8.1, 3.2, 5, M4_washer, M4_nut_trap_depth, 0, [8, 5.74]];
|
||||
M5_nut = ["M5_nut", 5, 9.2, 4, 6.25, M5_washer, M5_nut_depth, 0, [10, 7.79]];
|
||||
M6_nut = ["M6_nut", 6, 11.5, 5, 8, M6_washer, M6_nut_depth, 0, [12, 8.29]];
|
||||
M6_half_nut = ["M6_half_nut", 6, 11.5, 3, 8, M6_washer, 3, 0];
|
||||
M8_nut = ["M8_nut", 8, 15, 6.5, 8, M8_washer, M8_nut_depth, 0];
|
||||
M8_nut = ["M8_nut", 8, 15, 6.5, 8, M8_washer, M8_nut_depth, 0, [15, 11.35]];
|
||||
toggle_nut = ["toggle_nut", 6.1, 9.2, 1.5, 1.5, M6_washer, 1.5, inch(1/40)];
|
||||
|
||||
M4_wingnut = ["M4_wingnut", 4, 10, 3.75,8, M4_washer, 0, 22, 10, 6, 3];
|
||||
|
@@ -765,6 +765,27 @@ MT3608 = ["MT3608", "MT3608 boost converter module", 37, 17, 1.2, 2, 1.5,
|
||||
[ [-12.05 , -6.8, 180, "trimpot10"]
|
||||
]];
|
||||
|
||||
HW803_1WAY_RELAY = [
|
||||
"HW803_1WAY_RELAY", "HW-803 5V 1 way relay module",
|
||||
50, 26, 1.6, // size
|
||||
2, // corner radius
|
||||
3, // mounting hole diameter
|
||||
4, // pad around mounting hole
|
||||
"red", // color
|
||||
false, // true if parts should be separate BOM items
|
||||
[ // hole positions
|
||||
[3, 3], [-3, 3], [3, -3], [-3, -3]
|
||||
],
|
||||
[ // components
|
||||
[ 10.5 + 19/2, 26/2, 0, "block", 19, 15, 15.5, "SkyBlue" ],
|
||||
[ 50-5, 26/2, 0, "term35", 3],
|
||||
[ 5, 26/2, 180, "term35", 3],
|
||||
[ 34, 2, 0, "2p54header", 3, 1 ],
|
||||
],
|
||||
[], // accessories
|
||||
[], // grid
|
||||
];
|
||||
|
||||
TP4056 = ["TP4056", "TP4056 Li-lon Battery charger module", 26.2, 17.5, 1.0, 0, 1.0, [2.4, 2.4], "#2140BE", false,
|
||||
[[1.67, 1.8], [1.67, -1.8], [-1.67, 1.8], [-1.67, -1.8], [-1.67, -4.98], [-1.67, 4.98]],
|
||||
[ [ 2, 17.5 / 2, 180, "usb_uA"],
|
||||
@@ -1197,11 +1218,11 @@ tiny_buck = pcb("tiny_buck", "Ultra Small 3A buck regulator", [20, 11, 1.6],
|
||||
]
|
||||
);
|
||||
|
||||
tiny_pcbs = [ESP_201, ESP_12F, XIAO, MP1584EN, ESP_01, ESP_01M, tiny_buck, LIPO_fuel_gauge];
|
||||
tiny_pcbs = [ESP_201, ESP_01M, XIAO, ESP_12F, MP1584EN, ESP_01,tiny_buck, LIPO_fuel_gauge];
|
||||
|
||||
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, RAMPSEndstop, MT3608, ArduinoNano, Feather405, RPI_Pico, ESP32_DOIT_V1, RPI0, EnviroPlus, ArduinoUno3, ArduinoLeonardo, WD2002SJ, OPZ2, PanelDue_v3, RPI3A, RPI3, RPI4];
|
||||
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_not_shown = [Melzi, Duex2, PSU12V1A, Keyes5p1, PI_IO, ExtruderPCB];
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
//
|
||||
//! Potentiometers and rotary encoders
|
||||
include <../utils/core/core.scad>
|
||||
include <../core.scad>
|
||||
use <../utils/rounded_cylinder.scad>
|
||||
use <../utils/round.scad>
|
||||
use <../utils/thread.scad>
|
||||
@@ -71,18 +71,8 @@ module pot_nut(type, washer = true) { //! Draw the nut for a potentiometer and p
|
||||
}
|
||||
|
||||
if(nut)
|
||||
color(nut[2])
|
||||
translate_z(nut_z + exploded() * 10) {
|
||||
linear_extrude(nut[1])
|
||||
difference() {
|
||||
circle(d = nut.x / cos(30), $fn = 6);
|
||||
|
||||
circle(d = thread_d);
|
||||
}
|
||||
|
||||
if(show_threads && exploded())
|
||||
female_metric_thread(thread_d, pot_thread_p(type), nut[1], center = false, colour = nut[2]);
|
||||
}
|
||||
translate_z(nut_z + exploded() * 10)
|
||||
draw_nut(nut.x / cos(30), thread_d, nut[1], pot_thread_p(type), nut[2], show_threads && exploded());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -161,7 +161,7 @@ module psu(type) { //! Draw a power supply
|
||||
fan_holes(fan.z, h = 0);
|
||||
|
||||
difference() {
|
||||
square(inf, true);
|
||||
square(big, true);
|
||||
|
||||
fan_guard(fan.z, thickness = 0, grill = true);
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ function screw_head_depth(type, d = 0) = //! How far a counter sink
|
||||
: let(r = screw_radius(type)) screw_head_radius(type) - max(r, d / 2) + r / 5;
|
||||
|
||||
function screw_thread_radius(type) = //! Thread radius
|
||||
let(d = echoit(screw_thread_diameter(type))) is_undef(d) ? screw_radius(type) : d / 2;
|
||||
let(d = screw_thread_diameter(type)) is_undef(d) ? screw_radius(type) : d / 2;
|
||||
|
||||
function screw_angle(type, length, nut_distance) = //! How much to rotate the screw to align it with a nut at the specified `distance` from the head
|
||||
-360 * (length - nut_distance) / metric_coarse_pitch(screw_thread_radius(type) * 2);
|
||||
@@ -205,8 +205,7 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
|
||||
cylinder(h=2 * eps, r=socket_rad, $fn = 6);
|
||||
}
|
||||
if(head_type == hs_hex) {
|
||||
color(colour)
|
||||
cylinder(r = head_rad, h = head_height, $fn = 6);
|
||||
draw_nut(head_rad * 2, 0, head_height, 0, colour, false);
|
||||
|
||||
shaft();
|
||||
}
|
||||
|
@@ -26,11 +26,13 @@
|
||||
//
|
||||
mdf_colour = "#BEA587"; // sampled from a photo
|
||||
|
||||
MDF3 = [ "MDF3", "Sheet MDF", 3, mdf_colour, true];
|
||||
MDF6 = [ "MDF6", "Sheet MDF", 6, mdf_colour, true]; // ~1/4"
|
||||
MDF10 = [ "MDF10", "Sheet MDF", 10, mdf_colour, true]; // ~3/8"
|
||||
MDF12 = [ "MDF12", "Sheet MDF", 12, mdf_colour, true]; // ~1/2"
|
||||
MDF18 = [ "MDF18", "Sheet MDF", 18, mdf_colour, true];
|
||||
MDF19 = [ "MDF19", "Sheet MDF", 19, mdf_colour, true]; // ~3/4"
|
||||
MDF22 = [ "MDF22", "Sheet MDF", 22, mdf_colour, true];
|
||||
PMMA1p25 = [ "PMMA1p25", "Sheet acrylic", 1.25,[1, 1, 1, 0.5 ], false];
|
||||
PMMA2 = [ "PMMA2", "Sheet acrylic", 2, [1, 1, 1, 0.5 ], false];
|
||||
PMMA3 = [ "PMMA3", "Sheet acrylic", 3, [1, 1, 1, 0.5 ], false]; // ~1/8"
|
||||
@@ -56,7 +58,7 @@ CF2 = [ "CF2", "Sheet carbon fiber", 2, grey(35),
|
||||
CF3 = [ "CF3", "Sheet carbon fiber", 3, grey(35), false, 2, 2, grey(20)];
|
||||
|
||||
|
||||
sheets = [CF1, CF2, CF3, MDF6, MDF10, MDF12, MDF19, PMMA1p25, PMMA2, PMMA3, PMMA6, PMMA8, PMMA10,
|
||||
sheets = [CF1, CF2, CF3, MDF3, MDF6, MDF10, MDF12, MDF19, MDF22, PMMA1p25, PMMA2, PMMA3, PMMA6, PMMA8, PMMA10,
|
||||
glass2, DiBond, DiBond6, Cardboard, FoilTape, AL1_6, AL2, AL3, AL6, AL8, Steel06, Spring08, Silicone3, Foam20];
|
||||
|
||||
use <sheet.scad>
|
||||
|