1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0029182: BOPAlgo_PaveFiller sometimes raises exception in parallel mode

Data races have been prevented in the code of BOPAlgo_PaveFiller that makes pcurves of edges on faces. For that:
- Put into treatment only unique edge-face pairs.
- If the same edge is treated with different faces in different threads simultaneously this also causes data races. To avoid this make the edge's copy in each thread and update the copy. The original edge is updated only after finishing parallel processing.

The new method BOPTools_AlgoTools::CopyEdge has been added to make a copy of an edge with vertices.

Big screenshot in the test script tests/bugs/modalg_7/bug28200 has been replaced with a small one.
This commit is contained in:
msv
2017-10-06 17:07:50 +03:00
committed by bugmaster
parent 5fbe3d01e6
commit 56c62737ee
6 changed files with 168 additions and 47 deletions

View File

@@ -248,7 +248,9 @@ public:
//! Compute a 3D-point on the edge <aEdge> at parameter <aPrm>
Standard_EXPORT static void PointOnEdge (const TopoDS_Edge& aEdge, const Standard_Real aPrm, gp_Pnt& aP);
//! Makes a copy of <theEdge> with vertices.
Standard_EXPORT static TopoDS_Edge CopyEdge(const TopoDS_Edge& theEdge);
//! Make the edge from base edge <aE1> and two vertices <aV1,aV2>
//! at parameters <aP1,aP2>

View File

@@ -132,6 +132,20 @@ void BOPTools_AlgoTools::MakeSectEdge(const IntTools_Curve& aIC,
}
//=======================================================================
// function: CopyEdge
// purpose:
//=======================================================================
TopoDS_Edge BOPTools_AlgoTools::CopyEdge(const TopoDS_Edge& theEdge)
{
TopoDS_Edge aNewEdge = TopoDS::Edge(theEdge.Oriented(TopAbs_FORWARD));
aNewEdge.EmptyCopy();
for (TopoDS_Iterator it(theEdge, Standard_False); it.More(); it.Next())
BRep_Builder().Add(aNewEdge, it.Value());
aNewEdge.Orientation(theEdge.Orientation());
return aNewEdge;
}
//=======================================================================
// function: MakeSplitEdge
// purpose:
@@ -143,9 +157,6 @@ void BOPTools_AlgoTools::MakeSplitEdge(const TopoDS_Edge& aE,
const Standard_Real aP2,
TopoDS_Edge& aNewEdge)
{
Standard_Real aTol;//f, l,
aTol=BRep_Tool::Tolerance(aE);
//
TopoDS_Edge E = TopoDS::Edge(aE.Oriented(TopAbs_FORWARD));
E.EmptyCopy();
//
@@ -157,7 +168,6 @@ void BOPTools_AlgoTools::MakeSplitEdge(const TopoDS_Edge& aE,
BB.Add (E, aV2);
}
BB.Range(E, aP1, aP2);
BB.UpdateEdge(E, aTol);
aNewEdge=E;
aNewEdge.Orientation(aE.Orientation());
}