BufferParameters class

A value class containing the parameters which specify how a buffer should be constructed.

The parameters allow control over:

  • Quadrant segments (accuracy of approximation for circular arcs)
  • End Cap style
  • Join style
  • Mitre limit
  • whether the buffer is single-sided

@author Martin Davis

Constructors

BufferParameters()
Creates a default set of parameters
BufferParameters.withQS(int quadrantSegments)
Creates a set of parameters with the given quadrantSegments value.
BufferParameters.withQS_ECS(int quadrantSegments, int endCapStyle)
Creates a set of parameters with the given quadrantSegments and endCapStyle values.
BufferParameters.withQS_ECS_JS_ML(int quadrantSegments, int endCapStyle, int joinStyle, double mitreLimit)
Creates a set of parameters with the given parameter values.

Properties

endCapStyle int
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isSingleSided bool
Tests whether the buffer is to be generated on a single side only.
no setter
joinStyle int
getter/setter pair
mitreLimit double
getter/setter pair
quadrantSegments int
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
simplifyFactor double
getter/setter pair

Methods

getEndCapStyle() int
Gets the end cap style.
getJoinStyle() int
Gets the join style
getMitreLimit() double
Gets the mitre ratio limit.
getQuadrantSegments() int
Gets the number of quadrant segments which will be used
getSimplifyFactor() double
Gets the simplify factor.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setEndCapStyle(int endCapStyle) → void
Specifies the end cap style of the generated buffer. The styles supported are {@link #CAP_ROUND}, {@link #CAP_FLAT}, and {@link #CAP_SQUARE}. The default is CAP_ROUND.
setJoinStyle(int joinStyle) → void
Sets the join style for outside (reflex) corners between line segments. Allowable values are {@link #JOIN_ROUND} (which is the default), {@link #JOIN_MITRE} and {link JOIN_BEVEL}.
setMitreLimit(double mitreLimit) → void
Sets the limit on the mitre ratio used for very sharp corners. The mitre ratio is the ratio of the distance from the corner to the end of the mitred offset corner. When two line segments meet at a sharp angle, a miter join will extend far beyond the original geometry. (and in the extreme case will be infinitely far.) To prevent unreasonable geometry, the mitre limit allows controlling the maximum length of the join corner. Corners with a ratio which exceed the limit will be beveled.
setQuadrantSegments(int quadSegs) → void
Sets the number of line segments used to approximate an angle fillet.
setSimplifyFactor(double simplifyFactor) → void
Sets the factor used to determine the simplify distance tolerance for input simplification. Simplifying can increase the performance of computing buffers. Generally the simplify factor should be greater than 0. Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. Larger values sacrifice accuracy in return for performance.
setSingleSided(bool isSingleSided) → void
Sets whether the computed buffer should be single-sided. A single-sided buffer is constructed on only one side of each input line.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

bufferDistanceError(int quadSegs) double
Computes the maximum distance error due to a given level of approximation to a true arc.

Constants

CAP_FLAT → const int
Specifies a flat line buffer end cap style.
CAP_ROUND → const int
Specifies a round line buffer end cap style.
CAP_SQUARE → const int
Specifies a square line buffer end cap style.
DEFAULT_MITRE_LIMIT → const double
The default mitre limit Allows fairly pointy mitres.
DEFAULT_QUADRANT_SEGMENTS → const int
The default number of facets into which to divide a fillet of 90 degrees. A value of 8 gives less than 2% max error in the buffer distance. For a max error of < 1%, use QS = 12. For a max error of < 0.1%, use QS = 18.
DEFAULT_SIMPLIFY_FACTOR → const double
The default simplify factor Provides an accuracy of about 1%, which matches the accuracy of the default Quadrant Segments parameter.
JOIN_BEVEL → const int
Specifies a bevel join style.
JOIN_MITRE → const int
Specifies a mitre join style.
JOIN_ROUND → const int
Specifies a round join style.