public class BezierShapeGenerator extends Object
Constructor and Description |
---|
BezierShapeGenerator(int nControlPts,
double bezierSampleDistance,
double radius,
double spikiness)
Constructs a BezierShapeGenerator object with the specified number of control
points, bezier sample distance, radius and spikiness.
|
Modifier and Type | Method and Description |
---|---|
org.locationtech.jts.geom.Coordinate[] |
generate(boolean centering,
boolean cylinder,
double scale,
long seed)
Generates a shape's curve based on the control points.
|
public BezierShapeGenerator(int nControlPts, double bezierSampleDistance, double radius, double spikiness)
nControlPts
- The number of control points for the bezier
curve.bezierSampleDistance
- The sample distance along the bezier curve.radius
- The radius relative to the distance between
adjacent points. The radius is used to position
the control points of the bezier curve, should be
between 0 and 1. Larger values result in sharper
features on the curve.spikiness
- A measure of the curve's smoothness. If 0, the
curve's angle through each point will be the
average between the direction to adjacent points.
As it increases, the angle will be determined
mostly by one adjacent point, making the curve
more "spiky".public org.locationtech.jts.geom.Coordinate[] generate(boolean centering, boolean cylinder, double scale, long seed)
centering
- If true, the generated shape will be centered at the origin
(0, 0).cylinder
- If true, the control points will be initialized in a
cylindrical formation. If false, the control points are
generated randomly.scale
- The factor by which the initial control points are
magnified.seed
- The seed used for random control point generation
(applicable when cylinder is false).Copyright © 2023. All rights reserved.