Automatic ply detection and finite element model generation for composite laminates