1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-06 18:26:22 +03:00

0024648: Different types of intersection curves between Cone and Torus with a different order of arguments

Correct treatment of the cases with Cone and Torus.
Test cases for issue CR24648
This commit is contained in:
emv 2014-02-20 17:14:04 +04:00 committed by apn
parent 6f31882ada
commit 1d18c75e70
4 changed files with 345 additions and 278 deletions

View File

@ -691,6 +691,10 @@ void BOPAlgo_PaveFiller::ForceInterfVE(const Standard_Integer nV,
aT=aProjector.LowerDistanceParameter(); aT=aProjector.LowerDistanceParameter();
// //
BOPDS_VectorOfInterfVE& aVEs=myDS->InterfVE(); BOPDS_VectorOfInterfVE& aVEs=myDS->InterfVE();
if (aVEs.Extent() == 0) {
aVEs.Init();
}
//
i=aVEs.Append()-1; i=aVEs.Append()-1;
BOPDS_InterfVE& aVE=aVEs(i); BOPDS_InterfVE& aVE=aVEs(i);
aVE.SetIndices(nV, nE); aVE.SetIndices(nV, nE);

View File

@ -537,6 +537,10 @@ Standard_Boolean BOPAlgo_PaveFiller::ForceInterfVF(const Standard_Integer nV,
BRep_Builder aBB; BRep_Builder aBB;
// //
BOPDS_VectorOfInterfVF& aVFs=myDS->InterfVF(); BOPDS_VectorOfInterfVF& aVFs=myDS->InterfVF();
if (aVFs.Extent() == 0) {
aVFs.Init();
}
//
i=aVFs.Append()-1; i=aVFs.Append()-1;
BOPDS_InterfVF& aVF=aVFs(i); BOPDS_InterfVF& aVF=aVFs(i);
aVF.SetIndices(nV, nF); aVF.SetIndices(nV, nF);

View File

@ -139,16 +139,16 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
case GeomAbs_Torus: break; case GeomAbs_Torus: break;
default: default:
{ {
IntPatch_PrmPrmIntersection interpp; IntPatch_PrmPrmIntersection interpp;
interpp.Perform(S1,D1,TolArc,TolTang,myFleche,myUVMaxStep); interpp.Perform(S1,D1,TolArc,TolTang,myFleche,myUVMaxStep);
if (interpp.IsDone()) if (interpp.IsDone())
{ {
done = Standard_True; done = Standard_True;
tgte = Standard_False; tgte = Standard_False;
empt = interpp.IsEmpty(); empt = interpp.IsEmpty();
const Standard_Integer nblm = interpp.NbLines(); const Standard_Integer nblm = interpp.NbLines();
for (Standard_Integer i=1; i<=nblm; i++) slin.Append(interpp.Line(i)); for (Standard_Integer i=1; i<=nblm; i++) slin.Append(interpp.Line(i));
} }
} }
break; break;
} }
@ -200,12 +200,12 @@ static void FUN_GetMinMaxXYZPnt( const Handle(Adaptor3d_HSurface)& S,
for(Standard_Real U = S->FirstUParameter(); U <= S->LastUParameter(); U += DU) for(Standard_Real U = S->FirstUParameter(); U <= S->LastUParameter(); U += DU)
{ {
for(Standard_Real V = S->FirstVParameter(); V <= S->LastVParameter(); V += DV) for(Standard_Real V = S->FirstVParameter(); V <= S->LastVParameter(); V += DV)
{ {
S->D0(U,V,PUV); S->D0(U,V,PUV);
const Standard_Real cXYZ = PUV.XYZ().Modulus(); const Standard_Real cXYZ = PUV.XYZ().Modulus();
if(cXYZ > tMaxXYZ) { tMaxXYZ = cXYZ; ptMax = PUV; } if(cXYZ > tMaxXYZ) { tMaxXYZ = cXYZ; ptMax = PUV; }
if(cXYZ < tMinXYZ) { tMinXYZ = cXYZ; ptMin = PUV; } if(cXYZ < tMinXYZ) { tMinXYZ = cXYZ; ptMin = PUV; }
} }
} }
pMin = ptMin; pMin = ptMin;
pMax = ptMax; pMax = ptMax;
@ -226,19 +226,19 @@ static void FUN_TrimInfSurf(const gp_Pnt& Pmin,
{ {
Standard_Real Umax = -1.e+100, Umin = 1.e+100, Vmax = -1.e+100, Vmin = 1.e+100, cU, cV; Standard_Real Umax = -1.e+100, Umin = 1.e+100, Vmax = -1.e+100, Vmin = 1.e+100, cU, cV;
if(ext1.IsDone()) if(ext1.IsDone())
{ {
for(Standard_Integer i = 1; i <= ext1.NbExt(); i++) for(Standard_Integer i = 1; i <= ext1.NbExt(); i++)
{ {
const Extrema_POnSurf & pons = ext1.Point(i); const Extrema_POnSurf & pons = ext1.Point(i);
pons.Parameter(cU,cV); pons.Parameter(cU,cV);
if(cU > Umax) Umax = cU; if(cU > Umax) Umax = cU;
if(cU < Umin) Umin = cU; if(cU < Umin) Umin = cU;
if(cV > Vmax) Vmax = cV; if(cV > Vmax) Vmax = cV;
if(cV < Vmin) Vmin = cV; if(cV < Vmin) Vmin = cV;
} }
} }
if(ext2.IsDone()) if(ext2.IsDone())
{ {
for(Standard_Integer i = 1; i <= ext2.NbExt(); i++) for(Standard_Integer i = 1; i <= ext2.NbExt(); i++)
{ {
const Extrema_POnSurf & pons = ext2.Point(i); const Extrema_POnSurf & pons = ext2.Point(i);
@ -248,7 +248,7 @@ static void FUN_TrimInfSurf(const gp_Pnt& Pmin,
if(cV > Vmax) Vmax = cV; if(cV > Vmax) Vmax = cV;
if(cV < Vmin) Vmin = cV; if(cV < Vmin) Vmin = cV;
} }
} }
TP = Max(Abs(Umin),Max(Abs(Umax),Max(Abs(Vmin),Abs(Vmax)))); TP = Max(Abs(Umin),Max(Abs(Umax),Max(Abs(Vmin),Abs(Vmax))));
} }
if(TP == 0.) { TrimS = InfSurf; return; } if(TP == 0.) { TrimS = InfSurf; return; }
@ -265,18 +265,18 @@ static void FUN_TrimInfSurf(const gp_Pnt& Pmin,
if(Vinf && !Vsup){ TrimS = InfSurf->VTrim(-tp, InfSurf->LastVParameter(), 1.0e-7); IsTrimed = 1; } if(Vinf && !Vsup){ TrimS = InfSurf->VTrim(-tp, InfSurf->LastVParameter(), 1.0e-7); IsTrimed = 1; }
if(!Vinf && Vsup){ TrimS = InfSurf->VTrim(InfSurf->FirstVParameter(), tp, 1.0e-7); IsTrimed = 1; } if(!Vinf && Vsup){ TrimS = InfSurf->VTrim(InfSurf->FirstVParameter(), tp, 1.0e-7); IsTrimed = 1; }
if(IsTrimed) if(IsTrimed)
{ {
TmpSS = TrimS; TmpSS = TrimS;
if(Uinf && Usup) TrimS = TmpSS->UTrim(-tp, tp, 1.0e-7); if(Uinf && Usup) TrimS = TmpSS->UTrim(-tp, tp, 1.0e-7);
if(Uinf && !Usup) TrimS = TmpSS->UTrim(-tp, InfSurf->LastUParameter(), 1.0e-7); if(Uinf && !Usup) TrimS = TmpSS->UTrim(-tp, InfSurf->LastUParameter(), 1.0e-7);
if(!Uinf && Usup) TrimS = TmpSS->UTrim(InfSurf->FirstUParameter(), tp, 1.0e-7); if(!Uinf && Usup) TrimS = TmpSS->UTrim(InfSurf->FirstUParameter(), tp, 1.0e-7);
} }
else else
{ {
if(Uinf && Usup) TrimS = InfSurf->UTrim(-tp, tp, 1.0e-7); if(Uinf && Usup) TrimS = InfSurf->UTrim(-tp, tp, 1.0e-7);
if(Uinf && !Usup) TrimS = InfSurf->UTrim(-tp, InfSurf->LastUParameter(), 1.0e-7); if(Uinf && !Usup) TrimS = InfSurf->UTrim(-tp, InfSurf->LastUParameter(), 1.0e-7);
if(!Uinf && Usup) TrimS = InfSurf->UTrim(InfSurf->FirstUParameter(), tp, 1.0e-7); if(!Uinf && Usup) TrimS = InfSurf->UTrim(InfSurf->FirstUParameter(), tp, 1.0e-7);
} }
} }
} }
//================================================================================ //================================================================================
@ -296,11 +296,11 @@ static void FUN_GetUiso(const Handle(Geom_Surface)& GS,
Handle(Geom_Curve) gc = GS->UIso(U); Handle(Geom_Curve) gc = GS->UIso(U);
if(IsVP && (FirstV == 0.0 && LastV == (2.*M_PI))) I = gc; if(IsVP && (FirstV == 0.0 && LastV == (2.*M_PI))) I = gc;
else else
{ {
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstV,LastV); Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstV,LastV);
//szv:I = Handle(Geom_Curve)::DownCast(gtc); //szv:I = Handle(Geom_Curve)::DownCast(gtc);
I = gtc; I = gtc;
} }
} }
else//OffsetSurface else//OffsetSurface
{ {
@ -310,43 +310,43 @@ static void FUN_GetUiso(const Handle(Geom_Surface)& GS,
GeomAdaptor_Curve gac(gcbs); GeomAdaptor_Curve gac(gcbs);
const GeomAbs_CurveType GACT = gac.GetType(); const GeomAbs_CurveType GACT = gac.GetType();
if(IsVP || IsVC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve || Abs(LastV - FirstV) < 1.e+5) if(IsVP || IsVC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve || Abs(LastV - FirstV) < 1.e+5)
{ {
Handle(Geom_Curve) gc = gos->UIso(U); Handle(Geom_Curve) gc = gos->UIso(U);
if(IsVP && (FirstV == 0.0 && LastV == (2*M_PI))) I = gc; if(IsVP && (FirstV == 0.0 && LastV == (2*M_PI))) I = gc;
else else
{ {
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstV,LastV); Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstV,LastV);
//szv:I = Handle(Geom_Curve)::DownCast(gtc); //szv:I = Handle(Geom_Curve)::DownCast(gtc);
I = gtc; I = gtc;
} }
} }
else//Offset Line, Parab, Hyperb else//Offset Line, Parab, Hyperb
{ {
Standard_Real VmTr, VMTr; Standard_Real VmTr, VMTr;
if(GACT != GeomAbs_Hyperbola) if(GACT != GeomAbs_Hyperbola)
{ {
if(FirstV >= 0. && LastV >= 0.){ VmTr = FirstV; VMTr = ((LastV - FirstV) > 1.e+4) ? (FirstV + 1.e+4) : LastV; } if(FirstV >= 0. && LastV >= 0.){ VmTr = FirstV; VMTr = ((LastV - FirstV) > 1.e+4) ? (FirstV + 1.e+4) : LastV; }
else if(FirstV < 0. && LastV < 0.){ VMTr = LastV; VmTr = ((FirstV - LastV) < -1.e+4) ? (LastV - 1.e+4) : FirstV; } else if(FirstV < 0. && LastV < 0.){ VMTr = LastV; VmTr = ((FirstV - LastV) < -1.e+4) ? (LastV - 1.e+4) : FirstV; }
else { VmTr = (FirstV < -1.e+4) ? -1.e+4 : FirstV; VMTr = (LastV > 1.e+4) ? 1.e+4 : LastV; } else { VmTr = (FirstV < -1.e+4) ? -1.e+4 : FirstV; VMTr = (LastV > 1.e+4) ? 1.e+4 : LastV; }
} }
else//Hyperbola else//Hyperbola
{ {
if(FirstV >= 0. && LastV >= 0.) if(FirstV >= 0. && LastV >= 0.)
{ {
if(FirstV > 4.) return; if(FirstV > 4.) return;
VmTr = FirstV; VMTr = (LastV > 4.) ? 4. : LastV; VmTr = FirstV; VMTr = (LastV > 4.) ? 4. : LastV;
} }
else if(FirstV < 0. && LastV < 0.) else if(FirstV < 0. && LastV < 0.)
{ {
if(LastV < -4.) return; if(LastV < -4.) return;
VMTr = LastV; VmTr = (FirstV < -4.) ? -4. : FirstV; VMTr = LastV; VmTr = (FirstV < -4.) ? -4. : FirstV;
} }
else { VmTr = (FirstV < -4.) ? -4. : FirstV; VMTr = (LastV > 4.) ? 4. : LastV; } else { VmTr = (FirstV < -4.) ? -4. : FirstV; VMTr = (LastV > 4.) ? 4. : LastV; }
} }
//Make trimmed surface //Make trimmed surface
Handle(Geom_RectangularTrimmedSurface) rts = new Geom_RectangularTrimmedSurface(gos,VmTr,VMTr,Standard_True); Handle(Geom_RectangularTrimmedSurface) rts = new Geom_RectangularTrimmedSurface(gos,VmTr,VMTr,Standard_True);
I = rts->UIso(U); I = rts->UIso(U);
} }
} }
} }
//================================================================================ //================================================================================
@ -366,11 +366,11 @@ static void FUN_GetViso(const Handle(Geom_Surface)& GS,
Handle(Geom_Curve) gc = GS->VIso(V); Handle(Geom_Curve) gc = GS->VIso(V);
if(IsUP && (FirstU == 0.0 && LastU == (2*M_PI))) I = gc; if(IsUP && (FirstU == 0.0 && LastU == (2*M_PI))) I = gc;
else else
{ {
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstU,LastU); Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstU,LastU);
//szv:I = Handle(Geom_Curve)::DownCast(gtc); //szv:I = Handle(Geom_Curve)::DownCast(gtc);
I = gtc; I = gtc;
} }
} }
else//OffsetSurface else//OffsetSurface
{ {
@ -380,43 +380,43 @@ static void FUN_GetViso(const Handle(Geom_Surface)& GS,
GeomAdaptor_Curve gac(gcbs); GeomAdaptor_Curve gac(gcbs);
const GeomAbs_CurveType GACT = gac.GetType(); const GeomAbs_CurveType GACT = gac.GetType();
if(IsUP || IsUC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve || Abs(LastU - FirstU) < 1.e+5) if(IsUP || IsUC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve || Abs(LastU - FirstU) < 1.e+5)
{ {
Handle(Geom_Curve) gc = gos->VIso(V); Handle(Geom_Curve) gc = gos->VIso(V);
if(IsUP && (FirstU == 0.0 && LastU == (2*M_PI))) I = gc; if(IsUP && (FirstU == 0.0 && LastU == (2*M_PI))) I = gc;
else else
{ {
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstU,LastU); Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstU,LastU);
//szv:I = Handle(Geom_Curve)::DownCast(gtc); //szv:I = Handle(Geom_Curve)::DownCast(gtc);
I = gtc; I = gtc;
} }
} }
else//Offset Line, Parab, Hyperb else//Offset Line, Parab, Hyperb
{ {
Standard_Real UmTr, UMTr; Standard_Real UmTr, UMTr;
if(GACT != GeomAbs_Hyperbola) if(GACT != GeomAbs_Hyperbola)
{ {
if(FirstU >= 0. && LastU >= 0.){ UmTr = FirstU; UMTr = ((LastU - FirstU) > 1.e+4) ? (FirstU + 1.e+4) : LastU; } if(FirstU >= 0. && LastU >= 0.){ UmTr = FirstU; UMTr = ((LastU - FirstU) > 1.e+4) ? (FirstU + 1.e+4) : LastU; }
else if(FirstU < 0. && LastU < 0.){ UMTr = LastU; UmTr = ((FirstU - LastU) < -1.e+4) ? (LastU - 1.e+4) : FirstU; } else if(FirstU < 0. && LastU < 0.){ UMTr = LastU; UmTr = ((FirstU - LastU) < -1.e+4) ? (LastU - 1.e+4) : FirstU; }
else { UmTr = (FirstU < -1.e+4) ? -1.e+4 : FirstU; UMTr = (LastU > 1.e+4) ? 1.e+4 : LastU; } else { UmTr = (FirstU < -1.e+4) ? -1.e+4 : FirstU; UMTr = (LastU > 1.e+4) ? 1.e+4 : LastU; }
} }
else//Hyperbola else//Hyperbola
{ {
if(FirstU >= 0. && LastU >= 0.) if(FirstU >= 0. && LastU >= 0.)
{ {
if(FirstU > 4.) return; if(FirstU > 4.) return;
UmTr = FirstU; UMTr = (LastU > 4.) ? 4. : LastU; UmTr = FirstU; UMTr = (LastU > 4.) ? 4. : LastU;
} }
else if(FirstU < 0. && LastU < 0.) else if(FirstU < 0. && LastU < 0.)
{ {
if(LastU < -4.) return; if(LastU < -4.) return;
UMTr = LastU; UmTr = (FirstU < -4.) ? -4. : FirstU; UMTr = LastU; UmTr = (FirstU < -4.) ? -4. : FirstU;
} }
else { UmTr = (FirstU < -4.) ? -4. : FirstU; UMTr = (LastU > 4.) ? 4. : LastU; } else { UmTr = (FirstU < -4.) ? -4. : FirstU; UMTr = (LastU > 4.) ? 4. : LastU; }
} }
//Make trimmed surface //Make trimmed surface
Handle(Geom_RectangularTrimmedSurface) rts = new Geom_RectangularTrimmedSurface(gos,UmTr,UMTr,Standard_True); Handle(Geom_RectangularTrimmedSurface) rts = new Geom_RectangularTrimmedSurface(gos,UmTr,UMTr,Standard_True);
I = rts->VIso(V); I = rts->VIso(V);
} }
} }
} }
//================================================================================ //================================================================================
@ -553,11 +553,11 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1,
if(ICC.NbPoints() > 0 ) if(ICC.NbPoints() > 0 )
{ {
for(Standard_Integer ip = 1; ip <= ICC.NbPoints(); ip++) for(Standard_Integer ip = 1; ip <= ICC.NbPoints(); ip++)
{ {
gp_Pnt2d P = ICC.Point(ip); gp_Pnt2d P = ICC.Point(ip);
gp_Pnt P3d = ElCLib::To3d(gp_Ax2(puvS1,gp_Dir(DV)),P); gp_Pnt P3d = ElCLib::To3d(gp_Ax2(puvS1,gp_Dir(DV)),P);
SP.Append(P3d); SP.Append(P3d);
} }
} }
} }
//================================================================================ //================================================================================
@ -578,52 +578,52 @@ static void FUN_NewFirstLast(const GeomAbs_CurveType& ga_ct,
case GeomAbs_Parabola: case GeomAbs_Parabola:
{ {
if(Abs(Lst - Fst) > TrVal) if(Abs(Lst - Fst) > TrVal)
{ {
if(Fst >= 0. && Lst >= 0.) if(Fst >= 0. && Lst >= 0.)
{ {
NewFst = Fst; NewFst = Fst;
NewLst = ((Fst + TrVal) < Lst) ? (Fst + TrVal) : Lst; NewLst = ((Fst + TrVal) < Lst) ? (Fst + TrVal) : Lst;
} }
if(Fst < 0. && Lst < 0.) if(Fst < 0. && Lst < 0.)
{ {
NewLst = Lst; NewLst = Lst;
NewFst = ((Lst - TrVal) > Fst) ? (Lst - TrVal) : Fst; NewFst = ((Lst - TrVal) > Fst) ? (Lst - TrVal) : Fst;
} }
else else
{ {
NewFst = (Fst < -TrVal) ? -TrVal : Fst; NewFst = (Fst < -TrVal) ? -TrVal : Fst;
NewLst = (Lst > TrVal) ? TrVal : Lst; NewLst = (Lst > TrVal) ? TrVal : Lst;
} }
NeedTr = Standard_True; NeedTr = Standard_True;
} }
break;
}
case GeomAbs_Hyperbola:
{
if(Abs(Lst - Fst) > 10.)
{
if(Fst >= 0. && Lst >= 0.)
{
if(Fst > 4.) return;
NewFst = Fst;
NewLst = (Lst > 4.) ? 4. : Lst;
}
if(Fst < 0. && Lst < 0.)
{
if(Lst < -4.) return;
NewLst = Lst;
NewFst = (Fst < -4.) ? -4. : Fst;
}
else
{
NewFst = (Fst < -4.) ? -4. : Fst;
NewLst = (Lst > 4.) ? 4. : Lst;
}
NeedTr = Standard_True;
}
break; break;
} }
default: case GeomAbs_Hyperbola:
{
if(Abs(Lst - Fst) > 10.)
{
if(Fst >= 0. && Lst >= 0.)
{
if(Fst > 4.) return;
NewFst = Fst;
NewLst = (Lst > 4.) ? 4. : Lst;
}
if(Fst < 0. && Lst < 0.)
{
if(Lst < -4.) return;
NewLst = Lst;
NewFst = (Fst < -4.) ? -4. : Fst;
}
else
{
NewFst = (Fst < -4.) ? -4. : Fst;
NewLst = (Lst > 4.) ? 4. : Lst;
}
NeedTr = Standard_True;
}
break;
}
default:
break; break;
} }
} }
@ -684,19 +684,19 @@ static void FUN_TrimBothSurf(const Handle(Adaptor3d_HSurface)& S1,
if(TrmU1) if(TrmU1)
{ {
if(TrmV1) if(TrmV1)
{ {
Handle(Adaptor3d_HSurface) TS = NS1; Handle(Adaptor3d_HSurface) TS = NS1;
NS1 = TS->UTrim(U1S1, U2S1, 1.0e-7); NS1 = TS->UTrim(U1S1, U2S1, 1.0e-7);
} }
else NS1 = S1->UTrim(U1S1, U2S1, 1.0e-7); else NS1 = S1->UTrim(U1S1, U2S1, 1.0e-7);
} }
if(TrmU2) if(TrmU2)
{ {
if(TrmV2) if(TrmV2)
{ {
Handle(Adaptor3d_HSurface) TS = NS2; Handle(Adaptor3d_HSurface) TS = NS2;
NS2 = TS->UTrim(U1S2, U2S2, 1.0e-7); NS2 = TS->UTrim(U1S2, U2S2, 1.0e-7);
} }
else NS2 = S2->UTrim(U1S2, U2S2, 1.0e-7); else NS2 = S2->UTrim(U1S2, U2S2, 1.0e-7);
} }
} }
@ -732,7 +732,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
//treatment of the cases with cone or torus //treatment of the cases with cone or torus
Standard_Boolean TreatAsBiParametric = Standard_False; Standard_Boolean TreatAsBiParametric = Standard_False;
Standard_Integer bImp = 0; Standard_Integer bGeomGeom = 0;
// //
if (typs1 == GeomAbs_Cone || typs2 == GeomAbs_Cone || if (typs1 == GeomAbs_Cone || typs2 == GeomAbs_Cone ||
typs1 == GeomAbs_Torus || typs2 == GeomAbs_Torus) { typs1 == GeomAbs_Torus || typs2 == GeomAbs_Torus) {
@ -748,36 +748,47 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
aCTType = aCTSurf->GetType(); aCTType = aCTSurf->GetType();
bToCheck = Standard_False; bToCheck = Standard_False;
// //
if (aCTType == GeomAbs_Cone) { if (typs1 == GeomAbs_Cone || typs2 == GeomAbs_Cone) {
Standard_Real a1 = Abs(aCTSurf->Cone().SemiAngle()); const gp_Cone aCon1 = (aCTType == GeomAbs_Cone) ?
aCTSurf->Cone() : aGeomSurf->Cone();
Standard_Real a1 = Abs(aCon1.SemiAngle());
bToCheck = (a1 < 0.02) || (a1 > 1.55); bToCheck = (a1 < 0.02) || (a1 > 1.55);
//
if (typs1 == typs2) { if (typs1 == typs2) {
Standard_Real a2 = Abs(aGeomSurf->Cone().SemiAngle()); const gp_Cone aCon2 = aGeomSurf->Cone();
Standard_Real a2 = Abs(aCon2.SemiAngle());
bToCheck = bToCheck || (a2 < 0.02) || (a2 > 1.55); bToCheck = bToCheck || (a2 < 0.02) || (a2 > 1.55);
// //
if (a1 > 1.55 && a2 > 1.55) {//quasi-planes: if same domain, treat as canonic if (a1 > 1.55 && a2 > 1.55) {//quasi-planes: if same domain, treat as canonic
const gp_Cone aCon1 = aCTSurf->Cone();
const gp_Cone aCon2 = aGeomSurf->Cone();
const gp_Ax1 A1 = aCon1.Axis(), A2 = aCon2.Axis(); const gp_Ax1 A1 = aCon1.Axis(), A2 = aCon2.Axis();
if (A1.IsParallel(A2,Precision::Angular())) { if (A1.IsParallel(A2,Precision::Angular())) {
const gp_Pnt Apex1 = aCon1.Apex(), Apex2 = aCon2.Apex(); const gp_Pnt Apex1 = aCon1.Apex(), Apex2 = aCon2.Apex();
const gp_Pln Plan1( Apex1, A1.Direction() ); const gp_Pln Plan1( Apex1, A1.Direction() );
if (Plan1.Distance( Apex2 ) <= Precision::Confusion()) { if (Plan1.Distance( Apex2 ) <= Precision::Confusion()) {
bToCheck = Standard_False; bToCheck = Standard_False;
bImp = 1;
} }
} }
} }
} }
// //
aCTAx = aCTSurf->Cone().Axis(); TreatAsBiParametric = bToCheck;
} if (aCTType == GeomAbs_Cone) {
else { aCTAx = aCon1.Axis();
bToCheck = aCTSurf->Torus().MajorRadius() > aCTSurf->Torus().MinorRadius(); }
if (bToCheck && (typs1 == typs2)) { }
bToCheck = aGeomSurf->Torus().MajorRadius() > aGeomSurf->Torus().MinorRadius(); //
if (typs1 == GeomAbs_Torus || typs2 == GeomAbs_Torus) {
const gp_Torus aTor1 = (aCTType == GeomAbs_Torus) ?
aCTSurf->Torus() : aGeomSurf->Torus();
bToCheck = aTor1.MajorRadius() > aTor1.MinorRadius();
if (typs1 == typs2) {
const gp_Torus aTor2 = aGeomSurf->Torus();
bToCheck = aTor2.MajorRadius() > aTor2.MinorRadius();
}
//
if (aCTType == GeomAbs_Torus) {
aCTAx = aTor1.Axis();
} }
aCTAx = aCTSurf->Torus().Axis();
} }
// //
if (bToCheck) { if (bToCheck) {
@ -787,11 +798,11 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
case GeomAbs_Plane: { case GeomAbs_Plane: {
aGeomAx = aGeomSurf->Plane().Axis(); aGeomAx = aGeomSurf->Plane().Axis();
if (aCTType == GeomAbs_Cone) { if (aCTType == GeomAbs_Cone) {
bImp = 1; bGeomGeom = 1;
if (Abs(aCTSurf->Cone().SemiAngle()) < 0.02) { if (Abs(aCTSurf->Cone().SemiAngle()) < 0.02) {
Standard_Real ps = Abs(aCTAx.Direction().Dot(aGeomAx.Direction())); Standard_Real ps = Abs(aCTAx.Direction().Dot(aGeomAx.Direction()));
if(ps < 0.015) { if(ps < 0.015) {
bImp = 0; bGeomGeom = 0;
} }
} }
} }
@ -799,7 +810,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
if (aCTAx.IsParallel(aGeomAx, Precision::Angular()) || if (aCTAx.IsParallel(aGeomAx, Precision::Angular()) ||
(aCTAx.IsNormal(aGeomAx, Precision::Angular()) && (aCTAx.IsNormal(aGeomAx, Precision::Angular()) &&
(aGeomSurf->Plane().Distance(aCTAx.Location()) < Precision::Confusion()))) { (aGeomSurf->Plane().Distance(aCTAx.Location()) < Precision::Confusion()))) {
bImp = 1; bGeomGeom = 1;
} }
} }
bToCheck = Standard_False; bToCheck = Standard_False;
@ -807,7 +818,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
} }
case GeomAbs_Sphere: { case GeomAbs_Sphere: {
if (aL1.Distance(aGeomSurf->Sphere().Location()) < Precision::Confusion()) { if (aL1.Distance(aGeomSurf->Sphere().Location()) < Precision::Confusion()) {
bImp = 1; bGeomGeom = 1;
} }
bToCheck = Standard_False; bToCheck = Standard_False;
break; break;
@ -829,12 +840,12 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
if (bToCheck) { if (bToCheck) {
if (aCTAx.IsParallel(aGeomAx, Precision::Angular()) && if (aCTAx.IsParallel(aGeomAx, Precision::Angular()) &&
(aL1.Distance(aGeomAx.Location()) <= Precision::Confusion())) { (aL1.Distance(aGeomAx.Location()) <= Precision::Confusion())) {
bImp = 1; bGeomGeom = 1;
} }
} }
// //
if (aCTType == GeomAbs_Cone) { if (bGeomGeom == 1) {
TreatAsBiParametric = (bImp == 0); TreatAsBiParametric = Standard_False;
} }
} }
} }
@ -868,7 +879,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
case GeomAbs_Cylinder: case GeomAbs_Cylinder:
case GeomAbs_Sphere: case GeomAbs_Sphere:
case GeomAbs_Cone: ts1 = 1; break; case GeomAbs_Cone: ts1 = 1; break;
case GeomAbs_Torus: ts1 = bImp; break; case GeomAbs_Torus: ts1 = bGeomGeom; break;
default: break; default: break;
} }
@ -879,7 +890,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
case GeomAbs_Cylinder: case GeomAbs_Cylinder:
case GeomAbs_Sphere: case GeomAbs_Sphere:
case GeomAbs_Cone: ts2 = 1; break; case GeomAbs_Cone: ts2 = 1; break;
case GeomAbs_Torus: ts2 = bImp; break; case GeomAbs_Torus: ts2 = bGeomGeom; break;
default: break; default: break;
} }
// //
@ -955,7 +966,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
// //
//treatment of the cases with cone or torus //treatment of the cases with cone or torus
Standard_Boolean TreatAsBiParametric = Standard_False; Standard_Boolean TreatAsBiParametric = Standard_False;
Standard_Integer bImp = 0; Standard_Integer bGeomGeom = 0;
// //
if (typs1 == GeomAbs_Cone || typs2 == GeomAbs_Cone || if (typs1 == GeomAbs_Cone || typs2 == GeomAbs_Cone ||
typs1 == GeomAbs_Torus || typs2 == GeomAbs_Torus) { typs1 == GeomAbs_Torus || typs2 == GeomAbs_Torus) {
@ -971,36 +982,47 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
aCTType = aCTSurf->GetType(); aCTType = aCTSurf->GetType();
bToCheck = Standard_False; bToCheck = Standard_False;
// //
if (aCTType == GeomAbs_Cone) { if (typs1 == GeomAbs_Cone || typs2 == GeomAbs_Cone) {
Standard_Real a1 = Abs(aCTSurf->Cone().SemiAngle()); const gp_Cone aCon1 = (aCTType == GeomAbs_Cone) ?
aCTSurf->Cone() : aGeomSurf->Cone();
Standard_Real a1 = Abs(aCon1.SemiAngle());
bToCheck = (a1 < 0.02) || (a1 > 1.55); bToCheck = (a1 < 0.02) || (a1 > 1.55);
//
if (typs1 == typs2) { if (typs1 == typs2) {
Standard_Real a2 = Abs(aGeomSurf->Cone().SemiAngle()); const gp_Cone aCon2 = aGeomSurf->Cone();
Standard_Real a2 = Abs(aCon2.SemiAngle());
bToCheck = bToCheck || (a2 < 0.02) || (a2 > 1.55); bToCheck = bToCheck || (a2 < 0.02) || (a2 > 1.55);
// //
if (a1 > 1.55 && a2 > 1.55) {//quasi-planes: if same domain, treat as canonic if (a1 > 1.55 && a2 > 1.55) {//quasi-planes: if same domain, treat as canonic
const gp_Cone aCon1 = aCTSurf->Cone();
const gp_Cone aCon2 = aGeomSurf->Cone();
const gp_Ax1 A1 = aCon1.Axis(), A2 = aCon2.Axis(); const gp_Ax1 A1 = aCon1.Axis(), A2 = aCon2.Axis();
if (A1.IsParallel(A2,Precision::Angular())) { if (A1.IsParallel(A2,Precision::Angular())) {
const gp_Pnt Apex1 = aCon1.Apex(), Apex2 = aCon2.Apex(); const gp_Pnt Apex1 = aCon1.Apex(), Apex2 = aCon2.Apex();
const gp_Pln Plan1( Apex1, A1.Direction() ); const gp_Pln Plan1( Apex1, A1.Direction() );
if (Plan1.Distance( Apex2 ) <= Precision::Confusion()) { if (Plan1.Distance( Apex2 ) <= Precision::Confusion()) {
bToCheck = Standard_False; bToCheck = Standard_False;
bImp = 1;
} }
} }
} }
} }
// //
aCTAx = aCTSurf->Cone().Axis(); TreatAsBiParametric = bToCheck;
} if (aCTType == GeomAbs_Cone) {
else { aCTAx = aCon1.Axis();
bToCheck = aCTSurf->Torus().MajorRadius() > aCTSurf->Torus().MinorRadius(); }
if (bToCheck && (typs1 == typs2)) { }
bToCheck = aGeomSurf->Torus().MajorRadius() > aGeomSurf->Torus().MinorRadius(); //
if (typs1 == GeomAbs_Torus || typs2 == GeomAbs_Torus) {
const gp_Torus aTor1 = (aCTType == GeomAbs_Torus) ?
aCTSurf->Torus() : aGeomSurf->Torus();
bToCheck = aTor1.MajorRadius() > aTor1.MinorRadius();
if (typs1 == typs2) {
const gp_Torus aTor2 = aGeomSurf->Torus();
bToCheck = aTor2.MajorRadius() > aTor2.MinorRadius();
}
//
if (aCTType == GeomAbs_Torus) {
aCTAx = aTor1.Axis();
} }
aCTAx = aCTSurf->Torus().Axis();
} }
// //
if (bToCheck) { if (bToCheck) {
@ -1010,11 +1032,11 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
case GeomAbs_Plane: { case GeomAbs_Plane: {
aGeomAx = aGeomSurf->Plane().Axis(); aGeomAx = aGeomSurf->Plane().Axis();
if (aCTType == GeomAbs_Cone) { if (aCTType == GeomAbs_Cone) {
bImp = 1; bGeomGeom = 1;
if (Abs(aCTSurf->Cone().SemiAngle()) < 0.02) { if (Abs(aCTSurf->Cone().SemiAngle()) < 0.02) {
Standard_Real ps = Abs(aCTAx.Direction().Dot(aGeomAx.Direction())); Standard_Real ps = Abs(aCTAx.Direction().Dot(aGeomAx.Direction()));
if(ps < 0.015) { if(ps < 0.015) {
bImp = 0; bGeomGeom = 0;
} }
} }
} }
@ -1022,7 +1044,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
if (aCTAx.IsParallel(aGeomAx, Precision::Angular()) || if (aCTAx.IsParallel(aGeomAx, Precision::Angular()) ||
(aCTAx.IsNormal(aGeomAx, Precision::Angular()) && (aCTAx.IsNormal(aGeomAx, Precision::Angular()) &&
(aGeomSurf->Plane().Distance(aCTAx.Location()) < Precision::Confusion()))) { (aGeomSurf->Plane().Distance(aCTAx.Location()) < Precision::Confusion()))) {
bImp = 1; bGeomGeom = 1;
} }
} }
bToCheck = Standard_False; bToCheck = Standard_False;
@ -1030,7 +1052,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
} }
case GeomAbs_Sphere: { case GeomAbs_Sphere: {
if (aL1.Distance(aGeomSurf->Sphere().Location()) < Precision::Confusion()) { if (aL1.Distance(aGeomSurf->Sphere().Location()) < Precision::Confusion()) {
bImp = 1; bGeomGeom = 1;
} }
bToCheck = Standard_False; bToCheck = Standard_False;
break; break;
@ -1052,12 +1074,12 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
if (bToCheck) { if (bToCheck) {
if (aCTAx.IsParallel(aGeomAx, Precision::Angular()) && if (aCTAx.IsParallel(aGeomAx, Precision::Angular()) &&
(aL1.Distance(aGeomAx.Location()) <= Precision::Confusion())) { (aL1.Distance(aGeomAx.Location()) <= Precision::Confusion())) {
bImp = 1; bGeomGeom = 1;
} }
} }
// //
if (aCTType == GeomAbs_Cone) { if (bGeomGeom == 1) {
TreatAsBiParametric = (bImp == 0); TreatAsBiParametric = Standard_False;
} }
} }
} }
@ -1082,7 +1104,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
case GeomAbs_Cylinder: case GeomAbs_Cylinder:
case GeomAbs_Sphere: case GeomAbs_Sphere:
case GeomAbs_Cone: ts1 = 1; break; case GeomAbs_Cone: ts1 = 1; break;
case GeomAbs_Torus: ts1 = bImp; break; case GeomAbs_Torus: ts1 = bGeomGeom; break;
default: break; default: break;
} }
@ -1093,7 +1115,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
case GeomAbs_Cylinder: case GeomAbs_Cylinder:
case GeomAbs_Sphere: case GeomAbs_Sphere:
case GeomAbs_Cone: ts2 = 1; break; case GeomAbs_Cone: ts2 = 1; break;
case GeomAbs_Torus: ts2 = bImp; break; case GeomAbs_Torus: ts2 = bGeomGeom; break;
default: break; default: break;
} }
// //
@ -1475,7 +1497,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
IntPatch_PrmPrmIntersection interpp; IntPatch_PrmPrmIntersection interpp;
interpp.Perform(S1,D1,S2,D2,U1,V1,U2,V2,TolArc,TolTang,myFleche,myUVMaxStep); interpp.Perform(S1,D1,S2,D2,U1,V1,U2,V2,TolArc,TolTang,myFleche,myUVMaxStep);
if (interpp.IsDone()) if (interpp.IsDone())
{ {
done = Standard_True; done = Standard_True;
tgte = Standard_False; tgte = Standard_False;
empt = interpp.IsEmpty(); empt = interpp.IsEmpty();
@ -1493,19 +1515,19 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
//void IntPatch_Intersection__MAJ_R(Handle_Adaptor2d_HCurve2d *R1, //void IntPatch_Intersection__MAJ_R(Handle_Adaptor2d_HCurve2d *R1,
// Handle_Adaptor2d_HCurve2d *R2, // Handle_Adaptor2d_HCurve2d *R2,
// int *NR1, // int *NR1,
// int *NR2, // int *NR2,
// Standard_Integer nbR1, // Standard_Integer nbR1,
// Standard_Integer nbR2, // Standard_Integer nbR2,
// const IntPatch_Point& VTX) // const IntPatch_Point& VTX)
void IntPatch_Intersection__MAJ_R(Handle_Adaptor2d_HCurve2d *, void IntPatch_Intersection__MAJ_R(Handle_Adaptor2d_HCurve2d *,
Handle_Adaptor2d_HCurve2d *, Handle_Adaptor2d_HCurve2d *,
int *, int *,
int *, int *,
Standard_Integer , Standard_Integer ,
Standard_Integer , Standard_Integer ,
const IntPatch_Point& ) const IntPatch_Point& )
{ {
/* /*
if(VTX.IsOnDomS1()) { if(VTX.IsOnDomS1()) {
@ -1513,9 +1535,9 @@ void IntPatch_Intersection__MAJ_R(Handle_Adaptor2d_HCurve2d *,
//-- long unsigned ptr= *((long unsigned *)(((Handle_Standard_Transient *)(&(VTX.ArcOnS1()))))); //-- long unsigned ptr= *((long unsigned *)(((Handle_Standard_Transient *)(&(VTX.ArcOnS1())))));
for(Standard_Integer i=0; i<nbR1;i++) { for(Standard_Integer i=0; i<nbR1;i++) {
if(VTX.ArcOnS1()==R1[i]) { if(VTX.ArcOnS1()==R1[i]) {
NR1[i]++; NR1[i]++;
printf("\n ******************************"); printf("\n ******************************");
return; return;
} }
} }
printf("\n R Pas trouvee (IntPatch)\n"); printf("\n R Pas trouvee (IntPatch)\n");
@ -1527,10 +1549,10 @@ void IntPatch_Intersection__MAJ_R(Handle_Adaptor2d_HCurve2d *,
//void IntPatch_Intersection::Dump(const Standard_Integer Mode, //void IntPatch_Intersection::Dump(const Standard_Integer Mode,
void IntPatch_Intersection::Dump(const Standard_Integer , void IntPatch_Intersection::Dump(const Standard_Integer ,
const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S1,
const Handle(Adaptor3d_TopolTool)& D1, const Handle(Adaptor3d_TopolTool)& D1,
const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_HSurface)& S2,
const Handle(Adaptor3d_TopolTool)& D2) const const Handle(Adaptor3d_TopolTool)& D2) const
{ {
//-- ---------------------------------------------------------------------- //-- ----------------------------------------------------------------------
@ -1561,23 +1583,24 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
else if(IType == IntPatch_Restriction) { else if(IType == IntPatch_Restriction) {
nbr++; nbr++;
Handle(IntPatch_RLine)& rlin = Handle(IntPatch_RLine)& rlin =
*((Handle(IntPatch_RLine) *)&line); *((Handle(IntPatch_RLine) *)&line);
if(rlin->IsArcOnS1()) nbr1++; if(rlin->IsArcOnS1()) nbr1++;
if(rlin->IsArcOnS2()) nbr2++; if(rlin->IsArcOnS2()) nbr2++;
} }
else if(IType == IntPatch_Analytic) nba++; else if(IType == IntPatch_Analytic) nba++;
else { nbg++; else {
if(IType == IntPatch_Lin) nbgl++; nbg++;
else if(IType == IntPatch_Circle) nbgc++; if(IType == IntPatch_Lin) nbgl++;
else if(IType == IntPatch_Parabola) nbgp++; else if(IType == IntPatch_Circle) nbgc++;
else if(IType == IntPatch_Hyperbola) nbgh++; else if(IType == IntPatch_Parabola) nbgp++;
else if(IType == IntPatch_Ellipse) nbge++; else if(IType == IntPatch_Hyperbola) nbgh++;
} else if(IType == IntPatch_Ellipse) nbge++;
}
} }
printf("\nDUMP_INT:Lines:%2d Wlin:%2d Restr:%2d(On1:%2d On2:%2d) Ana:%2d Geom:%2d(L:%2d C:%2d E:%2d H:%2d P:%2d)", printf("\nDUMP_INT:Lines:%2d Wlin:%2d Restr:%2d(On1:%2d On2:%2d) Ana:%2d Geom:%2d(L:%2d C:%2d E:%2d H:%2d P:%2d)",
nbl,nbw,nbr,nbr1,nbr2,nba,nbg,nbgl,nbgc,nbge,nbgh,nbgp); nbl,nbw,nbr,nbr1,nbr2,nba,nbg,nbgl,nbgc,nbge,nbgh,nbgp);
IntPatch_LineConstructor LineConstructor(2); IntPatch_LineConstructor LineConstructor(2);
@ -1596,47 +1619,47 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
nbllc++; nbllc++;
const Handle(IntPatch_Line)& LineK = LineConstructor.Line(k); const Handle(IntPatch_Line)& LineK = LineConstructor.Line(k);
if (LineK->ArcType() == IntPatch_Analytic) { if (LineK->ArcType() == IntPatch_Analytic) {
Handle(IntPatch_ALine)& alin = Handle(IntPatch_ALine)& alin =
*((Handle(IntPatch_ALine) *)&LineK); *((Handle(IntPatch_ALine) *)&LineK);
nbvtx=alin->NbVertex(); nbvtx=alin->NbVertex();
nbva+=nbvtx; nba++; nbva+=nbvtx; nba++;
for(v=1;v<=nbvtx;v++) { for(v=1;v<=nbvtx;v++) {
IntPatch_Intersection__MAJ_R(R1,R2,NR1,NR2,nbR1,nbR2,alin->Vertex(v)); IntPatch_Intersection__MAJ_R(R1,R2,NR1,NR2,nbR1,nbR2,alin->Vertex(v));
} }
} }
else if (LineK->ArcType() == IntPatch_Restriction) { else if (LineK->ArcType() == IntPatch_Restriction) {
Handle(IntPatch_RLine)& rlin = Handle(IntPatch_RLine)& rlin =
*((Handle(IntPatch_RLine) *)&LineK); *((Handle(IntPatch_RLine) *)&LineK);
nbvtx=rlin->NbVertex(); nbvtx=rlin->NbVertex();
nbvr+=nbvtx; nbr++; nbvr+=nbvtx; nbr++;
for(v=1;v<=nbvtx;v++) { for(v=1;v<=nbvtx;v++) {
IntPatch_Intersection__MAJ_R(R1,R2,NR1,NR2,nbR1,nbR2,rlin->Vertex(v)); IntPatch_Intersection__MAJ_R(R1,R2,NR1,NR2,nbR1,nbR2,rlin->Vertex(v));
} }
} }
else if (LineK->ArcType() == IntPatch_Walking) { else if (LineK->ArcType() == IntPatch_Walking) {
Handle(IntPatch_WLine)& wlin = Handle(IntPatch_WLine)& wlin =
*((Handle(IntPatch_WLine) *)&LineK); *((Handle(IntPatch_WLine) *)&LineK);
nbvtx=wlin->NbVertex(); nbvtx=wlin->NbVertex();
nbvw+=nbvtx; nbw++; nbvw+=nbvtx; nbw++;
for(v=1;v<=nbvtx;v++) { for(v=1;v<=nbvtx;v++) {
IntPatch_Intersection__MAJ_R(R1,R2,NR1,NR2,nbR1,nbR2,wlin->Vertex(v)); IntPatch_Intersection__MAJ_R(R1,R2,NR1,NR2,nbR1,nbR2,wlin->Vertex(v));
} }
} }
else { else {
Handle(IntPatch_GLine)& glin = Handle(IntPatch_GLine)& glin =
*((Handle(IntPatch_GLine) *)&LineK); *((Handle(IntPatch_GLine) *)&LineK);
nbvtx=glin->NbVertex(); nbvtx=glin->NbVertex();
nbvg+=nbvtx; nbg++; nbvg+=nbvtx; nbg++;
for(v=1;v<=nbvtx;v++) { for(v=1;v<=nbvtx;v++) {
IntPatch_Intersection__MAJ_R(R1,R2,NR1,NR2,nbR1,nbR2,glin->Vertex(v)); IntPatch_Intersection__MAJ_R(R1,R2,NR1,NR2,nbR1,nbR2,glin->Vertex(v));
} }
} }
} }
} }
printf("\nDUMP_LC :Lines:%2d WLin:%2d Restr:%2d Ana:%2d Geom:%2d", printf("\nDUMP_LC :Lines:%2d WLin:%2d Restr:%2d Ana:%2d Geom:%2d",
nbllc,nbw,nbr,nba,nbg); nbllc,nbw,nbr,nba,nbg);
printf("\nDUMP_LC :vtx :%2d r:%2d :%2d :%2d", printf("\nDUMP_LC :vtx :%2d r:%2d :%2d :%2d",
nbvw,nbvr,nbva,nbvg); nbvw,nbvr,nbva,nbvg);

View File

@ -0,0 +1,36 @@
puts "==========="
puts "OCC24648"
puts "==========="
puts ""
##############################################################
# Different types of intersection curves between Cone and Torus with a different order of arguments
##############################################################
cone s1 60 0
torus s2 30 20
intersect i1 s1 s2
set info1 [dump i1_1]
intersect i2 s2 s1
set info2 [dump i2_1]
set type_of_curve "Circle"
if { [regexp ${type_of_curve} ${info1}] != 1 } {
puts "Error : Wrong type of intersection curve #1"
} else {
puts "OK : Good type of intersection curve #1"
}
if { [regexp ${type_of_curve} ${info2}] != 1 } {
puts "Error : Wrong type of intersection curve #2"
} else {
puts "OK : Good type of intersection curve #2"
}
smallview
donly i1_1 i2_1
fit
set only_screen_axo 1