Class: XRVG::FuseauVariety

Inherits:
Object
  • Object
show all
Includes:
Attributable, GeoVariety
Defined in:
lib/geovariety.rb

Overview

FuseauVariety implementation

Principle

Same as OffsetVariety, with Fuseau shape, that is with linearly varying ampl range

Instance Method Summary collapse

Methods included from GeoVariety

#bezier

Constructor Details

#initialize(*args) ⇒ FuseauVariety

Returns a new instance of FuseauVariety.



110
111
112
113
# File 'lib/geovariety.rb', line 110

def initialize( *args )
  super( *args )
  @range = (-self.ampl..self.ampl)
end

Instance Method Details

#line(x1, x2, y) ⇒ Object



120
121
122
123
# File 'lib/geovariety.rb', line 120

def line( x1, x2, y )
  curve = Offset[ :support, @support, :ampl, (0.0..@range.sample( y ))]
  return curve.apply_split( x1, x2 )
end

#point(point) ⇒ Object



115
116
117
118
# File 'lib/geovariety.rb', line 115

def point( point )
  curve = Offset[ :support, @support, :ampl, (0.0..@range.sample( point.y ))]
  return curve.point( point.x )
end