From fdd57cc133fa4e191973a51dc6e6df067ebc9e54 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 29 Aug 2022 16:46:59 -0600 Subject: [PATCH] What I'm printing in bulk. I did a bunch of annonying my family members with stupid questions about whether 0.5mm change was important. This is what we wound up with. --- .gitignore | 1 + LICENSE.md | 21 ++++++++++++++++++++ README.md | 45 +++++++++++++++++++++++++++++++++++++++++ build.sh | 6 ++++++ chip.scad | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ parameters.json | 17 ++++++++++++++++ 6 files changed, 143 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE.md create mode 100644 README.md create mode 100755 build.sh create mode 100644 chip.scad create mode 100644 parameters.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1567411 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.stl diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..a18d60f --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright © 2022 Neale Pickett + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +The software is provided "as is", without warranty of any kind, express or +implied, including but not limited to the warranties of merchantability, +fitness for a particular purpose and noninfringement. In no event shall the +authors or copyright holders be liable for any claim, damages or other +liability, whether in an action of contract, tort or otherwise, arising from, +out of or in connection with the software or the use or other dealings in the +software. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..dafdb70 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# Poker Chips + +This is an OpenSCAD program to build a poker chip. + +You can tell it how many sides you want. +Want round ones? Tell it 360 sides. +I like hexagonal ones, so that's the default. + +The front has text on it, +the back doesn't. +So you can use them for games that need some sort of coin with two sides. + + +# Chip Colors + +This is what I found on some random crafting web site. +I hate poker, +so random website's color scheme works fine for me. + + +| Value | Color | +| --- | --- | +| 1 | White | +| 5 | Red | +| 10 | Blue | +| 25 | Green | +| 50 | Orange | +| 100 | Black | +| 250 | Light Red | +| 500 | Purple | +| 1000 | Yellow | +| 2000 | Light Blue | +| 5000 | Brown | + + +# Chip Sizes + +A "standard" poker chip is 39mm wide, and 3.5mm thick. + +A "miniature" poker chip is 22m wide, and 3.5mm thick. + +There are boxes you can print that work will with these dimensions. + +You can make yours whatever size you like, though. +I won't tell anybody. diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..db0c7f9 --- /dev/null +++ b/build.sh @@ -0,0 +1,6 @@ +#! /bin/sh + +cat parameters.json | jq -r ".parameterSets | keys | .[]" \ +| while read param; do + openscad -o "${param}.stl" -p parameters.json -P "${param}" chip.scad +done \ No newline at end of file diff --git a/chip.scad b/chip.scad new file mode 100644 index 0000000..a439059 --- /dev/null +++ b/chip.scad @@ -0,0 +1,53 @@ +// Diameter of the coin (mm) +diameter = 22; + +// Height of the coin (mm) +height = 2; + +// Engraving depth (mm) +depth = 0.5; + +// Number of sides on your coin +sides = 6; // [3:360] + +// Text to display +TEXT = "100"; + +fontScale = ( + sides == 3 ? 0.50 + : sides == 4 ? 0.80 + : sides == 5 ? 0.80 + : sides == 6 ? 0.90 + : 1.00 +); + +// Enough width to fit four digits +fontSize = diameter * 0.21 * fontScale; + +// Rotate odd-numbers of sides to maximize width +rotation = (sides%2)?90:0; + +module chip() { + intersection() { + cylinder(h=height, d=diameter, center=true, $fn=sides); + union() { + 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); + } + } + for (i = [0 : 30 : 360]) { + rotate(i) cube([diameter*0.8, diameter/8, height*0.7], center=true); + } + } + } +} + +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"); +} diff --git a/parameters.json b/parameters.json new file mode 100644 index 0000000..b9ac950 --- /dev/null +++ b/parameters.json @@ -0,0 +1,17 @@ +{ + "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"} + } +} \ No newline at end of file