Interface Path3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>
-
- Type Parameters:
ST- is the type of the general implementation.IT- is the type of the implementation of this shape.IE- is the type of the path elements.P- is the type of the points.V- is the type of the vectors.B- is the type of the bounding boxes.
- All Superinterfaces:
Cloneable,JsonableObject,Path3D<ST,IT,PathIterator3afp<IE>,P,V,B>,Serializable,Shape3afp<ST,IT,IE,P,V,B>,Shape3D<ST,IT,PathIterator3afp<IE>,P,V,B>
public interface Path3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>> extends Shape3afp<ST,IT,IE,P,V,B>, Path3D<ST,IT,PathIterator3afp<IE>,P,V,B>
Fonctional interface that represented a 2D path on a plane.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND, Hamza JAFFALI, Thomas PIOTROWSKI
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPath3afp.AbstractPathPathIterator<T extends PathElement3afp>Abstract iterator on the path elements of the path.static classPath3afp.FlatteningPathIterator<T extends PathElement3afp>A path iterator that is flattening the path.static classPath3afp.PathPathIterator<T extends PathElement3afp>A path iterator that does not transform the coordinates.static classPath3afp.PointCollection<P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>An collection of the points of the path.static classPath3afp.PointIterator<P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>Iterator on the points of the path.static classPath3afp.TransformedPathPathIterator<T extends PathElement3afp>A path iterator that transforms the coordinates.-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d3.Path3D
Path3D.ArcType
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_FLATENING_LIMITThe default flatening depth limit.static PathWindingRuleDEFAULT_WINDING_RULEThe default winding rule:PathWindingRule.NON_ZERO.static intGROW_SIZEMultiple of cubic & quad curve size.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidadd(Iterator<? extends PathElement3afp> iterator)Add the elements replied by the iterator into this path.static booleancomputeControlPointBoundingBox(PathIterator3afp<?> iterator, RectangularPrism3afp<?,?,?,?,?,?> box)Compute the box that corresponds to the control points of the path.static intcomputeCrossingsFromPath(int crossings, PathIterator3afp<?> iterator, BasicPathShadow3afp shadow, CrossingComputationType type)Accumulate the number of times the path crosses the shadow extending to the right of the second path.static intcomputeCrossingsFromPoint(int crossings, PathIterator3afp<? extends PathElement3afp> iterator, double px, double py, double pz, CrossingComputationType type)Calculates the number of times the given path crosses the ray extending to the right from (px,py).static intcomputeCrossingsFromRect(int crossings, PathIterator3afp<? extends PathElement3afp> iterator, double rxmin, double rymin, double rzmin, double rxmax, double rymax, double rzmax, CrossingComputationType type)Accumulate the number of times the path crosses the shadow extending to the right of the rectangle.static intcomputeCrossingsFromSegment(int crossings, PathIterator3afp<? extends PathElement3afp> iterator, double x1, double y1, double z1, double x2, double y2, double z2, CrossingComputationType type)Calculates the number of times the given path crosses the given segment extending to the right.static intcomputeCrossingsFromSphere(int crossings, PathIterator3afp<? extends PathElement3afp> iterator, double cx, double cy, double cz, double radius, CrossingComputationType type)Calculates the number of times the given path crosses the given circle extending to the right.static booleancomputeDrawableElementBoundingBox(PathIterator3afp<?> iterator, RectangularPrism3afp<?,?,?,?,?,?> box)Compute the box that corresponds to the drawable elements of the path.static doublecomputeLength(PathIterator3afp<?> iterator)Compute the total squared length of the path.default booleancontains(double x, double y, double z)Replies if the given point is inside this shape.default booleancontains(RectangularPrism3afp<?,?,?,?,?,?> prism)Replies if the given rectangular prism is inside this shape.static booleancontainsPoint(PathIterator3afp<? extends PathElement3afp> pi, double x, double y, double z)Tests if the specified coordinates are inside the closed boundary of the specifiedPathIterator3afp.static booleancontainsRectangle(PathIterator3afp<? extends PathElement3afp> pi, double rx, double ry, double rz, double rwidth, double rheight, double rdepth)Tests if the specified rectangle is inside the closed boundary of the specifiedPathIterator3afp.voidcurveTo(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3,y3), using the specified points(x1,y1)and(x2,y2)as Bézier control points.default voidcurveTo(Point3D<?,?> ctrl1, Point3D<?,?> ctrl2, Point3D<?,?> to)Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3,y3), using the specified points(x1,y1)and(x2,y2)as Bézier control points.default booleanequalsToShape(IT shape)Replies this shape is equal to the given shape.default PgetClosestPointTo(Path3afp<?,?,?,?,?,?> path)Replies the closest point on this shape to the given path.static voidgetClosestPointTo(PathIterator3afp<? extends PathElement3afp> pi, double x, double y, double z, Point3D<?,?> result)Replies the point on the path that is closest to the given point.static booleangetClosestPointTo(PathIterator3afp<? extends PathElement3afp> pi, PathIterator3afp<? extends PathElement3afp> shape, Point3D<?,?> result)Replies the point on the path of pi that is closest to the given shape.default PgetClosestPointTo(RectangularPrism3afp<?,?,?,?,?,?> rectangularPrism)Replies the closest point on this shape to the given rectangular prism.default PgetClosestPointTo(Segment3afp<?,?,?,?,?,?> segment)Replies the closest point on this shape to the given segment.default PgetClosestPointTo(Sphere3afp<?,?,?,?,?,?> sphere)Replies the closest point on this shape to the given sphere.default PgetClosestPointTo(Point3D<?,?> pt)Replies the point on the shape that is closest to the given point.doublegetCoordAt(int index)Replies the coordinate at the given index.default PgetCurrentPoint()Replies the last point in the path.doublegetCurrentX()Replies the x coordinate of the last point in the path.doublegetCurrentY()Replies the y coordinate of the last point in the path.doublegetCurrentZ()Replies the z coordinate of the last point in the path.default doublegetDistanceL1(Point3D<?,?> point)Computes the L-1 (Manhattan) distance between this shape and point p1.default doublegetDistanceLinf(Point3D<?,?> point)Computes the L-infinite distance between this shape and point p1.default doublegetDistanceSquared(Point3D<?,?> point)Replies the squared value of the minimal distance from this shape to the given point.static voidgetFarthestPointTo(PathIterator3afp<? extends PathElement3afp> pi, double x, double y, double z, Point3D<?,?> result)Replies the point on the path that is farthest to the given point.default PgetFarthestPointTo(Point3D<?,?> pt)Replies the point on the shape that is farthest the given point.default doublegetLength()Replies the total length of the path.default doublegetLengthSquared()Replies the total squared length of the path.default PathIterator3afp<IE>getPathIterator(double flatness)Replies an iterator on the path elements.default PathIterator3afp<IE>getPathIterator(Transform3D transform)Replies the elements of the paths.default PathIterator3afp<IE>getPathIterator(Transform3D transform, double flatness)Replies an iterator on the path elements.default booleanintersects(MultiShape3afp<?,?,?,?,?,?,?> multishape)Replies if this shape is intersecting the given multishape.default booleanintersects(Path3afp<?,?,?,?,?,?> path)Replies if this shape is intersecting the given path.default booleanintersects(PathIterator3afp<?> iterator)Replies if this shape is intersecting the shape representing the given path iterator.default booleanintersects(RectangularPrism3afp<?,?,?,?,?,?> prism)Replies if this shape is intersecting the given Prism.default booleanintersects(Segment3afp<?,?,?,?,?,?> segment)Replies if this shape is intersecting the given line.default booleanintersects(Sphere3afp<?,?,?,?,?,?> sphere)Replies if this shape is intersecting the given circle.static booleanintersectsPathIteratorRectangle(PathIterator3afp<? extends PathElement3afp> pi, double x, double y, double z, double width, double height, double depth)Tests if the interior of the specifiedPathIterator3afpintersects the interior of a specified set of rectangular coordinates.voidlineTo(double x, double y, double z)Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.default voidlineTo(Point3D<?,?> to)Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.voidmoveTo(double x, double y, double z)Adds a point to the path by moving to the specified coordinates specified in double precision.default voidmoveTo(Point3D<?,?> position)Adds a point to the path by moving to the specified coordinates specified in double precision.voidquadTo(double x1, double y1, double z1, double x2, double y2, double z2)Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2,y2), using the specified point(x1,y1)as a quadratic parametric control point.default voidquadTo(Point3D<?,?> ctrl, Point3D<?,?> to)Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2,y2), using the specified point(x1,y1)as a quadratic parametric control point.booleanremove(double x, double y, double z)Remove the point with the given coordinates.default voidset(Path3afp<?,?,?,?,?,?> path)Set the path.voidsetLastPoint(double x, double y, double z)Change the coordinates of the last inserted point.default voidsetLastPoint(Point3D<?,?> point)Change the coordinates of the last inserted point.default voidtoBoundingBox(B box)Replies the bounds of the shape.default Collection<P>toCollection()Replies the collection that is contains all the points of the path.voidtransform(Transform3D transform)Transform the current path.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.Path3D
closePath, containsControlPoint, getPathElementCount, getPathElementTypeAt, getPointAt, getWindingRule, isCurved, isMultiParts, isPolygon, isPolyline, removeLast, setWindingRule, size, toBoundingBoxWithCtrlPoints, toBoundingBoxWithCtrlPoints, toDoubleArray, toDoubleArray, toFloatArray, toFloatArray, toIntArray, toIntArray, toPointArray, toPointArray
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.afp.Shape3afp
contains, contains, createTransformedShape, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, toBoundingBox, translate, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.Shape3D
clear, clone, equalsToPathIterator, getDistance, getDistance, getPathIterator, isEmpty, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo, set
-
-
-
-
Field Detail
-
GROW_SIZE
static final int GROW_SIZE
Multiple of cubic & quad curve size.- See Also:
- Constant Field Values
-
DEFAULT_FLATENING_LIMIT
static final int DEFAULT_FLATENING_LIMIT
The default flatening depth limit.- See Also:
- Constant Field Values
-
DEFAULT_WINDING_RULE
static final PathWindingRule DEFAULT_WINDING_RULE
The default winding rule:PathWindingRule.NON_ZERO.
-
-
Method Detail
-
computeCrossingsFromPath
static int computeCrossingsFromPath(int crossings, PathIterator3afp<?> iterator, BasicPathShadow3afp shadow, CrossingComputationType type)Accumulate the number of times the path crosses the shadow extending to the right of the second path. See the comment for the SHAPE_INTERSECTS constant for more complete details. The return value is the sum of all crossings for both the top and bottom of the shadow for every segment in the path, or the special value SHAPE_INTERSECTS if the path ever enters the interior of the rectangle. The path must start with a SEG_MOVETO, otherwise an exception is thrown. The caller must check r[xy]{min,max} for NaN values.- Parameters:
crossings- is the initial value for crossing.iterator- is the iterator on the path elements.shadow- is the description of the shape to project to the right.type- is the type of special computation to apply. Ifnull, it is equivalent toCrossingComputationType.STANDARD.- Returns:
- the crossings.
- See Also:
- "WeilerâAtherton clipping algorithm"
-
getClosestPointTo
static void getClosestPointTo(PathIterator3afp<? extends PathElement3afp> pi, double x, double y, double z, Point3D<?,?> result)
Replies the point on the path that is closest to the given point.CAUTION: This function works only on path iterators that are replying not-curved primitives, ie. if the
PathIterator3D.isCurved()ofpiis replyingfalse.getClosestPointTo(Point3D)avoids this restriction.- Parameters:
pi- is the iterator on the elements of the path.x- x coordinate of the point.y- y coordinate of the point.z- z coordinate of the point.result- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
static boolean getClosestPointTo(PathIterator3afp<? extends PathElement3afp> pi, PathIterator3afp<? extends PathElement3afp> shape, Point3D<?,?> result)
Replies the point on the path of pi that is closest to the given shape.CAUTION: This function works only on path iterators that are replying not-curved primitives, ie. if the
PathIterator3D.isCurved()ofpiis replyingfalse.Shape3afp.getClosestPointTo(org.arakhne.afc.math.geometry.d3.Shape3D)avoids this restriction.- Parameters:
pi- is the iterator of path elements, on one of which the closest point is located.shape- the shape to which the closest point must be computed.result- the closest point on pi.- Returns:
trueif a point was found. Otherwisefalse.
-
getClosestPointTo
@Pure default P getClosestPointTo(Point3D<?,?> pt)
Description copied from interface:Shape3DReplies the point on the shape that is closest to the given point.- Specified by:
getClosestPointToin interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
pt- the point.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
@Pure default P getClosestPointTo(Sphere3afp<?,?,?,?,?,?> sphere)
Description copied from interface:Shape3afpReplies the closest point on this shape to the given sphere.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
sphere- the sphere.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
@Pure default P getClosestPointTo(RectangularPrism3afp<?,?,?,?,?,?> rectangularPrism)
Description copied from interface:Shape3afpReplies the closest point on this shape to the given rectangular prism.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
rectangularPrism- the rectangular prism.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
@Pure default P getClosestPointTo(Segment3afp<?,?,?,?,?,?> segment)
Description copied from interface:Shape3afpReplies the closest point on this shape to the given segment.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
segment- the segment.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
@Pure default P getClosestPointTo(Path3afp<?,?,?,?,?,?> path)
Description copied from interface:Shape3afpReplies the closest point on this shape to the given path.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
path- the path.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getFarthestPointTo
static void getFarthestPointTo(PathIterator3afp<? extends PathElement3afp> pi, double x, double y, double z, Point3D<?,?> result)
Replies the point on the path that is farthest to the given point.CAUTION: This function works only on path iterators that are replying not-curved primitives, ie. if the
PathIterator3D.isCurved()ofpiis replyingfalse.getFarthestPointTo(Point3D)avoids this restriction.- Parameters:
pi- is the iterator on the elements of the path.x- x coordinate of the point.y- y coordinate of the point.z- z coordinate of the point.result- the fartheset point on the shape.
-
getFarthestPointTo
@Pure default P getFarthestPointTo(Point3D<?,?> pt)
Description copied from interface:Shape3DReplies the point on the shape that is farthest the given point.- Specified by:
getFarthestPointToin interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
pt- the point.- Returns:
- the farthest point on the shape.
-
containsPoint
static boolean containsPoint(PathIterator3afp<? extends PathElement3afp> pi, double x, double y, double z)
Tests if the specified coordinates are inside the closed boundary of the specifiedPathIterator3afp.This method provides a basic facility for implementors of the
Shape3afpinterface to implement support for theShape3afp.contains(double, double, double)method.- Parameters:
pi- the specifiedPathIterator2fx- the specified X coordinatey- the specified Y coordinatez- the specified Z coordinate- Returns:
trueif the specified coordinates are inside the specifiedPathIterator2f;falseotherwise
-
containsRectangle
static boolean containsRectangle(PathIterator3afp<? extends PathElement3afp> pi, double rx, double ry, double rz, double rwidth, double rheight, double rdepth)
Tests if the specified rectangle is inside the closed boundary of the specifiedPathIterator3afp.This method provides a basic facility for implementors of the
Shape3afpinterface to implement support for theShape3afp.contains(RectangularPrism3afp)method.- Parameters:
pi- the specifiedPathIterator2frx- the lowest corner of the rectangle.ry- the lowest corner of the rectangle.rz- the lowest corner of the rectangle.rwidth- is the width of the rectangle.rheight- is the width of the rectangle.rdepth- is the depth of the rectangle.- Returns:
trueif the specified rectangle is inside the specifiedPathIterator2f;falseotherwise.
-
intersectsPathIteratorRectangle
static boolean intersectsPathIteratorRectangle(PathIterator3afp<? extends PathElement3afp> pi, double x, double y, double z, double width, double height, double depth)
Tests if the interior of the specifiedPathIterator3afpintersects the interior of a specified set of rectangular coordinates.- Parameters:
pi- the specifiedPathIterator3afp.x- the specified X coordinate of the rectangle.y- the specified Y coordinate of the rectangle.z- the specified Y coordinate of the rectangle.width- the width of the specified rectangular coordinates.height- the height of the specified rectangular coordinates.depth- the depth of the specified rectangular coordinates.- Returns:
trueif the specifiedPathIterator3afpand the interior of the specified set of rectangular coordinates intersect each other;falseotherwise.
-
computeCrossingsFromPoint
static int computeCrossingsFromPoint(int crossings, PathIterator3afp<? extends PathElement3afp> iterator, double px, double py, double pz, CrossingComputationType type)Calculates the number of times the given path crosses the ray extending to the right from (px,py). If the point lies on a part of the path, then no crossings are counted for that intersection. +1 is added for each crossing where the Y coordinate is increasing -1 is added for each crossing where the Y coordinate is decreasing The return value is the sum of all crossings for every segment in the path. The path must start with a MOVE_TO, otherwise an exception is thrown.- Parameters:
crossings- is the initial value for crossing.iterator- is the description of the path.px- is the reference point to test.py- is the reference point to test.pz- is the reference point to test.type- is the type of special computation to apply. Ifnull, it is equivalent toCrossingComputationType.STANDARD.- Returns:
- the crossing
-
computeCrossingsFromSphere
static int computeCrossingsFromSphere(int crossings, PathIterator3afp<? extends PathElement3afp> iterator, double cx, double cy, double cz, double radius, CrossingComputationType type)Calculates the number of times the given path crosses the given circle extending to the right.- Parameters:
crossings- is the initial value for crossing.iterator- is the description of the path.cx- is the center of the circle.cy- is the center of the circle.cz- is the center of the circle.radius- is the radius of the circle.type- is the type of special computation to apply. Ifnull, it is equivalent toCrossingComputationType.STANDARD.- Returns:
- the crossing
-
computeCrossingsFromSegment
static int computeCrossingsFromSegment(int crossings, PathIterator3afp<? extends PathElement3afp> iterator, double x1, double y1, double z1, double x2, double y2, double z2, CrossingComputationType type)Calculates the number of times the given path crosses the given segment extending to the right.- Parameters:
crossings- is the initial value for crossing.iterator- is the description of the path.x1- is the first point of the segment.y1- is the first point of the segment.z1- is the first point of the segment.x2- is the first point of the segment.y2- is the first point of the segment.z2- is the first point of the segment.type- is the type of special computation to apply. Ifnull, it is equivalent toCrossingComputationType.STANDARD.- Returns:
- the crossing
-
computeCrossingsFromRect
static int computeCrossingsFromRect(int crossings, PathIterator3afp<? extends PathElement3afp> iterator, double rxmin, double rymin, double rzmin, double rxmax, double rymax, double rzmax, CrossingComputationType type)Accumulate the number of times the path crosses the shadow extending to the right of the rectangle. See the comment for the SHAPE_INTERSECTS constant for more complete details. The return value is the sum of all crossings for both the top and bottom of the shadow for every segment in the path, or the special value SHAPE_INTERSECTS if the path ever enters the interior of the rectangle. The path must start with a SEG_MOVETO, otherwise an exception is thrown. The caller must check r[xy]{min,max} for NaN values.- Parameters:
crossings- is the initial value for crossing.iterator- is the iterator on the path elements.rxmin- is the first corner of the rectangle.rymin- is the first corner of the rectangle.rzmin- is the first corner of the rectangle.rxmax- is the second corner of the rectangle.rymax- is the second corner of the rectangle.rzmax- is the second corner of the rectangle.type- is the type of special computation to apply. Ifnull, it is equivalent toCrossingComputationType.STANDARD.- Returns:
- the crossings.
-
computeDrawableElementBoundingBox
static boolean computeDrawableElementBoundingBox(PathIterator3afp<?> iterator, RectangularPrism3afp<?,?,?,?,?,?> box)
Compute the box that corresponds to the drawable elements of the path.An element is drawable if it is a line, a curve, or a closing path element. The box fits the drawn lines and the drawn curves. The control points of the curves may be outside the output box. For obtaining the bounding box of the path's points, use
computeControlPointBoundingBox(PathIterator3afp, RectangularPrism3afp).- Parameters:
iterator- the iterator on the path elements.box- the box to set.- Returns:
trueif a drawable element was found.- See Also:
computeControlPointBoundingBox(PathIterator3afp, RectangularPrism3afp)
-
computeControlPointBoundingBox
static boolean computeControlPointBoundingBox(PathIterator3afp<?> iterator, RectangularPrism3afp<?,?,?,?,?,?> box)
Compute the box that corresponds to the control points of the path.An element is drawable if it is a line, a curve, or a closing path element. The box fits the drawn lines and the drawn curves. The control points of the curves may be outside the output box. For obtaining the bounding box of the drawn lines and cruves, use
computeDrawableElementBoundingBox(PathIterator3afp, RectangularPrism3afp).- Parameters:
iterator- the iterator on the path elements.box- the box to set.- Returns:
trueif a control point was found.- See Also:
computeDrawableElementBoundingBox(PathIterator3afp, RectangularPrism3afp)
-
computeLength
static double computeLength(PathIterator3afp<?> iterator)
Compute the total squared length of the path.- Parameters:
iterator- the iterator on the path elements.- Returns:
- the squared length of the path.
-
equalsToShape
@Pure default boolean equalsToShape(IT shape)
Description copied from interface:Shape3DReplies this shape is equal to the given shape.- Specified by:
equalsToShapein interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
shape- the shape to compare to.- Returns:
trueif this shape is equal is equal to the given path.
-
add
default void add(Iterator<? extends PathElement3afp> iterator)
Add the elements replied by the iterator into this path.- Parameters:
iterator- the iterator that provides the elements to add in the path.
-
set
default void set(Path3afp<?,?,?,?,?,?> path)
Set the path.- Parameters:
path- the path to copy.
-
moveTo
void moveTo(double x, double y, double z)Adds a point to the path by moving to the specified coordinates specified in double precision.- Parameters:
x- the specified X coordinatey- the specified Y coordinatez- the specified Y coordinate
-
moveTo
default void moveTo(Point3D<?,?> position)
Description copied from interface:Path3DAdds a point to the path by moving to the specified coordinates specified in double precision.- Specified by:
moveToin interfacePath3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
position- the new position.
-
lineTo
void lineTo(double x, double y, double z)Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.- Parameters:
x- the specified X coordinatey- the specified Y coordinatez- the specified Y coordinate
-
lineTo
default void lineTo(Point3D<?,?> to)
Description copied from interface:Path3DAdds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.- Specified by:
lineToin interfacePath3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
to- the end point
-
quadTo
void quadTo(double x1, double y1, double z1, double x2, double y2, double z2)Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2,y2), using the specified point(x1,y1)as a quadratic parametric control point. All coordinates are specified in double precision.- Parameters:
x1- the X coordinate of the quadratic control pointy1- the Y coordinate of the quadratic control pointz1- the Z coordinate of the quadratic control pointx2- the X coordinate of the final end pointy2- the Y coordinate of the final end pointz2- the Y coordinate of the final end point
-
quadTo
default void quadTo(Point3D<?,?> ctrl, Point3D<?,?> to)
Description copied from interface:Path3DAdds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2,y2), using the specified point(x1,y1)as a quadratic parametric control point. All coordinates are specified in double precision.- Specified by:
quadToin interfacePath3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
ctrl- the quadratic control pointto- the final end point
-
curveTo
void curveTo(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3,y3), using the specified points(x1,y1)and(x2,y2)as Bézier control points. All coordinates are specified in double precision.- Parameters:
x1- the X coordinate of the first Bézier control pointy1- the Y coordinate of the first Bézier control pointz1- the Z coordinate of the first Bézier control pointx2- the X coordinate of the second Bézier control pointy2- the Y coordinate of the second Bézier control pointz2- the Z coordinate of the second Bézier control pointx3- the X coordinate of the final end pointy3- the Y coordinate of the final end pointz3- the Z coordinate of the final end point
-
curveTo
default void curveTo(Point3D<?,?> ctrl1, Point3D<?,?> ctrl2, Point3D<?,?> to)
Description copied from interface:Path3DAdds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3,y3), using the specified points(x1,y1)and(x2,y2)as Bézier control points. All coordinates are specified in double precision.- Specified by:
curveToin interfacePath3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
ctrl1- the first Bézier control pointctrl2- the second Bézier control pointto- the final end point
-
getDistanceSquared
@Pure default double getDistanceSquared(Point3D<?,?> point)
Description copied from interface:Shape3DReplies the squared value of the minimal distance from this shape to the given point.- Specified by:
getDistanceSquaredin interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
point- the point.- Returns:
- squared value of the minimal distance between this shape and the point.
-
getDistanceL1
@Pure default double getDistanceL1(Point3D<?,?> point)
Description copied from interface:Shape3DComputes the L-1 (Manhattan) distance between this shape and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).- Specified by:
getDistanceL1in interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
point- the point- Returns:
- the distance.
-
getDistanceLinf
@Pure default double getDistanceLinf(Point3D<?,?> point)
Description copied from interface:Shape3DComputes the L-infinite distance between this shape and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2), abs(z1-z2)].- Specified by:
getDistanceLinfin interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
point- the point.- Returns:
- the distance.
-
contains
@Pure default boolean contains(double x, double y, double z)Description copied from interface:Shape3afpReplies if the given point is inside this shape.- Specified by:
containsin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
x- x coordinate of the point to test.y- y coordinate of the point to test.z- z coordinate of the point to test.- Returns:
trueif the given point is inside this shape, otherwisefalse.
-
contains
default boolean contains(RectangularPrism3afp<?,?,?,?,?,?> prism)
Description copied from interface:Shape3afpReplies if the given rectangular prism is inside this shape.- Specified by:
containsin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
prism- the rectangular prism.- Returns:
trueif the given rectangle is inside this shape, otherwisefalse.
-
intersects
@Pure default boolean intersects(RectangularPrism3afp<?,?,?,?,?,?> prism)
Description copied from interface:Shape3afpReplies if this shape is intersecting the given Prism.- Specified by:
intersectsin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
prism- the prism- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Sphere3afp<?,?,?,?,?,?> sphere)
Description copied from interface:Shape3afpReplies if this shape is intersecting the given circle.- Specified by:
intersectsin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
sphere- the sphere- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Segment3afp<?,?,?,?,?,?> segment)
Description copied from interface:Shape3afpReplies if this shape is intersecting the given line.- Specified by:
intersectsin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
segment- the segment- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Path3afp<?,?,?,?,?,?> path)
Description copied from interface:Shape3afpReplies if this shape is intersecting the given path.- Specified by:
intersectsin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
path- the path- Returns:
trueif this shape is intersecting the given path;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(PathIterator3afp<?> iterator)
Description copied from interface:Shape3afpReplies if this shape is intersecting the shape representing the given path iterator.- Specified by:
intersectsin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
iterator- the iterator- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(MultiShape3afp<?,?,?,?,?,?,?> multishape)
Description copied from interface:Shape3afpReplies if this shape is intersecting the given multishape.- Specified by:
intersectsin interfaceShape3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
multishape- the multishape- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
getCoordAt
@Pure double getCoordAt(int index)
Replies the coordinate at the given index. The index is in [0;Path3D.size()*2).- Parameters:
index- the index.- Returns:
- the coordinate at the given index.
-
setLastPoint
void setLastPoint(double x, double y, double z)Change the coordinates of the last inserted point.- Parameters:
x- the new x coordinate of the last point.y- the new y coordinate of the last point.z- the new z coordinate of the last point.
-
setLastPoint
default void setLastPoint(Point3D<?,?> point)
Description copied from interface:Path3DChange the coordinates of the last inserted point.- Specified by:
setLastPointin interfacePath3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
point- the point.
-
transform
void transform(Transform3D transform)
Transform the current path. This function changes the current path.- Parameters:
transform- is the affine transformation to apply.- See Also:
Shape3afp.createTransformedShape(org.arakhne.afc.math.geometry.d3.Transform3D)
-
getLength
default double getLength()
Description copied from interface:Path3DReplies the total length of the path.- Specified by:
getLengthin interfacePath3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Returns:
- the length of the path.
-
getLengthSquared
default double getLengthSquared()
Description copied from interface:Path3DReplies the total squared length of the path.- Specified by:
getLengthSquaredin interfacePath3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Returns:
- the length of the path.
-
getPathIterator
@Pure default PathIterator3afp<IE> getPathIterator(Transform3D transform)
Description copied from interface:Shape3DReplies the elements of the paths.- Specified by:
getPathIteratorin interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
transform- is the transformation to apply to the path.- Returns:
- the elements of the path.
-
getPathIterator
@Pure default PathIterator3afp<IE> getPathIterator(double flatness)
Description copied from interface:Path3DReplies an iterator on the path elements.Only
PathElementType.MOVE_TO,PathElementType.LINE_TO, andPathElementType.CLOSEtypes are returned by the iterator.The amount of subdivision of the curved segments is controlled by the flatness parameter, which specifies the maximum distance that any point on the unflattened transformed curve can deviate from the returned flattened path segments. Note that a limit on the accuracy of the flattened path might be silently imposed, causing very small flattening parameters to be treated as larger values. This limit, if there is one, is defined by the particular implementation that is used.
The iterator for this class is not multi-threaded safe.
- Specified by:
getPathIteratorin interfacePath3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
flatness- is the maximum distance that the line segments used to approximate the curved segments are allowed to deviate from any point on the original curve.- Returns:
- an iterator on the path elements.
-
getPathIterator
@Pure default PathIterator3afp<IE> getPathIterator(Transform3D transform, double flatness)
Replies an iterator on the path elements.Only
PathElementType.MOVE_TO,PathElementType.LINE_TO, andPathElementType.CLOSEtypes are returned by the iterator.The amount of subdivision of the curved segments is controlled by the flatness parameter, which specifies the maximum distance that any point on the unflattened transformed curve can deviate from the returned flattened path segments. Note that a limit on the accuracy of the flattened path might be silently imposed, causing very small flattening parameters to be treated as larger values. This limit, if there is one, is defined by the particular implementation that is used.
The iterator for this class is not multi-threaded safe.
- Parameters:
transform- is an optional affine Transform3D to be applied to the coordinates as they are returned in the iteration, ornullif untransformed coordinates are desired.flatness- is the maximum distance that the line segments used to approximate the curved segments are allowed to deviate from any point on the original curve.- Returns:
- an iterator on the path elements.
-
getCurrentX
@Pure double getCurrentX()
Replies the x coordinate of the last point in the path.- Returns:
- the x coordinate of the last point in the path.
-
getCurrentY
@Pure double getCurrentY()
Replies the y coordinate of the last point in the path.- Returns:
- the y coordinate of the last point in the path.
-
getCurrentZ
@Pure double getCurrentZ()
Replies the z coordinate of the last point in the path.- Returns:
- the z coordinate of the last point in the path.
-
getCurrentPoint
@Pure default P getCurrentPoint()
Description copied from interface:Path3DReplies the last point in the path.- Specified by:
getCurrentPointin interfacePath3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Returns:
- the last point.
-
toCollection
default Collection<P> toCollection()
Description copied from interface:Path3DReplies the collection that is contains all the points of the path.- Specified by:
toCollectionin interfacePath3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Returns:
- the point collection.
-
remove
boolean remove(double x, double y, double z)Remove the point with the given coordinates.If the given coordinates do not match exactly a point in the path, nothing is removed.
- Parameters:
x- the x coordinate of the ponit to remove.y- the y coordinate of the ponit to remove.z- the z coordinate of the ponit to remove.- Returns:
trueif the point was removed;falseotherwise.
-
toBoundingBox
default void toBoundingBox(B box)
Description copied from interface:Shape3DReplies the bounds of the shape.- Specified by:
toBoundingBoxin interfaceShape3D<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Path3afp<?,?,IE,P,V,B>,IE extends PathElement3afp,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends RectangularPrism3afp<?,?,IE,P,V,B>>- Parameters:
box- is set with the bounds of the shape.
-
-