or how to transform vector3.z = 0
Could you be more specific and tell us more about what you try/do/want to achieve?
Triangulation is only for 2D shapes
Yes, but it doesn’t clarify your goal.
Also, feel free to search the forum: Texture on dynamically created object
For true 3D surfaces, this is a very complex issue.
I have worked on this for specific cases.
See Addon for triangulation of implicit surfaces/ forms with holes