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

0026330: BRepOffsetAPI_ThruSections creates invalid shape

Test case for issue CR26330
This commit is contained in:
ifv
2015-06-25 13:08:47 +03:00
committed by bugmaster
parent 539d3a1b7f
commit b77233473a
3 changed files with 276 additions and 248 deletions

View File

@@ -337,22 +337,24 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
return nullPCurve;
}
aCurveLocation = L.Predivided(aCurveLocation);
aCurveLocation = aCurveLocation.Predivided(L);
First = f; Last = l; //Range of edge must not be modified
Handle(Geom_Plane) Plane = GP;
if (!aCurveLocation.IsIdentity())
{
const gp_Trsf& T = aCurveLocation.Transformation();
Handle(Geom_Geometry) GPT = GP->Transformed(T);
Plane = *((Handle(Geom_Plane)*)&GPT);
Handle(Geom_Geometry) GC3d = C3d->Transformed(T);
C3d = *((Handle(Geom_Curve)*)&GC3d);
f = C3d->TransformedParameter(f, T);
l = C3d->TransformedParameter(l, T);
}
GeomAdaptor_Surface& GAS = HS->ChangeSurface();
GAS.Load(Plane);
GAS.Load(GP);
Handle(Geom_Curve) ProjOnPlane =
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,f,l,Standard_True,Standard_False),
Plane,
Plane->Position().Direction(),
GP,
GP->Position().Direction(),
Standard_True);
GeomAdaptor_Curve& GAC = HC->ChangeCurve();
@@ -366,7 +368,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
(*((Handle(Geom2d_TrimmedCurve)*)&pc));
pc = TC->BasisCurve();
}
First = f; Last = l;
return pc;
}