MCPcopy Index your code
hub / github.com/CadQuery/cadquery / testBrepImportExport

Method testBrepImportExport

tests/test_cadquery.py:5300–5324  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5298 self.assertTrue(all([v in endpoints for v in vecs]))
5299
5300 def testBrepImportExport(self):
5301
5302 # import/export to file
5303 s = Workplane().box(1, 1, 1).val()
5304
5305 with chdir(self.tmpdir):
5306 s.exportBrep("test.brep")
5307 si = Shape.importBrep("test.brep")
5308
5309 self.assertTrue(si.isValid())
5310 self.assertAlmostEqual(si.Volume(), 1)
5311
5312 # import/export to BytesIO
5313 from io import BytesIO
5314
5315 bio = BytesIO()
5316
5317 s.exportBrep(bio)
5318 bio.seek(0)
5319
5320 with chdir(self.tmpdir):
5321 si = Shape.importBrep("test.brep")
5322
5323 self.assertTrue(si.isValid())
5324 self.assertAlmostEqual(si.Volume(), 1)
5325
5326 def testFaceToPln(self):
5327

Callers

nothing calls this directly

Calls 7

WorkplaneClass · 0.85
boxMethod · 0.80
exportBrepMethod · 0.80
importBrepMethod · 0.80
isValidMethod · 0.80
VolumeMethod · 0.80
valMethod · 0.45

Tested by

no test coverage detected