component
IXYS IXTP15N50L2 LinearL2 N-channel MOSFET
Public Made by Adomby adom
500 V LinearL2 MOSFET, TO-220AB. Source-backed pin map and nominal CAD; mounting qualification pending.
main
John Lauer
Correct front orientation and virtual marking; add reviewed candidate Fusion library and fit limitations
3a87183
9d ago
"""Original nominal envelope reconstruction from IXYS DS100054B page 2.
Run with the existing OCP environment on the shared step2glb host, not chipsmith.
"""
import json,sys
from pathlib import Path
from OCP.gp import gp_Pnt,gp_Dir,gp_Ax2
from OCP.BRepPrimAPI import BRepPrimAPI_MakeBox,BRepPrimAPI_MakeCylinder
from OCP.BRepAlgoAPI import BRepAlgoAPI_Cut
from OCP.TopoDS import TopoDS_Compound
from OCP.BRep import BRep_Builder
from OCP.TopLoc import TopLoc_Location
from OCP.TDocStd import TDocStd_Document
from OCP.TCollection import TCollection_ExtendedString
from OCP.XCAFDoc import XCAFDoc_DocumentTool,XCAFDoc_ColorType
from OCP.TDataStd import TDataStd_Name
from OCP.Quantity import Quantity_Color,Quantity_TOC_RGB
from OCP.STEPCAFControl import STEPCAFControl_Writer
from OCP.STEPControl import STEPControl_AsIs
from OCP.IFSelect import IFSelect_RetDone
out=Path(sys.argv[1]);out.mkdir(parents=True,exist_ok=True)
# Millimeter dimension intervals transcribed from the TO-220 outline only.
limits={'A':[4.32,4.83],'b':[.64,1.02],'b1':[1.15,1.65],'c':[.35,.56],
'D':[14.73,16.00],'E':[9.91,10.66],'e':[2.54,2.54],'F':[1.14,1.40],
'H1':[5.85,6.85],'J1':[2.29,2.79],'k':[0,.38],'L':[12.70,13.97],
'L1':[2.79,5.84],'P':[3.53,4.08],'Q':[2.54,3.18]}
n={k:sum(v)/2 for k,v in limits.items()}
# Supplied straight leads; body bottom at Z=0. No undocumented formed-lead claim.
# X pad centres 0,2.54,5.08. Y=0 is lead centre. Rear tab plane derives from J1.
back=n['J1'];x0=n['e']-n['E']/2
parts=[]
def box(x,y,z,dx,dy,dz):return BRepPrimAPI_MakeBox(gp_Pnt(x,y,z),dx,dy,dz).Shape()
tab=box(x0,back-n['F'],0,n['E'],n['F'],n['D'])
hole=BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(n['e'],back-n['A']-1,n['D']-n['Q']),gp_Dir(0,1,0)),n['P']/2,n['A']+2).Shape()
tab=BRepAlgoAPI_Cut(tab,hole).Shape();parts.append(('DrainTab',tab,(.65,.66,.68)))
# Undimensioned taper, edge radii, mold split and shoulder transition simplified.
body=box(x0,back-n['A'],0,n['E'],n['A']-n['F'],n['D']-n['H1'])
parts.append(('MoldedBody_Nominal',body,(.08,.085,.09)))
for i,name in enumerate(['Gate','Drain','Source']):
x=i*n['e']
parts.append((f'Lead{i+1}_{name}',box(x-n['b']/2,-n['c']/2,-n['L'],n['b'],n['c'],n['L']-n['L1']),(.7,.71,.73)))
parts.append((f'Lead{i+1}_Shoulder',box(x-n['b1']/2,-n['c']/2,-n['L1'],n['b1'],n['c'],n['L1']),(.7,.71,.73)))
doc=TDocStd_Document(TCollection_ExtendedString('BinXCAF'))
st=XCAFDoc_DocumentTool.ShapeTool_s(doc.Main());ct=XCAFDoc_DocumentTool.ColorTool_s(doc.Main())
compound=TopoDS_Compound();builder=BRep_Builder();builder.MakeCompound(compound)
assembly=st.AddShape(compound,True);TDataStd_Name.Set_s(assembly,TCollection_ExtendedString('IXTP15N50L2_AI_Nominal'))
for name,shape,color in parts:
label=st.AddShape(shape,False);TDataStd_Name.Set_s(label,TCollection_ExtendedString(name));ct.SetColor(label,Quantity_Color(*color,Quantity_TOC_RGB),XCAFDoc_ColorType.XCAFDoc_ColorGen)
st.AddComponent(assembly,label,TopLoc_Location())
st.UpdateAssemblies()
writer=STEPCAFControl_Writer();writer.SetColorMode(True);writer.SetNameMode(True);writer.Transfer(doc,STEPControl_AsIs)
assert writer.Write(str(out/'ixtp15n50l2-ai-nominal.step'))==IFSelect_RetDone
(out/'dimensions.json').write_text(json.dumps({'units':'mm','source':'IXYS DS100054B (12/11), page 2, TO-220 Outline','limits':limits,'nominalMidpoints':n,'coordinateFrame':'Z upward along straight package; body bottom Z=0; molded front faces -Y so G/D/S read left-to-right from front; full untrimmed leads below Z=0; pin centres X=0,2.54,5.08 Y=0','limitations':['Original independent nominal envelope, not manufacturer CAD','Unspecified mold taper, edge radii and mold split omitted','Lead shoulders are simplified rectangular envelopes','No lead bend or board seating height is prescribed by this model','No manufacturer markings or internal die represented','Horizontal formed-lead footprint requires a separate pose and forming verification']},indent=2)+'\n')
print('WROTE',out)