Package micycle.pgs

Class PGS_Tiling

java.lang.Object
micycle.pgs.PGS_Tiling

public final class PGS_Tiling extends Object
Tiling, tessellation and subdivision of the plane using periodic or non-periodic geometric shapes.

A tiling is created when a collection of tiles fills a plane such that no gaps occur between the tiles and no two tiles overlap each other.

Since:
1.2.0
Author:
Michael Carleton
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<processing.core.PVector>
    doyleSpiral(double centerX, double centerY, int p, int q, double maxRadius)
    Generates a Doyle spiral.
    static processing.core.PShape
    hatchSubdivision(double width, double height, int gridCountX, int gridCountY, long seed)
    Randomly subdivides the plane into equal-width strips having varying lengths.
    static processing.core.PShape
    hexTiling(double width, double height, double sideLength, boolean flat)
    Generates a hexagonal tiling of the plane.
    static processing.core.PShape
    islamicTiling(double width, double height, double w, double h)
    Generates an "islamic-style" (Girih) tiling of the plane.
    static processing.core.PShape
    penroseTiling(double centerX, double centerY, double radius, int steps)
    Generates a Penrose Tiling (consisting of rhombi).
    static processing.core.PShape
    quadSubdivision(double width, double height, int depth)
    Recursively and randomly subdivides the given/bounded plane into convex quad polygons.
    static processing.core.PShape
    quadSubdivision(double width, double height, int depth, long seed)
    Recursively and randomly subdivides the given/bounded plane into convex quad polygons.
    static processing.core.PShape
    rectSubdivision(double width, double height, int maxDepth)
    Recursively and randomly subdivides the given/bounded plane into rectangles.
    static processing.core.PShape
    rectSubdivision(double width, double height, int maxDepth, long seed)
    Recursively and randomly subdivides the given/bounded plane into rectangles.
    static processing.core.PShape
    squareTriangleTiling(double width, double height, double tileSize)
    Generates a non-periodic tiling, comprising squares and equilateral triangles.
    static processing.core.PShape
    squareTriangleTiling(double width, double height, double tileSize, long seed)
    Generates a non-periodic tiling, comprising squares and equilateral triangles, having a given seed.
    static processing.core.PShape
    triangleSubdivision(double width, double height, int maxDepth)
    Recursively and randomly subdivides the given/bounded plane into triangles.
    static processing.core.PShape
    triangleSubdivision(double width, double height, int maxDepth, long seed)
    Recursively and randomly subdivides the given/bounded plane into triangles.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • rectSubdivision

      public static processing.core.PShape rectSubdivision(double width, double height, int maxDepth)
      Recursively and randomly subdivides the given/bounded plane into rectangles.
      Parameters:
      width - width of the quad subdivision plane
      height - height of the quad subdivision plane
      maxDepth - maximum number of subdivisions (recursion depth)
      Returns:
      a GROUP PShape, where each child shape is a face of the subdivision
      See Also:
    • rectSubdivision

      public static processing.core.PShape rectSubdivision(double width, double height, int maxDepth, long seed)
      Recursively and randomly subdivides the given/bounded plane into rectangles.
      Parameters:
      width - width of the quad subdivision plane
      height - height of the quad subdivision plane
      maxDepth - maximum number of subdivisions (recursion depth)
      seed - the random seed
      Returns:
      a GROUP PShape, where each child shape is a face of the subdivision
      See Also:
    • triangleSubdivision

      public static processing.core.PShape triangleSubdivision(double width, double height, int maxDepth)
      Recursively and randomly subdivides the given/bounded plane into triangles.
      Parameters:
      width - width of the subdivision plane
      height - height of the subdivision plane
      maxDepth - maximum number of subdivisions (recursion depth)
      Returns:
      a GROUP PShape, where each child shape is a face of the subdivision
      See Also:
    • triangleSubdivision

      public static processing.core.PShape triangleSubdivision(double width, double height, int maxDepth, long seed)
      Recursively and randomly subdivides the given/bounded plane into triangles.
      Parameters:
      width - width of the subdivision plane
      height - height of the subdivision plane
      maxDepth - maximum number of subdivisions (recursion depth)
      seed - the random seed
      Returns:
      a GROUP PShape, where each child shape is a face of the subdivision
      See Also:
    • quadSubdivision

      public static processing.core.PShape quadSubdivision(double width, double height, int depth)
      Recursively and randomly subdivides the given/bounded plane into convex quad polygons.
      Parameters:
      width - width of the plane that is subdivided
      height - height of the plane that is subdivided
      depth - number of subdivisions (recursion depth)
      Returns:
      a GROUP PShape, where each child shape is a face of the subdivision
      See Also:
    • quadSubdivision

      public static processing.core.PShape quadSubdivision(double width, double height, int depth, long seed)
      Recursively and randomly subdivides the given/bounded plane into convex quad polygons.
      Parameters:
      width - width of the quad subdivision plane
      height - height of the quad subdivision plane
      depth - number of subdivisions (recursion depth)
      seed - the random seed
      Returns:
      a GROUP PShape, where each child shape is a face of the subdivision
      See Also:
    • hatchSubdivision

      public static processing.core.PShape hatchSubdivision(double width, double height, int gridCountX, int gridCountY, long seed)
      Randomly subdivides the plane into equal-width strips having varying lengths.
      Parameters:
      width - width of the subdivision plane
      height - height of the subdivision plane
      gridCountX - horizontal grid count
      gridCountY - vertical grid count
      seed - the random seed
      Returns:
      a GROUP PShape, where each child shape is a face of the subdivision
      Since:
      1.3.0
    • doyleSpiral

      public static List<processing.core.PVector> doyleSpiral(double centerX, double centerY, int p, int q, double maxRadius)
      Generates a Doyle spiral. A Doyle spiral fills the plane with closely packed circles, where the radius of each circle in a packing is proportional to the distance of its centre from a central point. Each circle is tangent to six others that surround it by a ring of tangent circles
      Parameters:
      centerX - x coordinate of the center of the spiral
      centerY - y coordinate of the center of the spiral
      p - at least 2
      q - at least p + 1
      maxRadius - the maximum radius of the packing arrangement (the maximum distance a circle centroid can be from the center of the arrangement)
      Returns:
      A list of PVectors, each representing one circle in the spiral: (.x, .y) represent the center point and .z represents radius.
    • hexTiling

      public static processing.core.PShape hexTiling(double width, double height, double sideLength, boolean flat)
      Generates a hexagonal tiling of the plane.
      Parameters:
      width - width of the tiling plane
      height - height of the tiling plane
      sideLength - side length of each hexagon
      flat - determines the orientation of the hexagons -- whether the top is flat, or pointy
      Returns:
      a GROUP PShape, where each child shape is a hexagon of the tiling
    • islamicTiling

      public static processing.core.PShape islamicTiling(double width, double height, double w, double h)
      Generates an "islamic-style" (Girih) tiling of the plane.
      Parameters:
      width - width of the tiling plane
      height - height of the tiling plane
      w -
      h -
      Returns:
      a GROUP PShape, where each child shape is a tile of the tiling
    • penroseTiling

      public static processing.core.PShape penroseTiling(double centerX, double centerY, double radius, int steps)
      Generates a Penrose Tiling (consisting of rhombi).
      Parameters:
      centerX - x coordinate of the center/origin of the tiling
      centerY - y coordinate of the center/origin of the tiling
      radius - maximum radius of the tiling (measured from the center)
      steps - number of tiling subdivisions
      Returns:
      a GROUP PShape, where each child shape is a face of the tiling
    • squareTriangleTiling

      public static processing.core.PShape squareTriangleTiling(double width, double height, double tileSize)
      Generates a non-periodic tiling, comprising squares and equilateral triangles.
      Parameters:
      width - width of the tiling plane
      height - height of the tiling plane
      tileSize - diameter of each tile
      Returns:
      a GROUP PShape, where each child shape is a tile of the tiling
      Since:
      1.3.0
    • squareTriangleTiling

      public static processing.core.PShape squareTriangleTiling(double width, double height, double tileSize, long seed)
      Generates a non-periodic tiling, comprising squares and equilateral triangles, having a given seed.
      Parameters:
      width - width of the tiling plane
      height - height of the tiling plane
      tileSize - diameter of each tile
      seed - the random seed
      Returns:
      a GROUP PShape, where each child shape is a tile of the tiling
      Since:
      1.3.0