mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0030703: Modeling Algorithms - Intersector returns overlapping curves
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
This commit is contained in:
parent
9ab58ebf65
commit
9a640cbe72
@ -585,6 +585,37 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
break;
|
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.SetImplicitSurface(Quad);
|
||||||
Func.Set(IntSurf_QuadricTool::Tolerance(Quad));
|
Func.Set(IntSurf_QuadricTool::Tolerance(Quad));
|
||||||
AFunc.SetQuadric(Quad);
|
AFunc.SetQuadric(Quad);
|
||||||
@ -686,7 +717,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
|||||||
NbPointDep=seqpdep.Length();
|
NbPointDep=seqpdep.Length();
|
||||||
//
|
//
|
||||||
if (NbPointDep || NbPointIns) {
|
if (NbPointDep || NbPointIns) {
|
||||||
IntPatch_TheIWalking iwalk(TolTang, Fleche, Pas);
|
IntPatch_TheIWalking iwalk(TolTang, Fleche, aLocalPas);
|
||||||
iwalk.Perform(seqpdep, seqpins, Func, reversed ? Surf1 : Surf2, reversed);
|
iwalk.Perform(seqpdep, seqpins, Func, reversed ? Surf1 : Surf2, reversed);
|
||||||
|
|
||||||
if(!iwalk.IsDone()) {
|
if(!iwalk.IsDone()) {
|
||||||
|
@ -182,6 +182,7 @@ Standard_Boolean IntWalk_IWalking::IsPointOnLine(const IntSurf_PntOn2S& thePOn2S
|
|||||||
math_FunctionSetRoot& theSolver,
|
math_FunctionSetRoot& theSolver,
|
||||||
TheIWFunction& theFunc)
|
TheIWFunction& theFunc)
|
||||||
{
|
{
|
||||||
|
const Standard_Real eps = Epsilon(1.);
|
||||||
const gp_Pnt &aP3d = thePOn2S.Value();
|
const gp_Pnt &aP3d = thePOn2S.Value();
|
||||||
|
|
||||||
for (Standard_Integer aLIdx = 1; aLIdx <= lines.Length(); aLIdx++)
|
for (Standard_Integer aLIdx = 1; aLIdx <= lines.Length(); aLIdx++)
|
||||||
@ -212,12 +213,10 @@ Standard_Boolean IntWalk_IWalking::IsPointOnLine(const IntSurf_PntOn2S& thePOn2S
|
|||||||
Standard_Real aSqD = RealLast();
|
Standard_Real aSqD = RealLast();
|
||||||
if (aDP < 0.0)
|
if (aDP < 0.0)
|
||||||
{
|
{
|
||||||
//aSqD = aP1P.SquareModulus();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (aDP > aSq12)
|
else if (aDP > aSq12)
|
||||||
{
|
{
|
||||||
//aSqD = (aP3d.XYZ() - aP2.XYZ()).SquareModulus();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -232,6 +231,11 @@ Standard_Boolean IntWalk_IWalking::IsPointOnLine(const IntSurf_PntOn2S& thePOn2S
|
|||||||
const Standard_Real aL1 = aDP / aSq12;
|
const Standard_Real aL1 = aDP / aSq12;
|
||||||
const Standard_Real aL2 = 1.0 - aL1;
|
const Standard_Real aL2 = 1.0 - aL1;
|
||||||
|
|
||||||
|
if (aL1 < eps || aL2 < eps)
|
||||||
|
{
|
||||||
|
return Standard_True;
|
||||||
|
}
|
||||||
|
|
||||||
Standard_Real aU1, aV1, aU2, aV2;
|
Standard_Real aU1, aV1, aU2, aV2;
|
||||||
aL->Value(aPtIdx).ParametersOnSurface(reversed, aU1, aV1);
|
aL->Value(aPtIdx).ParametersOnSurface(reversed, aU1, aV1);
|
||||||
aL->Value(aPtIdx + 1).ParametersOnSurface(reversed, aU2, aV2);
|
aL->Value(aPtIdx + 1).ParametersOnSurface(reversed, aU2, aV2);
|
||||||
@ -241,7 +245,7 @@ Standard_Boolean IntWalk_IWalking::IsPointOnLine(const IntSurf_PntOn2S& thePOn2S
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aMinSqDist == RealLast())
|
if (aMinSqDist > Precision::Infinite())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
math_Vector aVecPrms(1, 2);
|
math_Vector aVecPrms(1, 2);
|
||||||
|
@ -18,7 +18,7 @@ if {[regexp "Faulties" [bopargcheck result]]} {
|
|||||||
|
|
||||||
set tolres [checkmaxtol result]
|
set tolres [checkmaxtol result]
|
||||||
|
|
||||||
if { ${tolres} > 5.e-6} {
|
if { ${tolres} > 1.e-5} {
|
||||||
puts "Error: bad tolerance of result"
|
puts "Error: bad tolerance of result"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
set viewname "vright"
|
set viewname "vright"
|
||||||
set length 1794.57
|
set length 1796.06
|
||||||
|
|
||||||
testreadstep [locate_data_file bug27341_CCS_Adapter_CAD.stp] a
|
testreadstep [locate_data_file bug27341_CCS_Adapter_CAD.stp] a
|
||||||
COMPUTE_HLR $viewname $algotype
|
COMPUTE_HLR $viewname $algotype
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
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 viewname "vright"
|
||||||
set length 2418.08
|
set length 2418.08
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
set viewname "vright"
|
set viewname "vright"
|
||||||
set length 1750.87
|
set length 1750.92
|
||||||
|
|
||||||
testreadstep [locate_data_file bug27341_ABS_Adapter_CAD.stp] a
|
testreadstep [locate_data_file bug27341_ABS_Adapter_CAD.stp] a
|
||||||
COMPUTE_HLR $viewname $algotype
|
COMPUTE_HLR $viewname $algotype
|
||||||
|
@ -3,6 +3,8 @@ puts "OCC29972: Intersection curve has a weird gap in the middle of it"
|
|||||||
puts "========"
|
puts "========"
|
||||||
puts ""
|
puts ""
|
||||||
|
|
||||||
|
puts "REQUIRED ALL: Error: The curve"
|
||||||
|
|
||||||
set GoodNbCurves 1
|
set GoodNbCurves 1
|
||||||
|
|
||||||
foreach a [directory res*] {unset $a}
|
foreach a [directory res*] {unset $a}
|
||||||
@ -17,9 +19,6 @@ if { [info exists res] } {
|
|||||||
renamevar res res_1
|
renamevar res res_1
|
||||||
}
|
}
|
||||||
|
|
||||||
bclearobjects
|
|
||||||
bcleartools
|
|
||||||
|
|
||||||
set ic 1
|
set ic 1
|
||||||
set AllowRepeat 1
|
set AllowRepeat 1
|
||||||
while { $AllowRepeat != 0 } {
|
while { $AllowRepeat != 0 } {
|
||||||
@ -48,7 +47,7 @@ while { $AllowRepeat != 0 } {
|
|||||||
set nv1 [ expr sqrt($nv1) ]
|
set nv1 [ expr sqrt($nv1) ]
|
||||||
set nv2 [ expr sqrt($nv2) ]
|
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 ] } {
|
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"
|
puts "Error: The curve res_$ic is possible to have a bend at parameter $p. Please check carefully"
|
||||||
|
28
tests/lowalgos/intss/bug30703
Normal file
28
tests/lowalgos/intss/bug30703
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
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
|
Loading…
x
Reference in New Issue
Block a user