From 504c92bba9c1eb4a0260a3f0abfcae6d3e9dc4d3 Mon Sep 17 00:00:00 2001 From: Alex Matulich Date: Thu, 5 Dec 2024 16:59:58 -0800 Subject: [PATCH] Corrected anchor positions, improved linear response of squareness, added example --- shapes2d.scad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shapes2d.scad b/shapes2d.scad index 3de6bcb..9a9f5a8 100644 --- a/shapes2d.scad +++ b/shapes2d.scad @@ -2024,11 +2024,11 @@ module squircle(squareness=0.7, size=[10,10], anchor=CENTER, spin=0) { anchors = [ for (i = [0:1:3]) let( ca = 360 - i*90, - cp = polar_to_xy(squircle_radius(squareness, bbox[0], ca), ca) + cp = polar_to_xy(squircle_radius(squareness, bbox[0]/2, ca), ca) ) named_anchor(str("side",i), cp, unit(cp,BACK), 0), for (i = [0:1:3]) let( ca = 360-45 - i*90, - cp = polar_to_xy(squircle_radius(squareness, bbox[0], ca), ca) + cp = polar_to_xy(squircle_radius(squareness, bbox[0]/2, ca), ca) ) named_anchor(str("corner",i), cp, unit(cp,BACK), 0) ]; attachable(anchor,spin, two_d=true, path=path, extent=false, anchors=anchors) {