Concepts¶
Understanding the theory and architecture behind COMPAS Slicer.
Overview¶
These guides explain how COMPAS Slicer works - the data structures, algorithms, and design decisions that power the library.
-
Architecture
Core data structures and pipeline flow - from mesh to G-code.
-
Slicing Algorithms
How planar, curved, and scalar field slicing work under the hood.
-
Print Organization
Transforming geometry into fabrication-ready toolpaths.
Quick Reference¶
The Pipeline¶
Key Classes¶
| Class | Purpose |
|---|---|
Layer |
One slice containing paths |
Path |
Single contour (closed or open) |
PrintPoint |
Point with fabrication data |
PlanarSlicer |
Horizontal plane slicing |
InterpolationSlicer |
Curved slicing between boundaries |
PlanarPrintOrganizer |
Generate printpoints from planar paths |
Typical Workflow¶
from compas.datastructures import Mesh
from compas_slicer.slicers import PlanarSlicer
from compas_slicer.print_organization import PlanarPrintOrganizer
# 1. Load
mesh = Mesh.from_obj("model.obj")
# 2. Slice
slicer = PlanarSlicer(mesh, layer_height=0.4)
slicer.generate_paths()
# 3. Organize
organizer = PlanarPrintOrganizer(slicer)
organizer.create_printpoints()
# 4. Export
gcode = organizer.output_gcode()