Module: Sevgi::Geometry::Operation
- Extended by:
- Operation
- Included in:
- Operation
- Defined in:
- lib/sevgi/geometry/operation.rb,
lib/sevgi/geometry/operation/align.rb,
lib/sevgi/geometry/operation/sweep.rb
Overview
Dispatches geometry operations to operation handler modules.
Constant Summary collapse
- OperationError =
Raised when an operation starts but cannot complete.
Class.new(Error)
- OperationInapplicableError =
Raised when an operation does not apply to the target element.
Class.new(Error)
Class Method Summary collapse
-
.align(element, other, alignment = :center) ⇒ Sevgi::Geometry::Element
Returns an element translated to align with another element.
-
.alignment(element, other, alignment = :center) ⇒ Sevgi::Geometry::Point
Returns the offset needed to align one element with another.
-
.sweep(element, initial:, angle:, step:, limit: Sweep::LIMIT) {|lines| ... } ⇒ Array<Sevgi::Geometry::Line>
Sweeps parallel lines across a lined element in both directions.
-
.sweep!(element, initial:, angle:, step:, limit: Sweep::LIMIT) {|lines| ... } ⇒ Array<Sevgi::Geometry::Line>
Sweeps parallel lines across a lined element and requires at least one result.
-
.unisweep(element, equation, step, limit: Sweep::LIMIT) ⇒ Array<Sevgi::Geometry::Line>
Sweeps parallel lines in one signed direction from an equation.
Class Method Details
.align(element, other, alignment = :center) ⇒ Sevgi::Geometry::Element
Returns an element translated to align with another element.
80 |
# File 'lib/sevgi/geometry/operation.rb', line 80 def register(handler, *operations) = operations.each { |operation| def_operation(operation, handler) } |
.alignment(element, other, alignment = :center) ⇒ Sevgi::Geometry::Point
Returns the offset needed to align one element with another.
80 |
# File 'lib/sevgi/geometry/operation.rb', line 80 def register(handler, *operations) = operations.each { |operation| def_operation(operation, handler) } |
.sweep(element, initial:, angle:, step:, limit: Sweep::LIMIT) {|lines| ... } ⇒ Array<Sevgi::Geometry::Line>
Sweeps parallel lines across a lined element in both directions.
80 |
# File 'lib/sevgi/geometry/operation.rb', line 80 def register(handler, *operations) = operations.each { |operation| def_operation(operation, handler) } |
.sweep!(element, initial:, angle:, step:, limit: Sweep::LIMIT) {|lines| ... } ⇒ Array<Sevgi::Geometry::Line>
Sweeps parallel lines across a lined element and requires at least one result.
80 |
# File 'lib/sevgi/geometry/operation.rb', line 80 def register(handler, *operations) = operations.each { |operation| def_operation(operation, handler) } |
.unisweep(element, equation, step, limit: Sweep::LIMIT) ⇒ Array<Sevgi::Geometry::Line>
Sweeps parallel lines in one signed direction from an equation.
80 |
# File 'lib/sevgi/geometry/operation.rb', line 80 def register(handler, *operations) = operations.each { |operation| def_operation(operation, handler) } |