mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-06 15:36:30 +02:00
Fixed thread bug on threaded inserts revealed by latest OpenSCAD snapshot.
This commit is contained in:
@@ -47,7 +47,7 @@ thread_colour_factor = 0.8; // 60 degree threads appear too bright due to the an
|
||||
|
||||
function thread_profile(h, crest, angle, overlap = 0.1) = //! Create thread profile path
|
||||
let(base = crest + 2 * (h + overlap) * tan(angle / 2))
|
||||
[[-base / 2, -overlap, 0], [-crest / 2, h, 0], [crest / 2, h, 0], [base / 2, -overlap, 0]];
|
||||
[[-base / 2, -overlap, 0], [-crest / 2, h, 0], if(crest) [crest / 2, h, 0], [base / 2, -overlap, 0]];
|
||||
|
||||
module thread(dia, pitch, length, profile, center = true, top = -1, bot = -1, starts = 1, solid = true, female = false, colour = undef) { //! Create male or female thread, ends can be tapered, chamfered or square
|
||||
assert(is_undef(colour) || is_list(colour), "Thread colour must be in [r, g, b] form");
|
||||
|
@@ -212,13 +212,10 @@ module threaded_insert(type) { //! Draw specified threaded insert, for use in wo
|
||||
|
||||
thread_l = insert_length(type) - z; // - insert_ring1_h(type);
|
||||
|
||||
|
||||
|
||||
|
||||
vitamin(str("threaded_insert(", type[0], "): Threaded insert M", insert_screw_diameter(type), " x ", length, "mm"));
|
||||
union() {
|
||||
color(silver)
|
||||
difference() {
|
||||
render() difference() {
|
||||
base_insert(type);
|
||||
translate_z(-socket/2 + 0.01)
|
||||
cylinder(r=socket, $fn = 6, h=socket/2);
|
||||
@@ -245,5 +242,4 @@ module threaded_insert(type) { //! Draw specified threaded insert, for use in wo
|
||||
female = false,
|
||||
colour = silver);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user