58 lines
1.5 KiB
OpenSCAD
58 lines
1.5 KiB
OpenSCAD
/* 79-character width
|
|
012345678.012345678.012345678.012345678.012345678.012345678.012345678.012345678
|
|
*/
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// LibFile: gridstack.scad
|
|
// FileGroup: CSGPATTERS
|
|
// FileSummary: Grid formed by stacked lines
|
|
//
|
|
// DETAILS:
|
|
// Weaker than fully meshed grids, but also faster to print and lighter
|
|
// Todo: NONE
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
include <BOSL2/std.scad>
|
|
|
|
include <sgc_params.scad>
|
|
|
|
lw = 2*nW; // line width
|
|
lh = LH; // layer height
|
|
|
|
// these MUST be the cavity size
|
|
gridX=4.8;
|
|
gridY=4.8;
|
|
|
|
// these ARE the number of cavities
|
|
xCount=7;
|
|
yCount=7;
|
|
|
|
// these MUST be the calculated dimensions
|
|
xw = ((2*gridX)*xCount)+((2*lw)*xCount); // X width
|
|
yw = ((2*gridY)*yCount)+((2*lw)*yCount)+lw; // Y width
|
|
yj = (2*gridY)+(0.5*lw); // jump by this amount
|
|
|
|
hc = 3; //height count = height of stack
|
|
|
|
|
|
*base_shape();
|
|
module base_shape() {
|
|
cuboid([xw, yw, lh]);
|
|
}
|
|
|
|
xCavity();
|
|
module xCavity() {
|
|
jumpY = ((0.5*yw)-(0.5*gridY))-lw;
|
|
|
|
difference() {
|
|
color("Gray") base_shape();
|
|
|
|
union() {
|
|
for (i = [0:(yCount-1)]) {
|
|
translate([lw, -(jumpY-(i*((2*lw)+(2*gridY)))), 0])
|
|
color("Gainsboro") cuboid([xw, gridY, lh+VOID]); }
|
|
|
|
for (i = [0:(yCount-1)]) {
|
|
translate([-lw, -((jumpY-(lw+gridY))-(i*((2*lw)+(2*gridY)))), 0])
|
|
color("White") cuboid([xw, gridY, lh+VOID]); }
|
|
}}
|
|
}
|