Class: Draught::ArcBuilder::SegmentBuilder
- Inherits:
-
Object
- Object
- Draught::ArcBuilder::SegmentBuilder
- Defined in:
- lib/draught/arc_builder.rb
Overview
@api: private Based on learnings from www.tinaja.com/glib/bezcirc2.pdf, via www.whizkidtech.redprince.net/bezier/circle/
Instance Attribute Summary collapse
-
#radius ⇒ Object
readonly
Returns the value of attribute radius.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#sweep ⇒ Object
readonly
Returns the value of attribute sweep.
Instance Method Summary collapse
- #cubic_bezier ⇒ Object
- #end_point ⇒ Object
- #first_point ⇒ Object
-
#initialize(sweep, start, radius) ⇒ SegmentBuilder
constructor
A new instance of SegmentBuilder.
Constructor Details
#initialize(sweep, start, radius) ⇒ SegmentBuilder
Returns a new instance of SegmentBuilder.
106 107 108 |
# File 'lib/draught/arc_builder.rb', line 106 def initialize(sweep, start, radius) @sweep, @start, @radius = sweep, start, radius end |
Instance Attribute Details
#radius ⇒ Object (readonly)
Returns the value of attribute radius.
104 105 106 |
# File 'lib/draught/arc_builder.rb', line 104 def radius @radius end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
104 105 106 |
# File 'lib/draught/arc_builder.rb', line 104 def start @start end |
#sweep ⇒ Object (readonly)
Returns the value of attribute sweep.
104 105 106 |
# File 'lib/draught/arc_builder.rb', line 104 def sweep @sweep end |
Instance Method Details
#cubic_bezier ⇒ Object
118 119 120 121 122 |
# File 'lib/draught/arc_builder.rb', line 118 def cubic_bezier @cubic_bezier ||= CubicBezier.new({ end_point: end_point, control_point_1: control_point_1, control_point_2: control_point_2 }) end |