Skip to main content

Zigzag

zigzag() 

Draw a zig-zag or saw-tooth wave along a path.

The number of tooths can be controlled via the segments or segment-length style key, and the width via amplitude.

line((0,0), (2,1), stroke: gray)
cetz.decorations.zigzag(line((0,0), (2,1)), amplitude: .25, start: 10%, stop: 90%)

target:

Target path

close:

Default: auto

Close the path

name:

Default: none

Element name

..style:

Style

Styling

Root: zigzag

factor:

Default: 100%

Triangle mid between its start and end. Setting this to 0% leads to a falling sawtooth shape, while 100% results in a raising sawtooth.