-
Notifications
You must be signed in to change notification settings - Fork 31
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
canvas: Change to rh coordinate system #502
Conversation
0a94d39
to
df174ba
Compare
I don't have any particular opinion about this as I haven't and don't have the need to use 3D. However, I would like to get feedback from users about this before merging as I assume it could be a large breaking change (although easily fixed just annoying). A thread on the discord server would work :) |
Before, z was sheared by 0.5. Now, it is instead scaled by 0.5. I am not sure what the effect of that difference is. Other than that, the sign is swapped, and this looks good to me! |
That is actually a typo. |
df174ba
to
56b8d59
Compare
3D users I know of that already use a rhs system by manually transforming coordinates:
|
Change the default transformation matrix to have z coordinates of zero after transformation. This is actually a fix, as the final 2D projection should not have a z-value other than zero. With this change, anchors in 3D space become 2D and thus elements like rect, Bézier or Catmull, … will correctly work when using them with anchors to 3D elements. Intersection between 3D elements will also work (in 2D space). See: #502 and #493.
56b8d59
to
2c6561d
Compare
Ping. |
For what it's worth I did a lot of 3D plots in TikZ and first thing to do is always using the keys By the way is the default really left-handed in TikZ? I have no memory of that and trying this:
gives the following which looks right-handed: |
You would do that using |
I was honestly very surprised to see the default being a left handed coordinate system. Throughout my 5 years engineering education I have not once used a left handed one, nor seen anyone else do it. Are there any fields in which it is not just implied that coordinate systems are right handed unless otherwise specified? |
2c6561d
to
bfdbdbe
Compare
Okay I've seen a few comments on discord as well, I'm happy for it to be merged once its been updated |
This is a breaking change for code that uses 3D coordinates!
Right hand sided coordinate systems are more common. Cetz currently uses lhs because TikZ does so by default. But TikZ also makes it more easy to change the system by having x, y and z arguments to the tikzpicture/canvas.
Question: Should we add
x
,y
, andz
arguments tocanvas
to make setting up a customcoordinate system simpler?
An alternative would be providing helper functions to set up axes:
Such function would override the current transformation matrix.
The proposed x, y and z arguments would be able to do the same (accept number or vector).
The proposed arguments or functions are not part of this PR but a proposal for a follow-up PR.