Skip to content

API reference -- geometry result types

The result types returned by compute_geometry_diff. Unit conventions: centroids in inches, areas in mm^2, displacements in mm (see the schema documentation).

One attributed change on a layer.

centroid_* and area_mm2 describe the after-state object when one exists (added/moved/resized) and the before-state object otherwise (removed). before_geom / after_geom carry the shapely polygons for programmatic/SVG use; they are excluded from repr and JSON.

Geometry diff result for one matched/added/removed layer pair.

unrepresented class-attribute instance-attribute

unrepresented: dict[str, int] = field(default_factory=dict)

Reasons this layer's geometry is incomplete, merged across both revisions.

Non-empty means the comparison could not be completed, so outcome is indeterminate even when no change was found: what was not modelled cannot be reported as unchanged (A3).

count

count(kind: ChangeKind) -> int

Number of changes of the given kind.

Full geometry diff across all matched layers.

outcome property

outcome: DiffOutcome

different outranks indeterminate.

A change that was found is a real finding about the fabrication output and stays one even when some other operation could not be modelled. The reverse would let one unmodellable stroke mask a trace that actually moved.

unrepresented property

unrepresented: dict[str, int]

Every reason across every layer, summed.

Core IR and shared result types

The complete output of parsing one Gerber or Excellon file.

has_changes property

has_changes: bool

True when any layer was added, removed, or has changed pixels.

A contiguous changed area. Coordinates in inches.