(tmpdir)
| 881 | |
| 882 | |
| 883 | def test_dxf_approx(tmpdir): |
| 884 | |
| 885 | pts = [(0, 0), (0, 0.5), (1, 1)] |
| 886 | w1 = Workplane().spline(pts).close().extrude(1).edges("|Z").fillet(0.1).section() |
| 887 | exporters.exportDXF(w1, str(tmpdir / "orig.dxf")) |
| 888 | |
| 889 | assert _dxf_spline_max_degree(str(tmpdir / "orig.dxf")) == 6 |
| 890 | |
| 891 | exporters.exportDXF(w1, str(tmpdir / "limit1.dxf"), approx="spline") |
| 892 | w1_i1 = importers.importDXF(str(tmpdir / "limit1.dxf")) |
| 893 | |
| 894 | assert _dxf_spline_max_degree(str(tmpdir / "limit1.dxf")) == 3 |
| 895 | |
| 896 | assert w1.val().Area() == approx(w1_i1.val().Area(), 1e-3) |
| 897 | assert w1.edges().size() == w1_i1.edges().size() |
| 898 | |
| 899 | exporters.exportDXF(w1, str(tmpdir / "limit2.dxf"), approx="arc") |
| 900 | w1_i2 = importers.importDXF(str(tmpdir / "limit2.dxf")) |
| 901 | |
| 902 | assert _check_dxf_no_spline(str(tmpdir / "limit2.dxf")) |
| 903 | |
| 904 | assert w1.val().Area() == approx(w1_i2.val().Area(), 1e-3) |
| 905 | |
| 906 | |
| 907 | def test_dxf_text(tmpdir, testdatadir): |
nothing calls this directly
no test coverage detected