Add Arrow
I already have an arrow node that lets you make arrows from scratch. But sometimes you need to add arrows to existing paths, which can be a tad cumbersome, even with my tangent node. This should be easy!
Hence, my new add_arrow node.
Add_arrow adds arrows to the end(s) of an open path, or segment midpoints of a closed path (shape). It takes the following parameters:
- Path. The path. If you feed it a group, it will ungroup it.
- Size. The size of the arrow's edge in pixels.
- Angle. The angle of the each arrow edge relative to its position on the path. Values can range from 10 (tight) to 60 (broad). 30 degrees generally works pretty well.
- Style. You have three choices:
- Simple. A plain open arrow consisting of two edges.
- Solid. A solid arrow.
- Fancy. A solid arrow with a swept interior.
- Both Ends. If checked, will place opposite arrows on both ends of an open path. Ignored for closed paths.
If you feed this node an open path your arrow will land on one or both endpoints. If you feed it a shape (closed path), the arrows will appear at the midpoints of each segment in the path. For ellipses or rectangles, this means four evenly spaced arrows (great for cycle diagrams). For text paths, this will show the direction, clockwise or counterclockwise, of each contour in each letter.
Tip: If you want to make backward arrows (used in some diagrams), just enter a negative size.
Add_arrow takes the path thickness into account when placing the arrows. So it is better to set with path color and strokeWidth using the colorize node before adding your arrows. You can certainly colorize paths after simple arrows are attached. Solid and fancy arrows, however, need to be ungrouped and colored separately if you don't want them filled the same way as the path or shape.
Add_arrow adds its arrows as separate paths and then groups them with the source path. I experimented with joining them to the path as contours using my join_contours node, but this would require a separate code module and would not allow proper colorization for solid and fancy arrows. Grouping is important when feeding multiple paths into the node; if you ever need to access the path independently of its arrows, just ungroup it and take the first path in the group.
The attached demo shows four simple examples:
- Fancy arrows arranged in a cycle around a rotated ellipse
- A bright orange solid arrow at the end of a curve
- The letter a with simple arrows showing the direction of both contours
- A double-sided angular arrow
I will be especially interested to see diagrams made using this node, if anyone out there is willing to share.
Enjoy!
-
add_arrow_screenshot.png 467 KB
- add_arrow_demo.ndbx.zip 106 KB
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac