コード例 #1
0
ファイル: phi25.py プロジェクト: p-chambers/VAMPzero
    def cpacsImport(self, path='.\\cpacs.xml', TIXIHandle=None, TIGLHandle=None):
        '''
        Imports the quarter chord sweep angle of the htp from TIGL. It takes the htp's first and last section and reads
        y and y coordinates and from these calculates the htp sweep. 
        '''
        wingIndex = 2

        if not TIXIHandle:
            TIXIHandle = openTIXI(path)

        if not TIGLHandle:
            TIGLHandle = openTIGL(TIXIHandle, self.parent.aircraft.modelUID.getValue())

        lastSeg = getWingSegmentCount(TIGLHandle, wingIndex)

        if checkElement(TIXIHandle, '/cpacs/vehicles/aircraft/model/wings/wing[2]'):
            x1, y1, z1 = getWingUpperPoint(TIGLHandle, wingIndex, 1, 0., 0.25)
            x2, y2, z2 = getWingUpperPoint(TIGLHandle, wingIndex, lastSeg, 1., 0.25)
            #Length of the hypothenuse so we do not need atan
            h = sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

            self.setValueFix(asin((x2 - x1) / h) / rad)

        else:
            self.importError()
コード例 #2
0
ファイル: span.py プロジェクト: codingpoets/VAMPzero
    def cpacsImport(self, path='.\\cpacs.xml', TIXIHandle=None, TIGLHandle=None):
        '''
        Overwrites the parameters cpacsImport method!
        Will get the value for wingSpan from CPACS via TIGL functions
        '''
        if not TIXIHandle:
            TIXIHandle = openTIXI(path)

        if not TIGLHandle:
            TIGLHandle = openTIGL(TIXIHandle, self.parent.aircraft.modelUID.getValue())

        if checkElement(TIXIHandle, '/cpacs/vehicles/aircraft/model/wings/wing'):

            #get First Point from the WingRoot
            wingIndex = 1

            x1, y1, z1 = getWingUpperPoint(TIGLHandle, wingIndex, 1, 0, 0)

            lastSegment = getWingSegmentCount(TIGLHandle, wingIndex)
            x2, y2, z2 = getWingUpperPoint(TIGLHandle, wingIndex, lastSegment, 1, 0)
            #todo: cpacsImport span: prototype version taking leading Edge Points

            self.setValueFix((y2 - y1) * 2.)
            self.importSuccess()
        else:
            self.importError()
コード例 #3
0
    def cpacsImport(self,
                    path='.\\cpacs.xml',
                    TIXIHandle=None,
                    TIGLHandle=None):
        '''
        Overwrites the parameters cpacsImport method!
        Will get the value for the htp span from CPACS via TIGL functions
        '''
        if not TIXIHandle:
            TIXIHandle = openTIXI(path)

        if not TIGLHandle:
            TIGLHandle = openTIGL(TIXIHandle,
                                  self.parent.aircraft.modelUID.getValue())

        if checkElement(TIXIHandle,
                        '/cpacs/vehicles/aircraft/model/wings/wing[2]'):
            #get First Point from the WingRoot
            wingIndex = 2

            x1, y1, z1 = getWingUpperPoint(TIGLHandle, wingIndex, 1, 0, 0)

            lastSegment = getWingSegmentCount(TIGLHandle, wingIndex)
            x2, y2, z2 = getWingUpperPoint(TIGLHandle, wingIndex, lastSegment,
                                           1, 0)
            #todo: cpacsImport span: prototype version taking leading Edge Points

            self.setValueFix((y2 - y1) * 2.)
            self.importSuccess()
        else:
            self.importError()
コード例 #4
0
        def calcTipLength(tiglHandle, wingIndex):
            '''
            Calculates the length of the tip section chord
            '''
            lastSegment = getWingSegmentCount(tiglHandle, wingIndex)
            x1, y1, z1 = getWingUpperPoint(tiglHandle, wingIndex, lastSegment, 1, 0)
            x2, y2, z2 = getWingUpperPoint(tiglHandle, wingIndex, lastSegment, 1, 1)

            return pointDistance(x1, y1, z1, x2, y2, z2)
コード例 #5
0
ファイル: taperRatio.py プロジェクト: codingpoets/VAMPzero
        def calcTipLength(tiglHandle, wingIndex):
            """
            Calculates the length of the tip section chord
            """
            lastSegment = getWingSegmentCount(tiglHandle, wingIndex)
            x1, y1, z1 = getWingUpperPoint(tiglHandle, wingIndex, lastSegment, 1, 0)
            x2, y2, z2 = getWingUpperPoint(tiglHandle, wingIndex, lastSegment, 1, 1)

            return pointDistance(x1, y1, z1, x2, y2, z2)