Footprint Rotator

This filter can rotate footprints, used for the positions file generation.
Some manufacturers use a different rotation than KiCad.
The JLCPCB Rotation Offset and JLCPCB Position Offset fields can be used to adjust special cases.
The internal _rot_footprint filter implements the simplest case.

  • comment : [string] (default: '') A comment for documentation purposes.

  • name : [string] (default: '') Used to identify this particular filter definition.

  • bennymeg_mode : [boolean] (default: true) Implements the rot_fields and offset_fields in the same way that the bennymeg/JLC-Plugin-for-KiCad tool. Note that the computation for bottom rotations is wrong, forcing the user to uses arbitrary rotations.
    The correct computation is (180 - component rot) + angle but the plugin does 180 - (component rot + angle).
    This option forces the wrong computation for compatibility.
    This option also controls the way offset signs are interpreted. When enabled the offsets matches this plugin, when disabled matches the interpretation used by the matthewlai/JLCKicadTools plugin.
    Disabling this option you’ll get better algorithms, but loose compatibility with this plugin.

  • extend : [boolean] (default: true) Extends the internal list of rotations with the one provided. Otherwise just use the provided list.
    Note that the provided list has more precedence than the internal list.

  • invert_bottom : [boolean] (default: false) Rotation for bottom components is negated, resulting in either: (- component rot - angle) or when combined with negative_bottom, (angle - component rot).

  • mirror_bottom : [boolean] (default: false) The original component rotation for components in the bottom is mirrored before applying the adjust so you get (180 - component rot + angle). This is used by JLCPCB.

  • negative_bottom : [boolean] (default: true) Rotation for bottom components is computed via subtraction as (component rot - angle).

  • offset_fields : [string | list(string)] (default: ['JLCPCB Position Offset', 'JLCPosOffset']) [comma separated] List of fields that can contain a position offset. The optional fields can contain a comma separated x,y position offset.
    This concept is from the bennymeg/JLC-Plugin-for-KiCad tool.

  • offsets : [list(list(string))] (default: []) A list of pairs regular expression/offset. Footprints matching the regular expression will be moved the specified offset.
    The offset must be two numbers separated by a comma. The first is the X offset.
    The signs matches the matthewlai/JLCKicadTools plugin specs.

  • rot_fields : [string | list(string)] (default: ['JLCPCB Rotation Offset', 'JLCRotOffset']) [comma separated] List of fields that can contain a rotation offset. The optional fields can contain a counter-clockwise orientation offset in degrees.
    This concept is from the bennymeg/JLC-Plugin-for-KiCad tool.

  • rotations : [list(list(string))] (default: []) A list of pairs regular expression/rotation. Footprints matching the regular expression will be rotated the indicated angle.
    The angle matches the matthewlai/JLCKicadTools plugin specs.

  • rotations_and_offsets : [Regex parameters] [list(dict)] (default: []) A list of rules to match components and specify the rotation and offsets. This is a more flexible version of the rotations and offsets options.
    Note that this list has more precedence.

  • skip_bottom : [boolean] (default: false) Do not rotate components on the bottom.

  • skip_top : [boolean] (default: false) Do not rotate components on the top.

Used dicts