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.Boundary
boundary()
Get theBoundary
of this intersectible.java.util.List<Intersection>
intersect(LineSegment line)
Calculates all the intersections between a givenLineSegment
and this object.NormalizedVector
normal(Point p)
This function returns the normal to the tube at the given point.Methods inherited from class geometries.Geometry
intersection
Methods 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:
normal
in classGeometry
- Parameters:
p
- ThePoint
to get the normal at.- Returns:
- The normalized normal
NonZeroVector
- Throws:
ZeroVectorException
- if the p is equal to the source @Point
of theTube
.
-
intersect
Description copied from interface:Intersectible
Calculates all the intersections between a givenLineSegment
and this object.- Parameters:
line
- TheLineSegment
to check for intersections.- Returns:
- A list of all the intersections with the given
LineSegment
.
-
boundary
public geometries.Boundary boundary()Description copied from interface:Intersectible
Get theBoundary
of this intersectible.- Returns:
- The bounding box of this intersectible.
-