Problem between BrepFace and Brep


#1

Hello!
I have got a very big problem. I need the orientation of a BrepFace through a Brep.
When I transform BreapFace to Brep with method “toBrep()”, I lose that information.

I have a FaceBrep that returns true if I use face.OrientationIsReversed, but BrepFace.ToBrep().Faces.First().OrientationIsReversed returns false.

How I can resolve this issue??


(Dale Fugier) #2

Hi Hector,

I am confused, you are you using the ToBrep() method?.

If you have a BrepFace and you have it’s orientation, then just do this:

BrepFace face = ...;
var reversed = face.OrientationIsReversed;

– Dale


#3

Hello Dale,

I’ve already contempled this situation, but I can’t use it.
My code is working with Brep’s. And I need to get that orientation from one Brep.

Any other idea?

Thanks for your fast answer,
Hector.


(Dale Fugier) #4

If you have the Brep, you can get the orientation of the face like this:

var rev = brep.Faces[face.FaceIndex].OrientationIsReversed;

– Dale


#5

There is the problem.

Just this is wrong:

If I get the orientation from the BrepFace, it returns one value.
Then, I convert this Face in Brep.
Later, I get the orientation through “brep.Faces.FirstOrDefault().OrientationIsReversed” that is the same that “brep.Faces[0].OrientationIsReversed” and it returns other different value.

Thanks,
Hector.


(Dale Fugier) #6

Yes, of course, you may get a different value as you’ve created a new Brep…


#7

OK. I’ll have to research other solution.

Thanks anyway,
Hector.


(Willem Derks) #8

Hi Hector,

How about the BrepFace.DuplicateFace Method? Maybe that will keep the reversed flag from the input face?

http://developer.rhino3d.com/wip/api/RhinoCommonWin/html/M_Rhino_Geometry_BrepFace_DuplicateFace.htm

-Willem


#9

Hi Willem,

I’ve tested and it works!! It’s perfect for my project. Thank you very much!!

Best regards,
Hector.