示例#1
0
 def set_Simulation(self):
     # User should define project simulation settings in project_name_setsimul.py
     # set_Simulation(qwm_doc) function
     publicdir = FreeCAD.ConfigGet("QWPUBLICDIR")
     thisExampleSubdir = setProjectDefaultFolder(self.qwm_doc, publicdir)
     self.qwm_doc.saveAs(thisExampleSubdir + self.qwm_doc.Name + ".QWpro")
     QW_Modeller.generateMesh(self.qwm_doc.Name)
def set_GeometryAndMedia(qwm_doc):
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_rxone')
    qwm_doc.sketch_rxone.Placement = FreeCAD.Placement(FreeCAD.Vector(0.0,0.0,-2.5),FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_rxone.addGeometry(Part.LineSegment(FreeCAD.Vector(0.0,-13.0,0), FreeCAD.Vector(20.0,-13.0,0)))
    qwm_doc.sketch_rxone.addGeometry(Part.LineSegment(FreeCAD.Vector(20.0,-13.0,0), FreeCAD.Vector(20.0,-7.0,0)))
    qwm_doc.sketch_rxone.addGeometry(Part.LineSegment(FreeCAD.Vector(20.0,-7.0,0), FreeCAD.Vector(0.0,-7.0,0)))
    qwm_doc.sketch_rxone.addGeometry(Part.LineSegment(FreeCAD.Vector(0.0,-7.0,0), FreeCAD.Vector(0.0,-13.0,0)))
    qwm_doc.addObject("Part::Extrusion", "rxone")
    qwm_doc.rxone.Base = qwm_doc.sketch_rxone
    qwm_doc.rxone.Dir = (0, 0, 5.0)
    qwm_doc.rxone.Solid = True
    rxone_viewObject = qwm_doc.rxone.ViewObject
    rxone_viewObject.Transparency = 60
    qwm_doc.rxone.Medium = QW_Modeller.getQWMedium("air")
    qwm_doc.rxone.Placement=FreeCAD.Placement(FreeCAD.Vector(0,0,0), FreeCAD.Rotation(FreeCAD.Vector(0,0,1),90.0), FreeCAD.Vector(0.0,-10.0,0))
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_rxsec')
    qwm_doc.sketch_rxsec.Placement = FreeCAD.Placement(FreeCAD.Vector(0.0,0.0,-2.5),FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_rxsec.addGeometry(Part.LineSegment(FreeCAD.Vector(-10.0,-3.0,0), FreeCAD.Vector(10.0,-3.0,0)))
    qwm_doc.sketch_rxsec.addGeometry(Part.LineSegment(FreeCAD.Vector(10.0,-3.0,0), FreeCAD.Vector(10.0,3.0,0)))
    qwm_doc.sketch_rxsec.addGeometry(Part.LineSegment(FreeCAD.Vector(10.0,3.0,0), FreeCAD.Vector(-10.0,3.0,0)))
    qwm_doc.sketch_rxsec.addGeometry(Part.LineSegment(FreeCAD.Vector(-10.0,3.0,0), FreeCAD.Vector(-10.0,-3.0,0)))
    qwm_doc.addObject("Part::Extrusion", "rxsec")
    qwm_doc.rxsec.Base = qwm_doc.sketch_rxsec
    qwm_doc.rxsec.Dir = (0, 0, 5.0)
    qwm_doc.rxsec.Solid = True
    rxsec_viewObject = qwm_doc.rxsec.ViewObject
    rxsec_viewObject.Transparency = 60
    qwm_doc.rxsec.Medium = QW_Modeller.getQWMedium("air")
    qwm_doc.addObject("Part::MultiFuse","Fusion1")
    qwm_doc.Fusion1.Shapes = [qwm_doc.rxsec,qwm_doc.rxone,]
    qwm_doc.Fusion1.Medium = qwm_doc.rxsec.Medium
    FreeCAD.Gui.activeDocument().rxsec.Visibility = False
    FreeCAD.Gui.activeDocument().rxone.Visibility = False
    qwm_doc.Fusion1.Label = 'rxall'
示例#3
0
def set_GeometryAndMedia(qwm_doc):
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_wgu')
    qwm_doc.sketch_wgu.Placement = FreeCAD.Placement(FreeCAD.Vector(0.0,0.0,-20.0),FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_wgu.addGeometry(Part.LineSegment(FreeCAD.Vector(-7.0,-4.5,0), FreeCAD.Vector(7.0,-4.5,0)))
    qwm_doc.sketch_wgu.addGeometry(Part.LineSegment(FreeCAD.Vector(7.0,-4.5,0), FreeCAD.Vector(7.0,4.5,0)))
    qwm_doc.sketch_wgu.addGeometry(Part.LineSegment(FreeCAD.Vector(7.0,4.5,0), FreeCAD.Vector(-7.0,4.5,0)))
    qwm_doc.sketch_wgu.addGeometry(Part.LineSegment(FreeCAD.Vector(-7.0,4.5,0), FreeCAD.Vector(-7.0,-4.5,0)))
    qwm_doc.sketch_wgu.addGeometry(Part.LineSegment(FreeCAD.Vector(-7.0,-4.5,0), FreeCAD.Vector(-5.0,-2.5,0)))
    qwm_doc.sketch_wgu.addGeometry(Part.LineSegment(FreeCAD.Vector(-5.0,-2.5,0), FreeCAD.Vector(-5.0,2.5,0)))
    qwm_doc.sketch_wgu.addGeometry(Part.LineSegment(FreeCAD.Vector(-5.0,2.5,0), FreeCAD.Vector(5.0,2.5,0)))
    qwm_doc.sketch_wgu.addGeometry(Part.LineSegment(FreeCAD.Vector(5.0,2.5,0), FreeCAD.Vector(5.0,-2.5,0)))
    qwm_doc.sketch_wgu.addGeometry(Part.LineSegment(FreeCAD.Vector(5.0,-2.5,0), FreeCAD.Vector(-5.0,-2.5,0)))
    qwm_doc.sketch_wgu.addGeometry(Part.LineSegment(FreeCAD.Vector(-5.0,-2.5,0), FreeCAD.Vector(-7.0,-4.5,0)))
    qwm_doc.addObject("Part::Extrusion", "wgu")
    qwm_doc.wgu.Base = qwm_doc.sketch_wgu
    qwm_doc.wgu.Dir = (0, 0, 20.0)
    qwm_doc.wgu.Solid = True
    wgu_viewObject = qwm_doc.wgu.ViewObject
    wgu_viewObject.Transparency = 60
    qwm_doc.wgu.Medium = QW_Modeller.getQWMedium("metal")
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_horn')
    qwm_doc.sketch_horn.Placement = FreeCAD.Placement(FreeCAD.Vector(0.0,0.0,0.0),FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_horn.addGeometry(Part.LineSegment(FreeCAD.Vector(-7.0,-4.5,0), FreeCAD.Vector(7.0,-4.5,0)))
    qwm_doc.sketch_horn.addGeometry(Part.LineSegment(FreeCAD.Vector(7.0,-4.5,0), FreeCAD.Vector(7.0,4.5,0)))
    qwm_doc.sketch_horn.addGeometry(Part.LineSegment(FreeCAD.Vector(7.0,4.5,0), FreeCAD.Vector(-7.0,4.5,0)))
    qwm_doc.sketch_horn.addGeometry(Part.LineSegment(FreeCAD.Vector(-7.0,4.5,0), FreeCAD.Vector(-7.0,-4.5,0)))
    qwm_doc.sketch_horn.addGeometry(Part.LineSegment(FreeCAD.Vector(-7.0,-4.5,0), FreeCAD.Vector(-5.0,-2.5,0)))
    qwm_doc.sketch_horn.addGeometry(Part.LineSegment(FreeCAD.Vector(-5.0,-2.5,0), FreeCAD.Vector(-5.0,2.5,0)))
    qwm_doc.sketch_horn.addGeometry(Part.LineSegment(FreeCAD.Vector(-5.0,2.5,0), FreeCAD.Vector(5.0,2.5,0)))
    qwm_doc.sketch_horn.addGeometry(Part.LineSegment(FreeCAD.Vector(5.0,2.5,0), FreeCAD.Vector(5.0,-2.5,0)))
    qwm_doc.sketch_horn.addGeometry(Part.LineSegment(FreeCAD.Vector(5.0,-2.5,0), FreeCAD.Vector(-5.0,-2.5,0)))
    qwm_doc.sketch_horn.addGeometry(Part.LineSegment(FreeCAD.Vector(-5.0,-2.5,0), FreeCAD.Vector(-7.0,-4.5,0)))
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_horn1')
    qwm_doc.sketch_horn1.Placement = FreeCAD.Placement(FreeCAD.Vector(0.0,0.0,30.0),FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_horn1.addGeometry(Part.LineSegment(FreeCAD.Vector(-12.0,-9.5,0), FreeCAD.Vector(12.0,-9.5,0)))
    qwm_doc.sketch_horn1.addGeometry(Part.LineSegment(FreeCAD.Vector(12.0,-9.5,0), FreeCAD.Vector(12.0,9.5,0)))
    qwm_doc.sketch_horn1.addGeometry(Part.LineSegment(FreeCAD.Vector(12.0,9.5,0), FreeCAD.Vector(-12.0,9.5,0)))
    qwm_doc.sketch_horn1.addGeometry(Part.LineSegment(FreeCAD.Vector(-12.0,9.5,0), FreeCAD.Vector(-12.0,-9.5,0)))
    qwm_doc.sketch_horn1.addGeometry(Part.LineSegment(FreeCAD.Vector(-12.0,-9.5,0), FreeCAD.Vector(-10.0,-7.5,0)))
    qwm_doc.sketch_horn1.addGeometry(Part.LineSegment(FreeCAD.Vector(-10.0,-7.5,0), FreeCAD.Vector(-10.0,7.5,0)))
    qwm_doc.sketch_horn1.addGeometry(Part.LineSegment(FreeCAD.Vector(-10.0,7.5,0), FreeCAD.Vector(10.0,7.5,0)))
    qwm_doc.sketch_horn1.addGeometry(Part.LineSegment(FreeCAD.Vector(10.0,7.5,0), FreeCAD.Vector(10.0,-7.5,0)))
    qwm_doc.sketch_horn1.addGeometry(Part.LineSegment(FreeCAD.Vector(10.0,-7.5,0), FreeCAD.Vector(-10.0,-7.5,0)))
    qwm_doc.sketch_horn1.addGeometry(Part.LineSegment(FreeCAD.Vector(-10.0,-7.5,0), FreeCAD.Vector(-12.0,-9.5,0)))
    qwm_doc.addObject("Part::Loft", "horn1")
    qwm_doc.horn1.Sections=[qwm_doc.sketch_horn, qwm_doc.sketch_horn1]
    qwm_doc.horn1.Solid=True
    qwm_doc.horn1.Ruled=False
    qwm_doc.horn1.Closed=False
    horn1_viewObject = qwm_doc.horn1.ViewObject
    horn1_viewObject.Transparency = 60
    qwm_doc.horn1.Medium = QW_Modeller.getQWMedium("metal")
示例#4
0
def set_GeometryAndMedia(qwm_doc):
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_cyvr')
    qwm_doc.sketch_cyvr.Placement = FreeCAD.Placement(FreeCAD.Vector(0.0,0.0,0.0),FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(2.0,0.0,0), FreeCAD.Vector(1.8477590650225735,0.7653668647301796,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(1.8477590650225735,0.7653668647301796,0), FreeCAD.Vector(1.4142135623730951,1.4142135623730951,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(1.4142135623730951,1.4142135623730951,0), FreeCAD.Vector(0.7653668647301797,1.8477590650225735,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(0.7653668647301797,1.8477590650225735,0), FreeCAD.Vector(1.2246467991473532e-16,2.0,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(1.2246467991473532e-16,2.0,0), FreeCAD.Vector(-0.7653668647301795,1.8477590650225735,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(-0.7653668647301795,1.8477590650225735,0), FreeCAD.Vector(-1.414213562373095,1.4142135623730951,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.414213562373095,1.4142135623730951,0), FreeCAD.Vector(-1.8477590650225735,0.7653668647301798,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.8477590650225735,0.7653668647301798,0), FreeCAD.Vector(-2.0,2.4492935982947064e-16,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(-2.0,2.4492935982947064e-16,0), FreeCAD.Vector(-1.8477590650225737,-0.7653668647301793,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.8477590650225737,-0.7653668647301793,0), FreeCAD.Vector(-1.4142135623730954,-1.414213562373095,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.4142135623730954,-1.414213562373095,0), FreeCAD.Vector(-0.765366864730179,-1.8477590650225737,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(-0.765366864730179,-1.8477590650225737,0), FreeCAD.Vector(-3.6739403974420594e-16,-2.0,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(-3.6739403974420594e-16,-2.0,0), FreeCAD.Vector(0.76536686473018,-1.8477590650225733,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(0.76536686473018,-1.8477590650225733,0), FreeCAD.Vector(1.4142135623730947,-1.4142135623730954,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(1.4142135623730947,-1.4142135623730954,0), FreeCAD.Vector(1.8477590650225737,-0.7653668647301791,0)))
    qwm_doc.sketch_cyvr.addGeometry(Part.LineSegment(FreeCAD.Vector(1.8477590650225737,-0.7653668647301791,0), FreeCAD.Vector(2.0,0.0,0)))
    qwm_doc.addObject("Part::Extrusion", "cyvr")
    qwm_doc.cyvr.Base = qwm_doc.sketch_cyvr
    qwm_doc.cyvr.Dir = (0, 0, 4.0)
    qwm_doc.cyvr.Solid = True
    cyvr_viewObject = qwm_doc.cyvr.ViewObject
    cyvr_viewObject.Transparency = 60
    qwm_doc.cyvr.Medium = QW_Modeller.getQWMedium("air")
def set_GeometryAndMedia(qwm_doc):
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_angpc')
    qwm_doc.sketch_angpc.Placement = FreeCAD.Placement(FreeCAD.Vector(0.0,0.0,0.0),FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(2.0,0.0,0), FreeCAD.Vector(4.0,0.0,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(4.0,0.0,0), FreeCAD.Vector(3.939231012048832,0.6945927106677213,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(3.939231012048832,0.6945927106677213,0), FreeCAD.Vector(3.7587704831436337,1.3680805733026749,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(3.7587704831436337,1.3680805733026749,0), FreeCAD.Vector(3.464101615137755,1.9999999999999998,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(3.464101615137755,1.9999999999999998,0), FreeCAD.Vector(3.064177772475912,2.571150438746157,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(3.064177772475912,2.571150438746157,0), FreeCAD.Vector(2.5711504387461575,3.064177772475912,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(2.5711504387461575,3.064177772475912,0), FreeCAD.Vector(2.0000000000000004,3.4641016151377544,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(2.0000000000000004,3.4641016151377544,0), FreeCAD.Vector(1.3680805733026753,3.7587704831436333,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(1.3680805733026753,3.7587704831436333,0), FreeCAD.Vector(0.6945927106677217,3.939231012048832,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(0.6945927106677217,3.939231012048832,0), FreeCAD.Vector(2.4492935982947064e-16,4.0,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(2.4492935982947064e-16,4.0,0), FreeCAD.Vector(1.2246467991473532e-16,2.0,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(1.2246467991473532e-16,2.0,0), FreeCAD.Vector(0.34729635533386083,1.969615506024416,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(0.34729635533386083,1.969615506024416,0), FreeCAD.Vector(0.6840402866513376,1.8793852415718166,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(0.6840402866513376,1.8793852415718166,0), FreeCAD.Vector(1.0000000000000002,1.7320508075688772,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(1.0000000000000002,1.7320508075688772,0), FreeCAD.Vector(1.2855752193730787,1.532088886237956,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(1.2855752193730787,1.532088886237956,0), FreeCAD.Vector(1.532088886237956,1.2855752193730785,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(1.532088886237956,1.2855752193730785,0), FreeCAD.Vector(1.7320508075688774,0.9999999999999999,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(1.7320508075688774,0.9999999999999999,0), FreeCAD.Vector(1.8793852415718169,0.6840402866513374,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(1.8793852415718169,0.6840402866513374,0), FreeCAD.Vector(1.969615506024416,0.34729635533386066,0)))
    qwm_doc.sketch_angpc.addGeometry(Part.LineSegment(FreeCAD.Vector(1.969615506024416,0.34729635533386066,0), FreeCAD.Vector(2.0,0.0,0)))
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_angpc1')
    qwm_doc.sketch_angpc1.Placement = FreeCAD.Placement(FreeCAD.Vector(0.0,0.0,4.0),FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(3.0,0.0,0), FreeCAD.Vector(5.0,0.0,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(5.0,0.0,0), FreeCAD.Vector(4.92403876506104,0.8682408883346516,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(4.92403876506104,0.8682408883346516,0), FreeCAD.Vector(4.698463103929543,1.7101007166283435,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(4.698463103929543,1.7101007166283435,0), FreeCAD.Vector(4.330127018922194,2.4999999999999996,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(4.330127018922194,2.4999999999999996,0), FreeCAD.Vector(3.83022221559489,3.2139380484326963,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(3.83022221559489,3.2139380484326963,0), FreeCAD.Vector(3.2139380484326967,3.83022221559489,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(3.2139380484326967,3.83022221559489,0), FreeCAD.Vector(2.5000000000000004,4.330127018922193,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(2.5000000000000004,4.330127018922193,0), FreeCAD.Vector(1.7101007166283442,4.698463103929542,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(1.7101007166283442,4.698463103929542,0), FreeCAD.Vector(0.8682408883346521,4.92403876506104,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(0.8682408883346521,4.92403876506104,0), FreeCAD.Vector(3.061616997868383e-16,5.0,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(3.061616997868383e-16,5.0,0), FreeCAD.Vector(1.8369701987210297e-16,3.0,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(1.8369701987210297e-16,3.0,0), FreeCAD.Vector(0.5209445330007912,2.954423259036624,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(0.5209445330007912,2.954423259036624,0), FreeCAD.Vector(1.0260604299770064,2.819077862357725,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(1.0260604299770064,2.819077862357725,0), FreeCAD.Vector(1.5000000000000004,2.598076211353316,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(1.5000000000000004,2.598076211353316,0), FreeCAD.Vector(1.9283628290596182,2.298133329356934,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(1.9283628290596182,2.298133329356934,0), FreeCAD.Vector(2.298133329356934,1.9283628290596178,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(2.298133329356934,1.9283628290596178,0), FreeCAD.Vector(2.598076211353316,1.4999999999999998,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(2.598076211353316,1.4999999999999998,0), FreeCAD.Vector(2.8190778623577253,1.0260604299770062,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(2.8190778623577253,1.0260604299770062,0), FreeCAD.Vector(2.954423259036624,0.520944533000791,0)))
    qwm_doc.sketch_angpc1.addGeometry(Part.LineSegment(FreeCAD.Vector(2.954423259036624,0.520944533000791,0), FreeCAD.Vector(3.0,0.0,0)))
    qwm_doc.addObject("Part::Loft", "angpc1")
    qwm_doc.angpc1.Sections=[qwm_doc.sketch_angpc, qwm_doc.sketch_angpc1]
    qwm_doc.angpc1.Solid=True
    qwm_doc.angpc1.Ruled=False
    qwm_doc.angpc1.Closed=False
    angpc1_viewObject = qwm_doc.angpc1.ViewObject
    angpc1_viewObject.Transparency = 60
    qwm_doc.angpc1.Medium = QW_Modeller.getQWMedium("metal")
示例#6
0
def set_GeometryAndMedia(qwm_doc):
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_cubic')
    qwm_doc.sketch_cubic.Placement = FreeCAD.Placement(FreeCAD.Vector(0.0,0.0,0.0),FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_cubic.addGeometry(Part.LineSegment(FreeCAD.Vector(-5.0,-5.0,0), FreeCAD.Vector(5.0,-5.0,0)))
    qwm_doc.sketch_cubic.addGeometry(Part.LineSegment(FreeCAD.Vector(5.0,-5.0,0), FreeCAD.Vector(5.0,5.0,0)))
    qwm_doc.sketch_cubic.addGeometry(Part.LineSegment(FreeCAD.Vector(5.0,5.0,0), FreeCAD.Vector(-5.0,5.0,0)))
    qwm_doc.sketch_cubic.addGeometry(Part.LineSegment(FreeCAD.Vector(-5.0,5.0,0), FreeCAD.Vector(-5.0,-5.0,0)))
    qwm_doc.addObject("Part::Extrusion", "cubic")
    qwm_doc.cubic.Base = qwm_doc.sketch_cubic
    qwm_doc.cubic.Dir = (0, 0, 10.0)
    qwm_doc.cubic.Solid = True
    cubic_viewObject = qwm_doc.cubic.ViewObject
    cubic_viewObject.Transparency = 60
    qwm_doc.cubic.Medium = QW_Modeller.getQWMedium("air")
def set_GeometryAndMedia(qwm_doc):
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_tv')
    qwm_doc.sketch_tv.Placement = FreeCAD.Placement(FreeCAD.Vector(0.0,0.0,0.0),FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(4.0,0.0,0), FreeCAD.Vector(3.695518130045147,1.5307337294603591,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(3.695518130045147,1.5307337294603591,0), FreeCAD.Vector(2.8284271247461903,2.8284271247461903,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(2.8284271247461903,2.8284271247461903,0), FreeCAD.Vector(1.5307337294603593,3.695518130045147,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(1.5307337294603593,3.695518130045147,0), FreeCAD.Vector(2.4492935982947064e-16,4.0,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(2.4492935982947064e-16,4.0,0), FreeCAD.Vector(-1.530733729460359,3.695518130045147,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.530733729460359,3.695518130045147,0), FreeCAD.Vector(-2.82842712474619,2.8284271247461903,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(-2.82842712474619,2.8284271247461903,0), FreeCAD.Vector(-3.695518130045147,1.5307337294603596,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(-3.695518130045147,1.5307337294603596,0), FreeCAD.Vector(-4.0,4.898587196589413e-16,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(-4.0,4.898587196589413e-16,0), FreeCAD.Vector(-3.6955181300451474,-1.5307337294603587,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(-3.6955181300451474,-1.5307337294603587,0), FreeCAD.Vector(-2.8284271247461907,-2.82842712474619,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(-2.8284271247461907,-2.82842712474619,0), FreeCAD.Vector(-1.530733729460358,-3.6955181300451474,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.530733729460358,-3.6955181300451474,0), FreeCAD.Vector(-7.347880794884119e-16,-4.0,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(-7.347880794884119e-16,-4.0,0), FreeCAD.Vector(1.53073372946036,-3.6955181300451465,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(1.53073372946036,-3.6955181300451465,0), FreeCAD.Vector(2.8284271247461894,-2.8284271247461907,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(2.8284271247461894,-2.8284271247461907,0), FreeCAD.Vector(3.6955181300451474,-1.5307337294603582,0)))
    qwm_doc.sketch_tv.addGeometry(Part.LineSegment(FreeCAD.Vector(3.6955181300451474,-1.5307337294603582,0), FreeCAD.Vector(4.0,0.0,0)))
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_tv1')
    qwm_doc.sketch_tv1.Placement = FreeCAD.Placement(FreeCAD.Vector(0.0,0.0,4.0),FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(2.0,0.0,0), FreeCAD.Vector(1.8477590650225735,0.7653668647301796,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(1.8477590650225735,0.7653668647301796,0), FreeCAD.Vector(1.4142135623730951,1.4142135623730951,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(1.4142135623730951,1.4142135623730951,0), FreeCAD.Vector(0.7653668647301797,1.8477590650225735,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(0.7653668647301797,1.8477590650225735,0), FreeCAD.Vector(1.2246467991473532e-16,2.0,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(1.2246467991473532e-16,2.0,0), FreeCAD.Vector(-0.7653668647301795,1.8477590650225735,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(-0.7653668647301795,1.8477590650225735,0), FreeCAD.Vector(-1.414213562373095,1.4142135623730951,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.414213562373095,1.4142135623730951,0), FreeCAD.Vector(-1.8477590650225735,0.7653668647301798,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.8477590650225735,0.7653668647301798,0), FreeCAD.Vector(-2.0,2.4492935982947064e-16,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(-2.0,2.4492935982947064e-16,0), FreeCAD.Vector(-1.8477590650225737,-0.7653668647301793,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.8477590650225737,-0.7653668647301793,0), FreeCAD.Vector(-1.4142135623730954,-1.414213562373095,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.4142135623730954,-1.414213562373095,0), FreeCAD.Vector(-0.765366864730179,-1.8477590650225737,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(-0.765366864730179,-1.8477590650225737,0), FreeCAD.Vector(-3.6739403974420594e-16,-2.0,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(-3.6739403974420594e-16,-2.0,0), FreeCAD.Vector(0.76536686473018,-1.8477590650225733,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(0.76536686473018,-1.8477590650225733,0), FreeCAD.Vector(1.4142135623730947,-1.4142135623730954,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(1.4142135623730947,-1.4142135623730954,0), FreeCAD.Vector(1.8477590650225737,-0.7653668647301791,0)))
    qwm_doc.sketch_tv1.addGeometry(Part.LineSegment(FreeCAD.Vector(1.8477590650225737,-0.7653668647301791,0), FreeCAD.Vector(2.0,0.0,0)))
    qwm_doc.addObject("Part::Loft", "tv1")
    qwm_doc.tv1.Sections=[qwm_doc.sketch_tv, qwm_doc.sketch_tv1]
    qwm_doc.tv1.Solid=True
    qwm_doc.tv1.Ruled=False
    qwm_doc.tv1.Closed=False
    tv1_viewObject = qwm_doc.tv1.ViewObject
    tv1_viewObject.Transparency = 60
    qwm_doc.tv1.Medium = QW_Modeller.getQWMedium("air")
示例#8
0
def set_Mesh(qwm_doc):
    MeshBox1 = QW_Modeller.addQWObject("QW_Modeller::MeshBox", "MeshBox1")
    MeshBox1.Length = 267.0
    MeshBox1.Width = 270.0
    MeshBox1.Height = 268.0
    MeshBox1.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.0, 0.0, 134.0),
        FreeCAD.Rotation(0.0000000, 0.0000000, 0.0000000, 1.0000000))
    MeshBox1.MeshX = True
    MeshBox1.MeshY = True
    MeshBox1.MeshZ = True
    MeshBox1.MeshXCellSize = 1.7
    MeshBox1.MeshYCellSize = 1.7
    MeshBox1.MeshZCellSize = 12.0
    MeshBox1.SnapToXMinus = False
    MeshBox1.SnapToXPlus = False
    MeshBox1.SnapToYMinus = False
    MeshBox1.SnapToYPlus = False
    MeshBox1.SnapToZMinus = False
    MeshBox1.SnapToZPlus = False
示例#9
0
def set_Mesh(qwm_doc):
    MeshBox1 = QW_Modeller.addQWObject("QW_Modeller::MeshBox", "MeshBox1")
    MeshBox1.Length = 55.060959999999994
    MeshBox1.Width = 48.43812
    MeshBox1.Height = 48.43812
    MeshBox1.Placement = FreeCAD.Placement(
        FreeCAD.Vector(-8.999999999999998, 0.0, 0.0),
        FreeCAD.Rotation(0.0000000, 0.0000000, 0.0000000, 1.0000000))
    MeshBox1.MeshX = True
    MeshBox1.MeshY = True
    MeshBox1.MeshZ = True
    MeshBox1.MeshXCellSize = 2.2
    MeshBox1.MeshYCellSize = 2.2
    MeshBox1.MeshZCellSize = 2.2
    MeshBox1.SnapToXMinus = False
    MeshBox1.SnapToXPlus = False
    MeshBox1.SnapToYMinus = False
    MeshBox1.SnapToYPlus = False
    MeshBox1.SnapToZMinus = False
    MeshBox1.SnapToZPlus = False
示例#10
0
def set_Mesh(qwm_doc):
    MeshBox1 = QW_Modeller.addQWObject("QW_Modeller::MeshBox", "MeshBox1")
    MeshBox1.Length = 90.0
    MeshBox1.Width = 51.43
    MeshBox1.Height = 45.08
    MeshBox1.Placement = FreeCAD.Placement(
        FreeCAD.Vector(50.0, -14.285, 17.46),
        FreeCAD.Rotation(0.0000000, 0.0000000, 0.0000000, 1.0000000))
    MeshBox1.MeshX = True
    MeshBox1.MeshY = True
    MeshBox1.MeshZ = True
    MeshBox1.MeshXCellSize = 1.0
    MeshBox1.MeshYCellSize = 1.0
    MeshBox1.MeshZCellSize = 1.0
    MeshBox1.SnapToXMinus = False
    MeshBox1.SnapToXPlus = False
    MeshBox1.SnapToYMinus = False
    MeshBox1.SnapToYPlus = False
    MeshBox1.SnapToZMinus = False
    MeshBox1.SnapToZPlus = False
示例#11
0
def set_GeometryAndMedia(qwm_doc):
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_vtape')
    qwm_doc.sketch_vtape.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.0, 0.0, 0.0), FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_vtape.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-6.0, -3.0, 0),
                         FreeCAD.Vector(6.0, -3.0, 0)))
    qwm_doc.sketch_vtape.addGeometry(
        Part.LineSegment(FreeCAD.Vector(6.0, -3.0, 0),
                         FreeCAD.Vector(6.0, 3.0, 0)))
    qwm_doc.sketch_vtape.addGeometry(
        Part.LineSegment(FreeCAD.Vector(6.0, 3.0, 0),
                         FreeCAD.Vector(-6.0, 3.0, 0)))
    qwm_doc.sketch_vtape.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-6.0, 3.0, 0),
                         FreeCAD.Vector(-6.0, -3.0, 0)))
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_vtape1')
    qwm_doc.sketch_vtape1.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.0, 0.0, 30.0), FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_vtape1.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-4.0, -1.5, 0),
                         FreeCAD.Vector(4.0, -1.5, 0)))
    qwm_doc.sketch_vtape1.addGeometry(
        Part.LineSegment(FreeCAD.Vector(4.0, -1.5, 0),
                         FreeCAD.Vector(4.0, 1.5, 0)))
    qwm_doc.sketch_vtape1.addGeometry(
        Part.LineSegment(FreeCAD.Vector(4.0, 1.5, 0),
                         FreeCAD.Vector(-4.0, 1.5, 0)))
    qwm_doc.sketch_vtape1.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-4.0, 1.5, 0),
                         FreeCAD.Vector(-4.0, -1.5, 0)))
    qwm_doc.addObject("Part::Loft", "vtape1")
    qwm_doc.vtape1.Sections = [qwm_doc.sketch_vtape, qwm_doc.sketch_vtape1]
    qwm_doc.vtape1.Solid = True
    qwm_doc.vtape1.Ruled = False
    qwm_doc.vtape1.Closed = False
    vtape1_viewObject = qwm_doc.vtape1.ViewObject
    vtape1_viewObject.Transparency = 60
    qwm_doc.vtape1.Medium = QW_Modeller.getQWMedium("air")
示例#12
0
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path+"\platforms" #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from cylinder_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("cylinder")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = cylinder_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#13
0
def set_Excitation(qwm_doc):
    QW_Modeller.addQWObject("QW_Modeller::SnappingPlane", "spx1")
    qwm_doc.spx1.Placement = FreeCAD.Placement(
        FreeCAD.Vector(-10.0, 0.05, 0.0), FreeCAD.Rotation(0.5, 0.5, 0.5, 0.5))
    qwm_doc.spx1.Orientation = "X"
    qwm_doc.spx1.Position = -10.0
    qwm_doc.spx1.Length = 0.1
    qwm_doc.spx1.Width = 0.0
    FreeCAD.Gui.ActiveDocument.spx1.ShowText = False
    FreeCAD.Gui.ActiveDocument.spx1.TextSize = 14
    FreeCAD.Gui.ActiveDocument.spx1.TextPlace = 3
    QW_Modeller.addQWObject("QW_Modeller::SnappingPlane", "spx2")
    qwm_doc.spx2.Placement = FreeCAD.Placement(
        FreeCAD.Vector(10.0, 0.05, 0.0), FreeCAD.Rotation(0.5, 0.5, 0.5, 0.5))
    qwm_doc.spx2.Orientation = "X"
    qwm_doc.spx2.Position = 10.0
    qwm_doc.spx2.Length = 0.1
    qwm_doc.spx2.Width = 0.0
    FreeCAD.Gui.ActiveDocument.spx2.ShowText = False
    FreeCAD.Gui.ActiveDocument.spx2.TextSize = 14
    FreeCAD.Gui.ActiveDocument.spx2.TextPlace = 3
    QW_Modeller.addQWObject("QW_Modeller::SnappingPlane", "spy1")
    qwm_doc.spy1.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.05, -7.5, 0.0), FreeCAD.Rotation(0.5, 0.5, 0.5, -0.5))
    qwm_doc.spy1.Orientation = "Y"
    qwm_doc.spy1.Position = -7.5
    qwm_doc.spy1.Length = 0.0
    qwm_doc.spy1.Width = 0.1
    FreeCAD.Gui.ActiveDocument.spy1.ShowText = False
    FreeCAD.Gui.ActiveDocument.spy1.TextSize = 14
    FreeCAD.Gui.ActiveDocument.spy1.TextPlace = 3
    QW_Modeller.addQWObject("QW_Modeller::SnappingPlane", "spy2")
    qwm_doc.spy2.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.05, 7.5, 0.0), FreeCAD.Rotation(0.5, 0.5, 0.5, -0.5))
    qwm_doc.spy2.Orientation = "Y"
    qwm_doc.spy2.Position = 7.5
    qwm_doc.spy2.Length = 0.0
    qwm_doc.spy2.Width = 0.1
    FreeCAD.Gui.ActiveDocument.spy2.ShowText = False
    FreeCAD.Gui.ActiveDocument.spy2.TextSize = 14
    FreeCAD.Gui.ActiveDocument.spy2.TextPlace = 3
    QW_Modeller.addQWObject("QW_Modeller::TemplatePort", "inp")
    qwm_doc.inp.Length = 10.0
    qwm_doc.inp.Width = 5.0
    qwm_doc.inp.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.0, 0.0, -20.0), FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.inp.Orientation = "Z"
    qwm_doc.inp.Position = -20.0
    qwm_doc.inp.Activity = "PLUS"
    qwm_doc.inp.Type = "Source"
    qwm_doc.inp.SymmetryH = False
    qwm_doc.inp.SymmetryV = False
    qwm_doc.inp.PointCoordX = 0.0
    qwm_doc.inp.PointCoordY = 0.0
    qwm_doc.inp.PointCoordZ = -20.0
    qwm_doc.inp.effectivePermitivityMode = "AUTO"
    qwm_doc.inp.Excitation = QW_Modeller.TemplateExcitation(
        QW_Modeller.DriveFunction(QW_Modeller.Waveform('delta'), 1, 0, 1, 0),
        'TEM', 'Ex', 1,
        QW_Modeller.TemplateGenerationConf('Automatic', (10, 0.2),
                                           (9, 11, 0.01), 1, 50, 1, 0))
    qwm_doc.inp.MultiPointExcitation = QW_Modeller.MultiPointPortExcitation(
        0, "0.1")
    qwm_doc.inp.Postprocessing = QW_Modeller.PortPostprocessing(0, 0, 1)
    qwm_doc.inp.ReferenceOffset = abs(qwm_doc.inp.PointCoordZ - -15.0)
示例#14
0
    'QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path + "\platforms"  #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from dielf1_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("dielf1")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = dielf1_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#15
0
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path+"\platforms" #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from cubeNested_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("cubeNested")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = cubeNested_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#16
0
    'QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path + "\platforms"  #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from patch2_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("patch2")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = patch2_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#17
0
def set_Excitation(qwm_doc):
    QW_Modeller.addQWObject("QW_Modeller::TemplatePort", "guideinp")
    qwm_doc.guideinp.Length = 10.0
    qwm_doc.guideinp.Width = 5.0
    qwm_doc.guideinp.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.0, 5.0, 2.5), FreeCAD.Rotation(0.5, 0.5, 0.5, 0.5))
    qwm_doc.guideinp.Orientation = "X"
    qwm_doc.guideinp.Position = 0.0
    qwm_doc.guideinp.Activity = "PLUS"
    qwm_doc.guideinp.Type = "Source"
    qwm_doc.guideinp.SymmetryH = False
    qwm_doc.guideinp.SymmetryV = False
    qwm_doc.guideinp.PointCoordX = 0.0
    qwm_doc.guideinp.PointCoordY = 5.0
    qwm_doc.guideinp.PointCoordZ = 2.5
    qwm_doc.guideinp.effectivePermitivityMode = "AUTO"
    qwm_doc.guideinp.Excitation = QW_Modeller.TemplateExcitation(
        QW_Modeller.DriveFunction(QW_Modeller.Waveform('delta'), 1, 0, 1, 0),
        'TEM', 'Ex', 1,
        QW_Modeller.TemplateGenerationConf('Automatic', (10, 0.2),
                                           (9, 11, 0.01), 1, 50, 1, 0))
    qwm_doc.guideinp.MultiPointExcitation = QW_Modeller.MultiPointPortExcitation(
        0, "0.1")
    qwm_doc.guideinp.Postprocessing = QW_Modeller.PortPostprocessing(0, 0, 1)
    qwm_doc.guideinp.ReferenceOffset = abs(qwm_doc.guideinp.PointCoordX - 5.2)
    QW_Modeller.addQWObject("QW_Modeller::TemplatePort", "coaxout")
    qwm_doc.coaxout.Length = 5.0
    qwm_doc.coaxout.Width = 5.0
    qwm_doc.coaxout.Placement = FreeCAD.Placement(
        FreeCAD.Vector(19.6, 5.0, 14.0), FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.coaxout.Orientation = "Z"
    qwm_doc.coaxout.Position = 14.0
    qwm_doc.coaxout.Activity = "MINUS"
    qwm_doc.coaxout.Type = "Load"
    qwm_doc.coaxout.SymmetryH = False
    qwm_doc.coaxout.SymmetryV = False
    qwm_doc.coaxout.PointCoordX = 19.6
    qwm_doc.coaxout.PointCoordY = 5.0
    qwm_doc.coaxout.PointCoordZ = 14.0
    qwm_doc.coaxout.effectivePermitivityMode = "AUTO"
    qwm_doc.coaxout.Excitation = QW_Modeller.TemplateExcitation(
        QW_Modeller.DriveFunction(QW_Modeller.Waveform('delta'), 1, 0, 1, 0),
        'TEM', 'Ex', 1,
        QW_Modeller.TemplateGenerationConf('Automatic', (10, 0.2),
                                           (9, 11, 0.01), 1, 50, 1, 0))
    qwm_doc.coaxout.MultiPointExcitation = QW_Modeller.MultiPointPortExcitation(
        0, "0.1")
    qwm_doc.coaxout.Postprocessing = QW_Modeller.PortPostprocessing(0, 0, 1)
    qwm_doc.coaxout.ReferenceOffset = abs(qwm_doc.coaxout.PointCoordZ - 9.0)
示例#18
0
    'QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path + "\platforms"  #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from cyv_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("cyv")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = cyv_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#19
0
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path+"\platforms" #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from cube_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("cube")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = cube_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#20
0
def set_GeometryAndMedia(qwm_doc):
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_cubic1')
    qwm_doc.sketch_cubic1.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.0, 0.0, 0.0), FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_cubic1.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-3.0, -2.5, 0),
                         FreeCAD.Vector(3.0, -2.5, 0)))
    qwm_doc.sketch_cubic1.addGeometry(
        Part.LineSegment(FreeCAD.Vector(3.0, -2.5, 0),
                         FreeCAD.Vector(3.0, 2.5, 0)))
    qwm_doc.sketch_cubic1.addGeometry(
        Part.LineSegment(FreeCAD.Vector(3.0, 2.5, 0),
                         FreeCAD.Vector(-3.0, 2.5, 0)))
    qwm_doc.sketch_cubic1.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-3.0, 2.5, 0),
                         FreeCAD.Vector(-3.0, -2.5, 0)))
    qwm_doc.addObject("Part::Extrusion", "cubic1")
    qwm_doc.cubic1.Base = qwm_doc.sketch_cubic1
    qwm_doc.cubic1.Dir = (0, 0, 5.0)
    qwm_doc.cubic1.Solid = True
    cubic1_viewObject = qwm_doc.cubic1.ViewObject
    cubic1_viewObject.Transparency = 60
    qwm_doc.cubic1.Medium = QW_Modeller.getQWMedium("air")
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_prismb')
    qwm_doc.sketch_prismb.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.0, 0.0, 5.0), FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_prismb.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-3.0, -2.5, 0),
                         FreeCAD.Vector(3.0, -2.5, 0)))
    qwm_doc.sketch_prismb.addGeometry(
        Part.LineSegment(FreeCAD.Vector(3.0, -2.5, 0),
                         FreeCAD.Vector(3.0, 2.5, 0)))
    qwm_doc.sketch_prismb.addGeometry(
        Part.LineSegment(FreeCAD.Vector(3.0, 2.5, 0),
                         FreeCAD.Vector(-3.0, 2.5, 0)))
    qwm_doc.sketch_prismb.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-3.0, 2.5, 0),
                         FreeCAD.Vector(-3.0, -2.5, 0)))
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_prismt')
    qwm_doc.sketch_prismt.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.0, 0.0, 12.0), FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_prismt.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-1.5, -1.25, 0),
                         FreeCAD.Vector(1.5, -1.25, 0)))
    qwm_doc.sketch_prismt.addGeometry(
        Part.LineSegment(FreeCAD.Vector(1.5, -1.25, 0),
                         FreeCAD.Vector(1.5, 1.25, 0)))
    qwm_doc.sketch_prismt.addGeometry(
        Part.LineSegment(FreeCAD.Vector(1.5, 1.25, 0),
                         FreeCAD.Vector(-1.5, 1.25, 0)))
    qwm_doc.sketch_prismt.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-1.5, 1.25, 0),
                         FreeCAD.Vector(-1.5, -1.25, 0)))
    qwm_doc.addObject("Part::Loft", "prismt")
    qwm_doc.prismt.Sections = [qwm_doc.sketch_prismb, qwm_doc.sketch_prismt]
    qwm_doc.prismt.Solid = True
    qwm_doc.prismt.Ruled = False
    qwm_doc.prismt.Closed = False
    prismt_viewObject = qwm_doc.prismt.ViewObject
    prismt_viewObject.Transparency = 60
    qwm_doc.prismt.Medium = QW_Modeller.getQWMedium("air")
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_cubic3')
    qwm_doc.sketch_cubic3.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.0, 0.0, 12.0), FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_cubic3.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-1.5, -1.25, 0),
                         FreeCAD.Vector(1.5, -1.25, 0)))
    qwm_doc.sketch_cubic3.addGeometry(
        Part.LineSegment(FreeCAD.Vector(1.5, -1.25, 0),
                         FreeCAD.Vector(1.5, 1.25, 0)))
    qwm_doc.sketch_cubic3.addGeometry(
        Part.LineSegment(FreeCAD.Vector(1.5, 1.25, 0),
                         FreeCAD.Vector(-1.5, 1.25, 0)))
    qwm_doc.sketch_cubic3.addGeometry(
        Part.LineSegment(FreeCAD.Vector(-1.5, 1.25, 0),
                         FreeCAD.Vector(-1.5, -1.25, 0)))
    qwm_doc.addObject("Part::Extrusion", "cubic3")
    qwm_doc.cubic3.Base = qwm_doc.sketch_cubic3
    qwm_doc.cubic3.Dir = (0, 0, 3.0)
    qwm_doc.cubic3.Solid = True
    cubic3_viewObject = qwm_doc.cubic3.ViewObject
    cubic3_viewObject.Transparency = 60
    qwm_doc.cubic3.Medium = QW_Modeller.getQWMedium("air")
示例#21
0
def set_GeometryAndMedia(qwm_doc):
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_cwghwg')
    qwm_doc.sketch_cwghwg.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.0, 0.0, 0.0), FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(50.0, 0.0, 0),
            FreeCAD.Vector(49.75923633360985, 4.90085701647803, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(49.75923633360985, 4.90085701647803, 0),
            FreeCAD.Vector(49.039264020161525, 9.754516100806413, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(49.039264020161525, 9.754516100806413, 0),
            FreeCAD.Vector(47.84701678661044, 14.514233862723117, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(47.84701678661044, 14.514233862723117, 0),
            FreeCAD.Vector(46.19397662556434, 19.134171618254488, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(46.19397662556434, 19.134171618254488, 0),
            FreeCAD.Vector(44.09606321741775, 23.56983684129988, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(44.09606321741775, 23.56983684129988, 0),
            FreeCAD.Vector(41.57348061512726, 27.778511650980107, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(41.57348061512726, 27.778511650980107, 0),
            FreeCAD.Vector(38.65052266813685, 31.719664208182273, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(38.65052266813685, 31.719664208182273, 0),
            FreeCAD.Vector(35.35533905932738, 35.35533905932738, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(35.35533905932738, 35.35533905932738, 0),
            FreeCAD.Vector(31.719664208182273, 38.650522668136844, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(31.719664208182273, 38.650522668136844, 0),
            FreeCAD.Vector(27.778511650980114, 41.57348061512726, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(27.778511650980114, 41.57348061512726, 0),
            FreeCAD.Vector(23.569836841299878, 44.09606321741775, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(23.569836841299878, 44.09606321741775, 0),
            FreeCAD.Vector(19.13417161825449, 46.19397662556434, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(19.13417161825449, 46.19397662556434, 0),
            FreeCAD.Vector(14.514233862723117, 47.847016786610446, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(14.514233862723117, 47.847016786610446, 0),
            FreeCAD.Vector(9.754516100806416, 49.039264020161525, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(9.754516100806416, 49.039264020161525, 0),
            FreeCAD.Vector(4.900857016478027, 49.75923633360985, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(4.900857016478027, 49.75923633360985, 0),
            FreeCAD.Vector(3.061616997868383e-15, 50.0, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(3.061616997868383e-15, 50.0, 0),
            FreeCAD.Vector(-4.9008570164780325, 49.75923633360985, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-4.9008570164780325, 49.75923633360985, 0),
            FreeCAD.Vector(-9.75451610080641, 49.039264020161525, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-9.75451610080641, 49.039264020161525, 0),
            FreeCAD.Vector(-14.514233862723119, 47.84701678661044, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-14.514233862723119, 47.84701678661044, 0),
            FreeCAD.Vector(-19.134171618254488, 46.19397662556434, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-19.134171618254488, 46.19397662556434, 0),
            FreeCAD.Vector(-23.569836841299885, 44.09606321741775, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-23.569836841299885, 44.09606321741775, 0),
            FreeCAD.Vector(-27.778511650980114, 41.57348061512726, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-27.778511650980114, 41.57348061512726, 0),
            FreeCAD.Vector(-31.71966420818227, 38.65052266813686, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-31.71966420818227, 38.65052266813686, 0),
            FreeCAD.Vector(-35.35533905932737, 35.35533905932738, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-35.35533905932737, 35.35533905932738, 0),
            FreeCAD.Vector(-38.65052266813685, 31.719664208182273, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-38.65052266813685, 31.719664208182273, 0),
            FreeCAD.Vector(-41.573480615127266, 27.778511650980107, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-41.573480615127266, 27.778511650980107, 0),
            FreeCAD.Vector(-44.09606321741775, 23.56983684129989, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-44.09606321741775, 23.56983684129989, 0),
            FreeCAD.Vector(-46.19397662556434, 19.134171618254495, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-46.19397662556434, 19.134171618254495, 0),
            FreeCAD.Vector(-47.84701678661044, 14.514233862723119, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-47.84701678661044, 14.514233862723119, 0),
            FreeCAD.Vector(-49.039264020161525, 9.754516100806407, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-49.039264020161525, 9.754516100806407, 0),
            FreeCAD.Vector(-49.75923633360984, 4.900857016478041, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-49.75923633360984, 4.900857016478041, 0),
            FreeCAD.Vector(-50.0, 6.123233995736766e-15, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-50.0, 6.123233995736766e-15, 0),
            FreeCAD.Vector(-49.75923633360985, -4.90085701647803, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-49.75923633360985, -4.90085701647803, 0),
            FreeCAD.Vector(-49.039264020161525, -9.754516100806418, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-49.039264020161525, -9.754516100806418, 0),
            FreeCAD.Vector(-47.847016786610446, -14.514233862723106, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-47.847016786610446, -14.514233862723106, 0),
            FreeCAD.Vector(-46.19397662556434, -19.134171618254484, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-46.19397662556434, -19.134171618254484, 0),
            FreeCAD.Vector(-44.09606321741775, -23.56983684129988, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-44.09606321741775, -23.56983684129988, 0),
            FreeCAD.Vector(-41.57348061512726, -27.778511650980114, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-41.57348061512726, -27.778511650980114, 0),
            FreeCAD.Vector(-38.65052266813686, -31.719664208182262, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-38.65052266813686, -31.719664208182262, 0),
            FreeCAD.Vector(-35.355339059327385, -35.35533905932737, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-35.355339059327385, -35.35533905932737, 0),
            FreeCAD.Vector(-31.719664208182298, -38.65052266813683, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-31.719664208182298, -38.65052266813683, 0),
            FreeCAD.Vector(-27.778511650980107, -41.57348061512726, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-27.778511650980107, -41.57348061512726, 0),
            FreeCAD.Vector(-23.569836841299892, -44.09606321741775, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-23.569836841299892, -44.09606321741775, 0),
            FreeCAD.Vector(-19.134171618254474, -46.19397662556434, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-19.134171618254474, -46.19397662556434, 0),
            FreeCAD.Vector(-14.514233862723122, -47.84701678661044, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-14.514233862723122, -47.84701678661044, 0),
            FreeCAD.Vector(-9.754516100806434, -49.03926402016152, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-9.754516100806434, -49.03926402016152, 0),
            FreeCAD.Vector(-4.900857016478023, -49.75923633360985, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-4.900857016478023, -49.75923633360985, 0),
            FreeCAD.Vector(-9.184850993605149e-15, -50.0, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-9.184850993605149e-15, -50.0, 0),
            FreeCAD.Vector(4.900857016478004, -49.75923633360985, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(4.900857016478004, -49.75923633360985, 0),
            FreeCAD.Vector(9.754516100806415, -49.039264020161525, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(9.754516100806415, -49.039264020161525, 0),
            FreeCAD.Vector(14.514233862723103, -47.847016786610446, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(14.514233862723103, -47.847016786610446, 0),
            FreeCAD.Vector(19.1341716182545, -46.19397662556433, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(19.1341716182545, -46.19397662556433, 0),
            FreeCAD.Vector(23.569836841299878, -44.09606321741775, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(23.569836841299878, -44.09606321741775, 0),
            FreeCAD.Vector(27.778511650980093, -41.57348061512727, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(27.778511650980093, -41.57348061512727, 0),
            FreeCAD.Vector(31.71966420818228, -38.650522668136844, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(31.71966420818228, -38.650522668136844, 0),
            FreeCAD.Vector(35.35533905932737, -35.355339059327385, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(35.35533905932737, -35.355339059327385, 0),
            FreeCAD.Vector(38.65052266813686, -31.719664208182262, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(38.65052266813686, -31.719664208182262, 0),
            FreeCAD.Vector(41.57348061512726, -27.778511650980107, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(41.57348061512726, -27.778511650980107, 0),
            FreeCAD.Vector(44.09606321741774, -23.569836841299896, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(44.09606321741774, -23.569836841299896, 0),
            FreeCAD.Vector(46.19397662556434, -19.134171618254477, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(46.19397662556434, -19.134171618254477, 0),
            FreeCAD.Vector(47.84701678661044, -14.514233862723124, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(47.84701678661044, -14.514233862723124, 0),
            FreeCAD.Vector(49.03926402016152, -9.754516100806436, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(49.03926402016152, -9.754516100806436, 0),
            FreeCAD.Vector(49.75923633360985, -4.900857016478025, 0)))
    qwm_doc.sketch_cwghwg.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(49.75923633360985, -4.900857016478025, 0),
            FreeCAD.Vector(50.0, 0.0, 0)))
    qwm_doc.addObject("Part::Extrusion", "cwghwg")
    qwm_doc.cwghwg.Base = qwm_doc.sketch_cwghwg
    qwm_doc.cwghwg.Dir = (0, 0, 300.0)
    qwm_doc.cwghwg.Solid = True
    cwghwg_viewObject = qwm_doc.cwghwg.ViewObject
    cwghwg_viewObject.Transparency = 60
    qwm_doc.cwghwg.Medium = QW_Modeller.getQWMedium("air")
    qwm_doc.addObject('Sketcher::SketchObject', 'sketch_cwghld')
    qwm_doc.sketch_cwghld.Placement = FreeCAD.Placement(
        FreeCAD.Vector(0.0, 0.0, 100.0), FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(15.0, 0.0, 0),
            FreeCAD.Vector(14.927770900082955, 1.470257104943409, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(14.927770900082955, 1.470257104943409, 0),
            FreeCAD.Vector(14.711779206048456, 2.9263548302419236, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(14.711779206048456, 2.9263548302419236, 0),
            FreeCAD.Vector(14.354105035983132, 4.354270158816935, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(14.354105035983132, 4.354270158816935, 0),
            FreeCAD.Vector(13.858192987669302, 5.740251485476347, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(13.858192987669302, 5.740251485476347, 0),
            FreeCAD.Vector(13.228818965225326, 7.070951052389964, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(13.228818965225326, 7.070951052389964, 0),
            FreeCAD.Vector(12.472044184538179, 8.333553495294034, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(12.472044184538179, 8.333553495294034, 0),
            FreeCAD.Vector(11.595156800441055, 9.515899262454683, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(11.595156800441055, 9.515899262454683, 0),
            FreeCAD.Vector(10.606601717798213, 10.606601717798213, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(10.606601717798213, 10.606601717798213, 0),
            FreeCAD.Vector(9.515899262454683, 11.595156800441053, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(9.515899262454683, 11.595156800441053, 0),
            FreeCAD.Vector(8.333553495294034, 12.472044184538179, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(8.333553495294034, 12.472044184538179, 0),
            FreeCAD.Vector(7.0709510523899635, 13.228818965225326, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(7.0709510523899635, 13.228818965225326, 0),
            FreeCAD.Vector(5.740251485476348, 13.858192987669302, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(5.740251485476348, 13.858192987669302, 0),
            FreeCAD.Vector(4.354270158816935, 14.354105035983133, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(4.354270158816935, 14.354105035983133, 0),
            FreeCAD.Vector(2.926354830241925, 14.711779206048456, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(2.926354830241925, 14.711779206048456, 0),
            FreeCAD.Vector(1.4702571049434083, 14.927770900082955, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(1.4702571049434083, 14.927770900082955, 0),
            FreeCAD.Vector(9.18485099360515e-16, 15.0, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(9.18485099360515e-16, 15.0, 0),
            FreeCAD.Vector(-1.4702571049434097, 14.927770900082955, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-1.4702571049434097, 14.927770900082955, 0),
            FreeCAD.Vector(-2.926354830241923, 14.711779206048456, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-2.926354830241923, 14.711779206048456, 0),
            FreeCAD.Vector(-4.354270158816936, 14.354105035983132, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-4.354270158816936, 14.354105035983132, 0),
            FreeCAD.Vector(-5.740251485476346, 13.858192987669302, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-5.740251485476346, 13.858192987669302, 0),
            FreeCAD.Vector(-7.070951052389965, 13.228818965225326, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-7.070951052389965, 13.228818965225326, 0),
            FreeCAD.Vector(-8.333553495294034, 12.472044184538177, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-8.333553495294034, 12.472044184538177, 0),
            FreeCAD.Vector(-9.515899262454681, 11.595156800441057, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-9.515899262454681, 11.595156800441057, 0),
            FreeCAD.Vector(-10.606601717798211, 10.606601717798213, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-10.606601717798211, 10.606601717798213, 0),
            FreeCAD.Vector(-11.595156800441055, 9.515899262454683, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-11.595156800441055, 9.515899262454683, 0),
            FreeCAD.Vector(-12.47204418453818, 8.333553495294034, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-12.47204418453818, 8.333553495294034, 0),
            FreeCAD.Vector(-13.228818965225324, 7.070951052389967, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-13.228818965225324, 7.070951052389967, 0),
            FreeCAD.Vector(-13.858192987669302, 5.740251485476349, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-13.858192987669302, 5.740251485476349, 0),
            FreeCAD.Vector(-14.354105035983132, 4.354270158816936, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-14.354105035983132, 4.354270158816936, 0),
            FreeCAD.Vector(-14.711779206048456, 2.9263548302419227, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-14.711779206048456, 2.9263548302419227, 0),
            FreeCAD.Vector(-14.927770900082953, 1.4702571049434123, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-14.927770900082953, 1.4702571049434123, 0),
            FreeCAD.Vector(-15.0, 1.83697019872103e-15, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-15.0, 1.83697019872103e-15, 0),
            FreeCAD.Vector(-14.927770900082955, -1.4702571049434088, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-14.927770900082955, -1.4702571049434088, 0),
            FreeCAD.Vector(-14.711779206048456, -2.9263548302419253, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-14.711779206048456, -2.9263548302419253, 0),
            FreeCAD.Vector(-14.354105035983133, -4.354270158816932, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-14.354105035983133, -4.354270158816932, 0),
            FreeCAD.Vector(-13.858192987669304, -5.740251485476345, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-13.858192987669304, -5.740251485476345, 0),
            FreeCAD.Vector(-13.228818965225326, -7.070951052389964, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-13.228818965225326, -7.070951052389964, 0),
            FreeCAD.Vector(-12.472044184538179, -8.333553495294034, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-12.472044184538179, -8.333553495294034, 0),
            FreeCAD.Vector(-11.595156800441057, -9.51589926245468, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-11.595156800441057, -9.51589926245468, 0),
            FreeCAD.Vector(-10.606601717798215, -10.606601717798211, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-10.606601717798215, -10.606601717798211, 0),
            FreeCAD.Vector(-9.515899262454688, -11.59515680044105, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-9.515899262454688, -11.59515680044105, 0),
            FreeCAD.Vector(-8.333553495294034, -12.472044184538179, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-8.333553495294034, -12.472044184538179, 0),
            FreeCAD.Vector(-7.070951052389968, -13.228818965225324, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-7.070951052389968, -13.228818965225324, 0),
            FreeCAD.Vector(-5.7402514854763425, -13.858192987669304, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-5.7402514854763425, -13.858192987669304, 0),
            FreeCAD.Vector(-4.354270158816937, -14.354105035983132, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-4.354270158816937, -14.354105035983132, 0),
            FreeCAD.Vector(-2.9263548302419298, -14.711779206048455, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-2.9263548302419298, -14.711779206048455, 0),
            FreeCAD.Vector(-1.4702571049434068, -14.927770900082955, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-1.4702571049434068, -14.927770900082955, 0),
            FreeCAD.Vector(-2.7554552980815444e-15, -15.0, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(-2.7554552980815444e-15, -15.0, 0),
            FreeCAD.Vector(1.4702571049434014, -14.927770900082955, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(1.4702571049434014, -14.927770900082955, 0),
            FreeCAD.Vector(2.9263548302419244, -14.711779206048456, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(2.9263548302419244, -14.711779206048456, 0),
            FreeCAD.Vector(4.354270158816931, -14.354105035983133, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(4.354270158816931, -14.354105035983133, 0),
            FreeCAD.Vector(5.7402514854763504, -13.8581929876693, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(5.7402514854763504, -13.8581929876693, 0),
            FreeCAD.Vector(7.0709510523899635, -13.228818965225326, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(7.0709510523899635, -13.228818965225326, 0),
            FreeCAD.Vector(8.333553495294028, -12.472044184538182, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(8.333553495294028, -12.472044184538182, 0),
            FreeCAD.Vector(9.515899262454685, -11.595156800441053, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(9.515899262454685, -11.595156800441053, 0),
            FreeCAD.Vector(10.60660171779821, -10.606601717798215, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(10.60660171779821, -10.606601717798215, 0),
            FreeCAD.Vector(11.595156800441059, -9.51589926245468, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(11.595156800441059, -9.51589926245468, 0),
            FreeCAD.Vector(12.472044184538179, -8.333553495294034, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(12.472044184538179, -8.333553495294034, 0),
            FreeCAD.Vector(13.228818965225322, -7.070951052389969, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(13.228818965225322, -7.070951052389969, 0),
            FreeCAD.Vector(13.858192987669304, -5.740251485476343, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(13.858192987669304, -5.740251485476343, 0),
            FreeCAD.Vector(14.354105035983132, -4.354270158816938, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(14.354105035983132, -4.354270158816938, 0),
            FreeCAD.Vector(14.711779206048455, -2.9263548302419307, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(14.711779206048455, -2.9263548302419307, 0),
            FreeCAD.Vector(14.927770900082955, -1.4702571049434077, 0)))
    qwm_doc.sketch_cwghld.addGeometry(
        Part.LineSegment(
            FreeCAD.Vector(14.927770900082955, -1.4702571049434077, 0),
            FreeCAD.Vector(15.0, 0.0, 0)))
    qwm_doc.addObject("Part::Extrusion", "cwghld")
    qwm_doc.cwghld.Base = qwm_doc.sketch_cwghld
    qwm_doc.cwghld.Dir = (0, 0, 100.0)
    qwm_doc.cwghld.Solid = True
    cwghld_viewObject = qwm_doc.cwghld.ViewObject
    cwghld_viewObject.Transparency = 60
    qwm_doc.cwghld.Medium = QW_Modeller.getQWMedium("air")
示例#22
0
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path+"\platforms" #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from rx_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("rx")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = rx_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#23
0
    'QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path + "\platforms"  #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from vtape_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("vtape")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = vtape_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#24
0
    'QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path + "\platforms"  #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from cwgheat_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("cwgheat")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = cwgheat_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
    'QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path + "\platforms"  #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from wgtocx1_inventor_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("wgtocx1_inventor")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = wgtocx1_inventor_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#26
0
    'QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path + "\platforms"  #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from angpc_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("angpc")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = angpc_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#27
0
    'QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path + "\platforms"  #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from ant2R_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("ant2R")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = ant2R_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#28
0
def set_Excitation(qwm_doc):
    QW_Modeller.addQWObject("QW_Modeller::TemplatePort", "port")
    qwm_doc.port.Length = 20.0
    qwm_doc.port.Width = 1.0
    qwm_doc.port.Placement = FreeCAD.Placement(
        FreeCAD.Vector(-20.0, 18.0, 0.5), FreeCAD.Rotation(0.5, 0.5, 0.5, 0.5))
    qwm_doc.port.Orientation = "X"
    qwm_doc.port.Position = -20.0
    qwm_doc.port.Activity = "PLUS"
    qwm_doc.port.Type = "Source"
    qwm_doc.port.SymmetryH = False
    qwm_doc.port.SymmetryV = False
    qwm_doc.port.PointCoordX = -20.0
    qwm_doc.port.PointCoordY = 18.0
    qwm_doc.port.PointCoordZ = 0.5
    qwm_doc.port.effectivePermitivityMode = "AUTO"
    qwm_doc.port.Excitation = QW_Modeller.TemplateExcitation(
        QW_Modeller.DriveFunction(QW_Modeller.Waveform('delta'), 1, 0, 1, 0),
        'TEM', 'Ex', 1,
        QW_Modeller.TemplateGenerationConf('Automatic', (10, 0.2),
                                           (9, 11, 0.01), 1, 50, 1, 0))
    qwm_doc.port.MultiPointExcitation = QW_Modeller.MultiPointPortExcitation(
        0, "0.1")
    qwm_doc.port.Postprocessing = QW_Modeller.PortPostprocessing(0, 0, 1)
    qwm_doc.port.ReferenceOffset = abs(qwm_doc.port.PointCoordX - -2.0)
    QW_Modeller.addQWObject("QW_Modeller::AbsorbingWall", "abs_left")
    qwm_doc.abs_left.Orientation = "X"
    qwm_doc.abs_left.Length = 697.8187226079011
    qwm_doc.abs_left.Width = 1.0
    qwm_doc.abs_left.Placement = FreeCAD.Placement(
        FreeCAD.Vector(-80.0, 348.90936130395056, 0.5),
        FreeCAD.Rotation(0.5, 0.5, 0.5, 0.5))
    qwm_doc.abs_left.Position = -80.0
    qwm_doc.abs_left.Activity = "PLUS"
    FreeCAD.Gui.ActiveDocument.abs_left.AbsorberDepth = 1.00000
    FreeCAD.Gui.ActiveDocument.abs_left.ShowText = True
    FreeCAD.Gui.ActiveDocument.abs_left.TextSize = 14
    FreeCAD.Gui.ActiveDocument.abs_left.TextPlace = 3
    qwm_doc.abs_left.Type = "MUR"
    qwm_doc.abs_left.EffectivePermittivity = 1
    QW_Modeller.addQWObject("QW_Modeller::AbsorbingWall", "abs_right")
    qwm_doc.abs_right.Orientation = "X"
    qwm_doc.abs_right.Length = 697.8187226079011
    qwm_doc.abs_right.Width = 1.0
    qwm_doc.abs_right.Placement = FreeCAD.Placement(
        FreeCAD.Vector(552.0, 348.90936130395056, 0.5),
        FreeCAD.Rotation(0.5, 0.5, 0.5, 0.5))
    qwm_doc.abs_right.Position = 552.0
    qwm_doc.abs_right.Activity = "MINUS"
    FreeCAD.Gui.ActiveDocument.abs_right.AbsorberDepth = 1.00000
    FreeCAD.Gui.ActiveDocument.abs_right.ShowText = True
    FreeCAD.Gui.ActiveDocument.abs_right.TextSize = 14
    FreeCAD.Gui.ActiveDocument.abs_right.TextPlace = 3
    qwm_doc.abs_right.Type = "MUR"
    qwm_doc.abs_right.EffectivePermittivity = 1
    qwm_doc.QW_Mesh_Borders.BorderXMin = "PMC"
    qwm_doc.QW_Mesh_Borders.BorderXMax = "PEC"
    qwm_doc.QW_Mesh_Borders.BorderYMin = "PEC"
    qwm_doc.QW_Mesh_Borders.BorderYMax = "PEC"
    qwm_doc.QW_Mesh_Borders.BorderZMin = "PEC"
    qwm_doc.QW_Mesh_Borders.BorderZMax = "PEC"
    qwm_doc.QW_Mesh.AutoAdjustMeshBoundaryCheck = False
    qwm_doc.QW_Mesh.bboxminX = -80.0
    qwm_doc.QW_Mesh.bboxmaxX = 552.0
    QW_Modeller.addQWObject("QW_Modeller::AbsorbingWall", "abs_up")
    qwm_doc.abs_up.Orientation = "Y"
    qwm_doc.abs_up.Length = 1.0
    qwm_doc.abs_up.Width = 632.0
    qwm_doc.abs_up.Placement = FreeCAD.Placement(
        FreeCAD.Vector(236.0, 697.8187226079011, 0.5),
        FreeCAD.Rotation(0.5, 0.5, 0.5, -0.5))
    qwm_doc.abs_up.Position = 697.8187226079011
    qwm_doc.abs_up.Activity = "MINUS"
    FreeCAD.Gui.ActiveDocument.abs_up.AbsorberDepth = 1.00000
    FreeCAD.Gui.ActiveDocument.abs_up.ShowText = True
    FreeCAD.Gui.ActiveDocument.abs_up.TextSize = 14
    FreeCAD.Gui.ActiveDocument.abs_up.TextPlace = 3
    qwm_doc.abs_up.Type = "MUR"
    qwm_doc.abs_up.EffectivePermittivity = 1
    QW_Modeller.addQWObject("QW_Modeller::NTFBox", "ntfbox")
    qwm_doc.ntfbox.Length = 512.0
    qwm_doc.ntfbox.Width = 617.8187226079011
    qwm_doc.ntfbox.Height = 0.5
    qwm_doc.ntfbox.Placement = FreeCAD.Placement(
        FreeCAD.Vector(236.0, 308.90936130395056, 0.5),
        FreeCAD.Rotation(0.0, 0.0, 0.0, 1.0))
    FreeCAD.Gui.ActiveDocument.ntfbox.ShowText = True
    FreeCAD.Gui.ActiveDocument.ntfbox.TextSize = 14
示例#29
0
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path+"\platforms" #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from wgtocx1_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("wgtocx1")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = wgtocx1_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()
示例#30
0
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = qw_modeller_path+"\platforms" #wersja  freecad 018 qt5 python 3.6

import FreeCADGui
import QW_Modeller
import FreeCAD

from horn1_proj import *

GUIMode = FreeCAD.ConfigGet("RunMode")

if not GUIMode:
    FreeCADGui.showMainWindow()

FreeCADGui.activateWorkbench("QW_ModellerWorkbench")

qwm_doc = QW_Modeller.newQWDocument("horn1")

FreeCADGui.activeDocument().activeView().viewAxometric()

proj = horn1_Project(qwm_doc)
proj.set_Circuit_Parameters()
proj.set_GeometryAndMedia()
proj.set_Mesh()
proj.set_Excitation()
proj.set_Postprocessing()
proj.set_Simulation()
proj.run_Simulation()

FreeCADGui.SendMsgToActiveView("ViewFit")
qwm_doc.recompute()