mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0033398: Modeling Algorithms - ShapeUpgrade_UnifySameDomain throws exception on specific STEP model
Added additional checking in static method FindCoordBounds to avoid processing null pcurves
This commit is contained in:
parent
5e53920228
commit
96d1fe2b05
@ -340,7 +340,13 @@ static Standard_Real ComputeMinEdgeSize(const TopTools_SequenceOfShape& theEdges
|
|||||||
return MinSize;
|
return MinSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FindCoordBounds(const TopTools_SequenceOfShape& theFaces,
|
//=======================================================================
|
||||||
|
//function : FindCoordBounds
|
||||||
|
//purpose : Searching for origin of U in 2d space
|
||||||
|
// Returns Standard_False if could not find curve on surface
|
||||||
|
// Returns Standard_True if succeed
|
||||||
|
//=======================================================================
|
||||||
|
static Standard_Boolean FindCoordBounds(const TopTools_SequenceOfShape& theFaces,
|
||||||
const TopoDS_Face& theRefFace,
|
const TopoDS_Face& theRefFace,
|
||||||
const TopTools_IndexedDataMapOfShapeListOfShape& theMapEF,
|
const TopTools_IndexedDataMapOfShapeListOfShape& theMapEF,
|
||||||
const TopTools_MapOfShape& theEdgesMap,
|
const TopTools_MapOfShape& theEdgesMap,
|
||||||
@ -372,6 +378,10 @@ static void FindCoordBounds(const TopTools_SequenceOfShape& theFaces,
|
|||||||
continue;
|
continue;
|
||||||
Standard_Real fpar, lpar;
|
Standard_Real fpar, lpar;
|
||||||
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, theRefFace, fpar, lpar);
|
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, theRefFace, fpar, lpar);
|
||||||
|
if (aPCurve.IsNull())
|
||||||
|
{
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
UpdateBoundaries (aPCurve, fpar, lpar, theIndCoord, aMinCoord, aMaxCoord);
|
UpdateBoundaries (aPCurve, fpar, lpar, theIndCoord, aMinCoord, aMaxCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -436,6 +446,7 @@ static void FindCoordBounds(const TopTools_SequenceOfShape& theFaces,
|
|||||||
theMinCoord = aPairSeq(1).first;
|
theMinCoord = aPairSeq(1).first;
|
||||||
|
|
||||||
theMaxCoord = aPairSeq(1).second;
|
theMaxCoord = aPairSeq(1).second;
|
||||||
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RelocatePCurvesToNewUorigin(const TopTools_SequenceOfShape& theEdges,
|
static void RelocatePCurvesToNewUorigin(const TopTools_SequenceOfShape& theEdges,
|
||||||
@ -3297,8 +3308,11 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
|
|||||||
//so that all the faces are in [origin, origin + Uperiod]
|
//so that all the faces are in [origin, origin + Uperiod]
|
||||||
Standard_Real aMinCoord, aMaxCoord; //Umin, Umax;
|
Standard_Real aMinCoord, aMaxCoord; //Umin, Umax;
|
||||||
Standard_Integer aNumberOfIntervals, i_face_max;
|
Standard_Integer aNumberOfIntervals, i_face_max;
|
||||||
FindCoordBounds (faces, F_RefFace, aMapEF, edgesMap, ii+1, aPeriods[ii],
|
if (!FindCoordBounds(faces, F_RefFace, aMapEF, edgesMap, ii + 1, aPeriods[ii],
|
||||||
aMinCoord, aMaxCoord, aNumberOfIntervals, i_face_max);
|
aMinCoord, aMaxCoord, aNumberOfIntervals, i_face_max))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (aMaxCoord - aMinCoord > aPeriods[ii] - 1.e-5)
|
if (aMaxCoord - aMinCoord > aPeriods[ii] - 1.e-5)
|
||||||
anIsSeamFound[ii] = Standard_True;
|
anIsSeamFound[ii] = Standard_True;
|
||||||
|
10
tests/bugs/heal/bug33398
Normal file
10
tests/bugs/heal/bug33398
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
puts "========================================="
|
||||||
|
puts "0033398: Modeling Algorithms - ShapeUpgrade_UnifySameDomain fails on specific STEP model"
|
||||||
|
puts "========================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
testreadstep [locate_data_file bug33398.step] s
|
||||||
|
unifysamedom result s
|
||||||
|
|
||||||
|
checknbshapes result -vertex 506 -edge 908 -wire 394 -face 382 -shell 4 -solid 4
|
||||||
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user