In order to save valuable machining time expended on machining bad casting, a point-cloud based analysis is proposed to perform a pre-process check on raw casting material conditions. This analysis virtually compares the point-cloud data of the raw casting with the nominal computer aided design (CAD) model of the final casting and analyzes if the dimensional tolerances on the finished casting can be satisfied by adjusting the coordinate frame in which the casting is machined. The proposed analysis includes the segmentation of the raw point-cloud data followed by extracting the functional features. The material conditions of all planar surfaces are expressed using linear algebraic inequalities. A linear programming-based methodology is developed that helps in aligning the raw casting to the nominal CAD frame so that the conformity is guaranteed. The proposed methodology with the help of slack variables can deal with the casting with unsatisfiable material conditions. An example problem dealing with machining of raw casting clamped on a four-axis machine tool is presented to check the validity of proposed method. The virtual gage analysis accurately suggests a solution to compensate part variation caused by fixturing and locating error.