gearbox

<script src="./point_src/gearbox"></script>

Meta Data
filepath_exists True
path gearbox
filepath gearbox.js
clean_files ()

  • ClassDeclaration
    class comments:
    For xy bound wheels
    • constructor

      constructor

      (
      points
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      For xy bound wheels
    • method

      performDraw

      (
      ctx
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      bindPinionWheels

      (
      large , pinion
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      pinion.parentWheel = large
    • method

      ensureDoubleBound

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Iterate the bindmap, ensuring the XY of a pair match -
    • method

      performStep

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      previous break-early
    • method

      pushVelocities

      (
      ps
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Iterate all the points, applying the angular velocity given in the compute steps.
    • method

      recursiveSpinTouchMap

      (
      tick , touchMap , ps , maxCount = 5 , currentCount
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      nothing to do.
    • method

      spinChildren

      (
      touchMap , allGears , hitTick
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      An entry in the touch map: origin: [touchPoint, ...] the touch points is not rotated yet, and should receive the rotation of the origin. Returned is a new touchmap, where each touchPoint is the origin and the touches are next gears - devoid of the origin.
    • method

      spinGears

      (
      allGears
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Filter touching. store as descendant. Loop each descendant store descendant. If already visited - raise error
    • method

      getTouching

      (
      motors , allGears
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      For each item, we store its _next_ items.
    • method

      getSingleTouching

      (
      target , allGears , exceptPoint = undefined
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      return a list of all touching points for this target, except the exceptPoint
    • method

      appendMap

      (
      map , key , pointList
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      wheelWheel

      (
      parentOriginPoint , boundReceiverPoint
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      The parentOriginPoint was rotated by the origin, the bound point should receive its rotation being an inner wheel of the parentOriginPoint
    • method

      doubleTouchCV

      (
      originPoint , touchPoint
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Angular velocity it given by a previous, and now this.
    • method

      isMotor

      (
      point
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      drawView

      (
      ctx
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Draw a circle at the origin points
    • method

      addGear

      (
      p , angularVelocity = 1
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      addPairGear

      (
      primary , pinion
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      A pair gear applies a primary wheel and a pinion wheen - bound together at the center. When one of the gears rotates, the other will also rotate at the same speed.
    • method

      gearWheel

      (
      originPoint , receiverPoint
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      A Gear defines a point edge meeting another point edge. Calculate and apply the angularVelocity using the origin and receiver radius. Note the originPoint.angularVelocity must exist.
    • method

      internalWheel

      (
      originPoint , receiverPoint
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      A Gear defines a point edge meeting another point edge. Calculate and apply the angularVelocity using the origin and receiver radius. Note the originPoint.angularVelocity must exist.
    • method

      calculateReceiverVelocity

      (
      originPoint , receiverPoint
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      ratchetAllowed

      (
      parentOriginPoint , boundReceiverPoint
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Ratcheting ensures the boundReceiverPoint can (and is) being spun in the ratchet direction `-1, 0, 1,` left, both, right respectively. If pass, return True: + If ratcheting == undefined, assume 0 + if 0; both directions + if -1 ratchet and angularVelocity < 0; ratchet left + if 1 ratchet and angularVelocity > 0; ratchet right
    • method

      createGear

      (
      options
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      createReductionGear

      (
      options
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      createInternalGear

      (
      options
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      createMotor

      (
      options
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])