Module: Sevgi::Graphics::Mixtures::Hatch
- Defined in:
- lib/sevgi/graphics/mixtures/hatch.rb
Overview
DSL helpers for drawing geometry-derived hatch lines.
Instance Method Summary collapse
-
#Draw(lines, **kwargs) ⇒ Array<Sevgi::Graphics::Element>
Draws one or more geometry line-like objects into this element.
-
#Hatch(element, angle:, step:, initial: nil, **kwargs) ⇒ Array<Sevgi::Graphics::Element>
Draws hatch lines swept through a geometry element.
Instance Method Details
#Draw(lines, **kwargs) ⇒ Array<Sevgi::Graphics::Element>
Draws one or more geometry line-like objects into this element.
12 13 14 |
# File 'lib/sevgi/graphics/mixtures/hatch.rb', line 12 def Draw(lines, **kwargs) Array(lines).map { it.draw(self, **kwargs) } end |
#Hatch(element, angle:, step:, initial: nil, **kwargs) ⇒ Array<Sevgi::Graphics::Element>
Draws hatch lines swept through a geometry element.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/sevgi/graphics/mixtures/hatch.rb', line 24 def Hatch(element, angle:, step:, initial: nil, **kwargs) begin require "sevgi/geometry" rescue ::LoadError => e raise unless e.path == "sevgi/geometry" MissingComponentError.("sevgi/geometry") end Draw(Geometry::Operation.sweep!(element, initial: initial || element.position, angle:, step:), **kwargs) end |