What is it you don’t understand, the reason for doing it or the code under the hood? As for the reason, without that the wireframe representation looks inside out, as can be seen with:
mapper.SetInputConnection(contour.GetOutputPort())
actor.GetProperty().SetRepresentation(1)
And vtkPolyDataNormals helps (left), but it’s nowhere as good as the original (right), I guess because the original computes the normals from the volume data, while the filter can only compute the normals from the triangles in the contour. Or am I missing something?