Package geometries
Class Tube
java.lang.Object
geometries.Geometry
geometries.Tube
- All Implemented Interfaces:
Intersectible
public class Tube extends Geometry
A Tube is a 3D tube object that goes on to infinity.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description geometries.Boundaryboundary()Get theBoundaryof this intersectible.java.util.List<Intersection>intersect(LineSegment line)Calculates all the intersections between a givenLineSegmentand this object.NormalizedVectornormal(Point p)This function returns the normal to the tube at the given point.Methods inherited from class geometries.Geometry
intersectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Method Details
-
normal
This function returns the normal to the tube at the given point. If the point doesn't lie on the surface of the tube, the behavior is undefined.- Specified by:
normalin classGeometry- Parameters:
p- ThePointto get the normal at.- Returns:
- The normalized normal
NonZeroVector - Throws:
ZeroVectorException- if the p is equal to the source @Pointof theTube.
-
intersect
Description copied from interface:IntersectibleCalculates all the intersections between a givenLineSegmentand this object.- Parameters:
line- TheLineSegmentto check for intersections.- Returns:
- A list of all the intersections with the given
LineSegment.
-
boundary
public geometries.Boundary boundary()Description copied from interface:IntersectibleGet theBoundaryof this intersectible.- Returns:
- The bounding box of this intersectible.
-