## Welcome to MakerHome

We've completed our yearlong print-a-day project! New projects will be posted at www.mathgrrl.com/hacktastic.

All mathgrrl designs and associated images and files on MakerHome are licensed under the Creative Commons Attribution Non-Commercial Share Alike license. If you want to use designs, images, or files outside of the terms of this license, please email request@mathgrrl.com.

## Saturday, November 30, 2013

### Day 96 - Customizable Coin Traps

Finally I have gotten around to learning how to use OpenSCAD, and thus also the Thingiverse Customizer. Our first customizable design: traps for coins of any size, from any country!

Did you lose a bet? Pay them back with a coin they can never use. Or, did you win a bet? Immortalize your winnings in this trophy bank. Also good for stocking stuffers and little presents, and as good "first 3D print" jobs to introduce people to 3D printing.

The customizer includes pre-loaded diameters for all major US coins and the top 10 world currencies, as well as the option for entering coin diameters manually. Here is a picture of the US coins, each in their own trap:

STL files: http://www.geekhaus.com/makerhome/day96_customizabelcointraps.stl

Settings: MakerWare .2mm/standard settings with a Replicator 2. Traps took between 15 and 35 minutes depending on their size.

Technical notes: Below is the OpenSCAD code that makes these coin traps. Thank you to my student Patrick Moran for pointing me to Patrick Connor's easy video introductions to OpenSCAD.

// mathgrrl customizable coin traps

////////////////////////////////////////////////////////////
// PARAMETERS //////////////////////////////////////////////

// ignore this variable
\$fn = 24*1;

// Choose the type of coin you want and leave the size below as 0. They'll all look basically the same in the output window but they are different sizes.
coin_type = 0; // [0:Enter Manually,19.05:US Penny,21.21:US Nickel,17.91:US Dime,24.26:US Quarter,30.61:US Half Dollar,26.49:US Presidential Dollar,23.25:Euro,20:Japanese Yen,40:Chinese Yuan,25:Indian Rupee,20.5:Russion Ruble,22.5:British Pound,26.5:Canadian Dollar,23.2:Swiss Franc,23:Polish Zloty,27:Brazillian Real,21:Mexican Peso,25:Australian Dollar]

// *OR* choose "Enter Manually" above and then type in any diameter you like, in millimeters. Values between 15 and 35 mm work the best.
coin_size = 0;

// this chooses one of the above for the diameter
coin_diameter = max(coin_type,coin_size);

// other parameters based on the coin diameter

////////////////////////////////////////////////////////////
////// RENDERS /////////////////////////////////////////////

// build the trap
difference(){
box_hull(); // enclosing box area with rounded edges5
cylinder_holes(); // three cylindrical holes
cylinder_bevels(); // six spherical holes to bevel the holes
sphere_hole(); // one spherical hole for coin clearance
}

////////////////////////////////////////////////////////////
// MODULES /////////////////////////////////////////////////

// overall rounded cube shape
module box_hull(){
hull(){
translate([corner_distance,corner_distance,corner_distance])
translate([-corner_distance,corner_distance,corner_distance])
translate([corner_distance,-corner_distance,corner_distance])
translate([corner_distance,corner_distance,-corner_distance])
translate([-corner_distance,-corner_distance,corner_distance])
translate([-corner_distance,corner_distance,-corner_distance])
translate([corner_distance,-corner_distance,-corner_distance])
translate([-corner_distance,-corner_distance,-corner_distance])
}
}

// holes for the sides
module cylinder_holes(){
rotate([0,0,0])
rotate([90,0,0])
rotate([0,90,0])
}

// beveling for the side holes
module cylinder_bevels(){
translate([cylinder_bevel_distance,0,0])
translate([0,cylinder_bevel_distance,0])
translate([0,0,cylinder_bevel_distance])
translate([-cylinder_bevel_distance,0,0])
translate([0,-cylinder_bevel_distance,0])