chord2 = cs.build_chord(pln2, scale=c2) chord3 = cs.build_chord(pln3, scale=c3, rotate=t3) sref = NurbsSurfaceByInterp([chord1, chord2, chord3], 1).surface sref.set_udomain(0., 1.) sref.set_vdomain(0., 1.) # Set the wing reference surface wing.set_sref(sref) # Show wing and reference surface gui = Viewer() gui.add(wing, wing.sref) gui.start() # Show the underlying shape of the reference surface gui.clear() gui.add(wing.sref_shape) gui.start() # Evaluate point p = wing.sref.eval(0.5, 0.5) # Extract a plane pln = wing.extract_plane(0.5, 0., 0.5, 0.5) face = FaceByPlane(pln, -10, 10, -10, 10).face # Extract a trimmed curve crv = wing.extract_curve(0.15, 0.05, 0.15, 0.95) gui.clear() gui.add(wing.sref, p, face, crv)
rspar.shape, wing, d1=30, d2=-30) internal_parts = wingbox.get_parts() skin = SkinByBody('skin', wing).part cref = wing.sref.u_iso(0.5) skin.discard_by_dmin(cref, 1.0) FuseSurfaceParts([skin], internal_parts) group = GroupAPI.get_master() v = Viewer() v.add(group) v.start() # Save print('\nSaving group...') GroupAPI.save_model('structure.xbf') print('done.\n') # Load into new group print('Loading group...') new_group = GroupAPI.create_group('new model') GroupAPI.load_model('structure.xbf', new_group) print('done.') v.clear() v.add(new_group) v.start()