Allow drawing lines with specific angles #1116
inkreasing
started this conversation in
Ideas
Replies: 2 comments
|
I learned that it is possible to do this using the interpolation coordinates using the angle property. This is not really ergonomic, but it works. |
0 replies
|
You can use relative coordinates in combination with polar coordinates: #canvas({
import draw: *
rect((0,0), (5,5))
line((1,1), (rel: (30deg, 1))) // ← The second coordinate is relative to the previous one.
}) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is currently possible only if the line starts at the origin (0, 0) by using polar coordinates as the second position. But if you want to draw a line starting at a different position that doesn't work. (or at least i didn't find a way)
It could work by allowing the polar coordinates to specify the origin. I am unsure how to make that ergonomic for the case of a line, where the origin should be the start of the line.
All reactions