Take the 2-minute tour ×

2 Answers 2

I would draw the path multiple times with different styles and clip it to the rectangles of the current medium so everything outside is removed. This is easier than to calculate the points where the path is crossing the media. However, this might also be an option and can be done with the intersections library.

share|improve this answer

Here is a quick way to draw the dotted points, using decorations for randomizing and dotting (the dotted option doesn't seem to work well with random steps). Play around with the various values to see which yield the best effect.


        decoration={random steps, segment length=0.4mm,amplitude=0.3mm},
                between positions 0 and 1 step 1mm
                {\fill (0,0) circle (0.7pt);}
        ] (0,0) -- (3,0);


share|improve this answer

Your Answer


