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

Function test_step_export

tests/test_assembly.py:705–722  ·  view source on GitHub ↗
(nested_assy, tmpdir)

Source from the content-addressed store, hash-verified

703
704
705def test_step_export(nested_assy, tmpdir):
706
707 with chdir(tmpdir):
708 exportAssembly(nested_assy, "nested.step")
709 exportAssembly(
710 nested_assy, "nested_options.step", write_pcurves=False, precision_mode=0
711 )
712 w = cq.importers.importStep("nested.step")
713 o = cq.importers.importStep("nested_options.step")
714
715 assert w.solids().size() == 4
716 assert o.solids().size() == 4
717
718 # check that locations were applied correctly
719 c = cq.Compound.makeCompound(w.solids().vals()).Center()
720 assert pytest.approx(c.toTuple()) == (0, 4, 0)
721 c2 = cq.Compound.makeCompound(o.solids().vals()).Center()
722 assert pytest.approx(c2.toTuple()) == (0, 4, 0)
723
724
725def test_meta_step_export(tmpdir):

Callers

nothing calls this directly

Calls 8

exportAssemblyFunction · 0.90
importStepMethod · 0.80
makeCompoundMethod · 0.80
sizeMethod · 0.45
solidsMethod · 0.45
CenterMethod · 0.45
valsMethod · 0.45
toTupleMethod · 0.45

Tested by

no test coverage detected