1

Tikz offers snake decoration, which is however not pure sine decoration. As written in Tikz manual, snake is "sine wave with a softened start and ending". I would like to have pure sine decoration.

I am aware that there is a solution for complete sines, which always draws full number of sines:

TikZ finishes a morphed path with a straight segment

The problem is that I want that line gets straight if sines do not fit in. Ie.

\draw [decoration={sines,segment length=1cm,amplitude=1cm},decorate] (0,0) -- (0,1.6cm);

should draw 1.5 sines and straight line 0.1cm long. It should also work with pre length and post length, just as snake does.

I guess this should be simpler that complete sines, but I don't know how to tweak @Jake's solution to my needs.

Pygmalion
  • 6,387
  • 4
  • 34
  • 68

0 Answers0