IntPatch/IntPatch_ImpPrmIntersection.cxx - calculation of step depending on resolution of surface
IntWalk_IWalking_6.gxx - calculation of point-line coincidence is improved
Correction of tests according to current results
lowalgos/intss/bug30703 - new test case added
break;
}
//
+ Standard_Real aLocalPas = Pas;
+ GeomAbs_SurfaceType aSType = reversed ? Surf1->GetType() : Surf2->GetType();
+
+ if (aSType == GeomAbs_BezierSurface || aSType == GeomAbs_BSplineSurface)
+ {
+ Standard_Real aMinRes = Precision::Infinite();
+ GeomAbs_Shape aCont = GeomAbs_C0;
+ Standard_Integer aMaxDeg = 0;
+ const Standard_Real aLimRes = 1.e-10;
+
+ if (reversed)
+ {
+ aMinRes = Min(Surf1->UResolution(Precision::Confusion()),
+ Surf1->VResolution(Precision::Confusion()));
+ aCont = (GeomAbs_Shape)Min(Surf1->UContinuity(), Surf1->VContinuity());
+ aMaxDeg = Max(Surf1->UDegree(), Surf1->VDegree());
+ }
+ else
+ {
+ aMinRes = Min(Surf2->UResolution(Precision::Confusion()),
+ Surf2->VResolution(Precision::Confusion()));
+ aCont = (GeomAbs_Shape)Min(Surf2->UContinuity(), Surf2->VContinuity());
+ aMaxDeg = Max(Surf2->UDegree(), Surf2->VDegree());
+ }
+
+ if (aMinRes < aLimRes && aCont > GeomAbs_C0 && aMaxDeg > 3)
+ {
+ aLocalPas = Min(Pas, 0.0001);
+ }
+ }
+
Func.SetImplicitSurface(Quad);
Func.Set(IntSurf_QuadricTool::Tolerance(Quad));
AFunc.SetQuadric(Quad);
NbPointDep=seqpdep.Length();
//
if (NbPointDep || NbPointIns) {
- IntPatch_TheIWalking iwalk(TolTang, Fleche, Pas);
+ IntPatch_TheIWalking iwalk(TolTang, Fleche, aLocalPas);
iwalk.Perform(seqpdep, seqpins, Func, reversed ? Surf1 : Surf2, reversed);
if(!iwalk.IsDone()) {
math_FunctionSetRoot& theSolver,
TheIWFunction& theFunc)
{
+ const Standard_Real eps = Epsilon(1.);
const gp_Pnt &aP3d = thePOn2S.Value();
for (Standard_Integer aLIdx = 1; aLIdx <= lines.Length(); aLIdx++)
Standard_Real aSqD = RealLast();
if (aDP < 0.0)
{
- //aSqD = aP1P.SquareModulus();
continue;
}
else if (aDP > aSq12)
{
- //aSqD = (aP3d.XYZ() - aP2.XYZ()).SquareModulus();
continue;
}
else
const Standard_Real aL1 = aDP / aSq12;
const Standard_Real aL2 = 1.0 - aL1;
+ if (aL1 < eps || aL2 < eps)
+ {
+ return Standard_True;
+ }
+
Standard_Real aU1, aV1, aU2, aV2;
aL->Value(aPtIdx).ParametersOnSurface(reversed, aU1, aV1);
aL->Value(aPtIdx + 1).ParametersOnSurface(reversed, aU2, aV2);
}
}
- if (aMinSqDist == RealLast())
+ if (aMinSqDist > Precision::Infinite())
continue;
math_Vector aVecPrms(1, 2);
aPb(theFunc.PSurface()->Value(aVecPrms(1), aVecPrms(2)));
const Standard_Real aSqD1 = aPb.SquareDistance(aP3d);
const Standard_Real aSqD2 = aPa.SquareDistance(aPb);
-
+
if (aSqD1 < 4.0*aSqD2)
{
return Standard_True;
set tolres [checkmaxtol result]
-if { ${tolres} > 5.e-6} {
+if { ${tolres} > 1.e-5} {
puts "Error: bad tolerance of result"
}
set viewname "vright"
-set length 1794.57
+set length 1796.06
testreadstep [locate_data_file bug27341_CCS_Adapter_CAD.stp] a
COMPUTE_HLR $viewname $algotype
-puts "TODO OCC30286 Windows: Error : The length of result shape is 2409.86, expected 2418.08"
+puts "TODO OCC30286 Windows: Error : The length of result shape is 2416.66, expected 2418.08"
+puts "TODO OCC30286 Linux: Error : The length of result shape is 2414.48, expected 2418.08"
set viewname "vright"
set length 2418.08
set viewname "vright"
-set length 1750.87
+set length 1750.92
testreadstep [locate_data_file bug27341_ABS_Adapter_CAD.stp] a
COMPUTE_HLR $viewname $algotype
puts "========"
puts ""
+puts "REQUIRED ALL: Error: The curve"
+
set GoodNbCurves 1
foreach a [directory res*] {unset $a}
renamevar res res_1
}
-bclearobjects
-bcleartools
-
set ic 1
set AllowRepeat 1
while { $AllowRepeat != 0 } {
set nv1 [ expr sqrt($nv1) ]
set nv2 [ expr sqrt($nv2) ]
- set dp [ dval dx1*dx2+dy2*dy2+dz1*dz2 ]
+ set dp [ dval dx1*dx2+dy1*dy2+dz1*dz2 ]
if {$dp < [ expr 0.25881904510252076234889883762405 * $nv1 * $nv2 ] } {
puts "Error: The curve res_$ic is possible to have a bend at parameter $p. Please check carefully"
--- /dev/null
+puts "============"
+puts "0030703: Modeling Algorithms - Intersector returns overlapping curves"
+puts "============"
+puts ""
+
+restore [locate_data_file bug30703s1] s1
+restore [locate_data_file bug30703s2] s2
+
+set info [intersect res s1 s2]
+# Number of solutions check.
+# There should be only 2 solution.
+if {[llength $info] != 1} {
+ Error: Incorrect number of solutions.
+}
+
+checklength res -l 22.9782037
+
+donly s2 res
+clpoles s2
+clknots s2
+clpoles res
+clknots res
+
+smallview
+
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png