mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0026099: Wrong result done by 2d intersection algorithm
Detection of intersection for almost parallel lines has been improved.
This commit is contained in:
parent
5d3ec53550
commit
2e6bcdaf8e
@ -601,7 +601,7 @@ void DomainIntersection(const IntRes2d_Domain& Domain
|
|||||||
Res1sup=Res1inf;
|
Res1sup=Res1inf;
|
||||||
PosSup=IntRes2d_Head;
|
PosSup=IntRes2d_Head;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(PosSup==IntRes2d_End) {
|
if(PosSup==IntRes2d_End) {
|
||||||
if(Res1inf >= (Res1sup-Domain.LastTolerance())) {
|
if(Res1inf >= (Res1sup-Domain.LastTolerance())) {
|
||||||
Res1inf=Res1sup;
|
Res1inf=Res1sup;
|
||||||
@ -1190,6 +1190,30 @@ static Standard_Boolean computeIntPoint(const IntRes2d_Domain& theCurDomain,
|
|||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : CheckLLCoincidence
|
||||||
|
//purpose : Returns true if input are trimmed curves and they coincide
|
||||||
|
// within tolerance
|
||||||
|
//=======================================================================
|
||||||
|
static Standard_Boolean CheckLLCoincidence(const gp_Lin2d& L1,
|
||||||
|
const gp_Lin2d& L2,
|
||||||
|
const IntRes2d_Domain& Domain1,
|
||||||
|
const IntRes2d_Domain& Domain2,
|
||||||
|
const Standard_Real theTol)
|
||||||
|
{
|
||||||
|
Standard_Boolean isFirst1 = (Domain1.HasFirstPoint() &&
|
||||||
|
L2.Distance(Domain1.FirstPoint()) < theTol);
|
||||||
|
Standard_Boolean isLast1 = (Domain1.HasLastPoint() &&
|
||||||
|
L2.Distance(Domain1.LastPoint()) < theTol);
|
||||||
|
if (isFirst1 && isLast1)
|
||||||
|
return Standard_True;
|
||||||
|
Standard_Boolean isFirst2 = (Domain2.HasFirstPoint() &&
|
||||||
|
L1.Distance(Domain2.FirstPoint()) < theTol);
|
||||||
|
Standard_Boolean isLast2 = (Domain2.HasLastPoint() &&
|
||||||
|
L1.Distance(Domain2.LastPoint()) < theTol);
|
||||||
|
return isFirst2 && isLast2;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1
|
void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1
|
||||||
,const IntRes2d_Domain& Domain1
|
,const IntRes2d_Domain& Domain1
|
||||||
@ -1220,6 +1244,9 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1
|
|||||||
|
|
||||||
done=Standard_True;
|
done=Standard_True;
|
||||||
|
|
||||||
|
if(nbsol==1 && CheckLLCoincidence(L1, L2, Domain1, Domain2, Tol))
|
||||||
|
nbsol = 2;
|
||||||
|
|
||||||
if(nbsol==1) {
|
if(nbsol==1) {
|
||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
//-- d: distance du point I a partir de laquelle les
|
//-- d: distance du point I a partir de laquelle les
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
puts "TODO OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
puts "TODO OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||||
puts "TODO OCC26020 ALL: Error: bopcheck failed"
|
puts "TODO OCC26020 ALL: Error: bopcheck failed"
|
||||||
puts "TODO OCC26020 Linux: Error : The area of the resulting shape is"
|
puts "TODO OCC26020 ALL: Error : The area of the resulting shape is"
|
||||||
|
|
||||||
# planar face
|
# planar face
|
||||||
plane pln_f1 35.877464033656999 5.9462928582193458e-016 -25.973690230789806 -0.64944804833018333 -3.0834627769631957e-016 -0.76040596560003137
|
plane pln_f1 35.877464033656999 5.9462928582193458e-016 -25.973690230789806 -0.64944804833018333 -3.0834627769631957e-016 -0.76040596560003137
|
||||||
|
23
tests/bugs/modalg_6/bug26099
Normal file
23
tests/bugs/modalg_6/bug26099
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC26099"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
##################################################
|
||||||
|
# Wrong result done by 2d intersection algorithm
|
||||||
|
##################################################
|
||||||
|
|
||||||
|
restore [locate_data_file OCC26099-f.brep] f
|
||||||
|
explode f e
|
||||||
|
pcurve c4 f_4 f
|
||||||
|
pcurve c5 f_5 f
|
||||||
|
set bug_info [2dintersect c4 c5]
|
||||||
|
|
||||||
|
if {[regexp {fist: ([\-0-9.]*) .*second: ([\-0-9.]*)} $bug_info dummy par1 par2] == 0} {
|
||||||
|
puts "ERROR: OCC26099 is reproduced. No intersection."
|
||||||
|
}
|
||||||
|
|
||||||
|
set refpar1 0.98989794855663704
|
||||||
|
set refpar2 0
|
||||||
|
if {[expr abs($par1-$refpar1)] > 0.0001 || [expr abs($par2-$refpar2)] > 0.0001} {
|
||||||
|
puts "ERROR: OCC26099 is reproduced. Parameters are $par1 and $par2, expected $refpar1 and $refpar2"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user