Initial commit
This commit is contained in:
commit
96c98b8fd8
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.stl
|
10
Lego.json
Normal file
10
Lego.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"parameterSets": {
|
||||||
|
"Brick_4x2": {
|
||||||
|
"type": "1",
|
||||||
|
"studs_x": "4",
|
||||||
|
"studs_y": "2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fileFormatVersion": "1"
|
||||||
|
}
|
55
Lego.scad
Normal file
55
Lego.scad
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/* [Lego Type] */
|
||||||
|
type = 1; // [1:Standard]
|
||||||
|
studs_x = 4;
|
||||||
|
studs_y = 2;
|
||||||
|
|
||||||
|
/* [Hidden] */
|
||||||
|
block_height = 9.6; // The height of the block without studs
|
||||||
|
length_per_stud = 31.8 / 4;
|
||||||
|
stud_details = 4 * ($preview ? 5 : 10);
|
||||||
|
wall_width = 1.4;
|
||||||
|
ceiling_width = 1;
|
||||||
|
|
||||||
|
module stud() {
|
||||||
|
cylinder(d = 4.8, h = 1.8, $fn = stud_details);
|
||||||
|
}
|
||||||
|
|
||||||
|
module studs() {
|
||||||
|
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])
|
||||||
|
stud();
|
||||||
|
}
|
||||||
|
|
||||||
|
module base() {
|
||||||
|
difference() {
|
||||||
|
cube([ studs_x*length_per_stud, studs_y*length_per_stud, block_height ]);
|
||||||
|
translate([wall_width, wall_width, -ceiling_width]) {
|
||||||
|
cube([
|
||||||
|
studs_x*length_per_stud - wall_width * 2,
|
||||||
|
studs_y*length_per_stud - wall_width * 2,
|
||||||
|
block_height
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module pillar() {
|
||||||
|
cylinder(h = block_height, d = 6.51, $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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module block() {
|
||||||
|
base();
|
||||||
|
pillars();
|
||||||
|
translate([0, 0, block_height])
|
||||||
|
studs();
|
||||||
|
}
|
||||||
|
|
||||||
|
block();
|
Loading…
x
Reference in New Issue
Block a user