From 6ab4bad97aa6089cf95cdf46ea7e3023c03db932 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Sun, 20 Dec 2020 10:37:41 +0000 Subject: [PATCH] Polyhole no longer adds an extra twist when layers is small. --- utils/core/polyholes.scad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/core/polyholes.scad b/utils/core/polyholes.scad index 99a48ac..b8dcce2 100644 --- a/utils/core/polyholes.scad +++ b/utils/core/polyholes.scad @@ -45,9 +45,9 @@ module poly_circle(r, sides = 0) { //! Make a circle adjusted to print the corre module poly_cylinder(r, h, center = false, sides = 0, chamfer = false, twist = 0) {//! Make a cylinder adjusted to print the correct size if(twist) { slices = ceil(h / layer_height); - twist = min(twist, slices - 1); + twists = min(twist + 1, slices); sides = sides ? sides : sides(r); - rot = 360 / sides / (twist + 1) * (1 + 1 / slices); + rot = 360 / sides / twists * (twists < slices ? (1 + 1 / slices) : 1); if(center) for(side = [0, 1]) mirror([0, 0, side])