math.geom2d.circulinear
Class CirculinearCurve2DUtils

Package class diagram package CirculinearCurve2DUtils
java.lang.Object
  extended by math.geom2d.circulinear.CirculinearCurve2DUtils

public class CirculinearCurve2DUtils
extends Object

Some utilities for working with circulinear curves.

Author:
dlegland

Constructor Summary
CirculinearCurve2DUtils()
           
 
Method Summary
static CirculinearDomain2D computeBuffer(CirculinearCurve2D curve, double dist)
          Compute the buffer of a circulinear curve.
static CirculinearDomain2D computeBuffer(PointSet2D set, double dist)
          Compute buffer of a point set.
static Collection<? extends CirculinearContour2D> computeBufferSimpleContour(CirculinearContinuousCurve2D curve, double d)
          Computes the rings that form the buffer of a continuous circulinear curve that does not self-intersect.
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 CirculinearContinuousCurve2D createContinuousParallel(CirculinearContinuousCurve2D curve, double dist)
           
static CirculinearCurve2D createParallel(CirculinearCurve2D curve, double dist)
           
static Collection<Point2D> findIntersections(CirculinearCurve2D curve1, CirculinearCurve2D curve2)
           
static Collection<Point2D> findIntersections(CirculinearElement2D elem1, CirculinearElement2D elem2)
          Compute the intersections, if they exist, of two circulinear elements.
static Collection<Point2D> findSelfIntersections(CirculinearCurve2D curve)
          Compute intersection point of a single curve, by iterating on pair of Circulinear elements composing the curve.
static double getDistanceCurvePoints(CirculinearCurve2D curve, 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 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 Collection<CirculinearContour2D> splitIntersectingContours(CirculinearContour2D curve1, CirculinearContour2D curve2)
           
static Collection<CirculinearContour2D> splitIntersectingContours(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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CirculinearCurve2DUtils

public CirculinearCurve2DUtils()
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 onr 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)

createParallel

public static CirculinearCurve2D createParallel(CirculinearCurve2D curve,
                                                double dist)

createContinuousParallel

public static CirculinearContinuousCurve2D createContinuousParallel(CirculinearContinuousCurve2D curve,
                                                                    double dist)

findSelfIntersections

public static Collection<Point2D> findSelfIntersections(CirculinearCurve2D curve)
Compute 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 Collection<Point2D> findIntersections(CirculinearCurve2D curve1,
                                                    CirculinearCurve2D curve2)

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 Collection<Point2D> findIntersections(CirculinearElement2D elem1,
                                                    CirculinearElement2D elem2)
Compute the intersections, if they exist, of two circulinear elements.


splitContinuousCurve

public static 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 Collection<CirculinearContour2D> splitIntersectingContours(CirculinearContour2D curve1,
                                                                         CirculinearContour2D curve2)

splitIntersectingContours

public static Collection<CirculinearContour2D> splitIntersectingContours(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.


computeBuffer

public static CirculinearDomain2D computeBuffer(CirculinearCurve2D curve,
                                                double dist)
Compute the buffer of a circulinear curve.

The algorithm is as folow:

  1. split the curve into a set of curves without self-intersections
  2. for each splitted curve, compute the contour of its buffer
  3. split self-intersecting contours into set of disjoint contours
  4. split all contour which intersect each other to disjoint contours
  5. remove contours which are too close from the original curve
  6. create a new domain with the final set of contours


computeBuffer

public static CirculinearDomain2D computeBuffer(PointSet2D set,
                                                double dist)
Compute buffer of a point set.


computeBufferSimpleContour

public static Collection<? extends CirculinearContour2D> computeBufferSimpleContour(CirculinearContinuousCurve2D curve,
                                                                                    double d)
Computes the rings that form the buffer of a continuous circulinear curve that does not self-intersect.


getDistanceCurvePoints

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


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.