Fri, 02/21/2020 - 19:42
Forums:
I wrote a subroutine to determine whether a given point lies on a surface:
BRepBuilderAPI_MakeVertex vertexbuilder(p); //p is a gp_Pnt
TopoDS_Vertex vertex = vertexbuilder.Vertex();
BRepExtrema_DistShapeShape extrema;
extrema.LoadS1(F); //F is a TopoDS_Face
extrema.LoadS2(vertex);
extrema.Perform();
if (extrema.IsDone())...
It works fine for the first face. I can run through a whole list of points without a problem. But when it tries to check the second face, extrema.Perform() crashes. The exception occurs in NCollection_Sequence.hxx in the function:
static void delNode (NCollection_SeqNode * theNode,
Handle(NCollection_BaseAllocator)& theAl)
{
((Node *) theNode)->~Node();
theAl->Free(theNode);
}
Any ideas??
Mon, 02/24/2020 - 15:36
Supposedly, there is some memory corruption issue (in your code around or maybe in BRepExtrema_DistShapeShape), which needs to be debugged...
Mon, 03/16/2020 - 18:37
I ran it again using a different STEP file as input and it seems to work fine now. Possibly the STEP file was corrupted. Thanks.