72 lines
2.0 KiB
OpenSCAD
72 lines
2.0 KiB
OpenSCAD
/*
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
} |