Ray-tracing plays an essential role for the design of a synchrotron radiation beamline optics. Nevertheless, it can also be extremely useful during the commissioning phase of a beamline. At that moment, it is possible to include real surface figure errors in the computer simulation of the optical devices. The resulting focal spot size and photon flux values are the final targets for the experimental optimization and alignment of the optics setup. We report on extensive ray-tracing of the mirror systems of the two beamlines placed at the ESRF insertion device 12. Slope errors measured after mirror delivery are included in the calculations. It is demonstrated how slope errors with characteristic periodicity between 1 and ca. 1/20 of the mirror length can affect the focal spot shape, size and position. In particular, they can create structures or satellites in the focal spot. The distortions from the ideal shape are generated by the polishing process itself and are intrinsic to each single mirror. Comparison between the effects of slope errors in ray-tracing using either real (measured) surfaces or numerically generated ones are also reported.© (1997) COPYRIGHT SPIE--The International Society for Optical Engineering. Downloading of the abstract is permitted for personal use only.