Class WireframeBox

Direct Known Subclasses:
WireframeCube

public class WireframeBox extends AbstractCompositeShape
A wireframe box (rectangular parallelepiped) composed of 12 line segments representing the edges of the box. The box is axis-aligned, defined by two diagonally opposite corner points.

The wireframe consists of four edges along each axis: four edges parallel to X, four parallel to Y, and four parallel to Z.

Vertex layout:

        cornerB (max) ────────┐
             /│              /│
            / │             / │
           /  │            /  │
          ┌───┼───────────┐   │
          │   │           │   │
          │   │           │   │
          │   └───────────│───┘
          │  /            │  /
          │ /             │ /
          │/              │/
          └───────────────┘ cornerA (min)

Usage example:

LineAppearance appearance = new LineAppearance(2, Color.GREEN);
Point3D cornerA = new Point3D(-50, -50, -50);
Point3D cornerB = new Point3D(50, 50, 50);
WireframeBox box = new WireframeBox(cornerA, cornerB, appearance);
shapeCollection.addShape(box);
See Also:
  • Constructor Details

    • WireframeBox

      public WireframeBox(Box box, LineAppearance appearance)
      Constructs a wireframe box from a Box geometry object.
      Parameters:
      box - the axis-aligned box defining the two opposite corners
      appearance - the line appearance (color, width) used for all 12 edges
    • WireframeBox

      public WireframeBox(Point3D cornerA, Point3D cornerB, LineAppearance appearance)
      Constructs a wireframe box from two diagonally opposite corner points. The corners do not need to be in any particular min/max order; the constructor uses each coordinate independently to form all eight vertices of the box.
      Parameters:
      cornerA - the first corner point of the box
      cornerB - the diagonally opposite corner point of the box
      appearance - the line appearance (color, width) used for all 12 edges