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(); y = float(sys.argv[2])
bb = s.BoundingBox()
# vertical section through one left lead centre (plane y=const), then horizontal line z=0.25 on it
sec = BRepAlgoAPI_Section(s.wrapped, gp_Pln(gp_Pnt(0, y, 0), gp_Dir(0, 1, 0))); sec.Build(); prof = cq.Shape.cast(sec.Shape())
sec2 = BRepAlgoAPI_Section(prof.wrapped, gp_Pln(gp_Pnt(0, 0, 0.25), gp_Dir(0, 0, 1))); sec2.Build()
pts = sorted(v.X for v in cq.Shape.cast(sec2.Shape()).Vertices())
left = [p for p in pts if p < 0]
print("tip", round(bb.xmin, 3), "gauge-plane crossings (left):", [round(p, 3) for p in left], "L =", round(left[0] - bb.xmin, 3) if left else None)