MCPcopy
hub / github.com/CadQuery/cadquery / testSTEPImportUnitDefault

Method testSTEPImportUnitDefault

tests/test_importers.py:179–191  ·  view source on GitHub ↗

Exports and re-imports a STEP file with the default unit (MM) and verifies the shape geometry is unchanged.

(self)

Source from the content-addressed store, hash-verified

177 self.assertEqual(2, len(objs.all()))
178
179 def testSTEPImportUnitDefault(self):
180 """
181 Exports and re-imports a STEP file with the default unit (MM) and
182 verifies the shape geometry is unchanged.
183 """
184
185 fileName = os.path.join(OUTDIR, "unit_default_import.step")
186 shape = Workplane("XY").box(1, 2, 3).val()
187 shape.exportStep(fileName)
188
189 imported = importers.importStep(fileName, unit="MM")
190 self.assertTrue(imported.val().isValid())
191 self.assertAlmostEqual(imported.findSolid().Volume(), 6)
192
193 def testSTEPImportUnitOverride(self):
194 """

Callers

nothing calls this directly

Calls 8

WorkplaneClass · 0.90
boxMethod · 0.80
exportStepMethod · 0.80
importStepMethod · 0.80
isValidMethod · 0.80
VolumeMethod · 0.80
findSolidMethod · 0.80
valMethod · 0.45

Tested by

no test coverage detected