mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028113: BOPAlgo_Builder produces invalid shape
Fast rebuilding of the face is now avoided if its edges have been unified during the intersection. Full rebuilding of the face is required in this case (using BuilderFace algorithm).
This commit is contained in:
@@ -865,6 +865,10 @@ TopoDS_Face BuildDraftFace(const TopoDS_Face& theFace,
|
||||
// possibility of split.
|
||||
TopTools_DataMapOfShapeListOfShape aVerticesCounter;
|
||||
|
||||
// Check that the edges of the initial face have not been unified during intersection.
|
||||
// Otherwise, it will be necessary to check validity of the new wires.
|
||||
TopTools_MapOfShape aMEdges;
|
||||
|
||||
// Update wires of the original face and add them to draft face
|
||||
TopoDS_Iterator aItW(theFace.Oriented(TopAbs_FORWARD));
|
||||
for (; aItW.More(); aItW.Next())
|
||||
@@ -895,6 +899,8 @@ TopoDS_Face BuildDraftFace(const TopoDS_Face& theFace,
|
||||
|
||||
// Check if the original edge is degenerated
|
||||
Standard_Boolean bIsDegenerated = BRep_Tool::Degenerated(aE);
|
||||
// Check if the original edge is closed on the face
|
||||
Standard_Boolean bIsClosed = BRep_Tool::IsClosed(aE, theFace);
|
||||
|
||||
// Check for the splits of the edge
|
||||
const TopTools_ListOfShape* pLEIm = theImages.Seek(aE);
|
||||
@@ -904,13 +910,14 @@ TopoDS_Face BuildDraftFace(const TopoDS_Face& theFace,
|
||||
if (!bIsDegenerated && HasMultiConnected(aE, aVerticesCounter))
|
||||
return TopoDS_Face();
|
||||
|
||||
// Check edges unification
|
||||
if (!bIsClosed && !aMEdges.Add(aE))
|
||||
return TopoDS_Face();
|
||||
|
||||
aBB.Add(aNewWire, aE);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if the original edge is closed on the face
|
||||
Standard_Boolean bIsClosed = BRep_Tool::IsClosed(aE, theFace);
|
||||
|
||||
TopTools_ListIteratorOfListOfShape aItLEIm(*pLEIm);
|
||||
for (; aItLEIm.More(); aItLEIm.Next())
|
||||
{
|
||||
@@ -920,6 +927,10 @@ TopoDS_Face BuildDraftFace(const TopoDS_Face& theFace,
|
||||
if (!bIsDegenerated && HasMultiConnected(aSp, aVerticesCounter))
|
||||
return TopoDS_Face();
|
||||
|
||||
// Check edges unification
|
||||
if (!bIsClosed && !aMEdges.Add(aSp))
|
||||
return TopoDS_Face();
|
||||
|
||||
aSp.Orientation(anOriE);
|
||||
if (bIsDegenerated)
|
||||
{
|
||||
|
Reference in New Issue
Block a user