Structural transformation in cadmium iodide polytypic crystal