Class ConditionalPathIterator2D

java.lang.Object
org.bzdev.geom.ConditionalPathIterator2D
All Implemented Interfaces:
PathIterator

public class ConditionalPathIterator2D extends Object implements PathIterator
Conditional path iterator class for two dimensions. This iterator adds segments to the segments returned by another path iterator by splitting quadratic and cubic Bézier-curve segments unless the points along a segment fails to satisfy a condition that indicates that splitting should continue. If that condition is not satisfied, splitting may continue in some circumstances: the second control point, for example, should not be closer to the initial control point than the first control point. The condition is a predicate whose argument is a control point array including the end points of a segment. It will have a length of 6 for qudratic segments and a length of 8 for cubic segments.

The iterator has a recursion limit (the default value is 10) to prevent the number of segments from becoming excessively large. Incrementing the recursion limit by 1 can double the number of segments from that returned by the previous limit.

The path may be partially flattened. This class does not modify segment types, unlike FlatteningPathIterator which turns quadratic and cubic segments into straight lines.