PETG material properties in 3D Printing - Time & Space Complexity
When working with PETG in 3D printing, it's helpful to understand how the time to print changes as the size or complexity of the object grows.
We want to know how the printing time scales when using PETG material.
Analyze the time complexity of the following 3D printing process using PETG.
startPrint()
for each layer in objectHeight:
heatNozzleToPETGTemp()
extrudePETGFilament(layerArea)
coolLayer()
endPrint()
This code simulates printing an object layer by layer with PETG, heating the nozzle, extruding filament for each layer, and cooling before the next.
Look at what repeats as the object prints.
- Primary operation: Extruding PETG filament for each layer.
- How many times: Once per layer, so the number of layers equals the object height in layers.
Printing time grows as the number of layers increases.
| Input Size (layers) | Approx. Operations (extrusions) |
|---|---|
| 10 | 10 extrusions |
| 100 | 100 extrusions |
| 1000 | 1000 extrusions |
Pattern observation: The printing time increases directly with the number of layers; doubling layers doubles the work.
Time Complexity: O(n)
This means the printing time grows in a straight line with the number of layers in the object.
[X] Wrong: "Printing time stays the same no matter how tall the object is."
[OK] Correct: Each layer adds more printing work, so taller objects take more time to print.
Understanding how printing time scales with object size helps you plan projects and explain your process clearly, a useful skill in many technical discussions.
"What if we changed the layer height to be twice as thick? How would the time complexity change?"