Ejemplo n.º 1
0
def main():  # pragma: no cover
    bdf_filename = 'bay.bdf'
    bc_file = 'bc'

    bdf_filename2 = 'bay2.bdf'
    cart3d_filename = 'bay.i.tri'
    stl_filename = 'bay.stl'
    #in_format = 'nastran'
    flip_normals = True

    volume_bdfname = 'bay.vol.bdf'

    module = __import__(bc_file)
    pid_map = module.__dict__['pid_map']
    boundary_conditions = module.__dict__['boundary_conditions']

    #print(dir(module))
    #e = execfile(bc_file, globals(), locals())
    #print(globals())
    #print(dir(e))

    pid_map
    boundary_conditions
    assert isinstance(pid_map, dict)
    assert isinstance(boundary_conditions, dict)

    get_bcs(bdf_filename, pid_map, boundary_conditions, log=None)
    #if flip_normals:
    #bdf = BDF(debug=False)
    #bdf.read_bdf(bdf_filename, xref=False)
    #bdf.flip_normals()
    #bdf.write_bdf(bdf_filename2)
    #del bdf
    #else:
    #bdf_filename2 = bdf_filename

    if 0:
        nastran_to_cart3d_filename(bdf_filename, cart3d_filename, log=log)
        cart3d_to_stl_filename(cart3d_filename, stl_filename, log=log)
    else:
        nastran_to_stl_filename(bdf_filename, stl_filename, log=log)
        stl_to_nastran_filename(stl_filename, bdf_filename2, log=log)
    print('----------')
    #nastran_to_cart3d(bdf_filename2, cart3d_filename)
    #cart3d = Cart3d()
    #cart3d.read_cart3d(cart3d_filename)

    stl = STL()
    stl.read_stl(stl_filename)

    if flip_normals:
        stl.flip_normals()
    stl.project_boundary_layer(stl.nodes, stl.elements, volume_bdfname)
Ejemplo n.º 2
0
def main():
    bdf_filename = 'bay.bdf'
    bc_file = 'bc'

    bdf_filename2 = 'bay2.bdf'
    cart3d_filename = 'bay.i.tri'
    stl_filename = 'bay.stl'
    #in_format = 'nastran'
    flip_normals = True

    volume_bdfname = 'bay.vol.bdf'

    module = __import__(bc_file)
    pid_map = module.__dict__['pid_map']
    boundary_conditions = module.__dict__['boundary_conditions']

    #print(dir(module))
    #e = execfile(bc_file, globals(), locals())
    #print(globals())
    #print(dir(e))

    pid_map
    boundary_conditions
    assert isinstance(pid_map, dict)
    assert isinstance(boundary_conditions, dict)

    get_bcs(bdf_filename, pid_map, boundary_conditions, log=None)
    #if flip_normals:
       #bdf = BDF()
       #bdf.read_bdf(bdf_filename, xref=False)
       #bdf.flip_normals()
       #bdf.write_bdf(bdf_filename2)
       #del bdf
    #else:
    #bdf_filename2 = bdf_filename

    if 0:
        nastran_to_cart3d_filename(bdf_filename, cart3d_filename, log=log)
        cart3d_to_stl_filename(cart3d_filename, stl_filename, log=log)
    else:
        nastran_to_stl_filename(bdf_filename, stl_filename, log=log)
        stl_to_nastran_filename(stl_filename, bdf_filename2, log=log)
    print("----------")
    #nastran_to_cart3d(bdf_filename2, cart3d_filename)
    #cart3d = Cart3d()
    #cart3d.read_cart3d(cart3d_filename)

    stl = STL()
    stl.read_stl(stl_filename)

    if flip_normals:
        stl.flip_normals()
    stl.project_boundary_layer(stl.nodes, stl.elements, volume_bdfname)