Skip to content

Commit d93e593

Browse files
committed
add dev instructions
1 parent 8ad1707 commit d93e593

File tree

6 files changed

+206
-39
lines changed

6 files changed

+206
-39
lines changed

README.md

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,70 @@ and can be installed using `conda`.
2020
conda create -n cgal -c conda-forge compas compas_cgal --yes
2121
```
2222

23+
## Dev Install
24+
25+
Create a development environment with the required dependencies using `conda`
26+
and compile and install an editable version of `compas_cgal` using `setuptools`.
27+
28+
**Windows**:
29+
30+
```bash
31+
conda create -n cgal-dev python=3.8 mpir mpfr boost-cpp eigen=3.3 cgal-cpp=5.2 pybind11 compas compas_view2 --yes
32+
conda activate cgal-dev
33+
git clone https://github.com/compas-dev/compas_cgal
34+
cd compas_cgal
35+
pip install -e .
36+
```
37+
38+
**Mac**:
39+
40+
```bash
41+
conda create -n cgal-dev python=3.8 gmp mpfr boost-cpp eigen=3.3 cgal-cpp=5.2 pybind11 compas compas_view2 --yes
42+
conda activate cgal-dev
43+
git clone https://github.com/compas-dev/compas_cgal
44+
cd compas_cgal
45+
pip install -e .
46+
```
47+
48+
> Note that the version of eigen is important and should be `3.3`.
49+
50+
To add a new c++ module to the Python wrapper, or to exclude some of the existing modules during development
51+
you can modify the list of extension modules in `setup.py`.
52+
53+
```python
54+
ext_modules = [
55+
Extension(
56+
'compas_cgal._cgal',
57+
sorted([
58+
'src/compas_cgal.cpp',
59+
'src/compas.cpp',
60+
'src/meshing.cpp',
61+
'src/booleans.cpp',
62+
'src/slicer.cpp',
63+
'src/intersections.cpp',
64+
'src/measure.cpp',
65+
]),
66+
include_dirs=[
67+
'./include',
68+
get_eigen_include(),
69+
get_pybind_include()
70+
],
71+
library_dirs=[
72+
get_library_dirs(),
73+
],
74+
libraries=['mpfr', 'gmp'],
75+
language='c++'
76+
),
77+
]
78+
```
79+
2380
## Usage
2481

2582
The provided functionality can be used directly from the `compas_cgal` package
2683
or from `compas.geometry` through the plugin mechanism in COMPAS.
2784

2885
For examples, see <https://compas.dev/compas_cgal/latest/examples.html>.
2986

30-
## Contribute
31-
32-
See [CONTRIBUTING](CONTRIBUTING.md) for more information.
33-
3487
## License
3588

3689
`compas_cgal` is released under the LGPL 3.0 to be compatible with the license of CGAL.

docs/gettingstarted.rst

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Documentation of COMPAS CGAL
77
:titlesonly:
88

99
Introduction<self>
10-
gettingstarted
10+
installation
11+
tutorial
1112
examples
1213
api
1314
license

docs/installation.rst

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
********************************************************************************
2+
Installation
3+
********************************************************************************
4+
5+
Stable
6+
======
7+
8+
Stable releases of :mod:`compas_cgal` can be installed via ``conda-forge``.
9+
10+
.. code-block:: bash
11+
12+
conda create -n cgal -c conda-forge compas compas_cgal --yes
13+
conda activate cgal
14+
15+
16+
Optional
17+
========
18+
19+
Several examples use COMPAS View2 for visualisation outside of CAD environments.
20+
To install :mod:`compas_view2` in the same environment
21+
22+
.. code-block:: bash
23+
24+
conda install compas_view2 --yes
25+
26+
Or everything in one go
27+
28+
.. code-block:: bash
29+
30+
conda create -n cgal -c conda-forge compas compas_cgal compas_view2 --yes
31+
32+
33+
Dev Install
34+
===========
35+
36+
A local development version can be set up using a combination of ``conda`` and ``pip``.
37+
First, clone the :mod:`compas_cgal` repo.
38+
39+
.. code-block:: bash
40+
41+
git clone https://github.com/compas-dev/compas_cgal
42+
43+
44+
Create an environment with all the required dependencies.
45+
46+
.. raw:: html
47+
48+
<div class="card">
49+
<div class="card-header">
50+
<ul class="nav nav-tabs card-header-tabs">
51+
<li class="nav-item">
52+
<a class="nav-link active" data-toggle="tab" href="#dev_windows">Windows</a>
53+
</li>
54+
<li class="nav-item">
55+
<a class="nav-link" data-toggle="tab" href="#dev_unix">OSX / Linux</a>
56+
</li>
57+
</ul>
58+
</div>
59+
<div class="card-body">
60+
<div class="tab-content">
61+
62+
.. raw:: html
63+
64+
<div class="tab-pane active" id="dev_windows">
65+
66+
.. code-block:: bash
67+
68+
conda create -n cgal-dev python=3.8 mpir mpfr boost-cpp eigen=3.3 cgal-cpp=5.2 pybind11 compas compas_view2 --yes
69+
70+
.. raw:: html
71+
72+
</div>
73+
<div class="tab-pane" id="dev_unix">
74+
75+
.. code-block:: bash
76+
77+
conda create -n cgal-dev python=3.8 mpir mpfr boost-cpp eigen=3.3 cgal-cpp=5.2 pybind11 compas compas_view2 --yes
78+
79+
.. raw:: html
80+
81+
</div>
82+
83+
.. raw:: html
84+
85+
</div>
86+
</div>
87+
</div>
88+
89+
Activate the environment.
90+
91+
.. code-block:: bash
92+
93+
conda activate cgal-dev
94+
95+
96+
Change to the root folder of the :mod:`compas_cgal` repo.
97+
98+
.. code-block:: bash
99+
100+
cd compas_cgal
101+
102+
103+
And compile the code while creating an editable install of the python wrapper using ``setuptools``.
104+
105+
.. code-block:: bash
106+
107+
pip install -e .
108+
109+
110+
To add your c++ module to the wrapper, and potentially exclude some of the existing modules during its development,
111+
modify the list of extension modules in the ``setup.py`` file.
112+
113+
.. code-block:: python
114+
115+
ext_modules = [
116+
Extension(
117+
'compas_cgal._cgal',
118+
sorted([
119+
'src/compas_cgal.cpp',
120+
'src/compas.cpp',
121+
'src/meshing.cpp',
122+
'src/booleans.cpp',
123+
'src/slicer.cpp',
124+
'src/intersections.cpp',
125+
'src/measure.cpp',
126+
]),
127+
include_dirs=[
128+
'./include',
129+
get_eigen_include(),
130+
get_pybind_include()
131+
],
132+
library_dirs=[
133+
get_library_dirs(),
134+
],
135+
libraries=['mpfr', 'gmp'],
136+
language='c++'
137+
),
138+
]

docs/tutorial.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
********************************************************************************
2+
Tutorial
3+
********************************************************************************

requirements-dev.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
autopep8
22
attrs >=17.4
3-
bump2version >=0.5.11
3+
bump2version >=1.0.1
44
check-manifest >=0.36
55
doc8
66
flake8
7+
graphviz
78
invoke >=0.14
89
ipykernel
910
ipython >=5.8
1011
isort
11-
m2r
12+
m2r2
1213
nbsphinx
1314
pydocstyle
1415
pytest >=3.2
15-
sphinx_autodoc_typehints
16-
sphinx_compas_theme >=0.11.2
17-
sphinx >=1.6, <2.4.4
16+
sphinx_compas_theme >=0.13
17+
sphinx >=3.4
1818
twine
19+
wheel
1920
-e .

0 commit comments

Comments
 (0)