Tunable spoke count
This commit is contained in:
parent
fdd57cc133
commit
0fdc8b779e
|
@ -37,7 +37,7 @@ so random website's color scheme works fine for me.
|
|||
|
||||
A "standard" poker chip is 39mm wide, and 3.5mm thick.
|
||||
|
||||
A "miniature" poker chip is 22m wide, and 3.5mm thick.
|
||||
A "miniature" poker chip is 22m wide, and I don't know how thick.
|
||||
|
||||
There are boxes you can print that work will with these dimensions.
|
||||
|
||||
|
|
26
build.sh
26
build.sh
|
@ -1,6 +1,26 @@
|
|||
#! /bin/sh
|
||||
|
||||
cat parameters.json | jq -r ".parameterSets | keys | .[]" \
|
||||
if [ ! -f "$1" ]; then
|
||||
cat <<EOD
|
||||
Usage: $0 PARAMETERS
|
||||
|
||||
Builds everything listed in parameter file PARAMETERS.
|
||||
|
||||
Example:
|
||||
$0 mini-hex.json
|
||||
EOD
|
||||
return
|
||||
fi
|
||||
|
||||
run () {
|
||||
echo "=== $*"
|
||||
"$@"
|
||||
}
|
||||
|
||||
basedir=$(dirname $0)
|
||||
|
||||
mkdir -p build
|
||||
cat $1 | jq -r ".parameterSets | keys | .[]" \
|
||||
| while read param; do
|
||||
openscad -o "${param}.stl" -p parameters.json -P "${param}" chip.scad
|
||||
done
|
||||
run openscad -o "build/chip-${param}.stl" -p "$basedir/$1" -P "${param}" chip.scad
|
||||
done
|
||||
|
|
26
chip.scad
26
chip.scad
|
@ -10,8 +10,14 @@ depth = 0.5;
|
|||
// Number of sides on your coin
|
||||
sides = 6; // [3:360]
|
||||
|
||||
// How many holes (spokes) do you want?
|
||||
holes = 24; // [0:12]
|
||||
|
||||
// Text to display
|
||||
TEXT = "100";
|
||||
text = "100";
|
||||
|
||||
// The font must be installed locally on your system
|
||||
font = "Droid Sans:style=Bold";
|
||||
|
||||
fontScale = (
|
||||
sides == 3 ? 0.50
|
||||
|
@ -34,12 +40,20 @@ module chip() {
|
|||
difference() {
|
||||
cube([diameter, diameter, height], center=true);
|
||||
difference() {
|
||||
cylinder(h=height, d=diameter*0.8-0.0, center=true, $fn=sides);
|
||||
cylinder(h=height, d=diameter*0.8-2, center=true, $fn=sides);
|
||||
cylinder(h=height, d=diameter*0.8, center=true, $fn=sides);
|
||||
cylinder(h=height, d=diameter*0.7, center=true, $fn=sides);
|
||||
}
|
||||
}
|
||||
for (i = [0 : 30 : 360]) {
|
||||
rotate(i) cube([diameter*0.8, diameter/8, height*0.7], center=true);
|
||||
|
||||
if (holes == 0) {
|
||||
cube([diameter, diameter, height*0.7], center=true);
|
||||
} else {
|
||||
spokeWidth = (diameter/holes) * 0.8;
|
||||
rotate((sides+holes)%2?90:0) {
|
||||
for (i = [0 : 360/holes : 360]) {
|
||||
rotate(i) translate([diameter/2, 0, 0]) cube([diameter, spokeWidth, height*0.7], center=true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,5 +63,5 @@ difference() {
|
|||
rotate(rotation) chip();
|
||||
translate([0, 0, height/2-depth])
|
||||
linear_extrude(height=depth+0.1, convexity = 10, twist = 0)
|
||||
text(text=TEXT, font="Droid Sans:style=Bold", size=fontSize, halign="center", valign="center");
|
||||
text(text=text, font=font, size=fontSize, halign="center", valign="center");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
{
|
||||
"parameterSets": {
|
||||
"full-circle-1": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "1"
|
||||
},
|
||||
"full-circle-2": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "2"
|
||||
},
|
||||
"full-circle-5": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "5"
|
||||
},
|
||||
"full-circle-10": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "10"
|
||||
},
|
||||
"full-circle-20": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "20"
|
||||
},
|
||||
"full-circle-25": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "25"
|
||||
},
|
||||
"full-circle-50": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "50"
|
||||
},
|
||||
"full-circle-100": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "100"
|
||||
},
|
||||
"full-circle-250": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "250"
|
||||
},
|
||||
"full-circle-500": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "500"
|
||||
},
|
||||
"full-circle-1000": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "1000"
|
||||
},
|
||||
"full-circle-2000": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "2000"
|
||||
},
|
||||
"full-circle-5000": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 360,
|
||||
"holes": 6,
|
||||
"text": "5000"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
{
|
||||
"parameterSets": {
|
||||
"full-hex-1": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "1"
|
||||
},
|
||||
"full-hex-2": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "2"
|
||||
},
|
||||
"full-hex-5": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "5"
|
||||
},
|
||||
"full-hex-10": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "10"
|
||||
},
|
||||
"full-hex-20": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "20"
|
||||
},
|
||||
"full-hex-25": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "25"
|
||||
},
|
||||
"full-hex-50": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "50"
|
||||
},
|
||||
"full-hex-100": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "100"
|
||||
},
|
||||
"full-hex-250": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "250"
|
||||
},
|
||||
"full-hex-500": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "500"
|
||||
},
|
||||
"full-hex-1000": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "1000"
|
||||
},
|
||||
"full-hex-2000": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "2000"
|
||||
},
|
||||
"full-hex-5000": {
|
||||
"diameter": 39,
|
||||
"height": 3.5,
|
||||
"sides": 6,
|
||||
"holes": 6,
|
||||
"text": "5000"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
{
|
||||
"parameterSets": {
|
||||
"mini-circle-1": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "1"
|
||||
},
|
||||
"mini-circle-2": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "2"
|
||||
},
|
||||
"mini-circle-5": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "5"
|
||||
},
|
||||
"mini-circle-10": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "10"
|
||||
},
|
||||
"mini-circle-20": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "20"
|
||||
},
|
||||
"mini-circle-25": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "25"
|
||||
},
|
||||
"mini-circle-50": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "50"
|
||||
},
|
||||
"mini-circle-100": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "100"
|
||||
},
|
||||
"mini-circle-250": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "250"
|
||||
},
|
||||
"mini-circle-500": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "500"
|
||||
},
|
||||
"mini-circle-1000": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "1000"
|
||||
},
|
||||
"mini-circle-2000": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "2000"
|
||||
},
|
||||
"mini-circle-5000": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 360,
|
||||
"holes": 4,
|
||||
"text": "5000"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
{
|
||||
"parameterSets": {
|
||||
"mini-hexagon-1": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "1"
|
||||
},
|
||||
"mini-hexagon-2": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "2"
|
||||
},
|
||||
"mini-hexagon-5": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "5"
|
||||
},
|
||||
"mini-hexagon-10": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "10"
|
||||
},
|
||||
"mini-hexagon-20": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "20"
|
||||
},
|
||||
"mini-hexagon-25": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "25"
|
||||
},
|
||||
"mini-hexagon-50": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "50"
|
||||
},
|
||||
"mini-hexagon-100": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "100"
|
||||
},
|
||||
"mini-hexagon-250": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "250"
|
||||
},
|
||||
"mini-hexagon-500": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "500"
|
||||
},
|
||||
"mini-hexagon-1000": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "1000"
|
||||
},
|
||||
"mini-hexagon-2000": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "2000"
|
||||
},
|
||||
"mini-hexagon-5000": {
|
||||
"diameter": 22,
|
||||
"height": 2,
|
||||
"sides": 6,
|
||||
"holes": 3,
|
||||
"text": "5000"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"parameterSets": {
|
||||
"1": {"TEXT": "1"},
|
||||
"2": {"TEXT": "2"},
|
||||
"5": {"TEXT": "5"},
|
||||
"10": {"TEXT": "10"},
|
||||
"20": {"TEXT": "20"},
|
||||
"25": {"TEXT": "25"},
|
||||
"50": {"TEXT": "50"},
|
||||
"100": {"TEXT": "100"},
|
||||
"250": {"TEXT": "250"},
|
||||
"500": {"TEXT": "500"},
|
||||
"1000": {"TEXT": "1000"},
|
||||
"2000": {"TEXT": "2000"},
|
||||
"5000": {"TEXT": "5000"}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue