Need Some Help For Snapping Calibre

Have you seen this thread ?

(There are some prior attempts that you could perhaps steal from, but you also might run into some reluctance from upstream )