Class: OffsetSegmentGenerator

jsts.operation.buffer.OffsetSegmentGenerator

new OffsetSegmentGenerator()

Generates segments which form an offset curve. Supports all end cap and join options provided for buffering. Implements various heuristics to produce smoother, simpler curves which are still within a reasonable tolerance of the true curve.
Source:

Members

hasNarrowConcaveAngle

The intersection test above is vulnerable to robustness errors; i.e. it may be that the offsets should intersect very close to their endpoints, but aren't reported as such due to rounding. To handle this situation appropriately, we use the following test: If the offset points are very close, don't add closing segments but simply use one of the offset points
Source:

Methods

addLastSegment()

Add last offset point
Source:

addLineEndCap()

Add an end cap around point p1, terminating a line segment coming from p0
Source:

createCircle()

Creates a CW circle around a point
Source:

createSquare()

Creates a CW square around a point
Source:

hasNarrowConcaveAngle()

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.
Source:
Returns:
true if the input has a narrow concave angle.