From 50238f6980946e1535777964800847a551ba5a9d Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Thu, 8 Aug 2019 16:25:07 -0700 Subject: [PATCH] Lessened impact of GRID_COARSE rounding on square() and cube() --- primitives.scad | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/primitives.scad b/primitives.scad index 110b30b..b617707 100644 --- a/primitives.scad +++ b/primitives.scad @@ -35,10 +35,9 @@ // path = square([40,30], anchor=FRONT, spin=30); module square(size, center=undef, anchor=FRONT+LEFT, spin=0) { size = is_num(size)? [size,size] : point2d(size); - s = size/2; - pts = [[-s.x,-s.y], [-s.x,s.y], [s.x,s.y], [s.x,-s.y]]; + pts = [[0,0], [0,size.y], size, [size.x,0]]; orient_and_anchor(point3d(size), UP, anchor, spin=spin, center=center, noncentered=FRONT+LEFT, two_d=true, chain=true) { - polygon(pts); + translate(-size/2) polygon(pts); children(); } }