Using PathIterator to return all line segments that constrain an Area?
In Java, how would one employ PathIterator to iterate through the line segments that constrain an Area ? The Area is bound only by lines (but curve support wouldn't hurt). The method should return a collection of all the line segments. Peter This works (in all situations, I believe), but it might require more thorough testing: Area area; // The value is set elsewhere in the code ArrayList<double[]> areaPoints = new ArrayList<double[]>(); ArrayList<Line2D.Double> areaSegments = new ArrayList<Line2D.Double>(); double[] coords = new double[6]; for (PathIterator pi = area.getPathIterator(null);