public class SolidPolygonCube extends SolidPolygonRectangularBox
A solid cube centered at a given point with equal side length along all axes. This is a convenience subclass of SolidPolygonRectangularBox that constructs a cube from a center point and a half-side length.

The cube extends size units in each direction from the center, resulting in a total edge length of 2 * size.

Usage example:


 SolidPolygonCube cube = new SolidPolygonCube(
         new Point3D(0, 0, 300), 50, Color.GREEN);
 shapeCollection.addShape(cube);
 
See Also:
  • Constructor Details

    • SolidPolygonCube

      public SolidPolygonCube(Point3D center, double size, Color color)
      Constructs a solid cube centered at the given point.
      Parameters:
      center - the center point of the cube in 3D space
      size - the half-side length; the cube extends this distance from the center along each axis, giving a total edge length of 2 * size
      color - the fill color applied to all faces of the cube