Added protection against null pointer dereferencing.
Modified BRepOffset_MakeOffset::MakeThickSolid method.
Fixed the problem with negative volume values.
Fixed several unit tests and added a new one.
for ( ;exp2.More(); exp2.Next()) {
LOE.Append(exp2.Current());
}
- BRepOffset_Tool::TryProject(CF,OF1,LOE,LInt1,LInt2,mySide,myTol);
//-------------------------------------------------------
// If no trace try intersection.
//-------------------------------------------------------
- if (LInt1.IsEmpty()) {
+ if (!BRepOffset_Tool::TryProject(CF, OF1, LOE, LInt1, LInt2, mySide, myTol) || LInt1.IsEmpty()) {
BRepOffset_Tool::Inter3D (CF,OF1,LInt1,LInt2,mySide,NullEdge,NullFace,NullFace);
}
Store (CF,OF1,LInt1,LInt2);
{
NbOF++;
}
- if (NbOF <= NbF)
+ if (NbOF < NbF)
{
myDone = Standard_False;
myError = BRepOffset_UnknownError;
return;
}
+ if (NbOF == NbF)
+ {
+ myOffset = 0;
+ }
}
if (myOffset > 0 ) myOffsetShape.Reverse();
if (C.IsNull()) {
BRepLib::BuildCurve3d(CurE,BRep_Tool::Tolerance(CurE));
C = BRep_Tool::Curve(CurE,L,f,l);
+ if (C.IsNull())
+ {
+ return Standard_False;
+ }
}
C = new Geom_TrimmedCurve(C,f,l);
if ( !L.IsIdentity()) C->Transform(L);
if (ToBuild.IsBound(E)) {
TopTools_ListOfShape LOE;
LOE.Append(E);
- BRepOffset_Tool::TryProject (TopoDS::Face(ToBuild(E)),
- EF,LOE,LInt2,LInt1,Side,TolConf);
- if (!LInt1.IsEmpty())
+ if (BRepOffset_Tool::TryProject(TopoDS::Face(ToBuild(E)), EF, LOE, LInt2, LInt1, Side, TolConf)
+ && !LInt1.IsEmpty())
ToBuild.UnBind(E);
}
}
-puts "TODO OCC23068 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23068 ALL: result is not a topological shape!!!"
-puts "TODO OCC23068 ALL: Error: The command cannot be built"
-puts "TODO OCC23068 ALL: TEST INCOMPLETE"
-
puts "========================"
puts " OCC427 "
puts "(case 6)"
-puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC25925 ALL: Error: The command cannot be built"
-puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
-puts "TODO OCC25925 ALL: TEST INCOMPLETE"
-puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
+puts "TODO OCC25925 ALL: Error : The area of result shape is"
puts "============"
puts "OCC5805"
}
-checknbshapes result -t -wire 5 -face 5 -shell 2 -solid 1
+checknbshapes result -t -wire 3 -face 3 -shell 1 -solid 1
checkview -display result -2d -path ${imagedir}/${test_image}.png
-puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
-puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
-puts "TODO OCC25925 ALL: Error: The command cannot be built"
-puts "TODO OCC25925 ALL: TEST INCOMPLETE"
+puts "TODO OCC25925 ALL: Error : The area of result shape is"
puts "============"
puts "OCC5805"
}
-checknbshapes result -vertex 2 -edge 3 -wire 3 -face 3 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 13
+checknbshapes result -vertex 1 -edge 2 -wire 3 -face 3 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 11
checkview -display result -2d -path ${imagedir}/${test_image}.png
-puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
-puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
-puts "TODO OCC25925 ALL: Error: The command cannot be built"
-puts "TODO OCC25925 ALL: TEST INCOMPLETE"
+puts "TODO OCC25925 ALL: Error : The area of result shape is"
puts "============"
puts "OCC5805"
}
-checknbshapes result -vertex 2 -edge 3 -wire 3 -face 3 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 13
+checknbshapes result -vertex 1 -edge 2 -wire 3 -face 3 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 11
checkview -display result -2d -path ${imagedir}/${test_image}.png
-puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
-puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC25925 ALL: Error: The command cannot be built"
+puts "TODO OCC25925 ALL: Error : The area of result shape is"
puts "============"
puts "OCC5805"
-puts "TODO OCC23068 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC25925 ALL: Error: The command cannot be built"
-puts "TODO OCC25925 ALL: Tcl Exception: result is not a topological shape"
-puts "TODO OCC25925 ALL: TEST INCOMPLETE"
+puts "TODO OCC25925 ALL: Error : The area of result shape is"
puts "============"
puts "OCC5805"
-puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
-puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
-puts "TODO OCC25925 ALL: Error: The command cannot be built"
-puts "TODO OCC25925 ALL: TEST INCOMPLETE"
+puts "TODO OCC25925 ALL: Error : The area of result shape is"
puts "============"
puts "OCC5805"
-puts "TODO OCC25395 ALL: ERROR. offsetperform operation not done."
-
puts "========"
puts "OCC25395"
puts "========"
-puts "TODO OCC25939 ALL: An exception was caught"
-
puts "============"
puts "0025939: S I G S E G V in MakeThickSolid"
puts "============"
-puts "TODO OCC31845 All: ERROR. offsetperform operation not done."
-
puts "============================================"
puts "OCC31845: BRepOffsetAPI_MakeThickSolid fails"
puts "============================================"
-puts "TODO OCC31845 All: ERROR. offsetperform operation not done."
-
puts "============================================"
puts "OCC31845: BRepOffsetAPI_MakeThickSolid fails"
puts "============================================"
--- /dev/null
+puts "================================================================="
+puts "0031601: Modeling Algorithms - BRepOffset_Tool Segmentation Fault"
+puts "================================================================="
+puts ""
+
+pload MODELING
+box b 50 50 10
+explode b E
+compound b_1 b_2 b_3 b_4 b_5 b_6 b_7 b_8 b_9 b_10 b_11 b_12 c
+fillet s b 4 c
+explode s F
+offsetparameter 1.e-7 c a
+offsetload s 1 s_11
+offsetperform r
+checkview -display r -2d -path ${imagedir}/${test_image}.png
-puts "TODO OCC23068 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23068 ALL: Error : The volume of result shape "
-
## ======================================
## Grid : CCV002
## Test : A1
offsetcompshape result s -10 s_1
#real volume of result shape is unknown yet
-checkprops result -v 0
+checkprops result -v 1.01e+06
## Comment : From CV tests serie page 60
## ======================================
-puts "TODO OCC26556 ALL: ERROR. offsetperform operation not done."
restore [locate_data_file CCV_2_d1_gsw.rle] s
explode s F
catch {offsetcompshape result s -2 s_17}
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
+puts "TODO CR23530 ALL: Faulty shapes in variables faulty_1 to faulty_"
+puts "TODO OCC23068 ALL: Error : The area of face "
+
pcone s 5 0 12 90
trotate s 0 0 0 0 0 1 90
OFFSETSHAPE 1 {s_4} $calcul $type
-checkprops result -v 0
+checkprops result -v 78.53988
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
pcone s 5 0 12 270
OFFSETSHAPE -1 {s_4} $calcul $type
-checkprops result -v 0
+checkprops result -v 235.619
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
pcone s 5 0 12 270
OFFSETSHAPE 1 {s_3 s_4} $calcul $type
-checkprops result -v 0
+checkprops result -v 235.619
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
+puts "TODO OCC23068 ALL: Error : The area of face "
+puts "TODO CR23530 ALL: Faulty shapes in variables faulty_1 to faulty_"
psphere s 15 -90 60 90
trotate s 0 0 0 0 0 1 90
OFFSETSHAPE 1 {s_4} $calcul $type
-checkprops result -v 0
+checkprops result -v 3488.84
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
+puts "TODO OCC23068 ALL: Error : The area of face "
+puts "TODO CR23530 ALL: Faulty shapes in variables faulty_1 to faulty_"
psphere s 15 -90 60 270
OFFSETSHAPE 1 {s_4} $calcul $type
-checkprops result -v 0
+checkprops result -v 10466.5
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
psphere s 15 -90 60 270
OFFSETSHAPE -1 {s_4} $calcul $type
-checkprops result -v 0
+checkprops result -v 10466.5
-puts "TODO OCC23068 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23068 ALL: Error : The offset cannot be built."
-puts "TODO OCC23068 ALL: Error: The command cannot be built"
+puts "TODO OCC23068 ALL: Error : The area of face "
psphere s 15 90
trotate s 0 0 0 0 0 1 90
OFFSETSHAPE 1 {s_3} $calcul $type
-checkprops result -v 0
+checkprops result -v 3534.29
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error : The offset cannot be built."
+puts "TODO OCC23068 ALL: Error : The area of face "
psphere s 15 270
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
psphere s 15 270
OFFSETSHAPE -1 {s_2} $calcul $type
-checkprops result -v 0
+checkprops result -v 10602.9
-puts "TODO OCC24156 MacOS: An exception was caught"
-puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
+puts "TODO CR23530 ALL: Faulty shapes in variables faulty_1 to faulty_"
+puts "TODO OCC23068 ALL: Error : The area of face "
ellipse w1 0 0 0 15 10
mkedge w1 w1 0 pi/2
OFFSETSHAPE 1 {s_4} $calcul $type
-checkprops result -v 0
+checkprops result -v 4385.14
-puts "TODO OCC24156 MacOS: An exception was caught"
-puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
ellipse w1 0 0 0 15 10
mkedge w1 w1 0 pi/2
trotate w1 0 0 0 1 0 0 90
OFFSETSHAPE -1 {s_4} $calcul $type
-checkprops result -v 0
+checkprops result -v 4385.14
-puts "TODO OCC24156 MacOS: An exception was caught"
-puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
ellipse w1 0 0 0 15 10
mkedge w1 w1 0 pi/2
trotate w1 0 0 0 1 0 0 90
OFFSETSHAPE 1 {s_4 s_5} $calcul $type
-checkprops result -v 0
+checkprops result -v 4385.14
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
ellipse w1 0 0 0 15 10
mkedge w1 w1 0 pi/2
trotate w1 0 0 0 1 0 0 90
OFFSETSHAPE -1 {s_4 s_5} $calcul $type
-checkprops result -v 0
+checkprops result -v 4385.14
-puts "TODO OCC24156 MacOS: An exception was caught"
-puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
+puts "TODO CR23530 ALL: Faulty shapes in variables faulty_1 to faulty_"
+puts "TODO OCC23068 ALL: Error : The area of face "
ellipse w1 0 0 0 15 10
mkedge w1 w1 0 pi/2
OFFSETSHAPE 1 {s_4} $calcul $type
-checkprops result -v 0
+checkprops result -v 13155.2
-puts "TODO OCC24156 MacOS: An exception was caught"
-puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
cpulimit 400
ellipse w1 0 0 0 15 10
OFFSETSHAPE -1 {s_4} $calcul $type
-checkprops result -v 0
+checkprops result -v 13155.2
-puts "TODO OCC24156 MacOS: An exception was caught"
-puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
ellipse w1 0 0 0 15 10
mkedge w1 w1 0 pi/2
trotate w1 0 0 0 1 0 0 90
OFFSETSHAPE 1 {s_4 s_5} $calcul $type
-checkprops result -v 0
+checkprops result -v 13155.2
-puts "TODO OCC24156 MacOS: An exception was caught"
-puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
# 17.01.2010
cpulimit 600
# 17.01.2010
OFFSETSHAPE -1 {s_4 s_5} $calcul $type
-checkprops result -v 0
+checkprops result -v 13155.2
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
pcylinder s 5 10 270
OFFSETSHAPE -1 {s_5} $calcul $type
-checkprops result -v 0
+checkprops result -v 589.049
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
pcone s 9 4 15 270
OFFSETSHAPE -1 {s_5} $calcul $type
-checkprops result -v 0
+checkprops result -v 1566.87
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
ptorus s 10 10 0 45 270
OFFSETSHAPE -1 {s_4} $calcul $type
-checkprops result -v 0
+checkprops result -v 6083.13
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
circle w -20 0 0 20
mkedge w w 0 pi*2/5
wire w w
OFFSETSHAPE 1 {s_2 s_3} $calcul $type
-checkprops result -v 0
+checkprops result -v 785.398
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
-
circle w -20 0 0 20
mkedge w w 0 pi*2/5
wire w w
OFFSETSHAPE 1 {s_4 s_5} $calcul $type
-checkprops result -v 0
+checkprops result -v 785.398
-puts "TODO OCC24156 MacOS: An exception was caught"
-puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
-puts "TODO OCC23748 ALL: ERROR. offsetperform operation not done."
-puts "TODO OCC23748 ALL: Error: The command cannot be built"
-puts "TODO OCC26556 ALL: Error : The offset cannot be built."
+puts "TODO CR23530 ALL: Faulty shapes in variables faulty_1 to faulty_"
+puts "TODO OCC23068 ALL: Error : The area of face "
beziersurf c 3 2 \
0 0 0 0 5 5 2 14 3 \
OFFSETSHAPE 1 {s_5 s_6} $calcul $type
-checkprops result -v 0
+checkprops result -v 3340
-puts "TODO OCC23068 All: ERROR. offsetperform operation not done."
-puts "TODO OCC23068 All: Error : The volume of result shape is"
# Original bug : hkg60144
# Date : 17Juillet98
offsetshape result s -5 s_1
-checkprops result -v 2.12817e+006
+checkprops result -v 2.80312e+07