Rotate UV direction


#1

Hi all,
Im looking for a quick way to rotate the UV direction of (simple) polysurfaces.
Is this possible without remodeling?

thanks,
Tobias


(Willem Derks) #2

Hi Tobias,

I think that would require for the face to be “reconstructed”, as it is the base surface that needs to be re-oriented.
What is your goal in rotating the UV? Is this for rendering purposes or do you need the geometric definitions to be oriented different?
How simple are these object? If they are extruded like the example it might be not that hard to script.

-Willem


#3

Hi Willem,

Thanks for your answer. Indeed the underlying base surface has to be rotated and my question is exactly about that: if there is a quick way to rotate that base surface. And no, it’s not about rendering and texture mapping.

The objects are pretty simple, like the example: extruded planar curves. I thought about scripting too. It should be doable, but I haven’t found the right approach how to do this.

thanks, Tobias


#4

Well depending on what scripting tool you use - I guess you would need to extract the surface(s) in question and then you would need a reference - for “automatic” I might try to find the longest edge of the surface and get a tangent vector (assuming straight), plus the surface plane and border curve. Then rotate the surface plane so its X axis is parallel to the tangent vector, get the bounding box of the border curve in that plane, construct a plane surface along that plane a little bigger than the bounding box, then trim the plane with the border. Afterwards shrink the surface if you want, and rejoin all.

If you work in Python a bunch of the extraction/construction can be done in RhinoCommon with geometry that doesn’t have to be added to the document, but I think all the tools are there to work with vanilla vb rhinoscript as well. It is a fair amount of work to do though.

As an afterthought, you might try running this script from my library on your objects - it uses Rhino’s automatic routines to re-create planar surfaces, but it might actually “straighten out” your UV’s in a number of cases as well…

SimplifyPlanarPolySrfs.rvb (2.1 KB)

–Mitch


#5

Hi Mitch,
Thanks a bunch for that script. It just simply does what I was looking for!! Great!
The ‘straighten out’ of UV’s is very much welcome too!

thanks, Tobias