Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unintuitive output for vsk.arc's start and stop params #96

Open
bcongdon opened this issue Mar 12, 2021 · 5 comments
Open

Unintuitive output for vsk.arc's start and stop params #96

bcongdon opened this issue Mar 12, 2021 · 5 comments

Comments

@bcongdon
Copy link

I'm a bit confused by the "start" and "stop" parameters of vsk.arc. They don't seem to do what I'd expect:

self.ellipseMode("radius")
self.arc(0, 0, w=5, h=5, start=0, stop=90, degrees=True)
self.arc(15, 0, w=5, h=5, start=90, stop=180, degrees=True)
self.arc(30, 0, w=5, h=5, start=180, stop=270, degrees=True)
self.arc(45, 0, w=5, h=5, start=270, stop=360, degrees=True)
self.circle(60, 0, diameter=5)

Screen Shot 2021-03-11 at 7 21 54 PM

With the above code, I'd expect the output to look more like this:

Screen Shot 2021-03-11 at 7 22 06 PM

Put another way, it looks like the "start" and "stop" degrees are not always relative to the same absolute starting reference point. This same behavior seems to happen in radians mode too. Am I misunderstanding the intended usage?

@abey79
Copy link
Owner

abey79 commented Mar 12, 2021

vsketch uses the unit circle convention: zero angle points to the right and positive angles extend counter-clockwise. In this regards, the output of your code is as expected. You were instead expecting the "compass" conversion (0 angle pointing top, positive angles extending clockwise).

I will clarify the documentation on this.

@bcongdon
Copy link
Author

Ah, I see. That makes a lot more sense now, thanks for the clarification!

@abey79
Copy link
Owner

abey79 commented Mar 13, 2021

No worries.

I'm going to reopen this issue so I don't forget to update arc's documentation.

@abey79 abey79 reopened this Mar 13, 2021
@lenary
Copy link
Contributor

lenary commented Apr 3, 2022

This caught me out too, because the +y direction of the unit circle for arc and the +y direction for coordinates do not match, if you use vsk.size(…, landscape=True, center=False). In this case, Increasing y takes you "down" the page in coordinate space, whereas for your unit circle increasing y takes you "up" the page.

@abey79
Copy link
Owner

abey79 commented Apr 3, 2022

I agree this is not ideal. I should add this to the list of breaking changes to make pre-1.0.

@abey79 abey79 added this to the release 1.0.0 milestone Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants