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.
This graphic object is registered under the :solid_arc key for use with the HexaPDF::Content::Canvas
class.
Thus 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("red"). draw(:solid_arc, outer_a: 80, outer_b: 50, end_angle: 360). 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("red"). 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), and
canvas.fill_color("red"). draw(:solid_arc, outer_a: 80, outer_b: 50, inner_a: 70, inner_b: 30, end_angle: 360). fill_stroke
-
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("red"). 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
Length of inner semi-major axis which (without altering the inclination
) is parallel to the x-axis
Examples:
solid_arc = canvas.graphic_object(:solid_arc, outer_a: 30, outer_b: 20, inner_a: 20, inner_b: 10) canvas.draw(solid_arc).stroke canvas.stroke_color("red").draw(solid_arc, inner_a: 5).stroke
Length of inner semi-minor axis which (without altering the inclination
) is parallel to the y-axis
Examples:
solid_arc = canvas.graphic_object(:solid_arc, outer_a: 30, outer_b: 20, inner_a: 20, inner_b: 10) canvas.draw(solid_arc).stroke canvas.stroke_color("red").draw(solid_arc, inner_b: 20).stroke
Length of outer semi-major axis which (without altering the inclination
) is parallel to the x-axis
Examples:
solid_arc = canvas.graphic_object(:solid_arc, outer_a: 30, outer_b: 20, inner_a: 20, inner_b: 10) canvas.draw(solid_arc).stroke canvas.stroke_color("red").draw(solid_arc, outer_a: 45).stroke
Length of outer semi-minor axis which (without altering the inclination
) is parallel to the y-axis
Examples:
solid_arc = canvas.graphic_object(:solid_arc, outer_a: 30, outer_b: 20, inner_a: 20, inner_b: 10) canvas.draw(solid_arc).stroke canvas.stroke_color("red").draw(solid_arc, outer_b: 40).stroke
Public Class Methods
Creates and configures a new solid arc object.
See configure
for the allowed keyword arguments.
Creates a solid arc with default values (a unit disk at the origin).
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.