## Welcome to MakerHome

We've completed our yearlong print-a-day project!
All new material is now at Hacktastic: www.mathgrrl.com

## Monday, January 6, 2014

### Day 133 - Broken Hearts

Today the holiday visits are over and we are back to designing. Something simple to start, and to get ahead for the next holiday: customizable easy-to-print broken hearts that you can string together. More importantly, this model is also a tutorial for printing designs based on mathematical parametric functions in OpenSCAD.

STL file: http://www.geekhaus.com/makerhome/day133_brokenhearts.stl

Settings: MakerWare .3mm/low in almost no time at all. The top indentation of each heart has a gap so that you can chain the hearts together.

Technical notes: This model was made in OpenSCAD using the following parametric equations that define a heart shape (equations obtained from Wolfram's HeartCurve page):
x = 16 sin^3 t
y = 13 cos t - 5 cos 2t - 2 cos 3t - cos 4t
The OpenSCAD code that makes the model is as follows. In the Customizer version we had to cut and paste the 2dgraph.scad code at the end of the file instead of using the "include" shown below, which calls the file 2dgraph.scad from the folder EXTENSIONS in my OpenSCAD working folder.

// mathgrrl broken heart - OpenSCAD parametric graph example

/////////////////////////////////////////////////////////////
// EXTENSIONS ///////////////////////////////////////////////

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

// Set the diameter of the heart, in mm
heart_diameter = 20;

// Set the thickness of the line, in mm
line_thickness = 1;

// Set the height of the model, in mm
line_height = 3;

// Choose low numbers for jagged, high for smooth
number_of_steps = 48;

scalefactor = heart_diameter*1.15/20;

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

// broken heart parametric curve
// equation from http://mathworld.wolfram.com/HeartCurve.html
function x(t) = scalefactor*16*pow(sin(t),3);
function y(t) = scalefactor*(13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t));

// make the graph and extrude it
linear_extrude(height=line_height)
2dgraph( [0, 350], // stop before 360 to make broken
line_thickness, // set line thickness
steps=number_of_steps, // choose low/high poly look
parametric=true); // use parametric grapher