Skip to content

KLC: add symbol geometry warnings

John Beard requested to merge johnbeard/kicad-library-utils:geom_warnings into master

This adds some geometry warnings for symbols:

  • Degenerate geometry:
    • Zero-sized arcs
    • Zero length segments
  • Duplicate geometry (arcs, circles and segments)

Moves some common geometry maths to a separate file for easier re-use by other checks, including footprints.


For example, here is the Connector:RJ45_Abracon_ARJP11A-MASA-B-A-EMU2 symbol output, which has many suspect elements (and, indeed, was crashing the visual diff tool until !492 (merged) merged):

Checking symbol 'Connector:RJ45_Abracon_ARJP11A-MASA-B-A-EMU2':
  Violating EC01 - (extended check)
    Basic geometry checks
    Arc has zero or near-zero size: start Point(-6.35, -13.97), mid Point(-6.35, -13.97), end Point(-6.35, -13.97)
    Arc has zero or near-zero size: start Point(-6.35, -17.78), mid Point(-6.35, -17.78), end Point(-6.35, -17.78)
    Arc has zero or near-zero size: start Point(-6.35, -5.08), mid Point(-6.35, -5.08), end Point(-6.35, -5.08)
    Arc has zero or near-zero size: start Point(-6.35, -3.81), mid Point(-6.35, -3.81), end Point(-6.35, -3.81)
    Arc has zero or near-zero size: start Point(-6.35, 1.27), mid Point(-6.35, 1.27), end Point(-6.35, 1.27)
    Arc has zero or near-zero size: start Point(-2.54, -19.05), mid Point(-2.54, -19.05), end Point(-2.54, -19.05)
    Arc has zero or near-zero size: start Point(-2.54, -15.24), mid Point(-2.54, -15.24), end Point(-2.54, -15.24)
    Arc has zero or near-zero size: start Point(-2.54, -6.35), mid Point(-2.54, -6.35), end Point(-2.54, -6.35)
    Arc has zero or near-zero size: start Point(-2.54, -3.81), mid Point(-2.54, -3.81), end Point(-2.54, -3.81)
    Arc has zero or near-zero size: start Point(-2.54, 0), mid Point(-2.54, 0), end Point(-2.54, 0)
    Arc has zero or near-zero size: start Point(2.54, -17.78), mid Point(2.54, -17.78), end Point(2.54, -17.78)
    Arc has zero or near-zero size: start Point(2.54, -3.81), mid Point(2.54, -3.81), end Point(2.54, -3.81)
    Arc has zero or near-zero size: start Point(3.81, -13.97), mid Point(3.81, -13.97), end Point(3.81, -13.97)
    Arc has zero or near-zero size: start Point(3.81, 0), mid Point(3.81, 0), end Point(3.81, 0)
    Arc has zero or near-zero size: start Point(5.08, -17.78), mid Point(5.08, -17.78), end Point(5.08, -17.78)
    Arc has zero or near-zero size: start Point(5.08, -3.81), mid Point(5.08, -3.81), end Point(5.08, -3.81)
    Arc has zero or near-zero size: start Point(6.35, -13.97), mid Point(6.35, -13.97), end Point(6.35, -13.97)
    Arc has zero or near-zero size: start Point(6.35, 0), mid Point(6.35, 0), end Point(6.35, 0)
    The same circle geometry exists multiple times:Point(5.08, 22.86), radius 0.0001
Edited by John Beard

Merge request reports