1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0025632: IGES writer looses face orientation

Adding reversing surfaces before writing for reversed faces

Test case for issue CR25632
This commit is contained in:
ika
2015-01-29 14:13:29 +03:00
committed by bugmaster
parent fd3ba7a1d9
commit 2157cfd0ef
3 changed files with 130 additions and 18 deletions

View File

@@ -235,11 +235,20 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
Handle(BRep_CurveRepresentation) cr;
Handle(BRep_GCurve) GC;
Standard_Real f = 0.,l = 0.;
Standard_Boolean rangeFound = Standard_False;
while (itcr.More()) {
GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
if ( !GC.IsNull() ) {
GC->Range(f,l);
if (GC->IsCurve3D()) {
GC->Range(f,l);
Standard_Boolean undefined = (Precision::IsPositiveInfinite(l) ||
Precision::IsNegativeInfinite(f));
if (!undefined) {
rangeFound = Standard_True;
}
}
Standard_Boolean iscos = GC->IsCurveOnSurface(S,L);
if (iscos) break;
}
@@ -257,7 +266,7 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
Handle(BRep_CurveOnClosedSurface) COS =
new BRep_CurveOnClosedSurface(C1,C2,S,L,GeomAbs_C0);
// test if there is already a range
if (!GC.IsNull()) {
if (rangeFound) {
COS->SetRange(f,l);
}
lcr.Append(COS);
@@ -282,11 +291,20 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
Handle(BRep_CurveRepresentation) cr;
Handle(BRep_GCurve) GC;
Standard_Real f = 0.,l = 0.;
Standard_Boolean rangeFound = Standard_False;
while (itcr.More()) {
GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
if ( !GC.IsNull() ) {
GC->Range(f,l);
if (GC->IsCurve3D()) {
GC->Range(f,l);
Standard_Boolean undefined = (Precision::IsPositiveInfinite(l) ||
Precision::IsNegativeInfinite(f));
if (!undefined) {
rangeFound = Standard_True;
}
}
Standard_Boolean iscos = GC->IsCurveOnSurface(S,L);
if (iscos) break;
}
@@ -304,7 +322,7 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
Handle(BRep_CurveOnClosedSurface) COS =
new BRep_CurveOnClosedSurface(C1,C2,S,L,GeomAbs_C0);
// test if there is already a range
if (!GC.IsNull()) {
if (rangeFound) {
COS->SetRange(f,l);
}
COS->SetUVPoints2(Pf,Pl);