From 31d14f6a4f49ae20534e5b1edd0811af4514b8a4 Mon Sep 17 00:00:00 2001 From: Julia DOROVSKIKH Date: Wed, 26 Nov 2025 12:14:56 +0000 Subject: [PATCH] ShapeUpgrade_UnifySameDomain gives wrong result on mirrored shape (OCCT bug #33439) (Salome bos #45819) --- src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx | 9 +++++++-- tests/bugs/heal/bug33421 | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx b/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx index c208deb9d0..f991071c13 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx @@ -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()); diff --git a/tests/bugs/heal/bug33421 b/tests/bugs/heal/bug33421 index fcfebd225e..387b772b11 100644 --- a/tests/bugs/heal/bug33421 +++ b/tests/bugs/heal/bug33421 @@ -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 -- 2.39.5