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

Compare commits

..

13 Commits

Author SHA1 Message Date
Chris Palmer
b56ddea1e3 Can now have PCB screw holes without screws for RAMPS endstop. 2020-03-07 22:11:09 +00:00
Chris Palmer
c16a1c3804 Moved cable strips nearer the back of the libtest picture. 2020-03-05 20:55:57 +00:00
Chris Palmer
245b158f1d Added threads to fuseholder. 2020-03-05 10:15:42 +00:00
Chris Palmer
60628dfec0 Added threads to 4mm jack sockets. 2020-03-04 17:42:03 +00:00
Chris Palmer
f7db793c74 Assembly module search in views.py now case insensitive
allowing the module name string to specify the capitalisaing used in the
build instructions.
2020-03-04 12:15:48 +00:00
Chris Palmer
53292c9f89 Filenames of tests can now be capitalised to get the correct titles.
The implementation files are still lower case for backwards compatibility.
2020-03-03 20:33:53 +00:00
Chris Palmer
bd60b50b09 Removed lower case tests 2020-03-03 20:28:18 +00:00
Chris Palmer
4d51cb73f3 Table of contents now has three vitamin coloumns 2020-03-03 09:32:08 +00:00
Chris Palmer
3b77c97532 Example now include core.scad instead of lib.scad. 2020-03-02 21:04:19 +00:00
Chris Palmer
4442042197 Include of wire.scad changed to use. 2020-03-02 21:03:41 +00:00
Chris Palmer
4e233e5e9d Updated readme and images 2020-03-02 19:45:28 +00:00
Martin Budden
675953d334 Allow no center hole in extrusion. 2020-03-02 19:06:53 +00:00
Martin Budden
9527fa1c1f Added E1515 extrusion. 2020-03-02 18:51:27 +00:00
38 changed files with 247 additions and 189 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -35,7 +35,14 @@ $extrusion_width = 0.5;
$pp1_colour = "dimgrey";
$pp2_colour = [0.9, 0.9, 0.9];
include <NopSCADlib/lib.scad>
include <NopSCADlib/core.scad>
include <NopSCADlib/vitamins/iecs.scad>
include <NopSCADlib/vitamins/mains_sockets.scad>
include <NopSCADlib/vitamins/tubings.scad>
use <NopSCADlib/vitamins/insert.scad>
use <NopSCADlib/vitamins/wire.scad>
use <NopSCADlib/vitamins/jack.scad>
use <NopSCADlib/printed/foot.scad>
echo(extrusion_width = extrusion_width, layer_height = layer_height);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 781 KiB

After

Width:  |  Height:  |  Size: 784 KiB

View File

@@ -38,13 +38,13 @@ use <tests/fans.scad>
use <tests/fuseholder.scad>
use <tests/geared_steppers.scad>
use <tests/hot_ends.scad>
use <tests/iecs.scad>
use <tests/IECs.scad>
use <tests/inserts.scad>
use <tests/jack.scad>
use <tests/kp_pillow_blocks.scad>
use <tests/KP_pillow_blocks.scad>
use <tests/leadnuts.scad>
use <tests/leds.scad>
use <tests/ldrs.scad>
use <tests/LDRs.scad>
use <tests/LEDs.scad>
use <tests/light_strips.scad>
use <tests/linear_bearings.scad>
use <tests/meter.scad>
@@ -53,22 +53,22 @@ use <tests/modules.scad>
use <tests/nuts.scad>
use <tests/o_ring.scad>
use <tests/opengrab.scad>
use <tests/pcbs.scad>
use <tests/PCBs.scad>
use <tests/pillars.scad>
use <tests/psus.scad>
use <tests/PSUs.scad>
use <tests/pulleys.scad>
use <tests/rails.scad>
use <tests/ring_terminals.scad>
use <tests/rockers.scad>
use <tests/rod.scad>
use <tests/screws.scad>
use <tests/scs_bearing_blocks.scad>
use <tests/SCS_bearing_blocks.scad>
use <tests/sealing_strip.scad>
use <tests/sheets.scad>
use <tests/sk_brackets.scad>
use <tests/SK_brackets.scad>
use <tests/spades.scad>
use <tests/springs.scad>
use <tests/ssrs.scad>
use <tests/SSRs.scad>
use <tests/stepper_motors.scad>
use <tests/toggles.scad>
use <tests/transformers.scad>
@@ -90,14 +90,14 @@ use <tests/fixing_block.scad>
use <tests/flat_hinge.scad>
use <tests/foot.scad>
use <tests/handle.scad>
use <tests/pcb_mount.scad>
use <tests/PCB_mount.scad>
use <tests/printed_box.scad>
use <tests/ribbon_clamp.scad>
use <tests/screw_knob.scad>
use <tests/socket_box.scad>
use <tests/strap_handle.scad>
use <tests/ssr_shroud.scad>
use <tests/psu_shroud.scad>
use <tests/SSR_shroud.scad>
use <tests/PSU_shroud.scad>
x0 = 0;
x1 = x0 + 100;
@@ -366,7 +366,7 @@ sk_brackets_y = extrusion_brackets_y + 80;
kp_pillow_blocks_y = sk_brackets_y + 50;
scs_bearing_blocks_y = kp_pillow_blocks_y + 60;
translate([x4 + 130, belts_y + 58]) {
translate([x4 + 150, belts_y + 58]) {
belt_test();
translate([0, 60])
@@ -376,9 +376,8 @@ translate([x4 + 130, belts_y + 58]) {
translate([x4, rails_y + 130])
rails();
translate([780, 0])
rotate(90)
cable_strips();
translate([900, fans_y + 50])
cable_strips();
translate([x4, kp_pillow_blocks_y])
kp_pillow_blocks();

View File

@@ -143,7 +143,7 @@ module psu_shroud(type, cable_d, name, cables = 1) { //! Generate the STL file f
}
module psu_shroud_assembly(type, cable_d, name, cables = 1) //! The printed parts with inserts fitted
assembly(str("psu_shroud_", name)) {
assembly(str("PSU_shroud_", name)) {
translate_z(psu_shroud_height(type))
vflip()

View File

@@ -107,7 +107,7 @@ module ssr_shroud(type, cable_d, name) { //! Generate the STL file for a spec
}
module ssr_shroud_assembly(type, cable_d, name) //! The printed parts with inserts fitted
assembly(str("ssr_shroud_", name)) {
assembly(str("SSR_shroud_", name)) {
translate_z(ssr_shroud_height(type))
vflip()

167
readme.md
View File

@@ -17,39 +17,29 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
## Table of Contents<a name="top"/>
<table><tr>
<th align="left"> Vitamins A-M </th><th align="left"> Vitamins N-Z </th><th align="left"> Printed </th><th align="left"> Utilities </th><th align="left"> Core Utilities </th></tr>
<tr><td> <a href = "#Ball_bearings">Ball_bearings</a> </td><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Box">Box</a> </td><td> <a href = "#Annotation">Annotation</a> </td><td> <a href = "#Bom">Bom</a> </td></tr>
<tr><td> <a href = "#Batteries">Batteries</a> </td><td> <a href = "#O_ring">O_ring</a> </td><td> <a href = "#Butt_box">Butt_box</a> </td><td> <a href = "#Bezier">Bezier</a> </td><td> <a href = "#Clip">Clip</a> </td></tr>
<tr><td> <a href = "#Belts">Belts</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Cable_grommets">Cable_grommets</a> </td><td> <a href = "#Dogbones">Dogbones</a> </td><td> <a href = "#Global">Global</a> </td></tr>
<tr><td> <a href = "#Blowers">Blowers</a> </td><td> <a href = "#Pcb">Pcb</a> </td><td> <a href = "#Carriers">Carriers</a> </td><td> <a href = "#Fillet">Fillet</a> </td><td> <a href = "#Polyholes">Polyholes</a> </td></tr>
<tr><td> <a href = "#Bulldogs">Bulldogs</a> </td><td> <a href = "#Pcbs">Pcbs</a> </td><td> <a href = "#Corner_block">Corner_block</a> </td><td> <a href = "#Hanging_hole">Hanging_hole</a> </td><td> <a href = "#Rounded_rectangle">Rounded_rectangle</a> </td></tr>
<tr><td> <a href = "#Buttons">Buttons</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Door_hinge">Door_hinge</a> </td><td> <a href = "#Layout">Layout</a> </td><td> <a href = "#Sphere">Sphere</a> </td></tr>
<tr><td> <a href = "#Cable_strips">Cable_strips</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Door_latch">Door_latch</a> </td><td> <a href = "#Maths">Maths</a> </td><td> <a href = "#Teardrops">Teardrops</a> </td></tr>
<tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Psus">Psus</a> </td><td> <a href = "#Fan_guard">Fan_guard</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr>
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr>
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Rails">Rails</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#Ring_terminals">Ring_terminals</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#Rockers">Rockers</a> </td><td> <a href = "#Handle">Handle</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Rod">Rod</a> </td><td> <a href = "#Pcb_mount">Pcb_mount</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Scs_bearing_blocks">Scs_bearing_blocks</a> </td><td> <a href = "#Psu_shroud">Psu_shroud</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Sk_brackets">Sk_brackets</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Iecs">Iecs</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Ssr_shroud">Ssr_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Jack">Jack</a> </td><td> <a href = "#Springs">Springs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Kp_pillow_blocks">Kp_pillow_blocks</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Ldrs">Ldrs</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Leds">Leds</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Light_strips">Light_strips</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Mains_sockets">Mains_sockets</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Meter">Meter</a> </td><td> <a href = "#Washers">Washers</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Modules">Modules</a> </td><td></td><td></td><td></td><td></td></tr>
<th align="left"> Vitamins A-J </th><th align="left"> Vitamins K-Q </th><th align="left"> Vitamins R-Z </th><th align="left"> Printed </th><th align="left"> Utilities </th><th align="left"> Core Utilities </th></tr>
<tr><td> <a href = "#Ball_bearings">Ball_bearings</a> </td><td> <a href = "#KP_pillow_blocks">KP_pillow_blocks</a> </td><td> <a href = "#Rails">Rails</a> </td><td> <a href = "#Box">Box</a> </td><td> <a href = "#Annotation">Annotation</a> </td><td> <a href = "#BOM">BOM</a> </td></tr>
<tr><td> <a href = "#Batteries">Batteries</a> </td><td> <a href = "#LDRs">LDRs</a> </td><td> <a href = "#Ring_terminals">Ring_terminals</a> </td><td> <a href = "#Butt_box">Butt_box</a> </td><td> <a href = "#Bezier">Bezier</a> </td><td> <a href = "#Clip">Clip</a> </td></tr>
<tr><td> <a href = "#Belts">Belts</a> </td><td> <a href = "#LEDs">LEDs</a> </td><td> <a href = "#Rockers">Rockers</a> </td><td> <a href = "#Cable_grommets">Cable_grommets</a> </td><td> <a href = "#Dogbones">Dogbones</a> </td><td> <a href = "#Global">Global</a> </td></tr>
<tr><td> <a href = "#Blowers">Blowers</a> </td><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Rod">Rod</a> </td><td> <a href = "#Carriers">Carriers</a> </td><td> <a href = "#Fillet">Fillet</a> </td><td> <a href = "#Polyholes">Polyholes</a> </td></tr>
<tr><td> <a href = "#Bulldogs">Bulldogs</a> </td><td> <a href = "#Light_strips">Light_strips</a> </td><td> <a href = "#SCS_bearing_blocks">SCS_bearing_blocks</a> </td><td> <a href = "#Corner_block">Corner_block</a> </td><td> <a href = "#Hanging_hole">Hanging_hole</a> </td><td> <a href = "#Rounded_rectangle">Rounded_rectangle</a> </td></tr>
<tr><td> <a href = "#Buttons">Buttons</a> </td><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#SK_brackets">SK_brackets</a> </td><td> <a href = "#Door_hinge">Door_hinge</a> </td><td> <a href = "#Layout">Layout</a> </td><td> <a href = "#Sphere">Sphere</a> </td></tr>
<tr><td> <a href = "#Cable_strips">Cable_strips</a> </td><td> <a href = "#Mains_sockets">Mains_sockets</a> </td><td> <a href = "#SSRs">SSRs</a> </td><td> <a href = "#Door_latch">Door_latch</a> </td><td> <a href = "#Maths">Maths</a> </td><td> <a href = "#Teardrops">Teardrops</a> </td></tr>
<tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Meter">Meter</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Fan_guard">Fan_guard</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr>
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Sealing_strip">Sealing_strip</a> </td><td> <a href = "#Fixing_block">Fixing_block</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr>
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#Modules">Modules</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Handle">Handle</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#O_ring">O_ring</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#PCB_mount">PCB_mount</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#PCB">PCB</a> </td><td> <a href = "#Toggles">Toggles</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 = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#IECs">IECs</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Inserts">Inserts</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Jack">Jack</a> </td><td></td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
</table>
---
@@ -676,14 +666,15 @@ Aluminium extrusion.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```extrusion(E1515, 80)``` | Extrusion E1515 x 80mm |
| 1 | ```extrusion(E2020, 80)``` | Extrusion E2020 x 80mm |
| 1 | ```extrusion(E2040, 80)``` | Extrusion E2040 x 80mm |
| 1 | ```extrusion(E2060, 80)``` | Extrusion E2060 x 80mm |
| 1 | ```extrusion(E2080, 80)``` | Extrusion E2080 x 80mm |
| 1 | ```extrusion(E3030, 80)``` | Extrusion E3030 x 80mm |
| 1 | ```extrusion(E3060, 80)``` | Extrusion E3060 x 80mm |
| 1 | ```extrusion(E4040, 80)``` | Extrusion E4040 x 80mm |
| 1 | ```extrusion(E4080, 80)``` | Extrusion E4080 x 80mm |
| 1 | ```extrusion(E3030, 80, cornerHole = true)``` | Extrusion E3030 x 80mm |
| 1 | ```extrusion(E3060, 80, cornerHole = true)``` | Extrusion E3060 x 80mm |
| 1 | ```extrusion(E4040, 80, cornerHole = true)``` | Extrusion E4040 x 80mm |
| 1 | ```extrusion(E4080, 80, cornerHole = true)``` | Extrusion E4080 x 80mm |
<a href="#top">Top</a>
@@ -985,8 +976,8 @@ Mini LCD Celsius Digital Thermometer Hygrometer Temperature Humidity Meter Gauge
<a href="#top">Top</a>
---
<a name="Iecs"></a>
## Iecs
<a name="IECs"></a>
## IECs
IEC mains inlets and outlet.
@@ -994,7 +985,7 @@ IEC mains inlets and outlet.
[vitamins/iec.scad](vitamins/iec.scad) Implementation.
[tests/iecs.scad](tests/iecs.scad) Code for this example.
[tests/IECs.scad](tests/IECs.scad) Code for this example.
### Properties
| Function | Description |
@@ -1141,8 +1132,8 @@ E.g. a "brown" socket for mains live needs to be displayed as "sienna" to look r
<a href="#top">Top</a>
---
<a name="Kp_pillow_blocks"></a>
## Kp_pillow_blocks
<a name="KP_pillow_blocks"></a>
## KP_pillow_blocks
KP pillow block bearings
@@ -1150,7 +1141,7 @@ KP pillow block bearings
[vitamins/kp_pillow_block.scad](vitamins/kp_pillow_block.scad) Implementation.
[tests/kp_pillow_blocks.scad](tests/kp_pillow_blocks.scad) Code for this example.
[tests/KP_pillow_blocks.scad](tests/KP_pillow_blocks.scad) Code for this example.
### Properties
| Function | Description |
@@ -1194,8 +1185,8 @@ KP pillow block bearings
<a href="#top">Top</a>
---
<a name="Ldrs"></a>
## Ldrs
<a name="LDRs"></a>
## LDRs
Light dependent resistors.
Larger ones seem to have both a higher dark resistance and a lower bright light resistance.
@@ -1205,7 +1196,7 @@ Larger ones seem to have both a higher dark resistance and a lower bright light
[vitamins/ldr.scad](vitamins/ldr.scad) Implementation.
[tests/ldrs.scad](tests/ldrs.scad) Code for this example.
[tests/LDRs.scad](tests/LDRs.scad) Code for this example.
### Properties
| Function | Description |
@@ -1285,8 +1276,8 @@ Nuts for leadscrews.
<a href="#top">Top</a>
---
<a name="Leds"></a>
## Leds
<a name="LEDs"></a>
## LEDs
Standard domed through hole LEDs. Can specify colour and lead length.
@@ -1294,7 +1285,7 @@ Standard domed through hole LEDs. Can specify colour and lead length.
[vitamins/led.scad](vitamins/led.scad) Implementation.
[tests/leds.scad](tests/leds.scad) Code for this example.
[tests/LEDs.scad](tests/LEDs.scad) Code for this example.
### Properties
| Function | Description |
@@ -1816,14 +1807,14 @@ A permanent magnet that can be magnatized and de-magnatized electronically.
<a href="#top">Top</a>
---
<a name="Pcb"></a>
## Pcb
<a name="PCB"></a>
## PCB
PCBs and perfboard with optional components. The shape can be a rectangle with optionally rounded corners or a polygon for odd shapes like Arduino.
[vitamins/pcb.scad](vitamins/pcb.scad) Implementation.
[tests/pcb.scad](tests/pcb.scad) Code for this example.
[tests/PCB.scad](tests/PCB.scad) Code for this example.
### Properties
| Function | Description |
@@ -1898,8 +1889,8 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
<a href="#top">Top</a>
---
<a name="Pcbs"></a>
## Pcbs
<a name="PCBs"></a>
## PCBs
PCBs and perfboard with optional components. The shape can be a rectangle with optionally rounded corners or a polygon for odd shapes like Arduino.
@@ -1907,7 +1898,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
[vitamins/pcb.scad](vitamins/pcb.scad) Implementation.
[tests/pcbs.scad](tests/pcbs.scad) Code for this example.
[tests/PCBs.scad](tests/PCBs.scad) Code for this example.
### Properties
| Function | Description |
@@ -1991,7 +1982,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 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 x 1.6mm nyloc |
| 32 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 30 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 12 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 12 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 1 | ```pcb(PI_IO)``` | PI_IO V2 |
@@ -2006,7 +1997,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | ```pcb(RPI3)``` | Raspberry Pi 3 |
| 1 | ```pcb(RPI0)``` | Raspberry Pi Zero |
| 16 | ```screw(M2_cap_screw, 25)``` | Screw M2 cap x 25mm |
| 4 | ```screw(M2p5_cap_screw, 16)``` | Screw M2.5 cap x 16mm |
| 2 | ```screw(M2p5_cap_screw, 16)``` | Screw M2.5 cap x 16mm |
| 12 | ```screw(M2p5_cap_screw, 20)``` | Screw M2.5 cap x 20mm |
| 4 | ```screw(M2p5_pan_screw, 20)``` | Screw M2.5 pan x 20mm |
| 8 | ```screw(M2p5_pan_screw, 25)``` | Screw M2.5 pan x 25mm |
@@ -2018,7 +2009,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 2 | ```green_terminal(gt_2p54, 4)``` | Terminal block 4 way 0.1" |
| 1 | | USB A to Mini B lead |
| 16 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
| 32 | ```washer(M2p5_washer)``` | Washer M2.5 x 5.9mm x 0.5mm |
| 30 | ```washer(M2p5_washer)``` | Washer M2.5 x 5.9mm x 0.5mm |
| 12 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 12 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
| 1 | ```pcb(ZC_A0591)``` | ZC-A0591 ULN2003 driver PCB |
@@ -2035,7 +2026,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 4 | pcb_spacer25120_2.stl |
| 4 | pcb_spacer25130_2.stl |
| 4 | pcb_spacer25240.stl |
| 4 | pcb_spacer2550.stl |
| 2 | pcb_spacer2550.stl |
| 4 | pcb_spacer2580.stl |
| 4 | pcb_spacer2590.stl |
| 4 | pcb_spacer30180.stl |
@@ -2145,8 +2136,8 @@ Pin headers and sockets, etc.
<a href="#top">Top</a>
---
<a name="Psus"></a>
## Psus
<a name="PSUs"></a>
## PSUs
Powersupplies. Can be a simple cube or can be defined by a list of six faces, each with thickness, holes, cutouts, etc.
Face order is bottom, top, left, right, front, back.
@@ -2156,7 +2147,7 @@ Face order is bottom, top, left, right, front, back.
[vitamins/psu.scad](vitamins/psu.scad) Implementation.
[tests/psus.scad](tests/psus.scad) Code for this example.
[tests/PSUs.scad](tests/PSUs.scad) Code for this example.
### Properties
| Function | Description |
@@ -2599,8 +2590,8 @@ Machine screws and wood screws with various head styles.
<a href="#top">Top</a>
---
<a name="Scs_bearing_blocks"></a>
## Scs_bearing_blocks
<a name="SCS_bearing_blocks"></a>
## SCS_bearing_blocks
SCSnUU and SCSnLUU bearing blocks
@@ -2608,7 +2599,7 @@ SCSnUU and SCSnLUU bearing blocks
[vitamins/scs_bearing_block.scad](vitamins/scs_bearing_block.scad) Implementation.
[tests/scs_bearing_blocks.scad](tests/scs_bearing_blocks.scad) Code for this example.
[tests/SCS_bearing_blocks.scad](tests/SCS_bearing_blocks.scad) Code for this example.
### Properties
| Function | Description |
@@ -2749,8 +2740,8 @@ Note that modules that drill holes will return a 2D object if ```h``` is set to
<a href="#top">Top</a>
---
<a name="Sk_brackets"></a>
## Sk_brackets
<a name="SK_brackets"></a>
## SK_brackets
SK shaft support brackets
@@ -2758,7 +2749,7 @@ SK shaft support brackets
[vitamins/sk_bracket.scad](vitamins/sk_bracket.scad) Implementation.
[tests/sk_brackets.scad](tests/sk_brackets.scad) Code for this example.
[tests/SK_brackets.scad](tests/SK_brackets.scad) Code for this example.
### Properties
| Function | Description |
@@ -2932,8 +2923,8 @@ By default springs have their origin at the bottom but can be centered.
<a href="#top">Top</a>
---
<a name="Ssrs"></a>
## Ssrs
<a name="SSRs"></a>
## SSRs
Solid state relays.
@@ -2941,7 +2932,7 @@ Solid state relays.
[vitamins/ssr.scad](vitamins/ssr.scad) Implementation.
[tests/ssrs.scad](tests/ssrs.scad) Code for this example.
[tests/SSRs.scad](tests/SSRs.scad) Code for this example.
### Properties
| Function | Description |
@@ -4250,15 +4241,15 @@ Printed handle that can be printed without needing support material due to its t
<a href="#top">Top</a>
---
<a name="Pcb_mount"></a>
## Pcb_mount
<a name="PCB_mount"></a>
## PCB_mount
A frame to mount a PCB by its corners when it has no mounting holes.
The stl must be given a parameterless wrapper in the project that uses it.
[printed/pcb_mount.scad](printed/pcb_mount.scad) Implementation.
[tests/pcb_mount.scad](tests/pcb_mount.scad) Code for this example.
[tests/PCB_mount.scad](tests/PCB_mount.scad) Code for this example.
### Functions
| Function | Description |
@@ -4379,15 +4370,15 @@ It can also have printed feet on the base with the screws doubling up to hold th
<a href="#top">Top</a>
---
<a name="Psu_shroud"></a>
## Psu_shroud
<a name="PSU_shroud"></a>
## PSU_shroud
A cover to go over the mains end of a PSU terminal strip to make it safe.
The stl and assembly must be given a name and parameterless wrappers for the stl and assembly added to the project.
[printed/psu_shroud.scad](printed/psu_shroud.scad) Implementation.
[tests/psu_shroud.scad](tests/psu_shroud.scad) Code for this example.
[tests/PSU_shroud.scad](tests/PSU_shroud.scad) Code for this example.
### Functions
| Function | Description |
@@ -4431,9 +4422,9 @@ The stl and assembly must be given a name and parameterless wrappers for the stl
### Assemblies
| Qty | Name |
| ---:|:--- |
| 1 | psu_shroud_PD_150_12_assembly |
| 1 | psu_shroud_S_250_48_assembly |
| 1 | psu_shroud_S_300_12_assembly |
| 1 | PSU_shroud_PD_150_12_assembly |
| 1 | PSU_shroud_S_250_48_assembly |
| 1 | PSU_shroud_S_300_12_assembly |
<a href="#top">Top</a>
@@ -4581,15 +4572,15 @@ UK 13A socket and printed backbox with earth terminal for the panel it is mounte
<a href="#top">Top</a>
---
<a name="Ssr_shroud"></a>
## Ssr_shroud
<a name="SSR_shroud"></a>
## SSR_shroud
A cover to go over the mains end of an SSR to make it safe to be touched.
The STL and assembly must be given a name and parameterless wrappers for the stl and assembly added to the project.
[printed/ssr_shroud.scad](printed/ssr_shroud.scad) Implementation.
[tests/ssr_shroud.scad](tests/ssr_shroud.scad) Code for this example.
[tests/SSR_shroud.scad](tests/SSR_shroud.scad) Code for this example.
### Functions
| Function | Description |
@@ -4629,8 +4620,8 @@ The STL and assembly must be given a name and parameterless wrappers for the stl
### Assemblies
| Qty | Name |
| ---:|:--- |
| 1 | ssr_shroud_SSR10DA_assembly |
| 1 | ssr_shroud_SSR25DA_assembly |
| 1 | SSR_shroud_SSR10DA_assembly |
| 1 | SSR_shroud_SSR25DA_assembly |
<a href="#top">Top</a>
@@ -5104,8 +5095,8 @@ Simple tube or ring
<a href="#top">Top</a>
---
<a name="Bom"></a>
## Bom
<a name="BOM"></a>
## BOM
Bill Of Materials generation via echo and the ```bom.py``` script. Also handles exploded assembly views and posing. Assembly instructions can precede the module
definition that makes the assembly.
@@ -5115,7 +5106,7 @@ heirachical BOMs are also generated for real projects.
[utils/core/bom.scad](utils/core/bom.scad) Implementation.
[tests/bom.scad](tests/bom.scad) Code for this example.
[tests/BOM.scad](tests/BOM.scad) Code for this example.
### Functions
| Function | Description |

View File

@@ -109,13 +109,14 @@ def tests(tests):
#
# List of individual part files
#
scads = [i for i in sorted(os.listdir(scad_dir)) if i[-5:] == ".scad"]
scads = [i for i in sorted(os.listdir(scad_dir), key = lambda s: s.lower()) if i[-5:] == ".scad"]
for scad in scads:
base_name = scad[:-5]
if not tests or base_name in tests:
print(base_name)
cap_name = base_name[0].capitalize() + base_name[1:]
base_name = base_name.lower()
scad_name = scad_dir + '/' + scad
png_name = png_dir + '/' + base_name + '.png'
bom_name = bom_dir + '/' + base_name + '.json'
@@ -140,11 +141,14 @@ def tests(tests):
print("Can't find implementation!")
continue
vsplit = "M"
vsplit = "AKR" + chr(ord('Z') + 1)
vtype = locations[0][1]
types = [vtype + ' A-' + vsplit[0], vtype + ' ' + chr(ord(vsplit) + 1) + '-Z'] + [loc[1] for loc in locations[1 :]]
types = [vtype + ' ' + vsplit[i] + '-' + chr(ord(vsplit[i + 1]) - 1) for i in range(len(vsplit) - 1)] + [loc[1] for loc in locations[1 :]]
if type == vtype:
type = types[0] if cap_name[0] <= vsplit else types[1]
for i in range(1, len(vsplit)):
if cap_name[0] < vsplit[i]:
type = types[i - 1]
break
for t in types:
if not t in bodies:
@@ -188,10 +192,10 @@ def tests(tests):
body += ["![%s](%s)\n" %(base_name, png_name)]
dname = deps_name(deps_dir, scad)
dname = deps_name(deps_dir, scad.lower())
oldest = png_name if mtime(png_name) < mtime(bom_name) else bom_name
changed = check_deps(oldest, dname)
changed = times.check_have_time(changed, scad_name)
changed = times.check_have_time(changed, scad_name.lower())
changed = options.have_changed(changed, oldest)
if changed:
print(changed)

View File

@@ -89,6 +89,14 @@ def eop(print_mode, doc_file, last = False, first = False):
def pad(s, before, after = 0):
return '&nbsp;' * before + str(s) + '&nbsp;' * after
def titalise(name):
cap_next = True
result = ''
for c in name.replace('_', ' '):
result = result + (c.upper() if cap_next else c);
cap_next = c == ' '
return result
def views(target, do_assemblies = None):
done_assemblies = []
#
@@ -109,9 +117,10 @@ def views(target, do_assemblies = None):
with open(bounds_fname) as json_file:
bounds_map = json.load(json_file)
#
# Find all the assemblies
# Find all the assemblies and remove any old views
#
assemblies = bom_to_assemblies(bom_dir, bounds_map)
lc_assemblies = [ass.lower() for ass in assemblies]
for file in os.listdir(target_dir):
if file.endswith('.png'):
assembly = file[:-4].replace('_assembled', '_assembly')
@@ -140,22 +149,24 @@ def views(target, do_assemblies = None):
if len(words) and words[0] == "module":
module = words[1].split('(')[0]
if is_assembly(module):
if module in assemblies:
lc_module = module.lower()
if lc_module in lc_assemblies:
real_name = assemblies[lc_assemblies.index(lc_module)]
#
# Scrape the assembly instructions
#
for ass in flat_bom:
if ass["name"] == module:
if ass["name"] == real_name:
if not "blurb" in ass:
ass["blurb"] = blurb.scrape_module_blurb(lines[:line_no])
break
if not do_assemblies or module in do_assemblies:
if not do_assemblies or real_name in do_assemblies:
#
# Run openscad on the created file
#
dname = deps_name(deps_dir, filename)
for explode in [0, 1]:
png_name = target_dir + '/' + module + '.png'
png_name = target_dir + '/' + real_name + '.png'
if not explode:
png_name = png_name.replace('_assembly', '_assembled')
changed = check_deps(png_name, dname)
@@ -181,7 +192,7 @@ def views(target, do_assemblies = None):
if mtime(png_name) > mtime(tn_name):
do_cmd(("magick "+ png_name + " -trim -resize 280x280 -background " + background + " -gravity Center -extent 280x280 -bordercolor " + background + " -border 10 " + tmp_name).split())
update_image(tmp_name, tn_name)
done_assemblies.append(module)
done_assemblies.append(real_name)
else:
if module == 'main_assembly':
main_blurb = blurb.scrape_module_blurb(lines[:line_no])
@@ -216,7 +227,7 @@ def views(target, do_assemblies = None):
print('1. [Parts list](#Parts_list)', file = doc_file)
for ass in flat_bom:
name = ass["name"]
cap_name = name.replace('_', ' ').title()
cap_name = titalise(name)
print('1. [%s](#%s)' % (cap_name, name), file = doc_file)
print(file = doc_file)
eop(print_mode, doc_file)
@@ -237,7 +248,7 @@ def views(target, do_assemblies = None):
else:
things[t][thing] = ass[t][thing]
for ass in flat_bom:
name = ass["name"][:-9].replace('_', ' ').title().replace(' ','&nbsp;')
name = titalise(ass["name"][:-9]).replace(' ','&nbsp;')
print('| <span style="writing-mode: vertical-rl; text-orientation: mixed;">%s</span> ' % name, file = doc_file, end = '')
print('| <span style="writing-mode: vertical-rl; text-orientation: mixed;">TOTALS</span> | |', file = doc_file)
@@ -274,7 +285,7 @@ def views(target, do_assemblies = None):
#
for ass in flat_bom:
name = ass["name"]
cap_name = name.replace('_', ' ').title()
cap_name = titalise(name)
if ass["count"] > 1:
print('<a name="%s"></a>\n## %d x %s' % (name, ass["count"], cap_name), file = doc_file)

View File

@@ -23,7 +23,7 @@ include <../vitamins/extrusions.scad>
module extrusions()
layout([for(e = extrusions) extrusion_width(e)], 10)
extrusion(extrusions[$i], 80);
extrusion(extrusions[$i], 80, cornerHole = extrusion_width(extrusions[$i]) > 20);
if ($preview)
extrusions();

View File

@@ -24,4 +24,5 @@ module fuseholders()
fuseholder(6);
if($preview)
fuseholders();
let($show_threads = 1)
fuseholders();

View File

@@ -32,4 +32,5 @@ module jacks() {
}
if($preview)
jacks();
let($show_threads = true)
jacks();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 143 KiB

View File

@@ -18,7 +18,7 @@
//
include <../utils/core/core.scad>
include <../vitamins/wire.scad>
use <../vitamins/wire.scad>
bundle = [7, 1.4];

View File

@@ -101,7 +101,8 @@ module extrusion_cross_section(type, cornerHole) {
translate([0,i*width+(width-height)/2])
difference() {
square([centerSquare,centerSquare],center=true);
circle(d=extrusion_center_hole(type));
if(extrusion_center_hole(type)>0)
circle(d=extrusion_center_hole(type));
}
translate([0,(width-height)/2])
for(angle=[0,90])

View File

@@ -20,6 +20,7 @@
// Extrusion
//
// W H d1 d2 s cw cwi t st f
E1515 = [ "E1515", 15, 15, 2.5, 0,5.7,3.4, 5.7, 1.1,1.1, 0.5 ];
E2020 = [ "E2020", 20, 20, 4.2, 3, 8, 6, 12.0, 2, 2, 1 ];
E2040 = [ "E2040", 20, 40, 4.2, 3, 8, 6, 12.0, 2, 2, 1 ];
E2060 = [ "E2060", 20, 60, 4.2, 3, 8, 6, 12.0, 2, 2, 1 ];
@@ -29,7 +30,7 @@ E3060 = [ "E3060", 30, 60, 6.8, 4.2, 12, 8, 16.5, 2, 2, 1 ];
E4040 = [ "E4040", 40, 40, 10.5, 6.0, 15, 10, 20.0, 5.5, 3, 1 ];
E4080 = [ "E4080", 40, 80, 10.5, 6.0, 15, 10, 20.0, 5.5, 3, 1 ];
extrusions = [E2020,E2040,E2060,E2080,E3030,E3060,E4040,E4080];
extrusions = [E1515,E2020,E2040,E2060,E2080,E3030,E3060,E4040,E4080];
use <extrusion.scad>

View File

@@ -23,6 +23,7 @@
include <../utils/core/core.scad>
include <spades.scad>
use <../utils/tube.scad>
use <../utils/thread.scad>
module fuseholder_hole(h = 100) //! Hole with flats for fuseholder
extrude_if(h)
@@ -39,7 +40,8 @@ module fuseholder(thickness) { //! Fuseholder with nut in place for specified pa
flange_d = fuseholder_diameter();
flange_t = 2;
height = 33.2;
thread_d = 11.7;
thread_d = 12;
thread_p = 1;
thread = 15;
bot_d = 10.4;
top_d = 8.7;
@@ -59,24 +61,28 @@ module fuseholder(thickness) { //! Fuseholder with nut in place for specified pa
//
// Nut
//
colour = grey40;
vflip()
translate_z(thickness)
explode(height)
color("dimgrey") {
tube(or = nut_d / 2, ir = 5, h = nut_flange_t, center = false);
explode(height) {
color(colour) {
tube(or = nut_d / 2, ir = thread_d / 2, h = nut_flange_t, center = false);
linear_extrude(height = nut_t)
difference() {
circle(d = nut_d, $fn = 6);
circle(5);
circle(d = thread_d);
}
}
if(show_threads)
female_metric_thread(thread_d, thread_p, nut_t, false, colour = colour);
}
//
// Body
//
explode(height + 5, offset = -height - 4) {
color("dimgrey") {
color(colour) {
tube(or = flange_d / 2, ir = 5.2, h = flange_t, center = false);
cylinder(r = 5, h = flange_t - 1);
@@ -89,26 +95,35 @@ module fuseholder(thickness) { //! Fuseholder with nut in place for specified pa
}
vflip() {
linear_extrude(height = thread)
intersection() {
circle(d = thread_d);
if(!show_threads)
linear_extrude(height = thread)
intersection() {
circle(d = thread_d - 0.3);
square([100, 10.8], center = true);
}
render() difference() {
translate_z(thread)
cylinder(d1 = bot_d, d2 = top_d, h = height - flange_t - thread);
square([100, 10.8], center = true);
}
render() difference() {
translate_z(thread)
cylinder(d1 = bot_d, d2 = top_d, h = height - flange_t - thread);
for(side = [-1, 1])
translate([side * (contact_slot_d / 2 + 1) - 1, -contact_slot_w / 2, contact_slot_z])
cube([2, contact_slot_w, 100]);
}
for(side = [-1, 1])
translate([side * (contact_slot_d / 2 + 1) - 1, -contact_slot_w / 2, contact_slot_z])
cube([2, contact_slot_w, 100]);
}
}
if(show_threads)
vflip()
render() intersection() {
male_metric_thread(thread_d, thread_p, thread, false, colour = colour);
translate_z(thread / 2)
cube([100, 10.8, thread + 1], center = true);
}
}
//
// Side contacts
//
color("silver") vflip()
color(silver) vflip()
for(side = [-1, 1])
translate([side * contact_slot_d / 2, 0, contact_slot_z])
rotate([0, -70, 90 - side * 90])

View File

@@ -25,6 +25,7 @@ include <../core.scad>
include <spades.scad>
use <../utils/tube.scad>
use <../utils/rounded_cylinder.scad>
use <../utils/thread.scad>
use <ring_terminal.scad>
function jack_4mm_hole_radius() = 8/2; //! Panel hole radius for 4mm jack
@@ -39,6 +40,7 @@ module jack_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm jack
sleaved_d = 6.4;
thread = 10.4;
thread_d = 8;
thread_p = 0.75;
nut_d = 9.8;
nut_t = 3;
barrel_d = 5.4;
@@ -56,28 +58,33 @@ module jack_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm jack
}
square([flange_id, 100], center = true);
}
color("silver") rotate_extrude() difference() {
color(silver) rotate_extrude() difference() {
union() {
translate([0, -thread])
square([thread_d / 2, thread]);
*translate([0, -nut_t - thickness])
square([nut_d / 2, nut_t]);
square([thread_d / 2 - (show_threads ? thread_p / 2 : 0), thread]);
translate([0, -barrel])
square([barrel_d / 2, barrel]);
}
square([4, 2 * (barrel - 1)], center = true);
}
if(show_threads)
translate_z(-thread)
male_metric_thread(thread_d, thread_p, thread, false, solid = false, colour = silver);
translate_z(-length + flange_t + spade)
vflip()
spade(spade4p8l, spade);
}
translate_z(-thickness)
explode(-length)
color("silver")
vflip()
vflip() {
color(silver)
tube(ir = thread_d / 2, or = nut_d / 2, h = nut_t, center = false);
if(show_threads)
female_metric_thread(thread_d, thread_p, nut_t, false, colour = silver);
}
}
function jack_4mm_shielded_hole_radius() = 12/2; //! Panel hole radius for 4mm shielded jack
@@ -90,14 +97,16 @@ module jack_4mm_shielded(colour, thickness, display_colour = false) { //! Draw a
sleaved = 21;
sleaved_d = 10.7;
thread = 14;
thread_d = 11.7;
thread_d = 12;
thread_p = 0.75;
nut_d = 14.4;
nut_t = 5;
length = 32;
spade = 8.5;
actual_colour = display_colour ? display_colour : colour;
explode(length, offset = -length + flange_t) {
color(display_colour ? display_colour : colour) {
color(actual_colour) {
rounded_cylinder(r = flange_d / 2, h = flange_t, r2 = 1, ir = 4.5);
rotate_extrude() difference() {
@@ -105,8 +114,9 @@ module jack_4mm_shielded(colour, thickness, display_colour = false) { //! Draw a
translate([0, -sleaved])
square([sleaved_d / 2, sleaved + flange_t]);
translate([0, -thread])
square([thread_d / 2, thread]);
if(!show_threads)
translate([0, -thread])
square([thread_d / 2, thread]);
}
square([flange_id, 100], center = true);
@@ -115,8 +125,13 @@ module jack_4mm_shielded(colour, thickness, display_colour = false) { //! Draw a
square([6, 2 * sleaved], center = true);
}
}
if(show_threads)
translate_z(-thread)
male_metric_thread(thread_d, thread_p, thread, false, solid = false);
}
color("silver")
color(silver)
translate_z(-length + flange_t + spade - 0.5)
cylinder(d = 4.8, h = 0.5);
@@ -127,10 +142,13 @@ module jack_4mm_shielded(colour, thickness, display_colour = false) { //! Draw a
translate_z(-thickness)
explode(-length)
color("silver")
vflip()
vflip() {
color(silver)
tube(ir = thread_d / 2, or = nut_d / 2, h = nut_t, center = false);
if(show_threads)
female_metric_thread(thread_d, thread_p, nut_t, false, colour = silver);
}
}
function post_4mm_diameter() = 13; //! Outer diameter of 4mm binding post
@@ -167,14 +185,15 @@ module post_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm bind
post_od = 9.5;
post_metal = 0.2;
thread_d = 3.5;
thread_d = 3.6;
thread_p = 0.66;
thread_l = 15;
post_d = 7;
post_h = 14;
ringterm = ["", 6.3, 3.8, 16.7, 3, 1.6, 0.3, M4_dome_screw];
module washer() {
module washer() color(silver) {
washer_t = 0.65;
tube(or = 7.6 / 2, ir = thread_d / 2, h = washer_t, center = false);
@@ -186,11 +205,14 @@ module post_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm bind
module nut() {
nut_t = 2.3;
linear_extrude(height = nut_t) difference() {
circle(d = 6.3 / cos(30), $fn = 6);
color(silver)
linear_extrude(height = nut_t) difference() {
circle(d = 6.3 / cos(30), $fn = 6);
circle(d = thread_d);
}
circle(d = thread_d);
}
if(show_threads)
female_metric_thread(thread_d, thread_p, nut_t, false, colour = silver);
translate_z(nut_t)
children();
@@ -219,8 +241,7 @@ module post_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm bind
render() difference() {
rotate_extrude(angle = 360 / 8)
polygon([
[0, 0],
[0, 2],
[post_d / 2, 0],
[post_d / 2, 2],
[post_d / 2, 17.5],
[11 / 2, 17.5],
@@ -238,7 +259,7 @@ module post_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm bind
}
}
color("silver") {
color(silver) {
translate_z(post_metal)
cylinder(d = post_od, h = base_h);
@@ -252,9 +273,13 @@ module post_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm bind
square([2, post_h]);
}
vflip()
cylinder(d = thread_d, h = thread_l);
if(!show_threads)
vflip()
cylinder(d = thread_d, h = thread_l);
}
if(show_threads)
vflip()
male_metric_thread(thread_d, thread_p, thread_l, false, colour = silver);
}
explode(-15)
color(actual_colour) {
@@ -272,12 +297,11 @@ module post_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm bind
}
translate_z(-thickness - base_h)
explode(-20, true)
color("silver")
vflip()
not_on_bom()
washer()
explode(5, true) nut()
explode(5, true) ring_terminal(ringterm)
explode(5, true) washer()
explode(5, true) nut();
vflip()
not_on_bom()
washer()
explode(5, true) nut()
explode(5, true) ring_terminal(ringterm)
explode(5, true) washer()
explode(5, true) nut();
}

View File

@@ -63,17 +63,20 @@ function pcb_coord(type, p) = let(l = pcb_length(type), w = pcb_width(type)) //!
[(p.x >= 0 ? p.x : l + p.x) - l / 2,
(p.y >= 0 ? p.y : w + p.y) - w / 2];
module pcb_screw_positions(type) { //! Positions children at the mounting hole positions
module pcb_hole_positions(type, all = true) { // Positition children at the hole positions, including holes not used for screws
holes = pcb_holes(type);
if(len(holes))
for($i = [0 : len(holes) - 1]) {
p = pcb_coord(type, holes[$i]);
translate([p.x, p.y, 0])
for($i = [0 : 1 : len(holes) - 1]) {
hole = holes[$i];
if(len(hole) == 2 || all)
translate(pcb_coord(type, hole))
children();
}
}
}
module pcb_screw_positions(type) //! Positions children at the mounting hole positions
pcb_hole_positions(type, false) children();
module chip(length, width, thickness, colour, cutout = false) //! Draw a coloured cube to represent a chip, or other rectangular component
if(!cutout)
color(colour)
@@ -837,7 +840,7 @@ module pcb(type) { //! Draw specified PCB
else
rounded_square([pcb_length(type), pcb_width(type)], r = pcb_radius(type));
pcb_screw_positions(type)
pcb_hole_positions(type)
circle(d = pcb_hole_d(type) + eps);
if(Len(grid))
@@ -847,7 +850,7 @@ module pcb(type) { //! Draw specified PCB
color("silver")
translate_z(t / 2)
pcb_screw_positions(type)
pcb_hole_positions(type)
tube(or = max(pcb_land_d(type), 1) / 2, ir = pcb_hole_d(type) / 2, h = t + 2 * eps);
fr4 = pcb_colour(type) != "sienna";

View File

@@ -342,7 +342,7 @@ PSU12V1A = ["PSU12V1A", "PSU 12V 1A", 67, 31, 1.7, 0, 3.9, 0, "green", true, [[3
RAMPSEndstop = ["RAMPSEndstop", "RAMPS Endstop Switch",
40.0, 16.0, 1.6, 0.5, 2.54, 0, "red", false,
[
[2, 2], [2, 13.5], [17, 13.5], [36, 13.5]
[2, 2, false], [2, 13.5, false], [17, 13.5], [36, 13.5]
],
[
[ 12, 8, -90, "jst_xh", 3, true, "white", "silver"],