Optical metrology has been widely used in quality inspection. However, the sensor setup during part inspection is often done in an ad hoc way. This leads to unnecessarily high signal dynamic range. Consequently, optical sensors do not have sufficient light dynamic range capabilities especially for shiny surface measurement. We present a computational approach for optimal sensor setup that takes into account the sensor/part interaction to decrease signal dynamic range and to increase model coverage for structured light or similar optical inspection systems. First, we transform the signal dynamic range issue into a distance problem in a spherical map. We then present novel algorithms on the spherical map to search a near-optimal sensor orientation. Based on this near-optimal orientation, we use a gradient method to obtain the free-optimal solution that gives the lowest possible dynamic range. Experimental results demonstrated that under the optimal orientation, there is lower signal dynamic range and better model coverage. Future work on extending this method to multiple sensor planning, sensor design, and stage design for large part inspection is also discussed.