Class Paths3D

java.lang.Object
org.bzdev.geom.Paths3D

public class Paths3D extends Object
Utility class to create various 3D paths. This class consists of static methods, and is analogous to the class Paths2D but for 3D paths instead of 2D paths. It also includes methods for creating unit vectors.

The operations include creating arcs and reversing existing paths.

  • Method Summary

    Modifier and Type
    Method
    Description
    static Path3D
    createArc(double startx, double starty, double startz, double[] tangent, double[] normal, double radius, double theta)
    Create a 3D arc.
    static Path3D
    createArc(double startx, double starty, double startz, double[] tangent, double[] normal, double radius, double theta, double maxDelta)
    /** Create a 3D arc, specifying a maximum angular extent for each path segment.
    static Path3D
    Reverse a path.

    Methods inherited from class java.lang.Object

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

    • createArc

      public static Path3D createArc(double startx, double starty, double startz, double[] tangent, double[] normal, double radius, double theta)
      Create a 3D arc. The normal vector must be perpendicular to the tangent vector and must point towards the center of the circle that contains the arc.
      Parameters:
      startx - the starting X coordinate
      starty - the starting Y coordinate
      startz - the starting Z coordinate
      tangent - the tangent vector at the start of the arc
      normal - the normal vector at the start of the arc
      radius - the radius of the arc
      theta - the angular extent of the arc in radians
      Returns:
      the new arc
    • createArc

      public static Path3D createArc(double startx, double starty, double startz, double[] tangent, double[] normal, double radius, double theta, double maxDelta)
      /** Create a 3D arc, specifying a maximum angular extent for each path segment. The normal vector must be perpendicular to the tangent vector and must point towards the center of the circle that contains the arc.
      Parameters:
      startx - the starting X coordinate
      starty - the starting Y coordinate
      startz - the starting Z coordinate
      tangent - the tangent vector at the start of the arc
      normal - the normal vector at the start of the arc
      radius - the radius of the arc
      theta - the angular extent of the arc in radians
      maxDelta - the maximum angular extent of an arc segment with allowed values in the range (0, 2π/3]
      Returns:
      the new arc
    • reverse

      public static Path3D reverse(Path3D path) throws IllegalArgumentException
      Reverse a path. For a path to be reversible, each PathIterator3D.SEG_CLOSE segment that does not end a path must be followed by a PathIterator3D.SEG_MOVETO segment.

      Reversing a path can be useful when a path is an outer boundary of one surface and an inner boundary of another.

      Parameters:
      path - the path to reverse
      Returns:
      the reversed path
      Throws:
      IllegalArgumentException - the path cannot be reversed