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

Compare commits

...

35 Commits

Author SHA1 Message Date
Chris Palmer
7c0a48d0c1 Added parametric printed box 2020-02-29 01:27:17 +00:00
Chris Palmer
95c4359421 Better test coverage of stepper earth tag position. 2020-02-28 14:27:35 +00:00
Chris Palmer
bcff26a27b Added threads to stepper motors and made the test show them. 2020-02-28 12:02:24 +00:00
Chris Palmer
07b00fabe0 Added a guard against and empty BOM in views.py. 2020-02-28 09:22:50 +00:00
Chris Palmer
8ed0f3c1af Updated readme and images. 2020-02-28 09:05:59 +00:00
Martin Budden
0e8e387d35 Improved S_300_12 PSU. 2020-02-28 03:05:45 +00:00
Chris Palmer
0c17620adb Removed echo from extrusion_bracket.scad 2020-02-28 01:59:00 +00:00
Chris Palmer
6470f1b004 Extrusions now default to centered. New parts added to the libtest picture.
Extrusion bracket examples rotated for clearer view and made optional.
Added missing description for scs_bearing_blocks.
Extrusion no longer shows centre parameter but does show no default cornerHole.
2020-02-27 17:55:03 +00:00
Chris Palmer
29ba402530 Updated image 2020-02-27 11:22:02 +00:00
Chris Palmer
aed4a699f2 Merge branch 'kp_pillow_block_fix' of https://github.com/martinbudden/NopSCADlib into martinbudden-kp_pillow_block_fix 2020-02-27 11:18:54 +00:00
Chris Palmer
10b846c0d5 Updated images 2020-02-27 11:17:07 +00:00
Martin Budden
2de479d691 Fixed incomplete webbing on side of kp_pillow_block. 2020-02-27 10:44:00 +00:00
Chris Palmer
054dab5025 Merge branch 'linear_rail_groove' of https://github.com/martinbudden/NopSCADlib into martinbudden-linear_rail_groove 2020-02-27 10:35:09 +00:00
Chris Palmer
b559319b03 Ensured all Markdown table heading markers have at least three dashes. 2020-02-27 10:15:37 +00:00
Martin Budden
a487ca0f20 Added groove to linear_rail. 2020-02-27 09:47:36 +00:00
Chris Palmer
a2ce3f1278 Updated readme 2020-02-27 09:44:54 +00:00
Chris Palmer
01eb6931d9 Merge branch 'extrusion_center' of https://github.com/martinbudden/NopSCADlib into martinbudden-extrusion_center 2020-02-27 09:41:01 +00:00
Chris Palmer
c09a74b4c9 Added center option to spring and documented the origin of rods, etc. 2020-02-27 09:39:05 +00:00
Martin Budden
aab7f3d683 Added center parameter. Added cornerhole dimensions to E20. 2020-02-27 09:03:23 +00:00
Chris Palmer
ad719dad5a Added copyright boiler plate and description.
Updated images and readme.
2020-02-26 19:43:02 +00:00
Chris Palmer
00690b61d2 Merge branch 'extrusion_corner_brackets' of https://github.com/martinbudden/NopSCADlib into martinbudden-extrusion_corner_brackets 2020-02-26 19:23:39 +00:00
Chris Palmer
1a24e0d87e Added image and updated readme. 2020-02-26 15:55:22 +00:00
Chris Palmer
171c9a6a34 Merge branch 'pcb_additions' of https://github.com/martinbudden/NopSCADlib into martinbudden-pcb_additions 2020-02-26 15:39:12 +00:00
Martin Budden
e87dffd92c More pcb component examples. Allowed more colour setting. 2020-02-26 07:19:55 +00:00
Martin Budden
c364bf06b2 Code tidy. 2020-02-25 22:34:13 +00:00
Martin Budden
1668f9c54c Naming update. 2020-02-25 22:23:44 +00:00
Martin Budden
e0dd174010 Parameterisation of extrusion brackets. 2020-02-25 22:19:20 +00:00
Martin Budden
8342ba87e9 Update as per code review. 2020-02-25 21:07:29 +00:00
Martin Budden
0e58e92fbc Allowed parameterised green terminals on PCBs. 2020-02-25 21:01:04 +00:00
Martin Budden
1af2e18594 Added usb_Ax1 and potentiometer. 2020-02-25 20:39:37 +00:00
Martin Budden
598527edbe Added a test pcb. 2020-02-25 20:13:15 +00:00
Martin Budden
9c666f8f47 Merge branch 'pin_header_color' into pcb_additions 2020-02-25 19:07:58 +00:00
Martin Budden
bc1f135e40 Added ability to set socket color. 2020-02-25 17:06:16 +00:00
Martin Budden
ce36729e50 Allow pin header base colour to be set on PCB. 2020-02-25 17:05:48 +00:00
Martin Budden
1dca024e64 Internal and external corner brackets for 20nn extrusion. 2020-02-25 16:53:51 +00:00
53 changed files with 1272 additions and 155 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -30,7 +30,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
<a name="Parts_list"></a>
## Parts list
| <span style="writing-mode: vertical-rl; text-orientation: mixed;">Base</span> | <span style="writing-mode: vertical-rl; text-orientation: mixed;">Feet</span> | <span style="writing-mode: vertical-rl; text-orientation: mixed;">Mains&nbsp;In</span> | <span style="writing-mode: vertical-rl; text-orientation: mixed;">Main</span> | <span style="writing-mode: vertical-rl; text-orientation: mixed;">TOTALS</span> | |
|--:|--:|--:|--:|--:|:--|
|---:|---:|---:|---:|---:|:---|
| | | | | | **Vitamins** |
| &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;2&nbsp; | &nbsp;&nbsp;2&nbsp; | &nbsp;&nbsp; 4mm shielded jack socket blue |
| &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;.&nbsp; | &nbsp;&nbsp;1&nbsp; | &nbsp;&nbsp;1&nbsp; | &nbsp;&nbsp; 4mm shielded jack socket brown |
@@ -61,14 +61,14 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
## Base Assembly
### Vitamins
|Qty|Description|
|--:|:----------|
|---:|:----------|
|2| Heatfit insert M3|
### 3D Printed parts
| 1 x socket_box.stl |
|--|
|---|
| ![socket_box.stl](stls/socket_box.png)
@@ -88,7 +88,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
## Feet Assembly
### Vitamins
|Qty|Description|
|--:|:----------|
|---:|:----------|
|4| Nut M3 x 2.4mm nyloc|
|4| Screw M3 dome x 10mm|
|8| Washer M3 x 7mm x 0.5mm|
@@ -97,7 +97,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
### 3D Printed parts
| 4 x foot.stl |
|--|
|---|
| ![foot.stl](stls/foot.png)
@@ -105,7 +105,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
### Sub-assemblies
| 1 x base_assembly |
|--|
|---|
| ![base_assembled](assemblies/base_assembled_tn.png)
@@ -124,7 +124,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
## Mains In Assembly
### Vitamins
|Qty|Description|
|--:|:----------|
|---:|:----------|
|3| Heatshrink sleeving ID 3.2mm x 15mm - not shown|
|1| IEC inlet for ATX|
|2| Nut M3 x 2.4mm nyloc|
@@ -138,7 +138,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
### Sub-assemblies
| 1 x feet_assembly |
|--|
|---|
| ![feet_assembled](assemblies/feet_assembled_tn.png)
@@ -163,7 +163,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
## Main Assembly
### Vitamins
|Qty|Description|
|--:|:----------|
|---:|:----------|
|2| 4mm shielded jack socket blue|
|1| 4mm shielded jack socket brown|
|2| 4mm shielded jack socket green|
@@ -178,7 +178,7 @@ Earth leakage can be measured Canadian CSA style by disconnected the neutral lin
### Sub-assemblies
| 1 x mains_in_assembly |
|--|
|---|
| ![mains_in_assembled](assemblies/mains_in_assembled_tn.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 KiB

After

Width:  |  Height:  |  Size: 786 KiB

View File

@@ -33,6 +33,7 @@ use <tests/components.scad>
use <tests/d_connectors.scad>
use <tests/displays.scad>
use <tests/extrusions.scad>
use <tests/extrusion_brackets.scad>
use <tests/fans.scad>
use <tests/fuseholder.scad>
use <tests/geared_steppers.scad>
@@ -40,6 +41,7 @@ use <tests/hot_ends.scad>
use <tests/iecs.scad>
use <tests/inserts.scad>
use <tests/jack.scad>
use <tests/kp_pillow_blocks.scad>
use <tests/leadnuts.scad>
use <tests/leds.scad>
use <tests/ldrs.scad>
@@ -60,8 +62,10 @@ 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/sealing_strip.scad>
use <tests/sheets.scad>
use <tests/sk_brackets.scad>
use <tests/spades.scad>
use <tests/springs.scad>
use <tests/ssrs.scad>
@@ -83,18 +87,25 @@ use <tests/door_hinge.scad>
use <tests/door_latch.scad>
use <tests/fan_guard.scad>
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/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/flat_hinge.scad>
use <tests/pcb_mount.scad>
x5 = 800;
x0 = 0;
x1 = x0 + 100;
x2 = x1 + 90;
x3 = x2 + 130;
x4 = x3 + 200;
x5 = 850;
x6 = x5 + 150;
cable_grommets_y = 0;
@@ -133,13 +144,17 @@ translate([x5 + 60, cable_grommets_y + 200])
translate([x5, cable_grommets_y + 250])
handle();
translate([900, 600])
translate([950, 600])
box_test();
translate([890, 730])
printed_boxes();
translate([850, 1260])
bbox_test();
x0 = 0;
inserts_y = 0;
nuts_y = inserts_y + 20;
washers_y = nuts_y + 100;
@@ -204,10 +219,6 @@ translate([x0, linear_bearings_y]) {
rods();
}
translate([x0+150, linear_bearings_y+30]) {
extrusions();
}
translate([x0 + 10, hot_ends_y])
hot_ends();
@@ -236,7 +247,6 @@ translate([x0, psus_y]) {
psu_shrouds();
}
x1 = x0 + 100;
zipties_y = 0;
bulldogs_y = zipties_y + 40;
@@ -246,7 +256,6 @@ translate([x1, zipties_y])
translate([x1, bulldogs_y])
bulldogs();
x2 = x1 + 90;
leds_y = 0;
carriers_y = leds_y + 40;
spades_y = carriers_y + 40;
@@ -293,8 +302,6 @@ translate([x2, toggles_y])
translate([x2, components_y])
components();
x3 = x2 + 150;
veroboard_y = 0;
d_connectors_y = veroboard_y + 110;
iecs_y = d_connectors_y + 80;
@@ -303,6 +310,7 @@ ssrs_y = modules_y + 80;
blowers_y = ssrs_y + 60;
batteries_y = blowers_y + 100;
steppers_y = batteries_y + 70;
extrusions_y = steppers_y + 100;
translate([x3, veroboard_y])
veroboard_test();
@@ -343,16 +351,22 @@ translate([x3, batteries_y])
translate([x2, steppers_y]) // interloper
stepper_motors();
translate([x2, extrusions_y]) {
extrusions();
}
translate([x3, transformers_y])
transformers();
x4 = x3 + 220;
belts_y = 0;
rails_y = belts_y + 200;
cable_strips_y = rails_y + 300;
extrusion_brackets_y = rails_y + 250;
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 + 112, belts_y + 58]) {
translate([x4 + 130, belts_y + 58]) {
belt_test();
translate([0, 60])
@@ -362,9 +376,22 @@ translate([x4 + 112, belts_y + 58]) {
translate([x4, rails_y + 130])
rails();
translate([x4, cable_strips_y])
cable_strips();
translate([780, 0])
rotate(90)
cable_strips();
translate([x4, kp_pillow_blocks_y])
kp_pillow_blocks();
translate([x4, sk_brackets_y])
sk_brackets();
translate([x4, extrusion_brackets_y])
extrusion_brackets();
translate([x4, scs_bearing_blocks_y])
scs_bearing_blocks();
x6 = x5 + 150;
translate([x6, 125])
light_strips();

230
printed/printed_box.scad Normal file
View File

@@ -0,0 +1,230 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
//! A fully parametric 3D printed case that can be customised with cutouts and additions specified by children.
//!
//! The walls can be made wavy, which possibly reduces warping when printing and looks nice, however if holes need to be made
//! in the sides you can't print a wavy bridge. Any holes need to be surrounded by a 45&deg; chamfer to make the bridges straight.
//! See the mounting points for the feet in the first example.
//!
//! It can also have printed feet on the base with the screws doubling up to hold the base on.
//
include <../core.scad>
include <../vitamins/screws.scad>
use <../vitamins/insert.scad>
use <foot.scad>
function pbox_name(type) = type[0]; //! Name to allow more than one box in a project
function pbox_wall(type) = type[1]; //! Wall thickness
function pbox_top(type) = type[2]; //! Top thickness
function pbox_base(type) = type[3]; //! Base thickness, can be zero for no base
function pbox_foot(type) = type[4]; //! Printed foot, can be false to suppress feet
function pbox_base_screw(type) = type[5]; //! Screw type if no feet
function pbox_radius(type) = type[6]; //! Internal corner radius
function pbox_ridges(type) = type[7]; //! Ridge wavelength and amplitude
function pbox_width(type) = type[8]; //! Internal width
function pbox_depth(type) = type[9]; //! Internal depth
function pbox_height(type) = type[10]; //! Internal height
base_outset = 1; // How much the base overlaps the inner dimensions
base_overlap = 2; // The width of ledge the base sits on
height_overlap = 1; // How far the edges sit below the base
function pbox_inclusion(type) = pbox_base(type) ? base_overlap - base_outset : 0; //! How far the ledge for the base extends inwards
function pbox_total_height(type) = //! Total height including base overlap
let(base = pbox_base(type),
foot = pbox_foot(type),
washer = pbox_washer(type),
screw = pbox_screw(type))
pbox_height(type) + pbox_top(type) + base + (base ? height_overlap : 0) + (foot || !base ? 0 : washer_thickness(washer) + screw_head_height(screw));
function pbox_screw(type) = //! Foot screw if got feet else base_screw
let(foot = pbox_foot(type)) foot ? foot_screw(foot) : pbox_base_screw(type);
function pbox_insert(type) = screw_insert(pbox_screw(type)); //! The insert for the base screws
function pbox_washer(type) = screw_washer(pbox_screw(type)); //! The washer for the base screws
function pbox_screw_length(type, panel_thickness = 0) = //! Length of the base screw
let(foot = pbox_foot(type))
screw_shorter_than(pbox_base(type) + washer_thickness(pbox_washer(type))
+ insert_length(pbox_insert(type))
+ (foot ? foot_thickness(foot) : panel_thickness));
function pbox_mid_offset(type) = pbox_ridges(type).y + pbox_wall(type) / 2; // Offset to wall midpoint
function pbox_screw_inset(type) = //! How far the base screws are inset
let(foot = pbox_foot(type),
r = foot ? foot_diameter(foot) / 2 : washer_radius(pbox_washer(type)),
R = pbox_radius(type)
) max(r, R - (R - r) / sqrt(2));
module pbox_screw_positions(type) {
foot = pbox_foot(type);
inset = pbox_screw_inset(type);
for(x = [-1, 1], y = [-1, 1])
translate([x * (pbox_width(type) / 2 - inset), y * (pbox_depth(type) / 2 - inset)])
rotate((y > 0 ? -x * 45 : -x * 135) + 90)
children();
}
module pbox_mid_shape(type) {
ridges = pbox_ridges(type);
offset = ridges.y + pbox_wall(type) / 2;
rad = pbox_radius(type) + offset;
w = pbox_width(type) + 2 * offset;
d = pbox_depth(type) + 2 * offset;
module waves(length) {
l = length - 2 * rad;
waves = round(l / ridges.x);
points = 16;
translate([-l / 2, ridges.y / 2])
polygon(concat([[0, -10]], [for(i = [0 : waves * points], a = 360 * i / points) [i * l / waves / points, -cos(a) * ridges.y / 2] ], [[l, -10]]));
}
difference() {
rounded_square([w, d], rad, center = true);
if(ridges.y)
for(side = [-1, 1]) {
translate([0, side * d / 2])
rotate(90 + side * 90)
waves(w);
translate([side * w / 2, 0])
rotate(side * 90)
waves(d);
}
}
}
module pbox_inner_shape(type) {
rad = pbox_radius(type);
w = pbox_width(type);
d = pbox_depth(type);
rounded_square([w, d], rad, center = true);
}
module pbox_base(type) { //! Generate the STL for the base
stl(str(pbox_name(type),"_base"));
t = pbox_base(type);
difference() {
union() {
linear_extrude(height = t)
offset(base_outset - 0.2)
pbox_inner_shape(type);
if($children > 0)
children(0);
}
pbox_screw_positions(type)
poly_cylinder(r = screw_clearance_radius(pbox_screw(type)), h = 2 * t + eps, center = true);
if($children > 1)
children(1);
}
}
module pbox(type) { //! Generate the STL for the main case
stl(pbox_name(type));
height = pbox_height(type);
total_height = pbox_total_height(type);
top_thickness = pbox_top(type);
wall = pbox_wall(type);
ledge_outset = pbox_ridges(type).y;
ledge_inset = base_outset - base_overlap;
ledge_h = pbox_base(type) ? (ledge_outset - ledge_inset) * 2 : 0;
difference() {
union() {
linear_extrude(height = total_height)
offset(wall / 2) pbox_mid_shape(type);
if($children > 2)
children(2);
}
difference() {
translate_z(top_thickness)
union() {
linear_extrude(height = height + eps)
offset(-wall / 2) pbox_mid_shape(type);
translate_z(height) // Recess for the base
linear_extrude(height = total_height - height)
offset(base_outset)
pbox_inner_shape(type);
}
// Ledge to support the lid
if(ledge_h)
translate_z(top_thickness + height - ledge_h)
difference() {
rounded_rectangle([pbox_width(type) + 2 * outset, pbox_depth(type) + 2 * outset, ledge_h], 1, center = false);
hull() {
linear_extrude(height = ledge_h + eps)
offset(ledge_inset)
pbox_inner_shape(type);
linear_extrude(height = eps)
offset(ledge_outset)
pbox_inner_shape(type);
}
pbox_screw_positions(type)
insert_hole(pbox_insert(type));
}
// Corner lugs for inserts
outset = wall + pbox_ridges(type).y;
or = pbox_radius(type) + outset;
inset = pbox_screw_inset(type) + outset;
br = insert_boss_radius(pbox_insert(type), wall);
ext = sqrt(2) * inset - or * (sqrt(2) - 1) - br;
translate_z(height + top_thickness)
pbox_screw_positions(type)
insert_lug(pbox_insert(type), wall, counter_bore = 0, extension = ext, corner_r = or);
if($children > 0)
children(0);
}
if($children > 1)
children(1);
}
}
module pbox_inserts(type) //! Place the inserts for the base screws
translate_z(pbox_height(type) + pbox_top(type))
pbox_screw_positions(type)
insert(pbox_insert(type));
module pbox_base_screws(type, thickness = 0) //! Place the screws and feet
translate_z(pbox_height(type) + pbox_top(type) + pbox_base(type))
pbox_screw_positions(type) {
foot = pbox_foot(type);
if(foot)
color(pp4_colour)
foot(foot);
translate_z(foot ? foot_thickness(foot) : thickness)
screw_and_washer(pbox_screw(type), pbox_screw_length(type, thickness));
}

299
readme.md
View File

@@ -21,19 +21,20 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
<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 = "#Pcbs">Pcbs</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 = "#Pillars">Pillars</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 = "#Pin_headers">Pin_headers</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 = "#Psus">Psus</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 = "#Pulleys">Pulleys</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 = "#Rails">Rails</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 = "#Ring_terminals">Ring_terminals</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 = "#Extrusions">Extrusions</a> </td><td> <a href = "#Rockers">Rockers</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 = "#Fans">Fans</a> </td><td> <a href = "#Rod">Rod</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 = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Screws">Screws</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 = "#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 = "#Sweep">Sweep</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 = "#Thread">Thread</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> <a href = "#Tube">Tube</a> </td><td></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>
@@ -589,6 +590,54 @@ LCD dispays.
| 1 | ```display(SSD1963_4p3)``` | LCD display SSD1963 4.3" |
<a href="#top">Top</a>
---
<a name="Extrusion_brackets"></a>
## Extrusion_brackets
Brackets for joining extrusions at a corner.
[vitamins/extrusion_brackets.scad](vitamins/extrusion_brackets.scad) Object definitions.
[vitamins/extrusion_bracket.scad](vitamins/extrusion_bracket.scad) Implementation.
[tests/extrusion_brackets.scad](tests/extrusion_brackets.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```extrusion_corner_bracket_base_thickness(type)``` | Thickness of base of bracket |
| ```extrusion_corner_bracket_hole_offset(type)``` | Hole offset from corner |
| ```extrusion_corner_bracket_side_thickness(type)``` | Thickness of side of bracket |
| ```extrusion_corner_bracket_size(type)``` | Size of bracket |
| ```extrusion_inner_corner_bracket_size(type)``` | Size of inner bracket |
### Modules
| Module | Description |
|:--- |:--- |
| ```extrusion_corner_bracket(type)``` | Corner bracket for extrusion |
| ```extrusion_corner_bracket_assembly(type, part_thickness = 2, screw_type = M4_cap_screw, nut_type = M4_sliding_t_nut, max_screw_depth = 6)``` | Assembly with fasteners in place |
| ```extrusion_corner_bracket_hole_positions(type)``` | Place children at hole positions |
| ```extrusion_inner_corner_bracket(type, grub_screws = true)``` | Inner corner bracket for extrusion |
![extrusion_brackets](tests/png/extrusion_brackets.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```extrusion(E2020, 20)``` | Extrusion E2020 x 20mm |
| 1 | ```extrusion(E2020, 30)``` | Extrusion E2020 x 30mm |
| 1 | ```extrusion(E2020, 40)``` | Extrusion E2020 x 40mm |
| 1 | ```extrusion(E2020, 50)``` | Extrusion E2020 x 50mm |
| 2 | ```extrusion_corner_bracket(E20_corner_bracket)``` | Extrusion corner bracket 20 |
| 2 | ```extrusion_inner_corner_bracket(E20_inner_corner_bracket, true)``` | Extrusion inner corner bracket 4.5 |
| 1 | ```extrusion_inner_corner_bracket(E20_inner_corner_bracket, false)``` | Extrusion inner corner bracket 4.5 |
| 4 | ```sliding_t_nut(M4_sliding_t_nut)``` | Nut M4 sliding T |
| 4 | ```screw(M4_cap_screw, 8)``` | Screw M4 cap x 8mm |
| 4 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
<a href="#top">Top</a>
---
@@ -620,7 +669,7 @@ Aluminium extrusion.
### Modules
| Module | Description |
|:--- |:--- |
| ```extrusion(type, length, cornerHole = false)``` | Draw the specified extrusion |
| ```extrusion(type, length, center = true, cornerHole = false)``` | Draw the specified extrusion |
![extrusions](tests/png/extrusions.png)
@@ -1765,6 +1814,88 @@ A permanent magnet that can be magnatized and de-magnatized electronically.
| 1 | ```opengrab()``` | OpenGrab V3 electro permanent magnet |
<a href="#top">Top</a>
---
<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.
### Properties
| Function | Description |
|:--- |:--- |
| ```hdmi_depth(type)``` | Front to back depth |
| ```hdmi_height(type)``` | Outside height above the PCB |
| ```hdmi_height1(type)``` | Inside height at the sides |
| ```hdmi_height2(type)``` | Inside height in the middle |
| ```hdmi_thickness(type)``` | Wall thickness of the metal |
| ```hdmi_width1(type)``` | Inside width at the top |
| ```hdmi_width2(type)``` | Inside width at the bottom |
| ```pcb_accessories(type)``` | List of accessories to go on the BOM, SD cards, USB cables, etc. |
| ```pcb_colour(type)``` | Colour of the subtrate |
| ```pcb_components(type)``` | List of components |
| ```pcb_grid(type)``` | Grid if a perfboard |
| ```pcb_hole_d(type)``` | Mounting hole diameter |
| ```pcb_holes(type)``` | List of hole positions |
| ```pcb_land_d(type)``` | Pad around mounting hole |
| ```pcb_length(type)``` | Length |
| ```pcb_name(type)``` | Description |
| ```pcb_parts_on_bom(type)``` | True if the parts should be separate BOM items |
| ```pcb_polygon(type)``` | Optional outline polygon for odd shaped boards |
| ```pcb_radius(type)``` | Corner radius |
| ```pcb_thickness(type)``` | Thickness |
| ```pcb_width(type)``` | Width |
### Functions
| Function | Description |
|:--- |:--- |
| ```pcb_component_position(type, name, index = 0)``` | Return x y position of specified component |
| ```pcb_coord(type, p)``` | Convert offsets from the edge to coordinates relative to the centre |
| ```pcb_grid_pos(type, x, y, z = 0)``` | Returns a pcb grid position |
| ```pcb_screw(type, cap = hs_cap)``` | Mounting screw type |
### Modules
| Module | Description |
|:--- |:--- |
| ```barrel_jack(cutout = false)``` | Draw barrel power jack |
| ```buzzer(height, diameter, colour)``` | Draw PCB buzzer with specified height, diameter and color |
| ```chip(length, width, thickness, colour, cutout = false)``` | Draw a coloured cube to represent a chip, or other rectangular component |
| ```flat_flex(cutout = false)``` | Draw flat flexistrip connector as used on RPI0 |
| ```flex(cutout = false)``` | Draw flexistrip connector |
| ```hdmi(type, cutout = false)``` | Draw HDMI socket |
| ```jack(cutout = false)``` | Draw 3.5mm jack |
| ```molex_254(ways)``` | Draw molex header |
| ```pcb(type)``` | Draw specified PCB |
| ```pcb_assembly(type, height, thickness)``` | Draw PCB assembly with spaces and fasteners in place |
| ```pcb_base(type, height, thickness, wall = 2)``` | Generate STL for a base with PCB spacers |
| ```pcb_component(comp, cutouts = false, angle = undef)``` | Draw pcb component from description |
| ```pcb_component_position(type, name)``` | Position child at the specified component position |
| ```pcb_components(type, cutouts = false, angle = undef)``` | Draw list of PCB components on the PCB |
| ```pcb_cutouts(type, angle = undef)``` | Make cut outs to clear components on a PCB |
| ```pcb_grid(type, x, y, z = 0)``` | Positions children at specified grid position |
| ```pcb_screw_positions(type)``` | Positions children at the mounting hole positions |
| ```pcb_spacer(screw, height, wall = 1.8, taper = 0)``` | Generate STL for PCB spacer |
| ```rj45(cutout = false)``` | Draw RJ45 Ethernet connector |
| ```terminal_35(ways, colour = "blue")``` | Draw 3.5mm terminal block |
| ```uSD(size, cutout = false)``` | Draw uSD socket |
| ```usb_Ax1(cutout = false)``` | Draw USB type A single socket |
| ```usb_Ax2(cutout = false)``` | Draw USB type A dual socket |
| ```usb_B(cutout = false)``` | Draw USB B connector |
| ```usb_uA(cutout = false)``` | Draw USB micro A connector |
![pcb](tests/png/pcb.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```pcb(TestPCB)``` | Test PCB |
<a href="#top">Top</a>
---
@@ -1834,8 +1965,9 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| ```pcb_screw_positions(type)``` | Positions children at the mounting hole positions |
| ```pcb_spacer(screw, height, wall = 1.8, taper = 0)``` | Generate STL for PCB spacer |
| ```rj45(cutout = false)``` | Draw RJ45 Ethernet connector |
| ```terminal_35(ways)``` | Draw 3.5mm terminal block |
| ```terminal_35(ways, colour = "blue")``` | Draw 3.5mm terminal block |
| ```uSD(size, cutout = false)``` | Draw uSD socket |
| ```usb_Ax1(cutout = false)``` | Draw USB type A single socket |
| ```usb_Ax2(cutout = false)``` | Draw USB type A dual socket |
| ```usb_B(cutout = false)``` | Draw USB B connector |
| ```usb_uA(cutout = false)``` | Draw USB micro A connector |
@@ -1876,15 +2008,13 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 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 |
| 8 | ```screw(M2p5_cap_screw, 20)``` | Screw M2.5 cap x 20mm |
| 4 | ```screw(M2p5_cap_screw, 35)``` | Screw M2.5 cap x 35mm |
| 8 | ```screw(M2p5_pan_screw, 20)``` | Screw M2.5 pan x 20mm |
| 4 | ```screw(M2p5_pan_screw, 25)``` | Screw M2.5 pan x 25mm |
| 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 |
| 4 | ```screw(M2p5_pan_screw, 35)``` | Screw M2.5 pan x 35mm |
| 8 | ```screw(M3_cap_screw, 30)``` | Screw M3 cap x 30mm |
| 4 | ```screw(M3_cap_screw, 35)``` | Screw M3 cap x 35mm |
| 4 | ```screw(M4_cap_screw, 30)``` | Screw M4 cap x 30mm |
| 8 | ```screw(M4_cap_screw, 35)``` | Screw M4 cap x 35mm |
| 12 | ```screw(M4_cap_screw, 35)``` | Screw M4 cap x 35mm |
| 3 | ```terminal_35(2)``` | Terminal block 2 way 3.5mm |
| 2 | ```green_terminal(gt_2p54, 4)``` | Terminal block 4 way 0.1" |
| 1 | | USB A to Mini B lead |
@@ -1897,24 +2027,24 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
### Printed
| Qty | Filename |
| ---:|:--- |
| 4 | pcb_spacer20130.stl |
| 4 | pcb_spacer20140.stl |
| 4 | pcb_spacer20150.stl |
| 4 | pcb_spacer20160.stl |
| 4 | pcb_spacer25100_2.stl |
| 4 | pcb_spacer20170.stl |
| 4 | pcb_spacer25100.stl |
| 4 | pcb_spacer25110_2.stl |
| 4 | pcb_spacer25120_2.stl |
| 4 | pcb_spacer25230.stl |
| 4 | pcb_spacer25130_2.stl |
| 4 | pcb_spacer25240.stl |
| 4 | pcb_spacer2570.stl |
| 4 | pcb_spacer2550.stl |
| 4 | pcb_spacer2580.stl |
| 4 | pcb_spacer2590.stl |
| 4 | pcb_spacer30170.stl |
| 4 | pcb_spacer30180.stl |
| 4 | pcb_spacer30220.stl |
| 4 | pcb_spacer40190.stl |
| 4 | pcb_spacer30190.stl |
| 4 | pcb_spacer30230.stl |
| 4 | pcb_spacer40200.stl |
| 4 | pcb_spacer40210.stl |
| 4 | pcb_spacer40220.stl |
<a href="#top">Top</a>
@@ -1997,8 +2127,8 @@ Pin headers and sockets, etc.
| ```idc_transition(type, cols = 5, skip = [], cutout = false)``` | Draw IDC transition header |
| ```jst_xh_header(type, pin_count, right_angle=false, colour, pin_colour)``` | Draw JST XH connector |
| ```pin(type, length = undef)``` | Draw a header pin |
| ```pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false)``` | Draw pin header |
| ```pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false)``` | Draw pin socket |
| ```pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour)``` | Draw pin header |
| ```pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false, colour)``` | Draw pin socket |
![pin_headers](tests/png/pin_headers.png)
@@ -2342,6 +2472,8 @@ Rocker switch. Also used for neon indicator in the same form factor.
## Rod
Steel rods and studding with chamfered ends.
These items are sysmtrical, so by default the origin is in the centre but it can be changed to the bottom.
[vitamins/rod.scad](vitamins/rod.scad) Implementation.
@@ -2469,6 +2601,9 @@ Machine screws and wood screws with various head styles.
---
<a name="Scs_bearing_blocks"></a>
## Scs_bearing_blocks
SCSnUU and SCSnLUU bearing blocks
[vitamins/scs_bearing_blocks.scad](vitamins/scs_bearing_blocks.scad) Object definitions.
[vitamins/scs_bearing_block.scad](vitamins/scs_bearing_block.scad) Implementation.
@@ -2753,6 +2888,8 @@ Filament spool models
## Springs
Compression springs. Can be tapered, have open, closed or ground ends. Ground ends will render a lot slower.
By default springs have their origin at the bottom but can be centered.
[vitamins/springs.scad](vitamins/springs.scad) Object definitions.
@@ -2781,7 +2918,7 @@ Compression springs. Can be tapered, have open, closed or ground ends. Ground en
### Modules
| Module | Description |
|:--- |:--- |
| ```comp_spring(type, l = 0)``` | Draw specified spring, l can be set to specify the compressed length. |
| ```comp_spring(type, l = 0, center = false)``` | Draw specified spring, l can be set to specify the compressed length. |
![springs](tests/png/springs.png)
@@ -2883,15 +3020,16 @@ NEMA stepper motor model.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 24 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 4 | ```ring_terminal(M3_ringterm)``` | Ring terminal 3mm |
| 15 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 1 | ```NEMA(NEMA14)``` | Stepper motor NEMA14 x 36mm |
| 1 | ```NEMA(NEMA16)``` | Stepper motor NEMA16 x 19.2mm |
| 1 | ```NEMA(NEMA17S)``` | Stepper motor NEMA17 x 34mm |
| 1 | ```NEMA(NEMA17M)``` | Stepper motor NEMA17 x 40mm |
| 1 | ```NEMA(NEMA17)``` | Stepper motor NEMA17 x 47mm |
| 1 | ```NEMA(NEMA23)``` | Stepper motor NEMA22 x 51.2mm |
| 24 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 24 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
| 11 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 15 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
<a href="#top">Top</a>
@@ -4157,6 +4295,87 @@ The stl must be given a parameterless wrapper in the project that uses it.
| 1 | pcb_mount_PI_IO_5.stl |
<a href="#top">Top</a>
---
<a name="Printed_box"></a>
## Printed_box
A fully parametric 3D printed case that can be customised with cutouts and additions specified by children.
The walls can be made wavy, which possibly reduces warping when printing and looks nice, however if holes need to be made
in the sides you can't print a wavy bridge. Any holes need to be surrounded by a 45&deg; chamfer to make the bridges straight.
See the mounting points for the feet in the first example.
It can also have printed feet on the base with the screws doubling up to hold the base on.
[printed/printed_box.scad](printed/printed_box.scad) Implementation.
[tests/printed_box.scad](tests/printed_box.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```pbox_base(type)``` | Base thickness, can be zero for no base |
| ```pbox_base_screw(type)``` | Screw type if no feet |
| ```pbox_depth(type)``` | Internal depth |
| ```pbox_foot(type)``` | Printed foot, can be false to suppress feet |
| ```pbox_height(type)``` | Internal height |
| ```pbox_name(type)``` | Name to allow more than one box in a project |
| ```pbox_radius(type)``` | Internal corner radius |
| ```pbox_ridges(type)``` | Ridge wavelength and amplitude |
| ```pbox_top(type)``` | Top thickness |
| ```pbox_wall(type)``` | Wall thickness |
| ```pbox_width(type)``` | Internal width |
### Functions
| Function | Description |
|:--- |:--- |
| ```pbox_inclusion(type)``` | How far the ledge for the base extends inwards |
| ```pbox_insert(type)``` | The insert for the base screws |
| ```pbox_screw(type)``` | Foot screw if got feet else base_screw |
| ```pbox_screw_inset(type)``` | How far the base screws are inset |
| ```pbox_screw_length(type, panel_thickness = 0)``` | Length of the base screw |
| ```pbox_total_height(type)``` | Total height including base overlap |
| ```pbox_washer(type)``` | The washer for the base screws |
### Modules
| Module | Description |
|:--- |:--- |
| ```pbox(type)``` | Generate the STL for the main case |
| ```pbox_base(type)``` | Generate the STL for the base |
| ```pbox_base_screws(type, thickness = 0)``` | Place the screws and feet |
| ```pbox_inserts(type)``` | Place the inserts for the base screws |
![printed_box](tests/png/printed_box.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | ```insert(F1BM)``` | Heatfit insert M2 |
| 4 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 4 | ```screw(M2_cap_screw, 6)``` | Screw M2 cap x 6mm |
| 3 | ```screw(M3_pan_screw, 6)``` | Screw M3 pan x 6mm |
| 4 | ```screw(M3_pan_screw, 10)``` | Screw M3 pan x 10mm |
| 4 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
| 7 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
### Printed
| Qty | Filename |
| ---:|:--- |
| 1 | box1.stl |
| 1 | box1_base.stl |
| 7 | foot.stl |
| 1 | smooth_box.stl |
| 1 | smooth_box_base.stl |
### Assemblies
| Qty | Name |
| ---:|:--- |
| 1 | box1_assembly |
| 1 | box2_assembly |
<a href="#top">Top</a>
---
@@ -4196,23 +4415,25 @@ The stl and assembly must be given a name and parameterless wrappers for the stl
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 4 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
| 4 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 4 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
| 2 | ```ziptie(small_ziptie, 3)``` | Ziptie 2.5mm x 100mm min length |
| 6 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 6 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
| 6 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 6 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
| 3 | ```ziptie(small_ziptie, 3)``` | Ziptie 2.5mm x 100mm min length |
### Printed
| Qty | Filename |
| ---:|:--- |
| 1 | psu_shroud_PD_150_12.stl |
| 1 | psu_shroud_S_250_48.stl |
| 1 | psu_shroud_S_300_12.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 |
<a href="#top">Top</a>

View File

@@ -40,7 +40,7 @@ These are located in the ```scripts``` subdirectory, which needs to be added to
They should work with both Python 2 and Python 3.
| Script | Function |
|:--|:--|''', file = doc_file)
|:---|:---|''', file = doc_file)
for file in os.listdir('scripts'):
if file.endswith('.py'):
blurb = ''

View File

@@ -5,7 +5,7 @@ These are located in the ```scripts``` subdirectory, which needs to be added to
They should work with both Python 2 and Python 3.
| Script | Function |
|:--|:--|
|:---|:---|
| ```bom.py``` | Generates BOM files for the project. |
| ```c14n_stl.py``` | OpenSCAD produces randomly ordered STL files. This script re-orders them consistently so that GIT can tell if they have changed or not. |
| ```doc_scripts.py``` | Makes this document and doc/usage.md. |

View File

@@ -71,9 +71,10 @@ def bom_to_assemblies(bom_dir, bounds_map):
#
# Remove the main assembly if it is a shell
#
ass = flat_bom[-1]
if len(ass["assemblies"]) < 2 and not ass["vitamins"] and not ass["printed"] and not ass["routed"]:
flat_bom = flat_bom[:-1]
if flat_bom:
ass = flat_bom[-1]
if len(ass["assemblies"]) < 2 and not ass["vitamins"] and not ass["printed"] and not ass["routed"]:
flat_bom = flat_bom[:-1]
return [assembly["name"] for assembly in flat_bom]
def eop(print_mode, doc_file, last = False, first = False):
@@ -240,7 +241,7 @@ def views(target, do_assemblies = None):
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)
print(('|--:' * len(flat_bom) + '|--:|:--|'), file = doc_file)
print(('|---:' * len(flat_bom) + '|---:|:---|'), file = doc_file)
for t in types:
if things[t]:
@@ -283,7 +284,7 @@ def views(target, do_assemblies = None):
if vitamins:
print("### Vitamins", file = doc_file)
print("|Qty|Description|", file = doc_file)
print("|--:|:----------|", file = doc_file)
print("|---:|:----------|", file = doc_file)
for v in sorted(vitamins, key = lambda s: s.split(":")[-1]):
print("|%d|%s|" % (vitamins[v], v.split(":")[1]), file = doc_file)
print("\n", file = doc_file)
@@ -297,7 +298,7 @@ def views(target, do_assemblies = None):
print('%s %d x %s |' % ('\n|' if not (i % 3) else '', printed[p], p), file = doc_file, end = '')
if (i % 3) == 2 or i == len(printed) - 1:
n = (i % 3) + 1
print('\n|%s' % ('--|' * n), file = doc_file)
print('\n|%s' % ('---|' * n), file = doc_file)
for j in range(n):
part = keys[i - n + j + 1]
print('| ![%s](stls/%s) %s' % (part, part.replace('.stl','.png'), '|\n' if j == j - 1 else ''), end = '', file = doc_file)
@@ -313,7 +314,7 @@ def views(target, do_assemblies = None):
print('%s %d x %s |' % ('\n|' if not (i % 3) else '', routed[r], r), file = doc_file, end = '')
if (i % 3) == 2 or i == len(routed) - 1:
n = (i % 3) + 1
print('\n|%s' % ('--|' * n), file = doc_file)
print('\n|%s' % ('---|' * n), file = doc_file)
for j in range(n):
part = keys[i - n + j + 1]
print('| ![%s](dxfs/%s) %s' % (part, part.replace('.dxf','.png'), '|\n' if j == j - 1 else ''), end = '', file = doc_file)
@@ -329,7 +330,7 @@ def views(target, do_assemblies = None):
print('%s %d x %s |' % ('\n|' if not (i % 3) else '', sub_assemblies[a], a), file = doc_file, end = '')
if (i % 3) == 2 or i == len(keys) - 1:
n = (i % 3) + 1
print('\n|%s' % ('--|' * n), file = doc_file)
print('\n|%s' % ('---|' * n), file = doc_file)
for j in range(n):
a = keys[i - n + j + 1].replace('_assembly', '_assembled')
print('| ![%s](assemblies/%s) %s' % (a, a + '_tn.png', '|\n' if j == j - 1 else ''), end = '', file = doc_file)

View File

@@ -0,0 +1,65 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
include <../vitamins/extrusion_brackets.scad>
include <../vitamins/extrusions.scad>
include <../vitamins/washers.scad>
include <../vitamins/nuts.scad>
module extrusion_brackets(examples = false) {
extrusion_inner_corner_bracket(E20_inner_corner_bracket);
translate([30, 0])
extrusion_inner_corner_bracket(E20_inner_corner_bracket, grub_screws = false);
translate([60, 0])
extrusion_corner_bracket_assembly(E20_corner_bracket);
eWidth = extrusion_width(E2020);
if(examples) {
translate([20, 60, 10]) rotate([90, 0, 180]) {
extrusion_inner_corner_bracket(E20_inner_corner_bracket);
translate([-eWidth / 2, 0, 0])
rotate([-90, 0, 0])
extrusion(E2020, 20, false);
translate([-eWidth, -eWidth / 2, 0])
rotate([0, 90, 0])
extrusion(E2020, 40, false);
}
translate([100, 60, 10]) rotate([90, 0, 180]) {
extrusion_corner_bracket_assembly(E20_corner_bracket);
translate([-eWidth / 2, 0, 0])
rotate([-90, 0, 0])
extrusion(E2020, 30, false);
translate([-eWidth, -eWidth / 2, 0])
rotate([0, 90, 0])
extrusion(E2020, 50, false);
}
}
}
if($preview)
extrusion_brackets(true);

109
tests/pcb.scad Normal file
View File

@@ -0,0 +1,109 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
use <../vitamins/pcb.scad>
include <../vitamins/microswitches.scad>
include <../vitamins/d_connectors.scad>
gt_5x17 = ["gt_5x17", 5, 10, 17, 5, 11, 0.4, 9, 2,1.5, 1, 3, 6, 0, 0, 0];
gt_5x11 = ["gt_5x11", 5, 8, 11, 5, 7, 0.4, 7, 1.5,1.5, 1,2.5, 6, 0, 0, 0];
TMC2130HeatSinkColor = "DeepSkyBlue";
TMC2130 = ["TMC2130", "TMC2130",
20, 14, 1.6, 0, 3, 0, "white", false, [],
[
[ 10, 1, 0, "-2p54header", 8, 1 ,undef, "blue" ],
[ 10, 13, 0, "-2p54header", 8, 1],
[ 12, 7, 0, "-chip", 6, 4, 1, grey20 ],
// mock up a heat sink
[ 10, 7, 0, "block", 9, 9, 2, TMC2130HeatSinkColor ],
[ 10, 11, 0, "block", 9, 1, 11, TMC2130HeatSinkColor ],
[ 10, 9, 0, "block", 9, 1, 11, TMC2130HeatSinkColor ],
[ 10, 7, 0, "block", 9, 1, 11, TMC2130HeatSinkColor ],
[ 10, 5, 0, "block", 9, 1, 11, TMC2130HeatSinkColor ],
[ 10, 3, 0, "block", 9, 1, 11, TMC2130HeatSinkColor ],
],
[]
];
test_pcb = ["TestPCB", "Test PCB",
50, 500, 1.6, // length, width, thickness
3, // Corner radius
2.75, // Mounting hole diameter
6, // Pad around mounting hole
"green",// Color
false, // True if the parts should be separate BOM items
// hole offsets
[ [3, 3], [3, -3], [-3, 3], [-3, -3] ],
// components
[
[ 10, 10, 0, "2p54header", 4, 1],
[ 25, 10, 0, "2p54header", 5, 1, undef, "blue" ],
[ 10, 20, 0, "2p54boxhdr", 4, 2],
[ 10, 30, 0, "2p54socket", 6, 1],
[ 25, 30, 0, "2p54socket", 4, 1, undef, undef, undef, "red" ],
[ 10, 40, 0, "chip", 10, 5, 1, grey20],
[ 10, 60, 180, "rj45"],
[ 8, 80, 180, "usb_A"],
[ 8, 100, 180, "usb_Ax2"],
[ 3, 120, 180, "usb_uA"],
[ 8, 140, 180, "usb_B"],
[ 10, 160, 0, "buzzer"],
[ 25, 160, 0, "buzzer", 4.5, 8.5],
[ 10, 175, 0, "potentiometer"],
[ 30, 175, 0, "potentiometer", 7, 8],
[ 8, 190, 180, "jack"],
[ 6, 200, 180, "barrel_jack"],
[ 5, 220, 180, "hdmi"],
[ 3, 240, 180, "mini_hdmi"],
[ 10, 250, 0, "flex"],
[ 10, 265, 0, "flat_flex"],
[ 10, 280, 0, "D_plug", DCONN9],
[ 10, 300, 0, "molex_hdr", 2],
[ 10, 310, 0, "jst_xh", 2],
[ 10, 320, 180, "term254", 3],
[ 20, 320, 180, "term254", 3, undef, grey20],
[ 10, 340, 180, "gterm35", 4, [1,2]],
[ 20, 340, 180, "gterm35", 4, [1,2], "red"],
[ 30, 340, 180, "gterm", gt_5x11, 3],
[ 10, 360, 180, "gterm635", 2],
[ 25, 360, 180, "gterm635", 2, undef, "blue"],
[ 40, 360, 180, "gterm", gt_5x17, 2, undef, grey20],
[ 40, 340, 180, "gterm", gt_5x17, 3, [1], "red"],
[ 10, 380, 180, "term35", 4],
[ 20, 380, 180, "term35", 3, "lime"],
[ 10, 400, 0, "transition", 5],
[ 10, 410, 0, "block", 10, 5, 8, "orange"],
[ 10, 420, 0, "button_6mm"],
[ 10, 435, 0, "microswitch", small_microswitch],
[ 12, 450, 0, "pcb", 11, TMC2130 ],
[ 12, 456, 0, "2p54socket", 8, 1 ],
[ 12, 444, 0, "2p54socket", 8, 1, undef, undef, undef, "red" ],
[ 10, 470, 0, "standoff", 5, 4.5, 12.5, 2.54],
[ 6, 480, 180, "uSD", [12, 11.5, 1.4]],
],
// accessories
[]
];
if($preview)
let($show_threads = true)
pcb(test_pcb);

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

BIN
tests/png/pcb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 144 KiB

BIN
tests/png/printed_box.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 84 KiB

167
tests/printed_box.scad Normal file
View File

@@ -0,0 +1,167 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
include <../core.scad>
include <../vitamins/screws.scad>
use <../printed/foot.scad>
use <../printed/printed_box.scad>
foot = [13, 5, 2, 1, M3_pan_screw, 10];
module foot_stl() foot(foot);
wall = 2;
top_thickness = 2;
base_thickness = 2;
case_inner_rad = 8;
width = 80;
depth = 45;
height = 40;
box1 = ["box1", wall, top_thickness, base_thickness, false, M2_cap_screw, case_inner_rad, [8, 1], width, depth, height];
box2 = ["smooth_box", wall, top_thickness, base_thickness, foot, false, case_inner_rad, [0, 0], width, depth, height];
module box1_feet_positions() {
clearance = 2;
foot_r = foot_diameter(foot) / 2;
x_inset = case_inner_rad + foot_r - pbox_ridges(box1).y;
z_inset = foot_r + clearance;
h = height + base_thickness;
for(p = [[-1, -1], [1, -1], [0, 1]])
translate([p.x * (width / 2 - x_inset), depth / 2 + wall + pbox_ridges(box1).y, top_thickness + h / 2 + p.y * (h / 2 - z_inset)])
rotate([90, 0, 0])
children();
}
module box1_internal_additions() {
d = washer_diameter(screw_washer(foot_screw(foot))) + 1;
h = pbox_ridges(box1).y;
box1_feet_positions()
translate_z(wall - eps)
cylinder(d2 = d, d1 = d + 2 * h, h = h);
}
module box1_external_additions() {
amp = pbox_ridges(box1).y + eps;
d = foot_diameter(foot) + 1;
box1_feet_positions()
cylinder(d1 = d, d2 = d + 2 * amp, h = amp);
}
module box1_holes() {
box1_feet_positions()
teardrop(r = screw_pilot_hole(foot_screw(foot)), h = 10, center = true);
}
module box1_case_stl() {
pbox(box1) {
box1_internal_additions();
box1_holes();
box1_external_additions();
}
}
module box1_base_additions() {
}
module box1_base_holes() {
}
module box1_base_stl()
pbox_base(box1) {
box1_base_additions();
box1_base_holes();
}
module box1_assembly()
assembly("box1") {
color(pp1_colour) render() box1_case_stl();
pbox_inserts(box1);
pbox_base_screws(box1);
box1_feet_positions() {
foot_assembly(0, foot);
vflip()
translate_z(foot_thickness(foot))
screw_and_washer(foot_screw(foot), 6);
}
translate_z(height + top_thickness + base_thickness + eps) vflip()
%render() box1_base_stl();
}
module box2_internal_additions() {
}
module box2_holes() {
}
module box2_external_additions() {
}
module box2_case_stl() {
pbox(box2) {
box2_internal_additions();
box2_holes();
box2_external_additions();
}
}
module box2_base_additions() {
}
module box2_base_holes() {
}
module box2_base_stl()
pbox_base(box2) {
box2_base_additions();
box2_base_holes();
}
module box2_assembly()
assembly("box2") {
color(pp1_colour) render() box2_case_stl();
pbox_inserts(box2);
pbox_base_screws(box2);
translate_z(height + top_thickness + base_thickness + eps) vflip()
%render() box2_base_stl();
}
module printed_boxes() {
rotate(180)
box1_assembly();
translate([100, 0])
box2_assembly();
}
if($preview)
printed_boxes();

View File

@@ -22,7 +22,7 @@ use <../utils/layout.scad>
include <../vitamins/scs_bearing_blocks.scad>
module scs_bearing_blocks()
layout([for(s = scs_bearing_blocks) 2 * scs_size(s)[0]]) {
layout([for(s = scs_bearing_blocks) scs_size(s).x], 10) {
part_thickness = 5;
scs_bearing_block_assembly(scs_bearing_blocks[$i], part_thickness);

View File

@@ -31,10 +31,9 @@ module sk_brackets() {
sk_bracket_assembly(sk_brackets[$i], screw_type = screws[$i], nut_type = nuts[$i], max_screw_depth = depths[$i]);
translate([0, -sk_hole_offset(sk_brackets[$i]) - extrusion_width($i < 2 ? E2020 : E3030) / 2, 0])
rotate([0, 90, 0])
extrusion($i < 2 ? E2020 : E3030, 20);
extrusion($i < 2 ? E2020 : E3030, 20, false);
}
}
if($preview)
let($show_threads = true)
sk_brackets();
sk_brackets();

View File

@@ -27,8 +27,10 @@ module stepper_motors()
rotate(180)
NEMA(stepper_motors[$i]);
NEMA_screws(stepper_motors[$i], M3_pan_screw);
translate_z(4)
NEMA_screws(stepper_motors[$i], M3_pan_screw, n = $i, earth = $i > 4 ? undef : $i - 1);
}
if($preview)
stepper_motors();
let($show_threads = 1)
stepper_motors();

View File

@@ -43,7 +43,7 @@ module extrusion_cross_section(type, cornerHole) {
fillet = extrusion_fillet(type);
cornerSize = (width-channelWidth)/2;
cornerSquare = (width-extrusion_channel_width_internal(type))/2;
cornerHoleDiameter =extrusion_corner_hole(type);
cornerHoleDiameter = extrusion_corner_hole(type);
translate([-width/2,-width/2]) {
difference() {
@@ -57,7 +57,7 @@ module extrusion_cross_section(type, cornerHole) {
translate([fillet,fillet])
square([cornerSquare-fillet,cornerSquare-fillet]);
}
if(cornerHole)
if(cornerHole && cornerHoleDiameter > 0)
translate([cornerSquare/2,cornerSquare/2])
circle(d=cornerHoleDiameter);
}
@@ -117,12 +117,11 @@ module extrusion_cross_section(type, cornerHole) {
extrusion_center_section(type);
}
module extrusion(type, length, cornerHole = false) { //! Draw the specified extrusion
module extrusion(type, length, center = true, cornerHole = false) { //! Draw the specified extrusion
vitamin(str("extrusion(", type[0], ", ", length, "): Extrusion ", type[0], " x ", length, "mm"));
vitamin(str("extrusion(", type[0], ", ", length, arg(cornerHole, false, "cornerHole"), "): Extrusion ", type[0], " x ", length, "mm"));
color(grey90)
linear_extrude(height = length)
linear_extrude(length, center = center)
extrusion_cross_section(type, cornerHole);
}

View File

@@ -0,0 +1,138 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//! Brackets for joining extrusions at a corner.
include <NopSCADlib/core.scad>
include <screws.scad>
include <nuts.scad>
function extrusion_inner_corner_bracket_size(type) = type[1]; //! Size of inner bracket
module extrusion_inner_corner_bracket(type, grub_screws = true) { //! Inner corner bracket for extrusion
vitamin(str("extrusion_inner_corner_bracket(", type[0], ", ", grub_screws, "): Extrusion inner corner bracket ", type[1].z));
size = extrusion_inner_corner_bracket_size(type);
armLength = size.x;
bottomTabOffset = 4;
topTabOffset = 10;
sizeBottom = [armLength - bottomTabOffset, 6, size.z];
sizeTop = [armLength - topTabOffset, 6, size.z];
tabSizeY1 = 10;
tabSizeY2 = 6;
tabSizeZ = 3.25;
holeRadius = M4_tap_radius;
translate([-size.z - 0.75, -size.z - 0.75, 0])
rotate([-90, 0, 0]) {
color("silver") {
translate([(armLength + bottomTabOffset) / 2, 0, tabSizeZ])
rotate([0, 180, 0])
extrusionSlidingNut(sizeBottom, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, (bottomTabOffset - armLength) / 2 + 5);
translate([tabSizeZ, 0, (armLength + topTabOffset) / 2])
rotate([0, -90, 0])
extrusionSlidingNut(sizeTop, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius,-(topTabOffset - armLength) / 2 - 5);
translate([0, -size.z / 2, 0]) {
cube([bottomTabOffset, size.z, size.z]);
cube([size.z, size.z, topTabOffset]);
}
}
if(grub_screws)
not_on_bom() no_explode() {
grubScrewLength = 6;
for(angle = [[0, 0, 0], [0, -90, 180]])
rotate(angle)
translate([armLength - 5, 0, size.z])
screw(M3_grub_screw, grubScrewLength);
}
}
}
function extrusion_corner_bracket_size(type) = type[1]; //! Size of bracket
function extrusion_corner_bracket_base_thickness(type) = type[2]; //! Thickness of base of bracket
function extrusion_corner_bracket_side_thickness(type) = type[3]; //! Thickness of side of bracket
function extrusion_corner_bracket_hole_offset(type) = type[4]; //! Hole offset from corner
module extrusion_corner_bracket(type) { //! Corner bracket for extrusion
vitamin(str("extrusion_corner_bracket(", type[0], "): Extrusion corner bracket ", type[1].z));
eSize = extrusion_corner_bracket_size(type).z;
cbSize = extrusion_corner_bracket_size(type).x;
baseThickness = extrusion_corner_bracket_base_thickness(type);
module base() {
linear_extrude(baseThickness)
difference() {
translate([0, -eSize / 2, 0])
square([cbSize, eSize]);
hull() {
translate([extrusion_corner_bracket_hole_offset(type) + 1.5, 0, 0])
circle(r = M5_clearance_radius);
translate([extrusion_corner_bracket_hole_offset(type) - 1.5, 0, 0])
circle(r = M5_clearance_radius);
}
}
}
color("silver") {
rotate([90, 0, 90])
base();
translate([0, baseThickness, 0])
rotate([90, 0, 0])
base();
sideThickness = extrusion_corner_bracket_side_thickness(type);
for(z = [-eSize / 2, eSize / 2 - sideThickness]) {
translate_z(z) {
right_triangle(cbSize, cbSize, sideThickness, center = false);
cube([5, cbSize, sideThickness]);
cube([cbSize, 5, sideThickness]);
}
}
}
}
module extrusion_corner_bracket_hole_positions(type) { //! Place children at hole positions
for(angle = [ [0, 90, 0], [-90, -90, 0] ])
rotate(angle)
translate([0, extrusion_corner_bracket_hole_offset(type), extrusion_corner_bracket_base_thickness(type)])
children();
}
module extrusion_corner_bracket_assembly(type, part_thickness = 2, screw_type = M4_cap_screw, nut_type = M4_sliding_t_nut, max_screw_depth = 6) { //! Assembly with fasteners in place
extrusion_corner_bracket(type);
screw_washer_thickness = washer_thickness(screw_washer(screw_type));
nut_washer_type = nut_washer(nut_type);
nut_washer_thickness = nut_washer_type ? washer_thickness(nut_washer_type) : 0;
nut_offset = extrusion_corner_bracket_base_thickness(type) + part_thickness;
screw_length = max_screw_depth ? screw_shorter_than(extrusion_corner_bracket_base_thickness(type) + screw_washer_thickness + max_screw_depth)
: screw_longer_than(nut_offset + screw_washer_thickness + nut_washer_thickness + nut_thickness(nut_type));
extrusion_corner_bracket_hole_positions(type) {
screw_and_washer(screw_type, screw_length);
translate_z(-nut_offset)
vflip()
if(nut_washer_type)
nut_and_washer(nut_type);
else
rotate(90)
sliding_t_nut(nut_type);
}
}

View File

@@ -0,0 +1,29 @@
//
// NopSCADlib Copyright Chris Palmer 2020
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
// Extrusion brackets
//
E20_inner_corner_bracket = [ "E20_inner_corner_bracket", [25, 25, 4.5] ];
E20_corner_bracket = [ "E20_corner_bracket", [28, 28, 20], 2, 3, 19.5];
use <extrusion_bracket.scad>

View File

@@ -20,10 +20,10 @@
// Extrusion
//
// W H d1 d2 s cw cwi t st f
E2020 = [ "E2020", 20, 20, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ];
E2040 = [ "E2040", 20, 40, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ];
E2060 = [ "E2060", 20, 60, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ];
E2080 = [ "E2080", 20, 80, 4.2, 0, 8, 6, 12.0, 2, 2, 1 ];
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 ];
E2080 = [ "E2080", 20, 80, 4.2, 3, 8, 6, 12.0, 2, 2, 1 ];
E3030 = [ "E3030", 30, 30, 6.8, 4.2, 12, 8, 16.5, 2, 2, 1 ];
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 ];

View File

@@ -72,13 +72,16 @@ module kp_pillow_block(type) { //! Draw the KP pillow block
for(x = [- L / 2 + squareSizeX - fillet, L / 2 - squareSizeX + fillet - 2])
translate([x, 0, 0])
cube([2, H, A]);
stripLength = J - 2 * bolthole_radius;
stripThickness = 4;
translate([-stripLength / 2, 0, (H1 + stripThickness) / 2])
cube([stripLength, H1, stripThickness]);
translate([0 , H, 0])
tube(H0 / 2, b / 2, A, center = false);
}
stripThickness = 4;
translate([-H0 / 2, 0, -stripThickness / 2])
linear_extrude(stripThickness) difference() {
square([H0, H]);
translate([H0 / 2, H])
circle(b / 2);
}
}
not_on_bom() no_explode()

View File

@@ -31,6 +31,7 @@ include <microswitches.scad>
use <../utils/rounded_cylinder.scad>
use <../utils/dogbones.scad>
use <../utils/thread.scad>
use <../utils/tube.scad>
use <d_connector.scad>
@@ -79,16 +80,21 @@ module chip(length, width, thickness, colour, cutout = false) //! Draw a coloure
color(colour)
translate_z(thickness / 2) cube([length, width, thickness], center = true);
module usb_Ax1(cutout = false) { //! Draw USB type A single socket
usb_A(h = 6.5, v_flange_l = 4.5, bar = 0, cutout = cutout);
}
module usb_Ax2(cutout = false) { //! Draw USB type A dual socket
usb_A(h = 15.6, v_flange_l = 12.15, bar = 3.4, cutout = cutout);
}
module usb_A(h, v_flange_l, bar, cutout) {
l = 17;
w = 13.25;
h = 15.6;
flange_t = 0.4;
h_flange_h = 0.8;
h_flange_l = 11;
v_flange_h = 1;
v_flange_l = 12.15;
bar = 3.4;
socket_h = (h - 2 * flange_t - bar) / 2;
translate_z(h / 2)
@@ -203,11 +209,32 @@ module jack(cutout = false) { //! Draw 3.5mm jack
module buzzer(height, diameter, colour) { //! Draw PCB buzzer with specified height, diameter and color
color (colour)
tube(or = diameter / 2, ir = height > 5 ? 1 : 0.75, h = height);
tube(or = diameter / 2, ir = height > 5 ? 1 : 0.75, h = height, center = false);
color("white")
cylinder(d = 2, h = max(height - 3 , 0.5));
}
module potentiometer(h1, h2) {
color("silver") {
baseSize = [12, 11, 6];
translate_z(baseSize.z / 2)
cube(baseSize, center = true);
translate_z(baseSize.z) {
cylinder(d = 5, h = h1 - 0.5);
if (show_threads)
male_metric_thread(6, metric_coarse_pitch(5), length = h1 - 0.5, center = false);
}
translate_z(baseSize.z + h1 - 0.5)
cylinder(d = 3, h = 0.5);
translate_z(baseSize.z + h1)
linear_extrude(h2)
difference() {
circle(d=5);
square([0.75,5], center = true);
}
}
}
function hdmi_depth(type) = type[2]; //! Front to back depth
function hdmi_width1(type) = type[3]; //! Inside width at the top
function hdmi_width2(type) = type[4]; //! Inside width at the bottom
@@ -574,7 +601,7 @@ module flat_flex(cutout = false) { //! Draw flat flexistrip connector as used on
}
}
module terminal_35(ways) { //! Draw 3.5mm terminal block
module terminal_35(ways, colour = "blue") { //! Draw 3.5mm terminal block
vitamin(str("terminal_35(", ways, "): Terminal block ", ways, " way 3.5mm"));
pitch = 3.5;
width = ways * pitch;
@@ -592,7 +619,7 @@ module terminal_35(ways) { //! Draw 3.5mm terminal block
module single() {
screw_r = 1;
color("blue") {
color(colour) {
rotate([90, 0, 0])
linear_extrude(height = pitch, center = true)
polygon(points = [
@@ -710,15 +737,17 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
function show(comp, part) = (comp[3] == part || comp[3] == str("-",part)) && (!cutouts || angle == undef || angle == comp.z);
function param(n, default = 0) = len(comp) > n ? comp[n] : default;
rotate(comp.z) {
if(show(comp, "2p54header")) pin_header(2p54header, comp[4], comp[5], param(6), cutouts);
if(show(comp, "2p54header")) pin_header(2p54header, comp[4], comp[5], param(6), cutouts, colour = param(7, undef));
if(show(comp, "2p54boxhdr")) box_header(2p54header, comp[4], comp[5], param(6), cutouts);
if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], param(6, false), param(7), param(8, false), cutouts);
if(show(comp, "2p54socket")) pin_socket(2p54header, comp[4], comp[5], param(6, false), param(7), param(8, false), cutouts, param(9, undef));
if(show(comp, "chip")) chip(comp[4], comp[5], comp[6], param(7, grey30), cutouts);
if(show(comp, "rj45")) rj45(cutouts);
if(show(comp, "usb_A")) usb_Ax1(cutouts);
if(show(comp, "usb_Ax2")) usb_Ax2(cutouts);
if(show(comp, "usb_uA")) usb_uA(cutouts);
if(show(comp, "usb_B")) usb_B(cutouts);
if(show(comp, "buzzer")) buzzer(param(4, 9), param(5, 12), param(6, grey20));
if(show(comp, "potentiometer")) potentiometer(param(4, 5), param(5, 9));
if(show(comp, "jack")) jack(cutouts);
if(show(comp, "barrel_jack")) barrel_jack(cutouts);
if(show(comp, "hdmi")) hdmi(hdmi_full, cutouts);
@@ -728,10 +757,11 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "D_plug")) if(!cutouts) translate_z(d_pcb_offset(comp[4])) d_plug(comp[4], pcb = true);
if(show(comp, "molex_hdr")) if(!cutouts) molex_254(comp[4]);
if(show(comp, "jst_xh")) if(!cutouts) jst_xh_header(jst_xh_header, comp[4], param(5, false), param(6, "white"), param(7, undef));
if(show(comp, "term254")) if(!cutouts) green_terminal(gt_2p54,comp[4], comp[5]);
if(show(comp, "gterm35")) if(!cutouts) green_terminal(gt_3p5, comp[4], comp[5]);
if(show(comp, "gterm635")) if(!cutouts) green_terminal(gt_6p35, comp[4], comp[5]);
if(show(comp, "term35")) if(!cutouts) terminal_35(comp[4]);
if(show(comp, "term254")) if(!cutouts) green_terminal(gt_2p54,comp[4], comp[5], param(6,"lime"));
if(show(comp, "gterm")) if(!cutouts) green_terminal(comp[4], comp[5], comp[6], param(7,"lime"));
if(show(comp, "gterm35")) if(!cutouts) green_terminal(gt_3p5, comp[4], comp[5], param(6,"lime"));
if(show(comp, "gterm635")) if(!cutouts) green_terminal(gt_6p35, comp[4], comp[5], param(6,"lime"));
if(show(comp, "term35")) if(!cutouts) terminal_35(comp[4], param(5,"blue"));
if(show(comp, "transition")) if(!cutouts) idc_transition(2p54header, comp[4], comp[5]);
if(show(comp, "block"))
color(comp[7]) if(!cutouts) translate_z(comp[6] / 2) cube([comp[4], comp[5], comp[6]], center = true);

View File

@@ -352,6 +352,6 @@ RAMPSEndstop = ["RAMPSEndstop", "RAMPS Endstop Switch",
[]];
pcbs = [ExtruderPCB, PI_IO, RPI0, EnviroPlus, RPI3, ArduinoUno3, ArduinoLeonardo, Keyes5p1, PERF80x20, PERF70x50, PERF70x30, PERF60x40, PERF74x51, PSU12V1A, DuetE, Duex2, Duex5, Melzi, ZC_A0591, RAMPSEndstop];
pcbs = [RAMPSEndstop, ExtruderPCB, PI_IO, RPI0, EnviroPlus, RPI3, ArduinoUno3, ArduinoLeonardo, Keyes5p1, PERF80x20, PERF70x50, PERF70x30, PERF60x40, PERF74x51, PSU12V1A, DuetE, Duex2, Duex5, Melzi, ZC_A0591];
use <pcb.scad>

View File

@@ -43,8 +43,9 @@ module pin(type, length = undef) { //! Draw a header pin
}
}
module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false) { //! Draw pin header
module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cutout = false, colour) { //! Draw pin header
pitch = hdr_pitch(type);
base_colour = colour ? colour : hdr_base_colour(type);
h = pitch;
ra_offset = 2.4;
width = pitch * rows;
@@ -79,7 +80,7 @@ module pin_header(type, cols = 1, rows = 1, smt = false, right_angle = false, cu
}
translate([0, right_angle ? -ra_offset - pitch / 2 : 0, right_angle ? width / 2 : 0])
rotate([right_angle ? 90 : 0, 0, 0])
color(hdr_base_colour(type))
color(base_colour)
linear_extrude(height = h)
for(x = [0 : cols - 1], y = [0 : rows - 1])
translate([pitch * (x - (cols - 1) / 2), pitch * (y - (rows - 1) / 2), pitch / 2])
@@ -160,18 +161,19 @@ module idc_transition(type, cols = 5, skip = [], cutout = false) { //! Draw IDC
}
}
module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false) { //! Draw pin socket
module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt = false, cutout = false, colour) { //! Draw pin socket
pitch = hdr_pitch(type);
length = pitch * cols + 0.5;
width = pitch * rows - 0.08;
depth = height ? height : hdr_socket_depth(type);
base_colour = colour ? colour : hdr_base_colour(type);
ra_offset = 1.5;
if(cutout)
;
else {
vitamin(str("pin_socket(", type[0], ", ", cols, ", ", rows, arg(right_angle, false, "right_angle"), arg(height, 0, "height"), arg(smt, false, "smt"),
"): Pin socket ", cols, " x ", rows, right_angle ? " right_angle" : ""));
color(hdr_base_colour(type))
color(base_colour)
translate([0, right_angle ? -ra_offset - pitch / 2 : 0, right_angle ? width / 2 : 0])
rotate([right_angle ? 90 : 0, 0, 0])
translate_z(depth / 2)

View File

@@ -259,23 +259,26 @@ module psu(type) { //! Draw a power supply
square(16, center = true);
}
// earth strap
tab_w = w / 2 + cutout[2].x;
color("silver")
translate([-l / 2, w / 2 - tab_w, z])
cube([left, tab_w - bt, lt]);
// Earth pilar and screw
earth_inset = 4.5;
earth_d = 5;
translate([-l / 2 + earth_inset, w / 2 - tab_w / 2]) {
// if the cutout is too wide, then don't draw earth strap, pillar and screw
if (tab_w - bt > 0) {
// earth strap
color("silver")
cylinder(d = earth_d, h = z - pcb_thickness);
translate([-l / 2, w / 2 - tab_w, z])
cube([left, tab_w - bt, lt]);
translate_z(z + lt)
not_on_bom() no_explode()
spring_washer(M3_washer)
screw(M3_pan_screw, 8);
// Earth pillar and screw
earth_inset = 4.5;
earth_d = 5;
translate([-l / 2 + earth_inset, w / 2 - tab_w / 2]) {
color("silver")
cylinder(d = earth_d, h = z - pcb_thickness);
translate_z(z + lt)
not_on_bom() no_explode()
spring_washer(M3_washer)
screw(M3_pan_screw, 8);
}
}
// terminal block

View File

@@ -83,15 +83,76 @@ KY240W =
// This PSU, and ones very like it, are sold by LulzBot, and various sellers on eBay.
// The screw layout specified here uses the inner set of screw-mounts on the PSU, which are M4.
// The outer set don't appear to be M3, even though the datasheet claims they are.
S_300_12 =
["S_300_12", "S-300-12", 215, 115, 50, M4_cap_screw, M4_clearance_radius, false, 0, 0, [],
[ [[[ 215 / 2 - 32.5, 115 / 2 - 82.5],
[ 215 / 2 - 32.5, 115 / 2 - 32.5],
[ 215 / 2 - 182.5, 115 / 2 - 82.5],
[ 215 / 2 - 182.5, 115 / 2 - 32.5]]]
S_300_12 = [
"S_300_12",
"S-300-12",// part name
215, 115, 50,// length, width, height
M4_cap_screw, M4_clearance_radius,// screw type and clearance
false,// true if ATX style
13,// terminals bay depth
0,// heatsink bay depth
[// terminals
9,// count
18,// y offset
st_terminals
],
// faces
[
[// f_bottom, bottom
[// holes
[215/2 - 32.5, 115/2 - 82.5], [215/2 - 32.5, 115/2 - 32.5], [215/2 - 182.5, 115/2 - 82.5], [215/2 - 182.5, 115/2 - 32.5]
],
1.5,// thickness
[],// cutouts
false,// grill
[],[],[]// fan, iec, rocker
],
[]
];
[// f_top, top
[],// holes
0.5,// thickness
[],// coutouts
false,// grill
[215/2 - 47.5, 115/2 - 37.5, fan50x15]
],
[// f_left, front (terminals) after rotation
[],// holes
0.5,// thickness
[// cutouts
[
[-56, -25], [-56, -17],
[-60, -17], [-60, 0],
[115/2, 0], [115/2, -25]
]
],
false,// grill
],
[// f_right, back after rotation
[], // holes
1.5,// thickness
[],// cutouts
false,// grill
],
[// f_front, right after rotation
[// holes, offset from center
[215/2 - 32.5,-15], [215/2 - 182.5,-15],
[215/2 - 32.5, 10], [215/2 - 182.5, 10]
],
1.5,// thickness
[],// cutouts
false,// grill
],
[// f_back, left after rotation
[// holes, offset from center
[215/2 - 32.5, 15], [215/2 - 182.5, 15]
],
1.5,// thickness
[],// cutouts
false,// grill
],
],
// accessories to add to BOM
[]
];
External =
["External", "X Box", 0, 0, 0, false, false, false, 0, 0, [],
@@ -102,3 +163,4 @@ External =
psus = [PD_150_12, S_250_48, ATX500, KY240W, S_300_12];
use <psu.scad>

View File

@@ -133,20 +133,36 @@ module rail(type, length) { //! Draw the specified rail
vitamin(str("rail(", type[0], ", ", length, "): Linear rail ", type[0], " x ", length, "mm"));
color(grey90) {
linear_extrude(height = height - rail_bore_depth(type)) difference() {
linear_extrude(height - rail_bore_depth(type)) difference() {
square([length, width], center = true);
rail_hole_positions(type, length)
circle(d = rail_hole(type));
}
translate_z(rail_height(type) - rail_bore_depth(type))
linear_extrude(height = rail_bore_depth(type)) difference() {
square([length, width], center = true);
translate_z(rail_height(type) - rail_bore_depth(type)) {
h1 = rail_bore_depth(type) > 2 ? rail_bore_depth(type) / 3 : rail_bore_depth(type) / 2;
h0 = rail_bore_depth(type) > 2 ? (rail_bore_depth(type) - h1) / 2 : 0;
h2 = rail_bore_depth(type) - h1 - h0;
linear_extrude(h0) difference() {
square([length, width], center = true);
rail_hole_positions(type, length)
circle(d = rail_bore(type));
}
translate_z(h0)
linear_extrude(h1) difference() {
w1 = max(width - 2, rail_bore(type));
square([length, w1], center = true);
rail_hole_positions(type, length)
circle(d = rail_bore(type));
}
translate_z(h0 + h1)
linear_extrude(h2) difference() {
square([length, width], center = true);
rail_hole_positions(type, length)
circle(d = rail_bore(type));
}
}
}
}

View File

@@ -19,6 +19,8 @@
//
//! Steel rods and studding with chamfered ends.
//!
//! These items are sysmtrical, so by default the origin is in the centre but it can be changed to the bottom.
//
include <../core.scad>
use <../utils/thread.scad>

View File

@@ -18,7 +18,7 @@
//
//
// SCSnUU and SCSnLUU bearing blocks
//! SCSnUU and SCSnLUU bearing blocks
//

View File

@@ -19,6 +19,8 @@
//
//! Compression springs. Can be tapered, have open, closed or ground ends. Ground ends will render a lot slower.
//!
//! By default springs have their origin at the bottom but can be centered.
//
include <../core.scad>
@@ -64,7 +66,7 @@ function comp_spring(type, l = 0) = //! Calculate the mesh for spring
profile = circle_points(wire_d / 2 - eps, $fn = 16)
) concat(type, [concat(sweep(path, profile), [l])]);
module comp_spring(type, l = 0) { //! Draw specified spring, l can be set to specify the compressed length.
module comp_spring(type, l = 0, center = false) { //! Draw specified spring, l can be set to specify the compressed length.
length = spring_length(type);
closed = spring_closed(type);
od = spring_od(type);
@@ -79,14 +81,17 @@ module comp_spring(type, l = 0) { //! Draw specified spring, l can be set to spe
mesh = len(type) > 9 ? spring_mesh(type) : spring_mesh(comp_spring(type, l));
assert(l == mesh[2], "can't change the length of a pre-generated spring");
color(spring_colour(type))
if(ground)
clip(zmin = 0, zmax = h)
len = l ? l : length;
translate_z(center ? - len / 2 : 0) {
color(spring_colour(type))
if(ground)
clip(zmin = 0, zmax = h)
polyhedron(mesh[0], mesh[1]);
else
polyhedron(mesh[0], mesh[1]);
else
polyhedron(mesh[0], mesh[1]);
if($children)
translate_z(l)
children();
if($children)
translate_z(len)
children();
}
}

View File

@@ -26,6 +26,7 @@ include <screws.scad>
use <washer.scad>
include <ring_terminals.scad>
use <../utils/tube.scad>
use <../utils/thread.scad>
use <rod.scad>
function NEMA_width(type) = type[1]; //! Width of the square face
@@ -60,6 +61,7 @@ module NEMA(type, shaft_angle = 0) { //! Draw specified NEMA stepper motor
shaft_rad = NEMA_shaft_dia(type) / 2;
cap = 8;
vitamin(str("NEMA(", type[0], "): Stepper motor NEMA", round(NEMA_width(type) / 2.54), " x ", length, "mm"));
thread_d = 3; // Is this always the case?
union() {
color(stepper_body_colour) // black laminations
@@ -75,7 +77,7 @@ module NEMA(type, shaft_angle = 0) { //! Draw specified NEMA stepper motor
tube(or = boss_rad, ir = shaft_rad + 2, h = boss_height * 2); // raised boss
for(end = [-1, 1])
translate_z(-length / 2 + end * (length - cap) / 2)
translate_z(-length / 2 + end * (length - cap) / 2) {
linear_extrude(height = cap, center = true)
difference() {
intersection() {
@@ -85,9 +87,14 @@ module NEMA(type, shaft_angle = 0) { //! Draw specified NEMA stepper motor
if(end > 0)
for(x = NEMA_holes(type), y = NEMA_holes(type))
translate([x, y])
circle(r = 3/2);
circle(d = thread_d);
}
}
}
if(show_threads)
for(x = NEMA_holes(type), y = NEMA_holes(type))
translate([x, y, -cap / 2])
female_metric_thread(thread_d, metric_coarse_pitch(thread_d), cap, colour = stepper_cap_colour);
shaft = NEMA_shaft_length(type);
translate_z(-5)
@@ -112,7 +119,7 @@ module NEMA(type, shaft_angle = 0) { //! Draw specified NEMA stepper motor
module NEMA_screw_positions(type, n = 4) { //! Positions children at the screw holes
pitch = NEMA_hole_pitch(type);
for($i = [0 : n - 1])
for($i = [0 : 1 : min(n - 1, 4)])
rotate($i * 90)
translate([pitch / 2, pitch / 2])
rotate($i * -90)