0
0
3D Printingknowledge~5 mins

Under-extrusion and over-extrusion in 3D Printing - Time & Space Complexity

Choose your learning style9 modes available
Time Complexity: Under-extrusion and over-extrusion
O(n)
Understanding Time Complexity

When 3D printing, the amount of filament pushed out affects print quality. We want to understand how the time to fix extrusion issues grows as the problem size changes.

How does the effort to correct under-extrusion or over-extrusion scale with the size of the print?

Scenario Under Consideration

Analyze the time complexity of this extrusion adjustment process.


for each layer in print:
    check extrusion amount
    if extrusion too low:
        increase flow rate
    else if extrusion too high:
        decrease flow rate
    print layer

This code checks and adjusts extrusion for every layer during printing.

Identify Repeating Operations

Look at what repeats as the print grows.

  • Primary operation: Looping through each layer to check and adjust extrusion.
  • How many times: Once per layer, so as many times as there are layers.
How Execution Grows With Input

As the number of layers increases, the checks and adjustments increase too.

Input Size (n)Approx. Operations
10 layers10 checks and possible adjustments
100 layers100 checks and possible adjustments
1000 layers1000 checks and possible adjustments

Pattern observation: The work grows directly with the number of layers; doubling layers doubles the work.

Final Time Complexity

Time Complexity: O(n)

This means the time to manage extrusion issues grows in a straight line with the number of layers printed.

Common Mistake

[X] Wrong: "Adjusting extrusion once fixes all layers, so time doesn't grow with layers."

[OK] Correct: Each layer can have different extrusion needs, so checks and adjustments must happen repeatedly, increasing with layers.

Interview Connect

Understanding how tasks scale with input size helps you think clearly about printer performance and troubleshooting. This skill is useful for solving real-world problems step by step.

Self-Check

"What if extrusion adjustments were only made every 10 layers instead of every layer? How would the time complexity change?"