Graphi...e::Path(3pm)

πŸ“¦
version 0.67 Β· 2 versions
  • 0.67 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.67 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 new Graphics::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 the current_point back 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 $end point using $control1 and $control2 as 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 a Geoemetry::Primitive::Point or two arguments for x and y. (yes, it's spelled Geoemetry in 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 a Geoemetry::Primitive::Point or 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 at current_position of 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 is 5,5 then calling rel_line_to(2, 2) would draw a line from the current point to 7,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 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