Skip to content

Instantly share code, notes, and snippets.

@creationix
Last active March 24, 2020 15:06
Show Gist options
  • Save creationix/7dac74086928467b3c3add7115f12184 to your computer and use it in GitHub Desktop.
Save creationix/7dac74086928467b3c3add7115f12184 to your computer and use it in GitHub Desktop.
Block Raised Garden
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
width=6;
depth=3;
total_bricks=width*2+depth*2;
inside_surface_area=(width*16-8)/12 * (depth*16-8)/12;
echo("Total bricks",total_bricks);
echo("Dirt surface Area (sqft)", inside_surface_area);
for (i=[0:1:width-1]){
translate([i * 16,0,0]) {
small_block();
translate([8,0,4])
block();
}
translate([i * 16,depth*16,0]) {
translate([8,0,0])
small_block();
translate([0,0,4])
block();
}
}
for (i=[0:1:depth-1]){
translate([0,i*16,0]) {
translate([8,8,0]) rotate([0,0,90])
small_block();
translate([8,0,4]) rotate([0,0,90])
block();
}
translate([width*16,i*16,0]) {
translate([8,0,0]) rotate([0,0,90])
small_block();
translate([8,8,4]) rotate([0,0,90])
block();
}
}
module block() {
//#cube([16, 8, 8]);
translate([0,0,3/16]) linear_extrude(height=7+5/8)
import("block-profile.svg", dpi=25.4);
}
module small_block() {
//#cube([16,8,4]);
translate([3/16,3/16,3/16])
cube([15+5/8,7+5/8,3+5/8]);
}
@creationix
Copy link
Author

creationix commented Mar 24, 2020

ECHO: "Total bricks", 18
ECHO: "Dirt surface Area (sqft)", 24.4444

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment