Class Cylindrical3D

java.lang.Object
org.jlab.geom.prim.Cylindrical3D
All Implemented Interfaces:
Face3D, Transformable, Showable

public final class Cylindrical3D extends Object implements Face3D
A horizontal cylindrical segment represented by an arc and a height. Cylindrical segments are portions of a cylinder (constant radius from some line) with finite height that are bounded by an arc.
Author:
jnhankins
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Constructs a new Cylindrical3D such that the arc of the surface is centered around the z axis, the radius is one, the arc begins at x=1 y=0 and ends at x=0, y=1, and the arc has unit height such that it extends from z=0 to z=1.
    Cylindrical3D(Arc3D arc, double height)
    Constructs a new Cylindrical3D from the given arc and height.
    Cylindrical3D(Cylindrical3D cylindricalSeg)
    Constructs a new Cylindrical3D that is identical to the given cylindrical segment.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    Returns the base of this cylindrical segment.
    void
    copy(Cylindrical3D cylindricalSeg)
    Sets the core parameters of this cylindrical segment such that this surface becomes identical to the given surface.
    double
    Distance between the point and the closest cylinder edge
    returns the axis of this cylinder.
    double
    Returns the height of this cylindrical segment.
    Constructs the arc at the top of this cylindrical segment.
    int
    intersection(Line3D line, List<Point3D> intersections)
    Finds the intersections of the given infinite line with this Face3D.
    double
    intersectionLength(Line3D line, List<Point3D> intersections)
    Compute the intersections of a ray within the 3D volume
    int
    intersectionRay(Line3D line, List<Point3D> intersections)
    Finds the intersections of the given ray with this Face3D.
    int
    intersectionSegment(Line3D line, List<Point3D> intersections)
    Finds the intersections of the given line segment with this Face3D.
    boolean
    Returns true if the given point is on the surface of this cylindrical segment.
    point(int index)
    Returns the point from this Face3D with corresponding index.
    void
    rotateX(double angle)
    Rotates this object clockwise around the x axis.
    void
    rotateY(double angle)
    Rotates this object clockwise around the y axis.
    void
    rotateZ(double angle)
    Rotates this object clockwise around the z axis.
    void
    set(Arc3D arc, double height)
    Sets the parameters of this cylindrical segment to equal the given parameters.
    void
    Sets the base of this cylindrical segment.
    void
    Sets the axis of this cylinder.
    void
    setHeight(double height)
    Sets the height of this cylindrical segment.
    void
    Invokes System.out.println(this).
     
    void
    translateXYZ(double dx, double dy, double dz)
    Translates this object linearly by the amounts specified.

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details Link icon

    • Cylindrical3D Link icon

      public Cylindrical3D()
      Constructs a new Cylindrical3D such that the arc of the surface is centered around the z axis, the radius is one, the arc begins at x=1 y=0 and ends at x=0, y=1, and the arc has unit height such that it extends from z=0 to z=1.
    • Cylindrical3D Link icon

      public Cylindrical3D(Arc3D arc, double height)
      Constructs a new Cylindrical3D from the given arc and height.
      Parameters:
      arc - the base of the cylindrical segment
      height - the height
    • Cylindrical3D Link icon

      public Cylindrical3D(Cylindrical3D cylindricalSeg)
      Constructs a new Cylindrical3D that is identical to the given cylindrical segment.
      Parameters:
      cylindricalSeg - the cylindrical segment to copy
  • Method Details Link icon

    • copy Link icon

      public void copy(Cylindrical3D cylindricalSeg)
      Sets the core parameters of this cylindrical segment such that this surface becomes identical to the given surface.
      Parameters:
      cylindricalSeg - the cylindrical segment to copy
    • set Link icon

      public void set(Arc3D arc, double height)
      Sets the parameters of this cylindrical segment to equal the given parameters.
      Parameters:
      arc - the base of the cylindrical segment
      height - the height
    • setArc Link icon

      public void setArc(Arc3D arc)
      Sets the base of this cylindrical segment.
      Parameters:
      arc - the base of the cylindrical segment
    • setAxis Link icon

      public void setAxis(Line3D axis)
      Sets the axis of this cylinder.
      Parameters:
      axis - the base of the cylindrical segment
    • getAxis Link icon

      public Line3D getAxis()
      returns the axis of this cylinder.
      Returns:
      the axis of the cylindrical segment
    • setHeight Link icon

      public void setHeight(double height)
      Sets the height of this cylindrical segment.
      Parameters:
      height - the height
    • baseArc Link icon

      public Arc3D baseArc()
      Returns the base of this cylindrical segment.
      Returns:
      the base of this cylindrical segment
    • highArc Link icon

      public Arc3D highArc()
      Constructs the arc at the top of this cylindrical segment.
      Returns:
      the arc at the top of this cylindrical segment
    • height Link icon

      public double height()
      Returns the height of this cylindrical segment.
      Returns:
      the height of this cylindrical segment.
    • intersection Link icon

      public int intersection(Line3D line, List<Point3D> intersections)
      Description copied from interface: Face3D
      Finds the intersections of the given infinite line with this Face3D. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.
      Specified by:
      intersection in interface Face3D
      Parameters:
      line - the infinite line
      intersections - the list to store the intersections in
      Returns:
      the number of intersections found
    • intersectionRay Link icon

      public int intersectionRay(Line3D line, List<Point3D> intersections)
      Description copied from interface: Face3D
      Finds the intersections of the given ray with this Face3D. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.
      Specified by:
      intersectionRay in interface Face3D
      Parameters:
      line - the ray
      intersections - the list to store the intersections in
      Returns:
      the number of intersections found
    • intersectionSegment Link icon

      public int intersectionSegment(Line3D line, List<Point3D> intersections)
      Description copied from interface: Face3D
      Finds the intersections of the given line segment with this Face3D. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.
      Specified by:
      intersectionSegment in interface Face3D
      Parameters:
      line - the line segment
      intersections - the list to store the intersections in
      Returns:
      the number of intersections found
    • intersectionLength Link icon

      public double intersectionLength(Line3D line, List<Point3D> intersections)
      Compute the intersections of a ray within the 3D volume
      Parameters:
      line -
      intersections -
      Returns:
      ray path length within the volume
    • isOnSurface Link icon

      public boolean isOnSurface(Point3D point)
      Returns true if the given point is on the surface of this cylindrical segment.
      Parameters:
      point - the point
      Returns:
      true if the point is on the surface
    • distanceToEdge Link icon

      public double distanceToEdge(Point3D point)
      Distance between the point and the closest cylinder edge
      Parameters:
      point - the point
      Returns:
      distance if point is on the surface, 0 otherwise
    • translateXYZ Link icon

      public void translateXYZ(double dx, double dy, double dz)
      Description copied from interface: Transformable
      Translates this object linearly by the amounts specified.
      Specified by:
      translateXYZ in interface Transformable
      Parameters:
      dx - amount to translate along the x axis
      dy - amount to translate along the y axis
      dz - amount to translate along the z axis
    • rotateX Link icon

      public void rotateX(double angle)
      Description copied from interface: Transformable
      Rotates this object clockwise around the x axis.
      Specified by:
      rotateX in interface Transformable
      Parameters:
      angle - rotation angle in radians
    • rotateY Link icon

      public void rotateY(double angle)
      Description copied from interface: Transformable
      Rotates this object clockwise around the y axis.
      Specified by:
      rotateY in interface Transformable
      Parameters:
      angle - rotation angle in radians
    • rotateZ Link icon

      public void rotateZ(double angle)
      Description copied from interface: Transformable
      Rotates this object clockwise around the z axis.
      Specified by:
      rotateZ in interface Transformable
      Parameters:
      angle - rotation angle in radians
    • show Link icon

      public void show()
      Invokes System.out.println(this).
      Specified by:
      show in interface Showable
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • point Link icon

      public Point3D point(int index)
      Description copied from interface: Face3D
      Returns the point from this Face3D with corresponding index. If an invalid index is given, then null is returned.
      Specified by:
      point in interface Face3D
      Parameters:
      index - index of the point
      Returns:
      the point at the corresponding index, otherwise null