Setting origin of coordinates

It’s useful to manage/be aware of zero point, when you also do nightly builds of PCB’s (home CNC milling) - where and how to adjust PCB layout on available copper laminate

Imperative even, but what does that have to do with this topic?

KiCAD is an EDA tool, that is a design tool. When designing your board it’s absolute position is largely irrelevant. Depending on the method of manufacture various post-processing may need to take place. Whether it be manipulating Gerber files, drill files, or generating a tool path for your CNC mill, this is performed by other, better suited, software. In the case of generating a CNC tool path it is a trivial process to add a work offset, mirror an axis, or swap axis. Not all CNC equipment is the same, for that reason most CNC equipment have built-in commands to do just that. So why would anyone expect the coordinate system of their EDA tool to match their CNC mill?

I’m not familiar with the machines (mills, photoplotters, laser etchers, CNC drills, etc) that may take over from where KiCAD (or any other EDA tool) leaves off, but I can’t imagine a situation where having the coordinate systems aligned is a disadvantage.

In the same way, the board designer is also a recipient of the KiCAD data and it would be helpful if the data is presented in a form that he can easily process - such as defining a co-ordinate system that doesn’t require additional interpretation or processing for the designer to make sense of it.

Dale

Could you elaborate a bit on what you mean by this?

Perhaps my POV is simply skewed by the fact that I am used to working with different coordinate systems and translating from one to another is just a fact of life. Whether it’s KiCAD, 2D CAD, 3D modelling, 5 axis cnc machining centers, industrial robots or laser guided vehicles. So KiCAD’s coordinate system is just another coordinate system to me and perhaps I don’t notice it as much as others might.

Probably that.
Imagine your average hobbyist: standard expectation = left/bottom to top/right with the origin at left/bottom.

I, like you, have no real problem with different coordinate systems, but from time to time the inverted y-axis and using the relative readout as the only means for a user-defined-origin while not being able to leverage that in the dialog boxes for coordinate input is no easy pill to swallow.
On the other hand, those things didn’t upset me that much so that I was inclined to actually look at the source and try to solve these problems. :pensive:

I’m curious about the origin of this expectation. (Pun intended) :wink:

That’s not entirely true, when making your relative measurement from your user-defined origin (using the space bar) the absolute coordinates are displayed right next to the relative coordinates. Those are the numbers you use as input to the dialog boxes. Relative movements of an item are also made easier by the “Move exactly” feature in the OpenGL canvas.

The reason for the expectation is that people draw an x-y graph with the origin bottom left

The reason for what KiCad and a lot of other software does is television. This scans left to right and top to bottom.
Originally the computer industry used tv displays and crt monitors based on tv technology, so the top left origin has stuck

I’ll speculate that’s a cultural thing that was well-entrenched before I, my wife, and all of our kids formally encountered it in elementary school. (And then it was vigorously beaten into us in the High School math courses.) As I recall, this is sometimes called a “right-hand coordinate system”.

But . . . when people from Western cultures WRITE on a page, we start at the TOP left, and proceed to the right and DOWN. This is, of course, contrary to how we construct graphs.

Other cultures compose their written pages differently. This seems “unnatural”, or even “wrong”, to some westerners but it seems to be quite effective within their own cultures. The problems arise when an individual must frequently change from one way of thinking to the other.

Dale

1 Like

My original issue (I’m the original reporter…FYI new guys:))) is when I get the drawing attached from mechanical designer, I have to place components to exact given places.The conversion of coordinates needs some base maths. It would be easier if I could directly enter the numbers from the drawing into Footprint properties fields. Not a big deal only some comfort.

1 Like

Well this is a generalization that is true only when the data being graphed permits. That is when the range of data being graphed lies completely within the first quadrant of the Cartesian plane we tend to ignore the other quadrants. But when any of the data lies outside the first quadrant you need at least two quadrants and the origin can no longer be bottom-left. But if you’re suggesting this generalization is the basis for expecting the origin to be bottom-left then, okay, I understand where you are coming from, even if I don’t entirely agree. :slight_smile:

Actually, raster scanned images predate computers and even television. The first facsimile machine that transmitted raster scanned images predates ENIAC by 100 years and television by about 60 years. I don’t know why television and/or computers always get the credit/blame for raster scanning. The top-left origin was well established long before the first computer program was written.

Perhaps I’m just showing my age by being just as comfortable with either coordinate system. :wink:

I’m all for more flexibility for users: if anyone needs to move coordinate origin (I do) they should be able to do so. Many commercial ECAD tools allow that. But as KiCad is an open source project users can only hope someone with appropriate skills would care enough to implement that feature.

This is the reason: https://en.wikipedia.org/wiki/Cartesian_coordinate_system :wink:

I agree, and KiCAD does support this to an extent using the space bar. But there still has to be an underlying fixed coordinate system used internally by the software. I guess there are two issues involved here, the location of the origin and the direction of the Y axis. If you select the top-left as your origin would you expect the direction of the Y axis to be up or down? If you then change the origin to the bottom-left would you expect the direction of the Y axis to remain the same or flip?

Your example drawing shows relative distances all, except for a few exceptions, relative to the top-left.

“Dream mode ON” :slight_smile:
I’d like KiCad to allow user to select both origin of coordinates and direction (polarity) of axis
“Dream mode OFF”

But if it just followed the world standard Cartesian coordinate system with ability to just move the origin that would be a great improvement.

2 Likes

In fact in the footprint and library component editors the origin can be changed by setting the anchor point (Anchor tool button), and all the objects have their coords moved accordingly. I set it to back to desired final position after editing.

It would certainly be nice if “set grid origin” in pcbnew did the same thing, and then it would better match it’s description.

3 Likes

What do you mean “relative distances”? Absolut is also relative: relative to [0;0].
I’ve asked MCAD guy to make the drawing relative to upper and left edge (most of dimensions fit…only some of them don’t). If my board’s top left is at [0;0], most numbers from the drawing go directly to FP properties x;y coords. If my board’s top left is not [0;0], I have to displace the dimensions.

They may be absolute as far as your drawing is concerned but as soon as you add it to your board they may no longer be absolute, they are however, always relative. Another reason why I referred to them as relative is because I do not know what the edges of your drawing represent. If they are the board edges then they are still relative to the board edges but not likely absolute within KiCAD.

In any case, my point is you have the relative dimensions. Put the footprints at the point that those dimensions reference, ie if it is the top-left corner of your board then put the footprint there. Now use “Move Exactly” and enter the numbers that are on your drawing. You’re done, and no math involved.

One very easy workaround for this problem is to move the board to the 0,0 point, then do your operations that is easier to do when for instance a board outline corner is at 0,0 and when you are done move the board back to a nice looking place in the middle of the drawing.

Drawing the outline (or at least one corner) with a grid like 1.00 mm or larger, makes the board easier to move to 0,0 and back again (being on the same grid)…

1 Like

You are right, Magnus, this is exactly what I do, except that I don’t do manual move, but a Ctrl-M with a [+20;+20] displacement. If I still need to convert coordinates, let it be easy.
Still, from the viewpoint of how hard to make it:
relative coords are existing, they are initialised by Space, they are displayed on bottom status line.
Some --I think not too hard-- modifications needed:

  • All coordinates given by numbers (e.g. at Footprint Properties - Position - X,Y) are counting in relative coord system.
  • Let relative coord origin make to survive: save and restore to/from .kicad_pcb or .pro file.
  • Make a hotkey (e.g. Ctrl-Space) to reset relative coords for convenience.
    (Stored coordinates may be in original absolute system, a displacement is only needed when displaying and editing numerically)
2 Likes