Due to the inexact science of grinding, a technique was desired to automate the grinding process in order to complete a finished profile with a closed loop control. A desired finished shape, or profile, is input to the system. The closed loop control plans the optimal grinding process, and drives the machine controllers to complete the task. This technique can be applied to many types of surface grinding applications such as optical grinding, precision surface grinding for coordinate measuring systems, complex curve grinding, as well as many others. The example illustrated is the closed loop application of railway rail grinding. Vista (vision based transverse analyzer) was intended as a solution to the difficult problem of railroad rail grinding. Due to complexities in analysis, and measurement limitations, rail grinding had evolved as an inexact art. Vista was created to refine the analysis techniques, and to automate the process of rail grinding. The intent was to design and produce a system fully capable of grinding railroad rails efficiently without the aid of human intervention. Vista is comprised of two parts; a rail measurement system (RMS), and an expert system. These devices become the host controller of present day rail grinding machinery, increasing efficiency and accuracy in the rail grinding environment.