def test_compatibility_generate_ctrlptsw2d_file2(nurbs_surface):
    fname_in = FILE_NAME + "_in.txt"
    fname_out = FILE_NAME + "_out.txt"
    fname_final = FILE_NAME + "_final.txt"

    exchange.export_txt(nurbs_surface, fname_in, two_dimensional=True)

    compatibility.generate_ctrlpts2d_weights_file(fname_in, fname_out)
    compatibility.generate_ctrlptsw2d_file(fname_out, fname_final)
    ctrlpts, size_u, size_v = exchange.import_txt(fname_final,
                                                  two_dimensional=True)
    ctrlptsw = compatibility.generate_ctrlptsw(ctrlpts)

    res_array = []
    for res in ctrlptsw:
        res_array.append(res)

    assert nurbs_surface.ctrlptsw == res_array
    assert nurbs_surface.ctrlpts_size_u == size_u
    assert nurbs_surface.ctrlpts_size_v == size_v

    # Clean up temporary file if exists
    if os.path.isfile(fname_in):
        os.remove(fname_in)
        os.remove(fname_out)
        os.remove(fname_final)
Esempio n. 2
0
def test_compatibility_generate_ctrlptsw2d_file2(nurbs_surface):
    fname_in = FILE_NAME + "_in.txt"
    fname_out = FILE_NAME + "_out.txt"
    fname_final = FILE_NAME + "_final.txt"

    exchange.export_txt(nurbs_surface, fname_in, two_dimensional=True)

    compatibility.generate_ctrlpts2d_weights_file(fname_in, fname_out)
    compatibility.generate_ctrlptsw2d_file(fname_out, fname_final)
    ctrlpts, size_u, size_v = exchange.import_txt(fname_final, two_dimensional=True)
    ctrlptsw = compatibility.generate_ctrlptsw(ctrlpts)

    res_array = []
    for res in ctrlptsw:
        res_array.append(res)

    assert nurbs_surface.ctrlptsw == res_array
    assert nurbs_surface.ctrlpts_size_u == size_u
    assert nurbs_surface.ctrlpts_size_v == size_v

    # Clean up temporary file if exists
    if os.path.isfile(fname_in):
        os.remove(fname_in)
        os.remove(fname_out)
        os.remove(fname_final)
def test_compatibility_generate_ctrlptsw2d_file1(nurbs_surface):
    fname_in = FILE_NAME + "_in.txt"
    fname_out = FILE_NAME + "_out.txt"
    fname_final = FILE_NAME + "_final.txt"

    exchange.export_txt(nurbs_surface, fname_in, two_dimensional=True)

    compatibility.generate_ctrlpts2d_weights_file(fname_in, fname_out)
    compatibility.generate_ctrlptsw2d_file(fname_out, fname_final)

    assert os.path.isfile(fname_final)
    assert os.path.getsize(fname_final) > 0

    # Clean up temporary file if exists
    if os.path.isfile(fname_in):
        os.remove(fname_in)
        os.remove(fname_out)
        os.remove(fname_final)
Esempio n. 4
0
def test_compatibility_generate_ctrlptsw2d_file1(nurbs_surface):
    fname_in = FILE_NAME + "_in.txt"
    fname_out = FILE_NAME + "_out.txt"
    fname_final = FILE_NAME + "_final.txt"

    exchange.export_txt(nurbs_surface, fname_in, two_dimensional=True)

    compatibility.generate_ctrlpts2d_weights_file(fname_in, fname_out)
    compatibility.generate_ctrlptsw2d_file(fname_out, fname_final)

    assert os.path.isfile(fname_final)
    assert os.path.getsize(fname_final) > 0

    # Clean up temporary file if exists
    if os.path.isfile(fname_in):
        os.remove(fname_in)
        os.remove(fname_out)
        os.remove(fname_final)