Skip to content

DXF export of filleted splines is missing fillet arcs #1225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sapphire-arches opened this issue Jan 12, 2023 · 0 comments · Fixed by #1226
Closed

DXF export of filleted splines is missing fillet arcs #1225

sapphire-arches opened this issue Jan 12, 2023 · 0 comments · Fixed by #1226

Comments

@sapphire-arches
Copy link
Contributor

sapphire-arches commented Jan 12, 2023

When manually constructing splines, extruding, filleting the result, and then exporting them, the resultant DXF file does not render correctly in LibreCAD (or various online DXF processors like the one provided by SendCutSend or Ponoko).

import cadquery as cq

s = cq.Sketch()
s = s.spline([
    (0, 0),
    (10, 10),
    (10, 0)
])
s = s.close()
s = s.assemble()

w = cq.Workplane("XY")
w = w.placeSketch(s)
w = w.extrude(5)
w = w.edges("|Z").fillet(2)

show_object(w)

cq.exporters.export(w, 'test.dxf')

Output:

image

sapphire-arches added a commit to sapphire-arches/cadquery that referenced this issue Jan 12, 2023
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 CadQuery#1225
sapphire-arches added a commit to sapphire-arches/cadquery that referenced this issue Jan 12, 2023
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 CadQuery#1225
adam-urbanczyk added a commit that referenced this issue Feb 21, 2023
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants