Point Pen

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

The pen provides a range of methods for visibly rendering the point.

Similar to how the draw tools plot or sketch, the pen renders the sketches. This allows you to draw many things and then pen the drawing.

The available functions generally match the draw tools and in many cases use the sibling function from the draw tools:

let p = new Point(100, 200)

p.pen.fill('red') // Calls p.draw.arc() then ctx.fill()

When imported, the PointPen auto-loads into the Point.pen.

Polypoint.head.lazyProp('Point', {
    pen() { return new PointPen(this) }
}, 'pen')

let p = new Point;
p.pen // new instance of PointPen
Meta Data
title Point Pen
dependencies ()
unused_keys ()
unknown_keys ()
filepath_exists True
path pointpen
filepath pointpen.js
clean_files ()

  • ClassDeclaration
    class comments:

    title: Point Pen

    The pen provides a range of methods for visibly rendering the point.

    Similar to how the draw tools plot or sketch, the pen renders the sketches. This allows you to draw many things and then pen the drawing.

    The available functions generally match the draw tools and in many cases use the sibling function from the draw tools:

    let p = new Point(100, 200)
    
    p.pen.fill('red') // Calls p.draw.arc() then ctx.fill()
    

    When imported, the PointPen auto-loads into the Point.pen.

    Polypoint.head.lazyProp('Point', {
        pen() { return new PointPen(this) }
    }, 'pen')
    
    let p = new Point;
    p.pen // new instance of PointPen
    

    Draw functions for the Point.draw

    • constructor

      constructor

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

      methods.

    • method

      _quickStroke

      (
      ctx , f , color , width = 1 , open = True , close
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      if(width != undefined && ctx.lineWidth == undefined) {

    • method

      ngon

      (
      ctx , sides , radius , fromCenter = True , color , width = 1 , angle , open = True , close = True
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      circleGon

      (
      ctx , radius , lod = 0.3 , fromCenter = True , color , width = 1 , open = True , close = True
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      line

      (
      ctx , otherPoint , color , width
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      let data = unpack(arguments, {

    • method

      arc

      (
      ctx , otherPoint , color , distance , width , direction = 1
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      draw.arc(ctx, radius=undefined, start=0, end=Math.PI2, direction=1)

    • method

      ellipse

      (
      ctx , other , color , radRotation , strokeWidth = 1
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      this.point.draw.arc(ctx, distance, start, end, direction)

    • method

      stroke

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

      circle

      (
      ctx , radius_or_conf = undefined , color , width
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      An arc, but complete with begin path and stoking

    • method

      fill

      (
      ctx , fillStyle = undefined , radius = undefined
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      ctx.lineWidth = width == undefined? 1: width

    • method

      box

      (
      ctx , size , color , width , angle
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
              A box is a rectangle on the outside of radius.
              If an angle is given, the box cannot be a _rect_ and returns an ngon(4).
      
    • method

      rect

      (
      ctx , width , height , color , strokeWidth , offset = {x: 0, y: 0}
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      this.point.draw.pen(ctx, width, height)

    • method

      roundRect

      (
      ctx , width , height , color , strokeWidth , offset = {x: 0, y: 0} , radii = []
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      roundRect(x, y, width, height, radii)

    • method

      indicator

      (
      ctx , miniConf = {}
      )
      from PointPen
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
          Synonymous to:
      
              weightedComPoint.project().pen.line(ctx, weightedComPoint, 'red', 2)
              weightedComPoint.pen.circle(ctx, undefined, 'yellow', 1)
      
    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])