-
Notifications
You must be signed in to change notification settings - Fork 70
InternalOverview
The MatterSlice engine derives its current structure from the CuraEngine, although it is organized following dotNet practices and some effort were done for using more meaningful names in some places.
This description is based on the original CuraEngine description and some examination of the code.
The global structure is:
- The command line is processed to know what to do. (main.cs)
- The settings are loaded up. (Settings.cs)
- The STL is loaded (modelFile.cs)
- The FFF processor is run on to do the processing (fffProcessor.cs)
the fffProcessor slice the source file following these steps:
- Load 3D model (see ModelLoading).
- Analyse and fix 3D model (see ModelOptimization).
- Slice 3D model into 2D layers (see Slicing).
- Build LayerParts from sliced layers (see LayerPartsGeneration).
- Generate Insets (see InsetsGeneration).
- Generate up/down skins areas (see SkinGeneration).
- Generate sparse infill areas (see SkinGeneration).
- Generate GCode for each layer (see GCodeGeneration).
Each step has more logic in it. But this is a general overview. All data for the engine is stored in the "sliceDataStorage". It's important to remember that only the data from the previous step is valid.
Coordinates are stored in 64bit integers as microns in the code. So if you see a value of 1000 then this mean 1mm of distance. This is because Clipper works on 64bit integers and microns give a high enough resolution without limiting the size too much. Note that there are some bits and pieces of code that need to be careful about 64bit overflows, especially calculating lengths sqrt(xx+yy) can cause overflows.