Skip to content

Commit 145ee0a

Browse files
authored
Merge pull request #151 from compas-dev/bug_fixes_joris
Added sort_paths_minimum_travel_time, some bug fixes and documentation updates. Should bump to 0.4.0
2 parents 2f46d42 + 1509d32 commit 145ee0a

File tree

24 files changed

+315
-98
lines changed

24 files changed

+315
-98
lines changed

CHANGELOG.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,25 @@ Unreleased
1111

1212
**Added**
1313
* Documentation updates
14-
* rdp libigl function
14+
* rdp libigl function (faster than the regular rdp)
15+
* sort_paths_minimum_travel_time: Function to sort paths by least travel time between contours in a layer
1516

1617
**Changed**
18+
* Changed the blend radius to add a blend radius of 0 for the first and last point of a path
19+
* Changed planar_slicing_cgal to add the possibility of slicing open paths with planar_slicing_cgal
20+
* Added the option to toggle generation of mesh normals on/off in create_printpoints
21+
* Added the possibility to slice only a certain section of the geometry by using slice_height_range in the PlanarSlicer
1722

1823
**Fixed**
24+
* Fixed some bugs in seams_align
25+
* Small bug in extruder_toggle
26+
* Small bug in simplify_paths_rdp_igl with printing remaining no of points
27+
* Bug in seams_smooth
1928

2029
**Deprecated**
2130

31+
* close_paths in the BaseSlicer is unused for now, as it should not be necessary
32+
2233
**Removed**
2334

2435
0.3.5

docs/examples/06_attributes_transfer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _compas_slicer_example_6:
22

3-
************************************
3+
**************************************
44
Transferring attributes to PrintPoints
5-
************************************
5+
**************************************
66

77
Often in 3D printing we need to transfer information from the mesh that is being sliced to the PrintPoints that
88
are used in the fabrication process. We might want, for example, to print paths that are generated from different parts of

docs/installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Basic installation steps
1212
========================
1313

1414
Step 1: Install compas slicer
15-
------------------------------
15+
-----------------------------
1616

1717

1818
The recommended way to install `compas_slicer` is with `conda <https://conda.io/docs/>`_.
@@ -25,7 +25,7 @@ For example, create an environment named ``my-project`` (or replace with your ow
2525
2626
2727
Step 2: Optional installation steps
28-
------------------------------------
28+
-----------------------------------
2929

3030
* COMPAS Viewers
3131

@@ -109,7 +109,7 @@ Make sure you are in the correct environment and type:
109109
pip install numpy==1.19.3
110110
111111
Fractions error
112-
-----------
112+
---------------
113113
.. code-block:: bash
114114
115115
ImportError: cannot import name 'gcd' from 'fractions' (C:\ProgramData\Anaconda3\envs\compas_slicer\lib\fractions.py)

docs/tutorials/01_introduction.rst

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,68 @@
44
Introduction
55
****************************
66

7-
* General overview of the pipeline
7+
Overview
8+
========
89

9-
* Geometry classes organization
10+
The COMPAS SLICER package broadly contains four blocks of code:
1011

11-
* Brief explanation of the organization of the remaining functionality (ex. what is pre-processing, what is post-processing ..)
12+
* **Geometry:** contains all geometrical entities
13+
* **Slicers:** provides the functionality that generates the sliced model
14+
* **Print organizers:** provides the functionality for embedding fabrication related information to the sliced model
15+
* **Visualization:** visualizes the results
1216

13-
* Folder structure of examples
17+
Geometry
18+
--------
1419

15-
* overview of slicers
20+
The geometry part of COMPAS SLICER contains all of the geometrical entities that are specific to COMPAS SLICER:
21+
The ``Layer``, ``VerticalLayer``, ``Path``, and ``PrintPoint``. A ``Layer`` is essentially a single slice of the model.
22+
In case of planar slicing, all points on one ``Layer`` are at the same height, however, this is not the case for non-planar slicing.
23+
A ``VerticalLayer`` is a special method for organizing layers, in this case several ``Layers`` are grouped together to form a
24+
group of layers. The ``VerticalLayer`` is only relevant in case a model consists out of multiple ``Paths``.
25+
A ``Layer`` contains a list of one or mulitple ``Paths``. Multiple ``Paths`` occur when a model has multiple branches (see image).
26+
Each ``Path`` is a closed or open contour and contains a list of ``compas.geometry.Point`` objects.
27+
Lastly, the ``PrintPoint`` is essentially the same as the Points in the ``Path``, however, it contains additional fabrication parameters.
1628

17-
* Reference to the 2 examples for further info
29+
.. figure:: intro_figures/01_layer.png
30+
:figclass: figure
31+
:class: figure-img img-fluid
1832

19-
* Reference to gh visualization tutorial for further info.
33+
.. figure:: intro_figures/02_vert_layer.png
34+
:figclass: figure
35+
:class: figure-img img-fluid
36+
37+
Slicers
38+
--------
39+
40+
Different slicers are integrated into COMPAS SLICER.
41+
42+
* **Planar slicer:** Most basic slicer, slices the model through an intersection of a plane parallel to the XY plane.
43+
* **Interpolation slicer:** Creates non-planar slices by interpolating between boundary curves.
44+
* **Scalar field slicer:** Uses a scalar field to create non-planar slices.
45+
* **UV slicer:** TBA.
46+
47+
Print organizers
48+
----------------
49+
50+
After the model is sliced using one of the available slicers, the toolpath can be generated using the PrintOrganizers.
51+
The ``PrintOrganizer`` creates ``PrintPoint`` objects out of the ``compas.geometry.Point`` objects that are used throughout the slicing process.
52+
Using different functions, fabrication parameters can be added or modified to the ``PrintPoints``. Examples of this include:
53+
setting the velocity, setting the blend radius, or adding safety printpoints (z-hop).
54+
55+
Visualization
56+
-------------
57+
58+
Both the Slicer output and the PrintOrganizer output can be visualized in different ways. These are described in Tutorial 2.
59+
60+
Folder structure
61+
================
62+
63+
The functions of COMPAS SLICER are grouped into different folders:
64+
65+
* **geometry:**
66+
* **parameters:** Contains functions for interacting with the parameters of the slicing and print organization process.
67+
* **post_processing:** Various functions that are used *after* a model is sliced, such as different methods of sorting, or adding a brim/raft.
68+
* **pre_processing:** Various functions that are used *before slicing a model*, such as repositioning, or various operations for curved slicing.
69+
* **print_organization:**
70+
* **slicers:**
71+
* **utilities:**
366 KB
Loading
416 KB
Loading

examples/1_planar_slicing_simple/example_1_planar_slicing_simple.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from compas_slicer.post_processing import generate_raft
1010
from compas_slicer.post_processing import simplify_paths_rdp_igl
1111
from compas_slicer.post_processing import seams_smooth
12+
from compas_slicer.post_processing import seams_align
1213
from compas_slicer.print_organization import PlanarPrintOrganizer
1314
from compas_slicer.print_organization import set_extruder_toggle
1415
from compas_slicer.print_organization import add_safety_printpoints
@@ -45,7 +46,7 @@ def main():
4546
# ==========================================================================
4647
# Move to origin
4748
# ==========================================================================
48-
move_mesh_to_point(compas_mesh, Point(0, 0, 0))
49+
# move_mesh_to_point(compas_mesh, Point(0, 0, 0))
4950

5051
# ==========================================================================
5152
# Slicing
@@ -56,6 +57,8 @@ def main():
5657
slicer = PlanarSlicer(compas_mesh, slicer_type="cgal", layer_height=1.5)
5758
slicer.slice_model()
5859

60+
seams_align(slicer, "next_path")
61+
5962
# ==========================================================================
6063
# Generate brim / raft
6164
# ==========================================================================
3.39 KB
Binary file not shown.
-2.18 KB
Binary file not shown.
1.83 KB
Binary file not shown.

0 commit comments

Comments
 (0)