2014-10-25 12:57:46 -04:00
|
|
|
.. _cadquery_reference:
|
|
|
|
|
2015-11-28 21:05:20 -05:00
|
|
|
CadQuery Scripts and Object Output
|
|
|
|
======================================
|
2014-10-25 12:57:46 -04:00
|
|
|
|
2019-01-17 13:25:51 -05:00
|
|
|
CadQuery scripts are pure Python scripts, that may follow a few conventions.
|
2014-10-25 12:57:46 -04:00
|
|
|
|
2019-01-17 13:25:51 -05:00
|
|
|
If you are using CadQuery as a library, there are no constraints.
|
2015-12-09 21:01:14 -05:00
|
|
|
|
2019-01-17 13:25:51 -05:00
|
|
|
If you are using CadQuery scripts inside of a CadQuery execution environment
|
|
|
|
like `CQ-editor <https://github.com/CadQuery/CQ-editor>`_, there are a few conventions you need to be aware of:
|
2015-12-09 21:01:14 -05:00
|
|
|
|
2019-01-17 13:25:51 -05:00
|
|
|
* cadquery is usually imported as 'cq' at the top of a script
|
|
|
|
* to return an object to the execution environment (like CQ-editor) for rendering, you need to call the show_object() method
|
2015-12-09 21:01:14 -05:00
|
|
|
|
2015-11-28 21:05:20 -05:00
|
|
|
Each script generally has three sections:
|
2014-10-25 12:57:46 -04:00
|
|
|
|
2015-12-12 15:08:38 -05:00
|
|
|
* Variable Assignments and metadata definitions
|
2019-01-17 13:25:51 -05:00
|
|
|
* CadQuery and other Python code
|
|
|
|
* object export or rendering, via the show_object() function
|
2014-10-25 12:57:46 -04:00
|
|
|
|
|
|
|
|
2015-12-09 21:01:14 -05:00
|
|
|
see the :ref:`cqgi` section for more details.
|