Skip to content

Add STEP diff utility

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

This is a simple utility to diff two STEP files (or two directories of STEP files) and report the volume change.

E.g.

./tools/step_diff.py /tmp/3d-tmp/Housings_DFN_QFN.3dshapes/DFN-8_2x2mm_Pitch0.5mm.step /tmp/3d-tmp/Housings_DFN_QFN.3dshapes/DFN-16-1EP_3x5mm_Pitch0.5mm.step -o ~/tmp/ -vv
Comparing /tmp/3d-tmp/Housings_DFN_QFN.3dshapes/DFN-8_2x2mm_Pitch0.5mm.step and /tmp/3d-tmp/Housings_DFN_QFN.3dshapes/DFN-16-1EP_3x5mm_Pitch0.5mm.step
INFO:root:Object 1 volume: 3.55
INFO:root:Object 2 volume: 11.31
INFO:root:Added volume: 8.36
INFO:root:Removed volume: 0.59
INFO:root:Difference volume: 8.95
INFO:root:Proportional difference: 252.46%

It can also export a graphical diff as a new STEP file:

2024-01-29_14-43.png

2024-01-24_112544_548x407_screenshot.png

It can also be made to exit non-zero if a volume difference is detected above a given threshold (default 0.1%), which means it may find use in CI tooling.

Merge request reports