The PerformIntersectionAtEnd code is currently not handling all the faces
correctly. If it retrieves Face[0] as F, it can happen that the previously
ran code didn't actually retrieve any faces in this array at all.
For example when:
* "if (nface==3)" is true
- "if (!findonf1)" is true (doesn't assign any faces to this array)
- "if (!findonf2)" is true (doesn't assign any faces to this array)
- "if (state == ChFiDS_OnSame)" is not true (because it is
ChFiDS_AllSame)
- "if (findonf1 && !isOnSame1)" cannot be true (see above, but would
handle faces)
- "if (findonf2 && !isOnSame2)" cannot be true (see above, but would
handle faces)
- "if (isOnSame2)" is false (but would also handle faces)
Since no faces were assigned here, F would be a NULL face. As result, the
function will crash when trying to access the Surface behind the face via
`BRep_Tool::Surface(F);`.
While the best approach would be to identify the implementation bug in the
algorithm behind PerformIntersectionAtEnd, a check + exception is used
instead because the actual algorithm is not known.
Signed-off-by: Charlemagne Lasse <charlemagnelasse@gmail.com>
F=Face[nb-1];
if (!prolface[nb-1]) faceprol[nb-1]=F;
}
+
+ if (F.IsNull()) throw Standard_NullObject("IntersectionAtEnd : Trying to intersect with NULL face");
+
Sfacemoins1=BRep_Tool::Surface(F);
Handle(Geom_Curve) cint;
Handle(Geom2d_Curve) C2dint1, C2dint2,cface,cfacemoins1;
--- /dev/null
+puts "TODO OCC32930 ALL: Tcl Exception"
+puts "TODO OCC32930 ALL: TEST INCOMPLETE"
+
+puts "============"
+puts "OCC32930: Modeling Algorithms - Crash in PerformIntersectionAtEnd when no face was found"
+puts "============"
+puts ""
+
+# Load & prepare data.
+restore [locate_data_file bug32930.brep] b
+explode b E
+
+# Make screenshot before filleting.
+smallview
+donly b b_10
+fit
+xwd $imagedir/${test_image}_1.png
+
+# Make fillet.
+blend result b 1 b_10
+
+# Make screenshot after filleting.
+donly result
+fit
+xwd $imagedir/${test_image}_2.png
+