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

Function test_step_options

tests/test_exporters.py:61–78  ·  view source on GitHub ↗

Exports a box using the options to decrease STEP file size and then imports that STEP to validate it.

(tmpdir)

Source from the content-addressed store, hash-verified

59
60
61def test_step_options(tmpdir):
62 """
63 Exports a box using the options to decrease STEP file size and
64 then imports that STEP to validate it.
65 """
66 # Use a temporary directory
67 box_path = os.path.join(tmpdir, "out1.step")
68
69 # Simple object to export
70 box = Workplane().box(1, 1, 1)
71
72 # Export the STEP with the size-saving options and then import it back in
73 box.val().exportStep(box_path, write_pcurves=False, precision_mode=0)
74 w = importers.importStep(box_path)
75
76 # Make sure there was a valid box in the exported file
77 assert w.solids().size() == 1
78 assert w.faces().size() == 6
79
80
81def test_fused_assembly(tmpdir):

Callers

nothing calls this directly

Calls 8

WorkplaneClass · 0.90
boxMethod · 0.80
exportStepMethod · 0.80
importStepMethod · 0.80
valMethod · 0.45
sizeMethod · 0.45
solidsMethod · 0.45
facesMethod · 0.45

Tested by

no test coverage detected