mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
bb368e271e | ||
|
04ecb233f2 | ||
|
dbfb0666b2 | ||
|
c74b60ab81 | ||
|
3d41db2138 | ||
|
43764346a1 | ||
|
3c61e8f7e0 | ||
|
da9cb57f57 | ||
|
60490a5c19 | ||
|
2b5fcf89b2 | ||
|
99ee8eb9d3 | ||
|
b9a5469aa1 | ||
|
c004c09c9e | ||
|
f15afeb84b | ||
|
488b78ed3c | ||
|
6faa1bd160 | ||
|
00be1552ed | ||
|
a2bacd54f4 |
@@ -173,8 +173,17 @@ static Standard_Real ComputeTolReached(const Handle(Adaptor3d_Curve)& c3d,
|
||||
{
|
||||
Standard_Real t = IntToReal(i) / IntToReal(nbp);
|
||||
Standard_Real u = first * (1.0 - t) + last * t;
|
||||
gp_Pnt Pc3d = c3d->Value(u);
|
||||
gp_Pnt Pcons = cons.Value(u);
|
||||
gp_Pnt Pc3d, Pcons;
|
||||
try
|
||||
{
|
||||
Pc3d = c3d->Value(u);
|
||||
Pcons = cons.Value(u);
|
||||
}
|
||||
catch (Standard_Failure const&)
|
||||
{
|
||||
d2 = Precision::Infinite();
|
||||
break;
|
||||
}
|
||||
if (Precision::IsInfinite(Pcons.X()) ||
|
||||
Precision::IsInfinite(Pcons.Y()) ||
|
||||
Precision::IsInfinite(Pcons.Z()))
|
||||
|
@@ -91,7 +91,7 @@ static void ComputeTrsf2d(const Handle(TheWLine)& theline,
|
||||
//function : Parameters
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static void Parameters(const ApproxInt_TheMultiLine& Line,
|
||||
void ApproxInt_Approx::Parameters(const ApproxInt_TheMultiLine& Line,
|
||||
const Standard_Integer firstP,
|
||||
const Standard_Integer lastP,
|
||||
const Approx_ParametrizationType Par,
|
||||
|
@@ -26,6 +26,8 @@
|
||||
#include <Precision.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <GeomInt_WLApprox.hxx>
|
||||
#include <GeomInt_TheMultiLineOfWLApprox.hxx>
|
||||
|
||||
// (Sqrt(5.0) - 1.0) / 4.0
|
||||
//static const Standard_Real aSinCoeff = 0.30901699437494742410229341718282;
|
||||
@@ -88,6 +90,94 @@ static Standard_Real EvalCurv(const Standard_Real dim,
|
||||
return curv;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BuildCurvature
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ApproxInt_KnotTools::BuildCurvature(
|
||||
const NCollection_LocalArray<Standard_Real>& theCoords,
|
||||
const Standard_Integer theDim,
|
||||
const math_Vector& thePars,
|
||||
TColStd_Array1OfReal& theCurv,
|
||||
Standard_Real& theMaxCurv)
|
||||
{
|
||||
// Arrays are allocated for max theDim = 7: 1 3d curve + 2 2d curves.
|
||||
Standard_Real Val[21], Par[3], Res[21];
|
||||
Standard_Integer i, j, m, ic;
|
||||
Standard_Integer dim = theDim;
|
||||
//
|
||||
theMaxCurv = 0.;
|
||||
if (theCurv.Length() < 3)
|
||||
{
|
||||
theCurv.Init(0.);
|
||||
return;
|
||||
}
|
||||
i = theCurv.Lower();
|
||||
for (j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i + j;
|
||||
ic = (k - theCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for (m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[0], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
theCurv(i) = EvalCurv(dim, &Res[dim], &Res[2 * dim]);
|
||||
//
|
||||
if (theCurv(i) > theMaxCurv)
|
||||
{
|
||||
theMaxCurv = theCurv(i);
|
||||
}
|
||||
//
|
||||
for (i = theCurv.Lower() + 1; i < theCurv.Upper(); ++i)
|
||||
{
|
||||
for (j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i + j - 1;
|
||||
ic = (k - theCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for (m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[1], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
theCurv(i) = EvalCurv(dim, &Res[dim], &Res[2 * dim]);
|
||||
if (theCurv(i) > theMaxCurv)
|
||||
{
|
||||
theMaxCurv = theCurv(i);
|
||||
}
|
||||
}
|
||||
//
|
||||
i = theCurv.Upper();
|
||||
for (j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i + j - 2;
|
||||
ic = (k - theCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for (m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[2], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
theCurv(i) = EvalCurv(dim, &Res[dim], &Res[2 * dim]);
|
||||
if (theCurv(i) > theMaxCurv)
|
||||
{
|
||||
theMaxCurv = theCurv(i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeKnotInds
|
||||
//purpose :
|
||||
@@ -100,75 +190,10 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray<Standard_
|
||||
//I: Create discrete curvature.
|
||||
NCollection_Sequence<Standard_Integer> aFeatureInds;
|
||||
TColStd_Array1OfReal aCurv(thePars.Lower(), thePars.Upper());
|
||||
// Arrays are allocated for max theDim = 7: 1 3d curve + 2 2d curves.
|
||||
Standard_Real Val[21], Par[3], Res[21];
|
||||
Standard_Integer i, j, m, ic;
|
||||
Standard_Real aMaxCurv = 0.;
|
||||
Standard_Integer dim = theDim;
|
||||
//
|
||||
i = aCurv.Lower();
|
||||
for(j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i+j;
|
||||
ic = (k - aCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for(m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[0], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
aCurv(i) = EvalCurv(dim, &Res[dim], &Res[2*dim]);
|
||||
//
|
||||
if(aCurv(i) > aMaxCurv)
|
||||
{
|
||||
aMaxCurv = aCurv(i);
|
||||
}
|
||||
//
|
||||
for(i = aCurv.Lower()+1; i < aCurv.Upper(); ++i)
|
||||
{
|
||||
for(j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i+j-1;
|
||||
ic = (k - aCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for(m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[1], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
aCurv(i) = EvalCurv(dim, &Res[dim], &Res[2*dim]);
|
||||
if(aCurv(i) > aMaxCurv)
|
||||
{
|
||||
aMaxCurv = aCurv(i);
|
||||
}
|
||||
}
|
||||
//
|
||||
i = aCurv.Upper();
|
||||
for(j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i+j-2;
|
||||
ic = (k - aCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for(m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[2], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
aCurv(i) = EvalCurv(dim, &Res[dim], &Res[2*dim]);
|
||||
if(aCurv(i) > aMaxCurv)
|
||||
{
|
||||
aMaxCurv = aCurv(i);
|
||||
}
|
||||
|
||||
BuildCurvature(theCoords, theDim, thePars, aCurv, aMaxCurv);
|
||||
//
|
||||
Standard_Integer i, j, dim = theDim;
|
||||
#ifdef APPROXINT_KNOTTOOLS_DEBUG
|
||||
std::cout << "Discrete curvature array is" << std::endl;
|
||||
for(i = aCurv.Lower(); i <= aCurv.Upper(); ++i)
|
||||
@@ -627,3 +652,172 @@ void ApproxInt_KnotTools::BuildKnots(const TColgp_Array1OfPnt& thePntsXYZ,
|
||||
#endif
|
||||
|
||||
}
|
||||
//=======================================================================
|
||||
//function : MaxParamRatio
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Real MaxParamRatio(const math_Vector& thePars)
|
||||
{
|
||||
Standard_Integer i;
|
||||
Standard_Real aMaxRatio = 0.;
|
||||
//
|
||||
for (i = thePars.Lower() + 1; i < thePars.Upper(); ++i)
|
||||
{
|
||||
Standard_Real aRat = (thePars(i + 1) - thePars(i)) / (thePars(i) - thePars(i - 1));
|
||||
if (aRat < 1.)
|
||||
aRat = 1. / aRat;
|
||||
|
||||
aMaxRatio = Max(aMaxRatio, aRat);
|
||||
}
|
||||
return aMaxRatio;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : DefineParType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Approx_ParametrizationType ApproxInt_KnotTools::DefineParType(
|
||||
const Handle(IntPatch_WLine)& theWL,
|
||||
const Standard_Integer theFpar, const Standard_Integer theLpar,
|
||||
const Standard_Boolean theApproxXYZ,
|
||||
const Standard_Boolean theApproxU1V1,
|
||||
const Standard_Boolean theApproxU2V2
|
||||
)
|
||||
{
|
||||
if (theLpar - theFpar == 1)
|
||||
return Approx_IsoParametric;
|
||||
|
||||
const Standard_Integer nbp3d = theApproxXYZ ? 1 : 0,
|
||||
nbp2d = (theApproxU1V1 ? 1 : 0) + (theApproxU2V2 ? 1 : 0);
|
||||
|
||||
GeomInt_TheMultiLineOfWLApprox aTestLine(theWL, nbp3d, nbp2d, theApproxU1V1, theApproxU2V2,
|
||||
0., 0., 0., 0., 0., 0., 0., theApproxU1V1, theFpar, theLpar);
|
||||
|
||||
TColgp_Array1OfPnt aTabPnt3d(1, Max(1, nbp3d));
|
||||
TColgp_Array1OfPnt2d aTabPnt2d(1, Max(1, nbp2d));
|
||||
TColgp_Array1OfPnt aPntXYZ(theFpar, theLpar);
|
||||
TColgp_Array1OfPnt2d aPntU1V1(theFpar, theLpar);
|
||||
TColgp_Array1OfPnt2d aPntU2V2(theFpar, theLpar);
|
||||
|
||||
Standard_Integer i, j;
|
||||
|
||||
for (i = theFpar; i <= theLpar; ++i)
|
||||
{
|
||||
if (nbp3d != 0 && nbp2d != 0) aTestLine.Value(i, aTabPnt3d, aTabPnt2d);
|
||||
else if (nbp2d != 0) aTestLine.Value(i, aTabPnt2d);
|
||||
else if (nbp3d != 0) aTestLine.Value(i, aTabPnt3d);
|
||||
//
|
||||
if (nbp3d > 0)
|
||||
{
|
||||
aPntXYZ(i) = aTabPnt3d(1);
|
||||
}
|
||||
if (nbp2d > 1)
|
||||
{
|
||||
aPntU1V1(i) = aTabPnt2d(1);
|
||||
aPntU2V2(i) = aTabPnt2d(2);
|
||||
}
|
||||
else if (nbp2d > 0)
|
||||
{
|
||||
if (theApproxU1V1)
|
||||
{
|
||||
aPntU1V1(i) = aTabPnt2d(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
aPntU2V2(i) = aTabPnt2d(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer aDim = 0;
|
||||
|
||||
if (theApproxXYZ)
|
||||
aDim += 3;
|
||||
if (theApproxU1V1)
|
||||
aDim += 2;
|
||||
if (theApproxU2V2)
|
||||
aDim += 2;
|
||||
|
||||
Standard_Integer aLength = theLpar - theFpar + 1;
|
||||
NCollection_LocalArray<Standard_Real> aCoords(aLength * aDim);
|
||||
for (i = theFpar; i <= theLpar; ++i)
|
||||
{
|
||||
j = (i - theFpar) * aDim;
|
||||
if (theApproxXYZ)
|
||||
{
|
||||
aCoords[j] = aPntXYZ.Value(i).X();
|
||||
++j;
|
||||
aCoords[j] = aPntXYZ.Value(i).Y();
|
||||
++j;
|
||||
aCoords[j] = aPntXYZ.Value(i).Z();
|
||||
++j;
|
||||
}
|
||||
if (theApproxU1V1)
|
||||
{
|
||||
aCoords[j] = aPntU1V1.Value(i).X();
|
||||
++j;
|
||||
aCoords[j] = aPntU1V1.Value(i).Y();
|
||||
++j;
|
||||
}
|
||||
if (theApproxU2V2)
|
||||
{
|
||||
aCoords[j] = aPntU2V2.Value(i).X();
|
||||
++j;
|
||||
aCoords[j] = aPntU2V2.Value(i).Y();
|
||||
++j;
|
||||
}
|
||||
}
|
||||
|
||||
//Analysis of curvature
|
||||
const Standard_Real aCritRat = 500.;
|
||||
const Standard_Real aCritParRat = 100.;
|
||||
math_Vector aPars(theFpar, theLpar);
|
||||
Approx_ParametrizationType aParType = Approx_ChordLength;
|
||||
GeomInt_WLApprox::Parameters(aTestLine, theFpar, theLpar, aParType, aPars);
|
||||
TColStd_Array1OfReal aCurv(aPars.Lower(), aPars.Upper());
|
||||
Standard_Real aMaxCurv = 0.;
|
||||
BuildCurvature(aCoords, aDim, aPars, aCurv, aMaxCurv);
|
||||
|
||||
if (aMaxCurv < Precision::PConfusion()
|
||||
|| Precision::IsPositiveInfinite(aMaxCurv))
|
||||
{
|
||||
//Linear case
|
||||
return aParType;
|
||||
}
|
||||
|
||||
Standard_Real aMidCurv = 0.;
|
||||
Standard_Real eps = Epsilon(1.);
|
||||
j = 0;
|
||||
for (i = aCurv.Lower(); i <= aCurv.Upper(); ++i)
|
||||
{
|
||||
if (aMaxCurv - aCurv(i) < eps)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
++j;
|
||||
aMidCurv += aCurv(i);
|
||||
}
|
||||
|
||||
if (j > 1)
|
||||
{
|
||||
aMidCurv /= j;
|
||||
}
|
||||
|
||||
if (aMidCurv <= eps)
|
||||
return aParType;
|
||||
|
||||
Standard_Real aRat = aMaxCurv / aMidCurv;
|
||||
|
||||
if (aRat > aCritRat)
|
||||
{
|
||||
if(aRat > 5.*aCritRat)
|
||||
aParType = Approx_Centripetal;
|
||||
else
|
||||
{
|
||||
Standard_Real aParRat = MaxParamRatio(aPars);
|
||||
if (aParRat > aCritParRat)
|
||||
aParType = Approx_Centripetal;
|
||||
}
|
||||
}
|
||||
|
||||
return aParType;
|
||||
}
|
||||
|
@@ -38,12 +38,15 @@
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <NCollection_LocalArray.hxx>
|
||||
#include <Approx_ParametrizationType.hxx>
|
||||
|
||||
class math_Vector;
|
||||
template <class A> class NCollection_Sequence;
|
||||
template <class A> class NCollection_List;
|
||||
template <class A> class NCollection_Vector;
|
||||
|
||||
class IntPatch_WLine;
|
||||
|
||||
// Corresponds for debug information output.
|
||||
// Debug information is also printed when OCCT_DEBUG defined.
|
||||
//#define APPROXINT_KNOTTOOLS_DEBUG
|
||||
@@ -84,6 +87,22 @@ public:
|
||||
const Standard_Integer theMinNbPnts,
|
||||
NCollection_Vector<Standard_Integer>& theKnots);
|
||||
|
||||
//! Builds discrete curvature
|
||||
Standard_EXPORT static void BuildCurvature(
|
||||
const NCollection_LocalArray<Standard_Real>& theCoords,
|
||||
const Standard_Integer theDim,
|
||||
const math_Vector& thePars,
|
||||
TColStd_Array1OfReal& theCurv,
|
||||
Standard_Real& theMaxCurv);
|
||||
|
||||
//! Defines preferable parametrization type for theWL
|
||||
Standard_EXPORT static Approx_ParametrizationType DefineParType(const Handle(IntPatch_WLine)& theWL,
|
||||
const Standard_Integer theFpar, const Standard_Integer theLpar,
|
||||
const Standard_Boolean theApproxXYZ,
|
||||
const Standard_Boolean theApproxU1V1,
|
||||
const Standard_Boolean theApproxU2V2);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//! Compute indices of knots:
|
||||
|
@@ -284,6 +284,35 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
|
||||
// Post-processing options
|
||||
Standard_Boolean bSplitCurve = Standard_False;
|
||||
//
|
||||
// Collect all pairs of Edge/Edge interferences to check if
|
||||
// some faces have to be moved to obtain more precise intersection
|
||||
NCollection_DataMap<BOPDS_Pair, TColStd_ListOfInteger, BOPDS_PairMapHasher> aEEMap;
|
||||
const BOPDS_VectorOfInterfEE& aVEEs = myDS->InterfEE();
|
||||
for (Standard_Integer iEE = 0; iEE < aVEEs.Size(); ++iEE)
|
||||
{
|
||||
const BOPDS_Interf& aEE = aVEEs(iEE);
|
||||
if (!aEE.HasIndexNew())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Standard_Integer nE1, nE2;
|
||||
aEE.Indices(nE1, nE2);
|
||||
|
||||
const Standard_Integer nVN = aEE.IndexNew();
|
||||
|
||||
BOPDS_Pair aPair(nE1, nE2);
|
||||
TColStd_ListOfInteger* pPoints = aEEMap.ChangeSeek(aPair);
|
||||
if (pPoints)
|
||||
{
|
||||
pPoints->Append(nVN);
|
||||
}
|
||||
else
|
||||
{
|
||||
pPoints = aEEMap.Bound(BOPDS_Pair(nE1, nE2), TColStd_ListOfInteger());
|
||||
pPoints->Append(nVN);
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare the pairs of faces for intersection
|
||||
BOPAlgo_VectorOfFaceFace aVFaceFace;
|
||||
myIterator->Initialize(TopAbs_FACE, TopAbs_FACE);
|
||||
@@ -312,15 +341,87 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if there is an intersection between edges of the faces.
|
||||
// If there is an intersection, check if there is a shift between the edges
|
||||
// (intersection point is on some distance from the edges), and move one of
|
||||
// the faces to the point of exact edges intersection. This should allow
|
||||
// obtaining more precise intersection curves between the faces
|
||||
// (at least the curves should reach the boundary).
|
||||
// Note, that currently this check considers only closed edges (seam edges).
|
||||
TopoDS_Face aFShifted1 = aF1, aFShifted2 = aF2;
|
||||
// Keep shift value to use it as the tolerance for intersection curves
|
||||
Standard_Real aShiftValue = 0.;
|
||||
|
||||
if (aBAS1.GetType() != GeomAbs_Plane ||
|
||||
aBAS2.GetType() != GeomAbs_Plane) {
|
||||
|
||||
Standard_Boolean isFound = Standard_False;
|
||||
for (TopExp_Explorer aExp1(aF1, TopAbs_EDGE); !isFound && aExp1.More(); aExp1.Next())
|
||||
{
|
||||
const TopoDS_Edge& aE1 = TopoDS::Edge(aExp1.Current());
|
||||
const Standard_Integer nE1 = myDS->Index(aE1);
|
||||
|
||||
for (TopExp_Explorer aExp2(aF2, TopAbs_EDGE); !isFound && aExp2.More(); aExp2.Next())
|
||||
{
|
||||
const TopoDS_Edge& aE2 = TopoDS::Edge(aExp2.Current());
|
||||
const Standard_Integer nE2 = myDS->Index(aE2);
|
||||
|
||||
Standard_Boolean bIsClosed1 = BRep_Tool::IsClosed(aE1, aF1);
|
||||
Standard_Boolean bIsClosed2 = BRep_Tool::IsClosed(aE2, aF2);
|
||||
if (!bIsClosed1 && !bIsClosed2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const TColStd_ListOfInteger* pPoints = aEEMap.Seek(BOPDS_Pair(nE1, nE2));
|
||||
if (!pPoints)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (TColStd_ListOfInteger::Iterator itEEP(*pPoints); itEEP.More(); itEEP.Next())
|
||||
{
|
||||
const Standard_Integer& nVN = itEEP.Value();
|
||||
const TopoDS_Vertex& aVN = TopoDS::Vertex(myDS->Shape(nVN));
|
||||
const gp_Pnt& aPnt = BRep_Tool::Pnt(aVN);
|
||||
|
||||
// Compute points exactly on the edges
|
||||
GeomAPI_ProjectPointOnCurve& aProjPC1 = myContext->ProjPC(aE1);
|
||||
GeomAPI_ProjectPointOnCurve& aProjPC2 = myContext->ProjPC(aE2);
|
||||
aProjPC1.Perform(aPnt);
|
||||
aProjPC2.Perform(aPnt);
|
||||
if (!aProjPC1.NbPoints() && !aProjPC2.NbPoints())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
gp_Pnt aP1 = aProjPC1.NbPoints() > 0 ? aProjPC1.NearestPoint() : aPnt;
|
||||
gp_Pnt aP2 = aProjPC2.NbPoints() > 0 ? aProjPC2.NearestPoint() : aPnt;
|
||||
|
||||
Standard_Real aShiftDist = aP1.Distance(aP2);
|
||||
if (aShiftDist > BRep_Tool::Tolerance(aVN))
|
||||
{
|
||||
// Move one of the faces to the point of exact intersection of edges
|
||||
gp_Trsf aTrsf;
|
||||
aTrsf.SetTranslation(bIsClosed1 ? gp_Vec(aP1, aP2) : gp_Vec(aP2, aP1));
|
||||
TopLoc_Location aLoc(aTrsf);
|
||||
(bIsClosed1 ? &aFShifted1 : &aFShifted2)->Move(aLoc);
|
||||
aShiftValue = aShiftDist;
|
||||
isFound = Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
BOPAlgo_FaceFace& aFaceFace=aVFaceFace.Appended();
|
||||
//
|
||||
aFaceFace.SetRunParallel (myRunParallel);
|
||||
aFaceFace.SetIndices(nF1, nF2);
|
||||
aFaceFace.SetFaces(aF1, aF2);
|
||||
aFaceFace.SetFaces(aFShifted1, aFShifted2);
|
||||
aFaceFace.SetBoxes (myDS->ShapeInfo (nF1).Box(), myDS->ShapeInfo (nF2).Box());
|
||||
// compute minimal tolerance for the curves
|
||||
Standard_Real aTolFF = ToleranceFF(aBAS1, aBAS2);
|
||||
// Note: in case of faces with closed edges it should not be less than value of the shift
|
||||
Standard_Real aTolFF = Max(aShiftValue, ToleranceFF(aBAS1, aBAS2));
|
||||
aFaceFace.SetTolFF(aTolFF);
|
||||
//
|
||||
IntSurf_ListOfPntOn2S aListOfPnts;
|
||||
|
@@ -106,6 +106,11 @@ public:
|
||||
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& Value (const Standard_Integer Index) const;
|
||||
|
||||
Standard_EXPORT static void Parameters(const BRepApprox_TheMultiLineOfApprox& Line,
|
||||
const Standard_Integer firstP,
|
||||
const Standard_Integer lastP,
|
||||
const Approx_ParametrizationType Par,
|
||||
math_Vector& TheParameters);
|
||||
|
||||
|
||||
|
||||
|
@@ -1978,6 +1978,12 @@ public:
|
||||
return aDeriv.Transformed(mySurfaceTrsf);
|
||||
}
|
||||
|
||||
gp_Dir Normal()
|
||||
{
|
||||
gp_Dir aNormal = mySurfaceProps.Normal();
|
||||
return aNormal.Transformed(mySurfaceTrsf);
|
||||
}
|
||||
|
||||
// Calculate principal curvatures, which consist of minimal and maximal normal curvatures and
|
||||
// the directions on the tangent plane (principal direction) where the extremums are reached
|
||||
void Curvature(gp_Dir& thePrincipalDir1, Standard_Real& theCurvature1,
|
||||
@@ -2016,32 +2022,63 @@ private:
|
||||
//purpose : check the angle at the border between two squares.
|
||||
// Two shares should have a shared front edge.
|
||||
//=======================================================================
|
||||
static GeomAbs_Shape tgtfaces(const TopoDS_Edge& Ed,
|
||||
const TopoDS_Face& F1,
|
||||
const TopoDS_Face& F2,
|
||||
const Standard_Real theAngleTol)
|
||||
GeomAbs_Shape BRepLib::ContinuityOfFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const Standard_Real theAngleTol)
|
||||
{
|
||||
Standard_Boolean isSeam = F1.IsEqual(F2);
|
||||
Standard_Boolean isSeam = theFace1.IsEqual(theFace2);
|
||||
|
||||
TopoDS_Edge E = Ed;
|
||||
TopoDS_Edge anEdgeInFace1, anEdgeInFace2;
|
||||
Handle(Geom2d_Curve) aCurve1, aCurve2;
|
||||
|
||||
Standard_Real aFirst, aLast;
|
||||
|
||||
if (!theFace1.IsSame (theFace2) &&
|
||||
BRep_Tool::IsClosed (theEdge, theFace1) &&
|
||||
BRep_Tool::IsClosed (theEdge, theFace2))
|
||||
{
|
||||
//Find the edge in the face 1: this edge will have correct orientation
|
||||
TopoDS_Face aFace1 = theFace1;
|
||||
aFace1.Orientation (TopAbs_FORWARD);
|
||||
TopExp_Explorer anExplo (aFace1, TopAbs_EDGE);
|
||||
for (; anExplo.More(); anExplo.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anExplo.Current());
|
||||
if (anEdge.IsSame (theEdge))
|
||||
{
|
||||
anEdgeInFace1 = anEdge;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (anEdgeInFace1.IsNull())
|
||||
return GeomAbs_C0;
|
||||
|
||||
aCurve1 = BRep_Tool::CurveOnSurface (anEdgeInFace1, aFace1, aFirst, aLast);
|
||||
TopoDS_Face aFace2 = theFace2;
|
||||
aFace2.Orientation (TopAbs_FORWARD);
|
||||
anEdgeInFace2 = anEdgeInFace1;
|
||||
anEdgeInFace2.Reverse();
|
||||
aCurve2 = BRep_Tool::CurveOnSurface (anEdgeInFace2, aFace2, aFirst, aLast);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
anEdgeInFace1 = anEdgeInFace2 = theEdge;
|
||||
aCurve1 = BRep_Tool::CurveOnSurface (anEdgeInFace1, theFace1, aFirst, aLast);
|
||||
//For the case of seam edge
|
||||
if (theFace1.IsSame(theFace2))
|
||||
anEdgeInFace2.Reverse();
|
||||
aCurve2 = BRep_Tool::CurveOnSurface (anEdgeInFace2, theFace2, aFirst, aLast);
|
||||
}
|
||||
|
||||
// Check if pcurves exist on both faces of edge
|
||||
Standard_Real aFirst,aLast;
|
||||
E.Orientation(TopAbs_FORWARD);
|
||||
Handle(Geom2d_Curve) aCurve1 = BRep_Tool::CurveOnSurface(E, F1, aFirst, aLast);
|
||||
if(aCurve1.IsNull())
|
||||
return GeomAbs_C0;
|
||||
|
||||
if (isSeam)
|
||||
E.Orientation(TopAbs_REVERSED);
|
||||
Handle(Geom2d_Curve) aCurve2 = BRep_Tool::CurveOnSurface(E, F2, aFirst, aLast);
|
||||
if(aCurve2.IsNull())
|
||||
if (aCurve1.IsNull() || aCurve2.IsNull())
|
||||
return GeomAbs_C0;
|
||||
|
||||
TopLoc_Location aLoc1, aLoc2;
|
||||
Handle(Geom_Surface) aSurface1 = BRep_Tool::Surface(F1, aLoc1);
|
||||
Handle(Geom_Surface) aSurface1 = BRep_Tool::Surface (theFace1, aLoc1);
|
||||
const gp_Trsf& aSurf1Trsf = aLoc1.Transformation();
|
||||
Handle(Geom_Surface) aSurface2 = BRep_Tool::Surface(F2, aLoc2);
|
||||
Handle(Geom_Surface) aSurface2 = BRep_Tool::Surface (theFace2, aLoc2);
|
||||
const gp_Trsf& aSurf2Trsf = aLoc2.Transformation();
|
||||
|
||||
if (aSurface1->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
|
||||
@@ -2058,11 +2095,11 @@ static GeomAbs_Shape tgtfaces(const TopoDS_Edge& Ed,
|
||||
return GeomAbs_CN;
|
||||
}
|
||||
|
||||
SurfaceProperties aSP1(aSurface1, aSurf1Trsf, aCurve1, F1.Orientation() == TopAbs_REVERSED);
|
||||
SurfaceProperties aSP2(aSurface2, aSurf2Trsf, aCurve2, F2.Orientation() == TopAbs_REVERSED);
|
||||
SurfaceProperties aSP1(aSurface1, aSurf1Trsf, aCurve1, theFace1.Orientation() == TopAbs_REVERSED);
|
||||
SurfaceProperties aSP2(aSurface2, aSurf2Trsf, aCurve2, theFace2.Orientation() == TopAbs_REVERSED);
|
||||
|
||||
Standard_Real f, l, eps;
|
||||
BRep_Tool::Range(E,f,l);
|
||||
BRep_Tool::Range (theEdge,f,l);
|
||||
Extrema_LocateExtPC ext;
|
||||
Handle(BRepAdaptor_Curve) aHC2;
|
||||
|
||||
@@ -2073,7 +2110,6 @@ static GeomAbs_Shape tgtfaces(const TopoDS_Edge& Ed,
|
||||
const Standard_Real anAngleTol2 = theAngleTol * theAngleTol;
|
||||
|
||||
gp_Vec aDer1, aDer2;
|
||||
gp_Vec aNorm1;
|
||||
Standard_Real aSqLen1, aSqLen2;
|
||||
gp_Dir aCrvDir1[2], aCrvDir2[2];
|
||||
Standard_Real aCrvLen1[2], aCrvLen2[2];
|
||||
@@ -2101,13 +2137,26 @@ static GeomAbs_Shape tgtfaces(const TopoDS_Edge& Ed,
|
||||
aDer2 = aSP2.Derivative();
|
||||
aSqLen2 = aDer2.SquareMagnitude();
|
||||
Standard_Boolean isSmoothSuspect = (aDer1.CrossSquareMagnitude(aDer2) <= anAngleTol2 * aSqLen1 * aSqLen2);
|
||||
if (isSmoothSuspect)
|
||||
{
|
||||
gp_Dir aNormal1 = aSP1.Normal();
|
||||
if (theFace1.Orientation() == TopAbs_REVERSED)
|
||||
aNormal1.Reverse();
|
||||
gp_Dir aNormal2 = aSP2.Normal();
|
||||
if (theFace2.Orientation() == TopAbs_REVERSED)
|
||||
aNormal2.Reverse();
|
||||
|
||||
if (aNormal1 * aNormal2 < 0.)
|
||||
return GeomAbs_C0;
|
||||
}
|
||||
|
||||
if (!isSmoothSuspect)
|
||||
{
|
||||
// Refine by projection
|
||||
if (aHC2.IsNull())
|
||||
{
|
||||
// adaptor for pcurve on the second surface
|
||||
aHC2 = new BRepAdaptor_Curve (E, F2);
|
||||
aHC2 = new BRepAdaptor_Curve (anEdgeInFace2, theFace2);
|
||||
ext.Initialize(*aHC2, f, l, Precision::PConfusion());
|
||||
}
|
||||
ext.Perform(aSP1.Value(), u);
|
||||
@@ -2303,9 +2352,8 @@ void BRepLib::EncodeRegularity(TopoDS_Edge& E,
|
||||
BRep_Builder B;
|
||||
if(BRep_Tool::Continuity(E,F1,F2)<=GeomAbs_C0){
|
||||
try {
|
||||
GeomAbs_Shape aCont = tgtfaces(E, F1, F2, TolAng);
|
||||
GeomAbs_Shape aCont = ContinuityOfFaces(E, F1, F2, TolAng);
|
||||
B.Continuity(E,F1,F2,aCont);
|
||||
|
||||
}
|
||||
catch(Standard_Failure const&)
|
||||
{
|
||||
|
@@ -202,7 +202,14 @@ public:
|
||||
//! orientation to have matter in the solid. Returns
|
||||
//! False if the solid is unOrientable (open or incoherent)
|
||||
Standard_EXPORT static Standard_Boolean OrientClosedSolid (TopoDS_Solid& solid);
|
||||
|
||||
|
||||
//! Returns the order of continuity between two faces
|
||||
//! connected by an edge
|
||||
Standard_EXPORT static GeomAbs_Shape ContinuityOfFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const Standard_Real theAngleTol);
|
||||
|
||||
//! Encodes the Regularity of edges on a Shape.
|
||||
//! Warning: <TolAng> is an angular tolerance, expressed in Rad.
|
||||
//! Warning: If the edges's regularity are coded before, nothing
|
||||
|
@@ -132,7 +132,7 @@ namespace
|
||||
{
|
||||
if (aDEdge->GetCurve()->ParametersNb() == 2)
|
||||
{
|
||||
if (splitEdge (aDEdge, Abs (getConeStep (aDFace))))
|
||||
if (splitEdge (aDEdge, aDFace, Abs (getConeStep (aDFace))))
|
||||
{
|
||||
TopLoc_Location aLoc;
|
||||
const Handle (Poly_Triangulation)& aTriangulation =
|
||||
@@ -177,48 +177,89 @@ namespace
|
||||
}
|
||||
|
||||
//! Splits 3D and all pcurves accordingly using the specified step.
|
||||
Standard_Boolean splitEdge(const IMeshData::IEdgePtr& theDEdge,
|
||||
const Standard_Real theDU) const
|
||||
Standard_Boolean splitEdge(const IMeshData::IEdgePtr& theDEdge,
|
||||
const IMeshData::IFaceHandle& theDFace,
|
||||
const Standard_Real theDU) const
|
||||
{
|
||||
if (!splitCurve<gp_XYZ> (theDEdge->GetCurve (), theDU))
|
||||
TopoDS_Edge aE = theDEdge->GetEdge();
|
||||
const TopoDS_Face& aF = theDFace->GetFace();
|
||||
|
||||
Standard_Real aFParam, aLParam;
|
||||
|
||||
Handle(Geom_Curve) aHC = BRep_Tool::Curve (aE, aFParam, aLParam);
|
||||
|
||||
const IMeshData::IPCurveHandle& aIPC1 = theDEdge->GetPCurve(0);
|
||||
const IMeshData::IPCurveHandle& aIPC2 = theDEdge->GetPCurve(1);
|
||||
|
||||
// Calculate the step by parameter of the curve.
|
||||
const gp_Pnt2d& aFPntOfIPC1 = aIPC1->GetPoint (0);
|
||||
const gp_Pnt2d& aLPntOfIPC1 = aIPC1->GetPoint (aIPC1->ParametersNb() - 1);
|
||||
const Standard_Real aMod = Abs (aFPntOfIPC1.Y() - aLPntOfIPC1.Y());
|
||||
|
||||
if (aMod < gp::Resolution())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
for (Standard_Integer aPCurveIdx = 0; aPCurveIdx < theDEdge->PCurvesNb(); ++aPCurveIdx)
|
||||
const Standard_Real aDT = Abs (aLParam - aFParam) / aMod * theDU;
|
||||
|
||||
if (!splitCurve<gp_Pnt> (aHC, theDEdge->GetCurve(), aDT))
|
||||
{
|
||||
splitCurve<gp_XY> (theDEdge->GetPCurve (aPCurveIdx), theDU);
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
// Define two pcurves of the seam-edge.
|
||||
Handle(Geom2d_Curve) aPC1, aPC2;
|
||||
Standard_Real af, al;
|
||||
|
||||
aE.Orientation (TopAbs_FORWARD);
|
||||
aPC1 = BRep_Tool::CurveOnSurface (aE, aF, af, al);
|
||||
|
||||
aE.Orientation (TopAbs_REVERSED);
|
||||
aPC2 = BRep_Tool::CurveOnSurface (aE, aF, af, al);
|
||||
|
||||
if (aPC1.IsNull() || aPC2.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
// Select the correct pcurve of the seam-edge.
|
||||
const gp_Pnt2d& aFPntOfPC1 = aPC1->Value (aPC1->FirstParameter());
|
||||
|
||||
if (Abs (aLPntOfIPC1.X() - aFPntOfPC1.X()) > Precision::Confusion())
|
||||
{
|
||||
std::swap (aPC1, aPC2);
|
||||
}
|
||||
|
||||
splitCurve<gp_Pnt2d> (aPC1, aIPC1, aDT);
|
||||
splitCurve<gp_Pnt2d> (aPC2, aIPC2, aDT);
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//! Splits the given curve using the specified step.
|
||||
template<class PointType, class Curve>
|
||||
Standard_Boolean splitCurve(Curve& theCurve, const Standard_Real theDU) const
|
||||
template<class PointType, class GeomCurve, class Curve>
|
||||
Standard_Boolean splitCurve(GeomCurve& theGeomCurve,
|
||||
Curve& theCurve,
|
||||
const Standard_Real theDT) const
|
||||
{
|
||||
Standard_Boolean isUpdated = Standard_False;
|
||||
PointType aDir = theCurve->GetPoint(theCurve->ParametersNb() - 1).Coord() - theCurve->GetPoint(0).Coord();
|
||||
const Standard_Real aModulus = aDir.Modulus();
|
||||
if (aModulus < gp::Resolution())
|
||||
{
|
||||
return isUpdated;
|
||||
}
|
||||
aDir /= aModulus;
|
||||
|
||||
const Standard_Real aLastParam = theCurve->GetParameter(theCurve->ParametersNb() - 1);
|
||||
const Standard_Boolean isReversed = theCurve->GetParameter(0) > aLastParam;
|
||||
const Standard_Real aFirstParam = theCurve->GetParameter (0);
|
||||
const Standard_Real aLastParam = theCurve->GetParameter (theCurve->ParametersNb() - 1);
|
||||
const Standard_Boolean isReversed = aFirstParam > aLastParam;
|
||||
|
||||
for (Standard_Integer aPointIdx = 1; ; ++aPointIdx)
|
||||
{
|
||||
const Standard_Real aCurrParam = theCurve->GetParameter(0) + aPointIdx * theDU * (isReversed ? -1.0 : 1.0);
|
||||
if (( isReversed && (aCurrParam < aLastParam)) ||
|
||||
(!isReversed && !(aCurrParam < aLastParam)))
|
||||
const Standard_Real aCurrParam = aFirstParam + aPointIdx * theDT * (isReversed ? -1.0 : 1.0);
|
||||
if (( isReversed && (aCurrParam - aLastParam < Precision::PConfusion())) ||
|
||||
(!isReversed && !(aCurrParam - aLastParam < - Precision::PConfusion())))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
theCurve->InsertPoint(theCurve->ParametersNb() - 1,
|
||||
theCurve->GetPoint(0).Translated (aDir * aPointIdx * theDU),
|
||||
theCurve->InsertPoint (theCurve->ParametersNb() - 1,
|
||||
theGeomCurve->Value (aCurrParam),
|
||||
aCurrParam);
|
||||
|
||||
isUpdated = Standard_True;
|
||||
|
@@ -139,12 +139,12 @@ ChFiDS_TypeOfConcavity ChFi3d::DefineConnectType(const TopoDS_Edge& E,
|
||||
//function : IsTangentFaces
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const GeomAbs_Shape Order)
|
||||
Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const GeomAbs_Shape theOrder)
|
||||
{
|
||||
if (Order == GeomAbs_G1 && BRep_Tool::Continuity(theEdge, theFace1, theFace2) != GeomAbs_C0)
|
||||
if (theOrder == GeomAbs_G1 && BRep_Tool::Continuity(theEdge, theFace1, theFace2) != GeomAbs_C0)
|
||||
return Standard_True;
|
||||
|
||||
Standard_Real TolC0 = Max(0.001, 1.5*BRep_Tool::Tolerance(theEdge));
|
||||
@@ -152,15 +152,46 @@ Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
Standard_Real aFirst;
|
||||
Standard_Real aLast;
|
||||
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
const Handle(Geom2d_Curve) aC2d1 = BRep_Tool::CurveOnSurface
|
||||
(theEdge, theFace1, aFirst, aLast);
|
||||
//For the case of seam edge
|
||||
TopoDS_Edge EE = theEdge;
|
||||
if (theFace1.IsSame(theFace2))
|
||||
EE.Reverse();
|
||||
const Handle(Geom2d_Curve) aC2d2 = BRep_Tool::CurveOnSurface
|
||||
(EE, theFace2, aFirst, aLast);
|
||||
Handle(Geom2d_Curve) aC2d1, aC2d2;
|
||||
|
||||
if (!theFace1.IsSame (theFace2) &&
|
||||
BRep_Tool::IsClosed (theEdge, theFace1) &&
|
||||
BRep_Tool::IsClosed (theEdge, theFace2))
|
||||
{
|
||||
//Find the edge in the face 1: this edge will have correct orientation
|
||||
TopoDS_Edge anEdgeInFace1;
|
||||
TopoDS_Face aFace1 = theFace1;
|
||||
aFace1.Orientation (TopAbs_FORWARD);
|
||||
TopExp_Explorer anExplo (aFace1, TopAbs_EDGE);
|
||||
for (; anExplo.More(); anExplo.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anExplo.Current());
|
||||
if (anEdge.IsSame (theEdge))
|
||||
{
|
||||
anEdgeInFace1 = anEdge;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (anEdgeInFace1.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
aC2d1 = BRep_Tool::CurveOnSurface (anEdgeInFace1, aFace1, aFirst, aLast);
|
||||
TopoDS_Face aFace2 = theFace2;
|
||||
aFace2.Orientation (TopAbs_FORWARD);
|
||||
anEdgeInFace1.Reverse();
|
||||
aC2d2 = BRep_Tool::CurveOnSurface (anEdgeInFace1, aFace2, aFirst, aLast);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
aC2d1 = BRep_Tool::CurveOnSurface (theEdge, theFace1, aFirst, aLast);
|
||||
//For the case of seam edge
|
||||
TopoDS_Edge EE = theEdge;
|
||||
if (theFace1.IsSame(theFace2))
|
||||
EE.Reverse();
|
||||
aC2d2 = BRep_Tool::CurveOnSurface (EE, theFace2, aFirst, aLast);
|
||||
}
|
||||
|
||||
if (aC2d1.IsNull() || aC2d2.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
@@ -191,15 +222,19 @@ Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
if (i == aNbSamples) aPar = aLast;
|
||||
|
||||
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
|
||||
aSurf1, aSurf2, Order,
|
||||
aSurf1, aSurf2, theOrder,
|
||||
0.001, TolC0, 0.1, 0.1, 0.1);
|
||||
if (!aCont.IsDone())
|
||||
{
|
||||
if (theOrder == GeomAbs_C2 &&
|
||||
aCont.StatusError() == LocalAnalysis_NullSecondDerivative)
|
||||
continue;
|
||||
|
||||
nbNotDone++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Order == GeomAbs_G1)
|
||||
if (theOrder == GeomAbs_G1)
|
||||
{
|
||||
if (!aCont.IsG1())
|
||||
return Standard_False;
|
||||
|
@@ -2036,6 +2036,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
|
||||
if ((possible1 && possible2) || (!possible1 && !possible2) || (nbarete > 4)) {
|
||||
while (!trouve) {
|
||||
nb++;
|
||||
if (nb>=nn) throw Standard_Failure("IntersectionAtEnd : the max number of faces reached");
|
||||
if (nb!=1) F3=Face[nb-2];
|
||||
Face[nb-1]=F3;
|
||||
if (CV1.Arc().IsSame(edgelibre1))
|
||||
|
@@ -610,6 +610,9 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
const Bnd_Range aRange(theUt21, theUt22);
|
||||
Bnd_Range aProjRng1;
|
||||
|
||||
// Precision of the calculation depends on circles radii
|
||||
const Standard_Real aPrecision = Max(Epsilon(myC[0]->Circle().Radius()), Epsilon(myC[1]->Circle().Radius()));
|
||||
|
||||
// Project arc of the 1st circle between points theUt11 and theUt12 to the
|
||||
// 2nd circle. It is necessary to chose correct arc from two possible ones.
|
||||
|
||||
@@ -671,7 +674,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
// myIsParallel = TRUE and only the least distance will be returned.
|
||||
//4. Arcs are not parallel. Then several (or single) extremas will be returned.
|
||||
|
||||
if (aRng.Delta() > Precision::Angular())
|
||||
if (aRng.Delta() > Precision::Confusion())
|
||||
{
|
||||
Standard_Real aPar = 0.0;
|
||||
aRng.GetIntermediatePoint(0.5, aPar);
|
||||
@@ -686,7 +689,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
aMinSqD = Min(aMinSqD, ExtPCir.SquareDistance(anExtID));
|
||||
}
|
||||
|
||||
if (aMinSqD <= aMinSquareDist + 10.* Epsilon(1. + aMinSqD))
|
||||
if (aMinSqD <= aMinSquareDist + (1. + aMinSqD) * aPrecision)
|
||||
{
|
||||
ClearSolutions();
|
||||
mySqDist.Append(aMinSqD);
|
||||
@@ -711,7 +714,6 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Nearer solution can be found
|
||||
}
|
||||
else if (!aRng.IsVoid())
|
||||
@@ -787,7 +789,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
imin = k;
|
||||
}
|
||||
}
|
||||
if (aDmin <= aMinSquareDist + 10.* Epsilon(1. + aDmin))
|
||||
if (aDmin <= aMinSquareDist + (1. + aDmin) * aPrecision)
|
||||
{
|
||||
if (imin == 0)
|
||||
{
|
||||
|
@@ -132,7 +132,7 @@ void GeomConvert_CompCurveToBSplineCurve::Add(
|
||||
if (SecondCurve->Degree() < Deg) { SecondCurve->IncreaseDegree(Deg); }
|
||||
|
||||
// Declarationd
|
||||
Standard_Real L1, L2, U_de_raccord;
|
||||
Standard_Real L1, L2;
|
||||
Standard_Integer ii, jj;
|
||||
Standard_Real Ratio=1, Ratio1, Ratio2, Delta1, Delta2;
|
||||
Standard_Integer NbP1 = FirstCurve->NbPoles(), NbP2 = SecondCurve->NbPoles();
|
||||
@@ -159,7 +159,6 @@ void GeomConvert_CompCurveToBSplineCurve::Add(
|
||||
Delta1 = 0;
|
||||
Ratio2 = 1/Ratio;
|
||||
Delta2 = Ratio2*SecondCurve->Knot(1) - FirstCurve->Knot(NbK1);
|
||||
U_de_raccord = FirstCurve->LastParameter();
|
||||
}
|
||||
else {
|
||||
// On ne bouge pas la seconde courbe
|
||||
@@ -167,12 +166,11 @@ void GeomConvert_CompCurveToBSplineCurve::Add(
|
||||
Delta1 = Ratio1*FirstCurve->Knot(NbK1) - SecondCurve->Knot(1);
|
||||
Ratio2 = 1;
|
||||
Delta2 = 0;
|
||||
U_de_raccord = SecondCurve->FirstParameter();
|
||||
}
|
||||
|
||||
// Les Noeuds
|
||||
Standard_Real eps;
|
||||
for (ii=1; ii<NbK1; ii++) {
|
||||
for (ii=1; ii<=NbK1; ii++) {
|
||||
Noeuds(ii) = Ratio1*FirstCurve->Knot(ii) - Delta1;
|
||||
if(ii > 1) {
|
||||
eps = Epsilon (Abs(Noeuds(ii-1)));
|
||||
@@ -183,11 +181,6 @@ void GeomConvert_CompCurveToBSplineCurve::Add(
|
||||
}
|
||||
Mults(ii) = FirstCurve->Multiplicity(ii);
|
||||
}
|
||||
Noeuds(NbK1) = U_de_raccord;
|
||||
eps = Epsilon (Abs(Noeuds(NbK1-1)));
|
||||
if(Noeuds(NbK1) - Noeuds(NbK1-1) <= eps) {
|
||||
Noeuds(NbK1) += eps;
|
||||
}
|
||||
Mults(NbK1) = FirstCurve->Degree();
|
||||
for (ii=2, jj=NbK1+1; ii<=NbK2; ii++, jj++) {
|
||||
Noeuds(jj) = Ratio2*SecondCurve->Knot(ii) - Delta2;
|
||||
|
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <Adaptor3d_TopolTool.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <Extrema_ExtPS.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
@@ -82,7 +83,7 @@ void GeomInt_IntSS::Perform(const Handle(Geom_Surface)& S1,
|
||||
|
||||
Standard_Real TolArc = Tol;
|
||||
Standard_Real TolTang = Tol;
|
||||
Standard_Real UVMaxStep = 0.001;
|
||||
Standard_Real UVMaxStep = IntPatch_Intersection::DefineUVMaxStep(myHS1, dom1, myHS2, dom2);
|
||||
Standard_Real Deflection = 0.1;
|
||||
|
||||
myIntersector.SetTolerances(TolArc,TolTang,UVMaxStep,Deflection);
|
||||
@@ -184,3 +185,4 @@ void GeomInt_IntSS::Perform(const Handle(Geom_Surface)& S1,
|
||||
StdFail_NotDone_Raise_if(!myIntersector.IsDone(),"GeomInt_IntSS::LineOnS2");
|
||||
return slineS2(Index);
|
||||
}
|
||||
|
||||
|
@@ -106,7 +106,6 @@ public:
|
||||
|
||||
Standard_EXPORT static Handle(Geom2d_BSplineCurve) MakeBSpline2d(const Handle(IntPatch_WLine)& theWLine, const Standard_Integer ideb, const Standard_Integer ifin, const Standard_Boolean onFirst);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
@@ -48,6 +48,7 @@
|
||||
#include <IntRes2d_IntersectionSegment.hxx>
|
||||
#include <IntSurf_Quadric.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <ApproxInt_KnotTools.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : AdjustUPeriodic
|
||||
@@ -623,12 +624,31 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index,
|
||||
ifprm = (Standard_Integer)fprm;
|
||||
ilprm = (Standard_Integer)lprm;
|
||||
}
|
||||
//-- lbr :
|
||||
//-- Si une des surfaces est un plan , on approxime en 2d
|
||||
//-- sur cette surface et on remonte les points 2d en 3d.
|
||||
|
||||
Standard_Boolean anApprox = myApprox;
|
||||
Standard_Boolean anApprox1 = myApprox1;
|
||||
Standard_Boolean anApprox2 = myApprox2;
|
||||
GeomAbs_SurfaceType typs1, typs2;
|
||||
typs1 = myHS1->GetType();
|
||||
typs2 = myHS2->GetType();
|
||||
|
||||
if (typs1 == GeomAbs_Plane) {
|
||||
anApprox = Standard_False;
|
||||
anApprox1 = Standard_True;
|
||||
}
|
||||
else if (typs2 == GeomAbs_Plane) {
|
||||
anApprox = Standard_False;
|
||||
anApprox2 = Standard_True;
|
||||
}
|
||||
|
||||
Approx_ParametrizationType aParType = ApproxInt_KnotTools::DefineParType(WL, ifprm, ilprm,
|
||||
anApprox, anApprox1, anApprox2);
|
||||
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, myHS1 != myHS2, aParType);
|
||||
|
||||
//-- lbr :
|
||||
//-- Si une des surfaces est un plan , on approxime en 2d
|
||||
//-- sur cette surface et on remonte les points 2d en 3d.
|
||||
//
|
||||
if(typs1 == GeomAbs_Plane) {
|
||||
theapp3d.Perform(myHS1, myHS2, WL, Standard_False,
|
||||
@@ -646,12 +666,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index,
|
||||
if ((typs1==GeomAbs_BezierSurface || typs1==GeomAbs_BSplineSurface) &&
|
||||
(typs2==GeomAbs_BezierSurface || typs2==GeomAbs_BSplineSurface)) {
|
||||
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_True);
|
||||
//Standard_Boolean bUseSurfaces;
|
||||
//bUseSurfaces=NotUseSurfacesForApprox(myFace1, myFace2, WL, ifprm, ilprm);
|
||||
//if (bUseSurfaces) {
|
||||
//theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, Standard_False);
|
||||
//}
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_True, aParType);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
@@ -96,7 +96,11 @@ public:
|
||||
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& Value (const Standard_Integer Index) const;
|
||||
|
||||
|
||||
Standard_EXPORT static void Parameters(const GeomInt_TheMultiLineOfWLApprox& Line,
|
||||
const Standard_Integer firstP,
|
||||
const Standard_Integer lastP,
|
||||
const Approx_ParametrizationType Par,
|
||||
math_Vector& TheParameters);
|
||||
|
||||
|
||||
protected:
|
||||
|
@@ -214,9 +214,9 @@ Handle(Image_PixMap) Graphic3d_TextureRoot::GetImage (const Handle(Image_Support
|
||||
void Graphic3d_TextureRoot::convertToCompatible (const Handle(Image_SupportedFormats)& theSupported,
|
||||
const Handle(Image_PixMap)& theImage)
|
||||
{
|
||||
if (theSupported.IsNull()
|
||||
|| theSupported->IsSupported (theImage->Format())
|
||||
|| theImage.IsNull())
|
||||
if (theImage.IsNull()
|
||||
|| theSupported.IsNull()
|
||||
|| theSupported->IsSupported (theImage->Format()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -29,7 +29,7 @@
|
||||
//function : AddPointIntoLine
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static inline void AddPointIntoLine(Handle(IntSurf_LineOn2S) theLine,
|
||||
static inline void AddPointIntoLine(Handle(IntSurf_LineOn2S)& theLine,
|
||||
const Standard_Real* const theArrPeriods,
|
||||
IntSurf_PntOn2S &thePoint,
|
||||
IntPatch_Point* theVertex = 0)
|
||||
@@ -252,6 +252,69 @@ void IntPatch_ALineToWLine::SetTolOpenDomain(const Standard_Real aTol)
|
||||
return myTolOpenDomain;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CorrectEndPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void IntPatch_ALineToWLine::CorrectEndPoint(Handle(IntSurf_LineOn2S)& theLine,
|
||||
const Standard_Integer theIndex) const
|
||||
{
|
||||
const Standard_Real aTol = 1.e-5;
|
||||
const Standard_Real aSqTol = 1.e-10;
|
||||
|
||||
//Perform linear extrapolation from two previous points
|
||||
Standard_Integer anIndFirst, anIndSecond;
|
||||
if (theIndex == 1)
|
||||
{
|
||||
anIndFirst = 3;
|
||||
anIndSecond = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
anIndFirst = theIndex - 2;
|
||||
anIndSecond = theIndex - 1;
|
||||
}
|
||||
IntSurf_PntOn2S aPntOn2S = theLine->Value(theIndex);
|
||||
|
||||
for (Standard_Integer ii = 1; ii <= 2; ii++)
|
||||
{
|
||||
Standard_Boolean anIsOnFirst = (ii == 1);
|
||||
|
||||
const IntSurf_Quadric& aQuad = (ii == 1)? myQuad1 : myQuad2;
|
||||
if (aQuad.TypeQuadric() == GeomAbs_Cone)
|
||||
{
|
||||
const gp_Cone aCone = aQuad.Cone();
|
||||
const gp_Pnt anApex = aCone.Apex();
|
||||
if (anApex.SquareDistance (aPntOn2S.Value()) > aSqTol)
|
||||
continue;
|
||||
}
|
||||
else if (aQuad.TypeQuadric() == GeomAbs_Sphere)
|
||||
{
|
||||
Standard_Real aU, aV;
|
||||
aPntOn2S.ParametersOnSurface(anIsOnFirst, aU, aV);
|
||||
if (Abs(aV - M_PI/2) > aTol &&
|
||||
Abs(aV + M_PI/2) > aTol)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
|
||||
gp_Pnt2d PrevPrevP2d = theLine->Value(anIndFirst).ValueOnSurface(anIsOnFirst);
|
||||
gp_Pnt2d PrevP2d = theLine->Value (anIndSecond).ValueOnSurface(anIsOnFirst);
|
||||
gp_Dir2d aDir = gp_Vec2d(PrevPrevP2d, PrevP2d);
|
||||
Standard_Real aX0 = PrevPrevP2d.X(), aY0 = PrevPrevP2d.Y();
|
||||
Standard_Real aXend, aYend;
|
||||
aPntOn2S.ParametersOnSurface(anIsOnFirst, aXend, aYend);
|
||||
|
||||
if (Abs(aDir.Y()) < gp::Resolution())
|
||||
continue;
|
||||
|
||||
Standard_Real aNewXend = aDir.X()/aDir.Y() * (aYend - aY0) + aX0;
|
||||
|
||||
theLine->SetUV (theIndex, anIsOnFirst, aNewXend, aYend);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetSectionRadius
|
||||
//purpose :
|
||||
@@ -331,24 +394,27 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
||||
#if 0
|
||||
//To draw ALine as a wire DRAW-object use the following code.
|
||||
{
|
||||
static int zzz = 0;
|
||||
zzz++;
|
||||
static int ind = 0;
|
||||
ind++;
|
||||
|
||||
bool flShow = /*(zzz == 1)*/false;
|
||||
bool flShow = true;
|
||||
|
||||
if (flShow)
|
||||
{
|
||||
std::cout << " +++ DUMP ALine (begin) +++++" << std::endl;
|
||||
Standard_Integer aI = 0;
|
||||
const Standard_Real aStep = (theLPar - theFPar) / 9999.0;
|
||||
for (Standard_Real aPrm = theFPar; aPrm < theLPar; aPrm += aStep)
|
||||
const Standard_Integer NbSamples = 20;
|
||||
const Standard_Real aStep = (theLPar - theFPar) / NbSamples;
|
||||
char* name = new char[100];
|
||||
|
||||
for (Standard_Integer ii = 0; ii <= NbSamples; ii++)
|
||||
{
|
||||
Standard_Real aPrm = theFPar + ii * aStep;
|
||||
const gp_Pnt aPP(theALine->Value(aPrm));
|
||||
std::cout << "vertex v" << ++aI << " " << aPP.X() << " " << aPP.Y() << " " << aPP.Z() << std::endl;
|
||||
}
|
||||
std::cout << "vertex v" << ii << " " << aPP.X() << " " << aPP.Y() << " " << aPP.Z() << std::endl;
|
||||
|
||||
gp_Pnt aPP(theALine->Value(theLPar));
|
||||
std::cout << "vertex v" << ++aI << " " << aPP.X() << " " << aPP.Y() << " " << aPP.Z() << std::endl;
|
||||
sprintf(name, "p%d_%d", ii, ind);
|
||||
Draw::Set(name, aPP);
|
||||
}
|
||||
std::cout << " --- DUMP ALine (end) -----" << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -435,6 +501,8 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
||||
|
||||
Standard_Integer aNewVertID = 0;
|
||||
aLinOn2S = new IntSurf_LineOn2S;
|
||||
Standard_Boolean anIsFirstDegenerated = Standard_False,
|
||||
anIsLastDegenerated = Standard_False;
|
||||
|
||||
const Standard_Real aStepMin = 0.1*aStep, aStepMax = 10.0*aStep;
|
||||
|
||||
@@ -467,6 +535,9 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
||||
{
|
||||
// We cannot compute 2D-parameters of
|
||||
// aPOn2S correctly.
|
||||
|
||||
if (anIsLastDegenerated) //the current last point is wrong
|
||||
aLinOn2S->RemovePoint (aLinOn2S->NbPoints());
|
||||
|
||||
isPointValid = Standard_False;
|
||||
}
|
||||
@@ -591,6 +662,27 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
||||
AddPointIntoLine(aLinOn2S, anArrPeriods, aPOn2S);
|
||||
aPrevLPoint = aPOn2S;
|
||||
}
|
||||
else
|
||||
{
|
||||
//add point, set correxponding status: to be corrected later
|
||||
Standard_Boolean ToAdd = Standard_False;
|
||||
if (aLinOn2S->NbPoints() == 0)
|
||||
{
|
||||
anIsFirstDegenerated = Standard_True;
|
||||
ToAdd = Standard_True;
|
||||
}
|
||||
else if (aLinOn2S->NbPoints() > 1)
|
||||
{
|
||||
anIsLastDegenerated = Standard_True;
|
||||
ToAdd = Standard_True;
|
||||
}
|
||||
|
||||
if (ToAdd)
|
||||
{
|
||||
AddPointIntoLine(aLinOn2S, anArrPeriods, aPOn2S);
|
||||
aPrevLPoint = aPOn2S;
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -630,6 +722,15 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
||||
|
||||
aPrePointExist = IsPoleOrSeam(myS1, myS2, aPrefIso, aLinOn2S, aVtx,
|
||||
anArrPeriods, aTol, aSingularSurfaceID);
|
||||
if (aPrePointExist == IntPatch_SPntPole ||
|
||||
aPrePointExist == IntPatch_SPntPoleSeamU)
|
||||
{
|
||||
//set correxponding status: to be corrected later
|
||||
if (aLinOn2S->NbPoints() == 1)
|
||||
anIsFirstDegenerated = Standard_True;
|
||||
else
|
||||
anIsLastDegenerated = Standard_True;
|
||||
}
|
||||
|
||||
const Standard_Real aCurVertParam = aVtx.ParameterOnLine();
|
||||
if(aPrePointExist != IntPatch_SPntNone)
|
||||
@@ -702,6 +803,15 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
||||
continue;
|
||||
}
|
||||
|
||||
//Correct first and last points if needed
|
||||
if (aLinOn2S->NbPoints() >= 3)
|
||||
{
|
||||
if (anIsFirstDegenerated)
|
||||
CorrectEndPoint (aLinOn2S, 1);
|
||||
if (anIsLastDegenerated)
|
||||
CorrectEndPoint (aLinOn2S, aLinOn2S->NbPoints());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
//-- W L i n e c r e a t i o n ---
|
||||
//-----------------------------------------------------------------
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <IntPatch_SequenceOfLine.hxx>
|
||||
#include <IntSurf_Quadric.hxx>
|
||||
#include <IntSurf_LineOn2S.hxx>
|
||||
|
||||
class IntPatch_ALine;
|
||||
class IntSurf_PntOn2S;
|
||||
@@ -90,6 +91,13 @@ protected:
|
||||
//! This check is made for cone and sphere only.
|
||||
Standard_EXPORT Standard_Real GetSectionRadius(const gp_Pnt& thePnt3d) const;
|
||||
|
||||
//! Corrects the U-parameter of an end point (first or last) of the line
|
||||
//! if this end point is a pole.
|
||||
//! The line must contain at least 3 points.
|
||||
//! This is made for cone and sphere only.
|
||||
Standard_EXPORT void CorrectEndPoint(Handle(IntSurf_LineOn2S)& theLine,
|
||||
const Standard_Integer theIndex) const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <ProjLib.hxx>
|
||||
|
||||
|
||||
//======================================================================
|
||||
// function: SequenceOfLine
|
||||
//======================================================================
|
||||
@@ -125,7 +126,7 @@ void IntPatch_Intersection::SetTolerances(const Standard_Real TolArc,
|
||||
if(myTolArc>0.5) myTolArc=0.5;
|
||||
if(myTolTang>0.5) myTolTang=0.5;
|
||||
if(myFleche<1.0e-3) myFleche=1e-3;
|
||||
if(myUVMaxStep<1.0e-3) myUVMaxStep=1e-3;
|
||||
//if(myUVMaxStep<1.0e-3) myUVMaxStep=1e-3;
|
||||
if(myFleche>10) myFleche=10;
|
||||
if(myUVMaxStep>0.5) myUVMaxStep=0.5;
|
||||
}
|
||||
@@ -1023,7 +1024,6 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_Surface)& theS1,
|
||||
myFleche = 0.01;
|
||||
if(myUVMaxStep <= Precision::PConfusion())
|
||||
myUVMaxStep = 0.01;
|
||||
|
||||
done = Standard_False;
|
||||
spnt.Clear();
|
||||
slin.Clear();
|
||||
@@ -1254,15 +1254,16 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_Surface)& t
|
||||
const GeomAbs_SurfaceType typs2)
|
||||
{
|
||||
IntPatch_PrmPrmIntersection interpp;
|
||||
//
|
||||
if(!theD1->DomainIsInfinite() && !theD2->DomainIsInfinite())
|
||||
{
|
||||
Standard_Boolean ClearFlag = Standard_True;
|
||||
if(!ListOfPnts.IsEmpty())
|
||||
{
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolTang,TolArc,myFleche,myUVMaxStep, ListOfPnts);
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolTang,TolArc,myFleche, myUVMaxStep, ListOfPnts);
|
||||
ClearFlag = Standard_False;
|
||||
}
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolTang,TolArc,myFleche,myUVMaxStep,ClearFlag);
|
||||
interpp.Perform(theS1,theD1,theS2,theD2,TolTang,TolArc,myFleche, myUVMaxStep,ClearFlag);
|
||||
}
|
||||
else if((theD1->DomainIsInfinite()) ^ (theD2->DomainIsInfinite()))
|
||||
{
|
||||
@@ -1275,7 +1276,7 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_Surface)& t
|
||||
const Standard_Real AP = Max(MU, MV);
|
||||
Handle(Adaptor3d_Surface) SS;
|
||||
FUN_TrimInfSurf(pMinXYZ, pMaxXYZ, theS1, AP, SS);
|
||||
interpp.Perform(SS,theD1,theS2,theD2,TolTang,TolArc,myFleche,myUVMaxStep);
|
||||
interpp.Perform(SS,theD1,theS2,theD2,TolTang,TolArc,myFleche, myUVMaxStep);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1285,7 +1286,7 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_Surface)& t
|
||||
const Standard_Real AP = Max(MU, MV);
|
||||
Handle(Adaptor3d_Surface) SS;
|
||||
FUN_TrimInfSurf(pMinXYZ, pMaxXYZ, theS2, AP, SS);
|
||||
interpp.Perform(theS1, theD1, SS, theD2,TolTang, TolArc,myFleche,myUVMaxStep);
|
||||
interpp.Perform(theS1, theD1, SS, theD2,TolTang, TolArc,myFleche, myUVMaxStep);
|
||||
}
|
||||
}//(theD1->DomainIsInfinite()) ^ (theD2->DomainIsInfinite())
|
||||
else
|
||||
@@ -1324,7 +1325,7 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_Surface)& t
|
||||
Handle(Adaptor3d_Surface) nS1 = theS1;
|
||||
Handle(Adaptor3d_Surface) nS2 = theS2;
|
||||
FUN_TrimBothSurf(theS1,typs1,theS2,typs2,1.e+8,nS1,nS2);
|
||||
interpp.Perform(nS1,theD1,nS2,theD2,TolTang,TolArc,myFleche,myUVMaxStep);
|
||||
interpp.Perform(nS1,theD1,nS2,theD2,TolTang,TolArc,myFleche, myUVMaxStep);
|
||||
}// 'NON - COLLINEAR LINES'
|
||||
}// both domains are infinite
|
||||
|
||||
@@ -1791,3 +1792,134 @@ void IntPatch_Intersection::Dump(const Standard_Integer /*Mode*/,
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CheckSingularPoints
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean IntPatch_Intersection::CheckSingularPoints(
|
||||
const Handle(Adaptor3d_Surface)& theS1,
|
||||
const Handle(Adaptor3d_TopolTool)& theD1,
|
||||
const Handle(Adaptor3d_Surface)& theS2,
|
||||
Standard_Real& theDist)
|
||||
{
|
||||
theDist = Precision::Infinite();
|
||||
Standard_Boolean isSingular = Standard_False;
|
||||
if (theS1 == theS2)
|
||||
{
|
||||
return isSingular;
|
||||
}
|
||||
//
|
||||
const Standard_Integer aNbBndPnts = 5;
|
||||
const Standard_Real aTol = Precision::Confusion();
|
||||
Standard_Integer i;
|
||||
theD1->Init();
|
||||
Standard_Boolean isU = Standard_True;
|
||||
for (; theD1->More(); theD1->Next())
|
||||
{
|
||||
Handle(Adaptor2d_Curve2d) aBnd = theD1->Value();
|
||||
Standard_Real pinf = aBnd->FirstParameter(), psup = aBnd->LastParameter();
|
||||
if (Precision::IsNegativeInfinite(pinf) || Precision::IsPositiveInfinite(psup))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Standard_Real t, dt = (psup - pinf) / (aNbBndPnts - 1);
|
||||
gp_Pnt2d aP1;
|
||||
gp_Vec2d aDir;
|
||||
aBnd->D1((pinf + psup) / 2., aP1, aDir);
|
||||
if (Abs(aDir.X()) > Abs(aDir.Y()))
|
||||
isU = Standard_True;
|
||||
else
|
||||
isU = Standard_False;
|
||||
gp_Pnt aPP1;
|
||||
gp_Vec aDU, aDV;
|
||||
Standard_Real aD1NormMax = 0.;
|
||||
gp_XYZ aPmid(0., 0., 0.);
|
||||
Standard_Integer aNb = 0;
|
||||
for (t = pinf; t <= psup; t += dt)
|
||||
{
|
||||
aP1 = aBnd->Value(t);
|
||||
theS1->D1(aP1.X(), aP1.Y(), aPP1, aDU, aDV);
|
||||
if (isU)
|
||||
aD1NormMax = Max(aD1NormMax, aDU.Magnitude());
|
||||
else
|
||||
aD1NormMax = Max(aD1NormMax, aDV.Magnitude());
|
||||
|
||||
aPmid += aPP1.XYZ();
|
||||
aNb++;
|
||||
|
||||
if (aD1NormMax > aTol)
|
||||
break;
|
||||
}
|
||||
|
||||
if (aD1NormMax <= aTol)
|
||||
{
|
||||
//Singular point aPP1;
|
||||
aPmid /= aNb;
|
||||
aPP1.SetXYZ(aPmid);
|
||||
Standard_Real aTolU = Precision::PConfusion(), aTolV = Precision::PConfusion();
|
||||
Extrema_ExtPS aProj(aPP1, *theS2.get(), aTolU, aTolV, Extrema_ExtFlag_MIN);
|
||||
|
||||
if (aProj.IsDone())
|
||||
{
|
||||
Standard_Integer aNbExt = aProj.NbExt();
|
||||
for (i = 1; i <= aNbExt; ++i)
|
||||
{
|
||||
theDist = Min(theDist, aProj.SquareDistance(i));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (!Precision::IsInfinite(theDist))
|
||||
{
|
||||
theDist = Sqrt(theDist);
|
||||
isSingular = Standard_True;
|
||||
}
|
||||
|
||||
return isSingular;
|
||||
|
||||
}
|
||||
//=======================================================================
|
||||
//function : DefineUVMaxStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real IntPatch_Intersection::DefineUVMaxStep(
|
||||
const Handle(Adaptor3d_Surface)& theS1,
|
||||
const Handle(Adaptor3d_TopolTool)& theD1,
|
||||
const Handle(Adaptor3d_Surface)& theS2,
|
||||
const Handle(Adaptor3d_TopolTool)& theD2)
|
||||
{
|
||||
Standard_Real anUVMaxStep = 0.001;
|
||||
Standard_Real aDistToSing1 = Precision::Infinite();
|
||||
Standard_Real aDistToSing2 = Precision::Infinite();
|
||||
const Standard_Real aTolMin = Precision::Confusion(), aTolMax = 1.e-5;
|
||||
if (theS1 != theS2)
|
||||
{
|
||||
Standard_Boolean isSing1 = CheckSingularPoints(theS1, theD1, theS2, aDistToSing1);
|
||||
if (isSing1)
|
||||
{
|
||||
if (aDistToSing1 > aTolMin && aDistToSing1 < aTolMax)
|
||||
{
|
||||
anUVMaxStep = 0.0001;
|
||||
}
|
||||
else
|
||||
{
|
||||
isSing1 = Standard_False;
|
||||
}
|
||||
}
|
||||
if (!isSing1)
|
||||
{
|
||||
Standard_Boolean isSing2 = CheckSingularPoints(theS2, theD2, theS1, aDistToSing2);
|
||||
if (isSing2)
|
||||
{
|
||||
if (aDistToSing2 > aTolMin && aDistToSing2 < aTolMax)
|
||||
{
|
||||
anUVMaxStep = 0.0001;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return anUVMaxStep;
|
||||
}
|
||||
|
||||
|
@@ -133,7 +133,21 @@ public:
|
||||
//! Mode for more accurate dumps.
|
||||
Standard_EXPORT void Dump (const Standard_Integer Mode, const Handle(Adaptor3d_Surface)& S1, const Handle(Adaptor3d_TopolTool)& D1, const Handle(Adaptor3d_Surface)& S2, const Handle(Adaptor3d_TopolTool)& D2) const;
|
||||
|
||||
//! Checks if surface theS1 has degenerated boundary (dS/du or dS/dv = 0) and
|
||||
//! calculates minimal distance between corresponding singular points and surface theS2
|
||||
//! If singular point exists the method returns "true" and stores minimal distance in theDist.
|
||||
Standard_EXPORT static Standard_Boolean CheckSingularPoints(
|
||||
const Handle(Adaptor3d_Surface)& theS1,
|
||||
const Handle(Adaptor3d_TopolTool)& theD1,
|
||||
const Handle(Adaptor3d_Surface)& theS2,
|
||||
Standard_Real& theDist);
|
||||
|
||||
//! Calculates recommended value for myUVMaxStep depending on surfaces and their domains
|
||||
Standard_EXPORT static Standard_Real DefineUVMaxStep(
|
||||
const Handle(Adaptor3d_Surface)& theS1,
|
||||
const Handle(Adaptor3d_TopolTool)& theD1,
|
||||
const Handle(Adaptor3d_Surface)& theS2,
|
||||
const Handle(Adaptor3d_TopolTool)& theD2);
|
||||
|
||||
|
||||
protected:
|
||||
|
@@ -2386,6 +2386,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf
|
||||
//Try to extend the intersection line to the boundary,
|
||||
//if it is possibly
|
||||
PW.PutToBoundary(Surf1, Surf2);
|
||||
//
|
||||
if (PW.NbPoints() < 3)
|
||||
continue;
|
||||
|
||||
const Standard_Integer aMinNbPoints = 40;
|
||||
if(PW.NbPoints() < aMinNbPoints)
|
||||
|
@@ -649,8 +649,11 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
IntCS.ParameterOnSurface(U2,V2);
|
||||
gp_Pnt anOldPnt, aNewPnt;
|
||||
OtherSurf->D0(U,V, anOldPnt);
|
||||
OtherSurf->D0(U2,V2, aNewPnt);
|
||||
if (anOldPnt.SquareDistance(aNewPnt) < Precision::SquareConfusion())
|
||||
OtherSurf->D0(U2,V2, aNewPnt);
|
||||
//if (anOldPnt.SquareDistance(aNewPnt) < Precision::SquareConfusion())
|
||||
Standard_Real aTolConf = Max(Precision::Confusion(), edgeTol);
|
||||
|
||||
if (anOldPnt.SquareDistance(aNewPnt) < aTolConf * aTolConf)
|
||||
{
|
||||
U2 = U;
|
||||
V2 = V;
|
||||
|
@@ -471,8 +471,7 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol)
|
||||
|
||||
//----------------------------------------------------
|
||||
//-- On detecte les points confondus dans la LineOn2S
|
||||
Standard_Real dmini = Precision::Confusion();
|
||||
dmini*=dmini;
|
||||
Standard_Real dmini = Precision::SquareConfusion();
|
||||
for(i=2; (i<=nbponline) && (nbponline > 2); i++) {
|
||||
const IntSurf_PntOn2S& aPnt1=curv->Value(i-1);
|
||||
const IntSurf_PntOn2S& aPnt2=curv->Value(i);
|
||||
@@ -516,7 +515,20 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol)
|
||||
|
||||
IntSurf_PntOn2S POn2S = svtx.Value(i).PntOn2S();
|
||||
RecadreMemePeriode(POn2S,curv->Value(1),U1Period(),V1Period(),U2Period(),V2Period());
|
||||
curv->Value(1,POn2S);
|
||||
if (myCreationWay == IntPatch_WLImpImp)
|
||||
{
|
||||
//Adjust first point of curve to corresponding vertex the following way:
|
||||
//set 3D point as the point of the vertex and 2D points as the points of the point on curve.
|
||||
curv->SetPoint (1, POn2S.Value());
|
||||
Standard_Real mu1,mv1,mu2,mv2;
|
||||
curv->Value(1).Parameters(mu1,mv1,mu2,mv2);
|
||||
svtx.ChangeValue(i).SetParameter(1);
|
||||
svtx.ChangeValue(i).SetParameters(mu1,mv1,mu2,mv2);
|
||||
}
|
||||
else
|
||||
{
|
||||
curv->Value(1,POn2S);
|
||||
}
|
||||
|
||||
//--curv->Value(1,svtx.Value(i).PntOn2S());
|
||||
svtx.ChangeValue(i).SetParameter(1.0);
|
||||
@@ -551,6 +563,9 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol)
|
||||
//---------------------------------------------------------
|
||||
Standard_Boolean Substitution = Standard_False;
|
||||
//-- for(k=indicevertexonline+1; !Substitution && k>=indicevertexonline-1;k--) { avant le 9 oct 97
|
||||
Standard_Real mu1,mv1,mu2,mv2;
|
||||
curv->Value(indicevertexonline).Parameters(mu1,mv1,mu2,mv2);
|
||||
|
||||
for(k=indicevertexonline+1; k>=indicevertexonline-1;k--) {
|
||||
if(k>0 && k<=nbponline) {
|
||||
if(CompareVertexAndPoint(P,curv->Value(k).Value(),vTol)) {
|
||||
@@ -560,9 +575,21 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol)
|
||||
//-------------------------------------------------------
|
||||
IntSurf_PntOn2S POn2S = svtx.Value(i).PntOn2S();
|
||||
RecadreMemePeriode(POn2S,curv->Value(k),U1Period(),V1Period(),U2Period(),V2Period());
|
||||
curv->Value(k,POn2S);
|
||||
Standard_Real mu1,mv1,mu2,mv2;
|
||||
POn2S.Parameters(mu1,mv1,mu2,mv2);
|
||||
|
||||
if (myCreationWay == IntPatch_WLImpImp)
|
||||
{
|
||||
//Adjust a point of curve to corresponding vertex the following way:
|
||||
//set 3D point as the point of the vertex and 2D points as the points
|
||||
//of the point on curve with index <indicevertexonline>
|
||||
curv->SetPoint (k, POn2S.Value());
|
||||
curv->SetUV (k, Standard_True, mu1, mv1);
|
||||
curv->SetUV (k, Standard_False, mu2, mv2);
|
||||
}
|
||||
else
|
||||
{
|
||||
curv->Value(k,POn2S);
|
||||
POn2S.Parameters(mu1,mv1,mu2,mv2);
|
||||
}
|
||||
svtx.ChangeValue(i).SetParameter(k);
|
||||
svtx.ChangeValue(i).SetParameters(mu1,mv1,mu2,mv2);
|
||||
Substitution = Standard_True;
|
||||
|
@@ -62,9 +62,14 @@ public:
|
||||
//! Replaces the point of range Index in the line.
|
||||
void Value (const Standard_Integer Index, const IntSurf_PntOn2S& P);
|
||||
|
||||
//! Sets the 3D point of the Index-th PntOn2S
|
||||
Standard_EXPORT void SetPoint(const Standard_Integer Index, const gp_Pnt& thePnt);
|
||||
|
||||
//! Sets the parametric coordinates on one of the surfaces
|
||||
//! of the point of range Index in the line.
|
||||
Standard_EXPORT void SetUV(const Standard_Integer Index, const Standard_Boolean OnFirst, const Standard_Real U, const Standard_Real V);
|
||||
Standard_EXPORT void SetUV(const Standard_Integer Index,
|
||||
const Standard_Boolean OnFirst,
|
||||
const Standard_Real U, const Standard_Real V);
|
||||
|
||||
void Clear();
|
||||
|
||||
|
@@ -38,6 +38,12 @@ inline void IntSurf_LineOn2S::Value(const Standard_Integer Index,
|
||||
mySeq(Index) = P;
|
||||
}
|
||||
|
||||
inline void IntSurf_LineOn2S::SetPoint(const Standard_Integer Index,
|
||||
const gp_Pnt& thePnt)
|
||||
{
|
||||
mySeq(Index).SetValue (thePnt);
|
||||
}
|
||||
|
||||
inline void IntSurf_LineOn2S::Clear ()
|
||||
{
|
||||
mySeq.Clear();
|
||||
|
@@ -55,6 +55,7 @@
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <ApproxInt_KnotTools.hxx>
|
||||
|
||||
static
|
||||
void Parameters(const Handle(GeomAdaptor_Surface)&,
|
||||
@@ -502,7 +503,7 @@ void IntTools_FaceFace::Perform (const TopoDS_Face& aF1,
|
||||
Tolerances(myHS1, myHS2, TolTang);
|
||||
|
||||
{
|
||||
const Standard_Real UVMaxStep = 0.001;
|
||||
const Standard_Real UVMaxStep = IntPatch_Intersection::DefineUVMaxStep(myHS1, dom1, myHS2, dom2);
|
||||
const Standard_Real Deflection = 0.1;
|
||||
myIntersector.SetTolerances(TolArc, TolTang, UVMaxStep, Deflection);
|
||||
}
|
||||
@@ -1164,22 +1165,6 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
||||
tol2d = myTolApprox;
|
||||
}
|
||||
|
||||
if(myHS1 == myHS2) {
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_False, aParType);
|
||||
rejectSurface = Standard_True;
|
||||
}
|
||||
else {
|
||||
if(reApprox && !rejectSurface)
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_False, aParType);
|
||||
else {
|
||||
Standard_Integer iDegMax, iDegMin, iNbIter;
|
||||
//
|
||||
ApproxParameters(myHS1, myHS2, iDegMin, iDegMax, iNbIter);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, iDegMin, iDegMax,
|
||||
iNbIter, 30, Standard_True, aParType);
|
||||
}
|
||||
}
|
||||
//
|
||||
Standard_Real aReachedTol = Precision::Confusion();
|
||||
bIsDecomposited = IntTools_WLineTool::
|
||||
DecompositionOfWLine(WL,
|
||||
@@ -1227,6 +1212,35 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
||||
ilprm = (Standard_Integer)lprm;
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Boolean anApprox = myApprox;
|
||||
if (typs1 == GeomAbs_Plane) {
|
||||
anApprox = Standard_False;
|
||||
anApprox1 = Standard_True;
|
||||
}
|
||||
else if (typs2 == GeomAbs_Plane) {
|
||||
anApprox = Standard_False;
|
||||
anApprox2 = Standard_True;
|
||||
}
|
||||
|
||||
aParType = ApproxInt_KnotTools::DefineParType(WL, ifprm, ilprm,
|
||||
anApprox, anApprox1, anApprox2);
|
||||
if (myHS1 == myHS2) {
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_False, aParType);
|
||||
rejectSurface = Standard_True;
|
||||
}
|
||||
else {
|
||||
if (reApprox && !rejectSurface)
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_False, aParType);
|
||||
else {
|
||||
Standard_Integer iDegMax, iDegMin, iNbIter;
|
||||
//
|
||||
ApproxParameters(myHS1, myHS2, iDegMin, iDegMax, iNbIter);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, iDegMin, iDegMax,
|
||||
iNbIter, 30, Standard_True, aParType);
|
||||
}
|
||||
}
|
||||
|
||||
//-- lbr :
|
||||
//-- Si une des surfaces est un plan , on approxime en 2d
|
||||
//-- sur cette surface et on remonte les points 2d en 3d.
|
||||
@@ -1892,6 +1906,7 @@ Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL,
|
||||
enlarge=Standard_True;
|
||||
}
|
||||
//
|
||||
|
||||
if(!isuperiodic && enlarge) {
|
||||
|
||||
if(!Precision::IsInfinite(theumin) &&
|
||||
@@ -1907,6 +1922,7 @@ Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL,
|
||||
else
|
||||
theumax = usup;
|
||||
}
|
||||
|
||||
//
|
||||
if(!isvperiodic && enlarge) {
|
||||
if(!Precision::IsInfinite(thevmin) &&
|
||||
@@ -1924,6 +1940,7 @@ Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL,
|
||||
thevmax = vsup;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if(isuperiodic || isvperiodic) {
|
||||
Standard_Boolean correct = Standard_False;
|
||||
|
@@ -400,8 +400,15 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage
|
||||
|
||||
//Normalizing factor. If it is less than 1.0 then the range will be expanded.
|
||||
//This is no good for computation. Therefore, it is limited.
|
||||
const Standard_Real deltau = mySRangeU.IsVoid() ? UM - Um : Max(mySRangeU.Delta(), 1.0);
|
||||
const Standard_Real deltav = mySRangeV.IsVoid() ? VM - Vm : Max(mySRangeV.Delta(), 1.0);
|
||||
//Do not limit this factor in case of highly anisotropic parametrization
|
||||
//(parametric space is considerably larger in one direction than another).
|
||||
const Standard_Boolean isHighlyAnisotropic = Max(tolu, tolv) > 1000. * Min(tolu, tolv);
|
||||
const Standard_Real deltau = mySRangeU.IsVoid() ? UM - Um
|
||||
: (isHighlyAnisotropic ? mySRangeU.Delta()
|
||||
: Max(mySRangeU.Delta(), 1.0));
|
||||
const Standard_Real deltav = mySRangeV.IsVoid() ? VM - Vm
|
||||
: (isHighlyAnisotropic ? mySRangeV.Delta()
|
||||
: Max(mySRangeV.Delta(), 1.0));
|
||||
|
||||
Up/=deltau; UV1/=deltau;
|
||||
Vp/=deltav; UV2/=deltav;
|
||||
|
@@ -2316,10 +2316,65 @@ Standard_Boolean IntWalk_PWalking::HandleSingleSingularPoint(const Handle(Adapto
|
||||
if (anInt.IsEmpty())
|
||||
continue;
|
||||
|
||||
anInt.Point().Parameters(thePnt(1), thePnt(2), thePnt(3), thePnt(4));
|
||||
|
||||
Standard_Real aPars[4];
|
||||
anInt.Point().Parameters(aPars[0], aPars[1], aPars[2], aPars[3]);
|
||||
Handle(Adaptor3d_Surface) aSurfs[2] = { theASurf1, theASurf2 };
|
||||
//Local resolutions
|
||||
Standard_Real aTol2 = the3DTol * the3DTol;
|
||||
gp_Pnt aP;
|
||||
gp_Vec aDU, aDV;
|
||||
gp_Pnt aPInt;
|
||||
Standard_Integer k;
|
||||
for (k = 0; k < 2; ++k)
|
||||
{
|
||||
Standard_Integer iu, iv;
|
||||
iu = 2*k;
|
||||
iv = iu + 1;
|
||||
aSurfs[k]->D1(aPars[iu], aPars[iv], aPInt, aDU, aDV);
|
||||
Standard_Real aMod = aDU.Magnitude();
|
||||
if (aMod > Precision::Confusion())
|
||||
{
|
||||
Standard_Real aTolU = the3DTol / aMod;
|
||||
if (Abs(aLowBorder[iu] - aPars[iu]) < aTolU)
|
||||
{
|
||||
aP = aSurfs[k]->Value(aLowBorder[iu], aPars[iv]);
|
||||
if (aPInt.SquareDistance(aP) < aTol2)
|
||||
aPars[iu] = aLowBorder[iu];
|
||||
}
|
||||
else if (Abs(aUppBorder[iu] - aPars[iu]) < aTolU)
|
||||
{
|
||||
aP = aSurfs[k]->Value(aUppBorder[iu], aPars[iv]);
|
||||
if (aPInt.SquareDistance(aP) < aTol2)
|
||||
aPars[iu] = aUppBorder[iu];
|
||||
}
|
||||
}
|
||||
aMod = aDV.Magnitude();
|
||||
if (aMod > Precision::Confusion())
|
||||
{
|
||||
Standard_Real aTolV = the3DTol / aMod;
|
||||
if (Abs(aLowBorder[iv] - aPars[iv]) < aTolV)
|
||||
{
|
||||
aP = aSurfs[k]->Value(aPars[iu], aLowBorder[iv]);
|
||||
if (aPInt.SquareDistance(aP) < aTol2)
|
||||
aPars[iv] = aLowBorder[iv];
|
||||
}
|
||||
else if (Abs(aUppBorder[iv] - aPars[iv]) < aTolV)
|
||||
{
|
||||
aP = aSurfs[k]->Value(aPars[iu], aUppBorder[iv]);
|
||||
if (aPInt.SquareDistance(aP) < aTol2)
|
||||
aPars[iv] = aUppBorder[iv];
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
//
|
||||
Standard_Integer j;
|
||||
for (j = 1; j <= 4; ++j)
|
||||
{
|
||||
thePnt(j) = aPars[j - 1];
|
||||
}
|
||||
Standard_Boolean isInDomain = Standard_True;
|
||||
for (Standard_Integer j = 1; isInDomain && (j <= 4); ++j)
|
||||
for (j = 1; isInDomain && (j <= 4); ++j)
|
||||
{
|
||||
if ((thePnt(j) - aLowBorder[j - 1] + Precision::PConfusion())*
|
||||
(thePnt(j) - aUppBorder[j - 1] - Precision::PConfusion()) > 0.0)
|
||||
@@ -2461,13 +2516,13 @@ Standard_Boolean IntWalk_PWalking::
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (aPInd == 1)
|
||||
{
|
||||
// After insertion, we will obtain
|
||||
// two coincident points in the line.
|
||||
// Therefore, insertion is forbidden.
|
||||
return isOK;
|
||||
}
|
||||
//else if (aPInd == 1)
|
||||
//{
|
||||
// // After insertion, we will obtain
|
||||
// // two coincident points in the line.
|
||||
// // Therefore, insertion is forbidden.
|
||||
// return isOK;
|
||||
//}
|
||||
}
|
||||
|
||||
for (++aPInd; aPInd <= aNbPnts; aPInd++)
|
||||
@@ -2493,6 +2548,12 @@ Standard_Boolean IntWalk_PWalking::
|
||||
RemoveAPoint(1);
|
||||
}
|
||||
|
||||
aP1.SetXYZ(line->Value(1).Value().XYZ());
|
||||
if (aP1.SquareDistance(aPInt) <= Precision::SquareConfusion())
|
||||
{
|
||||
RemoveAPoint(1);
|
||||
}
|
||||
|
||||
line->InsertBefore(1, anIP);
|
||||
isOK = Standard_True;
|
||||
}
|
||||
@@ -2511,13 +2572,13 @@ Standard_Boolean IntWalk_PWalking::
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (aPInd == aNbPnts)
|
||||
{
|
||||
// After insertion, we will obtain
|
||||
// two coincident points in the line.
|
||||
// Therefore, insertion is forbidden.
|
||||
return isOK;
|
||||
}
|
||||
//else if (aPInd == aNbPnts)
|
||||
//{
|
||||
// // After insertion, we will obtain
|
||||
// // two coincident points in the line.
|
||||
// // Therefore, insertion is forbidden.
|
||||
// return isOK;
|
||||
//}
|
||||
}
|
||||
|
||||
for (--aPInd; aPInd > 0; aPInd--)
|
||||
@@ -2543,7 +2604,14 @@ Standard_Boolean IntWalk_PWalking::
|
||||
RemoveAPoint(aNbPnts);
|
||||
}
|
||||
|
||||
Standard_Integer aNbPnts = line->NbPoints();
|
||||
aP1.SetXYZ(line->Value(aNbPnts).Value().XYZ());
|
||||
if (aP1.SquareDistance(aPInt) <= Precision::SquareConfusion())
|
||||
{
|
||||
RemoveAPoint(aNbPnts);
|
||||
}
|
||||
line->Add(anIP);
|
||||
|
||||
isOK = Standard_True;
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include <BRepTopAdaptor_TopolTool.hxx>
|
||||
#include <GC_MakeCircle.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <GCE2d_MakeLine.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dConvert.hxx>
|
||||
@@ -46,6 +47,7 @@
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomConvert.hxx>
|
||||
#include <GeomConvert_ApproxSurface.hxx>
|
||||
#include <GeomConvert_CompCurveToBSplineCurve.hxx>
|
||||
#include <GeomLib_IsPlanarSurface.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
@@ -102,6 +104,19 @@
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_UnifySameDomain,Standard_Transient)
|
||||
|
||||
static Standard_Boolean IsOnSingularity(const TopTools_ListOfShape& theEdgeList)
|
||||
{
|
||||
TopTools_ListIteratorOfListOfShape anItl (theEdgeList);
|
||||
for (; anItl.More(); anItl.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anItl.Value());
|
||||
if (BRep_Tool::Degenerated (anEdge))
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
static void SplitWire (const TopoDS_Wire& theWire,
|
||||
const TopoDS_Face& theFace,
|
||||
const TopTools_IndexedMapOfShape& theVmap,
|
||||
@@ -1212,7 +1227,31 @@ static Standard_Boolean GetNormalToSurface(const TopoDS_Face& theFace,
|
||||
{
|
||||
Standard_Real f, l;
|
||||
// get 2d curve to get point in 2d
|
||||
const Handle(Geom2d_Curve)& aC2d = BRep_Tool::CurveOnSurface(theEdge, theFace, f, l);
|
||||
Handle(Geom2d_Curve) aC2d;
|
||||
if (BRep_Tool::IsClosed(theEdge, theFace))
|
||||
{
|
||||
//Find the edge in the face: it will have correct orientation
|
||||
TopoDS_Edge anEdgeInFace;
|
||||
TopoDS_Face aFace = theFace;
|
||||
aFace.Orientation (TopAbs_FORWARD);
|
||||
TopExp_Explorer anExplo (aFace, TopAbs_EDGE);
|
||||
for (; anExplo.More(); anExplo.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anExplo.Current());
|
||||
if (anEdge.IsSame (theEdge))
|
||||
{
|
||||
anEdgeInFace = anEdge;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (anEdgeInFace.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
aC2d = BRep_Tool::CurveOnSurface (anEdgeInFace, aFace, f, l);
|
||||
}
|
||||
else
|
||||
aC2d = BRep_Tool::CurveOnSurface(theEdge, theFace, f, l);
|
||||
|
||||
if (aC2d.IsNull()) {
|
||||
return Standard_False;
|
||||
}
|
||||
@@ -1576,9 +1615,6 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape&
|
||||
if (isFound)
|
||||
continue;
|
||||
|
||||
Standard_Real aFirst, aLast;
|
||||
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface (aFirstEdge, aFace, aFirst, aLast);
|
||||
|
||||
aFaceSeq.Append (aFace);
|
||||
}
|
||||
|
||||
@@ -1623,6 +1659,9 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape&
|
||||
|
||||
if (aPCurveSeq.IsEmpty()) {
|
||||
Handle(Geom2d_Curve) aCopyPCurve = Handle(Geom2d_Curve)::DownCast(aPCurve->Copy());
|
||||
if (aCopyPCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
|
||||
aCopyPCurve = (Handle(Geom2d_TrimmedCurve)::DownCast(aCopyPCurve))->BasisCurve();
|
||||
|
||||
aPCurveSeq.Append(aCopyPCurve);
|
||||
aFirstsSeq.Append(aFirst);
|
||||
aLastsSeq.Append(aLast);
|
||||
@@ -1697,6 +1736,9 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape&
|
||||
else
|
||||
{
|
||||
Handle(Geom2d_Curve) aCopyPCurve = Handle(Geom2d_Curve)::DownCast(aPCurve->Copy());
|
||||
if (aCopyPCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
|
||||
aCopyPCurve = (Handle(Geom2d_TrimmedCurve)::DownCast(aCopyPCurve))->BasisCurve();
|
||||
|
||||
aPCurveSeq.Append(aCopyPCurve);
|
||||
aFirstsSeq.Append(aFirst);
|
||||
aLastsSeq.Append(aLast);
|
||||
@@ -1817,57 +1859,53 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape&
|
||||
}
|
||||
}
|
||||
|
||||
//Reparametrize 3d curve if needed
|
||||
//Reparametrize pcurves if needed
|
||||
if (!ResPCurves.IsEmpty())
|
||||
{
|
||||
if (Abs (aFirst3d - ResFirsts(1)) > aMaxTol ||
|
||||
Abs (aLast3d - ResLasts(1)) > aMaxTol)
|
||||
for (Standard_Integer ii = 1; ii <= ResPCurves.Length(); ii++)
|
||||
{
|
||||
GeomAdaptor_Curve aGAcurve (aCurve);
|
||||
GeomAbs_CurveType aType = aGAcurve.GetType();
|
||||
if (aType == GeomAbs_Line)
|
||||
if (Abs (aFirst3d - ResFirsts(ii)) > aMaxTol ||
|
||||
Abs (aLast3d - ResLasts(ii)) > aMaxTol)
|
||||
{
|
||||
gp_Lin aLin = aGAcurve.Line();
|
||||
gp_Dir aDir = aLin.Direction();
|
||||
gp_Pnt aPnt = aGAcurve.Value (aFirst3d);
|
||||
gp_Vec anOffset = -aDir;
|
||||
anOffset *= ResFirsts(1);
|
||||
aPnt.Translate (anOffset);
|
||||
Handle(Geom_Line) aLine = new Geom_Line (aPnt, aDir);
|
||||
aBuilder.UpdateEdge (theEdge, aLine, aTolEdge);
|
||||
aBuilder.Range(theEdge, ResFirsts(1), ResLasts(1));
|
||||
}
|
||||
else if (aType == GeomAbs_Circle)
|
||||
{
|
||||
gp_Circ aCirc = aGAcurve.Circle();
|
||||
Standard_Real aRadius = aCirc.Radius();
|
||||
gp_Ax2 aPosition = aCirc.Position();
|
||||
gp_Ax1 anAxis = aPosition.Axis();
|
||||
Standard_Real anOffset = aFirst3d - ResFirsts(1);
|
||||
aPosition.Rotate (anAxis, anOffset);
|
||||
Handle(Geom_Circle) aCircle = new Geom_Circle (aPosition, aRadius);
|
||||
aBuilder.UpdateEdge (theEdge, aCircle, aTolEdge);
|
||||
aBuilder.Range(theEdge, ResFirsts(1), ResLasts(1));
|
||||
}
|
||||
else //general case
|
||||
{
|
||||
for (Standard_Integer ii = 1; ii <= ResPCurves.Length(); ii++)
|
||||
Geom2dAdaptor_Curve aGAcurve (ResPCurves(ii));
|
||||
GeomAbs_CurveType aType = aGAcurve.GetType();
|
||||
if (aType == GeomAbs_Line)
|
||||
{
|
||||
if (Abs (aFirst3d - ResFirsts(ii)) > Precision::Confusion() ||
|
||||
Abs (aLast3d - ResLasts(ii)) > Precision::Confusion())
|
||||
{
|
||||
Handle(Geom2d_TrimmedCurve) aTrPCurve =
|
||||
new Geom2d_TrimmedCurve (ResPCurves(ii), ResFirsts(ii), ResLasts(ii));
|
||||
Handle(Geom2d_BSplineCurve) aBSplinePCurve = Geom2dConvert::CurveToBSplineCurve(aTrPCurve);
|
||||
TColStd_Array1OfReal aKnots (1, aBSplinePCurve->NbKnots());
|
||||
aBSplinePCurve->Knots (aKnots);
|
||||
BSplCLib::Reparametrize (aFirst3d, aLast3d, aKnots);
|
||||
aBSplinePCurve->SetKnots (aKnots);
|
||||
ResPCurves(ii) = aBSplinePCurve;
|
||||
}
|
||||
gp_Lin2d aLin2d = aGAcurve.Line();
|
||||
gp_Dir2d aDir2d = aLin2d.Direction();
|
||||
gp_Pnt2d aPnt2d = aGAcurve.Value(ResFirsts(ii));
|
||||
gp_Vec2d anOffset = -aDir2d;
|
||||
anOffset *= aFirst3d;
|
||||
aPnt2d.Translate (anOffset);
|
||||
Handle(Geom2d_Line) aNewLine2d = new Geom2d_Line (aPnt2d, aDir2d);
|
||||
ResPCurves(ii) = aNewLine2d;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (aType == GeomAbs_Circle)
|
||||
{
|
||||
gp_Circ2d aCirc2d = aGAcurve.Circle();
|
||||
Standard_Real aRadius = aCirc2d.Radius();
|
||||
gp_Ax22d aPosition = aCirc2d.Position();
|
||||
gp_Pnt2d aLocation = aCirc2d.Location();
|
||||
Standard_Real anOffset = ResFirsts(ii) - aFirst3d;
|
||||
aPosition.Rotate (aLocation, anOffset);
|
||||
Handle(Geom2d_Circle) aNewCircle2d = new Geom2d_Circle (aPosition, aRadius);
|
||||
ResPCurves(ii) = aNewCircle2d;
|
||||
}
|
||||
else //general case
|
||||
{
|
||||
Handle(Geom2d_TrimmedCurve) aTrPCurve =
|
||||
new Geom2d_TrimmedCurve (ResPCurves(ii), ResFirsts(ii), ResLasts(ii));
|
||||
Handle(Geom2d_BSplineCurve) aBSplinePCurve = Geom2dConvert::CurveToBSplineCurve(aTrPCurve);
|
||||
TColStd_Array1OfReal aKnots (1, aBSplinePCurve->NbKnots());
|
||||
aBSplinePCurve->Knots (aKnots);
|
||||
BSplCLib::Reparametrize (aFirst3d, aLast3d, aKnots);
|
||||
aBSplinePCurve->SetKnots (aKnots);
|
||||
ResPCurves(ii) = aBSplinePCurve;
|
||||
}
|
||||
ResFirsts(ii) = aFirst3d;
|
||||
ResLasts(ii) = aLast3d;
|
||||
} //if ranges > aMaxTol
|
||||
} //for (Standard_Integer ii = 1; ii <= ResPCurves.Length(); ii++)
|
||||
}
|
||||
|
||||
for (Standard_Integer j = 1; j <= ResPCurves.Length(); j++)
|
||||
@@ -2965,29 +3003,107 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
|
||||
TopTools_IndexedDataMapOfShapeListOfShape VEmap;
|
||||
for (Standard_Integer ind = 1; ind <= edges.Length(); ind++)
|
||||
TopExp::MapShapesAndUniqueAncestors(edges(ind), TopAbs_VERTEX, TopAbs_EDGE, VEmap);
|
||||
|
||||
//Try to find seam edge and an edge that is not seam but has 2 pcurves on the surface
|
||||
Standard_Boolean SeamFound = Standard_False;
|
||||
TopoDS_Edge EdgeWith2pcurves;
|
||||
for (Standard_Integer ii = 1; ii <= faces.Length(); ii++)
|
||||
{
|
||||
const TopoDS_Face& face_ii = TopoDS::Face(faces(ii));
|
||||
TopoDS_Wire anOuterWire = BRepTools::OuterWire(face_ii);
|
||||
TopoDS_Iterator itw(anOuterWire);
|
||||
for (; itw.More(); itw.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(itw.Value());
|
||||
if (BRep_Tool::IsClosed (anEdge, face_ii))
|
||||
{
|
||||
if (BRepTools::IsReallyClosed(anEdge, face_ii))
|
||||
SeamFound = Standard_True;
|
||||
else
|
||||
EdgeWith2pcurves = anEdge;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Boolean aIsEdgeWith2pcurvesSmooth = Standard_False;
|
||||
if (myConcatBSplines && !EdgeWith2pcurves.IsNull() && !SeamFound)
|
||||
{
|
||||
const TopTools_ListOfShape& aFaceList = theGMapEdgeFaces.FindFromKey (EdgeWith2pcurves);
|
||||
const TopoDS_Face& aFace1 = TopoDS::Face (aFaceList.First());
|
||||
const TopoDS_Face& aFace2 = TopoDS::Face (aFaceList.Last());
|
||||
GeomAbs_Shape anOrderOfCont = BRepLib::ContinuityOfFaces (EdgeWith2pcurves,
|
||||
aFace1, aFace2,
|
||||
myAngTol);
|
||||
aIsEdgeWith2pcurvesSmooth = (anOrderOfCont >= GeomAbs_G1);
|
||||
}
|
||||
|
||||
if (aIsEdgeWith2pcurvesSmooth)
|
||||
{
|
||||
Handle(Geom2d_Curve) aPC1, aPC2;
|
||||
Standard_Real aFirst, aLast;
|
||||
aPC1 = BRep_Tool::CurveOnSurface (EdgeWith2pcurves, F_RefFace, aFirst, aLast);
|
||||
EdgeWith2pcurves.Reverse();
|
||||
aPC2 = BRep_Tool::CurveOnSurface (EdgeWith2pcurves, F_RefFace, aFirst, aLast);
|
||||
gp_Pnt2d aPnt1 = aPC1->Value (aFirst);
|
||||
gp_Pnt2d aPnt2 = aPC2->Value (aFirst);
|
||||
Standard_Boolean anIsUclosed = (Abs(aPnt1.X() - aPnt2.X()) > Abs(aPnt1.Y() - aPnt2.Y()));
|
||||
Standard_Boolean aToMakeUPeriodic = Standard_False, aToMakeVPeriodic = Standard_False;
|
||||
if (anIsUclosed && Uperiod == 0.)
|
||||
aToMakeUPeriodic = Standard_True;
|
||||
if (!anIsUclosed && Vperiod == 0.)
|
||||
aToMakeVPeriodic = Standard_True;
|
||||
|
||||
if (aToMakeUPeriodic || aToMakeVPeriodic)
|
||||
{
|
||||
Handle(Geom_BSplineSurface) aBSplineSurface = Handle(Geom_BSplineSurface)::DownCast(aBaseSurface);
|
||||
if (aBSplineSurface.IsNull())
|
||||
{
|
||||
Standard_Real aTol = 1.e-4;
|
||||
GeomAbs_Shape aUCont = GeomAbs_C1, aVCont = GeomAbs_C1;
|
||||
Standard_Integer degU = 14, degV = 14;
|
||||
Standard_Integer nmax = 16;
|
||||
Standard_Integer aPrec = 1;
|
||||
GeomConvert_ApproxSurface Approximator(aBaseSurface,aTol,aUCont,aVCont,degU,degV,nmax,aPrec);
|
||||
aBSplineSurface = Approximator.Surface();
|
||||
}
|
||||
|
||||
if (aToMakeUPeriodic)
|
||||
{
|
||||
aBSplineSurface->SetUPeriodic();
|
||||
Uperiod = aBSplineSurface->UPeriod();
|
||||
}
|
||||
if (aToMakeVPeriodic)
|
||||
{
|
||||
aBSplineSurface->SetVPeriodic();
|
||||
Vperiod = aBSplineSurface->VPeriod();
|
||||
}
|
||||
|
||||
//Update ref face and pcurves if the surface changed
|
||||
if (aBSplineSurface != aBaseSurface)
|
||||
{
|
||||
TopoDS_Face OldRefFace = RefFace;
|
||||
Handle(Geom2d_Curve) NullPCurve;
|
||||
RefFace.Nullify();
|
||||
BB.MakeFace(RefFace, aBSplineSurface, aBaseLocation, 0.);
|
||||
for (Standard_Integer ii = 1; ii <= edges.Length(); ii++)
|
||||
{
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(edges(ii));
|
||||
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface (anEdge, OldRefFace, aFirst, aLast);
|
||||
if (MapEdgesWithTemporaryPCurves.Contains(anEdge))
|
||||
BB.UpdateEdge(anEdge, NullPCurve, OldRefFace, 0.);
|
||||
BB.UpdateEdge(anEdge, aPCurve, RefFace, 0.);
|
||||
}
|
||||
F_RefFace = RefFace;
|
||||
F_RefFace.Orientation(TopAbs_FORWARD);
|
||||
}
|
||||
}
|
||||
} //if (myConcatBSplines && !EdgeWith2pcurves.IsNull() && !SeamFound)
|
||||
|
||||
//Perform relocating to new U-origin
|
||||
//Define boundaries in 2d space of RefFace
|
||||
if (Uperiod != 0.)
|
||||
{
|
||||
//try to find a real seam edge - if it exists, do nothing
|
||||
Standard_Boolean SeamFound = Standard_False;
|
||||
for (Standard_Integer ii = 1; ii <= faces.Length(); ii++)
|
||||
{
|
||||
const TopoDS_Face& face_ii = TopoDS::Face(faces(ii));
|
||||
TopoDS_Wire anOuterWire = BRepTools::OuterWire(face_ii);
|
||||
TopoDS_Iterator itw(anOuterWire);
|
||||
for (; itw.More(); itw.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(itw.Value());
|
||||
if (BRepTools::IsReallyClosed(anEdge, face_ii))
|
||||
{
|
||||
SeamFound = Standard_True;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if seam edge exists, do nothing
|
||||
if (!SeamFound)
|
||||
{
|
||||
//try to find the origin of U in 2d space
|
||||
@@ -3189,6 +3305,10 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
|
||||
if (NextEdge.IsNull())
|
||||
{
|
||||
Standard_Boolean EndOfWire = Standard_False;
|
||||
|
||||
Standard_Boolean anIsOnSingularity = IsOnSingularity (Elist);
|
||||
if (!anIsOnSingularity && Elist.Extent() > 1)
|
||||
SplittingVertices.Add (CurVertex);
|
||||
|
||||
TopTools_ListOfShape TmpElist, TrueElist;
|
||||
//<TrueElist> will be the list of candidates to become <NextEdge>
|
||||
@@ -3208,7 +3328,6 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
|
||||
else
|
||||
{
|
||||
//we must choose the closest direction - the biggest angle
|
||||
SplittingVertices.Add (CurVertex);
|
||||
Standard_Real MaxAngle = RealFirst();
|
||||
TopoDS_Edge TrueEdge;
|
||||
Handle(Geom2d_Curve) CurPCurve = BRep_Tool::CurveOnSurface(CurEdge, F_RefFace, fpar, lpar);
|
||||
|
@@ -155,13 +155,22 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Registers this callback object in the current error handler (if found).
|
||||
void RegisterCallback();
|
||||
#if defined(OCC_CONVERT_SIGNALS)
|
||||
Standard_EXPORT
|
||||
#endif
|
||||
void RegisterCallback();
|
||||
|
||||
//! Unregisters this callback object from the error handler.
|
||||
void UnregisterCallback();
|
||||
#if defined(OCC_CONVERT_SIGNALS)
|
||||
Standard_EXPORT
|
||||
#endif
|
||||
void UnregisterCallback();
|
||||
|
||||
//! Destructor
|
||||
virtual ~Callback();
|
||||
#if defined(OCC_CONVERT_SIGNALS)
|
||||
Standard_EXPORT
|
||||
#endif
|
||||
virtual ~Callback();
|
||||
|
||||
//! The callback function to perform necessary callback action.
|
||||
//! Called by the exception handler when it is being destroyed but
|
||||
@@ -171,7 +180,10 @@ public:
|
||||
protected:
|
||||
|
||||
//! Empty constructor
|
||||
Callback();
|
||||
#if defined(OCC_CONVERT_SIGNALS)
|
||||
Standard_EXPORT
|
||||
#endif
|
||||
Callback();
|
||||
|
||||
private:
|
||||
Standard_Address myHandler;
|
||||
|
@@ -35,19 +35,19 @@
|
||||
// Primary definitions
|
||||
#define OCC_VERSION_MAJOR 7
|
||||
#define OCC_VERSION_MINOR 6
|
||||
#define OCC_VERSION_MAINTENANCE 1
|
||||
#define OCC_VERSION_MAINTENANCE 2
|
||||
|
||||
//! This macro must be commented in official release, and set to non-empty
|
||||
//! string in other situations, to identify specifics of the version, e.g.:
|
||||
//! - "dev" for development version between releases
|
||||
//! - "beta..." or "rc..." for beta releases or release candidates
|
||||
//! - "project..." for version containing project-specific fixes
|
||||
// #define OCC_VERSION_DEVELOPMENT "dev"
|
||||
//#define OCC_VERSION_DEVELOPMENT "dev"
|
||||
|
||||
// Derived (manually): version as real and string (major.minor)
|
||||
#define OCC_VERSION 7.6
|
||||
#define OCC_VERSION_STRING "7.6"
|
||||
#define OCC_VERSION_COMPLETE "7.6.1"
|
||||
#define OCC_VERSION_COMPLETE "7.6.2"
|
||||
|
||||
//! Derived: extended version as string ("major.minor.maintenance.dev")
|
||||
#ifdef OCC_VERSION_DEVELOPMENT
|
||||
|
@@ -128,7 +128,7 @@ void TNaming_CopyShape::Translate( const TopoDS_Shape& aShape,
|
||||
}
|
||||
|
||||
aResult.Orientation(aShape.Orientation());
|
||||
aResult.Location(TNaming_CopyShape::Translate(aShape.Location(), aMap));
|
||||
aResult.Location(TNaming_CopyShape::Translate(aShape.Location(), aMap), false);
|
||||
TrTool->UpdateShape(aShape,aResult);
|
||||
// #ifdef OCCT_DEBUG
|
||||
// if(fShar) {
|
||||
|
@@ -27,27 +27,37 @@ CommitCommand D0
|
||||
SaveAs D0 ${docname}
|
||||
Close D0
|
||||
|
||||
set whole_time [lindex [time {
|
||||
Open ${docname} D1
|
||||
Close D1
|
||||
} 20] 0]
|
||||
# Computes the elapsed time of open and close document with a given arguments (as text).
|
||||
# It launches 10 iteration, 10 actions in each. Returns time of average time of the minimum-time iteration.
|
||||
proc action_time args {
|
||||
global docname
|
||||
set min_time 1000000
|
||||
for {set iter 0} {$iter < 10} {incr iter} {
|
||||
set iter_time [lindex [time {
|
||||
Open ${docname} D {*}$args
|
||||
Close D
|
||||
} 10] 0]
|
||||
puts "Iteration time $iter_time mcs"
|
||||
if {$iter_time < $min_time} {
|
||||
set min_time $iter_time
|
||||
}
|
||||
}
|
||||
|
||||
return $min_time
|
||||
}
|
||||
|
||||
set whole_time [action_time]
|
||||
puts "Whole document open time $whole_time mcs"
|
||||
|
||||
set quater_time [lindex [time {
|
||||
Open ${docname} D2 -read0:2
|
||||
Close D2
|
||||
} 20] 0]
|
||||
set quater_time [action_time -read0:2]
|
||||
puts "Quater of document open time $quater_time mcs"
|
||||
|
||||
# Check that open of quater of the document is at least twice faster than open of whole.
|
||||
if { [expr $quater_time * 2] > $whole_time } {
|
||||
# Check that open of quater of the document is significantly faster than open of whole.
|
||||
if { [expr $quater_time * 1.5] > $whole_time } {
|
||||
puts "Error : loading of quater of the document content too slow relatively to the whole document load"
|
||||
}
|
||||
|
||||
set four_quaters_time [lindex [time {
|
||||
Open ${docname} D3 -read0:1 -read0:2 -read0:3 -read0:4
|
||||
Close D3
|
||||
} 20] 0]
|
||||
set four_quaters_time [action_time -read0:1 -read0:2 -read0:3 -read0:4]
|
||||
puts "Four quaters of document open time $four_quaters_time mcs"
|
||||
|
||||
# Check that open of four quaters of the document is not too much slower than opening of the whole document.
|
||||
@@ -69,6 +79,7 @@ if {![catch {Attributes D4 0:1:1:13}] || ![catch {Attributes D4 0:1:3:14}] || ![
|
||||
puts "Error : loading of document skipping arrays and sub-trees contains invalid attributes list"
|
||||
}
|
||||
|
||||
# check for appending arrays to the document from the file
|
||||
set append_arrays_time [lindex [time {
|
||||
Open ${docname} D4 -append -readTDataStd_IntegerArray -read0:2 -read0:3
|
||||
}] 0]
|
||||
|
24
tests/bugs/heal/bug29382_2
Normal file
24
tests/bugs/heal/bug29382_2
Normal file
@@ -0,0 +1,24 @@
|
||||
puts "================================================================================"
|
||||
puts "OCC29382: ShapeUpgrade_UnifySameDomain algorithm incorrectly processes the shape"
|
||||
puts "================================================================================"
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug29382_Group_3.brep] a
|
||||
|
||||
unifysamedom result a +b
|
||||
|
||||
checkshape result
|
||||
checkshape a
|
||||
|
||||
checknbshapes result -solid 3 -shell 3 -face 16 -wire 16 -edge 30 -vertex 18
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 1.8066863810061599e-05} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
explode result
|
||||
checkprops result_1 -v 4.41996e-06
|
||||
checkprops result_2 -v 1.30453e-06
|
||||
checkprops result_3 -v 1.16532e-06
|
24
tests/bugs/heal/bug29382_3
Normal file
24
tests/bugs/heal/bug29382_3
Normal file
@@ -0,0 +1,24 @@
|
||||
puts "================================================================================"
|
||||
puts "OCC29382: ShapeUpgrade_UnifySameDomain algorithm incorrectly processes the shape"
|
||||
puts "================================================================================"
|
||||
puts ""
|
||||
|
||||
beziercurve a 5 0 0 0 1 0 0 2 2 0 0 0.5 0 0 0 0
|
||||
mkedge a a
|
||||
wire a a
|
||||
mkplane a a
|
||||
prism a a 0 0 1
|
||||
box b -0.3 -0.2 0 1 0.4 1
|
||||
bcommon shape a b
|
||||
|
||||
unifysamedom result shape +b
|
||||
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -solid 1 -shell 1 -face 5 -wire 5 -edge 9 -vertex 5
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 6.e-6} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
20
tests/bugs/heal/bug32719
Normal file
20
tests/bugs/heal/bug32719
Normal file
@@ -0,0 +1,20 @@
|
||||
puts "============================================================"
|
||||
puts "OCC32719: UnifySameDomain result has incorrect triangulation"
|
||||
puts "============================================================"
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32719.brep] a
|
||||
|
||||
unifysamedom result a
|
||||
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -t -solid 4 -shell 4 -face 20 -wire 20 -edge 32 -vertex 16
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 6.e-6} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
checkprops result -s 0.0222593 -v 5.17261e-05
|
23
tests/bugs/heal/bug32814_1
Normal file
23
tests/bugs/heal/bug32814_1
Normal file
@@ -0,0 +1,23 @@
|
||||
puts "=============================================="
|
||||
puts "OCC32814: Unifysamedom produces invalid result"
|
||||
puts "=============================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32814_1.brep] s
|
||||
|
||||
unifysamedom result s -a 1e-4
|
||||
|
||||
checkshape result
|
||||
bopargcheck result
|
||||
|
||||
checknbshapes result -t -face 7 -wire 13 -edge 70 -vertex 64
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 1.e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
checkprops result -s 5.54082e+06
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
23
tests/bugs/heal/bug32814_2
Normal file
23
tests/bugs/heal/bug32814_2
Normal file
@@ -0,0 +1,23 @@
|
||||
puts "=============================================="
|
||||
puts "OCC32814: Unifysamedom produces invalid result"
|
||||
puts "=============================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32814_2.brep] s
|
||||
|
||||
unifysamedom result s
|
||||
|
||||
checkshape result
|
||||
bopargcheck result
|
||||
|
||||
checknbshapes result -t -solid 1 -shell 1 -face 78 -wire 110 -edge 220 -vertex 136
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 2.e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
checkprops result -s 1.61456e+06 -v 3e+07
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
9
tests/bugs/mesh/bug32767
Normal file
9
tests/bugs/mesh/bug32767
Normal file
@@ -0,0 +1,9 @@
|
||||
puts "================"
|
||||
puts "0032767: Mesh - incorrect splitting of edges of seams leading to hang \[since OCCT 7.4.0\] "
|
||||
puts "================"
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32767.brep] s
|
||||
tclean s
|
||||
incmesh s 0.01
|
||||
checktrinfo s -tri 3220 -nod 1770 -defl 0.018398669654253779 -tol_abs_defl 1e-6
|
@@ -3,8 +3,6 @@ puts "0029807: Impossible to cut cone from prism"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
puts "TODO OCC29922 ALL: Error: Degenerated edge is not found"
|
||||
|
||||
restore [locate_data_file bug29807-obj.brep] b1
|
||||
restore [locate_data_file bug29807-tool.brep] b2
|
||||
|
||||
|
@@ -3,9 +3,6 @@ puts "0029807: Impossible to cut cone from prism"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
puts "TODO OCC29860 ALL: Error : is WRONG because number of WIRE entities in shape \"result\" is 10"
|
||||
puts "TODO OCC29860 ALL: Error : is WRONG because number of FACE entities in shape \"result\" is 10"
|
||||
|
||||
restore [locate_data_file bug29807-obj.brep] b1
|
||||
restore [locate_data_file bug29807-tool.brep] b2
|
||||
|
||||
|
26
tests/bugs/modalg_7/bug32066
Normal file
26
tests/bugs/modalg_7/bug32066
Normal file
@@ -0,0 +1,26 @@
|
||||
puts "======================================================="
|
||||
puts "0032066: Modeling Algorithms - Incorrect result of Boolean CUT operation"
|
||||
puts "======================================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32066_solid.brep] s
|
||||
|
||||
restore [locate_data_file bug32066_hole_2547.brep] h1
|
||||
restore [locate_data_file bug32066_hole_2562.brep] h2
|
||||
restore [locate_data_file bug32066_hole_2563.brep] h3
|
||||
restore [locate_data_file bug32066_hole_2564.brep] h4
|
||||
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects s
|
||||
baddtools h1 h2 h3 h4
|
||||
bfillds
|
||||
|
||||
bbop r 2
|
||||
|
||||
checkshape r
|
||||
|
||||
checknbshapes r -wire 73 -face 65 -shell 1 -solid 1 -t
|
||||
checkprops r -s 3.45489e+07 -v 1.54742e+08
|
||||
|
||||
checkview -display r -2d -path ${imagedir}/${test_image}.png
|
25
tests/bugs/modalg_7/bug32874_1
Normal file
25
tests/bugs/modalg_7/bug32874_1
Normal file
@@ -0,0 +1,25 @@
|
||||
puts "================================================="
|
||||
puts "0032874: IsParallel() method of Extrema_ExtCC does not give same results in OCC 7.6.0 vs OCC 7.5.0"
|
||||
puts "================================================="
|
||||
puts ""
|
||||
|
||||
set distExpected 10
|
||||
circle c1 0 0 0 100
|
||||
circle c2 0 0 0 100+$distExpected
|
||||
|
||||
set nbSteps 72
|
||||
for {set i 1} {$i < $nbSteps} {incr i} {
|
||||
trim cc1 c1 0 2.*pi/$nbSteps*$i
|
||||
trim cc2 c2 0 2.*pi/$nbSteps*$i
|
||||
|
||||
set extr [extrema cc1 cc2]
|
||||
if {[regexp {Infinite number of extremas, distance = ([-0-9.+eE]+)} $extr full dist]} {
|
||||
if {[expr abs($dist - $distExpected)] < 1.e-7} {
|
||||
puts "OK"
|
||||
} else {
|
||||
puts "Error: wrong distance $dist instead of $distExpected expected"
|
||||
}
|
||||
} else {
|
||||
puts "Error: non-parallel curves"
|
||||
}
|
||||
}
|
29
tests/bugs/modalg_7/bug32874_2
Normal file
29
tests/bugs/modalg_7/bug32874_2
Normal file
@@ -0,0 +1,29 @@
|
||||
puts "================================================="
|
||||
puts "0032874: IsParallel() method of Extrema_ExtCC does not give same results in OCC 7.6.0 vs OCC 7.5.0"
|
||||
puts "================================================="
|
||||
puts ""
|
||||
|
||||
set distExpected 3.5
|
||||
circle c1 0 0 0 100
|
||||
circle c2 0 0 0 100+$distExpected
|
||||
|
||||
set start {0.0 0.5*pi pi 1.5*pi 2.0*pi}
|
||||
set delta {pi/4.0 pi/3.0 pi/2.0 0.55*pi 0.99*pi pi 1.1*pi}
|
||||
|
||||
foreach f $start {
|
||||
foreach d $delta {
|
||||
trim cc1 c1 $f $f+$d
|
||||
trim cc2 c2 $f $f+$d
|
||||
|
||||
set extr [extrema cc1 cc2]
|
||||
if {[regexp {Infinite number of extremas, distance = ([-0-9.+eE]+)} $extr full dist]} {
|
||||
if {[expr abs($dist - $distExpected)] < 1.e-7} {
|
||||
puts "OK"
|
||||
} else {
|
||||
puts "Error: wrong distance $dist instead of $distExpected expected"
|
||||
}
|
||||
} else {
|
||||
puts "Error: non-parallel curves"
|
||||
}
|
||||
}
|
||||
}
|
30
tests/bugs/modalg_7/bug32874_3
Normal file
30
tests/bugs/modalg_7/bug32874_3
Normal file
@@ -0,0 +1,30 @@
|
||||
puts "================================================="
|
||||
puts "0032874: IsParallel() method of Extrema_ExtCC does not give same results in OCC 7.6.0 vs OCC 7.5.0"
|
||||
puts "================================================="
|
||||
puts ""
|
||||
|
||||
set radius 0.001
|
||||
set distExpected 0.00001
|
||||
circle c1 0 0 0 $radius
|
||||
circle c2 0 0 0 $radius+$distExpected
|
||||
|
||||
set start {0.0 0.5*pi pi 1.5*pi 2.0*pi}
|
||||
set delta {pi/4.0 pi/3.0 pi/2.0 0.55*pi 0.99*pi pi 1.1*pi}
|
||||
|
||||
foreach f $start {
|
||||
foreach d $delta {
|
||||
trim cc1 c1 $f $f+$d
|
||||
trim cc2 c2 $f $f+$d
|
||||
|
||||
set extr [extrema cc1 cc2]
|
||||
if {[regexp {Infinite number of extremas, distance = ([-0-9.+eE]+)} $extr full dist]} {
|
||||
if {[expr abs($dist - $distExpected)] < 1.e-7} {
|
||||
puts "OK"
|
||||
} else {
|
||||
puts "Error: wrong distance $dist instead of $distExpected expected"
|
||||
}
|
||||
} else {
|
||||
puts "Error: non-parallel curves"
|
||||
}
|
||||
}
|
||||
}
|
30
tests/bugs/modalg_7/bug32874_4
Normal file
30
tests/bugs/modalg_7/bug32874_4
Normal file
@@ -0,0 +1,30 @@
|
||||
puts "================================================="
|
||||
puts "0032874: IsParallel() method of Extrema_ExtCC does not give same results in OCC 7.6.0 vs OCC 7.5.0"
|
||||
puts "================================================="
|
||||
puts ""
|
||||
|
||||
set radius 0.001
|
||||
set distExpected 1000.0
|
||||
circle c1 0 0 0 $radius
|
||||
circle c2 0 0 0 $radius+$distExpected
|
||||
|
||||
set start {0.0 0.5*pi pi 1.5*pi 2.0*pi}
|
||||
set delta {pi/4.0 pi/3.0 pi/2.0 0.55*pi 0.99*pi pi 1.1*pi}
|
||||
|
||||
foreach f $start {
|
||||
foreach d $delta {
|
||||
trim cc1 c1 $f $f+$d
|
||||
trim cc2 c2 $f $f+$d
|
||||
|
||||
set extr [extrema cc1 cc2]
|
||||
if {[regexp {Infinite number of extremas, distance = ([-0-9.+eE]+)} $extr full dist]} {
|
||||
if {[expr abs($dist - $distExpected)] < 1.e-7} {
|
||||
puts "OK"
|
||||
} else {
|
||||
puts "Error: wrong distance $dist instead of $distExpected expected"
|
||||
}
|
||||
} else {
|
||||
puts "Error: non-parallel curves"
|
||||
}
|
||||
}
|
||||
}
|
30
tests/bugs/modalg_7/bug32874_5
Normal file
30
tests/bugs/modalg_7/bug32874_5
Normal file
@@ -0,0 +1,30 @@
|
||||
puts "================================================="
|
||||
puts "0032874: IsParallel() method of Extrema_ExtCC does not give same results in OCC 7.6.0 vs OCC 7.5.0"
|
||||
puts "================================================="
|
||||
puts ""
|
||||
|
||||
set radius 1000.0
|
||||
set distExpected 1.e-5
|
||||
circle c1 0 0 0 $radius
|
||||
circle c2 0 0 0 $radius-$distExpected
|
||||
|
||||
set start {0.0 0.5*pi pi 1.5*pi 2.0*pi}
|
||||
set delta {pi/4.0 pi/3.0 pi/2.0 0.55*pi 0.99*pi pi 1.1*pi}
|
||||
|
||||
foreach f $start {
|
||||
foreach d $delta {
|
||||
trim cc1 c1 $f $f+$d
|
||||
trim cc2 c2 $f $f+$d
|
||||
|
||||
set extr [extrema cc1 cc2]
|
||||
if {[regexp {Infinite number of extremas, distance = ([-0-9.+eE]+)} $extr full dist]} {
|
||||
if {[expr abs($dist - $distExpected)] < 1.e-7} {
|
||||
puts "OK"
|
||||
} else {
|
||||
puts "Error: wrong distance $dist instead of $distExpected expected"
|
||||
}
|
||||
} else {
|
||||
puts "Error: non-parallel curves"
|
||||
}
|
||||
}
|
||||
}
|
35
tests/bugs/modalg_8/bug32721
Normal file
35
tests/bugs/modalg_8/bug32721
Normal file
@@ -0,0 +1,35 @@
|
||||
puts "======================================================"
|
||||
puts "OCC32721: BOP wrong results on a cone and an extrusion"
|
||||
puts "======================================================"
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32721.brep] prism
|
||||
pcone cone 6 0 10
|
||||
|
||||
bop cone prism
|
||||
bopfuse r1
|
||||
bopcommon r2
|
||||
bopcut r3
|
||||
boptuc r4
|
||||
|
||||
checkshape r1
|
||||
checknbshapes r1 -t -vertex 8 -edge 17 -wire 8 -face 8 -shell 1 -solid 1
|
||||
checkshape r2
|
||||
checknbshapes r2 -t -vertex 3 -edge 7 -wire 4 -face 4 -shell 1 -solid 1
|
||||
checkshape r3
|
||||
checknbshapes r3 -t -vertex 4 -edge 10 -wire 4 -face 4 -shell 1 -solid 1
|
||||
checkshape r4
|
||||
checknbshapes r4 -t -vertex 7 -edge 14 -wire 8 -face 8 -shell 2 -solid 2
|
||||
|
||||
set tolres [checkmaxtol r1]
|
||||
|
||||
if { ${tolres} > 0.0002} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
checkprops r1 -s 388.634 -v 406.357
|
||||
checkprops r2 -s 57.8605 -v 22.8116
|
||||
checkprops r3 -s 358.735 -v 354.179
|
||||
checkprops r4 -s 87.7592 -v 29.3659
|
||||
|
||||
checkview -display r1 -2d -path ${imagedir}/${test_image}.png
|
@@ -1,4 +1,4 @@
|
||||
puts "TODO OCC30286 ALL: Error : The length of result shape is 227257, expected 11."
|
||||
puts "TODO OCC30286 ALL: Error : The length of result shape is"
|
||||
|
||||
puts "========================================================================"
|
||||
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
|
||||
|
15
tests/lowalgos/extcc/bug32796
Normal file
15
tests/lowalgos/extcc/bug32796
Normal file
@@ -0,0 +1,15 @@
|
||||
puts "============"
|
||||
puts "OCC32796: Modeling Data - Calculation of distance between two circles crashes"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32796e1.brep] e1
|
||||
restore [locate_data_file bug32796e2.brep] e2
|
||||
mkcurve c1 e1
|
||||
mkcurve c2 e2
|
||||
|
||||
if [catch { extrema c1 c2 }] {
|
||||
puts "Calculation of distance between two circles crashes"
|
||||
} else {
|
||||
puts "Calculation of distance between two circles is OK"
|
||||
}
|
@@ -7,7 +7,7 @@ puts ""
|
||||
###############################
|
||||
|
||||
puts "TODO OCC29501 ALL: Error in ii12_22"
|
||||
|
||||
puts "TODO OCC29501 All: Error: The curve ii12_22 is possible"
|
||||
set MaxToler 1.5e-4
|
||||
|
||||
restore [locate_data_file bug24472_Pipe_1.brep] b1
|
||||
|
@@ -7,7 +7,7 @@ puts ""
|
||||
#######################################################################
|
||||
|
||||
set MaxTol 1.e-3
|
||||
set GoodNbCurv 11
|
||||
set GoodNbCurv 12
|
||||
|
||||
restore [locate_data_file bug27167_pipe.brep] a1
|
||||
pcylinder a2 100 300
|
||||
|
@@ -6,7 +6,7 @@ puts ""
|
||||
# Incomplete intersection curve from the attached shapes
|
||||
#################################################
|
||||
|
||||
set ExpTol 1.1e-7
|
||||
set ExpTol 1.e-5
|
||||
set GoodNbCurv 3
|
||||
set GoodLength 0.6288896355727489
|
||||
|
||||
|
@@ -18,7 +18,7 @@ fit
|
||||
# Before the fix: Exception in Debug-mode only
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves f_1 f_2 -2d] full Toler NbCurv
|
||||
|
||||
checkreal Tolerance $Toler 4.601149532364662e-008 1.0e-7 0.0
|
||||
checkreal Tolerance $Toler 2.1053092622220167e-07 1.0e-7 0.0
|
||||
|
||||
if {$NbCurv != 1} {
|
||||
puts "Error: Please check NbCurves for intersector"
|
||||
|
@@ -17,7 +17,9 @@ fit
|
||||
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves b1_5 b2_2 -2d] full Toler NbCurv
|
||||
|
||||
checkreal Tolerance $Toler 0.00039718358540697849 0.0 0.01
|
||||
if { ${Toler} > 0.0004} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
if {$NbCurv != 2} {
|
||||
puts "Error: Please check NbCurves for intersector"
|
||||
|
@@ -17,7 +17,9 @@ fit
|
||||
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves b1_5 b2_2 -2d] full Toler NbCurv
|
||||
|
||||
checkreal Tolerance $Toler 5.0314111870170835e-005 0.0 0.01
|
||||
if { ${Toler} > 5.1e-5} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
if {$NbCurv != 2} {
|
||||
puts "Error: Please check NbCurves for intersector"
|
||||
|
@@ -18,7 +18,9 @@ fit
|
||||
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves b1_5 b2_2 -2d] full Toler NbCurv
|
||||
|
||||
checkreal Tolerance $Toler 0.00011289757099748416 0.0 0.01
|
||||
if { ${Toler} > 0.000113} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
if {$NbCurv != 2} {
|
||||
puts "Error: Please check NbCurves for intersector"
|
||||
|
@@ -18,7 +18,9 @@ fit
|
||||
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves b1_5 b2_2 -2d] full Toler NbCurv
|
||||
|
||||
checkreal Tolerance $Toler 7.7125880147734232e-007 0.0 0.01
|
||||
if { ${Toler} > 8e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
if {$NbCurv != 2} {
|
||||
puts "Error: Please check NbCurves for intersector"
|
||||
|
@@ -16,7 +16,9 @@ fit
|
||||
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves b1_5 f2 -2d] full Toler NbCurv
|
||||
|
||||
checkreal Tolerance $Toler 0.00039718358530349535 0.0 0.01
|
||||
if { ${Toler} > 0.0004} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
if {$NbCurv != 2} {
|
||||
puts "Error: Please check NbCurves for intersector"
|
||||
|
@@ -17,7 +17,9 @@ fit
|
||||
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves b1_5 f2 -2d] full Toler NbCurv
|
||||
|
||||
checkreal Tolerance $Toler 0.00011289757087827709 0.0 0.01
|
||||
if { ${Toler} > 0.000113} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
if {$NbCurv != 2} {
|
||||
puts "Error: Please check NbCurves for intersector"
|
||||
|
@@ -17,7 +17,9 @@ fit
|
||||
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves b1_5 f2 -2d] full Toler NbCurv
|
||||
|
||||
checkreal Tolerance $Toler 7.7124681583892622e-007 0.0 0.01
|
||||
if { ${Toler} > 8e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
if {$NbCurv != 2} {
|
||||
puts "Error: Please check NbCurves for intersector"
|
||||
|
@@ -32,8 +32,8 @@ while { $AllowRepeat != 0 } {
|
||||
puts "Error: Wrong curve's range!"
|
||||
}
|
||||
|
||||
xdistcs res_$ic s1 U1 U2 100 2.0e-7
|
||||
xdistcs res_$ic s2 U1 U2 100 2.0e-7
|
||||
xdistcs res_$ic s1 U1 U2 100 6.0e-7
|
||||
xdistcs res_$ic s2 U1 U2 100 6.0e-7
|
||||
|
||||
mkedge ee res_$ic
|
||||
baddobjects ee
|
||||
|
56
tests/lowalgos/intss/bug32701
Normal file
56
tests/lowalgos/intss/bug32701
Normal file
@@ -0,0 +1,56 @@
|
||||
puts "========"
|
||||
puts "0032701: Modeling Algorithms - 2d curve has bending near the degenerated edge of the face"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32701s.brep] s
|
||||
restore [locate_data_file bug32701t.brep] t
|
||||
|
||||
explode t f
|
||||
|
||||
set log [bopcurves s t_3 -2d]
|
||||
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} $log full Toler NbCurv
|
||||
|
||||
if {$NbCurv != 1} {
|
||||
puts "Error: Number of curves is wrong"
|
||||
}
|
||||
|
||||
if { $Toler > 3.0e-5} {
|
||||
puts "Error: Big tolerance value"
|
||||
}
|
||||
|
||||
set log [bopcurves s t_4 -2d]
|
||||
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} $log full Toler NbCurv
|
||||
|
||||
if {$NbCurv != 1} {
|
||||
puts "Error: Number of curves is wrong"
|
||||
}
|
||||
|
||||
if { $Toler > 8.0e-5} {
|
||||
puts "Error: Big tolerance value"
|
||||
}
|
||||
|
||||
bcommon cc s t
|
||||
|
||||
checkshape cc
|
||||
checkprops cc -s 19899.6
|
||||
|
||||
##checkview -display cc -2d -path ${imagedir}/${test_image}.png
|
||||
|
||||
bcut cct s t
|
||||
|
||||
checkshape cct
|
||||
checkprops cct -s 32252.5
|
||||
|
||||
compound cc cct qq
|
||||
|
||||
checkview -display qq -2d -path ${imagedir}/${test_image}.png
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user