It’s official; we are moving to NYC this summer! This means downsizing from a house to an apartment, and some interesting furniture decisions. To help sort things out (and to procrastinate actually packing for as long as possible) I wrote a customizable sofa generator in OpenSCAD, and used it to model our sofas:
Thingiverse link: http://www.thingiverse.com/make:77609
Settings: Printed on a Replicator 2 with MakerWare .3mm/low.
Technical notes, OpenSCAD flavor: The code below makes sofas in the same way that we made knots in Day 153, by using hulls of collections of spheres. For example, the sofa code starts by forming an upright rectangular solid to make the back of the sofa, with eight spheres placed at the corners and then hull() filling in the space between by taking the convex hull of those eight spheres. Of course we could also have used the cube() command to make the rectangular solid, but taking the hull of spherical corners is what gives our sofas a rounded, comfy look.
We used a scale of 1:50 for these models (meaning that our furniture is fifty times as long, wide, and tall as these models) and a conversion factor that allowed us to enter our dimensions in inches. For example, one of our sofas has depth 59″, length 70″, and height 32″. To convert these to inches we have to multiply by 25.4, since there are 25.4 millimeters in an inch. Then to make the scale 1:50 we divide by scale=50. In the future we’ll add the ability to scale automatically to certain types of graph paper.
// renders //////////////////////////////////////////////////
//uncomment the one you want to make
I really love this series – wish we had had a series of units when planning our new kitchen – maybe manufacturers will soon routinely provide printable models.
I would be tempted to refactor (easy to do after you've done the work )
module cuboid(depth,length,height,r=1) {
hull(){
translate([0,0,0]) sphere(r);
translate([depth,0,0]) sphere(r);
translate([depth,length,0]) sphere(r);
translate([0,length,0]) sphere(r);
translate([0,length,height]) sphere(r);
translate([depth,length,height]) sphere(r);
translate([depth,0,height]) sphere(r);
translate([0,0,height]) sphere(r);
}
}
module sofa(depth,length,height,r=2) {
cuboid(depth/4,length,height); //back
cuboid(depth,depth/4,height/2); // left arm
translate([0,length-depth/4,0])
cuboid(depth,depth/4,height/2); //right arm
cuboid(depth,length,height/3); // cushions
}
scale(s)
sofa(39,90,32);