Class KochSnowflakeBuilder
- java.lang.Object
-
- org.locationtech.jts.shape.GeometricShapeBuilder
-
- org.locationtech.jts.shape.fractal.KochSnowflakeBuilder
-
public class KochSnowflakeBuilder extends GeometricShapeBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private CoordinateList
coordList
private static double
HEIGHT_FACTOR
The height of an equilateral triangle of side oneprivate static double
ONE_THIRD
private static double
THIRD_HEIGHT
private static double
TWO_THIRDS
-
Fields inherited from class org.locationtech.jts.shape.GeometricShapeBuilder
extent, geomFactory, numPts
-
-
Constructor Summary
Constructors Constructor Description KochSnowflakeBuilder(GeometryFactory geomFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addSegment(Coordinate p0, Coordinate p1)
void
addSide(int level, Coordinate p0, Coordinate p1)
private Coordinate[]
getBoundary(int level, Coordinate origin, double width)
Geometry
getGeometry()
static int
recursionLevelForSize(int numPts)
-
Methods inherited from class org.locationtech.jts.shape.GeometricShapeBuilder
createCoord, getCentre, getDiameter, getExtent, getRadius, getSquareBaseLine, getSquareExtent, setExtent, setNumPoints
-
-
-
-
Field Detail
-
coordList
private CoordinateList coordList
-
HEIGHT_FACTOR
private static final double HEIGHT_FACTOR
The height of an equilateral triangle of side one
-
ONE_THIRD
private static final double ONE_THIRD
- See Also:
- Constant Field Values
-
THIRD_HEIGHT
private static final double THIRD_HEIGHT
-
TWO_THIRDS
private static final double TWO_THIRDS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
KochSnowflakeBuilder
public KochSnowflakeBuilder(GeometryFactory geomFactory)
-
-
Method Detail
-
recursionLevelForSize
public static int recursionLevelForSize(int numPts)
-
getGeometry
public Geometry getGeometry()
- Specified by:
getGeometry
in classGeometricShapeBuilder
-
getBoundary
private Coordinate[] getBoundary(int level, Coordinate origin, double width)
-
addSide
public void addSide(int level, Coordinate p0, Coordinate p1)
-
addSegment
private void addSegment(Coordinate p0, Coordinate p1)
-
-