mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-04 12:45:30 +02:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
654f094304 | ||
|
1e5e5860e1 | ||
|
3d8a9ec8aa | ||
|
9e826c1a09 | ||
|
2c1dbe04a9 | ||
|
d644d6b698 | ||
|
dc4e24b63a | ||
|
c55b8b6d1c | ||
|
728b7adf38 |
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 764 KiB After Width: | Height: | Size: 764 KiB |
@@ -196,7 +196,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```belt(type, points, gap = 0, gap_pt = undef)``` | Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless a gap is specified |
|
||||
| ```belt(type, points, gap = 0, gap_pt = undef, belt_colour = grey20, tooth_colour = grey50)``` | Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless a gap is specified |
|
||||
|
||||

|
||||
|
||||
@@ -2562,7 +2562,7 @@ Filament spool models
|
||||
### Modules
|
||||
| Module | Description |
|
||||
|:--- |:--- |
|
||||
| ```spool(type)``` | Draw specified spool |
|
||||
| ```spool(type, filament_depth = 0, filament_colour = "white", filament_d = 3)``` | Draw specified spool with optional filament |
|
||||
|
||||

|
||||
|
||||
|
@@ -67,7 +67,7 @@ module belt_test() {
|
||||
translate([-25, 0])
|
||||
layout([for(b = belts) belt_width(b)], 10)
|
||||
rotate([0, 90, 0])
|
||||
belt(belts[$i], [[0, 0, 20], [0, 1, 20]]);
|
||||
belt(belts[$i], [[0, 0, 20], [0, 1, 20]], belt_colour = $i%2==0 ? grey90 : grey20, tooth_colour = $i%2==0 ? grey70 : grey50);
|
||||
}
|
||||
|
||||
if($preview)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
Binary file not shown.
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 162 KiB |
@@ -23,9 +23,9 @@ use <../utils/layout.scad>
|
||||
include <../vitamins/spools.scad>
|
||||
|
||||
module spools()
|
||||
layout([for(s = spools) spool_height(s)], 100)
|
||||
layout([for(s = spools) spool_height(s)], 100) let(s = spools[$i])
|
||||
rotate([90, 0, 90])
|
||||
spool(spools[$i]);
|
||||
spool(s, filament_depth = spool_depth(s) / 2, filament_colour = [pp1_colour, pp2_colour, pp3_colour, pp4_colour][$i % 4], filament_d = $i ? 3 : 1.75);
|
||||
|
||||
if($preview)
|
||||
spools();
|
||||
|
@@ -41,9 +41,7 @@ function no_point(str) = chr([for(c = str) if(c == ".") ord("p") else ord(c)]);
|
||||
// We model the belt path at the pitch radius of the pulleys and the pitch line of the belt to get an accurate length.
|
||||
// The belt is then drawn by offseting each side from the pitch line.
|
||||
//
|
||||
module belt(type, points, gap = 0, gap_pt = undef) { //! Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless a gap is specified
|
||||
belt_colour = grey20;
|
||||
tooth_colour = grey50;
|
||||
module belt(type, points, gap = 0, gap_pt = undef, belt_colour = grey20, tooth_colour = grey50) { //! Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless a gap is specified
|
||||
width = belt_width(type);
|
||||
pitch = belt_pitch(type);
|
||||
thickness = belt_thickness(type);
|
||||
|
@@ -20,6 +20,7 @@
|
||||
//! Filament spool models
|
||||
|
||||
include <../core.scad>
|
||||
include <../utils/tube.scad>
|
||||
|
||||
function spool_diameter(type) = type[1]; //! Outside diameter
|
||||
function spool_width(type) = type[2]; //! Internal width
|
||||
@@ -32,7 +33,7 @@ function spool_hub_taper(type) = type[8]; //! Diameter at which it tapers do
|
||||
function spool_height(type) = spool_width(type) + 2 * spool_hub_thickness(type); //! Outside width
|
||||
function spool_pitch(type) = spool_width(type) + spool_rim_thickness(type); //! Spacing of the rims
|
||||
|
||||
module spool(type) { //! Draw specified spool
|
||||
module spool(type, filament_depth = 0, filament_colour = "white", filament_d = 3) { //! Draw specified spool with optional filament
|
||||
vitamin(str("spool(", type[0], "): Filament spool ", spool_diameter(type), " x ", spool_width(type)));
|
||||
|
||||
h = spool_height(type);
|
||||
@@ -57,4 +58,25 @@ module spool(type) { //! Draw specified spool
|
||||
[r3, h - spool_hub_thickness(type) + spool_rim_thickness(type)],
|
||||
[r2, h],
|
||||
]);
|
||||
|
||||
if(filament_depth) {
|
||||
w = spool_width(type);
|
||||
r = r5 + filament_depth;
|
||||
color(filament_colour)
|
||||
if(filament_d) {
|
||||
n = round(w / filament_d) + 1;
|
||||
fd = w / n;
|
||||
rotate_extrude($fn = 180) {
|
||||
for(i = [0 : n -1])
|
||||
translate([r - fd / 2, i * fd - w / 2 + fd / 2])
|
||||
circle(d = fd, $fn = 32);
|
||||
|
||||
translate([r5, -w / 2])
|
||||
square([filament_depth - fd / 2, w]);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
tube(r, r5, w, $fn = 180);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user