public class Grid3D extends AbstractCompositeShape
A 3D grid of line segments filling a rectangular volume defined by two diagonally opposite corner points. Lines run along all three axes (X, Y, and Z) at regular intervals determined by the step size.

At each grid intersection point, up to three line segments are created (one along each axis), forming a three-dimensional lattice.

This shape is useful for visualizing 3D space, voxel boundaries, or spatial reference grids in a scene.

Usage example:


 LineAppearance appearance = new LineAppearance(1, Color.GRAY);
 Point3D cornerA = new Point3D(-100, -100, -100);
 Point3D cornerB = new Point3D(100, 100, 100);
 Grid3D grid = new Grid3D(cornerA, cornerB, 50, appearance);
 shapeCollection.addShape(grid);
 
See Also:
  • Constructor Details

    • Grid3D

      public Grid3D(Point3D cornerA, Point3D cornerB, double step, LineAppearance appearance)
      Constructs a 3D grid filling the volume between two diagonally opposite corner points.

      The corner points do not need to be in any particular min/max order; the constructor automatically normalizes them so that grid generation always proceeds from minimum to maximum coordinates.

      Parameters:
      cornerA - the first corner point defining the volume
      cornerB - the diagonally opposite corner point
      step - the spacing between grid lines along each axis; must be positive
      appearance - the line appearance (color, width) used for all grid lines