Utility methods for making toothed gears, and setting forces on them.

TO DO* add a DisplayObject for the turning force which is a big obvious arrow

Methods

  • Adds a gear shape set of edges to the given Polygon. The shape of a tooth is determined as follows. A tooth has 4 edges, which we call: up-slope, out-edge, down-slope, and in-edge.

        ___
       /   \
      /     \___
    

    Let the horizontal span be 100%, then each of the 4 tooth edges has a percentage. For example in the above diagram, the percentages are roughly 25% each. The percentages for the out-edge and in-edge are supplied as parameters. The remainder is split evenly between the up-slope and down-slope.

    Parameters

    • p: Polygon

      the Polygon to add the gear to

    • r1: number

      the inside radius of the gear

    • depth: number

      the depth (or length) of the teeth

    • numTeeth: number

      number of teeth

    • outPercent: number

      the percentage of tooth that is extended (the out-edge)

    • inPercent: number

      the percentage of tooth that is not extended (the in-edge)

    • startEdges: Edge[]

      adds to this array the starting edge of the gear

    Returns void

  • Parameters

    • radius: number
    • startEdges: Edge[]

      adds to this array the starting edge of the gear

    • Optional opt_name: string

      name of the Polygon

    • Optional opt_localName: string

      localized name of the Polygon

    Returns Polygon

Generated using TypeDoc