spakin / SimpInkScr

Simple Inkscape Scripting
https://inkscape.org/~pakin/%E2%98%85simple-inkscape-scripting
GNU General Public License v3.0
320 stars 31 forks source link

Better Documentation for Path Commands #52

Closed alexporth closed 2 years ago

alexporth commented 2 years ago

I am trying to use the path command but I cannot make head nor tails of the arguments listed in the documentation. I would greatly appreciate it if the arguments for each of the path commands could be described. For Example: Arc(rx, ry, x_axis_rotation, large_arc, sweep, x, y) https://inkscape.gitlab.io/extensions/documentation/source/inkex.paths.html?highlight=arc#inkex.paths.Arc From the documentation, I don't even know which types the arguments expect. Or is there a part of the documentation that I missed where these are described?

spakin commented 2 years ago

The trick is to search the Web for SVG documentation, not Inkscape or inkex documentation. I usually start with MDN Web Docs. In the case of arcs, https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#arcs covers SVG's arc (A) path subcommand.

I consider arcs by far the hardest SVG path subcommand to understand. Here's a quick summary:

Going back to large_arc and sweep, these arguments are each either 0 or 1. They exist because there are in fact four arcs that start at position A, end at position B, and lie on an ellipse with the specified radii and rotation:

svg-arcs

A large_arc of 1 indicates that you want to go the long route around the ellipse (≥180°) instead of the short way (≤180°), indicated with 0. A sweep of 0 or 1 selects one of the two possible ellipses to follow.

I hope that helps.

alexporth commented 2 years ago

Helps a lot thank you.