mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-04 03:09:45 +00:00
Fixed broken cylinder()
This commit is contained in:
parent
5133734cfd
commit
65666ce334
1 changed files with 3 additions and 2 deletions
|
@ -177,12 +177,13 @@ module cylinder(r=undef, d=undef, r1=undef, r2=undef, d1=undef, d2=undef, h=unde
|
||||||
r1 = get_radius(r1=r1, r=r, d1=d1, d=d, dflt=1);
|
r1 = get_radius(r1=r1, r=r, d1=d1, d=d, dflt=1);
|
||||||
r2 = get_radius(r1=r2, r=r, d1=d2, d=d, dflt=1);
|
r2 = get_radius(r1=r2, r=r, d1=d2, d=d, dflt=1);
|
||||||
l = first_defined([h, l]);
|
l = first_defined([h, l]);
|
||||||
hh = h/2;
|
hh = l/2;
|
||||||
sides = segs(max(r1,r2));
|
sides = segs(max(r1,r2));
|
||||||
size = [r1*2, r1*2, l];
|
size = [r1*2, r1*2, l];
|
||||||
|
path = [[0,hh],[r2,hh],[r1,-hh],[0,-hh]];
|
||||||
orient_and_anchor(size, orient, anchor, center, spin=spin, size2=[r2*2,r2*2], noncentered=BOTTOM, geometry="cylinder", chain=true) {
|
orient_and_anchor(size, orient, anchor, center, spin=spin, size2=[r2*2,r2*2], noncentered=BOTTOM, geometry="cylinder", chain=true) {
|
||||||
rotate_extrude(convexity=2, $fn=sides) {
|
rotate_extrude(convexity=2, $fn=sides) {
|
||||||
polygon([[0,hh],[r2,hh],[r1,-hh],[0,-hh]]);
|
polygon(path);
|
||||||
}
|
}
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue