Module: XRVG::GeoVariety
- Included in:
- FuseauVariety, InterBezier, OffsetVariety
- Defined in:
- lib/geovariety.rb
Overview
GeoVariety abstract module
Principle
Base module to define geometrical spaces or canvas different from simple euclidean one to draw curves on. It provides three different services:
-
point computation
-
geodesic computation
-
arbitrary bezier computation, this one by computing sampling of euclidean curve on the variety, and then fitting point sequence with FitBezierBuilder
Instance Method Summary collapse
-
#bezier(pointrange, bezier) ⇒ Object
see GeoVariety module description for algorithm.
-
#line(x1, x2, y) ⇒ Object
must be overriden.
-
#point(point) ⇒ Object
must be overriden.
Instance Method Details
#bezier(pointrange, bezier) ⇒ Object
see GeoVariety module description for algorithm
32 33 34 35 36 37 |
# File 'lib/geovariety.rb', line 32 def bezier( pointrange, bezier ) bezier = bezier.similar( pointrange ) points = bezier.samples( 20 ) points = points.map {|point| self.point( point )} return FitBezierBuilder[ :points, points ] end |
#line(x1, x2, y) ⇒ Object
must be overriden
27 28 29 |
# File 'lib/geovariety.rb', line 27 def line( x1, x2, y ) raise NotImplementedError.new("#{self.class.name}#line is an abstract method.") end |
#point(point) ⇒ Object
must be overriden
22 23 24 |
# File 'lib/geovariety.rb', line 22 def point( point ) raise NotImplementedError.new("#{self.class.name}#point is an abstract method.") end |