Class Parallelepiped.Builder

java.lang.Object
org.apache.commons.geometry.euclidean.threed.shape.Parallelepiped.Builder
Enclosing class:
Parallelepiped

public static final class Parallelepiped.Builder extends Object
Class designed to aid construction of Parallelepiped instances. Parallelepipeds are constructed by transforming the vertices of a unit cube centered at the origin with a transform built from the values configured here. The transformations applied are scaling, rotation, and translation, in that order. When applied in this order, the scale factors determine the width, height, and depth of the parallelepiped; the rotation determines the orientation; and the translation determines the position of the center point.
  • Method Details

    • setPosition

      Set the center position of the created parallelepiped.
      Parameters:
      pos - center position of the created parallelepiped
      Returns:
      this instance
    • setScale

      public Parallelepiped.Builder setScale(Vector3D scaleFactors)
      Set the scaling for the created parallelepiped. The scale values determine the lengths of the respective sides in the created parallelepiped.
      Parameters:
      scaleFactors - scale factors
      Returns:
      this instance
    • setScale

      public Parallelepiped.Builder setScale(double x, double y, double z)
      Set the scaling for the created parallelepiped. The scale values determine the lengths of the respective sides in the created parallelepiped.
      Parameters:
      x - x scale factor
      y - y scale factor
      z - z scale factor
      Returns:
      this instance
    • setScale

      public Parallelepiped.Builder setScale(double scaleFactor)
      Set the scaling for the created parallelepiped. The given scale factor is applied to the x, y, and z directions.
      Parameters:
      scaleFactor - scale factor for the x, y, and z directions
      Returns:
      this instance
    • setRotation

      Set the rotation of the created parallelepiped.
      Parameters:
      rot - the rotation of the created parallelepiped
      Returns:
      this instance
    • build

      Build a new parallelepiped instance with the values configured in this builder.
      Returns:
      a new parallelepiped instance
      Throws:
      IllegalArgumentException - if the length of any side of the parallelepiped is zero, as determined by the configured precision context
      See Also: