This is a mesh extrusion algorithm I've translated to C# from the Unity procedural examples written in javascript: https://assetstore.unity.com/packages/essentials/tutorial-projects/procedural-examples-5141. This was the basis for making the tilt brush like painting app 'Virtual Studio' : https://github.com/eman-insilico/Virtual-Studio.