1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-09 00:46:32 +02:00

Fixed thread bug on threaded inserts revealed by latest OpenSCAD snapshot.

This commit is contained in:
Chris Palmer
2024-06-12 21:18:11 +01:00
parent f6f348b76e
commit c76be23867
2 changed files with 2 additions and 6 deletions

View File

@@ -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");