How do I force footprints to stay on the the grid?

How do I force parts to stay on the grid when I move things around? I thought I understood this but it keeps coming back to annoy me. It is simple enough when you place a part and can grab it by the centroid and move it and it sucks to the grid. And when a part does not fit the grid (eg: inch part on metric grid) you can grab pin 1 or whatever and place that specific pad on the grid when you drag it, even though the rest is off grid – I have no problem with those special cases. Yes, I know that the grid can be turned off or control key used, which is really handy for tidying up silk. And I realize that when dragging a selection you need to grab a centroid of one of the parts, else the whole selection ends up willy-nilly off grid.

I generally work on a subsection of the board (maybe a micro/xtal…) off to one side, place/route/tighten-up and get that little circuit nugget ready. I ensure that all part centroids are on the grid when I work on this nugget. Then I select it all (rotate it if needed) and drag it into place in the board. I am careful to grab one of the part centroids so everything ends up back on grid after the drag move (or so I think). I even zoom in to the part centers to check and see that all is on grid, or at least it looks like is hits a grid crosshair.

I have a board off to fab now, and I am massaging the placement file, and even though I thought I kept everything on my 0.125mm grid, I have some parts that ended up at 41.837452, 97.537548 and such. I realize that this is just me being anal and perfectionist, but it drives me crazy that I don’t have the control I want during layout.

I wish (and am hoping there is a setting for this) that I could force parts to always stay on grid unless I tell it otherwise. I don’t care about the traces, and push-n-shove (which is awesome btw) takes them wherever need be to ensure clearances, and that is no problem. I just want a clean and predictable pnp file with centroids on the grid. Yeah, yeah, let the ocd comments fly :}

Am I missing a fundamental setting?

I have done some PCBs using KiCad V5 and had no problem with having all footprints at grid. I work with 0.1mm grid. I have worked with V6 only one day few months ago.
I don’t suppose I rotated a selection ever. Who knows may be it is rotated against a center of selection and if you use grid 0.125 and footprints (crtyd) are rather keep at 0.1 or 0.05 grid than may be the selection center is out of grid and used as rotation point. Sorry for not checking with KiCad what I am writing but I am at Win7 PC now and V6 needs Win10.

Hmm, my parts snap to grid by default. In Preferences > PCB Editor > Dsplay Options > Grid Options there are settings for the grid. Mine is set to snap to grid when grid shown. What’s yours?

Hi @teletypeguy
It is best to use the terms “footprints” and “symbols” to avoid confusion about whether the PCB or Schematic is involved.
“Parts” is not a great description.
I’ve edited your title for future reference by members.

Nothing wrong with a little OCD :grin: :grin: :grin:

By coincidence, I came here to ask the exact same question. Here’s what I’ve figured out:

Conclusion

The rotation tool uses the center of the selection as the pivot, which leads to off-grid movements.

The rotation tool can be forced to use a specific footprint as the pivot by first using the move tool with “Warp mouse to origin of moved object” enabled, and then switching to the rotation tool.

If the pivot is on the desired grid, and the desired grid is active, then the footprints in your move or rotation will also be on the desired grid.

If you are not careful to meet both these conditions, you will have off-grid footprints.

Experiments

Setup

First off, you’ll want to make sure that “Warp mouse to origin of moved object” is set (which it sounds like you do):


Anyway, starting out with a few resistors on a 1mm grid:

Rotated, they’re still on the grid:

Let’s offset one of them 0.5mm:

Rotate around group center

Select them all, press “R”, :sob:

In this case, the rotation happens around the centerpoint of all the footprints combined, and ends up way off-grid.

Rotate around footprint center

Ok, let’s revert, select all, hover over the center footprint, press “M”, press “R”, :white_check_mark:

In this case, pressing M snaps the cursor to the nearest footprint’s centerpoint, the middle footprint. The rotation then happens around the cursor. The middle footprint is on the 1mm grid.

Let’s try that again, but instead let’s make the nearest footprint be the .5 footprint, :sob:

In this case, the rotation again happens around the cursor, but since the closest footprint to the cursor is the footprint on the 0.5mm grid, the other footprintss are now off-grid.

Translate around footprint center

From a reset state, hover over the middle footprint, press M, and move :white_check_mark:

From a reset state, hover over the right footprint, press M, and move :sob:

4 Likes

Thanks @eleven0959 – it made sense when I realized I could select a group, get near the desired centroid, M, and move. And I thought that I had moved the selection to the new location and it was on grid when de-selected. But then many hours and a couple of days later I find a (former) selection group that I had moved, which was now slightly off the grid (I usually use 0.125mm grid).

I am wondering whether there is some setting I have not found that enforces “centroid must be on current grid” or something like that.

Yes, @retiredfeline, my grid is set to ‘snap to grid when grid shown’ and I realize that toggling the grid off means that any moved stuff will be off grid, so I am careful to keep grid on except when I need a tiny tweak and then turn it right back on. But that is possibly what happened to me.

On a related note: is it possible to group (like inkscape or ai) a selection? Maybe this micro with bypass caps, xtal stuff, and related starter traces and keep them together as a group (a relative lock)?

Yes
You can “lock” a single item or selection… will not move on board 'till unlocked.
You can “group” a selection… relative lock.

Highlight the selection then right click anywhere in that selection. Up comes a “Select” menu.
“Locking” and “grouping” are both in that menu.

I am wondering whether there is some setting I have not found that enforces “centroid must be on current grid” or something like that.

No, such setting doesn’t exist.

Maybe helpful if you already have moved footprints away from the grid: there is a python-addon somewhere which puts the footprints back onto the grid: “snap selected footprints to grid”. It belongs to some addon-collection (collection-name?? here ends my knowledge)

So if you add to selection the rectangle (at some graphic layer) painted with grid = 2 x (your grid) containing all your selection than the pivot should be in grid.

There are at least two tools which let you rotate around a certain point. Both are in context menu → Positioning tools. Move with Reference lets you first find a wanted center point. Then you can rotate. I guess this is pretty much what normal Move + Rotate does but is more “explicit”. Move Exactly lets you type in the wanted angle and lets you choose the pivot point which must be selected beforehand. This requires to mark the point with for example spacebar (local coordinates origin) and how this works depends on your settings.

I don’t know if these offer any benefits compared with move+rotate, but at least there’s more than one way to skin a cat.

1 Like

So I feel silly now @jmk for not noticing grouping in the right-click menu. Yes, that is dandy. Is the a way to select something inside the group without ungrouping? Say, I want to delete a trace or fatten a trace in the group?

And @eelik I found the Move Exactly tool very handy at times, for precise positioning, rotating something to 45 (or random) degrees… I have not really had a need to rotate about a certain location, as it is easy to move the rotated selection if is not where desired.

Enter the group (context menu).

1 Like

Enter/Leave Group – oh yeah, that is awesome to edit a group. I think I will use this a lot.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.