Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions threads.scad
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
//
// https://www.thingiverse.com/thing:1686322
//
// v2.1
// v2.1.1


screw_resolution = 0.2; // in mm
default_screw_resolution = 0.2; // in mm; override by setting $screw_resolution


// Provides standard metric thread pitches.
Expand Down Expand Up @@ -223,14 +223,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 @@ -344,16 +345,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 Expand Up @@ -626,7 +628,19 @@ module Demo() {
}


Demo();
module ThreadCheck() {
d=5;
h=10;
intersection() {
union() {
ScrewThread(d, h);
ScrewHole(d, h)
cylinder(d=h,h=h);
}
cube(h);
}
}

//MetricBoltSet(6, 8, 10);

//Demo();
ThreadCheck();