Fixed reversed faces.

This commit is contained in:
Revar Desmera 2020-04-23 03:18:28 -07:00
parent 97e67384c1
commit c7e5056741
3 changed files with 4 additions and 4 deletions

View file

@ -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));

View file

@ -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],

View file

@ -8,7 +8,7 @@
//////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,275];
BOSL_VERSION = [2,0,276];
// Section: BOSL Library Version Functions