Skip to main content

Coil

coil() 

Draw a stretched coil/loop spring along a path

The number of windings 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.coil(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: coil

factor:

Default: 150%

Factor of how much the coil overextends its length to form a curl.