Inverted Y-Axis in Part Library Editor

Huh, I never noticed that. Cool.

The consequences of the various KiCad programs starting off as independent applications, written by different people.
Backwards compatibility stops any change now, so the best we can hope for is some accurate and clear documentation explaining the rules

Won’t the lib format be redone and replaced by something like .sweet?

Slightly OT, but historically graphic displays have always been rendered by hardware with (0,0) at top left. This precedes pixel graphics, it goes back to character generators (e.g. MC6845). Probably makes sense for character displays which are read top down.

I think it is coincidence that the CRT scanlines also proceed top down. If the refresh rate is high then is shouldn’t matter, although the very first TV systems used some very slow scan rates. But even the original mechanical TV with a scanning “Nipkow” disc had a hole pattern that scanned top down.

There is no particularly good reason that applications written in the past 30 years should not fix the axis, it saves a small calculation when drawing which is nearly insignificant. Every PC application I wrote since the start of Windows (3.1) I have always put the Y axis to match a “normal” XY layout. All modern window managers seem to allow custom transforms, so it is almost transparent to application code.

History aside… I tried to find the spec for the new library format but failed, I am sure Wayne posted a link to it on the dev list. Anyone have a link ?

1 Like

Something here, but five! years old
https://github.com/blairbonnett-mirrors/kicad/blob/master/new/sweet_spec_for_schematic_parts_EN.fodt

Presumably this will be another directory plus file per symbol approach

Discussion is informative, thank you all!

That’s easy - KiCad is using a Screen Coordinate with the upper left at (0,0). Technical drawings such as in datasheets are in a 2D Cartesian coordinate. In the distant past using the screen coordinate system may have provided some small advantage when calculating coordinates for drawing and testing for a ‘hit’ but I have no idea what the historical reason is. At any rate we can bet that this won’t change because it would involve a huge change in the code (plotting, printing, 3D rendering and export, etc).

That depends on how you define “points”, as the pin doesn’t actually have any arrows on it. It could be considered to be “pointing” towards the symbol. I would agree however, that it would make it more intuitive if a “left” pin was placed on the left side of the symbol.

X mirrors about the ‘X’ axis, Y mirrors about the ‘Y’ axis, anything else would be weird.

No, it scrolls the object being viewed to the left. Not that uncommon, sometimes you can choose whether you scroll the viewport or the contents.

And that is still how it is today. Most raster scan graphics systems have the origin at the top left as this position corresponds to the first memory location in hardware. And the display hardware usually scans left to right, top to bottom regardless of whether it is a CRT, LCD or even a printer. Most modern day software maps a different coordinate system onto the hardware, some even let you choose the coordinate system. But you can’t always assume it’s the cartesian coordinate system.

I guess you must be the “everything should be backwards, normal = weird” person KiCad is designed for :slight_smile:

Well I’m sure that in geometry class you were never told to “flip in Y” but rather “mirror about X”. Flip in Y is ambiguous at best, where is the mirror line? KiCad definitely has that one right. The other two I wouldn’t argue either way, but I do think left/right and up/down pins would be more intuitive if they were reversed. But there are a lot of other things I would rather see fixed first.

Just wanted to add my 2 cents worth here. This is another inconsistency with Kicad, relative to numerous other mechanical (EG Autocad) and Electrical/Electronic (eg Protel 99 and Altium) CAD packages. The bearing on how pixels were/still are presented graphically onscreen to me has little relevence. X/Y coordinate signs are well established for all 4 quadrants (long before computers too…). Even when a CAD package is only working in the single quadrant, the signs are both positive. This discrepancy in Kicad in my humble opinion should be corrected to
A. be mathematically correct and
B. Eliminate confusion for people experienced in other CAD packages, who opt to try out and use Kicad.

Thank you.

1 Like

KiCad is “different” in many ways; much of those being good ways.

This one issue is a minor quirk that the vast majority of users can easily deal with.

Negative Y from the top left is surprisingly common in computing and video processing and is a historical consequence of the way television CRT displays scan.
eg the Java 2D origin is top left

The convention of 0,0 being top left and ‘Y’ being positive “down” was indeed established long before computers.

Out of curiosity, have you asked Microsoft to change “Paint” or do you just adjust to it? How about Gimp? Or Photoshop? Shall I continue? I know you’re going to say that these are graphics programs and not “CAD” programs but still you can adjust to using them without any issue so what is the problem? Sure KiCad it is not like Altium, but so what?

2 Likes

The details are quite indefinite in my superannuated cerebrum, but I DO recall considering, for a day or two, in High School math (either advanced algebra, or calculus) the characteristics of alternative coordinate systems - including polar, cylindrical, and the distinctions between “right-hand” and “left-hand” Cartesian systems. Even had some homework problems dealing with coordinate system transformations, though I never figured out how to transform a polar bear into a cartesian bear.

About the same time I became acquainted with the NTSC system for representing an image by a sequence of horizontal scan lines - and the lines were always numbered from top to bottom. It was many years later, in a class on image processing, where the “downward positive” convention for the Y-axis was used almost exclusively in calculations. That practice may be unfamiliar to you but it is just as correct as “upward positive”.

In the interest of “diversity”, please be sensitive to your choice of words! It’s not a “minor quirk”, it’s a “charming idiosyncrasy”. :wink:

Dale

2 Likes

b : a peculiar trait : idiosyncrasy

Definition of quirk
1 a : an abrupt twist or curve
b : a peculiar trait : idiosyncrasy

Fairly certain I used the correct wordages, and just used fewer typed letters.

I think this was an attempt in humor by @dchisholm not a correction.

5 Likes

Yes, Jim (@Sprig) and I are poking fun at each other.

Dale

2 Likes

@witenitenz
Just remember, KiCAD has bigger fish to fry than reworking any and all code that deals with the coordinate system and being an open source project most of us here using it are thankful that we got it how it is.
If enough people feel strongly about it they can set out and change it. Just get your hands dirty, no one is stopping you.
Most everyone else is accepting the status quo for whatever reason and gets on with life/work.
So don’t be too sad that a lot here will not agree with you.
:wink: