Add plates and refined wall and pillar sizes
This commit is contained in:
parent
53679529f5
commit
574499bfa7
21
Lego.json
21
Lego.json
@ -1,19 +1,34 @@
|
||||
{
|
||||
"parameterSets": {
|
||||
"Brick_4x2": {
|
||||
"type": "1",
|
||||
"type": "brick",
|
||||
"studs_x": "4",
|
||||
"studs_y": "2"
|
||||
},
|
||||
"Brick_2x2": {
|
||||
"type": "1",
|
||||
"type": "brick",
|
||||
"studs_x": "2",
|
||||
"studs_y": "2"
|
||||
},
|
||||
"Brick_2x1": {
|
||||
"type": "1",
|
||||
"type": "brick",
|
||||
"studs_x": "2",
|
||||
"studs_y": "1"
|
||||
},
|
||||
"Plate_4x2": {
|
||||
"type": "plate",
|
||||
"studs_x": "4",
|
||||
"studs_y": "2"
|
||||
},
|
||||
"Plate_2x2": {
|
||||
"type": "plate",
|
||||
"studs_x": "2",
|
||||
"studs_y": "2"
|
||||
},
|
||||
"Plate_2x1": {
|
||||
"type": "plate",
|
||||
"studs_x": "2",
|
||||
"studs_y": "1"
|
||||
}
|
||||
},
|
||||
"fileFormatVersion": "1"
|
||||
|
14
Lego.scad
14
Lego.scad
@ -1,15 +1,19 @@
|
||||
/* [Lego Type] */
|
||||
type = 1; // [1:Standard]
|
||||
type = "brick"; // ["brick":Brick, "plate":Plate]
|
||||
studs_x = 4;
|
||||
studs_y = 2;
|
||||
|
||||
/* [Hidden] */
|
||||
block_height = 9.6; // The height of the block without studs
|
||||
block_height =
|
||||
type == "brick" ? 9.6 :
|
||||
type == "plate" ? 3.2 :
|
||||
0;
|
||||
length_per_stud = 31.8 / 4;
|
||||
stud_details = 4 * ($preview ? 5 : 10);
|
||||
wall_width = 1.4;
|
||||
wall_width = 1.5;
|
||||
ceiling_width = 1;
|
||||
|
||||
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");
|
||||
|
||||
module stud() {
|
||||
@ -36,7 +40,7 @@ module base() {
|
||||
}
|
||||
|
||||
module pillar() {
|
||||
cylinder(h = block_height, d = 6.51, $fn = stud_details);
|
||||
cylinder(h = block_height, d = 6.48, $fn = stud_details);
|
||||
}
|
||||
|
||||
module small_pillar() {
|
||||
@ -62,4 +66,4 @@ module block() {
|
||||
studs();
|
||||
}
|
||||
|
||||
block();
|
||||
block();
|
9
Makefile
9
Makefile
@ -1,8 +1,13 @@
|
||||
PARAMETERS := $(shell cat Lego.json | grep -v '"parameterSets": ""' | jq -r '.parameterSets | keys[]')
|
||||
STL = $(PARAMETERS:%=%.stl)
|
||||
SCAD = Lego.scad
|
||||
CONFIG = Lego.json
|
||||
|
||||
all: $(STL)
|
||||
|
||||
$(STL): Lego.scad Lego.json
|
||||
openscad -o $@ -P $@ $<
|
||||
clean:
|
||||
rm -f $(STL)
|
||||
|
||||
$(STL): $(SCAD) $(CONFIG) Makefile
|
||||
openscad -o $@ -p $(CONFIG) -P $(@:%.stl=%) $(SCAD)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user