class HexaPDF:: Content:: GraphicObject:: SolidArc
Parent | Object |
---|
This graphic object represents a solid elliptical arc, i.e. an arc that has an inner and an outer set of a/b values.
Note that only the path itself is added to the canvas. So depending on the use-case the path itself still has to be, for example, stroked.
This graphic object is registered under the :solid_arc key for use with the HexaPDF::Content::Canvas
class.
It can be used to create
-
an (elliptical) disk (when the inner a/b are zero and the difference between start and end angles is greater than or equal to 360),
canvas.fill_color("hp-blue"). draw(:solid_arc, outer_a: 80, outer_b: 50). fill_stroke
-
an (elliptical) sector (when the inner a/b are zero and the difference between start and end angles is less than 360),
canvas.fill_color("hp-blue"). draw(:solid_arc, outer_a: 80, outer_b: 50, start_angle: 20, end_angle: 230). fill_stroke
-
an (elliptical) annulus (when the inner a/b are nonzero and the difference between start and end angles is greater than or equal to 360),
canvas.fill_color("hp-blue"). draw(:solid_arc, outer_a: 80, outer_b: 50, inner_a: 70, inner_b: 30). fill_stroke
-
and an (elliptical) *annular sector* (when the inner a/b are nonzero and the difference between start and end angles is less than 360)
canvas.fill_color("hp-blue"). draw(:solid_arc, outer_a: 80, outer_b: 50, inner_a: 70, inner_b: 30, start_angle: 20, end_angle: 230). fill_stroke
See: Arc
Attributes
Inclination in degrees of semi-major axis in respect to x-axis, defaults to 0.
Examples:
solid_arc = canvas.graphic_object(:solid_arc, cx: -50, outer_a: 30, outer_b: 20,
inner_a: 20, inner_b: 10)
canvas.draw(solid_arc).stroke
canvas.stroke_color("hp-blue").draw(solid_arc, cx: 50, inclination: 40).stroke
Length of inner semi-major axis which (without altering the inclination
) is parallel to the x-axis, defaults to 0.
Examples:
solid_arc = canvas.graphic_object(:solid_arc, cx: -50, outer_a: 30, outer_b: 20,
inner_a: 20, inner_b: 10)
canvas.draw(solid_arc).stroke
canvas.stroke_color("hp-blue").draw(solid_arc, cx: 50, inner_a: 5).stroke
Length of inner semi-minor axis which (without altering the inclination
) is parallel to the y-axis, defaults to 0.
Examples:
solid_arc = canvas.graphic_object(:solid_arc, cx: -50, outer_a: 30, outer_b: 20,
inner_a: 20, inner_b: 10)
canvas.draw(solid_arc).stroke
canvas.stroke_color("hp-blue").draw(solid_arc, cx: 50, inner_b: 20).stroke
Length of outer semi-major axis which (without altering the inclination
) is parallel to the x-axis, defaults to 1.
Examples:
solid_arc = canvas.graphic_object(:solid_arc, cx: -50, outer_a: 30, outer_b: 20,
inner_a: 20, inner_b: 10)
canvas.draw(solid_arc).stroke
canvas.stroke_color("hp-blue").draw(solid_arc, cx: 50, outer_a: 45).stroke
Length of outer semi-minor axis which (without altering the inclination
) is parallel to the y-axis, defaults to 1.
Examples:
solid_arc = canvas.graphic_object(:solid_arc, cx: -50, outer_a: 30, outer_b: 20,
inner_a: 20, inner_b: 10)
canvas.draw(solid_arc).stroke
canvas.stroke_color("hp-blue").draw(solid_arc, cx: 50, outer_b: 40).stroke
Public Class Methods
Creates and configures a new solid arc object.
See configure
for the allowed keyword arguments.
Public Instance Methods
Configures the solid arc with
-
center point (
cx
,cy
), -
inner semi-major axis
inner_a
, -
inner semi-minor axis
inner_b
, -
outer semi-major axis
outer_a
, -
outer semi-minor axis
outer_b
, -
start angle of
start_angle
degrees, -
end angle of
end_angle
degrees and -
an inclination in respect to the x-axis of
inclination
degrees.
Any arguments not specified are not modified and retain their old value, see initialize for the inital values.
Returns self.
Examples:
solid_arc = canvas.graphic_object(:solid_arc)
solid_arc.configure(outer_a: 30, outer_b: 20, inner_a: 20, inner_b: 10)
canvas.draw(solid_arc).stroke