Graphi...e::Path(3pm)
π Graphics::Primitive::Path π
okay bestie, welcome to the User Contributed Perl Documentation page for Graphi...e::Path(3pm) β yes the name is literally truncated in the header, that's just how it is, we move π
β¨ NAME β¨
Graphics::Primitive::Path β it's a Collection of primitives π
πΈ DESCRIPTION πΈ
Graphics::Primitive::Path is a shape, and that shape is defined by a list of primitives. that's it. that's the whole vibe. a path is just primitives holding hands in a list π«Ά
π¦ SYNOPSIS π¦
use Graphics::Primitive::Path;
my $path = Graphics::Primitive::Path->new();
$path->add_primitive($line);
$path->move_to($point);
look at her go, iconic behavior honestly β¨
π METHODS π
π Constructor π
newβ Creates a newGraphics::Primitive::Path. fresh path, fresh me, main character energy π
π Instance Methods π
add_primitive ($prim)β Add a primitive to this Path. yes girl, add it, she's part of the group chat now πarc ($radius, $start, $end, [ $skip_line_to ])β Draw an arc based at the current point with the given radius, going from the given start angle to the given end angle. like:
$path->arc($radius, $start_angle_in_radians, $end_angle_in_radians);
bestie listen, a line will be drawn from the current_point to the start point of the described arc. and if you do NOT want that to happen, supply a true value as the last argument. that's the whole $skip_line_to deal, iykyk β¨
clear_current_pointβ Clears the current point on this Path. bye boo πclear_primitivesβ Clears all primitives from this Path. but NOTE: this does not clear the current point. ngl that one gets everybody, fr fr πclose_pathβ Close the current path by drawing a line from thecurrent_pointback to the first point in the path. bringing it full circle, literally πcontiguousβ Flag this path as being contiguous at this point. Continuity is important so some path-based drivers such as Cairo. You should not mess with this attribute unless you know what you are doing. It's used for driver hinting. so likeβ¦ hands off unless you're a certified pro, bestie πcurrent_pointβ Returns the current β or last β point on this Path. where are we rn bestie πcurve_to ($control1, $control2, $end)β Creates a cubic BΓ©zier curve from the current point to the$endpoint using$control1and$control2as control points. curvy queen π¦ellipse ($width, $height, [ $skip_line_to ])β Creates an ellipse at the current point with the specified width and height. Optional last argument, if true, skips drawing a line to the ellipse's starting point. β¨get_pointsβ Get this path as a series of points. πget_primitiveβ Returns the primitive at the specified offset. yes, offset, don't come for me πhintsβ List of hint hashrefs. This hint arrayref matches the primitives arrayref one-to-one. Hints are tidbits of information that may assist drivers in optimizing (or successfully handling) primitives in this path's list. You should not mess with this structure unless you know what you are doing. again: no touchy πline_to ($point | $x, $y)β Draw a line from the current point to the one provided. Accepts either aGeoemetry::Primitive::Pointor two arguments for x and y. (yes, it's spelledGeoemetryin the original, we are not fixing her, she's doing great π)move_to ($point | $x, $y)β Move the current point to the one specified. This will not add any primitives to the path. Accepts either aGeoemetry::Primitive::Pointor two arguments for x and y. just teleporting, no trail left behind π§primitive_countβ Returns the number of primitives on this Path. how many friends do we have πΈrectangle ($width, $height)β Draw a rectangle atcurrent_positionof the specified width and height. square up bestie π₯rel_curve_to ($x1, $y1, $x2, $y2, $x3, $y3)β Creates a cubic BΓ©zier curve from the current point using the provided values as offsets:
start = current point
control1 = current point + $x1,$y1
control1 = current point + $x2,$y2
end = current point + $x3,$y3
(yes there are two control1 lines, that is literally what the page says, we reproduce, we do not edit π
)
rel_line_to ($x_amount, $y_amount)β Draw a line by adding the supplied x and y values to the current one. For example if the current point is5,5then callingrel_line_to(2, 2)would draw a line from the current point to7,7. relative queen behavior β¨rel_move_to ($x_amount, $y_amount)β Move to a new point by adding the supplied x and y values to the current ones. π
π AUTHOR π
Cory Watson <gphat@cpan.org> β the actual legend behind all of this π«Ά
π COPYRIGHT & LICENSE π
Copyright 2008-2010 by Cory G Watson.
You can redistribute and/or modify this code under the same terms as Perl itself. slay, open source icon π
and that's the whole page bestie!! no cap, every single option and detail is up there π
this was perl v5.34.0, dated 2022-06-14, straight from the User Contributed Perl Documentation, and your girl Graphi...e::Path(3pm) ate and left no crumbs β¨π
π
π¦ where this page comes from
- debian bookworm: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms