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 CoordinateListcoordListprivate static doubleHEIGHT_FACTORThe height of an equilateral triangle of side oneprivate static doubleONE_THIRDprivate static doubleTHIRD_HEIGHTprivate static doubleTWO_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 voidaddSegment(Coordinate p0, Coordinate p1)voidaddSide(int level, Coordinate p0, Coordinate p1)private Coordinate[]getBoundary(int level, Coordinate origin, double width)GeometrygetGeometry()static intrecursionLevelForSize(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:
getGeometryin 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)
-
-