Class: XRVG::ArcBezier

Inherits:
BezierMotif show all
Defined in:
lib/beziermotifs.rb

Overview

ArcBezier class

Content

Build an “arc” bezier whose base is specified by two points, and whose shape is controlled by a :height attribute. :height parameter is a factor of base length

Attributes

attribute :height,    1.0

Example

arc = ArcBezier[ :support, [V2D::O, V2D::X], :height, 1.0 ]

Instance Method Summary collapse

Methods inherited from BezierMotif

build

Methods inherited from BezierBuilder

[], build, lissage

Instance Method Details

#computeObject

BezierBuilder compute overloading.

See code for algorithm



89
90
91
92
93
# File 'lib/beziermotifs.rb', line 89

def compute
  p1, p2 = self.support
  v = (p2 - p1).ortho * @height
  return [[:vector, p1, v, p2, v]]
end