def test_step_importer_2_boxes(): r"""Import an step file containing 2 distinct boxes and test topology""" importer = StepImporter(path_from_file(__file__, "./models_in/2_boxes_203.stp")) assert len(importer.shapes) == 1 assert importer.shapes[0].ShapeType() == TopAbs.TopAbs_COMPOUND topo = Topo(importer.shapes[0]) assert topo.number_of_compounds() == 1 assert topo.number_of_comp_solids() == 0 assert topo.number_of_solids() == 2 assert topo.number_of_shells() == 2
def test_step_importer_happy_topology(): r"""import step file containing a box and test topology""" importer = StepImporter(path_from_file(__file__, "./models_in/box_203.stp")) assert len(importer.shapes) == 1 assert isinstance(importer.shapes[0], TopoDS.TopoDS_Shape) assert importer.shapes[0].ShapeType() == TopAbs.TopAbs_SOLID topo = Topo(importer.shapes[0]) assert topo.number_of_compounds() == 0 assert topo.number_of_comp_solids() == 0 assert topo.number_of_solids() == 1 assert topo.number_of_shells() == 1