StudDiameter = 5;
StudHeight = 1.8;
BaseSize = 8;
PlateHeight = 3.2;
WallThickness = 1.6;
InnerHeightTolerance = 0.5;
difference() {
tile(2,8);
translate([2,4,PlateHeight-0.0001]) linear_extrude(1) text("Nirastich",7.5,halign="left",valign="bottom",font="Liberation Sans:style=Bold");
translate([46,4,PlateHeight-0.0001]) linear_extrude(1) text(".com",5,halign="left",valign="bottom",font="Liberation Sans:style=Bold");
}
module brick(depth, width) {
union() {
difference() {
cube([width*BaseSize,depth*BaseSize,3*PlateHeight]);
translate([WallThickness,WallThickness,-1])
cube([width*BaseSize-2*WallThickness,depth*BaseSize-2*WallThickness,2*PlateHeight+StudHeight+InnerHeightTolerance+1]);
tol(depth,width);
}
if (depth > 1 && width > 1) {
for (a = [1:depth-1]) {
for (b = [1:width-1]) {
translate([b*BaseSize,a*BaseSize,0]) tube(2*PlateHeight+StudHeight+InnerHeightTolerance);
}
}
}
if (depth <= 1 && width > 1) {
for (a = [1:width-1]) {
translate([a*BaseSize,BaseSize/2,0]) smalltube(2*PlateHeight+StudHeight+InnerHeightTolerance);
}
}
if (depth > 1 && width <= 1) {
for (a = [1:depth-1]) {
translate([BaseSize/2,a*BaseSize,0]) smalltube(2*PlateHeight+StudHeight+InnerHeightTolerance);
}
}
for (a = [1:depth]) {
for (b = [1:width]) {
translate([b*BaseSize,a*BaseSize,3*PlateHeight])stud();
}
}
}
}
module plate(depth, width) {
union() {
difference() {
cube([width*BaseSize,depth*BaseSize,PlateHeight]);
translate([WallThickness,WallThickness,-1])
cube([width*BaseSize-2*WallThickness,depth*BaseSize-2*WallThickness,StudHeight+InnerHeightTolerance+1]);
tol(depth,width);
}
if (depth > 1 && width > 1) {
for (a = [1:depth-1]) {
for (b = [1:width-1]) {
translate([b*BaseSize,a*BaseSize,0])tube(StudHeight+InnerHeightTolerance);
}
}
}
if (depth <= 1 && width > 1) {
for (a = [1:width-1]) {
translate([a*BaseSize,BaseSize/2,0]) smalltube(StudHeight+InnerHeightTolerance);
}
}
if (depth > 1 && width <= 1) {
for (a = [1:depth-1]) {
translate([BaseSize/2,a*BaseSize,0]) smalltube(StudHeight+InnerHeightTolerance);
}
}
for (a = [1:depth]) {
for (b = [1:width]) {
translate([b*BaseSize,a*BaseSize,PlateHeight])stud();
}
}
}
}
module tile(depth, width) {
union() {
difference() {
cube([width*BaseSize,depth*BaseSize,PlateHeight]);
translate([WallThickness,WallThickness,-1])
cube([width*BaseSize-2*WallThickness,depth*BaseSize-2*WallThickness,StudHeight+InnerHeightTolerance+1]);
groove(depth,width);
tol(depth,width);
}
if (depth > 1 && width > 1) {
for (a = [1:depth-1]) {
for (b = [1:width-1]) {
translate([b*BaseSize,a*BaseSize,0])tube(StudHeight+1);
}
}
}
if (depth <= 1 && width > 2) {
for (a = [1:width-1]) {
translate([a*BaseSize,BaseSize/2,0]) smalltube(StudHeight+InnerHeightTolerance);
}
}
if (depth > 2 && width <= 1) {
for (a = [1:depth-1]) {
translate([BaseSize/2,a*BaseSize,0]) smalltube(StudHeight+InnerHeightTolerance);
}
}
}
}
module groove(depth, width) {
GrooveSize = 0.5;
difference() {
cube([width*BaseSize,depth*BaseSize,GrooveSize]);
translate([GrooveSize,GrooveSize,-1])
cube([width*BaseSize-2*GrooveSize,depth*BaseSize-2*GrooveSize,GrooveSize+2]);
}
}
module tol(depth, width) {
Tolerance = 0.1;
difference() {
cube([width*BaseSize,depth*BaseSize,10]);
translate([Tolerance,Tolerance,0])
cube([width*BaseSize-2*Tolerance,depth*BaseSize-2*Tolerance,10]);
}
}
module tube(height) {
OuterDiameter = 6.5;
InnerDiameter = 5;
difference() {
cylinder($fn=50,h=height,r1=OuterDiameter/2,r2=OuterDiameter/2);
translate([0,0,-0.5]) cylinder($fn=50,h=StudHeight+2,r1=InnerDiameter/2,r2=InnerDiameter/2);
}
}
module smalltube(height) {
OuterDiameter = WallThickness*2;
InnerDiameter = 0;
difference() {
cylinder($fn=50,h=height,r1=OuterDiameter/2,r2=OuterDiameter/2);
translate([0,0,-0.5]) cylinder($fn=50,h=StudHeight+2,r1=InnerDiameter/2,r2=InnerDiameter/2);
}
}
module stud() {
translate([-BaseSize/2,-BaseSize/2,0]) cylinder($fn=50,h=StudHeight,r1=StudDiameter/2,r2=StudDiameter/2);
}