mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-31 11:15:31 +03:00
0026330: BRepOffsetAPI_ThruSections creates invalid shape
Test case for issue CR26330
This commit is contained in:
parent
9f87ad8c86
commit
e55cd82c8e
@ -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;
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,8 @@ void BRepCheck_Edge::Minimum()
|
||||
Handle(Geom_Curve) C3d = Handle(Geom_Curve)::DownCast
|
||||
(myCref->Curve3D()->Transformed
|
||||
(/*myCref->Location()*/L.Transformation()));
|
||||
GeomAdaptor_Curve GAC3d(C3d,First,Last);
|
||||
GeomAdaptor_Curve GAC3d(C3d, C3d->TransformedParameter(First, L.Transformation()),
|
||||
C3d->TransformedParameter(Last, L.Transformation()));
|
||||
myHCurve = new GeomAdaptor_HCurve(GAC3d);
|
||||
}
|
||||
else { // curve on surface
|
||||
@ -274,6 +275,8 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
|
||||
const TopLoc_Location& TFloc = TF->Location();
|
||||
const Handle(Geom_Surface)& Su = TF->Surface();
|
||||
TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location());
|
||||
TopLoc_Location LE = myShape.Location() * myCref->Location();
|
||||
const gp_Trsf& Etrsf = LE.Transformation();
|
||||
Standard_Boolean pcurvefound = Standard_False;
|
||||
|
||||
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
|
||||
@ -284,16 +287,18 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
|
||||
const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
|
||||
Standard_Real f,l;
|
||||
GC->Range(f,l);
|
||||
Standard_Real ff = f, ll = l;
|
||||
if(myCref->IsCurve3D())
|
||||
{
|
||||
ff = myCref->Curve3D()->TransformedParameter(f, Etrsf);
|
||||
ll = myCref->Curve3D()->TransformedParameter(l, Etrsf);
|
||||
}
|
||||
// gka OCC
|
||||
// Modified by skv - Tue Apr 27 11:50:35 2004 Begin
|
||||
// if (SameRange && (fabs(f-First) > Precision::PConfusion() || fabs(l-Last)> Precision::PConfusion())) { //f != First || l != Last)) { gka OCC
|
||||
if (Abs(f-First) > Precision::PConfusion() ||
|
||||
Abs(l-Last) > Precision::PConfusion()) {
|
||||
if (Abs(ff-First) > Precision::PConfusion() ||
|
||||
Abs(ll-Last) > Precision::PConfusion()) {
|
||||
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
|
||||
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
||||
// if (SameParameter) {
|
||||
// BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
||||
// }
|
||||
}
|
||||
// Modified by skv - Tue Apr 27 11:50:37 2004 End
|
||||
if (myGctrl) {
|
||||
|
21
tests/bugs/modalg_6/bug26330
Normal file
21
tests/bugs/modalg_6/bug26330
Normal file
@ -0,0 +1,21 @@
|
||||
puts "=========="
|
||||
puts "OCC26330"
|
||||
puts "=========="
|
||||
puts ""
|
||||
############################################################
|
||||
# BRepOffsetAPI_ThruSections creates invalid shape
|
||||
############################################################
|
||||
|
||||
restore [locate_data_file bug26330_s1.brep] s1
|
||||
restore [locate_data_file bug26330_s2.brep] s2
|
||||
|
||||
# both wires seem okay
|
||||
checkshape s1
|
||||
checkshape s2
|
||||
|
||||
thrusections result 1 1 s1 s2
|
||||
|
||||
# check subshapes
|
||||
checkshape result
|
||||
|
||||
set 3dviewer 1
|
Loading…
x
Reference in New Issue
Block a user