Skip to content

Commit 1f5109f

Browse files
author
ioannam
committed
Updated documentation and fixed lint errors
1 parent c2a6190 commit 1f5109f

File tree

4 files changed

+46
-82
lines changed

4 files changed

+46
-82
lines changed

README.md

Lines changed: 6 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -5,86 +5,23 @@
55
[![PyPI - Latest Release](https://img.shields.io/pypi/v/COMPAS-SLICER.svg)](https://pypi.python.org/project/COMPAS-SLICER)
66
[![DOI](https://zenodo.org/badge/226364384.svg)](https://zenodo.org/badge/latestdoi/226364384)
77

8-
9-
10-
Slicing package for FDM 3D Printing with COMPAS.
11-
8+
Python slicing package for FDM 3D Printing based on the [COMPAS](https://block.arch.ethz.ch/brg/tools/compas-computational-framework-for-collaboration-and-research-in-architecture-structures-and-digital-fabrication) framework.
129

1310
## Main features
1411

1512
* Planar slicing (default method, and method based on Cgal library)
1613
* Curved slicing (interpolation of boundaries, UV slicing, scalar field slicing)
1714
* Generation of fabrication-related information
18-
* Export print data to Json and gcode formats
15+
* Export print data to Json and gcode format
16+
* Visualization of results in grasshopper
1917

2018
## Getting started
2119

22-
### Step 1: Installation
23-
24-
The recommended way to install `compas_slicer` is with [conda](https://conda.io/docs/).
25-
For example, create an environment named ``my-project`` (or replace with your own environment name) and install as follows:
26-
27-
conda config --add channels conda-forge
28-
conda create -n my-project compas_slicer
29-
30-
### Step 2: Optional installation steps
31-
32-
#### COMPAS Viewers
33-
34-
Follow the instructions to install `compas_view2` (https://github.com/compas-dev/compas_view2).
35-
36-
#### COMPAS CGAL (for planar slicing)
37-
38-
conda install -n my-project compas_cgal
39-
40-
#### LIBIGL python bindings (for curved slicing)
41-
42-
conda install -c conda-forge igl
43-
44-
#### Grasshopper
45-
46-
The Grasshopper components are automatically installed with the `compas_rhino` installation, e.g.:
47-
48-
conda activate my-project
49-
python -m compas_rhino.install -v 6.0
50-
51-
### Step 3. Test if the library works
52-
53-
Activate your environment and run the following command:
54-
55-
conda activate my-project
56-
python -m compas_slicer
57-
58-
Enjoy!
59-
60-
## Troubleshooting
61-
62-
See here: https://compas.dev/compas_slicer/installation.html#troubleshooting-1
63-
64-
## Contributions
65-
66-
Before contributing code:
67-
68-
- Install development dependencies:
69-
```bash
70-
pip install -r requirements-dev.txt
71-
```
72-
73-
- Make sure all tests pass:
74-
```bash
75-
invoke test
76-
```
77-
78-
- Make sure you pass flake8 tests. (hint: This is the most annoying part of the process)
79-
```bash
80-
invoke lint
81-
```
82-
83-
- Add an example on the examples folder that uses the new functionality. Run the example and make sure it works smoothly.
20+
You can find tutorials and documentation of the project in the [compas_slicer page](https://compas.dev/compas_slicer/latest/)
8421

85-
- Create a pull request for the master branch, where you explain in detail what you fixed. When you create a pull request, there is an automatic action that runs the tests for your code again on the server.
86-
Make sure the pull request passes the automatic tests as well. If not, then inspect the result, find what went wrong, fix it, and push again the result on your branch. The action will run again automatically on the open pull request.
22+
For installation instructions, see here: [installation](https://compas.dev/compas_slicer/latest/installation.html)
8723

24+
For troubleshooting, see here: [troubleshooting](https://compas.dev/compas_slicer/installation.html#troubleshooting-1)
8825

8926
## Authors
9027

docs/installation.rst

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ COMPAS_SLICER can be easily installed on multiple platforms.
1111
Basic installation steps
1212
========================
1313

14-
Step 1: Install compas slicer
14+
Install compas slicer
1515
-----------------------------
1616

1717

@@ -32,7 +32,7 @@ For example, create an environment named ``my-project`` (or replace with your ow
3232
conda install -c conda-forge compas_cgal
3333
3434
35-
* Grasshopper
35+
* Install Grasshopper components
3636

3737
The Grasshopper components are automatically installed with the `compas_rhino` installation, e.g.:
3838

@@ -42,8 +42,7 @@ The Grasshopper components are automatically installed with the `compas_rhino` i
4242
python -m compas_rhino.install -v 7.0
4343
4444
45-
Step 4. Test if the library works
46-
---------------------------------
45+
* Test if the library works
4746

4847
Activate your environment and run the following command:
4948

@@ -55,6 +54,36 @@ Activate your environment and run the following command:
5554
Enjoy!
5655

5756

57+
58+
Contributions
59+
===============
60+
61+
Before contributing code:
62+
63+
- Install development dependencies:
64+
65+
.. code-block:: bash
66+
pip install -r requirements-dev.txt
67+
68+
- Make sure all tests pass:
69+
.. code-block:: bash
70+
invoke test
71+
72+
- Make sure you pass flake8 tests. (hint: This is the most annoying part of the process)
73+
.. code-block:: bash
74+
invoke lint
75+
76+
- Add your code in the appropriate folder. If you are not sure where to put it, contact [@ioannaMitropoulou](https://github.com/ioannaMitropoulou).
77+
78+
- Add an example on the examples folder that uses the new functionality. Run the example and make sure it works smoothly.
79+
80+
- Add your name to the authors in README.md.
81+
82+
- Create a pull request for the master branch, where you explain in detail what you fixed. When you create a pull request, there is an automatic action that runs the tests for your code again on the server.
83+
Make sure the pull request passes the automatic tests as well. If not, then inspect the result, find what went wrong, fix it, and push again the result on your branch. The action will run again automatically on the open pull request.
84+
85+
86+
5887
Troubleshooting
5988
===============
6089

src/compas_slicer/print_organization/base_print_organizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import compas_slicer
22
import logging
3-
from compas.geometry import Vector, Polyline, distance_point_point, norm_vector, normalize_vector, subtract_vectors, \
3+
from compas.geometry import Vector, distance_point_point, norm_vector, normalize_vector, subtract_vectors, \
44
cross_vectors, scale_vector
55
from compas.utilities import pairwise
66
import numpy as np

src/compas_slicer/print_organization/interpolation_print_organizer.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self, slicer, parameters, DATA_PATH):
4646
if len(self.vertical_layers) > 1:
4747
try:
4848
self.topological_sorting()
49-
except AssertionError as e:
49+
except AssertionError:
5050
logger.exception("topology sorting failed\n")
5151
logger.critical("integrity of the output data ")
5252
# TODO: perhaps its better to be even more explicit and add a
@@ -89,13 +89,11 @@ def create_base_boundaries(self):
8989
else:
9090
bs.append(root_boundary)
9191
else:
92-
logger.critical("""no topology graph was created, no base boundaries created,
93-
output will be degenerated.
94-
95-
a likely cause for topology sorting to fail is that
96-
non-continuous paths were created. When creating paths with variable
97-
layer heights, it may very well be that the non-continuous paths are
98-
created, while this is not yet a supported feature""")
92+
logger.critical("""no topology graph was created, no base boundaries created,
93+
output will be degenerated. A likely cause for topology sorting to fail is that
94+
non-continuous paths were created. When creating paths with variable
95+
layer heights, it may very well be that the non-continuous paths are
96+
created, while this is not yet a supported feature""")
9997

10098
# save intermediary outputs
10199
b_data = {i: b.to_data() for i, b in enumerate(bs)}

0 commit comments

Comments
 (0)