//! due to being rejected by bounding boxes intersection.
Standard_EXPORT void ForceInterfEE();
+ //! When all section edges are created and no increase of the tolerance
+ //! of vertices put on the section edges is expected, make sure that
+ //! the created sections have valid range.
+ //! If any of the section edges do not have valid range, remove them
+ //! from Face/Face intersection info and from the input <theMSCPB> map.
+ //! Put such edges into <aMicroEdges> map for further unification of their
+ //! vertices in the PostTreatFF method.
+ //!
+ //! All these section edges have already been checked to have valid range.
+ //! Current check is necessary for the edges whose vertices have also
+ //! been put on other section edges with greater tolerance, which has caused
+ //! increase of the tolerance value of the vertices.
+ Standard_EXPORT void RemoveMicroSectionEdges(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
+ TopTools_IndexedMapOfShape& theMicroEdges);
+
TopTools_ListOfShape myArguments;
BOPDS_PDS myDS;
}
}
}//for (i=0; i<aNbFF; ++i) {
- //
+
+ // Remove "micro" section edges
+ RemoveMicroSectionEdges(aMSCPB, aMicroEdges);
+
// post treatment
MakeSDVerticesFF(aDMVLV, aDMNewSD);
PostTreatFF(aMSCPB, aDMExEdges, aDMNewSD, aMicroEdges, aVertsOnRejectedPB, aAllocator);
}
}
}
+
+//=======================================================================
+//function : RemoveMicroSectionEdges
+//purpose :
+//=======================================================================
+void BOPAlgo_PaveFiller::RemoveMicroSectionEdges
+ (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
+ TopTools_IndexedMapOfShape& theMicroEdges)
+{
+ if (theMSCPB.IsEmpty())
+ // no section edges
+ return;
+
+ // Get all F/F interferences
+ BOPDS_VectorOfInterfFF& aFFs = myDS->InterfFF();
+
+ // Build the new map of section edges avoiding the micro edges
+ BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aSEPBMap;
+ // Analyze all section edges
+ Standard_Integer aNbCPB = theMSCPB.Extent();
+ for (Standard_Integer i = 1; i <= aNbCPB; ++i)
+ {
+ const TopoDS_Shape& aSI = theMSCPB.FindKey(i);
+ const BOPDS_CoupleOfPaveBlocks& aCPB = theMSCPB(i);
+
+ if (aSI.ShapeType() != TopAbs_EDGE)
+ {
+ // Not an edge
+ aSEPBMap.Add(aSI, aCPB);
+ continue;
+ }
+
+ // Get pave block for analysis
+ const Handle(BOPDS_PaveBlock)& aPB = aCPB.PaveBlock1();
+ if (aPB->HasEdge())
+ {
+ // Not a real section edge
+ aSEPBMap.Add(aSI, aCPB);
+ continue;
+ }
+
+ if (!BOPTools_AlgoTools::IsMicroEdge(TopoDS::Edge(aSI), myContext, Standard_False))
+ {
+ // Normal edge
+ aSEPBMap.Add(aSI, aCPB);
+ continue;
+ }
+
+ // Micro edge is found, avoid it in the <theMSCPB> map
+ // and remove from the F/F Intersection info structure
+
+ // Get F/F interference which created this micro edge
+ BOPDS_InterfFF& aFF = aFFs(aCPB.IndexInterf());
+ // Get curve from which this edge has been created
+ BOPDS_Curve& aCurve = aFF.ChangeCurves().ChangeValue(aCPB.Index());
+ // Get all section pave blocks created from this curve
+ BOPDS_ListOfPaveBlock& aLPBC = aCurve.ChangePaveBlocks();
+ // Remove pave block from the list
+ for (BOPDS_ListIteratorOfListOfPaveBlock it(aLPBC); it.More(); it.Next())
+ {
+ if (it.Value() == aPB)
+ {
+ aLPBC.Remove(it);
+ break;
+ }
+ }
+
+ // Add the "micro" edge to the map of "micro" edges for
+ // unification of its vertices in the PostTreatFF method
+ theMicroEdges.Add(aSI);
+ }
+
+ // Overwrite the old map if necessary
+ if (aSEPBMap.Extent() != theMSCPB.Extent())
+ theMSCPB = aSEPBMap;
+}
--- /dev/null
+puts "========"
+puts "OCC29387"
+puts "========"
+puts ""
+#################################################
+# Incorrect result of cut a face with several shapes
+#################################################
+
+restore [locate_data_file bug29387_obj.brep] s
+restore [locate_data_file bug29387_tools.brep] t
+bclearobjects
+bcleartools
+baddobjects s
+baddctools t
+bfillds
+
+# perform GF operation
+bbuild rgf
+checkshape rgf
+checknbshapes rgf -wire 289 -face 288 -shell 14 -solid 14 -t
+checkprops rgf -s 529.587 -v 0.604529
+
+# perform CUT operation
+bbop result 2
+checkshape result
+checknbshapes result -wire 2 -face 1
+checkprops result -s 470.719
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file