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

Method testSTEPImportUnitViaImportShape

tests/test_importers.py:210–224  ·  view source on GitHub ↗

Verifies that the unit parameter is correctly threaded through importShape to importStep.

(self)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected