mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0022851: No intersection curve between two surfaces
This commit is contained in:
parent
3e42bd70cf
commit
fa9681ca7a
@ -765,7 +765,6 @@ Standard_Boolean Adaptor3d_TopolTool::DomainIsInfinite() {
|
|||||||
if(Precision::IsPositiveInfinite(Vsup)) return(Standard_True);
|
if(Precision::IsPositiveInfinite(Vsup)) return(Standard_True);
|
||||||
return(Standard_False);
|
return(Standard_False);
|
||||||
}
|
}
|
||||||
//modified by NIZNHY-PKV Mon Apr 23 16:00:31 2001 f
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Edge
|
//function : Edge
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -774,8 +773,6 @@ Standard_Boolean Adaptor3d_TopolTool::DomainIsInfinite() {
|
|||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
//modified by NIZNHY-PKV Mon Apr 23 16:00:35 2001 t
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Has3d
|
//function : Has3d
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -1211,8 +1208,52 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
|||||||
myNbSamplesV = myMinPnts;
|
myNbSamplesV = myMinPnts;
|
||||||
aVFlg(j) = Standard_True;
|
aVFlg(j) = Standard_True;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
//modified by NIZNHY-PKV Fri Dec 16 10:05:01 2011f
|
||||||
|
//
|
||||||
|
Standard_Boolean bFlag;
|
||||||
|
//
|
||||||
|
// U
|
||||||
|
bFlag=(myNbSamplesU < theNUmin);
|
||||||
|
if (bFlag) {
|
||||||
|
myNbSamplesU=nbsu;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
myUPars = new TColStd_HArray1OfReal(1, myNbSamplesU);
|
||||||
|
//
|
||||||
|
for(j = 0, i = 1; i <= nbsu; ++i) {
|
||||||
|
if (bFlag) {
|
||||||
|
myUPars->SetValue(i,anUPars(i));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(anUFlg(i)) {
|
||||||
|
++j;
|
||||||
|
myUPars->SetValue(j,anUPars(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// V
|
||||||
|
bFlag=(myNbSamplesV < theNVmin);
|
||||||
|
if (bFlag) {
|
||||||
|
myNbSamplesV=nbsv;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
myVPars = new TColStd_HArray1OfReal(1, myNbSamplesV);
|
||||||
|
//
|
||||||
|
for(j = 0, i = 1; i <= nbsv; ++i) {
|
||||||
|
if (bFlag) {
|
||||||
|
myVPars->SetValue(i,aVPars(i));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(aVFlg(i)) {
|
||||||
|
++j;
|
||||||
|
myVPars->SetValue(j,aVPars(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
/*
|
||||||
myUPars = new TColStd_HArray1OfReal(1, myNbSamplesU);
|
myUPars = new TColStd_HArray1OfReal(1, myNbSamplesU);
|
||||||
myVPars = new TColStd_HArray1OfReal(1, myNbSamplesV);
|
myVPars = new TColStd_HArray1OfReal(1, myNbSamplesV);
|
||||||
|
|
||||||
@ -1231,10 +1272,15 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
|||||||
myVPars->SetValue(j,aVPars(i));
|
myVPars->SetValue(j,aVPars(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
//modified by NIZNHY-PKV Mon Dec 26 12:25:35 2011t
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsUniformSampling
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
Standard_Boolean Adaptor3d_TopolTool::IsUniformSampling() const
|
Standard_Boolean Adaptor3d_TopolTool::IsUniformSampling() const
|
||||||
{
|
{
|
||||||
GeomAbs_SurfaceType typS = myS->GetType();
|
GeomAbs_SurfaceType typS = myS->GetType();
|
||||||
|
@ -3,60 +3,42 @@
|
|||||||
// Author: Peter KURNEV
|
// Author: Peter KURNEV
|
||||||
// <pkv@irinox>
|
// <pkv@irinox>
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <IntTools_EdgeEdge.ixx>
|
#include <IntTools_EdgeEdge.ixx>
|
||||||
|
|
||||||
#include <BRep_Tool.hxx>
|
#include <Precision.hxx>
|
||||||
|
|
||||||
#include <GCPnts_QuasiUniformDeflection.hxx>
|
|
||||||
|
|
||||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
|
||||||
#include <GeomAPI_ExtremaCurveCurve.hxx>
|
|
||||||
|
|
||||||
#include <TColStd_ListOfReal.hxx>
|
|
||||||
#include <TColStd_ListIteratorOfListOfReal.hxx>
|
|
||||||
#include <TColStd_MapOfInteger.hxx>
|
|
||||||
#include <TColStd_ListOfReal.hxx>
|
|
||||||
#include <TColStd_SequenceOfReal.hxx>
|
#include <TColStd_SequenceOfReal.hxx>
|
||||||
|
|
||||||
#include <IntTools.hxx>
|
|
||||||
#include <IntTools_Range.hxx>
|
|
||||||
#include <IntTools_CArray1OfInteger.hxx>
|
|
||||||
#include <IntTools_CArray1OfReal.hxx>
|
|
||||||
#include <IntTools_Array1OfRange.hxx>
|
|
||||||
#include <IntTools_QuickSortRange.hxx>
|
|
||||||
#include <IntTools_CompareRange.hxx>
|
|
||||||
#include <IntTools_Root.hxx>
|
|
||||||
#include <IntTools_Array1OfRoots.hxx>
|
|
||||||
#include <IntTools_Compare.hxx>
|
|
||||||
#include <IntTools_QuickSort.hxx>
|
|
||||||
#include <IntTools_Root.hxx>
|
|
||||||
#include <IntTools_CommonPrt.hxx>
|
|
||||||
#include <IntTools_SequenceOfRanges.hxx>
|
|
||||||
|
|
||||||
#include <gp_Circ.hxx>
|
#include <gp_Circ.hxx>
|
||||||
#include <gp_Ax1.hxx>
|
#include <gp_Ax1.hxx>
|
||||||
#include <gp_Lin.hxx>
|
#include <gp_Lin.hxx>
|
||||||
#include <gp_Dir.hxx>
|
#include <gp_Dir.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
|
|
||||||
#include <gce_MakeCirc.hxx>
|
#include <ElCLib.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
#include <IntTools.hxx>
|
|
||||||
//
|
#include <Geom_BSplineCurve.hxx>
|
||||||
#include <Bnd_Box.hxx>
|
#include <GeomAdaptor_Curve.hxx>
|
||||||
#include <TopoDS_Vertex.hxx>
|
|
||||||
#include <TopExp.hxx>
|
|
||||||
#include <BndLib_Add3dCurve.hxx>
|
|
||||||
#include <IntTools_BeanBeanIntersector.hxx>
|
|
||||||
#include <IntTools_Tools.hxx>
|
|
||||||
|
|
||||||
#include <CPnts_AbscissaPoint.hxx>
|
#include <CPnts_AbscissaPoint.hxx>
|
||||||
#include <gp_Circ.hxx>
|
|
||||||
|
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||||
|
|
||||||
#include <Extrema_ExtElC.hxx>
|
#include <Extrema_ExtElC.hxx>
|
||||||
#include <Extrema_POnCurv.hxx>
|
#include <Extrema_POnCurv.hxx>
|
||||||
|
#include <Extrema_ExtCC.hxx>
|
||||||
|
|
||||||
#include <TopoDS_Iterator.hxx>
|
#include <TopoDS_Iterator.hxx>
|
||||||
#include <Geom_BSplineCurve.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
|
|
||||||
|
#include <IntTools.hxx>
|
||||||
|
#include <IntTools_Range.hxx>
|
||||||
|
#include <IntTools_CArray1OfReal.hxx>
|
||||||
|
#include <IntTools_CommonPrt.hxx>
|
||||||
|
#include <IntTools_SequenceOfRanges.hxx>
|
||||||
|
#include <IntTools_Tools.hxx>
|
||||||
|
#include <IntTools_BeanBeanIntersector.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IntTools_EdgeEdge::IntTools_EdgeEdge
|
//function : IntTools_EdgeEdge::IntTools_EdgeEdge
|
||||||
@ -273,7 +255,6 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//modified by NIZNHY-PKV Mon Oct 31 14:52:09 2011f
|
|
||||||
bIsSameCurves=IsSameCurves();
|
bIsSameCurves=IsSameCurves();
|
||||||
if (bIsSameCurves) {
|
if (bIsSameCurves) {
|
||||||
aCommonPrt.SetType(TopAbs_EDGE);
|
aCommonPrt.SetType(TopAbs_EDGE);
|
||||||
@ -283,7 +264,6 @@
|
|||||||
myIsDone=Standard_True;
|
myIsDone=Standard_True;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//modified by NIZNHY-PKV Mon Oct 31 14:52:11 2011t
|
|
||||||
//
|
//
|
||||||
IntTools_BeanBeanIntersector anIntersector(myCFrom, myCTo, myTolFrom, myTolTo);
|
IntTools_BeanBeanIntersector anIntersector(myCFrom, myCTo, myTolFrom, myTolTo);
|
||||||
anIntersector.SetBeanParameters(Standard_True, myTminFrom, myTmaxFrom);
|
anIntersector.SetBeanParameters(Standard_True, myTminFrom, myTmaxFrom);
|
||||||
@ -373,147 +353,7 @@
|
|||||||
//
|
//
|
||||||
myIsDone=Standard_True;
|
myIsDone=Standard_True;
|
||||||
}
|
}
|
||||||
//modified by NIZNHY-PKV Mon Oct 31 14:04:36 2011f
|
|
||||||
//=======================================================================
|
|
||||||
//function : IsSameCurves
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Boolean IntTools_EdgeEdge::IsSameCurves()
|
|
||||||
{
|
|
||||||
Standard_Boolean bRet;
|
|
||||||
GeomAbs_CurveType aCTFrom, aCTTo;
|
|
||||||
//
|
|
||||||
aCTFrom = myCFrom.GetType();
|
|
||||||
aCTTo = myCTo.GetType();
|
|
||||||
//
|
|
||||||
bRet = (aCTFrom==aCTTo);
|
|
||||||
if (!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
bRet=Standard_False;
|
|
||||||
//
|
|
||||||
if (aCTTo==GeomAbs_BSplineCurve) {
|
|
||||||
Standard_Boolean bIsRational, bIsPreiodic;
|
|
||||||
Standard_Integer iNbPoles, iNbKnots, iDegree;
|
|
||||||
Standard_Real dT, aEpsilon;
|
|
||||||
//
|
|
||||||
aEpsilon=Epsilon(myTminFrom);
|
|
||||||
dT=myTminFrom-myTminTo;
|
|
||||||
bRet=(fabs(dT)<aEpsilon);
|
|
||||||
if (!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
aEpsilon=Epsilon(myTmaxFrom);
|
|
||||||
dT=myTmaxFrom-myTmaxTo;
|
|
||||||
bRet=(fabs(dT)<aEpsilon);
|
|
||||||
if (!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
bIsRational=myCFrom.IsRational();
|
|
||||||
bRet=(bIsRational==myCTo.IsRational());
|
|
||||||
if (!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
iNbPoles=myCFrom.NbPoles();
|
|
||||||
bRet=(iNbPoles==myCTo.NbPoles());
|
|
||||||
if (!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
iNbKnots=myCFrom.NbKnots();
|
|
||||||
bRet=(iNbKnots==myCTo.NbKnots());
|
|
||||||
if (!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
iDegree=myCFrom.Degree();
|
|
||||||
bRet=(iDegree==myCTo.Degree());
|
|
||||||
if (!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
bIsPreiodic=myCFrom.IsPeriodic();
|
|
||||||
bRet=(bIsPreiodic==myCTo.IsPeriodic());
|
|
||||||
if (!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//-------------------------------------------
|
|
||||||
Standard_Integer i, j, aM[2];
|
|
||||||
Standard_Real aT1[2], aT2[2], aX0[4], aX1[4];
|
|
||||||
gp_Pnt aP;
|
|
||||||
Handle(Geom_Curve) aC;
|
|
||||||
Handle(Geom_BSplineCurve) aBSp[2];
|
|
||||||
TopoDS_Edge aE[2];
|
|
||||||
//
|
|
||||||
aE[0]=myCFrom.Edge();
|
|
||||||
aE[1]=myCTo.Edge();
|
|
||||||
//
|
|
||||||
aC=BRep_Tool::Curve (aE[0], aT1[0], aT2[0]);
|
|
||||||
aBSp[0]=Handle(Geom_BSplineCurve)::DownCast(aC);
|
|
||||||
//
|
|
||||||
aC=BRep_Tool::Curve (aE[1], aT1[1], aT2[1]);
|
|
||||||
aBSp[1]=Handle(Geom_BSplineCurve)::DownCast(aC);
|
|
||||||
//
|
|
||||||
aEpsilon=Epsilon(aT1[0]);
|
|
||||||
dT=aT1[0]-aT1[1];
|
|
||||||
bRet=(fabs(dT)<aEpsilon);
|
|
||||||
if (!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
aEpsilon=Epsilon(aT2[0]);
|
|
||||||
dT=aT2[0]-aT2[1];
|
|
||||||
bRet=(fabs(dT)<aEpsilon);
|
|
||||||
if (!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// Poles / Weights
|
|
||||||
for(i=1; i<=iNbPoles; ++i) {
|
|
||||||
aP=aBSp[0]->Pole(i);
|
|
||||||
aP.Coord(aX0[0], aX0[1], aX0[2]);
|
|
||||||
aX0[3]=aBSp[0]->Weight(i);
|
|
||||||
//
|
|
||||||
aP=aBSp[1]->Pole(i);
|
|
||||||
aP.Coord(aX1[0], aX1[1], aX1[2]);
|
|
||||||
aX1[3]=aBSp[1]->Weight(i);
|
|
||||||
//
|
|
||||||
for (j=0; j<4; ++j) {
|
|
||||||
aEpsilon=Epsilon(aX0[j]);
|
|
||||||
dT=aX0[j]-aX1[j];
|
|
||||||
bRet=(fabs(dT)<aEpsilon);
|
|
||||||
if(!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}//for(i=1; i<iNbPoles; ++i) {
|
|
||||||
//
|
|
||||||
// Knots / Multiplicities
|
|
||||||
for(i=1; i<=iNbKnots; ++i) {
|
|
||||||
aX0[0]=aBSp[0]->Knot(i);
|
|
||||||
aX0[1]=aBSp[1]->Knot(i);
|
|
||||||
aEpsilon=Epsilon(aX0[0]);
|
|
||||||
dT=aX0[0]-aX0[1];
|
|
||||||
bRet=(fabs(dT)<aEpsilon);
|
|
||||||
if(!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
aM[0]=aBSp[0]->Multiplicity(i);
|
|
||||||
aM[1]=aBSp[1]->Multiplicity(i);
|
|
||||||
bRet=(aM[0]==aM[1]);
|
|
||||||
if(!bRet) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
}//for(i=1; i<=iNbKnots; ++i) {
|
|
||||||
}// if (aCTTo==GeomAbs_BSplineCurve) {
|
|
||||||
return bRet;
|
|
||||||
}
|
|
||||||
//modified by NIZNHY-PKV Mon Oct 31 14:04:40 2011t
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : CheckData
|
//function : CheckData
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -1376,12 +1216,7 @@ Standard_Boolean IntTools_EdgeEdge::IsSameCurves()
|
|||||||
// on myCTo
|
// on myCTo
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <Precision.hxx>
|
|
||||||
#include <Geom_Curve.hxx>
|
|
||||||
#include <GeomAdaptor_Curve.hxx>
|
|
||||||
#include <BRep_Tool.hxx>
|
|
||||||
#include <Extrema_ExtCC.hxx>
|
|
||||||
#include <ElCLib.hxx>
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : CheckTouchVertex
|
//function : CheckTouchVertex
|
||||||
//purpose : line/Circle refinement
|
//purpose : line/Circle refinement
|
||||||
@ -1783,3 +1618,313 @@ Standard_Boolean IntTools_EdgeEdge::IsSameCurves()
|
|||||||
mySeqOfCommonPrts.Append(aCommonPrt);
|
mySeqOfCommonPrts.Append(aCommonPrt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//modified by NIZNHY-PKV Mon Dec 26 13:44:53 2011f
|
||||||
|
static
|
||||||
|
Standard_Boolean IsSameReal(const Standard_Real aR1,
|
||||||
|
const Standard_Real aR2);
|
||||||
|
static
|
||||||
|
Standard_Boolean IsSameXYZ(const gp_XYZ& aXYZ1, const gp_XYZ& aXYZ2);
|
||||||
|
static
|
||||||
|
Standard_Boolean IsSameDir(const gp_Dir& aDir1, const gp_Dir& aDir2);
|
||||||
|
static
|
||||||
|
Standard_Boolean IsSamePnt(const gp_Pnt& aP1, const gp_Pnt& aP2);
|
||||||
|
static
|
||||||
|
Standard_Boolean IsSameAx1(const gp_Ax1& aAx1, const gp_Ax1& aAx2);
|
||||||
|
static
|
||||||
|
Standard_Boolean IsSameAx2(const gp_Ax2& aAx21, const gp_Ax2& aAx22);
|
||||||
|
static
|
||||||
|
Standard_Boolean IsSameElips(const gp_Elips& aElips1,
|
||||||
|
const gp_Elips& aElips2);
|
||||||
|
static
|
||||||
|
Standard_Boolean IsSameBSplineCurve(const BRepAdaptor_Curve& myCFrom,
|
||||||
|
const BRepAdaptor_Curve& myCTo);
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsSameCurves
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IntTools_EdgeEdge::IsSameCurves()
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
GeomAbs_CurveType aCTFrom, aCTTo;
|
||||||
|
//
|
||||||
|
aCTFrom=myCFrom.GetType();
|
||||||
|
aCTTo =myCTo.GetType();
|
||||||
|
//
|
||||||
|
bRet=(aCTFrom==aCTTo);
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bRet=IsSameReal(myTminFrom, myTminTo);
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bRet=IsSameReal(myTmaxFrom, myTmaxTo);
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bRet=!bRet; // false
|
||||||
|
//
|
||||||
|
if (aCTTo==GeomAbs_Ellipse) {
|
||||||
|
gp_Elips aC1, aC2;
|
||||||
|
//
|
||||||
|
aC1=myCFrom.Ellipse();
|
||||||
|
aC2=myCTo.Ellipse();
|
||||||
|
//
|
||||||
|
bRet=IsSameElips(aC1, aC2);
|
||||||
|
//
|
||||||
|
return bRet;
|
||||||
|
} //if (aCTTo==GeomAbs_Ellipse) {
|
||||||
|
//
|
||||||
|
else if (aCTTo==GeomAbs_BSplineCurve) {
|
||||||
|
bRet=IsSameBSplineCurve(myCFrom, myCTo);
|
||||||
|
if(!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
}// if (aCTTo==GeomAbs_BSplineCurve) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsSameBSplineCurve
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsSameBSplineCurve(const BRepAdaptor_Curve& myCFrom,
|
||||||
|
const BRepAdaptor_Curve& myCTo)
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet, bIsRational, bIsPreiodic;
|
||||||
|
Standard_Integer iNbPoles, iNbKnots, iDegree;
|
||||||
|
//
|
||||||
|
bIsRational=myCFrom.IsRational();
|
||||||
|
bRet=(bIsRational==myCTo.IsRational());
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
iNbPoles=myCFrom.NbPoles();
|
||||||
|
bRet=(iNbPoles==myCTo.NbPoles());
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
iNbKnots=myCFrom.NbKnots();
|
||||||
|
bRet=(iNbKnots==myCTo.NbKnots());
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
iDegree=myCFrom.Degree();
|
||||||
|
bRet=(iDegree==myCTo.Degree());
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bIsPreiodic=myCFrom.IsPeriodic();
|
||||||
|
bRet=(bIsPreiodic==myCTo.IsPeriodic());
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//-------------------------------------------
|
||||||
|
Standard_Integer i, j, aM[2];
|
||||||
|
Standard_Real aT1[2], aT2[2], aX0[4], aX1[4];
|
||||||
|
gp_Pnt aP;
|
||||||
|
Handle(Geom_Curve) aC;
|
||||||
|
Handle(Geom_BSplineCurve) aBSp[2];
|
||||||
|
TopoDS_Edge aE[2];
|
||||||
|
//
|
||||||
|
aE[0]=myCFrom.Edge();
|
||||||
|
aE[1]=myCTo.Edge();
|
||||||
|
//
|
||||||
|
aC=BRep_Tool::Curve (aE[0], aT1[0], aT2[0]);
|
||||||
|
aBSp[0]=Handle(Geom_BSplineCurve)::DownCast(aC);
|
||||||
|
//
|
||||||
|
aC=BRep_Tool::Curve (aE[1], aT1[1], aT2[1]);
|
||||||
|
aBSp[1]=Handle(Geom_BSplineCurve)::DownCast(aC);
|
||||||
|
//
|
||||||
|
bRet=IsSameReal(aT1[0], aT1[1]);
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bRet=IsSameReal(aT2[0], aT2[1]);
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Poles / Weights
|
||||||
|
for(i=1; i<=iNbPoles; ++i) {
|
||||||
|
aP=aBSp[0]->Pole(i);
|
||||||
|
aP.Coord(aX0[0], aX0[1], aX0[2]);
|
||||||
|
aX0[3]=aBSp[0]->Weight(i);
|
||||||
|
//
|
||||||
|
aP=aBSp[1]->Pole(i);
|
||||||
|
aP.Coord(aX1[0], aX1[1], aX1[2]);
|
||||||
|
aX1[3]=aBSp[1]->Weight(i);
|
||||||
|
//
|
||||||
|
for (j=0; j<4; ++j) {
|
||||||
|
bRet=IsSameReal(aX0[j], aX1[j]);
|
||||||
|
if(!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}//for(i=1; i<iNbPoles; ++i) {
|
||||||
|
//
|
||||||
|
// Knots / Multiplicities
|
||||||
|
for(i=1; i<=iNbKnots; ++i) {
|
||||||
|
aX0[0]=aBSp[0]->Knot(i);
|
||||||
|
aX0[1]=aBSp[1]->Knot(i);
|
||||||
|
bRet=IsSameReal(aX0[0], aX0[1]);
|
||||||
|
if(!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aM[0]=aBSp[0]->Multiplicity(i);
|
||||||
|
aM[1]=aBSp[1]->Multiplicity(i);
|
||||||
|
bRet=(aM[0]==aM[1]);
|
||||||
|
if(!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
}// for(i=1; i<=iNbKnots; ++i) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsSameElips
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsSameElips(const gp_Elips& aElips1,
|
||||||
|
const gp_Elips& aElips2)
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
Standard_Real aR1, aR2;
|
||||||
|
//
|
||||||
|
aR1=aElips1.MajorRadius();
|
||||||
|
aR2=aElips2.MajorRadius();
|
||||||
|
bRet=IsSameReal(aR1, aR2);
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aR1=aElips1.MinorRadius();
|
||||||
|
aR2=aElips2.MinorRadius();
|
||||||
|
bRet=IsSameReal(aR1, aR2);
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const gp_Ax2& aAx21=aElips1.Position();
|
||||||
|
const gp_Ax2& aAx22=aElips2.Position();
|
||||||
|
bRet=IsSameAx2(aAx21, aAx22);
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsSameAx2
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsSameAx2(const gp_Ax2& aAx21, const gp_Ax2& aAx22)
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
//
|
||||||
|
const gp_Ax1& aAx1=aAx21.Axis();
|
||||||
|
const gp_Ax1& aAx2=aAx22.Axis();
|
||||||
|
//
|
||||||
|
bRet=IsSameAx1(aAx1, aAx2);
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const gp_Dir& aDirX1=aAx21.XDirection();
|
||||||
|
const gp_Dir& aDirX2=aAx22.XDirection();
|
||||||
|
//
|
||||||
|
bRet=IsSameDir(aDirX1, aDirX2);
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
const gp_Dir& aDirY1=aAx21.YDirection();
|
||||||
|
const gp_Dir& aDirY2=aAx22.YDirection();
|
||||||
|
//
|
||||||
|
bRet=IsSameDir(aDirY1, aDirY2);
|
||||||
|
//
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsSameAx1
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsSameAx1(const gp_Ax1& aAx1, const gp_Ax1& aAx2)
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
//
|
||||||
|
const gp_Pnt& aP1=aAx1.Location();
|
||||||
|
const gp_Pnt& aP2=aAx2.Location();
|
||||||
|
//
|
||||||
|
bRet=IsSamePnt(aP1, aP2);
|
||||||
|
if (!bRet) {
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const gp_Dir& aDir1=aAx1.Direction();
|
||||||
|
const gp_Dir& aDir2=aAx2.Direction();
|
||||||
|
//
|
||||||
|
bRet=IsSameDir(aDir1, aDir2);
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsSamePnt
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsSamePnt(const gp_Pnt& aP1, const gp_Pnt& aP2)
|
||||||
|
{
|
||||||
|
const gp_XYZ& aXYZ1=aP1.XYZ();
|
||||||
|
const gp_XYZ& aXYZ2=aP2.XYZ();
|
||||||
|
return IsSameXYZ(aXYZ1, aXYZ2);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsSameDir
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsSameDir(const gp_Dir& aDir1, const gp_Dir& aDir2)
|
||||||
|
{
|
||||||
|
const gp_XYZ& aXYZ1=aDir1.XYZ();
|
||||||
|
const gp_XYZ& aXYZ2=aDir2.XYZ();
|
||||||
|
return IsSameXYZ(aXYZ1, aXYZ2);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsSameXYZ
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsSameXYZ(const gp_XYZ& aXYZ1, const gp_XYZ& aXYZ2)
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
Standard_Integer i;
|
||||||
|
Standard_Real aX1[3], aX2[3];
|
||||||
|
|
||||||
|
aXYZ1.Coord(aX1[0], aX1[1], aX1[2]);
|
||||||
|
aXYZ2.Coord(aX2[0], aX2[1], aX2[2]);
|
||||||
|
//
|
||||||
|
for (i=0; i<3; ++i) {
|
||||||
|
bRet=IsSameReal(aX1[i], aX2[i]);
|
||||||
|
if(!bRet) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsSameReal
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsSameReal(const Standard_Real aR1,
|
||||||
|
const Standard_Real aR2)
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
Standard_Real aEpsilon;
|
||||||
|
//
|
||||||
|
aEpsilon=Epsilon(aR1);
|
||||||
|
bRet=(fabs(aR1-aR2)<aEpsilon);
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//modified by NIZNHY-PKV Mon Dec 26 13:44:55 2011t
|
||||||
|
@ -108,11 +108,12 @@
|
|||||||
#include <IntTools_Context.hxx>
|
#include <IntTools_Context.hxx>
|
||||||
#include <IntSurf_ListIteratorOfListOfPntOn2S.hxx>
|
#include <IntSurf_ListIteratorOfListOfPntOn2S.hxx>
|
||||||
|
|
||||||
|
//modified by NIZNHY-PKV Mon Dec 26 13:37:52 2011f
|
||||||
//modified by NIZNHY-PKV Fri Nov 25 12:03:55 2011f
|
static
|
||||||
|
void RefineVector(gp_Vec2d& aV2D);
|
||||||
|
//modified by NIZNHY-PKV Mon Dec 26 13:37:54 2011t
|
||||||
static
|
static
|
||||||
void DumpWLine(const Handle(IntPatch_WLine)& aWLine);
|
void DumpWLine(const Handle(IntPatch_WLine)& aWLine);
|
||||||
//modified by NIZNHY-PKV Fri Nov 25 12:03:58 2011t
|
|
||||||
//
|
//
|
||||||
static
|
static
|
||||||
void TolR3d(const TopoDS_Face& ,
|
void TolR3d(const TopoDS_Face& ,
|
||||||
@ -2710,7 +2711,6 @@ Standard_Boolean IsDegeneratedZone(const gp_Pnt2d& aP2d,
|
|||||||
//=========================================================================
|
//=========================================================================
|
||||||
Handle(IntPatch_WLine) ComputePurgedWLine(const Handle(IntPatch_WLine)& theWLine) {
|
Handle(IntPatch_WLine) ComputePurgedWLine(const Handle(IntPatch_WLine)& theWLine) {
|
||||||
|
|
||||||
//modified by NIZNHY-PKV Tue Nov 29 12:14:07 2011f
|
|
||||||
Standard_Integer i, k, v, nb, nbvtx;
|
Standard_Integer i, k, v, nb, nbvtx;
|
||||||
Handle(IntPatch_WLine) aResult;
|
Handle(IntPatch_WLine) aResult;
|
||||||
nbvtx = theWLine->NbVertex();
|
nbvtx = theWLine->NbVertex();
|
||||||
@ -2727,7 +2727,6 @@ Handle(IntPatch_WLine) ComputePurgedWLine(const Handle(IntPatch_WLine)& theWLine
|
|||||||
Handle(IntPatch_WLine) aTmpWLine = theWLine;
|
Handle(IntPatch_WLine) aTmpWLine = theWLine;
|
||||||
Handle(IntSurf_LineOn2S) aLineOn2S = new IntSurf_LineOn2S();
|
Handle(IntSurf_LineOn2S) aLineOn2S = new IntSurf_LineOn2S();
|
||||||
aLocalWLine = new IntPatch_WLine(aLineOn2S, Standard_False);
|
aLocalWLine = new IntPatch_WLine(aLineOn2S, Standard_False);
|
||||||
//modified by NIZNHY-PKV Tue Nov 29 12:13:19 2011t
|
|
||||||
for(i = 1; i <= nb; i++) {
|
for(i = 1; i <= nb; i++) {
|
||||||
aLineOn2S->Add(theWLine->Point(i));
|
aLineOn2S->Add(theWLine->Point(i));
|
||||||
}
|
}
|
||||||
@ -2742,10 +2741,7 @@ Handle(IntPatch_WLine) ComputePurgedWLine(const Handle(IntPatch_WLine)& theWLine
|
|||||||
nb = aLineOn2S->NbPoints();
|
nb = aLineOn2S->NbPoints();
|
||||||
anEndIndex = (anEndIndex > nb) ? nb : anEndIndex;
|
anEndIndex = (anEndIndex > nb) ? nb : anEndIndex;
|
||||||
|
|
||||||
//modified by NIZNHY-PKV Fri Nov 25 13:02:40 2011f
|
|
||||||
if((aStartIndex > nb) || (anEndIndex <= 1)) {
|
if((aStartIndex > nb) || (anEndIndex <= 1)) {
|
||||||
//if((aStartIndex >= nb) || (anEndIndex <= 1)) {
|
|
||||||
//modified by NIZNHY-PKV Fri Nov 25 13:02:47 2011t
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
k = aStartIndex;
|
k = aStartIndex;
|
||||||
@ -2901,6 +2897,9 @@ Standard_Boolean FindPoint(const gp_Pnt2d& theFirstPoint,
|
|||||||
}
|
}
|
||||||
gp_Vec2d anormvec = aVec;
|
gp_Vec2d anormvec = aVec;
|
||||||
anormvec.Normalize();
|
anormvec.Normalize();
|
||||||
|
//modified by NIZNHY-PKV Mon Dec 19 11:46:06 2011f
|
||||||
|
RefineVector(anormvec);
|
||||||
|
//modified by NIZNHY-PKV Mon Dec 19 11:46:10 2011t
|
||||||
Standard_Real adot1 = anormvec.Dot(anOtherVecNormal);
|
Standard_Real adot1 = anormvec.Dot(anOtherVecNormal);
|
||||||
|
|
||||||
if(fabs(adot1) < Precision::Angular())
|
if(fabs(adot1) < Precision::Angular())
|
||||||
@ -4536,8 +4535,6 @@ Standard_Integer IndexType(const GeomAbs_SurfaceType aType)
|
|||||||
}
|
}
|
||||||
return aIndex;
|
return aIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
//modified by NIZNHY-PKV Fri Nov 25 11:58:12 2011f
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : DumpWLine
|
//function : DumpWLine
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -4559,4 +4556,36 @@ void DumpWLine(const Handle(IntPatch_WLine)& aWLine)
|
|||||||
i, aX, aY, aZ, aU1, aV1, aU2, aV2);
|
i, aX, aY, aZ, aU1, aV1, aU2, aV2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//modified by NIZNHY-PKV Fri Nov 25 11:58:19 2011t
|
//modified by NIZNHY-PKV Wed Dec 14 12:22:48 2011f
|
||||||
|
//=======================================================================
|
||||||
|
//function : RefineVector
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void RefineVector(gp_Vec2d& aV2D)
|
||||||
|
{
|
||||||
|
Standard_Integer k,m;
|
||||||
|
Standard_Real aC[2], aEps, aR1, aR2, aNum;
|
||||||
|
//
|
||||||
|
aEps=RealEpsilon();
|
||||||
|
aR1=1.-aEps;
|
||||||
|
aR2=1.+aEps;
|
||||||
|
//
|
||||||
|
aV2D.Coord(aC[0], aC[1]);
|
||||||
|
//
|
||||||
|
for (k=0; k<2; ++k) {
|
||||||
|
m=(k+1)%2;
|
||||||
|
aNum=fabs(aC[k]);
|
||||||
|
if (aNum>aR1 && aNum<aR2) {
|
||||||
|
if (aC[k]<0.) {
|
||||||
|
aC[k]=-1.;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aC[k]=1.;
|
||||||
|
}
|
||||||
|
aC[m]=0.;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aV2D.SetCoord(aC[0], aC[1]);
|
||||||
|
}
|
||||||
|
//modified by NIZNHY-PKV Wed Dec 14 12:22:50 2011t
|
||||||
|
Loading…
x
Reference in New Issue
Block a user