mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-10-01 01:16:44 +02:00
Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f51e93969d | ||
|
757b808f07 | ||
|
eca8f2eccc | ||
|
450224ec39 | ||
|
dcd2624a12 | ||
|
83e8502ecb | ||
|
a722df0b2b | ||
|
6d223c8d1f | ||
|
6d59ea2bc8 | ||
|
8243b244af | ||
|
1a2e04367d | ||
|
f97070099e | ||
|
729891b675 | ||
|
4b533cffd2 | ||
|
a40a2190dc | ||
|
6556d14a11 | ||
|
c7d12b20c9 | ||
|
545329b875 | ||
|
760e3a890d | ||
|
bd4f7b155b | ||
|
16c1eeef27 | ||
|
800bb89921 | ||
|
41a0723362 | ||
|
6b8ea9685e | ||
|
0cf8cb7d28 | ||
|
7c439a687f |
@@ -251,7 +251,7 @@ module drag_chain_link(type, start = false, end = false, check_kids = true) { //
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Need to use a wrapper because can't define nested modules in an assembly
|
// Need to use a wrapper because can't define nested modules in an assembly
|
||||||
module _drag_chain_assembly(type, pos = 0) {
|
module _drag_chain_assembly(type, pos = 0, render = false) {
|
||||||
s = drag_chain_size(type);
|
s = drag_chain_size(type);
|
||||||
x = (1 + exploded()) * s.x;
|
x = (1 + exploded()) * s.x;
|
||||||
r = drag_chain_radius(type) * x / s.x;
|
r = drag_chain_radius(type) * x / s.x;
|
||||||
@@ -278,8 +278,11 @@ module _drag_chain_assembly(type, pos = 0) {
|
|||||||
module link(n) // Position and colour link with origin at the hinge hole
|
module link(n) // Position and colour link with origin at the hinge hole
|
||||||
translate([-z / 2, 0, -z / 2]) {
|
translate([-z / 2, 0, -z / 2]) {
|
||||||
stl_colour(n < 0 || n == npoints - 1 ? pp3_colour : n % 2 ? pp1_colour : pp2_colour)
|
stl_colour(n < 0 || n == npoints - 1 ? pp3_colour : n % 2 ? pp1_colour : pp2_colour)
|
||||||
drag_chain_link(type, start = n == -1, end = n == npoints - 1, check_kids = false)
|
render_if(render)
|
||||||
let($fasteners = 0) children();
|
drag_chain_link(type, start = n == -1, end = n == npoints - 1, check_kids = false)
|
||||||
|
let($fasteners = 0)
|
||||||
|
children();
|
||||||
|
|
||||||
let($fasteners = 1) children();
|
let($fasteners = 1) children();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,15 +310,15 @@ module _drag_chain_assembly(type, pos = 0) {
|
|||||||
|
|
||||||
//! 1. Remove the support material from the links with side cutters.
|
//! 1. Remove the support material from the links with side cutters.
|
||||||
//! 1. Clip the links together with the special ones at the ends.
|
//! 1. Clip the links together with the special ones at the ends.
|
||||||
module drag_chain_assembly(type, pos = 0) //! Drag chain assembly
|
module drag_chain_assembly(type, pos = 0, render = false) //! Drag chain assembly
|
||||||
assembly(str(drag_chain_name(type), "_drag_chain"), big = true)
|
assembly(str(drag_chain_name(type), "_drag_chain"), big = true)
|
||||||
if($children == 2)
|
if($children == 2)
|
||||||
_drag_chain_assembly(type, pos) {
|
_drag_chain_assembly(type, pos, render) {
|
||||||
children(0);
|
children(0);
|
||||||
children(1);
|
children(1);
|
||||||
}
|
}
|
||||||
else if($children == 1)
|
else if($children == 1)
|
||||||
_drag_chain_assembly(type, pos)
|
_drag_chain_assembly(type, pos, render)
|
||||||
children(0);
|
children(0);
|
||||||
else
|
else
|
||||||
_drag_chain_assembly(type, pos);
|
_drag_chain_assembly(type, pos, render);
|
||||||
|
41
readme.md
41
readme.md
@@ -313,7 +313,7 @@ Models of radial blowers.
|
|||||||
| 4 | `screw(M2_cap_screw, 8)` | Screw M2 cap x 8mm |
|
| 4 | `screw(M2_cap_screw, 8)` | Screw M2 cap x 8mm |
|
||||||
| 3 | `screw(M3_cap_screw, 20)` | Screw M3 cap x 20mm |
|
| 3 | `screw(M3_cap_screw, 20)` | Screw M3 cap x 20mm |
|
||||||
| 2 | `screw(M4_cap_screw, 25)` | Screw M4 cap x 25mm |
|
| 2 | `screw(M4_cap_screw, 25)` | Screw M4 cap x 25mm |
|
||||||
| 1 | `blower(BL40x10)` | Square radial 4010 |
|
| 1 | `blower(BL40x10)` | Square radial fan 4010 |
|
||||||
| 4 | `washer(M2_washer)` | Washer M2 x 5mm x 0.3mm |
|
| 4 | `washer(M2_washer)` | Washer M2 x 5mm x 0.3mm |
|
||||||
| 3 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
|
| 3 | `washer(M3_washer)` | Washer M3 x 7mm x 0.5mm |
|
||||||
| 2 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
|
| 2 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
|
||||||
@@ -1102,17 +1102,17 @@ Needs updating as mostly obsolete versions.
|
|||||||
### Vitamins
|
### Vitamins
|
||||||
| Qty | Module call | BOM entry |
|
| Qty | Module call | BOM entry |
|
||||||
| ---:|:--- |:---|
|
| ---:|:--- |:---|
|
||||||
| 2 | `tubing(HSHRNK16)` | Heatshrink sleeving ID 1.6mm x 15mm |
|
| 2 | `tubing(HSHRNK16)` | Heatshrink sleeving ID 1.6mm x 15mm - not shown |
|
||||||
| 4 | `tubing(HSHRNK64, 60)` | Heatshrink sleeving ID 6.4mm x 60mm |
|
| 4 | `tubing(HSHRNK64, 60)` | Heatshrink sleeving ID 6.4mm x 60mm |
|
||||||
| 1 | `e3d_hot_end(E3Dv5, 3)` | Hot end E3D V5 direct 3mm |
|
| 1 | `e3d_hot_end(E3Dv5, 3)` | Hot end E3D V5 direct 3mm |
|
||||||
| 1 | `e3d_hot_end(E3Dv6, 3)` | Hot end E3D V6 direct 3mm |
|
| 1 | `e3d_hot_end(E3Dv6, 3)` | Hot end E3D V6 direct 3mm |
|
||||||
| 1 | `e3d_hot_end(E3D_clone, 3)` | Hot end E3D clone aliexpress 3mm |
|
| 1 | `e3d_hot_end(E3D_clone, 3)` | Hot end E3D clone aliexpress 3mm |
|
||||||
| 1 | `jhead_hot_end(JHeadMk5, 3)` | Hot end JHead MK5 3mm |
|
| 1 | `jhead_hot_end(JHeadMk5, 3)` | Hot end JHead MK5 3mm |
|
||||||
| 2 | `tubing(PTFE07, 62)` | PTFE sleeving OD 1.2mm ID 0.71mm x 62mm |
|
| 2 | `tubing(PTFE07, 62)` | PTFE sleeving OD 1.2mm ID 0.71mm x 62mm - not shown |
|
||||||
| 2 | `tubing(PTFE20, 45)` | PTFE sleeving OD 2.6mm ID 2mm x 45mm |
|
| 2 | `tubing(PTFE20, 45)` | PTFE sleeving OD 2.6mm ID 2mm x 45mm - not shown |
|
||||||
| 1 | `resistor(RIE1212UB5C5R6)` | Resistor UB5C 5R6F 5R6 3W vitreous enamel |
|
| 1 | `resistor(RIE1212UB5C5R6)` | Resistor UB5C 5R6F 5R6 3W vitreous enamel - not shown |
|
||||||
| 1 | | Tape self amalgamating silicone 110mm x 25mm |
|
| 1 | | Tape self amalgamating silicone 110mm x 25mm |
|
||||||
| 1 | `resistor(Epcos)` | Thermistor Epcos B57560G104F 100K 1% |
|
| 1 | `resistor(Epcos)` | Thermistor Epcos B57560G104F 100K 1% - not shown |
|
||||||
| 2 | | Wire Red PTFE 16/0.2mm strands, length 170mm |
|
| 2 | | Wire Red PTFE 16/0.2mm strands, length 170mm |
|
||||||
| 4 | `ziptie(small_ziptie, 8)` | Ziptie 2.5mm x 100mm min length |
|
| 4 | `ziptie(small_ziptie, 8)` | Ziptie 2.5mm x 100mm min length |
|
||||||
|
|
||||||
@@ -1687,6 +1687,13 @@ 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 |
|
||||||
|
|
||||||
|
|
||||||
<a href="#top">Top</a>
|
<a href="#top">Top</a>
|
||||||
|
|
||||||
@@ -1771,6 +1778,7 @@ Used for limit switches.
|
|||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| `microswitch_lower_extent(type)` | How far legs extend downwards |
|
| `microswitch_lower_extent(type)` | How far legs extend downwards |
|
||||||
| `microswitch_right_extent(type)` | How far legs extend right |
|
| `microswitch_right_extent(type)` | How far legs extend right |
|
||||||
|
| `microswitch_size(type)` | Body size |
|
||||||
|
|
||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
@@ -2673,7 +2681,7 @@ Linear rails with carriages.
|
|||||||
| `rail(type, length)` | Draw the specified rail |
|
| `rail(type, length)` | Draw the specified rail |
|
||||||
| `rail_assembly(type, length, pos, carriage_end_colour = grey(20)` | Rail and carriage assembly |
|
| `rail_assembly(type, length, pos, carriage_end_colour = grey(20)` | Rail and carriage assembly |
|
||||||
| `rail_hole_positions(type, length, first = 0, screws = 100, both_ends = true)` | Position children over screw holes |
|
| `rail_hole_positions(type, length, first = 0, screws = 100, both_ends = true)` | Position children over screw holes |
|
||||||
| `rail_screws(type, length, thickness, screws = 100)` | Place screws in the rail |
|
| `rail_screws(type, length, thickness, screws = 100, index_screws = undef)` | Place screws in the rail |
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -3768,6 +3776,7 @@ Veroboard with mounting holes, track breaks, removed tracks, solder points and c
|
|||||||
| Function | Description |
|
| Function | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| `vero_length(type)` | Length of the board |
|
| `vero_length(type)` | Length of the board |
|
||||||
|
| `vero_size(type)` | Board size |
|
||||||
| `vero_thickness(type)` | Thickness of the substrate |
|
| `vero_thickness(type)` | Thickness of the substrate |
|
||||||
| `vero_track_thickness(type)` | Thickness of the tracks |
|
| `vero_track_thickness(type)` | Thickness of the tracks |
|
||||||
| `vero_track_width(type)` | The width of the tracks |
|
| `vero_track_width(type)` | The width of the tracks |
|
||||||
@@ -4550,7 +4559,7 @@ to the assembly, for example to add inserts.
|
|||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| `drag_chain_assembly(type, pos = 0)` | Drag chain assembly |
|
| `drag_chain_assembly(type, pos = 0, render = false)` | Drag chain assembly |
|
||||||
| `drag_chain_link(type, start = false, end = false, check_kids = true)` | One link of the chain, special case for start and end |
|
| `drag_chain_link(type, start = false, end = false, check_kids = true)` | One link of the chain, special case for start and end |
|
||||||
| `drag_chain_screw_positions(type, end)` | Place children at the screw positions, end = 0 for the start, 1 for the end |
|
| `drag_chain_screw_positions(type, end)` | Place children at the screw positions, end = 0 for the start, 1 for the end |
|
||||||
| `screw_lug(screw, h = 0)` | Create a D shaped lug for a screw |
|
| `screw_lug(screw, h = 0)` | Create a D shaped lug for a screw |
|
||||||
@@ -5728,7 +5737,8 @@ Cylinder with a rounded end.
|
|||||||
---
|
---
|
||||||
<a name="Rounded_polygon"></a>
|
<a name="Rounded_polygon"></a>
|
||||||
## Rounded_polygon
|
## Rounded_polygon
|
||||||
Draw a polygon with rounded corners. Each element of the vector is the XY coordinate and a radius. Radius can be negative for a concave corner.
|
Draw a polygon with rounded corners. Each element of the vector is the XY coordinate and a radius in clockwise order.
|
||||||
|
Radius can be negative for a concave corner.
|
||||||
|
|
||||||
Because the tangents need to be calculated to find the length these can be calculated separately and re-used when drawing to save calculating them twice.
|
Because the tangents need to be calculated to find the length these can be calculated separately and re-used when drawing to save calculating them twice.
|
||||||
|
|
||||||
@@ -5739,6 +5749,7 @@ Because the tangents need to be calculated to find the length these can be calcu
|
|||||||
### Functions
|
### Functions
|
||||||
| Function | Description |
|
| Function | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
|
| `circle_tangent(p1, p2)` | Compute the clockwise tangent between two circles represented as [x,y,r] |
|
||||||
| `rounded_polygon_length(points, tangents)` | Calculate the length given the point list and the list of tangents computed by ` rounded_polygon_tangents` |
|
| `rounded_polygon_length(points, tangents)` | Calculate the length given the point list and the list of tangents computed by ` rounded_polygon_tangents` |
|
||||||
| `rounded_polygon_tangents(points)` | Compute the straight sections needed to draw and to compute the lengths |
|
| `rounded_polygon_tangents(points)` | Compute the straight sections needed to draw and to compute the lengths |
|
||||||
|
|
||||||
@@ -6172,12 +6183,12 @@ do not intrude into the circle. See <https://hydraraptor.blogspot.com/2020/07/ho
|
|||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| `semi_teardrop(h, r, d = undef, center = true, chamfer = 0, plus = false)` | A semi teardrop in the positive Y domain |
|
| `semi_teardrop(h, r, d = undef, center = true, chamfer = 0, chamfer_both_ends = true, plus = false)` | A semi teardrop in the positive Y domain |
|
||||||
| `teardrop(h, r, center = true, truncate = true, chamfer = 0, plus = false)` | For making horizontal holes that don't need support material, set `truncate = false` to make traditional RepRap teardrops that don't even need bridging |
|
| `teardrop(h, r, center = true, truncate = true, chamfer = 0, chamfer_both_ends = true, plus = false)` | For making horizontal holes that don't need support material, set `truncate = false` to make traditional RepRap teardrops that don't even need bridging |
|
||||||
| `teardrop_chamfer(h, center, chamfer)` | Helper module for adding chamfer to a teardrop |
|
| `teardrop_chamfer(h, center, chamfer, chamfer_both_ends)` | Helper module for adding chamfer to a teardrop |
|
||||||
| `teardrop_plus(h, r, center = true, truncate = true, chamfer = 0)` | Slightly elongated teardrop to allow for the 3D printing staircase effect |
|
| `teardrop_plus(h, r, center = true, truncate = true, chamfer = 0, chamfer_both_ends = true)` | Slightly elongated teardrop to allow for the 3D printing staircase effect |
|
||||||
| `tearslot(h, r, w, center = true, chamfer = 0, plus = false)` | A horizontal slot that doesn't need support material |
|
| `tearslot(h, r, w, center = true, chamfer = 0, chamfer_both_ends = true, plus = false)` | A horizontal slot that doesn't need support material |
|
||||||
| `vertical_tearslot(h, r, l, center = true, chamfer = 0, plus = false)` | A vertical slot that doesn't need support material |
|
| `vertical_tearslot(h, r, l, center = true, chamfer = 0, chamfer_both_ends = true, plus = false)` | A vertical slot that doesn't need support material |
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@ from __future__ import print_function
|
|||||||
import subprocess, sys
|
import subprocess, sys
|
||||||
|
|
||||||
def run_list(args, silent = False, verbose = False):
|
def run_list(args, silent = False, verbose = False):
|
||||||
cmd = ["openscad.exe"] + args
|
cmd = ["openscad"] + args
|
||||||
if not silent:
|
if not silent:
|
||||||
for arg in cmd:
|
for arg in cmd:
|
||||||
print(arg, end=" ")
|
print(arg, end=" ")
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
//! Using teardrop_plus() or setting the plus option on other modules will elongate the teardrop vertically by the layer height, so when sliced the staircase tips
|
//! Using teardrop_plus() or setting the plus option on other modules will elongate the teardrop vertically by the layer height, so when sliced the staircase tips
|
||||||
//! do not intrude into the circle. See <https://hydraraptor.blogspot.com/2020/07/horiholes-2.html>
|
//! do not intrude into the circle. See <https://hydraraptor.blogspot.com/2020/07/horiholes-2.html>
|
||||||
//
|
//
|
||||||
module teardrop(h, r, center = true, truncate = true, chamfer = 0, plus = false) { //! For making horizontal holes that don't need support material, set `truncate = false` to make traditional RepRap teardrops that don't even need bridging
|
module teardrop(h, r, center = true, truncate = true, chamfer = 0, chamfer_both_ends = true, plus = false) { //! For making horizontal holes that don't need support material, set `truncate = false` to make traditional RepRap teardrops that don't even need bridging
|
||||||
module teardrop_2d(r, truncate) {
|
module teardrop_2d(r, truncate) {
|
||||||
er = layer_height / 2 - eps; // Extrustion edge radius
|
er = layer_height / 2 - eps; // Extrustion edge radius
|
||||||
R = plus ? r + er : r; // Corrected radius
|
R = plus ? r + er : r; // Corrected radius
|
||||||
@@ -52,7 +52,7 @@ module teardrop(h, r, center = true, truncate = true, chamfer = 0, plus = false)
|
|||||||
extrude_if(h, center)
|
extrude_if(h, center)
|
||||||
teardrop_2d(r, truncate);
|
teardrop_2d(r, truncate);
|
||||||
|
|
||||||
teardrop_chamfer(h, center, chamfer) {
|
teardrop_chamfer(h, center, chamfer, chamfer_both_ends) {
|
||||||
linear_extrude(eps, center = true)
|
linear_extrude(eps, center = true)
|
||||||
teardrop_2d(r + chamfer / 2, truncate);
|
teardrop_2d(r + chamfer / 2, truncate);
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ module teardrop(h, r, center = true, truncate = true, chamfer = 0, plus = false)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module semi_teardrop(h, r, d = undef, center = true, chamfer = 0, plus = false) { //! A semi teardrop in the positive Y domain
|
module semi_teardrop(h, r, d = undef, center = true, chamfer = 0, chamfer_both_ends = true, plus = false) { //! A semi teardrop in the positive Y domain
|
||||||
module semi_teardrop_2d(r, d)
|
module semi_teardrop_2d(r, d)
|
||||||
intersection() {
|
intersection() {
|
||||||
R = is_undef(d) ? r : d / 2;
|
R = is_undef(d) ? r : d / 2;
|
||||||
@@ -77,7 +77,7 @@ module semi_teardrop(h, r, d = undef, center = true, chamfer = 0, plus = false)
|
|||||||
extrude_if(h, center)
|
extrude_if(h, center)
|
||||||
semi_teardrop_2d(r, d);
|
semi_teardrop_2d(r, d);
|
||||||
|
|
||||||
teardrop_chamfer(h, center, chamfer) {
|
teardrop_chamfer(h, center, chamfer, chamfer_both_ends) {
|
||||||
linear_extrude(eps, center = true)
|
linear_extrude(eps, center = true)
|
||||||
semi_teardrop_2d(r + chamfer / 2, d);
|
semi_teardrop_2d(r + chamfer / 2, d);
|
||||||
|
|
||||||
@@ -87,10 +87,10 @@ module semi_teardrop(h, r, d = undef, center = true, chamfer = 0, plus = false)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module teardrop_plus(h, r, center = true, truncate = true, chamfer = 0) //! Slightly elongated teardrop to allow for the 3D printing staircase effect
|
module teardrop_plus(h, r, center = true, truncate = true, chamfer = 0, chamfer_both_ends = true) //! Slightly elongated teardrop to allow for the 3D printing staircase effect
|
||||||
teardrop(h, r, center, truncate, chamfer, plus = true);
|
teardrop(h, r, center, truncate, chamfer, chamfer_both_ends, plus = true);
|
||||||
|
|
||||||
module tearslot(h, r, w, center = true, chamfer = 0, plus = false) { //! A horizontal slot that doesn't need support material
|
module tearslot(h, r, w, center = true, chamfer = 0, chamfer_both_ends = true, plus = false) { //! A horizontal slot that doesn't need support material
|
||||||
module tearslot_2d(r, w)
|
module tearslot_2d(r, w)
|
||||||
hull()
|
hull()
|
||||||
for(x = [-1, 1])
|
for(x = [-1, 1])
|
||||||
@@ -99,7 +99,7 @@ module tearslot(h, r, w, center = true, chamfer = 0, plus = false) { //! A horiz
|
|||||||
extrude_if(h, center)
|
extrude_if(h, center)
|
||||||
tearslot_2d(r, w);
|
tearslot_2d(r, w);
|
||||||
|
|
||||||
teardrop_chamfer(h, center, chamfer) {
|
teardrop_chamfer(h, center, chamfer, chamfer_both_ends) {
|
||||||
linear_extrude(eps, center = true)
|
linear_extrude(eps, center = true)
|
||||||
tearslot_2d(r + chamfer / 2, w);
|
tearslot_2d(r + chamfer / 2, w);
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ module tearslot(h, r, w, center = true, chamfer = 0, plus = false) { //! A horiz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module vertical_tearslot(h, r, l, center = true, chamfer = 0, plus = false) { //! A vertical slot that doesn't need support material
|
module vertical_tearslot(h, r, l, center = true, chamfer = 0, chamfer_both_ends = true, plus = false) { //! A vertical slot that doesn't need support material
|
||||||
module vertical_tearslot_2d(r, l)
|
module vertical_tearslot_2d(r, l)
|
||||||
hull()
|
hull()
|
||||||
for(y = [-1, 1])
|
for(y = [-1, 1])
|
||||||
@@ -119,7 +119,7 @@ module vertical_tearslot(h, r, l, center = true, chamfer = 0, plus = false) { //
|
|||||||
extrude_if(h, center)
|
extrude_if(h, center)
|
||||||
vertical_tearslot_2d(r, l);
|
vertical_tearslot_2d(r, l);
|
||||||
|
|
||||||
teardrop_chamfer(h, center, chamfer) {
|
teardrop_chamfer(h, center, chamfer, chamfer_both_ends) {
|
||||||
linear_extrude(eps, center = true)
|
linear_extrude(eps, center = true)
|
||||||
vertical_tearslot_2d(r + chamfer / 2, l);
|
vertical_tearslot_2d(r + chamfer / 2, l);
|
||||||
|
|
||||||
@@ -129,10 +129,10 @@ module vertical_tearslot(h, r, l, center = true, chamfer = 0, plus = false) { //
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module teardrop_chamfer(h, center, chamfer) { //! Helper module for adding chamfer to a teardrop
|
module teardrop_chamfer(h, center, chamfer, chamfer_both_ends) { //! Helper module for adding chamfer to a teardrop
|
||||||
if(h && chamfer)
|
if(h && chamfer)
|
||||||
translate_z(center ? 0 : h / 2)
|
translate_z(center ? 0 : h / 2)
|
||||||
for(m = [0, 1])
|
for(m = chamfer_both_ends ? [0, 1] : [1])
|
||||||
mirror([0, 0, m])
|
mirror([0, 0, m])
|
||||||
translate_z((h - eps ) / 2)
|
translate_z((h - eps ) / 2)
|
||||||
hull()
|
hull()
|
||||||
|
@@ -18,13 +18,14 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
//! Draw a polygon with rounded corners. Each element of the vector is the XY coordinate and a radius. Radius can be negative for a concave corner.
|
//! Draw a polygon with rounded corners. Each element of the vector is the XY coordinate and a radius in clockwise order.
|
||||||
|
//! Radius can be negative for a concave corner.
|
||||||
//!
|
//!
|
||||||
//! Because the tangents need to be calculated to find the length these can be calculated separately and re-used when drawing to save calculating them twice.
|
//! Because the tangents need to be calculated to find the length these can be calculated separately and re-used when drawing to save calculating them twice.
|
||||||
//
|
//
|
||||||
include <../utils/core/core.scad>
|
include <../utils/core/core.scad>
|
||||||
|
|
||||||
function circle_tangent(p1, p2) =
|
function circle_tangent(p1, p2) = //! Compute the clockwise tangent between two circles represented as [x,y,r]
|
||||||
let(
|
let(
|
||||||
r1 = p1[2],
|
r1 = p1[2],
|
||||||
r2 = p2[2],
|
r2 = p2[2],
|
||||||
@@ -32,11 +33,8 @@ function circle_tangent(p1, p2) =
|
|||||||
dy = p2.y - p1.y,
|
dy = p2.y - p1.y,
|
||||||
d = sqrt(dx * dx + dy * dy),
|
d = sqrt(dx * dx + dy * dy),
|
||||||
theta = atan2(dy, dx) + acos((r1 - r2) / d),
|
theta = atan2(dy, dx) + acos((r1 - r2) / d),
|
||||||
xa = p1.x +(cos(theta) * r1),
|
v = [cos(theta), sin(theta)]
|
||||||
ya = p1.y +(sin(theta) * r1),
|
)[ p1 + r1 * v, p2 + r2 * v ];
|
||||||
xb = p2.x +(cos(theta) * r2),
|
|
||||||
yb = p2.y +(sin(theta) * r2)
|
|
||||||
)[ [xa, ya], [xb, yb] ];
|
|
||||||
|
|
||||||
function rounded_polygon_tangents(points) = //! Compute the straight sections needed to draw and to compute the lengths
|
function rounded_polygon_tangents(points) = //! Compute the straight sections needed to draw and to compute the lengths
|
||||||
let(len = len(points))
|
let(len = len(points))
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
// h h s t t
|
// h h s t t
|
||||||
RB5015 = ["RB5015", "Blower Runda RB5015", 51.3, 51, 15, 31.5, M4_cap_screw, 26, [27.3, 25.4], 4.5, [[4.3, 45.4], [47.3,7.4]], 20, 14, 1.5, 1.3, 1.2, 15];
|
RB5015 = ["RB5015", "Blower Runda RB5015", 51.3, 51, 15, 31.5, M4_cap_screw, 26, [27.3, 25.4], 4.5, [[4.3, 45.4], [47.3,7.4]], 20, 14, 1.5, 1.3, 1.2, 15];
|
||||||
PE4020 = ["PE4020", "Blower Pengda Technology 4020", 40, 40, 20, 27.5, M3_cap_screw, 22, [21.5, 20 ], 3.2, [[37,3],[3,37],[37,37]], 29.3, 17, 1.7, 1.2, 1.3, 13];
|
PE4020 = ["PE4020", "Blower Pengda Technology 4020", 40, 40, 20, 27.5, M3_cap_screw, 22, [21.5, 20 ], 3.2, [[37,3],[3,37],[37,37]], 29.3, 17, 1.7, 1.2, 1.3, 13];
|
||||||
BL40x10 =["BL40x10","Square radial 4010", 40, 40,9.5, 27, M2_cap_screw, 16, [24, 20 ], 2.4, [[2,2],[38,2],[2,38],[38,38]], 30 , 9.5, 1.5, 1.5, 1.1, 1.5];
|
BL40x10 =["BL40x10","Square radial fan 4010", 40, 40,9.5, 27, M2_cap_screw, 16, [24, 20 ], 2.4, [[2,2],[38,2],[2,38],[38,38]], 30 , 9.5, 1.5, 1.5, 1.1, 1.5];
|
||||||
|
|
||||||
blowers = [BL40x10, PE4020, RB5015];
|
blowers = [BL40x10, PE4020, RB5015];
|
||||||
|
|
||||||
|
@@ -34,15 +34,16 @@ hygrometer_hole_r = 21.3;
|
|||||||
slot_w = 5.5;
|
slot_w = 5.5;
|
||||||
|
|
||||||
module hygrometer_hole(h = 0) { //! Drill the hole for a hygrometer
|
module hygrometer_hole(h = 0) { //! Drill the hole for a hygrometer
|
||||||
round(cnc_bit_r) {
|
extrude_if(h)
|
||||||
intersection() {
|
round(cnc_bit_r) {
|
||||||
drill(hygrometer_hole_r, h);
|
intersection() {
|
||||||
|
drill(hygrometer_hole_r, 0);
|
||||||
|
|
||||||
rotate(30)
|
rotate(30)
|
||||||
square([slot_w + 2 * cnc_bit_r, 100], center = true);
|
square([slot_w + 2 * cnc_bit_r, 100], center = true);
|
||||||
|
}
|
||||||
|
drill((od + 0.2) / 2, 0);
|
||||||
}
|
}
|
||||||
drill((od + 0.2) / 2, h);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function hygrometer_or() = flange_d / 2; //! The outside radius of a hygrometer
|
function hygrometer_or() = flange_d / 2; //! The outside radius of a hygrometer
|
||||||
@@ -54,13 +55,13 @@ module hygrometer() { //! Draw a hygrometer
|
|||||||
color(grey(30))
|
color(grey(30))
|
||||||
rotate_extrude()
|
rotate_extrude()
|
||||||
polygon([
|
polygon([
|
||||||
[0, 0],
|
[0, 0],
|
||||||
[aperture_d / 2, 0],
|
[aperture_d / 2, 0],
|
||||||
[aperture_d / 2, flange_t],
|
[aperture_d / 2, flange_t],
|
||||||
[flange_d2 / 2, flange_t2],
|
[flange_d2 / 2, flange_t2],
|
||||||
[flange_d / 2, flange_t],
|
[flange_d / 2, flange_t],
|
||||||
[flange_d / 2, 0],
|
[flange_d / 2, 0],
|
||||||
[od / 2, 0],
|
[od / 2, 0],
|
||||||
[od / 2, -h],
|
[od / 2, -h],
|
||||||
[0, -h]
|
[0, -h]
|
||||||
]);
|
]);
|
||||||
|
@@ -194,12 +194,14 @@ module jhead_hot_end_assembly(type, filament, naked = false) { //! Assembly with
|
|||||||
if(exploded())
|
if(exploded())
|
||||||
heater_components();
|
heater_components();
|
||||||
else
|
else
|
||||||
intersection() {
|
if(naked) // hide the wires when not exploded
|
||||||
heater_components();
|
intersection() {
|
||||||
|
heater_components();
|
||||||
|
|
||||||
if(naked)
|
color("grey")
|
||||||
color("grey") cylinder(r = 12, h = 100, center = true);
|
cylinder(r = 12, h = 100, center = true);
|
||||||
else
|
}
|
||||||
cube(1, true); // hide the wires when not exploded
|
else
|
||||||
}
|
hidden() // hidden by the tape
|
||||||
|
heater_components();
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,7 @@ module magnet(type) { //! Draw specified magnet
|
|||||||
h = magnet_h(type);
|
h = magnet_h(type);
|
||||||
r = magnet_r(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 ", od, "mm diameter, ", h, "mm high", id ? str(", ", id, "mm bore") : "" ));
|
||||||
|
|
||||||
or = od / 2;
|
or = od / 2;
|
||||||
ir = id / 2;
|
ir = id / 2;
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
// od, id, h, r
|
// od, id, h, r
|
||||||
MAG8x4x4p2 = ["MAG8x4x4p2", 8, 4.2, 4, 0.5];
|
MAG8x4x4p2 = ["MAG8x4x4p2", 8, 4.2, 4, 0.5];
|
||||||
MAG484 = ["MAG484", inch(1/4), inch(1/8), inch(1/4), 0.5];
|
MAG484 = ["MAG484", inch(1/4), inch(1/8), inch(1/4), 0.5];
|
||||||
MAG5x8 = ["MAG484", 8, 0, 5, 0.5];
|
MAG5x8 = ["MAG5x8", 8, 0, 5, 0.5];
|
||||||
|
|
||||||
magnets = [MAG8x4x4p2, MAG484, MAG5x8];
|
magnets = [MAG8x4x4p2, MAG484, MAG5x8];
|
||||||
|
|
||||||
|
@@ -41,6 +41,8 @@ function microswitch_button_clr(type)= type[14]; //! Button colour
|
|||||||
function microswitch_lower_extent(type) = let(leg = microswitch_leg(type)) min([for(pos = microswitch_legs(type)) pos.y - leg.y / 2]); //! How far legs extend downwards
|
function microswitch_lower_extent(type) = let(leg = microswitch_leg(type)) min([for(pos = microswitch_legs(type)) pos.y - leg.y / 2]); //! How far legs extend downwards
|
||||||
function microswitch_right_extent(type) = let(leg = microswitch_leg(type)) max([microswitch_length(type) / 2, for(pos = microswitch_legs(type)) pos.x + leg.x / 2]); //! How far legs extend right
|
function microswitch_right_extent(type) = let(leg = microswitch_leg(type)) max([microswitch_length(type) / 2, for(pos = microswitch_legs(type)) pos.x + leg.x / 2]); //! How far legs extend right
|
||||||
|
|
||||||
|
function microswitch_size(type) = [microswitch_length(type), microswitch_width(type), microswitch_thickness(type)]; //! Body size
|
||||||
|
|
||||||
module microswitch_hole_positions(type) //! Place children at the hole positions
|
module microswitch_hole_positions(type) //! Place children at the hole positions
|
||||||
{
|
{
|
||||||
for(hole = microswitch_holes(type))
|
for(hole = microswitch_holes(type))
|
||||||
|
@@ -64,6 +64,7 @@ module pulley(type) { //! Draw a pulley
|
|||||||
hl = pulley_hub_length(type);
|
hl = pulley_hub_length(type);
|
||||||
w = pulley_width(type);
|
w = pulley_width(type);
|
||||||
r1 = pulley_bore(type) / 2;
|
r1 = pulley_bore(type) / 2;
|
||||||
|
screw_z = pulley_screw_z(type);
|
||||||
|
|
||||||
or = od / 2;
|
or = od / 2;
|
||||||
ir = pulley_ir(type);
|
ir = pulley_ir(type);
|
||||||
@@ -100,33 +101,42 @@ module pulley(type) { //! Draw a pulley
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module screw_holes() {
|
module hub()
|
||||||
if(pulley_screws(type))
|
rotate_extrude() translate([r1, 0]) {
|
||||||
translate_z(pulley_screw_z(type))
|
if(hl)
|
||||||
for(i = [0 : pulley_screws(type) - 1])
|
square([pulley_hub_dia(type) / 2 - r1, hl]);
|
||||||
rotate([-90, 0, i * -90])
|
|
||||||
cylinder(r = screw_radius(pulley_screw(type)), h = 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
color("silver") {
|
for(z = [pulley_hub_length(type), hl + ft + w])
|
||||||
render() difference() {
|
translate([0, z])
|
||||||
rotate_extrude() translate([r1, 0]) {
|
square([pulley_flange_dia(type) / 2 - r1, ft]);
|
||||||
if(hl)
|
|
||||||
square([pulley_hub_dia(type) / 2 - r1, hl]);
|
|
||||||
|
|
||||||
for(z = [pulley_hub_length(type), hl + ft + w])
|
|
||||||
translate([0, z])
|
|
||||||
square([pulley_flange_dia(type) / 2 - r1, ft]);
|
|
||||||
}
|
|
||||||
if(pulley_screw_z(type) < hl)
|
|
||||||
screw_holes();
|
|
||||||
}
|
}
|
||||||
render() difference() { // T5 pulleys have screw through the teeth
|
|
||||||
|
module screw_holes()
|
||||||
|
translate_z(screw_z)
|
||||||
|
for(i = [0 : pulley_screws(type) - 1])
|
||||||
|
rotate([-90, 0, i * -90])
|
||||||
|
cylinder(r = screw_radius(pulley_screw(type)), h = 100);
|
||||||
|
|
||||||
|
color(silver) {
|
||||||
|
if(screw_z && screw_z < hl)
|
||||||
|
render()
|
||||||
|
difference() {
|
||||||
|
hub();
|
||||||
|
|
||||||
|
screw_holes();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
hub();
|
||||||
|
|
||||||
|
if(screw_z && screw_z > hl) // T5 pulleys have screw through the teeth
|
||||||
|
render()
|
||||||
|
difference() {
|
||||||
|
core();
|
||||||
|
|
||||||
|
screw_holes();
|
||||||
|
}
|
||||||
|
else
|
||||||
core();
|
core();
|
||||||
|
|
||||||
if(pulley_screw_z(type) > hl)
|
|
||||||
screw_holes();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ function rail_holes(type, length) = //! Number of holes in a rail given its `len
|
|||||||
module rail_hole_positions(type, length, first = 0, screws = 100, both_ends = true) { //! Position children over screw holes
|
module rail_hole_positions(type, length, first = 0, screws = 100, both_ends = true) { //! Position children over screw holes
|
||||||
pitch = rail_pitch(type);
|
pitch = rail_pitch(type);
|
||||||
holes = rail_holes(type, length);
|
holes = rail_holes(type, length);
|
||||||
last = first + screws;
|
last = first + min(screws, both_ends ? ceil(holes / 2) : holes);
|
||||||
for(i = [first : holes - 1], j = holes - 1 - i)
|
for(i = [first : holes - 1], j = holes - 1 - i)
|
||||||
if(i < last || both_ends && (j >= first && j < last))
|
if(i < last || both_ends && (j >= first && j < last))
|
||||||
translate([i * pitch - length / 2 + (length - (holes - 1) * pitch) / 2, 0])
|
translate([i * pitch - length / 2 + (length - (holes - 1) * pitch) / 2, 0])
|
||||||
@@ -181,19 +181,19 @@ module rail_assembly(type, length, pos, carriage_end_colour = grey(20), carriage
|
|||||||
carriage(rail_carriage(type), type, carriage_end_colour, carriage_wiper_colour);
|
carriage(rail_carriage(type), type, carriage_end_colour, carriage_wiper_colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
module rail_screws(type, length, thickness, screws = 100) { //! Place screws in the rail
|
module rail_screws(type, length, thickness, screws = 100, index_screws = undef) { //! Place screws in the rail
|
||||||
screw = rail_screw(type);
|
screw = rail_screw(type);
|
||||||
end_screw = rail_end_screw(type);
|
end_screw = rail_end_screw(type);
|
||||||
screw_len = screw_longer_than(rail_screw_height(type, screw) + thickness);
|
screw_len = screw_longer_than(rail_screw_height(type, screw) + thickness);
|
||||||
end_screw_len = screw_longer_than(rail_screw_height(type, end_screw) + thickness);
|
end_screw_len = screw_longer_than(rail_screw_height(type, end_screw) + thickness);
|
||||||
|
|
||||||
index_screws = screws > 2 ? 1 : 2;
|
index_screws = is_undef(index_screws) ? screws > 2 ? 1 : 2 : index_screws;
|
||||||
|
|
||||||
translate_z(rail_screw_height(type, end_screw))
|
translate_z(rail_screw_height(type, end_screw))
|
||||||
rail_hole_positions(type, length, 0, index_screws)
|
rail_hole_positions(type, length, 0, index_screws)
|
||||||
screw(end_screw, end_screw_len);
|
screw(end_screw, end_screw_len);
|
||||||
|
|
||||||
translate_z(rail_screw_height(type, screw))
|
translate_z(rail_screw_height(type, screw))
|
||||||
rail_hole_positions(type, length, index_screws, min(screws, rail_holes(type, length)) - 2 * index_screws)
|
rail_hole_positions(type, length, index_screws, screws - index_screws)
|
||||||
screw(screw, screw_len);
|
screw(screw, screw_len);
|
||||||
}
|
}
|
||||||
|
@@ -262,7 +262,7 @@ module screw_countersink(type, drilled = true) { //! Countersink shape
|
|||||||
if(drilled)
|
if(drilled)
|
||||||
cylinder(h = head_height + eps, r1 = 0, r2 = head_rad + head_t);
|
cylinder(h = head_height + eps, r1 = 0, r2 = head_rad + head_t);
|
||||||
else
|
else
|
||||||
intersection() {
|
render() intersection() {
|
||||||
cylinder(h = head_height + eps, r1 = 0, r2 = head_rad + head_t);
|
cylinder(h = head_height + eps, r1 = 0, r2 = head_rad + head_t);
|
||||||
|
|
||||||
cylinder(h = head_height + eps, r = head_rad + eps);
|
cylinder(h = head_height + eps, r = head_rad + eps);
|
||||||
|
@@ -41,6 +41,8 @@ function vero_track_width(type) = vero_pitch(type) * 0.8; //! The width of th
|
|||||||
function vero_length(type) = vero_holes(type) * vero_pitch(type); //! Length of the board
|
function vero_length(type) = vero_holes(type) * vero_pitch(type); //! Length of the board
|
||||||
function vero_width(type) = vero_strips(type) * vero_pitch(type); //! Width of the board
|
function vero_width(type) = vero_strips(type) * vero_pitch(type); //! Width of the board
|
||||||
|
|
||||||
|
function vero_size(type) = [vero_length(type), vero_width(type), vero_thickness(type)]; //! Board size
|
||||||
|
|
||||||
module solder_meniscus(type) {
|
module solder_meniscus(type) {
|
||||||
h = 1;
|
h = 1;
|
||||||
r = vero_track_width(type) / 2;
|
r = vero_track_width(type) / 2;
|
||||||
|
Reference in New Issue
Block a user