Skip to content

Commit 6dd55fd

Browse files
committed
Added DXF import, STEP import, and started STL export
1 parent 2b2c06b commit 6dd55fd

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

doc/importexport.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,41 @@ Notes on the Formats
4242
Importing DXF
4343
##############
4444

45+
DXF files can be imported using the :py:meth:`importers.importDXF` method. There are 3 parameters that can be
46+
passed this method to control how the DXF is handled.
47+
48+
* *fileName* - The path and name of the DXF file to be imported.
49+
* *tol* - The tolerance used for merging edges into wires (default: 1e-6).
50+
* *exclude* - A list of layer names not to import (default: []).
51+
52+
Importing a DXF profile with default settings and using it within a CadQuery script is shown in the following code.
53+
54+
.. code-block:: python
55+
56+
import cadquery as cq
57+
58+
result = (
59+
cq.importers.importDXF('/path/to/dxf/circle.dxf')
60+
.wires().toPending()
61+
.extrude(10)
62+
)
63+
64+
Note the use of the :py:meth:`Workplane.wires` and :py:meth:`Workplane.toPending` methods to make the DXF profile
65+
ready for use during subsequent operations. Calling toPending() tells CadQuery to make the edges/wires available
66+
to the next operation that is called in the chain.
67+
4568
Importing STEP
4669
###############
4770

71+
STEP files can be imported using the :py:meth:`importers.importStep` method (note the capitalization of "Step").
72+
There are no parameters for this method other than the file path to import.
73+
74+
.. code-block:: python
75+
76+
import cadquery as cq
77+
78+
result = cq.importers.importStep('/path/to/step/block.stp')
79+
4880
Exporting SVG
4981
##############
5082

@@ -116,5 +148,11 @@ Which results in the following image:
116148
Exporting STL
117149
##############
118150

151+
The STL exporter is capable of adjusting the quality of the resulting STL, and accepts the following options.
152+
153+
* ** -
154+
* ** -
155+
* ** -
156+
119157
Exporting Other Formats
120158
########################

0 commit comments

Comments
 (0)