Strandmite

     

A small model based on Theo Jansen's majestic Strandbeests. Printed on a RepRap it can just walk when pushed over a carpet.

Source

Animation
OpenSCAD has simple but effective animation support. When you select `View->Animate` you can specify `FPS` and `Steps` to describe how fast you want the animation and how long you want the animation. Here setting both to 30 gave us a smooth animation that looped every second. This then sets a special `$t` variable to a fraction between 0 and 1. You then use that variable to calculate the appropriate position for your module at that point in the animation.

Maths
The key element to ensure it can walk are the relative lengths of the struts and triangles. These were selected my evolutionary algorithm which tested the fitness of the arc described by the end of the leg as the central cam rotated.

To position the shapes in the model I used Trigonometry, Law of cosines and Pythagoras' rule; who said GCSE Maths was pointless!

Construction
The final design is nearly 2d. Everything except the cranks could be cut on a laser cutter; and in fact the cranks could be cut then sanded to shape. The material has to have low friction and good rigidity (though the material thickness only effects the length of the handle so would be easy to adjust). In the end I decided to stick to the 3D PLA prints I used during prototyping. These proved sufficiently ridged and very low friction.

I was also very excited to rediscover the technique of riveting the bearings with a short section of unprinted 3mm filament and a soldering iron set to 180°C. This proved quick and easy and created a very strong joint and low-friction bearing.

You can see that although the final output needed to be 'Airfix' style sheets for easy printing. Modelling and animating them in their final positions made the design phase much easier.

Code
A perennial bugbear of mine are the rounding errors in OpenSCAD's preview rendering. A common approach is to simply oversize all 'subtracted' shapes, but this can make their intent harder to see, so I like to include a dedicated 'easing' function to keep all the other numbers nice and clear:

module e { if(preview==1) { translate([      0,       0,       -.1     ]) { scale([        1,         1,         1.1       ]) { child; }    }   } else { child; } }