コード例 #1
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)
コード例 #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)
コード例 #3
0
def test_compatibility_generate_ctrlpts2d_weights_file(nurbs_surface):
    fname_in = FILE_NAME + "_in.txt"
    fname_out = FILE_NAME + "_out.txt"

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

    compatibility.generate_ctrlpts2d_weights_file(fname_in, fname_out)

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

    # Clean up temporary file if exists
    if os.path.isfile(fname_in):
        os.remove(fname_in)
        os.remove(fname_out)
コード例 #4
0
def test_compatibility_generate_ctrlpts2d_weights_file(nurbs_surface):
    fname_in = FILE_NAME + "_in.txt"
    fname_out = FILE_NAME + "_out.txt"

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

    compatibility.generate_ctrlpts2d_weights_file(fname_in, fname_out)

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

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