Fixed reversed faces on onion()

This commit is contained in:
Revar Desmera 2018-11-19 16:04:42 -08:00
parent 907a41fd61
commit 0141df5d38

View file

@ -163,6 +163,9 @@ module rcube(size=[1,1,1], r=0.25, center=false)
translate(center? [0,0,0] : size/2) { translate(center? [0,0,0] : size/2) {
minkowski() { minkowski() {
cube([max(0.01,size[0]-dd), max(0.01,size[1]-dd), max(0.01,size[2]-dd)], center=true); cube([max(0.01,size[0]-dd), max(0.01,size[1]-dd), max(0.01,size[2]-dd)], center=true);
// Synthesize a sphere with vertices at the axis extremes.
// This makes the result of the minkowski have the proper dimensions.
rotate_extrude() { rotate_extrude() {
difference() { difference() {
circle(dd/2); circle(dd/2);
@ -424,7 +427,7 @@ module onion(h=1, r=1, d=undef, maxang=45)
rotate_extrude(angle=360, convexity=2) { rotate_extrude(angle=360, convexity=2) {
difference() { difference() {
teardrop2d(r=r, ang=maxang, cap_h=h); teardrop2d(r=r, ang=maxang, cap_h=h);
right(r+h/2) square(size=r*2+h, center=true); left(r+h/2) square(size=r*2+h, center=true);
} }
} }
} }