Class: Sevgi::Sundries::Grid::Axis::Query
- Inherits:
-
Object
- Object
- Sevgi::Sundries::Grid::Axis::Query
- Defined in:
- lib/sevgi/sundries/grid.rb
Overview
Memoized grid line query for an axis.
Instance Method Summary collapse
-
#initialize(this, other) ⇒ void
constructor
Creates a query.
-
#lines ⇒ Array<Sevgi::Geometry::Line>
Returns generated grid lines.
-
#points ⇒ Array<Array<Sevgi::Geometry::Point>>
Returns grid line endpoints as points.
-
#xys ⇒ Array<Array<Array<Float>>>
Returns grid line endpoints as coordinate pairs.
Constructor Details
#initialize(this, other) ⇒ void
Creates a query.
87 |
# File 'lib/sevgi/sundries/grid.rb', line 87 def initialize(this, other) = (@this, @other = this, other) |
Instance Method Details
#lines ⇒ Array<Sevgi::Geometry::Line>
Returns generated grid lines. The memoized collection is frozen and must be treated as immutable.
102 |
# File 'lib/sevgi/sundries/grid.rb', line 102 def lines = @lines ||= lines!.freeze |
#points ⇒ Array<Array<Sevgi::Geometry::Point>>
Returns grid line endpoints as points. The outer and nested collections are frozen and must be treated as immutable.
97 |
# File 'lib/sevgi/sundries/grid.rb', line 97 def points = @points ||= lines.map { it.points(true).freeze }.freeze |
#xys ⇒ Array<Array<Array<Float>>>
Returns grid line endpoints as coordinate pairs. The outer and nested collections are frozen and must be treated as immutable.
92 |
# File 'lib/sevgi/sundries/grid.rb', line 92 def xys = @xys ||= lines.map { it.points(true).map { |point| point.deconstruct.freeze }.freeze }.freeze |