java.lang.Object
org.bzdev.geom.Paths3D
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 TypeMethodDescriptionstatic 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.
-
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 coordinatestarty
- the starting Y coordinatestartz
- the starting Z coordinatetangent
- the tangent vector at the start of the arcnormal
- the normal vector at the start of the arcradius
- the radius of the arctheta
- 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 coordinatestarty
- the starting Y coordinatestartz
- the starting Z coordinatetangent
- the tangent vector at the start of the arcnormal
- the normal vector at the start of the arcradius
- the radius of the arctheta
- the angular extent of the arc in radiansmaxDelta
- the maximum angular extent of an arc segment with allowed values in the range (0, 2π/3]- Returns:
- the new arc
-
reverse
Reverse a path. For a path to be reversible, eachPathIterator3D.SEG_CLOSE
segment that does not end a path must be followed by aPathIterator3D.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
-