loading

Step 4: Non-Problem 4: Writing the software

Finally, a step I've actually got the skills for.

I work on real-time 3D software a lot, which means I'm used to making things which don't work at first, and then after I've debugged them, still don't work. I'm used to staring at a screen full of text with a single punctuation mark out of place, stopping everything, and unable to spot it, at 3am.

What I needed here was a program which would build and position all of the gears for me automatically, based on the number of teeth and other info I provided. Also, it needs to take in birthdates of the two people, and build the gears specifically to point the needles in the right direction for them. All of that ends up taking a while.

I wrote the software in C++, using a framework called Qt to save time on the standard "buttons and windows" part. (Incidentally, since HotSharpToxic's lipstick thing was going on at the same time, I decided to make one program that does both, to save time.)

For this software to work, I needed a format to store a description of a gear machine.
That way I can change the specification to mess with the machine, instead of the C++ code.
The text-file format I chose is wonky and ugly, but very quickly did the job.

The complete parametric specification for the gears in the machine is here:
(Even if you're not a software engineer, you can probably pick out some parts.
The key is the group of words right after the "expr" section.)


//______________________________________________________________________
// GearMachine.tsu  -  Bio gear machine, version 49b
//
expr, thickness, 0.3
expr, extraThick, (1.0 * thickness)
expr, stackOffset, (1.25 * thickness)
expr, toothSize, 0.30
expr, axleDiameter, 0.5

// Gear id, numTeeth, toothSize, thickness, axleDiameter, addAxle, u1, u2, v1, v2

image, gears/plainGear1.png

expr, baseDrop, -0.5
expr, timeAngle, 0.0
expr, emoAngle, 220.0
expr, emoArch1Angle, (emoAngle - 60.0)
expr, emoArch2Angle, (emoAngle + 60.0)

// real gears are below
//    name          teeth  toothSize  thickness  axleDiameter  verticalOff   parent         connect angle   tilt backWidth backOffset stackOffCenter fixArrowLen fixArrowAngle fixArrowOffset  topAxleExtend  bottomAxleExtend
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gear, rootGear89,      89, toothSize, extraThick,axleDiameter, 0.0,          none,            stack,  0.0,   0.0,    1.00,    -1.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0
gear, rootGear79,      79, toothSize, extraThick,axleDiameter, stackOffset,   rootGear89,      stack,  0.0,   0.0,    0.00,     0.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0

gear, 3monthStandoff,  18, toothSize, thickness, axleDiameter, 0.0,          rootGear79,      link,   timeAngle,  0.0,    1.0,      -1.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0
gear, 3monthStandoff2,  18, toothSize, thickness, axleDiameter, 4.5,          3monthStandoff,   stack,   0.0,  0.0,    0.00,      0.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0
gear, 3months55,         55, toothSize, thickness, axleDiameter, 0.0,          3monthStandoff2,  link,   180.0,  0.0,    0.00,    -1.0,      0.0,         10.0,           0.0,          0.3,           0.3,           0.0
//gear, 3months55,       55, toothSize, thickness, axleDiameter, 0.0,          rootGear79,      link,   0.0, 110.0,    0.00,    -1.0,      0.0,         10.0,           0.0,          0.3,           0.3,           0.0
gear, 3months10,       10, toothSize, thickness, axleDiameter, (-1.0*stackOffset),  3months55,       stack,  0.0,   0.0,    2.50,    -1.0,      0.0,           0.0,           0.0,          0.0,           0.0,           0.0
gear, monthsToYears30, 30, toothSize, thickness, axleDiameter, 0.0,          3months10,       link, -130.0,   0.0,    0.00,     0.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0
gear, monthsToYears10, 10, toothSize, thickness, axleDiameter, (-1.5*stackOffset),  monthsToYears30, stack,  0.0,   0.0,    2.50,    -1.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0
gear, 3years40,        40, toothSize, thickness, axleDiameter, 0.0,          monthsToYears10, link,  90.0,   0.0,    0.00,     0.0,      0.0,          7.0,                   0.0,       0.3,           0.3,           0.0

gear, 3years10,        10, toothSize, thickness, axleDiameter, (-3.0*stackOffset),  3years40,        stack,  0.0,   0.0,    2.50,    -1.0,      0.0,          0.0,           0.0,           0.0,            0.0,           0.0
gear, yearsToCentury60, 60, toothSize, thickness, axleDiameter, 0.0,          3years10,         link,  123.0,   0.0,    0.00,     0.0,      0.0,          0.0,           0.0,           0.0,            0.0,           0.0
gear, yearsToCentury10,  10, toothSize, thickness, axleDiameter, (-2.0*stackOffset),  yearsToCentury60,stack,  0.0,   0.0,    2.50,    -1.0,      0.0,          0.0,           0.0,           0.0,            0.0,           0.0
gear, century60,         60, toothSize, thickness, axleDiameter, 0.0,          yearsToCentury10, link,  180.0,   0.0,    1.00,     -1.0,      0.0,          0.0,           0.0,           0.0,            0.0,           0.0

gear, emoStandoff,     10, toothSize, thickness, axleDiameter, 0.0,          rootGear89,      link, emoAngle,  68.0,    1.00,   -1.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0
gear, emotional19,     19, toothSize, thickness, axleDiameter, 0.0,          emoStandoff,      link,  0.0,  68.0,    1.50,     1.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0
//gear, emotional19,     19, toothSize, thickness, axleDiameter, 0.0,          rootGear89,      link, 120.0, 120.0,    1.50,     1.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0
gear, emotional28,     28, toothSize, thickness, axleDiameter, -stackOffset, emotional19,     stack,  0.0,   0.0,    0.00,     0.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0
gear, physical23,      23, toothSize, thickness, axleDiameter, 0.0,          emotional28,     link, -90.0,   0.0,    1.50,     1.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0
gear, intellectual33,  33, toothSize, thickness, axleDiameter, 0.0,          emotional28,     link,  90.0,   0.0,    1.50,     1.0,      0.0,           0.0,           0.0,           0.0,           0.0,           0.0
gear, [emotionalArrow],     10, toothSize, thickness, axleDiameter, -0.21, emotional28,         link,   0.0,   0.0,    1.50,     -0.1,      0.0,           0.0,           0.0,           0.0,           0.0,           0.6
gear, [physicalArrow],     10, toothSize, thickness, axleDiameter, 0.0, physical23,           link,  90.0,   0.0,    1.50,     -0.1,      0.0,           0.0,           0.0,           0.0,           0.0,           0.6
gear, [intellectualArrow],     10, toothSize, thickness, axleDiameter, 0.0, intellectual33,   link, -90.0,   0.0,    1.50,     -0.1,      0.0,           0.0,           0.0,           0.0,           0.0,           0.6
_________________________________________________________________________________

that is extremely complex, but it has gears! which is awesome! i could probably watch that spin for five hours without any problems. and i noticed the vertices that supported the gears,exceptionally well done! bravo! you should seriously think about getting it made out of brass, it'd probably cost an arm and a leg but they technically do have 3-d printers that spray glue onto brass sand, then they stick it in an oven and it becomes solid. you'd be like the king of steam punk! <br> <br>and after laying it on that thick i suppose you should definitely ask Ms.HotSharpToxic out to a big fancy restaurant for dinner. wait she's an engineer, find the closest machine shop and build a trebuchet or something, engineers dig that stuff!
Trebuchet... now why didn't I think of that? Genius! She'll love it for sure. Now if only there was a website where you could learn to make things... oh right, there is! :] <br> <br>http://www.instructables.com/tag/type-id/category-play/channel-siege-engines/keyword-trebuchet/ <br> <br>On it.
Beautiful! I liked the rethinking about its shape. 3D printing has changed our way of thinking!! I agree about the steampunk goal... how to adapt this and help it grow into a full fledged Victorian artifact? Great job. Thanks for sharing.
Congratulations !&acirc;€&brvbar; <br>I can say only one thing, and I'll say it loud and clear for everyone to hear : <br> <br> LEONARDO DA VINCI !!!.... <br> <br> <br> <br> <br>
Awesome use of gears! Seriously though, axle rose? really? I laughed more than I should have at that.
Oh yeah, um, sorry about that one. Really couldn't be avoided. I tried. ;]<br> <br> I neglected to post the parts list for DIY'ers, but in case you want gears, I made the full 3D model a free download at these links on both&nbsp;<a href="http://www.ponoko.com/showroom/MachineLevel" rel="nofollow">Ponoko</a> and <a href="http://www.shapeways.com/model/384377/prefinal4c.html" rel="nofollow">Shapeways</a>.

About This Instructable

12,442 views

120 favorites

License:

More by LabRat: Batkid Tech #3: Wrist-Projector Communicator Batkid Tech #1: Riddler's Device Custom Mechanical Biorhythm Computer, 3D printed
Add instructable to: