]> OCCT Git - occt.git/commitdiff
ShapeUpgrade_UnifySameDomain gives wrong result on mirrored shape (OCCT bug #33439... CR790-SALOME-PATCH
authorJulia DOROVSKIKH <julia.dorovskikh@opencascade.com>
Wed, 26 Nov 2025 12:14:56 +0000 (12:14 +0000)
committerJulia DOROVSKIKH <julia.dorovskikh@opencascade.com>
Wed, 26 Nov 2025 12:14:56 +0000 (12:14 +0000)
src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
tests/bugs/heal/bug33421

index c208deb9d08abd2c161f72829c43efc9b2d7649f..f991071c13182d16926be9ce2f7705f7839f23bc 100644 (file)
@@ -748,8 +748,6 @@ static void ReconstructMissedSeam(const TopTools_SequenceOfShape& theRemovedEdge
                                   TopoDS_Edge&                    theSeamEdge,
                                   gp_Pnt2d&                       theNextPoint)
 {
-  Handle(Geom_Surface) RefSurf = BRep_Tool::Surface(theFrefFace);
-
   // Find seam edge between removed edges
   theSeamEdge.Nullify();
   for (Standard_Integer i = 1; i <= theRemovedEdges.Length(); i++)
@@ -768,6 +766,13 @@ static void ReconstructMissedSeam(const TopTools_SequenceOfShape& theRemovedEdge
     if ((aFirstVertex.IsSame(theCurVertex) || aLastVertex.IsSame(theCurVertex))
         && BRep_Tool::IsClosed(anEdge, theFrefFace))
     {
+      // Problem with mirrored cylinder BEGIN
+      if (!aFirstVertex.IsSame(theCurVertex)) {
+        anEdge.Reverse();
+        aPC = BRep_Tool::CurveOnSurface(anEdge, theFrefFace, Param1, Param2);
+        TopExp::Vertices(anEdge, aFirstVertex, aLastVertex, Standard_True);
+      }
+      // Problem with mirrored cylinder END
       Standard_Real aParam = (anEdge.Orientation() == TopAbs_FORWARD) ? Param1 : Param2;
       gp_Pnt2d      aPoint = aPC->Value(aParam);
       Standard_Real aUdiff = Abs(aPoint.X() - theCurPoint.X());
index fcfebd225e61e8177011a3852d836d1f910e8a16..387b772b11dfdc6a350d8e3c37318eb24b5fef8b 100644 (file)
@@ -15,5 +15,5 @@ bopfuse c3
 
 unifysamedom result c3
 
-checknbshapes result -t -solid 1 -shell 1 -face 3 -wire 3 -edge 3 -vertex 3
+checknbshapes result -t -solid 1 -shell 1 -face 3 -wire 3 -edge 3 -vertex 2
 checkview -display result -2d -path ${imagedir}/${test_image}.png