Constraint based component placement

It would be nice if there were a way to place components on the pcb in a similar manner as mechanical cad systems were you can place constraints between components.

An example of how I would like to use this is I have a hole pattern my LEDs need to protrude from, relative to mounting holes and I would like that to always be perfectly exact rather than having to manually do it now… either by hand or by moving position exactly by calculating it manually (sort of manually doing constraints).

Constraints should probably be between any footprint feature, either the footprint center or a pad etc… or even the courtyard etc…

Constraints wouldn’t be as much useful for board design as for footprint design. Datasheets give dimensions almost always in a form which resembles more constraints than coordinates. Actually, when you think about it you can see the current footprint editing system is clumsy and doesn’t follow “real world”.

This has been discussed and the developers aren’t against the idea of having more features to ease this kind of workflow (at least for footprints). But a full-blown constraint system isn’t in sight.

I think this is a similar feature request: https://gitlab.com/kicad/code/kicad/-/issues/2329

I’m not sure why you feel the need to discredit my needs in order to state your own. You could have just as easily stated that it would be nice if not a life saver in footprints also, and I think we would have been in agreement there.

Currently positioning is quite clunky both in PCB and Footprints, the only saving grace being that you can do math in the positioning dialogs… but it would be super nice if that math could be persistent etc… and potentially saved in a constraint.

Sorry if you feel that way, I don’t want or don’t try to discredit your needs. But the fact is that footprints are almost always designed according to datasheets which are explicitly constraint based (it’s not only my need!) while board layouts seldom have such design instructions. Of course it doesn’t discredit those needs, but I think that the layout design wouldn’t be a strong driver for that feature. I vaguely remember some developer discussion where it was explicitly said they don’t want complex constraint system while some features would be good. The payoff just wouldn’t be good enough to warrant a full constraint system.

2 Likes

I agree with you there and can see your point… all I am saying is that PCBs do eventually have to meet up with MCAD at some point and you can to some degree ignore the issues, but it would be much more pleasant to talk to my mechanical guy if I had constraints :smiley: … also when my MCAD guy gets depression when he starts measuring distances between my parts its a bit annoying, and yes I can make it nice enough for him with the existing placement options but it is a bit of work… that could be alleviated.

They also can be a bit picky and prefer offsets that are in 1/16ths of an inch etc… which is unusual for PCB editors. But it all ties back to the fact that the machinists are Americans… so thats what exists in the mechanical designs and flows back to me its not a hard requirement but they find it annoying.

you may have a look at StepUp

Stepup really nothing to do with this issue… even if you were to import.

I already use step up for exporting the model to MCAD.

With KiCAD StepUp it is possible to do a Seamless ECAD/MCAD PCB Data collaboration
Push/Pull 3D model placement from/to KiCAD board to/from FreeCAD mechanical design
This is exactly a way to create a mechanical constrain between the 3d models associated to the footprints.

this is only one part of the features of Stepup

Not it isn’t… now, quit going off topic to promote something I don’t want, nor do I care about in this use case.

You may be able to abuse it for that… but frankly I can’t imagine why you’d want to do that.

Also… I’m not using freecad, so again… off topic.

@cb88
hey man… keep quite… nobody is pushing you in doing nothing…
It seems to me you asked for a MCAD integration and that is exactly what I suggested…
Anyway enjoy your time Cheers

4 Likes

So what is it?

Apart from that you seem to be easily irritated and treat people who are trying to give suggestions as personal attacks. First with eelik and later with maui.

This is enough for me to keep me from wanting to contribute to this tread except for a simple remark:

There is no built-in constraint system in KiCad.

If you want more, then start by working on your attitude first.
This whole forum is driven by volunteers spending their own free time to help strangers.

3 Likes

This is going off the rails fast. If you don’t like the advice given, then politely decline or ignore it. I get the feeling that ideas aren’t being adequately exchanged and understood here.

Well, I started working on one a few years ago :slight_smile: but lack of time and more urgent work has not allowed me to make much progress.

Now I’m feeling scared to continue if I would have to receive feedback from our colleauge cb88 :slight_smile:

T.

If people don’t like negative feedback maybe they should not thread jack to promote their own mostly unrelated ideas. Maybe they shouldn’t get behind others who are thread jacking… otherwise they join in in the bad behavior. Note this is my thread you are derailing.

The origin of the negative feedback is bad netiquette. In fact StepUp is the one of the reasons I am asking for constraints as my mechanical engineers can measure my models with higher fidelity than if I just handed them a board and said design your mechanical part to my board with calipers… StepUp not the solution in any way it just exposes lack of fine grained constraints, or lack of having put in significant effort to get things just perfect.

Provided the footprints have the origin set at the center it is easy to position them in the right place. Most of the boards I do have to fit in already designed enclosures and so I have to position parts to match existing apertures. As I can set the position of the center I can set the position to line up quickly and easily.
To be honest in 30 years I have never had a pcb design program that has constraint based alignment. I use it in 3D CAD but never missed it in pcb design.

True, however it would be nice if it were an option there for where I do need to constrain positions of things.

Just because no other PCB software had done it doesn’t mean it wouldn’t be useful… I know we collectively as PCB designers are basically doing constraints either on paper or in our heads for footprint designs and mechanical positioning of things on boards, just without the convenience of being able to save our work currently.

I’m just saying wouldn’t that be nice, just as StepUp or the builtin .Step export is nice for what it’s use cases are… which are actually mainly exporting to MCAD so they can constrain their designs to mine.

KiCad does have a simplistic constraint based alignment system.

If you have a rectangular array of LED’s for example you can first place them roughly at the right location, then place the four corners at the exact location, then select a column or a row of the leds, press right mouse button and select: Align/Distribute and then: Distribute Horizontally or: Distribute Vertically. It’s a one time function though.

But the use of that is pretty limited. It would be easier to just set the grid to proper values and then place the LED’s on the grid.

If you do such things regularly, then the approach of a python script is probably a better option.

If you want a constraint based system in KiCad you can make a proposal for such a thing on gitlab. A full constraint based sketcher such as in FreeCAD is probably not in line with KiCad, and also not very useful. I can see some merit in the ability to define some “stretchable grid” and then semi/permanently attach components to it.

KiCad already has an option to draw an array of a certain footprint. Such an array can easily be deleted and re-created with different parameters. One thing I have not figured out though is how to create the association between the created array of footprints and the schematic.

Is this answer acceptable, or do you think I’m also babbling nonsense?

I think since the software doesn’t have what is being asked for then this thread will just continue to go south. We’ll leave it in tact as an example of what we really would prefer not to see here.