

.. _sphx_glr_examples_02_writers:

.. _writers:

Writing CAD formats
===================

Examples that take a PyVista dataset and write it to a CAD file on
disk via :func:`pyvista_cad.write_dxf` or the ``.cad`` accessor.


.. raw:: html

  <div id='sg-tag-list' class='sphx-glr-tag-list'></div>


.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Export a printable part to 3MF. The 3MF format carries per-object names, units, and (where supported) colors: everything a modern slicer needs to put the part on the build plate.">

.. only:: html

  .. image:: /examples/02_writers/images/thumb/sphx_glr_write_3mf_thumb.png
    :alt:

  :doc:`/examples/02_writers/write_3mf`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Write a 3MF package</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Serialize a tessellated pyvista.PolyData as a faceted TopoDS_Compound in OpenCASCADE&#x27;s native BREP format. BREP is the canonical handoff to any OCCT-aware tool (FreeCAD, build123d, cadquery).">

.. only:: html

  .. image:: /examples/02_writers/images/thumb/sphx_glr_write_brep_thumb.png
    :alt:

  :doc:`/examples/02_writers/write_brep`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Write a BREP file</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Round-trip a real 2D drawing through PyVista back out to DXF. The layer assignment of every cell is preserved on the cad.layer array.">

.. only:: html

  .. image:: /examples/02_writers/images/thumb/sphx_glr_write_dxf_thumb.png
    :alt:

  :doc:`/examples/02_writers/write_dxf`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Write a DXF drawing</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Send a tessellated mesh back to a STEP file via OCCT&#x27;s STEPControl_Writer. The result is faceted (triangulated), not a B-rep reconstruction, ideal for downstream tools that accept STEP for visualization or CAM but do not require analytical surfaces.">

.. only:: html

  .. image:: /examples/02_writers/images/thumb/sphx_glr_write_step_faceted_thumb.png
    :alt:

  :doc:`/examples/02_writers/write_step_faceted`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Write a faceted STEP file</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/02_writers/write_3mf
   /examples/02_writers/write_brep
   /examples/02_writers/write_dxf
   /examples/02_writers/write_step_faceted

