From 9636a2d24567a045fb5920028b73902723d16c77 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 23 Aug 2025 00:00:18 -0400 Subject: [PATCH] Fix offset() bug where it produced 3 points too many in roundings --- regions.scad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regions.scad b/regions.scad index 1a5aeefb..8dca3cfa 100644 --- a/regions.scad +++ b/regions.scad @@ -1097,7 +1097,7 @@ function offset( goodsegs[i][0]-goodpath[i])) assert(!outsidecorner[i] || vang!=0, // If outsidecorner[i] is true then vang>0 needed to give valid step count "\nOffset computation failed, probably because validity check mistakenly removed a valid segment. Increasing quality might fix this.") - 1+floor(segs(r)*vang/360) + 1+segs(r,vang) ], // newcorners is a list where each entry is a list of the points that correspond to a single point in the sharpcorners // list: newcorners[i] is the point list that replaces goodpath[i]. Without rounding or chamfering (or reversals), @@ -1134,7 +1134,7 @@ function offset( ) arc(cp=goodpath[i], cw=cw, ccw=ccw, points=basepts, - n=steps[i]+3) + n=steps[i]) ], pointcount = [for(entry=newcorners) len(entry)], edges = flatten(newcorners),