This script was developed to be used in succession to the components of simple subdivision and Catmull-Clark subdivision introduced in Grasshopper thanks to the plugin WeaverBird developed by Giulio Piacentino.
One of the difficulties of working with subdivided meshes is the not easy acces to different faces. The difficulty stems from two fundamental aspects: the order of the vertices of the individual faces is not always the same, but it was caracterized by a different shift in each subdivision for each face. The second aspect concerns the order of indexing of individual faces and vertices. In fact, these orders do not coincide with the rows and columns of the corresponding grid.
To solve the first problem you need to go and investigate the slip rule, which follows a rule for incremental four faces derived from the mesh of departure according to their order and the number of subdivisions.
Look at the image to better understand the difference in output, if we decide for example of triangular faces using vertices [0, 1, 2] of each quad-face:
It is possible to download the Grasshopper definition for vertices shifting. It includes my script in C # together with an explanation and a different version of the process with standard GH components both edited by Mirco Bianchini
Because the orientation of vertices depends on the order of faces of starting low-poly mesh, I insert in my c# component vertex the possibility to correct manually through a list of integers containing the individual shifting values for faces of starting mesh. By default I give a shifting value of 1 for the first face. Disconnecting the panel it turns off automatically.