java.lang.Object
org.bzdev.geom.Path3D
org.bzdev.geom.Path3D.Float
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- Path3D
Class extending
Path3D
by storing coordinate data as
single-precision numbers.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bzdev.geom.Path3D
Path3D.Double, Path3D.Float
-
Constructor Summary
ConstructorsConstructorDescriptionFloat()
Constructor.Float
(int initialCapacity) Constructor giving an estimate of the number of path segments.Float
(int initialCapacity, Path2D path, Point3DMapper<Point3D> mapper, int mapperIndex) Constructor given a 2D path and an initial capacity.Float
(int initialCapacity, Path2D path, Transform3D tform) Constructor given a 2D path, a 3D transform, and an initial capacity.Float
(Path2D path, Point3DMapper<Point3D> mapper) Constructor given a 2D path and a mapper.Float
(Path2D path, Point3DMapper<Point3D> mapper, int mapperIndex) Constructor given a 2D path.Float
(Path2D path, Transform3D tform) Constructor given a 2D path and a 3D transform.Constructor using another path to determine the initial path segments.Float
(Path3D path, Transform3D transform) Constructor using another path to determine the initial path segments, modified with a 3D transform. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
append
(PathIterator3D pi, boolean connect) Append the path segments specified by a path iterator.clone()
final Path3D
createTransformedPath
(Transform3D transform) Create a new path by applying a transform to this path.final void
curveTo
(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3) Add a segment specified by a cubic Bézier curve.getEnd()
/** Get the last point on a path.final PathIterator3D
getPathIterator
(Transform3D tform) Get a path iterator for this path.getStart()
Get the starting point of a path.final void
lineTo
(double x, double y, double z) Add a straight-line segment starting from the current point.void
moveTo
(double x, double y, double z) Move the current point to a new location or to an initial location.final void
quadTo
(double x1, double y1, double z1, double x2, double y2, double z2) Add a segment specified by a quadratic Bézier curve.final void
transform
(Transform3D tform) Apply a transform to a path.Methods inherited from class org.bzdev.geom.Path3D
append, closePath, getBounds, getCurrentPoint, isEmpty, reset, setupCubic, setupCubic, setupCubic, setupCubic
-
Constructor Details
-
Float
public Float()Constructor. -
Float
public Float(int initialCapacity) Constructor giving an estimate of the number of path segments.- Parameters:
initialCapacity
- the initial number of path segments allocated in an expandable table
-
Float
Constructor using another path to determine the initial path segments.- Parameters:
path
- the path whose segments will be copied
-
Float
Constructor using another path to determine the initial path segments, modified with a 3D transform.- Parameters:
path
- the path whose segments will be copiedtransform
- the transform to apply to the path segments
-
Float
Constructor given a 2D path and a mapper. An instance of Point3DMapper is used to map the 2D path's control points to the corresponding control points of the 3D path.The mapper is passed a default mapper index of 0, so this constructor will typically be used when that index is ignored, e.g., when the mapper is used to create a single path.
- Parameters:
path
- the 2D pathmapper
- the object that converts a 2D point to a 3D point- See Also:
-
Float
Constructor given a 2D path. An instance of Point3DMapper is used to map the 2D path's control points to the corresponding control points of the 3D path.When a mapper is used to create a single path, the mapper index will typically be ignored, and the constructor
Float(Path2D,Point3DMapper)
will result in more easily read code.- Parameters:
path
- the 2D pathmapper
- the object that converts a 2D point to a 3D pointmapperIndex
- an index used to select a mapping- See Also:
-
Float
Constructor given a 2D path and a 3D transform. Each control point of the 2D path is converted to a 3D point by using the same X and Y values and setting the Z value to 0 and this new point is then transformed.- Parameters:
path
- the 2D pathtform
- the transform to apply to each control point
-
Float
Constructor given a 2D path, a 3D transform, and an initial capacity. Each control point of the 2D path is converted to a 3D point by using the same X and Y values and setting the Z value to 0 and this new point is then transformed.- Parameters:
initialCapacity
- the number of control points that can be stored before tables are automatically expandedpath
- the 2D pathtform
- the transform to apply to each control point
-
Float
Constructor given a 2D path and an initial capacity. An instance of Point3DMapper is used to map the 2D path's control points to the corresponding control points of the 3D path.When a mapper is used to create a single path, the mapper index will typically be ignored, and the constructor
Double(Path2D,Point3DMapper)
will result in more easily read code. A mapper index is used implicitly by the constructorBezierGrid(Path2D,Point3DMapper,int,boolean)
, which can be used to create surfaces of revolution.- Parameters:
initialCapacity
- the initial number of path segments allocated in an expandable tablepath
- the 2D pathmapper
- the object that converts a 2D point to a 3D pointmapperIndex
- an index used to select a mapping- See Also:
-
-
Method Details
-
append
Description copied from class:Path3D
Append the path segments specified by a path iterator. -
clone
-
createTransformedPath
Description copied from class:Path3D
Create a new path by applying a transform to this path.- Specified by:
createTransformedPath
in classPath3D
- Parameters:
transform
- the transform- Returns:
- the new path
-
curveTo
public final void curveTo(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3) Description copied from class:Path3D
Add a segment specified by a cubic Bézier curve.- Specified by:
curveTo
in classPath3D
- Parameters:
x1
- the X coordinate of the first control pointy1
- the Y coordinate of the first control pointz1
- the Z coordinate of the first control pointx2
- the X coordinate of the second control pointy2
- the Y coordinate of the second control pointz2
- the Z coordinate of the second control pointx3
- the X coordinate of the final point of the segmenty3
- the Y coordinate of the final point of the segmentz3
- the Z coordinate of the final point of the segment
-
getPathIterator
Description copied from class:Path3D
Get a path iterator for this path. The iterator will ignore new segments added after the call to this method, butPath3D.reset()
should not be called while this path iterator is in use.- Specified by:
getPathIterator
in classPath3D
- Parameters:
tform
- the transform to apply to control points; null if there is none- Returns:
- a path iterator for this path
-
lineTo
public final void lineTo(double x, double y, double z) Description copied from class:Path3D
Add a straight-line segment starting from the current point. -
moveTo
public void moveTo(double x, double y, double z) Description copied from class:Path3D
Move the current point to a new location or to an initial location. -
quadTo
public final void quadTo(double x1, double y1, double z1, double x2, double y2, double z2) Description copied from class:Path3D
Add a segment specified by a quadratic Bézier curve.- Specified by:
quadTo
in classPath3D
- Parameters:
x1
- the X coordinate of the control pointy1
- the Y coordinate of the control pointz1
- the Z coordinate of the control pointx2
- the X coordinate of the end point of the segmenty2
- the Y coordinate of the end point of the segmentz2
- the Z coordinate of the end point of the segment
-
transform
Description copied from class:Path3D
Apply a transform to a path. The transform will be applied to each segment's control points. -
getStart
Description copied from class:Path3D
Get the starting point of a path. -
getEnd
Description copied from class:Path3D
/** Get the last point on a path.
-