mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-05 09:17:34 +02:00
Added center argument to trapezoidal_threaded_rod()
This commit is contained in:
@@ -59,7 +59,7 @@ function _trpzd_thread_pt(thread, threads, start, starts, astep, asteps, part, p
|
|||||||
// trapezoidal_threaded_rod(d=16, l=40, pitch=2, thread_angle=30);
|
// trapezoidal_threaded_rod(d=16, l=40, pitch=2, thread_angle=30);
|
||||||
// trapezoidal_threaded_rod(d=10, l=40, pitch=3, thread_angle=15, left_handed=true, starts=3, $fn=36);
|
// trapezoidal_threaded_rod(d=10, l=40, pitch=3, thread_angle=15, left_handed=true, starts=3, $fn=36);
|
||||||
// trapezoidal_threaded_rod(d=50, l=50, pitch=8, thread_angle=30, starts=4, $fa=2, $fs=2);
|
// trapezoidal_threaded_rod(d=50, l=50, pitch=8, thread_angle=30, starts=4, $fa=2, $fs=2);
|
||||||
// trapezoidal_threaded_rod(d=25, l=68, pitch=10, thread_depth=8/3, thread_angle=50, starts=2, $fa=2, $fs=2);
|
// trapezoidal_threaded_rod(d=25, l=100, pitch=10, thread_depth=8/3, thread_angle=50, starts=4, center=false, $fa=2, $fs=2);
|
||||||
module trapezoidal_threaded_rod(
|
module trapezoidal_threaded_rod(
|
||||||
d=10,
|
d=10,
|
||||||
l=100,
|
l=100,
|
||||||
@@ -67,6 +67,7 @@ module trapezoidal_threaded_rod(
|
|||||||
thread_angle=15,
|
thread_angle=15,
|
||||||
thread_depth=undef,
|
thread_depth=undef,
|
||||||
left_handed=false,
|
left_handed=false,
|
||||||
|
center=true,
|
||||||
starts=1
|
starts=1
|
||||||
) {
|
) {
|
||||||
astep = 360 / quantup(segs(d/2), starts);
|
astep = 360 / quantup(segs(d/2), starts);
|
||||||
@@ -200,11 +201,13 @@ module trapezoidal_threaded_rod(
|
|||||||
) otri
|
) otri
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
up(center? 0 : l/2) {
|
||||||
intersection() {
|
intersection() {
|
||||||
polyhedron(points=poly_points, faces=poly_faces, convexity=threads*starts*2);
|
polyhedron(points=poly_points, faces=poly_faces, convexity=threads*starts*2);
|
||||||
cube([d+1, d+1, l], center=true);
|
cube([d+1, d+1, l], center=true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Constructs a hex nut for a threaded screw rod. This method makes
|
// Constructs a hex nut for a threaded screw rod. This method makes
|
||||||
|
Reference in New Issue
Block a user