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:



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

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

Instance Method Details

#linesArray<Sevgi::Geometry::Line>

Returns generated grid lines.

Returns:

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


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

def lines = @lines ||= lines!

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

Returns grid line endpoints as points.

Returns:

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


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

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

#xysArray<Array<Array<Float>>>

Returns grid line endpoints as coordinate pairs.

Returns:

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


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

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