Add inner coaster pattern - circle
This commit is contained in:
parent
8ee2c372d8
commit
0041bc9c4a
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"parameterSets": {
|
||||
"design default values": {
|
||||
"$fn": "180",
|
||||
"Depth": "4",
|
||||
"Diameter": "101.6",
|
||||
"Inner_pattern": "c",
|
||||
"Inner_pattern_depth": "1",
|
||||
"Inner_pattern_width": "24.5",
|
||||
"Inset": "true",
|
||||
"Inset_depth": "1",
|
||||
"Inset_width": "15"
|
||||
},
|
||||
"hdd-2.5-v1": {
|
||||
"$fn": "180",
|
||||
"Depth": "4",
|
||||
"Diameter": "101.6",
|
||||
"Inner_pattern": "c",
|
||||
"Inner_pattern_depth": "1",
|
||||
"Inner_pattern_width": "24.5",
|
||||
"Inset": "true",
|
||||
"Inset_depth": "1",
|
||||
"Inset_width": "15"
|
||||
}
|
||||
},
|
||||
"fileFormatVersion": "1"
|
||||
}
|
||||
22
coaster.scad
22
coaster.scad
|
|
@ -5,13 +5,33 @@ Inset = false;
|
|||
Inset_depth = 4; // 0.1
|
||||
Inset_width = 5; // 0.1
|
||||
|
||||
Inner_pattern = "n"; // [n: None, c: Circle]
|
||||
Inner_pattern_width = 5; // 0.1
|
||||
Inner_pattern_depth = 1; // 0.1
|
||||
|
||||
$fn = 180; // 0.1
|
||||
|
||||
rotate([0, 180, 0]) {
|
||||
module coaster_frame() {
|
||||
difference() {
|
||||
cylinder(h = Depth, d = Diameter);
|
||||
if (Inset) {
|
||||
cylinder(h = Inset_depth, d = Diameter - 2*Inset_width);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
module coaster_pattern() {
|
||||
offset = Inset ? [0, 0, Inset_depth - Inner_pattern_depth] : [0, 0, -Inner_pattern_depth];
|
||||
if (Inner_pattern == "c") {
|
||||
translate(offset) {
|
||||
#cylinder(h = Inner_pattern_depth, d = Inner_pattern_width);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rotate([0, 180, 0]) {
|
||||
union() {
|
||||
coaster_frame();
|
||||
coaster_pattern();
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue