main
John Lauer STM32G431CBT6: datasheet-built LQFP48 model (DS12589 Rev 2 Table 94) with ST's real top marking STM32G431 / CBT6 / Y WW… 82dc23c
import sys, cadquery as cq
from OCP.BRepAlgoAPI import BRepAlgoAPI_Section
from OCP.gp import gp_Pln, gp_Pnt, gp_Dir
s = cq.importers.importStep(sys.argv[1]).val()
for axis, v in [("y", float(sys.argv[2])), ("x", float(sys.argv[3]))]:
    pl = gp_Pln(gp_Pnt(0, v, 0), gp_Dir(0, 1, 0)) if axis == "y" else gp_Pln(gp_Pnt(v, 0, 0), gp_Dir(1, 0, 0))
    sec = BRepAlgoAPI_Section(s.wrapped, pl); sec.Build(); b = cq.Shape.cast(sec.Shape()).BoundingBox()
    print(f"profile {axis}={v}: x {b.xmin:.3f}..{b.xmax:.3f} ({b.xlen:.3f})  y {b.ymin:.3f}..{b.ymax:.3f} ({b.ylen:.3f})  z {b.zmin:.3f}..{b.zmax:.3f}")