How to find out if Brep uv-directions got reversed?

Hi there,

is it possible to find out if the uv-directions of a brep got modified?
I am asking because:
Brep tagged as “original/reversed” is part of a brep that got unrolled.
In the result (tagged as Unroll) the direction matches (because I was able to control that via BrepFaceList.Flip(bool onlyReversedFaces).

Sometimes users are reversing the uv-directions (I don’t know why, but they do).
So now my question is: Is it possible to find out if it go switched, because then I would be able to refurbish the brep and orient the faces on top of each other perfectly.

Any ideas?
Thanks,
T.

Hi @tobias.stoltmann, does BrepFace.OrientationIsReversed help ?

_
c.

@clement I think this only partially helps, since inverting the normals will change the bool, but changing both normals and swapping UV, will change the bool twice.

But maybe it can be combined with another step to check if the U and V direction are aligned with the part as you expect it.

Hi @Gijs, yes, a combination with a domain check of the underlying surface might exclude some cases. Usually if someone changes the UV direction the domain(s) are not increasing anymore, eg. if a surface which has a U domain from 0 to 17, reversing U yields a domain from -17 to -0. But if the user reparameterizes with own values things get really complicated to detect.

_
c.

@clement @Gijs

Thanks for the input first of all.

There are two things I can see.
The original surface in the picture below has

"U":  degree =1  CV count = 2  (0.000 <= U <= 200.000)
"V":  degree =1  CV count = 2  (0.000 <= V <= 300.000)

On the other one I moved the edge of the surface and get

"U":  degree =1  CV count = 2  (-300.000 <= U <= 0.000)
"V":  degree =1  CV count = 2  (0.000 <= V <= 200.000)

So I can not explain why it’s flipping, but at least now I found the reason why I need to find out if it is flipped or not.

I also thought of the Domaincheck, which might be working in this case.
What I also am able to see here is that uv are switched and the one is switched. This gives me a headache, because I am not able to control anything…

I also thought of getting each breps first edge and creating a plane with the surfaces normal to alingn them to each other, as by reverting the orientation the plane should be accurate.


I assume you mean the fact that in your example the uvw is rotated 90 degrees clockwise?
You could compare the uvw directions with a reference plane, then you will have all information you need I think.