Add knobbed plate
This commit is contained in:
parent
7a792f0a91
commit
832b70605e
10
Lego.json
10
Lego.json
@ -25,6 +25,11 @@
|
|||||||
"studs_x": "6",
|
"studs_x": "6",
|
||||||
"studs_y": "6"
|
"studs_y": "6"
|
||||||
},
|
},
|
||||||
|
"Plate_10x2": {
|
||||||
|
"type": "plate",
|
||||||
|
"studs_x": "10",
|
||||||
|
"studs_y": "2"
|
||||||
|
},
|
||||||
"Plate_4x2": {
|
"Plate_4x2": {
|
||||||
"type": "plate",
|
"type": "plate",
|
||||||
"studs_x": "4",
|
"studs_x": "4",
|
||||||
@ -49,6 +54,11 @@
|
|||||||
"type": "slope45",
|
"type": "slope45",
|
||||||
"studs_x": "2",
|
"studs_x": "2",
|
||||||
"studs_y": "1"
|
"studs_y": "1"
|
||||||
|
},
|
||||||
|
"Knob_2x2": {
|
||||||
|
"type": "knob",
|
||||||
|
"studs_x": "2",
|
||||||
|
"studs_y": "2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fileFormatVersion": "1"
|
"fileFormatVersion": "1"
|
||||||
|
20
Lego.scad
20
Lego.scad
@ -1,5 +1,5 @@
|
|||||||
/* [Lego Type] */
|
/* [Lego Type] */
|
||||||
type = "brick"; // ["brick":Brick, "plate":Plate, "slope45":"Slope 45"]
|
type = "brick"; // ["brick":Brick, "plate":Plate, "slope45":"Slope 45","knob":Knob]
|
||||||
studs_x = 4;
|
studs_x = 4;
|
||||||
studs_y = 2;
|
studs_y = 2;
|
||||||
slice_x = false;
|
slice_x = false;
|
||||||
@ -7,24 +7,38 @@ slice_x = false;
|
|||||||
/* [Hidden] */
|
/* [Hidden] */
|
||||||
block_height =
|
block_height =
|
||||||
(type == "brick" || type == "slope45") ? 9.6 :
|
(type == "brick" || type == "slope45") ? 9.6 :
|
||||||
type == "plate" ? 3.2 :
|
(type == "plate" || type == "knob") ? 3.2 :
|
||||||
0;
|
0;
|
||||||
length_per_stud = 31.8 / 4;
|
length_per_stud = 31.8 / 4;
|
||||||
wall_width = 1.6;
|
wall_width = 1.6;
|
||||||
ceiling_width = 1;
|
ceiling_width = 1;
|
||||||
|
centered_knob = type == "knob";
|
||||||
$fs = 1;
|
$fs = 1;
|
||||||
|
|
||||||
assert(block_height > 0, "Invalid block height. Perhaps type is not correct?");
|
assert(block_height > 0, "Invalid block height. Perhaps type is not correct?");
|
||||||
assert(studs_x >= studs_y, "studs_x must be equal or larger than studs_y");
|
assert(studs_x >= studs_y, "studs_x must be equal or larger than studs_y");
|
||||||
|
|
||||||
module stud() {
|
module stud() {
|
||||||
|
if (type == "knob") {
|
||||||
|
difference() {
|
||||||
cylinder(d = 4.8, h = 1.8);
|
cylinder(d = 4.8, h = 1.8);
|
||||||
|
cylinder(d = 3.2, h = 1.9);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cylinder(d = 4.8, h = 1.8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module studs() {
|
module studs() {
|
||||||
|
if (centered_knob) {
|
||||||
|
for (x = [0:studs_x-2], y = [0:studs_y-2])
|
||||||
|
translate([(x+1) * length_per_stud, (y+1) * length_per_stud, 0])
|
||||||
|
stud();
|
||||||
|
} else {
|
||||||
for (x = [0:studs_x-1], y = [0:studs_y-1])
|
for (x = [0:studs_x-1], y = [0:studs_y-1])
|
||||||
translate([(x+0.5) * length_per_stud, (y+0.5) * length_per_stud, 0])
|
translate([(x+0.5) * length_per_stud, (y+0.5) * length_per_stud, 0])
|
||||||
stud();
|
stud();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module base() {
|
module base() {
|
||||||
@ -50,7 +64,7 @@ module base() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module pillar() {
|
module pillar() {
|
||||||
cylinder(h = block_height, d = 6.48);
|
cylinder(h = block_height, d = 6.55);
|
||||||
}
|
}
|
||||||
|
|
||||||
module small_pillar() {
|
module small_pillar() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user