Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrrat committed Jul 7, 2023
1 parent 87a2f92 commit a608fc6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/threads/threads.scad
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// v2.1


screw_resolution = 0.2; // in mm
default_screw_resolution = 0.2; // in mm


// Provides standard metric thread pitches.
Expand Down Expand Up @@ -231,14 +231,15 @@ module ClosePoints(pointarrays) {
];
faces = concat(faces_bot, faces_loop, faces_top);

polyhedron(points=points, faces=faces);
polyhedron(points=points, faces=faces, convexity=2);
}



// This creates a vertical rod at the origin with external threads. It uses
// metric standards by default.
module ScrewThread(outer_diam, height, pitch=0, tooth_angle=30, tolerance=0.4, tip_height=0, tooth_height=0, tip_min_fract=0) {
screw_resolution = is_undef($screw_resolution) ? default_screw_resolution : $screw_resolution;

pitch = (pitch==0) ? ThreadPitch(outer_diam) : pitch;
tooth_height = (tooth_height==0) ? pitch : tooth_height;
Expand Down Expand Up @@ -352,16 +353,17 @@ module AugerThread(outer_diam, inner_diam, height, pitch, tooth_angle=30, tolera

// This creates a threaded hole in its children using metric standards by
// default.
module ScrewHole(outer_diam, height, position=[0,0,0], rotation=[0,0,0], pitch=0, tooth_angle=30, tolerance=0.4, tooth_height=0) {
module ScrewHole(outer_diam, height, position=[0,0,0], rotation=[0,0,0], pitch=0, tooth_angle=30, tolerance=0.4, tooth_height=0, tip_height=0, tip_min_fract=0) {
extra_height = 0.001 * height;
pitch = (pitch==0) ? ThreadPitch(outer_diam) : pitch;

difference() {
children();
translate(position)
rotate(rotation)
translate([0, 0, -extra_height/2])
ScrewThread(1.01*outer_diam + 1.25*tolerance, height + extra_height,
pitch, tooth_angle, tolerance, tooth_height=tooth_height);
pitch, tooth_angle, tolerance, tooth_height=tooth_height, tip_height=tip_height, tip_min_fract=tip_min_fract);
}
}

Expand Down

0 comments on commit a608fc6

Please sign in to comment.