1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

0025908: BSpline (U2 < U1) in HLRBRep_HLRToShape

Test case for issue CR25908
This commit is contained in:
msv 2015-04-30 14:22:56 +03:00 committed by bugmaster
parent 7b1c1b7cbb
commit 46b2b6afa0
2 changed files with 73 additions and 4 deletions

View File

@ -430,15 +430,19 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
EB.Builds(aBuildIN); // build hidden parts
// ******************
while (EB.MoreEdges()) {
while (EB.MoreVertices()) {
p1 = 0.; p2 = 0.;
Standard_Integer aMaskP1P2 = 0;
while (EB.MoreVertices()) {
switch (EB.Orientation()) {
case TopAbs_FORWARD :
p1 = EB.Current().Parameter();
tol1 = EB.Current().Tolerance();
aMaskP1P2 |= 1;
break;
case TopAbs_REVERSED :
p2 = EB.Current().Parameter();
tol2 = EB.Current().Tolerance();
aMaskP1P2 |= 2;
break;
case TopAbs_INTERNAL :
case TopAbs_EXTERNAL :
@ -447,7 +451,7 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
EB.NextVertex();
}
if(Abs(p1 - p2) <= 1.e-7) {
if(aMaskP1P2 != 3 || p2 - p1 <= 1.e-7) {
EB.NextEdge();
continue;
}
@ -479,15 +483,19 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
EB.Builds(TopAbs_ON); // build parts under the boundary
// ******************************
while (EB.MoreEdges()) {
p1 = 0.; p2 = 0.;
Standard_Integer aMaskP1P2 = 0;
while (EB.MoreVertices()) {
switch (EB.Orientation()) {
case TopAbs_FORWARD :
p1 = EB.Current().Parameter();
tol1 = EB.Current().Tolerance();
aMaskP1P2 |= 1;
break;
case TopAbs_REVERSED :
p2 = EB.Current().Parameter();
tol2 = EB.Current().Tolerance();
aMaskP1P2 |= 2;
break;
case TopAbs_INTERNAL :
case TopAbs_EXTERNAL :
@ -495,7 +503,12 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
}
EB.NextVertex();
}
if(aMaskP1P2 != 3 || p2 - p1 <= 1.e-7) {
EB.NextEdge();
continue;
}
TopAbs_State aTestState = TopAbs_IN;
if(IsSuspicion) {
//Standard_Integer aNbp = 1;
@ -558,15 +571,19 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
EB.Builds (TopAbs_IN); // build parts on the Face
// ***********************
while (EB.MoreEdges()) {
p1 = 0.; p2 = 0.;
Standard_Integer aMaskP1P2 = 0;
while (EB.MoreVertices()) {
switch (EB.Orientation()) {
case TopAbs_FORWARD :
p1 = EB.Current().Parameter();
tol1 = EB.Current().Tolerance();
aMaskP1P2 |= 1;
break;
case TopAbs_REVERSED :
p2 = EB.Current().Parameter();
tol2 = EB.Current().Tolerance();
aMaskP1P2 |= 2;
break;
case TopAbs_INTERNAL :
case TopAbs_EXTERNAL :
@ -574,6 +591,12 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
}
EB.NextVertex();
}
if(aMaskP1P2 != 3 || p2 - p1 <= 1.e-7) {
EB.NextEdge();
continue;
}
ES.Hide(p1,tol1,p2,tol2,
Standard_True, // on the Face
Standard_False); // inside the Face
@ -583,15 +606,19 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
EB.Builds(TopAbs_ON); // build hidden parts under the boundary
// *************************************
while (EB.MoreEdges()) {
p1 = 0.; p2 = 0.;
Standard_Integer aMaskP1P2 = 0;
while (EB.MoreVertices()) {
switch (EB.Orientation()) {
case TopAbs_FORWARD :
p1 = EB.Current().Parameter();
tol1 = EB.Current().Tolerance();
aMaskP1P2 |= 1;
break;
case TopAbs_REVERSED :
p2 = EB.Current().Parameter();
tol2 = EB.Current().Tolerance();
aMaskP1P2 |= 2;
break;
case TopAbs_INTERNAL :
case TopAbs_EXTERNAL :
@ -599,7 +626,13 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI,
}
EB.NextVertex();
}
ES.Hide(p1,tol1,p2,tol2,
if(aMaskP1P2 != 3 || p2 - p1 <= 1.e-7) {
EB.NextEdge();
continue;
}
ES.Hide(p1,tol1,p2,tol2,
Standard_True, // on the Face
Standard_True); // on the boundary
EB.NextEdge();

36
tests/bugs/modalg_6/bug25908 Executable file
View File

@ -0,0 +1,36 @@
puts "============"
puts "OCC25908"
puts "============"
puts ""
###############################
## BSpline (U2 < U1) in HLRBRep_HLRToShape
###############################
restore [locate_data_file bug25908_hlr-bspline-clone2-tcl-h1.brep] h1
hprj h1_proj 0 0 0 0 1 0 0 0 1
houtl h1_outl h1
hfill h1_outl h1_proj 0
hload h1_outl
hsetprj h1_proj
hupdate
hhide
hres2d
compound vl v1l vnl vol vil result
set nbshapes_expected "
Number of shapes in shape
VERTEX : 169
EDGE : 85
WIRE : 0
FACE : 0
SHELL : 0
SOLID : 0
COMPSOLID : 0
COMPOUND : 1
SHAPE : 255
"
checknbshapes result -ref ${nbshapes_expected} -t -m "HLRToShape"
set 2dviewer 1