java.lang.Object
org.bzdev.geom.Path3DInfo.SegmentData
- Enclosing class:
- Path3DInfo
Class to store values used in computations on a segment of
a path.
-
Constructor Summary
ConstructorsConstructorDescriptionSegmentData(int st, double x0, double y0, double z0, double[] coords, Path3DInfo.SegmentData last) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondoubleCompute 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.booleanDetermine if the curvature exists for the specified argument.doubleCompute the second derivative with respect to the path parameter of the signed distance along the path from its initial pointdoubleCompute the second derivative with respect to the path parameter of the x coordinate of a point on the path.doubleCompute the second derivative with respect to the path parameter of the y coordinate of a point on the path.doubleCompute the second derivative with respect to the path parameter of the z coordinate of a point on the path.doubleCompute the third derivative with respect to the path parameter of the x coordinate of a point on the path.doubleCompute the third derivative with respect to the path parameter of the y coordinate of a point on the path.doubleCompute the third derivative with respect to the path parameter of the z coordinate of a point on the path.doubleCompute the derivative with respect to the path parameter of the signed distance along the path from its initial pointdoubleCompute the derivative with respect to the path parameter of the x coordinate of a point on the path.doubleCompute the derivative with respect to the path parameter of the y coordinate of a point on the path.doubleCompute the derivative with respect to the path parameter of the z coordinate of a point on the path.booleangetBinormal(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.booleangetNormal(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.booleangetTangent(Path3DInfo.UValues uv, double[] array, int offset) Get the tangent vector for a specified value of the path parameter and an output-array offset.doubleCompute the x coordinate of a point on the path.doubleCompute the x coordinate of a point on the path.doubleCompute the x coordinate of a point on the path.doubleCompute 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.
-
Constructor Details
-
SegmentData
public SegmentData(int st, double x0, double y0, double z0, double[] coords, Path3DInfo.SegmentData last) throws IllegalArgumentException Constructor.- Parameters:
st- the path-segment type, legal values of which arex0- the initial x coordinate for the segment (ignored for thePathIterator3D.SEG_MOVETOcase)y0- the initial y coordinate for the segment (ignored for thePathIterator3D.SEG_MOVETOcase)z0- the initial y coordinate for the segment (ignored for thePathIterator3D.SEG_MOVETOcase)coords- the coordinates array set by a call toPathIterator3D.currentSegment(double[]), but with the first three elements set to the x, y, and z coordinates respectively for the previousPathIterator3D.SEG_MOVETOsegment when first argument's value isPathIterator3D.SEG_CLOSE. The size of this array should be at least 3 and the maximum size needed is 9.last- the previous SegmentData for a path; null if there is none- Throws:
IllegalArgumentException- a value was out of rangeArrayIndexOutOfBoundsException- the array argument was two smallNullPointerException- the array argument was null- See Also:
-
-
Method Details
-
getX
Compute the x coordinate of a point on the path.- Parameters:
uv- the path parameter- Returns:
- the x coordinate
-
getY
Compute the x coordinate of a point on the path.- Parameters:
uv- the path parameter- Returns:
- the y coordinate
-
getZ
Compute the x coordinate of a point on the path.- Parameters:
uv- the path parameter- Returns:
- the y coordinate
-
dxDu
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 parameterarray- 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 componentoffset- 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
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 parameterarray- 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 componentoffset- 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
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 parameterarray- 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 componentoffset- 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
-