occt: master 329e5df9

Author Committer Branch Timestamp Parent
Chris Hennes (chennes) bugmaster master 2021-02-27 17:58:50 master 7fd4958d
Affected Issues  0032181: Modeling Algorithms - ChFi3d missing error checking
Changeset 0032181: Modeling Algorithms - ChFi3d missing error checking

Throughout the ChFi3d fillet creation functions there are two sets of unchecked
errors that can result in segmentation faults when geometry-creation problems
occur.

The first is that the functions ChFi3d_cherche_* may fail to find the requested
item: they silently return without setting the required reference, which is
then accessed by the algorithms. This can be caught with a conditional at the
end of the function that throws an exception if the required item was not
found.

The second class of unchecked error is the use of BRep_Tool::CurveOnSurface,
which may fail to create the required curve, returning a null handle. In many
cases in the existing fillet code this is not checked. This can be dealt with
by checking the returned handle using IsNull() and throwing an exception
if the call did not result in valid geometry.
mod - src/ChFi3d/ChFi3d_Builder_0.cxx Diff File
mod - src/ChFi3d/ChFi3d_Builder_C1.cxx Diff File
mod - src/ChFi3d/ChFi3d_Builder_CnCrn.cxx Diff File