1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0032623: [Regression] Modelling Algorithms - UnifySameDomain invalid result only in release mode

Correct local function ReconstructMissedSeam: use copy of existing pcurve for seam edge reconstruction to prevent possible corruption of another edges.
This commit is contained in:
jgv 2021-10-18 20:00:20 +03:00 committed by smoskvin
parent 4e61131a1c
commit f8d8c3f2bc
2 changed files with 30 additions and 8 deletions

View File

@ -699,6 +699,8 @@ static void ReconstructMissedSeam(const TopTools_SequenceOfShape& theEdges,
{ {
//make edge a real seam edge with 2 pcurves on ref face //make edge a real seam edge with 2 pcurves on ref face
Handle(Geom2d_Curve) aPC = BRep_Tool::CurveOnSurface (MissedSeam, theFrefFace, Param1, Param2); Handle(Geom2d_Curve) aPC = BRep_Tool::CurveOnSurface (MissedSeam, theFrefFace, Param1, Param2);
Handle(Geom2d_Curve) aCopyPC = Handle(Geom2d_Curve)::DownCast(aPC->Copy());
gp_Pnt2d aP2d = aPC->Value(Param1); gp_Pnt2d aP2d = aPC->Value(Param1);
if (Abs(aP2d.Coord(IndCoord) - theCurPoint.Coord(IndCoord)) > thePeriod/2) if (Abs(aP2d.Coord(IndCoord) - theCurPoint.Coord(IndCoord)) > thePeriod/2)
{ {
@ -713,18 +715,18 @@ static void ReconstructMissedSeam(const TopTools_SequenceOfShape& theEdges,
else else
Offset.SetCoord (0., anOffset); Offset.SetCoord (0., anOffset);
aPC->Translate(Offset); aCopyPC->Translate(Offset);
} }
gp_Pnt2d aFirstP2d, aLastP2d; gp_Pnt2d aFirstP2d, aLastP2d;
if (MissedSeam.Orientation() == TopAbs_FORWARD) if (MissedSeam.Orientation() == TopAbs_FORWARD)
{ {
aFirstP2d = aPC->Value(Param1); aFirstP2d = aCopyPC->Value(Param1);
aLastP2d = aPC->Value(Param2); aLastP2d = aCopyPC->Value(Param2);
} }
else else
{ {
aFirstP2d = aPC->Value(Param2); aFirstP2d = aCopyPC->Value(Param2);
aLastP2d = aPC->Value(Param1); aLastP2d = aCopyPC->Value(Param1);
} }
if (theIsU) if (theIsU)
{ {
@ -740,16 +742,16 @@ static void ReconstructMissedSeam(const TopTools_SequenceOfShape& theEdges,
else else
Offset.SetCoord (0., -thePeriod); Offset.SetCoord (0., -thePeriod);
} }
Handle(Geom2d_Curve) AnotherPC = Handle(Geom2d_Curve)::DownCast(aPC->Copy()); Handle(Geom2d_Curve) AnotherPC = Handle(Geom2d_Curve)::DownCast(aCopyPC->Copy());
AnotherPC->Translate(Offset); AnotherPC->Translate(Offset);
TopoDS_Edge F_MissedSeam = MissedSeam; TopoDS_Edge F_MissedSeam = MissedSeam;
F_MissedSeam.Orientation (TopAbs_FORWARD); F_MissedSeam.Orientation (TopAbs_FORWARD);
Handle(Geom2d_Curve) NullPC; Handle(Geom2d_Curve) NullPC;
BB.UpdateEdge (F_MissedSeam, NullPC, theFrefFace, 0.); BB.UpdateEdge (F_MissedSeam, NullPC, theFrefFace, 0.);
if (MissedSeam.Orientation() == TopAbs_FORWARD) if (MissedSeam.Orientation() == TopAbs_FORWARD)
BB.UpdateEdge (F_MissedSeam, aPC, AnotherPC, theFrefFace, 0.); BB.UpdateEdge (F_MissedSeam, aCopyPC, AnotherPC, theFrefFace, 0.);
else else
BB.UpdateEdge (F_MissedSeam, AnotherPC, aPC, theFrefFace, 0.); BB.UpdateEdge (F_MissedSeam, AnotherPC, aCopyPC, theFrefFace, 0.);
} }
BB.Continuity(MissedSeam, theFrefFace, theFrefFace, aContinuity); BB.Continuity(MissedSeam, theFrefFace, theFrefFace, aContinuity);

20
tests/bugs/heal/bug32623 Normal file
View File

@ -0,0 +1,20 @@
puts "============================================================="
puts "OCC32623: UnifySameDomain invalid result only in release mode"
puts "============================================================="
puts ""
restore [locate_data_file bug32623.brep] a
unifysamedom result a
checkshape result
checknbshapes result -t -solid 1 -shell 1 -face 58 -wire 68 -edge 163 -vertex 107
set tolres [checkmaxtol result]
if { ${tolres} > 2.e-5} {
puts "Error: bad tolerance of result"
}
checkprops result -s 56934.4 -v 244645