question about OpenGL in the 3D dynamic simulation

Hello!
Now I have a question about OpenGL in the 3D dynamic simulation of lathe NC system. I would like to use cutter to cut workpiece. I have achieved it in the 2D dynamic simulation. But when I use the cutter envelope intersecting with the surface of the model, the machined model (the inner surface )is not visible as the same as the outer surface. The problem is about in stencil test. So I would like to learn how to solve it. I look forward to your help on edge.
Thanks very much!