Class | Magick::RVG::PathData
In: | lib/rvg/pathdata.rb
Parent: | Object

The PathData class provides an object-oriented way to produce an SVG path. Each of the methods corresponds to a path command. Construct a path by calling one or more methods. The path object can be passed as an argument to the RVG::ShapeConstructors#path method.

### Methods

arc closepath curveto hlineto lineto moveto new quadratic_curveto smooth_curveto smooth_quadratic_curveto to_s vlineto

### Public Class methods

new()

Construct an empty path

### Public Instance methods

arc(abs, rx, ry, x_axis_rotation, large_arc_flag, sweep_flag, x, y)

Add an `arc` command. If `abs` is `true` the coordinates are absolute, otherwise the coordinates are relative.

closepath(abs=true)

Add a `closepath` command. The `abs` argument is ignored.

curveto(abs, x1, y1, x2, y2, x, y, *coords)

Add a `curveto` (cubic Bezier) command. If `abs` is `true` the coordinates are absolute, otherwise the coordinates are relative.

hlineto(abs, x)

Add a `horizontal lineto` command. If `abs` is `true` the coordinates are absolute, otherwise the coordinates are relative.

lineto(abs, x, y, *coords)

Add a `lineto` command. Any number of x,y coordinate pairs may be specified. If `abs` is `true` the coordinates are absolute, otherwise the coordinates are relative.

moveto(abs, x, y, *coords)

Add a `moveto` command. If `abs` is `true` the coordinates are absolute, otherwise the coordinates are relative.

quadratic_curveto(abs, x1, y1, x, y, *coords)

Add a `quadratic Bezier curveto` command. If `abs` is `true` the coordinates are absolute, otherwise the coordinates are relative.

smooth_curveto(abs, x2, y2, x, y, *coords)

Add a `smooth curveto` (cubic Bezier) command. If `abs` is `true` the coordinates are absolute, otherwise the coordinates are relative.

smooth_quadratic_curveto(abs, x, y, *coords)

Add a `smooth quadratic Bezier curveto` command. If `abs` is `true` the coordinates are absolute, otherwise the coordinates are relative.

to_s()

Convert the path to its string equivalent.

vlineto(abs, y)

Add a `vertical lineto` command. If `abs` is `true` the coordinates are absolute, otherwise the coordinates are relative.

[Validate]