tqec icon indicating copy to clipboard operation
tqec copied to clipboard

Normalise coordinate systems

Open nelimee opened this issue 8 months ago • 12 comments

Is your feature request related to a problem? Please describe.

We have several co-existing coordinate systems in tqec. In a recent improvement (#454), we named explicitly the coordinate system in which each coordinate in tqec is expressed, and the goal is to never use Position2D but rather use one of its subclass that explicitly encodes the coordinate system.

One problem that is still around is about the orientation of axes. For historical reasons, most (all?) tqec coordinate systems have the Y axis pointing downwards:

O ----------> X
|
|
|
|
V

Y

This is the direct cause of #463 and is a recurrent source of mistakes in PRs.

Describe the solution you'd like

Only use coordinate systems where the Y axis is pointing up, as this seems like what is intuitively expected by most of the developers.

Additional context

Note that issue PR will likely introduce a lot of small and tricky changes, and there is a high chance of silently missing some code that would still expect a downwards Y axis. For this reason:

  • extra care should be taken and reviewers of the PR should likely re-review the whole code-base for missing changes multiple times,
  • we should wait for the code base to be stabilized (layer approach in main, previous approach removed from main, extensive tests).

nelimee avatar Mar 17 '25 07:03 nelimee

My vote is to keep the Y-axis pointing downward, mainly because this is a well-established convention in computer graphics, and since we expect the tool to interoperate with other, graphical programs, it would be good to try to stick with the convention.

smburdick avatar Mar 22 '25 02:03 smburdick

Can we make consistent the RGB axes in SketchUp with XYZ axes? That gets my vote.

On Fri, Mar 21, 2025, 7:36 PM Sam Burdick @.***> wrote:

My vote is to keep the Y-axis pointing downward, mainly because this is a well-established convention in computer graphics, and since we expect the tool to interoperate with other, graphical programs, it would be good to try to stick with the convention.

— Reply to this email directly, view it on GitHub https://github.com/tqec/tqec/issues/520#issuecomment-2744910601, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKAXTAMDRZXN6PMTENWEHT2VTEEPAVCNFSM6AAAAABZEZC7AWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBUHEYTANRQGE . You are receiving this because you are subscribed to this thread.Message ID: @.***> [image: smburdick]smburdick left a comment (tqec/tqec#520) https://github.com/tqec/tqec/issues/520#issuecomment-2744910601

My vote is to keep the Y-axis pointing downward, mainly because this is a well-established convention in computer graphics, and since we expect the tool to interoperate with other, graphical programs, it would be good to try to stick with the convention.

— Reply to this email directly, view it on GitHub https://github.com/tqec/tqec/issues/520#issuecomment-2744910601, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKAXTAMDRZXN6PMTENWEHT2VTEEPAVCNFSM6AAAAABZEZC7AWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBUHEYTANRQGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

afowler avatar Mar 22 '25 03:03 afowler

Only use coordinate systems where the Y axis is pointing up, as this seems like what is intuitively expected by most of the developers.

My vote is for this as I expected this when I was trying to understand the issue. https://github.com/tqec/tqec/commit/ed22572e121c7cc36cee3dfd0a235a2a91be4c0e#r153351194

But I am also fine with the option in Austin's comment.

ETA: @nelimee Once the convention is decided upon, I wouldn't mind working on this as a fix for #469

purva-thakre avatar Mar 22 '25 14:03 purva-thakre

Can we make consistent the RGB axes in SketchUp with XYZ axes? That gets my vote.

I think that is what is proposed. Looking at the SketchUp axes, when Z is pointing toward me, X goes right and Y goes up.

My vote is to keep the Y-axis pointing downward, mainly because this is a well-established convention in computer graphics, and since we expect the tool to interoperate with other, graphical programs, it would be good to try to stick with the convention.

Turns out I do not care that much about the specific convention used, but intuitively I find myself assuming that the Y axis is pointing upwards when coding. Seems like I am not the only one, and that led to multiple issues, hence this issue.

nelimee avatar Mar 22 '25 16:03 nelimee

I think that is what is proposed. Looking at the SketchUp axes, when Z is pointing toward me, X goes right and Y goes up.

Uh, no, In SketchUp, X goes right, Z points up and Y is pointing away from me.

Image

purva-thakre avatar Mar 22 '25 16:03 purva-thakre

I think that is what is proposed. Looking at the SketchUp axes, when Z is pointing toward me, X goes right and Y goes up.

Uh, no, In SketchUp, X goes right, Z points up and Y is pointing away from me.

Image

Yes I have the same. I think my message still holds. When Z is pointing towards me (i.e., looking the XY axis from the up), X points right and Y points up.

nelimee avatar Mar 22 '25 16:03 nelimee

looking the XY axis from the up

Well, here the position of the viewer matters. So, it's better we decide on this convention and stay consistent to it.

https://github.com/tqec/tqec/commit/ed22572e121c7cc36cee3dfd0a235a2a91be4c0e#r153351194

purva-thakre avatar Mar 22 '25 16:03 purva-thakre

Forgot to update that based on the discussion during meeting number 47, the Y axis should point up.

purva-thakre avatar May 21 '25 20:05 purva-thakre

Should we prioritize this issue before the first release?

purva-thakre avatar Jul 15 '25 15:07 purva-thakre

Should we prioritize this issue before the first release?

I think so, that would be nice. I am pretty sure this will be complicated though.

nelimee avatar Jul 15 '25 16:07 nelimee

@inmzhang Since you will be the reviewer for the corresponding PR, are you in agreement with the Y-axis pointing up? https://github.com/tqec/tqec/issues/520#issuecomment-2899205381

purva-thakre avatar Oct 06 '25 08:10 purva-thakre

@inmzhang Since you will be the reviewer for the corresponding PR, are you in agreement with the Y-axis pointing up? #520 (comment)

I agree, this will conform to the right-hand coordinate system.

inmzhang avatar Oct 06 '25 10:10 inmzhang