You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Limit DXF BSpline Degree
Most DXF renderers and processing tools can't handle BSplines with
degree >= 3 (order >= 4). For maximum compatibility, we should
approximate such BSplines using degree-3 splines. This change uses the
OpenCascade facilities to do so, though ezdxf.math also provides some
spline approximation facilities that could be used. Using the
OpenCascade approach allows us to match FreeCAD's parameters which are
presumably tuned on a diversity of real-world designs.
Fixes#1225
* Make DXF BSpline degree limit optional
This adds plumbing through the option infrastructure to make the DXF
approximation optional, and expose the important control parameters to
the user with reasonable defaults. Includes some additional
documentation to ease discovery and explain why that should be
important.
* Black
* Start refactoring
* Add toSplines and toArcs
* Refactor exportDXF and add arc approximation
* Update tests
* Rework opt handling
* Update docs
* Better docstring
* Use C0
* Apply suggestions from code review
Co-authored-by: Jeremy Wright <[email protected]>
Co-authored-by: Lorenz <[email protected]>
* Update docstring
* Code review suggestion
Co-authored-by: Jeremy Wright <[email protected]>
---------
Co-authored-by: AU <[email protected]>
Co-authored-by: Jeremy Wright <[email protected]>
Co-authored-by: Lorenz <[email protected]>
By default, the DXF exporter will output splines exactly as they are represented by the OpenCascade kernel. Unfortunately some software cannot handle higher-order splines resulting in missing curves after DXF import. To resolve this, specify an approximation strategy controlled by the following options:
238
+
239
+
* ``approx`` - ``None``, ``"spline"`` or ``"arc"``. ``"spline"`` results in all splines approximated with cubic splines. ``"arc"`` results in all curves approximated with arcs and line segments.
240
+
* ``tolerance``: Acceptable error of the approximation, in the DXF's coordinate system. Defaults to 0.001 (1 thou for inch-scale drawings, 1 µm for mm-scale drawings).
0 commit comments