| 1236 | |
| 1237 | # prepare the model |
| 1238 | def make_model(name: str, COPY: bool): |
| 1239 | |
| 1240 | b = box(1, 1, 1) |
| 1241 | |
| 1242 | assy = Assembly(name="test_assy") |
| 1243 | assy.add(box(1, 2, 5), color=Color("green")) |
| 1244 | |
| 1245 | for i, v in enumerate(rect(10, 10).vertices()): |
| 1246 | assy.add( |
| 1247 | b.copy() if COPY else b, |
| 1248 | name=f"element_{i}", |
| 1249 | loc=Location(v.Center()), |
| 1250 | color=Color("red"), |
| 1251 | ) |
| 1252 | |
| 1253 | with chdir(tmpdir): |
| 1254 | assy.export(name) |
| 1255 | |
| 1256 | return assy |
| 1257 | |
| 1258 | make_model("test_assy_copy.step", True) |
| 1259 | make_model("test_assy.step", False) |