Class Path3D.Double

java.lang.Object
org.bzdev.geom.Path3D
org.bzdev.geom.Path3D.Double
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
SplinePath3D
Enclosing class:
Path3D

public static class Path3D.Double extends Path3D
Class extending Path3D by storing coordinate data as double-precision numbers.
  • Constructor Details

    • Double

      public Double()
      Constructor.
    • Double

      public Double(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
    • Double

      public Double(Path3D path)
      Constructor using another path to determine the initial path segments.
      Parameters:
      path - the path whose segments will be copied
    • Double

      public Double(Path3D path, Transform3D transform)
      Constructor using another path to determine the initial path segments, modified with a 3D transform.
      Parameters:
      path - the path whose segments will be copied
      transform - the transform to apply to the path segments
    • Double

      public Double(Path2D path, Point3DMapper<Point3D> mapper)
      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 path
      mapper - the object that converts a 2D point to a 3D point
      See Also:
    • Double

      public Double(Path2D path, Point3DMapper<Point3D> mapper, int mapperIndex)
      Constructor given a 2D path, a mapper, and an index. 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 constructor BezierGrid(Path2D,Point3DMapper,int,boolean), which can be used to create surfaces of revolution.

      Parameters:
      path - the 2D path
      mapper - the object that converts a 2D point to a 3D point
      mapperIndex - an index used to select a mapping
      See Also:
    • Double

      public Double(Path2D path, Transform3D tform)
      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 path
      tform - the transform to apply to each control point
    • Double

      public Double(int initialCapacity, Path2D path, Transform3D tform)
      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 initial number of path segments allocated in an expandable table
      path - the 2D path
      tform - the transform to apply to each control point
    • Double

      public Double(int initialCapacity, Path2D path, Point3DMapper<Point3D> mapper, int mapperIndex)
      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 constructor BezierGrid(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 table
      path - the 2D path
      mapper - the object that converts a 2D point to a 3D point
      mapperIndex - an index used to select a mapping
      See Also:
  • Method Details

    • append

      public final void append(PathIterator3D pi, boolean connect)
      Description copied from class: Path3D
      Append the path segments specified by a path iterator.
      Specified by:
      append in class Path3D
      Parameters:
      pi - the path iterator
      connect - true if an initial MOVETO segment obtained from the path iterator should be turned into a LINETO segment
    • clone

      public Object clone()
      Overrides:
      clone in class Path3D
    • createTransformedPath

      public final Path3D createTransformedPath(Transform3D transform)
      Description copied from class: Path3D
      Create a new path by applying a transform to this path.
      Specified by:
      createTransformedPath in class Path3D
      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 class Path3D
      Parameters:
      x1 - the X coordinate of the first control point
      y1 - the Y coordinate of the first control point
      z1 - the Z coordinate of the first control point
      x2 - the X coordinate of the second control point
      y2 - the Y coordinate of the second control point
      z2 - the Z coordinate of the second control point
      x3 - the X coordinate of the final point of the segment
      y3 - the Y coordinate of the final point of the segment
      z3 - the Z coordinate of the final point of the segment
    • getPathIterator

      public final PathIterator3D getPathIterator(Transform3D tform)
      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, but Path3D.reset() should not be called while this path iterator is in use.
      Specified by:
      getPathIterator in class Path3D
      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.
      Specified by:
      lineTo in class Path3D
      Parameters:
      x - the X coordinate of the segment's end point
      y - the Y coordinate of the segment's end point
      z - the Z coordinate of the segment's end point
    • moveTo

      public final 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.
      Specified by:
      moveTo in class Path3D
      Parameters:
      x - the X coordinate of the new current point
      y - the Y coordinate of the new current point
      z - the Z coordinate of the new current point
    • 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 class Path3D
      Parameters:
      x1 - the X coordinate of the control point
      y1 - the Y coordinate of the control point
      z1 - the Z coordinate of the control point
      x2 - the X coordinate of the end point of the segment
      y2 - the Y coordinate of the end point of the segment
      z2 - the Z coordinate of the end point of the segment
    • transform

      public final void transform(Transform3D tform)
      Description copied from class: Path3D
      Apply a transform to a path. The transform will be applied to each segment's control points.
      Specified by:
      transform in class Path3D
      Parameters:
      tform - the transform
    • getStart

      public Point3D getStart()
      Description copied from class: Path3D
      Get the starting point of a path.
      Specified by:
      getStart in class Path3D
      Returns:
      the first point along the path; null if the path is empty
    • getEnd

      public Point3D getEnd()
      Description copied from class: Path3D
      /** Get the last point on a path.
      Specified by:
      getEnd in class Path3D
      Returns:
      the last point; null if the path is empty or closed at its end