Exports as simple assembly using the "fused" STEP export mode and then imports that STEP again to validate it.
(tmpdir)
| 79 | |
| 80 | |
| 81 | def test_fused_assembly(tmpdir): |
| 82 | """ |
| 83 | Exports as simple assembly using the "fused" STEP export mode |
| 84 | and then imports that STEP again to validate it. |
| 85 | """ |
| 86 | |
| 87 | # Create the sample assembly |
| 88 | assy = Assembly() |
| 89 | body = Workplane().box(10, 10, 10) |
| 90 | assy.add(body, color=Color(1, 0, 0), name="body") |
| 91 | pin = Workplane().center(2, 2).cylinder(radius=2, height=20) |
| 92 | assy.add(pin, color=Color(0, 1, 0), name="pin") |
| 93 | |
| 94 | # Export the assembly |
| 95 | step_path = os.path.join(tmpdir, "fused.step") |
| 96 | assy.save( |
| 97 | path=str(step_path), |
| 98 | exportType=exporters.ExportTypes.STEP, |
| 99 | mode=exporters.assembly.ExportModes.FUSED, |
| 100 | ) |
| 101 | |
| 102 | # Import the assembly and make sure it acts as expected |
| 103 | model = importers.importStep(step_path) |
| 104 | assert model.solids().size() == 1 |
| 105 | |
| 106 | |
| 107 | def test_fused_not_touching_assembly(tmpdir): |