def createWingAirfoil(CPACSObj): # get airfoil holding object cpacsPath = '/cpacs/vehicles/profiles/wingAirfoils/wingAirfoil[NACA0009]' myAirfoil = getObjfromXpath(CPACSObj, cpacsPath) pointList = myAirfoil.get_pointList() if pointList is None: # print "Airfoil 'NACA0009' not found -> will be created." # create pointList pointList = pointListXYZVectorType() xVector = [] yVector = [] zVector = [] for x, y in NACA0009[::-1]: xVector.append(str(x)) yVector.append(str(0.0)) zVector.append(str(y)) x = stringVectorBaseType(mapType='vector',valueOf_=';'.join(xVector)) y = stringVectorBaseType(mapType='vector',valueOf_=';'.join(yVector)) z = stringVectorBaseType(mapType='vector',valueOf_=';'.join(zVector)) pointList.set_x(x) pointList.set_y(y) pointList.set_z(z) myAirfoil.set_pointList(pointList) myAirfoil.set_name(stringBaseType(valueOf_="NACA0009 Airfoil")) myAirfoil.set_description(stringBaseType(valueOf_="Profile generated automatically by VAMPzero cpacs-export")) # get airfoil holding object cpacsPath = '/cpacs/vehicles/profiles/wingAirfoils/wingAirfoil[NACA653218]' myAirfoil = getObjfromXpath(CPACSObj, cpacsPath) pointList = myAirfoil.get_pointList() if pointList is None: # print "Airfoil 'NACA0000' not found -> will be created." # create pointList pointList = pointListXYZVectorType() xVector = [] yVector = [] zVector = [] for x, y in NACA653218[::-1]: xVector.append(str(x)) yVector.append(str(0.0)) zVector.append(str(y)) x = stringVectorBaseType(mapType='vector',valueOf_=';'.join(xVector)) y = stringVectorBaseType(mapType='vector',valueOf_=';'.join(yVector)) z = stringVectorBaseType(mapType='vector',valueOf_=';'.join(zVector)) pointList.set_x(x) pointList.set_y(y) pointList.set_z(z) myAirfoil.set_pointList(pointList) myAirfoil.set_name(stringBaseType(valueOf_="NACA653218 Airfoil")) myAirfoil.set_description(stringBaseType(valueOf_="Profile generated automatically by VAMPzero cpacs-export"))
def createFuselageProfile(CPACSObj, profile='Circle' ): ''' @author: Jonas Jepsen ''' # get airfoil holding object cpacsPath = '/cpacs/vehicles/profiles/fuselageProfiles/fuselageProfile[%s]'% profile myProfile = getObjfromXpath(CPACSObj,cpacsPath) pointList = myProfile.get_pointList() if pointList is None: #print "Airfoil 'Circle' not found -> will be created." xVector, yVector, zVector = createCircleList() # create pointList pointList = pointListXYZVectorType() x = stringVectorBaseType(mapType='vector',valueOf_=';'.join(xVector)) y = stringVectorBaseType(mapType='vector',valueOf_=';'.join(yVector)) z = stringVectorBaseType(mapType='vector',valueOf_=';'.join(zVector)) pointList.set_x(x) pointList.set_y(y) pointList.set_z(z) myProfile.set_pointList(pointList) myProfile.set_name(stringBaseType(valueOf_="Circle Profile")) myProfile.set_description(stringBaseType(valueOf_="Profile generated automatically by VAMPzero cpacs-export" ))
def createFuselageProfile(CPACSObj, profile='Circle'): ''' @author: Jonas Jepsen ''' # get airfoil holding object cpacsPath = '/cpacs/vehicles/profiles/fuselageProfiles/fuselageProfile[%s]' % profile myProfile = getObjfromXpath(CPACSObj, cpacsPath) pointList = myProfile.get_pointList() if pointList is None: #print "Airfoil 'Circle' not found -> will be created." xVector, yVector, zVector = createCircleList() # create pointList pointList = pointListXYZVectorType() x = stringVectorBaseType(None, None, None, 'vector', ';'.join(xVector)) y = stringVectorBaseType(None, None, None, 'vector', ';'.join(yVector)) z = stringVectorBaseType(None, None, None, 'vector', ';'.join(zVector)) pointList.set_x(x) pointList.set_y(y) pointList.set_z(z) myProfile.set_pointList(pointList) myProfile.set_name(stringBaseType(None, None, None, "Circle Profile")) myProfile.set_description( stringBaseType( None, None, None, "Profile generated automatically by VAMPzero cpacs-export"))
def createWingAirfoil(CPACSObj): # get airfoil holding object cpacsPath = '/cpacs/vehicles/profiles/wingAirfoils/wingAirfoil[NACA0009]' myAirfoil = getObjfromXpath(CPACSObj, cpacsPath) pointList = myAirfoil.get_pointList() if pointList is None: # print "Airfoil 'NACA0009' not found -> will be created." # create pointList pointList = pointListXYZVectorType() xVector = [] yVector = [] zVector = [] for x, y in NACA0009: xVector.append(str(x)) yVector.append(str(0.0)) zVector.append(str(y)) x = stringVectorBaseType(None, None, None, 'vector', ';'.join(xVector)) y = stringVectorBaseType(None, None, None, 'vector', ';'.join(yVector)) z = stringVectorBaseType(None, None, None, 'vector', ';'.join(zVector)) pointList.set_x(x) pointList.set_y(y) pointList.set_z(z) myAirfoil.set_pointList(pointList) myAirfoil.set_name(stringBaseType(None, None, None, "NACA0009 Airfoil")) myAirfoil.set_description( stringBaseType( None, None, None, "Profile generated automatically by VAMPzero cpacs-export")) # get airfoil holding object cpacsPath = '/cpacs/vehicles/profiles/wingAirfoils/wingAirfoil[NACA653218]' myAirfoil = getObjfromXpath(CPACSObj, cpacsPath) pointList = myAirfoil.get_pointList() if pointList is None: # print "Airfoil 'NACA0000' not found -> will be created." # create pointList pointList = pointListXYZVectorType() xVector = [] yVector = [] zVector = [] for x, y in NACA653218: xVector.append(str(x)) yVector.append(str(0.0)) zVector.append(str(y)) x = stringVectorBaseType(None, None, None, 'vector', ';'.join(xVector)) y = stringVectorBaseType(None, None, None, 'vector', ';'.join(yVector)) z = stringVectorBaseType(None, None, None, 'vector', ';'.join(zVector)) pointList.set_x(x) pointList.set_y(y) pointList.set_z(z) myAirfoil.set_pointList(pointList) myAirfoil.set_name( stringBaseType(None, None, None, "NACA653218 Airfoil")) myAirfoil.set_description( stringBaseType( None, None, None, "Profile generated automatically by VAMPzero cpacs-export"))