math.geom2d.domain
Class PolyOrientedCurve2D<T extends ContinuousOrientedCurve2D>
- java.lang.Object
-
- math.geom2d.curve.CurveArray2D<T>
-
- math.geom2d.curve.PolyCurve2D<T>
-
- math.geom2d.domain.PolyOrientedCurve2D<T>
-
- All Implemented Interfaces:
- java.lang.Cloneable, java.lang.Iterable<T>, ContinuousCurve2D, Curve2D, CurveSet2D<T>, ContinuousOrientedCurve2D, OrientedCurve2D, GeometricObject2D, Shape2D, ShapeSet2D<T>
- Direct Known Subclasses:
- BoundaryPolyCurve2D, PolyCirculinearCurve2D
public class PolyOrientedCurve2D<T extends ContinuousOrientedCurve2D> extends PolyCurve2D<T> implements ContinuousOrientedCurve2D
A PolyOrientedCurve2D is a set of piecewise smooth curve arcs, such that the end of a curve is the beginning of the next curve, and such that they do not intersect nor self-intersect.
-
-
Constructor Summary
Constructors Constructor and Description PolyOrientedCurve2D()PolyOrientedCurve2D(java.util.Collection<? extends T> curves)PolyOrientedCurve2D(java.util.Collection<? extends T> curves, boolean closed)PolyOrientedCurve2D(int size)PolyOrientedCurve2D(T... curves)PolyOrientedCurve2D(T[] curves, boolean closed)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description CurveSet2D<? extends ContinuousOrientedCurve2D>clip(Box2D box)Clips the PolyCurve2D by a box.static <T extends ContinuousOrientedCurve2D>
PolyOrientedCurve2D<T>create(T... curves)Static factory for creating a new PolyOrientedCurve2D from an array of curves.static <T extends ContinuousOrientedCurve2D>
PolyOrientedCurve2D<T>create(T[] curves, boolean closed)Static factory for creating a new PolyOrientedCurve2D from an array of curves and a flag indicating if the curve is closed or not.static <T extends ContinuousOrientedCurve2D>
PolyOrientedCurve2D<T>createClosed(T... curves)Static factory for creating a new PolyOrientedCurve2D from an array of curves.booleanequals(java.lang.Object obj)Returns true if obj is a CurveArray2D with the same number of curves, and such that each curve belongs to both objects.booleanisInside(Point2D point)Determines if the given point lies within the domain bounded by this curve.PolyOrientedCurve2D<? extends ContinuousOrientedCurve2D>reverse()Returns the reverse curve of this PolyCurve2D.doublesignedDistance(double x, double y)The same as distanceSigned(Point2D), but by passing 2 double as arguments.doublesignedDistance(Point2D p)Returns the signed distance of the curve to the given point.PolyOrientedCurve2D<? extends ContinuousOrientedCurve2D>subCurve(double t0, double t1)Returns a portion of this curve as an instance of PolyOrientedCurve2D.PolyOrientedCurve2D<?>transform(AffineTransform2D trans)Transforms each smooth piece in this PolyCurve2D and returns a new instance of PolyCurve2D.doublewindingAngle(Point2D point)Return the angle portion that the curve turn around the given point.-
Methods inherited from class math.geom2d.curve.PolyCurve2D
appendPath, asPolyline, continuousCurves, create, curvature, draw, getGeneralPath, isClosed, leftTangent, rightTangent, setClosed, smoothPieces
-
Methods inherited from class math.geom2d.curve.CurveArray2D
add, add, almostEquals, asAwtShape, boundingBox, childCurve, clear, clone, contains, contains, contains, create, curveIndex, curves, distance, distance, firstCurve, firstPoint, get, getT0, getT1, globalPosition, indexOf, intersections, isBounded, isEmpty, isSingular, iterator, lastCurve, lastPoint, localPosition, point, position, project, remove, remove, singularPoints, size, t0, t1, vertices
-
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface math.geom2d.curve.ContinuousCurve2D
appendPath, asPolyline, curvature, isClosed, leftTangent, rightTangent, smoothPieces
-
Methods inherited from interface math.geom2d.curve.Curve2D
asAwtShape, clone, continuousCurves, draw, firstPoint, getT0, getT1, intersections, isSingular, lastPoint, point, position, project, singularPoints, t0, t1, vertices
-
Methods inherited from interface math.geom2d.Shape2D
boundingBox, contains, contains, distance, distance, isBounded, isEmpty
-
Methods inherited from interface math.geom2d.GeometricObject2D
almostEquals
-
-
-
-
Constructor Detail
-
PolyOrientedCurve2D
public PolyOrientedCurve2D()
-
PolyOrientedCurve2D
public PolyOrientedCurve2D(int size)
-
PolyOrientedCurve2D
public PolyOrientedCurve2D(T... curves)
-
PolyOrientedCurve2D
public PolyOrientedCurve2D(T[] curves, boolean closed)
-
PolyOrientedCurve2D
public PolyOrientedCurve2D(java.util.Collection<? extends T> curves)
-
PolyOrientedCurve2D
public PolyOrientedCurve2D(java.util.Collection<? extends T> curves, boolean closed)
-
-
Method Detail
-
create
public static <T extends ContinuousOrientedCurve2D> PolyOrientedCurve2D<T> create(T... curves)
Static factory for creating a new PolyOrientedCurve2D from an array of curves.- Since:
- 0.8.1
-
createClosed
public static <T extends ContinuousOrientedCurve2D> PolyOrientedCurve2D<T> createClosed(T... curves)
Static factory for creating a new PolyOrientedCurve2D from an array of curves.- Since:
- 0.8.1
-
create
public static <T extends ContinuousOrientedCurve2D> PolyOrientedCurve2D<T> create(T[] curves, boolean closed)
Static factory for creating a new PolyOrientedCurve2D from an array of curves and a flag indicating if the curve is closed or not.- Since:
- 0.9.0
-
windingAngle
public double windingAngle(Point2D point)
Description copied from interface:OrientedCurve2DReturn the angle portion that the curve turn around the given point. Result is a signed angle.- Specified by:
windingAnglein interfaceOrientedCurve2D- Parameters:
point- a point of the plane- Returns:
- a signed angle
-
signedDistance
public double signedDistance(Point2D p)
Description copied from interface:OrientedCurve2DReturns the signed distance of the curve to the given point. The distance is positive if the point lies outside the shape, and negative if the point lies inside the shape. In both cases, absolute value of distance is equals to the distance to the border of the shape.- Specified by:
signedDistancein interfaceOrientedCurve2D- Parameters:
p- a point of the plane- Returns:
- the signed distance to the curve
-
signedDistance
public double signedDistance(double x, double y)Description copied from interface:OrientedCurve2DThe same as distanceSigned(Point2D), but by passing 2 double as arguments.- Specified by:
signedDistancein interfaceOrientedCurve2D- Parameters:
x- x-coord of a pointy- y-coord of a point- Returns:
- the signed distance of the point (x,y) to the curve
-
isInside
public boolean isInside(Point2D point)
Determines if the given point lies within the domain bounded by this curve.- Specified by:
isInsidein interfaceOrientedCurve2D- Parameters:
point- a point in the plane- Returns:
- true if the point is on the left side of the curve.
-
reverse
public PolyOrientedCurve2D<? extends ContinuousOrientedCurve2D> reverse()
Description copied from class:PolyCurve2DReturns the reverse curve of this PolyCurve2D.- Specified by:
reversein interfaceContinuousCurve2D- Specified by:
reversein interfaceCurve2D- Specified by:
reversein interfaceContinuousOrientedCurve2D- Specified by:
reversein interfaceOrientedCurve2D- Overrides:
reversein classPolyCurve2D<T extends ContinuousOrientedCurve2D>
-
subCurve
public PolyOrientedCurve2D<? extends ContinuousOrientedCurve2D> subCurve(double t0, double t1)
Returns a portion of this curve as an instance of PolyOrientedCurve2D.- Specified by:
subCurvein interfaceContinuousCurve2D- Specified by:
subCurvein interfaceCurve2D- Specified by:
subCurvein interfaceContinuousOrientedCurve2D- Overrides:
subCurvein classPolyCurve2D<T extends ContinuousOrientedCurve2D>- Parameters:
t0- position of the start of the sub-curvet1- position of the end of the sub-curve- Returns:
- the portion of original curve comprised between t0 and t1.
-
clip
public CurveSet2D<? extends ContinuousOrientedCurve2D> clip(Box2D box)
Clips the PolyCurve2D by a box. The result is an instance of CurveSet2D, which contains only instances of ContinuousOrientedCurve2D. If the PolyCurve2D is not clipped, the result is an instance of CurveSet2D which contains 0 curves.- Specified by:
clipin interfaceContinuousCurve2D- Specified by:
clipin interfaceCurve2D- Specified by:
clipin interfaceContinuousOrientedCurve2D- Specified by:
clipin interfaceOrientedCurve2D- Specified by:
clipin interfaceShape2D- Overrides:
clipin classPolyCurve2D<T extends ContinuousOrientedCurve2D>- Parameters:
box- the clipping box- Returns:
- the clipped shape
-
transform
public PolyOrientedCurve2D<?> transform(AffineTransform2D trans)
Description copied from class:PolyCurve2DTransforms each smooth piece in this PolyCurve2D and returns a new instance of PolyCurve2D.- Specified by:
transformin interfaceContinuousCurve2D- Specified by:
transformin interfaceCurve2D- Specified by:
transformin interfaceCurveSet2D<T extends ContinuousOrientedCurve2D>- Specified by:
transformin interfaceContinuousOrientedCurve2D- Specified by:
transformin interfaceOrientedCurve2D- Specified by:
transformin interfaceShape2D- Overrides:
transformin classPolyCurve2D<T extends ContinuousOrientedCurve2D>- Parameters:
trans- an affine transform- Returns:
- the transformed shape
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:CurveArray2DReturns true if obj is a CurveArray2D with the same number of curves, and such that each curve belongs to both objects.- Overrides:
equalsin classPolyCurve2D<T extends ContinuousOrientedCurve2D>
-
-
DMelt 3.0 © DataMelt by jWork.ORG