Пример #1
0
def test_incidence_ranges(model, corner_uuids, line_uuids, surface_uuids,
                          block_uuids):
    corner_incidence_count = 0
    for corner_incidence in model.incident_lines(model.corner(
            corner_uuids[0])):
        corner_incidence_count += 1
        if corner_incidence.id().string() != line_uuids[0].string(
        ) and corner_incidence.id().string() != line_uuids[2].string(
        ) and corner_incidence.id().string() != line_uuids[5].string():
            raise ValueError(
                "[Test] IncidentLineRange iteration result is not correct")
    if corner_incidence_count != 3:
        raise ValueError("[Test] IncidentLineRange should iterates on 3 Lines")

    line_incidence_count = 0
    for line_incidence in model.incident_surfaces(model.line(line_uuids[0])):
        line_incidence_count += 1
        if line_incidence.id().string() != surface_uuids[0].string(
        ) and line_incidence.id().string() != surface_uuids[1].string():
            raise ValueError(
                "[Test] IncidentSurfaceRange iteration result is not correct")
    if line_incidence_count != 2:
        raise ValueError(
            "[Test] IncidentSurfaceRange should iterates on 2 Surfaces")

    surface_incidence_count = 0
    for surface_incidence in model.incident_blocks(
            model.surface(surface_uuids[0])):
        surface_incidence_count += 1
        if surface_incidence.id().string() != block_uuids[0].string():
            raise ValueError(
                "[Test] IncidentBlockRange iteration result is not correct")
    if surface_incidence_count != 1:
        raise ValueError(
            "[Test] IncidentBlockRange should iterates on 1 Block")
Пример #2
0
def add_line_surface_boundary_relation(model, builder, line_uuids,
                                       surface_uuids):
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[0]), model.surface(surface_uuids[0]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[1]), model.surface(surface_uuids[0]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[2]), model.surface(surface_uuids[0]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[2]), model.surface(surface_uuids[1]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[3]), model.surface(surface_uuids[1]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[4]), model.surface(surface_uuids[1]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[5]), model.surface(surface_uuids[1]))

    for line_id in line_uuids:
        for incidence in model.incident_surfaces(model.line(line_id)):
            if surface_uuids[0].string() != incidence.id().string(
            ) and surface_uuids[1].string() != incidence.id().string():
                raise ValueError(
                    "[Test] All Lines incidences should be Surfaces")
    if model.nb_boundaries(surface_uuids[0]) != 3:
        raise ValueError("[Test] Surface 0 should have 3 Lines as boundaries")
    if model.nb_boundaries(surface_uuids[1]) != 4:
        raise ValueError("[Test] Surface 1 should have 4 Lines as boundaries")
Пример #3
0
def test_incidence_ranges( model, corner_uuids, line_uuids, surface_uuids ):
    corner_incidence_count = 0
    for corner_incidence in model.incident_lines( model.corner( corner_uuids[0] ) ):
        corner_incidence_count += 1
        if corner_incidence.id().string() != line_uuids[0].string() and corner_incidence.id().string() != line_uuids[1].string():
            raise ValueError( "[Test] IncidentLineRange iteration result is not correct" )
    if corner_incidence_count != 2:
        raise ValueError( "[Test] IncidentLineRange should iterates on 2 Lines" )

    line_incidence_count = 0
    for line_incidence in model.incident_surfaces( model.line( line_uuids[0] ) ):
        line_incidence_count += 1
        if line_incidence.id().string() != surface_uuids[0].string():
            raise ValueError( "[Test] IncidentSurfaceRange iteration result is not correct" )
    if line_incidence_count != 1:
        raise ValueError( "[Test] IncidentSurfaceRange should iterates on 1 Surface" )
Пример #4
0
def add_line_surface_boundary_relation(model, builder, line_uuids,
                                       surface_uuids):
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[0]), model.surface(surface_uuids[0]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[0]), model.surface(surface_uuids[1]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[1]), model.surface(surface_uuids[0]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[1]), model.surface(surface_uuids[2]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[2]), model.surface(surface_uuids[0]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[2]), model.surface(surface_uuids[3]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[3]), model.surface(surface_uuids[1]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[3]), model.surface(surface_uuids[2]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[4]), model.surface(surface_uuids[2]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[4]), model.surface(surface_uuids[3]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[5]), model.surface(surface_uuids[1]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[5]), model.surface(surface_uuids[3]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[6]), model.surface(surface_uuids[1]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[6]), model.surface(surface_uuids[4]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[7]), model.surface(surface_uuids[2]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[7]), model.surface(surface_uuids[4]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[8]), model.surface(surface_uuids[3]))
    builder.add_line_surface_boundary_relationship(
        model.line(line_uuids[8]), model.surface(surface_uuids[4]))

    for line_id in line_uuids:
        for incidence in model.incident_surfaces(model.line(line_id)):
            if not find_uuid_in_list(surface_uuids, incidence.id()):
                raise ValueError(
                    "[Test] All Lines incidences should be Surfaces")
        if model.nb_incidences(line_id) != 2:
            raise ValueError(
                "[Test] All Lines should be connected to 2 Surfaces")