From 9ac1747e514e837167dd8fbf7a910e6108f71abc Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Tue, 5 Aug 2025 20:53:26 -0400 Subject: [PATCH] Add foot option to CR_BOX --- CR_BOX.scad | 114 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 71 insertions(+), 43 deletions(-) diff --git a/CR_BOX.scad b/CR_BOX.scad index 3b3cb6e..14cab01 100644 --- a/CR_BOX.scad +++ b/CR_BOX.scad @@ -1,44 +1,72 @@ -/* [Filter] */ -filterThiccness = 100.0; //mm - -/* [Piece] */ -//Length, width, height. Size of the piece including the wall thiccness -pieceDimensions = [150, 150, 25]; -pieceWallThiccness = 1.2; //mm -bottomThiccness = 1.0; //mm -mirrored = false; -insideCornerStyle = 2; //[0:Cut Corner, 1:Don't cut corner, 2:Rounded corner] - -/* [OpenSCAD] [Settings] */ -$fn = 100; - -module filter(filterDimensions = [100, 1000, 1000]){ - cube(filterDimensions); -} - -mirror([mirrored? 1 : 0, 0, 0]){ - difference(){ - translate([-pieceWallThiccness, -pieceWallThiccness, -bottomThiccness]){ - cube(pieceDimensions); - } - #filter([filterThiccness, 1000, 1000]); - #translate([filterThiccness + pieceWallThiccness, filterThiccness, 0]){ - rotate([0, 0, -90]){ - filter([filterThiccness, 1000, 1000]); - } - } - //Corner cutter - if(insideCornerStyle == 0){ - translate([filterThiccness + pieceWallThiccness, filterThiccness + pieceWallThiccness, -bottomThiccness]){ - cube(pieceDimensions); - } - }else if(insideCornerStyle == 1){ - //nothing lol - }else if(insideCornerStyle == 2){ - radius = pieceDimensions.x - (filterThiccness + pieceWallThiccness); - #translate([pieceDimensions.x, pieceDimensions.y, -bottomThiccness]){ - cylinder(r=radius, h=pieceDimensions.z); - } - } - } +/* + +Originally by ThatDude7Piglets is licensed under the Creative Commons - Attribution - Non-Commercial - Share Alike license. + +https://www.thingiverse.com/thing:6072539 + +Additions: + * optional foot +*/ + +/* [Filter] */ +filterThiccness = 100.0; //mm + +/* [Piece] */ +//Length, width, height. Size of the piece including the wall thiccness +pieceDimensions = [150, 150, 25]; +pieceWallThiccness = 1.2; //mm +bottomThiccness = 1.0; //mm +mirrored = false; +insideCornerStyle = 2; //[0:Cut Corner, 1:Don't cut corner, 2:Rounded corner] + +/* [OpenSCAD] [Settings] */ +$fn = 100; + +/* [Foot] */ +footEnable = 0; //[0:Disable, 1:Enable] +footShape = 0; //[0:Cylinder, 1:Square] +footDepth = 10; //mm +footWidth = 54; //mm +footInset = 0; //mm + +module filter(filterDimensions = [100, 1000, 1000]){ + cube(filterDimensions); +} + +mirror([mirrored? 1 : 0, 0, 0]){ + difference(){ + translate([-pieceWallThiccness, -pieceWallThiccness, -bottomThiccness]){ + cube(pieceDimensions); + } + #filter([filterThiccness, 1000, 1000]); + #translate([filterThiccness + pieceWallThiccness, filterThiccness, 0]){ + rotate([0, 0, -90]){ + filter([filterThiccness, 1000, 1000]); + } + } + //Corner cutter + if(insideCornerStyle == 0){ + translate([filterThiccness + pieceWallThiccness, filterThiccness + pieceWallThiccness, -bottomThiccness]){ + cube(pieceDimensions); + } + }else if(insideCornerStyle == 1){ + //nothing lol + }else if(insideCornerStyle == 2){ + radius = pieceDimensions.x - (filterThiccness + pieceWallThiccness); + #translate([pieceDimensions.x, pieceDimensions.y, -bottomThiccness]){ + cylinder(r=radius, h=pieceDimensions.z); + } + } + } + + if(footEnable == 1) { + translate([pieceDimensions[0]/2 - footInset, pieceDimensions[1]/2 - footInset, -footDepth/2 - pieceWallThiccness]) { + if (footShape == 0) { + cylinder(footDepth, footWidth, footWidth, center=true); + } + else { + cube([footWidth*2, footWidth*2, footDepth], center=true); + } + } + } } \ No newline at end of file