From: jgv Date: Tue, 2 Jun 2015 12:23:21 +0000 (+0300) Subject: This version allows to build a chamfer surface. X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=b09b2f259426b133b5284a08029f8cfae1b59b35;p=occt-copy.git This version allows to build a chamfer surface. --- diff --git a/src/Blend/Blend_Walking_1.gxx b/src/Blend/Blend_Walking_1.gxx index 44f18d3643..01fd619220 100644 --- a/src/Blend/Blend_Walking_1.gxx +++ b/src/Blend/Blend_Walking_1.gxx @@ -200,7 +200,8 @@ Standard_Boolean Blend_Walking::PerformFirstSection(Blend_Function& Func, ParDep = sol; Pos1 = domain1->Classify(gp_Pnt2d(sol(1), sol(2)), Min(tolerance(1), tolerance(2)), 0); Pos2 = domain2->Classify(gp_Pnt2d(sol(3), sol(4)), Min(tolerance(3), tolerance(4)), 0); - if (Pos1 != TopAbs_IN || Pos2 != TopAbs_IN) + //if (Pos1 != TopAbs_IN || Pos2 != TopAbs_IN) + if (Pos1 == TopAbs_OUT || Pos2 == TopAbs_OUT) { return Standard_False; } diff --git a/src/Blend/Blend_Walking_4.gxx b/src/Blend/Blend_Walking_4.gxx index 9cc1ab4f11..2ba04be877 100644 --- a/src/Blend/Blend_Walking_4.gxx +++ b/src/Blend/Blend_Walking_4.gxx @@ -96,7 +96,9 @@ void Blend_Walking::InternalPerform(Blend_Function& Func, { Standard_Real Cosi = 0., Cosi2 = 0.; - Standard_Real stepw = pasmax; + Standard_Real stepw = pasmax, SaveStepw = 0.; + Standard_Boolean IsAlwaysON = Standard_False; + Standard_Boolean IsModeON = Standard_False; Standard_Integer nbp = line->NbPoints(); if(nbp >= 2){ //On reprend le dernier step s'il n est pas trop petit. if(sens < 0.){ @@ -204,6 +206,21 @@ void Blend_Walking::InternalPerform(Blend_Function& Func, if(bonpoint && line->NbPoints() == 1 && (situ1 != TopAbs_IN || situ2 != TopAbs_IN)){ State = Blend_StepTooLarge; bonpoint = 0; + if (situ1 != TopAbs_OUT && situ2 != TopAbs_OUT) //ON or IN + { + if (IsModeON) + { + bonpoint = 1; + situ1 = situ2 = TopAbs_IN; + State = Blend_OK; + } + else + { + if (IsAlwaysON == Standard_False) + SaveStepw = stepw; + IsAlwaysON = Standard_True; + } + } } if(bonpoint){ w1 = w2 = Bound; @@ -211,6 +228,12 @@ void Blend_Walking::InternalPerform(Blend_Function& Func, recad2 = Standard_False; echecrecad = Standard_False; control = Standard_False; + if (IsModeON && situ1 != TopAbs_OUT && situ2 != TopAbs_OUT) + situ1 = situ2 = TopAbs_IN; + + if (IsModeON && + (situ1 == TopAbs_OUT || situ2 == TopAbs_OUT)) + situ1 = situ2 = TopAbs_OUT; if (situ1 == TopAbs_OUT || situ1 == TopAbs_ON) { // pb inverse sur surf1 @@ -516,23 +539,34 @@ void Blend_Walking::InternalPerform(Blend_Function& Func, { stepw = stepw/2.; if (Abs(stepw) < tolgui) { - Ext1.SetValue(previousP.PointOnS1(), - sol(1),sol(2), - previousP.Parameter(),tolesp); - Ext2.SetValue(previousP.PointOnS2(), - sol(3),sol(4), - previousP.Parameter(),tolesp); - if (!previousP.IsTangencyPoint()) { - Ext1.SetTangent(previousP.TangentOnS1()); - Ext2.SetTangent(previousP.TangentOnS2()); - } - Arrive = Standard_True; - if (line->NbPoints()>=2) { - // Indiquer qu on s arrete en cours de cheminement - } -// else { -// line->Clear(); -// } + if (IsAlwaysON) + { + IsModeON = Standard_True; + stepw = SaveStepw; + param = parprec + sens*stepw; // on ne risque pas de depasser Bound. + evalpinit(parinit,previousP,parprec,param, + infbound,supbound, clasonS1, clasonS2); + } + else + { + Ext1.SetValue(previousP.PointOnS1(), + sol(1),sol(2), + previousP.Parameter(),tolesp); + Ext2.SetValue(previousP.PointOnS2(), + sol(3),sol(4), + previousP.Parameter(),tolesp); + if (!previousP.IsTangencyPoint()) { + Ext1.SetTangent(previousP.TangentOnS1()); + Ext2.SetTangent(previousP.TangentOnS2()); + } + Arrive = Standard_True; + if (line->NbPoints()>=2) { + // Indiquer qu on s arrete en cours de cheminement + } + // else { + // line->Clear(); + // } + } } else { param = parprec + sens*stepw; // on ne risque pas de depasser Bound.