mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0024126: Crash on fixing the attached shape
Added the check for an empty list. Adding test case for issue CR24126
This commit is contained in:
parent
c151c0f1f5
commit
0f180c0c18
@ -2211,18 +2211,24 @@ Standard_Boolean ShapeFix_Face::FixSplitFace(const TopTools_DataMapOfShapeListOf
|
|||||||
TopoDS_Shape S = myFace;
|
TopoDS_Shape S = myFace;
|
||||||
if ( ! Context().IsNull() )
|
if ( ! Context().IsNull() )
|
||||||
S = Context()->Apply ( myFace );
|
S = Context()->Apply ( myFace );
|
||||||
Standard_Integer NbWires=0, NbWiresNew=0;
|
Standard_Integer NbWires=0, NbWiresNew=0, NbEdges;
|
||||||
for(TopoDS_Iterator iter(S,Standard_False); iter.More(); iter.Next()) {
|
for(TopoDS_Iterator iter(S,Standard_False); iter.More(); iter.Next()) {
|
||||||
if(iter.Value().ShapeType() != TopAbs_WIRE ||
|
const TopoDS_Shape& aShape = iter.Value();
|
||||||
(iter.Value().Orientation() != TopAbs_FORWARD && iter.Value().Orientation() != TopAbs_REVERSED))
|
if(aShape.ShapeType() != TopAbs_WIRE ||
|
||||||
|
(aShape.Orientation() != TopAbs_FORWARD && aShape.Orientation() != TopAbs_REVERSED))
|
||||||
continue;
|
continue;
|
||||||
TopoDS_Wire wire = TopoDS::Wire ( iter.Value() );
|
TopoDS_Wire wire = TopoDS::Wire ( aShape );
|
||||||
NbWires++;
|
NbWires++;
|
||||||
if(MapWires.IsBound(wire)) {
|
if(MapWires.IsBound(wire)) {
|
||||||
// if wire not closed --> stop split and return false
|
// if wire not closed --> stop split and return false
|
||||||
Handle(ShapeExtend_WireData) sewd = new ShapeExtend_WireData(wire);
|
Handle(ShapeExtend_WireData) sewd = new ShapeExtend_WireData(wire);
|
||||||
|
NbEdges = sewd->NbEdges();
|
||||||
|
if (NbEdges == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
TopoDS_Edge E1 = sewd->Edge(1);
|
TopoDS_Edge E1 = sewd->Edge(1);
|
||||||
TopoDS_Edge E2 = sewd->Edge(sewd->NbEdges());
|
TopoDS_Edge E2 = sewd->Edge(NbEdges);
|
||||||
TopoDS_Vertex V1,V2;
|
TopoDS_Vertex V1,V2;
|
||||||
ShapeAnalysis_Edge sae;
|
ShapeAnalysis_Edge sae;
|
||||||
V1=sae.FirstVertex(E1);
|
V1=sae.FirstVertex(E1);
|
||||||
|
13
tests/bugs/heal/bug24126
Executable file
13
tests/bugs/heal/bug24126
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
puts "================"
|
||||||
|
puts "OCC24126"
|
||||||
|
puts "================"
|
||||||
|
puts ""
|
||||||
|
######################################################################################
|
||||||
|
# Crash on fixing the attached shape
|
||||||
|
######################################################################################
|
||||||
|
|
||||||
|
catch {pload XDE}
|
||||||
|
|
||||||
|
restore [locate_data_file bug24126_Partition_1.brep] b
|
||||||
|
|
||||||
|
fixshape result b
|
Loading…
x
Reference in New Issue
Block a user