From a7dde2d4e274865c8fdad6548d351f61d88399c6 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Tue, 24 Mar 2020 17:28:10 +0000 Subject: [PATCH] Fixed short thread bug although threads should not be that short. --- utils/thread.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/thread.scad b/utils/thread.scad index 3937415..fc14fc7 100644 --- a/utils/thread.scad +++ b/utils/thread.scad @@ -79,7 +79,7 @@ module thread(dia, pitch, length, profile, center = true, top = -1, bot = -1, st sides = r2sides4n(r); step_angle = 360 / sides; segs = ceil(turns * sides); - leadin = ceil(sides / starts); + leadin = min(ceil(sides / starts), floor(turns * sides / 2)); final = floor(turns * sides) - leadin; path = [for(i = [0 : segs], R = i < leadin && bot < 0 ? r + dir * (h - h * i / leadin)