mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Fixed dimensional accuracy of rcube().
This commit is contained in:
parent
366459cb04
commit
97723305fb
1 changed files with 9 additions and 3 deletions
12
shapes.scad
12
shapes.scad
|
@ -158,11 +158,17 @@ module rrect(size=[1,1,1], r=0.25, center=false)
|
|||
// rcube(size=[5,7,3], r=1);
|
||||
module rcube(size=[1,1,1], r=0.25, center=false)
|
||||
{
|
||||
rr = min(r, min(min(size[0]/2-0.01, size[1]/2-0.01), size[2]/2-0.01));
|
||||
dd = min(2*r, min(size));
|
||||
$fn=quantup(segs(dd/2), 4);
|
||||
translate(center? [0,0,0] : size/2) {
|
||||
minkowski() {
|
||||
cube([size[0]-2*rr, size[1]-2*rr, size[2]-2*rr], center=true);
|
||||
sphere(rr, $fn=quantup(segs(rr), 4));
|
||||
cube([max(0.01,size[0]-dd), max(0.01,size[1]-dd), max(0.01,size[2]-dd)], center=true);
|
||||
rotate_extrude() {
|
||||
difference() {
|
||||
circle(dd/2);
|
||||
left(dd/2) square(dd, center=true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue