Skip to content

Commit 45227c9

Browse files
committed
Added a docstring to exportStl and used it in the docs
1 parent c06cfa5 commit 45227c9

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

cadquery/occ_impl/shapes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,16 @@ def cast(
396396
def exportStl(
397397
self, fileName: str, tolerance: float = 1e-3, angularTolerance: float = 0.1
398398
) -> bool:
399+
"""
400+
Exports a shape to a specified STL file.
401+
402+
:param fileName: The path and file name to write the STL output to.
403+
:type fileName: fileName
404+
: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.
405+
:type tolerance: float
406+
:param angularTolerance: - Angular deflection setting which limits the angle between subsequent segments in a polyline. Default is 0.1.
407+
:type angularTolerance: float
408+
"""
399409

400410
mesh = BRepMesh_IncrementalMesh(self.wrapped, tolerance, True, angularTolerance)
401411
mesh.Perform()

doc/importexport.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,8 @@ Exporting STL
148148

149149
The STL exporter is capable of adjusting the quality of the resulting mesh, and accepts the following parameters.
150150

151-
* ``fileName`` - The path and file name to write the STL output to.
152-
* ``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.
153-
* ``angularTolerance`` - Angular deflection setting which limits the angle between subsequent segments in a polyline. Default is 0.1.
151+
.. automethod::
152+
cadquery.occ_impl.shapes.Shape.exportStl
154153

155154
For more complex objects, some experimentation with ``tolerance`` and ``angularTolerance`` may be required to find the
156155
optimum values that will produce an acceptable mesh.

0 commit comments

Comments
 (0)