Class PrismaticComponent

java.lang.Object
org.jlab.geom.abs.AbstractComponent
org.jlab.geom.component.PrismaticComponent
All Implemented Interfaces:
Component, Transformable, Showable
Direct Known Subclasses:
DriftChamberWire, RectangularComponent

public abstract class PrismaticComponent extends AbstractComponent
This class provides a basic implementation of the Component interface where the component's volume is defined by two convex polygons such that the edges of each polygon are connected to form trapezoidal sides.

These volumes are similar to geometric-prisms except that the two polygons do not need to be congruent and do not need to be related by a simple translation. Instead the two base polygons may be incongruent and have arbitrary positions and orientations relative to one another. The only requirement is that the two polygons have the same number of points and must be convex. As a result, the side faces of the volume may be trapezoids rather than parallelograms. Another way to describe these volumes is as generalized polygonal-frustums where the two cutting planes need non be parallel. To my knowledge, there is no simple word for such a shape.

In this documentation, the words "polygon", "base", and "face" are used interchangeably.

In addition to fulfilling most of the requirements for the Component interface, PrismaticComponent provides additional geometry data via getDirection() and getLine(). The direction is a Vector3D pointing from the component's midpoint towards the readout end of the component (eg towards the PMT of a scintillator). The line is a Line3D running down the middle of the length of the component from the geometric center of the first base to the geometric center of the second base.

For more information see Component.

Developer's Note: This class could be further abstracted such that points in two arbitrary similar-shapes defined by points could be connected to form a volume. This abstracted class could then be subtyped into classes to handle convex polygonal prisms, concave polygonal prisms, and handle cylindrical segment volumes (volumes with two sectors as bases).

Author:
jnhankins
  • Constructor Summary Link icon

    Constructors
    Modifier
    Constructor
    Description
    protected
    PrismaticComponent(int componentId, List<Point3D> firstFace, List<Point3D> secondFace)
    Initializes a PrismaticComponent from the two given polygonal faces with the given component id.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    Returns a vector pointing from the midpoint of this component towards the readout end of the component (eg towards the PMT of a scintillator).
    double
    Returns the length of this component.
    Returns a line running down the middle of the length of the component such that the two end points of the line segment are at the geometric centers of the the two polygons defining this component's volume.
    boolean
    getVolumeIntersection(Line3D line, Point3D inIntersect, Point3D outIntersect)
    Returns true if the given line segment intersect the volume-shape twice (one incoming intersection and one out going) and stores the incoming and outgoing intersection points are stored in the first and second Point3D objects given as arguments respectively.
    protected void
    onRotateX(double angle)
    Classes extending AbstractComponent should implement onRotateX so that any additional geometric data they contain is rotated appropriately when AbstractComponent's rotateX method is invoke.
    protected void
    onRotateY(double angle)
    Classes extending AbstractComponent should implement onRotateY so that any additional geometric data they contain is rotated appropriately when AbstractComponent's rotateY method is invoke.
    protected void
    onRotateZ(double angle)
    Classes extending AbstractComponent should implement onRotateZ so that any additional geometric data they contain is rotated appropriately when AbstractComponent's rotateZ method is invoke.
    protected void
    onTranslateXYZ(double dx, double dy, double dz)
    Classes extending AbstractComponent should implement onTranslateXYZ so that any additional geometric data they contain is translated appropriately when AbstractComponent's translateXYZ method is invoked.

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.jlab.geom.base.Component Link icon

    getType
  • Constructor Details Link icon

    • PrismaticComponent Link icon

      protected PrismaticComponent(int componentId, List<Point3D> firstFace, List<Point3D> secondFace)
      Initializes a PrismaticComponent from the two given polygonal faces with the given component id.
      Parameters:
      componentId - the id of the component
      firstFace - the first polygonal base
      secondFace - the second polygonal base
      Throws:
      IllegalArgumentException - if the number of points in the first and second polygonal bases differ
      IllegalArgumentException - if the points given lists do not form convex polygons
      IllegalArgumentException - if the points in the first polygon are wound counter-clockwise from the perspective of an outside observer
      IllegalArgumentException - if the points in the second polygon are wound clockwise from the perspective of an outside observer
  • Method Details Link icon

    • getDirection Link icon

      public Vector3D getDirection()
      Returns a vector pointing from the midpoint of this component towards the readout end of the component (eg towards the PMT of a scintillator).
      Returns:
      the direction of the readout end
    • getLine Link icon

      public Line3D getLine()
      Returns a line running down the middle of the length of the component such that the two end points of the line segment are at the geometric centers of the the two polygons defining this component's volume. By convention, the origin point of the line lies at the geometric center of the first face and the end point of the line lies at the geometric center of the second face.

      Note that getLength()=getLine().length().

      Returns:
      a line running down the middle of the length the component
      See Also:
    • getLength Link icon

      public double getLength()
      Description copied from interface: Component
      Returns the length of this component.
      Returns:
      the length
    • onTranslateXYZ Link icon

      protected void onTranslateXYZ(double dx, double dy, double dz)
      Description copied from class: AbstractComponent
      Classes extending AbstractComponent should implement onTranslateXYZ so that any additional geometric data they contain is translated appropriately when AbstractComponent's translateXYZ method is invoked. This method is called at the end of AbstractComponent's translateXYZ method.
      Overrides:
      onTranslateXYZ in class AbstractComponent
      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
      See Also:
    • onRotateX Link icon

      protected void onRotateX(double angle)
      Description copied from class: AbstractComponent
      Classes extending AbstractComponent should implement onRotateX so that any additional geometric data they contain is rotated appropriately when AbstractComponent's rotateX method is invoke. This method is called at the end of AbstractComponent's rotateX method.
      Overrides:
      onRotateX in class AbstractComponent
      Parameters:
      angle - rotation angle in radians
      See Also:
    • onRotateY Link icon

      protected void onRotateY(double angle)
      Description copied from class: AbstractComponent
      Classes extending AbstractComponent should implement onRotateY so that any additional geometric data they contain is rotated appropriately when AbstractComponent's rotateY method is invoke. This method is called at the end of AbstractComponent's rotateY method.
      Overrides:
      onRotateY in class AbstractComponent
      Parameters:
      angle - rotation angle in radians
      See Also:
    • onRotateZ Link icon

      protected void onRotateZ(double angle)
      Description copied from class: AbstractComponent
      Classes extending AbstractComponent should implement onRotateZ so that any additional geometric data they contain is rotated appropriately when AbstractComponent's rotateZ method is invoke. This method is called at the end of AbstractComponent's rotateZ method.
      Overrides:
      onRotateZ in class AbstractComponent
      Parameters:
      angle - rotation angle in radians
      See Also:
    • getVolumeIntersection Link icon

      public boolean getVolumeIntersection(Line3D line, Point3D inIntersect, Point3D outIntersect)
      Returns true if the given line segment intersect the volume-shape twice (one incoming intersection and one out going) and stores the incoming and outgoing intersection points are stored in the first and second Point3D objects given as arguments respectively.

      The incoming intersection is defined such that the incoming intersection point is closer to the origin of the line than the outgoing intersection point.

      Developer's Note: For optimization, this algorithm assumes that

      1. the volume contains N*4-4 triangular faces
      2. the faces form a closed bounding volume
      3. neither end point of the line segment are inside the volume
      4. pairs of faces from index 0 through N*2-1 (i.e. 1 and 2, 2 and 3, 3 and 4, etc.) are coplanar (the side trapezoids)
      5. the faces from N*2 through N*3-3 are coplanar (the first base)
      6. the faces from N*3-3 through N*4-5 are coplanar (the second base)
      where N is the number of points in either polygonal base.
      Parameters:
      line - the line segment
      inIntersect - the incoming intersection
      outIntersect - the outgoing intersection
      Returns:
      true if two intersections are found