Skip to content

Architecture

Erwan MATHIEU edited this page Jan 15, 2024 · 1 revision

This document details the hierarchical structure of the classes used during slicing:

classDiagram
Application *-- "0..1" Communication : communication_
Application *-- "0..1" ThreadPool : thread_pool_
Application o-- "0..1" Slice : current_slice_
Application : #slice
<<singleton>> Application

Communication
<<abstract>> Communication

ArcusCommunication --|> Communication

CommandLineCommunication --|> Communication

Slice *-- "1" Scene : scene
Slice : +compute()
Slice : +reset()

Scene *-- "1" Settings : settings
Scene *-- "*" MeshGroup : mesh_groups
Scene *-- "*" ExtruderTrain : extruders
Scene : +processMeshGroup(MeshGroup)

MeshGroup *-- "1" Settings : settings
MeshGroup *-- "*" Mesh : meshes
MeshGroup : +finalize()
MeshGroup : +clear()

ExtruderTrain *-- "1" Settings : settings_

FffProcessor *-- "1" FffGCodeWriter : gcode_writer
FffProcessor *-- "1" FffPolygonGenerator : polygon_generator
FffProcessor : +setTargetFile(filename)
FffProcessor : +setTargetStream(stream)
FffProcessor : +getTotalFilamentUsed(extruder_nr) double
FffProcessor : +getTotalPrintTimePerFeature() vector~Duration~
FffProcessor : +finalize()
<<singleton>> FffProcessor

FffGCodeWriter *-- "1" LayerPlanBuffer : layer_plan_buffer
FffGCodeWriter *-- "1" GCodeExport : gcode
FffGCodeWriter : +setTargetFile(filename)
FffGCodeWriter : +setTargetStream(stream)
FffGCodeWriter : +getTotalFilamentUsed(extruder_nr) double
FffGCodeWriter : +getTotalPrintTimePerFeature() vector~Duration~
FffGCodeWriter : +writeGCode(storage, timeKeeper)

FffPolygonGenerator : +generateAreas(storage, object, timeKeeper) bool

LayerPlanBuffer o-- "*" LayerPlan : buffer_
LayerPlanBuffer : +setPreheatConfig()
LayerPlanBuffer : +push(layer_plan)
LayerPlanBuffer : +handle(layer_plan, gcode)
LayerPlanBuffer : +flush()

LayerPlan *-- "1..*" ExtruderPlan : extruder_plans_

ExtruderPlan *-- "*" GCodePath : paths_
ExtruderPlan *-- "*" NozzleTempInsert : inserts_
Loading

We can see 2 main trees:

  • The Application is the root that contains all the data structures, especially the Scene with the objects that need to be printed, and their settings
  • The FffProcessor singleton contains the objects doing the actual slicing and conversion to GCode

The Scene Hierarchy


A number of slices can be queued up to be processed. Each slice contains their own scene, which represents the build plate full of objects that are supposed to be printed.

Each scene contains a number of mesh groups as well as a number of extruders. These mesh groups are processed one at a time. For each of the mesh groups the same set of extruders are used. A mesh group contains a number of meshes.

This scene is built by the communication class (whichever one is active).