public class WireframePyramid extends AbstractCompositeShape
A wireframe square-based pyramid that can be oriented in any direction.

The pyramid has a square base and four triangular faces meeting at an apex (tip). The wireframe consists of:

  • Four lines forming the square base
  • Four lines from each base corner to the apex

Two constructors are provided for different use cases:

  • Directional (recommended): Specify apex point and base center point. The pyramid points from apex toward the base center. This allows arbitrary orientation and is the most intuitive API.
  • Y-axis aligned: Specify base center, base size, and height. The pyramid points in -Y direction (apex at lower Y). Useful for simple vertical pyramids.

Usage examples:


 // Directional constructor: pyramid pointing from apex toward base
 LineAppearance appearance = new LineAppearance(2, Color.RED);
 WireframePyramid directionalPyramid = new WireframePyramid(
     new Point3D(0, -100, 0),   // apex (tip of the pyramid)
     new Point3D(0, 50, 0),     // baseCenter (pyramid points toward this)
     50,                        // baseSize (half-width of square base)
     appearance
 );

 // Y-axis aligned constructor: pyramid pointing upward
 WireframePyramid verticalPyramid = new WireframePyramid(
     new Point3D(0, 0, 300),    // baseCenter
     50,                        // baseSize (half-width of square base)
     100,                       // height
     appearance
 );
 
See Also:
  • Constructor Details

    • WireframePyramid

      public WireframePyramid(Point3D apexPoint, Point3D baseCenter, double baseSize, LineAppearance appearance)
      Constructs a wireframe square-based pyramid pointing from apex toward base center.

      This is the recommended constructor for placing pyramids in 3D space. The pyramid's apex (tip) is at apexPoint, and the square base is centered at baseCenter. The pyramid points in the direction from apex to base center.

      Coordinate interpretation:

      • apexPoint - the sharp tip of the pyramid
      • baseCenter - the center of the square base; the pyramid "points" in this direction from the apex
      • baseSize - half the width of the square base; the base extends this distance from the center along perpendicular axes
      • The distance between apex and base center determines the pyramid height
      Parameters:
      apexPoint - the position of the pyramid's tip (apex)
      baseCenter - the center point of the square base; the pyramid points from apex toward this point
      baseSize - the half-width of the square base; the base extends this distance from the center, giving a total base edge length of 2 * baseSize
      appearance - the line appearance (color, width) used for all lines
    • WireframePyramid

      public WireframePyramid(Point3D baseCenter, double baseSize, double height, LineAppearance appearance)
      Constructs a wireframe square-based pyramid with base centered at the given point, pointing in the -Y direction.

      This constructor creates a Y-axis aligned pyramid. The apex is positioned at baseCenter.y - height (above the base in the negative Y direction). For pyramids pointing in arbitrary directions, use WireframePyramid(Point3D, Point3D, double, LineAppearance) instead.

      Coordinate system: The pyramid points in -Y direction (apex at lower Y). The base is at Y=baseCenter.y, and the apex is at Y=baseCenter.y - height. In Sixth 3D's coordinate system, "up" visually is negative Y.

      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
      appearance - the line appearance (color, width) used for all lines