From c7e5056741e66b67ec6ecfa21f9433f476fa1ec9 Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Thu, 23 Apr 2020 03:18:28 -0700 Subject: [PATCH] Fixed reversed faces. --- debug.scad | 2 +- primitives.scad | 4 ++-- version.scad | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debug.scad b/debug.scad index 4229fe6..b183e7a 100644 --- a/debug.scad +++ b/debug.scad @@ -194,7 +194,7 @@ module debug_faces(vertices, faces, size=1, disabled=false) { v0 = vertices[face[0]]; v1 = vertices[face[1]]; v2 = vertices[face[2]]; - c = (v0 + v1 + v2) / 3; + c = mean(select(vertices,face)); dv0 = unit(v1 - v0); dv1 = unit(v2 - v0); nrm0 = unit(cross(dv0, dv1)); diff --git a/primitives.scad b/primitives.scad index 8ff0039..5d749c7 100644 --- a/primitives.scad +++ b/primitives.scad @@ -281,8 +281,8 @@ function cylinder(h, r1, r2, center, l, r, d, d1, d2, anchor, spin=0, orient=UP) l = first_defined([h, l, 1]), sides = segs(max(r1,r2)), verts = [ - for (i=[0:1:sides-1]) let(a=i*360/sides) [r1*cos(a),r1*sin(a),-l/2], - for (i=[0:1:sides-1]) let(a=i*360/sides) [r2*cos(a),r2*sin(a), l/2], + for (i=[0:1:sides-1]) let(a=360*(1-i/sides)) [r1*cos(a),r1*sin(a),-l/2], + for (i=[0:1:sides-1]) let(a=360*(1-i/sides)) [r2*cos(a),r2*sin(a), l/2], ], faces = [ [for (i=[0:1:sides-1]) sides-1-i], diff --git a/version.scad b/version.scad index 4ded712..8e76910 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,275]; +BOSL_VERSION = [2,0,276]; // Section: BOSL Library Version Functions