OffsetSegmentGenerator class
Generates segments which form an offset curve. Supports all end cap and join options provided for buffering. This algorithm implements various heuristics to produce smoother, simpler curves which are still within a reasonable tolerance of the true curve.
@author Martin Davis
Constructors
- OffsetSegmentGenerator(PrecisionModel precisionModel, BufferParameters bufParams, double distance)
Properties
- bufParams ↔ BufferParameters
-
getter/setter pair
- closingSegLengthFactor ↔ int
-
The Closing Segment Length Factor controls how long
"closing segments" are. Closing segments are added
at the middle of inside corners to ensure a smoother
boundary for the buffer offset curve.
In some cases (particularly for round joins with default-or-better
quantization) the closing segments can be made quite short.
This substantially improves performance (due to fewer intersections being created).
getter/setter pair
- distance ↔ double
-
getter/setter pair
- filletAngleQuantum ↔ double
-
The angle quantum with which to approximate a fillet curve
(based on the input # of quadrant segments)
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- li ↔ LineIntersector?
-
getter/setter pair
- maxCurveSegmentError ↔ double
-
the max error of approximation (distance) between a quad segment and the true fillet curve
getter/setter pair
- offset0 ↔ LineSegment
-
getter/setter pair
- offset1 ↔ LineSegment
-
getter/setter pair
- precisionModel ↔ PrecisionModel
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- s0 ↔ Coordinate
-
getter/setter pair
- s1 ↔ Coordinate
-
getter/setter pair
- s2 ↔ Coordinate
-
getter/setter pair
- seg0 ↔ LineSegment
-
getter/setter pair
- seg1 ↔ LineSegment
-
getter/setter pair
- segList ↔ OffsetSegmentString
-
getter/setter pair
- side ↔ int
-
getter/setter pair
Methods
-
addBevelJoin(
LineSegment offset0, LineSegment offset1) → void - Adds a bevel join connecting the two offset segments around a reflex corner.
-
addCollinear(
bool addStartPoint) → void -
addCornerFillet(
Coordinate p, Coordinate p0, Coordinate p1, int direction, double radius) → void - Add points for a circular fillet around a reflex corner. Adds the start and end points
-
addDirectedFillet(
Coordinate p, double startAngle, double endAngle, int direction, double radius) → void - Adds points for a circular fillet arc between two specified angles. The start and end point for the fillet are not added - the caller must add them if required.
-
addFirstSegment(
) → void -
addInsideTurn(
int orientation, bool addStartPoint) → void - Adds the offset points for an inside (concave) turn.
-
addLastSegment(
) → void - Add last offset point
-
addLimitedMitreJoin(
LineSegment offset0, LineSegment offset1, double distance, double mitreLimit) → void - Adds a limited mitre join connecting the two reflex offset segments. A limited mitre is a mitre which is beveled at the distance determined by the mitre ratio limit.
-
addLineEndCap(
Coordinate p0, Coordinate p1) → void - Add an end cap around point p1, terminating a line segment coming from p0
-
addMitreJoin(
Coordinate p, LineSegment offset0, LineSegment offset1, double distance) → void - Adds a mitre join connecting the two reflex offset segments. The mitre will be beveled if it exceeds the mitre ratio limit.
-
addNextSegment(
Coordinate p, bool addStartPoint) → void -
addOutsideTurn(
int orientation, bool addStartPoint) → void - Adds the offset points for an outside (convex) turn
-
addSegments(
List< Coordinate> pt, bool isForward) → void -
closeRing(
) → void -
computeOffsetSegment(
LineSegment seg, int side, double distance, LineSegment offset) → void - Compute an offset segment for an input segment on a given side and at a given distance. The offset points are computed in full double precision, for accuracy.
-
createCircle(
Coordinate p) → void - Creates a CW circle around a point
-
createSquare(
Coordinate p) → void - Creates a CW square around a point
-
getCoordinates(
) → List< Coordinate> -
hasNarrowConcaveAngleWW(
) → bool - Tests whether the input has a narrow concave angle (relative to the offset distance). In this case the generated offset curve will contain self-intersections and heuristic closing segments. This is expected behaviour in the case of Buffer curves. For pure Offset Curves, the output needs to be further treated before it can be used.
-
init(
double distance) → void -
initSideSegments(
Coordinate s1, Coordinate s2, int side) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- CURVE_VERTEX_SNAP_DISTANCE_FACTOR → double
-
Factor which controls how close curve vertices can be to be snapped
final
- INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR → double
-
Factor which controls how close curve vertices on inside turns can be to be snapped
final
- MAX_CLOSING_SEG_LEN_FACTOR → int
-
Factor which determines how short closing segs can be for round buffers
final
- OFFSET_SEGMENT_SEPARATION_FACTOR → double
-
Factor which controls how close offset segments can be to
skip adding a filler or mitre.
final