mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-06 15:36:30 +02:00
Added studding.
This commit is contained in:
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 707 KiB After Width: | Height: | Size: 708 KiB |
15
readme.md
15
readme.md
@@ -2155,13 +2155,19 @@ Rocket switch. Also used for neon indicator in the same form factor.
|
|||||||
---
|
---
|
||||||
<a name="Rod"></a>
|
<a name="Rod"></a>
|
||||||
## Rod
|
## Rod
|
||||||
Steel rods, with optional chamfer.
|
Steel rods and studding with chamfered ends.
|
||||||
|
|
||||||
|
|
||||||
[vitamins/rod.scad](vitamins/rod.scad) Implementation.
|
[vitamins/rod.scad](vitamins/rod.scad) Implementation.
|
||||||
|
|
||||||
[tests/rod.scad](tests/rod.scad) Code for this example.
|
[tests/rod.scad](tests/rod.scad) Code for this example.
|
||||||
|
|
||||||
|
### Modules
|
||||||
|
| Module | Description |
|
||||||
|
|:--- |:--- |
|
||||||
|
| ```rod(d , l)``` | Draw a smooth rod with specified length and diameter |
|
||||||
|
| ```studding(d , l)``` | Draw a threaded rod with specified length and diameter |
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Vitamins
|
### Vitamins
|
||||||
@@ -2174,6 +2180,13 @@ Steel rods, with optional chamfer.
|
|||||||
| 1 | ```rod(5, 80)``` | Smooth rod 5mm x 80mm |
|
| 1 | ```rod(5, 80)``` | Smooth rod 5mm x 80mm |
|
||||||
| 1 | ```rod(6, 80)``` | Smooth rod 6mm x 80mm |
|
| 1 | ```rod(6, 80)``` | Smooth rod 6mm x 80mm |
|
||||||
| 1 | ```rod(8, 80)``` | Smooth rod 8mm x 80mm |
|
| 1 | ```rod(8, 80)``` | Smooth rod 8mm x 80mm |
|
||||||
|
| 1 | ```studding(10, 80)``` | Threaded rod M10 x 80mm |
|
||||||
|
| 1 | ```studding(12, 80)``` | Threaded rod M12 x 80mm |
|
||||||
|
| 1 | ```studding(3, 80)``` | Threaded rod M3 x 80mm |
|
||||||
|
| 1 | ```studding(4, 80)``` | Threaded rod M4 x 80mm |
|
||||||
|
| 1 | ```studding(5, 80)``` | Threaded rod M5 x 80mm |
|
||||||
|
| 1 | ```studding(6, 80)``` | Threaded rod M6 x 80mm |
|
||||||
|
| 1 | ```studding(8, 80)``` | Threaded rod M8 x 80mm |
|
||||||
|
|
||||||
|
|
||||||
<a href="#top">Top</a>
|
<a href="#top">Top</a>
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 49 KiB |
@@ -24,8 +24,13 @@ include <../vitamins/linear_bearings.scad>
|
|||||||
use <../vitamins/rod.scad>
|
use <../vitamins/rod.scad>
|
||||||
|
|
||||||
module rods()
|
module rods()
|
||||||
layout([for(b = linear_bearings) 2 * bearing_radius(b)])
|
layout([for(b = linear_bearings) 2 * bearing_radius(b)]) {
|
||||||
|
|
||||||
rod(bearing_rod_dia(linear_bearings[$i]), 80);
|
rod(bearing_rod_dia(linear_bearings[$i]), 80);
|
||||||
|
|
||||||
|
translate([0, 20])
|
||||||
|
studding(bearing_rod_dia(linear_bearings[$i]), 80);
|
||||||
|
}
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
rods();
|
rods();
|
||||||
|
@@ -18,13 +18,14 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
//! Steel rods, with optional chamfer.
|
//! Steel rods and studding with chamfered ends.
|
||||||
//
|
//
|
||||||
include <../core.scad>
|
include <../core.scad>
|
||||||
|
|
||||||
rod_colour = grey80;
|
rod_colour = grey80;
|
||||||
|
studding_colour = grey70;
|
||||||
|
|
||||||
module rod(d , l) {
|
module rod(d , l) { //! Draw a smooth rod with specified length and diameter
|
||||||
vitamin(str("rod(", d, ", ", l, "): Smooth rod ", d, "mm x ", l, "mm"));
|
vitamin(str("rod(", d, ", ", l, "): Smooth rod ", d, "mm x ", l, "mm"));
|
||||||
|
|
||||||
chamfer = d / 10;
|
chamfer = d / 10;
|
||||||
@@ -35,3 +36,15 @@ module rod(d , l) {
|
|||||||
cylinder(d = d - 2 * chamfer, h = l, center = true);
|
cylinder(d = d - 2 * chamfer, h = l, center = true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module studding(d , l) { //! Draw a threaded rod with specified length and diameter
|
||||||
|
vitamin(str("studding(", d, ", ", l,"): Threaded rod M", d, " x ", l, "mm"));
|
||||||
|
|
||||||
|
chamfer = d / 20;
|
||||||
|
color(studding_colour)
|
||||||
|
hull() {
|
||||||
|
cylinder(d = d, h = l - 2 * chamfer, center = true);
|
||||||
|
|
||||||
|
cylinder(d = d - 2 * chamfer, h = l, center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user