main
John Lauer
OPA2365AIDR: datasheet-built SOIC-8 model (TI D, SBOS365E p.31) with TI's real Device Marking O2365A (p.25), overlay pr…
2bebd70
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}")