Module: Sunniesnow::Tools::SvgPath::Curve

Included in:
Arc, CubicBezier, QuadraticBezier
Defined in:
lib/sscharter/tools/svg_path.rb

Instance Method Summary collapse

Instance Method Details

#at_length(s) ⇒ Vector2D

Parameters:

  • s (Float)

Returns:



161
162
163
164
# File 'lib/sscharter/tools/svg_path.rb', line 161

def at_length s
	k = (@lengths.bsearch_index { _1 > s } || @lengths.length - 1) - 1
	@segments[k].at_length s - @lengths[k]
end

#lengthFloat

Returns:

  • (Float)


155
156
157
# File 'lib/sscharter/tools/svg_path.rb', line 155

def length
	@lengths.last
end