185 ball_tunnel_c =
count;
186 ball_tunnel_a =
angle;
198 ball_tunnel_d = ball_d + (ball_d * gap/100) * ((type == 0) ? +1 : -1);
201 ball_tunnel_l = bearing_block_h - (ball_tunnel_r*2 + ball_tunnel_d + bearing_end_cap_h*2);
202 ball_tunnel_h = bearing_block_h - bearing_end_cap_h*2;
215 ball_feed_alignment =
217 [ [-(ball_tunnel_r + ball_tunnel_w/2), -(bearing_feed_p * ball_tunnel_l - ball_tunnel_l/2), 0],
218 [0, 90 - ball_tunnel_a + bearing_feed_a, 0],
219 [0, 0, -(bearing_feed_l/2 + ball_tunnel_d/4)] ],
220 [ [+(ball_tunnel_r + ball_tunnel_w/2), +(bearing_feed_p * ball_tunnel_l - ball_tunnel_l/2), 0],
221 [0, 90 - ball_tunnel_a + bearing_feed_a, 0],
222 [0, 0, +(bearing_feed_l/2 + ball_tunnel_d/4)] ],
223 [ [+(bearing_feed_p * ball_tunnel_w - ball_tunnel_w/2), +(ball_tunnel_h/2 - ball_tunnel_d/2), 0],
224 [90 + bearing_feed_a, 0, 0],
225 [0, 0, -(bearing_feed_l/2 + ball_tunnel_d/4)] ],
226 [ [-(bearing_feed_p * ball_tunnel_w - ball_tunnel_w/2), -(ball_tunnel_h/2 - ball_tunnel_d/2), 0],
227 [90 + bearing_feed_a, 0, 0],
228 [0, 0, +(bearing_feed_l/2 + ball_tunnel_d/4)] ]
237 ball_pipe_alignment = pipe_od/2 + delta +
241 ball_d/2 - (ball_d * gap/100)/2
245 pipe_tunnel_d = pipe_od +
247 ball_d/2 * (reveal/100),
248 ball_d/2 * (reveal/100) - ball_d * gap/(100*2),
249 ball_d/2 * (reveal/100) - ball_d * gap/(100*4)
253 module align_ball_tunnel()
256 translate([ball_pipe_alignment, 0, 0])
257 rotate([0, 0, ball_tunnel_a])
258 translate([ball_tunnel_w/2 + ball_tunnel_r, 0, 0])
264 module build_tunnel_path(r, l, s=1, m=255)
276 [+lx/2, +ly/2, 0, 1, [sr, sr]],
277 [-lx/2, +ly/2, 90, 3, [sr, 1]],
278 [-lx/2, -ly/2, 180, 5, [ 1, sr]],
279 [+lx/2, -ly/2, 270, 7, [sr, sr]]
284 translate([i[0], i[1], 0])
294 [ +r +lx/2, +ly/2, 0, ly, 0, sr],
295 [ -lx/2, +r +ly/2, 90, lx, 2, sr],
296 [ -r -lx/2, -ly/2, 180, ly, 4, 1],
297 [ lx/2, -r -ly/2, 270, lx, 6, sr]
302 translate([i[0], i[1], 0])
303 rotate([90, 0, i[2]])
304 translate([0, 0, -
eps])
305 linear_extrude(height=i[3] +
eps*2)
315 ( [ [0, 0, +bearing_block_h/2],
316 [0, 0, +ball_tunnel_h/2],
318 [0, 0, -ball_tunnel_h/2],
319 [0, 0, -bearing_block_h/2]
334 circle(d=pipe_tunnel_d);
341 build_tunnel_path(r=ball_tunnel_r, l=[ball_tunnel_w, ball_tunnel_l], s=dilate)
342 circle(d=ball_tunnel_d);
345 if (
is_between(load, 1, len(ball_feed_alignment)) )
346 translate( ball_feed_alignment[load-1][0] )
347 rotate( ball_feed_alignment[load-1][1] )
348 translate( ball_feed_alignment[load-1][2] )
350 circle(d=bearing_feed_r * ball_d);
355 ball_path = 2 *
pi * ball_tunnel_r + (ball_tunnel_w+ball_tunnel_l)*2;
356 echo(ball_path=ball_path, ball_count=ball_path/ball_d);
364 build_tunnel_path(r=ball_tunnel_r, l=[ball_tunnel_w, ball_tunnel_l], m=(8+16+32))
365 circle(d=ball_tunnel_d +
eps);
377 difference_cs(pipe_id>0){circle(d=pipe_od); circle(d=pipe_id);}
pi
<decimal> The ratio of a circle's circumference to its diameter.
eps
<decimal> Epsilon, small distance to deal with overlapping shapes.
function binary_bit_is(v, b, t=1)
Test if a binary bit position of an integer value equals a test bit.
function defined_e_or(v, i, d)
Return an element of an iterable when it exists or a default value otherwise.
function count(mv, v, s=true, i)
Count all occurrences of a match value in an iterable value.
function select_ci(v, i, l=true)
Select specified element from list or return a default.
function is_between(v, l, u)
Test if a numerical value is between an upper and lower bounds.
function is_defined(v)
Test if a value is defined.
module make_bearing_linear_rod(pipe, ball, count, angle, h, tunnel, feed, load=1, offset=1, delta=0, gap=10, reveal=50, dilate=15, type=0, align=2, verb=0, view)
Transform 2d or 3d shape into a linear rod ball or sled bearing.
function angle(a, from=angle_unit_default, to=angle_unit_base)
Convert an angle from some units to another.