From e0a9c183e90acf00915f06adf2bc846e8184d35e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Urba=C5=84czyk?= Date: Sun, 2 Aug 2020 16:52:55 +0200 Subject: [PATCH 1/2] Mention DXF export in the README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1296c5265..3f6d887a0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ CadQuery is often compared to [OpenSCAD](http://www.openscad.org/). Like OpenSCA ### Key features * Build 3D models with scripts that are as close as possible to how you would describe the object to a human. * Create parametric models that can be very easily customized by end users. -* Output high quality (loss-less) CAD formats like STEP in addition to STL and AMF. +* Output high quality (loss-less) CAD formats like STEP and DXF in addition to STL and AMF. * Provide a non-proprietary, plain text model format that can be edited and executed with only a web browser. * Offer advanced modeling capabilities such as fillets, curvelinear extrudes, parametric curves and lofts. From d3bf61854773031d1a088d0e9f89b5a31d0522d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Urba=C5=84czyk?= Date: Sun, 2 Aug 2020 17:03:23 +0200 Subject: [PATCH 2/2] Mention export in the tutorial --- doc/quickstart.rst | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/quickstart.rst b/doc/quickstart.rst index 2fe705648..fd3918ccb 100644 --- a/doc/quickstart.rst +++ b/doc/quickstart.rst @@ -223,6 +223,38 @@ The finished product looks like this: .. image:: _static/quickstart/005.png +Exporting +========= + +If you want to fabricate a physical object you need to export the result to STL or DXF. Additionally, exporting as STEP for post-processing in another CAD tool is also possible. + +This can be easily accomplished using the :py:meth:`cadquery.exporters.export` function: + +.. code-block:: python + :linenos: + :emphasize-lines: 13 + + height = 60.0 + width = 80.0 + thickness = 10.0 + diameter = 22.0 + padding = 12.0 + + # make the base + result = cq.Workplane("XY").box(height, width, thickness)\ + .faces(">Z").workplane().hole(diameter)\ + .faces(">Z").workplane() \ + .rect(height - padding, width - padding, forConstruction=True)\ + .vertices().cboreHole(2.4, 4.4, 2.1)\ + .edges("|Z").fillet(2.0) + + # Render the solid + show_object(result) + + # Export + cq.exporters.export(result,'result.stl') + cq.exporters.export(result.section(),'result.dxf') + cq.exporters.export(result,'result.step') Done! ============