I have a few issues with drawing origins in Kicad.
By pressing the space bar, it’s possible to change the origin, which is very handy. However, after pressing the space bar, if I try to edit the coordinates of any components, they are related to the origin of the drawing area, which is the top left corner.
Let’s suppose I want to design a board that can be plugged onto a Raspberry PI. In this case, it would be very handy if I could for instance set the origin at the bottom left corner, and then be allowed to get all the coordinates accurately from there. For instance, I could edit the position of the bottom-left hole and set it to (3.5, 3.5) to position the hole exactly. Then, to setup the second hole, I could set the origin at the center of the first hole, and set the coordinates of the second one to (0, 49), etc…
Is there a way to do that?
Is there a way to invert y to have it upwards?
Is there a global setting of the origin, other than the top left corner of the PCB drawing sheet, so that
all the coordinates are changed accordingly?
The space key only marks (sets to x=0, y=0) the current cursor position. An excellent tool for relative positioning. In any case the space key does not move the mechanical origin.
Drawing precision board outlines and key part positions is better done in a 2D CAD tool like LibreCad or even a parametric 3D application like FreeCad, then import as a DXF file.
For historical reasons KiCad uses a top left origin, this is the way computer graphics mapped screen memory
I wasn’t asking for a change of the mechanical coordinates inside of the files, but just in the GUI.
What I was thinking (but didn’t explain accurately enough), is that there is an internal set of coordinates which are measured from the top left corner of the sheet, downwards for Y. Let’s call it AbsOrgX, AbsOrgY.
And when pressing space bar, Kicad could temporarily store a user origin that we can call UOrgX, UOrgY.
When editing a component (let’s call its coordinates CX and XY related to the abs origin), Kicad could display them from my user origin (i.e. instead of displaying Cx, Cy, it could display Cx - UOrgX, Cy - UOrgY).
Then if I want to edit them in my user origin, I would key in 2 coordinates Kx and Ky, and Kicad would store them as Kx+UOrgX, Ky+UOrgY, which are back to the absolute space.
And this could even allow to invert y (with a checkbox) and be fully compatible with the existing files because nothing would change internally.
I made a board last time, which is plugged into an STM32F469 discovery board. I made a mistake, actually a few of them, but mostly one important one. As you can see, the difference with the measured values and on Kicad differ, especially the x positon of the STM32 board’s arduino connectors. Fortunately all of them in the
same direction. I didn’t make a spreadsheet the first time, and calculated everythig too quickly because I was in a hurry, but this mistake wouldn’t happen with an interface as mentioned above. I can fit the 2 boards because there is only 0.5mm difference, but it’s a bit hard.
The conversion relationships are:
Dx =Bx-147
Gx = 92 - Cx // Inversion of Y
And they could be done automagically by Kicad with very simple modifications.
There is no support for relative (GUI) coordinates in kicad right now but it is planned for v6. (I seem to remember a discussion on the mailing list but can not find it right now.)
History or not, it would very helpful to adjust that by way of settings.
Quite often bottom left reference is preferable. Mathematically, it sould be easy to move the origin around with a simple offset. Provided KiCad internally is up to that task.
Why do you think the devs consider adding it to v6 if they would not agree with your statement? (Really your comment is not very thought out if you consider the one i made 6 or so minutes before you commented.)
Great! And I think this new feature may appear in the nightly builds. Is this under development? Or not yet in the works? I guess it will need at least a year to get V6, right?
v6 is at least 2 years away. And there is no guarantee this makes it in just because it was discussed over on the mailing list. (The volunteer suggesting it might be held up with other stuff they deem more important like their personal live.)
Meaning the proper answer is: The devs are aware of it. They have a plan to add it to v6. It will be in kicad when it is done.
A workaround is to simply pick a position as “reference position” and then first place a component on that reference position, and then use the “move exactly” function and type in the distances.
You can also place the mouse cursor over your “reference position” and hit space and then look at the dx and dy coordinates to move stuff.
Especially if you use a coarse grid (for examle in whole milimeters) as much as possible this is fairly quick.
Note: The “origin” of the grid can be changed, and while changing the origin of the grid, it snaps to graphical objects, but not to pads or tracks.
( 0, 0) has been in the left top corner for programmers since before GUI’s existed, while CAD programs are more used to having it in the lower left corner.
Mathematicians don’t care. They simply note where the origin is and go on.
In 5.1 “Position Relative To” can use the “local origin”, i.e. the origin set by the space bar. There’s no need to move the item first to a reference position.
I have a set of patches for a pre-release of KiCad v5.0.0 that changes the reference origin to the “Aux” (aka “Manufacturing”) origin to solve this exact problem. Unfortunately I haven’t been keeping them up to date and they don’t apply to KiCad v5.1.2. I’m in the process of updating my patch set now, but this would require you to build KiCad from sources.
I’m hoping my changes will get merged into the KiCad v6 sources, but as Rene pointed out v6 is a couple of years out.