UV Space Orientation
Posted: Mon May 16, 2022 11:31 am
Hi all,
I've been trying to write a script that creates a path of points along the center of curved surfaces and stores it coordinates and normal values. I do this by using the uv-space ranges. This is what I've done so far:
- First I select a face of a body and get its uv-space parameter ranges
- Then I choose the parameter range I want to keep constant (e.g. u)
- I find its middle value ((umin + umax) / 2)
- Then I loop through the range of v parameters, incrementing it with a defined step (e.g. range(vmin, vmax, step))
- I save each points coordinates and normal vector in an list and export it as a csv file
This works well, however I want to be able to do this with multiple adjacent faces at once. The problem here is that the orientation of the uv-space is not always the same. For example, if I have two adjacent rectangular faces, the width of the first rectangle might be represented with the u range and the width of the second rectangle with the v range. That means that if I select the u range to be constant, I will get a longitudinal path for the first rectangle and a transversal path for the second (see attachment). I want both to be longitudinal or transversal.
I've been trying to find a way to harmonize the orientation of these paths when done with multiple faces, but so far I haven't been successful.
I kindly want to ask the experts for some help. Is there a way to determine the orientation of the uv-space or to rotate it? Is there maybe a better approach to this?
I hope I was clear enough. Please let me know if more information is required.
I've been trying to write a script that creates a path of points along the center of curved surfaces and stores it coordinates and normal values. I do this by using the uv-space ranges. This is what I've done so far:
- First I select a face of a body and get its uv-space parameter ranges
- Then I choose the parameter range I want to keep constant (e.g. u)
- I find its middle value ((umin + umax) / 2)
- Then I loop through the range of v parameters, incrementing it with a defined step (e.g. range(vmin, vmax, step))
- I save each points coordinates and normal vector in an list and export it as a csv file
This works well, however I want to be able to do this with multiple adjacent faces at once. The problem here is that the orientation of the uv-space is not always the same. For example, if I have two adjacent rectangular faces, the width of the first rectangle might be represented with the u range and the width of the second rectangle with the v range. That means that if I select the u range to be constant, I will get a longitudinal path for the first rectangle and a transversal path for the second (see attachment). I want both to be longitudinal or transversal.
I've been trying to find a way to harmonize the orientation of these paths when done with multiple faces, but so far I haven't been successful.
I kindly want to ask the experts for some help. Is there a way to determine the orientation of the uv-space or to rotate it? Is there maybe a better approach to this?
I hope I was clear enough. Please let me know if more information is required.