1
2
3
4 import empro.toolkit as toolkit
5 import empro.units as units
6
7
8 -def surfaceMountedSMA( metalThickness = 0.01*units.inch,
9 radiusInnerPin = 0.01*units.inch,
10 radiusOuterConductor = 0.05*units.inch,
11 feetHeight = 0.02*units.inch,
12 feetWidth = 0.045*units.inch,
13 groundHeight = 0.03*units.inch,
14 groundWidth = 0.187*units.inch,
15 coaxHeight = 0.2*units.inch,
16 permittivity = 2.0,
17 matDi = toolkit.defaultMaterial("PTFE"),
18 matMetal = toolkit.defaultMaterial("Cu"),
19 divisions = 0):
20 import empro.geometry as geometry
21 import empro.toolkit.geometry
22 import math
23 V = empro.geometry.Vector3d
24 cylinderLike = empro.toolkit.geometry.zCylinder
25 if divisions!=0:
26 cylinderLike = lambda x,y,z,w:empro.toolkit.geometry.zRegularPolygonalPrism(x,y,z,w,divisions)
27
28 doMergeMetals = False
29
30
31 firstObjectFound = False
32 smaConnector = geometry.Assembly()
33 smaConnector.name = "Surface Mounted SMA Connector"
34
35 xSigns = [-1.0,1.0]
36 ySigns = [-1.0,1.0]
37 for xSign in xSigns:
38 for ySign in ySigns:
39 p1 = V(xSign*groundWidth/2.0, ySign*groundWidth/2.0,0.0)
40 p2 = V(xSign*(groundWidth/2.0-feetWidth), ySign*(groundWidth/2.0-feetWidth),feetHeight)
41 foot = toolkit.geometry.Block(p1,p2)
42 foot.name = "Foot"
43 foot.material = matMetal
44 if not doMergeMetals:
45 smaConnector.append(foot)
46 else:
47 if firstObjectFound:
48 metals = geometry.Boolean.unite(metals,foot)
49
50 else:
51 metals = foot
52 firstObjectFound =True
53
54 p1 = V(-groundWidth/2.0,-groundWidth/2.0,0.0)
55 p2 = V(groundWidth/2.0,groundWidth/2.0,groundHeight)
56 groundPlate = toolkit.geometry.Block(p1,p2)
57 empro.toolkit.geometry.translate(groundPlate,V(0,0,feetHeight))
58 p1 = V(0.0,0.0,feetHeight)
59 p2 = V(0.0,0.0,feetHeight+groundHeight)
60 hole = cylinderLike(0.0,radiusOuterConductor,p1,groundHeight)
61 groundPlate = geometry.Boolean.subtract(groundPlate,hole)
62 groundPlate.name = "Ground Plate"
63 groundPlate.material = matMetal
64 if not doMergeMetals:
65 smaConnector.append(groundPlate)
66 else:
67 metals = geometry.Boolean.unite(metals,groundPlate)
68
69 p1 = V(0.0,0.0,feetHeight+groundHeight)
70 p2 = V(0.0,0.0,feetHeight+groundHeight+coaxHeight)
71 innerRadius = radiusOuterConductor
72 outerRadius = radiusOuterConductor+metalThickness
73 outerConductor = cylinderLike(innerRadius,outerRadius,p1,coaxHeight)
74 outerConductor.name = "Outer Conductor"
75 outerConductor.material = matMetal
76 if not doMergeMetals:
77 smaConnector.append(outerConductor)
78 else:
79 metals = geometry.Boolean.unite(metals,outerConductor)
80
81 p1 = V(0.0,0.0,0.0)
82 p2 = V(0.0,0.0,feetHeight+groundHeight+coaxHeight)
83 innerRadius = 0.0
84 outerRadius = radiusInnerPin
85 innerPin = cylinderLike(innerRadius,outerRadius,p1,feetHeight+groundHeight+coaxHeight)
86 innerPin.name = "Inner Pin"
87 innerPin.material = matMetal
88 if not doMergeMetals:
89 smaConnector.append(innerPin)
90 else:
91 metals = geometry.Boolean.unite(metals,innerPin)
92 metals.name = "Metals"
93 metals.material = matMetal
94 smaConnector.append(metals)
95
96 p1 = V(0.0,0.0,feetHeight)
97 p2 = V(0.0,0.0,feetHeight+groundHeight+coaxHeight)
98 innerRadius = radiusInnerPin
99 outerRadius = radiusOuterConductor
100 coaxFilling = cylinderLike(innerRadius,outerRadius,p1,groundHeight+coaxHeight)
101 coaxFilling.name = "Filling"
102 coaxFilling.material = matDi
103 smaConnector.append(coaxFilling)
104 return smaConnector
105