Any periodic waveform can be approximated by summing sine waves. Add harmonics one-by-one and watch the Fourier series converge to the target shape.