Exemplo n.º 1
0
    def __init__(self, oEditor, pwidth, pradius, layer):
        '''
		type=0 for 01005 type=1 for 0201
		orient=0 for x axis, orient=1 for y axis
		3 for Cu1
		2 for Cu2
		1 for Cu3
		0 for Cu0 
		'''
        LUMP.__init__(self)
        self.MET = lam.MakeLam.get_metal_params()[layer]
        self.eva = self.MET[0] + self.MET[1] / 2
        self.thick = self.MET[1]
        #self.MET2=lam.MakeLam.get_metal_params()[2]
        self.oEditor = oEditor
        self.pport = 500
        self.pgap = 300
        self.pwidth = pwidth
        self.pradius = pradius
        self.xpos = [0, 1000, 1000]
        self.ypos = [0, 0, 1000]

        self.zpos = [self.eva, self.eva, self.eva]
        #num_pt=len(self.xpos)
        pxf = 'pxf' + str(self.id)
        print 'The value of MTOP'
        #print self.MTOP[1]
        #print type(self.MTOP[1])
        ind = hfss.create_polyline(self.oEditor, self.xpos, self.ypos,
                                   self.zpos, pxf, '20mm', '30mm', '\"LamCu\"')
        '''
Exemplo n.º 2
0
oProject = hfss.new_project(oDesktop)

raw_input('Press "Enter" to insert a new DrivenModal design named HFSSDesign1.>')

oDesign = hfss.insert_design(oProject, "HFSSDesign1", "DrivenModal")

raw_input('Press "Enter" to set the active editor to "3D Modeler" (The default and only known correct value).>')

oEditor = hfss.set_active_editor(oDesign)

raw_input('Press "Enter" to draw a red three-vertex polyline named Triangle1.>')

obj = hfss.create_polyline(oEditor, [1, 0, -1], 
                                    [0, 1, 0], 
                                    [0, 0, 0], 
                                    Name='Triangle1',
                                    Color="(255 0 0)")

print("We'll now rotate the triangle about the Z axis by 30 degrees.")

raw_input('Press "Enter" to rotate the part.>')

hfss.rotate(oEditor, [obj], 'Z', 30*pi/180)

raw_input('Press "Enter" to quit HFSS.>')

hfss.quit_application(oDesktop)

del oEditor
del oDesign
Exemplo n.º 3
0
def shunt(oEditor,
          cpw_filter,
          x0=0,
          y0=0,
          var_x=0.5,
          l4=0.01,
          W3=0.003,
          r0=0.0024,
          r1=0.0024,
          n=4):
    l3 = var_x / 2 - r0 - n * r1
    if (l3 <= 0):
        print "Parametrics<0"
        exit()
    d3 = var_x / 2 - W3 / 2 - r0 - r1 - l4
    if (d3 <= 0):
        print "Parametrics<0"
        exit()

    rect = hfss.create_rectangle(oEditor, i_s(x0), i_s(y0 - var_x / 2), 0,
                                 i_s(var_x), i_s(var_x))

    cl = [
        hfss.create_polyline(
            oEditor,
            [i_s(x0), i_s(x0 + l3)],
            [i_s(y0), i_s(y0)],
            [0, 0],
            IsPolylineCovered=False,
        ),
        hfss.create_EQbasedcurve(
            oEditor,
            i_s(x0 + l3) + '+' + i_s(r0) + '*sin(_t)',
            i_s(y0 + r0) + '-' + i_s(r0) + '*cos(_t)',
            '0',
            0,
            'pi/2',
            0,
        )
    ]

    for i in range(n - 1):
        if i % 2 == 0:
            cl.append(
                hfss.create_polyline(oEditor, [
                    i_s(x0 + l3 + r0 + i * 2 * r1),
                    i_s(x0 + l3 + r0 + i * 2 * r1)
                ], [i_s(y0 + r0), i_s(y0 + r0 + l4)], [0, 0],
                                     IsPolylineCovered=False))
            cl.append(
                hfss.create_EQbasedcurve(
                    oEditor,
                    i_s(x0 + l3 + r0 + r1 + i * 2 * r1) + '-' + i_s(r1) +
                    '*cos(_t)',
                    i_s(y0 + r0 + l4) + '+' + i_s(r1) + '*sin(_t)', '0', 0,
                    'pi', 0))
            cl.append(
                hfss.create_polyline(oEditor, [
                    i_s(x0 + l3 + r0 + 2 * r1 + i * 2 * r1),
                    i_s(x0 + l3 + r0 + 2 * r1 + i * 2 * r1)
                ], [i_s(y0 + r0 + l4), i_s(y0 + r0)], [0, 0],
                                     IsPolylineCovered=False))
            cl.append(
                hfss.create_polyline(oEditor, [
                    i_s(x0 + l3 + r0 + 2 * r1 + i * 2 * r1),
                    i_s(x0 + l3 + r0 + 2 * r1 + i * 2 * r1)
                ], [i_s(y0 + r0), i_s(y0 - r0)], [0, 0],
                                     IsPolylineCovered=False))
        else:
            cl.append(
                hfss.create_polyline(oEditor, [
                    i_s(x0 + l3 + r0 + i * 2 * r1),
                    i_s(x0 + l3 + r0 + i * 2 * r1)
                ], [i_s(y0 - r0), i_s(y0 - r0 - l4)], [0, 0],
                                     IsPolylineCovered=False))
            cl.append(
                hfss.create_EQbasedcurve(
                    oEditor,
                    i_s(x0 + l3 + r0 + r1 + i * 2 * r1) + '-' + i_s(r1) +
                    '*cos(_t)',
                    i_s(y0 - r0 - l4) + '-' + i_s(r1) + '*sin(_t)', '0', 0,
                    'pi', 0))
            cl.append(
                hfss.create_polyline(oEditor, [
                    i_s(x0 + l3 + r0 + 2 * r1 + i * 2 * r1),
                    i_s(x0 + l3 + r0 + 2 * r1 + i * 2 * r1)
                ], [i_s(y0 - r0 - l4), i_s(y0 - r0)], [0, 0],
                                     IsPolylineCovered=False))
            cl.append(
                hfss.create_polyline(oEditor, [
                    i_s(x0 + l3 + r0 + 2 * r1 + i * 2 * r1),
                    i_s(x0 + l3 + r0 + 2 * r1 + i * 2 * r1)
                ], [i_s(y0 - r0), i_s(y0 + r0)], [0, 0],
                                     IsPolylineCovered=False))
    if n % 2 == 0:
        cl.append(
            hfss.create_polyline(oEditor, [
                i_s(x0 + l3 + r0 + (n - 1) * 2 * r1),
                i_s(x0 + l3 + r0 + (n - 1) * 2 * r1)
            ], [i_s(y0 - r0), i_s(y0 - r0 - l4)], [0, 0],
                                 IsPolylineCovered=False))
        cl.append(
            hfss.create_EQbasedcurve(
                oEditor,
                i_s(x0 + l3 + r0 + r1 +
                    (n - 1) * 2 * r1) + '-' + i_s(r1) + '*cos(_t)',
                i_s(y0 - r0 - l4) + '-' + i_s(r1) + '*sin(_t)', '0', 0, 'pi',
                0))
        cl.append(
            hfss.create_polyline(oEditor, [
                i_s(x0 + l3 + r0 + 2 * r1 + (n - 1) * 2 * r1),
                i_s(x0 + l3 + r0 + 2 * r1 + (n - 1) * 2 * r1)
            ], [i_s(y0 - r0 - l4), i_s(y0 - r0)], [0, 0],
                                 IsPolylineCovered=False))
        cl.append(
            hfss.create_EQbasedcurve(oEditor,
                                     i_s(x0 + l3 + r0 + n * 2 * r1 + r0) +
                                     '-' + i_s(r0) + '*cos(_t)',
                                     i_s(y0 - r0) + '+' + i_s(r0) + '*sin(_t)',
                                     '0',
                                     0,
                                     'pi/2',
                                     0,
                                     Name='Quarter_Line'))
        cl.append(
            hfss.create_polyline(oEditor, [
                i_s(x0 + l3 + r0 + n * 2 * r1 + r0),
                i_s(x0 + l3 + r0 + n * 2 * r1 + r0 + l3)
            ], [i_s(y0), i_s(y0)], [0, 0],
                                 IsPolylineCovered=False))
    else:
        cl.append(
            hfss.create_polyline(oEditor, [
                i_s(x0 + l3 + r0 + (n - 1) * 2 * r1),
                i_s(x0 + l3 + r0 + (n - 1) * 2 * r1)
            ], [i_s(y0 + r0), i_s(y0 + r0 + l4)], [0, 0],
                                 IsPolylineCovered=False))
        cl.append(
            hfss.create_EQbasedcurve(
                oEditor,
                i_s(x0 + l3 + r0 + r1 +
                    (n - 1) * 2 * r1) + '-' + i_s(r1) + '*cos(_t)',
                i_s(y0 + r0 + l4) + '+' + i_s(r1) + '*sin(_t)', '0', 0, 'pi',
                0))
        cl.append(
            hfss.create_polyline(oEditor, [
                i_s(x0 + l3 + r0 + 2 * r1 + (n - 1) * 2 * r1),
                i_s(x0 + l3 + r0 + 2 * r1 + (n - 1) * 2 * r1)
            ], [i_s(y0 + r0 + l4), i_s(y0 + r0)], [0, 0],
                                 IsPolylineCovered=False))
        cl.append(
            hfss.create_EQbasedcurve(oEditor,
                                     i_s(x0 + l3 + r0 + n * 2 * r1 + r0) +
                                     '-' + i_s(r0) + '*cos(_t)',
                                     i_s(y0 + r0) + '-' + i_s(r0) + '*sin(_t)',
                                     '0',
                                     0,
                                     'pi/2',
                                     0,
                                     Name='Quarter_Line'))
        cl.append(
            hfss.create_polyline(oEditor, [
                i_s(x0 + l3 + r0 + n * 2 * r1 + r0),
                i_s(x0 + l3 + r0 + n * 2 * r1 + r0 + l3)
            ], [i_s(y0), i_s(y0)], [0, 0],
                                 IsPolylineCovered=False))

    cl = hfss.unite(oEditor, cl)

    temp_l = hfss.create_polyline(
        oEditor, [i_s(x0), i_s(x0)],
        [i_s(y0 - W3 / 2), i_s(y0 + W3 / 2)], [0, 0],
        IsPolylineClosed=False)
    meander = hfss.sweep_along_path(oEditor, [temp_l], [cl])
    cpw_filter = hfss.subtract(oEditor, [cpw_filter], [rect])
    cpw_filter = hfss.unite(oEditor, [cpw_filter, meander[0]])

    return cpw_filter
Exemplo n.º 4
0
import hycohanz as hfss

[oAnsoftApp, oDesktop] = hfss.setup_interface()

oProject = hfss.new_project(oDesktop)
oDesign = hfss.insert_design(oProject, "HFSSDesign1", "DrivenModal")
oEditor = hfss.set_active_editor(oDesign)

objname1 = hfss.create_polyline(
    oEditor, [1, 0], 
    [0, 0],
    [0, 0],
    Name='Path',
    Color="(255 0 0)",
    IsPolylineCovered=False,
    IsPolylineClosed=False)

objname2 = hfss.create_circle(oEditor, 0, 0, 0, 4, WhichAxis='X')

objname3 = hfss.create_cylinder(oEditor, 0, 0, 0, 10, 30, WhichAxis='Z')

objname4 = hfss.create_sphere(oEditor, 0, 0, 0, 3)

hfss.sweep_along_path(oEditor,[objname2, objname1])

hfss.subtract(oEditor, [objname3], [objname4], KeepOriginals=False)

merge1 = hfss.get_matched_object_name(oEditor, "Cyl*")
merge2 = hfss.get_matched_object_name(oEditor, "Cir*")
hfss.unite(oEditor, merge1 + merge2)