Package org.locationtech.jts.geom.util
Class SineStarFactory
java.lang.Object
org.locationtech.jts.util.GeometricShapeFactory
org.locationtech.jts.geom.util.SineStarFactory
Creates geometries which are shaped like multi-armed stars
with each arm shaped like a sine wave.
These kinds of geometries are useful as a more complex
geometry for testing algorithms.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.locationtech.jts.util.GeometricShapeFactory
GeometricShapeFactory.Dimensions
-
Field Summary
FieldsFields inherited from class org.locationtech.jts.util.GeometricShapeFactory
dim, geomFact, nPts, precModel, rotationAngle
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a factory which will create sine stars using the defaultGeometryFactory
.SineStarFactory
(GeometryFactory geomFact) Creates a factory which will create sine stars using the givenGeometryFactory
. -
Method Summary
Modifier and TypeMethodDescriptionGenerates the geometry for the sine starvoid
setArmLengthRatio
(double armLengthRatio) Sets the ration of the length of each arm to the distance from the tip of the arm to the centre of the star.void
setNumArms
(int numArms) Sets the number of arms in the starMethods inherited from class org.locationtech.jts.util.GeometricShapeFactory
coord, coordTrans, createArc, createArcPolygon, createCircle, createEllipse, createRectangle, createSquircle, createSupercircle, rotate, setBase, setCentre, setEnvelope, setHeight, setNumPoints, setRotation, setSize, setWidth
-
Field Details
-
numArms
protected int numArms -
armLengthRatio
protected double armLengthRatio
-
-
Constructor Details
-
SineStarFactory
public SineStarFactory()Creates a factory which will create sine stars using the defaultGeometryFactory
. -
SineStarFactory
Creates a factory which will create sine stars using the givenGeometryFactory
.- Parameters:
geomFact
- the factory to use
-
-
Method Details
-
setNumArms
public void setNumArms(int numArms) Sets the number of arms in the star- Parameters:
numArms
- the number of arms to generate
-
setArmLengthRatio
public void setArmLengthRatio(double armLengthRatio) Sets the ration of the length of each arm to the distance from the tip of the arm to the centre of the star. Value should be between 0.0 and 1.0- Parameters:
armLengthRatio
-
-
createSineStar
Generates the geometry for the sine star- Returns:
- the geometry representing the sine star
-