hzeller / kicad-source-mirror

(my personal sandbox copy of KiCad. Nothing to see here)
GNU Affero General Public License v3.0
1 stars 0 forks source link

Allow expressions in all measuring fields #11

Open hzeller opened 8 years ago

hzeller commented 8 years ago

It would be good to allow expressions in fields that affect the placement or sizes of components.

Examples for pcbnew

Footprint design ?

This should be pretty simple expressions (should be easy to write a parser for it and constraint solver), but it will be very powerful as a CAD tool, as it allows things that are otherwise too tedious.

It need to be thought through and carefully documented first (possibly with some demo implementation) before settling too early so that we are not locked into a hard-to-extend situation.

Now things are pretty neat as if the encoder is moved, all the LEDs around it are also moved (as they are tied to the $enc1.x, $enc1.y coordinates. Problems arise if the user wants to move constraint things with a mouse (e.g. one of the LEDs). Three options:

  1. not moving (like a 'locked module')
  2. Moving but adding relative coordinates to the expression; say we moved x by 12.3mm, it would change the expression to x=$global.led_ring_radius * cos($angle) * $enc1.x + 12.3mm
  3. totally replace the expression with the new coordinates, overwriting whatever expression was in there before (but maybe remember the expression so that later on this can be recovered with a drop-down ?)

Lots of questions to think more refined about but really powerful.