3dSynth

Tutorials / Custom G-code

Open in the interactive tutorials reader

---
title: Tutorial 22 Non-planar Thinking
description: Breaking free from flat layers.
---

Tutorial 22 Non-planar Thinking

1. Lesson Header

2. Concept Introduction

The Flat Layer Trap.
Slicers slice 3D models into 2D planes. This is efficient but limits strength (Z-axis is weak) and finish (stair-stepping on slopes).
Non-planar Printing means moving X, Y, and Z simultaneously to follow the contour of an object.
Instead of "steps", we get smooth curves in 3D space.

3. Machine State Explanation

True 3D Movement.
Your printer is a CNC machine. It doesn't know about layers. It just goes to coordinates.
G1 X10 Y10 Z10 moves diagonally up in 3D space.
If you chain many small 3D moves, you can print on a curved surface (like a helmet or a wing).

4. Command Breakdown

5. Minimal Working Example

The Ramp.
Print a line that goes up a slope.
Start at Z0. End at Z10. Length 100mm.
This is a 10% grade.

G28
G1 X0 Y0 Z0
G1 X100 Y0 Z10 E5 ; Extrude while climbing!

6. Visual Representation

Interactive preview is available in the interactive reader.

7. Build Exercise

Task: Create a "Wave" Wall.
Print a single wall (0.4mm wide).
But the top edge is not flat. It follows a sine wave.
Z = 10 + 5*sin(x).
(We can't use sin() in G-code directly, so we approximate with points).

Points:
- X0 Z10
- X10 Z12
- X20 Z14
- X30 Z15 (Peak)
- X40 Z14
- X50 Z12
- X60 Z10
- ... down to Z5 ...

The Challenge:
You must calculate the E value for each segment.
Since the hypotenuse (3D distance) is longer than the flat distance (X), you need more extrusion per segment than a flat line!
Distance = sqrt(dx^2 + dy^2 + dz^2).

8. Deep Insight Section

Collision Avoidance.
The biggest risk in non-planar printing is the nozzle hitting the print.
Standard nozzles are pointy. But the heater block is flat and wide.
If your slope is steeper than ~45 degrees (depending on nozzle geometry), the shoulder of the nozzle will crash into the part you just printed.
Rule of Thumb: Keep non-planar angles shallow (< 30 degrees).

9. Common Failure Modes

  1. Dragging: If you move Z down while moving X/Y over an existing part, you might drag the hot nozzle through the plastic.
  2. Flow Rate Mismatch: If you don't account for the 3D distance, you will under-extrude on steep slopes.

10. Real-World Application

Aerodynamic Skins.
Printing a wing with flat layers creates steps that disturb airflow.
Printing the top skin as a continuous non-planar sheet makes it perfectly smooth and aerodynamic.

11. Final Clean Version

; Lesson 22 - The Wave Wall
G21
G90
M83
G28
G1 Z0.2 F3000

; --- Base (Flat) ---
G1 X50 Y50 E2
G1 X150 Y50 E5 ; 100mm line
G1 X150 Y52 E0.1 ; Shift Y
G1 X50 Y52 E5 ; Return

; --- Wave Layer 1 ---
; We will approximate a wave.
; Up-slope
G1 X60 Y50 Z0.4 E0.5 ; Start climbing
G1 X70 Y50 Z0.8 E0.5
G1 X80 Y50 Z1.2 E0.5
G1 X90 Y50 Z1.6 E0.5
G1 X100 Y50 Z2.0 E0.5 ; Peak

; Down-slope
G1 X110 Y50 Z1.6 E0.5
G1 X120 Y50 Z1.2 E0.5
G1 X130 Y50 Z0.8 E0.5
G1 X140 Y50 Z0.4 E0.5
G1 X150 Y50 Z0.2 E0.5 ; Bottom

; Return (Flat for stability)
G1 X50 Y52 Z0.2 E5

; Reset
G28 X0 Y0

12. Stretch Challenge

Challenge: Print a "Dome".
Use G2/G3 arcs.
Start with a large circle at Z0.
Move up Z0.2, make a slightly smaller circle.
Repeat until the circle radius is 0.
This is standard slicing.
True Challenge: Make the toolpath itself a spiral dome (Lesson 18 + Lesson 22).
One continuous line that spirals in and up.
G3 X[Target] Y[Target] Z[Up] I[Offset] J[Offset].
You have to change I/J continuously.