diff --git a/src/IntPatch/IntPatch_ImpImpIntersection_1.gxx b/src/IntPatch/IntPatch_ImpImpIntersection_1.gxx index bcf3d2cd92..ae67ca8aad 100755 --- a/src/IntPatch/IntPatch_ImpImpIntersection_1.gxx +++ b/src/IntPatch/IntPatch_ImpImpIntersection_1.gxx @@ -21,6 +21,9 @@ static Standard_Boolean IntPCy (const IntSurf_Quadric&, static Standard_Boolean IntPSp (const IntSurf_Quadric&, const IntSurf_Quadric&, + //modified by NIZNHY-PKV Tue Sep 20 08:59:56 2011t + const Standard_Real, + //modified by NIZNHY-PKV Tue Sep 20 08:59:52 2011t const Standard_Real, const Standard_Boolean, Standard_Boolean&, diff --git a/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx b/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx index 519c607eba..da1aac68c8 100755 --- a/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx +++ b/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx @@ -98,7 +98,10 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1, case GeomAbs_Sphere: { quad2.SetValue(S2->Sphere()); - if (!IntPSp(quad1,quad2,TolTang,Standard_False,empt,slin,spnt)) { + //modified by NIZNHY-PKV Tue Sep 20 09:03:06 2011f + if (!IntPSp(quad1,quad2,Tolang,TolTang,Standard_False,empt,slin,spnt)) { + //if (!IntPSp(quad1,quad2,TolTang,Standard_False,empt,slin,spnt)) { + //modified by NIZNHY-PKV Tue Sep 20 09:03:10 2011t return; } if (empt) { @@ -208,7 +211,10 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1, case GeomAbs_Plane: { quad2.SetValue(S2->Plane()); - if (!IntPSp(quad1,quad2,TolTang,Standard_True,empt,slin,spnt)) { + //modified by NIZNHY-PKV Tue Sep 20 09:03:35 2011f + if (!IntPSp(quad1,quad2,Tolang,TolTang,Standard_True,empt,slin,spnt)) { + //if (!IntPSp(quad1,quad2,TolTang,Standard_True,empt,slin,spnt)) { + //modified by NIZNHY-PKV Tue Sep 20 09:03:38 2011t return; } if (empt) { diff --git a/src/IntPatch/IntPatch_ImpImpIntersection_3.gxx b/src/IntPatch/IntPatch_ImpImpIntersection_3.gxx index 5302cb52e5..c9e9eb7cbe 100755 --- a/src/IntPatch/IntPatch_ImpImpIntersection_3.gxx +++ b/src/IntPatch/IntPatch_ImpImpIntersection_3.gxx @@ -3,13 +3,35 @@ // Author: Jacques GOUSSARD // Copyright: OPEN CASCADE 1992 +//modified by NIZNHY-PKV Thu Sep 15 11:09:12 2011 +static + void SeamPosition(const gp_Pnt& aPLoc, + const gp_Ax3& aPos, + gp_Ax2& aSeamPos); +static + void AdjustToSeam (const gp_Cylinder& aQuad, + gp_Circ& aCirc); +static + void AdjustToSeam (const gp_Sphere& aQuad, + gp_Circ& aCirc, + const Standard_Real aTolAng); +static + void AdjustToSeam (const gp_Cone& aQuad, + gp_Circ& aCirc); +//modified by NIZNHY-PKV Thu Sep 15 11:09:13 2011 + +//======================================================================= +//function : IntPP +//purpose : +// Traitement du cas Plan/Plan +//======================================================================= Standard_Boolean IntPP (const IntSurf_Quadric& Quad1, const IntSurf_Quadric& Quad2, const Standard_Real Tolang, const Standard_Real TolTang, Standard_Boolean& Same, IntPatch_SequenceOfLine& slin) -// Traitement du cas Plan/Plan + { IntSurf_TypeTrans trans1,trans2; IntAna_ResultType typint; @@ -37,12 +59,17 @@ Standard_Boolean IntPP (const IntSurf_Quadric& Quad1, trans1 = IntSurf_In; trans2 = IntSurf_Out; } - Handle(IntPatch_GLine) glig = new IntPatch_GLine (linsol,Standard_False,trans1,trans2); + Handle(IntPatch_GLine) glig = + new IntPatch_GLine (linsol,Standard_False,trans1,trans2); slin.Append(glig); } return Standard_True; } -//==================================================================================== +//======================================================================= +//function : IntPCy +//purpose : +// Traitement du cas Plan/Cylindre et reciproquement +//======================================================================= Standard_Boolean IntPCy (const IntSurf_Quadric& Quad1, const IntSurf_Quadric& Quad2, const Standard_Real Tolang, @@ -51,7 +78,6 @@ Standard_Boolean IntPCy (const IntSurf_Quadric& Quad1, Standard_Boolean& Empty, IntPatch_SequenceOfLine& slin) -// Traitement du cas Plan/Cylindre et reciproquement { gp_Pln Pl; gp_Cylinder Cy; @@ -76,14 +102,12 @@ Standard_Boolean IntPCy (const IntSurf_Quadric& Quad1, switch (typint) { - case IntAna_Empty : - { + case IntAna_Empty : { Empty = Standard_True; } - break; + break; - case IntAna_Line: - { + case IntAna_Line: { gp_Lin linsol = inter.Line(1); gp_Pnt orig(linsol.Location()); if (NbSol == 1) { // ligne de tangence @@ -128,7 +152,8 @@ Standard_Boolean IntPCy (const IntSurf_Quadric& Quad1, } slin.Append(glig); } - else { // on a 2 droites. Il faut determiner les transitions + else { + // on a 2 droites. Il faut determiner les transitions // de chacune. if (linsol.Direction().DotCross(Quad2.Normale(orig), @@ -140,7 +165,8 @@ Standard_Boolean IntPCy (const IntSurf_Quadric& Quad1, trans1 = IntSurf_In; trans2 = IntSurf_Out; } - Handle(IntPatch_GLine) glig = new IntPatch_GLine(linsol, Standard_False,trans1,trans2); + Handle(IntPatch_GLine) glig = + new IntPatch_GLine(linsol, Standard_False,trans1,trans2); slin.Append(glig); linsol = inter.Line(2); @@ -159,15 +185,19 @@ Standard_Boolean IntPCy (const IntSurf_Quadric& Quad1, slin.Append(glig); } } - break; - - case IntAna_Circle: - { - gp_Circ cirsol = inter.Circle(1); + break; + // + case IntAna_Circle: { + gp_Circ cirsol; gp_Pnt ptref; gp_Vec Tgt; + // + cirsol = inter.Circle(1); + //modified by NIZNHY-PKV Thu Sep 15 11:30:03 2011f + AdjustToSeam(Cy, cirsol); + //modified by NIZNHY-PKV Thu Sep 15 11:30:15 2011t ElCLib::D1(0.,cirsol,ptref,Tgt); - + if (Tgt.DotCross(Quad2.Normale(ptref),Quad1.Normale(ptref)) > 0.0) { trans1 = IntSurf_Out; trans2 = IntSurf_In; @@ -179,15 +209,14 @@ Standard_Boolean IntPCy (const IntSurf_Quadric& Quad1, Handle(IntPatch_GLine) glig = new IntPatch_GLine(cirsol,Standard_False,trans1,trans2); slin.Append(glig); } - break; - - case IntAna_Ellipse: - { + break; + // + case IntAna_Ellipse: { gp_Elips elipsol = inter.Ellipse(1); gp_Pnt ptref; gp_Vec Tgt; ElCLib::D1(0.,elipsol,ptref,Tgt); - + if (Tgt.DotCross(Quad2.Normale(ptref),Quad1.Normale(ptref)) > 0.0) { trans1 = IntSurf_Out; trans2 = IntSurf_In; @@ -199,25 +228,31 @@ Standard_Boolean IntPCy (const IntSurf_Quadric& Quad1, Handle(IntPatch_GLine) glig = new IntPatch_GLine(elipsol,Standard_False,trans1,trans2); slin.Append(glig); } - break; - - default: - { + break; + // + default: { return Standard_False; // on ne doit pas passer ici } } return Standard_True; } -//==================================================================================== +//======================================================================= +//function : IntPSp +//purpose : +// Traitement du cas Plan/Sphere et reciproquement +//======================================================================= Standard_Boolean IntPSp (const IntSurf_Quadric& Quad1, const IntSurf_Quadric& Quad2, + //modified by NIZNHY-PKV Tue Sep 20 08:59:36 2011f + const Standard_Real Tolang, + //modified by NIZNHY-PKV Tue Sep 20 08:59:39 2011t const Standard_Real TolTang, const Standard_Boolean Reversed, Standard_Boolean& Empty, IntPatch_SequenceOfLine& slin, IntPatch_SequenceOfPoint& spnt) -// Traitement du cas Plan/Sphere et reciproquement + { gp_Circ cirsol; gp_Pln Pl; @@ -242,15 +277,12 @@ Standard_Boolean IntPSp (const IntSurf_Quadric& Quad1, Empty = Standard_False; switch (typint) { - - case IntAna_Empty : - { + case IntAna_Empty : { Empty = Standard_True; } - break; - - case IntAna_Point: - { + break; + // + case IntAna_Point: { gp_Pnt psol = inter.Point(1); Standard_Real U1,V1,U2,V2; Quad1.Parameters(psol,U1,V1); @@ -260,11 +292,13 @@ Standard_Boolean IntPSp (const IntSurf_Quadric& Quad1, ptsol.SetParameters(U1,V1,U2,V2); spnt.Append(ptsol); } - break; - - case IntAna_Circle: - { + break; + // + case IntAna_Circle: { cirsol = inter.Circle(1); + //modified by NIZNHY-PKV Thu Sep 15 11:30:03 2011f + AdjustToSeam(Sp, cirsol, Tolang); + //modified by NIZNHY-PKV Thu Sep 15 11:30:15 2011t gp_Pnt ptref; gp_Vec Tgt; ElCLib::D1(0.,cirsol,ptref,Tgt); @@ -280,16 +314,19 @@ Standard_Boolean IntPSp (const IntSurf_Quadric& Quad1, Handle(IntPatch_GLine) glig = new IntPatch_GLine(cirsol,Standard_False,trans1,trans2); slin.Append(glig); } - break; - - default: - { + break; + + default: { return Standard_False; // on ne doit pas passer ici } } return Standard_True; } -//==================================================================================== +//======================================================================= +//function : IntPCo +//purpose : +// Traitement du cas Plan/Cone et reciproquement +//======================================================================= Standard_Boolean IntPCo (const IntSurf_Quadric& Quad1, const IntSurf_Quadric& Quad2, const Standard_Real Tolang, @@ -300,7 +337,7 @@ Standard_Boolean IntPCo (const IntSurf_Quadric& Quad1, IntPatch_SequenceOfLine& slin, IntPatch_SequenceOfPoint& spnt) -// Traitement du cas Plan/Cone et reciproquement + { gp_Pnt apex; @@ -323,16 +360,16 @@ Standard_Boolean IntPCo (const IntSurf_Quadric& Quad1, } inter.Perform(Pl,Co,Tolang,TolTang); - if (!inter.IsDone()) {return Standard_False;} - + if (!inter.IsDone()) { + return Standard_False; + } + // typint = inter.TypeInter(); Standard_Integer NbSol = inter.NbSolutions(); Empty = Standard_False; switch (typint) { - - case IntAna_Point: - { + case IntAna_Point: { gp_Pnt psol = inter.Point(1); Standard_Real U1,V1,U2,V2; Quad1.Parameters(psol,U1,V1); @@ -342,10 +379,9 @@ Standard_Boolean IntPCo (const IntSurf_Quadric& Quad1, ptsol.SetParameters(U1,V1,U2,V2); spnt.Append(ptsol); } - break; - - case IntAna_Line: - { + break; + + case IntAna_Line: { gp_Lin linsol = inter.Line(1); if (linsol.Direction().Dot(Co.Axis().Direction()) <0.) { linsol.SetDirection(linsol.Direction().Reversed()); @@ -355,7 +391,7 @@ Standard_Boolean IntPCo (const IntSurf_Quadric& Quad1, Standard_Real U1,V1,U2,V2; Quad1.Parameters(apex,U1,V1); Quad2.Parameters(apex,U2,V2); - + if (NbSol == 1) { // ligne de tangence IntPatch_Point ptsol; ptsol.SetValue(apex,TolTang,Standard_False); @@ -372,10 +408,9 @@ Standard_Boolean IntPCo (const IntSurf_Quadric& Quad1, Normp = Quad2.Normale(ptbid); Normco = Quad1.Normale(ptbid); } - IntSurf_Situation situco,situco_otherside; IntSurf_Situation situp,situp_otherside; - + if (Normp.Dot(TestCurvature) > 0.) { situco = IntSurf_Outside; situco_otherside = IntSurf_Inside; @@ -504,100 +539,71 @@ Standard_Boolean IntPCo (const IntSurf_Quadric& Quad1, } } break; - - case IntAna_Circle: - { + + case IntAna_Circle: { gp_Circ cirsol = inter.Circle(1); -#if 0 - if (ElCLib::LineParameter(Co.Axis(),cirsol.Location()) < - ElCLib::LineParameter(Co.Axis(),apex) ) { - Empty = Standard_True; + //modified by NIZNHY-PKV Thu Sep 15 11:34:04 2011f + AdjustToSeam(Co, cirsol); + //modified by NIZNHY-PKV Thu Sep 15 11:36:08 2011t + gp_Pnt ptref; + gp_Vec Tgt; + ElCLib::D1(0.,cirsol,ptref,Tgt); + + if (Tgt.DotCross(Quad2.Normale(ptref),Quad1.Normale(ptref)) >0.) { + trans1 = IntSurf_Out; + trans2 = IntSurf_In; } -#endif - if(0) { } else { - - gp_Pnt ptref; - gp_Vec Tgt; - ElCLib::D1(0.,cirsol,ptref,Tgt); - - if (Tgt.DotCross(Quad2.Normale(ptref),Quad1.Normale(ptref)) >0.) { - trans1 = IntSurf_Out; - trans2 = IntSurf_In; - } - else { - trans1 = IntSurf_In; - trans2 = IntSurf_Out; - } - Handle(IntPatch_GLine) glig = new IntPatch_GLine(cirsol,Standard_False,trans1,trans2); - slin.Append(glig); + trans1 = IntSurf_In; + trans2 = IntSurf_Out; } + Handle(IntPatch_GLine) glig = new IntPatch_GLine(cirsol,Standard_False,trans1,trans2); + slin.Append(glig); } - break; - - case IntAna_Ellipse: - { + break; + + case IntAna_Ellipse: { gp_Elips elipsol = inter.Ellipse(1); -#if 0 - if (ElCLib::LineParameter(Co.Axis(),elipsol.Location()) < - ElCLib::LineParameter(Co.Axis(),apex) ) { - Empty = Standard_True; + gp_Pnt ptref; + gp_Vec Tgt; + ElCLib::D1(0.,elipsol,ptref,Tgt); + + if (Tgt.DotCross(Quad2.Normale(ptref),Quad1.Normale(ptref)) >0.) { + trans1 = IntSurf_Out; + trans2 = IntSurf_In; } -#endif - if(0) { } else { - gp_Pnt ptref; - gp_Vec Tgt; - ElCLib::D1(0.,elipsol,ptref,Tgt); - - if (Tgt.DotCross(Quad2.Normale(ptref),Quad1.Normale(ptref)) >0.) { - trans1 = IntSurf_Out; - trans2 = IntSurf_In; - } - else { - trans1 = IntSurf_In; - trans2 = IntSurf_Out; - } - Handle(IntPatch_GLine) glig = new IntPatch_GLine(elipsol,Standard_False,trans1,trans2); - slin.Append(glig); + trans1 = IntSurf_In; + trans2 = IntSurf_Out; } + Handle(IntPatch_GLine) glig = new IntPatch_GLine(elipsol,Standard_False,trans1,trans2); + slin.Append(glig); } - break; - - case IntAna_Parabola: - { + break; + + case IntAna_Parabola: { gp_Parab parabsol = inter.Parabola(1); -#if 0 - if (ElCLib::LineParameter(Co.Axis(),parabsol.Focus()) < - ElCLib::LineParameter(Co.Axis(),apex) ) { - Empty = Standard_True; + + gp_Vec Tgtorig(parabsol.YAxis().Direction()); + Standard_Real ptran = Tgtorig.DotCross(Quad2.Normale(parabsol.Location()), + Quad1.Normale(parabsol.Location())); + if (ptran >0.00000001) { + trans1 = IntSurf_Out; + trans2 = IntSurf_In; } -#endif - if(0) { } - else { - - gp_Vec Tgtorig(parabsol.YAxis().Direction()); - Standard_Real ptran = Tgtorig.DotCross(Quad2.Normale(parabsol.Location()), - Quad1.Normale(parabsol.Location())); - if (ptran >0.00000001) { - trans1 = IntSurf_Out; - trans2 = IntSurf_In; - } - else if (ptran <-0.00000001) { - trans1 = IntSurf_In; - trans2 = IntSurf_Out; - } - else { - trans1=trans2=IntSurf_Undecided; - } - Handle(IntPatch_GLine) glig = new IntPatch_GLine(parabsol,Standard_False,trans1,trans2); - slin.Append(glig); + else if (ptran <-0.00000001) { + trans1 = IntSurf_In; + trans2 = IntSurf_Out; } + else { + trans1=trans2=IntSurf_Undecided; + } + Handle(IntPatch_GLine) glig = new IntPatch_GLine(parabsol,Standard_False,trans1,trans2); + slin.Append(glig); } - break; - - case IntAna_Hyperbola: - { + break; + + case IntAna_Hyperbola: { gp_Pnt tophypr; gp_Vec Tgttop; @@ -624,13 +630,78 @@ Standard_Boolean IntPCo (const IntSurf_Quadric& Quad1, slin.Append(glig); } } - break; - - default: - { + break; + + default: { return Standard_False; } } return Standard_True; } -//==================================================================================== +// +//modified by NIZNHY-PKV Thu Sep 15 10:53:39 2011f +//======================================================================= +//function : AdjustToSeam +//purpose : +//======================================================================= +void AdjustToSeam (const gp_Cone& aQuad, + gp_Circ& aCirc) +{ + gp_Ax2 aAx2; + // + const gp_Pnt& aPLoc=aCirc.Location(); + const gp_Ax3& aAx3=aQuad.Position(); + SeamPosition(aPLoc, aAx3, aAx2); + aCirc.SetPosition(aAx2); +} +//======================================================================= +//function : AdjustToSeam +//purpose : +//======================================================================= +void AdjustToSeam (const gp_Sphere& aQuad, + gp_Circ& aCirc, + const Standard_Real aTolAng) +{ + gp_Ax2 aAx2; + // + const gp_Ax1& aAx1C=aCirc.Axis(); + const gp_Ax3& aAx3=aQuad.Position(); + const gp_Ax1& aAx1Q=aAx3.Axis(); + // + const gp_Dir& aDirC=aAx1C.Direction(); + const gp_Dir& aDirQ=aAx1Q.Direction(); + if (aDirC.IsParallel(aDirQ, aTolAng)) { + const gp_Pnt& aPLoc=aCirc.Location(); + SeamPosition(aPLoc, aAx3, aAx2); + aCirc.SetPosition(aAx2); + } +} +//======================================================================= +//function : AdjustToSeam +//purpose : +//======================================================================= +void AdjustToSeam (const gp_Cylinder& aQuad, + gp_Circ& aCirc) +{ + gp_Ax2 aAx2; + // + const gp_Pnt& aPLoc=aCirc.Location(); + const gp_Ax3& aAx3=aQuad.Position(); + SeamPosition(aPLoc, aAx3, aAx2); + aCirc.SetPosition(aAx2); +} +//======================================================================= +//function : SeamPosition +//purpose : +//======================================================================= +void SeamPosition(const gp_Pnt& aPLoc, + const gp_Ax3& aPos, + gp_Ax2& aSeamPos) +{ + const gp_Dir& aDZ=aPos.Direction(); + const gp_Dir& aDX=aPos.XDirection(); + gp_Ax2 aAx2(aPLoc, aDZ, aDX); + aSeamPos=aAx2; +} + +//modified by NIZNHY-PKV Thu Sep 15 10:53:41 2011t diff --git a/src/IntTools/IntTools_FaceFace.cdl b/src/IntTools/IntTools_FaceFace.cdl index 5129d8c10d..59b4fd486f 100755 --- a/src/IntTools/IntTools_FaceFace.cdl +++ b/src/IntTools/IntTools_FaceFace.cdl @@ -101,14 +101,18 @@ is returns Boolean from Standard; ---Purpose: --- Returns True if faces are tangent - --- - - PrepareLines3D (me:out); + --- + --modified by NIZNHY-PKV Fri Sep 16 07:44:22 2011 + PrepareLines3D (me:out; + bToSplit: Boolean from Standard=Standard_True); + --PrepareLines3D (me:out); ---Purpose: - --- Provides post-processing the result lines, - --- which includes spliting closed curves. - --- - --amv + --- Provides post-processing the result lines. + --- - the flag. + -- In case of is true the closed 3D-curves will be splitted + -- on parts. + -- In case of is false the closed 3D-curves remain untouched. + SetList (me: in out; ListOfPnts: in out ListOfPntOn2S from IntSurf); ---------------------------------------------------------- @@ -119,10 +123,8 @@ is D2 : TopolTool from Adaptor3d) is protected; - --modified by NIZNHY-PKV Tue Jul 10 10:01:27 2007f ComputeTolReached3d(me:out) is protected; - --modified by NIZNHY-PKV Tue Jul 10 10:01:30 2007t fields diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx index 1536181c67..a53d1051f8 100755 --- a/src/IntTools/IntTools_FaceFace.cxx +++ b/src/IntTools/IntTools_FaceFace.cxx @@ -821,7 +821,7 @@ void IntTools_FaceFace::SetList(IntSurf_ListOfPntOn2S& aListOfPnts) myTolReached3d=1.1*myTolReached3d; } }// if ((aType1==GeomAbs_Plane && aType2==GeomAbs_Torus) || - //modified by NIZNHY-PKV Mon Sep 12 09:32:44 2011f + // if ((aType1==GeomAbs_SurfaceOfRevolution && aType2==GeomAbs_Cylinder) || (aType2==GeomAbs_SurfaceOfRevolution && aType1==GeomAbs_Cylinder)) { Standard_Boolean bIsDone; @@ -912,8 +912,7 @@ void IntTools_FaceFace::SetList(IntSurf_ListOfPntOn2S& aListOfPnts) if (aDSmax > aDS) { myTolReached3d=sqrt(aDSmax); } - }// if ((aType1==GeomAbs_Plane && aType2==GeomAbs_Torus) || - //modified by NIZNHY-PKV Mon Sep 12 09:32:46 2011t + }//if((aType1==GeomAbs_SurfaceOfRevolution ... } //======================================================================= //function : MakeCurve @@ -2216,59 +2215,57 @@ Handle(Geom2d_BSplineCurve) MakeBSpline2d(const Handle(IntPatch_WLine)& theWLine return new Geom2d_BSplineCurve(poles,knots,mults,1); } +//modified by NIZNHY-PKV Fri Sep 16 07:57:30 2011f //======================================================================= //function : PrepareLines3D //purpose : //======================================================================= - void IntTools_FaceFace::PrepareLines3D() + void IntTools_FaceFace::PrepareLines3D(const Standard_Boolean bToSplit) { - Standard_Integer i, aNbCurves, j, aNbNewCurves; + Standard_Integer i, aNbCurves; + GeomAbs_SurfaceType aType1, aType2; IntTools_SequenceOfCurves aNewCvs; - // - // 1. Treatment of periodic and closed curves + // 1. Treatment closed curves aNbCurves=mySeqOfCurve.Length(); - for (i=1; i<=aNbCurves; i++) { + for (i=1; i<=aNbCurves; ++i) { const IntTools_Curve& aIC=mySeqOfCurve(i); - // DEBUG - // const Handle(Geom_Curve)& aC3D =aIC.Curve(); - // const Handle(Geom2d_Curve)& aC2D1=aIC.FirstCurve2d(); - // const Handle(Geom2d_Curve)& aC2D2=aIC.SecondCurve2d(); // - IntTools_SequenceOfCurves aSeqCvs; - aNbNewCurves=IntTools_Tools::SplitCurve(aIC, aSeqCvs); - - if (aNbNewCurves) { - for (j=1; j<=aNbNewCurves; j++) { - const IntTools_Curve& aICNew=aSeqCvs(j); - aNewCvs.Append(aICNew); + if (bToSplit) { + Standard_Integer j, aNbC; + IntTools_SequenceOfCurves aSeqCvs; + // + aNbC=IntTools_Tools::SplitCurve(aIC, aSeqCvs); + if (aNbC) { + for (j=1; j<=aNbC; ++j) { + const IntTools_Curve& aICNew=aSeqCvs(j); + aNewCvs.Append(aICNew); + } + } + else { + aNewCvs.Append(aIC); } } - // else { aNewCvs.Append(aIC); } } // // 2. Plane\Cone intersection when we had 4 curves - GeomAbs_SurfaceType aType1, aType2; - BRepAdaptor_Surface aBS1, aBS2; - - aBS1.Initialize(myFace1); - aType1=aBS1.GetType(); - - aBS2.Initialize(myFace2); - aType2=aBS2.GetType(); - + aType1=myHS1->GetType(); + aType2=myHS2->GetType(); + aNbCurves=aNewCvs.Length(); + // if ((aType1==GeomAbs_Plane && aType2==GeomAbs_Cone) || (aType2==GeomAbs_Plane && aType1==GeomAbs_Cone)) { - aNbCurves=aNewCvs.Length(); if (aNbCurves==4) { - GeomAbs_CurveType aCType1=aNewCvs(1).Type(); + GeomAbs_CurveType aCType1; + // + aCType1=aNewCvs(1).Type(); if (aCType1==GeomAbs_Line) { IntTools_SequenceOfCurves aSeqIn, aSeqOut; // - for (i=1; i<=aNbCurves; i++) { + for (i=1; i<=aNbCurves; ++i) { const IntTools_Curve& aIC=aNewCvs(i); aSeqIn.Append(aIC); } @@ -2277,26 +2274,23 @@ Handle(Geom2d_BSplineCurve) MakeBSpline2d(const Handle(IntPatch_WLine)& theWLine // aNewCvs.Clear(); aNbCurves=aSeqOut.Length(); - for (i=1; i<=aNbCurves; i++) { + for (i=1; i<=aNbCurves; ++i) { const IntTools_Curve& aIC=aSeqOut(i); aNewCvs.Append(aIC); } - // } } - }// end of if ((aType1==GeomAbs_Plane && ... + }// if ((aType1==GeomAbs_Plane && aType2==GeomAbs_Cone)... // // 3. Fill mySeqOfCurve mySeqOfCurve.Clear(); aNbCurves=aNewCvs.Length(); - for (i=1; i<=aNbCurves; i++) { + for (i=1; i<=aNbCurves; ++i) { const IntTools_Curve& aIC=aNewCvs(i); mySeqOfCurve.Append(aIC); } - } - - +//modified by NIZNHY-PKV Fri Sep 16 07:57:32 2011t //======================================================================= //function : CorrectSurfaceBoundaries //purpose :