0021762: EDF 2333 : Bug in composite side algorithm on partition result

fix orientation of EDGEs before calling BRepLProp::Continuity()
This commit is contained in:
eap 2012-07-31 10:51:50 +00:00
parent 5c3c22f91d
commit 0bab05d95d

View File

@ -504,10 +504,16 @@ GeomAbs_Shape SMESH_Algo::Continuity(TopoDS_Edge E1,
E1.Orientation( TopAbs_FORWARD );
if (E2.Orientation() > TopAbs_REVERSED) // INTERNAL
E2.Orientation( TopAbs_FORWARD );
TopoDS_Vertex V = TopExp::LastVertex (E1, true);
if ( !V.IsSame( TopExp::FirstVertex(E2, true )))
if ( !TopExp::CommonVertex( E1, E2, V ))
return GeomAbs_C0;
TopoDS_Vertex V, VV1[2], VV2[2];
TopExp::Vertices( E1, VV1[0], VV1[1], true );
TopExp::Vertices( E2, VV2[0], VV2[1], true );
if ( VV1[1].IsSame( VV2[0] )) { V = VV1[1]; }
else if ( VV1[0].IsSame( VV2[1] )) { V = VV1[0]; }
else if ( VV1[1].IsSame( VV2[1] )) { V = VV1[1]; E1.Reverse(); }
else if ( VV1[0].IsSame( VV2[0] )) { V = VV1[0]; E1.Reverse(); }
else { return GeomAbs_C0; }
Standard_Real u1 = BRep_Tool::Parameter( V, E1 );
Standard_Real u2 = BRep_Tool::Parameter( V, E2 );
BRepAdaptor_Curve C1( E1 ), C2( E2 );