Flipping the Y axis

My two biggest complaints about KiCad have been (1) the PCB coordinate origin is the upper-left corner of an arbitrary “page frame” around the board rather than a point on the board, and (2) the Y axis increases down then screen instead of up.

The PCB coordinate origin thing annoys me badly enough that I have source patches to fix this. My intent is to have these patches merged into the v6 release, and I’ll probably make them available as source patches for v5. The current plan is for this to become a user-configurable board attribute, so if a team of people works on a board they’ll all see the same board origin without having to change user preferences.

But let’s talk here about my second biggest gripe: the Y axis direction.

I could fix this at the same time I fix the board origin issue. My patches already do this, and this could also be a board attribute. However, the potential would exist for some boards to have the Y axis increasing down the screen, while others would increase up the screen. Would this end up being more confusing to users?

How about footprints? Do footprints need to have the Y axis direction as an attribute? Then you’d have some footprints laid out with different Y axis directions.

It might be better for the direction of the Y axis to be a user preference thing, like the choice of inches vs millimeters. Then you risk having two people talking about the same object using different terms. But is this any worse than the in/mm thing?

What about schematics? If the Y axis increased up the screen, we’d probably want the origin to be in the lower left corner rather than the upper left. Would this switch automatically? Or should it be user-settable, like setting the Aux origin in Pcbnew? Eeschema internally supports an Aux origin just like Pcbnew but there is no way to set it, presumably because there was never a use for it.

As annoying as the Y-axis thing is, I’m now beginning to wonder if it would be better to just leave it as it is, at least for now. It’s much less of a problem to me than the board coordinate origin thing.

What do others think?

Edit: I’ve pretty well abandoned the idea of using board attributes to store either the choice of origin or the direction of the axes. The plan now is to make these user preference selections.

3 Likes

handling of user controllable origins see: https://bugs.launchpad.net/kicad/+bug/1773638

1 Like

Rene, that’s the bug report related to the display coordinate origin. Wayne and some other of the lead developers and I discussed my proposed changes at KiCon and I think we’re all on the same page.

What I’d like to discuss here is the Y-axis direction, which is a related but different issue.

Would it not have been a lot easier, to not move the grid at all, but to only shift the location of the page frame? Without the page frame there is no reference for a user whether he is moving the origin point, or the PCB itself, and he therefore can not distinguish between them.

I do have a (small) preference for positive Y to go up, and it will be confusing if on a part of my PCB’s the Y direction is reversed. To me it does not matter if the coordinates in the file coincide with the coordinates on screen, though it would be logical to use the same coordinates for both, and this may be important to some.

Best solution I see is to make it user configurabe and a setting among the preferences. (Maybe only for the legacy boards), and then when an “old board” is saved while “Positive Y goes up”, it uses that coordinate system to save the board.

4 Likes

If it is user configurable then the file format will simply stay at one defined system and only the abstraction for the user changes. It does not make any sense to have the coordinate system changing in the files depending on user settings. In fact i would veto any such suggestion as it would make the maintainance of the official lib a nightmare.

3 Likes

That’s a good question. I’m sure it would lead to some confusion. I can’t decide whether the option should be available or not. I didn’t like the “wrong” axis direction but had to learn it, and I’m not sure I would like the chance to change it at will. And I’m not sure if it should be a project thing. Communication between people is one thing, but confusion may arise also if one person swithces between projects and suddenly the axis direction changes. It may actually cause more confusion than per-user setting.

3 Likes

My patches don’t change anything about the coordinate values saved in the board files. They only translate the coordinates to a user-selected origin for display and user editing.

Initially I was thinking that the coordinate origin and the axis directions should be an attribute of the object (board, schematic, footprint, etc.) so that if two people edited an object they’d see the same origin and axis directions. Now I’m leaning toward them being user view attributes.

1 Like

Please do not add any further cruft to the file than there already is. (And yes this is a reference to the comments @Seth_h made at the kicon panel. https://www.youtube.com/watch?v=NRwTyBX2BFk&t=270s at around 15:20 minutes in.)

Oh geez… I didn’t realize I had such a big bald spot! :astonished:

I’m the one who asked the follow-up question about the unnamed net numbering. I’m hoping to propose some changes to reduce the amount of “noise” that gets saved in files that need to be revision-managed.

1 Like

The Y direction downwards being positive is quite confusing sometimes though not unovercomable. I for one would like to see it corrected. But it seems that part of the discussion above is directed towards changing the file format to accommodate a variety of choices for schematic/board editor and team members. That, imho, would be a total disaster.

As @Rene_Poschl mentioned above, he’d veto a file format change. I have no veto rights here, but I would veto that change if I could. The file format should stay as is, Y-axis positive going up or down is just a user facing change/interpretation. Addiitonally it should be a system-wide setting; i.e. no choices for one editor this way and another editor that way.

Confusion between team members who have a different preference setting is hugely over-estimated imho. If I were to work briefly on someones workstation, it would be a matter of switching the preference setting for as long as I work on it and switch it back when I leave. At any rate, this would not occur often so please don’t design for edge cases.

@RRPollack thanks for making these changes, thanks for asking opinions and looking forward to use your work!

2 Likes

Y axis being downward has been a tradition of computer sciences since before GUI was a thing and it’s a staple of most 2d painting / cad programs. It being up is rare and unusual if you ask me but I suppose it is a matter of what an individual has most experience with in the past.

But I’ve thought about the coordinates origin thing and just can’t think of a reason why that would matter? If you need it to be inside or in the corner of the board for some reason just edit your frame template and shift it so that (0,0) is inside somewhere. What is the issue here?

OH MY GOODNESS!

What if the page frame was treated like a Footprint with an anchor that could be moved in relation to the main KiCad Origin (I’m not sure this is the proper term).

This would allow for any user configuration of what is displayed in the relative positive of the anchor of X and Y axis as positive and negative numbers; or in the case of a center anchor, both X and Y having positive and negative numbers.

Origin location for a US Letter 8.5x11in sheet of paper.

Origin

1 Like

Well, in MY past the Y-sense was positive-up going back to when I first started drawing graphs in elementary school (probably about 9 years old). In High School Advanced Algebra I think we spent a couple days talking about alternative ways to construct coordinate systems, and using matrix operations to transform between coordinate systems. It wasn’t until a college class talked about image processing that I saw a positive-down Y-sense in actual use,

My general conditioning has been positive-up, but if I’m warned about a positive-down Y-sense I can make my superannuated brain think that way. When I first started with KiCAD it was an “annoying quirk”, but it has migrated to “charming ideosyncrasy” status. Even so, if I haven’t worked in KiCAD for a month or more I have to keep reminding myself about the Y-sense for the first few hours of using KiCAD.

Dale

1 Like

Have you ever seen a graph where positive was down?

It happens in electronics for some legacy assumptions when there needed to be a choice between two options and the technology did not yet exist to explore the details to know the difference.

I was working in positive down video addressing at university 40 years ago, TV has always been left to right and top to bottom and it has stuck in computer graphics and then later with digital video compression.

2 Likes

I don’t recall seeing a positive-down graph when the graph was created specifically for a published work. The closest thing I’ve seen to a positive-down graph would be an exercise done in the lab for an introductory circuits class. (For most folks in Electronics Engineering curricula, this happens in the first term of Sophomore year.) Students produce the V-I characteristics of resistors and diodes using a basic school oscilloscope configured as an X-Y display. Because a resistor is used to sense current, and the two 'scope channels share a common ground, one axis ends up with a negative sense.

Dale

2 Likes

You are talking about math, I’m talking about CS. In computers all coordinates increase downward starting with pixels on monitor and ending with text lines in text vga mode.

Not any. Just any change that would add even more “cruft” that would make using git or other version control systems harder.

The current kicad coordinate system violates the typical right handedness of mathematical coordinate systems. Most CAD programs however follow that right handed coordinate system. (Freecad, Catia, Libre cad, Auto cad, Eagle and altium do it for sure. I would guess nearly all others do it as well as STEP and gerber use a right handed system.)
See https://en.wikipedia.org/wiki/Cartesian_coordinate_system (Section orientation and handedness)
Or the german version which is even clearer about it: https://de.wikipedia.org/wiki/Rechtssystem_(Mathematik)

You are however correct that pixel coordinates typically go top to bottom which is where i assume the kicad coordinate system comes from.


In conclusion: Yes as seen in this thread having a way to user edit the coordinate direction will be an improvement to kicad. I would however not save it in the project files but in the user specific global settings.

1 Like

I specified 2d, I know that most 3d programs have standard right handed coordinate system. But not 2d.