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

Compare commits

...

50 Commits

Author SHA1 Message Date
Chris Palmer
e6254daaf1 Merge branch 'martinbudden-belt_gt2x9' 2021-12-12 08:40:51 +00:00
Chris Palmer
c31f58a4fd Udpated images and readme. 2021-12-12 08:40:34 +00:00
Chris Palmer
46fc574e7a Merge branch 'belt_gt2x9' of https://github.com/martinbudden/NopSCADlib into martinbudden-belt_gt2x9 2021-12-11 21:08:56 +00:00
Chris Palmer
6ee0fad2e1 Updated changelog. 2021-12-11 20:57:48 +00:00
Chris Palmer
6e76c2ce89 Merge branch 'martinbudden-drag_chain_links' 2021-12-11 20:54:08 +00:00
Chris Palmer
a2dfaef2b5 Updated readme. 2021-12-11 20:53:01 +00:00
Chris Palmer
2c197be193 Merge branch 'drag_chain_links' of https://github.com/martinbudden/NopSCADlib into martinbudden-drag_chain_links 2021-12-11 20:51:38 +00:00
Chris Palmer
05a67d1b2e Updated changelog 2021-12-11 20:50:37 +00:00
Chris Palmer
be4dc0c57a Merge branch 'martinbudden-drag_chain_no_support_v2' 2021-12-11 20:48:02 +00:00
Chris Palmer
c4895f84c7 Updated image and readme. 2021-12-11 18:34:38 +00:00
Chris Palmer
72700a0acb Merge branch 'drag_chain_no_support_v2' of https://github.com/martinbudden/NopSCADlib into martinbudden-drag_chain_no_support_v2 2021-12-11 13:10:07 +00:00
Chris Palmer
43c78fd1a3 Anual image changes due to change of computer. 2021-12-11 13:01:57 +00:00
Martin Budden
a280e1fcbd Added GT2x9 belt. 2021-11-27 11:06:56 +00:00
Martin Budden
b1ad206ce4 Rotated conical horihole. 2021-11-20 09:51:19 +00:00
Martin Budden
da55f86536 Added variant of drag chain without supports.
Unsupported drag chain has conical pin and corresponding horihole and is printed with cutout facing upwards.

Also made clearance a property of the drag chain so it can be altered for printing chain assemblies
2021-11-20 07:21:09 +00:00
Martin Budden
9790bdda11 Added function returning number of links in drag chain. 2021-11-16 05:41:16 +00:00
Chris Palmer
59c3f984c5 Updated changelog. 2021-11-13 18:35:06 +00:00
Chris Palmer
9c2dd1c37b Merge branch 'martinbudden-screw_socket_visibility' 2021-11-13 18:32:35 +00:00
Chris Palmer
74e569896b Updated images. 2021-11-13 18:32:16 +00:00
Chris Palmer
3a87d7afde Merge branch 'screw_socket_visibility' of https://github.com/martinbudden/NopSCADlib into martinbudden-screw_socket_visibility 2021-11-13 18:11:05 +00:00
Martin Budden
ed6f8cf5c0 Added shading to base of screw sockets to increase visibility. 2021-11-01 10:18:28 +00:00
Chris Palmer
1c9945d978 Updated changelog. 2021-10-29 12:38:48 +01:00
Chris Palmer
9464ad5dbf Fixed knob for pots with split shaft.
Changed the order of knob_for_pot() parameters.
2021-10-29 12:37:12 +01:00
Chris Palmer
370ad8a2d1 Updated changelog. 2021-10-28 13:15:02 +01:00
Chris Palmer
b424bea622 Added printed knobs for pots. 2021-10-28 12:50:22 +01:00
Chris Palmer
c8d9bb7d09 Potentiometers now create a BOM entry and have a value specified. 2021-10-28 12:43:53 +01:00
Chris Palmer
c35c732324 Updated changlog. 2021-10-26 12:28:37 +01:00
Chris Palmer
f5528c5a9a Single 7_segment objects can now have multiple digits.
This is deduced from the digit size compared to the overall size.
The decimal point is now suppressed if there are not enough pins.
Added 02531A and 02352A 3 digit displays.
2021-10-26 12:27:22 +01:00
Chris Palmer
09bce09a85 Typo 2021-10-26 08:47:35 +01:00
Chris Palmer
389e2f9c2e Updated changelog. 2021-10-24 13:52:47 +01:00
Chris Palmer
c35e263113 Merge branch 'martinbudden-magnet_name' 2021-10-24 13:50:17 +01:00
Chris Palmer
bad33da95e Updated images and readme. 2021-10-24 13:49:21 +01:00
Chris Palmer
f727e1d27d Merge branch 'magnet_name' of https://github.com/martinbudden/NopSCADlib into martinbudden-magnet_name 2021-10-24 13:36:33 +01:00
Chris Palmer
5ddd9f6324 Updated changelog. 2021-10-24 13:35:39 +01:00
Chris Palmer
f5d0bfb6c8 Fixed drill center parameter in poly_drill(). 2021-10-24 13:33:51 +01:00
Chris Palmer
b2117fa99a atx_psu_cutout(type) now parametric and can be shown in the test.
ATX300 PSU now has a correct cutout and more accurate grill holes.
The four margins around grill holes can now be specified.
2021-10-24 13:32:46 +01:00
Chris Palmer
6687a4a7c6 Added jack_4mm_flange_radius(). 2021-10-24 13:24:25 +01:00
Chris Palmer
8524ddd34d Foot now lowered by squeeze distance so the washer is visible. 2021-10-24 13:23:45 +01:00
Martin Budden
427ef610de Allowed naming of magnets. Added radial encoder magnet. 2021-10-21 10:37:56 +01:00
Chris Palmer
c8869fc415 Updated changelog. 2021-10-20 20:38:12 +01:00
Chris Palmer
21c06667a3 Added ATX300 PSU model. 2021-10-20 20:35:45 +01:00
Chris Palmer
d19fad3f9f PSU grills can now have different holes sizes, spacing, round or heaxagonal and avoid a list of rectangular regions. 2021-10-20 20:33:52 +01:00
Chris Palmer
172bfb16d8 Added lugless pressfit IEC inlet. 2021-10-20 12:50:35 +01:00
Chris Palmer
491dbae13b screw_shorter_than() will return 4 or 3 for short grub screws. 2021-10-09 12:05:13 +01:00
Chris Palmer
99ebfffd2b Updated changelog. 2021-10-06 10:14:18 +01:00
Chris Palmer
f04486a040 Merge branch 'martinbudden-extrusion_convexity' 2021-10-06 10:12:54 +01:00
Chris Palmer
42a7d222b5 Merge branch 'extrusion_convexity' of https://github.com/martinbudden/NopSCADlib into martinbudden-extrusion_convexity 2021-10-06 10:08:08 +01:00
Chris Palmer
598a01295f Updated changelog. 2021-10-06 10:05:49 +01:00
Chris Palmer
5f72a12125 Nuts shown on jacks and fuseholders only shown threaded when exploded. 2021-10-06 07:32:50 +01:00
Martin Budden
046c475e18 Set convexity to 8 for linear_extrude of extrusion. 2021-10-02 09:20:51 +01:00
48 changed files with 757 additions and 223 deletions

View File

@@ -3,6 +3,85 @@
This changelog is generated by `changelog.py` using manually added semantic version tags to classify commits as breaking changes, additions or fixes.
### [v17.9.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.9.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.8.0...v17.9.0 "diff with v17.8.0")
* 2021-12-11 [`a2dfaef`](https://github.com/nophead/NopSCADlib/commit/a2dfaef2b51ffec3f048f0af569b39e8a7dbbeaf "show commit") [C.P.](# "Chris Palmer") Updated readme.
* 2021-11-16 [`9790bdd`](https://github.com/nophead/NopSCADlib/commit/9790bdda11573904bf87c655d1ab7b81736a45e0 "show commit") [M.B.](# "Martin Budden") Added function returning number of links in drag chain.
### [v17.8.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.8.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.7.2...v17.8.0 "diff with v17.7.2")
* 2021-12-11 [`c4895f8`](https://github.com/nophead/NopSCADlib/commit/c4895f84c7cff48baa14040c2759da15d2a165be "show commit") [C.P.](# "Chris Palmer") Updated image and readme.
* 2021-11-20 [`b1ad206`](https://github.com/nophead/NopSCADlib/commit/b1ad206ce4d29b61f3a9be15adde7f1a51c225b5 "show commit") [M.B.](# "Martin Budden") Rotated conical horihole.
* 2021-11-20 [`da55f86`](https://github.com/nophead/NopSCADlib/commit/da55f86536746657a1e105858109f177d24c362e "show commit") [M.B.](# "Martin Budden") Added variant of drag chain without supports.
Unsupported drag chain has conical pin and corresponding horihole and is printed with cutout facing upwards.
* Also made clearance a property of the drag chain so it can be altered for printing chain assemblies
* 2021-12-11 [`43c78fd`](https://github.com/nophead/NopSCADlib/commit/43c78fd1a38de87a210a64c3587bc994731b41c6 "show commit") [C.P.](# "Chris Palmer") Annual image changes due to change of computer.
#### [v17.7.2](https://github.com/nophead/NopSCADlib/releases/tag/v17.7.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v17.7.1...v17.7.2 "diff with v17.7.1")
* 2021-11-13 [`74e5698`](https://github.com/nophead/NopSCADlib/commit/74e569896bd9b4f98bcd7c84322cd358fee8941f "show commit") [C.P.](# "Chris Palmer") Updated images.
* 2021-11-01 [`ed6f8cf`](https://github.com/nophead/NopSCADlib/commit/ed6f8cf5c0877f7e8ad9323cc4fd3a6983a11080 "show commit") [M.B.](# "Martin Budden") Added shading to base of screw sockets to increase visibility.
#### [v17.7.1](https://github.com/nophead/NopSCADlib/releases/tag/v17.7.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v17.7.0...v17.7.1 "diff with v17.7.0")
* 2021-10-29 [`9464ad5`](https://github.com/nophead/NopSCADlib/commit/9464ad5dbf1c6befaa0059e7cc3f0988d5639173 "show commit") [C.P.](# "Chris Palmer") Fixed knob for pots with split shaft.
Changed the order of `knob_for_pot()` parameters.
### [v17.7.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.7.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.6.0...v17.7.0 "diff with v17.6.0")
* 2021-10-28 [`b424bea`](https://github.com/nophead/NopSCADlib/commit/b424bea622d5247fd1e2f1ddd51782aba55277e1 "show commit") [C.P.](# "Chris Palmer") Added printed knobs for pots.
* 2021-10-28 [`c8d9bb7`](https://github.com/nophead/NopSCADlib/commit/c8d9bb7d094408f70cb91354895856cb915cfe00 "show commit") [C.P.](# "Chris Palmer") Potentiometers now create a BOM entry and have a value specified.
### [v17.6.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.6.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.5.0...v17.6.0 "diff with v17.5.0")
* 2021-10-26 [`f5528c5`](https://github.com/nophead/NopSCADlib/commit/f5528c5a9a51abdd12443a677236ac8610206c20 "show commit") [C.P.](# "Chris Palmer") Single `7_segment` objects can now have multiple digits.
This is deduced from the digit size compared to the overall size.
The decimal point is now suppressed if there are not enough pins.
Added 02531A and 02352A 3 digit displays.
* 2021-10-26 [`09bce09`](https://github.com/nophead/NopSCADlib/commit/09bce09a85fee3f3ac684743467329c18f4ebb73 "show commit") [C.P.](# "Chris Palmer") Typo
### [v17.5.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.5.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.4.0...v17.5.0 "diff with v17.4.0")
* 2021-10-24 [`bad33da`](https://github.com/nophead/NopSCADlib/commit/bad33da95eb3b20ccbb6e4906dccfe51e8f4372c "show commit") [C.P.](# "Chris Palmer") Updated images and readme.
* 2021-10-21 [`427ef61`](https://github.com/nophead/NopSCADlib/commit/427ef610def6ef2744d565329069719e485a500e "show commit") [M.B.](# "Martin Budden") Allowed naming of magnets. Added radial encoder magnet.
### [v17.4.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.4.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.3.0...v17.4.0 "diff with v17.3.0")
* 2021-10-24 [`f5d0bfb`](https://github.com/nophead/NopSCADlib/commit/f5d0bfb6c80111399f5fa2aeb8bab5bab9101285 "show commit") [C.P.](# "Chris Palmer") Fixed drill `center` parameter in `poly_drill()`.
* 2021-10-24 [`b2117fa`](https://github.com/nophead/NopSCADlib/commit/b2117fa99a57341f9c93eed97c392c18173aa73c "show commit") [C.P.](# "Chris Palmer") `atx_psu_cutout(type)` now parametric and can be shown in the test.
ATX300 PSU now has a correct cutout and more accurate grill holes.
The four margins around grill holes can now be specified.
* 2021-10-24 [`6687a4a`](https://github.com/nophead/NopSCADlib/commit/6687a4a7c62d526a5f376db903dcd74c4fb8a25c "show commit") [C.P.](# "Chris Palmer") Added `jack_4mm_flange_radius()`.
* 2021-10-24 [`8524ddd`](https://github.com/nophead/NopSCADlib/commit/8524ddd34dd93d0bf5ddf538984809b8f0f8c986 "show commit") [C.P.](# "Chris Palmer") Foot now lowered by squeeze distance so the washer is visible.
### [v17.3.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.3.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.2.2...v17.3.0 "diff with v17.2.2")
* 2021-10-20 [`21c0666`](https://github.com/nophead/NopSCADlib/commit/21c06667a3c5a0bc65440b990e28b8a2f93c7c32 "show commit") [C.P.](# "Chris Palmer") Added ATX300 PSU model.
* 2021-10-20 [`d19fad3`](https://github.com/nophead/NopSCADlib/commit/d19fad3f9f7e6eba94b2005b4798b5914fff4b69 "show commit") [C.P.](# "Chris Palmer") PSU grills can now have different holes sizes, spacing, round or heaxagonal and avoid a list of rectangular regions.
* 2021-10-20 [`172bfb1`](https://github.com/nophead/NopSCADlib/commit/172bfb16d8ec8ffee8b5185ef42867b37ab6bce1 "show commit") [C.P.](# "Chris Palmer") Added lugless pressfit IEC inlet.
* 2021-10-09 [`491dbae`](https://github.com/nophead/NopSCADlib/commit/491dbae13b9ff2736324ff084c6a6f313b4a09fc "show commit") [C.P.](# "Chris Palmer") `screw_shorter_than()` will return 4 or 3 for short grub screws.
#### [v17.2.2](https://github.com/nophead/NopSCADlib/releases/tag/v17.2.2 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v17.2.1...v17.2.2 "diff with v17.2.1")
* 2021-10-02 [`046c475`](https://github.com/nophead/NopSCADlib/commit/046c475e1833c09a925a5310d1ccc6e4b07e7f89 "show commit") [M.B.](# "Martin Budden") Set convexity to 8 for `linear_extrude` of extrusion.
#### [v17.2.1](https://github.com/nophead/NopSCADlib/releases/tag/v17.2.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v17.2.0...v17.2.1 "diff with v17.2.0")
* 2021-10-06 [`5f72a12`](https://github.com/nophead/NopSCADlib/commit/5f72a1212514ee7f8a795b53b1d1d180329660df "show commit") [C.P.](# "Chris Palmer") Nuts shown on jacks and fuseholders only shown threaded when exploded.
### [v17.2.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.2.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.1.0...v17.2.0 "diff with v17.1.0")
* 2021-10-06 [`82502eb`](https://github.com/nophead/NopSCADlib/commit/82502eb470127b28e4036821077cbdbd06c17e9e "show commit") [C.P.](# "Chris Palmer") Added `pot_nut()` module to draw potentiometer nuts and washers.
### [v17.1.0](https://github.com/nophead/NopSCADlib/releases/tag/v17.1.0 "show release") Additions [...](https://github.com/nophead/NopSCADlib/compare/v17.0.1...v17.1.0 "diff with v17.0.1")
* 2021-10-05 [`b541298`](https://github.com/nophead/NopSCADlib/commit/b541298eae361b80df3c6c5797f3940a37fc2a38 "show commit") [C.P.](# "Chris Palmer") Printed foot assembly can now omit the top washer when space is at a premium.
Now correctly shows the screw in the squeezed position.
* 2021-10-02 [`9884160`](https://github.com/nophead/NopSCADlib/commit/9884160ed5e8cd7d1f44c6fee950e3682714da9c "show commit") [C.P.](# "Chris Palmer") Updated the gallery
#### [v17.0.1](https://github.com/nophead/NopSCADlib/releases/tag/v17.0.1 "show release") Fixes [...](https://github.com/nophead/NopSCADlib/compare/v17.0.0...v17.0.1 "diff with v17.0.0")
* 2021-10-01 [`38c973b`](https://github.com/nophead/NopSCADlib/commit/38c973b316a853fcbef3ccb857d99404a772d9dd "show commit") [C.P.](# "Chris Palmer") FR4 veroboard made the correct colour.
veroboard track cuts made slightly bigger.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 KiB

After

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 KiB

After

Width:  |  Height:  |  Size: 390 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 932 KiB

After

Width:  |  Height:  |  Size: 944 KiB

View File

@@ -123,6 +123,7 @@ use <tests/fixing_block.scad>
use <tests/flat_hinge.scad>
use <tests/foot.scad>
use <tests/handle.scad>
use <tests/knob.scad>
use <tests/PCB_mount.scad>
use <tests/pocket_handle.scad>
use <tests/printed_box.scad>
@@ -173,16 +174,19 @@ translate([x5, cable_grommets_y + 470]) {
flat_hinges();
}
translate([x5, cable_grommets_y + 370])
translate([x5, cable_grommets_y + 380])
no_explode() socket_boxes();
translate([x5 + 60, cable_grommets_y + 200])
strap_handles();
translate([640, cable_grommets_y + 200])
printed_pulley_test();
translate([x5, cable_grommets_y + 250])
translate([x5, cable_grommets_y + 200])
knobs();
translate([x5 + 60, cable_grommets_y + 250])
strap_handles();
translate([x5, cable_grommets_y + 300])
handle();
translate([950, 600])

View File

@@ -35,18 +35,17 @@ include <../core.scad>
use <../utils/horiholes.scad>
use <../utils/maths.scad>
clearance = 0.1;
function drag_chain_name(type) = type[0]; //! The name to allow more than one in a project
function drag_chain_size(type) = type[1]; //! The internal size and link length
function drag_chain_travel(type) = type[2]; //! X travel
function drag_chain_wall(type) = type[3]; //! Side wall thickness
function drag_chain_bwall(type) = type[4]; //! Bottom wall
function drag_chain_twall(type) = type[5]; //! Top wall
function drag_chain_screw(type) = type[6]; //! Mounting screw for the ends
function drag_chain_screw_lists(type) = type[7]; //! Two lists of four bools to say which screws positions are used
function drag_chain_clearance(type) = type[6]; //! Clearance around joints
function drag_chain_supports(type) = type[7]; //! Whether to print version of chain with or without supports
function drag_chain_screw(type) = type[8]; //! Mounting screw for the ends
function drag_chain_screw_lists(type) = type[9]; //! Two lists of four bools to say which screws positions are used
function drag_chain_clearance() = clearance; //! Clearance around joints.
function drag_chain_radius(type) = //! The bend radius at the pivot centres
let(s = drag_chain_size(type))
@@ -56,12 +55,15 @@ function drag_chain_z(type) = //! Outside dimension of a 180 bend
let(os = drag_chain_outer_size(type), s = drag_chain_size(type))
2 * drag_chain_radius(type) + os.z;
function drag_chain(name, size, travel, wall = 1.6, bwall = 1.5, twall = 1.5, screw = M2_cap_screw, screw_lists = [[1,0,0,1],[1,0,0,1]]) = //! Constructor
[name, size, travel, wall, bwall, twall, screw, screw_lists];
function drag_chain(name, size, travel, wall = 1.6, bwall = 1.5, twall = 1.5, clearance = 0.1, supports = true, screw = M2_cap_screw, screw_lists = [[1,0,0,1],[1,0,0,1]]) = //! Constructor
[name, size, travel, wall, bwall, twall, clearance, supports, screw, screw_lists];
function drag_chain_outer_size(type) = //! Link outer dimensions
let(s = drag_chain_size(type), z = s.z + drag_chain_bwall(type) + drag_chain_twall(type))
[s.x + z, s.y + 4 * drag_chain_wall(type) + 2 * clearance, z];
[s.x + z, s.y + 4 * drag_chain_wall(type) + 2 * drag_chain_clearance(type), z];
function drag_chain_links(type) = //! Number of links in chain
ceil(drag_chain_travel(type) / drag_chain_size(type).x) + 4;
function screw_lug_radius(screw) = //! Radius of a screw lug
corrected_radius(screw_clearance_radius(screw)) + 3.1 * extrusion_width;
@@ -85,6 +87,7 @@ module drag_chain_screw_positions(type, end) { //! Place children at the screw p
r = screw_lug_radius(drag_chain_screw(type));
s = drag_chain_size(type);
os = drag_chain_outer_size(type);
clearance = drag_chain_clearance(type);
R = os.z / 2;
x0 = end ? R + norm([drag_chain_cam_x(type), R - drag_chain_twall(type)]) + clearance + r : r;
x1 = end ? os.x - r : os.x - 2 * R - clearance - r;
@@ -99,7 +102,7 @@ function drag_chain_cam_x(type) = // how far the cam sticks out
let(s = drag_chain_size(type),
r = drag_chain_outer_size(type).z / 2,
wall = drag_chain_wall(type),
cam_r = s.x - 2 * clearance - wall - r, // inner_x_normal - clearance - r
cam_r = s.x - 2 * drag_chain_clearance(type) - wall - r, // inner_x_normal - clearance - r
twall = drag_chain_twall(type)
) min(sqrt(max(sqr(cam_r) - sqr(r - twall), 0)), r);
@@ -111,8 +114,15 @@ module drag_chain_link(type, start = false, end = false, check_kids = true) { //
bwall = drag_chain_bwall(type);
twall = drag_chain_twall(type);
os = drag_chain_outer_size(type);
clearance = drag_chain_clearance(type);
supports = drag_chain_supports(type);
r = os.z / 2;
pin_r = r / 2;
// initial estimates of pin_r and pin_h
pin_r0 = r / 2 - 0.2;
pin_h0 = min(wall + clearance, 2 * pin_r0 - 1);
// for conical pin: ensure minimum radius of top of pin and pin does not overlap cutout
pin_r = supports ? r / 2 : min(r / 2 - 0.2, (os.z - 2 * twall - 3 * pin_h0 / 4 - 0.2) / 2);
pin_h = min(wall + clearance, 2 * pin_r - 1);
socket_x = r;
pin_x = socket_x + s.x;
@@ -123,44 +133,51 @@ module drag_chain_link(type, start = false, end = false, check_kids = true) { //
inner_x = start ? 0 : outer_normal_x - wall; // s.x - clearance - wall
roof_x_normal = 2 * r - twall;
roof_x = start ? 0 : roof_x_normal;
floor_x = start ? 0 : 2 * r;
cam_x = drag_chain_cam_x(type);
assert(r + norm([drag_chain_cam_x(type), r - drag_chain_twall(type)]) + clearance <= inner_x || start, "Link must be longer");
vflip(!supports)
difference() {
union() {
for(side = [-1, 1])
rotate([90, 0, 0]) {
// Outer cheeks
translate_z(side * (os.y / 2 - wall / 2))
linear_extrude(wall, center = true)
difference() {
difference() {
linear_extrude(wall, center = true)
hull() {
if(start)
square([eps, os.z]);
else
translate([socket_x, r])
rotate(180)
rotate(supports ? 180 : 0)
teardrop(r = r, h = 0);
translate([outer_end_x - eps, 0])
square([eps, os.z]);
}
if(!start)
translate([socket_x, r])
horihole(pin_r, r);
if(supports)
translate([socket_x, r, 0])
horihole(pin_r, r, wall + 2*eps);
else
translate([socket_x, r, -side * (wall / 2 + clearance)])
rotate(180)
hull() {
horihole(r = pin_r + pin_h / 2, z = r, h = eps);
translate_z(side * pin_h)
horihole(r = pin_r - pin_h / 2, z = r, h = eps);
}
}
// Inner cheeks
translate_z(side * (s.y / 2 + wall / 2))
translate_z(side * (s.y / 2 + wall / 2)) {
linear_extrude(wall, center = true)
difference() {
union() {
hull() {
if(!end) {
translate([pin_x, r])
rotate(180)
rotate(supports ? 180 : 0)
teardrop(r = r, h = 0);
translate([pin_x, twall])
@@ -186,31 +203,39 @@ module drag_chain_link(type, start = false, end = false, check_kids = true) { //
square(os.z);
}
}
// Pin
if(!end)
translate([pin_x, r, side * (s.y / 2 + wall + clearance)])
horicylinder(r = pin_r, z = r, h = 2 * wall);
// Pin
if(!end)
if(supports)
translate([pin_x, r, side * (wall / 2 + clearance)])
horicylinder(r = pin_r, z = r, h = 2 * wall + eps);
else
translate([pin_x, r, side * wall / 2])
vflip(side == -1)
cylinder(r1 = pin_r + pin_h / 2, r2 = pin_r - pin_h / 2, h = pin_h + eps);
}
// Cheek joint
translate([inner_x, 0, side * (s.y / 2 + wall) - 0.5])
cube([outer_end_x - inner_x, os.z, 1]);
}
// Roof, actually the floor when printed
// Roof, actually the floor when printed with supports
roof_x = start ? 0 : roof_x_normal;
roof_end = end ? s.x + 2 * r : s.x + r - twall - clearance;
translate([roof_x, -s.y / 2 - 0.5])
cube([roof_end - roof_x , s.y + 1, twall]);
translate([roof_x, -s.y / 2 - wall, 0]) {
cube([roof_end - roof_x, s.y + 2 * wall, twall]);
translate([0, -wall, 0])
cube([s.x - roof_x - clearance, s.y + 4 * wall, twall]);
}
translate([roof_x, -os.y / 2 + 0.5])
cube([s.x - clearance - roof_x, os.y - 1, twall]);
// Floor, actually the roof when printed
// Floor, actually the roof when printed with supports
floor_x = start ? 0 : 2 * r;
floor_end = end ? s.x + 2 * r : s.x + r;
translate([floor_x, -s.y / 2 - wall, os.z - bwall])
translate([floor_x, -s.y / 2 - wall, os.z - bwall]) {
cube([floor_end - floor_x, s.y + 2 * wall, bwall]);
translate([floor_x, -os.y / 2 + 0.5, os.z - bwall])
cube([s.x - floor_x - clearance, os.y -1, bwall]);
translate([0, -wall, 0])
cube([s.x - floor_x - clearance, s.y + 4 * wall, bwall]);
}
if(start || end) {
drag_chain_screw_positions(type, end)
@@ -223,16 +248,16 @@ module drag_chain_link(type, start = false, end = false, check_kids = true) { //
}
children();
}
}
} // end union
if(start || end)
translate_z(-eps)
drag_chain_screw_positions(type, end)
rotate($a)
poly_cylinder(r = screw_clearance_radius(drag_chain_screw(type)), h = os.z + 2 * eps, center = false);
} // end difference
}
if(show_supports() && !end) {
if(supports && show_supports() && !end) {
for(side = [-1, 1]) {
w = 2.1 * extrusion_width;
translate([s.x + r + cam_x - w / 2, side * (s.y / 2 + wall / 2), twall / 2])
@@ -255,16 +280,15 @@ module _drag_chain_assembly(type, pos = 0, render = false) {
s = drag_chain_size(type);
x = (1 + exploded()) * s.x;
r = drag_chain_radius(type) * x / s.x;
travel = drag_chain_travel(type);
links = ceil(travel / s.x);
actual_travel = links * s.x;
links = drag_chain_links(type);
actual_travel = (links - 4) * s.x;
z = drag_chain_outer_size(type).z;
zb = z / 2; // z of bottom track
c = [actual_travel / 2 + pos / 2, 0, r + zb]; // centre of bend
points = [ // Calculate list of hinge points
for(i = 0, p = [0, 0, z / 2 + 2 * r]; i < links + 5;
for(i = 0, p = [0, 0, z / 2 + 2 * r]; i < links + 1;
i = i + 1,
dx = p.z > c.z ? x : -x,
p = max(p.x + dx, p.x) <= c.x ? p + [dx, 0, 0] // Straight sections
@@ -277,11 +301,12 @@ module _drag_chain_assembly(type, pos = 0, render = false) {
module link(n) // Position and colour link with origin at the hinge hole
translate([-z / 2, 0, -z / 2]) {
stl_colour(n < 0 || n == npoints - 1 ? pp3_colour : n % 2 ? pp1_colour : pp2_colour)
render_if(render)
drag_chain_link(type, start = n == -1, end = n == npoints - 1, check_kids = false)
let($fasteners = 0)
children();
vflip(!drag_chain_supports(type))
stl_colour(n < 0 || n == npoints - 1 ? pp3_colour : n % 2 ? pp1_colour : pp2_colour)
render_if(render)
drag_chain_link(type, start = n == -1, end = n == npoints - 1, check_kids = false)
let($fasteners = 0)
children();
let($fasteners = 1) children();
}

View File

@@ -74,7 +74,8 @@ module foot_assembly(t = 0, type = foot, flip = false, no_washer = false) { //!
screw_length = screw_length(screw, foot_thickness(type) + t - squeeze, no_washer ? 1 : 2, nyloc = true);
vflip() explode(15, true) {
stl_colour(pp4_colour) foot(type);
translate_z(-squeeze)
stl_colour(pp4_colour) foot(type);
if(t)
explode(15, true)

171
printed/knob.scad Normal file
View File

@@ -0,0 +1,171 @@
//
// NopSCADlib Copyright Chris Palmer 221
// 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/>.
//
//
//! Parametric knobs for potentiometers and encoders.
//!
//! A knob can be constructed by specififying all the parameters or the potentiometer can be specified to customise it for its shaft with a recess to clear the nut, washer and thread.
//! An optional skirt and / or a pointer can be specified.
//!
//! The STL includes a support membrane that needs to be cut out and a thread needs to be tapped for the grub screw.
//
include <../core.scad>
use <../utils/hanging_hole.scad>
use <../utils/rounded_polygon.scad>
use <../vitamins/potentiometer.scad>
clearance = 0.2;
function knob_name(type) = type[0]; //! Name for the stl maker
function knob_top_d(type) = type[1]; //! Diameter at the top
function knob_bot_d(type) = type[2]; //! Diameter at the bottom
function knob_height(type) = type[3]; //! Height
function knob_corner_r(type) = type[4]; //! Rounded top corner
function knob_shaft_d(type) = type[5]; //! Shaft diameter
function knob_shaft_len(type)= type[6]; //! Shaft length
function knob_flat_d(type) = type[7]; //! The shaft diameter at the flat
function knob_flat_h(type) = type[8]; //! The length of the flat
function knob_screw(type) = type[9]; //! The grub screw type
function knob_skirt(type) = type[10]; //! Skirt diameter and thickness
function knob_recess(type) = type[11]; //! Recess diameter and thickness to clear nut and thread, diameter, nut height, thread height
function knob_pointer(type) = type[12]; //! Pointer outside radius, [point width, back width] and height height
function knob(name = "knob", top_d = 12, bot_d = 15, height = 18, shaft_length, skirt = [20, 2], pointer = false, corner_r = 2, screw = M3_grub_screw, shaft_d, flat_d, flat_h, recess) = //! Constructor
[
name, top_d, bot_d, height, corner_r, shaft_d, shaft_length, flat_d, flat_h, screw, skirt, recess, pointer
];
function knob_for_pot(pot, thickness, z = 1, washer = true, top_d = 12, bot_d = 15, height = 0, shaft_length = undef, skirt = [20, 2], pointer = false, corner_r = 2, screw = M3_grub_screw) = //! Construct a knob to fit specified pot
let(s = pot_shaft(pot),
washer = washer && pot_washer(pot) ? pot_washer(pot) : [0, 0],
nut = pot_nut(pot) ? pot_nut(pot) : [pot_thread_d(pot) * cos(30), pot_thread_h(pot) - thickness],
shaft_length = is_undef(shaft_length) ? s.z : min(shaft_length, s.z),
h = round_to_layer(shaft_length + pot_thread_h(pot) - thickness - z),
height = max(height, h + 1),
recess = [(z > washer.y ? nut.x / cos(30) : washer.x) + 0.4, round_to_layer(nut.y + washer.y - z + layer_height), round_to_layer(pot_thread_h(pot) - z - thickness + 2 * layer_height)],
flat_d = s.y + 0.06,
flat_h = min(s[3], shaft_length)
)
knob(name = str(pot[0], "_knob"),
top_d = top_d,
bot_d = bot_d,
height = height,
corner_r = corner_r,
screw = screw,
skirt = skirt,
pointer = pointer,
shaft_d = s.x,
shaft_length = h,
flat_d = flat_d,
flat_h = flat_h,
recess = recess);
function knob_screw_z(type) = knob_shaft_len(type) - knob_flat_h(type) / 2;
module knob(type, supports = true) { //! Generate the STL for a knob
r_top = knob_top_d(type) / 2;
r_bot = knob_bot_d(type) / 2;
h = knob_height(type);
r = knob_corner_r(type);
screw = knob_screw(type);
sr = knob_shaft_d(type) / 2 + (screw ? clearance : 0);
top_wall = h - knob_shaft_len(type);
fr = knob_flat_d(type) - sr + 2 * clearance;
fh = knob_flat_h(type);
skirt = knob_skirt(type);
recess = knob_recess(type);
pointer = knob_pointer(type);
stl(knob_name(type))
{
difference() {
union() {
rotate_extrude() {
rounded_polygon([
[0, h, 0],
[r_top - r, h - r, r],
[r_bot, 0, 0],
[0, 0, 0],
]);
if(skirt)
square([skirt.x / 2, skirt.y]);
}
if(pointer)
linear_extrude(pointer.z)
rotate(-90)
hull() {
translate([pointer.x, 0])
square([eps, pointer.y[0]], center = true);
translate([r_bot, 0])
square([eps, pointer.y[1]], center = true);
}
}
shaft_z = recess ? recess.z + (supports ? layer_height : -eps) : -eps;
translate_z(shaft_z) {
h = h - top_wall - shaft_z;
linear_extrude(h)
difference() {
poly_circle(sr);
if(fr > 0)
translate([-sr, fr])
square([2 * sr, sr]);
}
if(h > fh)
poly_cylinder(sr, round_to_layer(h - fh), center = false);
}
if(recess)
translate_z(-eps)
hull() {
poly_cylinder(r = recess.x / 2, h = recess.y + eps, center = false);
linear_extrude(recess.z + eps)
offset(min(-(recess.z - recess.y), 0))
poly_circle(recess.x / 2);
}
if(screw)
translate_z(knob_screw_z(type))
rotate([90, 0, 180])
teardrop_plus(r = screw_pilot_hole(screw), h = max(r_top, r_bot) + eps, center = false);
}
}
}
//! Knob with grub screw in place
module knob_assembly(type) explode(40, explode_children = true) { //! Assembly with the grub screw in place
sr = knob_shaft_d(type) / 2;
fr = knob_flat_d(type) < sr ? knob_flat_d(type) - sr : sr;
r_top = knob_top_d(type) / 2;
r_bot = knob_bot_d(type) / 2;
screw_length = screw_shorter_than(min(r_top, r_bot) - fr);
screw = knob_screw(type);
stl_colour(pp1_colour) render() knob(type, supports = false);
if(screw)
translate([0, (fr + screw_length), knob_screw_z(type)])
rotate([90, 0, 180])
screw(screw, screw_length);
}

145
readme.md
View File

@@ -35,24 +35,27 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
<tr><td> <a href = "#Cable_strips">Cable_strips</a> </td><td> <a href = "#Microswitches">Microswitches</a> </td><td> <a href = "#Sheets">Sheets</a> </td><td> <a href = "#Flat_hinge">Flat_hinge</a> </td><td> <a href = "#Offset">Offset</a> </td><td></td></tr>
<tr><td> <a href = "#Cameras">Cameras</a> </td><td> <a href = "#Microview">Microview</a> </td><td> <a href = "#Spades">Spades</a> </td><td> <a href = "#Foot">Foot</a> </td><td> <a href = "#Quadrant">Quadrant</a> </td><td></td></tr>
<tr><td> <a href = "#Circlips">Circlips</a> </td><td> <a href = "#Modules">Modules</a> </td><td> <a href = "#Spools">Spools</a> </td><td> <a href = "#Handle">Handle</a> </td><td> <a href = "#Round">Round</a> </td><td></td></tr>
<tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#PCB_mount">PCB_mount</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
<tr><td> <a href = "#DIP">DIP</a> </td><td> <a href = "#O_ring">O_ring</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Swiss_clips">Swiss_clips</a> </td><td> <a href = "#Pocket_handle">Pocket_handle</a> </td><td> <a href = "#Rounded_triangle">Rounded_triangle</a> </td><td></td></tr>
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#PCB">PCB</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td> <a href = "#Press_fit">Press_fit</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Printed_pulleys">Printed_pulleys</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Pillow_blocks">Pillow_blocks</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Wire">Wire</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Potentiometers">Potentiometers</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td></td><td></td><td></td><td></td></tr>
<tr><td> <a href = "#Components">Components</a> </td><td> <a href = "#Nuts">Nuts</a> </td><td> <a href = "#Springs">Springs</a> </td><td> <a href = "#Knob">Knob</a> </td><td> <a href = "#Rounded_cylinder">Rounded_cylinder</a> </td><td></td></tr>
<tr><td> <a href = "#DIP">DIP</a> </td><td> <a href = "#O_ring">O_ring</a> </td><td> <a href = "#Stepper_motors">Stepper_motors</a> </td><td> <a href = "#PCB_mount">PCB_mount</a> </td><td> <a href = "#Rounded_polygon">Rounded_polygon</a> </td><td></td></tr>
<tr><td> <a href = "#D_connectors">D_connectors</a> </td><td> <a href = "#Opengrab">Opengrab</a> </td><td> <a href = "#Swiss_clips">Swiss_clips</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Rounded_triangle">Rounded_triangle</a> </td><td></td></tr>
<tr><td> <a href = "#Displays">Displays</a> </td><td> <a href = "#PCB">PCB</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td> <a href = "#Pocket_handle">Pocket_handle</a> </td><td> <a href = "#Sector">Sector</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Press_fit">Press_fit</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Printed_pulleys">Printed_pulleys</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Pillow_blocks">Pillow_blocks</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Wire">Wire</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Potentiometers">Potentiometers</a> </td><td> <a href = "#Zipties">Zipties</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td></td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
</table>
---
<a name="7_segments"></a>
## 7_segments
7 Segment displays
7 Segment displays.
Can be single digits stacked side by side or can be multiple digits in one unit. This is determined by the overall width compared to the width of a digit.
Presence of a decimal point is determined by the number of pins. Its position is determined by a heuristic.
[vitamins/7_segments.scad](vitamins/7_segments.scad) Object definitions.
@@ -63,7 +66,7 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
### Properties
| Function | Description |
|:--- |:--- |
| `7_segment_digit_size(type)` | Size of the actual digit and segemnt width and angle |
| `7_segment_digit_size(type)` | Size of the actual digit and segment width and angle |
| `7_segment_pin_pitch(type)` | x and y pin pitches and pin diameter |
| `7_segment_pins(type)` | None |
| `7_segment_size(type)` | Size of the body |
@@ -353,6 +356,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour
| 1 | `belt(GT2x6, [ ... ])` | Belt GT2 x 6mm x 128mm |
| 1 | `belt(GT2x6, [ ... ])` | Belt GT2 x 6mm x 552mm |
| 2 | `belt(GT2x6, [ ... ])` | Belt GT2 x 6mm x 556mm |
| 1 | `belt(GT2x9, [ ... ])` | Belt GT2 x 9mm x 128mm |
| 1 | `belt(T2p5x6, [ ... ])` | Belt T2.5 x 6mm x 130mm |
| 1 | `belt(T5x10, [ ... ])` | Belt T5 x 10mm x 130mm |
| 1 | `belt(T5x6, [ ... ])` | Belt T5 x 6mm x 130mm |
@@ -1454,6 +1458,7 @@ 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 |
| 1 | `iec(IEC_inlet_atx2)` | IEC pressfit inlet for ATX |
| 1 | `iec(IEC_320_C14_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 |
@@ -1526,6 +1531,7 @@ E.g. a "brown" socket for mains live needs to be displayed as "sienna" to look r
### Functions
| Function | Description |
|:--- |:--- |
| `jack_4mm_flange_radius()` | 4mm jack socket flange radius |
| `jack_4mm_hole_radius()` | Panel hole radius for 4mm jack |
| `jack_4mm_plastic_flange_radius()` | 4mm plastic jack socket flange radius |
| `jack_4mm_shielded_hole_radius()` | Panel hole radius for 4mm shielded jack |
@@ -1879,6 +1885,7 @@ Cylindrical and ring magnets.
|:--- |:--- |
| `magnet_h(type)` | Height |
| `magnet_id(type)` | Inside diameter if a ring |
| `magnet_name(type)` | Name |
| `magnet_od(type)` | Outer diameter |
| `magnet_r(type)` | Corner radius |
@@ -1892,9 +1899,10 @@ Cylindrical and ring magnets.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `magnet(MAG484)` | Magnet 6.35mm diameter, 6.35mm high, 3.175mm bore |
| 1 | `magnet(MAG8x4x4p2)` | Magnet 8mm diameter, 4mm high, 4.2mm bore |
| 1 | `magnet(MAG5x8)` | Magnet 8mm diameter, 5mm high |
| 1 | `magnet(MAG484)` | Magnet, 6.35mm diameter, 6.35mm high, 3.175mm bore |
| 1 | `magnet(MAG8x4x4p2)` | Magnet, 8mm diameter, 4mm high, 4.2mm bore |
| 1 | `magnet(MAG5x8)` | Magnet, 8mm diameter, 5mm high |
| 1 | `magnet(MAGRE6x2p5)` | Radial encoder magnet, 6mm diameter, 2.5mm high |
<a href="#top">Top</a>
@@ -2383,6 +2391,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `potentiometer(BTT_encoder)` | BTT_encoder |
| 1 | `box_header(2p54header, 4, 2)` | Box header 4 x 2 |
| 1 | `d_plug(DCONN9, pcb = true)` | D-type 9 way PCB mount plug |
| 1 | `dil_socket(12, 15.24)` | DIL socket 24 x 0.6" |
@@ -2390,6 +2399,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `pdip(24, 27C32, w = 15.24)` | IC 27C32 PDIP24 |
| 1 | `pdip(8, NE555)` | IC NE555 PDIP8 |
| 1 | `idc_transition(2p54header, 5)` | IDC transition header 5 x 2 |
| 1 | `potentiometer(KY_040_encoder)` | KY_040_encoder |
| 1 | `led(LED10mm, "yellow")` | LED 10 mm yellow |
| 1 | `led(LED3mm)` | LED 3 mm red |
| 1 | `led(LED5mm, "orange")` | LED 5 mm orange |
@@ -2819,10 +2829,19 @@ Potentiometers and rotary encoders
| Module | Description |
|:--- |:--- |
| `pot_nut(type, washer = true)` | Draw the nut for a potentiometer and possibly a washer |
| `potentiometer(type, thickness = 3, shaft_length = undef)` | Draw a potentiometer with nut spaced by specified thickness |
| `potentiometer(type, thickness = 3, shaft_length = undef, value = false)` | Draw a potentiometer with nut spaced by specified thickness |
![potentiometers](tests/png/potentiometers.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `potentiometer(BTT_encoder)` | BTT_encoder |
| 1 | `potentiometer(KY_040_encoder)` | KY_040_encoder |
| 1 | `potentiometer(imperial_pot)` | Potentiometer imperial_pot |
| 1 | `potentiometer(imperial_pot_x2)` | Potentiometer imperial_pot_x2 |
| 1 | `potentiometer(metric_pot)` | Potentiometer metric_pot |
<a href="#top">Top</a>
@@ -2844,6 +2863,7 @@ Face order is bottom, top, left, right, front, back.
|:--- |:--- |
| `atx_psu(type)` | True if an ATX style PSU |
| `psu_accessories(type)` | Accessories to add to BOM, e.g. mains lead |
| `psu_face_cutout(type)` | Panel cutout to accommodate this face, e.g. for ATX |
| `psu_face_cutouts(type)` | List of polygons to remove |
| `psu_face_fan(type)` | Fan x,y position and type |
| `psu_face_grill(type)` | Is this face a grill |
@@ -2879,7 +2899,7 @@ Face order is bottom, top, left, right, front, back.
### Modules
| Module | Description |
|:--- |:--- |
| `atx_psu_cutout(type)` | Cut out for the rear of an ATX |
| `atx_psu_cutout(type, face = f_front)` | Cut out for the rear of an ATX, which is actually f_front! |
| `psu(type)` | Draw a power supply |
| `psu_screw_positions(type, face = undef)` | Position children at the screw positions on the preferred mounting face, which can be overridden. |
| `terminal_block(type, ways)` | Draw a power supply terminal block |
@@ -2889,18 +2909,18 @@ Face order is bottom, top, left, right, front, back.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | | IEC mains lead |
| 2 | | IEC mains lead |
| 1 | `psu(ATX500)` | PSU ATX500 |
| 1 | `psu(KY240W)` | PSU KY-240W-12-L |
| 1 | `psu(ATX300)` | PSU FSP300-60GHX |
| 1 | `psu(KY240W)` | PSU KY-240W-12-L - not shown |
| 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 |
| 9 | `screw(No632_pan_screw, 8)` | Screw 6-32 pan 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 |
| 8 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
| 13 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
<a href="#top">Top</a>
@@ -4921,10 +4941,12 @@ to the assembly, for example to add inserts.
| Function | Description |
|:--- |:--- |
| `drag_chain_bwall(type)` | Bottom wall |
| `drag_chain_clearance(type)` | Clearance around joints |
| `drag_chain_name(type)` | The name to allow more than one in a project |
| `drag_chain_screw(type)` | Mounting screw for the ends |
| `drag_chain_screw_lists(type)` | Two lists of four bools to say which screws positions are used |
| `drag_chain_size(type)` | The internal size and link length |
| `drag_chain_supports(type)` | Whether to print version of chain with or without supports |
| `drag_chain_travel(type)` | X travel |
| `drag_chain_twall(type)` | Top wall |
| `drag_chain_wall(type)` | Side wall thickness |
@@ -4932,8 +4954,8 @@ to the assembly, for example to add inserts.
### Functions
| Function | Description |
|:--- |:--- |
| `drag_chain(name, size, travel, wall = 1.6, bwall = 1.5, twall = 1.5, screw = M2_cap_screw, screw_lists = [[1,0,0,1],[1,0,0,1]])` | Constructor |
| `drag_chain_clearance()` | Clearance around joints. |
| `drag_chain(name, size, travel, wall = 1.6, bwall = 1.5, twall = 1.5, clearance = 0.1, supports = true, screw = M2_cap_screw, screw_lists = [[1,0,0,1],[1,0,0,1]])` | Constructor |
| `drag_chain_links(type)` | Number of links in chain |
| `drag_chain_outer_size(type)` | Link outer dimensions |
| `drag_chain_radius(type)` | The bend radius at the pivot centres |
| `drag_chain_z(type)` | Outside dimension of a 180 bend |
@@ -5270,6 +5292,75 @@ Printed handle that can be printed without needing support material due to its t
| 1 | handle_assembly |
<a href="#top">Top</a>
---
<a name="Knob"></a>
## Knob
Parametric knobs for potentiometers and encoders.
A knob can be constructed by specififying all the parameters or the potentiometer can be specified to customise it for its shaft with a recess to clear the nut, washer and thread.
An optional skirt and / or a pointer can be specified.
The STL includes a support membrane that needs to be cut out and a thread needs to be tapped for the grub screw.
[printed/knob.scad](printed/knob.scad) Implementation.
[tests/knob.scad](tests/knob.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| `knob_bot_d(type)` | Diameter at the bottom |
| `knob_corner_r(type)` | Rounded top corner |
| `knob_flat_d(type)` | The shaft diameter at the flat |
| `knob_flat_h(type)` | The length of the flat |
| `knob_height(type)` | Height |
| `knob_name(type)` | Name for the stl maker |
| `knob_pointer(type)` | None |
| `knob_recess(type)` | Recess diameter and thickness to clear nut and thread, diameter, nut height, thread height |
| `knob_screw(type)` | The grub screw type |
| `knob_shaft_d(type)` | Shaft diameter |
| `knob_shaft_len(type)` | Shaft length |
| `knob_skirt(type)` | Skirt diameter and thickness |
| `knob_top_d(type)` | Diameter at the top |
### Functions
| Function | Description |
|:--- |:--- |
| `knob(name = "knob", top_d = 12, bot_d = 15, height = 18, shaft_length, skirt = [20, 2], pointer = false, corner_r = 2, screw = M3_grub_screw, shaft_d, flat_d, flat_h, recess)` | Constructor |
| `knob_for_pot(pot, thickness, z = 1, washer = true, top_d = 12, bot_d = 15, height = 0, shaft_length = undef, skirt = [20, 2], pointer = false, corner_r = 2, screw = M3_grub_screw)` | Construct a knob to fit specified pot |
### Modules
| Module | Description |
|:--- |:--- |
| `knob(type, supports = true)` | Generate the STL for a knob |
| `knob_assembly(type) explode(40, explode_children = true)` | Assembly with the grub screw in place |
![knob](tests/png/knob.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `potentiometer(BTT_encoder)` | BTT_encoder |
| 1 | `potentiometer(KY_040_encoder)` | KY_040_encoder |
| 1 | `potentiometer(imperial_pot)` | Potentiometer imperial_pot |
| 1 | `potentiometer(imperial_pot_x2)` | Potentiometer imperial_pot_x2 |
| 1 | `potentiometer(metric_pot)` | Potentiometer metric_pot |
| 1 | `screw(M3_grub_screw, 3)` | Screw M3 grub x 3mm |
| 2 | `screw(M3_grub_screw, 4)` | Screw M3 grub x 4mm |
| 1 | `screw(M3_grub_screw, 6)` | Screw M3 grub x 6mm |
### Printed
| Qty | Filename |
| ---:|:--- |
| 1 | BTT_encoder_knob.stl |
| 1 | KY_040_encoder_knob.stl |
| 1 | imperial_pot_knob.stl |
| 1 | imperial_pot_x2_knob.stl |
| 1 | metric_pot_knob.stl |
<a href="#top">Top</a>
---

View File

@@ -82,6 +82,7 @@ def codify(word, url):
def fixup_comment(comment, url):
comment = comment.replace('cnc_bit+_r', 'cnc_bit_r')
""" markup code words and fix new paragraphs """
result = ''
word = ''
@@ -161,6 +162,6 @@ if __name__ == '__main__':
# Print commits excluding merges
if not c.comment.startswith('Merge branch') and not c.comment.startswith('Merge pull') and not re.match(r'U..ated changelog.*', c.comment):
if not c.comment.startswith('Merge branch') and not c.comment.startswith('Merge pull') and not re.match(r'U..ated chang.*log.*', c.comment):
print('* %s [`%s`](%s "show commit") %s %s\n' % (c.date, c.hash[:7], url + '/commit/' + c.hash, initials(c.author), fixup_comment(c.comment, url)), file = file)
do_cmd(('codespell -w -L od ' + filename).split())

View File

@@ -21,9 +21,11 @@ use <../utils/layout.scad>
include <../vitamins/7_segments.scad>
function digits(s) = 7_segment_digits(s) < 2 ? 2 : 1;
module 7_segments()
layout([for(s = 7_segments) 7_segment_size(s).x * 2], 5) let(s = 7_segments[$i])
7_segment_digits(s, 2);
layout([for(s = 7_segments) 7_segment_size(s).x * digits(s)], 3) let(s = 7_segments[$i])
7_segment_digits(s, digits(s));
if($preview)
7_segments();

View File

@@ -16,20 +16,32 @@
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
show_cutout = false;
include <../core.scad>
include <../vitamins/psus.scad>
use <../utils/layout.scad>
module psus()
layout([for(p = psus) psu_width(p)], 10) let(p = psus[$i])
layout([for(p = psus) atx_psu(p) ? psu_length(p) : psu_width(p)], 10) let(p = psus[$i])
rotate(atx_psu(p) ? 0 : 90) {
psu(p);
psu_screw_positions(p)
translate_z(3)
screw_and_washer(psu_screw(p), 8);
if(show_cutout && atx_psu(p))
#atx_psu_cutout(p);
}
if($preview)
if($preview) {
psus();
for(p = psus_not_shown)
hidden()
psu(p);
}

58
tests/knob.scad Normal file
View File

@@ -0,0 +1,58 @@
//
// NopSCADlib Copyright Chris Palmer 2021
// 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/>.
//
z = 1; // [0: 5]
thickness = 3; // [0: 5]
shaft_length = 10;
include <../core.scad>
use <../printed/knob.scad>
use <../utils/layout.scad>
include <../vitamins/potentiometers.scad>
knobs = [for(i = [0 : len(potentiometers) - 1]) let(p = potentiometers[i])
knob_for_pot(p, thickness, z, shaft_length = pot_shaft(p).z > 20 ? shaft_length : undef,
top_d = [10, 12, 20, 16, 16 ][i],
bot_d = [10, 15, 20, 20, 20 ][i],
skirt = [false, [20, 2], false, [27, 1.5], [27, 1.5]][i],
pointer = [false, false, [14, [1, 5], 2], [13.5, [1, 1], 3], [13.5, [1, 3], 3]][i],
screw = let(s = pot_shaft(p)) s.y > s.x / 2 ? M3_grub_screw : false
)];
module knobs(show_pot = false)
layout([for(p = potentiometers) pot_size(p).x], 5) let(p = potentiometers[$i])
if($preview) {
translate_z(z)
knob_assembly(knobs[$i]);
if(show_pot)
translate_z(-thickness)
vflip() {
potentiometer(p, shaft_length = shaft_length);
translate_z(-thickness)
pot_nut(p);
}
}
else
knob(knobs[$i]);
knobs(true);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 38 KiB

BIN
tests/png/knob.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 KiB

After

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 181 KiB

View File

@@ -103,7 +103,7 @@ module drill(r, h = 100, center = true) //! Make a cylinder for drilling holes s
module poly_drill(r, h = 100, center = true) //! Make a cylinder for drilling holes suitable for CNC routing if cnc_bit_r is non zero, otherwise a poly_cylinder.
if(cnc_bit_r)
drill(r, h, center = true);
drill(r, h, center = center);
else
poly_cylinder(r, h, center);

View File

@@ -18,22 +18,33 @@
//
//
//! 7 Segment displays
//! 7 Segment displays.
//!
//! Can be single digits stacked side by side or can be multiple digits in one unit. This is determined by the overall width compared to the width of a digit.
//! Presence of a decimal point is determined by the number of pins. Its position is determined by a heuristic.
//
include <../utils/core/core.scad>
function 7_segment_size(type) = type[1]; //! Size of the body
function 7_segment_digit_size(type) = type[2]; //! Size of the actual digit and segemnt width and angle
function 7_segment_digit_size(type) = type[2]; //! Size of the actual digit and segment width and angle
function 7_segment_pins(type) = type[3]; //! [x, y] array of pins
function 7_segment_pin_pitch(type) = type[4]; //! x and y pin pitches and pin diameter
function 7_segment_digits(type) = let(d = 7_segment_digit_size(type)) floor(7_segment_size(type).x / (d.x + d.y * tan(d[3])));
module 7_segment_digit(type, colour = grey(95), pin_length = 6.4) { //! Draw the specified 7 segment digit
size = 7_segment_size(type);
digit = 7_segment_digit_size(type);
pins = 7_segment_pins(type);
pin_pitch = 7_segment_pin_pitch(type);
t = digit[2];
a = digit[3];
digits = 7_segment_digits(type);
pitch = size.x / digits;
has_dp = (pins.x * pins.y) > 7 + digits;
color(grey(95))
linear_extrude(size.z)
square([size.x - 0.1, size.y], center = true);
@@ -43,48 +54,48 @@ module 7_segment_digit(type, colour = grey(95), pin_length = 6.4) { //! Draw the
cube([size.x - 0.1, size.y, eps], center = true);
color(colour)
translate_z(size.z)
linear_extrude(2 * eps) {
t = digit[2];
a = digit[3];
sq = [digit.x - 2 * t, (digit.y - 3 * t) / 2];
for(i = [0 : digits - 1])
translate([(i - (digits - 1) / 2) * pitch, 0, size.z])
linear_extrude(2 * eps) {
sq = [digit.x - 2 * t, (digit.y - 3 * t) / 2];
multmatrix([ // Skew
[1, tan(a), 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
])
difference() {
square([digit.x, digit.y], center = true);
multmatrix([ // Skew
[1, tan(a), 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
])
difference() {
square([digit.x, digit.y], center = true);
for(y = [-1, 1], x = [-1, 1]) {
translate([0, y * (t + sq.y) / 2])
square(sq, center = true);
for(y = [-1, 1], x = [-1, 1]) {
translate([0, y * (t + sq.y) / 2])
square(sq, center = true);
translate([x * digit.x / 2, y * digit.y / 2])
rotate(-45 * x * y) {
square([10, t], center = true);
translate([x * digit.x / 2, y * digit.y / 2])
rotate(-45 * x * y) {
square([10, t], center = true);
square([t / 5, 10], center = true);
}
square([t / 5, 10], center = true);
}
translate([x * (digit.x - t) / 2, 0])
rotate(45) {
square([t / 5, t * 2], center = true);
translate([x * (digit.x - t) / 2, 0])
rotate(45) {
square([t / 5, t * 2], center = true);
square([t * 2, t / 5], center = true);
square([t * 2, t / 5], center = true);
translate([x * t / 2, -x * t / 2])
square([t, t], center = true);
}
translate([x * t / 2, -x * t / 2])
square([t, t], center = true);
}
}
}
r = 1.25 * t / 2;
if(has_dp)
translate([max(digit.x / 2 + digit.y / 2 * tan(a) - r, digit.x / 2 - digit.y /2 * tan(a) + r * 1.25), -digit.y / 2 + r])
circle(r);
}
r = 1.25 * t / 2;
translate([digit.x / 2 - r + digit.y / 2 * tan(a), -digit.y / 2 + r])
circle(r);
}
color(silver)
translate_z(-pin_length)

View File

@@ -21,8 +21,10 @@
//! 7 Segment displays
//
02531A = ["02531A", [15.0, 8, 4.0], [3.5, 6.2, 0.7, 5], [5, 2], [inch(0.1), inch(0.1), 0.45]];
02352A = ["02352A", [15.0, 8, 4.0], [3.5, 6.2, 0.6, 5], [6, 2], [inch(0.1), 5.52, 0.45]];
WT5011BSR = ["WT5011BSR", [12.7, 19, 8.2], [7.2, 12.7, 1.2, 10], [5, 2], [inch(0.1), inch(0.6), 0.4]];
7_segments = [ WT5011BSR ];
7_segments = [02531A, 02352A, WT5011BSR];
use <7_segment.scad>

View File

@@ -30,6 +30,7 @@ T5x6 = ["T", 5, 6, 2.2, 1.2, 0.5];
T5x10 = ["T", 5, 10, 2.2, 1.2, 0.5];
T2p5x6 =["T", 2.5, 6, 1.7, 0.7, 0.3];
GT2x6 = ["GT", 2.0, 6, 1.38, 0.75, 0.254];
GT2x9 = ["GT", 2.0, 9, 1.38, 0.75, 0.254];
belts = [T5x6, T5x10, T2p5x6, GT2x6];
belts = [T5x6, T5x10, T2p5x6, GT2x6, GT2x9];
use <belt.scad>

View File

@@ -138,6 +138,6 @@ module extrusion(type, length, center = true, cornerHole = false) { //! Draw the
vitamin(str("extrusion(", type[0], ", ", length, arg(cornerHole, false, "cornerHole"), "): Extrusion ", type[0], " x ", length, "mm"));
color(grey(90))
linear_extrude(length, center = center)
linear_extrude(length, center = center, convexity = 8)
extrusion_cross_section(type, cornerHole);
}

View File

@@ -68,7 +68,7 @@ module fuseholder(thickness) { //! Fuseholder with nut in place for specified pa
colour = grey(40);
vflip()
translate_z(thickness)
explode(height) {
explode(height, explode_children = true) {
color(colour) {
tube(or = nut_d / 2, ir = thread_d / 2, h = nut_flange_t, center = false);
@@ -79,7 +79,7 @@ module fuseholder(thickness) { //! Fuseholder with nut in place for specified pa
circle(d = thread_d);
}
}
if(show_threads)
if(show_threads && exploded())
female_metric_thread(thread_d, thread_p, nut_t, false, colour = colour);
}
//

View File

@@ -203,9 +203,10 @@ module iec(type) { //! Draw specified IEC connector
function iec_spade_depth(type) = iec_depth(type) + max([for(spade = iec_spades(type)) spade[1]]);
module iec_screw_positions(type) //! Position children at the screw holes
for(side = [-1, 1])
translate([side * iec_pitch(type) / 2, 0])
children();
if(iec_pitch(type))
for(side = [-1, 1])
translate([side * iec_pitch(type) / 2, 0])
children();
module iec_holes(type, h = 100, poly = false, horizontal = false, insert = false) { //! Drill the required panel holes
clearance = 0.2;

View File

@@ -59,7 +59,8 @@ IEC_320_C14_switched_fused_inlet = ["IEC_320_C14_switched_fused_inlet", "IEC320
M3_cs_cap_screw, 40, 27, 16,46.8,3,28, 48, 2.4, 1.0, 33, 57, 4, 3.0, 48,16.5, iec320c14FusedSwitchedSpades, false ];
IEC_inlet = ["IEC_inlet", "IEC inlet", M3_cs_cap_screw, 40, 28, 18, 20, 3, 28, 20.5, 4, 2.5, 37, 23, 1, 2.5, 48, 14, inlet_spades, false ];
IEC_inlet_atx = ["IEC_inlet_atx", "IEC inlet for ATX", M3_cs_cap_screw, 40, 27, 18, 19, 3, 30.5, 22, 2, 2.0, 30.5, 22, 2, 4.0, 50, 15, atx_spades, false ];
IEC_inlet_atx2 = ["IEC_inlet_atx2", "IEC pressfit inlet for ATX", M3_cs_cap_screw, 0, 27, 18, 19, 3, 30.5, 22, 1, 0, 30.5, 22, 1, 4.0, 50, 15, atx_spades, false ]; // lugless
IEC_outlet = ["IEC_outlet", "IEC outlet RS 811-7193", M3_cs_cap_screw, 40, 32, 18, 24, 3, 28, 20.5, 2, 0.0, 29, 29, 2, 2.8, 50, 23, outlet_spades, true ];
iecs = [IEC_inlet, IEC_inlet_atx, IEC_fused_inlet, IEC_fused_inlet2, IEC_320_C14_switched_fused_inlet, IEC_outlet];
iecs = [IEC_inlet_atx2, IEC_inlet, IEC_inlet_atx, IEC_fused_inlet, IEC_fused_inlet2, IEC_320_C14_switched_fused_inlet, IEC_outlet];
use <iec.scad>

View File

@@ -29,10 +29,11 @@ use <../utils/thread.scad>
use <ring_terminal.scad>
function jack_4mm_hole_radius() = 8/2; //! Panel hole radius for 4mm jack
function jack_4mm_flange_radius() = 10.6 / 2; //! 4mm jack socket flange radius
module jack_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm jack socket with nut positioned for specified panel thickness
vitamin(str("jack_4mm(\"", colour, "\", 3", arg(display_colour, false), "): 4mm jack socket ", colour));
flange_d = 10.6;
flange_r = jack_4mm_flange_radius();
flange_t = 3;
flange_id = 4.6;
length = 28.5;
@@ -50,7 +51,7 @@ module jack_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm jack
explode(length, offset = -length + flange_t) {
color(display_colour ? display_colour : colour) rotate_extrude() difference() {
union() {
square([flange_d / 2, flange_t]);
square([flange_r, flange_t]);
translate([0, -sleaved])
square([sleaved_d / 2, sleaved]);
@@ -77,12 +78,12 @@ module jack_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm jack
spade(spade4p8l, spade);
}
translate_z(-thickness)
explode(-length)
explode(-length, explode_children = true)
vflip() {
color(silver)
tube(ir = thread_d / 2, or = nut_d / 2, h = nut_t, center = false);
if(show_threads)
if(show_threads && exploded())
female_metric_thread(thread_d, thread_p, nut_t, false, colour = silver);
}
}

View File

@@ -22,10 +22,11 @@
//
include <../utils/core/core.scad>
function magnet_od(type) = type[1]; //! Outer diameter
function magnet_id(type) = type[2]; //! Inside diameter if a ring
function magnet_h(type) = type[3]; //! Height
function magnet_r(type) = type[4]; //! Corner radius
function magnet_name(type) = type[1]; //! Name
function magnet_od(type) = type[2]; //! Outer diameter
function magnet_id(type) = type[3]; //! Inside diameter if a ring
function magnet_h(type) = type[4]; //! Height
function magnet_r(type) = type[5]; //! Corner radius
module magnet(type) { //! Draw specified magnet
od = magnet_od(type);
@@ -33,7 +34,7 @@ module magnet(type) { //! Draw specified magnet
h = magnet_h(type);
r = magnet_r(type);
vitamin(str("magnet(", type[0], "): Magnet ", od, "mm diameter, ", h, "mm high", id ? str(", ", id, "mm bore") : "" ));
vitamin(str("magnet(", type[0], "): ", magnet_name(type), ", ", od, "mm diameter, ", h, "mm high", id ? str(", ", id, "mm bore") : "" ));
or = od / 2;
ir = id / 2;

View File

@@ -20,11 +20,12 @@
//! Cylindrical and ring magnets.
//
// od, id, h, r
MAG8x4x4p2 = ["MAG8x4x4p2", 8, 4.2, 4, 0.5];
MAG484 = ["MAG484", inch(1/4), inch(1/8), inch(1/4), 0.5];
MAG5x8 = ["MAG5x8", 8, 0, 5, 0.5];
// name, od, id, h, r
MAG8x4x4p2 = ["MAG8x4x4p2", "Magnet", 8, 4.2, 4, 0.5];
MAG484 = ["MAG484", "Magnet", inch(1/4), inch(1/8), inch(1/4), 0.5];
MAG5x8 = ["MAG5x8", "Magnet", 8, 0, 5, 0.5];
MAGRE6x2p5 = ["MAGRE6x2p5", "Radial encoder magnet", 6, 0, 2.5, 0.5];
magnets = [MAG8x4x4p2, MAG484, MAG5x8];
magnets = [MAG8x4x4p2, MAG484, MAG5x8, MAGRE6x2p5];
use <magnet.scad>

View File

@@ -27,21 +27,21 @@ pot_proud = 0.3;
spigot_r = 0.5;
tab = [3.2, 0.5];
function pot_body(type) = type[0]; //! Body diameter or width & depth, height and corner radius
function pot_face(type) = type[1]; //! Faceplate rib width, plate depth and plate height
function pot_wafer(type) = type[2]; //! Width, diameter and thickness of the track wafer plus true if curved
function pot_gangs(type) = type[3]; //! Number of gangs for mult-gang pot
function pot_thread_d(type) = type[4]; //! Nomininal thread diameter
function pot_thread_p(type) = type[5]; //! Thread pritch
function pot_thread_h(type) = type[6]; //! Height of threaded part
function pot_boss_d(type) = type[7]; //! Boss diameter
function pot_boss_h(type) = type[8]; //! Boss height
function pot_spigot(type) = type[9]; //! Spigot width, length and height above the boss
function pot_spigot_x(type) = type[10]; //! Spigot offset from the shaft centre
function pot_shaft(type) = type[11]; //! Diameter, flat diameter, length and flat/slot length and colour. If flat diameter is less than the radius then it is a slot width
function pot_neck(type) = type[12]; //! Diameter and length of the shaft neck
function pot_nut(type) = type[13]; //! Across flat diameter and thickness of the nut
function pot_washer(type) = type[14]; //! Outside diameter and thickness of the washer
function pot_body(type) = type[1]; //! Body diameter or width & depth, height and corner radius
function pot_face(type) = type[2]; //! Faceplate rib width, plate depth and plate height
function pot_wafer(type) = type[3]; //! Width, diameter and thickness of the track wafer plus true if curved
function pot_gangs(type) = type[4]; //! Number of gangs for mult-gang pot
function pot_thread_d(type) = type[5]; //! Nomininal thread diameter
function pot_thread_p(type) = type[6]; //! Thread pritch
function pot_thread_h(type) = type[7]; //! Height of threaded part
function pot_boss_d(type) = type[8]; //! Boss diameter
function pot_boss_h(type) = type[9]; //! Boss height
function pot_spigot(type) = type[10]; //! Spigot width, length and height above the boss
function pot_spigot_x(type) = type[11]; //! Spigot offset from the shaft centre
function pot_shaft(type) = type[12]; //! Diameter, flat diameter, length and flat/slot length and colour. If flat diameter is less than the radius then it is a slot width
function pot_neck(type) = type[13]; //! Diameter and length of the shaft neck
function pot_nut(type) = type[14]; //! Across flat diameter and thickness of the nut
function pot_washer(type) = type[15]; //! Outside diameter and thickness of the washer
function pot_size(type) = let(d = pot_body(type)) len(d) > 3 ? [d.x , d.y, d.z] : [d.x, d.x, d.y]; //! Get pot body dimensions
@@ -86,7 +86,7 @@ module pot_nut(type, washer = true) { //! Draw the nut for a potentiometer and p
}
}
module potentiometer(type, thickness = 3, shaft_length = undef) {//! Draw a potentiometer with nut spaced by specified thickness
module potentiometer(type, thickness = 3, shaft_length = undef, value = false) {//! Draw a potentiometer with nut spaced by specified thickness
bh = pot_boss_h(type);
s = pot_size(type);
face = pot_face(type);
@@ -97,6 +97,7 @@ module potentiometer(type, thickness = 3, shaft_length = undef) {//! Draw a pote
thread_d = pot_thread_d(type);
thread_h = pot_thread_h(type);
shaft = pot_shaft(type);
vitamin(str("potentiometer(", type[0], "): ", slice(type[0], start = -8) != "_encoder" ? "Potentiometer " : "", value ? value : type[0]));
color(dia_cast_colour) {
// Boss
@@ -210,7 +211,7 @@ module potentiometer(type, thickness = 3, shaft_length = undef) {//! Draw a pote
color(shaft[4])
vflip()
cylinder(d = shaft.x, h = gap);
cylinder(d = shaft.x, h = gap);
}
}

View File

@@ -17,12 +17,12 @@
// If not, see <https://www.gnu.org/licenses/>.
//
//! Potentiometers and rotary encoders
// body h r face wafer gangs thread d pitch h boss h spigot w, l, h offset shaft d flat d shaft h flat h colour neck nut washer
imperial_pot_x2 = [[24, 22.5, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 2, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, silver], [0, 0], [13.3, 2.4, brass], [17.4, 0.8, grey(20), 9]];
imperial_pot = [[24, 12, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 1, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, grey(95)], [0, 0], [13.3, 2.4, brass], [17.4, 0.8, grey(20), 9]];
metric_pot = [[23, 11, 1.0], [0, 15.33, 0.8], [18, 27, 1.2, false], 1, 10, 0.75, 7.32, 13.9, 2.5, [1.12, 2.88, 1.26], 11, [6.27, 5.5, 43.8, 43.5, grey(50)], [0, 0], [12.8, 2, silver], [17.7, 0.8, grey(20), 10]];
KY_040_encoder = [[12, 12, 6.5, 1.0], false, false, 1, 7, 0.75, 7, 0, 0, [0.4, 2, 0.8],5.8, [6, 4.5, 13, 10, grey(60)], [4, 0.5],[9.8, 2.2, silver], [11.5, 0.4, silver]];
BTT_encoder = [[12, 11, 6, 0.5], false, false, 1, 6, 0.8, 4.5, 0, 0, false, 0, [5, 0.75, 9.5, 9, silver], [3, 0.5]];
// body h r face wafer gangs thread d pitch h boss h spigot w, l, h offset shaft d flat d shaft h flat h colour neck nut washer
imperial_pot_x2 = ["imperial_pot_x2", [24, 22.5, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 2, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, silver], [0, 0], [13.3, 2.4, brass], [17.4, 0.8, grey(20), 9]];
imperial_pot = ["imperial_pot", [24, 12, 1.5], [5.7, 15.33, 0.8], [20, 28, 1.6, true], 1, inch(3/8), inch(1/32), 6.35, 13.6, 2.4, [1.12, 3.03, 2], 11, [6.27, 5.5, 44.3, 44.3, grey(95)], [0, 0], [13.3, 2.4, brass], [17.4, 0.8, grey(20), 9]];
metric_pot = ["metric_pot", [23, 11, 1.0], [0, 15.33, 0.8], [18, 27, 1.2, false], 1, 10, 0.75, 7.32, 13.9, 2.5, [1.12, 2.88, 1.26], 11, [6.27, 5.5, 43.8, 43.5, grey(50)], [0, 0], [12.8, 2, silver], [17.7, 0.8, grey(20), 10]];
KY_040_encoder = ["KY_040_encoder", [12, 12, 6.5, 1.0], false, false, 1, 7, 0.75, 7, 0, 0, [0.4, 2, 0.8],5.8, [6, 4.5, 13, 10, grey(60)], [4, 0.5],[9.8, 2.2, silver], [11.5, 0.4, silver]];
BTT_encoder = ["BTT_encoder", [12, 11, 6, 0.5], false, false, 1, 6, 0.8, 4.5, 0, 0, false, 0, [5, 0.75, 9.5, 9, silver], [3, 0.5]];
potentiometers = [BTT_encoder, KY_040_encoder, metric_pot, imperial_pot, imperial_pot_x2];

View File

@@ -39,6 +39,7 @@ function psu_face_fan(type) = type[4]; //! Fan x,y position and typ
function psu_face_iec(type) = type[5]; //! IEC connector x,y, rotation and type
function psu_face_switch(type) = type[6]; //! Rocker switch x,y, rotation and type
function psu_face_vents(type) = type[7]; //! Vents array position x,y, rotation, size and corner radius
function psu_face_cutout(type) = type[8]; //! Panel cutout to accommodate this face, e.g. for ATX
function psu_name(type) = type[1]; //! The part name
function psu_length(type) = type[2]; //! Length
@@ -124,19 +125,23 @@ function psu_face_transform(type, face) = //! Returns a transformation
translations = [h / 2, h / 2, l / 2 - left, l / 2 - right, w / 2, w / 2]
) translate([0, 0, h / 2]) * rotate(rotations[face]) * translate([0, 0, translations[face]]);
grill_hole = 4.5;
grill_gap = 1.5;
module psu_grill(width, height) {
nx = floor(width / (grill_hole + grill_gap));
module psu_grill(width, height, grill_hole = 4.5, grill_gap = 1.5, fn = 0, avoid = []) {
nx = floor(width / (grill_hole + grill_gap)) + 1;
xpitch = width / nx;
ny = floor(height / ((grill_hole + grill_gap) * cos(30)));
ny = floor(height / ((grill_hole + grill_gap) * cos(30))) + 1;
ypitch = height / ny;
r = grill_hole / 2;
avoid = avoid ? [for(p = avoid) [[p.x - p[2] / 2 - r, p.y - p[3] / 2 - r], [p.x + p[2] / 2 + r, p.y + p[3] / 2 + r]]] : false;
function in(regions, x, y) = [for(r = regions) if(x >= r[0].x && x <= r[1].x && y >= r[0].y && y <= r[1].y) true];
for(y = [0 : ny - 1], x = [0 : nx - 1 - (y % 2)]) {
x = -width / 2 + (x + 0.5 + (y % 2) / 2) * xpitch;
y = -height / 2 + (y + 0.5) * ypitch;
translate([x, y])
circle(d = grill_hole);
if(!avoid || !in(avoid, x, y))
translate([x, y])
rotate(30)
circle(r, $fn = fn);
}
}
@@ -185,12 +190,20 @@ module psu(type) { //! Draw a power supply
translate(h)
drill(screw_pilot_hole(psu_screw(type)), 0);
if(psu_face_grill(f)) {
mx = 6;
my1 = i == f_top && psu_face_grill(faces[f_back]) ? 0 : 6;
my2 = i == f_back && psu_face_grill(faces[f_top]) ? 0 : 6;
translate([0, (my2 - my1) / 2])
psu_grill(xw - 2 * mx, yw - my1 - my2);
g = psu_face_grill(f);
if(g) {
list = is_list(g);
hole = list ? g[0] : 4.5;
gap = list ? g[1] : 1.5;
fn = list ? g[2] : 0;
margins = list ? g[3] : [6, 6, 6, 6];
avoid = list ? g[4] : [];
mx1 = margins[0];
mx2 = margins[1];
my1 = i == f_top && psu_face_grill(faces[f_back]) ? 0 : margins[2];
my2 = i == f_back && psu_face_grill(faces[f_top]) ? 0 : margins[3];
translate([(mx1 - mx2) / 2, (my2 - my1) / 2])
psu_grill(xw - mx1 - mx2, yw - my1 - my2, grill_hole = hole, grill_gap = gap, fn = fn, avoid = avoid);
}
if(fan)
translate([fan.x, fan.y]) intersection() {
@@ -234,7 +247,7 @@ module psu(type) { //! Draw a power supply
}
if(iec)
translate([iec.x, iec.y])
translate([iec.x, iec.y, t])
rotate(iec.z)
iec_assembly(iec[3], t);
@@ -333,22 +346,9 @@ module psu_screw_positions(type, face = undef) { //! Position children at the sc
children();
}
module atx_psu_cutout(type) { //! Cut out for the rear of an ATX
holes = psu_face_holes(psu_faces(type)[f_front]);
translate([holes[0].x, -psu_width(type) / 2, psu_height(type) / 2 + holes[0].y])
rotate([90, 0, 0])
linear_extrude(100, center = true)
round(5)
polygon([ // https://www.techpowerup.com/forums/threads/pc-component-dimensions.157239, tweaked
[18.7, -13],
[ 5.7, 0],
[ 5.7, 54],
[18.7, 67],
[127, 67],
[140, 67 - 13 / tan(52)],
[140, -5 + 11 / tan(52)],
[129, -5],
[81.3, -5],
[73.3, -13],
]);
module atx_psu_cutout(type, face = f_front) { //! Cut out for the rear of an ATX, which is actually f_front!
multmatrix(psu_face_transform(type, face))
linear_extrude(100, center = true)
round(5)
polygon(psu_face_cutout(psu_faces(type)[face]));
}

View File

@@ -62,12 +62,64 @@ ATX500 =
[[], 0.8, []],
[[], 0.8, []],
[[], 0.8, []],
[[[-69, -27], [-69, 37], [69, 37], [45, -37]], 0.8, [], false, [-25, 0, fan80x25], [45, -19.6, 180, IEC_inlet_atx], [45, 23, 90, small_rocker]],
[[[-69, -27], [-69, 37], [69, 37], [45, -37]], 0.8, [], false, [-25, 0, fan80x25], [45, -19.6, 180, IEC_inlet_atx], [45, 23, 90, small_rocker], false,
let(h0 = [-69, -27]) [ // https://www.techpowerup.com/forums/threads/pc-component-dimensions.157239, tweaked
[18.7, -13] + h0,
[ 5.7, 0] + h0,
[ 5.7, 54] + h0,
[18.7, 67] + h0,
[127, 67] + h0,
[140, 67 - 13 / tan(52)] + h0,
[140, -5 + 11 / tan(52)] + h0,
[129, -5] + h0,
[81.3, -5] + h0,
[73.3, -13] + h0,
]
],
[[], 0.8, [], true],
],
[": IEC mains lead"]
];
// Single fan in the top, wires exit opposite side from mains in
ATX300 = let(p = [113 / 2, 51.5 / 2], s = [125, 100, 64], iec = [35.5, 6], sw = [6.5, 7])
["ATX300", "FSP300-60GHX", s.x, s.y, s.z, No632_pan_screw, No6_clearance_radius, true, 0, 0, [],
[
[[], 0.5, []],
[[], 0.5, [], false, [0, 8, fan80x25]],
[[], 0.5, []],
[[], 0.5, []],
[[-p, p, [-p.x, p.y], [p.x, -p.y], [p.x, 0]], 0.5, [], [3, 0.6, 6, [6.3, 7, 6.4, 5.5], [
[-p.x, -p.y, 5, 5],
[-p.x, p.y, 5, 5],
[p.x, 0, 5, 100],
[p.x, p.y, 12, 6],
[p.x, -p.y, 12, 6],
[iec.x, iec.y, 32, 22],
[sw.x, sw.y, 20, 20],
[sw.x, sw.y, 27, 12],
]], false, [iec.x, iec.y, 180, IEC_inlet_atx2], [sw.x, sw.y, 90, small_rocker], false, [
[-s.x / 2 + 11.5, -s.z / 2 + 4.5],
[-s.x / 2 + 5.5, -s.z / 2 + 4.5 + 6 * tan(60)],
[-s.x / 2 + 5.5, s.z / 2 - 5.4 - 6 * tan(60)],
[-s.x / 2 + 11.5, s.z / 2 - 5.4],
[ s.x / 2 - 14, s.z / 2 - 5.4],
[ s.x / 2 - 10.5, s.z / 2 - 5.4 - 3.5 * tan(60)],
[ s.x / 2 - 10.5, -6],
[ s.x / 2 - 8, -8.5],
[ s.x / 2 - 8, -s.z / 2 + 4.5 + 6 * tan(60)],
[ s.x / 2 - 14, -s.z / 2 + 4.5],
]
],
[[], 0.5, []],
],
[": IEC mains lead"]
];
KY240W =
["KY240W", "KY-240W-12-L", 199, 110, 50, M3_cap_screw, M3_clearance_radius, false, 0, 0, [],
[
@@ -75,7 +127,6 @@ KY240W =
[ 199 / 2 - 12, 110 / 2 - 9 ],
[ 199 / 2 - 138, 110 / 2 - 93],
[ 199 / 2 - 138, 110 / 2 - 9 ]]]
],
[]
];
@@ -179,6 +230,8 @@ External =
[": IEC mains lead"]
];
psus = [PD_150_12, S_250_48, S_300_12, ATX500, KY240W];
psus = [PD_150_12, S_250_48, S_300_12, ATX300, ATX500];
psus_not_shown = [KY240W];
use <psu.scad>

View File

@@ -62,7 +62,9 @@ function screw_shorter_than(x) = x >= 20 ? floor(x / 5) * 5 : //! Returns the le
x >= 10 ? 10 :
x >= 8 ? 8 :
x >= 6 ? 6 :
5;
x >= 5 ? 5 :
x >= 4 ? 4 :
3;
function screw_length(screw, thickness, washers, insert = false, nyloc = false, nut = false, longer = false) = //! Returns the length of the longest or shortest screw that will got through `thickness` and `washers` and possibly an `insert`, `nut` or `nyloc`
let(washer = washers ? washers * washer_thickness(screw_washer(screw)) : 0,
@@ -127,21 +129,26 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
head_t = rad / 5;
head_height = head_rad + head_t;
rotate_extrude()
difference() {
polygon([[0, 0], [head_rad, 0], [head_rad, -head_t], [0, -head_height]]);
translate([0, -socket_depth + eps])
square([socket_rad, 10]);
}
translate_z(-socket_depth)
linear_extrude(socket_depth)
color(colour) {
rotate_extrude()
difference() {
circle(socket_rad + 0.1);
polygon([[0, 0], [head_rad, 0], [head_rad, -head_t], [0, -head_height]]);
children();
translate([0, -socket_depth + eps])
square([socket_rad, 10]);
}
translate_z(-socket_depth)
linear_extrude(socket_depth)
difference() {
circle(socket_rad + 0.1);
children();
}
}
color(colour * 0.9)
translate_z(-socket_depth)
cylinder(h=2 * eps, r=socket_rad, $fn = 6);
}
explode(length + 10) {
@@ -158,6 +165,9 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
}
}
color(colour * 0.9)
translate_z(head_height - socket_depth)
cylinder(h=2 * eps, r=socket_rad, $fn = 6);
shaft();
}
if(head_type == hs_grub) {
@@ -177,6 +187,9 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
translate_z(-length)
cylinder(r = r, h = length - socket_depth);
}
color(colour * 0.8)
translate_z(head_height - socket_depth)
cylinder(h=2 * eps, r=socket_rad, $fn = 6);
}
if(head_type == hs_hex) {
color(colour)
@@ -205,6 +218,9 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
square([socket_width, 2 * socket_rad], center = true);
}
}
color(colour * 0.9)
translate_z(head_height - socket_depth)
cylinder(h=2 * eps, r=socket_rad + eps);
shaft();
}
@@ -232,6 +248,9 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
circle(socket_rad, $fn = 6);
}
}
color(colour * 0.9)
translate_z(head_height - socket_depth)
cylinder(h=2 * eps, r=socket_rad, $fn = 6);
shaft();
}
@@ -239,19 +258,17 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
socket_rad = 0.6 * head_rad;
socket_depth = 0.3 * head_rad;
socket_width = 1;
color(colour)
cs_head(socket_rad, socket_depth) {
square([2 * socket_rad, socket_width], center = true);
square([socket_width, 2 * socket_rad], center = true);
}
cs_head(socket_rad, socket_depth) {
square([2 * socket_rad, socket_width], center = true);
square([socket_width, 2 * socket_rad], center = true);
}
shaft(socket_depth);
}
if(head_type == hs_cs_cap) {
color(colour)
cs_head(socket_rad, socket_depth)
circle(socket_rad, $fn = 6);
cs_head(socket_rad, socket_depth)
circle(socket_rad, $fn = 6);
shaft(socket_depth);
}