mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0024964: ThruSections crashes the DRAW.exe
Test case for issue CR24964
This commit is contained in:
@@ -932,7 +932,6 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
|
||||
const Standard_Boolean vClosed) const
|
||||
{
|
||||
Standard_Integer i,j,jdeb=1,jfin=NbSects;
|
||||
TopoDS_Edge edge;
|
||||
TopoDS_Vertex vf,vl;
|
||||
|
||||
GeomFill_SectionGenerator section;
|
||||
@@ -943,7 +942,7 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
|
||||
|
||||
if (w1Point) {
|
||||
jdeb++;
|
||||
edge = TopoDS::Edge(shapes(1));
|
||||
TopoDS_Edge edge = TopoDS::Edge(shapes(1));
|
||||
TopExp::Vertices(edge,vl,vf);
|
||||
TColgp_Array1OfPnt Extremities(1,2);
|
||||
Extremities(1) = BRep_Tool::Pnt(vf);
|
||||
@@ -981,10 +980,15 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
|
||||
for (i=2; i<=NbEdges; i++) {
|
||||
// read the edge
|
||||
TopoDS_Edge aNextEdge = TopoDS::Edge (shapes((j-1)*NbEdges+i));
|
||||
Standard_Real aTolV = Precision::Confusion();
|
||||
TopExp::Vertices(aNextEdge,vf,vl);
|
||||
aTolV = Max(aTolV, BRep_Tool::Tolerance(vf));
|
||||
aTolV = Max(aTolV, BRep_Tool::Tolerance(vl));
|
||||
aTolV = Min(aTolV, 1.e-3);
|
||||
curvBS = EdgeToBSpline (aNextEdge);
|
||||
|
||||
// concatenation
|
||||
CompBS.Add(curvBS, Precision::Confusion(), Standard_True, Standard_False, 1);
|
||||
CompBS.Add(curvBS, aTolV, Standard_True, Standard_False, 1);
|
||||
}
|
||||
|
||||
// return the final section
|
||||
@@ -1000,7 +1004,7 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
|
||||
}
|
||||
|
||||
if (w2Point) {
|
||||
edge = TopoDS::Edge(shapes(NbSects*NbEdges));
|
||||
TopoDS_Edge edge = TopoDS::Edge(shapes(NbSects*NbEdges));
|
||||
TopExp::Vertices(edge,vl,vf);
|
||||
TColgp_Array1OfPnt Extremities(1,2);
|
||||
Extremities(1) = BRep_Tool::Pnt(vf);
|
||||
|
27
tests/bugs/modalg_5/bug24964
Normal file
27
tests/bugs/modalg_5/bug24964
Normal file
@@ -0,0 +1,27 @@
|
||||
puts "============"
|
||||
puts "OCC24964"
|
||||
puts "============"
|
||||
puts ""
|
||||
#########################################################################
|
||||
# ThruSections crashes the DRAW.exe
|
||||
#########################################################################
|
||||
|
||||
restore [locate_data_file bug24964_w1.brep] w1
|
||||
restore [locate_data_file bug24964_w2.brep] w2
|
||||
restore [locate_data_file bug24964_w3.brep] w3
|
||||
|
||||
thrusections result 0 0 w1 w2 w3
|
||||
|
||||
set square 163127
|
||||
|
||||
set nb_v_good 30
|
||||
set nb_e_good 45
|
||||
set nb_w_good 15
|
||||
set nb_f_good 15
|
||||
set nb_sh_good 1
|
||||
set nb_sol_good 0
|
||||
set nb_compsol_good 0
|
||||
set nb_compound_good 0
|
||||
set nb_shape_good 106
|
||||
|
||||
set 2dviewer 1
|
Reference in New Issue
Block a user