Wall thickness (perimeters) in 3D Printing - Time & Space Complexity
When 3D printing, the wall thickness is controlled by printing multiple perimeters around the shape.
We want to understand how the printing time grows as we increase the number of perimeters.
Analyze the time complexity of printing perimeters for a single layer.
for each perimeter in number_of_perimeters:
print perimeter outline
move to next inner perimeter
# number_of_perimeters controls wall thickness
# each perimeter is a loop around the shape
This code prints each perimeter line one after another to build the wall thickness.
We look for repeated actions that take most time.
- Primary operation: Printing each perimeter outline around the shape.
- How many times: Once for each perimeter, so number_of_perimeters times.
As you add more perimeters, the printer prints more outlines, increasing time.
| Input Size (number_of_perimeters) | Approx. Operations |
|---|---|
| 1 | Print 1 perimeter outline |
| 3 | Print 3 perimeter outlines |
| 10 | Print 10 perimeter outlines |
Pattern observation: Printing time grows directly with the number of perimeters.
Time Complexity: O(n)
This means the printing time increases in a straight line as you add more perimeters.
[X] Wrong: "Adding more perimeters won't affect printing time much because the printer just moves around the same shape."
[OK] Correct: Each perimeter is a full loop around the shape, so more perimeters mean more loops and more printing time.
Understanding how printing time grows with wall thickness helps you explain trade-offs in 3D printing settings clearly and confidently.
What if the shape size doubled but the number of perimeters stayed the same? How would the time complexity change?