def add_internal_line_relations(model, builder, line_uuids, surface_uuids, block_uuids): for line_id in line_uuids: builder.add_line_surface_internal_relationship( model.line(line_id), model.surface(surface_uuids[0])) builder.add_line_block_internal_relationship( model.line(line_id), model.block(block_uuids[0])) for line_id in line_uuids: for embedding in model.embedding_surfaces_of_line(model.line(line_id)): if surface_uuids[0].string() != embedding.id().string(): raise ValueError( "[Test] All Line embedded surfaces should be Surfaces") if model.nb_internal_lines_of_surface(embedding) != len( line_uuids): raise ValueError("[Test] Surface should embed all Lines") for embedding in model.embedding_blocks_of_line(model.line(line_id)): if block_uuids[0].string() != embedding.id().string(): raise ValueError( "[Test] All Lines embedded blocks should be Blocks") if model.nb_internal_lines_of_block(embedding) != len(line_uuids): raise ValueError("[Test] Block should embed all Lines") if model.nb_embeddings(line_id) != 2: raise ValueError( "[Test] All Surfaces should be embedded to 1 Block and 1 Surface" ) if model.nb_embedding_surfaces_of_line(model.line(line_id)) != 1: raise ValueError( "[Test] All Surfaces should be embedded to 1 Surface") if model.nb_embedding_blocks_of_line(model.line(line_id)) != 1: raise ValueError( "[Test] All Surfaces should be embedded to 1 Block")
def add_internal_corner_relations( model, builder, corner_uuids, surface_uuids ): for corner_id in corner_uuids: builder.add_corner_surface_internal_relationship( model.corner( corner_id ), model.surface( surface_uuids[0] ) ) for corner_id in corner_uuids: for embedding in model.embedding_surfaces_of_corner( model.corner( corner_id ) ): if surface_uuids[0].string() != embedding.id().string(): raise ValueError( "[Test] All Corners embeddings should be Surfaces" ) if model.nb_internal_corners_of_surface( embedding ) != len( corner_uuids ): raise ValueError( "[Test] Surface should embed all Corners" ) if model.nb_embeddings( corner_id ) != 1: raise ValueError( "[Test] All Corners should be embedded to 1 Surface" ) if model.nb_embedding_surfaces_of_corner( model.corner( corner_id ) ) != 1: raise ValueError( "[Test] All Corners should be embedded to 1 Surface" )
def add_internal_surface_relations(model, builder, surface_uuids, block_uuids): for surface_id in surface_uuids: builder.add_surface_block_internal_relationship( model.surface(surface_id), model.block(block_uuids[0])) for surface_id in surface_uuids: for embedding in model.embedding_blocks_of_surface( model.surface(surface_id)): if model.nb_internal_surfaces_of_block(embedding) != len( surface_uuids): raise ValueError("[Test] Block should embed all Surfaces") if block_uuids[0].string() != embedding.id().string(): raise ValueError( "[Test] All Surfaces embeddings should be Blocks") if model.nb_embeddings(surface_id) != 1: raise ValueError( "[Test] All Surfaces should be embedded to 1 Block") if model.nb_embedding_blocks_of_surface( model.surface(surface_id)) != 1: raise ValueError( "[Test] All Surfaces should be embedded to 1 Block")