math.geom2d.circulinear
Class CirculinearCurves2D

java.lang.Object
  extended by math.geom2d.circulinear.CirculinearCurves2D

public class CirculinearCurves2D
extends java.lang.Object

Some utilities for working with circulinear curves.

Author:
dlegland

Constructor Summary
CirculinearCurves2D()
           
 
Method Summary
static CirculinearCurve2D convert(Curve2D curve)
          Converts a curve to a circulinear curve, by concatenating all elements of the curve to the appropriate circulinear curve type.
static java.util.Collection<Point2D> findIntersections(CirculinearCurve2D curve1, CirculinearCurve2D curve2)
          Compute the set of intersection points between the two curves.
static java.util.Collection<Point2D> findIntersections(CirculinearElement2D elem1, CirculinearElement2D elem2)
          Computes the intersections, if they exist, of two circulinear elements.
static java.util.Collection<Point2D> findSelfIntersections(CirculinearCurve2D curve)
          Computes intersection point of a single curve, by iterating on pair of Circulinear elements composing the curve.
static double getDistanceCurvePoints(CirculinearCurve2D curve, java.util.Collection<? extends Point2D> points)
           
static double getLength(CurveSet2D<? extends CirculinearCurve2D> curve, double pos)
           
static double getPosition(CurveSet2D<? extends CirculinearCurve2D> curveSet, double length)
           
static double[][] locateIntersections(CirculinearCurve2D curve1, CirculinearCurve2D curve2)
          Locate intersection points of two curves.
static double[][] locateSelfIntersections(CurveSet2D<? extends CirculinearElement2D> curve)
           
static java.util.Collection<CirculinearContinuousCurve2D> splitContinuousCurve(CirculinearContinuousCurve2D curve)
          Split a continuous curve which self-intersects into a set of continuous circulinear curves which do not self-intersect.
static java.util.Collection<CirculinearContour2D> splitIntersectingContours(CirculinearContour2D curve1, CirculinearContour2D curve2)
           
static java.util.Collection<CirculinearContour2D> splitIntersectingContours(java.util.Collection<? extends CirculinearContour2D> curves)
          Split a collection of contours which possibly intersect each other to a set of contours which do not intersect each others.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CirculinearCurves2D

public CirculinearCurves2D()
Method Detail

convert

public static CirculinearCurve2D convert(Curve2D curve)
Converts a curve to a circulinear curve, by concatenating all elements of the curve to the appropriate circulinear curve type. If the curve contains one or more non-circulinear smooth curve, a NonCirculinearClassException is thrown.


getLength

public static double getLength(CurveSet2D<? extends CirculinearCurve2D> curve,
                               double pos)

getPosition

public static double getPosition(CurveSet2D<? extends CirculinearCurve2D> curveSet,
                                 double length)

findSelfIntersections

public static java.util.Collection<Point2D> findSelfIntersections(CirculinearCurve2D curve)
Computes intersection point of a single curve, by iterating on pair of Circulinear elements composing the curve.

Returns:
the set of self-intersection points

locateSelfIntersections

public static double[][] locateSelfIntersections(CurveSet2D<? extends CirculinearElement2D> curve)

findIntersections

public static java.util.Collection<Point2D> findIntersections(CirculinearCurve2D curve1,
                                                              CirculinearCurve2D curve2)
Compute the set of intersection points between the two curves.

Returns:
a collection of intersection points

locateIntersections

public static double[][] locateIntersections(CirculinearCurve2D curve1,
                                             CirculinearCurve2D curve2)
Locate intersection points of two curves. The result is a N-by-2 array of double, where N is the number of intersections. For each row, the first element is the position on the first curve, and the second element is the position on the second curve.


findIntersections

public static java.util.Collection<Point2D> findIntersections(CirculinearElement2D elem1,
                                                              CirculinearElement2D elem2)
Computes the intersections, if they exist, of two circulinear elements.


splitContinuousCurve

public static java.util.Collection<CirculinearContinuousCurve2D> splitContinuousCurve(CirculinearContinuousCurve2D curve)
Split a continuous curve which self-intersects into a set of continuous circulinear curves which do not self-intersect.

Parameters:
curve - the curve to split
Returns:
a set of non-self-intersecting continuous curves

splitIntersectingContours

public static java.util.Collection<CirculinearContour2D> splitIntersectingContours(CirculinearContour2D curve1,
                                                                                   CirculinearContour2D curve2)

splitIntersectingContours

public static java.util.Collection<CirculinearContour2D> splitIntersectingContours(java.util.Collection<? extends CirculinearContour2D> curves)
Split a collection of contours which possibly intersect each other to a set of contours which do not intersect each others. Each contour is assumed not to self-intersect.


getDistanceCurvePoints

public static double getDistanceCurvePoints(CirculinearCurve2D curve,
                                            java.util.Collection<? extends Point2D> points)