Пример #1
0
def test_clone(section):
    section2 = model.Section()
    builder = model.SectionBuilder(section2)
    builder.copy(section)
    if section2.nb_corners() != 5:
        raise ValueError("[Test] Section should have 5 corners")
    if section2.nb_lines() != 6:
        raise ValueError("[Test] Section should have 6 lines")
    if section2.nb_surfaces() != 2:
        raise ValueError("[Test] Section should have 2 surfaces")
    if section2.nb_model_boundaries() != 2:
        raise ValueError("[Test] Section should have 2 model boundaries")
Пример #2
0
    section2 = model.Section()
    builder = model.SectionBuilder(section2)
    builder.copy(section)
    if section2.nb_corners() != 5:
        raise ValueError("[Test] Section should have 5 corners")
    if section2.nb_lines() != 6:
        raise ValueError("[Test] Section should have 6 lines")
    if section2.nb_surfaces() != 2:
        raise ValueError("[Test] Section should have 2 surfaces")
    if section2.nb_model_boundaries() != 2:
        raise ValueError("[Test] Section should have 2 model boundaries")


if __name__ == '__main__':
    section = model.Section()
    builder = model.SectionBuilder(section)

    # This Section represents a house (with one triangle and one square as in children sketches)
    corner_uuids = add_corners(section, builder)
    line_uuids = add_lines(section, builder)
    surface_uuids = add_surfaces(section, builder)
    model_boundary_uuids = add_model_boundaries(section, builder)

    add_corner_line_boundary_relation(section, builder, corner_uuids,
                                      line_uuids)
    add_line_surface_boundary_relation(section, builder, line_uuids,
                                       surface_uuids)
    add_lines_in_model_boundaries(section, builder, line_uuids,
                                  model_boundary_uuids)
    add_internal_corner_relations(section, builder, corner_uuids,
                                  surface_uuids)