1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0026173: Wrong result of ChFi3d_ChBuilder algorithm: incorrect processing of G1 junctions at vertex

Test case for issue CR26173
This commit is contained in:
jgv
2015-09-10 15:30:55 +03:00
committed by bugmaster
parent a0ed76c3fb
commit 7d92212e57
11 changed files with 287 additions and 143 deletions

View File

@@ -52,8 +52,8 @@ Standard_Integer ChFi3d::ConcaveSide(const BRepAdaptor_Surface& S1,
gp_Pnt pt, pt1, pt2; gp_Vec tgE, tgE1, tgE2, ns1, ns2, dint1, dint2;
TopoDS_Face F1 = S1.Face();
TopoDS_Face F2 = S2.Face();
F1.Orientation(TopAbs_FORWARD);
F2.Orientation(TopAbs_FORWARD);
//F1.Orientation(TopAbs_FORWARD);
//F2.Orientation(TopAbs_FORWARD);
CE.D1(par,pt,tgE);
tgE.Normalize();
@@ -100,9 +100,13 @@ Standard_Integer ChFi3d::ConcaveSide(const BRepAdaptor_Surface& S1,
S1.D1(p2d1.X(),p2d1.Y(),pt1,DU1,DV1);
ns1 = DU1.Crossed(DV1);
ns1.Normalize();
if (F1.Orientation() == TopAbs_REVERSED)
ns1.Reverse();
S2.D1(p2d2.X(),p2d2.Y(),pt2,DU2,DV2);
ns2 = DU2.Crossed(DV2);
ns2.Normalize();
if (F2.Orientation() == TopAbs_REVERSED)
ns2.Reverse();
dint1 = ns1.Crossed(tgE1);
dint2 = ns2.Crossed(tgE2);
@@ -129,11 +133,15 @@ Standard_Integer ChFi3d::ConcaveSide(const BRepAdaptor_Surface& S1,
DV1 += ( DV1 * dint1 < 0) ? -DDV : DDV;
ns1 = DU1.Crossed(DV1);
ns1.Normalize();
if (F1.Orientation() == TopAbs_REVERSED)
ns1.Reverse();
S2.D2(p2d2.X(),p2d2.Y(),pt2,DU2,DV2,DDU,DDV,DDUV);
DU2 += ( DU2 * dint2 < 0) ? -DDU : DDU;
DV2 += ( DV2 * dint2 < 0) ? -DDV : DDV;
ns2 = DU2.Crossed(DV2);
ns2.Normalize();
if (F2.Orientation() == TopAbs_REVERSED)
ns2.Reverse();
dint1 = ns1.Crossed(tgE1);
dint2 = ns2.Crossed(tgE2);
@@ -171,8 +179,12 @@ Standard_Integer ChFi3d::ConcaveSide(const BRepAdaptor_Surface& S1,
p2d2.SetX(p2d2.X() + u); p2d2.SetY(p2d2.Y() + v);
S1.D1(p2d1.X(),p2d1.Y(),pt1,DU1,DV1);
ns1 = DU1.Crossed(DV1);
if (F1.Orientation() == TopAbs_REVERSED)
ns1.Reverse();
S2.D1(p2d2.X(),p2d2.Y(),pt2,DU2,DV2);
ns2 = DU2.Crossed(DV2);
if (F2.Orientation() == TopAbs_REVERSED)
ns2.Reverse();
gp_Vec vref(pt1,pt2);
if(ns1.Dot(vref) < 0.){
Or1 = TopAbs_REVERSED;