Standard_EXPORT void TolFixTangents (Standard_Real& aTolCheck, Standard_Real& aTolAngCheck);
+ //! Set angular tolerance
+ Standard_EXPORT void SetAngularTolerance (Standard_Real theAngularTolerance);
+
//! converts RLine to Geom(2d)_Curve.
Standard_EXPORT static void TreatRLine (const Handle(IntPatch_RLine)& theRL, const Handle(GeomAdaptor_Surface)& theHS1, const Handle(GeomAdaptor_Surface)& theHS2, Handle(Geom_Curve)& theC3d, Handle(Geom2d_Curve)& theC2d1, Handle(Geom2d_Curve)& theC2d2, Standard_Real& theTolReached);
{
return myIntersector.Point(Index).Value();
}
+
+//=======================================================================
+//function : SetAngularTolerance
+//purpose :
+//=======================================================================
+inline void GeomInt_IntSS::SetAngularTolerance (Standard_Real theAngularTolerance)
+{
+ myIntersector.SetAngularTolerance(theAngularTolerance);
+}
//purpose : Empty constructor
//=======================================================================
IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(void)
- : done(Standard_False),
- nbint(0),
- typeres(IntAna_Empty),
- pt1(0,0,0),
- pt2(0,0,0),
- pt3(0,0,0),
- pt4(0,0,0),
- param1(0),
- param2(0),
- param3(0),
- param4(0),
- param1bis(0),
- param2bis(0),
- myCommonGen(Standard_False),
- myPChar(0,0,0)
+: done(Standard_False),
+ nbint(0),
+ typeres(IntAna_Empty),
+ pt1(0,0,0),
+ pt2(0,0,0),
+ pt3(0,0,0),
+ pt4(0,0,0),
+ param1(0),
+ param2(0),
+ param3(0),
+ param4(0),
+ param1bis(0),
+ param2bis(0),
+ myCommonGen(Standard_False),
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
+{
+ InitTolerances();
+}
+
+//=======================================================================
+//function : IntAna_QuadQuadGeo
+//purpose : Constructor with angular tolerance
+//=======================================================================
+IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(Standard_Real theAngularTolerance, Standard_Boolean theUseAngularTolerance)
+: done(Standard_False),
+ nbint(0),
+ typeres(IntAna_Empty),
+ pt1(0,0,0),
+ pt2(0,0,0),
+ pt3(0,0,0),
+ pt4(0,0,0),
+ param1(0),
+ param2(0),
+ param3(0),
+ param4(0),
+ param1bis(0),
+ param2bis(0),
+ myCommonGen(Standard_False),
+ myPChar(0,0,0),
+ myAngularTolerance(theAngularTolerance),
+ myUseAngularTolerance(theUseAngularTolerance)
{
InitTolerances();
}
+
//=======================================================================
//function : InitTolerances
//purpose :
void IntAna_QuadQuadGeo::InitTolerances()
{
myEPSILON_DISTANCE = 1.0e-14;
- myEPSILON_ANGLE_CONE = Precision::Angular();
+ if (myUseAngularTolerance)
+ {
+ myEPSILON_ANGLE_CONE = myAngularTolerance;
+ }
+ else
+ {
+ myEPSILON_ANGLE_CONE = Precision::Angular();
+ }
myEPSILON_MINI_CIRCLE_RADIUS = 0.01*Precision::Confusion();
myEPSILON_CYLINDER_DELTA_RADIUS = 1.0e-13;
myEPSILON_CYLINDER_DELTA_DISTANCE= Precision::Confusion();
myEPSILON_AXES_PARA = Precision::Angular();
}
+
//=======================================================================
//function : IntAna_QuadQuadGeo
//purpose : Pln Pln
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(P1,P2,TolAng,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(P,Co,Tolang,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(P,S);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(Cyl1,Cyl2,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(Cyl,Con,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(Cyl,Sph,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(Con1,Con2,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(Sph,Con,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(Sph1,Sph2,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(Pln,Tor,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(Cyl,Tor,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(Con,Tor,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(Sph,Tor,Tol);
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
- myPChar(0,0,0)
+ myPChar(0,0,0),
+ myAngularTolerance(0.0),
+ myUseAngularTolerance(Standard_False)
{
InitTolerances();
Perform(Tor1,Tor2,Tol);
{
return myPChar;
}
+
//=======================================================================
//function : RefineDir
//purpose :
//! Empty constructor.
Standard_EXPORT IntAna_QuadQuadGeo();
+ //! Constructor with angular tolerance
+ Standard_EXPORT IntAna_QuadQuadGeo(Standard_Real theAngularTolerance, Standard_Boolean theUseAngularTolerance);
+
//! Creates the intersection between two planes.
//! TolAng is the angular tolerance used to determine
//! if the planes are parallel.
Standard_Real myEPSILON_AXES_PARA;
Standard_Boolean myCommonGen;
gp_Pnt myPChar;
-
+ Standard_Real myAngularTolerance;
+ Standard_Boolean myUseAngularTolerance;
private:
//! An exception is raised if Index<=0 or Index>NbLine.
const Handle(IntPatch_Line)& Line (const Standard_Integer Index) const;
-
-
+ //! Sets the angular tolerance
+ void SetAngularTolerance (Standard_Real theAngularTolerance);
protected:
IntPatch_SequenceOfPoint spnt;
IntPatch_SequenceOfLine slin;
IntPatch_TheSOnBounds solrst;
-
+ Standard_Real myAngularTolerance;
+ Standard_Boolean myUseAngularTolerance;
};
if (!IsDone ()) { throw StdFail_NotDone(); }
return slin(Index);
}
+
+inline void IntPatch_ImpImpIntersection::SetAngularTolerance (Standard_Real theAngularTolerance)
+{
+ myAngularTolerance = theAngularTolerance;
+ myUseAngularTolerance = Standard_True;
+}
Standard_Boolean&,
Standard_Boolean&,
IntPatch_SequenceOfLine&,
- IntPatch_SequenceOfPoint&);
+ IntPatch_SequenceOfPoint&,
+ Standard_Boolean theUseAngularTolerance = Standard_False,
+ Standard_Real theAngularTolerance = 0.0);
//torus
static Standard_Boolean IntPTo(const IntSurf_Quadric&,
myDone(IntStatus_Fail),
empt(Standard_True),
tgte(Standard_False),
-oppo(Standard_False)
+oppo(Standard_False),
+myUseAngularTolerance(Standard_False)
{
}
//=======================================================================
}
//
case 33: { // Cone/Cone
- if (!IntCoCo(quad1, quad2, TolTang, empt, SameSurf, multpoint, slin, spnt)) {
+ if (!IntCoCo(quad1, quad2, TolTang, empt, SameSurf, multpoint, slin, spnt, myUseAngularTolerance, myAngularTolerance)) {
return;
}
bEmpty = empt;
Standard_Boolean& Same,
Standard_Boolean& Multpoint,
IntPatch_SequenceOfLine& slin,
- IntPatch_SequenceOfPoint& spnt)
+ IntPatch_SequenceOfPoint& spnt,
+ Standard_Boolean theUseAngularTolerance,
+ Standard_Real theAngularTolerance)
{
Standard_Integer i, NbSol;
gp_Cone Co1(Quad1.Cone());
gp_Cone Co2(Quad2.Cone());
//
- IntAna_QuadQuadGeo inter(Co1,Co2,Tol);
+ IntAna_QuadQuadGeo inter(theAngularTolerance, theUseAngularTolerance);
+ inter.Perform(Co1,Co2,Tol);
if (!inter.IsDone()) {
return Standard_False;
}
myU1Start(0.0),
myV1Start(0.0),
myU2Start(0.0),
- myV2Start(0.0)
+ myV2Start(0.0),
+ myUseAngularTolerance(Standard_False)
{
}
myU1Start(0.0),
myV1Start(0.0),
myU2Start(0.0),
- myV2Start(0.0)
+ myV2Start(0.0),
+ myUseAngularTolerance(Standard_False)
{
if(myTolArc<1e-8) myTolArc=1e-8;
if(myTolTang<1e-8) myTolTang=1e-8;
myU1Start(0.0),
myV1Start(0.0),
myU2Start(0.0),
- myV2Start(0.0)
+ myV2Start(0.0),
+ myUseAngularTolerance(Standard_False)
{
Perform(S1,D1,TolArc,TolTang);
}
if(myUVMaxStep>0.5) myUVMaxStep=0.5;
}
+void IntPatch_Intersection::SetAngularTolerance (Standard_Real theAngularTolerance)
+{
+ myAngularTolerance = theAngularTolerance;
+ myUseAngularTolerance = Standard_True;
+}
+
//======================================================================
// function: Perform
//======================================================================
const GeomAbs_SurfaceType theTyps2,
const Standard_Boolean theIsReqToKeepRLine)
{
- IntPatch_ImpImpIntersection interii(theS1,theD1,theS2,theD2,
- myTolArc,myTolTang, theIsReqToKeepRLine);
+ IntPatch_ImpImpIntersection interii;
+
+ if (myUseAngularTolerance)
+ {
+ interii.SetAngularTolerance(myAngularTolerance);
+ }
+ interii.Perform(theS1, theD1, theS2, theD2, myTolArc, myTolTang, theIsReqToKeepRLine);
if (!interii.IsDone())
{
//! points in their respective parametric spaces.
Standard_EXPORT void SetTolerances (const Standard_Real TolArc, const Standard_Real TolTang, const Standard_Real UVMaxStep, const Standard_Real Fleche);
+ Standard_EXPORT void SetAngularTolerance (Standard_Real theAngularTolerance);
+
//! Flag theIsReqToKeepRLine has been entered only for
//! compatibility with TopOpeBRep package. It shall be deleted
//! after deleting TopOpeBRep.
Standard_Real myV1Start;
Standard_Real myU2Start;
Standard_Real myV2Start;
-
+ Standard_Real myAngularTolerance;
+ Standard_Boolean myUseAngularTolerance;
};