Package micycle.pgs
Class PGS_Tiling
java.lang.Object
micycle.pgs.PGS_Tiling
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 TypeMethodDescriptionstatic 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.
-
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 planeheight
- height of the quad subdivision planemaxDepth
- 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 planeheight
- height of the quad subdivision planemaxDepth
- 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 planeheight
- height of the subdivision planemaxDepth
- 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 planeheight
- height of the subdivision planemaxDepth
- 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 subdividedheight
- height of the plane that is subdivideddepth
- 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 planeheight
- height of the quad subdivision planedepth
- 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 planeheight
- height of the subdivision planegridCountX
- horizontal grid countgridCountY
- vertical grid countseed
- 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 spiralcenterY
- y coordinate of the center of the spiralp
- at least 2q
- at least p + 1maxRadius
- 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 planeheight
- height of the tiling planesideLength
- side length of each hexagonflat
- 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 planeheight
- height of the tiling planew
-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 tilingcenterY
- y coordinate of the center/origin of the tilingradius
- 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 planeheight
- height of the tiling planetileSize
- 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 planeheight
- height of the tiling planetileSize
- diameter of each tileseed
- the random seed- Returns:
- a GROUP PShape, where each child shape is a tile of the tiling
- Since:
- 1.3.0
-