1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-27 09:14:24 +02:00

Extension to belt.scad

Can now:
- render open loops
- twist the belt
- use pulleys instead of radius in the points list

Fixes some precision a few places
Breaking change in belt_length(); now requires a type argument
This commit is contained in:
SmoothieAq
2021-03-11 13:40:17 +01:00
parent 516b225275
commit 240334784d
4 changed files with 178 additions and 38 deletions

View File

@@ -72,6 +72,31 @@ module belt_test() {
layout([for(b = belts) belt_width(b)], 10)
rotate([0, 90, 0])
belt(belts[$i], [[0, 0, 20], [0, 1, 20]], belt_colour = $i%2==0 ? grey(90) : grey(20), tooth_colour = $i%2==0 ? grey(70) : grey(50));
// new example with open loop - this is a simplified example of the style used for example for the BLV 3D printer
pulley = GT2x20ob_pulley;
idler = GT2x16_plain_idler;
corners = [[-75,-50],[75,100]];
carriagepos = [0,0];
carriagew = 80;
points = [
[carriagepos.x - carriagew / 2, carriagepos.y, 0],
[corners[0].x + belt_pulley_pr(belt, pulley) + belt_pulley_pr(belt, idler), carriagepos.y - belt_pulley_pr(belt, idler), idler],
[corners[0].x, corners[0].y, pulley],
[corners[0].x, corners[1].y, idler],
[corners[1].x, corners[1].y, idler],
[corners[1].x, carriagepos.y + belt_pulley_pr(belt, idler), idler],
[carriagepos.x + carriagew / 2, carriagepos.y, 0]
];
translate_z(-30) {
belt(belt, points, open=true, auto_twist=true);
for (p = points)
if (is_list(p.z))
translate([p.x, p.y, 0])
pulley_assembly(p.z);
}
}
if($preview)