1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0027468: Incorrect processing of some cases by HLR algorithm

Incorrect work of HLR algorithm caused by usage of wrong tolerances, wrong sampling of 2d curve and some other bugs are fixed.

Test cases for issue CR27341
This commit is contained in:
jgv
2016-05-05 15:47:43 +03:00
committed by bugmaster
parent b7b2f85ac1
commit c59fcd1186
12 changed files with 45 additions and 115 deletions

View File

@@ -60,8 +60,8 @@ HLRBRep_CurveTool::NbSamples (const Standard_Address C)
Standard_Integer
HLRBRep_CurveTool::NbSamples (const Standard_Address C,
const Standard_Real /*u1*/,
const Standard_Real /*u2*/)
const Standard_Real u1,
const Standard_Real u2)
{
GeomAbs_CurveType typC = ((HLRBRep_Curve *)C)->GetType();
static Standard_Real nbsOther = 10.0;
@@ -72,7 +72,9 @@ HLRBRep_CurveTool::NbSamples (const Standard_Address C,
else if(typC == GeomAbs_BezierCurve)
nbs = 3 + ((HLRBRep_Curve *)C)->NbPoles();
else if(typC == GeomAbs_BSplineCurve) {
nbs = ((HLRBRep_Curve *)C)->NbKnots();
Handle(Geom_Curve) aCurve = ((HLRBRep_Curve *)C)->Curve().Curve().Curve();
GeomAdaptor_Curve GAcurve(aCurve, u1, u2);
nbs = GAcurve.NbIntervals(GeomAbs_CN) + 1;
nbs*= ((HLRBRep_Curve *)C)->Degree();
if(nbs < 2.0) nbs=2;
}

View File

@@ -774,7 +774,7 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P)
Standard_Boolean withOutL = Standard_False;
for (myFaceItr1.InitEdge(*fd);
myFaceItr1.MoreEdge() && !cut && !withOutL;
myFaceItr1.MoreEdge();
myFaceItr1.NextEdge()) {
if (myFaceItr1.Internal()) {
withOutL = Standard_True;

View File

@@ -118,7 +118,10 @@ void HLRBRep_Intersector::Perform (const Standard_Address A1,
b = ((HLRBRep_Curve*)myC1)->Parameter2d(b);
IntRes2d_Domain D1(pa,a,(Standard_Real)ta,pb,b,(Standard_Real)tb);
tol = (Standard_Real)(((HLRBRep_EdgeData*) A1)->Tolerance());
//modified by jgv, 18.04.2016 for OCC27341
//tol = (Standard_Real)(((HLRBRep_EdgeData*) A1)->Tolerance());
tol = Precision::Confusion();
//////////////////////////////////////////
myIntersector.Perform(myC1,D1,tol,tol);
}
@@ -155,8 +158,12 @@ void HLRBRep_Intersector::Perform (const Standard_Integer /*nA*/,
Standard_Real a1,b1,a2,b2,d,dd,tol,tol1,tol2;
Standard_ShortReal ta,tb;
tol1 = (Standard_Real)(((HLRBRep_EdgeData*) A1)->Tolerance());
tol2 = (Standard_Real)(((HLRBRep_EdgeData*) A2)->Tolerance());
//modified by jgv, 18.04.2016 for OCC27341
//tol1 = (Standard_Real)(((HLRBRep_EdgeData*) A1)->Tolerance());
//tol2 = (Standard_Real)(((HLRBRep_EdgeData*) A2)->Tolerance());
tol1 = Precision::Confusion();
tol2 = Precision::Confusion();
//////////////////////////////////////////
if (tol1 > tol2) tol = tol1;
else tol = tol2;