Dimension Constraints

Does anyone know if there is a way currently, or perhaps something in development to be able to apply dimensional constraints to footprints or traces? For instance, I have four mounting holes that I want to lock in place 100mm apart from each other at 90 degree angles. I think the way it’s handled in CAD/CAM programs with constraints to lock things horizontal/vertical, add distance constraints, parallelism, etc. would be really useful. Just a thought…

When I want to lock multiple holes relative to each other, I put them into a footprint. I am not sure that I have done that with KiCad but I think that would be my first approach.

Here’s how to do it:

  1. Create a New Footprint
    • Add a useful drawn item to Dwgs, Silk, Margin… other
    …Example shows a Guide-Ref Line on the Dwgs layer to line up with the PCB’s right edge
    • Add your Holes for mounting and other - Draw them on Dwgs layer (could use other layers, too)
    • Save the Footprint

  2. In a Text Editor, open the Footprint’s .mod file and edit the layer names for the Holes/other items you want on the Edge.Cuts layer.
    Save it.

  3. Now, use it like any other footprint. The guide line will help to place it.

Note: Dimension Tool only gets the positions on selected item/handles, it does not constrain them but, you can set your Grid and place them where wanted and can edit the individual items (in Footprint editor) and set their location).

Images show:
Footprint in Editor
.mod file being edited (Dwg changed to Edge Cuts)
Results

The problem with having a large footprint just to group things together is that it gets selected by accident, so much that it’s very annoying and useless.

In 5.99 you can group items. Then they are all selected when you click on one of the items and they can’t be moved separately by accident.

But this is different than using constraints when placing items. There have been plans for some kind of constraints which would be useful especially for creating footprints because datasheets usually offer dimensions like constraints rather than with coordinates. But KiCad will never be a generic 2D CAD.

1 Like

Thanks, guys. I like the footprint method as a helpful workaround, but for fast workflow and precision, it would be really cool to have some simple dimension tools in Pcbnew. Maybe a feature request to be considered? The other reason I think a tool-set, rather than creating custom footprints would be useful, is that it could be used for other components too – not just for holes or board features. Custom footprints wouldn’t really scale if you want to precisely place everything on the board across multiple projects. Being able to quickly align and space components at a specific distance relative to other features and components without relying on clicking and dragging things to the grid would be very useful.

In such cases I just enter the X,Y positions by hand. And it is the reason I am working with my PCBs around absolute 0,0.

I have big footprint of shielding box (BMIS210). To avoid it being all time selected I keep it out of PCB for design time. Having its position as 0,0 helps to get it back for a moment I need to see it and then I put it out once more. And so on.
Fortunately I could tell DRC to ignore CrtYd as even lines were not crossing I get Error message for each element inside shield.

@BlackCoffee, Doesn’t a footprint need to be associated with a symbol on the schematic ? What symbol would you use on the schematic for four mounting holes in the board’s corners ? Or am I overlooking something?

No. A footprint does not need to be associated with a schematic/symbol unless user wants it.

I seldom make schematics as I most often use a hand-drawn schematic and go straight to PCBnew.

If you want a symbol in schematic, it’s easy to draw one in eeschema and associate it with the Footprint (even though there may be No electrical connection.

EDIT: Oh, there are many Mounting Holes already in Kicad footprint library - example below. And, you can associate them with a Symbol on the Schematic…

Screen Shot 2021-02-26 at 3.22.43 PM

Screen Shot 2021-02-26 at 3.22.57 PM

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