//=======================================================================
//function : InscribePoint
-//purpose :
+//purpose : If theFlForce==TRUE theUGiven will be adjasted forceful.
//=======================================================================
static Standard_Boolean InscribePoint(const Standard_Real theUfTarget,
const Standard_Real theUlTarget,
Standard_Real& theUGiven,
const Standard_Real theTol2D,
- const Standard_Real thePeriod)
+ const Standard_Real thePeriod,
+ const Standard_Boolean theFlForce)
{
- if((theUfTarget - theUGiven <= theTol2D) && (theUGiven - theUlTarget <= theTol2D))
+ if((theUfTarget - theUGiven <= theTol2D) &&
+ (theUGiven - theUlTarget <= theTol2D))
{//it has already inscribed
/*
+ * +
*/
+ if(theFlForce)
+ {
+ Standard_Real anUtemp = theUGiven + thePeriod;
+ if((theUfTarget - anUtemp <= theTol2D) &&
+ (anUtemp - theUlTarget <= theTol2D))
+ {
+ theUGiven = anUtemp;
+ return Standard_True;
+ }
+
+ anUtemp = theUGiven - thePeriod;
+ if((theUfTarget - anUtemp <= theTol2D) &&
+ (anUtemp - theUlTarget <= theTol2D))
+ {
+ theUGiven = anUtemp;
+ }
+ }
+
return Standard_True;
}
{
Standard_Real anUpar = theUfGiven;
const Standard_Real aDelta = theUlGiven - theUfGiven;
- if(InscribePoint(theUfTarget, theUlTarget, anUpar, theTol2D, thePeriod))
+ if(InscribePoint(theUfTarget, theUlTarget, anUpar,
+ theTol2D, thePeriod, Standard_False))
{
theUfGiven = anUpar;
theUlGiven = theUfGiven + aDelta;
else
{
anUpar = theUlGiven;
- if(InscribePoint(theUfTarget, theUlTarget, anUpar, theTol2D, thePeriod))
+ if(InscribePoint(theUfTarget, theUlTarget, anUpar,
+ theTol2D, thePeriod, Standard_False))
{
theUlGiven = anUpar;
theUfGiven = theUlGiven - aDelta;
continue;
}
- InscribePoint(theUf, theUl, theArr[i], theTol2D, thePeriod);
+ InscribePoint(theUf, theUl, theArr[i], theTol2D, thePeriod, Standard_False);
for(Standard_Integer j = i - 1; j >= 0; j--)
{
const Standard_Real theUlSurf1,
const Standard_Real thePeriodOfSurf1,
const Handle(IntSurf_LineOn2S)& theLine,
- const Standard_Real theTol2D)
+ const Standard_Real theTol2D,
+ const Standard_Boolean theFlForce)
{
gp_Pnt aPt1(theQuad1.Value(thePntOnSurf1.X(), thePntOnSurf1.Y())),
aPt2(theQuad2.Value(thePntOnSurf2.X(), thePntOnSurf2.Y()));
Standard_Real anUpar = thePntOnSurf1.X();
- if(!InscribePoint(theUfSurf1, theUlSurf1, anUpar, theTol2D, thePeriodOfSurf1))
+ if(!InscribePoint(theUfSurf1, theUlSurf1, anUpar, theTol2D,
+ thePeriodOfSurf1, theFlForce))
return Standard_False;
IntSurf_PntOn2S aPnt;
{
aPnt.SetValue((aPt1.XYZ()+aPt2.XYZ())/2.0,
thePntOnSurf2.X(), thePntOnSurf2.Y(),
- thePntOnSurf1.X(), thePntOnSurf1.Y());
+ anUpar, thePntOnSurf1.Y());
}
else
{
aPnt.SetValue((aPt1.XYZ()+aPt2.XYZ())/2.0,
- thePntOnSurf1.X(), thePntOnSurf1.Y(),
+ anUpar, thePntOnSurf1.Y(),
thePntOnSurf2.X(), thePntOnSurf2.Y());
}
const Standard_Real theV2Prev,
const Standard_Boolean isTheReverse,
const Standard_Real theArccosFactor,
+ const Standard_Boolean theFlForce,
Standard_Boolean& isTheFound1,
Standard_Boolean& isTheFound2)
{
Standard_Real aU2 = theCoeffs.mFI2 + theArccosFactor * acos(anArg);
- if(InscribePoint(aUSurf2f, aUSurf2l, aU2, theTol2D, thePeriod))
+ if(InscribePoint(aUSurf2f, aUSurf2l, aU2, theTol2D, thePeriod, Standard_False))
{
- const Standard_Real aV1 = (aTS1 == SearchV1) ? aV1zad :
+ const Standard_Real aV1 =
+ (aTS1 == SearchV1) ? aV1zad :
theCoeffs.mK21 * sin(aU2) + theCoeffs.mK11 * sin(anUpar1) +
theCoeffs.mL21 * cos(aU2) + theCoeffs.mL11 * cos(anUpar1) + theCoeffs.mM1;
- const Standard_Real aV2 = (aTS1 == SearchV2) ? aV2zad :
+ const Standard_Real aV2 =
+ (aTS1 == SearchV2) ? aV2zad :
theCoeffs.mK22 * sin(aU2) + theCoeffs.mK12 * sin(anUpar1) +
theCoeffs.mL22 * cos(aU2) + theCoeffs.mL12 * cos(anUpar1) + theCoeffs.mM2;
- AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2), aUSurf1f, aUSurf1l, thePeriod, theWL->Curve(), theTol2D);
+ AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
+ gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2),
+ aUSurf1f, aUSurf1l, thePeriod,
+ theWL->Curve(), theTol2D, theFlForce);
}
else
{
anArg = -1.0;
Standard_Real aU2 = theCoeffs.mFI2 + theArccosFactor * acos(anArg);
- if(InscribePoint(aUSurf2f, aUSurf2l, aU2, theTol2D, thePeriod))
+ if(InscribePoint(aUSurf2f, aUSurf2l, aU2, theTol2D, thePeriod, Standard_False))
{
- const Standard_Real aV1 = (aTS2 == SearchV1) ? aV1zad :
+ const Standard_Real aV1 =
+ (aTS2 == SearchV1) ? aV1zad :
theCoeffs.mK21 * sin(aU2) + theCoeffs.mK11 * sin(anUpar2) +
theCoeffs.mL21 * cos(aU2) + theCoeffs.mL11 * cos(anUpar2) + theCoeffs.mM1;
- const Standard_Real aV2 = (aTS2 == SearchV2) ? aV2zad :
+ const Standard_Real aV2 =
+ (aTS2 == SearchV2) ? aV2zad :
theCoeffs.mK22 * sin(aU2) + theCoeffs.mK12 * sin(anUpar2) +
theCoeffs.mL22 * cos(aU2) + theCoeffs.mL12 * cos(anUpar2) + theCoeffs.mM2;
- AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2), aUSurf1f, aUSurf1l, thePeriod, theWL->Curve(), theTol2D);
+ AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
+ gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2),
+ aUSurf1f, aUSurf1l, thePeriod,
+ theWL->Curve(), theTol2D, theFlForce);
}
else
{
Standard_Real aU2 = theCoeffs.mFI2 + theArccosFactor * acos(anArg);
- if(InscribePoint(aUSurf2f, aUSurf2l, aU2, theTol2D, thePeriod))
+ if(InscribePoint(aUSurf2f, aUSurf2l, aU2, theTol2D, thePeriod, Standard_False))
{
const Standard_Real aV1 = (aTS2 == SearchV1) ? aV1zad :
theCoeffs.mK21 * sin(aU2) + theCoeffs.mK11 * sin(anUpar2) +
theCoeffs.mK22 * sin(aU2) + theCoeffs.mK12 * sin(anUpar2) +
theCoeffs.mL22 * cos(aU2) + theCoeffs.mL12 * cos(anUpar2) + theCoeffs.mM2;
- AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2), aUSurf1f, aUSurf1l, thePeriod, theWL->Curve(), theTol2D);
+ AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
+ gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2),
+ aUSurf1f, aUSurf1l, thePeriod,
+ theWL->Curve(), theTol2D, theFlForce);
}
else
{
anArg = -1.0;
Standard_Real aU2 = theCoeffs.mFI2+theArccosFactor*acos(anArg);
- if(InscribePoint(aUSurf2f, aUSurf2l, aU2, theTol2D, thePeriod))
+ if(InscribePoint(aUSurf2f, aUSurf2l, aU2, theTol2D, thePeriod, Standard_False))
{
const Standard_Real aV1 = (aTS1 == SearchV1) ? aV1zad :
theCoeffs.mK21 * sin(aU2) + theCoeffs.mK11 * sin(anUpar1) +
theCoeffs.mK22 * sin(aU2) + theCoeffs.mK12 * sin(anUpar1) +
theCoeffs.mL22 * cos(aU2) + theCoeffs.mL12 * cos(anUpar1) + theCoeffs.mM2;
- AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2), aUSurf1f, aUSurf1l, thePeriod, theWL->Curve(), theTol2D);
+ AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
+ gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2),
+ aUSurf1f, aUSurf1l, thePeriod,
+ theWL->Curve(), theTol2D, theFlForce);
}
else
{
aNbPointsPrev = aNbPoints;
for(Standard_Integer fp = 1, lp = 2; fp < aNbPoints; fp = lp + 1)
{
- Standard_Real U1f, V1f; //first point in 1st suraface
- Standard_Real U1l, V1l; //last point in 1st suraface
+ Standard_Real U1f = 0.0, V1f = 0.0; //first point in 1st suraface
+ Standard_Real U1l = 0.0, V1l = 0.0; //last point in 1st suraface
+
+ Standard_Real U2f = 0.0, V2f = 0.0; //first point in 2nd suraface
+ Standard_Real U2l = 0.0, V2l = 0.0; //last point in 2nd suraface
lp = fp+1;
{
theLile->Value(fp).ParametersOnS2(U1f, V1f);
theLile->Value(lp).ParametersOnS2(U1l, V1l);
+
+ theLile->Value(fp).ParametersOnS1(U2f, V2f);
+ theLile->Value(lp).ParametersOnS1(U2l, V2l);
}
else
{
theLile->Value(fp).ParametersOnS1(U1f, V1f);
theLile->Value(lp).ParametersOnS1(U1l, V1l);
+
+ theLile->Value(fp).ParametersOnS2(U2f, V2f);
+ theLile->Value(lp).ParametersOnS2(U2l, V2l);
+ }
+
+ if(Abs(U1l - U1f) <= theTol2D)
+ {
+ //Step is minimal. It is not necessary to divide it.
+ continue;
}
U1prec = 0.5*(U1f+U1l);
anArg = -1.0;
U2prec = theCoeffs.mFI2 + theArccosFactor*acos(anArg);
- InscribePoint(theU2f, theU2l, U2prec, theTol2D, thePeriodOfSurf2);
+ InscribePoint(theU2f, theU2l, U2prec, theTol2D, thePeriodOfSurf2, Standard_False);
gp_Pnt aP1, aP2;
- gp_Vec aVec1, aVec2;
- if(isTheReverse)
- {
- V1prec = theCoeffs.mK21 * sin(U2prec) + theCoeffs.mK11 * sin(U1prec) + theCoeffs.mL21 * cos(U2prec) + theCoeffs.mL11 * cos(U1prec) + theCoeffs.mM1;
- V2prec = theCoeffs.mK22 * sin(U2prec) + theCoeffs.mK12 * sin(U1prec) + theCoeffs.mL22 * cos(U2prec) + theCoeffs.mL12 * cos(U1prec) + theCoeffs.mM2;
+ V1prec = theCoeffs.mK21 * sin(U2prec) +
+ theCoeffs.mK11 * sin(U1prec) +
+ theCoeffs.mL21 * cos(U2prec) +
+ theCoeffs.mL11 * cos(U1prec) + theCoeffs.mM1;
+ V2prec = theCoeffs.mK22 * sin(U2prec) +
+ theCoeffs.mK12 * sin(U1prec) +
+ theCoeffs.mL22 * cos(U2prec) +
+ theCoeffs.mL12 * cos(U1prec) + theCoeffs.mM2;
- gp_Pnt aP3, aP4;
- theQuad1.D1(U2prec, V2prec, aP3, aVec1, aVec2);
- theQuad2.D1(U1prec, V1prec, aP4, aVec1, aVec2);
-
- theQuad1.D1(U1prec, V1prec, aP1, aVec1, aVec2);
- theQuad2.D1(U2prec, V2prec, aP2, aVec1, aVec2);
- }
- else
- {
- V1prec = theCoeffs.mK21 * sin(U2prec) + theCoeffs.mK11 * sin(U1prec) + theCoeffs.mL21 * cos(U2prec) + theCoeffs.mL11 * cos(U1prec) + theCoeffs.mM1;
- V2prec = theCoeffs.mK22 * sin(U2prec) + theCoeffs.mK12 * sin(U1prec) + theCoeffs.mL22 * cos(U2prec) + theCoeffs.mL12 * cos(U1prec) + theCoeffs.mM2;
-
- theQuad1.D1(U1prec, V1prec, aP1, aVec1, aVec2);
- theQuad2.D1(U2prec, V2prec, aP2, aVec1, aVec2);
- }
+ aP1 = theQuad1.Value(U1prec, V1prec);
+ aP2 = theQuad2.Value(U2prec, V2prec);
gp_Pnt aPInt(0.5*(aP1.XYZ() + aP2.XYZ()));
//[2...3] - First and last U1 parameter.
//[4...5] - in these points parameter U2 goes through
// the seam-edge of the second cylinder.
- //[6...9] - in these points an intersetion line goes through
+ //[6...9] - in these points an intersection line goes through
// U-boundaries of the second surface.
const Standard_Integer aNbCritPointsMax = 10;
Standard_Real anU1crit[aNbCritPointsMax] = {Precision::Infinite(),
}
}
- Standard_Real anArg = anEquationCoeffs.mB * cos(anU1 - anEquationCoeffs.mFI1) + anEquationCoeffs.mC;
+ Standard_Real anArg = anEquationCoeffs.mB *
+ cos(anU1 - anEquationCoeffs.mFI1) + anEquationCoeffs.mC;
if(aNulValue > 1.0 - anArg)
anArg = 1.0;
anArg = -1.0;
Standard_Real aU21 = anEquationCoeffs.mFI2 + acos(anArg);
- InscribePoint(aUSurf2f, aUSurf2l, aU21, theTol2D, aPeriod);
+ InscribePoint(aUSurf2f, aUSurf2l, aU21, theTol2D, aPeriod, Standard_False);
+
+
+ const Standard_Integer aNbPntsWL1 = aWLine1.IsNull() ? 0 :
+ aWLine1->Curve()->NbPoints();
+ if(aNbPntsWL1 == 0)
+ {//the line have not contained any points yet
+ if(((aUSurf2l - aUSurf2f) >= aPeriod) &&
+ ((Abs(aU21-aUSurf2f) < theTol2D) || (Abs(aU21-aUSurf2l) < theTol2D)))
+ {
+ const Standard_Real anU1Temp = anU1 + aStepMin;
+ Standard_Real anArgTemp = anEquationCoeffs.mB *
+ cos(anU1Temp - anEquationCoeffs.mFI1) + anEquationCoeffs.mC;
+
+ if(aNulValue > 1.0 - anArg)
+ anArg = 1.0;
+ if(anArg + 1.0 < aNulValue)
+ anArg = -1.0;
+
+ Standard_Real aU2Temp = anEquationCoeffs.mFI2 + acos(anArgTemp);
+ InscribePoint(aUSurf2f, aUSurf2l, aU2Temp, theTol2D, aPeriod, Standard_False);
+ if(2.0*Abs(aU2Temp - aU21) > aPeriod)
+ {
+ if(aU2Temp > aU21)
+ aU21 += aPeriod;
+ else
+ aU21 -= aPeriod;
+ }
+ }
+ }
+
+ if(aNbPntsWL1 > 0)
+ {//end of the line
+ if(((aUSurf2l - aUSurf2f) >= aPeriod) &&
+ ((Abs(aU21-aUSurf2f) < theTol2D) || (Abs(aU21-aUSurf2l) < theTol2D)))
+ {
+ Standard_Real aU2prev = 0.0, aV2prev = 0.0;
+ if(isTheReverse)
+ aWLine1->Curve()->Value(aNbPntsWL1).ParametersOnS1(aU2prev, aV2prev);
+ else
+ aWLine1->Curve()->Value(aNbPntsWL1).ParametersOnS2(aU2prev, aV2prev);
+
+ if(2.0*Abs(aU2prev - aU21) > aPeriod)
+ {
+ if(aU2prev > aU21)
+ aU21 += aPeriod;
+ else
+ aU21 -= aPeriod;
+ }
+ }
+ }
Standard_Real aU22 = anEquationCoeffs.mFI2 - acos(anArg);
- InscribePoint(aUSurf2f, aUSurf2l, aU22, theTol2D, aPeriod);
+ InscribePoint(aUSurf2f, aUSurf2l, aU22, theTol2D, aPeriod, Standard_False);
+
+ const Standard_Integer aNbPntsWL2 = aWLine2.IsNull() ? 0 :
+ aWLine2->Curve()->NbPoints();
+ if(aNbPntsWL2 == 0)
+ {//the line have not contained any points yet
+ if(((aUSurf2l - aUSurf2f) >= aPeriod) &&
+ ((Abs(aU22-aUSurf2f) < theTol2D) || (Abs(aU22-aUSurf2l) < theTol2D)))
+ {
+ const Standard_Real anU1Temp = anU1 + aStepMin;
+ Standard_Real anArgTemp = anEquationCoeffs.mB *
+ cos(anU1Temp - anEquationCoeffs.mFI1) + anEquationCoeffs.mC;
+
+ if(aNulValue > 1.0 - anArg)
+ anArg = 1.0;
+ if(anArg + 1.0 < aNulValue)
+ anArg = -1.0;
+
+ Standard_Real aU2Temp = anEquationCoeffs.mFI2 - acos(anArgTemp);
+ InscribePoint(aUSurf2f, aUSurf2l, aU2Temp, theTol2D, aPeriod, Standard_False);
+ if(2.0*Abs(aU2Temp - aU22) > aPeriod)
+ {
+ if(aU2Temp > aU21)
+ aU22 += aPeriod;
+ else
+ aU22 -= aPeriod;
+ }
+ }
+ }
+
+ if(aNbPntsWL2 > 0)
+ {//end of the line
+ if(((aUSurf2l - aUSurf2f) >= aPeriod) &&
+ ((Abs(aU22-aUSurf2f) < theTol2D) || (Abs(aU22-aUSurf2l) < theTol2D)))
+ {
+ Standard_Real aU2prev = 0.0, aV2prev = 0.0;
+ if(isTheReverse)
+ aWLine2->Curve()->Value(aNbPntsWL2).ParametersOnS1(aU2prev, aV2prev);
+ else
+ aWLine2->Curve()->Value(aNbPntsWL2).ParametersOnS2(aU2prev, aV2prev);
+
+ if(2.0*Abs(aU2prev - aU22) > aPeriod)
+ {
+ if(aU2prev > aU22)
+ aU22 += aPeriod;
+ else
+ aU22 -= aPeriod;
+ }
+ }
+ }
const Standard_Real aV11 = anEquationCoeffs.mK21 * sin(aU21) +
anEquationCoeffs.mK11 * sin(anU1) +
((aV11 - aVSurf1l) <= theTol2D) &&
((aVSurf2f - aV21) <= theTol2D) && ((aV21 - aVSurf2l) <= theTol2D))
{
+ Standard_Boolean isForce = Standard_False;
if(!aWL1FindStatus)
{
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
- AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs, theUVSurf1, theUVSurf2,
- theTol2D, aPeriod, aNulValue, anU1, aU21,
- aV11, aV11Prev, aV21, aV21Prev, isTheReverse, 1.0, isFound1, isFound2);
+ if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
+ {
+ isForce = Standard_True;
+ }
+
+ AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
+ theUVSurf1, theUVSurf2, theTol2D, aPeriod,
+ aNulValue, anU1, aU21, aV11, aV11Prev,
+ aV21, aV21Prev, isTheReverse,
+ 1.0, isForce, isFound1, isFound2);
if(isFound1 || isFound2)
{
if((aWL1FindStatus != 2) || (aWLine1->NbPnts() >= 1))
{
- if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anU1, aV11),
- gp_Pnt2d(aU21, aV21), aUSurf1f, aUSurf1l, aPeriod, aWLine1->Curve(), theTol2D))
+ if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
+ gp_Pnt2d(anU1, aV11), gp_Pnt2d(aU21, aV21),
+ aUSurf1f, aUSurf1l, aPeriod,
+ aWLine1->Curve(), theTol2D, isForce))
{
if(!aWL1FindStatus)
{
{
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
- AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs, theUVSurf1, theUVSurf2,
- theTol2D, aPeriod, aNulValue, anU1, aU21, aV11, aV11Prev, aV21, aV21Prev, isTheReverse, 1.0, isFound1, isFound2);
+ AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
+ theUVSurf1, theUVSurf2, theTol2D, aPeriod,
+ aNulValue, anU1, aU21, aV11, aV11Prev,
+ aV21, aV21Prev, isTheReverse,
+ 1.0, Standard_False, isFound1, isFound2);
if(isFound1 || isFound2)
aWL1FindStatus = 2; //start a new line
((aVSurf2f - aV22) <= theTol2D) &&
((aV22 - aVSurf2l) <= theTol2D))
{
+ Standard_Boolean isForce = Standard_False;
+
if(!aWL2FindStatus)
{
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
- AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs, theUVSurf1, theUVSurf2,
- theTol2D, aPeriod, aNulValue, anU1, aU22,
- aV12, aV12Prev, aV22, aV22Prev, isTheReverse, -1.0, isFound1, isFound2);
+ if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
+ {
+ isForce = Standard_True;
+ }
+
+ AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
+ theUVSurf1, theUVSurf2, theTol2D, aPeriod,
+ aNulValue, anU1, aU22, aV12, aV12Prev,
+ aV22, aV22Prev, isTheReverse,
+ -1.0, isForce, isFound1, isFound2);
if(isFound1 || isFound2)
{
if((aWL2FindStatus != 2) || (aWLine2->NbPnts() >= 1))
{
- if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, gp_Pnt2d(anU1, aV12),
- gp_Pnt2d(aU22, aV22), aUSurf1f, aUSurf1l, aPeriod, aWLine2->Curve(), theTol2D))
+ if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
+ gp_Pnt2d(anU1, aV12), gp_Pnt2d(aU22, aV22),
+ aUSurf1f, aUSurf1l, aPeriod,
+ aWLine2->Curve(), theTol2D, isForce))
{
if(!aWL2FindStatus)
{
{
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
- AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs, theUVSurf1, theUVSurf2,
- theTol2D, aPeriod, aNulValue, anU1, aU22,
- aV12, aV12Prev, aV22, aV22Prev, isTheReverse, -1.0, isFound1, isFound2);
+ AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
+ theUVSurf1, theUVSurf2, theTol2D, aPeriod,
+ aNulValue, anU1, aU22, aV12, aV12Prev,
+ aV22, aV22Prev, isTheReverse,
+ -1.0, Standard_False, isFound1, isFound2);
if(isFound1 || isFound2)
aWL2FindStatus = 2; //start a new line
isTheEmpty = Standard_False;
isAddedIntoWL1 = Standard_True;
- SeekAdditionalPoints(theQuad1, theQuad2, aWLine1->Curve(), anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l, theTol2D, aPeriod, 1.0, isTheReverse);
+ SeekAdditionalPoints(theQuad1, theQuad2, aWLine1->Curve(),
+ anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
+ theTol2D, aPeriod, 1.0, isTheReverse);
aWLine1->ComputeVertexParameters(theTol3D);
theSlin.Append(aWLine1);
isTheEmpty = Standard_False;
isAddedIntoWL2 = Standard_True;
- SeekAdditionalPoints(theQuad1, theQuad2, aWLine2->Curve(), anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l, theTol2D, aPeriod, -1.0, isTheReverse);
+ SeekAdditionalPoints(theQuad1, theQuad2, aWLine2->Curve(),
+ anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
+ theTol2D, aPeriod, -1.0, isTheReverse);
aWLine2->ComputeVertexParameters(theTol3D);
theSlin.Append(aWLine2);
ListOfPnts.Clear();
if(isGeomInt)
{
- GeomGeomPerfom(theS1, theD1, theS2, theD2, TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
+ if(theD1->DomainIsInfinite() || theD2->DomainIsInfinite())
+ {
+ GeomGeomPerfom(theS1, theD1, theS2, theD2, TolArc,
+ TolTang, ListOfPnts, RestrictLine, typs1, typs2);
+ }
+ else
+ {
+ GeomGeomPerfomTrimSurf(theS1, theD1, theS2, theD2,
+ TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
+ }
}
else
{
- ParamParamPerfom(theS1, theD1, theS2, theD2, TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
+ ParamParamPerfom(theS1, theD1, theS2, theD2,
+ TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
}
}
IntSurf_ListOfPntOn2S ListOfPnts;
ListOfPnts.Clear();
- ParamParamPerfom(theS1, theD1, theS2, theD2, TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
+ ParamParamPerfom(theS1, theD1, theS2, theD2, TolArc,
+ TolTang, ListOfPnts, RestrictLine, typs1, typs2);
}
}
if(!isGeomInt)
{
- ParamParamPerfom(theS1, theD1, theS2, theD2, TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
+ ParamParamPerfom(theS1, theD1, theS2, theD2,
+ TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
}
else if(ts1 != ts2)
{
}
else if (ts1 == 0)
{
- ParamParamPerfom(theS1, theD1, theS2, theD2, TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
+ ParamParamPerfom(theS1, theD1, theS2, theD2,
+ TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
}
else if(ts1 == 1)
{
}
}
else
- ParamParamPerfom(theS1, theD1, theS2, theD2, TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
+ ParamParamPerfom(theS1, theD1, theS2, theD2,
+ TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
}
//=======================================================================
if((theTyps1 == GeomAbs_Cylinder) && (theTyps2 == GeomAbs_Cylinder))
{
IntPatch_ImpImpIntersection anInt;
- anInt.Perform(theS1, theD1, theS2, theD2, theTolArc, theTolTang, Standard_True);
+ anInt.Perform(theS1, theD1, theS2, theD2, myTolArc, myTolTang, Standard_True);
done = anInt.IsDone();
- const Standard_Integer aNbLin = anInt.NbLines();
- const Standard_Integer aNbPts = anInt.NbPnts();
-
- for(Standard_Integer aLID = 1; aLID <= aNbLin; aLID++)
+ if(done)
{
- const Handle(IntPatch_Line)& aLine = anInt.Line(aLID);
- slin.Append(aLine);
- }
+ empt = anInt.IsEmpty();
+ if (!empt)
+ {
+ tgte = anInt.TangentFaces();
+ if (tgte)
+ oppo = anInt.OppositeFaces();
- for(Standard_Integer aPID = 1; aPID <= aNbPts; aPID++)
- {
- const IntPatch_Point& aPoint = anInt.Point(aPID);
- spnt.Append(aPoint);
+ const Standard_Integer aNbLin = anInt.NbLines();
+ const Standard_Integer aNbPts = anInt.NbPnts();
+
+ for(Standard_Integer aLID = 1; aLID <= aNbLin; aLID++)
+ {
+ const Handle(IntPatch_Line)& aLine = anInt.Line(aLID);
+ slin.Append(aLine);
+ }
+
+ for(Standard_Integer aPID = 1; aPID <= aNbPts; aPID++)
+ {
+ const IntPatch_Point& aPoint = anInt.Point(aPID);
+ spnt.Append(aPoint);
+ }
+ }
}
}
else
{
- GeomGeomPerfom(theS1, theD1, theS2, theD2, theTolArc, theTolTang, theListOfPnts, RestrictLine, theTyps1, theTyps2);
+ GeomGeomPerfom(theS1, theD1, theS2, theD2,
+ theTolArc, theTolTang, theListOfPnts, RestrictLine, theTyps1, theTyps2);
}
}