GridPlane3d

References
public sealed class GridPlane3d
Represents an orthogonal grid with custom domain and codomain intervals.

Constructors

GridPlane3d

#
public GridPlane3d(Rectangle3d boundary, Interval domain, Interval codomain)
Create a new grid.
boundary (Rectangle3d)Rectangular boundary of grid.
domain (Interval)Domain of grid along the boundary X direction.
codomain (Interval)Domain of grid along the boundary Y direction.

Fields

Boundary

#
public readonly Rectangle3d Boundary

Codomain

#
public readonly Interval Codomain

Domain

#
public readonly Interval Domain

Methods

Draw

#
public void Draw(DisplayPipeline pipeline, Color colour, float thick, float thin, double minSpacing = 15, double maxSpacing = 30, bool drawLabels = true)
Draw this grid into a display pipeline. It is strongly recommended to only draw trimmed grids as that can vastly reduce the overhead from drawing (or attempting to draw) thousands upon thousands of invisible lines and labels.
pipeline (DisplayPipeline)Pipeline to draw with.
colour (Color)Colour of lines and labels.
thick (float)Thickness of grid boundary and axes.
thin (float)Thickness of grid lines.
minSpacing (double = 15)Minimum spacing of grid lines. Lines closer together than this value are not drawn.
maxSpacing (double = 30)Ideal spacing of grid lines. Lines further apart than this value are drawn fully opaque.
drawLabels (bool = true)True to draw labels next to grid lines.

GenerateZoomAwareGridLines

#
public static IEnumerable<(Line line, double value, double opacity)> GenerateZoomAwareGridLines(Line lowerEdge, Line upperEdge, Interval domain, RhinoViewport viewport, (double min, double max) spacing)
Create one directional grid lines sorted from large magnitude to small.
lowerEdge (Line)
upperEdge (Line)
domain (Interval)
viewport (RhinoViewport)
spacing ((double min, double max))

IterateFromLargeToSmall

#
public static IEnumerable<(double value, double orderOfMagnitude)> IterateFromLargeToSmall(Interval interval)
Iterate over all values in an interval from most relevant to least relevant. This method enumerates forever, it is up to the called to stop enumerating.
interval (Interval)Interval to enumerate over.

TrimToView

#
public GridPlane3d TrimToView(RhinoViewport viewport)
viewport (RhinoViewport)