void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
TopoDS_Edge& aNewEdge)
{
+ //modified by NIZNHY-PKV Thu Dec 30 11:15:23 2004 f
myErrorStatus=0;
//
+ Standard_Boolean bIsDE;
Standard_Real aT1, aT2;
TopoDS_Vertex aV1, aV2, aVR1, aVR2;
TopoDS_Edge aEx;
//
+ bIsDE=BRep_Tool::Degenerated(aE);
+ //
aEx=aE;
aEx.Orientation(TopAbs_FORWARD);
//
aVR2=TopoDS::Vertex(myOrigins.Find(aV2));
aVR2.Orientation(TopAbs_REVERSED);
//
- BOPTools_Tools::MakeSplitEdge(aEx, aVR1, aT1, aVR2, aT2, aNewEdge);
+ if (bIsDE) {
+ Standard_Real aTol;
+ BRep_Builder aBB;
+ TopoDS_Edge E;
+ TopAbs_Orientation anOrE;
+ //
+ anOrE=aE.Orientation();
+ aTol=BRep_Tool::Tolerance(aE);
+ //
+ E=aEx;
+ E.EmptyCopy();
+ //
+ aBB.Add (E, aVR1);
+ aBB.Add (E, aVR2);
+ aBB.Range(E, aT1, aT2);
+ aBB.Degenerated(E, Standard_True);
+ aBB.UpdateEdge(E, aTol);
+ //
+ aNewEdge=E;
+ }
+ //
+ else {
+ BOPTools_Tools::MakeSplitEdge(aEx, aVR1, aT1, aVR2, aT2, aNewEdge);
+ }
+ //modified by NIZNHY-PKV Thu Dec 30 11:15:28 2004 t
}
//
//=======================================================================
for (; aExpE.More(); aExpE.Next()) {
const TopoDS_Edge& aE=TopoDS::Edge(aExpE.Current());
aER=TopoDS::Edge(myOrigins.Find(aE));
+ //
aER.Orientation(TopAbs_FORWARD);
- // build p-curve
- if (bIsUPeriodic) {
- GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
+ if (!BRep_Tool::Degenerated(aER)) {//modified by NIZNHY-PKV Thu Dec 30 11:31:37 2004 ft
+ // build p-curve
+ if (bIsUPeriodic) {
+ GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
+ }
+ BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
+
+ // orient image
+ bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
+ if (bIsToReverse) {
+ aER.Reverse();
+ }
}
- BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
-
- // orient image
- bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
- if (bIsToReverse) {
- aER.Reverse();
+ else {
+ aER.Orientation(aE.Orientation());
}
//
aBB.Add(newWire, aER);
bRet=Standard_False;
//
aExp.Init(aF, TopAbs_EDGE);
- if (!aExp.More()) {
- return bRet;
- }
- const TopoDS_Edge& aE=TopoDS::Edge(aExp.Current());
- const TopoDS_Edge& aER=TopoDS::Edge(myOrigins.Find(aE));
- //
- aC3D=BRep_Tool::Curve(aE, aT1, aT2);
- aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2);
- aC3D->D0(aT, aP);
- myContext.ProjectPointOnEdge(aP, aER, aTR);
- //
- BOPTools_Tools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF);
- if (aF.Orientation()==TopAbs_REVERSED) {
- aDNF.Reverse();
- }
- //
- BOPTools_Tools3D::GetNormalToFaceOnEdge (aER, aFR, aTR, aDNFR);
- if (aFR.Orientation()==TopAbs_REVERSED) {
- aDNFR.Reverse();
+ for (; aExp.More(); aExp.Next()) {
+ const TopoDS_Edge& aE=TopoDS::Edge(aExp.Current());
+ //modified by NIZNHY-PKV Thu Dec 30 11:38:05 2004 f
+ if (BRep_Tool::Degenerated(aE)) {
+ continue;
+ }
+ //modified by NIZNHY-PKV Thu Dec 30 11:38:08 2004 t
+ const TopoDS_Edge& aER=TopoDS::Edge(myOrigins.Find(aE));
+ //
+ aC3D=BRep_Tool::Curve(aE, aT1, aT2);
+ aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2);
+ aC3D->D0(aT, aP);
+ myContext.ProjectPointOnEdge(aP, aER, aTR);
+ //
+ BOPTools_Tools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF);
+ if (aF.Orientation()==TopAbs_REVERSED) {
+ aDNF.Reverse();
+ }
+ //
+ BOPTools_Tools3D::GetNormalToFaceOnEdge (aER, aFR, aTR, aDNFR);
+ if (aFR.Orientation()==TopAbs_REVERSED) {
+ aDNFR.Reverse();
+ }
+ //
+ aScPr=aDNF*aDNFR;
+ return (aScPr<0.);
}
- //
- aScPr=aDNF*aDNFR;
- return (aScPr<0.);
+ return bRet;
}
//
aNbE=aMPKLE.Extent();
for (i=1; i<=aNbE; ++i) {
TopTools_ListOfShape& aLSDE=aMPKLE.ChangeFromIndex(i);
- aMEE.Clear();
//
+ aMEE.Clear();
iErr=GEOMAlgo_Tools::FindSDShapes(aLSDE, aTol, aMEE, aCtx);
if (iErr) {
return iErr;
TopTools_ListOfShape aLESD;
TopTools_ListIteratorOfListOfShape aIt, aIt1;
TopTools_IndexedMapOfShape aMProcessed;
+ TopAbs_ShapeEnum aType;
//
aNbE=aLE.Extent();
if (!aNbE) {
return 3; // Err
- }
+ }
+ //modified by NIZNHY-PKV Thu Dec 30 10:56:52 2004 f
+ if (aNbE==1) {
+ return 0; // Nothing to do
+ }
+ //modified by NIZNHY-PKV Thu Dec 30 10:56:56 2004 t
//
while(1) {
aNbEProcessed=aMProcessed.Extent();
aIt.Initialize(aLE);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Value();
+ //
if (aMProcessed.Contains(aS)) {
continue;
}
//
+ //modified by NIZNHY-PKV Thu Dec 30 10:57:01 2004 f
+ aType=aS.ShapeType();
+ if (aType==TopAbs_EDGE) {
+ const TopoDS_Edge& aE=TopoDS::Edge(aS);
+ if (BRep_Tool::Degenerated(aE)) {
+ aMProcessed.Add(aE);
+ continue;
+ }
+ }
+ //modified by NIZNHY-PKV Thu Dec 30 10:57:03 2004 t
+ //
aLESD.Clear();
iErr=GEOMAlgo_Tools::FindSDShapes(aS, aLE, aTol, aLESD, aCtx);
if (iErr) {