Skip to content

Commit 3c576f4

Browse files
authored
Merge pull request #1305 from lorenzncode/docs-install
docs - Update installation section of README and documentation
2 parents 6aadd58 + ba17e01 commit 3c576f4

File tree

3 files changed

+173
-113
lines changed

3 files changed

+173
-113
lines changed

README.md

Lines changed: 35 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ CadQuery is often compared to [OpenSCAD](http://www.openscad.org/). Like OpenSCA
2727
4. CadQuery scripts require less code to create most objects, because it is possible to locate features based on the position of other features, workplanes, vertices, etc.
2828
5. CadQuery scripts can build STL, STEP, AMF and 3MF faster than OpenSCAD.
2929

30+
CadQuery was built to be used as a Python library without any GUI. This makes it great for use cases such as integration into servers, or creating scientific and engineering scripts. Options for visualziation are also available including CQ-Editor and JupyterLab.
31+
32+
For those who are interested, the [OCP repository](https://github.com/CadQuery/OCP) contains the current OCCT wrapper used by CQ.
33+
3034
### Key features
3135
* Build 3D models with scripts that are as close as possible to how you would describe the object to a human.
3236
* Create parametric models that can be very easily customized by end users.
@@ -43,86 +47,55 @@ The original version of CadQuery was built on the FreeCAD API. This was great be
4347

4448
To learn more about designing with CadQuery, visit the [documentation](https://cadquery.readthedocs.io/en/latest/intro.html), [examples](https://cadquery.readthedocs.io/en/latest/examples.html), and [cheatsheet](https://cadquery.readthedocs.io/en/latest/_static/cadquery_cheatsheet.html).
4549

46-
To get started playing around with CadQuery and see it's capabilities, take a look at the [CQ-editor GUI](https://github.com/CadQuery/CQ-editor). This easy-to-use IDE is a great way to get started desiging with CadQuery.
50+
To get started playing around with CadQuery and see its capabilities, take a look at the [CQ-editor GUI](https://github.com/CadQuery/CQ-editor). This easy-to-use IDE is a great way to get started desiging with CadQuery.
4751

48-
There are currently 4 different ways to use CadQuery for designing your next project:
49-
* Using the [CQ-editor GUI](https://github.com/CadQuery/CQ-editor)
50-
* From a [Jupyter notebook](https://github.com/bernhard-42/jupyter-cadquery)
51-
* Using a [VSCode extension](https://marketplace.visualstudio.com/items?itemName=roipoussiere.cadquery)
52-
* As a standalone library
53-
* Linux [installation video](https://youtu.be/sjLTePOq8bQ)
54-
* Windows [installation video](https://youtu.be/3Tg_RJhqZRg)
52+
See the documentation for detailed CadQuery [installation instructions](https://cadquery.readthedocs.io/en/latest/installation.html).
5553

54+
There are also videos covering installation:
5655

57-
There are two ways to install CadQuery and its dependencies. One is using conda, and the other is using pip. Pip is shown first below, followed by two sections on installing CadQuery via conda, and a non-intrusive way to install conda on a system. Note that conda is the better supported option.
58-
59-
### CadQuery Installation Via Pip
60-
61-
CadQuery has a complex set of dependencies including OCP, which is our set of bindings to the OpenCASCADE CAD kernel. OCP is distributed as binary wheels for Linux, MacOS and Windows. However, there are some limitations. Only Python 3.8 through 3.10 are currently supported, and some older Linux distributions such as Ubuntu 18.04 are not supported. If the pip installation method does not work for your system, you can try the conda installation method outlined in the next two sections.
56+
* Linux [installation video](https://youtu.be/sjLTePOq8bQ)
57+
* Windows [installation video](https://youtu.be/3Tg_RJhqZRg)
6258

63-
It is highly recommended that a virtual environment is used when installing CadQuery, although it is not strictly required. Installing CadQuery via pip requires a up-to-date version of pip, which can be obtained with the following command line (or a slight variation thereof).
64-
```
65-
python3 -m pip install --upgrade pip
66-
```
67-
Once a current version of pip is installed, CadQuery can be installed using the following command line.
68-
```
69-
pip install cadquery
70-
```
59+
There are two ways to install CadQuery and its dependencies. One is using conda, and the other is using pip. Note that conda is the better supported option.
7160

72-
It is also possible to install the very latest changes directly from CadQuery's GitHub repository, with the understanding that sometimes breaking changes can occur. To install from the git repository, run the following command line.
73-
```
74-
pip install git+https://github.com/CadQuery/cadquery.git
75-
```
61+
### CadQuery Installation Via Conda
7662

77-
You should now have a working CadQuery installation, but developers or users who want to use CadQuery with IPython/Jupyter or to set up a developer environment can read the rest of this section.
63+
To first install the Conda package manager see [Install the Conda Package Manager](https://cadquery.readthedocs.io/en/latest/installation#install-the-conda-package-manager).
7864

79-
If you are installing CadQuery to use with IPython/Jupyter, you may want to run the following command line to install the extra dependencies.
80-
```
81-
pip install cadquery[ipython]==2.2.0b2
82-
```
65+
The steps to install cadquery with conda are as follows:
8366

84-
If you want to create a developer setup to contribute to CadQuery, the following command line will install all the development dependencies that are needed.
85-
```
86-
pip install cadquery[dev]==2.2.0b2
87-
```
88-
89-
### CadQuery Installation Via Conda
90-
91-
conda is included as part of a [miniforge](https://github.com/conda-forge/miniforge) installation (other distributions can be used as well). See the next section for more details regarding conda. The steps to install cadquery are as follows:
9267
```
9368
# Set up a new environment
9469
conda create -n cadquery
9570
9671
# Activate the new environment
9772
conda activate cadquery
9873
99-
# CadQuery development is moving quickly, so it is best to install the latest version from GitHub master
74+
# Install the latest released version
75+
conda install -c conda-forge cadquery occt=7.7.0
76+
77+
# Or install the dev version to get the latest changes
10078
conda install -c conda-forge -c cadquery cadquery=master
10179
```
10280

103-
For those who are interested, the [OCP repository](https://github.com/CadQuery/OCP) contains the current OCCT wrapper used by CQ.
81+
### CadQuery Installation Via Pip
10482

105-
### Conda Installation
83+
CadQuery has a complex set of dependencies including OCP, which is our set of bindings to the OpenCASCADE CAD kernel. OCP is distributed as binary wheels for Linux, MacOS and Windows. However, there are some limitations. Only Python 3.8 through 3.10 are currently supported, and some older Linux distributions such as Ubuntu 18.04 are not supported. If the pip installation method does not work for your system, you can try the conda installation method.
10684

107-
For those unfamiliar (or uncomfortable) with conda, it is probably best to install Miniforge to a local directory and to avoid running `conda init`. After performing a local directory installation, Miniforge can be activated via the [scripts,bin]/activate scripts. This will help avoid polluting and breaking the local Python installation. In Linux, the local directory installation method looks something like this:
85+
It is highly recommended that a virtual environment is used when installing CadQuery, although it is not strictly required. Installing CadQuery via pip requires a up-to-date version of pip, which can be obtained with the following command line (or a slight variation thereof).
10886
```
109-
# Install the script to ~/miniforge
110-
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O miniforge.sh
111-
bash miniforge.sh -b -p $HOME/miniforge
112-
113-
# To activate and use Miniconda
114-
source $HOME/miniforge/bin/activate
87+
python3 -m pip install --upgrade pip
88+
```
89+
Once a current version of pip is installed, CadQuery can be installed using the following command line.
11590
```
116-
On Windows one can install locally as follows:
91+
pip install cadquery
11792
```
118-
:: Install
119-
curl -L -o miniforge.exe https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe
120-
start /wait "" miniforge.exe /InstallationType=JustMe /RegisterPython=0 /NoRegistry=1 /NoScripts=1 /S /D=%USERPROFILE%\Miniforge3
12193

122-
:: Activate
123-
cmd /K ""%USERPROFILE%/Miniforge3/Scripts/activate.bat" "%USERPROFILE%/Miniforge3""
94+
It is also possible to install the very latest changes directly from CadQuery's GitHub repository, with the understanding that sometimes breaking changes can occur. To install from the git repository, run the following command line.
12495
```
125-
You might want to consider using `/NoScripts=0` to have an activation shortcut added to the start menu.
96+
pip install git+https://github.com/CadQuery/cadquery.git
97+
```
98+
12699

127100
### CQ-editor GUI
128101

@@ -132,33 +105,19 @@ CQ-editor is an IDE that allows users to edit CadQuery model scripts in a GUI en
132105
* A CadQuery stack inspector.
133106
* Export to various formats, including STEP and STL, directly from the menu.
134107

135-
The installation instructions for CQ-editor can be found [here](https://github.com/CadQuery/CQ-editor#installation).
108+
More on CQ-editor:
109+
* [CQ-editor README](https://github.com/CadQuery/CQ-editor/blob/master/README.md)
110+
* [Installation](https://cadquery.readthedocs.io/en/latest/installation.html#adding-a-nicer-gui-via-cq-editor)
111+
136112

137113
<img src="https://raw.githubusercontent.com/CadQuery/CQ-editor/master/screenshots/screenshot3.png" alt="CQ editor screenshot" width="800"/>
138114

139115
### Jupyter
140116

141-
CadQuery supports Jupyter notebook out of the box using the jupyter-cadquery extension created by @bernhard-42:
142-
143-
* [Installation](https://github.com/bernhard-42/jupyter-cadquery#installation)
144-
* [Usage](https://github.com/bernhard-42/jupyter-cadquery#jupyter-cadquery)
145-
146-
<img src="https://raw.githubusercontent.com/bernhard-42/jupyter-cadquery/master/screenshots/0_intro.png" alt="CadQuery Jupyter extension screenshot" width="800"/>
117+
CadQuery supports Jupyter out-of-the-box. Run your CadQuery code in the notebook and visualize the model by calling ```display(<CadQuery object>)```.
147118

148-
### Docker
119+
* [JupyterLab installation](https://cadquery.readthedocs.io/en/latest/installation.html#jupyter).
149120

150-
A list of Docker images can be found [here](https://github.com/RubenRubens/cq-containers), and includes images for the following projects.
151-
* [Core CadQuery library](https://github.com/RubenRubens/cq-containers/tree/master/cq-conda), which allows users to run CadQuery Python scripts without a GUI.
152-
* [cq-cli](https://github.com/RubenRubens/cq-containers/tree/master/cq-cli), a command line utility which is used to export the results of a CadQuery script to an output format (i.e. STL, STEP).
153-
* [jupyter-cadquery](https://github.com/bernhard-42/jupyter-cadquery#b-using-a-docker-image), makes CadQuery accessible through Jupyter Labs and provides a web-based GUI. This is currently the only image that provides a GUI.
154-
155-
### Standalone Stable Version
156-
157-
CadQuery was built to be used as a Python library without any GUI. This makes it great for use cases such as integration into servers, or creating scientific and engineering scripts. Use Anaconda/Miniconda to install CadQuery, and then add `import cadquery` to the top of your Python scripts. If the stable version of CadQuery is desired, the following command will install it. However, be aware that the stable version can fall significantly behind the current state of CadQuery, so in many cases the `master` installation method at the beginning of the Getting Started section is preferable.
158-
159-
```
160-
conda install -c conda-forge -c cadquery cadquery=2
161-
```
162121

163122
## Getting help
164123

@@ -186,7 +145,7 @@ Hexidor is an expanded take on the Quoridor board game, and the development proc
186145

187146
### Spindle assembly
188147

189-
Thanks to @marcus7070 for this example from [here](https://github.com/marcus7070/spindle-assy-example).
148+
Thanks to @marcus7070 for this example from [here](https://github.com/marcus7070/spindle-assy-example).
190149

191150
<img src="./doc/_static/assy.png" width="400">
192151

0 commit comments

Comments
 (0)