1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/examples/bearing_captured_in_mobius_cut.scad
Justin Lin e4ac6dcb98 format
2019-09-26 08:53:47 +08:00

38 lines
1.1 KiB
OpenSCAD

include <rotate_p.scad>;
include <circle_path.scad>;
include <cross_sections.scad>;
include <polysections.scad>;
include <ring_extrude.scad>;
ball_radius = 10;
mobius_radius = 30;
ring_radius = 60;
spacing = 0.5;
with_ball = "YES";
fn = 96;
module bearing_captured_in_mobius_cut(ball_radius, mobius_radius, ring_radius, spacing, with_ball, fn) {
$fn = fn;
ball_track_radius = ball_radius + spacing;
trans_pt = [mobius_radius - ball_track_radius + ball_track_radius / 3, 0, 0];
circle_points = [for(p = circle_path(ball_track_radius)) p + trans_pt];
difference() {
rotate_extrude()
translate([ring_radius, 0, 0])
circle(mobius_radius);
ring_extrude(circle_points, radius = ring_radius, twist = 180);
rotate([180, 0, 0])
ring_extrude(circle_points, radius = ring_radius, twist = 180);
}
if(with_ball == "YES") {
translate([ring_radius, 0, 0] + trans_pt) sphere(ball_radius);
}
}
bearing_captured_in_mobius_cut(ball_radius, mobius_radius, ring_radius, spacing, with_ball, fn);