class HexaPDF:: Content:: GraphicObject:: EndpointArc
Parent | Object |
---|---|
Included Modules |
HexaPDF::Utils::MathHelpers |
This class describes an elliptical arc in endpoint parameterization. It allows one to generate an arc from the current point to a given point, similar to Content::Canvas#line_to
.
This graphic object is registered under the :endpoint_arc key for use with the HexaPDF::Content::Canvas
class.
Examples:
arc = canvas.graphic_object(:endpoint_arc, x: 50, y: 20, a: 30, b: 10) canvas.move_to(0, 0).draw(arc).stroke
See: GraphicObject::Arc
, ARC - www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
Constants
- EPSILON¶
Attributes
Direction of arc - if true
in clockwise direction, else in counterclockwise direction
This is needed, for example, when filling paths using the nonzero winding number rule to achieve different effects.
Examples:
arc = canvas.graphic_object(:endpoint_arc, x: 50, y: 20, a: 30, b: 20) canvas.move_to(0, 0).draw(arc).stroke canvas.stroke_color("red").move_to(0, 0).draw(arc, clockwise: true).stroke
Large arc choice - if true
use the large arc (i.e. the one spanning more than 180 degrees), else the small arc
Examples:
arc = canvas.graphic_object(:endpoint_arc, x: 50, y: 20, a: 30, b: 20) canvas.move_to(0, 0).draw(arc).stroke canvas.stroke_color("red").move_to(0, 0).draw(arc, large_arc: false, clockwise: true).stroke
Public Class Methods
Creates and configures a new endpoint arc object.
See configure
for the allowed keyword arguments.
Public Instance Methods
Configures the endpoint arc with
-
endpoint (
x
,y
), -
semi-major axis
a
, -
semi-minor axis
b
, -
an inclination in respect to the x-axis of
inclination
degrees, -
the given
large_arc
flag and -
the given clockwise flag.
The large_arc
option determines whether the large arc, i.e. the one spanning more than 180 degrees, is used (true
) or the small arc (false
).
The clockwise
option determines if the arc is drawn in the counterclockwise direction (false
) or in the clockwise direction (true
).
Any arguments not specified are not modified and retain their old value, see initialize for the inital values.
Returns self.