From 2b2c06b4a3168701a307f4a0fec7155aa2a6270e Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 25 Feb 2021 17:24:32 -0500 Subject: [PATCH 01/10] Started to add dedicated import-export doc --- .../importexport/box_custom_options.svg | 33 +++++ .../importexport/box_default_options.svg | 46 +++++++ doc/importexport.rst | 120 ++++++++++++++++++ doc/index.rst | 1 + 4 files changed, 200 insertions(+) create mode 100644 doc/_static/importexport/box_custom_options.svg create mode 100644 doc/_static/importexport/box_default_options.svg create mode 100644 doc/importexport.rst diff --git a/doc/_static/importexport/box_custom_options.svg b/doc/_static/importexport/box_custom_options.svg new file mode 100644 index 000000000..d8c85e99e --- /dev/null +++ b/doc/_static/importexport/box_custom_options.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/_static/importexport/box_default_options.svg b/doc/_static/importexport/box_default_options.svg new file mode 100644 index 000000000..948cb5940 --- /dev/null +++ b/doc/_static/importexport/box_default_options.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + X + + + Y + + + Z + + + diff --git a/doc/importexport.rst b/doc/importexport.rst new file mode 100644 index 000000000..b1b52edbc --- /dev/null +++ b/doc/importexport.rst @@ -0,0 +1,120 @@ +.. _importexport: + +****************************** +Importing and Exporting Files +****************************** + +Introduction +============ + +The purpose of this section is to explain how to import external file formats into CadQuery, and export files from +it as well. While the external file formats can be used to interchange CAD model data with out software, CadQuery +does not support any formats that carry parametric data with them at this time. The only format that is fully +parametric is CadQuery's own Python format. Below are lists of the import and export file formats that CadQuery +supports. + +Import Formats +############### + +* DXF +* STEP + +Export Formats +############### + +* DXF +* SVG +* STEP +* STL +* AMF +* TJS +* VRML + +Notes on the Formats +####################### + +* DXF is useful for importing complex 2D profiles that would be tedious to create using CadQuery's 2D operations. An example is that the 2D profiles of aluminum extrusion are often provided in DXF format. This can be imported and extruded to create the length of extrusion that is needed in a design. +* STEP files are useful for interchanging model data with other CAD and analysis systems, such as FreeCAD. +* STL and AMF files are mesh-based formats which are typically used in additive manufacturing (i.e. 3D printing). AMF files support more features, but are not as widely supported as STL files. +* TJS is short for ThreeJS, and is a JSON format that is useful for displaying 3D models in web browsers. The TJS format is used to display embedded 3D examples within the CadQuery documentation. +* VRML is a format for representing interactive 3D objects in a web browser. + +Importing DXF +############## + +Importing STEP +############### + +Exporting SVG +############## + +The SVG exporter has several options which can be useful for getting the desired final output. Those +options are as follows. + +* *width* - Document width of the resulting image. +* *height* - Document height of the resulting image. +* *marginLeft* - Inset margin from the left side of the document. +* *marginTop* - Inset margin from the top side of the document. +* *projectionDir* - Direction the camera will view the shape from. +* *showAxes* - Whether or not to show the axes indicator, which will only be visible when the projectionDir is also at the default. +* *strokeWidth* - Width of the line that visible edges are drawn with. +* *strokeColor* - Color of the line that visible edges are drawn with. +* *hiddenColor* - Color of the line that hidden edges are drawn with. +* *showHidden* - Whether or not to show hidden lines. + +The options are passed to the exporter in a dictionary, and can be left out to force the SVG to be created with default options. +Below are a few examples. + +Without options: + +.. code-block:: python + + import cadquery as cq + from cadquery import exporters + + result = cq.Workplane().box(10, 10, 10) + + exporters.export(result, '/path/to/file/box.svg') + +Results in: + +.. image:: _static/importexport/box_default_options.svg + +Note that the exporters API figured out the format type from the file extension. The format +type can be set explicitly by using :py:class:`exporters.ExportTypes`. + +The following is an example of using options to alter the resulting SVG output by passing in the opt parameter. + +.. code-block:: python + + import cadquery as cq + from cadquery import exporters + + result = cq.Workplane().box(10, 10, 10) + + exporters.export( + result, + '/path/to/file/box_custom_options.svg', + opt={ + "width": 300, + "height": 300, + "marginLeft": 10, + "marginTop": 10, + "showAxes": False, + "projectionDir": (0.5, 0.5, 0.5), + "strokeWidth": 0.25, + "strokeColor": (255, 0, 0), + "hiddenColor": (0, 0, 255), + "showHidden": True, + }, + ) + +Which results in the following image: + +.. image:: _static/importexport/box_custom_options.svg + +Exporting STL +############## + +Exporting Other Formats +######################## diff --git a/doc/index.rst b/doc/index.rst index b7394353d..26ea9b2de 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -44,6 +44,7 @@ Table Of Contents apireference.rst selectors.rst classreference.rst + importexport.rst cqgi.rst extending.rst roadmap.rst From 6dd55fd65b1ba57861eff67b47ca2ea8585ef336 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 26 Feb 2021 08:47:20 -0500 Subject: [PATCH 02/10] Added DXF import, STEP import, and started STL export --- doc/importexport.rst | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/doc/importexport.rst b/doc/importexport.rst index b1b52edbc..b59202b0c 100644 --- a/doc/importexport.rst +++ b/doc/importexport.rst @@ -42,9 +42,41 @@ Notes on the Formats Importing DXF ############## +DXF files can be imported using the :py:meth:`importers.importDXF` method. There are 3 parameters that can be +passed this method to control how the DXF is handled. + +* *fileName* - The path and name of the DXF file to be imported. +* *tol* - The tolerance used for merging edges into wires (default: 1e-6). +* *exclude* - A list of layer names not to import (default: []). + +Importing a DXF profile with default settings and using it within a CadQuery script is shown in the following code. + +.. code-block:: python + + import cadquery as cq + + result = ( + cq.importers.importDXF('/path/to/dxf/circle.dxf') + .wires().toPending() + .extrude(10) + ) + +Note the use of the :py:meth:`Workplane.wires` and :py:meth:`Workplane.toPending` methods to make the DXF profile +ready for use during subsequent operations. Calling toPending() tells CadQuery to make the edges/wires available +to the next operation that is called in the chain. + Importing STEP ############### +STEP files can be imported using the :py:meth:`importers.importStep` method (note the capitalization of "Step"). +There are no parameters for this method other than the file path to import. + +.. code-block:: python + + import cadquery as cq + + result = cq.importers.importStep('/path/to/step/block.stp') + Exporting SVG ############## @@ -116,5 +148,11 @@ Which results in the following image: Exporting STL ############## +The STL exporter is capable of adjusting the quality of the resulting STL, and accepts the following options. + +* ** - +* ** - +* ** - + Exporting Other Formats ######################## From f3c3d7cc7d8aa520954c05c119f9ee280eb837e6 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 26 Feb 2021 08:49:13 -0500 Subject: [PATCH 03/10] Syncing STL export doc --- doc/importexport.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/importexport.rst b/doc/importexport.rst index b59202b0c..f67c084df 100644 --- a/doc/importexport.rst +++ b/doc/importexport.rst @@ -150,9 +150,9 @@ Exporting STL The STL exporter is capable of adjusting the quality of the resulting STL, and accepts the following options. -* ** - -* ** - -* ** - +* *fileName* - The path and file name to write the STL output to. +* *tolerance* - +* *angularTolerance* - Exporting Other Formats ######################## From 622f59bcfdb254fd22df0bb8fc22a80feedcbdcb Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 26 Feb 2021 14:15:17 -0500 Subject: [PATCH 04/10] Finished importers-exporters documentation --- doc/importexport.rst | 141 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 123 insertions(+), 18 deletions(-) diff --git a/doc/importexport.rst b/doc/importexport.rst index f67c084df..abb7bb45b 100644 --- a/doc/importexport.rst +++ b/doc/importexport.rst @@ -8,7 +8,7 @@ Introduction ============ The purpose of this section is to explain how to import external file formats into CadQuery, and export files from -it as well. While the external file formats can be used to interchange CAD model data with out software, CadQuery +it as well. While the external file formats can be used to interchange CAD model data with other software, CadQuery does not support any formats that carry parametric data with them at this time. The only format that is fully parametric is CadQuery's own Python format. Below are lists of the import and export file formats that CadQuery supports. @@ -33,21 +33,21 @@ Export Formats Notes on the Formats ####################### -* DXF is useful for importing complex 2D profiles that would be tedious to create using CadQuery's 2D operations. An example is that the 2D profiles of aluminum extrusion are often provided in DXF format. This can be imported and extruded to create the length of extrusion that is needed in a design. -* STEP files are useful for interchanging model data with other CAD and analysis systems, such as FreeCAD. -* STL and AMF files are mesh-based formats which are typically used in additive manufacturing (i.e. 3D printing). AMF files support more features, but are not as widely supported as STL files. -* TJS is short for ThreeJS, and is a JSON format that is useful for displaying 3D models in web browsers. The TJS format is used to display embedded 3D examples within the CadQuery documentation. -* VRML is a format for representing interactive 3D objects in a web browser. +* DXF is useful for importing complex 2D profiles that would be tedious to create using CadQuery's 2D operations. An example is that the 2D profiles of aluminum extrusion are often provided in DXF format. These can be imported and extruded to create the length of extrusion that is needed in a design. +* STEP files are useful for interchanging model data with other CAD and analysis systems, such as FreeCAD. Many parts such as screws have STEP files available, which can be imported and used in CadQuery assemblies. +* STL and AMF files are mesh-based formats which are typically used in additive manufacturing (i.e. 3D printing). AMF files support more features, but are not as universally supported as STL files. +* TJS is short for ThreeJS, and is a JSON mesh format that is useful for displaying 3D models in web browsers. The TJS format is used to display embedded 3D examples within the CadQuery documentation. +* VRML is a mesh-based format for representing interactive 3D objects in a web browser. Importing DXF ############## DXF files can be imported using the :py:meth:`importers.importDXF` method. There are 3 parameters that can be -passed this method to control how the DXF is handled. +passed to this method to control how the DXF is handled. -* *fileName* - The path and name of the DXF file to be imported. -* *tol* - The tolerance used for merging edges into wires (default: 1e-6). -* *exclude* - A list of layer names not to import (default: []). +* ``fileName`` - The path and name of the DXF file to be imported. +* ``tol`` - The tolerance used for merging edges into wires (default: 1e-6). +* ``exclude`` - A list of layer names not to import (default: []). Importing a DXF profile with default settings and using it within a CadQuery script is shown in the following code. @@ -62,7 +62,7 @@ Importing a DXF profile with default settings and using it within a CadQuery scr ) Note the use of the :py:meth:`Workplane.wires` and :py:meth:`Workplane.toPending` methods to make the DXF profile -ready for use during subsequent operations. Calling toPending() tells CadQuery to make the edges/wires available +ready for use during subsequent operations. Calling ``toPending()`` tells CadQuery to make the edges/wires available to the next operation that is called in the chain. Importing STEP @@ -80,7 +80,7 @@ There are no parameters for this method other than the file path to import. Exporting SVG ############## -The SVG exporter has several options which can be useful for getting the desired final output. Those +The SVG exporter has several options which can be useful for achieving the desired final output. Those options are as follows. * *width* - Document width of the resulting image. @@ -95,7 +95,7 @@ options are as follows. * *showHidden* - Whether or not to show hidden lines. The options are passed to the exporter in a dictionary, and can be left out to force the SVG to be created with default options. -Below are a few examples. +Below are examples with and without options set. Without options: @@ -115,7 +115,7 @@ Results in: Note that the exporters API figured out the format type from the file extension. The format type can be set explicitly by using :py:class:`exporters.ExportTypes`. -The following is an example of using options to alter the resulting SVG output by passing in the opt parameter. +The following is an example of using options to alter the resulting SVG output by passing in the ``opt`` parameter. .. code-block:: python @@ -148,11 +148,116 @@ Which results in the following image: Exporting STL ############## -The STL exporter is capable of adjusting the quality of the resulting STL, and accepts the following options. +The STL exporter is capable of adjusting the quality of the resulting mesh, and accepts the following parameters. -* *fileName* - The path and file name to write the STL output to. -* *tolerance* - -* *angularTolerance* - +* ``fileName`` - The path and file name to write the STL output to. +* ``tolerance`` - A linear deflection setting which limits the distance between a curve and its tessellation. Setting this value too low will result in large meshes that can consume computing resources. Setting the value too high can result in meshes with a level of detail that is too low. Default is 0.1, which is good starting point for a range of cases. +* ``angularTolerance`` - Angular deflection setting which limits the angle between subsequent segments in a polyline. Default is 0.1. + +For more complex objects, some experimentation with ``tolerance`` and ``angularTolerance`` may be required to find the +optimum values that will produce an acceptable mesh. + +.. code-block:: python + + import cadquery as cq + from cadquery import exporters + + result = cq.Workplane().box(10, 10, 10) + + exporters.export(result, '/path/to/file/mesh.stl') + +Exporting AMF +############## + +The AMF exporter is capable of adjusting the quality of the resulting mesh, and accepts the following parameters. + +* ``fileName`` - The path and file name to write the AMF output to. +* ``tolerance`` - A linear deflection setting which limits the distance between a curve and its tessellation. Setting this value too low will result in large meshes that can consume computing resources. Setting the value too high can result in meshes with a level of detail that is too low. Default is 0.1, which is good starting point for a range of cases. +* ``angularTolerance`` - Angular deflection setting which limits the angle between subsequent segments in a polyline. Default is 0.1. + +For more complex objects, some experimentation with ``tolerance`` and ``angularTolerance`` may be required to find the +optimum values that will produce an acceptable mesh. Note that parameters for AMF color and material are absent. + +.. code-block:: python + + import cadquery as cq + from cadquery import exporters + + result = cq.Workplane().box(10, 10, 10) + + exporters.export(result, '/path/to/file/mesh.amf', tolerance=0.01, angularTolerance=0.1) + + +Exporting TJS +############## + +The TJS (ThreeJS) exporter is capable of adjusting the quality of the resulting JSON-based mesh, and accepts the following parameters. + +* ``fileName`` - The path and file name to write the ThreeJS output to. +* ``tolerance`` - A linear deflection setting which limits the distance between a curve and its tessellation. Setting this value too low will result in large meshes that can consume computing resources. Setting the value too high can result in meshes with a level of detail that is too low. Default is 0.1, which is good starting point for a range of cases. +* ``angularTolerance`` - Angular deflection setting which limits the angle between subsequent segments in a polyline. Default is 0.1. + +For more complex objects, some experimentation with ``tolerance`` and ``angularTolerance`` may be required to find the +optimum values that will produce an acceptable mesh. + +.. code-block:: python + + import cadquery as cq + from cadquery import exporters + + result = cq.Workplane().box(10, 10, 10) + + exporters.export(result, '/path/to/file/mesh.json', tolerance=0.01, angularTolerance=0.1, exportType=exporters.ExportTypes.TJS) + +Note that the export type was explicitly specified as ``TJS`` because the extension that was used for the file name was ``.json``. If the extension ``.tjs`` +had been used, CadQuery would have understood to use the ``TJS`` export format. + +Exporting VRML +############### + +The VRML exporter is capable of adjusting the quality of the resulting mesh, and accepts the following parameters. + +* ``fileName`` - The path and file name to write the VRML output to. +* ``tolerance`` - A linear deflection setting which limits the distance between a curve and its tessellation. Setting this value too low will result in large meshes that can consume computing resources. Setting the value too high can result in meshes with a level of detail that is too low. Default is 0.1, which is good starting point for a range of cases. +* ``angularTolerance`` - Angular deflection setting which limits the angle between subsequent segments in a polyline. Default is 0.1. + +For more complex objects, some experimentation with ``tolerance`` and ``angularTolerance`` may be required to find the +optimum values that will produce an acceptable mesh. + +.. code-block:: python + + import cadquery as cq + from cadquery import exporters + + result = cq.Workplane().box(10, 10, 10) + + exporters.export(result, '/path/to/file/mesh.vrml', tolerance=0.01, angularTolerance=0.1) Exporting Other Formats ######################## + +The remaining export formats do not accept any additional parameters other than file name, and can be exported +using the following structure. + +.. code-block:: python + + import cadquery as cq + from cadquery import exporters + + result = cq.Workplane().box(10, 10, 10) + + exporters.export(result, '/path/to/file/object.[file_extension]') + +Be sure to use the correct file extension so that CadQuery can determine the export format. If in doubt, fall +back to setting the type explicitly by using :py:class:`exporters.ExportTypes`. + +For example: + +.. code-block:: python + + import cadquery as cq + from cadquery import exporters + + result = cq.Workplane().box(10, 10, 10) + + exporters.export(result, '/path/to/file/object.dxf', exporters.ExportTypes.DXF) From 6328fd12e21674095f9491b2b41d4bbbf1d72ac1 Mon Sep 17 00:00:00 2001 From: Marcus Boyd Date: Sat, 27 Feb 2021 15:20:50 +1030 Subject: [PATCH 05/10] added .svg to .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index d8383eddf..f0b0594c5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,7 @@ # Don't display text diffs for files that are not human readable # Git should not modify line endings in these test files tests/testdata/* -diff -text +*.svg # Jupyter notebooks should be classified as documentation *.ipynb linguist-documentation -diff -text From aa0eb803bc406f39a671299aa8d166d24065bf25 Mon Sep 17 00:00:00 2001 From: Marcus Boyd Date: Sat, 27 Feb 2021 15:27:12 +1030 Subject: [PATCH 06/10] properly added .svg to .gitattributes --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index f0b0594c5..00353f0a5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,7 @@ # Don't display text diffs for files that are not human readable # Git should not modify line endings in these test files tests/testdata/* -diff -text -*.svg +*.svg -diff -text # Jupyter notebooks should be classified as documentation *.ipynb linguist-documentation -diff -text From 394b1b6a78b29e4ecb5efcf41640acbd8f9cfe1d Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Sat, 27 Feb 2021 07:22:14 -0500 Subject: [PATCH 07/10] Update doc/importexport.rst Pull importDXF docstring into docs Co-authored-by: Marcus Boyd <50230945+marcus7070@users.noreply.github.com> --- doc/importexport.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/importexport.rst b/doc/importexport.rst index abb7bb45b..5336bd9b4 100644 --- a/doc/importexport.rst +++ b/doc/importexport.rst @@ -42,12 +42,10 @@ Notes on the Formats Importing DXF ############## -DXF files can be imported using the :py:meth:`importers.importDXF` method. There are 3 parameters that can be -passed to this method to control how the DXF is handled. +DXF files can be imported using the :py:meth:`importers.importDXF` method. -* ``fileName`` - The path and name of the DXF file to be imported. -* ``tol`` - The tolerance used for merging edges into wires (default: 1e-6). -* ``exclude`` - A list of layer names not to import (default: []). +.. automethod:: + cadquery.importers.importDXF Importing a DXF profile with default settings and using it within a CadQuery script is shown in the following code. From e271164efac77517e93fe4d1cd78f2107abbc457 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Sat, 27 Feb 2021 07:23:34 -0500 Subject: [PATCH 08/10] Update doc/importexport.rst Clarification of operation type called after toPending() Co-authored-by: Marcus Boyd <50230945+marcus7070@users.noreply.github.com> --- doc/importexport.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/importexport.rst b/doc/importexport.rst index 5336bd9b4..e34fc865b 100644 --- a/doc/importexport.rst +++ b/doc/importexport.rst @@ -61,7 +61,7 @@ Importing a DXF profile with default settings and using it within a CadQuery scr Note the use of the :py:meth:`Workplane.wires` and :py:meth:`Workplane.toPending` methods to make the DXF profile ready for use during subsequent operations. Calling ``toPending()`` tells CadQuery to make the edges/wires available -to the next operation that is called in the chain. +to the next modelling operation that is called in the chain. Importing STEP ############### From c06cfa594898765349e7cb765443e041cbb48c6e Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Sat, 27 Feb 2021 07:24:57 -0500 Subject: [PATCH 09/10] Update doc/importexport.rst Updated description on TJS format Co-authored-by: Marcus Boyd <50230945+marcus7070@users.noreply.github.com> --- doc/importexport.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/importexport.rst b/doc/importexport.rst index e34fc865b..8691f4dbd 100644 --- a/doc/importexport.rst +++ b/doc/importexport.rst @@ -189,7 +189,7 @@ optimum values that will produce an acceptable mesh. Note that parameters for AM Exporting TJS ############## -The TJS (ThreeJS) exporter is capable of adjusting the quality of the resulting JSON-based mesh, and accepts the following parameters. +The TJS (ThreeJS) exporter produces a file in JSON format that describes a scene for the ThreeJS WebGL renderer. The objects in the first argument are converted into a mesh and then form the ThreeJS geometry for the scene. The mesh can be adjusted with the following parameters. * ``fileName`` - The path and file name to write the ThreeJS output to. * ``tolerance`` - A linear deflection setting which limits the distance between a curve and its tessellation. Setting this value too low will result in large meshes that can consume computing resources. Setting the value too high can result in meshes with a level of detail that is too low. Default is 0.1, which is good starting point for a range of cases. From 45227c9971e1424a797cbb2a17c582637a4609dc Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Sat, 27 Feb 2021 07:53:59 -0500 Subject: [PATCH 10/10] Added a docstring to exportStl and used it in the docs --- cadquery/occ_impl/shapes.py | 10 ++++++++++ doc/importexport.rst | 5 ++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index a7880dc64..464c788d1 100644 --- a/cadquery/occ_impl/shapes.py +++ b/cadquery/occ_impl/shapes.py @@ -396,6 +396,16 @@ def cast( def exportStl( self, fileName: str, tolerance: float = 1e-3, angularTolerance: float = 0.1 ) -> bool: + """ + Exports a shape to a specified STL file. + + :param fileName: The path and file name to write the STL output to. + :type fileName: fileName + :param tolerance: A linear deflection setting which limits the distance between a curve and its tessellation. Setting this value too low will result in large meshes that can consume computing resources. Setting the value too high can result in meshes with a level of detail that is too low. Default is 0.1, which is good starting point for a range of cases. + :type tolerance: float + :param angularTolerance: - Angular deflection setting which limits the angle between subsequent segments in a polyline. Default is 0.1. + :type angularTolerance: float + """ mesh = BRepMesh_IncrementalMesh(self.wrapped, tolerance, True, angularTolerance) mesh.Perform() diff --git a/doc/importexport.rst b/doc/importexport.rst index 8691f4dbd..af38835ee 100644 --- a/doc/importexport.rst +++ b/doc/importexport.rst @@ -148,9 +148,8 @@ Exporting STL The STL exporter is capable of adjusting the quality of the resulting mesh, and accepts the following parameters. -* ``fileName`` - The path and file name to write the STL output to. -* ``tolerance`` - A linear deflection setting which limits the distance between a curve and its tessellation. Setting this value too low will result in large meshes that can consume computing resources. Setting the value too high can result in meshes with a level of detail that is too low. Default is 0.1, which is good starting point for a range of cases. -* ``angularTolerance`` - Angular deflection setting which limits the angle between subsequent segments in a polyline. Default is 0.1. +.. automethod:: + cadquery.occ_impl.shapes.Shape.exportStl For more complex objects, some experimentation with ``tolerance`` and ``angularTolerance`` may be required to find the optimum values that will produce an acceptable mesh.