Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Create

The Create class provides various convenient functions to create structures or shapes.

Hierarchy

  • Create

Index

Methods

Static delaunay

  • Create a Delaunay Group. Use the .delaunay() and .voronoi() functions in the returned group to generate tessellations.

    Parameters

    Returns Delaunay

    an instance of the Delaunay class

Static distributeLinear

  • Create a set of points that distribute evenly on a line

    Parameters

    • line: GroupLike

      a Group representing a line

    • count: number

      number of points to create

    Returns Group

Static distributeRandom

  • distributeRandom(bound: Bound, count: number, dimensions?: number): Group
  • Create a set of random points inside a bounday

    Parameters

    • bound: Bound

      the rectangular boundary

    • count: number

      number of random points to create

    • Default value dimensions: number = 2

      number of dimensions in each point

    Returns Group

Static gridCells

  • gridCells(bound: Bound, columns: number, rows: number): Group[]
  • Create a grid inside a boundary

    Parameters

    • bound: Bound

      the rectangular boundary

    • columns: number

      number of columns

    • rows: number

      number of rows

    Returns Group[]

    an array of Groups, where each group represents a rectangular cell

Static gridPts

  • gridPts(bound: Bound, columns: number, rows: number, orientation?: PtLike): Group
  • Create an evenly distributed set of points (like a grid of points) inside a boundary.

    Parameters

    • bound: Bound

      the rectangular boundary

    • columns: number

      number of columns

    • rows: number

      number of rows

    • Default value orientation: PtLike = [0.5, 0.5]

      a Pt or number array to specify where the point should be inside a cell. Default is [0.5, 0.5] which places the point in the middle.

    Returns Group

    a Group of Pts

Static noisePts

  • noisePts(pts: GroupLike, dx?: number, dy?: number, rows?: number, columns?: number): Group
  • Given a group of Pts, return a new group of Noise Pts.

    Parameters

    • pts: GroupLike

      a Group or an array of Pts

    • Default value dx: number = 0.01

      small increment value in x dimension

    • Default value dy: number = 0.01

      small increment value in y dimension

    • Default value rows: number = 0

      Optional row count to generate 2D noise

    • Default value columns: number = 0

      Optional column count to generate 2D noise

    Returns Group

Static radialPts

  • radialPts(center: PtLike, radius: number, count: number): Group
  • Create a set of Pts around a circular path

    Parameters

    • center: PtLike

      circle center

    • radius: number

      circle radius

    • count: number

      number of Pts to create

    Returns Group

Generated using TypeDoc