Compare commits
116 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8435a350d0 | ||
|
3e5d4b1c8e | ||
|
20f830a008 | ||
|
10bd8ff354 | ||
|
4459cca3ea | ||
|
95bbebd42d | ||
|
28c795e9f4 | ||
|
9a0477d16b | ||
|
0583da2eb7 | ||
|
9a08fe9b5c | ||
|
8ab7993148 | ||
|
16dd8d6d17 | ||
|
08c268145e | ||
|
ba7e64233a | ||
|
7090c714ce | ||
|
c5038db6d9 | ||
|
654f094304 | ||
|
1e5e5860e1 | ||
|
a08216d0b8 | ||
|
3d8a9ec8aa | ||
|
7ec059142f | ||
|
7f0d96b824 | ||
|
9e826c1a09 | ||
|
2c1dbe04a9 | ||
|
d644d6b698 | ||
|
8db4cc2cb5 | ||
|
509a87939c | ||
|
40607e6cfc | ||
|
599fbba6c2 | ||
|
52729d012c | ||
|
6097e07094 | ||
|
9d71438a3c | ||
|
ffa1ab940b | ||
|
3174013e1a | ||
|
c4eea38a2b | ||
|
0cd89279a5 | ||
|
92051e0b28 | ||
|
f4b22e35c7 | ||
|
17ecfc07f3 | ||
|
9658205efd | ||
|
53140a4cc1 | ||
|
2798d39538 | ||
|
8be0cc98ea | ||
|
6a5f31edd8 | ||
|
e068918e21 | ||
|
1614f50b73 | ||
|
32522b28d7 | ||
|
1936c95d06 | ||
|
16060629c0 | ||
|
b7b5c837bd | ||
|
a793cb6d43 | ||
|
dc4e24b63a | ||
|
8f85ac73dc | ||
|
3ab934d83e | ||
|
d1324a670e | ||
|
f5fdec613c | ||
|
c55b8b6d1c | ||
|
56ec8e03ad | ||
|
728b7adf38 | ||
|
75747687d9 | ||
|
03c97e8b6a | ||
|
8ac06b53e7 | ||
|
de76eb46e7 | ||
|
2c77f184a2 | ||
|
4d3d9dfdfe | ||
|
f7a972f946 | ||
|
4e81fcbd4f | ||
|
1f038decd4 | ||
|
da958fe112 | ||
|
61493eaa34 | ||
|
804c00bdcb | ||
|
11ea68681f | ||
|
d703ae4997 | ||
|
ed97d226f8 | ||
|
4107a2c848 | ||
|
f7ef075434 | ||
|
6f93b6af9a | ||
|
53f416eef1 | ||
|
6354219627 | ||
|
56e2b71bda | ||
|
8f5503586d | ||
|
1cd9edfe87 | ||
|
a85fdaf176 | ||
|
18294b4b81 | ||
|
ad62ce362c | ||
|
9f27f26894 | ||
|
2eaa4bfc21 | ||
|
1944039f22 | ||
|
1c221ad612 | ||
|
85adf7b4f4 | ||
|
64bde2cb3a | ||
|
c34469e852 | ||
|
dbc3c36f44 | ||
|
8c51183ba6 | ||
|
a9c4e60cac | ||
|
d041b18025 | ||
|
e85887fec4 | ||
|
ededb514b8 | ||
|
d0d525b97a | ||
|
371d274906 | ||
|
7118e6eb03 | ||
|
46004381b7 | ||
|
cfdf759a49 | ||
|
aeded1b807 | ||
|
79f1c95136 | ||
|
9bb84593be | ||
|
ab91defcd2 | ||
|
7c1ff5ecd5 | ||
|
6f4859a4b5 | ||
|
e35fb695a2 | ||
|
61bec656d7 | ||
|
3a087be0e9 | ||
|
854adab665 | ||
|
77aa8fe44d | ||
|
6fe4548213 | ||
|
b7654f0384 |
16
.gitattributes
vendored
Normal 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
@@ -7,6 +7,7 @@ tests/bom/
|
|||||||
*.log
|
*.log
|
||||||
*.html
|
*.html
|
||||||
bounds.json
|
bounds.json
|
||||||
|
options.json
|
||||||
times.txt
|
times.txt
|
||||||
*_diff.png
|
*_diff.png
|
||||||
*.echo
|
*.echo
|
||||||
|
BIN
docs/metric_threads.png
Normal file
After Width: | Height: | Size: 17 KiB |
@@ -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,
|
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.
|
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.
|
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.
|
||||||
|
|
||||||
|
BIN
gallery/FilamentDryBox.png
Normal file
After Width: | Height: | Size: 124 KiB |
BIN
gallery/SunBot.png
Normal file
After Width: | Height: | Size: 206 KiB |
@@ -6,6 +6,13 @@ Arduino thermostat to control a beer fridge to use it as an environmental chambe
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
<a name="TOP"></a>
|
||||||
|
## FilamentDryBox
|
||||||
|
A small fan oven with a spool holder to keep the filament warm and dry.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
<a name="TOP"></a>
|
<a name="TOP"></a>
|
||||||
## HydraBot
|
## HydraBot
|
||||||
Current state of HydraRaptor after being modified for laser engraving.
|
Current state of HydraRaptor after being modified for laser engraving.
|
||||||
@@ -68,6 +75,13 @@ Mains isolated and variable supply with metering.
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
<a name="TOP"></a>
|
||||||
|
## SunBot
|
||||||
|
A solar tracker to keep solar powerbanks pointing at the sun.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
<a name="TOP"></a>
|
<a name="TOP"></a>
|
||||||
## Turntable
|
## Turntable
|
||||||
WiFi enabled remote control turntable for photography
|
WiFi enabled remote control turntable for photography
|
||||||
|
@@ -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
|
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
|
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_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
|
// 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)
|
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];
|
grey70 = [0.7, 0.7, 0.7];
|
||||||
grey80 = [0.8, 0.8, 0.8];
|
grey80 = [0.8, 0.8, 0.8];
|
||||||
grey90 = [0.9, 0.9, 0.9];
|
grey90 = [0.9, 0.9, 0.9];
|
||||||
brass = "gold";
|
brass = [255/255, 215/255, 0/255];
|
||||||
|
silver = [0.75, 0.75, 0.75];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enums
|
* Enums
|
||||||
|
4
lib.scad
@@ -62,10 +62,13 @@ include <vitamins/spools.scad>
|
|||||||
include <vitamins/mains_sockets.scad>
|
include <vitamins/mains_sockets.scad>
|
||||||
include <vitamins/ldrs.scad>
|
include <vitamins/ldrs.scad>
|
||||||
include <vitamins/geared_steppers.scad>
|
include <vitamins/geared_steppers.scad>
|
||||||
|
include <vitamins/extrusions.scad>
|
||||||
|
include <vitamins/sk_brackets.scad>
|
||||||
|
|
||||||
use <vitamins/jack.scad>
|
use <vitamins/jack.scad>
|
||||||
use <vitamins/meter.scad>
|
use <vitamins/meter.scad>
|
||||||
use <vitamins/fuseholder.scad>
|
use <vitamins/fuseholder.scad>
|
||||||
|
use <vitamins/hygrometer.scad>
|
||||||
|
|
||||||
use <vitamins/opengrab.scad>
|
use <vitamins/opengrab.scad>
|
||||||
use <vitamins/wire.scad>
|
use <vitamins/wire.scad>
|
||||||
@@ -89,3 +92,4 @@ use <utils/layout.scad>
|
|||||||
use <utils/round.scad>
|
use <utils/round.scad>
|
||||||
use <utils/offset.scad>
|
use <utils/offset.scad>
|
||||||
use <utils/sector.scad>
|
use <utils/sector.scad>
|
||||||
|
use <utils/thread.scad>
|
||||||
|
BIN
libtest.png
Before Width: | Height: | Size: 708 KiB After Width: | Height: | Size: 766 KiB |
22
libtest.scad
@@ -32,6 +32,7 @@ use <tests/cable_strips.scad>
|
|||||||
use <tests/components.scad>
|
use <tests/components.scad>
|
||||||
use <tests/d_connectors.scad>
|
use <tests/d_connectors.scad>
|
||||||
use <tests/displays.scad>
|
use <tests/displays.scad>
|
||||||
|
use <tests/extrusions.scad>
|
||||||
use <tests/fans.scad>
|
use <tests/fans.scad>
|
||||||
use <tests/fuseholder.scad>
|
use <tests/fuseholder.scad>
|
||||||
use <tests/geared_steppers.scad>
|
use <tests/geared_steppers.scad>
|
||||||
@@ -91,6 +92,7 @@ use <tests/strap_handle.scad>
|
|||||||
use <tests/ssr_shroud.scad>
|
use <tests/ssr_shroud.scad>
|
||||||
use <tests/psu_shroud.scad>
|
use <tests/psu_shroud.scad>
|
||||||
use <tests/flat_hinge.scad>
|
use <tests/flat_hinge.scad>
|
||||||
|
use <tests/pcb_mount.scad>
|
||||||
|
|
||||||
x5 = 800;
|
x5 = 800;
|
||||||
|
|
||||||
@@ -134,13 +136,13 @@ translate([x5, cable_grommets_y + 250])
|
|||||||
translate([900, 600])
|
translate([900, 600])
|
||||||
box_test();
|
box_test();
|
||||||
|
|
||||||
translate([850, 1170])
|
translate([850, 1260])
|
||||||
bbox_test();
|
bbox_test();
|
||||||
|
|
||||||
x0 = 0;
|
x0 = 0;
|
||||||
inserts_y = 0;
|
inserts_y = 0;
|
||||||
nuts_y = inserts_y + 20;
|
nuts_y = inserts_y + 20;
|
||||||
washers_y = nuts_y + 60;
|
washers_y = nuts_y + 100;
|
||||||
screws_y = washers_y + 120;
|
screws_y = washers_y + 120;
|
||||||
o_rings_y = screws_y + 130;
|
o_rings_y = screws_y + 130;
|
||||||
springs_y = o_rings_y + 20;
|
springs_y = o_rings_y + 20;
|
||||||
@@ -151,7 +153,7 @@ leadnuts_y = pillars_y + 40;
|
|||||||
pulleys_y = leadnuts_y +40;
|
pulleys_y = leadnuts_y +40;
|
||||||
hot_ends_y = pulleys_y + 60;
|
hot_ends_y = pulleys_y + 60;
|
||||||
linear_bearings_y = hot_ends_y + 50;
|
linear_bearings_y = hot_ends_y + 50;
|
||||||
sheets_y = linear_bearings_y + 50;
|
sheets_y = linear_bearings_y + 100;
|
||||||
pcbs_y = sheets_y + 40;
|
pcbs_y = sheets_y + 40;
|
||||||
displays_y = pcbs_y + 150;
|
displays_y = pcbs_y + 150;
|
||||||
fans_y = displays_y + 100;
|
fans_y = displays_y + 100;
|
||||||
@@ -202,6 +204,10 @@ translate([x0, linear_bearings_y]) {
|
|||||||
rods();
|
rods();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
translate([x0+150, linear_bearings_y+30]) {
|
||||||
|
extrusions();
|
||||||
|
}
|
||||||
|
|
||||||
translate([x0 + 10, hot_ends_y])
|
translate([x0 + 10, hot_ends_y])
|
||||||
hot_ends();
|
hot_ends();
|
||||||
|
|
||||||
@@ -248,7 +254,7 @@ buttons_y = spades_y + 40;
|
|||||||
jacks_y = buttons_y + 40;
|
jacks_y = buttons_y + 40;
|
||||||
microswitches_y = jacks_y + 40;
|
microswitches_y = jacks_y + 40;
|
||||||
rockers_y = microswitches_y + 40;
|
rockers_y = microswitches_y + 40;
|
||||||
toggles_y = rockers_y + 40;
|
toggles_y = rockers_y + 60;
|
||||||
components_y = toggles_y + 40;
|
components_y = toggles_y + 40;
|
||||||
|
|
||||||
translate([x2, leds_y])
|
translate([x2, leds_y])
|
||||||
@@ -304,6 +310,9 @@ translate([x3, veroboard_y])
|
|||||||
translate([x3 + 70, veroboard_y + 30])
|
translate([x3 + 70, veroboard_y + 30])
|
||||||
geared_steppers();
|
geared_steppers();
|
||||||
|
|
||||||
|
translate([x3 + 140, veroboard_y + 20])
|
||||||
|
pcb_mounts();
|
||||||
|
|
||||||
translate([x3, d_connectors_y])
|
translate([x3, d_connectors_y])
|
||||||
d_connectors();
|
d_connectors();
|
||||||
|
|
||||||
@@ -313,7 +322,10 @@ translate([x3, iecs_y])
|
|||||||
translate([x3 + 15, modules_y])
|
translate([x3 + 15, modules_y])
|
||||||
microview();
|
microview();
|
||||||
|
|
||||||
translate([x3 + 40, modules_y])
|
translate([x3 + 60, modules_y])
|
||||||
|
hygrometer();
|
||||||
|
|
||||||
|
translate([x3 + 90, modules_y])
|
||||||
modules();
|
modules();
|
||||||
|
|
||||||
translate([x3, ssrs_y]) {
|
translate([x3, ssrs_y]) {
|
||||||
|
@@ -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 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 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
|
module bbox_shelf_blank(type) { //! 2D template for a shelf
|
||||||
dxf(str(bbox_name(type), "_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"));
|
dxf(str(bbox_name(type), "_front"));
|
||||||
|
|
||||||
t = sheet_thickness(bbox_sheets(type));
|
t = sheet_thickness(bbox_sheets(type));
|
||||||
@@ -174,7 +178,7 @@ module bbox_front_blank(type, sheet = false) { //! 2D template for the front
|
|||||||
|
|
||||||
difference() {
|
difference() {
|
||||||
translate([0, (bt - bb) / 2])
|
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]));
|
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);
|
width = bbox_width(type);
|
||||||
depth = bbox_depth(type);
|
depth = bbox_depth(type);
|
||||||
height = bbox_height(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));
|
t = sheet_thickness(bbox_sheets(type));
|
||||||
bt = sheet_thickness(bbox_base_sheet(type));
|
bt = sheet_thickness(bbox_base_sheet(type));
|
||||||
|
@@ -195,12 +195,15 @@ module mouse_grommet_assembly(r, thickness)
|
|||||||
module ribbon_grommet_20_3_stl() ribbon_grommet(20, 3);
|
module ribbon_grommet_20_3_stl() ribbon_grommet(20, 3);
|
||||||
module mouse_grommet_15_3_stl() mouse_grommet(1.5, 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_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 mouse_grommet_30_3_stl() mouse_grommet(3, 3);
|
||||||
|
|
||||||
module round_grommet_bottom_30_stl() round_grommet_bottom(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_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_bottom_60_stl() round_grommet_bottom(6);
|
||||||
|
|
||||||
module round_grommet_top_30_3_stl() round_grommet_top(3, 3);
|
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_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);
|
module round_grommet_top_60_3_stl() round_grommet_top(6, 3);
|
||||||
|
124
printed/pcb_mount.scad
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
@@ -139,8 +139,8 @@ module psu_shroud(type, cable_d, name, cables = 1) { //! Generate the STL file f
|
|||||||
mirror([0, 1, 0])
|
mirror([0, 1, 0])
|
||||||
psu_shroud_hole_positions(type)
|
psu_shroud_hole_positions(type)
|
||||||
translate_z(height)
|
translate_z(height)
|
||||||
rotate(90)
|
rotate($side * 90)
|
||||||
insert_lug(insert, wall, $side, counter_bore);
|
insert_lug(insert, wall, counter_bore);
|
||||||
}
|
}
|
||||||
|
|
||||||
module psu_shroud_assembly(type, cable_d, name, cables = 1) //! The printed parts with inserts fitted
|
module psu_shroud_assembly(type, cable_d, name, cables = 1) //! The printed parts with inserts fitted
|
||||||
|
@@ -34,7 +34,7 @@ knob_waves = 5;
|
|||||||
knob_height = knob_stem_h + knob_thickness;
|
knob_height = knob_stem_h + knob_thickness;
|
||||||
function knob_height() = knob_height;
|
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));
|
stl(str("screw_knob_M", screw_radius(screw) * 20));
|
||||||
|
|
||||||
knob_stem_r = nut_trap_radius(screw_nut(screw)) + knob_wall;
|
knob_stem_r = nut_trap_radius(screw_nut(screw)) + knob_wall;
|
||||||
|
@@ -103,8 +103,8 @@ module ssr_shroud(type, cable_d, name) { //! Generate the STL file for a spec
|
|||||||
ssr_shroud_hole_positions(type)
|
ssr_shroud_hole_positions(type)
|
||||||
vflip()
|
vflip()
|
||||||
translate_z(height)
|
translate_z(height)
|
||||||
rotate(90)
|
rotate($side * 90)
|
||||||
insert_lug(insert, wall, $side, counter_bore);
|
insert_lug(insert, wall, counter_bore);
|
||||||
}
|
}
|
||||||
|
|
||||||
module ssr_shroud_assembly(type, cable_d, name) //! The printed parts with inserts fitted
|
module ssr_shroud_assembly(type, cable_d, name) //! The printed parts with inserts fitted
|
||||||
|
0
scripts/bom.py
Normal file → Executable file
0
scripts/doc_scripts.py
Normal file → Executable file
0
scripts/dxfs.py
Normal file → Executable file
0
scripts/gallery.py
Normal file → Executable file
0
scripts/make_all.py
Normal file → Executable file
@@ -24,8 +24,8 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import subprocess, sys
|
import subprocess, sys
|
||||||
|
|
||||||
def run(*args, silent = False):
|
def run_list(args, silent = False):
|
||||||
cmd = ["openscad"] + list(args)
|
cmd = ["openscad"] + args
|
||||||
if not silent:
|
if not silent:
|
||||||
for arg in cmd:
|
for arg in cmd:
|
||||||
print(arg, end=" ")
|
print(arg, end=" ")
|
||||||
@@ -37,3 +37,9 @@ def run(*args, silent = False):
|
|||||||
print(line[:-1])
|
print(line[:-1])
|
||||||
if rc:
|
if rc:
|
||||||
sys.exit(rc)
|
sys.exit(rc)
|
||||||
|
|
||||||
|
def run(*args):
|
||||||
|
run_list(list(args), False)
|
||||||
|
|
||||||
|
def run_silent(*args):
|
||||||
|
run_list(list(args), True);
|
||||||
|
49
scripts/options.py
Normal 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
|
@@ -67,7 +67,7 @@ def plateup(target, part_type):
|
|||||||
log_name = 'openscad.log'
|
log_name = 'openscad.log'
|
||||||
else:
|
else:
|
||||||
log_name = 'openscad.echo'
|
log_name = 'openscad.echo'
|
||||||
openscad.run("-D$bom=1", "-o", log_name, src_file, silent = True)
|
openscad.run_silent("-D$bom=1", "-o", log_name, src_file)
|
||||||
#
|
#
|
||||||
# Add the files on the BOM to the used list
|
# Add the files on the BOM to the used list
|
||||||
#
|
#
|
||||||
|
0
scripts/render.py
Normal file → Executable file
0
scripts/set_config.py
Normal file → Executable file
0
scripts/stls.py
Normal file → Executable file
11
scripts/tests.py
Normal file → Executable file
@@ -27,6 +27,7 @@ import openscad
|
|||||||
import subprocess
|
import subprocess
|
||||||
import bom
|
import bom
|
||||||
import times
|
import times
|
||||||
|
import options
|
||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
import shutil
|
import shutil
|
||||||
@@ -96,6 +97,7 @@ def tests(tests):
|
|||||||
index = {}
|
index = {}
|
||||||
bodies = {}
|
bodies = {}
|
||||||
times.read_times()
|
times.read_times()
|
||||||
|
options.check_options(deps_dir)
|
||||||
#
|
#
|
||||||
# Make cover pic if does not exist as very slow. Delete it to force an update.
|
# Make cover pic if does not exist as very slow. Delete it to force an update.
|
||||||
#
|
#
|
||||||
@@ -107,7 +109,7 @@ def tests(tests):
|
|||||||
#
|
#
|
||||||
# List of individual part files
|
# List of individual part files
|
||||||
#
|
#
|
||||||
scads = [i for i in os.listdir(scad_dir) if i[-5:] == ".scad"]
|
scads = [i for i in sorted(os.listdir(scad_dir)) if i[-5:] == ".scad"]
|
||||||
|
|
||||||
for scad in scads:
|
for scad in scads:
|
||||||
base_name = scad[:-5]
|
base_name = scad[:-5]
|
||||||
@@ -138,7 +140,7 @@ def tests(tests):
|
|||||||
print("Can't find implementation!")
|
print("Can't find implementation!")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
vsplit = "N"
|
vsplit = "M"
|
||||||
vtype = locations[0][1]
|
vtype = locations[0][1]
|
||||||
types = [vtype + ' A-' + vsplit[0], vtype + ' ' + chr(ord(vsplit) + 1) + '-Z'] + [loc[1] for loc in locations[1 :]]
|
types = [vtype + ' A-' + vsplit[0], vtype + ' ' + chr(ord(vsplit) + 1) + '-Z'] + [loc[1] for loc in locations[1 :]]
|
||||||
if type == vtype:
|
if type == vtype:
|
||||||
@@ -190,11 +192,12 @@ def tests(tests):
|
|||||||
oldest = png_name if mtime(png_name) < mtime(bom_name) else bom_name
|
oldest = png_name if mtime(png_name) < mtime(bom_name) else bom_name
|
||||||
changed = check_deps(oldest, dname)
|
changed = check_deps(oldest, dname)
|
||||||
changed = times.check_have_time(changed, scad_name)
|
changed = times.check_have_time(changed, scad_name)
|
||||||
|
changed = options.have_changed(changed, oldest)
|
||||||
if changed:
|
if changed:
|
||||||
print(changed)
|
print(changed)
|
||||||
t = time.time()
|
t = time.time()
|
||||||
tmp_name = 'tmp.png'
|
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)
|
times.add_time(scad_name, t)
|
||||||
do_cmd(["magick", tmp_name, "-trim", "-resize", "1000x600", "-bordercolor", background, "-border", "10", tmp_name])
|
do_cmd(["magick", tmp_name, "-trim", "-resize", "1000x600", "-bordercolor", background, "-border", "10", tmp_name])
|
||||||
update_image(tmp_name, png_name)
|
update_image(tmp_name, png_name)
|
||||||
@@ -257,7 +260,7 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa
|
|||||||
print('<tr>', file = doc_file, end = '')
|
print('<tr>', file = doc_file, end = '')
|
||||||
for type in types:
|
for type in types:
|
||||||
if i < len(index[type]):
|
if i < len(index[type]):
|
||||||
name = index[type][i]
|
name = sorted(index[type])[i]
|
||||||
print('<td> <a href = "#' + name + '">' + name + '</a> </td>', file = doc_file, end = '')
|
print('<td> <a href = "#' + name + '">' + name + '</a> </td>', file = doc_file, end = '')
|
||||||
else:
|
else:
|
||||||
print('<td></td>', file = doc_file, end = '')
|
print('<td></td>', file = doc_file, end = '')
|
||||||
|
7
scripts/views.py
Normal file → Executable file
@@ -28,6 +28,7 @@ import openscad
|
|||||||
from tests import do_cmd, update_image, colour_scheme, background
|
from tests import do_cmd, update_image, colour_scheme, background
|
||||||
import time
|
import time
|
||||||
import times
|
import times
|
||||||
|
import options
|
||||||
from deps import *
|
from deps import *
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
@@ -102,6 +103,7 @@ def views(target, do_assemblies = None):
|
|||||||
os.makedirs(deps_dir)
|
os.makedirs(deps_dir)
|
||||||
|
|
||||||
times.read_times(target_dir)
|
times.read_times(target_dir)
|
||||||
|
options.check_options(deps_dir)
|
||||||
bounds_fname = top_dir + 'stls/bounds.json'
|
bounds_fname = top_dir + 'stls/bounds.json'
|
||||||
with open(bounds_fname) as json_file:
|
with open(bounds_fname) as json_file:
|
||||||
bounds_map = json.load(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("use <%s/%s>\n" % (dir, filename))
|
||||||
f.write("%s();\n" % module);
|
f.write("%s();\n" % module);
|
||||||
#
|
#
|
||||||
# Run openscad on th created file
|
# Run openscad on the created file
|
||||||
#
|
#
|
||||||
dname = deps_name(deps_dir, filename)
|
dname = deps_name(deps_dir, filename)
|
||||||
for explode in [0, 1]:
|
for explode in [0, 1]:
|
||||||
@@ -163,11 +165,12 @@ def views(target, do_assemblies = None):
|
|||||||
png_name = png_name.replace('_assembly', '_assembled')
|
png_name = png_name.replace('_assembly', '_assembled')
|
||||||
changed = check_deps(png_name, dname)
|
changed = check_deps(png_name, dname)
|
||||||
changed = times.check_have_time(changed, png_name)
|
changed = times.check_have_time(changed, png_name)
|
||||||
|
changed = options.have_changed(changed, png_name)
|
||||||
tmp_name = 'tmp.png'
|
tmp_name = 'tmp.png'
|
||||||
if changed:
|
if changed:
|
||||||
print(changed)
|
print(changed)
|
||||||
t = time.time()
|
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)
|
times.add_time(png_name, t)
|
||||||
do_cmd(["magick", tmp_name, "-trim", "-resize", "1004x1004", "-bordercolor", background, "-border", "10", tmp_name])
|
do_cmd(["magick", tmp_name, "-trim", "-resize", "1004x1004", "-bordercolor", background, "-border", "10", tmp_name])
|
||||||
update_image(tmp_name, png_name)
|
update_image(tmp_name, png_name)
|
||||||
|
@@ -67,7 +67,7 @@ module belt_test() {
|
|||||||
translate([-25, 0])
|
translate([-25, 0])
|
||||||
layout([for(b = belts) belt_width(b)], 10)
|
layout([for(b = belts) belt_width(b)], 10)
|
||||||
rotate([0, 90, 0])
|
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)
|
if($preview)
|
||||||
|
@@ -35,4 +35,5 @@ module d_connectors()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
d_connectors();
|
let($show_threads = true)
|
||||||
|
d_connectors();
|
||||||
|
30
tests/extrusions.scad
Normal 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
@@ -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();
|
@@ -21,10 +21,21 @@ use <../utils/layout.scad>
|
|||||||
|
|
||||||
include <../vitamins/inserts.scad>
|
include <../vitamins/inserts.scad>
|
||||||
|
|
||||||
module inserts()
|
module inserts() {
|
||||||
|
|
||||||
for(i = [0: len(inserts) -1])
|
for(i = [0: len(inserts) -1])
|
||||||
translate([10 * i, 0])
|
translate([10 * i, 0])
|
||||||
insert(inserts[i]);
|
insert(inserts[i]);
|
||||||
|
|
||||||
|
color(pp1_colour)
|
||||||
|
translate([len(inserts) * 10, 0]) {
|
||||||
|
insert_lug(inserts[0], 2, 1);
|
||||||
|
|
||||||
|
translate([10, 0])
|
||||||
|
insert_boss(inserts[0], z = 10, wall = 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
inserts();
|
let($show_threads = true)
|
||||||
|
inserts();
|
||||||
|
@@ -27,4 +27,5 @@ module leadnuts()
|
|||||||
leadnut(leadnuts[$i]);
|
leadnut(leadnuts[$i]);
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
leadnuts();
|
let($show_threads = true)
|
||||||
|
leadnuts();
|
||||||
|
@@ -22,8 +22,12 @@ use <../utils/layout.scad>
|
|||||||
include <../vitamins/linear_bearings.scad>
|
include <../vitamins/linear_bearings.scad>
|
||||||
|
|
||||||
module linear_bearings()
|
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]);
|
linear_bearing(linear_bearings[$i]);
|
||||||
|
|
||||||
|
translate([0, 30])
|
||||||
|
linear_bearing(long_linear_bearings[$i]);
|
||||||
|
}
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
linear_bearings();
|
linear_bearings();
|
||||||
|
@@ -56,7 +56,7 @@ module maths() {
|
|||||||
//
|
//
|
||||||
z = [0, 0, 1];
|
z = [0, 0, 1];
|
||||||
v = cross(u, z);
|
v = cross(u, z);
|
||||||
a = acos(u * z);
|
a = angle_between(u, z);
|
||||||
|
|
||||||
|
|
||||||
l = 20;
|
l = 20;
|
||||||
@@ -64,6 +64,11 @@ module maths() {
|
|||||||
translate_z(l)
|
translate_z(l)
|
||||||
vflip()
|
vflip()
|
||||||
arrow(l);
|
arrow(l);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Test Euler
|
||||||
|
//
|
||||||
|
assert(euler(rotate(r)) == r, "euler() failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
rotate(45)
|
rotate(45)
|
||||||
|
@@ -22,13 +22,12 @@ use <../utils/layout.scad>
|
|||||||
include <../vitamins/screws.scad>
|
include <../vitamins/screws.scad>
|
||||||
|
|
||||||
module nuts() {
|
module nuts() {
|
||||||
for(nyloc = [false, true])
|
layout([for(n = nuts) 2 * nut_radius(n)], 5) let(n = nuts[$i]) {
|
||||||
translate([0, nyloc ? 20 : 0])
|
for(nyloc = [false, true])
|
||||||
layout([for(n = nuts) 2 * nut_radius(n)], 5)
|
translate([0, nyloc ? 20 : 0])
|
||||||
nut(nuts[$i], nyloc);
|
nut(n, nyloc);
|
||||||
|
|
||||||
translate([0, 40])
|
translate([0, 40]) {
|
||||||
layout([for(n = nuts) 2 * nut_radius(n)], 5) let(n = nuts[$i]) {
|
|
||||||
if(n == M3_nut)
|
if(n == M3_nut)
|
||||||
nut(n, brass = true);
|
nut(n, brass = true);
|
||||||
|
|
||||||
@@ -45,7 +44,28 @@ module nuts() {
|
|||||||
if(n == M8_nut)
|
if(n == M8_nut)
|
||||||
#nut_trap(M8_cap_screw, n, h = 30);
|
#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)
|
if($preview)
|
||||||
nuts();
|
let($show_threads = true)
|
||||||
|
nuts();
|
||||||
|
@@ -29,4 +29,5 @@ module opengrab_test() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
opengrab_test();
|
let($show_threads = true)
|
||||||
|
opengrab_test();
|
||||||
|
35
tests/pcb_mount.scad
Normal 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();
|
@@ -23,7 +23,7 @@ include <../vitamins/d_connectors.scad>
|
|||||||
include <../vitamins/pcbs.scad>
|
include <../vitamins/pcbs.scad>
|
||||||
|
|
||||||
module pcbs()
|
module pcbs()
|
||||||
layout([for(p = pcbs) pcb_width(p)], 15)
|
layout([for(p = pcbs) pcb_width(p)], 10)
|
||||||
translate([0, pcb_length(pcbs[$i]) / 2])
|
translate([0, pcb_length(pcbs[$i]) / 2])
|
||||||
rotate(90)
|
rotate(90)
|
||||||
pcb_assembly(pcbs[$i], 5 + $i, 3);
|
pcb_assembly(pcbs[$i], 5 + $i, 3);
|
||||||
|
@@ -26,4 +26,5 @@ module pillars()
|
|||||||
pillar(pillars[$i]);
|
pillar(pillars[$i]);
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
pillars();
|
let($show_threads = true)
|
||||||
|
pillars();
|
||||||
|
@@ -28,15 +28,18 @@ module pin_headers()
|
|||||||
idc_transition(pin_headers[$i], 10);
|
idc_transition(pin_headers[$i], 10);
|
||||||
|
|
||||||
translate([0, 20])
|
translate([0, 20])
|
||||||
pin_header(pin_headers[$i], 10, 2);
|
pin_header(pin_headers[$i], 10, 2, right_angle = true);
|
||||||
|
|
||||||
translate([0, 40])
|
translate([0, 40])
|
||||||
|
pin_header(pin_headers[$i], 10, 2);
|
||||||
|
|
||||||
|
translate([0, 60])
|
||||||
box_header(pin_headers[$i], 10, 2);
|
box_header(pin_headers[$i], 10, 2);
|
||||||
|
|
||||||
translate([0, 65])
|
translate([0, 80])
|
||||||
pin_socket(pin_headers[$i], 10, 2);
|
pin_socket(pin_headers[$i], 10, 2);
|
||||||
|
|
||||||
translate([0, 95])
|
translate([0, 110])
|
||||||
pin_socket(pin_headers[$i], 10, 2, right_angle = true);
|
pin_socket(pin_headers[$i], 10, 2, right_angle = true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
BIN
tests/png/extrusions.png
Normal file
After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 149 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
BIN
tests/png/hygrometer.png
Normal file
After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 52 KiB |
BIN
tests/png/pcb_mount.png
Normal file
After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 149 KiB After Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 97 KiB |
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 188 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 86 KiB |
BIN
tests/png/sk_brackets.png
Normal file
After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 162 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 92 KiB |
BIN
tests/png/thread.png
Normal file
After Width: | Height: | Size: 215 KiB |
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 93 KiB |
@@ -34,7 +34,7 @@ module rails()
|
|||||||
nut = screw_nut(screw);
|
nut = screw_nut(screw);
|
||||||
washer = screw_washer(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));
|
rail_screws(rail, length, sheet + nut_thickness(nut, true) + washer_thickness(washer));
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ include <../vitamins/ring_terminals.scad>
|
|||||||
|
|
||||||
module ring_terminals()
|
module ring_terminals()
|
||||||
layout([for(t = ring_terminals) ringterm_od(t)], 5)
|
layout([for(t = ring_terminals) ringterm_od(t)], 5)
|
||||||
rotate(90)
|
rotate(180)
|
||||||
ring_terminal_assembly(ring_terminals[$i], 3);
|
ring_terminal_assembly(ring_terminals[$i], 3);
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
|
@@ -21,9 +21,13 @@ use <../utils/layout.scad>
|
|||||||
|
|
||||||
include <../vitamins/rockers.scad>
|
include <../vitamins/rockers.scad>
|
||||||
|
|
||||||
module rockers()
|
module rockers() {
|
||||||
layout([for(r = rockers) rocker_flange_w(r)], 5)
|
layout([for(r = rockers) rocker_flange_w(r)], 5) {
|
||||||
rocker(rockers[$i]);
|
rocker(rockers[$i]);
|
||||||
|
translate([0, 25])
|
||||||
|
rocker(rockers[$i], $i==0 ? "red" : "green");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
rockers();
|
rockers();
|
||||||
|
@@ -24,13 +24,23 @@ include <../vitamins/linear_bearings.scad>
|
|||||||
use <../vitamins/rod.scad>
|
use <../vitamins/rod.scad>
|
||||||
|
|
||||||
module rods()
|
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])
|
translate([0, 30])
|
||||||
studding(bearing_rod_dia(linear_bearings[$i]), 80);
|
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)
|
if($preview)
|
||||||
rods();
|
let($show_threads = true)
|
||||||
|
rods();
|
||||||
|
@@ -25,13 +25,15 @@ for(y = [0 : len(screw_lists) -1])
|
|||||||
for(x = [0 : len(screw_lists[y]) -1]) {
|
for(x = [0 : len(screw_lists[y]) -1]) {
|
||||||
screw = screw_lists[y][x];
|
screw = screw_lists[y][x];
|
||||||
if(screw) {
|
if(screw) {
|
||||||
length = screw_max_thread(screw)
|
length = screw_head_type(screw) == hs_grub ? 6
|
||||||
? screw_longer_than(screw_max_thread(screw) + 5)
|
: screw_radius(screw) <= 1.5 ? 10
|
||||||
: screw_head_type(screw) == hs_grub ? 6 : 30;
|
: screw_max_thread(screw) ? screw_longer_than(screw_max_thread(screw) + 5)
|
||||||
|
: 30;
|
||||||
translate([x * 20, y * 20])
|
translate([x * 20, y * 20])
|
||||||
screw(screw, length);
|
screw(screw, length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
screws();
|
let($show_threads = true)
|
||||||
|
screws();
|
||||||
|
32
tests/sk_brackets.scad
Normal 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();
|
||||||
|
|
@@ -23,9 +23,9 @@ use <../utils/layout.scad>
|
|||||||
include <../vitamins/spools.scad>
|
include <../vitamins/spools.scad>
|
||||||
|
|
||||||
module spools()
|
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])
|
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)
|
if($preview)
|
||||||
spools();
|
spools();
|
||||||
|