math.geom2d.polygon
Class Polylines2D

java.lang.Object
  extended by math.geom2d.polygon.Polylines2D

public abstract class Polylines2D
extends java.lang.Object

Some utility functions for manipulating Polyline2D.

Since:
0.6.3
Author:
dlegland

Constructor Summary
Polylines2D()
           
 
Method Summary
static boolean hasMultipleVertices(LinearCurve2D polyline)
          Checks if the open polyline has multiple vertices.
static boolean hasMultipleVertices(LinearCurve2D polyline, boolean closed)
          Checks if the input polyline has multiple vertices.
static java.util.Collection<Point2D> intersect(LinearCurve2D poly1, LinearCurve2D poly2)
          Return all intersection points between the 2 polylines.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Polylines2D

public Polylines2D()
Method Detail

hasMultipleVertices

public static final boolean hasMultipleVertices(LinearCurve2D polyline)
Checks if the open polyline has multiple vertices. Polyline extremities are not tested for equality.


hasMultipleVertices

public static final boolean hasMultipleVertices(LinearCurve2D polyline,
                                                boolean closed)
Checks if the input polyline has multiple vertices. Extremities are tested if the polyline is closed (second argument is true).


intersect

public static java.util.Collection<Point2D> intersect(LinearCurve2D poly1,
                                                      LinearCurve2D poly2)
Return all intersection points between the 2 polylines. This method implements a naive algorithm, that tests all possible edge couples. It is supposed that only one point is returned by intersection.

Parameters:
poly1 - a first polyline
poly2 - a second polyline
Returns:
the set of intersection points