I’m trying to unify the UV directions so the the edges of the cones will face towards the stright line of each surface. As you can see in the picture some of the cones are facing other directions (yellow lines) while some are facing the direction that I need (green lines).
I tried using many differnt scripts from this forum to unify the direction, but without any succses. Some of them are included in the script (very sorry for not giving credits for each script that I tried, cant remember who created which).
I think this might be a way, taking advantage of the thing that all those surfaces are planar, and they all have a straight edge
it finds the bounding box of each surface based on a plane aligned with the straight edge, then goes back to your original definition (on those rectangular surfaces, for which UVs are fine) to create the cones: