Verifies that the unit parameter is correctly threaded through importShape to importStep.
(self)
| 208 | assert bb.ylen == approx(1, rel=1e-3) |
| 209 | |
| 210 | def testSTEPImportUnitViaImportShape(self): |
| 211 | """ |
| 212 | Verifies that the unit parameter is correctly threaded through |
| 213 | importShape to importStep. |
| 214 | """ |
| 215 | |
| 216 | fileName = os.path.join(OUTDIR, "unit_importshape.step") |
| 217 | shape = Workplane("XY").box(1, 2, 3).val() |
| 218 | shape.exportStep(fileName) |
| 219 | |
| 220 | imported = importers.importShape( |
| 221 | importers.ImportTypes.STEP, fileName, unit="MM" |
| 222 | ) |
| 223 | self.assertTrue(imported.val().isValid()) |
| 224 | self.assertAlmostEqual(imported.findSolid().Volume(), 6) |
| 225 | |
| 226 | def testImportDXF(self): |
| 227 | """ |