Welcome to MakerHome




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


Sunday, February 16, 2014

Day 174 - MAA icosahedron

In a couple of days I'll be speaking at the Carriage House, the headquarters of the Mathematical Association of America. Since the MAA's logo is an icosahedron, I'll be bringing them one as a present:



STL file: http://www.geekhaus.com/makerhome/day174_MAAisosahedron.stl
OpenSCAD file: http://www.geekhaus.com/makerhome/day174_MAAisosahedron.scad
Thingiverse link: http://www.thingiverse.com/thing:252515

Settings: MakerWare .3mm/low with 5% infill (half as much as usual), on a Replicator 2, in about an hour. The black was added after printing with a Sharpie.

Technical notes: We printed hollow icosahedra on Day 32 and Day 100, but used a Community Shape Script file from Tinkercad that needed rotating to print on a flat face. Since I don't know how to rotate by non-integer degrees in Tinkercad, the rotation was not exact and some flat triangles had to be added to the top and base in order for the model to print correctly.  Today we finally got off our Keister and made a new icosahedron, constructing the triangle faces explicitly using the polyhedron command in OpenSCAD.  We used Harlan Martin's write.scad code from Thingiverse to add the text.

// mathgrrl MAA icosahedron

use <write.scad>

////////////////////////////////////////////////////////////////////
// parameters
////////////////////////////////////////////////////////////////////

$fn=12;
phi = (sqrt(5)-1)/2; 
scalefactor = 50; // 15 for small

////////////////////////////////////////////////////////////////////
// renders
////////////////////////////////////////////////////////////////////

// MAA logo sized for scalefactor 50
translate([1,-5,35])
color("red")
write("MAA",t=30,h=32,center=true);

icosahedron(scalefactor);

// uncomment this to see the vertices
//showvertices(scalefactor);

////////////////////////////////////////////////////////////////////
// module for icosahedron 
// vertex coords from Wikipedia
// http://en.wikipedia.org/wiki/Icosahedron#Cartesian_coordinates
////////////////////////////////////////////////////////////////////

module icosahedron(thescale){
scale(thescale)
// rotate to have flat top and base
rotate(-atan(1-phi),[1,0,0])
polyhedron(
// list the vertices in some order
points=[
[0,1,phi], //vx 0
[0,1,-phi], //vx 1
[0,-1,phi], //vx 2
[0,-1,-phi], //vx 3
[1,phi,0], //vx 4
[1,-phi,0], //vx 5
[-1,phi,0], //vx 6
[-1,-phi,0], //vx 7
[phi,0,1], //vx 8
[-phi,0,1], //vx 9
[phi,0,-1], //vx 10
[-phi,0,-1], //vx 11
],  
// define faces, each oriented counter-clockwise
triangles=[
// top face
[8,9,2],
// faces with edges incident with top face
[8,2,5],
[2,9,7],
[9,8,0],
// faces next row down
[8,4,0],
[8,5,4],
[2,3,5],
[2,7,3],
[9,6,7],
[9,0,6],
// faces another row down
[0,1,6],
[0,4,1],
[5,10,4],
[5,3,10],
[7,11,3],
[7,6,11],
// and one more down, with edges incident to bottom face
[4,10,1],
[3,11,10],
[6,1,11],
// bottom face
[10,11,1]
]
); 
}  

OpenSCAD's polyhedron command takes a list of vertices as inputs, followed by a list of triples of those vertices that determine oriented triangle faces. We got the coordinates for the vertices from Wikipedia's icosahedron page, and wrote a vertex visualizer to keep track of the twelve vertices and determine how to construct and orient the triangles. In case you want to use the same trick, here is the code for that vertex visualizer:

////////////////////////////////////////////////////////////////////
// vertex visualizer module 
// use for constructing oriented faces
////////////////////////////////////////////////////////////////////
module showvertices(thescale){
scale(thescale)
// rotate to have flat top and base
rotate(-atan(1-phi),[1,0,0])
union(){
// vertices in yz-plane
color("red") translate([0,1,phi]) sphere(.1); //vx 0
color("red") translate([0,1,-phi]) sphere(.2); //vx 1
color("red") translate([0,-1,phi]) cube(.1); //vx 2
color("red") translate([0,-1,-phi]) cube(.2); //vx 3
// vertices in xy-plane
color("blue") translate([1,phi,0]) sphere(.1); //vx 4
color("blue") translate([1,-phi,0]) sphere(.2); //vx 5
color("blue") translate([-1,phi,0]) cube(.1); //vx 6
color("blue") translate([-1,-phi,0]) cube(.2); //vx 7
// vertices in xz-plane
color("yellow") translate([phi,0,1]) sphere(.1); //vx 8
color("yellow") translate([-phi,0,1]) sphere(.2); //vx 9
color("yellow") translate([phi,0,-1]) cube(.1); //vx 10
color("yellow") translate([-phi,0,-1]) cube(.2); //vx 11
}
}

Saturday, February 15, 2014

Day 173 - LEGO ring

Thank you, tart2000, for making this lovely LEGO Ring on Thingiverse. My son had a great time adding the bling!


Thingiverse link: http://www.thingiverse.com/make:65858

Settings: MakerWare .3mm/low on a Replicator 2, with no raft or supports.

Technical notes: We made this from tart2000's "less chunky" demo file without any changes or customizations. At first we thought the 2x2 LEGO plate was not going to fit in the ring, but a set of pliers told us differently. The tight design makes the ring really secure, and it is easy to add and remove things from the ring without the plate falling out. A simple, elegant design that just works!

Friday, February 14, 2014

Day 172 - Mobius Heart

Happy Valentine's Day!  In celebration, today we made a Möbius strip in the shape of a heart. The OpenSCAD code was kindly provided by kitwallace.


From the side you can more clearly see its Möbius-ness:


Thingiverse link: http://www.thingiverse.com/thing:249696
OpenSCAD code: http://www.geekhaus.com/makerhome/day172_kitwallace_mobiusheart.scad

Settings: MakerWare .3mm/low with no raft and no supports in 26 minutes.

Technical notes: Below is kitwallace's OpenSCAD code, in case you want to change any of the parameters for your own print.  The heart equations are the same ones we used in Day 133, with a sine curve thrown in on the z-coordinate for curviness.

// Mobius heart by kitwallace

//Radius of strip
Radius = 20;
//Width of Strip
Width = 7;
//Thickness of strip
Thickness=1.2;
//Half twists 0 is a collar, 1 is the mobius strip, 2 = full twist
Halftwist=1;
//Start Angle - important if Halftwist = 0
Start=90;
//Step size in degrees
Step = 2;

function f(t) =
[ 16*pow(sin(t),3),
  13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t),
  5*sin(2*t)
];

module mobius_strip(radius,width,thickness,step=3,halftwist=3,start=90) {
  for (i = [0:step:360])
   hull() {
    translate(f(i))
     rotate([0,start+i * halftwist * 0.5, 0])
       cube([width,Delta,thickness], center=true);
    translate(f(i+step))
     rotate([0,start+(i+step)* halftwist * 0.5 , 0])
       cube([width,Delta,thickness], center=true);
  }
}

Delta= 0.1;
mobius_strip(Radius,Width,Thickness,Step,Halftwist,Start);

Thursday, February 13, 2014

Day 171 - Sliced Menger 3: Triangles

The Menger slices from Day 169 and Day 170 each divided the cube into two identical pieces. Today we make a a slice parallel to the Starmaker from the first day, but higher up. What will the slice look like? Don't peek until you've tried to draw it!


This piece is interesting because makes the largest possible hole on the inside; a triangle that goes all the way to three of the edges of the cube.


Settings: MakerWare .2mm/standard on a Replicator 2 with no support and no raft, using owens' disposable Menger-printing stand.

Wednesday, February 12, 2014

Day 170 - Sliced Menger 2: Rhomboidal

Lots of people know what the inside of a sliced Menger cube looks like, at least the way we sliced it yesterday. But there are infinitely many ways to slice a cube into two identical pieces, and each one will make a different cross-section with different interior markings inherited from the Menger cube's holes. For example, what does this slice look like? Don't peek at the second picture until you've had a chance to guess!


The slice itself is a rhombus, with some nice four-fold symmetry inside:


Settings: MakerWare .2mm/standard on a Replicator 2, with no supports and no raft (using owens' stand as part of the model).

Thingiverse link: http://www.thingiverse.com/make:65847

Tuesday, February 11, 2014

Day 169 - Sliced Menger 1: Starmaker

Today we made a white stand and slice illustrator to accompany the diagonally sliced Level 2 Menger sponge we printed on Day 155.  Don't look at the second picture until you try to guess what the white slice looks like!


My God, it's full of stars!


Thingiverse link: http://www.thingiverse.com/make:65825

Settings: MakerWare .2mm/standard on a Replicator 2 with no support and no raft, thanks to owens' great disposable stand that prints with the model (see Day 157).

Technical notes, Kinks flavor: This model Starmaker is named after the first song on the Kinks' concept album Soap Opera.  I can take the most ordinary cube in the world and make it a star!

Monday, February 10, 2014

Day 168 - Mobius Trefoil

Using the same OpenSCAD code of kitwallace's from yesterday, today we made a Mobius-like solid whose cross-sections are triangles and whose boundary is the trefoil knot - that is, the knot that wraps three times around the outside of a torus while wrapping twice around its handle.


STL file: http://www.geekhaus.com/makerhome/day168_trefoilmobius.stl
Thingiverse link: http://www.thingiverse.com/make:65700

Settings: MakerWare .3mm/low with the custom knot support described in Day 110.

Sunday, February 9, 2014

Day 167 - Umbilic torus

Today we did not print an umbilic torus.  But we did print a triangular-cross-section mobius strip, which is very close. In yesterday's post we wished for a way to remesh Mathematica output, and it turns out that at least for this kind of object, kitwallace had already posted a way to make seamless mobius bands with OpenSCAD on his blog The Wallace Line. And even better, kitwallace's code allows for different numbers of sides, which makes for some beautiful objects. This one is posing in such a way to mimic the iconic umbilic torus that graces the covers of Larson's calculus textbooks:



Settings: MakerWare .3mm/low using the custom knot support described in Day 110.

UPDATE 2/20/2014: I got to see Helaman Ferguson's beautiful umbilic torus sculpture in person at the MAA Carriage house in DC today! You can even touch it, and feel the Peano curve (see Day 61) carved into its surface. It's beautiful.


You can much read more about this beautiful art piece as well as a much larger version of the piece at Ivars Peterson's Mathematical Tourist blog.

Saturday, February 8, 2014

Day 166 - Mobius

Today I spoke with jamesford007, a student at SUNY Geneseo who is spearheading efforts there to bring 3D printing into the study of mathematics. He shared with me his technique for creating thickened parametric surfaces in Mathematica that can be exported as STL files, and posted a lovely Mobius strip on Thingiverse which is our 3D print for the day:



Settings: MakerWare with the custom slicing profile that we use for printing knots (see Day 110), to minimize support. We printed this vertically, standing on the flat side to the right in the picture above. In that orientation the only support that is printed is a small amount at the base and a very thin sheet of support that supports the top of the model through the center.

Technical notes: Here is the Mathematica code that James wrote to generate this model:

F[u_, v_] := {(Cos[u] + v*Cos[u/2]*Cos[u]), (Sin[u] + v*Cos[u/2]*Sin[u]), v*Sin[u/2]} 
MobiusStrip = ParametricPlot3D[{F[u, v]}, {u, 0, 2 Pi}, {v, -.3, .3}, 
PlotStyle -> Thickness[.1]]

This works beautifully when exported to STL from Mathematica, with one problem: A seam is printed where the parametrization closes up at 2pi. On my printer the model did not split at this seam, but it was visible. Trying to cheat by extending the parametrization to 2pi+.1 just increases the problem with an even more noticeable seam.  I had the same seam problem with the rocking knot from Day 110, and didn't resolve it for that model until the OpenSCAD redesign in Day 151. There must be a way to remesh objects like these in MeshLab or some other program, but I don't know it yet. Please let me know if you do!

Friday, February 7, 2014

Day 165 - One-piece catapult

A student in my GSCI 104: 3D Printing class built a catapult that prints in one piece! Inspired by zheng's multi-piece Seej Catapult on Thingiverse, zackowen built a new Print in Place Catapult in Tinkercad that requires no assembly. We printed it successfully with no raft or supports at all!


Thingiverse link: http://www.thingiverse.com/make:64946

Settings: MakerWare .3mm/low with no raft and no support. The movable piece worked perfectly with no obstruction or weaknesses. The base of the firing arm was a little bit above the platform and printed with some sagging, but it was easy to cut off the loose threads.

Thursday, February 6, 2014

Day 164 - Two-color gyroscope

Gyroscope time is going to go on for a while! Today we used the Custimizer version of althepal's Another parmeterized gimbal to make a 6-hoop version and switched filament partway through to get a two-color effect. It's really impressive.


Thingiverse link: http://www.thingiverse.com/make:64808

Settings: MakerWare .3mm/low in a bit over an hour.

Technical notes: We used the following options in the Customizer for this model:
outer_r = 40
hoop_thinkness = 3
hoop_height = 8
hoop_gap = 1
num_hoops = 6
UPDATE: This print spins easily and beautifully, but it is a little loose and some of the rings occasionally fall off. They are easy to put back on again, but I'd prefer a tighter model that this, so next time I'll lower the hoop_gap parameter.

Wednesday, February 5, 2014

Day 163 - Working gyroscope!

I don't know why, but I haven't had much luck 3D-printing gyroscopes - either from Thingiverse or that I designed myself. It really shouldn't be that hard, but somehow the prints were either too loose or too tight, and I sort of gave up for a while. Today we gave it another go with althepal's Another parmeterized gimbal model on Thingiverse, and success! Thank you, althepal, for making such a nice model.


Thingiverse link: http://www.thingiverse.com/make:64763

Settings: .3mm/low on an Afinia H-Series.

Technical notes: We used althepal's sample file rather than the Customizer. Tomorrow, we Customize!

Tuesday, February 4, 2014

Day 162 - Sliced level 3 Menger cube

We are going to be printing a lot of Menger-type objects, I think. Today's is a level 3, sliced to reveal the stars. Model again by owens on Thingiverse. Here's the print in front of a mirror:



Settings: MakerWare .2mm/standard in 7 hours and 27 minutes. 

Technical notes: The first time I printed this Menger slice it worked wonderfully, but the second time I had a serious problem removing the model from the build platform. Next time I think I'll print this in owens' "on the corner" configuration, the same way yesterday's cube was printed.

Monday, February 3, 2014

Day 161 - Level 3 Menger cube on a filament printer!

Thank you, owens at Thingiverse!  You have made the impossible possible.  It was great fun walking this print around the math department today, since everyone there knows just how difficult it is to print this object on a filament-deposition machine.


Beautiful! As we said on Day 157, in hindsight the idea is simple, but genius is to dream it up and do it: print a Menger cube on its corner, supported on a stand that prints at the same time and can be removed later. Owens' create a clever design does just that, with a very well-made external support stand that leaves nearly no trace on the model after removal. To get a sense of just how great owens' model is, compare it to our first print of a Level 3 Menger Cube back in August, which was full of internal support material that will live in those tiny holes forever:


But don't think about that, because now we can print Menger cubes all day long with no worries and no support.

Thingiverse link: http://www.thingiverse.com/thing:240739

Settings: MakerWare .2mm/standard in about six and a half hours.

Sunday, February 2, 2014

Day 160 - Stella prints!

This is what happens on the first day that an 11-year-old girl and an 8-year-old girl learn how to design 3D models. The first day! I look forward to the next generation of grrl power makers!


Settings: MakerWare .3mm/low. Thank you S&S for the guest prints today!

Saturday, February 1, 2014

Day 159 - Catan expander

At our house we have enough extra hex tiles to play a five-person Catan game, but not a fifth set of pieces. Today we printed a new full set of Settlers of Catan pieces, including the knight and city wall pieces needed for the Cities and Knights Expansion Pack and a set of rings to attach to LEGOs to hold a new stack of homemade Cities and Knights flip-cards. The standard pieces in this print job came from Arcym's Settlers of Catan Pieces model on Thingiverse, and the Cities and Knights pieces were easy to add in Tinkercad. We also threw in a new print of our Catan numbers from Day 42.



STL file: http://www.geekhaus.com/makerhome/day159_catan_expander.stl
Tinkercad link: https://tinkercad.com/things/b1RgkZvMY4s-day-159-catan-expander
Thingiverse link: http://www.thingiverse.com/thing:239439

Settings: MakerWare .3mm/low on a Replicator 2.

Friday, January 31, 2014

Day 158 - One hundred fidget cubes

Actually, it's 105, counting the ones that are printing in the background. We've been making these all week; they print fairly reliably in batches of a dozen. We need to make 400 of these by mid-March for a set of conference giveaways.


STL file: http://www.geekhaus.com/makerhome/day158_fidgetcubesmall.stl
Thingiverse link: http://www.thingiverse.com/make:64083

Settings: MakerWare .2mm/standard with no raft and no support (this layer height and settings are required for the hinges and clearances to work correctly). Each batch of 12 takes a bit over four hours to print.

Technical notes: Here are the customizer settings that make this model. (This is just like the tiny example model from Day 148 except with hinge_clearance increased to 0.5.)
cube_height = 10
hinge_radius = 1.5
snub = yes
stacking_clearance = .3
hinge_clearance = .5

Thursday, January 30, 2014

Day 157 - One-piece Menger cube without internal supports

The Holy Grail!  Owens' model Menger sponge with external support prints a beautiful Level 2 Menger sponge with no internal supports. The difficulty with printing a Menger sponge on a filament-deposition printer is that in the horizontal position, the model is stable on the build platform but requires a vast amount of internal support that is nearly impossible to remove. On the other hand, in the diagonal position, the model has holes with 45-degree sides that are easy to print without support, but as a whole is unstable on the platform.

In hindsight the solution is obvious, but such is the case with all great ideas. The hard part is to have the idea in the first place! The key to owens' model is a specially constructed ring of external support that is easy to break off after printing. It works beautifully!


Thingiverse link: http://www.thingiverse.com/thing:238551

Settings: MakerWare .2mm/standard on a Replicator 2; each model is at 50% scale and took just under an hour to print.

Stuff to change: It would not be difficult to change owens' OpenSCAD code (at the Thingiverse link) to make a Level 3 Menger cube. Or, dare we hope, Level 4??

Wednesday, January 29, 2014

Day 156 - Olee's designs

Today we printed some custom bracelets for my niece, who mailed us a very nice letter that included some awesome designs to start from.  Her designs were so good that we decided to print them exactly as she drew them! We tried to size them correctly but if they don't fit then they can be used as picture frames or room decorations.


Tinkercad link for heart: https://tinkercad.com/things/89CANRAiU05-day-156-olee-heart
Tinkercad link for frame: https://tinkercad.com/things/6fmQbUNMfqv-day-156-olee-olee
Thingiverse link: http://www.thingiverse.com/thing:238516

Settings: MakerWare .3mm/low on a Replicator 2.

Technical notes: We used the photo --> Inkscape --> bitmap --> SVG --> Tinkercad chain to make this, just like in Day 109.

Tuesday, January 28, 2014

Day 155 - Menger slice

Today we printed owens' Diagonal Cut Menger Sponge design from Thingiverse. If you sliced a Level 2 Menger sponge in half along a diagonal plane as shown in the picture, what would the sliced face look like? Before you scroll down, take a look at this picture and try to imagine it: If you could see the hidden diagonal face made by the slice, what would it look like? Would it have holes in it? What kind? Don't peek!


The answer is: Whatever you said, you're wrong. Instead you get this:


Thingiverse link: http://www.thingiverse.com/make:63728

Settings: MakerWare .3mm/low, with no raft and no support. This makes a nice model but the detail on the stars could be better, so next time we'll use a finer setting.

Further reading: Making sliced Menger cubes is a popular sport. MadOverlord's design Diagonally-Sliced 3-Level Menger Sponge is a nice Level 3 version. Over at the Simons Foundation, George Hart has a nice video about slicing Menger cubes. And Gaya has a nice post on her blog A Girl with a 3D Printer about the advantages of printing Menger cubes diagonally instead of in the upright position. Printing upright/horizontally causes great sadness and an impossible amount of support to remove, but diagonal printing allows for beautiful prints without any support material at all.

Monday, January 27, 2014

Day 154 - First Digitizer Print!

To break in the new MakerBot Digitizer in the JMU 3-SPACE Classroom, my student Patrick scanned and printed a beautiful African woman statue that another student gave me as a gift many years ago. It came out great, with lots of the details intact even with a small print. (This model is also a prototype of a game token that will be part of a later project, so stay tuned.) Does it count as a "print from home" if this print was made at work, and not even by me? It's my blog and I''m really excited about the Digitizer so yes, yes it does.


STL file: http://www.geekhaus.com/makerhome/day154_africanstatue.stl
Thingiverse link: COMING SOON

Settings: MakerWare .2mm/standard. Although we nearly always print in .3mm/low, in this case we wanted to catch some of the finer details.

Call for suggestions: We are finding it surprisingly difficult to find things to scan for some reason. Everything we consider is either something we could design ourselves, or something that has too much interior detail or too many organic features to scan reliably, or something very shiny and therefore difficult to scan, or something we already 3D printed! If you have any good suggestions please let me know. Somehow I thought we would be digitizing everything in sight right away, but we seem to have scanner's block...

Sunday, January 26, 2014

Day 153 - Stick and lattice trefoil knots

To finish our collection of trefoil conformations, we have a stick knot and a cubic lattice knot:


STL file for stick: http://www.geekhaus.com/makerhome/day153_trefoil_stick_40_25.stl
STL file for lattice: http://www.geekhaus.com/makerhome/day153_trefoil_lattice_40_25.stl
Thingiverse link: http://www.thingiverse.com/thing:234107

Technical notes, math flavor: Usually in knot theory, although the knots we draw are curvy, in the back of our minds we require that the knots we study are nice enough to be put into some piecewise-linear format with a finite number of straight pieces. This is to avoid having to deal with wild knots, which are truly unreasonable and the sort of thing you see in the following diagram from Rolfsen's book Knots and Links (image here from Aaron Heap of SUNY Geneseo):


I remember when I first saw this picture, at literally half the age I am now, while in an REU program learning about knot theory for the first time. My brain fell into a thousand tiny pieces, after which I agreed: we *definitely* do not want to work with knots like these. (Nowadays we have fancier pictures of the terrible and wonderful Alexander horned sphere, if you are interested.)

Anyway, the stick and lattice knots above are very nice knots, not wild at all, but the first question we have to ask about such knots is this: given a knot, can we always represent it in such a fashion? And if so, what is the fewest number of sticks that we can use (the stick number)? In the first example we have a stick knot for which the only requirement is that the sticks be sticks. In the second picture we also require that the sticks sit on a cubic integer lattice, which means that more sticks are required. People also study knots made out of sticks that are all the same length ("equilateral" stick knots) and knots that are made out of sticks with the same length and the same angle between each adjacent pair of sticks ("alpha-regular" stick knots). The stick knot model of the trefoil above illustrates that 6 is the minimum possible number of sticks that can be used to make a trefoil. The right-angled lattice knot on the right side of the picture illustrates that 24 units is the minimum length of rope that can be used to make the trefoil in the cubic lattice.

Technical notes, OpenSCAD flavor: The code for these knots is easy; each knot is constructed from a very small number of spheres at specific coordinates which are combined in "hulls" when adjacent. The coordinate data is from The Knot Server. And yes, this is ridiculously stupid OpenSCAD code but it makes pretty knots anyway!

// trefoil in minimal stick conformation
// http://newweb.cecm.sfu.ca/cgi-bin/KnotPlot/KnotServer/kserver?ncomp=1&ncross=3&id=1
s = 13;
r=2.5;
p1=[s*0.300775, s*1.301248, s*(-0.702434)];
p2=[s*(-0.976281), s*(-0.910795), s*0.701983];
p3=[s*0.976171, s*(-0.910795), s*(-0.702076)];
p4=[s*(-0.300495), s*1.300967, s*0.702620];
p5=[s*(-1.276451), s*(-0.390204), s*(-0.702474)];
p6=[s*1.276282, s*(-0.390420), s*0.702381];
hull(){
translate(p1) sphere(r);
translate(p2) sphere(r);
}
hull(){
translate(p2) sphere(r);
translate(p3) sphere(r);
}
hull(){
translate(p3) sphere(r);
translate(p4) sphere(r);
}
hull(){
translate(p4) sphere(r);
translate(p5) sphere(r);
}
hull(){
translate(p5) sphere(r);
translate(p6) sphere(r);
}
hull(){
translate(p6) sphere(r);
translate(p1) sphere(r);
}

// trefoil as minimal cubic lattice knot
// http://www.knotplot.com/EquiLat/CubicLatticeKnots.html
// http://bit-player.org/wp-content/extras/bph-publications/AmSci-1997-11-Hayes-square-knots/compsci9711.html
s = 11;
r=2.5;
p1=[s*0, s*0, s*2];
p2=[s*0, s*2, s*2];
p3=[s*2, s*2, s*2];
p4=[s*2, s*1, s*2];
p5=[s*3, s*1, s*2];
p6=[s*3, s*1, s*0];
p7=[s*1, s*1, s*0];
p8=[s*1, s*1, s*3];
p9=[s*2, s*1, s*3];
p10=[s*2, s*2, s*3];
p11=[s*3, s*2, s*3];
p12=[s*3, s*2, s*1];
p13=[s*2, s*2, s*1];
p14=[s*2, s*0, s*1];
p15=[s*1, s*0, s*1];
p16=[s*1, s*0, s*2];
p17=[s*0, s*0, s*2];
translate([-1.5*s,-1.5*s,-1.5*s])
union(){
hull(){
translate(p1) sphere(r);
translate(p2) sphere(r);
}
hull(){
translate(p2) sphere(r);
translate(p3) sphere(r);
}
hull(){
translate(p3) sphere(r);
translate(p4) sphere(r);
}
hull(){
translate(p4) sphere(r);
translate(p5) sphere(r);
}
hull(){
translate(p5) sphere(r);
translate(p6) sphere(r);
}
hull(){
translate(p6) sphere(r);
translate(p7) sphere(r);
}
hull(){
translate(p7) sphere(r);
translate(p8) sphere(r);
}
hull(){
translate(p8) sphere(r);
translate(p9) sphere(r);
}
hull(){
translate(p9) sphere(r);
translate(p10) sphere(r);
}
hull(){
translate(p10) sphere(r);
translate(p11) sphere(r);
}
hull(){
translate(p11) sphere(r);
translate(p12) sphere(r);
}
hull(){
translate(p12) sphere(r);
translate(p13) sphere(r);
}
hull(){
translate(p13) sphere(r);
translate(p14) sphere(r);
}
hull(){
translate(p14) sphere(r);
translate(p15) sphere(r);
}
hull(){
translate(p15) sphere(r);
translate(p16) sphere(r);
}
hull(){
translate(p16) sphere(r);
translate(p17) sphere(r);
}
hull(){
translate(p17) sphere(r);
translate(p1) sphere(r);
}
}

Saturday, January 25, 2014

Day 152 - Petal and tight trefoil knots

Two more trefoil conformations - as a petal knot (all crossings line up along one center stem) and a tight knot (with the smallest amount of rope length possible given its diameter):


STL file for petal: http://www.geekhaus.com/makerhome/day152_trefoil_petal_40_25_3.stl
STL file for tight: http://www.geekhaus.com/makerhome/day152_trefoil_minimumrope_25.stl
Thingiverse link: http://www.thingiverse.com/thing:234107

Settings: MakerWare .3mm/low in 20-25 minutes for the petal knot and even less for the tight knot, with the minimum-support custom slicing profile for knots described on Day 110.

Technical notes, math flavor: The beautiful petal knot conformation is from the paper Bounds on Übercrossing and Petal Numbers for Knots by Colin Adams at Williams College and his amazing team of student researchers. In this work Adams, et al made the startling decision to study "petal" projections of knots where the crossings occur all on top of each other in one place! This is a wild and crazy idea compared to the usual notion that we should look at knot projections where crossings happen nicely and one at a time. But this crazy idea bore some amazing fruit: they proved that every knot admits a petal projection, and went on to discover deep connections between the übercrossing number of knots and other traditional invariants such as crossing and unknotting numbers. I know I'm not supposed to have favorites, but of the eight trefoil knots I am printing in this collection, this is by far my favorite. It's beautiful and surprising each time you turn the knot over and the perspective shifts from one-crossing-at-a-time to all-crossings-lined-up-at-once. Wonderful! See the OpenSCAD code below if you want a (piecewise) parametrization of this knot.

Minimum-length rope knot conformations of the tiny trefoil aren't the most impressive, but for higher-crossing knots they are fascinating, and what started my journey with 3D printing last year. Jason Cantarella at the University of Georgia and Eric Rawdon at the University of St. Thomas, together with some students, have been investigating "tight" knots since their paper Knot Tightening by Constrained Gradient Descent in which they used their ridgerunner algorithm to find minimal conformations of a large number of knots. The data they made available with this paper was what helped me model my first 3D-printable knot models (for example, see Day 9Day 11Day 66, and Day 67).

Technical notes, OpenSCAD flavor:  By the time of this posting, kitwallace and the GitHub OpenSCAD community had improved this code significantly; see kitwallace's excellent post at his blog The Wallace Line. However the new code requires the new 2014.01.04 snapshot of OpenSCAD, which does not want to work on my machine at the moment. Therefore I will post the old, slow code. It works but it ain't fast. In fact, it ain't pretty either, since getting Adams' petal knot parametrization to work in OpenSCAD required creating a very clunky piecewise function, as you will see in the code below. And it just gets worse for the tight knot; I have a very inefficient piece of code that takes 50 coordinates from Cantarella's data and connects the dots with hulled pairs of spheres. I am sure a nice loop would have made quicker work of the problem, but at the time my clunky mess of code was easier to write.  I've put that code under the fold so you have to click through to see my code of shame.

// mathgrrl parametric knots
// tubify module based on tube module from kitwallace
// choose the knot you want and comment out the rest

// trefoil as petal knot
// http://arxiv.org/pdf/1311.0526v1.pdf
// based on mma algorithm from Adams, need to do z-coord in cases
// scaled to 40mm before tubifying
tempstep = .005; //.005/1 is 2/360
function g(t,a,b,u,v) = 
[ 3.5*5*cos(180*t)*sin(5*180*t), 
 3.5*5*sin(180*t)*sin(5*180*t),
 8*u*(cos(180*(((5*t-a+1)%5)-1)/2))*(cos(180*(((5*t-a+1)%5)-1)/2)) 
+ 8*v*(cos(180*(((5*t-b+1)%5)-1)/2))*(cos(180*(((5*t-b+1)%5)-1)/2)) 
];
translate([0,0,-24])
union(){
color("red")
for (t=[1: tempstep: 1.2-tempstep]) { //replacement for 0 to .2
hull() {
translate(g(t,5,1,4,1)) sphere(2.5); 
translate(g(t+tempstep,5,1,4,1)) sphere(2.5);
      }
  }
color("orange")
for (t=[.2: tempstep: .4]) { //also why here?
hull() {
translate(g(t,1,2,1,3)) sphere(2.5);
translate(g(t+tempstep,1,2,1,3)) sphere(2.5);
      }
  }
color("yellow")
for (t=[.4: tempstep: .6]) {
hull() {
translate(g(t,2,3,3,5)) sphere(2.5);
translate(g(t+tempstep,2,3,3,5)) sphere(2.5);
      }
  }
color("green")
for (t=[.6: tempstep: .8]) {
hull() {
translate(g(t,3,4,5,2)) sphere(2.5);
translate(g(t+tempstep,3,4,5,2)) sphere(2.5);
      }
  }
color("blue")
for (t=[.8: tempstep: 1]) {
hull() {
translate(g(t,4,5,2,4)) sphere(2.5);
translate(g(t+tempstep,4,5,2,4)) sphere(2.5);
      }
  }
}