Engine pistons are generally cut with a copy machine or a CNC machine. In recent years, CNC machining has become more popular due to the necessity for increased productivity and accuracy in piston machining. CL data are essential for CNC machining, and such data are usually generated from a 3D CAD model. When using a 3D CAD model, the intersection curves between the surfaces and the cross-sectional plane must be calculated, which is both time-consuming and imprecise. In this paper, a geometric equation for the sidewall of a piston is proposed as a solution to this problem. The geometry consists of an ellipse, recesses, eccentricities, and an offset. The equation for the sidewall of a piston is expressed in terms of the distance from the center. This equation makes it possible to calculate CL data very quickly, and facilitates the compensation of tracking error. A specialized four-axis CNC lathe, suitable for machining the sidewall of a piston, is also introduced. The proposed method has been tested by actual turning using this four-axis lathe. The results demonstrate the practicality of the method in the manufacturing of pistons.