View Issue Details

IDProjectCategoryView StatusLast Update
0029963CommunityOCCT:Modeling Algorithmspublic2018-07-16 15:15
ReporterMatthias Leuenberger Assigned Tomsv 
PrioritynormalSeverityminor 
Status newResolutionopen 
PlatformWindowsOSVC++ 2012 
Product Version7.3.0 
Summary0029963: BRepAlgo_NormalProjection not successful (even crashes in release)
DescriptionThe following function crashes on my side:

try
{
    STEPControl_Reader edgeReader;
    edgeReader.ReadFile("edge.step"));
    edgeReader.TransferRoots();
    auto edge = edgeReader.OneShape();
    STEPControl_Reader shapeWriter;
    shapeWriter.ReadFile("shape.step"));
    shapeWriter.TransferRoots();
    auto shape = shapeWriter.OneShape();

    BRepAlgo_NormalProjection projector(shape);
    projector.Add(edge);
    projector.Build();
}
catch (Standard_Failure const& f){}


The crash happens in ProjLib_CompProjectedCurve.cxx at line 1938:

      const Extrema_POnSurf &aPOnS = theSplitDS.myExtPS->Point(aMinIdx);

aMinIdx is -1, and thus Point is throwing an exception. Surprisingly, the exception isn't caught, and the program crashes. I suspect that it could be a optimisation problem (Compiler VC12, release). In debug the exception is caught.

Additionally, I looked a bit into the projection algorithm, and I think that there should be something like

      const Standard_Integer aNbPext = theSplitDS.myExtPS->NbExt();
      if (aNbPext == 0)
    return;

some lines above (i.e. return; instead of throw). Because if aNbPext == 0, the input edge doesn't need the be split. I tested it and in that case the algorithm succeeds.
Steps To ReproduceThe files edge.step and shape.step are attached.
TagsNo tags attached.
Test case number

Attached Files

  • Projection.zip (5,529 bytes)

Activities

Matthias Leuenberger

2018-07-16 15:15

reporter  

Projection.zip (5,529 bytes)

Issue History

Date Modified Username Field Change
2018-07-16 15:15 Matthias Leuenberger New Issue
2018-07-16 15:15 Matthias Leuenberger Assigned To => msv
2018-07-16 15:15 Matthias Leuenberger File Added: Projection.zip