I am trying to import the IGES file and then want to iterate through each face to get correct face normal.
But I am getting wrong normals for the face.Here is the steps which I am following.
1.Read IGES using IGESControl_Reader
2.Sew the body using BRepBuilderAPI_Sewing
3.Try to repair the shape using ShapeFix_Shell
4.iterating through the faces to get face normals - tried these 3 approaches (BRepGProp_Face/BRepAdaptor_Surface.D1()/GeomLProp_SLProps)
each one is giving same result. but wrong one.
Face normal coming reverse for some faces.
One approach is:
gp_Vec d1U = new gp_Vec();
gp_Vec d1V = new gp_Vec();
gp_Pnt p = new gp_Pnt();
bRepAdaptorSurface.D1(uParam, vParam, ref p, ref d1U, ref d1V);
gp_Vec norm = d1U.Crossed(d1V);
if(face.Orientation() == TopAbs_Orientation.TopAbs_REVERSED)
Same approach works fine for STEP file.
Can someone help me in this case? Am I doing something wrong while reading IGES?
Please find the sample iges attached.