diff --git a/Lego.json b/Lego.json index 527d65e..61406c0 100644 --- a/Lego.json +++ b/Lego.json @@ -4,6 +4,16 @@ "type": "1", "studs_x": "4", "studs_y": "2" + }, + "Brick_2x2": { + "type": "1", + "studs_x": "2", + "studs_y": "2" + }, + "Brick_2x1": { + "type": "1", + "studs_x": "2", + "studs_y": "2" } }, "fileFormatVersion": "1" diff --git a/Lego.scad b/Lego.scad index b90792d..13f5004 100644 --- a/Lego.scad +++ b/Lego.scad @@ -10,6 +10,8 @@ stud_details = 4 * ($preview ? 5 : 10); wall_width = 1.4; ceiling_width = 1; +assert(studs_x >= studs_y, "studs_x must be equal or larger than studs_y"); + module stud() { cylinder(d = 4.8, h = 1.8, $fn = stud_details); } @@ -37,11 +39,19 @@ module pillar() { cylinder(h = block_height, d = 6.51, $fn = stud_details); } +module small_pillar() { + cylinder(h = block_height, d = 3.2, $fn = stud_details); +} + module pillars() { if (studs_x >= 2 && studs_y >= 2) { for (x = [0:studs_x-2], y = [0:studs_y-2]) translate([(x+1) * length_per_stud, (y+1) * length_per_stud, 0]) pillar(); + } else if (studs_y >= 2) { + for (x = [0:studs_x-2]) + translate([(x+1) * length_per_stud, length_per_stud/2, 0]) + small_pillar(); } }