A Dalitz plot analysis of approximately 13,000 Ds+ decays to pi+pi-pi+ has been performed. The analysis uses a 384 fb-1 data sample recorded by the BaBar detector at the PEP-II asymmetric-energy e+e- storage ring running at center of mass energies near 10.6 GeV. Amplitudes and phases of the intermediate resonances which contribute to this final state are measured. A high precision measurement of the ratio of branching fractions is performed: BR(Ds+ -> pi+pi-pi+)/BR(Ds+ -> K+ K- pi+)=0.199 +/- 0.004 +/- 0.009. Using a model-independent partial wave analysis, the amplitude and phase of the S-wave have been measured.