コード例 #1
0
ファイル: test-py-section.py プロジェクト: Algiane/OpenGeode
def add_surfaces(model, builder):
    nb = 2
    uuids = []
    for i in range(nb):
        uuids.append(builder.add_surface())

    temp_surface = model.surface(builder.add_surface())
    builder.remove_surface(temp_surface)
    if model.nb_surfaces() != nb:
        raise ValueError("[Test] Section should have 2 surfaces")
    return uuids
コード例 #2
0
ファイル: test-py-brep.py プロジェクト: Co1dCoder/OpenGeode
def add_surfaces(model, builder):
    nb = 5
    uuids = []
    for i in range(nb):
        uuids.append(builder.add_surface())
        builder.set_surface_name(uuids[-1], "surface" + str(len(uuids)))

    temp_surface = model.surface(builder.add_surface())
    builder.remove_surface(temp_surface)
    if model.nb_surfaces() != nb:
        raise ValueError("[Test] BRep should have 5 surfaces")
    if model.surface(uuids[1]).name() != "surface2":
        raise ValueError("[Test] Wrong Surface name")
    return uuids
コード例 #3
0
ファイル: test-py-brep.py プロジェクト: Co1dCoder/OpenGeode
def test_reloaded_brep(model):
    if model.nb_corners() != 6:
        raise ValueError(
            "[Test] Number of Corners in reloaded BRep should be 6")
    if model.nb_lines() != 9:
        raise ValueError("[Test] Number of Lines in reloaded BRep should be 9")
    if model.nb_surfaces() != 5:
        raise ValueError(
            "[Test] Number of Surfaces in reloaded BRep should be 5")
    if model.nb_blocks() != 1:
        raise ValueError(
            "[Test] Number of Blocks in reloaded BRep should be 1")
    if model.nb_model_boundaries() != 3:
        raise ValueError(
            "[Test] Number of Boundaries in reloaded BRep should be 3")