curve-extras

<script src="./point_src/curve-extras"></script>

Meta Data
filepath_exists True
path curve-extras
filepath curve-extras.js
clean_files ()

  • VariableDeclaration
    const

    saveRestoreDraw

    =
    function ( ctx , position , callback )
    moved to functions/context.js
    + `save()` the context + translate and rotate to `position`` + run the function + Restore.
  • ClassDeclaration
    class comments:
    new Line([90, 130], [200, 300], 420)
    • property

      doTips

      = true
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      doBeginPath

      = true
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      doClosePath

      = true
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • constructor

      constructor

      (
      p1 , p2 , color = red , width = 1
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      new Line([90, 130], [200, 300], 420)
    • get

      [[computed_Literal]]

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

      [[computed_Literal]]

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

      last

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

      first

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

      length

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

      points

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

      create

      (
      p1 , p2 , color = red , width = 1
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      render

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

      start

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

      draw

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

      performDrawTips

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

      performTipA

      (
      ctx , result
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Apply a tip at point A, (the first position). The Tip is a point, with some styling with an ngon.
    • method

      writeLineTip

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

      drawPolyTipA

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Rotate this _end point_ to look directly at, then perform a 180, allowing Polypoint to offset the calculation
    • method

      _ctx_fill

      (
      ctx
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Make a fancy Fill thing.
    • method

      drawLineTipA

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

      performTipB

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

      drawPolyTipB

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      || this.b)
    • method

      drawLineTipB

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Look at the target point.
    • method

      writeLine

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

      perform

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

      close

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

    :

    dict_keys(['type', 'expression', 'pos'])
  • ClassDeclaration
    class comments:
    create(p1, p2, color='red', width=1) {
    • property

      useCache

      = false
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • method

      getControlPoints

      (
      useCache
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      let midDistance = a.distanceTo(b)*.5
    • get

      points

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

      drawLineTipA

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      let target = this.b.copy()
    • method

      drawPolyTipA

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Rotate this _end point_ to look directly at, then perform a 180, allowing Polypoint to offset the calculation
    • method

      drawLineTipB

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      let tail = s.copy()
    • method

      drawPolyTipB

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      it's likely the original point, therefore we ensure it's new.
    • method

      perform

      (
      ctx
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/bezierCurveTo
    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • ClassDeclaration
    class comments:
    A Quad line control point is A.project()
    • property

      useCache

      = false
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • method

      getControlPoints

      (
      useCache
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      let midDistance = a.distanceTo(b)*.5
    • get

      points

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

      perform

      (
      ctx
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      https://developer.mozilla.org/
    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])
  • ClassDeclaration
    class comments:
    When sine bouncing, reduce over time to stop the motion. 0 would turn of motion, 1 would bounce forever very quickly.
    • property

      doTips

      = true
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      sine

      = 1
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      bounceRate

      = .1
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      _oneReducer

      = 1
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      stable

      = false
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      reductionRate

      = .999
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      swingDegrees

      = 20
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      elasticity

      = .09
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • method

      create

      (
      a , b , length = undefined , color = red , width = 1
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Length elasticity when oscillating
    • get

      points

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

      length

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

      restart

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

      restLength

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

      stretchMultiplier

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

      getCurveLength

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

      getControlPoints

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

      getCachedCurve

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

      draw

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

      perform

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

      performTipB

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

      drawLineTipB

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      First we grab the cached _curve_ of this line instance.
    • method

      writeLineTipB

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

      drawTipA

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

      drawPolyTipA

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      First we grab the cached _curve_ of this line instance.
    • method

      drawLineTipA

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      First we grab the cached _curve_ of this line instance.
    • method

      drawTipB

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      return this.drawPolyTipB(ctx, result, position)
    • method

      drawPolyTipB

      (
      ctx , result , position
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      || this.b)
    • method

      writeLineTip

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

      writePolyTipB

      (
      ctx
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Make a fancy Fill thing.
    • method

      update

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

      updateSwing

      (
      ctx , tick
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      How much _left and right_ can the line swing.
    • method

      clear

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