static
Standard_Boolean IsMicroEdge(const TopoDS_Edge& theEdge,
- const Handle(IntTools_Context)& theCtx,
- Standard_Real& theFuzz);
+ const Handle(IntTools_Context)& theCtx);
static
Standard_Boolean ComputeBiNormal(const TopoDS_Face& theF,
Handle(BRepAlgo_AsDes) AsDes2d = new BRepAlgo_AsDes();
for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) {
const TopoDS_Face& FI = TopoDS::Face(Exp.Current());
-// Modified by skv - Mon Jan 12 11:50:02 2004 OCC4455 Begin
-// BRepOffset_Inter2d::ConnexIntByInt (FI,MapSF(FI),MES,Build,AsDes2d,myTol);
- BRepOffset_Inter2d::ConnexIntByInt (FI,MapSF(FI),MES,Build,AsDes,AsDes2d,myOffset, myTol);
-// Modified by skv - Mon Jan 12 11:50:03 2004 OCC4455 End
+ Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(FI);
+ BRepOffset_Inter2d::ConnexIntByInt (FI, MapSF(FI), MES, Build,
+ AsDes, AsDes2d, myOffset, aCurrFaceTol);
}
//-----------------------------------------------------------
// Great restriction of new edges and update of AsDes.
TopTools_ListIteratorOfListOfShape itLFE(LFE);
for (; itLFE.More(); itLFE.Next()) {
const TopoDS_Face& NEF = TopoDS::Face(itLFE.Value());
- BRepOffset_Inter2d::Compute(AsDes,NEF,NewEdges,myTol);
+ Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(NEF);
+ BRepOffset_Inter2d::Compute(AsDes, NEF, NewEdges, aCurrFaceTol);
}
//----------------------------------------------
// Intersections 2d on caps.
Standard_Integer i;
for (i = 1; i <= myFaces.Extent(); i++) {
const TopoDS_Face& Cork = TopoDS::Face(myFaces(i));
- BRepOffset_Inter2d::Compute(AsDes,Cork,NewEdges,myTol);
+ Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(Cork);
+ BRepOffset_Inter2d::Compute(AsDes, Cork, NewEdges, aCurrFaceTol);
}
//-------------------------------
aBB.MakeCompound(aFaces);
//
// firstly it is necessary to fuse all the edges
- Standard_Real aFuzz = 0.;
Handle(IntTools_Context) aCtx = new IntTools_Context();
//
aItLF.Initialize(theLF);
continue;
}
//
- if (IsMicroEdge(aE, aCtx, aFuzz)) {
+ if (IsMicroEdge(aE, aCtx)) {
continue;
}
//
BOPAlgo_Builder aGFE;
//
aGFE.SetArguments(aLS);
- aGFE.SetFuzzyValue(aFuzz);
aGFE.Perform();
if (aGFE.ErrorStatus() == 0) {
// fill map with edges images
}
}
//
- aFuzz = 0.;
// the edges by which the offset face should be split
const TopTools_ListOfShape& aLE = theAsDes->Descendant(aF);
aItLE.Initialize(aLE);
for (; aItLE1.More(); aItLE1.Next()) {
const TopoDS_Edge& aEIm = *(TopoDS_Edge*)&aItLE1.Value();
// check for micro edge
- if (IsMicroEdge(aEIm, aCtx, aFuzz)) {
+ if (IsMicroEdge(aEIm, aCtx)) {
continue;
}
//
}
}
else {
- if (IsMicroEdge(aE, aCtx, aFuzz)) {
+ if (IsMicroEdge(aE, aCtx)) {
continue;
}
aLS.Append(aE);
BOPAlgo_Builder aGF;
//
aGF.SetArguments(aLS);
- aGF.SetFuzzyValue(aFuzz);
aGF.Perform();
if (aGF.ErrorStatus()) {
theLFailed.Append(aF);
Standard_Integer i;
for (i = 1; i <= Modif.Extent(); i++) {
const TopoDS_Face& F = TopoDS::Face(Modif(i));
- BRepOffset_Inter2d::Compute(myAsDes,F,NewEdges,myTol);
+ Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(F);
+ BRepOffset_Inter2d::Compute(myAsDes,F,NewEdges,aCurrFaceTol);
}
#ifdef OCCT_DEBUG
TopTools_ListIteratorOfListOfShape itr;
const TopTools_ListOfShape& Roots = myInitOffsetFace.Roots();
TopTools_ListOfShape LOF;
+ TopTools_MapOfShape aMFence;
//----------------------------------
// Loop on all faces //.
//----------------------------------
for (itr.Initialize(Roots); itr.More(); itr.Next()) {
TopoDS_Face F = TopoDS::Face(myInitOffsetFace.Image(itr.Value()).First());
- LOF.Append(F);
+ if (!myImageOffset.HasImage(F) && aMFence.Add(F)) {
+ LOF.Append(F);
+ }
}
- myMakeLoops.BuildFaces(LOF,myAsDes,myImageOffset);
-
+ //
+ if ((myJoin == GeomAbs_Intersection) && myInter) {
+ TopTools_ListOfShape aLFailed;
+ TopTools_IndexedDataMapOfShapeListOfShape anOr;
+ BuildSplitsOfFaces(LOF, myAsDes, anOr, myImageOffset, aLFailed, Standard_True);
+ if (aLFailed.Extent()) {
+ myMakeLoops.Build(aLFailed, myAsDes, myImageOffset);
+ }
+ }
+ else {
+ myMakeLoops.BuildFaces(LOF,myAsDes,myImageOffset);
+ }
+ //
#ifdef OCCT_DEBUG
if ( ChronBuild) Clock.Show();
#endif
//purpose :
//=======================================================================
Standard_Boolean IsMicroEdge(const TopoDS_Edge& theEdge,
- const Handle(IntTools_Context)& theCtx,
- Standard_Real& theFuzz)
+ const Handle(IntTools_Context)& theCtx)
{
TopoDS_Vertex aV1, aV2;
TopExp::Vertices(theEdge, aV1, aV2);
}
//
if (bMicro) {
- Standard_Real aLen = CPnts_AbscissaPoint::Length(aBAC);
- if (aLen > theFuzz) {
- theFuzz = aLen;
+ if (aBAC.GetType() == GeomAbs_Line) {
+ BRep_Builder aBB;
+ Standard_Real aLen = CPnts_AbscissaPoint::Length(aBAC);
+ //
+ aBB.UpdateVertex(aV1, aLen/2.);
+ aBB.UpdateVertex(aV2, aLen/2.);
}
}
//