BRepOffset_MakeOffset - Added protection from the Infinite edges.
BOPAlgo_PaveFiller::MakeSplitEdges() - Remove PaveBlocks with same parameters on paves.
BOPAlgo_PaveFiller::PerformVE() - Added protection from edges with no PaveBlocks.
const Handle(BOPDS_PaveBlock)& aPB=aItPB.Value();
const Handle(BOPDS_PaveBlock)& aPBR=myDS->RealPaveBlock(aPB);
//
- nSpR=aPBR->Edge();
+ if (!aPBR->HasEdge(nSpR)) {
+ continue;
+ }
const TopoDS_Shape& aSpR=myDS->Shape(nSpR);
aLS.Append(aSpR);
myOrigins.Bind(aSpR, aE);
continue;
}
//
+ BOPDS_ListOfPaveBlock& aLPB=myDS->ChangePaveBlocks(nE);
+ if (aLPB.IsEmpty()) {
+ continue;
+ }
+ //
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aSIE.Shape()));
const TopoDS_Vertex& aV=(*(TopoDS_Vertex *)(&myDS->Shape(nVx)));
//
// 2
myDS->AddInterf(nV, nE);
// 3
- BOPDS_ListOfPaveBlock& aLPB=myDS->ChangePaveBlocks(nE);
- Handle(BOPDS_PaveBlock)& aPB=*((Handle(BOPDS_PaveBlock)*)&aLPB.First());
+ const BOPDS_ListOfPaveBlock& aLPB=myDS->PaveBlocks(nE);
+ const Handle(BOPDS_PaveBlock)& aPB=*((Handle(BOPDS_PaveBlock)*)&aLPB.First());
//
aPave.SetIndex(nVx);
aPave.SetParameter(aT);
}
//
aItPB.Initialize(aLPB);
- for (; aItPB.More(); aItPB.Next()) {
+ for (; aItPB.More(); ) {
aPB=aItPB.Value();
const Handle(BOPDS_CommonBlock)& aCB=myDS->CommonBlock(aPB);
bCB=!aCB.IsNull();
aPB=aCB->PaveBlock1();
}
//
+ aPB->Range(aT1, aT2);
+ if (aT2 - aT1 < Precision::PConfusion()) {
+ aLPB.Remove(aItPB);
+ continue;
+ }
+ //
if (aMPB.Add(aPB)) {
nE=aPB->OriginalEdge();
aPB->Indices(nV1, nV2);
- aPB->Range(aT1, aT2);
//
aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
aE.Orientation(TopAbs_FORWARD);
}
aBSE.SetProgressIndicator(myProgressIndicator);
}
+ aItPB.Next();
} // for (; aItPB.More(); aItPB.Next()) {
} // for (i=0; i<aNbPBP; ++i) {
//
#ifdef OCCT_DEBUG
cout <<"edge shared by more than two faces"<<endl;
#endif
+ // analyze each intersection
+ BRepOffset_ListOfInterval& aLEI = mapEdgeType(E);
+ TopTools_ListIteratorOfListOfShape aIt1, aIt2;
+ aIt1.Initialize(L);
+ for (; aIt1.More(); aIt1.Next()) {
+ const TopoDS_Face& F1 = TopoDS::Face(aIt1.Value());
+ //
+ aIt2 = aIt1;
+ for (aIt2.Next(); aIt2.More(); aIt2.Next()) {
+ const TopoDS_Face& F2 = TopoDS::Face(aIt2.Value());
+ //
+ EdgeAnalyse(E,F1,F2,SinTol,aLEI);
+ }
+ }
}
}
}
#include <BRepOffset_Tool.hxx>
#include <BRepOffset_Interval.hxx>
#include <BRepOffset_ListOfInterval.hxx>
+#include <BRepOffset_ListIteratorOfListOfInterval.hxx>
#include <BRepOffset_DataMapOfShapeOffset.hxx>
#include <BRepOffset_Offset.hxx>
#include <BRepAdaptor_Curve.hxx>
continue;
}
//
- BRepOffset_Type OT = L.First().Type();
- if (OT != BRepOffset_Convex && OT != BRepOffset_Concave) {
+ BRepOffset_Type OT = L.First().Type();
+ BRepOffset_ListIteratorOfListOfInterval aItInt(L);
+ for (; aItInt.More(); aItInt.Next()) {
+ OT = aItInt.Value().Type();
+ if (OT == BRepOffset_Convex || OT == BRepOffset_Concave) {
+ break;
+ }
+ }
+ //
+ if (!aItInt.More()) {
continue;
}
//
+ //
if (OT == BRepOffset_Concave) CurSide = TopAbs_IN;
else CurSide = TopAbs_OUT;
//-----------------------------------------------------------
// edge is of the proper type, return adjacent faces.
//-----------------------------------------------------------
const TopTools_ListOfShape& Anc = Analyse.Ancestors(E);
- if (Anc.Extent() != 2) {
+ if (Anc.Extent() < 2) {
continue;
}
//
- F1 = TopoDS::Face(Anc.First());
- F2 = TopoDS::Face(Anc.Last());
- //
- aLF1.Append(F1);
- aLF2.Append(F2);
+ it.Initialize(Anc);
+ for (; it.More(); it.Next()) {
+ F1 = TopoDS::Face(it.Value());
+ //
+ it1 = it;
+ for (it1.Next(); it1.More(); it1.Next()) {
+ F2 = TopoDS::Face(it1.Value());
+ //
+ aLF1.Append(F1);
+ aLF2.Append(F2);
+ }
+ }
}
else {
if (!aDMVLF1.IsBound(aS)) {
//purpose : Trim the edge of the largest of descendants in AsDes2d.
// Order in AsDes two vertices that have trimmed the edge.
//=======================================================================
-void TrimEdge(TopoDS_Edge& NE,
- const Handle(BRepAlgo_AsDes)& AsDes2d,
- Handle(BRepAlgo_AsDes)& AsDes,
- TopTools_DataMapOfShapeShape& theETrimEInf)
+static
+ Standard_Boolean TrimEdge(TopoDS_Edge& NE,
+ const Handle(BRepAlgo_AsDes)& AsDes2d,
+ Handle(BRepAlgo_AsDes)& AsDes,
+ TopTools_DataMapOfShapeShape& theETrimEInf)
{
TopoDS_Edge aSourceEdge;
TopoDS_Vertex V1,V2;
theETrimEInf.Bind(NE, aSourceEdge);
}
}
+ return bTrim;
}
//=======================================================================
theEdgesOrigins.Bind(NE, aLSx);
}
//
+ Standard_Boolean bTrimmed = Standard_True;
if (theMES.IsBound(NE)) {
NE = theMES(NE);
NE.Orientation(aS.Orientation());
if (theNewEdges.Add(NE))
{
- TrimEdge (TopoDS::Edge(NE), theAsDes2d, theAsDes, theETrimEInf);
+ bTrimmed = TrimEdge (TopoDS::Edge(NE), theAsDes2d, theAsDes, theETrimEInf);
}
}
else {
theETrimEInf.Bind(anEdge, aNewEdge);
}
}
- theAsDes->Add(NF, NE);
+ if (bTrimmed) {
+ theAsDes->Add(NF, NE);
+ }
}
}
}
TopoDS_Vertex aV1, aV2;
TopExp::Vertices(TopoDS::Edge(aE), aV1, aV2);
//
- aGFE.AddArgument(aV1);
- aGFE.AddArgument(aV2);
+ if (!aV1.IsNull()) {
+ aGFE.AddArgument(aV1);
+ }
+ //
+ if (!aV2.IsNull()) {
+ aGFE.AddArgument(aV2);
+ }
//
aGFE.Perform();
//
//
TopExp_Explorer aExp(aCEIm, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
- const TopoDS_Shape& aEIm = aExp.Current();
+ const TopoDS_Edge& aEIm = TopoDS::Edge(aExp.Current());
+ //
+ // check the split to be trimmed
+ Standard_Real aFirst, aLast;
+ BRep_Tool::Range(aEIm, aFirst, aLast);
+ if (Precision::IsInfinite(aFirst) || Precision::IsInfinite(aLast)) {
+ continue;
+ }
//
// check the split not to contain bounding vertices
TopExp_Explorer aExpV(aEIm, TopAbs_VERTEX);