Brep domain orientation

Hello everyone,

I have a question about the concept of brep itself. If I call

brep.Faces[0].IsoCurve(0, v_value)

and

brep.Faces[0].FrameAt(u, v_value, out var frame)

I would expect that the isocurve obtained would “follow” the frame.XAxis. Is this correct? Should I check the OrientationIsReversed flag? If so, why the two APIs refer to two different “coordinate systems”?

Hope that someone can clear some confusion for me,

Thanks

No. The underlying function does this test for you.

Can you point us to what you are referring to?

– Dale

See attached files. If I run the script without flipping U and V I get what I expected, but if I run Dir and run it again the results are different

domain_orientation.py (494 Bytes)

domain_orientation.3dm (116.7 KB)

Hi @m.camillo,

When you run the Dir command, are you clicking a command line option? If so, which one?

– Dale

Yes, the SwapUV option.

Hi @m.camillo,

Do not confuse what the Dir command displays with what the Surface.FrameAt method returns.

The Dir command shows you a surface’s U (green), V (red), and normal (white) directions. These are just vector, and they do not always create a valid, right-hand-rule plane.

For example, this is what you see when you run the Dir command on your surface and pick SwapUV:

The Surface.FrameAt always returns a valid, right-hand-rule plane. Perhaps this is what you’re seeing.

TestMarco.py (1.6 KB)

– Dale

Hi Dale,

this is what I’m getting from your script

The frame XAxis lines are both in the “vertical” direction, opposite from the isocurve, even after frame.Flip()is called. I would expect at least one of those to be in the other direction, am I thinking it right?
By the way, is calling brep_face.Transpose() the same as using SwapUV option of Dir? If so, I DO have to check for the OrientationIsReversed flag to have a frame similarly oriented to the face domain, right?

@m.camillo,

Other than not using rhinoscriptsyntax, my script does nothing special.

As I mentioned above, a surface’s U, V, and Normal direction do not always make up a valid right-hand rule plane.

Here is a C# sample of what the Dir command does, basically. You should be able to translate this to Python.

SampleCsDir.cs

– Dale