mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-07-25 12:55:50 +03:00
0025416: Wrong section curve
1. Restriction line is processed in IntTools_FaceFace with using methods of GeomInt_IntSS class. 2. Check, if Restriction- and Walking-lines (or Restriction-Restriction lines) are coincided, has been added in IntPatch_ImpPrmIntersection.cxx (at that RLine is considered to be isoline only). 3. Check, if RLine and GLine are coincided, has been added in IntPatch_ImpImpIntersection.cxx. 4. Create new class IntPatch_PointLine, which is inherited from IntPatch_Line. 5. The reason of exception (in DEBUG MODE) has been eliminated. New test cases for issue #25416 were added. tests/bugs/modalg_5/bug24650 was modified.
This commit is contained in:
parent
2a8523acca
commit
d4b867e617
@ -796,6 +796,12 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
if(!aHatcher.IsDone(aIx))
|
||||||
|
{
|
||||||
|
iErr=2;
|
||||||
|
return iErr;
|
||||||
|
}
|
||||||
|
|
||||||
aNbDomains=aHatcher.NbDomains(aIx);
|
aNbDomains=aHatcher.NbDomains(aIx);
|
||||||
if (aNbDomains > 0) {
|
if (aNbDomains > 0) {
|
||||||
const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, 1);
|
const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, 1);
|
||||||
|
@ -1 +1,2 @@
|
|||||||
GeomInt_IntSS_1.cxx
|
GeomInt_IntSS_1.cxx
|
||||||
|
GeomInt_VectorOfReal.hxx
|
@ -35,11 +35,13 @@ uses StdFail,
|
|||||||
|
|
||||||
IntSurf,
|
IntSurf,
|
||||||
IntPatch,
|
IntPatch,
|
||||||
ApproxInt
|
ApproxInt,
|
||||||
|
Bnd
|
||||||
|
|
||||||
is
|
is
|
||||||
|
|
||||||
class IntSS;
|
class IntSS;
|
||||||
|
imported VectorOfReal;
|
||||||
|
|
||||||
class LineConstructor;
|
class LineConstructor;
|
||||||
|
|
||||||
|
@ -30,7 +30,10 @@ uses Intersection from IntPatch,
|
|||||||
Surface from Geom,
|
Surface from Geom,
|
||||||
HSurface from GeomAdaptor,
|
HSurface from GeomAdaptor,
|
||||||
TopolTool from Adaptor3d,
|
TopolTool from Adaptor3d,
|
||||||
Line from IntPatch
|
Line from IntPatch,
|
||||||
|
RLine from IntPatch,
|
||||||
|
Box2d from Bnd,
|
||||||
|
VectorOfReal from GeomInt
|
||||||
|
|
||||||
|
|
||||||
raises NotDone from StdFail,
|
raises NotDone from StdFail,
|
||||||
@ -191,6 +194,27 @@ is
|
|||||||
aTolCheck:out Real from Standard;
|
aTolCheck:out Real from Standard;
|
||||||
aTolAngCheck:out Real from Standard);
|
aTolAngCheck:out Real from Standard);
|
||||||
|
|
||||||
|
TreatRLine(myclass; theRL: RLine from IntPatch;
|
||||||
|
theHS1, theHS2: HSurface from GeomAdaptor;
|
||||||
|
theC3d: out Curve from Geom;
|
||||||
|
theC2d1, theC2d2: out Curve from Geom2d;
|
||||||
|
theTolReached: out Real from Standard);
|
||||||
|
---Purpose: converts RLine to Geom(2d)_Curve.
|
||||||
|
|
||||||
|
BuildPCurves(myclass; f, l : Real from Standard;
|
||||||
|
Tol: out Real from Standard;
|
||||||
|
S: Surface from Geom;
|
||||||
|
C: Curve from Geom;
|
||||||
|
C2d: out Curve from Geom2d);
|
||||||
|
---Purpose: creates 2D-curve on given surface from given 3D-curve
|
||||||
|
|
||||||
|
TrimILineOnSurfBoundaries(myclass; theC2d1, theC2d2: Curve from Geom2d;
|
||||||
|
theBound1, theBound2: Box2d from Bnd;
|
||||||
|
theArrayOfParameters: out VectorOfReal from GeomInt);
|
||||||
|
---Purpose: puts into theArrayOfParameters the parameters of intersection
|
||||||
|
-- points of given theC2d1 and theC2d2 curves with the boundaries
|
||||||
|
-- of the source surface.
|
||||||
|
|
||||||
--- Private methods
|
--- Private methods
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
|
@ -14,8 +14,12 @@
|
|||||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
// commercial license or contractual agreement.
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include <GeomInt_IntSS.ixx>
|
#include <GeomInt_IntSS.ixx>
|
||||||
|
|
||||||
|
#include <GeomInt.hxx>
|
||||||
|
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <gp_Pnt2d.hxx>
|
#include <gp_Pnt2d.hxx>
|
||||||
@ -75,13 +79,22 @@
|
|||||||
#include <GeomInt_WLApprox.hxx>
|
#include <GeomInt_WLApprox.hxx>
|
||||||
#include <Extrema_ExtPS.hxx>
|
#include <Extrema_ExtPS.hxx>
|
||||||
|
|
||||||
static
|
#include <GeomAdaptor_HSurface.hxx>
|
||||||
void BuildPCurves (Standard_Real f,
|
#include <gp_Lin2d.hxx>
|
||||||
Standard_Real l,
|
#include <Geom2d_Line.hxx>
|
||||||
Standard_Real& Tol,
|
#include <IntPatch_RLine.hxx>
|
||||||
const Handle (Geom_Surface)& S,
|
#include <Geom2dAdaptor.hxx>
|
||||||
const Handle (Geom_Curve)& C,
|
#include <Adaptor2d_HCurve2d.hxx>
|
||||||
Handle (Geom2d_Curve)& C2d);
|
#include <Approx_CurveOnSurface.hxx>
|
||||||
|
#include <GeomAdaptor.hxx>
|
||||||
|
#include <GeomProjLib.hxx>
|
||||||
|
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||||
|
#include <TColStd_Array1OfReal.hxx>
|
||||||
|
#include <TColgp_Array1OfPnt2d.hxx>
|
||||||
|
#include <TColStd_Array1OfInteger.hxx>
|
||||||
|
#include <Geom2d_BSplineCurve.hxx>
|
||||||
|
#include <Geom2dAPI_InterCurveCurve.hxx>
|
||||||
|
#include <IntRes2d_IntersectionPoint.hxx>
|
||||||
|
|
||||||
static
|
static
|
||||||
void Parameters(const Handle(GeomAdaptor_HSurface)& HS1,
|
void Parameters(const Handle(GeomAdaptor_HSurface)& HS1,
|
||||||
@ -145,20 +158,6 @@ static
|
|||||||
void GetQuadric(const Handle(GeomAdaptor_HSurface)& HS1,
|
void GetQuadric(const Handle(GeomAdaptor_HSurface)& HS1,
|
||||||
IntSurf_Quadric& quad1);
|
IntSurf_Quadric& quad1);
|
||||||
|
|
||||||
static
|
|
||||||
void TreatRLine(const Handle(IntPatch_RLine)& theRL,
|
|
||||||
const Handle(GeomAdaptor_HSurface)& theHS1,
|
|
||||||
const Handle(GeomAdaptor_HSurface)& theHS2,
|
|
||||||
const Standard_Boolean theApprox1,
|
|
||||||
const Standard_Boolean theApprox2,
|
|
||||||
Handle(Geom_Curve)& theC3d,
|
|
||||||
Handle(Geom2d_Curve)& theC2d1,
|
|
||||||
Handle(Geom2d_Curve)& theC2d2,
|
|
||||||
Standard_Real& theTolReached);
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
class ProjectPointOnSurf
|
class ProjectPointOnSurf
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -251,13 +250,13 @@ Standard_Real ProjectPointOnSurf::LowerDistance() const
|
|||||||
//function : MakeCurve
|
//function : MakeCurve
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GeomInt_IntSS::MakeCurve(const Standard_Integer Index,
|
void GeomInt_IntSS::MakeCurve(const Standard_Integer Index,
|
||||||
const Handle(Adaptor3d_TopolTool) & dom1,
|
const Handle(Adaptor3d_TopolTool) & dom1,
|
||||||
const Handle(Adaptor3d_TopolTool) & dom2,
|
const Handle(Adaptor3d_TopolTool) & dom2,
|
||||||
const Standard_Real Tol,
|
const Standard_Real Tol,
|
||||||
const Standard_Boolean Approx,
|
const Standard_Boolean Approx,
|
||||||
const Standard_Boolean ApproxS1,
|
const Standard_Boolean ApproxS1,
|
||||||
const Standard_Boolean ApproxS2)
|
const Standard_Boolean ApproxS2)
|
||||||
|
|
||||||
{
|
{
|
||||||
Standard_Boolean myApprox1, myApprox2, myApprox;
|
Standard_Boolean myApprox1, myApprox2, myApprox;
|
||||||
@ -1036,96 +1035,92 @@ Standard_Real ProjectPointOnSurf::LowerDistance() const
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isAnalS1 || !isAnalS2)
|
Handle(IntPatch_RLine) RL =
|
||||||
|
Handle(IntPatch_RLine)::DownCast(L);
|
||||||
|
Handle(Geom_Curve) aC3d;
|
||||||
|
Handle(Geom2d_Curve) aC2d1, aC2d2;
|
||||||
|
Standard_Real aTolReached;
|
||||||
|
TreatRLine(RL, myHS1, myHS2, aC3d,
|
||||||
|
aC2d1, aC2d2, aTolReached);
|
||||||
|
|
||||||
|
if(aC3d.IsNull())
|
||||||
|
break;
|
||||||
|
|
||||||
|
Bnd_Box2d aBox1, aBox2;
|
||||||
|
|
||||||
|
const Standard_Real aU1f = myHS1->FirstUParameter(),
|
||||||
|
aV1f = myHS1->FirstVParameter(),
|
||||||
|
aU1l = myHS1->LastUParameter(),
|
||||||
|
aV1l = myHS1->LastVParameter();
|
||||||
|
const Standard_Real aU2f = myHS2->FirstUParameter(),
|
||||||
|
aV2f = myHS2->FirstVParameter(),
|
||||||
|
aU2l = myHS2->LastUParameter(),
|
||||||
|
aV2l = myHS2->LastVParameter();
|
||||||
|
|
||||||
|
aBox1.Add(gp_Pnt2d(aU1f, aV1f));
|
||||||
|
aBox1.Add(gp_Pnt2d(aU1l, aV1l));
|
||||||
|
aBox2.Add(gp_Pnt2d(aU2f, aV2f));
|
||||||
|
aBox2.Add(gp_Pnt2d(aU2l, aV2l));
|
||||||
|
|
||||||
|
GeomInt_VectorOfReal anArrayOfParameters;
|
||||||
|
|
||||||
|
//We consider here that the intersection line is same-parameter-line
|
||||||
|
anArrayOfParameters.Append(aC3d->FirstParameter());
|
||||||
|
anArrayOfParameters.Append(aC3d->LastParameter());
|
||||||
|
|
||||||
|
TrimILineOnSurfBoundaries(aC2d1, aC2d2, aBox1, aBox2, anArrayOfParameters);
|
||||||
|
|
||||||
|
const Standard_Integer aNbIntersSolutionsm1 = anArrayOfParameters.Length() - 1;
|
||||||
|
|
||||||
|
//Trim RLine found.
|
||||||
|
for(Standard_Integer anInd = 0; anInd < aNbIntersSolutionsm1; anInd++)
|
||||||
{
|
{
|
||||||
Handle(IntPatch_RLine) RL =
|
const Standard_Real aParF = anArrayOfParameters(anInd),
|
||||||
Handle(IntPatch_RLine)::DownCast(L);
|
aParL = anArrayOfParameters(anInd+1);
|
||||||
Handle(Geom_Curve) aC3d;
|
|
||||||
Handle(Geom2d_Curve) aC2d1, aC2d2;
|
if((aParL - aParF) <= Precision::PConfusion())
|
||||||
Standard_Real aTolReached;
|
continue;
|
||||||
TreatRLine(RL, myHS1, myHS2, myApprox1, myApprox2, aC3d,
|
|
||||||
aC2d1, aC2d2, aTolReached);
|
const Standard_Real aPar = 0.5*(aParF + aParL);
|
||||||
sline.Append(aC3d);
|
gp_Pnt2d aPt;
|
||||||
slineS1.Append(aC2d1);
|
|
||||||
slineS2.Append(aC2d2);
|
Handle(Geom2d_Curve) aCurv2d1, aCurv2d2;
|
||||||
|
if(!aC2d1.IsNull())
|
||||||
|
{
|
||||||
|
aC2d1->D0(aPar, aPt);
|
||||||
|
|
||||||
|
if(aBox1.IsOut(aPt))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(myApprox1)
|
||||||
|
aCurv2d1 = new Geom2d_TrimmedCurve(aC2d1, aParF, aParL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!aC2d2.IsNull())
|
||||||
|
{
|
||||||
|
aC2d2->D0(aPar, aPt);
|
||||||
|
|
||||||
|
if(aBox2.IsOut(aPt))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(myApprox2)
|
||||||
|
aCurv2d2 = new Geom2d_TrimmedCurve(aC2d2, aParF, aParL);
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle(Geom_Curve) aCurv3d = new Geom_TrimmedCurve(aC3d, aParF, aParL);
|
||||||
|
|
||||||
|
sline.Append(aCurv3d);
|
||||||
|
slineS1.Append(aCurv2d1);
|
||||||
|
slineS2.Append(aCurv2d2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AdjustUPeriodic
|
//function : AdjustUPeriodic
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
|
||||||
void TreatRLine(const Handle(IntPatch_RLine)& theRL,
|
|
||||||
const Handle(GeomAdaptor_HSurface)& theHS1,
|
|
||||||
const Handle(GeomAdaptor_HSurface)& theHS2,
|
|
||||||
const Standard_Boolean theApprox1,
|
|
||||||
const Standard_Boolean theApprox2,
|
|
||||||
Handle(Geom_Curve)& theC3d,
|
|
||||||
Handle(Geom2d_Curve)& theC2d1,
|
|
||||||
Handle(Geom2d_Curve)& theC2d2,
|
|
||||||
Standard_Real& theTolReached)
|
|
||||||
{
|
|
||||||
Handle(GeomAdaptor_HSurface) aGAHS;
|
|
||||||
Handle(Adaptor2d_HCurve2d) anAHC2d;
|
|
||||||
Standard_Real tf, tl;
|
|
||||||
gp_Lin2d aL;
|
|
||||||
// It is assumed that 2d curve is 2d line (rectangular surface domain)
|
|
||||||
if(theRL->IsArcOnS1())
|
|
||||||
{
|
|
||||||
aGAHS = theHS1;
|
|
||||||
anAHC2d = theRL->ArcOnS1();
|
|
||||||
theRL->ParamOnS1(tf, tl);
|
|
||||||
theC2d1 = Geom2dAdaptor::MakeCurve(theRL->ArcOnS1()->Curve2d());
|
|
||||||
}
|
|
||||||
else if (theRL->IsArcOnS2())
|
|
||||||
{
|
|
||||||
aGAHS = theHS2;
|
|
||||||
anAHC2d = theRL->ArcOnS2();
|
|
||||||
theRL->ParamOnS2(tf, tl);
|
|
||||||
theC2d2 = Geom2dAdaptor::MakeCurve(theRL->ArcOnS2()->Curve2d());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
//To provide sameparameter it is necessary to get 3d curve as
|
|
||||||
//approximation of curve on surface.
|
|
||||||
Standard_Integer aMaxDeg = 8;
|
|
||||||
Standard_Integer aMaxSeg = 1000;
|
|
||||||
Approx_CurveOnSurface anApp(anAHC2d, aGAHS, tf, tl, Precision::Confusion(),
|
|
||||||
GeomAbs_C1, aMaxDeg, aMaxSeg,
|
|
||||||
Standard_True, Standard_False);
|
|
||||||
if(anApp.HasResult())
|
|
||||||
{
|
|
||||||
theC3d = anApp.Curve3d();
|
|
||||||
theTolReached = anApp.MaxError3d();
|
|
||||||
Standard_Real aTol = Precision::Confusion();
|
|
||||||
if(theRL->IsArcOnS1() && theApprox2)
|
|
||||||
{
|
|
||||||
Handle(Geom_Surface) aS = GeomAdaptor::MakeSurface(theHS1->Surface());
|
|
||||||
BuildPCurves (tf, tl, aTol,
|
|
||||||
aS, theC3d, theC2d2);
|
|
||||||
}
|
|
||||||
if(theRL->IsArcOnS2() && theApprox1)
|
|
||||||
{
|
|
||||||
Handle(Geom_Surface) aS = GeomAdaptor::MakeSurface(theHS2->Surface());
|
|
||||||
BuildPCurves (tf, tl, aTol,
|
|
||||||
aS, theC3d, theC2d1);
|
|
||||||
}
|
|
||||||
theTolReached = Max(theTolReached, aTol);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
|
|
||||||
}
|
|
||||||
//
|
|
||||||
//=======================================================================
|
|
||||||
//function : AdjustUPeriodic
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AdjustUPeriodic (const Handle(Geom_Surface)& aS, Handle(Geom2d_Curve)& aC2D)
|
void AdjustUPeriodic (const Handle(Geom_Surface)& aS, Handle(Geom2d_Curve)& aC2D)
|
||||||
{
|
{
|
||||||
@ -1168,53 +1163,6 @@ void TreatRLine(const Handle(IntPatch_RLine)& theRL,
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BuildPCurves
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void BuildPCurves (Standard_Real f, Standard_Real l,
|
|
||||||
Standard_Real& Tol,
|
|
||||||
const Handle(Geom_Surface)& S,
|
|
||||||
const Handle(Geom_Curve)& C,
|
|
||||||
Handle(Geom2d_Curve)& C2d)
|
|
||||||
{
|
|
||||||
if (C2d.IsNull())
|
|
||||||
{
|
|
||||||
C2d = GeomProjLib::Curve2d(C,f,l,S,Tol);
|
|
||||||
if (S->IsUPeriodic())
|
|
||||||
{
|
|
||||||
Standard_Real umin,umax,vmin,vmax;
|
|
||||||
S->Bounds(umin,umax,vmin,vmax);
|
|
||||||
// Recadre dans le domaine UV de la face
|
|
||||||
const Standard_Real period = S->UPeriod();
|
|
||||||
gp_Pnt2d Pf=C2d->Value(f);
|
|
||||||
//
|
|
||||||
Standard_Real U0=Pf.X();
|
|
||||||
//
|
|
||||||
const Standard_Real aEpsilon=Epsilon(10.);//1.77e-15
|
|
||||||
if (fabs(U0)<aEpsilon)
|
|
||||||
U0=0.;
|
|
||||||
if (fabs(U0-period)<aEpsilon)
|
|
||||||
U0=period;
|
|
||||||
//
|
|
||||||
const Standard_Real aEps=Precision::PConfusion();//1.e-9
|
|
||||||
Standard_Real du=0.;
|
|
||||||
while(U0 <(umin-aEps)) {
|
|
||||||
U0+=period;
|
|
||||||
du+=period;
|
|
||||||
}
|
|
||||||
while(U0>(umax+aEps)) {
|
|
||||||
U0-=period;
|
|
||||||
du-=period;
|
|
||||||
}
|
|
||||||
if (du!=0.) {
|
|
||||||
gp_Vec2d T1(du, 0.);
|
|
||||||
C2d->Translate(T1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
//=======================================================================
|
|
||||||
//function : GetQuadric
|
//function : GetQuadric
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -2106,26 +2054,312 @@ Standard_Boolean FindPoint(const gp_Pnt2d& theFirstPoint,
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
static
|
|
||||||
void DumpWLine (const Handle(IntPatch_WLine)& theWLine);
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : DumpWLine
|
//function : TreatRLine
|
||||||
|
//purpose : Approx of Restriction line
|
||||||
|
//=======================================================================
|
||||||
|
void GeomInt_IntSS::TreatRLine(const Handle(IntPatch_RLine)& theRL,
|
||||||
|
const Handle(GeomAdaptor_HSurface)& theHS1,
|
||||||
|
const Handle(GeomAdaptor_HSurface)& theHS2,
|
||||||
|
Handle(Geom_Curve)& theC3d,
|
||||||
|
Handle(Geom2d_Curve)& theC2d1,
|
||||||
|
Handle(Geom2d_Curve)& theC2d2,
|
||||||
|
Standard_Real& theTolReached)
|
||||||
|
{
|
||||||
|
Handle(GeomAdaptor_HSurface) aGAHS;
|
||||||
|
Handle(Adaptor2d_HCurve2d) anAHC2d;
|
||||||
|
Standard_Real tf, tl;
|
||||||
|
gp_Lin2d aL;
|
||||||
|
// It is assumed that 2d curve is 2d line (rectangular surface domain)
|
||||||
|
if(theRL->IsArcOnS1())
|
||||||
|
{
|
||||||
|
aGAHS = theHS1;
|
||||||
|
anAHC2d = theRL->ArcOnS1();
|
||||||
|
theRL->ParamOnS1(tf, tl);
|
||||||
|
theC2d1 = Geom2dAdaptor::MakeCurve(anAHC2d->Curve2d());
|
||||||
|
}
|
||||||
|
else if (theRL->IsArcOnS2())
|
||||||
|
{
|
||||||
|
aGAHS = theHS2;
|
||||||
|
anAHC2d = theRL->ArcOnS2();
|
||||||
|
theRL->ParamOnS2(tf, tl);
|
||||||
|
theC2d2 = Geom2dAdaptor::MakeCurve(anAHC2d->Curve2d());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//To provide sameparameter it is necessary to get 3d curve as
|
||||||
|
//approximation of curve on surface.
|
||||||
|
Standard_Integer aMaxDeg = 8;
|
||||||
|
Standard_Integer aMaxSeg = 1000;
|
||||||
|
Approx_CurveOnSurface anApp(anAHC2d, aGAHS, tf, tl, Precision::Confusion(),
|
||||||
|
GeomAbs_C1, aMaxDeg, aMaxSeg,
|
||||||
|
Standard_True, Standard_False);
|
||||||
|
if(!anApp.HasResult())
|
||||||
|
return;
|
||||||
|
|
||||||
|
theC3d = anApp.Curve3d();
|
||||||
|
theTolReached = anApp.MaxError3d();
|
||||||
|
Standard_Real aTol = Precision::Confusion();
|
||||||
|
if(theRL->IsArcOnS1())
|
||||||
|
{
|
||||||
|
Handle(Geom_Surface) aS = GeomAdaptor::MakeSurface(theHS2->Surface());
|
||||||
|
BuildPCurves (tf, tl, aTol,
|
||||||
|
aS, theC3d, theC2d2);
|
||||||
|
}
|
||||||
|
if(theRL->IsArcOnS2())
|
||||||
|
{
|
||||||
|
Handle(Geom_Surface) aS = GeomAdaptor::MakeSurface(theHS1->Surface());
|
||||||
|
BuildPCurves (tf, tl, aTol,
|
||||||
|
aS, theC3d, theC2d1);
|
||||||
|
}
|
||||||
|
theTolReached = Max(theTolReached, aTol);
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : BuildPCurves
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void DumpWLine (const Handle(IntPatch_WLine)& theWLine)
|
void GeomInt_IntSS::BuildPCurves (Standard_Real f,
|
||||||
|
Standard_Real l,
|
||||||
|
Standard_Real& Tol,
|
||||||
|
const Handle (Geom_Surface)& S,
|
||||||
|
const Handle (Geom_Curve)& C,
|
||||||
|
Handle (Geom2d_Curve)& C2d)
|
||||||
{
|
{
|
||||||
Standard_Integer i, nbp;
|
if (!C2d.IsNull()) {
|
||||||
Standard_Real u1,v1,u2,v2;
|
return;
|
||||||
|
}
|
||||||
//
|
//
|
||||||
nbp=theWLine->NbPnts();
|
Standard_Real umin,umax,vmin,vmax;
|
||||||
printf(" nbp=%d\n", nbp);
|
//
|
||||||
for(i=1;i<=nbp;i++) {
|
S->Bounds(umin, umax, vmin, vmax);
|
||||||
const IntSurf_PntOn2S& aPoint = theWLine->Point(i);
|
// in class ProjLib_Function the range of parameters is shrank by 1.e-09
|
||||||
const gp_Pnt& aP=aPoint.Value();
|
if((l - f) > 2.e-09) {
|
||||||
aPoint.Parameters(u1,v1,u2,v2);
|
C2d = GeomProjLib::Curve2d(C,f,l,S,umin,umax,vmin,vmax,Tol);
|
||||||
printf("point i%d %lf %lf %lf [ %lf %lf ] [ %lf %lf ]\n",
|
//
|
||||||
i, aP.X(), aP.Y(), aP.Z(), u1, v1, u2, v2);
|
if (C2d.IsNull()) {
|
||||||
|
// proj. a circle that goes through the pole on a sphere to the sphere
|
||||||
|
Tol += Precision::Confusion();
|
||||||
|
C2d = GeomProjLib::Curve2d(C,f,l,S,Tol);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if((l - f) > Epsilon(Abs(f))) {
|
||||||
|
GeomAPI_ProjectPointOnSurf aProjector1, aProjector2;
|
||||||
|
gp_Pnt P1 = C->Value(f);
|
||||||
|
gp_Pnt P2 = C->Value(l);
|
||||||
|
aProjector1.Init(P1, S);
|
||||||
|
aProjector2.Init(P2, S);
|
||||||
|
|
||||||
|
if(aProjector1.IsDone() && aProjector2.IsDone()) {
|
||||||
|
Standard_Real U=0., V=0.;
|
||||||
|
aProjector1.LowerDistanceParameters(U, V);
|
||||||
|
gp_Pnt2d p1(U, V);
|
||||||
|
|
||||||
|
aProjector2.LowerDistanceParameters(U, V);
|
||||||
|
gp_Pnt2d p2(U, V);
|
||||||
|
|
||||||
|
if(p1.Distance(p2) > gp::Resolution()) {
|
||||||
|
TColgp_Array1OfPnt2d poles(1,2);
|
||||||
|
TColStd_Array1OfReal knots(1,2);
|
||||||
|
TColStd_Array1OfInteger mults(1,2);
|
||||||
|
poles(1) = p1;
|
||||||
|
poles(2) = p2;
|
||||||
|
knots(1) = f;
|
||||||
|
knots(2) = l;
|
||||||
|
mults(1) = mults(2) = 2;
|
||||||
|
|
||||||
|
C2d = new Geom2d_BSplineCurve(poles,knots,mults,1);
|
||||||
|
|
||||||
|
// compute reached tolerance.begin
|
||||||
|
gp_Pnt PMid = C->Value((f + l) * 0.5);
|
||||||
|
aProjector1.Perform(PMid);
|
||||||
|
|
||||||
|
if(aProjector1.IsDone()) {
|
||||||
|
aProjector1.LowerDistanceParameters(U, V);
|
||||||
|
gp_Pnt2d pmidproj(U, V);
|
||||||
|
gp_Pnt2d pmidcurve2d = C2d->Value((f + l) * 0.5);
|
||||||
|
Standard_Real adist = pmidcurve2d.Distance(pmidproj);
|
||||||
|
Tol = (adist > Tol) ? adist : Tol;
|
||||||
|
}
|
||||||
|
// compute reached tolerance.end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (S->IsUPeriodic() && !C2d.IsNull()) {
|
||||||
|
// Recadre dans le domaine UV de la face
|
||||||
|
Standard_Real aTm, U0, aEps, period, du, U0x;
|
||||||
|
Standard_Boolean bAdjust;
|
||||||
|
//
|
||||||
|
aEps = Precision::PConfusion();
|
||||||
|
period = S->UPeriod();
|
||||||
|
//
|
||||||
|
aTm = .5*(f + l);
|
||||||
|
gp_Pnt2d pm = C2d->Value(aTm);
|
||||||
|
U0 = pm.X();
|
||||||
|
//
|
||||||
|
bAdjust =
|
||||||
|
GeomInt::AdjustPeriodic(U0, umin, umax, period, U0x, du, aEps);
|
||||||
|
if (bAdjust) {
|
||||||
|
gp_Vec2d T1(du, 0.);
|
||||||
|
C2d->Translate(T1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : TrimILineOnSurfBoundaries
|
||||||
|
//purpose : This function finds intersection points of given curves with
|
||||||
|
// surface boundaries and fills theArrayOfParameters by parameters
|
||||||
|
// along the given curves corresponding of these points.
|
||||||
|
//=======================================================================
|
||||||
|
void GeomInt_IntSS::TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d1,
|
||||||
|
const Handle(Geom2d_Curve)& theC2d2,
|
||||||
|
const Bnd_Box2d& theBound1,
|
||||||
|
const Bnd_Box2d& theBound2,
|
||||||
|
GeomInt_VectorOfReal& theArrayOfParameters)
|
||||||
|
{
|
||||||
|
//Rectangular boundaries of two surfaces: [0]:U=Ufirst, [1]:U=Ulast,
|
||||||
|
// [2]:V=Vfirst, [3]:V=Vlast
|
||||||
|
const Standard_Integer aNumberOfCurves = 4;
|
||||||
|
Handle(Geom2d_Curve) aCurS1Bounds[aNumberOfCurves];
|
||||||
|
Handle(Geom2d_Curve) aCurS2Bounds[aNumberOfCurves];
|
||||||
|
|
||||||
|
Standard_Real aU1f=0.0, aV1f=0.0, aU1l=0.0, aV1l=0.0;
|
||||||
|
Standard_Real aU2f=0.0, aV2f=0.0, aU2l=0.0, aV2l=0.0;
|
||||||
|
|
||||||
|
theBound1.Get(aU1f, aV1f, aU1l, aV1l);
|
||||||
|
theBound2.Get(aU2f, aV2f, aU2l, aV2l);
|
||||||
|
|
||||||
|
Standard_Real aDelta = aV1l-aV1f;
|
||||||
|
if(Abs(aDelta) > RealSmall())
|
||||||
|
{
|
||||||
|
if(!Precision::IsInfinite(aU1f))
|
||||||
|
{
|
||||||
|
aCurS1Bounds[0] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1f), gp_Dir2d(0.0, 1.0));
|
||||||
|
|
||||||
|
if(!Precision::IsInfinite(aDelta))
|
||||||
|
aCurS1Bounds[0] = new Geom2d_TrimmedCurve(aCurS1Bounds[0], 0, aDelta);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!Precision::IsInfinite(aU1l))
|
||||||
|
{
|
||||||
|
aCurS1Bounds[1] = new Geom2d_Line(gp_Pnt2d(aU1l, aV1f), gp_Dir2d(0.0, 1.0));
|
||||||
|
if(!Precision::IsInfinite(aDelta))
|
||||||
|
aCurS1Bounds[1] = new Geom2d_TrimmedCurve(aCurS1Bounds[1], 0, aDelta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
aDelta = aU1l-aU1f;
|
||||||
|
if(Abs(aDelta) > RealSmall())
|
||||||
|
{
|
||||||
|
if(!Precision::IsInfinite(aV1f))
|
||||||
|
{
|
||||||
|
aCurS1Bounds[2] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1f), gp_Dir2d(1.0, 0.0));
|
||||||
|
if(!Precision::IsInfinite(aDelta))
|
||||||
|
aCurS1Bounds[2] = new Geom2d_TrimmedCurve(aCurS1Bounds[2], 0, aDelta);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!Precision::IsInfinite(aV1l))
|
||||||
|
{
|
||||||
|
aCurS1Bounds[3] = new Geom2d_Line(gp_Pnt2d(aU1l, aV1l), gp_Dir2d(1.0, 0.0));
|
||||||
|
if(!Precision::IsInfinite(aDelta))
|
||||||
|
aCurS1Bounds[3] = new Geom2d_TrimmedCurve(aCurS1Bounds[3], 0, aDelta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
aDelta = aV2l-aV2f;
|
||||||
|
if(Abs(aDelta) > RealSmall())
|
||||||
|
{
|
||||||
|
if(!Precision::IsInfinite(aU2f))
|
||||||
|
{
|
||||||
|
aCurS2Bounds[0] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2f), gp_Dir2d(0.0, 1.0));
|
||||||
|
if(!Precision::IsInfinite(aDelta))
|
||||||
|
aCurS2Bounds[0] = new Geom2d_TrimmedCurve(aCurS2Bounds[0], 0, aDelta);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!Precision::IsInfinite(aU2l))
|
||||||
|
{
|
||||||
|
aCurS2Bounds[1] = new Geom2d_Line(gp_Pnt2d(aU2l, aV2f), gp_Dir2d(0.0, 1.0));
|
||||||
|
if(!Precision::IsInfinite(aDelta))
|
||||||
|
aCurS2Bounds[1] = new Geom2d_TrimmedCurve(aCurS2Bounds[1], 0, aDelta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
aDelta = aU2l-aU2f;
|
||||||
|
if(Abs(aDelta) > RealSmall())
|
||||||
|
{
|
||||||
|
if(!Precision::IsInfinite(aV2f))
|
||||||
|
{
|
||||||
|
aCurS2Bounds[2] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2f), gp_Dir2d(1.0, 0.0));
|
||||||
|
if(!Precision::IsInfinite(aDelta))
|
||||||
|
aCurS2Bounds[2] = new Geom2d_TrimmedCurve(aCurS2Bounds[2], 0, aDelta);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!Precision::IsInfinite(aV2l))
|
||||||
|
{
|
||||||
|
aCurS2Bounds[3] = new Geom2d_Line(gp_Pnt2d(aU2l, aV2l), gp_Dir2d(1.0, 0.0));
|
||||||
|
if(!Precision::IsInfinite(aDelta))
|
||||||
|
aCurS2Bounds[3] = new Geom2d_TrimmedCurve(aCurS2Bounds[3], 0, aDelta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Geom2dAPI_InterCurveCurve anIntCC2d;
|
||||||
|
|
||||||
|
if(!theC2d1.IsNull())
|
||||||
|
{
|
||||||
|
for(Standard_Integer aCurID = 0; aCurID < aNumberOfCurves; aCurID++)
|
||||||
|
{
|
||||||
|
if(aCurS1Bounds[aCurID].IsNull())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
anIntCC2d.Init(theC2d1, aCurS1Bounds[aCurID]);
|
||||||
|
|
||||||
|
for (Standard_Integer aPntID = 1; aPntID <= anIntCC2d.NbPoints(); aPntID++)
|
||||||
|
{
|
||||||
|
const Standard_Real aParam = anIntCC2d.Intersector().Point(aPntID).ParamOnFirst();
|
||||||
|
theArrayOfParameters.Append(aParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Standard_Integer aSegmID = 1; aSegmID <= anIntCC2d.NbSegments(); aSegmID++)
|
||||||
|
{
|
||||||
|
Handle(Geom2d_Curve) aCS, aCSTemp;
|
||||||
|
anIntCC2d.Segment(aSegmID, aCS, aCSTemp);
|
||||||
|
theArrayOfParameters.Append(aCS->FirstParameter());
|
||||||
|
theArrayOfParameters.Append(aCS->LastParameter());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!theC2d2.IsNull())
|
||||||
|
{
|
||||||
|
for(Standard_Integer aCurID = 0; aCurID < aNumberOfCurves; aCurID++)
|
||||||
|
{
|
||||||
|
if(aCurS2Bounds[aCurID].IsNull())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
anIntCC2d.Init(theC2d2, aCurS2Bounds[aCurID]);
|
||||||
|
|
||||||
|
for (Standard_Integer aPntID = 1; aPntID <= anIntCC2d.NbPoints(); aPntID++)
|
||||||
|
{
|
||||||
|
const Standard_Real aParam = anIntCC2d.Intersector().Point(aPntID).ParamOnFirst();
|
||||||
|
theArrayOfParameters.Append(aParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Standard_Integer aSegmID = 1; aSegmID <= anIntCC2d.NbSegments(); aSegmID++)
|
||||||
|
{
|
||||||
|
Handle(Geom2d_Curve) aCS, aCSTemp;
|
||||||
|
anIntCC2d.Segment(aSegmID, aCS, aCSTemp);
|
||||||
|
theArrayOfParameters.Append(aCS->FirstParameter());
|
||||||
|
theArrayOfParameters.Append(aCS->LastParameter());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::sort(theArrayOfParameters.begin(), theArrayOfParameters.end());
|
||||||
|
}
|
||||||
|
23
src/GeomInt/GeomInt_VectorOfReal.hxx
Normal file
23
src/GeomInt/GeomInt_VectorOfReal.hxx
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// Created on: 2015-02-18
|
||||||
|
// Created by: Nikolai BUKHALOV
|
||||||
|
// Copyright (c) 2003-2015 OPEN CASCADE SAS
|
||||||
|
//
|
||||||
|
// This file is part of Open CASCADE Technology software library.
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or modify it under
|
||||||
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||||
|
// by the Free Software Foundation, with special exception defined in the file
|
||||||
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||||
|
// distribution for complete text of the license and disclaimer of any warranty.
|
||||||
|
//
|
||||||
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
|
#ifndef GeomInt_VectorOfReal_HeaderFile
|
||||||
|
#define GeomInt_VectorOfReal_HeaderFile
|
||||||
|
|
||||||
|
#include <NCollection_Vector.hxx>
|
||||||
|
|
||||||
|
typedef NCollection_Vector<Standard_Real> GeomInt_VectorOfReal;
|
||||||
|
|
||||||
|
#endif
|
@ -38,14 +38,11 @@ is
|
|||||||
class Point;
|
class Point;
|
||||||
|
|
||||||
deferred class Line;
|
deferred class Line;
|
||||||
|
class ALine; -- inherits Line from IntPatch
|
||||||
class GLine; -- inherits Line from IntPatch
|
class GLine; -- inherits Line from IntPatch
|
||||||
|
deferred class PointLine; -- inherits Line from IntPatch
|
||||||
class ALine; -- inherits Line from IntPatch
|
class RLine; -- inherits PointLine from IntPatch
|
||||||
|
class WLine; -- inherits PointLine from IntPatch
|
||||||
class WLine; -- inherits Line from IntPatch
|
|
||||||
|
|
||||||
class RLine; -- inherits Line from IntPatch
|
|
||||||
|
|
||||||
class ArcFunction;
|
class ArcFunction;
|
||||||
|
|
||||||
|
@ -44,7 +44,15 @@ is
|
|||||||
|
|
||||||
Create (S1: HSurface from Adaptor3d; D1: TopolTool from Adaptor3d;
|
Create (S1: HSurface from Adaptor3d; D1: TopolTool from Adaptor3d;
|
||||||
S2: HSurface from Adaptor3d; D2: TopolTool from Adaptor3d;
|
S2: HSurface from Adaptor3d; D2: TopolTool from Adaptor3d;
|
||||||
TolArc,TolTang: Real from Standard)
|
TolArc,TolTang: Real from Standard;
|
||||||
|
theIsReqToKeepRLine: Boolean from Standard = Standard_False)
|
||||||
|
|
||||||
|
---Purpose: Flag theIsReqToKeepRLine has been enterred only for
|
||||||
|
-- compatibility with TopOpeBRep package. It shall be deleted
|
||||||
|
-- after deleting TopOpeBRep.
|
||||||
|
-- When intersection result returns IntPatch_RLine and another
|
||||||
|
-- IntPatch_Line (not restriction) we (in case of theIsReqToKeepRLine==TRUE)
|
||||||
|
-- will always keep both lines even if they are coincided.
|
||||||
|
|
||||||
returns ImpImpIntersection from IntPatch
|
returns ImpImpIntersection from IntPatch
|
||||||
|
|
||||||
@ -55,10 +63,18 @@ is
|
|||||||
S1: HSurface from Adaptor3d; D1: TopolTool from Adaptor3d;
|
S1: HSurface from Adaptor3d; D1: TopolTool from Adaptor3d;
|
||||||
S2: HSurface from Adaptor3d; D2: TopolTool from Adaptor3d;
|
S2: HSurface from Adaptor3d; D2: TopolTool from Adaptor3d;
|
||||||
TolArc,TolTang: Real from Standard;
|
TolArc,TolTang: Real from Standard;
|
||||||
isTheTrimmed: Boolean from Standard = Standard_False)
|
isTheTrimmed: Boolean from Standard = Standard_False;
|
||||||
|
theIsReqToKeepRLine: Boolean from Standard = Standard_False)
|
||||||
|
|
||||||
raises ConstructionError from Standard
|
raises ConstructionError from Standard
|
||||||
|
|
||||||
|
---Purpose: Flag theIsReqToKeepRLine has been enterred only for
|
||||||
|
-- compatibility with TopOpeBRep package. It shall be deleted
|
||||||
|
-- after deleting TopOpeBRep.
|
||||||
|
-- When intersection result returns IntPatch_RLine and another
|
||||||
|
-- IntPatch_Line (not restriction) we (in case of theIsReqToKeepRLine==TRUE)
|
||||||
|
-- will always keep both lines even if they are coincided.
|
||||||
|
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,6 +22,12 @@
|
|||||||
#include <IntSurf.hxx>
|
#include <IntSurf.hxx>
|
||||||
#include <TColStd_Array1OfInteger.hxx>
|
#include <TColStd_Array1OfInteger.hxx>
|
||||||
#include <TColStd_SequenceOfReal.hxx>
|
#include <TColStd_SequenceOfReal.hxx>
|
||||||
|
#include <IntPatch_GLine.hxx>
|
||||||
|
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||||
|
#include <Geom_Ellipse.hxx>
|
||||||
|
#include <Geom_Parabola.hxx>
|
||||||
|
#include <Geom_Hyperbola.hxx>
|
||||||
|
|
||||||
|
|
||||||
static void PutPointsOnLine(const Handle(Adaptor3d_HSurface)& S1,
|
static void PutPointsOnLine(const Handle(Adaptor3d_HSurface)& S1,
|
||||||
const Handle(Adaptor3d_HSurface)& S2,
|
const Handle(Adaptor3d_HSurface)& S2,
|
||||||
@ -82,7 +88,8 @@ static void ProcessSegments (const IntPatch_SequenceOfSegmentOfTheSOnBounds&,
|
|||||||
static void ProcessRLine (IntPatch_SequenceOfLine&,
|
static void ProcessRLine (IntPatch_SequenceOfLine&,
|
||||||
const IntSurf_Quadric&,
|
const IntSurf_Quadric&,
|
||||||
const IntSurf_Quadric&,
|
const IntSurf_Quadric&,
|
||||||
const Standard_Real);
|
const Standard_Real,
|
||||||
|
const Standard_Boolean theIsReqToKeepRLine);
|
||||||
|
|
||||||
//-- le calcul de dist est completement faux ds la routine ci dessous a revoir (lbr le 18 nov 97)
|
//-- le calcul de dist est completement faux ds la routine ci dessous a revoir (lbr le 18 nov 97)
|
||||||
Standard_Boolean IntersectionWithAnArc(gp_Pnt& PSurf,
|
Standard_Boolean IntersectionWithAnArc(gp_Pnt& PSurf,
|
||||||
@ -1654,13 +1661,136 @@ void ProcessSegments (const IntPatch_SequenceOfSegmentOfTheSOnBounds& listedg,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const gp_Pnt& PointValue(const Handle(IntPatch_RLine) theRLine,
|
||||||
|
const Standard_Integer theIndex)
|
||||||
|
{
|
||||||
|
return theRLine->Point(theIndex).Value();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const gp_Pnt& VertexValue( const Handle(IntPatch_RLine) theRLine,
|
||||||
|
const Standard_Integer theIndex)
|
||||||
|
{
|
||||||
|
return theRLine->Vertex(theIndex).Value();
|
||||||
|
}
|
||||||
|
|
||||||
|
static Standard_Real SquareDistance(const Handle(IntPatch_GLine) theGLine,
|
||||||
|
const gp_Pnt& theP,
|
||||||
|
GeomAPI_ProjectPointOnCurve& thePrj)
|
||||||
|
{
|
||||||
|
Standard_Real aSQDist = RealLast();
|
||||||
|
switch(theGLine->ArcType())
|
||||||
|
{
|
||||||
|
case IntPatch_Lin:
|
||||||
|
aSQDist = theGLine->Line().SquareDistance(theP);
|
||||||
|
break;
|
||||||
|
case IntPatch_Circle:
|
||||||
|
aSQDist = theGLine->Circle().SquareDistance(theP);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
thePrj.Perform(theP);
|
||||||
|
if(thePrj.NbPoints() == 0)
|
||||||
|
{
|
||||||
|
//Lines are not overlapped
|
||||||
|
return aSQDist;
|
||||||
|
}
|
||||||
|
|
||||||
|
aSQDist = theP.SquareDistance(thePrj.NearestPoint());
|
||||||
|
}
|
||||||
|
|
||||||
|
return aSQDist;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Standard_Boolean IsRLineGood(const IntSurf_Quadric& Quad1,
|
||||||
|
const IntSurf_Quadric& Quad2,
|
||||||
|
const Handle(IntPatch_GLine) theGLine,
|
||||||
|
const Handle(IntPatch_RLine) theRLine,
|
||||||
|
const Standard_Real theTol)
|
||||||
|
{
|
||||||
|
const Standard_Real aSQTol = theTol*theTol;
|
||||||
|
const IntPatch_IType aGType = theGLine->ArcType();
|
||||||
|
Standard_Integer aNbPntsM1 = 0;
|
||||||
|
|
||||||
|
const gp_Pnt& (*Value) (const Handle(IntPatch_RLine), const Standard_Integer);
|
||||||
|
|
||||||
|
if(theRLine->HasPolygon())
|
||||||
|
{
|
||||||
|
aNbPntsM1 = theRLine->NbPnts()-1;
|
||||||
|
Value = PointValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aNbPntsM1 = theRLine->NbVertex()-1;
|
||||||
|
Value = VertexValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(aNbPntsM1 < 1)
|
||||||
|
return Standard_False;
|
||||||
|
|
||||||
|
GeomAPI_ProjectPointOnCurve aPrj;
|
||||||
|
|
||||||
|
Handle(Geom_Curve) aCurv;
|
||||||
|
if(aGType == IntPatch_Ellipse)
|
||||||
|
aCurv = new Geom_Ellipse(theGLine->Ellipse());
|
||||||
|
else if(aGType == IntPatch_Parabola)
|
||||||
|
aCurv = new Geom_Parabola(theGLine->Parabola());
|
||||||
|
else if(aGType == IntPatch_Hyperbola)
|
||||||
|
aCurv = new Geom_Hyperbola(theGLine->Hyperbola());
|
||||||
|
|
||||||
|
if(!aCurv.IsNull())
|
||||||
|
aPrj.Init(aCurv, aCurv->FirstParameter(), aCurv->LastParameter());
|
||||||
|
|
||||||
|
if(aNbPntsM1 == 1)
|
||||||
|
{
|
||||||
|
gp_Pnt aP1(Value(theRLine, 1)), aP2(Value(theRLine, 2));
|
||||||
|
|
||||||
|
if(aP1.SquareDistance(aP2) < aSQTol)
|
||||||
|
{
|
||||||
|
//RLine is degenerated
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
|
||||||
|
gp_Pnt aPMid;
|
||||||
|
if(theRLine->IsArcOnS1())
|
||||||
|
{
|
||||||
|
const Handle(Adaptor2d_HCurve2d)& anAC2d = theRLine->ArcOnS1();
|
||||||
|
const Standard_Real aParF = anAC2d->FirstParameter(),
|
||||||
|
aParL = anAC2d->LastParameter();
|
||||||
|
gp_Pnt2d aP2d(anAC2d->Value(0.5*(aParF+aParL)));
|
||||||
|
aPMid = Quad1.Value(aP2d.X(), aP2d.Y());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const Handle(Adaptor2d_HCurve2d)& anAC2d = theRLine->ArcOnS2();
|
||||||
|
const Standard_Real aParF = anAC2d->FirstParameter(),
|
||||||
|
aParL = anAC2d->LastParameter();
|
||||||
|
gp_Pnt2d aP2d(anAC2d->Value(0.5*(aParF+aParL)));
|
||||||
|
aPMid = Quad2.Value(aP2d.X(), aP2d.Y());
|
||||||
|
}
|
||||||
|
|
||||||
|
const Standard_Real aSQDist = SquareDistance(theGLine, aPMid, aPrj);
|
||||||
|
return (aSQDist > aSQTol);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(Standard_Integer i = 2; i <= aNbPntsM1; i++)
|
||||||
|
{
|
||||||
|
const gp_Pnt aP(Value(theRLine, i));
|
||||||
|
const Standard_Real aSQDist = SquareDistance(theGLine, aP, aPrj);
|
||||||
|
|
||||||
|
if(aSQDist > aSQTol)
|
||||||
|
return Standard_True;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ProcessRLine (IntPatch_SequenceOfLine& slin,
|
void ProcessRLine (IntPatch_SequenceOfLine& slin,
|
||||||
// const Handle(Adaptor3d_HSurface)& Surf1,
|
// const Handle(Adaptor3d_HSurface)& Surf1,
|
||||||
// const Handle(Adaptor3d_HSurface)& Surf2,
|
// const Handle(Adaptor3d_HSurface)& Surf2,
|
||||||
const IntSurf_Quadric& Quad1,
|
const IntSurf_Quadric& Quad1,
|
||||||
const IntSurf_Quadric& Quad2,
|
const IntSurf_Quadric& Quad2,
|
||||||
const Standard_Real _TolArc) {
|
const Standard_Real _TolArc,
|
||||||
|
const Standard_Boolean theIsReqToKeepRLine) {
|
||||||
|
|
||||||
// On cherche a placer sur les restrictions solutions les points "multiples"
|
// On cherche a placer sur les restrictions solutions les points "multiples"
|
||||||
// des autres lignes d intersection
|
// des autres lignes d intersection
|
||||||
@ -1701,15 +1831,17 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
|
|||||||
for (i=1; i<=Nblin; i++) {
|
for (i=1; i<=Nblin; i++) {
|
||||||
const Handle(IntPatch_Line)& slini = slin(i);
|
const Handle(IntPatch_Line)& slini = slin(i);
|
||||||
typ1 = slini->ArcType();
|
typ1 = slini->ArcType();
|
||||||
|
|
||||||
|
Standard_Boolean HasToDeleteRLine = Standard_False;
|
||||||
if (typ1 == IntPatch_Restriction) {
|
if (typ1 == IntPatch_Restriction) {
|
||||||
seq_Pnt3d.Clear();
|
seq_Pnt3d.Clear();
|
||||||
seq_Real.Clear();
|
seq_Real.Clear();
|
||||||
|
|
||||||
for (j=1; j<=Nblin; j++) {
|
for (j=1; j<=Nblin; j++) {
|
||||||
const Handle(IntPatch_Line)& slinj = slin(j);
|
const Handle(IntPatch_Line)& slinj = slin(j);
|
||||||
Nbpt = seq_Pnt3d.Length(); // important que ce soit ici
|
Nbpt = seq_Pnt3d.Length(); // important que ce soit ici
|
||||||
typ2 = slinj->ArcType();
|
typ2 = slinj->ArcType();
|
||||||
if (typ2 != IntPatch_Restriction) {
|
if (typ2 != IntPatch_Restriction) {
|
||||||
|
|
||||||
//-- arcref = (*((Handle(IntPatch_RLine)*)&slini))->Arc();
|
//-- arcref = (*((Handle(IntPatch_RLine)*)&slini))->Arc();
|
||||||
//-- OnFirst = (*((Handle(IntPatch_RLine)*)&slini))->IsOnFirstSurface();
|
//-- OnFirst = (*((Handle(IntPatch_RLine)*)&slini))->IsOnFirstSurface();
|
||||||
|
|
||||||
@ -1896,8 +2028,32 @@ void ProcessRLine (IntPatch_SequenceOfLine& slin,
|
|||||||
} //-- if (keeppoint)
|
} //-- if (keeppoint)
|
||||||
} //-- if ((OnFirst && !Ptvtx.IsOnDomS1())||(!OnFirst && !Ptvtx.IsOnDomS2()))
|
} //-- if ((OnFirst && !Ptvtx.IsOnDomS1())||(!OnFirst && !Ptvtx.IsOnDomS2()))
|
||||||
} //-- boucle sur les vertex
|
} //-- boucle sur les vertex
|
||||||
|
|
||||||
|
if(!theIsReqToKeepRLine)
|
||||||
|
{
|
||||||
|
Handle(IntPatch_GLine) aGL = Handle(IntPatch_GLine)::DownCast(slinj);
|
||||||
|
|
||||||
|
if(!aGL.IsNull())
|
||||||
|
{
|
||||||
|
HasToDeleteRLine = !IsRLineGood(Quad1, Quad2, aGL,
|
||||||
|
Handle(IntPatch_RLine)::DownCast(slini), TolArc);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(HasToDeleteRLine)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
} //-- if (typ2 != IntPatch_Restriction)
|
} //-- if (typ2 != IntPatch_Restriction)
|
||||||
} //-- for (j=1; j<=Nblin; j++)
|
} //-- for (j=1; j<=Nblin; j++)
|
||||||
} //-- if (typ1 == IntPatch_Restriction)
|
} //-- if (typ1 == IntPatch_Restriction)
|
||||||
|
|
||||||
|
if(HasToDeleteRLine)
|
||||||
|
{
|
||||||
|
slin.Remove(i);
|
||||||
|
i--;
|
||||||
|
Nblin = slin.Length();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} //-- for (i=1; i<=Nblin; i++)
|
} //-- for (i=1; i<=Nblin; i++)
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ static
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
IntPatch_ImpImpIntersection::IntPatch_ImpImpIntersection ():
|
IntPatch_ImpImpIntersection::IntPatch_ImpImpIntersection ():
|
||||||
done(Standard_False)
|
done(Standard_False)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -37,9 +37,10 @@ IntPatch_ImpImpIntersection::IntPatch_ImpImpIntersection
|
|||||||
const Handle(Adaptor3d_HSurface)& S2,
|
const Handle(Adaptor3d_HSurface)& S2,
|
||||||
const Handle(Adaptor3d_TopolTool)& D2,
|
const Handle(Adaptor3d_TopolTool)& D2,
|
||||||
const Standard_Real TolArc,
|
const Standard_Real TolArc,
|
||||||
const Standard_Real TolTang)
|
const Standard_Real TolTang,
|
||||||
|
const Standard_Boolean theIsReqToKeepRLine)
|
||||||
{
|
{
|
||||||
Perform(S1,D1,S2,D2,TolArc,TolTang);
|
Perform(S1,D1,S2,D2,TolArc,TolTang, Standard_False, theIsReqToKeepRLine);
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Perform
|
//function : Perform
|
||||||
@ -51,7 +52,8 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
|||||||
const Handle(Adaptor3d_TopolTool)& D2,
|
const Handle(Adaptor3d_TopolTool)& D2,
|
||||||
const Standard_Real TolArc,
|
const Standard_Real TolArc,
|
||||||
const Standard_Real TolTang,
|
const Standard_Real TolTang,
|
||||||
const Standard_Boolean isTheTrimmed) {
|
const Standard_Boolean isTheTrimmed,
|
||||||
|
const Standard_Boolean theIsReqToKeepRLine) {
|
||||||
done = Standard_False;
|
done = Standard_False;
|
||||||
Standard_Boolean isTrimmed = isTheTrimmed;
|
Standard_Boolean isTrimmed = isTheTrimmed;
|
||||||
spnt.Clear();
|
spnt.Clear();
|
||||||
@ -418,7 +420,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
|||||||
|
|
||||||
if (edg1.Length() !=0 || edg2.Length() !=0) {
|
if (edg1.Length() !=0 || edg2.Length() !=0) {
|
||||||
// ProcessRLine(slin,S1,S2,TolArc);
|
// ProcessRLine(slin,S1,S2,TolArc);
|
||||||
ProcessRLine(slin,quad1,quad2,TolArc);
|
ProcessRLine(slin,quad1,quad2,TolArc, theIsReqToKeepRLine);
|
||||||
}
|
}
|
||||||
}//if (!nosolonS1 || !nosolonS2) {
|
}//if (!nosolonS1 || !nosolonS2) {
|
||||||
else {
|
else {
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
#define No_Standard_OutOfRange
|
#define No_Standard_OutOfRange
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <math_Vector.hxx>
|
#include <math_Vector.hxx>
|
||||||
#include <math_Matrix.hxx>
|
#include <math_Matrix.hxx>
|
||||||
#include <TopTrans_CurveTransition.hxx>
|
#include <TopTrans_CurveTransition.hxx>
|
||||||
@ -53,6 +52,11 @@
|
|||||||
#include <IntSurf_SequenceOfInteriorPoint.hxx>
|
#include <IntSurf_SequenceOfInteriorPoint.hxx>
|
||||||
#include <IntSurf_QuadricTool.hxx>
|
#include <IntSurf_QuadricTool.hxx>
|
||||||
#include <GeomAbs_SurfaceType.hxx>
|
#include <GeomAbs_SurfaceType.hxx>
|
||||||
|
#include <IntAna2d_AnaIntersection.hxx>
|
||||||
|
#include <gp_Lin2d.hxx>
|
||||||
|
#include <ElCLib.hxx>
|
||||||
|
|
||||||
|
#include <Bnd_Box2d.hxx>
|
||||||
|
|
||||||
static Standard_Boolean DecomposeResult(const Handle(IntPatch_Line)& Line,
|
static Standard_Boolean DecomposeResult(const Handle(IntPatch_Line)& Line,
|
||||||
const Standard_Boolean IsReversed,
|
const Standard_Boolean IsReversed,
|
||||||
@ -80,6 +84,12 @@ static
|
|||||||
Standard_Real U2,
|
Standard_Real U2,
|
||||||
Standard_Real V2);
|
Standard_Real V2);
|
||||||
|
|
||||||
|
static Standard_Boolean IsIn2DBox(const Bnd_Box2d& theBox,
|
||||||
|
const Handle(IntPatch_PointLine)& theLine,
|
||||||
|
const Standard_Real theUPeriod,
|
||||||
|
const Standard_Real theVPeriod,
|
||||||
|
const Standard_Boolean isTheSurface1Using);
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IntPatch_ImpPrmIntersection
|
//function : IntPatch_ImpPrmIntersection
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -402,7 +412,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
const Standard_Real Pas)
|
const Standard_Real Pas)
|
||||||
{
|
{
|
||||||
Standard_Boolean reversed, procf, procl, dofirst, dolast;
|
Standard_Boolean reversed, procf, procl, dofirst, dolast;
|
||||||
Standard_Integer indfirst = 0, indlast = 0, ind2, i,j,k, NbSegm;
|
Standard_Integer indfirst = 0, indlast = 0, ind2, NbSegm;
|
||||||
Standard_Integer NbPointIns, NbPointRst, Nblines, Nbpts, NbPointDep;
|
Standard_Integer NbPointIns, NbPointRst, Nblines, Nbpts, NbPointDep;
|
||||||
Standard_Real U1,V1,U2,V2,paramf,paraml,currentparam;
|
Standard_Real U1,V1,U2,V2,paramf,paraml,currentparam;
|
||||||
|
|
||||||
@ -557,7 +567,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
UVap(2)=s2d.Y();
|
UVap(2)=s2d.Y();
|
||||||
Func.Value(UVap,Valf);
|
Func.Value(UVap,Valf);
|
||||||
Standard_Real rvalf = Sign(1.,Valf(1));
|
Standard_Real rvalf = Sign(1.,Valf(1));
|
||||||
for(i = 2; i <= aNbSamples; ++i)
|
for(Standard_Integer i = 2; i <= aNbSamples; ++i)
|
||||||
{
|
{
|
||||||
D1->SamplePoint(i,s2d, s3d);
|
D1->SamplePoint(i,s2d, s3d);
|
||||||
UVap(1)=s2d.X();
|
UVap(1)=s2d.X();
|
||||||
@ -586,7 +596,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
solins.Perform(Func,Surf1,D1,TolTang);
|
solins.Perform(Func,Surf1,D1,TolTang);
|
||||||
}
|
}
|
||||||
NbPointIns = solins.NbPoints();
|
NbPointIns = solins.NbPoints();
|
||||||
for (i=1; i <= NbPointIns; i++) {
|
for (Standard_Integer i=1; i <= NbPointIns; i++) {
|
||||||
seqpins.Append(solins.Value(i));
|
seqpins.Append(solins.Value(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -616,13 +626,13 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
Nblines = iwalk.NbLines();
|
Nblines = iwalk.NbLines();
|
||||||
for (j=1; j<=Nblines; j++) {
|
for (Standard_Integer j=1; j<=Nblines; j++) {
|
||||||
const Handle(IntPatch_TheIWLineOfTheIWalking)& iwline = iwalk.Value(j);
|
const Handle(IntPatch_TheIWLineOfTheIWalking)& iwline = iwalk.Value(j);
|
||||||
const Handle(IntSurf_LineOn2S)& thelin = iwline->Line();
|
const Handle(IntSurf_LineOn2S)& thelin = iwline->Line();
|
||||||
|
|
||||||
Nbpts = thelin->NbPoints();
|
Nbpts = thelin->NbPoints();
|
||||||
if(Nbpts>=2) {
|
if(Nbpts>=2) {
|
||||||
|
Standard_Integer k = 0;
|
||||||
tgline = iwline->TangentVector(k);
|
tgline = iwline->TangentVector(k);
|
||||||
if(k>=1 && k<=Nbpts) { } else { k=Nbpts>>1; }
|
if(k>=1 && k<=Nbpts) { } else { k=Nbpts>>1; }
|
||||||
valpt = thelin->Value(k).Value();
|
valpt = thelin->Value(k).Value();
|
||||||
@ -772,7 +782,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
PPoint = seqpdep(indfirst);
|
PPoint = seqpdep(indfirst);
|
||||||
tgline = PPoint.Direction3d();
|
tgline = PPoint.Direction3d();
|
||||||
Standard_Integer themult = PPoint.Multiplicity();
|
Standard_Integer themult = PPoint.Multiplicity();
|
||||||
for (i=NbPointRst; i>=1; i--) {
|
for (Standard_Integer i=NbPointRst; i>=1; i--) {
|
||||||
if (Destination(i) == indfirst) {
|
if (Destination(i) == indfirst) {
|
||||||
if (!reversed) { //-- typeS1 = Pln || Cyl || Sph || Cone
|
if (!reversed) { //-- typeS1 = Pln || Cyl || Sph || Cone
|
||||||
Quad.Parameters(PPoint.Value(),U1,V1);
|
Quad.Parameters(PPoint.Value(),U1,V1);
|
||||||
@ -860,7 +870,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
PPoint = seqpdep(indlast);
|
PPoint = seqpdep(indlast);
|
||||||
tgline = PPoint.Direction3d().Reversed();
|
tgline = PPoint.Direction3d().Reversed();
|
||||||
Standard_Integer themult = PPoint.Multiplicity();
|
Standard_Integer themult = PPoint.Multiplicity();
|
||||||
for (i=NbPointRst; i >=1; i--) {
|
for (Standard_Integer i=NbPointRst; i >=1; i--) {
|
||||||
if (Destination(i) == indlast) {
|
if (Destination(i) == indlast) {
|
||||||
if (!reversed) {
|
if (!reversed) {
|
||||||
Quad.Parameters(PPoint.Value(),U1,V1);
|
Quad.Parameters(PPoint.Value(),U1,V1);
|
||||||
@ -952,7 +962,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
|
|
||||||
|
|
||||||
Nblines = slin.Length();
|
Nblines = slin.Length();
|
||||||
for (j=1; j<=Nblines-1; j++) {
|
for (Standard_Integer j=1; j<=Nblines-1; j++) {
|
||||||
dofirst = dolast = Standard_False;
|
dofirst = dolast = Standard_False;
|
||||||
const Handle(IntPatch_Line)& slinj = slin(j);
|
const Handle(IntPatch_Line)& slinj = slin(j);
|
||||||
const Handle(IntPatch_WLine)& wlin1 = *((Handle(IntPatch_WLine)*)&slinj);
|
const Handle(IntPatch_WLine)& wlin1 = *((Handle(IntPatch_WLine)*)&slinj);
|
||||||
@ -970,7 +980,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dofirst || dolast) {
|
if (dofirst || dolast) {
|
||||||
for (k=j+1; k<=Nblines;k++) {
|
for (Standard_Integer k=j+1; k<=Nblines;k++) {
|
||||||
const Handle(IntPatch_Line)& slink = slin(k);
|
const Handle(IntPatch_Line)& slink = slin(k);
|
||||||
const Handle(IntPatch_WLine)& wlin2 = *((Handle(IntPatch_WLine)*)&slink);
|
const Handle(IntPatch_WLine)& wlin2 = *((Handle(IntPatch_WLine)*)&slink);
|
||||||
if (wlin2->HasFirstPoint()) {
|
if (wlin2->HasFirstPoint()) {
|
||||||
@ -1031,7 +1041,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
// Treatment the segments
|
// Treatment the segments
|
||||||
NbSegm = solrst.NbSegments();
|
NbSegm = solrst.NbSegments();
|
||||||
if (NbSegm) {
|
if (NbSegm) {
|
||||||
for(i=1; i<=NbSegm; i++) {
|
for(Standard_Integer i=1; i<=NbSegm; i++) {
|
||||||
thesegm = solrst.Segment(i);
|
thesegm = solrst.Segment(i);
|
||||||
//Check if segment is degenerated
|
//Check if segment is degenerated
|
||||||
if(thesegm.HasFirstPoint() && thesegm.HasLastPoint())
|
if(thesegm.HasFirstPoint() && thesegm.HasLastPoint())
|
||||||
@ -1240,7 +1250,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
Standard_Integer nbsample = 100;
|
Standard_Integer nbsample = 100;
|
||||||
|
|
||||||
if (!reversed) {
|
if (!reversed) {
|
||||||
for (j=1; j<=nbsample; j++) {
|
for (Standard_Integer j=1; j<=nbsample; j++) {
|
||||||
prm = paramf + (j-1)*(paraml-paramf)/(nbsample-1);
|
prm = paramf + (j-1)*(paraml-paramf)/(nbsample-1);
|
||||||
arcsegm->D0(prm,p2d);
|
arcsegm->D0(prm,p2d);
|
||||||
Surf2->D0(p2d.X(),p2d.Y(),ptpoly);
|
Surf2->D0(p2d.X(),p2d.Y(),ptpoly);
|
||||||
@ -1251,7 +1261,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (j=1; j<=nbsample; j++) {
|
for (Standard_Integer j=1; j<=nbsample; j++) {
|
||||||
prm = paramf + (j-1)*(paraml-paramf)/(nbsample-1);
|
prm = paramf + (j-1)*(paraml-paramf)/(nbsample-1);
|
||||||
arcsegm->D0(prm,p2d);
|
arcsegm->D0(prm,p2d);
|
||||||
Surf1->D0(p2d.X(),p2d.Y(),ptpoly);
|
Surf1->D0(p2d.X(),p2d.Y(),ptpoly);
|
||||||
@ -1266,7 +1276,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
|
|
||||||
if (dofirst || dolast) {
|
if (dofirst || dolast) {
|
||||||
Nblines = slin.Length();
|
Nblines = slin.Length();
|
||||||
for (j=1; j<=Nblines; j++) {
|
for (Standard_Integer j=1; j<=Nblines; j++) {
|
||||||
const Handle(IntPatch_Line)& slinj = slin(j);
|
const Handle(IntPatch_Line)& slinj = slin(j);
|
||||||
typ = slinj->ArcType();
|
typ = slinj->ArcType();
|
||||||
if (typ == IntPatch_Walking) {
|
if (typ == IntPatch_Walking) {
|
||||||
@ -1275,7 +1285,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
else {
|
else {
|
||||||
Nbpts = (*((Handle(IntPatch_RLine)*)&slinj))->NbVertex();
|
Nbpts = (*((Handle(IntPatch_RLine)*)&slinj))->NbVertex();
|
||||||
}
|
}
|
||||||
for (k=1; k<=Nbpts;k++) {
|
for (Standard_Integer k=1; k<=Nbpts;k++) {
|
||||||
if (typ == IntPatch_Walking) {
|
if (typ == IntPatch_Walking) {
|
||||||
ptdeb = (*((Handle(IntPatch_WLine)*)&slinj))->Vertex(k);
|
ptdeb = (*((Handle(IntPatch_WLine)*)&slinj))->Vertex(k);
|
||||||
}
|
}
|
||||||
@ -1333,19 +1343,101 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
}// if (NbSegm)
|
}// if (NbSegm)
|
||||||
//
|
//
|
||||||
// on traite les restrictions de la surface implicite
|
// on traite les restrictions de la surface implicite
|
||||||
for (i=1; i<=slin.Length(); i++)
|
for (Standard_Integer i=1; i<=slin.Length(); i++)
|
||||||
{
|
{
|
||||||
|
Handle(IntPatch_Line)& aL = slin(i);
|
||||||
|
|
||||||
if (!reversed)
|
if (!reversed)
|
||||||
IntPatch_RstInt::PutVertexOnLine(slin(i),Surf1,D1,Surf2,Standard_True,TolTang);
|
IntPatch_RstInt::PutVertexOnLine(aL,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||||
else
|
else
|
||||||
IntPatch_RstInt::PutVertexOnLine(slin(i),Surf2,D2,Surf1,Standard_False,TolTang);
|
IntPatch_RstInt::PutVertexOnLine(aL,Surf2,D2,Surf1,Standard_False,TolTang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Standard_Real aUPeriodOfSurf1 = Surf1->IsUPeriodic() ? Surf1->UPeriod() : 0.0,
|
||||||
|
aUPeriodOfSurf2 = Surf2->IsUPeriodic() ? Surf2->UPeriod() : 0.0,
|
||||||
|
aVPeriodOfSurf1 = Surf1->IsVPeriodic() ? Surf1->VPeriod() : 0.0,
|
||||||
|
aVPeriodOfSurf2 = Surf2->IsVPeriodic() ? Surf2->VPeriod() : 0.0;
|
||||||
|
|
||||||
|
for (Standard_Integer i = 1; i <= slin.Length(); i++)
|
||||||
|
{
|
||||||
|
//BndBox of the points in Restriction line
|
||||||
|
Bnd_Box2d aBRL;
|
||||||
|
for(Standard_Integer j = i + 1; j <= slin.Length(); j++)
|
||||||
|
{
|
||||||
|
Handle(IntPatch_PointLine) aL1 = Handle(IntPatch_PointLine)::DownCast(slin(i));
|
||||||
|
Handle(IntPatch_PointLine) aL2 = Handle(IntPatch_PointLine)::DownCast(slin(j));
|
||||||
|
|
||||||
|
Handle(IntPatch_RLine) aRL1 = Handle(IntPatch_RLine)::DownCast(aL1);
|
||||||
|
Handle(IntPatch_RLine) aRL2 = Handle(IntPatch_RLine)::DownCast(aL2);
|
||||||
|
|
||||||
|
if(aRL1.IsNull() && aRL2.IsNull())
|
||||||
|
{//If Walking-Walking
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if(aRL1.IsNull())
|
||||||
|
{// i-th line is not restriction,
|
||||||
|
// but j-th is restriction
|
||||||
|
slin.Append(aL1);
|
||||||
|
slin.SetValue(i, aL2);
|
||||||
|
slin.Remove(j);
|
||||||
|
j--;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Here aL1 (i-th line) is Restriction-line and aL2 (j-th line) is not Restriction
|
||||||
|
|
||||||
|
if(aBRL.IsVoid())
|
||||||
|
{//Fill aBRL
|
||||||
|
for(Standard_Integer aPRID = 1; aPRID <= aRL1->NbPnts(); aPRID++)
|
||||||
|
{
|
||||||
|
Standard_Real u = 0.0, v = 0.0;
|
||||||
|
if(reversed)
|
||||||
|
aRL1->Point(aPRID).ParametersOnS1(u, v);
|
||||||
|
else
|
||||||
|
aRL1->Point(aPRID).ParametersOnS2(u, v);
|
||||||
|
|
||||||
|
aBRL.Add(gp_Pnt2d(u, v));
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Real aXmin = 0.0, aYmin = 0.0, aXMax = 0.0, aYMax = 0.0;
|
||||||
|
aBRL.Get(aXmin, aYmin, aXMax, aYMax);
|
||||||
|
const Standard_Real aDX = aXMax - aXmin,
|
||||||
|
aDY = aYMax - aYmin;
|
||||||
|
|
||||||
|
const Standard_Real aTolU = reversed? Surf1->UResolution(TolArc) : Surf2->UResolution(TolArc);
|
||||||
|
const Standard_Real aTolV = reversed? Surf1->VResolution(TolArc) : Surf2->VResolution(TolArc);
|
||||||
|
|
||||||
|
if((aDX > aTolU) && (aDY > aTolV))
|
||||||
|
{//Delete restriction line because it is not isoline.
|
||||||
|
slin.Remove(i);
|
||||||
|
i--;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
aXmin -= aTolU;
|
||||||
|
aXMax += aTolU;
|
||||||
|
aYmin -= aTolV;
|
||||||
|
aYMax += aTolV;
|
||||||
|
aBRL.SetVoid();
|
||||||
|
aBRL.Update(aXmin, aYmin, aXMax, aYMax);
|
||||||
|
}
|
||||||
|
|
||||||
|
const Standard_Boolean isCoincide = IsIn2DBox(aBRL, aL2,
|
||||||
|
(reversed? aUPeriodOfSurf1 : aUPeriodOfSurf2),
|
||||||
|
(reversed? aVPeriodOfSurf1 : aVPeriodOfSurf2), reversed);
|
||||||
|
|
||||||
|
if(isCoincide)
|
||||||
|
{//Delete Walking-line
|
||||||
|
slin.Remove(j);
|
||||||
|
j--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
empt = (slin.Length() == 0 && spnt.Length() == 0);
|
empt = (slin.Length() == 0 && spnt.Length() == 0);
|
||||||
done = Standard_True;
|
done = Standard_True;
|
||||||
|
|
||||||
|
|
||||||
// post processing for cones and spheres
|
|
||||||
|
|
||||||
if(slin.Length() == 0)
|
if(slin.Length() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1355,12 +1447,14 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
if(!isDecomposeRequired)
|
if(!isDecomposeRequired)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// post processing for cones and spheres
|
||||||
|
|
||||||
const Handle(Adaptor3d_TopolTool)& PDomain = (reversed) ? D1 : D2;
|
const Handle(Adaptor3d_TopolTool)& PDomain = (reversed) ? D1 : D2;
|
||||||
const Handle(Adaptor3d_HSurface)& aQSurf = (reversed) ? Surf2 : Surf1;
|
const Handle(Adaptor3d_HSurface)& aQSurf = (reversed) ? Surf2 : Surf1;
|
||||||
|
|
||||||
IntPatch_SequenceOfLine dslin;
|
IntPatch_SequenceOfLine dslin;
|
||||||
Standard_Boolean isDecompose = Standard_False;
|
Standard_Boolean isDecompose = Standard_False;
|
||||||
for(i = 1; i <= slin.Length(); i++ )
|
for(Standard_Integer i = 1; i <= slin.Length(); i++ )
|
||||||
{
|
{
|
||||||
if(DecomposeResult(slin(i),reversed,Quad,PDomain,aQSurf,TolArc,dslin))
|
if(DecomposeResult(slin(i),reversed,Quad,PDomain,aQSurf,TolArc,dslin))
|
||||||
{
|
{
|
||||||
@ -1372,7 +1466,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
slin.Clear();
|
slin.Clear();
|
||||||
for(i = 1; i <= dslin.Length(); i++ )
|
for(Standard_Integer i = 1; i <= dslin.Length(); i++ )
|
||||||
slin.Append(dslin(i));
|
slin.Append(dslin(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1518,8 +1612,8 @@ static Standard_Boolean AreSamePoints(const IntSurf_PntOn2S& P1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void ForcedPurgePoints(const Handle(IntSurf_LineOn2S)& Result,
|
static void ForcedPurgePoints(const Handle(IntSurf_LineOn2S)& Result,
|
||||||
const Standard_Boolean IsReversed,
|
const Standard_Boolean IsReversed,
|
||||||
const IntSurf_Quadric& Quad)
|
const IntSurf_Quadric& Quad)
|
||||||
{
|
{
|
||||||
if(Result->NbPoints() <= 30) return;
|
if(Result->NbPoints() <= 30) return;
|
||||||
Standard_Integer Index = 0, IndexLimF = 8, IndexLimL = 8;
|
Standard_Integer Index = 0, IndexLimF = 8, IndexLimL = 8;
|
||||||
@ -1790,10 +1884,10 @@ static Standard_Boolean InsertSeamVertices(Handle(IntSurf_LineOn2S)& Line,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void ToSmooth( const Handle(IntSurf_LineOn2S)& Line,
|
static void ToSmooth( const Handle(IntSurf_LineOn2S)& Line,
|
||||||
const Standard_Boolean IsReversed,
|
const Standard_Boolean IsReversed,
|
||||||
const IntSurf_Quadric& Quad,
|
const IntSurf_Quadric& Quad,
|
||||||
const Standard_Boolean IsFirst,
|
const Standard_Boolean IsFirst,
|
||||||
Standard_Real& D3D)
|
Standard_Real& D3D)
|
||||||
{
|
{
|
||||||
if(Line->NbPoints() <= 10)
|
if(Line->NbPoints() <= 10)
|
||||||
return;
|
return;
|
||||||
@ -1886,10 +1980,10 @@ static void ToSmooth( const Handle(IntSurf_LineOn2S)& Line,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Standard_Boolean TestMiddleOnPrm(const IntSurf_PntOn2S& aP,
|
static Standard_Boolean TestMiddleOnPrm(const IntSurf_PntOn2S& aP,
|
||||||
const IntSurf_PntOn2S& aV,
|
const IntSurf_PntOn2S& aV,
|
||||||
const Standard_Boolean IsReversed,
|
const Standard_Boolean IsReversed,
|
||||||
const Standard_Real ArcTol,
|
const Standard_Real ArcTol,
|
||||||
const Handle(Adaptor3d_TopolTool)& PDomain)
|
const Handle(Adaptor3d_TopolTool)& PDomain)
|
||||||
|
|
||||||
{
|
{
|
||||||
Standard_Boolean result = Standard_False;
|
Standard_Boolean result = Standard_False;
|
||||||
@ -1911,15 +2005,15 @@ static Standard_Boolean TestMiddleOnPrm(const IntSurf_PntOn2S& aP,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void VerifyVertices( const Handle(IntSurf_LineOn2S)& Line,
|
static void VerifyVertices( const Handle(IntSurf_LineOn2S)& Line,
|
||||||
const Standard_Boolean IsReversed,
|
const Standard_Boolean IsReversed,
|
||||||
const Handle(IntSurf_LineOn2S)& Vertices,
|
const Handle(IntSurf_LineOn2S)& Vertices,
|
||||||
const Standard_Real TOL2D,
|
const Standard_Real TOL2D,
|
||||||
const Standard_Real ArcTol,
|
const Standard_Real ArcTol,
|
||||||
const Handle(Adaptor3d_TopolTool)& PDomain,
|
const Handle(Adaptor3d_TopolTool)& PDomain,
|
||||||
IntSurf_PntOn2S& VrtF,
|
IntSurf_PntOn2S& VrtF,
|
||||||
Standard_Boolean& AddFirst,
|
Standard_Boolean& AddFirst,
|
||||||
IntSurf_PntOn2S& VrtL,
|
IntSurf_PntOn2S& VrtL,
|
||||||
Standard_Boolean& AddLast)
|
Standard_Boolean& AddLast)
|
||||||
{
|
{
|
||||||
Standard_Integer nbp = Line->NbPoints(), nbv = Vertices->NbPoints();
|
Standard_Integer nbp = Line->NbPoints(), nbv = Vertices->NbPoints();
|
||||||
Standard_Integer FIndexSame = 0, FIndexNear = 0, LIndexSame = 0, LIndexNear = 0;
|
Standard_Integer FIndexSame = 0, FIndexNear = 0, LIndexSame = 0, LIndexNear = 0;
|
||||||
@ -2522,21 +2616,58 @@ static Standard_Boolean DecomposeResult(const Handle(IntPatch_Line)& theLine,
|
|||||||
|
|
||||||
return hasBeenDecomposed;
|
return hasBeenDecomposed;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
// <-A
|
static Standard_Boolean IsIn2DBox(const Bnd_Box2d& theBox,
|
||||||
|
const Handle(IntPatch_PointLine)& theLine,
|
||||||
|
const Standard_Real theUPeriod,
|
||||||
|
const Standard_Real theVPeriod,
|
||||||
|
const Standard_Boolean isTheSurface1Using)
|
||||||
{
|
{
|
||||||
Standard_Integer aNbPnts;
|
const Standard_Integer aNbPnts = theLine->NbPnts();
|
||||||
Standard_Real aU1,aV1,aU2,aV2;
|
|
||||||
gp_Pnt aPx;
|
const Standard_Real aDeltaUPeriod[] = {0.0, -theUPeriod, 2.0*theUPeriod};
|
||||||
//
|
const Standard_Real aDeltaVPeriod[] = {0.0, -theVPeriod, 2.0*theVPeriod};
|
||||||
aNbPnts=thelin->NbPoints();
|
|
||||||
printf(" WLine: aNbPnts=%d\n", aNbPnts);
|
const Standard_Integer aSzOfUPArr = sizeof(aDeltaUPeriod)/sizeof(aDeltaUPeriod[0]);
|
||||||
for(i=1; i <= aNbPnts; ++i) {
|
const Standard_Integer aSzOfVPArr = sizeof(aDeltaVPeriod)/sizeof(aDeltaVPeriod[0]);
|
||||||
const IntSurf_PntOn2S& aPoint = thelin->Value(i);
|
|
||||||
aPx=aPoint.Value();
|
for(Standard_Integer aPtID = 1; aPtID <= aNbPnts; aPtID++)
|
||||||
aPoint.Parameters(aU1, aV1, aU2, aV2);
|
{
|
||||||
printf(" point %d %lf %lf %lf %lf %lf %lf %lf\n",
|
Standard_Real aU = 0.0, aV = 0.0;
|
||||||
i, aPx.X(), aPx.Y(), aPx.Z(), aU1, aV1, aU2, aV2);
|
if(isTheSurface1Using)
|
||||||
|
theLine->Point(aPtID).ParametersOnS1(aU, aV);
|
||||||
|
else
|
||||||
|
theLine->Point(aPtID).ParametersOnS2(aU, aV);
|
||||||
|
|
||||||
|
if(!theBox.IsOut(gp_Pnt2d(aU, aV)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Standard_Boolean isInscribe = Standard_False;
|
||||||
|
|
||||||
|
for(Standard_Integer aUind = 0; !isInscribe && (aUind < aSzOfUPArr); aUind++)
|
||||||
|
{
|
||||||
|
if((aUind > 0) && (aDeltaUPeriod[aUind] == 0.0))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
aU += aDeltaUPeriod[aUind];
|
||||||
|
|
||||||
|
for(Standard_Integer aVind = 0; !isInscribe && (aVind < aSzOfVPArr); aVind++)
|
||||||
|
{
|
||||||
|
if((aVind > 0) && (aDeltaVPeriod[aVind] == 0.0))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
aV += aDeltaVPeriod[aVind];
|
||||||
|
|
||||||
|
isInscribe = !theBox.IsOut(gp_Pnt2d(aU, aV));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isInscribe)
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
return Standard_True;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
@ -88,7 +88,15 @@ is
|
|||||||
S1: HSurface from Adaptor3d; D1: TopolTool from Adaptor3d;
|
S1: HSurface from Adaptor3d; D1: TopolTool from Adaptor3d;
|
||||||
S2: HSurface from Adaptor3d; D2: TopolTool from Adaptor3d;
|
S2: HSurface from Adaptor3d; D2: TopolTool from Adaptor3d;
|
||||||
TolArc,TolTang: Real from Standard;
|
TolArc,TolTang: Real from Standard;
|
||||||
isGeomInt : Boolean from Standard = Standard_True)
|
isGeomInt : Boolean from Standard = Standard_True;
|
||||||
|
theIsReqToKeepRLine: Boolean from Standard = Standard_False)
|
||||||
|
|
||||||
|
---Purpose: Flag theIsReqToKeepRLine has been enterred only for
|
||||||
|
-- compatibility with TopOpeBRep package. It shall be deleted
|
||||||
|
-- after deleting TopOpeBRep.
|
||||||
|
-- When intersection result returns IntPatch_RLine and another
|
||||||
|
-- IntPatch_Line (not restriction) we (in case of theIsReqToKeepRLine==TRUE)
|
||||||
|
-- will always keep both lines even if they are coincided.
|
||||||
|
|
||||||
raises ConstructionError from Standard
|
raises ConstructionError from Standard
|
||||||
is static;
|
is static;
|
||||||
@ -140,7 +148,15 @@ is
|
|||||||
TolArc,TolTang: Real from Standard;
|
TolArc,TolTang: Real from Standard;
|
||||||
LOfPnts: in out ListOfPntOn2S from IntSurf;
|
LOfPnts: in out ListOfPntOn2S from IntSurf;
|
||||||
RestrictLine: Boolean from Standard;
|
RestrictLine: Boolean from Standard;
|
||||||
typs1, typs2: SurfaceType from GeomAbs)
|
typs1, typs2: SurfaceType from GeomAbs;
|
||||||
|
theIsReqToKeepRLine: Boolean from Standard = Standard_False)
|
||||||
|
|
||||||
|
---Purpose: Flag theIsReqToKeepRLine has been enterred only for
|
||||||
|
-- compatibility with TopOpeBRep package. It shall be deleted
|
||||||
|
-- after deleting TopOpeBRep.
|
||||||
|
-- When intersection result returns IntPatch_RLine and another
|
||||||
|
-- IntPatch_Line (not restriction) we (in case of theIsReqToKeepRLine==TRUE)
|
||||||
|
-- will always keep both lines even if they are coincided.
|
||||||
|
|
||||||
is private;
|
is private;
|
||||||
|
|
||||||
@ -150,7 +166,15 @@ is
|
|||||||
TolArc,TolTang: Real from Standard;
|
TolArc,TolTang: Real from Standard;
|
||||||
LOfPnts: in out ListOfPntOn2S from IntSurf;
|
LOfPnts: in out ListOfPntOn2S from IntSurf;
|
||||||
RestrictLine: Boolean from Standard;
|
RestrictLine: Boolean from Standard;
|
||||||
typs1, typs2: SurfaceType from GeomAbs)
|
typs1, typs2: SurfaceType from GeomAbs;
|
||||||
|
theIsReqToKeepRLine: Boolean from Standard = Standard_False)
|
||||||
|
|
||||||
|
---Purpose: Flag theIsReqToKeepRLine has been enterred only for
|
||||||
|
-- compatibility with TopOpeBRep package. It shall be deleted
|
||||||
|
-- after deleting TopOpeBRep.
|
||||||
|
-- When intersection result returns IntPatch_RLine and another
|
||||||
|
-- IntPatch_Line (not restriction) we (in case of theIsReqToKeepRLine==TRUE)
|
||||||
|
-- will always keep both lines even if they are coincided.
|
||||||
|
|
||||||
is private;
|
is private;
|
||||||
|
|
||||||
|
@ -925,7 +925,8 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
|||||||
const Handle(Adaptor3d_TopolTool)& theD2,
|
const Handle(Adaptor3d_TopolTool)& theD2,
|
||||||
const Standard_Real TolArc,
|
const Standard_Real TolArc,
|
||||||
const Standard_Real TolTang,
|
const Standard_Real TolTang,
|
||||||
const Standard_Boolean isGeomInt)
|
const Standard_Boolean isGeomInt,
|
||||||
|
const Standard_Boolean theIsReqToKeepRLine)
|
||||||
{
|
{
|
||||||
myTolArc = TolArc;
|
myTolArc = TolArc;
|
||||||
myTolTang = TolTang;
|
myTolTang = TolTang;
|
||||||
@ -1124,13 +1125,15 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
|||||||
{
|
{
|
||||||
if(theD1->DomainIsInfinite() || theD2->DomainIsInfinite())
|
if(theD1->DomainIsInfinite() || theD2->DomainIsInfinite())
|
||||||
{
|
{
|
||||||
GeomGeomPerfom(theS1, theD1, theS2, theD2, TolArc,
|
GeomGeomPerfom( theS1, theD1, theS2, theD2, TolArc,
|
||||||
TolTang, ListOfPnts, RestrictLine, typs1, typs2);
|
TolTang, ListOfPnts, RestrictLine,
|
||||||
|
typs1, typs2, theIsReqToKeepRLine);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GeomGeomPerfomTrimSurf(theS1, theD1, theS2, theD2,
|
GeomGeomPerfomTrimSurf( theS1, theD1, theS2, theD2,
|
||||||
TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
|
TolArc, TolTang, ListOfPnts, RestrictLine,
|
||||||
|
typs1, typs2, theIsReqToKeepRLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1500,9 +1503,11 @@ void IntPatch_Intersection::GeomGeomPerfom(const Handle(Adaptor3d_HSurface)& the
|
|||||||
IntSurf_ListOfPntOn2S& ListOfPnts,
|
IntSurf_ListOfPntOn2S& ListOfPnts,
|
||||||
const Standard_Boolean RestrictLine,
|
const Standard_Boolean RestrictLine,
|
||||||
const GeomAbs_SurfaceType typs1,
|
const GeomAbs_SurfaceType typs1,
|
||||||
const GeomAbs_SurfaceType typs2)
|
const GeomAbs_SurfaceType typs2,
|
||||||
|
const Standard_Boolean theIsReqToKeepRLine)
|
||||||
{
|
{
|
||||||
IntPatch_ImpImpIntersection interii(theS1,theD1,theS2,theD2,myTolArc,myTolTang);
|
IntPatch_ImpImpIntersection interii(theS1,theD1,theS2,theD2,
|
||||||
|
myTolArc,myTolTang, theIsReqToKeepRLine);
|
||||||
const Standard_Boolean anIS = interii.IsDone();
|
const Standard_Boolean anIS = interii.IsDone();
|
||||||
if (anIS)
|
if (anIS)
|
||||||
{
|
{
|
||||||
@ -1693,14 +1698,16 @@ void IntPatch_Intersection::
|
|||||||
IntSurf_ListOfPntOn2S& theListOfPnts,
|
IntSurf_ListOfPntOn2S& theListOfPnts,
|
||||||
const Standard_Boolean RestrictLine,
|
const Standard_Boolean RestrictLine,
|
||||||
const GeomAbs_SurfaceType theTyps1,
|
const GeomAbs_SurfaceType theTyps1,
|
||||||
const GeomAbs_SurfaceType theTyps2)
|
const GeomAbs_SurfaceType theTyps2,
|
||||||
|
const Standard_Boolean theIsReqToKeepRLine)
|
||||||
{
|
{
|
||||||
IntSurf_Quadric Quad1,Quad2;
|
IntSurf_Quadric Quad1,Quad2;
|
||||||
|
|
||||||
if((theTyps1 == GeomAbs_Cylinder) && (theTyps2 == GeomAbs_Cylinder))
|
if((theTyps1 == GeomAbs_Cylinder) && (theTyps2 == GeomAbs_Cylinder))
|
||||||
{
|
{
|
||||||
IntPatch_ImpImpIntersection anInt;
|
IntPatch_ImpImpIntersection anInt;
|
||||||
anInt.Perform(theS1, theD1, theS2, theD2, myTolArc, myTolTang, Standard_True);
|
anInt.Perform(theS1, theD1, theS2, theD2, myTolArc,
|
||||||
|
myTolTang, Standard_True, theIsReqToKeepRLine);
|
||||||
|
|
||||||
done = anInt.IsDone();
|
done = anInt.IsDone();
|
||||||
|
|
||||||
@ -1743,7 +1750,8 @@ void IntPatch_Intersection::
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
GeomGeomPerfom(theS1, theD1, theS2, theD2,
|
GeomGeomPerfom(theS1, theD1, theS2, theD2,
|
||||||
theTolArc, theTolTang, theListOfPnts, RestrictLine, theTyps1, theTyps2);
|
theTolArc, theTolTang, theListOfPnts,
|
||||||
|
RestrictLine, theTyps1, theTyps2, theIsReqToKeepRLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ uses
|
|||||||
HVertex from Adaptor3d,
|
HVertex from Adaptor3d,
|
||||||
HCurve2d from Adaptor2d,
|
HCurve2d from Adaptor2d,
|
||||||
PntOn2S from IntSurf,
|
PntOn2S from IntSurf,
|
||||||
Line from IntPatch,
|
|
||||||
Transition from IntSurf,
|
Transition from IntSurf,
|
||||||
Pnt from gp
|
Pnt from gp
|
||||||
|
|
||||||
|
75
src/IntPatch/IntPatch_PointLine.cdl
Normal file
75
src/IntPatch/IntPatch_PointLine.cdl
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
-- Created on: 2015-02-18
|
||||||
|
-- Created by: Nikolai BUKHALOV
|
||||||
|
-- Copyright (c) 1992-1999 Matra Datavision
|
||||||
|
-- Copyright (c) 1999-2015 OPEN CASCADE SAS
|
||||||
|
--
|
||||||
|
-- This file is part of Open CASCADE Technology software library.
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or modify it under
|
||||||
|
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||||
|
-- by the Free Software Foundation, with special exception defined in the file
|
||||||
|
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||||
|
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||||
|
--
|
||||||
|
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
|
-- commercial license or contractual agreement.
|
||||||
|
|
||||||
|
deferred class PointLine from IntPatch
|
||||||
|
|
||||||
|
inherits Line from IntPatch
|
||||||
|
|
||||||
|
---Purpose: Definition of an intersection line between two
|
||||||
|
-- surfaces.
|
||||||
|
-- A line defined by a set of points
|
||||||
|
-- (e.g. coming from a walking algorithm) as
|
||||||
|
-- defined in the class WLine or RLine (Restriction line).
|
||||||
|
|
||||||
|
|
||||||
|
uses TypeTrans from IntSurf,
|
||||||
|
Situation from IntSurf,
|
||||||
|
PntOn2S from IntSurf
|
||||||
|
|
||||||
|
|
||||||
|
raises DomainError from Standard,
|
||||||
|
OutOfRange from Standard
|
||||||
|
|
||||||
|
is
|
||||||
|
|
||||||
|
Initialize(Tang: Boolean from Standard;
|
||||||
|
Trans1,Trans2: TypeTrans from IntSurf);
|
||||||
|
|
||||||
|
---Purpose: To initialize the fields, when the transitions
|
||||||
|
-- are In or Out.
|
||||||
|
|
||||||
|
|
||||||
|
Initialize(Tang: Boolean from Standard;
|
||||||
|
Situ1,Situ2: Situation from IntSurf);
|
||||||
|
|
||||||
|
---Purpose: To initialize the fields, when the transitions
|
||||||
|
-- are Touch.
|
||||||
|
|
||||||
|
Initialize(Tang: Boolean from Standard);
|
||||||
|
|
||||||
|
---Purpose: To initialize the fields, when the transitions
|
||||||
|
-- are Undecided.
|
||||||
|
|
||||||
|
NbPnts(me) returns Integer from Standard
|
||||||
|
---Purpose: Returns the number of intersection points.
|
||||||
|
|
||||||
|
is deferred;
|
||||||
|
|
||||||
|
Point(me; Index : Integer from Standard) returns PntOn2S from IntSurf
|
||||||
|
---Purpose: Returns the intersection point of range Index.
|
||||||
|
|
||||||
|
---C++: return const&
|
||||||
|
|
||||||
|
raises OutOfRange from Standard,
|
||||||
|
DomainError from Standard
|
||||||
|
--- The exception DomainError is raised if HasPolygon returns False.
|
||||||
|
--- The exception OutOfRange is raised if Index <= 0 or Index > NbPnts.
|
||||||
|
|
||||||
|
is deferred;
|
||||||
|
|
||||||
|
-- fields
|
||||||
|
|
||||||
|
end Line;
|
36
src/IntPatch/IntPatch_PointLine.cxx
Normal file
36
src/IntPatch/IntPatch_PointLine.cxx
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// Created on: 2015-02-18
|
||||||
|
// Created by: Nikolai BUKHALOV
|
||||||
|
// Copyright (c) 1995-1999 Matra Datavision
|
||||||
|
// Copyright (c) 1999-2015 OPEN CASCADE SAS
|
||||||
|
//
|
||||||
|
// This file is part of Open CASCADE Technology software library.
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or modify it under
|
||||||
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||||
|
// by the Free Software Foundation, with special exception defined in the file
|
||||||
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||||
|
// distribution for complete text of the license and disclaimer of any warranty.
|
||||||
|
//
|
||||||
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
|
#include <IntPatch_PointLine.ixx>
|
||||||
|
|
||||||
|
|
||||||
|
IntPatch_PointLine::IntPatch_PointLine (const Standard_Boolean Tang,
|
||||||
|
const IntSurf_TypeTrans Trans1,
|
||||||
|
const IntSurf_TypeTrans Trans2) :
|
||||||
|
IntPatch_Line(Tang, Trans1, Trans2)
|
||||||
|
{}
|
||||||
|
|
||||||
|
IntPatch_PointLine::IntPatch_PointLine (const Standard_Boolean Tang,
|
||||||
|
const IntSurf_Situation Situ1,
|
||||||
|
const IntSurf_Situation Situ2) :
|
||||||
|
IntPatch_Line(Tang, Situ1, Situ2)
|
||||||
|
{}
|
||||||
|
|
||||||
|
IntPatch_PointLine::IntPatch_PointLine (const Standard_Boolean Tang) :
|
||||||
|
IntPatch_Line(Tang)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
|||||||
class RLine from IntPatch
|
class RLine from IntPatch
|
||||||
|
|
||||||
|
|
||||||
inherits Line from IntPatch
|
inherits PointLine from IntPatch
|
||||||
|
|
||||||
---Purpose: Implementation of an intersection line described by a
|
---Purpose: Implementation of an intersection line described by a
|
||||||
-- restriction line on one of the surfaces.
|
-- restriction line on one of the surfaces.
|
||||||
|
@ -20,10 +20,9 @@
|
|||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
|
||||||
IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang,
|
IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang,
|
||||||
const IntSurf_TypeTrans Trans1,
|
const IntSurf_TypeTrans Trans1,
|
||||||
const IntSurf_TypeTrans Trans2) :
|
const IntSurf_TypeTrans Trans2) :
|
||||||
IntPatch_Line(Tang,Trans1,Trans2),
|
IntPatch_PointLine(Tang,Trans1,Trans2), fipt(Standard_False),lapt(Standard_False)
|
||||||
fipt(Standard_False),lapt(Standard_False)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
typ = IntPatch_Restriction;
|
typ = IntPatch_Restriction;
|
||||||
@ -33,10 +32,9 @@ IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang,
|
|||||||
|
|
||||||
|
|
||||||
IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang,
|
IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang,
|
||||||
const IntSurf_Situation Situ1,
|
const IntSurf_Situation Situ1,
|
||||||
const IntSurf_Situation Situ2) :
|
const IntSurf_Situation Situ2) :
|
||||||
IntPatch_Line(Tang,Situ1,Situ2),
|
IntPatch_PointLine(Tang,Situ1,Situ2), fipt(Standard_False),lapt(Standard_False)
|
||||||
fipt(Standard_False),lapt(Standard_False)
|
|
||||||
{
|
{
|
||||||
typ = IntPatch_Restriction;
|
typ = IntPatch_Restriction;
|
||||||
onS2=Standard_False;
|
onS2=Standard_False;
|
||||||
@ -45,8 +43,7 @@ IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang,
|
|||||||
|
|
||||||
|
|
||||||
IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang) :
|
IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang) :
|
||||||
IntPatch_Line(Tang),
|
IntPatch_PointLine(Tang), fipt(Standard_False),lapt(Standard_False)
|
||||||
fipt(Standard_False),lapt(Standard_False)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
typ = IntPatch_Restriction;
|
typ = IntPatch_Restriction;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
class WLine from IntPatch
|
class WLine from IntPatch
|
||||||
|
|
||||||
inherits Line from IntPatch
|
inherits PointLine from IntPatch
|
||||||
|
|
||||||
---Purpose: Definition of set of points as a result of the intersection
|
---Purpose: Definition of set of points as a result of the intersection
|
||||||
-- between 2 parametrised patches.
|
-- between 2 parametrised patches.
|
||||||
|
@ -28,7 +28,7 @@ IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line,
|
|||||||
const Standard_Boolean Tang,
|
const Standard_Boolean Tang,
|
||||||
const IntSurf_TypeTrans Trans1,
|
const IntSurf_TypeTrans Trans1,
|
||||||
const IntSurf_TypeTrans Trans2) :
|
const IntSurf_TypeTrans Trans2) :
|
||||||
IntPatch_Line(Tang,Trans1,Trans2),fipt(Standard_False),lapt(Standard_False),
|
IntPatch_PointLine(Tang,Trans1,Trans2),fipt(Standard_False),lapt(Standard_False),
|
||||||
hasArcOnS1(Standard_False),hasArcOnS2(Standard_False)
|
hasArcOnS1(Standard_False),hasArcOnS2(Standard_False)
|
||||||
{
|
{
|
||||||
typ = IntPatch_Walking;
|
typ = IntPatch_Walking;
|
||||||
@ -44,7 +44,7 @@ IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line,
|
|||||||
const Standard_Boolean Tang,
|
const Standard_Boolean Tang,
|
||||||
const IntSurf_Situation Situ1,
|
const IntSurf_Situation Situ1,
|
||||||
const IntSurf_Situation Situ2) :
|
const IntSurf_Situation Situ2) :
|
||||||
IntPatch_Line(Tang,Situ1,Situ2),fipt(Standard_False),lapt(Standard_False),
|
IntPatch_PointLine(Tang,Situ1,Situ2),fipt(Standard_False),lapt(Standard_False),
|
||||||
hasArcOnS1(Standard_False),hasArcOnS2(Standard_False)
|
hasArcOnS1(Standard_False),hasArcOnS2(Standard_False)
|
||||||
{
|
{
|
||||||
typ = IntPatch_Walking;
|
typ = IntPatch_Walking;
|
||||||
@ -58,7 +58,7 @@ IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line,
|
|||||||
|
|
||||||
IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line,
|
IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line,
|
||||||
const Standard_Boolean Tang) :
|
const Standard_Boolean Tang) :
|
||||||
IntPatch_Line(Tang),fipt(Standard_False),lapt(Standard_False),
|
IntPatch_PointLine(Tang),fipt(Standard_False),lapt(Standard_False),
|
||||||
hasArcOnS1(Standard_False),hasArcOnS2(Standard_False)
|
hasArcOnS1(Standard_False),hasArcOnS2(Standard_False)
|
||||||
{
|
{
|
||||||
typ = IntPatch_Walking;
|
typ = IntPatch_Walking;
|
||||||
|
@ -87,6 +87,7 @@
|
|||||||
|
|
||||||
#include <Geom2dAPI_InterCurveCurve.hxx>
|
#include <Geom2dAPI_InterCurveCurve.hxx>
|
||||||
#include <Geom2dInt_GInter.hxx>
|
#include <Geom2dInt_GInter.hxx>
|
||||||
|
#include <Geom2dAdaptor.hxx>
|
||||||
#include <GeomAdaptor_Curve.hxx>
|
#include <GeomAdaptor_Curve.hxx>
|
||||||
#include <GeomAdaptor_HSurface.hxx>
|
#include <GeomAdaptor_HSurface.hxx>
|
||||||
#include <GeomAdaptor_Surface.hxx>
|
#include <GeomAdaptor_Surface.hxx>
|
||||||
@ -115,6 +116,10 @@
|
|||||||
#include <IntSurf_ListIteratorOfListOfPntOn2S.hxx>
|
#include <IntSurf_ListIteratorOfListOfPntOn2S.hxx>
|
||||||
#include <GeomInt.hxx>
|
#include <GeomInt.hxx>
|
||||||
|
|
||||||
|
#include <Approx_CurveOnSurface.hxx>
|
||||||
|
#include <GeomAdaptor.hxx>
|
||||||
|
#include <GeomInt_IntSS.hxx>
|
||||||
|
|
||||||
static
|
static
|
||||||
void RefineVector(gp_Vec2d& aV2D);
|
void RefineVector(gp_Vec2d& aV2D);
|
||||||
#ifdef OCCT_DEBUG_DUMPWLINE
|
#ifdef OCCT_DEBUG_DUMPWLINE
|
||||||
@ -140,12 +145,6 @@ static
|
|||||||
Standard_Real&,
|
Standard_Real&,
|
||||||
Standard_Real&);
|
Standard_Real&);
|
||||||
|
|
||||||
static
|
|
||||||
void BuildPCurves (Standard_Real f,Standard_Real l,Standard_Real& Tol,
|
|
||||||
const Handle (Geom_Surface)& S,
|
|
||||||
const Handle (Geom_Curve)& C,
|
|
||||||
Handle (Geom2d_Curve)& C2d);
|
|
||||||
|
|
||||||
static
|
static
|
||||||
void CorrectSurfaceBoundaries(const TopoDS_Face& theFace,
|
void CorrectSurfaceBoundaries(const TopoDS_Face& theFace,
|
||||||
const Standard_Real theTolerance,
|
const Standard_Real theTolerance,
|
||||||
@ -153,6 +152,7 @@ static
|
|||||||
Standard_Real& theumax,
|
Standard_Real& theumax,
|
||||||
Standard_Real& thevmin,
|
Standard_Real& thevmin,
|
||||||
Standard_Real& thevmax);
|
Standard_Real& thevmax);
|
||||||
|
|
||||||
static
|
static
|
||||||
Standard_Boolean NotUseSurfacesForApprox
|
Standard_Boolean NotUseSurfacesForApprox
|
||||||
(const TopoDS_Face& aF1,
|
(const TopoDS_Face& aF1,
|
||||||
@ -1094,20 +1094,32 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
bAvoidLineConstructor = Standard_False;
|
bAvoidLineConstructor = Standard_False;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typl=L->ArcType();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Line Constructor
|
// Line Constructor
|
||||||
if(!bAvoidLineConstructor) {
|
if(!bAvoidLineConstructor) {
|
||||||
myLConstruct.Perform(L);
|
myLConstruct.Perform(L);
|
||||||
//
|
//
|
||||||
bDone=myLConstruct.IsDone();
|
bDone=myLConstruct.IsDone();
|
||||||
aNbParts=myLConstruct.NbParts();
|
if(!bDone)
|
||||||
if (!bDone|| !aNbParts) {
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(typl != IntPatch_Restriction)
|
||||||
|
{
|
||||||
|
aNbParts=myLConstruct.NbParts();
|
||||||
|
if (aNbParts <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// Do the Curve
|
// Do the Curve
|
||||||
//
|
|
||||||
|
|
||||||
switch (typl) {
|
switch (typl) {
|
||||||
//########################################
|
//########################################
|
||||||
// Line, Parabola, Hyperbola
|
// Line, Parabola, Hyperbola
|
||||||
@ -1140,7 +1152,7 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
Standard_Boolean bFNIt, bLPIt;
|
Standard_Boolean bFNIt, bLPIt;
|
||||||
//
|
//
|
||||||
myLConstruct.Part(i, fprm, lprm);
|
myLConstruct.Part(i, fprm, lprm);
|
||||||
//
|
//
|
||||||
bFNIt=Precision::IsNegativeInfinite(fprm);
|
bFNIt=Precision::IsNegativeInfinite(fprm);
|
||||||
bLPIt=Precision::IsPositiveInfinite(lprm);
|
bLPIt=Precision::IsPositiveInfinite(lprm);
|
||||||
//
|
//
|
||||||
@ -1162,7 +1174,8 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
aCurve.SetCurve(new Geom_TrimmedCurve(newc, fprm, lprm));
|
aCurve.SetCurve(new Geom_TrimmedCurve(newc, fprm, lprm));
|
||||||
if(myApprox1) {
|
if(myApprox1) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
BuildPCurves(fprm, lprm, Tolpc, myHS1->ChangeSurface().Surface(), newc, C2d);
|
GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
|
||||||
|
myHS1->ChangeSurface().Surface(), newc, C2d);
|
||||||
if(Tolpc>myTolReached2d || myTolReached2d==0.) {
|
if(Tolpc>myTolReached2d || myTolReached2d==0.) {
|
||||||
myTolReached2d=Tolpc;
|
myTolReached2d=Tolpc;
|
||||||
}
|
}
|
||||||
@ -1177,7 +1190,8 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
//
|
//
|
||||||
if(myApprox2) {
|
if(myApprox2) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
BuildPCurves(fprm,lprm,Tolpc,myHS2->ChangeSurface().Surface(),newc,C2d);
|
GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
|
||||||
|
myHS2->ChangeSurface().Surface(), newc, C2d);
|
||||||
if(Tolpc>myTolReached2d || myTolReached2d==0.) {
|
if(Tolpc>myTolReached2d || myTolReached2d==0.) {
|
||||||
myTolReached2d=Tolpc;
|
myTolReached2d=Tolpc;
|
||||||
}
|
}
|
||||||
@ -1345,7 +1359,8 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
if (typl == IntPatch_Circle || typl == IntPatch_Ellipse) {////
|
if (typl == IntPatch_Circle || typl == IntPatch_Ellipse) {////
|
||||||
if(myApprox1) {
|
if(myApprox1) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
BuildPCurves(fprm,lprm,Tolpc,myHS1->ChangeSurface().Surface(),newc,C2d);
|
GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
|
||||||
|
myHS1->ChangeSurface().Surface(), newc, C2d);
|
||||||
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
||||||
myTolReached2d=Tolpc;
|
myTolReached2d=Tolpc;
|
||||||
}
|
}
|
||||||
@ -1360,7 +1375,8 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
|
|
||||||
if(myApprox2) {
|
if(myApprox2) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
BuildPCurves(fprm,lprm,Tolpc,myHS2->ChangeSurface().Surface(),newc,C2d);
|
GeomInt_IntSS::BuildPCurves(fprm,lprm,Tolpc,
|
||||||
|
myHS2->ChangeSurface().Surface(),newc,C2d);
|
||||||
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
||||||
myTolReached2d=Tolpc;
|
myTolReached2d=Tolpc;
|
||||||
}
|
}
|
||||||
@ -1396,7 +1412,8 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
|
|
||||||
if(myApprox1) {
|
if(myApprox1) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
BuildPCurves(fprm,lprm,Tolpc,myHS1->ChangeSurface().Surface(),newc,C2d);
|
GeomInt_IntSS::BuildPCurves(fprm,lprm,Tolpc,
|
||||||
|
myHS1->ChangeSurface().Surface(),newc,C2d);
|
||||||
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
||||||
myTolReached2d=Tolpc;
|
myTolReached2d=Tolpc;
|
||||||
}
|
}
|
||||||
@ -1410,7 +1427,8 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
|
|
||||||
if(myApprox2) {
|
if(myApprox2) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
BuildPCurves(fprm,lprm,Tolpc,myHS2->ChangeSurface().Surface(),newc,C2d);
|
GeomInt_IntSS::BuildPCurves(fprm,lprm,Tolpc,
|
||||||
|
myHS2->ChangeSurface().Surface(),newc,C2d);
|
||||||
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
||||||
myTolReached2d=Tolpc;
|
myTolReached2d=Tolpc;
|
||||||
}
|
}
|
||||||
@ -1447,7 +1465,8 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
|
|
||||||
if(myApprox1) {
|
if(myApprox1) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
BuildPCurves(fprm, lprm, Tolpc, myHS1->ChangeSurface().Surface(), newc, C2d);
|
GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
|
||||||
|
myHS1->ChangeSurface().Surface(), newc, C2d);
|
||||||
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
||||||
myTolReached2d=Tolpc;
|
myTolReached2d=Tolpc;
|
||||||
}
|
}
|
||||||
@ -1461,7 +1480,8 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
|
|
||||||
if(myApprox2) {
|
if(myApprox2) {
|
||||||
Handle (Geom2d_Curve) C2d;
|
Handle (Geom2d_Curve) C2d;
|
||||||
BuildPCurves(fprm, lprm, Tolpc,myHS2->ChangeSurface().Surface(), newc, C2d);
|
GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
|
||||||
|
myHS2->ChangeSurface().Surface(), newc, C2d);
|
||||||
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
if(Tolpc>myTolReached2d || myTolReached2d==0) {
|
||||||
myTolReached2d=Tolpc;
|
myTolReached2d=Tolpc;
|
||||||
}
|
}
|
||||||
@ -2126,7 +2146,8 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
|
|
||||||
Handle(Geom2d_Curve) C2d;
|
Handle(Geom2d_Curve) C2d;
|
||||||
Standard_Real aTol = myTolApprox;
|
Standard_Real aTol = myTolApprox;
|
||||||
BuildPCurves(fprm, lprm, aTol, myHS1->ChangeSurface().Surface(), BS, C2d);
|
GeomInt_IntSS::BuildPCurves(fprm, lprm, aTol,
|
||||||
|
myHS1->ChangeSurface().Surface(), BS, C2d);
|
||||||
BS1 = Handle(Geom2d_BSplineCurve)::DownCast(C2d);
|
BS1 = Handle(Geom2d_BSplineCurve)::DownCast(C2d);
|
||||||
aCurve.SetFirstCurve2d(BS1);
|
aCurve.SetFirstCurve2d(BS1);
|
||||||
}
|
}
|
||||||
@ -2156,7 +2177,8 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
|
|
||||||
Handle(Geom2d_Curve) C2d;
|
Handle(Geom2d_Curve) C2d;
|
||||||
Standard_Real aTol = myTolApprox;
|
Standard_Real aTol = myTolApprox;
|
||||||
BuildPCurves(fprm, lprm, aTol, myHS2->ChangeSurface().Surface(), BS, C2d);
|
GeomInt_IntSS::BuildPCurves(fprm, lprm, aTol,
|
||||||
|
myHS2->ChangeSurface().Surface(), BS, C2d);
|
||||||
BS2 = Handle(Geom2d_BSplineCurve)::DownCast(C2d);
|
BS2 = Handle(Geom2d_BSplineCurve)::DownCast(C2d);
|
||||||
aCurve.SetSecondCurve2d(BS2);
|
aCurve.SetSecondCurve2d(BS2);
|
||||||
}
|
}
|
||||||
@ -2178,6 +2200,110 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case IntPatch_Restriction:
|
case IntPatch_Restriction:
|
||||||
|
{
|
||||||
|
GeomAbs_SurfaceType typS1 = myHS1->Surface().GetType();
|
||||||
|
GeomAbs_SurfaceType typS2 = myHS2->Surface().GetType();
|
||||||
|
Standard_Boolean isAnalS1 = Standard_False;
|
||||||
|
switch (typS1)
|
||||||
|
{
|
||||||
|
case GeomAbs_Plane:
|
||||||
|
case GeomAbs_Cylinder:
|
||||||
|
case GeomAbs_Sphere:
|
||||||
|
case GeomAbs_Cone:
|
||||||
|
case GeomAbs_Torus: isAnalS1 = Standard_True; break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Integer isAnalS2 = Standard_False;
|
||||||
|
switch (typS2)
|
||||||
|
{
|
||||||
|
case GeomAbs_Plane:
|
||||||
|
case GeomAbs_Cylinder:
|
||||||
|
case GeomAbs_Sphere:
|
||||||
|
case GeomAbs_Cone:
|
||||||
|
case GeomAbs_Torus: isAnalS2 = Standard_True; break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle(IntPatch_RLine) RL =
|
||||||
|
Handle(IntPatch_RLine)::DownCast(L);
|
||||||
|
Handle(Geom_Curve) aC3d;
|
||||||
|
Handle(Geom2d_Curve) aC2d1, aC2d2;
|
||||||
|
Standard_Real aTolReached;
|
||||||
|
GeomInt_IntSS::TreatRLine(RL, myHS1, myHS2, aC3d,
|
||||||
|
aC2d1, aC2d2, aTolReached);
|
||||||
|
|
||||||
|
if(aC3d.IsNull())
|
||||||
|
break;
|
||||||
|
|
||||||
|
Bnd_Box2d aBox1, aBox2;
|
||||||
|
|
||||||
|
const Standard_Real aU1f = myHS1->FirstUParameter(),
|
||||||
|
aV1f = myHS1->FirstVParameter(),
|
||||||
|
aU1l = myHS1->LastUParameter(),
|
||||||
|
aV1l = myHS1->LastVParameter();
|
||||||
|
const Standard_Real aU2f = myHS2->FirstUParameter(),
|
||||||
|
aV2f = myHS2->FirstVParameter(),
|
||||||
|
aU2l = myHS2->LastUParameter(),
|
||||||
|
aV2l = myHS2->LastVParameter();
|
||||||
|
|
||||||
|
aBox1.Add(gp_Pnt2d(aU1f, aV1f));
|
||||||
|
aBox1.Add(gp_Pnt2d(aU1l, aV1l));
|
||||||
|
aBox2.Add(gp_Pnt2d(aU2f, aV2f));
|
||||||
|
aBox2.Add(gp_Pnt2d(aU2l, aV2l));
|
||||||
|
|
||||||
|
GeomInt_VectorOfReal anArrayOfParameters;
|
||||||
|
|
||||||
|
//We consider here that the intersection line is same-parameter-line
|
||||||
|
anArrayOfParameters.Append(aC3d->FirstParameter());
|
||||||
|
anArrayOfParameters.Append(aC3d->LastParameter());
|
||||||
|
|
||||||
|
GeomInt_IntSS::
|
||||||
|
TrimILineOnSurfBoundaries(aC2d1, aC2d2, aBox1, aBox2, anArrayOfParameters);
|
||||||
|
|
||||||
|
const Standard_Integer aNbIntersSolutionsm1 = anArrayOfParameters.Length() - 1;
|
||||||
|
|
||||||
|
//Trim RLine found.
|
||||||
|
for(Standard_Integer anInd = 0; anInd < aNbIntersSolutionsm1; anInd++)
|
||||||
|
{
|
||||||
|
const Standard_Real aParF = anArrayOfParameters(anInd),
|
||||||
|
aParL = anArrayOfParameters(anInd+1);
|
||||||
|
|
||||||
|
if((aParL - aParF) <= Precision::PConfusion())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const Standard_Real aPar = 0.5*(aParF + aParL);
|
||||||
|
gp_Pnt2d aPt;
|
||||||
|
|
||||||
|
Handle(Geom2d_Curve) aCurv2d1, aCurv2d2;
|
||||||
|
if(!aC2d1.IsNull())
|
||||||
|
{
|
||||||
|
aC2d1->D0(aPar, aPt);
|
||||||
|
|
||||||
|
if(aBox1.IsOut(aPt))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(myApprox1)
|
||||||
|
aCurv2d1 = new Geom2d_TrimmedCurve(aC2d1, aParF, aParL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!aC2d2.IsNull())
|
||||||
|
{
|
||||||
|
aC2d2->D0(aPar, aPt);
|
||||||
|
|
||||||
|
if(aBox2.IsOut(aPt))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(myApprox2)
|
||||||
|
aCurv2d2 = new Geom2d_TrimmedCurve(aC2d2, aParF, aParL);
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle(Geom_Curve) aCurv3d = new Geom_TrimmedCurve(aC3d, aParF, aParL);
|
||||||
|
|
||||||
|
IntTools_Curve aIC(aCurv3d, aCurv2d1, aCurv2d2);
|
||||||
|
mySeqOfCurve.Append(aIC);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -2185,100 +2311,6 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : BuildPCurves
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void BuildPCurves (Standard_Real f,
|
|
||||||
Standard_Real l,
|
|
||||||
Standard_Real& Tol,
|
|
||||||
const Handle (Geom_Surface)& S,
|
|
||||||
const Handle (Geom_Curve)& C,
|
|
||||||
Handle (Geom2d_Curve)& C2d)
|
|
||||||
{
|
|
||||||
if (!C2d.IsNull()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
Standard_Real umin,umax,vmin,vmax;
|
|
||||||
//
|
|
||||||
S->Bounds(umin, umax, vmin, vmax);
|
|
||||||
// in class ProjLib_Function the range of parameters is shrank by 1.e-09
|
|
||||||
if((l - f) > 2.e-09) {
|
|
||||||
C2d = GeomProjLib::Curve2d(C,f,l,S,umin,umax,vmin,vmax,Tol);
|
|
||||||
//
|
|
||||||
if (C2d.IsNull()) {
|
|
||||||
// proj. a circle that goes through the pole on a sphere to the sphere
|
|
||||||
Tol += Precision::Confusion();
|
|
||||||
C2d = GeomProjLib::Curve2d(C,f,l,S,Tol);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if((l - f) > Epsilon(Abs(f))) {
|
|
||||||
GeomAPI_ProjectPointOnSurf aProjector1, aProjector2;
|
|
||||||
gp_Pnt P1 = C->Value(f);
|
|
||||||
gp_Pnt P2 = C->Value(l);
|
|
||||||
aProjector1.Init(P1, S);
|
|
||||||
aProjector2.Init(P2, S);
|
|
||||||
|
|
||||||
if(aProjector1.IsDone() && aProjector2.IsDone()) {
|
|
||||||
Standard_Real U=0., V=0.;
|
|
||||||
aProjector1.LowerDistanceParameters(U, V);
|
|
||||||
gp_Pnt2d p1(U, V);
|
|
||||||
|
|
||||||
aProjector2.LowerDistanceParameters(U, V);
|
|
||||||
gp_Pnt2d p2(U, V);
|
|
||||||
|
|
||||||
if(p1.Distance(p2) > gp::Resolution()) {
|
|
||||||
TColgp_Array1OfPnt2d poles(1,2);
|
|
||||||
TColStd_Array1OfReal knots(1,2);
|
|
||||||
TColStd_Array1OfInteger mults(1,2);
|
|
||||||
poles(1) = p1;
|
|
||||||
poles(2) = p2;
|
|
||||||
knots(1) = f;
|
|
||||||
knots(2) = l;
|
|
||||||
mults(1) = mults(2) = 2;
|
|
||||||
|
|
||||||
C2d = new Geom2d_BSplineCurve(poles,knots,mults,1);
|
|
||||||
|
|
||||||
// compute reached tolerance.begin
|
|
||||||
gp_Pnt PMid = C->Value((f + l) * 0.5);
|
|
||||||
aProjector1.Perform(PMid);
|
|
||||||
|
|
||||||
if(aProjector1.IsDone()) {
|
|
||||||
aProjector1.LowerDistanceParameters(U, V);
|
|
||||||
gp_Pnt2d pmidproj(U, V);
|
|
||||||
gp_Pnt2d pmidcurve2d = C2d->Value((f + l) * 0.5);
|
|
||||||
Standard_Real adist = pmidcurve2d.Distance(pmidproj);
|
|
||||||
Tol = (adist > Tol) ? adist : Tol;
|
|
||||||
}
|
|
||||||
// compute reached tolerance.end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
if (S->IsUPeriodic() && !C2d.IsNull()) {
|
|
||||||
// Recadre dans le domaine UV de la face
|
|
||||||
Standard_Real aTm, U0, aEps, period, du, U0x;
|
|
||||||
Standard_Boolean bAdjust;
|
|
||||||
//
|
|
||||||
aEps = Precision::PConfusion();
|
|
||||||
period = S->UPeriod();
|
|
||||||
//
|
|
||||||
aTm = .5*(f + l);
|
|
||||||
gp_Pnt2d pm = C2d->Value(aTm);
|
|
||||||
U0 = pm.X();
|
|
||||||
//
|
|
||||||
bAdjust =
|
|
||||||
GeomInt::AdjustPeriodic(U0, umin, umax, period, U0x, du, aEps);
|
|
||||||
if (bAdjust) {
|
|
||||||
gp_Vec2d T1(du, 0.);
|
|
||||||
C2d->Translate(T1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Parameters
|
//function : Parameters
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -2524,26 +2556,30 @@ Handle(Geom2d_BSplineCurve) MakeBSpline2d(const Handle(IntPatch_WLine)& theWLine
|
|||||||
//
|
//
|
||||||
if(!isuperiodic && enlarge) {
|
if(!isuperiodic && enlarge) {
|
||||||
|
|
||||||
if((theumin - uinf) > delta )
|
if(!Precision::IsInfinite(theumin) &&
|
||||||
|
((theumin - uinf) > delta))
|
||||||
theumin -= delta;
|
theumin -= delta;
|
||||||
else {
|
else {
|
||||||
theumin = uinf;
|
theumin = uinf;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((usup - theumax) > delta )
|
if(!Precision::IsInfinite(theumax) &&
|
||||||
|
((usup - theumax) > delta))
|
||||||
theumax += delta;
|
theumax += delta;
|
||||||
else
|
else
|
||||||
theumax = usup;
|
theumax = usup;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if(!isvperiodic && enlarge) {
|
if(!isvperiodic && enlarge) {
|
||||||
if((thevmin - vinf) > delta ) {
|
if(!Precision::IsInfinite(thevmin) &&
|
||||||
|
((thevmin - vinf) > delta)) {
|
||||||
thevmin -= delta;
|
thevmin -= delta;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
thevmin = vinf;
|
thevmin = vinf;
|
||||||
}
|
}
|
||||||
if((vsup - thevmax) > delta ) {
|
if(!Precision::IsInfinite(thevmax) &&
|
||||||
|
((vsup - thevmax) > delta)) {
|
||||||
thevmax += delta;
|
thevmax += delta;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -208,7 +208,8 @@ void TopOpeBRep_FacesIntersector::Perform(const TopoDS_Shape& F1,const TopoDS_Sh
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
myIntersector.SetTolerances(myTol1,myTol2,MaxUV,Deflection);
|
myIntersector.SetTolerances(myTol1,myTol2,MaxUV,Deflection);
|
||||||
myIntersector.Perform(mySurface1,myDomain1,mySurface2,myDomain2,myTol1,myTol2);
|
myIntersector.Perform(mySurface1,myDomain1,mySurface2,myDomain2,
|
||||||
|
myTol1,myTol2,Standard_True,Standard_True);
|
||||||
|
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
if (TopOpeBRepTool_GettraceKRO()) KRO_DSFILLER_INTFF.Stop();
|
if (TopOpeBRepTool_GettraceKRO()) KRO_DSFILLER_INTFF.Stop();
|
||||||
|
@ -95,10 +95,8 @@ inline Standard_Real gp_Lin2d::SquareDistance (const gp_Pnt2d& P) const
|
|||||||
inline Standard_Real gp_Lin2d::SquareDistance (const gp_Lin2d& Other) const
|
inline Standard_Real gp_Lin2d::SquareDistance (const gp_Lin2d& Other) const
|
||||||
{
|
{
|
||||||
Standard_Real D = 0.0;
|
Standard_Real D = 0.0;
|
||||||
if (pos.IsParallel (Other.pos, gp::Resolution())) {
|
if (pos.IsParallel (Other.pos, gp::Resolution()))
|
||||||
D = Other.Distance(pos.Location());
|
D = Other.SquareDistance(pos.Location());
|
||||||
D *= D;return D * D;
|
|
||||||
}
|
|
||||||
return D;
|
return D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,4 +7,4 @@ restore [locate_data_file CTO904_cts20280b.rle] b
|
|||||||
bop a b
|
bop a b
|
||||||
bopsection result
|
bopsection result
|
||||||
|
|
||||||
set length 546.82
|
set length 530.82
|
||||||
|
@ -2,4 +2,4 @@ restore [locate_data_file CIN001_a15.rle] a
|
|||||||
restore [locate_data_file CIN001_b15.rle] b
|
restore [locate_data_file CIN001_b15.rle] b
|
||||||
bsection result a b
|
bsection result a b
|
||||||
|
|
||||||
set length 546.82
|
set length 530.82
|
||||||
|
@ -6,6 +6,8 @@ puts ""
|
|||||||
# Wrong intersection curves obtained for a surface of revolution and a plane.
|
# Wrong intersection curves obtained for a surface of revolution and a plane.
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
|
set GoodNbCurv 1
|
||||||
|
|
||||||
restore [locate_data_file bug24650_fz1365.brep] b1
|
restore [locate_data_file bug24650_fz1365.brep] b1
|
||||||
restore [locate_data_file bug24650_fz2495.brep] b2
|
restore [locate_data_file bug24650_fz2495.brep] b2
|
||||||
|
|
||||||
@ -13,22 +15,67 @@ mksurface sb1 b1
|
|||||||
mksurface sb2 b2
|
mksurface sb2 b2
|
||||||
trimu sb1tu sb1 0.242 0.291
|
trimu sb1tu sb1 0.242 0.291
|
||||||
|
|
||||||
set N [intersect i sb1tu sb2]
|
clear
|
||||||
|
|
||||||
if { [llength ${N}] != 1} {
|
set N [intersect res sb1tu sb2]
|
||||||
puts "Error : Wrong intersection curves"
|
|
||||||
|
set che [whatis res]
|
||||||
|
set ind [string first "3d curve" $che]
|
||||||
|
if {${ind} >= 0} {
|
||||||
|
#Only variable "res" exists
|
||||||
|
renamevar res res_1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
set ic 1
|
||||||
|
set AllowRepeate 1
|
||||||
|
while { $AllowRepeate != 0 } {
|
||||||
|
set che [whatis res_$ic]
|
||||||
|
set ind [string first "3d curve" $che]
|
||||||
|
if {${ind} < 0} {
|
||||||
|
set AllowRepeate 0
|
||||||
|
} else {
|
||||||
|
display res_$ic
|
||||||
|
|
||||||
|
bounds res_$ic U1 U2
|
||||||
|
|
||||||
|
dval U1
|
||||||
|
dval U2
|
||||||
|
|
||||||
|
if {[dval U2-U1] < 1.0e-20} {
|
||||||
|
puts "Error: Wrong curve's range!"
|
||||||
|
}
|
||||||
|
|
||||||
|
dlog reset
|
||||||
|
dlog on
|
||||||
|
xdistcs res_$ic sb1tu U1 U2 10
|
||||||
|
set Log1 [dlog get]
|
||||||
|
set List1 [split ${Log1} {TD= \t\n}]
|
||||||
|
set Tolerance 1.0e-7
|
||||||
|
set Limit_Tol 1.0e-7
|
||||||
|
set D_good 0.
|
||||||
|
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
|
||||||
|
|
||||||
|
dlog reset
|
||||||
|
dlog on
|
||||||
|
xdistcs res_$ic sb2 U1 U2 10
|
||||||
|
set Log1 [dlog get]
|
||||||
|
set List1 [split ${Log1} {TD= \t\n}]
|
||||||
|
set Tolerance 1.0e-7
|
||||||
|
set Limit_Tol 1.0e-7
|
||||||
|
set D_good 0.
|
||||||
|
checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
|
||||||
|
|
||||||
|
incr ic
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if {[expr {$ic - 1}] == $GoodNbCurv} {
|
||||||
|
puts "OK: Curve Number is good!"
|
||||||
} else {
|
} else {
|
||||||
set info1 [dump i]
|
puts "Error: Curve Number is bad!"
|
||||||
set type_of_curve "BSplineCurve"
|
|
||||||
if { [regexp ${type_of_curve} ${info1}] != 1 } {
|
|
||||||
puts "Error : Wrong type of intersection curve"
|
|
||||||
} else {
|
|
||||||
puts "OK : Good type of intersection curve"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
smallview
|
smallview
|
||||||
donly i
|
|
||||||
fit
|
fit
|
||||||
set only_screen_axo 1
|
set only_screen_axo 1
|
||||||
|
|
||||||
|
124
tests/bugs/modalg_5/bug25416_1
Normal file
124
tests/bugs/modalg_5/bug25416_1
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
puts "================"
|
||||||
|
puts "OCC25416"
|
||||||
|
puts "================"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Wrong section curve
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
# Check if list of xdistcs-command is valid
|
||||||
|
proc checkList {List Tolerance D_good Limit_Tol} {
|
||||||
|
set L1 [llength ${List}]
|
||||||
|
set L2 10
|
||||||
|
set L3 5
|
||||||
|
set N [expr (${L1} - ${L2})/${L3} + 1]
|
||||||
|
|
||||||
|
for {set i 1} {${i} <= ${N}} {incr i} {
|
||||||
|
set j1 [expr ${L2} + (${i}-1)*${L3}]
|
||||||
|
set j2 [expr ${j1} + 2]
|
||||||
|
set T [lindex ${List} ${j1}]
|
||||||
|
set D [lindex ${List} ${j2}]
|
||||||
|
#puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}"
|
||||||
|
if { [expr abs(${D} - ${D_good})] > ${Tolerance} } {
|
||||||
|
puts "Error: T=${T} D=${D}"
|
||||||
|
}
|
||||||
|
|
||||||
|
if { ${Tolerance} > ${Limit_Tol} } {
|
||||||
|
if { [expr abs(${D} - ${D_good})] > ${Limit_Tol}
|
||||||
|
&& [expr abs(${D} - ${D_good})] <= ${Tolerance} } {
|
||||||
|
puts "Attention (critical value of tolerance) : T=${T} D=${D}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
puts "##############################"
|
||||||
|
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
|
||||||
|
puts "##############################"
|
||||||
|
puts ""
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
# bopcurves command
|
||||||
|
|
||||||
|
restore [locate_data_file bug25416_f1.brep] f1
|
||||||
|
restore [locate_data_file bug25416_f2.brep] f2
|
||||||
|
|
||||||
|
#############################
|
||||||
|
set log [bopcurves f1 f2 -2d]
|
||||||
|
#############################
|
||||||
|
|
||||||
|
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
|
||||||
|
|
||||||
|
#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid.
|
||||||
|
set MaxTol 1.e-7
|
||||||
|
|
||||||
|
#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid.
|
||||||
|
set GoodNbCurv 1
|
||||||
|
|
||||||
|
if {${Toler} > ${MaxTol}} {
|
||||||
|
puts "Error: Tolerance is too big!"
|
||||||
|
}
|
||||||
|
if {${NbCurv} != ${GoodNbCurv}} {
|
||||||
|
puts "Error: Curve Number is bad!"
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------
|
||||||
|
|
||||||
|
mksurface s1 f1
|
||||||
|
mksurface s2 f2
|
||||||
|
|
||||||
|
erase s1 s2
|
||||||
|
|
||||||
|
for {set i 1} {$i <= ${NbCurv}} {incr i} {
|
||||||
|
set log [dump c_$i]
|
||||||
|
set dumptrimres [regexp {Trimmed curve\nParameters : +([-0-9.+eE]+) +([-0-9.+eE]+)} ${log} full U1 U2]
|
||||||
|
|
||||||
|
if {${dumptrimres} == 0} {
|
||||||
|
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
|
||||||
|
|
||||||
|
puts "Degree=${Degree}"
|
||||||
|
puts "Poles=${Poles}"
|
||||||
|
puts "KnotsPoles=${KnotsPoles}"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
set Knot 1
|
||||||
|
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
|
||||||
|
regexp ${exp_string} ${log} full U1 Mult1
|
||||||
|
|
||||||
|
set Knot ${KnotsPoles}
|
||||||
|
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
|
||||||
|
regexp ${exp_string} ${log} full U2 Mult2
|
||||||
|
}
|
||||||
|
|
||||||
|
puts "U1=${U1}"
|
||||||
|
puts "U2=${U2}"
|
||||||
|
|
||||||
|
if {[expr {$U2 - $U1}] < 1.0e-20} {
|
||||||
|
puts "Error: Wrong curve's range!"
|
||||||
|
}
|
||||||
|
|
||||||
|
dlog reset
|
||||||
|
dlog on
|
||||||
|
xdistcs c_$i s1 ${U1} ${U2} 10
|
||||||
|
set Log2 [dlog get]
|
||||||
|
set List2 [split ${Log2} {TD= \t\n}]
|
||||||
|
set Tolerance 1.0e-7
|
||||||
|
set Limit_Tol 1.0e-7
|
||||||
|
set D_good 0.
|
||||||
|
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
|
||||||
|
|
||||||
|
dlog reset
|
||||||
|
dlog on
|
||||||
|
xdistcs c_$i s2 ${U1} ${U2} 10
|
||||||
|
set Log2 [dlog get]
|
||||||
|
set List2 [split ${Log2} {TD= \t\n}]
|
||||||
|
set Tolerance 1.0e-7
|
||||||
|
set Limit_Tol 1.0e-7
|
||||||
|
set D_good 0.
|
||||||
|
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
|
||||||
|
}
|
||||||
|
|
||||||
|
smallview
|
||||||
|
fit
|
||||||
|
set only_screen_axo 1
|
127
tests/bugs/modalg_5/bug25416_2
Normal file
127
tests/bugs/modalg_5/bug25416_2
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
puts "================"
|
||||||
|
puts "OCC25416"
|
||||||
|
puts "================"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Wrong section curve
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
# Check if list of xdistcs-command is valid
|
||||||
|
proc checkList {List Tolerance D_good Limit_Tol} {
|
||||||
|
set L1 [llength ${List}]
|
||||||
|
set L2 10
|
||||||
|
set L3 5
|
||||||
|
set N [expr (${L1} - ${L2})/${L3} + 1]
|
||||||
|
|
||||||
|
for {set i 1} {${i} <= ${N}} {incr i} {
|
||||||
|
set j1 [expr ${L2} + (${i}-1)*${L3}]
|
||||||
|
set j2 [expr ${j1} + 2]
|
||||||
|
set T [lindex ${List} ${j1}]
|
||||||
|
set D [lindex ${List} ${j2}]
|
||||||
|
#puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}"
|
||||||
|
if { [expr abs(${D} - ${D_good})] > ${Tolerance} } {
|
||||||
|
puts "Error: T=${T} D=${D}"
|
||||||
|
}
|
||||||
|
|
||||||
|
if { ${Tolerance} > ${Limit_Tol} } {
|
||||||
|
if { [expr abs(${D} - ${D_good})] > ${Limit_Tol}
|
||||||
|
&& [expr abs(${D} - ${D_good})] <= ${Tolerance} } {
|
||||||
|
puts "Attention (critical value of tolerance) : T=${T} D=${D}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
puts "##############################"
|
||||||
|
puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
|
||||||
|
puts "##############################"
|
||||||
|
puts ""
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
# bopcurves command
|
||||||
|
|
||||||
|
restore [locate_data_file bug25416_f3.brep] f1
|
||||||
|
restore [locate_data_file bug25416_f4.brep] f2
|
||||||
|
|
||||||
|
mksurface s1 f1
|
||||||
|
mksurface s2 f2
|
||||||
|
|
||||||
|
#Trim according to "xbounds f1"
|
||||||
|
trim s1 s1 -55.44 150.554 -98.1087 79.1766
|
||||||
|
|
||||||
|
mkface ff1 s1
|
||||||
|
donly ff1 f2
|
||||||
|
|
||||||
|
#############################
|
||||||
|
set log [bopcurves ff1 f2]
|
||||||
|
#############################
|
||||||
|
|
||||||
|
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
|
||||||
|
|
||||||
|
#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid.
|
||||||
|
set MaxTol 1.e-7
|
||||||
|
|
||||||
|
#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid.
|
||||||
|
set GoodNbCurv 2
|
||||||
|
|
||||||
|
if {${Toler} > ${MaxTol}} {
|
||||||
|
puts "Error: Tolerance is too big!"
|
||||||
|
}
|
||||||
|
if {${NbCurv} != ${GoodNbCurv}} {
|
||||||
|
puts "Error: Curve Number is bad!"
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------
|
||||||
|
|
||||||
|
for {set i 1} {$i <= ${NbCurv}} {incr i} {
|
||||||
|
set log [dump c_$i]
|
||||||
|
set dumptrimres [regexp {Trimmed curve\nParameters : +([-0-9.+eE]+) +([-0-9.+eE]+)} ${log} full U1 U2]
|
||||||
|
|
||||||
|
if {${dumptrimres} == 0} {
|
||||||
|
regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
|
||||||
|
|
||||||
|
puts "Degree=${Degree}"
|
||||||
|
puts "Poles=${Poles}"
|
||||||
|
puts "KnotsPoles=${KnotsPoles}"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
set Knot 1
|
||||||
|
set exp_string "Knots :\n\n +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
|
||||||
|
regexp ${exp_string} ${log} full U1 Mult1
|
||||||
|
|
||||||
|
set Knot ${KnotsPoles}
|
||||||
|
set exp_string " +${Knot} : +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
|
||||||
|
regexp ${exp_string} ${log} full U2 Mult2
|
||||||
|
}
|
||||||
|
|
||||||
|
puts "U1=${U1}"
|
||||||
|
puts "U2=${U2}"
|
||||||
|
|
||||||
|
if {[expr {$U2 - $U1}] < 1.0e-20} {
|
||||||
|
puts "Error: Wrong curve's range!"
|
||||||
|
}
|
||||||
|
|
||||||
|
dlog reset
|
||||||
|
dlog on
|
||||||
|
xdistcs c_$i s1 ${U1} ${U2} 10
|
||||||
|
set Log2 [dlog get]
|
||||||
|
set List2 [split ${Log2} {TD= \t\n}]
|
||||||
|
set Tolerance 1.0e-7
|
||||||
|
set Limit_Tol 1.0e-7
|
||||||
|
set D_good 0.
|
||||||
|
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
|
||||||
|
|
||||||
|
dlog reset
|
||||||
|
dlog on
|
||||||
|
xdistcs c_$i s2 ${U1} ${U2} 10
|
||||||
|
set Log2 [dlog get]
|
||||||
|
set List2 [split ${Log2} {TD= \t\n}]
|
||||||
|
set Tolerance 1.0e-7
|
||||||
|
set Limit_Tol 1.0e-7
|
||||||
|
set D_good 0.
|
||||||
|
checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
|
||||||
|
}
|
||||||
|
|
||||||
|
smallview
|
||||||
|
fit
|
||||||
|
set only_screen_axo 1
|
44
tests/bugs/modalg_5/bug25416_3
Normal file
44
tests/bugs/modalg_5/bug25416_3
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
puts "================"
|
||||||
|
puts "OCC25416"
|
||||||
|
puts "================"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Wrong section curve
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
#Check if intersection algorithm produces overlapped curves
|
||||||
|
|
||||||
|
restore [locate_data_file bug25416_s1.brep] s1
|
||||||
|
restore [locate_data_file bug25416_s2.brep] s2
|
||||||
|
|
||||||
|
set ll [intersect ii s1 s2]
|
||||||
|
|
||||||
|
set status 0
|
||||||
|
if { [llength $ll] < 1 } {
|
||||||
|
set status 1
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach i $ll {
|
||||||
|
foreach j $ll {
|
||||||
|
if { $i >= $j } continue
|
||||||
|
|
||||||
|
decho off
|
||||||
|
mkedge e1 $i
|
||||||
|
mkedge e2 $j
|
||||||
|
set coe [checkoverlapedges e1 e2]
|
||||||
|
decho on
|
||||||
|
|
||||||
|
puts "$i<->$j: $coe"
|
||||||
|
if { [regexp "Edges is not overlaped" $coe] != 1 } {
|
||||||
|
set status 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
decho on
|
||||||
|
|
||||||
|
if { $status != 0 } {
|
||||||
|
puts "Wrong section. Error with code $status"
|
||||||
|
} else {
|
||||||
|
puts "OK: Good section"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user