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

Creates a query.

Parameters:



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

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



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

def lines = @lines ||= lines!.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



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

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



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

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