1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-09-03 12:22:46 +02:00

Compare commits

...

121 Commits

Author SHA1 Message Date
Chris Palmer
fa91acbaad Merge branch 'martinbudden-scs_bearing_blocks' 2020-02-24 00:03:42 +00:00
Chris Palmer
8bad05e721 Added to lib.scad 2020-02-24 00:00:32 +00:00
Chris Palmer
9d6727d371 Added images and readme 2020-02-23 23:57:18 +00:00
Chris Palmer
8902d83f0a Merge branch 'scs_bearing_blocks' of https://github.com/martinbudden/NopSCADlib into martinbudden-scs_bearing_blocks 2020-02-23 23:40:02 +00:00
Martin Budden
e40b10f5a0 Added comment. 2020-02-23 23:08:34 +00:00
Martin Budden
d066648a76 Renamed sheet_thickness to part_thickness. 2020-02-23 22:34:59 +00:00
Chris Palmer
b8546414c0 Fixed leadscrew when center = false. 2020-02-23 21:54:26 +00:00
Martin Budden
581c2f8a96 Used accessor functions internally. 2020-02-23 21:49:35 +00:00
Martin Budden
e9ee88dfe9 Updates as per code review. 2020-02-23 21:41:47 +00:00
Martin Budden
b07a8ad245 Added SCS bearing blocks, SCSnUU and SCSnLUU variants 2020-02-23 21:06:38 +00:00
Chris Palmer
ab17de3b0b Merge branch 'martinbudden-green_terminals' 2020-02-23 19:53:10 +00:00
Chris Palmer
0b8141844c Updated readme. 2020-02-23 19:52:18 +00:00
Chris Palmer
7d0548b033 Merge branch 'green_terminals' of https://github.com/martinbudden/NopSCADlib into martinbudden-green_terminals 2020-02-23 19:49:16 +00:00
Chris Palmer
8435a350d0 Merge branch 'martinbudden-sk_brackets' 2020-02-23 17:32:54 +00:00
Chris Palmer
3e5d4b1c8e Added to lib.scad. 2020-02-23 17:12:47 +00:00
Chris Palmer
20f830a008 Added image and updated readme. 2020-02-23 16:46:27 +00:00
Chris Palmer
10bd8ff354 Merge branch 'sk_brackets' of https://github.com/martinbudden/NopSCADlib into martinbudden-sk_brackets 2020-02-23 16:22:11 +00:00
Chris Palmer
4459cca3ea Merge branch 'martinbudden-screw_length_formatting' 2020-02-23 16:16:30 +00:00
Chris Palmer
95bbebd42d Updated readme. 2020-02-23 16:16:09 +00:00
Martin Budden
cc84a5a536 Added comments and ability to set colour to green terminals. 2020-02-23 15:38:02 +00:00
Chris Palmer
28c795e9f4 Merge branch 'screw_length_formatting' of https://github.com/martinbudden/NopSCADlib into martinbudden-screw_length_formatting 2020-02-23 15:24:43 +00:00
Chris Palmer
9a0477d16b Merge branch 'martinbudden-pcb_microswitch2' 2020-02-23 15:22:43 +00:00
Chris Palmer
0583da2eb7 Added images 2020-02-23 15:22:25 +00:00
Chris
9a08fe9b5c Merge branch 'master' into pcb_microswitch2 2020-02-23 15:10:13 +00:00
Chris Palmer
8ab7993148 Merge branch 'martinbudden-rocker_color' 2020-02-23 15:03:23 +00:00
Chris Palmer
16dd8d6d17 Added images and readme. 2020-02-23 15:02:39 +00:00
Chris Palmer
08c268145e Merge branch 'rocker_color' of https://github.com/martinbudden/NopSCADlib into martinbudden-rocker_color 2020-02-23 14:52:11 +00:00
Chris Palmer
ba7e64233a Clarified path settings in usage.md. 2020-02-23 14:46:39 +00:00
Chris Palmer
7090c714ce Merge branch 'martinbudden-pcb_buzzer' 2020-02-23 14:34:04 +00:00
Martin Budden
c5038db6d9 Added support for tNuts in sk_brackets. 2020-02-23 14:32:40 +00:00
Chris Palmer
654f094304 Merge branch 'martinbudden-spool_filament' 2020-02-23 14:28:57 +00:00
Chris Palmer
1e5e5860e1 Made more realistic and added a test. 2020-02-23 14:28:39 +00:00
Martin Budden
a08216d0b8 Added SK shaft support brackets. 2020-02-23 13:57:14 +00:00
Chris Palmer
3d8a9ec8aa Merge branch 'spool_filament' of https://github.com/martinbudden/NopSCADlib into martinbudden-spool_filament 2020-02-23 10:04:23 +00:00
Chris Palmer
7ec059142f Updated readme. 2020-02-23 10:01:28 +00:00
Chris Palmer
7f0d96b824 Merge branch 'pcb_buzzer' of https://github.com/martinbudden/NopSCADlib into martinbudden-pcb_buzzer 2020-02-22 23:06:08 +00:00
Chris Palmer
9e826c1a09 Merge branch 'martinbudden-belt_colors' 2020-02-22 23:02:03 +00:00
Chris Palmer
2c1dbe04a9 Added images and readme. 2020-02-22 23:01:50 +00:00
Chris Palmer
d644d6b698 Merge branch 'belt_colors' of https://github.com/martinbudden/NopSCADlib into martinbudden-belt_colors 2020-02-22 22:47:42 +00:00
Chris Palmer
8db4cc2cb5 Merge branch 'martinbudden-pcb_jst_xh' 2020-02-22 22:40:31 +00:00
Chris Palmer
509a87939c Updated images and readme 2020-02-22 22:40:09 +00:00
Chris Palmer
40607e6cfc Merge branch 'pcb_jst_xh' of https://github.com/martinbudden/NopSCADlib into martinbudden-pcb_jst_xh 2020-02-22 22:28:16 +00:00
Chris Palmer
599fbba6c2 Reduced dependecies in pcb_mount test. 2020-02-22 22:24:45 +00:00
Chris Palmer
52729d012c Merge branch 'martinbudden-rail_carriage_coloring' 2020-02-22 22:16:50 +00:00
Chris Palmer
6097e07094 Updated images and readme. 2020-02-22 22:16:09 +00:00
Chris Palmer
9d71438a3c Merge branch 'rail_carriage_coloring' of https://github.com/martinbudden/NopSCADlib into martinbudden-rail_carriage_coloring 2020-02-22 21:59:15 +00:00
Chris Palmer
ffa1ab940b Merge branch 'martinbudden-tnuts' 2020-02-22 21:51:16 +00:00
Chris Palmer
3174013e1a Updated images and readme. 2020-02-22 21:51:05 +00:00
Chris Palmer
c4eea38a2b Added threads 2020-02-22 21:27:51 +00:00
Chris Palmer
0cd89279a5 Merge branch 'tnuts' of https://github.com/martinbudden/NopSCADlib into martinbudden-tnuts 2020-02-22 21:12:13 +00:00
Chris Palmer
92051e0b28 Merge branch 'martinbudden-gitattributes' 2020-02-22 21:05:26 +00:00
Chris Palmer
f4b22e35c7 Merge branch 'gitattributes' of https://github.com/martinbudden/NopSCADlib into martinbudden-gitattributes 2020-02-22 21:02:24 +00:00
Chris Palmer
17ecfc07f3 Merge branch 'martinbudden-screw_knob_typo' 2020-02-22 20:58:55 +00:00
Chris Palmer
9658205efd Updated readme 2020-02-22 20:58:43 +00:00
Chris Palmer
53140a4cc1 Merge branch 'screw_knob_typo' of https://github.com/martinbudden/NopSCADlib into martinbudden-screw_knob_typo 2020-02-22 20:55:17 +00:00
Chris Palmer
2798d39538 Merge branch 'martinbudden-iec_switched_fused' 2020-02-22 20:51:58 +00:00
Chris Palmer
8be0cc98ea Updated the images and readme. 2020-02-22 20:51:15 +00:00
Chris Palmer
6a5f31edd8 Merge branch 'iec_switched_fused' of https://github.com/martinbudden/NopSCADlib into martinbudden-iec_switched_fused 2020-02-22 20:01:25 +00:00
Chris Palmer
e068918e21 Added screw threads to most things that are threaded.
Added a mechanism for tests.py and views.py to have command line options.
2020-02-22 19:44:01 +00:00
Chris Palmer
1614f50b73 Merged master 2020-02-22 18:32:35 +00:00
Martin Budden
32522b28d7 Added hammer nuts. 2020-02-19 06:42:11 +00:00
Martin Budden
1936c95d06 Added IEC 320 C14 switched fused inlet module. 2020-02-18 08:24:16 +00:00
Martin Budden
16060629c0 Added sliding t nuts. Sizes M3, M4 and M5. 2020-02-18 07:48:01 +00:00
Martin Budden
b7b5c837bd Used tube for buzzer. 2020-02-17 19:40:49 +00:00
Martin Budden
a793cb6d43 Added ability to use microswitch on a pcb. 2020-02-17 06:58:09 +00:00
Martin Budden
dc4e24b63a Simplified drawing of filament. 2020-02-16 23:06:07 +00:00
Martin Budden
8f85ac73dc Added space before screw length when length < 10 to ensure correct ordering.
This means 5mm, 6mm etc comes before 10mm in BOM.
2020-02-16 21:15:44 +00:00
Martin Budden
3ab934d83e Typo in screw_knob. foe corrected to for. 2020-02-07 19:58:37 +00:00
Martin Budden
d1324a670e Added JST-XH connector for pcbs. 2020-01-30 05:45:29 +00:00
Martin Budden
f5fdec613c Allow setting of color of rocker switch. Defaults to current colors. 2020-01-29 17:46:32 +00:00
Martin Budden
c55b8b6d1c Parameterised belt colors. 2020-01-29 17:40:34 +00:00
Martin Budden
56ec8e03ad Added PCB buzzer. 2020-01-29 17:37:01 +00:00
Martin Budden
728b7adf38 Add ability to display filament on spool. 2020-01-14 11:26:21 +00:00
Martin Budden
75747687d9 Parameterised coloring of linear rail carriage. 2020-01-12 10:20:10 +00:00
Martin Budden
03c97e8b6a Changed rail carriage coloring to be green with red endpiece to match common form. 2020-01-11 14:54:00 +00:00
Chris Palmer
8ac06b53e7 Updated readme and images for linear_bearings change. 2020-01-11 08:57:33 +00:00
Martin Budden
de76eb46e7 Initial commit. Set default text file line endings to LF. 2020-01-11 08:21:38 +00:00
Chris
2c77f184a2 Merge pull request #12 from martinbudden/linear_bearings
Added LM16UU and long form (LMxLUU) of linear bearings plus external grooves.
2020-01-11 08:10:49 +00:00
Martin Budden
4d3d9dfdfe Added LM16UU and long form (LMxLUU) of linear bearings.
Added external grooves.
2020-01-10 22:11:53 +00:00
Chris Palmer
f7a972f946 Added pictures and documentation for extrusions. 2020-01-10 20:10:17 +00:00
Chris
4e81fcbd4f Merge pull request #10 from martinbudden/extrusions
Initial submission of E2020 aluminium extrusion.
2020-01-10 19:32:49 +00:00
Martin Budden
1f038decd4 Initial submission of aluminium extrusion. Supports 2020, 2040, 2060, 2080, 3030, 3060, 4040, 4080 types.
Added extrusions to main picture.
2020-01-10 19:24:24 +00:00
Chris
da958fe112 Merge pull request #11 from martinbudden/e3d_naked
E3d Resistor wire drawn even if naked=true.
2020-01-10 13:26:43 +00:00
Martin Budden
61493eaa34 Resistor wire drawn even if naked=true. 2020-01-10 12:26:56 +00:00
Chris
804c00bdcb Merge pull request #8 from martinbudden/rocker_typo
Fixed typo where 'rocker' was spelt 'rocket'.
2020-01-10 10:28:21 +00:00
Chris
11ea68681f Merge pull request #9 from martinbudden/e3d_tab_formatting
Tabs used instead of spaces in module e3d_resistor.
2020-01-10 10:27:40 +00:00
Chris Palmer
d703ae4997 Added male screw threads. 2020-01-10 10:26:12 +00:00
Martin Budden
ed97d226f8 Tabs used instead of spaces in module e3d_resistor. 2020-01-10 08:49:03 +00:00
Martin Budden
4107a2c848 Fixed typo where 'rocker' was spelt 'rocket'. 2020-01-10 08:26:20 +00:00
Chris Palmer
f7ef075434 Fixed hex pillar thread length.
Reordered screws.
Random pixel changes.
2019-12-30 12:45:51 +00:00
Chris Palmer
6f93b6af9a pcb_component_position() can now be passed an index to differentiate between
multiple components of the same type.

Added pcb_grid_pos() function.
2019-11-15 13:30:27 +00:00
Chris Palmer
53f416eef1 Added more detail to the Environ+ pcb.
Changed the RPI0 SD height to be more accurate.
2019-11-15 13:28:02 +00:00
Chris Palmer
6354219627 Added tiny 17x8mm fan. 2019-11-15 13:25:32 +00:00
Chris Palmer
56e2b71bda Updated readme for last PR 2019-10-22 18:01:51 +01:00
Chris
8f5503586d Merge pull request #6 from limitz/e3d_resistor_wire_rotate
E3d resistor wire rotate
2019-10-22 17:57:14 +01:00
Chris
1cd9edfe87 Merge pull request #5 from limitz/blower_typo
Small typo fix for blower RB5015 in source (string) and documentation
2019-10-22 17:54:17 +01:00
Chris Palmer
a85fdaf176 Added printed pcb_mount to hold PCBs without mounting holes. 2019-10-22 17:47:46 +01:00
Chris Palmer
18294b4b81 Added Enviro+ PCB 2019-10-22 16:32:26 +01:00
Chris Palmer
ad62ce362c Can now force fan screws to be the full depth and nuts then get washers. 2019-10-22 16:21:58 +01:00
Chris Palmer
9f27f26894 Added pcb_component_position() function. 2019-10-22 16:17:22 +01:00
Chris Palmer
2eaa4bfc21 Readme changes for last commit. 2019-10-22 16:16:12 +01:00
Chris Palmer
1944039f22 Added crimp version of ring terminal. 2019-10-22 16:12:58 +01:00
Chris Palmer
1c221ad612 Added S-7282B LCD display 2019-10-22 16:12:00 +01:00
Chris Palmer
85adf7b4f4 Readme changes for last commit. 2019-10-22 16:09:46 +01:00
Chris Palmer
64bde2cb3a Added right angle pin headers. 2019-10-22 16:08:15 +01:00
Chris Palmer
c34469e852 Added more sizes of cable grommets. 2019-10-22 15:37:10 +01:00
Chris Palmer
dbc3c36f44 Can now override the front panel width of a butt_box to make it wider. 2019-10-22 15:36:37 +01:00
Chris Palmer
8c51183ba6 Added volume and area functions to butt_box. 2019-10-22 15:34:08 +01:00
Chris Palmer
a9c4e60cac Added another spool size 2019-10-22 15:27:49 +01:00
Eddy Pronk
d041b18025 Adds an option resistor_wire_rotate 2019-10-21 17:51:19 +02:00
Eddy Pronk
e85887fec4 Small typo fix for blower RB5015 in source (string) and documentation 2019-10-21 17:17:11 +02:00
Chris Palmer
ededb514b8 Fixed some missing commas in pin_header vitamin calls. 2019-09-15 18:28:42 +01:00
Chris Palmer
d0d525b97a Added RPi 0 model 2019-09-14 23:26:26 +01:00
Chris Palmer
371d274906 Fixed missing include for hygrometer. 2019-09-14 23:09:21 +01:00
Chris Palmer
7118e6eb03 Typo in comment. 2019-09-06 11:28:49 +01:00
Chris Palmer
46004381b7 Merge branch 'master' into Execute_attributes 2019-08-21 22:04:27 +01:00
Chris Palmer
cfdf759a49 Added missing files from last push. 2019-08-21 18:51:45 +01:00
Chris Palmer
6f4859a4b5 Merge branch 'master' into Execute_attributes 2019-08-18 18:42:42 +01:00
Chris Palmer
3a087be0e9 Merge branch 'master' into Execute_attributes 2019-08-18 15:22:47 +01:00
Chris Palmer
77aa8fe44d Merge branch 'master' into Execute_attributes 2019-08-18 14:30:28 +01:00
Chris Palmer
6fe4548213 Set execute attributes on scripts for Linux. 2019-08-18 14:29:15 +01:00
147 changed files with 2666 additions and 451 deletions

16
.gitattributes vendored Normal file
View File

@@ -0,0 +1,16 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto eol=lf
# Declare text files that are normalized and converted on checkout.
*.scad text
*.py text
*.md text
# Handle Windows batch and command files
*.{bat,[bB][aA][tT]} text eol=crlf
*.{cmd,[cC][mM][dD]} text eol=crlf
# Denote files that are binary and should not be modified.
*.png binary
*.jpg binary

1
.gitignore vendored
View File

@@ -7,6 +7,7 @@ tests/bom/
*.log
*.html
bounds.json
options.json
times.txt
*_diff.png
*.echo

BIN
docs/metric_threads.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -26,7 +26,7 @@ OpenSCAD has to be setup to find libraries by setting the ```OPENSCADPATH``` env
in the directory it points to. This can be done with ```git clone https://github.com/nophead/NopSCADlib.git``` while in that directory or, if you don't want to use GIT,
by downloading https://github.com/nophead/NopSCADlib/archive/master.zip and unzipping it to a directory called NopSCADlib.
The ```NopSCADlib/scripts``` directory needs to be added to the executable search path.
The ```NopSCADlib/scripts``` directory needs to be added to the executable search path, ```PATH``` on Windows and ```path``` on Linux and Mac.
The installation can be tested by opening ```NopSCADlib/libtest.scad``` in the OpenSCAD GUI. It should render all the objects in the library in about 1 minute.

View File

@@ -39,6 +39,7 @@ pp2_colour = is_undef($pp2_colour) ? "red" : $pp2_colour; // pri
pp3_colour = is_undef($pp3_colour) ? "blue" : $pp3_colour; // printed part colour 3
pp4_colour = is_undef($pp4_colour) ? "darkorange" : $pp4_colour;// printed part colour 4
show_rays = is_undef($show_rays) ? false : $show_rays; // show camera sight lines and light direction
show_threads = is_undef($show_threads) ? false : $show_threads; // show screw threads
// Minimum wall is about two filaments wide but we extrude it closer to get better bonding
squeezed_wall = $preview ? 2 * extrusion_width - layer_height * (1 - PI / 4)
@@ -59,7 +60,8 @@ grey60 = [0.6, 0.6, 0.6];
grey70 = [0.7, 0.7, 0.7];
grey80 = [0.8, 0.8, 0.8];
grey90 = [0.9, 0.9, 0.9];
brass = "gold";
brass = [255/255, 215/255, 0/255];
silver = [0.75, 0.75, 0.75];
/*
* Enums

View File

@@ -62,6 +62,9 @@ include <vitamins/spools.scad>
include <vitamins/mains_sockets.scad>
include <vitamins/ldrs.scad>
include <vitamins/geared_steppers.scad>
include <vitamins/extrusions.scad>
include <vitamins/sk_brackets.scad>
include <vitamins/scs_bearing_blocks.scad>
use <vitamins/jack.scad>
use <vitamins/meter.scad>
@@ -90,3 +93,4 @@ use <utils/layout.scad>
use <utils/round.scad>
use <utils/offset.scad>
use <utils/sector.scad>
use <utils/thread.scad>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 716 KiB

After

Width:  |  Height:  |  Size: 766 KiB

View File

@@ -32,6 +32,7 @@ use <tests/cable_strips.scad>
use <tests/components.scad>
use <tests/d_connectors.scad>
use <tests/displays.scad>
use <tests/extrusions.scad>
use <tests/fans.scad>
use <tests/fuseholder.scad>
use <tests/geared_steppers.scad>
@@ -91,6 +92,7 @@ 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;
@@ -134,13 +136,13 @@ translate([x5, cable_grommets_y + 250])
translate([900, 600])
box_test();
translate([850, 1170])
translate([850, 1260])
bbox_test();
x0 = 0;
inserts_y = 0;
nuts_y = inserts_y + 20;
washers_y = nuts_y + 60;
washers_y = nuts_y + 100;
screws_y = washers_y + 120;
o_rings_y = screws_y + 130;
springs_y = o_rings_y + 20;
@@ -151,7 +153,7 @@ leadnuts_y = pillars_y + 40;
pulleys_y = leadnuts_y +40;
hot_ends_y = pulleys_y + 60;
linear_bearings_y = hot_ends_y + 50;
sheets_y = linear_bearings_y + 50;
sheets_y = linear_bearings_y + 100;
pcbs_y = sheets_y + 40;
displays_y = pcbs_y + 150;
fans_y = displays_y + 100;
@@ -202,6 +204,10 @@ translate([x0, linear_bearings_y]) {
rods();
}
translate([x0+150, linear_bearings_y+30]) {
extrusions();
}
translate([x0 + 10, hot_ends_y])
hot_ends();
@@ -248,7 +254,7 @@ buttons_y = spades_y + 40;
jacks_y = buttons_y + 40;
microswitches_y = jacks_y + 40;
rockers_y = microswitches_y + 40;
toggles_y = rockers_y + 40;
toggles_y = rockers_y + 60;
components_y = toggles_y + 40;
translate([x2, leds_y])
@@ -304,6 +310,9 @@ translate([x3, veroboard_y])
translate([x3 + 70, veroboard_y + 30])
geared_steppers();
translate([x3 + 140, veroboard_y + 20])
pcb_mounts();
translate([x3, d_connectors_y])
d_connectors();

View File

@@ -50,6 +50,10 @@ function bbox_name(type) = type[8] ? type[8] : "bbox"; //! Optional name i
function bbox_skip_blocks(type)= type[9] ? type[9] : []; //! List of fixing blocks to skip, used to allow a hinged panel for example
function star_washers(type) = type[10] ? type[10] : is_undef(type[10]); //! Set to false to remove star washers.
function bbox_volume(type) = bbox_width(type) * bbox_depth(type) * bbox_height(type) / 1000000; //! Internal volume in litres
function bbox_area(type) = let(w = bbox_width(type), d = bbox_depth(type), h = bbox_height(type)) //! Internal surdface area in m^2
2 * (w * d + w * h + d * h) / 1000000;
module bbox_shelf_blank(type) { //! 2D template for a shelf
dxf(str(bbox_name(type), "_shelf"));
@@ -165,7 +169,7 @@ module bbox_right_blank(type, sheet = false) { //! 2D template for the right sid
}
}
module bbox_front_blank(type, sheet = false) { //! 2D template for the front
module bbox_front_blank(type, sheet = false, width = 0) { //! 2D template for the front
dxf(str(bbox_name(type), "_front"));
t = sheet_thickness(bbox_sheets(type));
@@ -174,7 +178,7 @@ module bbox_front_blank(type, sheet = false) { //! 2D template for the front
difference() {
translate([0, (bt - bb) / 2])
sheet_2D(subst_sheet(type, sheet), bbox_width(type) + 2 * t, bbox_height(type) + bb + bt);
sheet_2D(subst_sheet(type, sheet), max(bbox_width(type) + 2 * t, width), bbox_height(type) + bb + bt);
drill_holes(type, rotate([-90, 0, 0]) * translate([0, bbox_depth(type) / 2]));
}
@@ -205,7 +209,7 @@ module _bbox_assembly(type, top = true, base = true, left = true, right = true,
width = bbox_width(type);
depth = bbox_depth(type);
height = bbox_height(type);
echo("Box:", width, depth, height);
echo("Box:", width, depth, height, volume = bbox_volume(type), area = bbox_area(type));
t = sheet_thickness(bbox_sheets(type));
bt = sheet_thickness(bbox_base_sheet(type));

View File

@@ -195,12 +195,15 @@ module mouse_grommet_assembly(r, thickness)
module ribbon_grommet_20_3_stl() ribbon_grommet(20, 3);
module mouse_grommet_15_3_stl() mouse_grommet(1.5, 3);
module mouse_grommet_20_3_stl() mouse_grommet(2, 3);
module mouse_grommet_25_3_stl() mouse_grommet(2.5, 3);
module mouse_grommet_30_3_stl() mouse_grommet(3, 3);
module round_grommet_bottom_30_stl() round_grommet_bottom(3);
module round_grommet_bottom_40_stl() round_grommet_bottom(4);
module round_grommet_bottom_50_stl() round_grommet_bottom(5);
module round_grommet_bottom_60_stl() round_grommet_bottom(6);
module round_grommet_top_30_3_stl() round_grommet_top(3, 3);
module round_grommet_top_40_3_stl() round_grommet_top(4, 3);
module round_grommet_top_50_3_stl() round_grommet_top(5, 3);
module round_grommet_top_60_3_stl() round_grommet_top(6, 3);

124
printed/pcb_mount.scad Normal file
View File

@@ -0,0 +1,124 @@
//
// NopSCADlib Copyright Chris Palmer 2019
// 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 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.
//
include <../core.scad>
include <../vitamins/screws.scad>
use <../vitamins/pcb.scad>
clearance = 0.2;
min_wall = extrusion_width * 2;
wall = 2;
overlap = 2;
screw = M3_cap_screw;
screw_clearance_r = 3.1 / 2;
pillar_r = corrected_radius(screw_clearance_r) + wall;
function pillar_x_pitch(pcb) = pcb_length(pcb) + 2 * clearance + 2 * (pillar_r - overlap) / sqrt(2); //! x pitch of screw pillars
function pillar_y_pitch(pcb) = pcb_width(pcb) + 2 * clearance + 2 * (pillar_r - overlap) / sqrt(2); //! y pitch of screw pillars
function pcb_mount_length(pcb) = pillar_x_pitch(pcb) + 2 * pillar_r; //! Outside length of the mount
function pcb_mount_width(pcb) = pillar_y_pitch(pcb) + 2 * pillar_r; //! Outside width of the mount
frame_w = 3;
frame_t = 2;
washer_thickness = 1.25;
module pcb_mount_screw_positions(pcb) //! Positions of the screws and pillars
for(x = [-1, 1], y = [-1, 1])
translate([x * pillar_x_pitch(pcb) / 2, y * pillar_y_pitch(pcb) / 2])
children();
module pcb_mount_holes(pcb, h = 0) //! Drill holes for PCB mount
pcb_mount_screw_positions(pcb)
drill(screw_clearance_radius(screw), h);
module pcb_mount_ring()
difference() {
circle(pillar_r);
poly_circle(screw_clearance_r);
}
module pcb_mount_washer_stl() //! A plastic washer to clamp a PCB
linear_extrude(height = washer_thickness)
pcb_mount_ring();
module pcb_mount(pcb, height = 5, washers = true) { //! Make the STL of a pcb mount for the specified PCB.
stl(str("pcb_mount_", pcb[0], "_", height));
y_pitch = pcb_width(pcb) > 4 * pillar_r + 4 ? pillar_r + 1
: pcb_width(pcb) / 2 + frame_w + 1 + pillar_r;
if(washers)
for(x = [-1, 1], y = [-1, 1])
translate([x * (pillar_r + 1), y * y_pitch, 0])
pcb_mount_washer_stl();
for(x = [-1, 1])
translate([x * pillar_x_pitch(pcb) / 2, 0, frame_t / 2])
cube([frame_w, pillar_y_pitch(pcb) - 2 * wall, frame_t], center = true);
for(y = [-1, 1])
translate([0, y * pillar_y_pitch(pcb) / 2, frame_t / 2])
cube([pillar_x_pitch(pcb) - 2 * wall, frame_w, frame_t], center = true);
pcb_mount_screw_positions(pcb)
linear_extrude(height = height)
pcb_mount_ring();
linear_extrude(height = height + pcb_thickness(pcb) - layer_height)
difference() {
pcb_mount_screw_positions(pcb)
pcb_mount_ring();
square([pcb_length(pcb) + 2 * clearance, pcb_width(pcb) + 2 * clearance], center = true);
}
}
module pcb_mount_assembly(pcb, thickness, height = 5) { //! A PCB mount assembly with fasteners
translate_z(height)
pcb(pcb);
color(pp1_colour) pcb_mount(pcb, washers = false);
washer = screw_washer(screw);
nut = screw_nut(screw);
t = pcb_thickness(pcb);
screw_length = screw_longer_than(height + t + washer_thickness + thickness + washer_thickness(washer) + nut_thickness(nut, true));
pcb_mount_screw_positions(pcb) {
translate_z(height + t) {
color(pp2_colour) pcb_mount_washer_stl();
translate_z(washer_thickness)
screw(screw, screw_length);
}
translate_z(-thickness)
vflip()
nut_and_washer(nut, true);
}
}

View File

@@ -34,7 +34,7 @@ knob_waves = 5;
knob_height = knob_stem_h + knob_thickness;
function knob_height() = knob_height;
module screw_knob(screw) { //! Generate the STL foe a knob to fit the specified hex screw
module screw_knob(screw) { //! Generate the STL for a knob to fit the specified hex screw
stl(str("screw_knob_M", screw_radius(screw) * 20));
knob_stem_r = nut_trap_radius(screw_nut(screw)) + knob_wall;

527
readme.md
View File

@@ -28,25 +28,26 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
<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 = "#Fans">Fans</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 = "#Fuseholder">Fuseholder</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 = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Screws">Screws</a> </td><td> <a href = "#Psu_shroud">Psu_shroud</a> </td><td> <a href = "#Sector">Sector</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 = "#Sweep">Sweep</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 = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Spades">Spades</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 = "#Spools">Spools</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 = "#Springs">Springs</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 = "#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>
<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 = "#Ldrs">Ldrs</a> </td><td> <a href = "#Ssrs">Ssrs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Leadnuts">Leadnuts</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Leds">Leds</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Light_strips">Light_strips</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Linear_bearings">Linear_bearings</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Mains_sockets">Mains_sockets</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Meter">Meter</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Washers">Washers</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Wire">Wire</a> </td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Modules">Modules</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td></td><td></td><td></td></tr>
</table>
---
@@ -195,7 +196,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour
### Modules
| Module | Description |
|:--- |:--- |
| ```belt(type, points, gap = 0, gap_pt = undef)``` | Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless a gap is specified |
| ```belt(type, points, gap = 0, gap_pt = undef, belt_colour = grey20, tooth_colour = grey50)``` | Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless a gap is specified |
![belts](tests/png/belts.png)
@@ -212,7 +213,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour
| 2 | ```pulley(GT2x16_plain_idler)``` | Pulley GT2 idler smooth 9.63mm |
| 2 | ```pulley(GT2x20ob_pulley)``` | Pulley GT2OB 20 teeth |
| 1 | ```screw(M3_cs_cap_screw, 20)``` | Screw M3 cs cap x 20mm |
| 4 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
| 4 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
<a href="#top">Top</a>
@@ -260,7 +261,7 @@ Models of radial blowers.
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```blower(PE4020)``` | Blower Pengda Technology 4020 |
| 1 | ```blower(RM5015)``` | Blower Runda RB5015 |
| 1 | ```blower(RB5015)``` | Blower Runda RB5015 |
| 3 | ```screw(M3_cap_screw, 20)``` | Screw M3 cap x 20mm |
| 2 | ```screw(M4_cap_screw, 25)``` | Screw M4 cap x 25mm |
| 3 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
@@ -581,9 +582,58 @@ LCD dispays.
| ---:|:--- |:---|
| 1 | ```display(HDMI5)``` | HDMI display 5" |
| 1 | ```display(LCD1602A)``` | LCD display 1602A |
| 1 | ```display(LCDS7282B)``` | LCD display S-7282B |
| 1 | ```display(SSD1963_4p3)``` | LCD display SSD1963 4.3" |
<a href="#top">Top</a>
---
<a name="Extrusions"></a>
## Extrusions
Aluminium extrusion.
[vitamins/extrusions.scad](vitamins/extrusions.scad) Object definitions.
[vitamins/extrusion.scad](vitamins/extrusion.scad) Implementation.
[tests/extrusions.scad](tests/extrusions.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```extrusion_center_hole(type)``` | Diameter of center hole |
| ```extrusion_center_square(type)``` | Size of center square |
| ```extrusion_channel_width(type)``` | Channel width |
| ```extrusion_channel_width_internal(type)``` | Internal channel width |
| ```extrusion_corner_hole(type)``` | Diameter of corner hole |
| ```extrusion_fillet(type)``` | Radius of corner fillet |
| ```extrusion_height(type)``` | Height of extrusion |
| ```extrusion_spar_thickness(type)``` | Spar thickness |
| ```extrusion_tab_thickness(type)``` | Tab thickness |
| ```extrusion_width(type)``` | Width of extrusion |
### Modules
| Module | Description |
|:--- |:--- |
| ```extrusion(type, length, cornerHole = false)``` | Draw the specified extrusion |
![extrusions](tests/png/extrusions.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 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 |
<a href="#top">Top</a>
---
@@ -615,16 +665,11 @@ Can draw three styles: solid, open frame and open frame with screw bosses.
| ```fan_thickness(type)``` | Thickness of the frame |
| ```fan_width(type)``` | Width of square |
### Functions
| Function | Description |
|:--- |:--- |
| ```fan_screw_length(type, thickness)``` | Screw length required |
### Modules
| Module | Description |
|:--- |:--- |
| ```fan(type)``` | Draw specified fan, origin in the centre |
| ```fan_assembly(type, thickness, include_fan = true, screw = false)``` | Fan with its fasteners |
| ```fan_assembly(type, thickness, include_fan = true, screw = false, full_depth = false)``` | Fan with its fasteners |
| ```fan_hole_positions(type, z = undef)``` | Position children at the screw hole positions |
| ```fan_holes(type, poly = false, screws = true, h = 100)``` | Make all the holes for the fan, or just the aperture if ```screws``` is false. Set ```poly``` true for poly_holes. |
@@ -634,6 +679,7 @@ Can draw three styles: solid, open frame and open frame with screw bosses.
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```fan(fan120x25)``` | Fan 120mm x 25mm |
| 1 | ```fan(fan17x8)``` | Fan 17mm x 8mm |
| 1 | ```fan(fan25x10)``` | Fan 25mm x 10mm |
| 1 | ```fan(fan30x10)``` | Fan 30mm x 10mm |
| 1 | ```fan(fan40x11)``` | Fan 40mm x 11mm |
@@ -643,17 +689,20 @@ Can draw three styles: solid, open frame and open frame with screw bosses.
| 1 | ```fan(fan70x15)``` | Fan 70mm x 15mm |
| 1 | ```fan(fan80x25)``` | Fan 80mm x 25mm |
| 1 | ```fan(fan80x38)``` | Fan 80mm x 38mm |
| 4 | ```nut(M2_nut, nyloc = true)``` | Nut M2 x 1.6mm nyloc |
| 4 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 8 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 28 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 4 | ```screw(M2_cap_screw, 16)``` | Screw M2 cap x 16mm |
| 4 | ```screw(M2p5_pan_screw, 20)``` | Screw M2.5 pan x 20mm |
| 8 | ```screw(M3_dome_screw, 20)``` | Screw M3 dome x 20mm |
| 20 | ```screw(M4_dome_screw, 16)``` | Screw M4 dome x 16mm |
| 4 | ```screw(M4_dome_screw, 25)``` | Screw M4 dome x 25mm |
| 4 | ```screw(M4_dome_screw, 30)``` | Screw M4 dome x 30mm |
| 4 | ```washer(M2p5_washer)``` | Washer M2.5 x 5.9mm x 0.5mm |
| 8 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 28 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
| 8 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
| 8 | ```washer(M2p5_washer)``` | Washer M2.5 x 5.9mm x 0.5mm |
| 12 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 32 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
<a href="#top">Top</a>
@@ -774,7 +823,7 @@ Parametric green terminal blocks
### Modules
| Module | Description |
|:--- |:--- |
| ```green_terminal(type, ways, skip = [])``` | Draw green terminal blocks, skip can be used to remove pins. |
| ```green_terminal(type, ways, skip = [], colour = "lime")``` | Draw green terminal blocks, skip can be used to remove pins. |
| ```terminal_254(ways, skip = [])``` | Draw 0.1" terminal block |
![green_terminals](tests/png/green_terminals.png)
@@ -829,7 +878,7 @@ Needs updating as mostly obsolete versions.
### Modules
| Module | Description |
|:--- |:--- |
| ```hot_end(type, filament, naked = false)``` | Draw specified hot end |
| ```hot_end(type, filament, naked = false, resistor_wire_rotate = [0,0,0])``` | Draw specified hot end |
![hot_ends](tests/png/hot_ends.png)
@@ -943,10 +992,11 @@ IEC mains inlets and outlet.
| 1 | ```iec(IEC_inlet)``` | IEC inlet |
| 1 | ```iec(IEC_inlet_atx)``` | IEC inlet for ATX |
| 1 | ```iec(IEC_outlet)``` | IEC outlet RS 811-7193 |
| 10 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 1 | ```iec(IEC_switched_fused_inlet)``` | IEC320 C14 switched fused inlet module |
| 12 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 4 | ```screw(M3_cs_cap_screw, 10)``` | Screw M3 cs cap x 10mm |
| 6 | ```screw(M3_cs_cap_screw, 12)``` | Screw M3 cs cap x 12mm |
| 10 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 8 | ```screw(M3_cs_cap_screw, 12)``` | Screw M3 cs cap x 12mm |
| 12 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
<a href="#top">Top</a>
@@ -1103,7 +1153,9 @@ Nuts for leadscrews.
| ```leadnut_hole_dia(type)``` | The diameter of the screw holes |
| ```leadnut_hole_pitch(type)``` | The radia pitch of the screw holes |
| ```leadnut_holes(type)``` | The number of screw holes |
| ```leadnut_lead(type)``` | Screw lead |
| ```leadnut_od(type)``` | Outer diameter of the shank |
| ```leadnut_pitch(type)``` | Screw pitch |
| ```leadnut_screw(type)``` | The type of the fixing screws |
### Functions
@@ -1244,6 +1296,9 @@ LMnUU linear bearings.
| Function | Description |
|:--- |:--- |
| ```bearing_dia(type)``` | Outside diameter |
| ```bearing_groove_dia(type)``` | Groove diameter |
| ```bearing_groove_length(type)``` | Groove length |
| ```bearing_groove_spacing(type)``` | Spacing between grooves, outer to outer, ie includes the grooves themselves |
| ```bearing_length(type)``` | Total length |
| ```bearing_rod_dia(type)``` | Internal diameter |
@@ -1262,12 +1317,21 @@ LMnUU linear bearings.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```linear_bearing(LM10LUU)``` | Linear bearing LM10LUU |
| 1 | ```linear_bearing(LM10UU)``` | Linear bearing LM10UU |
| 1 | ```linear_bearing(LM12LUU)``` | Linear bearing LM12LUU |
| 1 | ```linear_bearing(LM12UU)``` | Linear bearing LM12UU |
| 1 | ```linear_bearing(LM16LUU)``` | Linear bearing LM16LUU |
| 1 | ```linear_bearing(LM16UU)``` | Linear bearing LM16UU |
| 1 | ```linear_bearing(LM3LUU)``` | Linear bearing LM3LUU |
| 1 | ```linear_bearing(LM3UU)``` | Linear bearing LM3UU |
| 1 | ```linear_bearing(LM4LUU)``` | Linear bearing LM4LUU |
| 1 | ```linear_bearing(LM4UU)``` | Linear bearing LM4UU |
| 1 | ```linear_bearing(LM5LUU)``` | Linear bearing LM5LUU |
| 1 | ```linear_bearing(LM5UU)``` | Linear bearing LM5UU |
| 1 | ```linear_bearing(LM6LUU)``` | Linear bearing LM6LUU |
| 1 | ```linear_bearing(LM6UU)``` | Linear bearing LM6UU |
| 1 | ```linear_bearing(LM8LUU)``` | Linear bearing LM8LUU |
| 1 | ```linear_bearing(LM8UU)``` | Linear bearing LM8UU |
@@ -1559,11 +1623,16 @@ If a nut is given a child then it gets placed on its top surface.
| 1 | ```nut(M2p5_nut)``` | Nut M2.5 x 2.2mm |
| 1 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 1 | ```nut(M2p5_nut, nylon = true)``` | Nut M2.5 x 2.2mm nylon |
| 1 | ```hammer_nut(M3_hammer_nut)``` | Nut M3 hammer |
| 1 | ```sliding_t_nut(M3_sliding_t_nut)``` | Nut M3 sliding T |
| 1 | ```nut(M3_nut)``` | Nut M3 x 2.4mm |
| 1 | ```nut(M3_nut, brass = true)``` | Nut M3 x 2.4mm brass |
| 1 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 1 | ```hammer_nut(M4_hammer_nut)``` | Nut M4 hammer |
| 1 | ```sliding_t_nut(M4_sliding_t_nut)``` | Nut M4 sliding T |
| 1 | ```nut(M4_nut)``` | Nut M4 x 3.2mm |
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 1 | ```sliding_t_nut(M5_sliding_t_nut)``` | Nut M5 sliding T |
| 1 | ```nut(M5_nut)``` | Nut M5 x 4mm |
| 1 | ```nut(M5_nut, nyloc = true)``` | Nut M5 x 4mm nyloc |
| 1 | ```nut(M6_half_nut)``` | Nut M6 x 3mm |
@@ -1657,6 +1726,13 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
### 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 |
@@ -1675,16 +1751,20 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
### 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(cutout = false)``` | Draw HDMI socket |
| ```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 |
@@ -1694,7 +1774,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| ```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 positions |
| ```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 |
@@ -1716,14 +1796,15 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | ```pcb(DuetE)``` | Duet 2 Ethernet electronics |
| 1 | ```pcb(Duex2)``` | Duex2 expansion board |
| 1 | ```pcb(Duex5)``` | Duex5 expasnion board |
| 1 | ```pcb(EnviroPlus)``` | Enviro+ |
| 1 | ```pcb(ExtruderPCB)``` | Extruder connection PCB |
| 1 | ```pcb(Keyes5p1)``` | Keyes5.1 Arduino Uno expansion board |
| 1 | ```pcb(Melzi)``` | Melzi electronics |
| 3 | | Micro SD card |
| 4 | | Micro SD card |
| 1 | ```molex_254(2)``` | Molex KK header 2 way |
| 1 | ```molex_254(3)``` | Molex KK header 3 way |
| 16 | ```nut(M2_nut, nyloc = true)``` | Nut M2 x 1.6mm nyloc |
| 20 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
| 32 | ```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 |
@@ -1734,20 +1815,25 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | ```pcb(PERF74x51)``` | Perfboard 74 x 51mm |
| 1 | ```pcb(PERF80x20)``` | Perfboard 80 x 20mm |
| 1 | ```pin_socket(2p54header, 13, 2, right_angle = true)``` | Pin socket 13 x 2 right_angle |
| 1 | ```pcb(RAMPSEndstop)``` | RAMPS Endstop Switch |
| 1 | ```pcb(RPI3)``` | Raspberry Pi 3 |
| 8 | ```screw(M2_cap_screw, 20)``` | Screw M2 cap x 20mm |
| 8 | ```screw(M2_cap_screw, 25)``` | Screw M2 cap x 25mm |
| 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 |
| 12 | ```screw(M2p5_pan_screw, 20)``` | Screw M2.5 pan x 20mm |
| 4 | ```screw(M2p5_pan_screw, 30)``` | Screw M2.5 pan x 30mm |
| 4 | ```screw(M3_cap_screw, 25)``` | Screw M3 cap x 25mm |
| 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 |
| 4 | ```screw(M2p5_pan_screw, 35)``` | Screw M2.5 pan x 35mm |
| 8 | ```screw(M3_cap_screw, 30)``` | Screw M3 cap x 30mm |
| 12 | ```screw(M4_cap_screw, 30)``` | Screw M4 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 |
| 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 |
| 16 | ```washer(M2_washer)``` | Washer M2 x 5mm x 0.3mm |
| 20 | ```washer(M2p5_washer)``` | Washer M2.5 x 5.9mm x 0.5mm |
| 32 | ```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 |
@@ -1755,21 +1841,24 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
### Printed
| Qty | Filename |
| ---:|:--- |
| 4 | pcb_spacer20110.stl |
| 4 | pcb_spacer20120.stl |
| 4 | pcb_spacer20130.stl |
| 4 | pcb_spacer20140.stl |
| 4 | pcb_spacer20150.stl |
| 4 | pcb_spacer20160.stl |
| 4 | pcb_spacer25100_2.stl |
| 4 | pcb_spacer25210.stl |
| 4 | pcb_spacer25110_2.stl |
| 4 | pcb_spacer25120_2.stl |
| 4 | pcb_spacer25230.stl |
| 4 | pcb_spacer25240.stl |
| 4 | pcb_spacer2570.stl |
| 4 | pcb_spacer2580_2.stl |
| 4 | pcb_spacer2590_2.stl |
| 4 | pcb_spacer30150.stl |
| 4 | pcb_spacer30160.stl |
| 4 | pcb_spacer30200.stl |
| 4 | pcb_spacer40170.stl |
| 4 | pcb_spacer40180.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_spacer40200.stl |
| 4 | pcb_spacer40210.stl |
<a href="#top">Top</a>
@@ -1850,18 +1939,20 @@ Pin headers and sockets, etc.
|:--- |:--- |
| ```box_header(type, cols = 1, rows = 1, smt = false, cutout = false)``` | Draw box header |
| ```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, cutout = false)``` | Draw pin header |
| ```pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, cutout = false)``` | Draw pin socket |
| ```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_headers](tests/png/pin_headers.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```box_header(2p54header102)``` | Box header 10 x 2 |
| 1 | ```box_header(2p54header, 10, 2)``` | Box header 10 x 2 |
| 1 | ```idc_transition(2p54header, 10)``` | IDC transition header 10 x 2 |
| 1 | ```pin_header(2p54header102)``` | Pin header 10 x 2 |
| 1 | ```pin_header(2p54header, 10, 2)``` | Pin header 10 x 2 |
| 1 | ```pin_header(2p54header, 10, 2, right_angle = true)``` | Pin header 10 x 2 right_angle |
| 1 | ```pin_socket(2p54header, 10, 2)``` | Pin socket 10 x 2 |
| 1 | ```pin_socket(2p54header, 10, 2, right_angle = true)``` | Pin socket 10 x 2 right_angle |
@@ -1936,10 +2027,10 @@ Face order is bottom, top, left, right, front, back.
| 1 | ```psu(PD_150_12)``` | PSU PD-150-12 |
| 1 | ```psu(S_250_48)``` | PSU S-250-48 |
| 1 | ```psu(S_300_12)``` | PSU S-300-12 |
| 4 | ```screw(No632_pan_screw, 8)``` | Screw 6-32 pan x 8mm |
| 4 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 8 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 4 | ```screw(M4_cap_screw, 8)``` | Screw M4 cap x 8mm |
| 4 | ```screw(No632_pan_screw, 8)``` | Screw 6-32 pan x 8mm |
| 4 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 8 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 4 | ```screw(M4_cap_screw, 8)``` | Screw M4 cap x 8mm |
| 12 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 8 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
@@ -2005,10 +2096,10 @@ Timing belt pulleys, both toothed and plain with internal bearings for idlers.
| 1 | ```pulley(GT2x20um_pulley)``` | Pulley GT2UM 20 teeth |
| 1 | ```pulley(T2p5x16_pulley)``` | Pulley T2.5 16 teeth |
| 1 | ```pulley(T5x10_pulley)``` | Pulley T5 10 teeth |
| 1 | ```screw(M3_grub_screw, 3)``` | Screw M3 grub x 3mm |
| 2 | ```screw(M3_grub_screw, 4)``` | Screw M3 grub x 4mm |
| 4 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
| 1 | ```screw(M4_grub_screw, 6)``` | Screw M4 grub x 6mm |
| 1 | ```screw(M3_grub_screw, 3)``` | Screw M3 grub x 3mm |
| 2 | ```screw(M3_grub_screw, 4)``` | Screw M3 grub x 4mm |
| 4 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
| 1 | ```screw(M4_grub_screw, 6)``` | Screw M4 grub x 6mm |
<a href="#top">Top</a>
@@ -2057,10 +2148,10 @@ Linear rails with carriages.
### Modules
| Module | Description |
|:--- |:--- |
| ```carriage(type, rail)``` | Draw the specified carriage |
| ```carriage(type, rail, end_color = grey20, wiper_color = grey20)``` | Draw the specified carriage |
| ```carriage_hole_positions(type)``` | Position children over screw holes |
| ```rail(type, length)``` | Draw the specified rail |
| ```rail_assembly(type, length, pos)``` | Rail and carriage assembly |
| ```rail_assembly(type, length, pos, carriage_end_color = grey20, carriage_wiper_color = grey20)``` | Rail and carriage assembly |
| ```rail_hole_positions(type, length, first = 0, screws = 100, both_ends = true)``` | Position children over screw holes |
| ```rail_screws(type, length, thickness, screws = 100)``` | Place screws in the rail |
@@ -2107,6 +2198,7 @@ Ring terminals and earth assemblies for DiBond panels.
### Properties
| Function | Description |
|:--- |:--- |
| ```ringterm_crimp_length(type)``` | If non-zero the length of the crimp tube |
| ```ringterm_hole(type)``` | Wire hole diameter |
| ```ringterm_id(type)``` | Inside diameter |
| ```ringterm_length(type)``` | Length of the tail including the ring |
@@ -2132,12 +2224,13 @@ Ring terminals and earth assemblies for DiBond panels.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 2 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 3 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 1 | ```ring_terminal(M3_ringterm)``` | Ring terminal 3mm |
| 1 | ```ring_terminal(M3_ringterm_cs)``` | Ring terminal 3mm |
| 1 | ```ring_terminal(M3_ringterm_crimp)``` | Ring terminal crimp 3mm |
| 1 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
| 1 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
| 4 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
| 2 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
| 6 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
<a href="#top">Top</a>
@@ -2145,7 +2238,7 @@ Ring terminals and earth assemblies for DiBond panels.
---
<a name="Rockers"></a>
## Rockers
Rocket switch. Also used for neon indicator in the same form factor.
Rocker switch. Also used for neon indicator in the same form factor.
[vitamins/rockers.scad](vitamins/rockers.scad) Object definitions.
@@ -2166,7 +2259,7 @@ Rocket switch. Also used for neon indicator in the same form factor.
| ```rocker_height(type)``` | Body height |
| ```rocker_part(type)``` | Part description |
| ```rocker_pivot(type)``` | Pivot distance from the back of the flange |
| ```rocker_slot_h(type)``` | Panel slow height |
| ```rocker_slot_h(type)``` | Panel slot height |
| ```rocker_slot_w(type)``` | Panel slot width |
| ```rocker_spades(type)``` | Spade types and positions |
| ```rocker_width(type)``` | Body width |
@@ -2174,7 +2267,7 @@ Rocket switch. Also used for neon indicator in the same form factor.
### Modules
| Module | Description |
|:--- |:--- |
| ```rocker(type)``` | Draw the specified rocker switch |
| ```rocker(type, colour)``` | Draw the specified rocker switch |
| ```rocker_hole(type, h = 0)``` | Make a hole to accept a rocker switch, by default 2D, set h for 3D |
![rockers](tests/png/rockers.png)
@@ -2182,8 +2275,8 @@ Rocket switch. Also used for neon indicator in the same form factor.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```rocker(neon_indicator)``` | Neon Indicator H8630FBNAL |
| 1 | ```rocker(small_rocker)``` | Rocker Switch PRASA1-16F-BB0BW |
| 2 | ```rocker(neon_indicator)``` | Neon Indicator H8630FBNAL |
| 2 | ```rocker(small_rocker)``` | Rocker Switch PRASA1-16F-BB0BW |
<a href="#top">Top</a>
@@ -2201,16 +2294,23 @@ Steel rods and studding with chamfered ends.
### Modules
| Module | Description |
|:--- |:--- |
| ```rod(d , l)``` | Draw a smooth rod with specified length and diameter |
| ```studding(d , l)``` | Draw a threaded rod with specified length and diameter |
| ```leadscrew(d , l, lead, starts, center = true)``` | Draw a leadscrew with specified diameter, length, lead and number of starts |
| ```rod(d , l, center = true)``` | Draw a smooth rod with specified diameter and length |
| ```studding(d , l, center = true)``` | Draw a threaded rod with specified diameter and length |
![rod](tests/png/rod.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```leadscrew(10, 80, 8, 4)``` | Leadscrew 10 x 80mm, 8mm lead, 4 starts |
| 1 | ```leadscrew(12, 80, 12, 4)``` | Leadscrew 12 x 80mm, 12mm lead, 4 starts |
| 1 | ```leadscrew(16, 80, 16, 4)``` | Leadscrew 16 x 80mm, 16mm lead, 4 starts |
| 1 | ```leadscrew(6, 80, 2, 1)``` | Leadscrew 6 x 80mm, 2mm lead, 1 starts |
| 1 | ```leadscrew(8, 80, 8, 4)``` | Leadscrew 8 x 80mm, 8mm lead, 4 starts |
| 1 | ```rod(10, 80)``` | Smooth rod 10mm x 80mm |
| 1 | ```rod(12, 80)``` | Smooth rod 12mm x 80mm |
| 1 | ```rod(16, 80)``` | Smooth rod 16mm x 80mm |
| 1 | ```rod(3, 80)``` | Smooth rod 3mm x 80mm |
| 1 | ```rod(4, 80)``` | Smooth rod 4mm x 80mm |
| 1 | ```rod(5, 80)``` | Smooth rod 5mm x 80mm |
@@ -2218,6 +2318,7 @@ Steel rods and studding with chamfered ends.
| 1 | ```rod(8, 80)``` | Smooth rod 8mm x 80mm |
| 1 | ```studding(10, 80)``` | Threaded rod M10 x 80mm |
| 1 | ```studding(12, 80)``` | Threaded rod M12 x 80mm |
| 1 | ```studding(16, 80)``` | Threaded rod M16 x 80mm |
| 1 | ```studding(3, 80)``` | Threaded rod M3 x 80mm |
| 1 | ```studding(4, 80)``` | Threaded rod M4 x 80mm |
| 1 | ```studding(5, 80)``` | Threaded rod M5 x 80mm |
@@ -2276,21 +2377,21 @@ Machine screws and wood screws with various head styles.
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```screw(No632_pan_screw, 30)``` | Screw 6-32 pan x 30mm |
| 1 | ```screw(M2_cap_screw, 25)``` | Screw M2 cap x 25mm |
| 1 | ```screw(M2_cs_cap_screw, 25)``` | Screw M2 cs cap x 25mm |
| 1 | ```screw(M2p5_cap_screw, 25)``` | Screw M2.5 cap x 25mm |
| 1 | ```screw(M2p5_pan_screw, 30)``` | Screw M2.5 pan x 30mm |
| 1 | ```screw(M3_cap_screw, 25)``` | Screw M3 cap x 25mm |
| 1 | ```screw(M3_cs_cap_screw, 25)``` | Screw M3 cs cap x 25mm |
| 1 | ```screw(M3_dome_screw, 25)``` | Screw M3 dome x 25mm |
| 1 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
| 1 | ```screw(M3_hex_screw, 30)``` | Screw M3 hex x 30mm |
| 1 | ```screw(M3_low_cap_screw, 25)``` | Screw M3 low cap x 25mm |
| 1 | ```screw(M3_pan_screw, 30)``` | Screw M3 pan x 30mm |
| 1 | ```screw(M2_cap_screw, 10)``` | Screw M2 cap x 10mm |
| 1 | ```screw(M2_cs_cap_screw, 10)``` | Screw M2 cs cap x 10mm |
| 1 | ```screw(M2p5_cap_screw, 10)``` | Screw M2.5 cap x 10mm |
| 1 | ```screw(M2p5_pan_screw, 10)``` | Screw M2.5 pan x 10mm |
| 1 | ```screw(M3_cap_screw, 10)``` | Screw M3 cap x 10mm |
| 1 | ```screw(M3_cs_cap_screw, 10)``` | Screw M3 cs cap x 10mm |
| 1 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
| 1 | ```screw(M3_grub_screw, 6)``` | Screw M3 grub x 6mm |
| 1 | ```screw(M3_hex_screw, 10)``` | Screw M3 hex x 10mm |
| 1 | ```screw(M3_low_cap_screw, 10)``` | Screw M3 low cap x 10mm |
| 1 | ```screw(M3_pan_screw, 10)``` | Screw M3 pan x 10mm |
| 1 | ```screw(M4_cap_screw, 25)``` | Screw M4 cap x 25mm |
| 1 | ```screw(M4_cs_cap_screw, 25)``` | Screw M4 cs cap x 25mm |
| 1 | ```screw(M4_dome_screw, 25)``` | Screw M4 dome x 25mm |
| 1 | ```screw(M4_grub_screw, 6)``` | Screw M4 grub x 6mm |
| 1 | ```screw(M4_grub_screw, 6)``` | Screw M4 grub x 6mm |
| 1 | ```screw(M4_hex_screw, 30)``` | Screw M4 hex x 30mm |
| 1 | ```screw(M4_pan_screw, 30)``` | Screw M4 pan x 30mm |
| 1 | ```screw(M5_cap_screw, 30)``` | Screw M5 cap x 30mm |
@@ -2301,12 +2402,70 @@ Machine screws and wood screws with various head styles.
| 1 | ```screw(M6_pan_screw, 30)``` | Screw M6 pan x 30mm |
| 1 | ```screw(M8_cap_screw, 35)``` | Screw M8 cap x 35mm |
| 1 | ```screw(M8_hex_screw, 30)``` | Screw M8 hex x 30mm |
| 1 | ```screw(No2_screw, 30)``` | Screw No2 pan wood x 30mm |
| 1 | ```screw(No4_screw, 30)``` | Screw No4 pan wood x 30mm |
| 1 | ```screw(No2_screw, 10)``` | Screw No2 pan wood x 10mm |
| 1 | ```screw(No4_screw, 10)``` | Screw No4 pan wood x 10mm |
| 1 | ```screw(No6_cs_screw, 30)``` | Screw No6 cs wood x 30mm |
| 1 | ```screw(No6_screw, 30)``` | Screw No6 pan wood x 30mm |
<a href="#top">Top</a>
---
<a name="Scs_bearing_blocks"></a>
## Scs_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.
[tests/scs_bearing_blocks.scad](tests/scs_bearing_blocks.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```scs_bearing(type)``` | Linear bearing used |
| ```scs_block_center_height(type)``` | Height of the center of the block |
| ```scs_block_side_height(type)``` | Height of the side of the block, this determines the minimum screw length |
| ```scs_hole_offset(type)``` | Offset of bearing hole from base of block |
| ```scs_screw(type)``` | Screw type |
| ```scs_screw_separation_x(type)``` | Screw separation in X direction |
| ```scs_screw_separation_z(type)``` | Screw separation in Z direction |
### Functions
| Function | Description |
|:--- |:--- |
| ```scs_size(type)``` | Size of scs bracket bounding block |
### Modules
| Module | Description |
|:--- |:--- |
| ```scs_bearing_block(type)``` | Draw the specified SCS bearing block |
| ```scs_bearing_block_assembly(type, part_thickness, screw_type, nut_type)``` | Assembly with screws and nuts in place |
| ```scs_bearing_block_hole_positions(type)``` | Place children at hole positions |
![scs_bearing_blocks](tests/png/scs_bearing_blocks.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 12 | ```nut(M4_nut)``` | Nut M4 x 3.2mm |
| 24 | ```nut(M5_nut)``` | Nut M5 x 4mm |
| 1 | ```scs_bearing_block(SCS10LUU)``` | SCS10LUU bearing block |
| 1 | ```scs_bearing_block(SCS10UU)``` | SCS10UU bearing block |
| 1 | ```scs_bearing_block(SCS12LUU)``` | SCS12LUU bearing block |
| 1 | ```scs_bearing_block(SCS12UU)``` | SCS12UU bearing block |
| 1 | ```scs_bearing_block(SCS16LUU)``` | SCS16LUU bearing block |
| 1 | ```scs_bearing_block(SCS16UU)``` | SCS16UU bearing block |
| 1 | ```scs_bearing_block(SCS6UU)``` | SCS6UU bearing block |
| 1 | ```scs_bearing_block(SCS8LUU)``` | SCS8LUU bearing block |
| 1 | ```scs_bearing_block(SCS8UU)``` | SCS8UU bearing block |
| 4 | ```screw(M4_cap_screw, 25)``` | Screw M4 cap x 25mm |
| 8 | ```screw(M4_cap_screw, 30)``` | Screw M4 cap x 30mm |
| 16 | ```screw(M5_cap_screw, 35)``` | Screw M5 cap x 35mm |
| 8 | ```screw(M5_cap_screw, 45)``` | Screw M5 cap x 45mm |
| 12 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
| 24 | ```washer(M5_washer)``` | Washer M5 x 10mm x 1mm |
<a href="#top">Top</a>
---
@@ -2396,6 +2555,54 @@ Note that modules that drill holes will return a 2D object if ```h``` is set to
| 1 | ```sheet(Steel06, 30, 30, 2)``` | Sheet mild steel 30mm x 30mm x 0.6mm |
<a href="#top">Top</a>
---
<a name="Sk_brackets"></a>
## Sk_brackets
SK shaft support brackets
[vitamins/sk_brackets.scad](vitamins/sk_brackets.scad) Object definitions.
[vitamins/sk_bracket.scad](vitamins/sk_bracket.scad) Implementation.
[tests/sk_brackets.scad](tests/sk_brackets.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| ```sk_base_height(type)``` | Height of base containing the screws |
| ```sk_diameter(type)``` | Rod hole diameter |
| ```sk_hole_offset(type)``` | Rod hole offset |
| ```sk_screw_separation(type)``` | Separation of screws in the base |
### Functions
| Function | Description |
|:--- |:--- |
| ```sk_size(type)``` | Size of bracket |
### Modules
| Module | Description |
|:--- |:--- |
| ```sk_bracket(type)``` | SK shaft support bracket |
| ```sk_bracket_assembly(type, screw_length = 16, screw_type = M5_cap_screw, nut_type = undef)``` | Assembly with fasteners in place |
![sk_brackets](tests/png/sk_brackets.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | ```sliding_t_nut(M5_sliding_t_nut)``` | Nut M5 sliding T |
| 4 | ```nut(M5_nut)``` | Nut M5 x 4mm |
| 1 | ```sk_bracket(SK10)``` | SK10 shaft support bracket |
| 1 | ```sk_bracket(SK12)``` | SK12 shaft support bracket |
| 1 | ```sk_bracket(SK16)``` | SK16 shaft support bracket |
| 1 | ```sk_bracket(SK8)``` | SK8 shaft support bracket |
| 8 | ```screw(M5_cap_screw, 16)``` | Screw M5 cap x 16mm |
| 12 | ```washer(M5_washer)``` | Washer M5 x 10mm x 1mm |
<a href="#top">Top</a>
---
@@ -2462,7 +2669,7 @@ Filament spool models
### Modules
| Module | Description |
|:--- |:--- |
| ```spool(type)``` | Draw specified spool |
| ```spool(type, filament_depth = 0, filament_colour = "white", filament_d = 3)``` | Draw specified spool with optional filament |
![spools](tests/png/spools.png)
@@ -2470,6 +2677,7 @@ Filament spool models
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | ```spool(spool_200x55)``` | Filament spool 200 x 55 |
| 1 | ```spool(spool_200x60)``` | Filament spool 200 x 60 |
| 1 | ```spool(spool_300x85)``` | Filament spool 300 x 85 |
| 1 | ```spool(spool_300x88)``` | Filament spool 300 x 88 |
@@ -2589,7 +2797,7 @@ NEMA stepper motor model.
| ```NEMA_length(type)``` | Body length |
| ```NEMA_radius(type)``` | End cap radius |
| ```NEMA_shaft_dia(type)``` | Shaft diameter |
| ```NEMA_shaft_length(type)``` | Shaft length above the face |
| ```NEMA_shaft_length(type)``` | Shaft length above the face, if a list then a leadscrew: length, lead, starts |
| ```NEMA_width(type)``` | Width of the square face |
### Functions
@@ -2601,7 +2809,7 @@ NEMA stepper motor model.
### Modules
| Module | Description |
|:--- |:--- |
| ```NEMA(type)``` | Draw specified NEMA stepper motor |
| ```NEMA(type, shaft_angle = 0)``` | Draw specified NEMA stepper motor |
| ```NEMA_outline(type)``` | 2D outline |
| ```NEMA_screw_positions(type, n = 4)``` | Positions children at the screw holes |
| ```NEMA_screws(type, screw, n = 4, screw_length = 8, earth = undef)``` | Place screws and optional earth tag |
@@ -2611,7 +2819,7 @@ NEMA stepper motor model.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 24 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 24 | ```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 |
@@ -3229,6 +3437,12 @@ Uses [fixing blocks](#fixing_block) and [corner blocks](#corner_block).
| ```bbox_width(type)``` | Internal width |
| ```star_washers(type)``` | Set to false to remove star washers. |
### Functions
| Function | Description |
|:--- |:--- |
| ```bbox_area(type)``` | Internal surdface area in m^2 |
| ```bbox_volume(type)``` | Internal volume in litres |
### Modules
| Module | Description |
|:--- |:--- |
@@ -3238,7 +3452,7 @@ Uses [fixing blocks](#fixing_block) and [corner blocks](#corner_block).
| ```bbox_base(type)``` | Default base, can be overridden to customise |
| ```bbox_base_blank(type)``` | 2D template for the base |
| ```bbox_front(type)``` | Default front, can be overridden to customise |
| ```bbox_front_blank(type, sheet = false)``` | 2D template for the front |
| ```bbox_front_blank(type, sheet = false, width = 0)``` | 2D template for the front |
| ```bbox_left(type)``` | Default left side, can be overridden to customise |
| ```bbox_left_blank(type, sheet = false)``` | 2D template for the left side |
| ```bbox_right(type)``` | Default right side, can be overridden to customise |
@@ -3399,7 +3613,7 @@ Star washers can be omitted by setting ```star_washers``` to false.
| 3 | ```insert(F1BM2p5)``` | Heatfit insert M2.5 |
| 3 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 3 | ```insert(F1BM4)``` | Heatfit insert M4 |
| 3 | ```screw(M2_cap_screw, 8)``` | Screw M2 cap x 8mm |
| 3 | ```screw(M2_cap_screw, 8)``` | Screw M2 cap x 8mm |
| 3 | ```screw(M2p5_pan_screw, 10)``` | Screw M2.5 pan x 10mm |
| 3 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
| 3 | ```screw(M4_dome_screw, 12)``` | Screw M4 dome x 12mm |
@@ -3556,6 +3770,7 @@ The ring spacing as well as the number of spokes can be specified, if zero a gas
| Qty | Filename |
| ---:|:--- |
| 1 | fan_guard_120.stl |
| 1 | fan_guard_17.stl |
| 1 | fan_guard_25.stl |
| 1 | fan_guard_30.stl |
| 1 | fan_guard_40.stl |
@@ -3618,7 +3833,7 @@ Star washers can be omitted by setting ```star_washers``` to false.
| 3 | ```insert(F1BM2p5)``` | Heatfit insert M2.5 |
| 3 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 3 | ```insert(F1BM4)``` | Heatfit insert M4 |
| 3 | ```screw(M2_cap_screw, 8)``` | Screw M2 cap x 8mm |
| 3 | ```screw(M2_cap_screw, 8)``` | Screw M2 cap x 8mm |
| 3 | ```screw(M2p5_pan_screw, 10)``` | Screw M2.5 pan x 10mm |
| 3 | ```screw(M3_dome_screw, 10)``` | Screw M3 dome x 10mm |
| 3 | ```screw(M4_dome_screw, 16)``` | Screw M4 dome x 16mm |
@@ -3762,7 +3977,7 @@ inserts don't grip well in rubber.
| ---:|:--- |:---|
| 1 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
| 1 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 1 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 1 | ```screw(M4_cap_screw, 16)``` | Screw M4 cap x 16mm |
| 1 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 2 | ```washer(M4_washer)``` | Washer M4 x 9mm x 0.8mm |
@@ -3830,6 +4045,54 @@ Printed handle that can be printed without needing support material due to its t
| 1 | handle_assembly |
<a href="#top">Top</a>
---
<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.
### Functions
| Function | Description |
|:--- |:--- |
| ```pcb_mount_length(pcb)``` | Outside length of the mount |
| ```pcb_mount_width(pcb)``` | Outside width of the mount |
| ```pillar_x_pitch(pcb)``` | x pitch of screw pillars |
| ```pillar_y_pitch(pcb)``` | y pitch of screw pillars |
### Modules
| Module | Description |
|:--- |:--- |
| ```pcb_mount(pcb, height = 5, washers = true)``` | Make the STL of a pcb mount for the specified PCB. |
| ```pcb_mount_assembly(pcb, thickness, height = 5)``` | A PCB mount assembly with fasteners |
| ```pcb_mount_holes(pcb, h = 0)``` | Drill holes for PCB mount |
| ```pcb_mount_screw_positions(pcb)``` | Positions of the screws and pillars |
| ```pcb_mount_washer_stl()``` | A plastic washer to clamp a PCB |
![pcb_mount](tests/png/pcb_mount.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
| 1 | ```pcb(PI_IO)``` | PI_IO V2 |
| 1 | ```pin_socket(2p54header, 13, 2)``` | Pin socket 13 x 2 |
| 4 | ```screw(M3_cap_screw, 16)``` | Screw M3 cap x 16mm |
| 3 | ```terminal_35(2)``` | Terminal block 2 way 3.5mm |
| 4 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
### Printed
| Qty | Filename |
| ---:|:--- |
| 1 | pcb_mount_PI_IO_5.stl |
<a href="#top">Top</a>
---
@@ -3955,7 +4218,7 @@ Knob with embedded hex head screw.
### Modules
| Module | Description |
|:--- |:--- |
| ```screw_knob(screw)``` | Generate the STL foe a knob to fit the specified hex screw |
| ```screw_knob(screw)``` | Generate the STL for a knob to fit the specified hex screw |
| ```screw_knob_assembly(screw, length)``` | Assembly with the screw in place |
![screw_knob](tests/png/screw_knob.png)
@@ -4129,7 +4392,7 @@ be fully customised by passing a list of properties.
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 2 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 2 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 2 | ```screw(M3_pan_screw, 8)``` | Screw M3 pan x 8mm |
| 2 | ```washer(M3_penny_washer)``` | Washer penny M3 x 12mm x 0.8mm |
| 2 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |
@@ -4283,7 +4546,7 @@ Layout objects in a line with equal gaps given a vector of their widths.
---
<a name="Maths"></a>
## Maths
Maths utilities for minapulating vectors and matrices.
Maths utilities for manipulating vectors and matrices.
[utils/maths.scad](utils/maths.scad) Implementation.
@@ -4293,6 +4556,8 @@ Maths utilities for minapulating vectors and matrices.
### Functions
| Function | Description |
|:--- |:--- |
| ```angle_between(v1, v2)``` | Return the angle between two vectors |
| ```euler(R)``` | Convert a rotation matrix to a Euler rotation vector. |
| ```identity(n, x = 1)``` | Construct an arbitrary size identity matrix |
| ```reverse(v)``` | Reverse a vector |
| ```rotate(a, v)``` | Generate a 4x4 rotation matrix, ```a``` can be a vector of three angles or a single angle around ```z```, or around axis ```v``` |
@@ -4303,6 +4568,7 @@ Maths utilities for minapulating vectors and matrices.
| ```transpose(m)``` | Transpose an arbitrary size matrix |
| ```unit(v)``` | Convert ```v``` to a unit vector |
| ```vec3(v)``` | Return a 3 vector with the first three elements of ```v``` |
| ```vec4(v)``` | Return a 4 vector with the first three elements of ```v``` |
![maths](tests/png/maths.png)
@@ -4469,9 +4735,12 @@ An additional twist around the path can be specified. If the path is closed this
| ```after(path1, path2)``` | Translate ```path2``` so its start meets the end of ```path1``` and then concatenate |
| ```arc_points(r, a = [90, 0, 180], al = 90)``` | Generate the points of a circular arc |
| ```before(path1, path2)``` | Translate ```path1``` so its end meets the start of ```path2``` and then concatenate |
| ```circle_points(r = 1, z = 0)``` | Generate the points of a circle, setting z makes a single turn spiral |
| ```cap(facets, segment = 0, end)``` | Create the mesh for an end cap |
| ```circle_points(r = 1, z = 0, dir = -1)``` | Generate the points of a circle, setting z makes a single turn spiral |
| ```helical_twist_per_segment(r, pitch, sides)``` | Calculate the twist around Z that rotate_from_to() introduces |
| ```path_length(path, i = 0, length = 0)``` | Calculated the length along a path |
| ```rectangle_points(w, h)``` | Generate the points of a rectangle |
| ```skin_faces(points, npoints, facets, loop, offset = 0)``` | Create the mesh for the swept volume without end caps |
| ```sweep(path, profile, loop = false, twist = 0)``` | Generate the point list and face list of the swept volume |
### Modules
@@ -4482,6 +4751,50 @@ An additional twist around the path can be specified. If the path is closed this
![sweep](tests/png/sweep.png)
<a href="#top">Top</a>
---
<a name="Thread"></a>
## Thread
Utilities for making threads with sweep. They can be used to model screws, nuts, studding, leadscrews, etc, and also to make printed threads.
The ends can be tapered, flat or chamfered by setting the ```top``` and ```bot``` parameters to -1 for tapered, 0 for a flat cut and positive to
specify a chamfer angle.
Threads are by default solid, so the male version is wrapped around a cylinder and the female inside a tube. This can be suppressed to just get the helix, for
example to make a printed pot with a screw top lid.
Threads with a typical 60 degree angle appear too bright with OpenSCAD's primitive lighting model as they face towards the lights more than the top and sides of
a cylinder. To get around this a colour can be passed to thread that is used to colour the cylinder and then toned down to colour the helix.
Making the ends requires a CGAL intersection, which make threads relatively slow. For this reason they are generally disabled when using the GUI but can
be enabled by setting ```$show_threads``` to ```true```. When the tests are run, by default, threads are enabled only for things that feature them like screws.
This behaviour can be changed by setting a ```SHOW_THREADS``` environment variable to ```false``` to disable all threads and ```true``` to enable all threads.
The same variable also affects the generation of assembly diagrams.
Threads obey the $fn, $fa, $fs variables.
[utils/thread.scad](utils/thread.scad) Implementation.
[tests/thread.scad](tests/thread.scad) Code for this example.
### Functions
| Function | Description |
|:--- |:--- |
| ```metric_coarse_pitch(d)``` | Convert metric diameter to pitch |
| ```thread_profile(h, crest, angle, overlap = 0.1)``` | Create thread profile path |
### Modules
| Module | Description |
|:--- |:--- |
| ```female_metric_thread(d, pitch, length, center = true, top = -1, bot = -1, colour = undef)``` | Create female thread with metric profile |
| ```male_metric_thread(d, pitch, length, center = true, top = -1, bot = -1, solid = true, colour = undef)``` | Create male thread with metric profile |
| ```thread(dia, pitch, length, profile, center = true, top = -1, bot = -1, starts = 1, solid = true, female = false, colour = undef)``` | Create male or femail thread, ends can be tapered, chamfered or square |
![thread](tests/png/thread.png)
<a href="#top">Top</a>
---
@@ -4551,7 +4864,7 @@ heirachical BOMs are also generated for real projects.
| ---:|:--- |:---|
| 1 | ```insert(F1BM3)``` | Heatfit insert M3 |
| 1 | ```widget(3)``` | Rivit like thing for 3mm sheets |
| 1 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 1 | ```screw(M3_cap_screw, 8)``` | Screw M3 cap x 8mm |
| 1 | ```sheet(PMMA3, 20, 20, 1)``` | Sheet acrylic 20mm x 20mm x 3mm |
| 1 | ```washer(M3_washer)``` | Washer M3 x 7mm x 0.5mm |
| 1 | ```star_washer(M3_washer)``` | Washer star M3 x 0.5mm |

0
scripts/bom.py Normal file → Executable file
View File

0
scripts/doc_scripts.py Normal file → Executable file
View File

0
scripts/dxfs.py Normal file → Executable file
View File

0
scripts/gallery.py Normal file → Executable file
View File

0
scripts/make_all.py Normal file → Executable file
View File

View File

@@ -24,7 +24,7 @@ from __future__ import print_function
import subprocess, sys
def _run(args, silent):
def run_list(args, silent = False):
cmd = ["openscad"] + args
if not silent:
for arg in cmd:
@@ -39,7 +39,7 @@ def _run(args, silent):
sys.exit(rc)
def run(*args):
_run(list(args), False)
run_list(list(args), False)
def run_silent(*args):
_run(list(args), True);
run_list(list(args), True);

49
scripts/options.py Normal file
View File

@@ -0,0 +1,49 @@
#
# 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/>.
#
# Set command line options from enviroment variables and check if they have changed
import json, os, deps
def check_options(dir = '.'):
global options, options_mtime
options = { "show_threads": str(os.getenv("SHOW_THREADS")) }
options_fname = dir + '/options.json'
try:
with open(options_fname) as json_file:
last_options = json.load(json_file)
except:
last_options = {}
if last_options != options:
with open(options_fname, 'w') as outfile:
json.dump(options, outfile, indent = 4)
options_mtime = deps.mtime(options_fname)
def have_changed(changed, target):
if not changed and deps.mtime(target) < options_mtime:
return "command line options changed"
return changed
def list():
result = []
for name in options.keys():
value = options[name]
if value != 'None':
result.append('-D$' + name + '=' + value)
return result

0
scripts/render.py Normal file → Executable file
View File

0
scripts/set_config.py Normal file → Executable file
View File

0
scripts/stls.py Normal file → Executable file
View File

5
scripts/tests.py Normal file → Executable file
View File

@@ -27,6 +27,7 @@ import openscad
import subprocess
import bom
import times
import options
import time
import json
import shutil
@@ -96,6 +97,7 @@ def tests(tests):
index = {}
bodies = {}
times.read_times()
options.check_options(deps_dir)
#
# Make cover pic if does not exist as very slow. Delete it to force an update.
#
@@ -190,11 +192,12 @@ def tests(tests):
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 = options.have_changed(changed, oldest)
if changed:
print(changed)
t = time.time()
tmp_name = 'tmp.png'
openscad.run("-D", "$bom=2", colour_scheme, "--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,70,0,315,500", "--autocenter", "--viewall", "-d", dname, "-o", tmp_name, scad_name);
openscad.run_list(options.list() + ["-D$bom=2", colour_scheme, "--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,70,0,315,500", "--autocenter", "--viewall", "-d", dname, "-o", tmp_name, scad_name]);
times.add_time(scad_name, t)
do_cmd(["magick", tmp_name, "-trim", "-resize", "1000x600", "-bordercolor", background, "-border", "10", tmp_name])
update_image(tmp_name, png_name)

7
scripts/views.py Normal file → Executable file
View File

@@ -28,6 +28,7 @@ import openscad
from tests import do_cmd, update_image, colour_scheme, background
import time
import times
import options
from deps import *
import os
import json
@@ -102,6 +103,7 @@ def views(target, do_assemblies = None):
os.makedirs(deps_dir)
times.read_times(target_dir)
options.check_options(deps_dir)
bounds_fname = top_dir + 'stls/bounds.json'
with open(bounds_fname) as json_file:
bounds_map = json.load(json_file)
@@ -154,7 +156,7 @@ def views(target, do_assemblies = None):
f.write("use <%s/%s>\n" % (dir, filename))
f.write("%s();\n" % module);
#
# Run openscad on th created file
# Run openscad on the created file
#
dname = deps_name(deps_dir, filename)
for explode in [0, 1]:
@@ -163,11 +165,12 @@ def views(target, do_assemblies = None):
png_name = png_name.replace('_assembly', '_assembled')
changed = check_deps(png_name, dname)
changed = times.check_have_time(changed, png_name)
changed = options.have_changed(changed, png_name)
tmp_name = 'tmp.png'
if changed:
print(changed)
t = time.time()
openscad.run("-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", "--imgsize=4096,4096", "--autocenter", "--viewall", "-d", dname, "-o", tmp_name, png_maker_name);
openscad.run_list(options.list() + ["-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", "--imgsize=4096,4096", "--autocenter", "--viewall", "-d", dname, "-o", tmp_name, png_maker_name]);
times.add_time(png_name, t)
do_cmd(["magick", tmp_name, "-trim", "-resize", "1004x1004", "-bordercolor", background, "-border", "10", tmp_name])
update_image(tmp_name, png_name)

View File

@@ -67,7 +67,7 @@ module belt_test() {
translate([-25, 0])
layout([for(b = belts) belt_width(b)], 10)
rotate([0, 90, 0])
belt(belts[$i], [[0, 0, 20], [0, 1, 20]]);
belt(belts[$i], [[0, 0, 20], [0, 1, 20]], belt_colour = $i%2==0 ? grey90 : grey20, tooth_colour = $i%2==0 ? grey70 : grey50);
}
if($preview)

View File

@@ -35,4 +35,5 @@ module d_connectors()
}
if($preview)
d_connectors();
let($show_threads = true)
d_connectors();

30
tests/extrusions.scad Normal file
View File

@@ -0,0 +1,30 @@
//
// 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 <../utils/layout.scad>
include <../vitamins/extrusions.scad>
module extrusions()
layout([for(e = extrusions) extrusion_width(e)], 10)
extrusion(extrusions[$i], 80);
if ($preview)
extrusions();

22
tests/hygrometer.scad Normal file
View File

@@ -0,0 +1,22 @@
//
// NopSCADlib Copyright Chris Palmer 2018
// 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/>.
//
use <../vitamins/hygrometer.scad>
if($preview)
hygrometer();

View File

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

View File

@@ -27,4 +27,5 @@ module leadnuts()
leadnut(leadnuts[$i]);
if($preview)
leadnuts();
let($show_threads = true)
leadnuts();

View File

@@ -22,8 +22,12 @@ use <../utils/layout.scad>
include <../vitamins/linear_bearings.scad>
module linear_bearings()
layout([for(b = linear_bearings) 2 * bearing_radius(b)])
layout([for(b = linear_bearings) 2 * bearing_radius(b)]) {
linear_bearing(linear_bearings[$i]);
translate([0, 30])
linear_bearing(long_linear_bearings[$i]);
}
if($preview)
linear_bearings();

View File

@@ -56,7 +56,7 @@ module maths() {
//
z = [0, 0, 1];
v = cross(u, z);
a = acos(u * z);
a = angle_between(u, z);
l = 20;
@@ -64,6 +64,11 @@ module maths() {
translate_z(l)
vflip()
arrow(l);
//
// Test Euler
//
assert(euler(rotate(r)) == r, "euler() failed");
}
rotate(45)

View File

@@ -22,13 +22,12 @@ use <../utils/layout.scad>
include <../vitamins/screws.scad>
module nuts() {
for(nyloc = [false, true])
translate([0, nyloc ? 20 : 0])
layout([for(n = nuts) 2 * nut_radius(n)], 5)
nut(nuts[$i], nyloc);
layout([for(n = nuts) 2 * nut_radius(n)], 5) let(n = nuts[$i]) {
for(nyloc = [false, true])
translate([0, nyloc ? 20 : 0])
nut(n, nyloc);
translate([0, 40])
layout([for(n = nuts) 2 * nut_radius(n)], 5) let(n = nuts[$i]) {
translate([0, 40]) {
if(n == M3_nut)
nut(n, brass = true);
@@ -45,7 +44,28 @@ module nuts() {
if(n == M8_nut)
#nut_trap(M8_cap_screw, n, h = 30);
}
translate([0, 60]) {
if(n == M3_nut)
sliding_t_nut(M3_sliding_t_nut);
if(n == M4_nut)
sliding_t_nut(M4_sliding_t_nut);
if(n == M5_nut)
sliding_t_nut(M5_sliding_t_nut);
}
translate([0, 80]) {
if(n == M3_nut)
hammer_nut(M3_hammer_nut);
if(n == M4_nut)
hammer_nut(M4_hammer_nut);
}
}
}
if($preview)
nuts();
let($show_threads = true)
nuts();

View File

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

35
tests/pcb_mount.scad Normal file
View File

@@ -0,0 +1,35 @@
//
// NopSCADlib Copyright Chris Palmer 2019
// 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 <../printed/pcb_mount.scad>
PI_IO = ["PI_IO", "PI_IO V2", 35.56, 25.4, 1.6, 0, 0, 0, "green", true, [],
[[(3.015 - 2.7) * 25.4 - 3.5 /2, (4.5 - 3.685) * 25.4, 90, "term35", 2],
[(3.46 - 2.7) * 25.4 - 3.5 /2, (4.5 - 3.69) * 25.4, 90, "term35", 2],
[(3.91 - 2.7) * 25.4 - 3.5 /2, (4.5 - 3.69) * 25.4, 90, "term35", 2],
[(3.4 - 2.7) * 25.4, (4.5 - 4.15) * 25.4, 0, "2p54socket", 13, 2],
], []];
module pcb_mounts()
if($preview)
pcb_mount_assembly(PI_IO, 3);
else
pcb_mount(PI_IO);
pcb_mounts();

View File

@@ -26,4 +26,5 @@ module pillars()
pillar(pillars[$i]);
if($preview)
pillars();
let($show_threads = true)
pillars();

View File

@@ -28,15 +28,18 @@ module pin_headers()
idc_transition(pin_headers[$i], 10);
translate([0, 20])
pin_header(pin_headers[$i], 10, 2);
pin_header(pin_headers[$i], 10, 2, right_angle = true);
translate([0, 40])
pin_header(pin_headers[$i], 10, 2);
translate([0, 60])
box_header(pin_headers[$i], 10, 2);
translate([0, 65])
translate([0, 80])
pin_socket(pin_headers[$i], 10, 2);
translate([0, 95])
translate([0, 110])
pin_socket(pin_headers[$i], 10, 2, right_angle = true);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

BIN
tests/png/extrusions.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

BIN
tests/png/hygrometer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 52 KiB

BIN
tests/png/pcb_mount.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
tests/png/sk_brackets.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 92 KiB

BIN
tests/png/thread.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 93 KiB

View File

@@ -34,7 +34,7 @@ module rails()
nut = screw_nut(screw);
washer = screw_washer(screw);
rail_assembly(rail, length, rail_travel(rail, length) / 2);
rail_assembly(rail, length, rail_travel(rail, length) / 2, $i<2 ? grey20 : "green", $i<2 ? grey20 : "red");
rail_screws(rail, length, sheet + nut_thickness(nut, true) + washer_thickness(washer));

View File

@@ -24,7 +24,7 @@ include <../vitamins/ring_terminals.scad>
module ring_terminals()
layout([for(t = ring_terminals) ringterm_od(t)], 5)
rotate(90)
rotate(180)
ring_terminal_assembly(ring_terminals[$i], 3);
if($preview)

View File

@@ -21,9 +21,13 @@ use <../utils/layout.scad>
include <../vitamins/rockers.scad>
module rockers()
layout([for(r = rockers) rocker_flange_w(r)], 5)
module rockers() {
layout([for(r = rockers) rocker_flange_w(r)], 5) {
rocker(rockers[$i]);
translate([0, 25])
rocker(rockers[$i], $i==0 ? "red" : "green");
}
}
if($preview)
rockers();

View File

@@ -24,13 +24,23 @@ include <../vitamins/linear_bearings.scad>
use <../vitamins/rod.scad>
module rods()
layout([for(b = linear_bearings) 2 * bearing_radius(b)]) {
layout([for(b = linear_bearings) 2 * bearing_radius(b)]) let(d = bearing_rod_dia(linear_bearings[$i])){
rod(bearing_rod_dia(linear_bearings[$i]), 80);
rod(d, 80);
translate([0, 20])
studding(bearing_rod_dia(linear_bearings[$i]), 80);
translate([0, 30])
studding(d, 80);
if(d >= 6)
translate([0, 60]) {
starts = d > 6 ? 4 : 1;
pitch = d > 14 ? 4
: d > 10 ? 3 : 2;
let($show_threads = true)
leadscrew(d, 80, starts * pitch, starts);
}
}
if($preview)
rods();
let($show_threads = true)
rods();

View File

@@ -25,13 +25,15 @@ for(y = [0 : len(screw_lists) -1])
for(x = [0 : len(screw_lists[y]) -1]) {
screw = screw_lists[y][x];
if(screw) {
length = screw_max_thread(screw)
? screw_longer_than(screw_max_thread(screw) + 5)
: screw_head_type(screw) == hs_grub ? 6 : 30;
length = screw_head_type(screw) == hs_grub ? 6
: screw_radius(screw) <= 1.5 ? 10
: screw_max_thread(screw) ? screw_longer_than(screw_max_thread(screw) + 5)
: 30;
translate([x * 20, y * 20])
screw(screw, length);
}
}
if($preview)
screws();
let($show_threads = true)
screws();

View File

@@ -0,0 +1,35 @@
//
// 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 <../utils/layout.scad>
include <../vitamins/scs_bearing_blocks.scad>
module scs_bearing_blocks()
layout([for(s = scs_bearing_blocks) 2 * scs_size(s)[0]]) {
part_thickness = 5;
scs_bearing_block_assembly(scs_bearing_blocks[$i], part_thickness);
if($i > 0) // skip $i==0, since no SCS6LUU long variant to match SCS6UU
translate([0, 60])
scs_bearing_block_assembly(scs_bearing_blocks_long[$i - 1], part_thickness);
}
if($preview)
scs_bearing_blocks();

32
tests/sk_brackets.scad Normal file
View File

@@ -0,0 +1,32 @@
//
// NopSCADlib Copyright Chris Palmer 2018
// 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 <../utils/layout.scad>
include <../vitamins/sk_brackets.scad>
module sk_brackets() {
nuts = [undef, M5_nut, M5_sliding_t_nut, M5_sliding_t_nut];
layout([for(s = sk_brackets) 1.5 * sk_size(s)[1]])
sk_bracket_assembly(sk_brackets[$i], nut_type = nuts[$i]);
}
if($preview)
sk_brackets();

View File

@@ -23,9 +23,9 @@ use <../utils/layout.scad>
include <../vitamins/spools.scad>
module spools()
layout([for(s = spools) spool_height(s)], 100)
layout([for(s = spools) spool_height(s)], 100) let(s = spools[$i])
rotate([90, 0, 90])
spool(spools[$i]);
spool(s, filament_depth = spool_depth(s) / 2, filament_colour = [pp1_colour, pp2_colour, pp3_colour, pp4_colour][$i % 4], filament_d = $i ? 3 : 1.75);
if($preview)
spools();

View File

@@ -44,7 +44,7 @@ knot = [ for(i=[0:.2:359])
(19*cos(3*i) + 40)*sin(2*i),
19*sin(3*i) ] ];
sweep(knot, L_points, loop = true, twist = 0);
sweep(knot, L_points, loop = true);
p = transform_points([[0,0,0], [20,0,5], [10,30,4], [0,0,0], [0,0,20]], scale(10));
n = 100;

52
tests/thread.scad Normal file
View File

@@ -0,0 +1,52 @@
//
// 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 <../utils/thread.scad>
pitch = 2;
starts = 4;
profile = thread_profile(pitch / 2, pitch * 0.366, 30);
module threads()
for(female = [false, true]) translate([0, female ? -20 : 0]) {
length = female ? 8 : 40;
dia = female ? 8 : 8 - pitch;
colour = female ? brass : silver;
thread(dia, starts * pitch, length, profile, starts = starts, top = 45, bot = 45, female = female, colour = colour);
color(colour)
translate([20, 0])
thread(dia, starts * pitch, length, profile, starts = starts, top = 0, bot = 0, female = female);
translate([40, 0])
thread(dia, starts * pitch, length, profile, starts = starts, top = -1, bot = -1, female = female, colour = colour);
color(colour)
translate([60, 0])
thread(dia, 2 * pitch, length, profile, starts = 2, top = -1, bot = -1, female = female);
color(colour)
translate([80, 0])
thread(dia, pitch, length, profile, starts = 1, top = -1, bot = -1, female = female);
}
let($show_threads = true)
threads();

View File

@@ -27,4 +27,5 @@ module toggles()
toggle(toggles[$i], 3);
if($preview)
toggles();
let($show_threads = true)
toggles();

View File

@@ -43,7 +43,7 @@ module ellipse(xr, yr) scale([1, yr / xr]) circle4n(xr);
module extrude_if(h, center = true) //! Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D
if(h)
linear_extrude(height = h, center = center) // 3D
linear_extrude(height = h, center = center, convexity = 2) // 3D
children();
else
children(); // 2D

View File

@@ -18,7 +18,7 @@
//
//
//! Maths utilities for minapulating vectors and matrices.
//! Maths utilities for manipulating vectors and matrices.
//
function sqr(x) = x * x;
@@ -39,9 +39,9 @@ function rotate(a, v) = //! Generate a 4x4 rotation matrix, ```a``` can be a vec
sy = sin(av[1]),
sz = sin(av[2]))
[
[ cy * cz, cz * sx * sy - cx * sz, cx * cz * sy + sx * sz, 0],
[ cy * sz, cx * cz + sx * sy * sz,-cz * sx + cx * sy * sz, 0],
[-sy, cy * sx, cx * cy, 0],
[ cy * cz, sx * sy * cz - cx * sz, cx * sy * cz + sx * sz, 0],
[ cy * sz, sx * sy * sz + cx * cz, cx * sy * sz - sx * cz, 0],
[-sy, sx * cy, cx * cy, 0],
[ 0, 0, 0, 1]
]
: let(s = sin(a),
@@ -65,6 +65,7 @@ function scale(v) = let(s = is_list(v) ? v : [v, v, v]) //! Generate a 4x4 matr
];
function vec3(v) = [v.x, v.y, v.z]; //! Return a 3 vector with the first three elements of ```v```
function vec4(v) = [v.x, v.y, v.z, 1]; //! Return a 4 vector with the first three elements of ```v```
function transform(v, m) = vec3(m * [v.x, v.y, v.z, 1]); //! Apply 4x4 transform to a 3 vector by extending it and cropping it again
function transform_points(path, m) = [for(p = path) transform(p, m)]; //! Apply transform to a path
function unit(v) = let(n = norm(v)) n ? v / n : v; //! Convert ```v``` to a unit vector
@@ -74,3 +75,11 @@ function transpose(m) = [ for(j = [0 : len(m[0]) - 1]) [ for(i = [0 : len(m) - 1
function identity(n, x = 1) = [for(i = [0 : n - 1]) [for(j = [0 : n - 1]) i == j ? x : 0] ]; //! Construct an arbitrary size identity matrix
function reverse(v) = let(n = len(v) - 1) n < 0 ? [] : [for(i = [0 : n]) v[n - i]]; //! Reverse a vector
function angle_between(v1, v2) = acos(v1 * v2 / (norm(v1) * norm(v2))); //! Return the angle between two vectors
// https://www.gregslabaugh.net/publications/euler.pdf
function euler(R) = let(ay = asin(-R[2][0]), cy = cos(ay)) //! Convert a rotation matrix to a Euler rotation vector.
cy ? [ atan2(R[2][1] / cy, R[2][2] / cy), ay, atan2(R[1][0] / cy, R[0][0] / cy) ]
: R[2][0] < 0 ? [atan2( R[0][1], R[0][2]), 180, 0]
: [atan2(-R[0][1], -R[0][2]), -180, 0];

Some files were not shown because too many files have changed in this diff Show More