Adjust filet on square holes by CutoutMargin

If you have a cutout margin, the filet on square holes must be adjusted
by that amount if you want to achieve the desired filet.
This commit is contained in:
Joel Ebel 2018-07-27 00:28:36 -04:00
parent cc8d527884
commit 81ccd45685

View File

@ -741,11 +741,12 @@ module CylinderHole(OnOff, Cx, Cy, Cdia) {
*/ */
module SquareHole(OnOff, Sx, Sy, Sl, Sw, Filet) { module SquareHole(OnOff, Sx, Sy, Sl, Sw, Filet) {
if (OnOff) { if (OnOff) {
Offset = Filet + CutoutMargin;
echo("SquareHole:", Sx=Sx - CutoutMargin, Sy=Sy - CutoutMargin, echo("SquareHole:", Sx=Sx - CutoutMargin, Sy=Sy - CutoutMargin,
Sl=Sl + CutoutMargin*2, Sw=Sw + CutoutMargin*2, Filet=Filet); Sl=Sl + CutoutMargin*2, Sw=Sw + CutoutMargin*2, Filet=Offset);
translate([Sx + Filet - CutoutMargin, Sy + Filet - CutoutMargin, 0]) { translate([Sx + Filet, Sy + Filet, 0]) {
offset(r=Filet, $fn=Resolution) { offset(r=Offset, $fn=Resolution) {
square([Sl + CutoutMargin*2 - Filet*2, Sw + CutoutMargin*2 - Filet*2]); square([Sl - Filet*2, Sw - Filet*2]);
} }
} }
} }