Skip to content
Snippets Groups Projects

Expand additional drawing system for polygons and crosses, use in SMD single row and BGA

Merged John Beard requested to merge johnbeard/kicad-footprint-generator:add_dwg into master

This is a fairly major extension of the additional drawing system to support:

  • Polygons (Polyline and Polygon, and therefore Line)
  • Rectangles
  • Crosses

Also added:

  • Grid repeats (good for showing pin array graphics)
  • Mirrors (good for not duplicating points lists with a sign flip

An example of a polygon used to draw "ears" on a connector and pin array graphics:

image.png

          layer: 'F.Fab'
                repeat:
                    type: grid
                    spacing: ['$(pitch_x)', 0]
                    reference_is: 'center'
                    count: ['$(pin_count)', 1]
            tabs:
                type: poly
                layer: 'F.Fab'
                points:
                    - [0, 0]
                    - [-1.5, 0]
                    - [-1.7, -0.2]
                    - [-1.7, -2.0]
                    - [-1.5, -2.2]
                    - [-1.5, -2.8]
                    - [0, -2.8]
                offset: [$(body_left_x), $(body_bottom_y)]
                mirror:
                    x: 0

It is designed to easily plug in new drawing types and even allow client code (generators) to plug in their own providers, which can be anything at all.

In this commit series then:

  • Replace all the SMD single row/MP custom drawing code with the standard implementation - this reduces to two or three lines for full support
  • Replace the custom text handling in BGA with a cross provider (the only text uses is a +, and a real cross is both easier to position correctly and allows users to snap to the centrepoints)

Note: this does remove text handling from BGAs. But it will be easy to slot this in as a formal declarative drawing type when needed. It just isn't needed (and therefore not tested via generation) right now. And when implemented, all generators will benefit from it.

An implementation detail is that the core part of the system is generic and does not depend on anything in KicadModTree, so it can be used for future symbol and 3d generator applications. There is then a footprint-node-based implementation for footprint use.


Prelude commit: zero-diff refactor of the SMD single row generator to make the integration tractable


Following commit: delete BGA docs as moved to the wiki: https://gitlab.com/groups/kicad/libraries/-/wikis/Footprint-Generators/Common-YAML-data


Expected diffs:

  • Near zero graphical changes
  • Some changes of lines -> rects
  • Text to crossed in BGA
  • No change in FP/libs counts
Edited by John Beard

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading