Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 1.39 KB

slice_model.md

File metadata and controls

23 lines (17 loc) · 1.39 KB

3. Slice model

This step is also mostly ported and refactored from the first CuraEngine commit.

It is responsible for the actual slicing of the model into slices at different heights.

To do this for each height the faces are sliced into segments (lines).
This is done in slicer.go which calls SliceFace in segment.go.

After that the loose segments have to be connected together to several polygons and holes of polygons:

  1. connect segments which have the exact same points
  2. sometimes there are small spaces between the points. If it the space is small enough it is just skipped and the segments are also connected together.
  3. also it is possible that some poligons are nearly closed or two half polygons nearly can be connected to one. Then they are just closed.
  4. at the end all not yet closed or too small polygons are just removed.

All this happens in the method makePolygons in layer.go.

As last step the LayerParts are generated for each layer out of the polygons. This happens using the method GenerateLayerParts in clip.go.
It basically just calls the clipper lib which groups the polygons together and calculates which one are polygons and which one are holes. (Note: polygons go counter-clockwise, holes go clockwise.)