pointlistshape

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

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

  • ClassDeclaration
    class comments:

    Shape an existing Array, editing points in place.

    • constructor

      constructor

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

      length

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

      linear

      (
      spread , keys = [] , altValue = undefined , altKeys = []
      )
      from PointListShape
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])

      order the items in a flat linear list. Spread across the key axis. If the altValue is undefined, the other position key is not changed.

      // Spread across X by 20 per step. Y becomes 100 for each.
      pointList.shape.linear(20, 'x', 100)
      
      // diagonal, the altValue is not useful here:
      plRandom.shape.linear(20, ['x', 'y'])
      
    • method

      random

      (
      multiplier = 100
      )
      from PointListShape
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])

      move all points to a random position within a space.

    • method

      grid

      (
      spread , rowCount = 10 , pos
      )
      from PointListShape
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])

      Distribute across a plane, similar to linear, but with a reset stepper.

      spread of 50, with 5 per row, drawing from position[0]: plRandom.shape.grid(50, 5);

      Set the position then draw:

      plRandom[0].set(50,50)
      plRandom.shape.grid(50, 6);
      

      Spread of 30, with 6 items per row, at a position:

      plRandom.shape.grid(30, 6, point(100,100));
      
    • method

      radial

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

      "Radial" plots the points around the a given point. Unlike "circle" or "radius" of which draw from an origin,

      This method rotates around the origin.

      if the given point is undefined, the center of the point list is used. If radius is undefined, the point radius is used.

    • method

      radius

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

      Return a list of points distrubuted evenly around a circle.

      If the position is not given, the fist point in the array is used. Notably this may cause the circle to march for every render.

      plRandom.shape.radius(50);
      plRandom.shape.radius(50); // moves to the _new_ x
      plRandom.shape.radius(50); // moves to the _new_ x
      

      Apply a position to pin the circle at a location:

      plRandom.shape.radius(50, point(100,100));
      plRandom.shape.radius(50, point(100,100)); // does not march
      
      // follow mouse
      plRandom.shape.radius(50, Point.mouse.position);
      
    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])