ποΈ 09082025 1715
π
svg_line_command_basics
L
β Line To (Absolute)β
- Syntax:
L x y
- Draws a straight line from the current cursor position to the given
(x, y)
coordinates.
M 10 10 L 50 40
H
/ h
β Horizontal Lineβ
- Absolute (
H x
): Draws to an absolutex
coordinate (y stays the same). - Relative (
h dx
): Draws a horizontal line of lengthdx
. - Relative form is often more intuitive because itβs based on length, not absolute position.
V
/ v
β Vertical Lineβ
- Absolute (
V y
): Draws to an absolutey
coordinate (x stays the same). - Relative (
v dy
): Draws a vertical line of lengthdy
.
Z
or z
β Close Pathβ
- Closes the current path by drawing a line from the current point to the starting point
- Benefits:
- Ensures the shape is βclosedβ.
- Makes joins smoother compared to manually repeating the starting coordinates.
Best Practicesβ
- Use relative commands (
l
,h
,v
) when possible for easier adjustments. - Always end closed shapes with
Z
for smoother joins and cleaner SVG paths. - Mix commands (
L
,H
,V
) to simplify shapes like rectangles, bookmarks, and icons.
References
- ChatGPT