Package micycle.pgs.commons
Class RandomSpaceFillingCurve
java.lang.Object
micycle.pgs.commons.RandomSpaceFillingCurve
Generates random space-filling curves.
A space-filling curve is a continuous curve that traverses every point of an plane exactly once.
This class implements the technique described in "Context-based space filling curves" by Dafner et al, and is based on this javascript implementation by Claudio Esperança.
- Author:
- Michael Carleton
-
Constructor Summary
ConstructorsConstructorDescriptionRandomSpaceFillingCurve
(int ncols, int nrows) Instantiates a random space-filling curve.RandomSpaceFillingCurve
(int ncols, int nrows, long seed) Instantiates a random space-filling curve, having a given random seed. -
Method Summary
Modifier and TypeMethodDescriptionprocessing.core.PShape
getCurve
(float cellWidth, float cellHeight) processing.core.PShape
getSkeleton
(float cellWidth, float cellHeight)
-
Constructor Details
-
RandomSpaceFillingCurve
public RandomSpaceFillingCurve(int ncols, int nrows) Instantiates a random space-filling curve. The curve is created upon initialisation.- Parameters:
ncols
- number of cells in the x direction (columns)nrows
- number of cells in the y direction (rows)
-
RandomSpaceFillingCurve
public RandomSpaceFillingCurve(int ncols, int nrows, long seed) Instantiates a random space-filling curve, having a given random seed. The curve is created upon initialisation.- Parameters:
ncols
- number of cells in the x direction (columns)nrows
- number of cells in the y direction (rows)seed
-
-
-
Method Details
-
getCurve
public processing.core.PShape getCurve(float cellWidth, float cellHeight) -
getSkeleton
public processing.core.PShape getSkeleton(float cellWidth, float cellHeight)
-