def createPointList(pointList): # new Point List object myPointList = pointListType() for [xvalue, yvalue] in pointList: # Convert Types and Create Point x = doubleBaseType(valueOf_=str(xvalue)) y = doubleBaseType(valueOf_=str(yvalue)) z = doubleBaseType(valueOf_=str(0.0)) myPoint = pointType(x=x, y=y, z=z) # Add Point to PointList myPointList.add_point(myPoint) return myPointList
def createPointList(pointList): #new Point List object myPointList = pointListType(None, None, None, None) for [xvalue, yvalue] in pointList: #Convert Types and Create Point x = doubleBaseType(None, None, None, str(xvalue)) y = doubleBaseType(None, None, None, str(yvalue)) z = doubleBaseType(None, None, None, str(0.0)) myPoint = pointType(None, None, None, None, x, y, z) #Add Point to PointList myPointList.add_point(myPoint) return myPointList
def createPointList(nparray): ''' create a point list for each cog location This method is currently without use, as long as there is no update to CPACS 2.2.1 ''' myPointList = pointListType() zero = doubleBaseType(valueOf_='0.') for item in nparray.tolist(): newPoint = pointType(x=doubleBaseType(valueOf_=str(item)),y=zero, z=zero) myPointList.add_point(newPoint) return myPointList
def createVectorPointList(nparray): ''' create a point list for each cog location ''' myPointList = pointListType() x = '; '.join(str(x) for x in nparray.tolist()) zeros = np.zeros(nparray.shape) y = '; '.join(str(y) for y in zeros.tolist()) newPoint = pointType(x=doubleBaseType(valueOf_=str(x)),y=doubleBaseType(valueOf_=y), z=doubleBaseType(valueOf_=y)) myPointList.add_point(newPoint) return myPointList