Class Path3DInfo.SegmentData

java.lang.Object
org.bzdev.geom.Path3DInfo.SegmentData
Enclosing class:
Path3DInfo

public static final class Path3DInfo.SegmentData extends Object
Class to store values used in computations on a segment of a path.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SegmentData(int st, double x0, double y0, double z0, double[] coords, Path3DInfo.SegmentData last)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Compute the curvature at a point with a given path parameter If the path segment's type of SEG_CLOSE and the starting and ending points of the segment are identical, the curvature at the end of the previous segment is returned.
    boolean
    Determine if the curvature exists for the specified argument.
    double
    Compute the second derivative with respect to the path parameter of the signed distance along the path from its initial point
    double
    Compute the second derivative with respect to the path parameter of the x coordinate of a point on the path.
    double
    Compute the second derivative with respect to the path parameter of the y coordinate of a point on the path.
    double
    Compute the second derivative with respect to the path parameter of the z coordinate of a point on the path.
    double
    Compute the third derivative with respect to the path parameter of the x coordinate of a point on the path.
    double
    Compute the third derivative with respect to the path parameter of the y coordinate of a point on the path.
    double
    Compute the third derivative with respect to the path parameter of the z coordinate of a point on the path.
    double
    Compute the derivative with respect to the path parameter of the signed distance along the path from its initial point
    double
    Compute the derivative with respect to the path parameter of the x coordinate of a point on the path.
    double
    Compute the derivative with respect to the path parameter of the y coordinate of a point on the path.
    double
    Compute the derivative with respect to the path parameter of the z coordinate of a point on the path.
    boolean
    getBinormal(Path3DInfo.UValues uv, double[] array, int offset)
    Get the binormal vector for a given value of the path parameter and an offset for the array storing the normal vector.
    boolean
    getNormal(Path3DInfo.UValues uv, double[] array, int offset)
    Get the normal vector for a given value of the path parameter and an offset for the array storing the normal vector.
    boolean
    getTangent(Path3DInfo.UValues uv, double[] array, int offset)
    Get the tangent vector for a specified value of the path parameter and an output-array offset.
    double
    Compute the x coordinate of a point on the path.
    double
    Compute the x coordinate of a point on the path.
    double
    Compute the x coordinate of a point on the path.
    double
    Compute the torsion at a point with a given path parameter If the path segment's type of SEG_CLOSE and the starting and ending points of the segment are identical, the torsion at the end of the previous segment is returned.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getX

      public double getX(Path3DInfo.UValues uv)
      Compute the x coordinate of a point on the path.
      Parameters:
      uv - the path parameter
      Returns:
      the x coordinate
    • getY

      public double getY(Path3DInfo.UValues uv)
      Compute the x coordinate of a point on the path.
      Parameters:
      uv - the path parameter
      Returns:
      the y coordinate
    • getZ

      public double getZ(Path3DInfo.UValues uv)
      Compute the x coordinate of a point on the path.
      Parameters:
      uv - the path parameter
      Returns:
      the y coordinate
    • dxDu

      public double dxDu(Path3DInfo.UValues uv)
      Compute the derivative with respect to the path parameter of the x coordinate of a point on the path.
      Parameters:
      uv - the path parameter
      Returns:
      the derivative of the x coordinate with respect to the path parameter
    • dyDu

      public double dyDu(Path3DInfo.UValues uv)
      Compute the derivative with respect to the path parameter of the y coordinate of a point on the path.
      Parameters:
      uv - the path parameter
      Returns:
      the derivative of the y coordinate with respect to the path parameter
    • dzDu

      public double dzDu(Path3DInfo.UValues uv)
      Compute the derivative with respect to the path parameter of the z coordinate of a point on the path.
      Parameters:
      uv - the path parameter
      Returns:
      the derivative of the y coordinate with respect to the path parameter
    • d2xDu2

      public double d2xDu2(Path3DInfo.UValues uv)
      Compute the second derivative with respect to the path parameter of the x coordinate of a point on the path.
      Parameters:
      uv - the path parameter
      Returns:
      the second derivative of the x coordinate with respect to the path parameter
    • d2yDu2

      public double d2yDu2(Path3DInfo.UValues uv)
      Compute the second derivative with respect to the path parameter of the y coordinate of a point on the path.
      Parameters:
      uv - the path parameter
      Returns:
      the second derivative of the y coordinate with respect to the path parameter
    • d2zDu2

      public double d2zDu2(Path3DInfo.UValues uv)
      Compute the second derivative with respect to the path parameter of the z coordinate of a point on the path.
      Parameters:
      uv - the path parameter
      Returns:
      the second derivative of the y coordinate with respect to the path parameter
    • d3xDu3

      public double d3xDu3(Path3DInfo.UValues uv)
      Compute the third derivative with respect to the path parameter of the x coordinate of a point on the path.

      Note: the value is 0.0 except for cubic segments, where the value is a constant.

      Parameters:
      uv - the path parameter
      Returns:
      the third derivative of the x coordinate with respect to the path parameter
    • d3yDu3

      public double d3yDu3(Path3DInfo.UValues uv)
      Compute the third derivative with respect to the path parameter of the y coordinate of a point on the path.

      Note: the value is 0.0 except for cubic segments, where the value is a constant.

      Parameters:
      uv - the path parameter
      Returns:
      the third derivative of the y coordinate with respect to the path parameter
    • d3zDu3

      public double d3zDu3(Path3DInfo.UValues uv)
      Compute the third derivative with respect to the path parameter of the z coordinate of a point on the path.

      Note: the value is 0.0 except for cubic segments, where the value is a constant.

      Parameters:
      uv - the path parameter
      Returns:
      the third derivative of the y coordinate with respect to the path parameter
    • dsDu

      public double dsDu(Path3DInfo.UValues uv)
      Compute the derivative with respect to the path parameter of the signed distance along the path from its initial point
      Parameters:
      uv - the path parameter
      Returns:
      the derivative of the signed distance along the path with respect to the path parameter
    • d2sDu2

      public double d2sDu2(Path3DInfo.UValues uv)
      Compute the second derivative with respect to the path parameter of the signed distance along the path from its initial point
      Parameters:
      uv - the path parameter
      Returns:
      the second derivative of the signed distance along the path with respect to the path parameter
    • curvature

      public double curvature(Path3DInfo.UValues uv)
      Compute the curvature at a point with a given path parameter If the path segment's type of SEG_CLOSE and the starting and ending points of the segment are identical, the curvature at the end of the previous segment is returned.
      Parameters:
      uv - the path parameter
      Returns:
      the curvature
    • torsion

      public double torsion(Path3DInfo.UValues uv)
      Compute the torsion at a point with a given path parameter If the path segment's type of SEG_CLOSE and the starting and ending points of the segment are identical, the torsion at the end of the previous segment is returned.
      Parameters:
      uv - the path parameter
      Returns:
      the torsion
    • curvatureExists

      public boolean curvatureExists(Path3DInfo.UValues uv)
      Determine if the curvature exists for the specified argument. In general, the curvature does not exist when all the points along a segment are the same point or when the segment is a SEG_MOVETO segment (which just indicates the start of a curve). For a SEG_CLOSE segment where the starting and ending points are identical, the curvature exists if the curvature of the previous segment exists at its end (u = 1.0).
      Parameters:
      uv - the path parameter
      Returns:
      true if the curvature exists; false otherwise
    • getTangent

      public boolean getTangent(Path3DInfo.UValues uv, double[] array, int offset)
      Get the tangent vector for a specified value of the path parameter and an output-array offset. If the tangent vector does not exist (e.g., the length of the line does not vary with the path parameter), the tangent vector will be set to zero. The tangent vector will have unit length if it is not zero.
      Parameters:
      uv - the path parameter
      array - an array of length no less than 3 used to store the tangent vector, with array[offset] containing the tangent vector's X component, array[offset+1] containing the tangent vector's Y component, and array[offset+2] containing the tangent vector's Z component
      offset - the index into the array at which to store the tangent vector
      Returns:
      true if the tangent vector exists; false if the tangent vector does not exist
    • getNormal

      public boolean getNormal(Path3DInfo.UValues uv, double[] array, int offset)
      Get the normal vector for a given value of the path parameter and an offset for the array storing the normal vector. The normal vector N is a vector of unit length, perpendicular to the tangent vector, and oriented so that d2r/ds2 = κN where κ is the curvature. If the normal vector does not exist (e.g., the length of the line does not vary with the path parameter), the normal vector will not be changed.
      Parameters:
      uv - the path parameter
      array - an array of length no less than 3 used to store the normal vector, with array[offset] containing the normal vector's X component, array[offset+1] containing the normal vector's Y component, and array[offset+2] containing the normal vector's Z component
      offset - the index into the array at which to store the normal vector
      Returns:
      true if the normal vector exists; false if the normal vector does not exist
    • getBinormal

      public boolean getBinormal(Path3DInfo.UValues uv, double[] array, int offset)
      Get the binormal vector for a given value of the path parameter and an offset for the array storing the normal vector. The binormal vector is defined as the cross product T × N of the tangent and normal vectors. If the binormal vector does not exist (e.g., the length of the line does not vary with the path parameter or the path is locally straight), the binormal vector will be set to zero.
      Parameters:
      uv - the path parameter
      array - an array of length no less than 3 used to store the normal vector, with array[offset] containing the normal vector's X component, array[offset+1] containing the normal vector's Y component, and array[offset+2] containing the normal vector's Z component
      offset - the index into the array at which to store the normal vector
      Returns:
      true if the binormal vector exists; false if the normal vector does not exist