pub fn threaded_rod(
m: i32,
length: f64,
segments: u64,
lead_in_degrees: f64,
lead_out_degrees: f64,
left_hand_thread: bool,
center: bool,
) -> Scad
Expand description
Creates a threaded rod at the world origin.
m: The metric size of the rod.
length: The length of the rod in mm.
segments: The number of segments in a circle.
lead_in_degrees: Span of the lead in.
lead_out_degrees: Span of the lead out.
left_hand_thread: lefty tighty?
center: Center vertically.
return: The threaded rod.
Examples found in repository?
examples/bottle.rs (line 80)
41fn make_bottle() {
42 let mut outside_profile = Pt2s::new();
43 outside_profile.push(Pt2::new(0.0, 125.0));
44 outside_profile.append(&mut dim2::cubic_bezier(
45 Pt2::new(19.0, 125.0),
46 Pt2::new(22.5, 110.0),
47 Pt2::new(32.5, 105.0),
48 Pt2::new(32.5, 100.0),
49 6,
50 ));
51 outside_profile.append(&mut dim2::quadratic_bezier(
52 Pt2::new(32.5, 5.0),
53 Pt2::new(32.5, 0.0),
54 Pt2::new(27.5, 0.0),
55 6,
56 ));
57 outside_profile.push(Pt2::new(0.0, 0.0));
58
59 let mut inside_profile = Pt2s::new();
60 inside_profile.push(Pt2::new(0.0, 140.0));
61 inside_profile.push(Pt2::new(16.0, 140.0));
62 inside_profile.append(&mut dim2::cubic_bezier(
63 Pt2::new(16.0, 125.0),
64 Pt2::new(20.5, 110.0),
65 Pt2::new(30.5, 105.0),
66 Pt2::new(30.5, 100.0),
67 6,
68 ));
69 inside_profile.append(&mut dim2::quadratic_bezier(
70 Pt2::new(30.5, 7.0),
71 Pt2::new(30.5, 2.0),
72 Pt2::new(25.5, 2.0),
73 6,
74 ));
75 inside_profile.push(Pt2::new(0.0, 2.0));
76
77 let outside = rotate_extrude!(angle=360.0, convexity=10, fn=128, polygon!(outside_profile););
78 let inside = rotate_extrude!(angle=360.0, convexity=10, fn=128, polygon!(inside_profile););
79
80 let threaded_rod = translate!([0.0,0.0,120.0], metric_thread::threaded_rod(40, 15.0, 128, 0.0, 180.0, false, false););
81
82 let bottle = outside + threaded_rod - inside;
83
84 bottle.save("output/bottle.scad");
85}