![]() The action happens in the make_shape() function of the UiucAirfoil. name of profile (as defined in the UIUC list of profiles).span(dimension perpendicular to airflow).Return _Tcol_dim_1(li, TColgp_Array1OfPnt2d)įunction factory for 1-dimensional TCol* typesįrom import init_displayĭisplay, start_display, add_menu, add_function_to_menu = init_display()ĭisplay.DisplayShape(airfoil.shape, update=True)įirst, we create a UiucAirfoil object with 4 attributes: Return BRepPrimAPI_MakePrism(face.Face(),ĭef point2d_list_to_TColgp_Array1OfPnt2d(li): # the trailing edge segment could not be created, probably because the points are too closeįace = BRepBuilderAPI_MakeFace(make_wire(make_edge(spline))) Gp_Pnt(section_pts_2d.X(), section_pts_2d.Y(),0.0))įace = BRepBuilderAPI_MakeFace(make_wire()) #first and last point of spline -> trailing edge # 5 - figure out if the trailing edge has a thickness or not, and create a Face Spline = GeomAPI_To3d(spline_2d.Curve(),plan) Spline_2d = Geom2dAPI_PointsToBSpline(point2d_list_to_TColgp_Array1OfPnt2d(section_pts_2d), # 4 - use the array to create a spline describing the airfoil section Section_pts_2d.append(gp_Pnt2d(float(data)*self.chord, If len(data)=2: # two coordinates for each point Max camber 4 at 42.3 chord Source UIUC Airfoil Coordinates Database Source dat file The dat file is in Lednicer format: NASA/LANGLEY NLF(1)-0215F AIRFOIL 33. Line = line.lstrip().rstrip().replace(' ',' ').replace(' ',' ').replace(' ',' ')ĭata = line.split(' ') # data = x coord. (nlf0215f-il) NASA/LANGLEY NLF(1)-0215F AIRFOIL NASA/Langley/Somers NLF(1)-0215F natural laminar flow airfoil Max thickness 15 at 37.7 chord. # 2 - do some cleanup on the data (mostly dealing with spaces) Plan = gp_Pln(gp_Pnt(0,0,0), gp_Dir(0,0,1)) # Z=0 plan / XY planįor line in f.readlines(): # The first line contains info only # 1 - retrieve the data from the UIUC airfoil data page Just replace the profile name with another valid profile name(see ) in the UiucAirfoil constructor call to construct a wing with a different profile.įrom OCC.BRepBuilderAPI import BRepBuilderAPI_MakeFaceįrom OCC.BRepPrimAPI import BRepPrimAPI_MakePrismįrom OCC.Geom2dAPI import Geom2dAPI_PointsToBSplineįrom OCC.gp import gp_Pnt, gp_Vec, gp_Pnt2d, gp_Pln, gp_Dirįrom OCC.TColgp import TColgp_Array1OfPnt2dįrom import make_wire, make_edge, make_vertexĪirfoil with a section from the UIUC database The list of available profile data is visible at. ![]() In this post, we will tap into the airfoil data from the UIUC (University of Illinois at Urbana-Champaign) to create a wing profile. With PythonOCC, you can read data from other websites and use it to create geometry: we could call that a geometrical mashup. Being a former user of OpenSCAD, a programmatic modeller that uses its own language, I really like the fact that PythonOCC relies on a mainstream language and all the ‘batteries included’ that come with it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |