Skip to content

Commit 9e9b452

Browse files
Change conda related sections in the README and the docs (#980)
* Started assy solver refactoring * First working version * Added validation +initial work on FixedPoint * Fixed tests * Unary constraints support and finish Fixed Point * Added Fixed and FixedAxis * Changed the locking logic * Test for unary constraints * Update cadquery/occ_impl/solver.py Co-authored-by: Marcus Boyd <[email protected]> * Simple validation test * Change conda related section * Update docs * Quickstart update * Fix typo * Correct curl line * Correct curl line in the docs * PointOnLine constraint * PointOnLine test * FixedRotation and FixedRotationAxis * FixedRotation test * Describe PointOnLine * Add new constraints to the docs * Use gp_Intrinsic_XYZ * Typos+clarification Co-authored-by: Marcus Boyd <[email protected]>
1 parent 23de5cc commit 9e9b452

File tree

4 files changed

+43
-11
lines changed

4 files changed

+43
-11
lines changed

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ It is currently possible to use CadQuery for your own projects in 3 different wa
4444
* Linux [installation video](https://youtu.be/sjLTePOq8bQ)
4545
* Windows [installation video](https://youtu.be/3Tg_RJhqZRg)
4646

47-
The easiest way to install CadQuery and its dependencies is using conda, which is included as part of an Anaconda/Miniconda installation. See the next section for an alternative to a full install of Anaconda that may be preferable to some users. The steps to install cadquery are as follows:
47+
The easiest way to install CadQuery and its dependencies is using conda, which 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:
4848
```
4949
# Set up a new environment
5050
conda create -n cadquery
@@ -58,17 +58,27 @@ conda install -c conda-forge -c cadquery cadquery=master
5858

5959
For those who are interested, the [OCP repository](https://github.com/CadQuery/OCP) contains the current OCCT wrapper used by CQ.
6060

61-
### Alternative Anaconda Installation Method
61+
### Conda Installation
6262

63-
For those unfamiliar (or uncomfortable) with Anaconda, it is probably best to install Miniconda to a local directory and to avoid running `conda init`. After performing a local directory installation, Miniconda 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:
63+
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:
6464
```
65-
# Install the script to ~/miniconda
66-
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
67-
bash miniconda.sh -b -p $HOME/miniconda
65+
# Install the script to ~/miniforge
66+
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O miniforge.sh
67+
bash miniforge.sh -b -p $HOME/miniforge
6868
6969
# To activate and use Miniconda
70-
source $HOME/miniconda/bin/activate
70+
source $HOME/miniforge/bin/activate
7171
```
72+
On Windows one can install locally as follows:
73+
```
74+
:: Install
75+
curl -L -o miniforge.exe https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe
76+
start /wait "" miniforge.exe /InstallationType=JustMe /RegisterPython=0 /NoRegistry=1 /NoScripts=1 /S /D=%USERPROFILE%\Miniforge3
77+
78+
:: Activate
79+
cmd /K ""%USERPROFILE%/Miniforge3/Scripts/activate.bat" "%USERPROFILE%/Miniforge3""
80+
```
81+
You might want to consider using `/NoScripts=0` to have an activation shortcut added to the start menu.
7282

7383
### CQ-editor GUI
7484

cadquery/assembly.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,10 @@ def solve(self) -> "Assembly":
383383
locked.append(ents[b])
384384
break
385385

386+
# Lock the first occuring entity if needed.
387+
if not locked:
388+
locked.append(0)
389+
386390
locs = [self.objects[n].loc for n in ents]
387391

388392
# construct the constraint mapping

doc/installation.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,27 @@ CadQuery 2 is based on
77
`OCP <https://github.com/CadQuery/OCP>`_,
88
which is a set of Python bindings for the open-source `OpenCascade <http://www.opencascade.com/>`_ modelling kernel.
99

10-
Anaconda or Miniconda (Python 3.x editions), Python 3.x
10+
Conda
1111
----------------------------------------------
12-
CadQuery requires OCP and Python version 3.x
12+
In principle any conda distrubtion will work, but it is probably best to install `Miniforge <https://github.com/conda-forge/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/MacOS, the local directory installation method looks something like this::
13+
14+
# Install the script to ~/miniforge
15+
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O miniforge.sh
16+
bash miniforge.sh -b -p $HOME/miniforge
17+
18+
# To activate and use Miniconda
19+
source $HOME/miniforge/bin/activate
20+
21+
On Windows one can install locally as follows::
22+
23+
:: Install
24+
curl -L -o miniforge.exe https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe
25+
start /wait "" miniforge.exe /InstallationType=JustMe /RegisterPython=0 /NoRegistry=1 /NoScripts=1 /S /D=%USERPROFILE%\Miniforge3
26+
27+
:: Activate
28+
cmd /K ""%USERPROFILE%/Miniforge3/Scripts/activate.bat" "%USERPROFILE%/Miniforge3""
29+
30+
It might be worthwhile to consider using ``/NoScripts=0`` to have an activation shortcut added to the start menu.
1331

1432
Command Line Installation
1533
------------------------------------------

doc/quickstart.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ CadQuery QuickStart
88

99
Want a quick glimpse of what CadQuery can do? This quickstart will demonstrate the basics of CadQuery using a simple example
1010

11-
Prerequisites: Anaconda/Miniconda + CQ-editor running from an environment
11+
Prerequisites: conda + CQ-editor running from an environment
1212
==============================================================
1313

14-
If you have not already done so, follow the :ref:`installation`, to install Anaconda/Miniconda and CQ-editor.
14+
If you have not already done so, follow the :ref:`installation`, to install conda and CQ-editor.
1515

1616
After installation, run CQ-editor:
1717

0 commit comments

Comments
 (0)