public class SolidPolygonPyramid extends AbstractCompositeShape
A solid square-based pyramid with the base centered at a given point.

The pyramid has a square base and four triangular faces meeting at an apex. The base has side length of 2 * baseSize and the height extends height units above the base center to the apex.

Usage example:


 SolidPolygonPyramid pyramid = new SolidPolygonPyramid(
         new Point3D(0, 0, 300), 50, 100, Color.BLUE);
 shapeCollection.addShape(pyramid);
 
See Also:
  • Constructor Details

    • SolidPolygonPyramid

      public SolidPolygonPyramid(Point3D baseCenter, double baseSize, double height, Color color)
      Constructs a solid square-based pyramid with base centered at the given point.
      Parameters:
      baseCenter - the center point of the pyramid's base in 3D space
      baseSize - the half-width of the square base; the base extends this distance from the center along X and Z axes, giving a total base edge length of 2 * baseSize
      height - the height of the pyramid from base center to apex
      color - the fill color applied to all faces of the pyramid