示例#1
0
def create_tower4_mesh(id, avg_func):
    file_prefix = 'tower_4' + avg_fn_to_str(avg_func)
    orig_ctrl_mesh = DCtrlMesh(id, avg_func)
    orig_ctrl_mesh.init_as_quad_cube(10.)
    orig_ctrl_mesh.extrude_face(9, 20.)
    orig_ctrl_mesh.extrude_face(30, 20.)
    orig_ctrl_mesh.extrude_face(34, 20.)
    orig_ctrl_mesh.set_naive_normals()
    #orig_ctrl_mesh.print_ctrl_mesh()
    return orig_ctrl_mesh, file_prefix

    mpl.rcParams['legend.fontsize'] = 10
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d', aspect='equal')
    ax.view_init(azim=30, elev=25)
    orig_ctrl_mesh.plot(ax, True, 'k')
    plt.show()
    return orig_ctrl_mesh, file_prefix
示例#2
0
def create_tube4_mesh(id, avg_func):
    file_prefix = 'tube_4' + avg_fn_to_str(avg_func)
    orig_ctrl_mesh = DCtrlMesh(id, avg_func)
    orig_ctrl_mesh.init_as_quad_cube(10.)
    orig_ctrl_mesh.extrude_face(9, 20.)
    dux = 60.
    duy = 60.
    duz = 240.
    orig_ctrl_mesh.id2obj[27].set_pt(np.array([dux, duy, duz]))
    orig_ctrl_mesh.id2obj[31].set_pt(np.array([-dux, duy, duz]))
    orig_ctrl_mesh.id2obj[35].set_pt(np.array([-dux, -duy, duz]))
    orig_ctrl_mesh.id2obj[39].set_pt(np.array([dux, -duy, duz]))
    dux = 60.
    duy = 60.
    duz = 0.4
    orig_ctrl_mesh.id2obj[5].set_pt(np.array([dux, duy, -duz]))
    orig_ctrl_mesh.id2obj[6].set_pt(np.array([dux, -duy, -duz]))
    orig_ctrl_mesh.id2obj[7].set_pt(np.array([-dux, -duy, -duz]))
    orig_ctrl_mesh.id2obj[8].set_pt(np.array([-dux, duy, -duz]))

    orig_ctrl_mesh.set_naive_normals()
    return orig_ctrl_mesh, file_prefix