Class Sphere3afp.AbstractSpherePathIterator<T extends PathElement3afp>
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d3.afp.Sphere3afp.AbstractSpherePathIterator<T>
-
- Type Parameters:
T- the type of the path elements.
- All Implemented Interfaces:
Cloneable,Iterator<T>,PathIterator3afp<T>,PathIterator3D<T>
- Direct Known Subclasses:
Sphere3afp.SpherePathIterator,Sphere3afp.TransformedCirclePathIterator
- Enclosing interface:
- Sphere3afp<ST extends Shape3afp<?,?,IE,P,V,B>,IT extends Sphere3afp<?,?,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>>
public abstract static class Sphere3afp.AbstractSpherePathIterator<T extends PathElement3afp> extends Object implements PathIterator3afp<T>
Abstract iterator on the path elements of the sphere.Discretization of the sphere with Bezier
For n segments on the sphere, the optimal distance to the control points, in the sense that the middle of the curve lies on the sphere itself, is (4/3)*tan(pi/(2n)).
In the case of a discretization with 4 bezier curves, the distance is is (4/3)*tan(pi/8) = 4*(sqrt(2)-1)/3 = 0.552284749831.

- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Field Summary
Fields Modifier and Type Field Description static double[][]BEZIER_CONTROL_POINTSContains the control points for a set of 4 cubic bezier curves that approximate a sphere of radius 1 centered at (0,0,0).static doubleCTRL_POINT_DISTANCEDistance from a Bezier curve control point on the sphere to the other control point.protected static intNUMBER_ELEMENTS4 segments + close.protected Sphere3afp<?,?,T,?,?,?>sphereThe iterated shape.
-
Constructor Summary
Constructors Constructor Description AbstractSpherePathIterator(Sphere3afp<?,?,T,?,?,?> sphere)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeomFactory3afp<T,?,?,?>getGeomFactory()Replies the factory of geometrical elements.PathWindingRulegetWindingRule()Replies the winding rule for the path.booleanisCurved()Replies the path contains a curve.booleanisMultiParts()Replies the path has multiple parts, i.e. multipleMOVE_TOare inside.booleanisPolygon()Replies the path is composed only by oneMOVE_TO, a sequence ofLINE_TOorQUAD_TOorCURVE_TO, and a singleCLOSEprimitives.booleanisPolyline()Replies the path is composed only by oneMOVE_TO, and a sequence ofLINE_TOprimitives.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.afp.PathIterator3afp
restartIterations
-
-
-
-
Field Detail
-
CTRL_POINT_DISTANCE
public static final double CTRL_POINT_DISTANCE
Distance from a Bezier curve control point on the sphere to the other control point.4/3 tan (PI/(2*n)), where n is the number on points on the sphere.
- See Also:
- Constant Field Values
-
BEZIER_CONTROL_POINTS
public static final double[][] BEZIER_CONTROL_POINTS
Contains the control points for a set of 4 cubic bezier curves that approximate a sphere of radius 1 centered at (0,0,0).
-
NUMBER_ELEMENTS
protected static final int NUMBER_ELEMENTS
4 segments + close.- See Also:
- Constant Field Values
-
sphere
protected final Sphere3afp<?,?,T extends PathElement3afp,?,?,?> sphere
The iterated shape.
-
-
Constructor Detail
-
AbstractSpherePathIterator
public AbstractSpherePathIterator(Sphere3afp<?,?,T,?,?,?> sphere)
Constructor.- Parameters:
sphere- the sphere.
-
-
Method Detail
-
getGeomFactory
public GeomFactory3afp<T,?,?,?> getGeomFactory()
Description copied from interface:PathIterator3afpReplies the factory of geometrical elements.- Specified by:
getGeomFactoryin interfacePathIterator3afp<T extends PathElement3afp>- Returns:
- the factory.
-
getWindingRule
@Pure public PathWindingRule getWindingRule()
Description copied from interface:PathIterator3DReplies the winding rule for the path.- Specified by:
getWindingRulein interfacePathIterator3D<T extends PathElement3afp>- Returns:
- the winding rule for the path.
-
isPolyline
@Pure public boolean isPolyline()
Description copied from interface:PathIterator3DReplies the path is composed only by oneMOVE_TO, and a sequence ofLINE_TOprimitives.- Specified by:
isPolylinein interfacePathIterator3D<T extends PathElement3afp>- Returns:
trueif the path does not contain curve primitives,falseotherwise.
-
isCurved
public boolean isCurved()
Description copied from interface:PathIterator3DReplies the path contains a curve.- Specified by:
isCurvedin interfacePathIterator3D<T extends PathElement3afp>- Returns:
trueif the path contains curve primitives,falseotherwise.
-
isPolygon
public boolean isPolygon()
Description copied from interface:PathIterator3DReplies the path is composed only by oneMOVE_TO, a sequence ofLINE_TOorQUAD_TOorCURVE_TO, and a singleCLOSEprimitives.- Specified by:
isPolygonin interfacePathIterator3D<T extends PathElement3afp>- Returns:
trueif the path does not contain curve primitives,falseotherwise.
-
isMultiParts
@Pure public boolean isMultiParts()
Description copied from interface:PathIterator3DReplies the path has multiple parts, i.e. multipleMOVE_TOare inside. primitives.- Specified by:
isMultiPartsin interfacePathIterator3D<T extends PathElement3afp>- Returns:
trueif the path has multiple move-to primitive,falseotherwise.
-
-