Tests the ability to fuse an assembly with only one part present. The resulting STEP is imported again to test it.
(tmpdir)
| 161 | |
| 162 | |
| 163 | def test_fused_assembly_with_one_part(tmpdir): |
| 164 | """ |
| 165 | Tests the ability to fuse an assembly with only one part present. |
| 166 | The resulting STEP is imported again to test it. |
| 167 | """ |
| 168 | # Create the single-part assembly |
| 169 | assy = Assembly() |
| 170 | body = Workplane().box(10, 10, 10) |
| 171 | assy.add(body, color=Color(1, 0, 0), name="body") |
| 172 | |
| 173 | # Export the assembly |
| 174 | step_path = os.path.join(tmpdir, "single_part_fused_assembly.step") |
| 175 | assy.save( |
| 176 | path=str(step_path), |
| 177 | exportType=exporters.ExportTypes.STEP, |
| 178 | mode=exporters.assembly.ExportModes.FUSED, |
| 179 | ) |
| 180 | |
| 181 | # Import the assembly and make sure it acts as expected |
| 182 | model = importers.importStep(step_path) |
| 183 | assert model.solids().size() == 1 |
| 184 | |
| 185 | |
| 186 | def test_fused_assembly_glue_tol(tmpdir): |