Class: Sevgi::Sundries::Grid::Axis::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/sevgi/sundries/grid.rb

Overview

Memoized grid line query for an axis.

Direct Known Subclasses

Halve, Major, Minor

Instance Method Summary collapse

Constructor Details

#initialize(this, other) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates a query.

Parameters:



142
# File 'lib/sevgi/sundries/grid.rb', line 142

def initialize(this, other) = (@this, @other = this, other)

Instance Method Details

#linesArray<Sevgi::Geometry::Line>

Returns generated grid lines. The memoized collection is frozen and must be treated as immutable.

Returns:

  • (Array<Sevgi::Geometry::Line>)

    frozen lines



157
# File 'lib/sevgi/sundries/grid.rb', line 157

def lines = @lines ||= build.freeze

#pointsArray<Array<Sevgi::Geometry::Point>>

Returns grid line endpoints as points. The outer and nested collections are frozen and must be treated as immutable.

Returns:

  • (Array<Array<Sevgi::Geometry::Point>>)

    frozen point pairs



152
# File 'lib/sevgi/sundries/grid.rb', line 152

def points = @points ||= lines.map { it.points(true).freeze }.freeze

#xysArray<Array<Array<Float>>>

Returns grid line endpoints as coordinate pairs. The outer and nested collections are frozen and must be treated as immutable.

Returns:

  • (Array<Array<Array<Float>>>)

    frozen coordinate pairs



147
# File 'lib/sevgi/sundries/grid.rb', line 147

def xys = @xys ||= lines.map { it.points(true).map { |point| point.deconstruct.freeze }.freeze }.freeze