public class Grid3D extends AbstractCompositeShape
A 3D grid of line segments filling a rectangular volume defined by two 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. The corner points are automatically normalized so that p1 holds the minimum coordinates and p2 holds the maximum coordinates.

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 corner1 = new Point3D(-100, -100, -100);
 Point3D corner2 = new Point3D(100, 100, 100);
 Grid3D grid = new Grid3D(corner1, corner2, 50, appearance);
 shapeCollection.addShape(grid);
 
See Also:
  • Constructor Details

    • Grid3D

      public Grid3D(Point3D p1t, Point3D p2t, double step, LineAppearance appearance)
      Constructs a 3D grid filling the volume between two corner points. The corner points are copied and normalized internally so that grid generation always proceeds from minimum to maximum coordinates.
      Parameters:
      p1t - the first corner point defining the volume (copied, not modified)
      p2t - the diagonally opposite corner point (copied, not modified)
      step - the spacing between grid lines along each axis; must be positive
      appearance - the line appearance (color, width) used for all grid lines