math.geom2d.domain
Class Boundary2DUtils

Package class diagram package Boundary2DUtils
java.lang.Object
  extended by math.geom2d.domain.Boundary2DUtils

public abstract class Boundary2DUtils
extends Object

Collects some useful methods for clipping curves.

Author:
dlegland

Constructor Summary
Boundary2DUtils()
           
 
Method Summary
static BoundarySet2D<ContinuousBoundary2D> clipBoundary(Boundary2D boundary, Box2D box)
          Clips a boundary and closes the result curve.
static CurveSet2D<ContinuousOrientedCurve2D> clipContinuousOrientedCurve(ContinuousOrientedCurve2D curve, Box2D box)
          Clip a curve, and return a CurveSet2D.
static int findNextCurveIndex(double[] positions, double pos)
           
static Polyline2D getBoundaryPortion(Box2D box, Point2D p0, Point2D p1)
          Extracts a portion of the boundary of a bounded box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Boundary2DUtils

public Boundary2DUtils()
Method Detail

clipContinuousOrientedCurve

public static final CurveSet2D<ContinuousOrientedCurve2D> clipContinuousOrientedCurve(ContinuousOrientedCurve2D curve,
                                                                                      Box2D box)
Clip a curve, and return a CurveSet2D. If the curve is totally outside the box, return a CurveSet2D with 0 curves inside. If the curve is totally inside the box, return a CurveSet2D with only one curve, which is the original curve.


clipBoundary

public static final BoundarySet2D<ContinuousBoundary2D> clipBoundary(Boundary2D boundary,
                                                                     Box2D box)
Clips a boundary and closes the result curve. Return an instance of BoundarySet2D.


findNextCurveIndex

public static final int findNextCurveIndex(double[] positions,
                                           double pos)

getBoundaryPortion

public static final Polyline2D getBoundaryPortion(Box2D box,
                                                  Point2D p0,
                                                  Point2D p1)
Extracts a portion of the boundary of a bounded box.

Parameters:
box - the box from which one extract a portion of boundary
p0 - the first point of the portion
p1 - the last point of the portion
Returns:
the portion of the bounding box boundary as a Polyline2D


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