Just to point out, I already answered & posted a full sample scene in this thread:
https://www.c4dcafe.com/ipb/forums/topic/109504-python-vertex-map/
plus a detailed explanation on how vertex map calculation works in a free post on my Patreon:
https://www.patreon.com/posts/script-club-1-07-34384586

(Just so we don't get work duplicated.)