UV mapping for odd shape Procedural Mesh(Runtime mesh)

Frankly speaking, i was hoping for an all rounder shapes UV unwrapping solution. Could be a triangle, a sphere, a cube, low poly mountain or even a humanoid. Just need each of the triangles in their normals direction to be sized accordingly in a UV tile. But i am lacking the math area to solve this.

Currently i have managed a simple cube like mapping which is pretty simple. But there are refinements to do even for this simple uv unwrap.