Exit Full View
Up

/Games/Spiro.foocad

Spiro

A gears have teeth which mesh together arranged around a circle. However, I want to add teeth around ANY shape. So lets consider perfectly meshing teeth along a STRAIGHT LINE.

┌───────────────────┐ |_ PART A __│ \ /\ /\ /\ / / / / /

    /\  /\  /\
___/  \/  \/  \_____

| PART B | └────────────────────┘

We can then warp the geometry so that these teeth are around a circle, rounded rectangles, ellipses...

So our primative tooth profile (shown as a triangle in the diagram above) is for teeth along a straight line. FYI, A circular gear running along a straigh is called a Rack and Pinion.

Our basic tooth profile is that of the rack, and the warping it around a circle will form the pinion.

Triangles aren't a good tooth shape though.

Firstly, the sharp corners don't play well with 3D prints. So we should at the very least round the corner.

Secondly, as the gears rotate we want the force to be constant, and the motion to be smooth. What we need is an Involute Gear.

A rounded triangle would give very variable force. At the rounded part of the travel there would be nearly zero force

FooCAD Source Code
import uk.co.nickthecoder.foocad.gears.v1.*

class Spiro : Model {

    @Custom
    var config = GearConfig.lego()//(1, 20, 0.05)

    override fun build() : Shape3d {
        val thickness = 1

        val involute8 = config.teeth( 8 )
        val spurGear = involute8.spurProfile().extrude(thickness)

        val spurGear2 = spurGear
            .rotateZ( 180 / involute8.toothCount ) 
            .translateX( involute8.pitchDiameter() )

        val involute20 = config.teeth( 20 )

        val planetGear = involute20.planetProfile(2)
            .extrude(thickness)
            .translateX( -6 )
            .color("Green")

        return spurGear + planetGear
            
    }

}