1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-16 10:08:36 +03:00

0027784: Thickness fails on cylinder with draft

Incorrect calculation of intersection in 2D space is fixed.
This commit is contained in:
aml 2017-10-31 06:43:57 +03:00 committed by bugmaster
parent 5891b8ba41
commit 3cdf48fe62
3 changed files with 10 additions and 10 deletions

View File

@ -2365,6 +2365,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F,
#endif #endif
Standard_Real U1 = 0.,U2 = 0.; Standard_Real U1 = 0.,U2 = 0.;
gp_Pnt2d P2d; gp_Pnt2d P2d;
Standard_Boolean aCurrentFind = Standard_False;
if (itry == 1) { if (itry == 1) {
fl1[0] = C1->FirstParameter(); fl1[1] = C1->LastParameter(); fl1[0] = C1->FirstParameter(); fl1[1] = C1->LastParameter();
fl2[0] = C2->FirstParameter(); fl2[1] = C2->LastParameter(); fl2[0] = C2->FirstParameter(); fl2[1] = C2->LastParameter();
@ -2384,6 +2385,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F,
Abs(fl2[i2]) < Precision::Infinite() ) { Abs(fl2[i2]) < Precision::Infinite() ) {
if (P1[i1].IsEqual(P2[i2],TolConf)) { if (P1[i1].IsEqual(P2[i2],TolConf)) {
YaSol = Standard_True; YaSol = Standard_True;
aCurrentFind = Standard_True;
U1 = fl1[i1]; U2 = fl2[i2]; U1 = fl1[i1]; U2 = fl2[i2];
P2d = C1->Value(U1); P2d = C1->Value(U1);
} }
@ -2410,6 +2412,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F,
if (Dist2Min <= Precision::SquareConfusion()) if (Dist2Min <= Precision::SquareConfusion())
{ {
YaSol = Standard_True; YaSol = Standard_True;
aCurrentFind = Standard_True;
P2d = P1[i1]; P2d = P1[i1];
U1 = fl1[i1]; U1 = fl1[i1];
U2 = (extr.Point(IndexMin)).Parameter(); U2 = (extr.Point(IndexMin)).Parameter();
@ -2437,6 +2440,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F,
if (Dist2Min <= Precision::SquareConfusion()) if (Dist2Min <= Precision::SquareConfusion())
{ {
YaSol = Standard_True; YaSol = Standard_True;
aCurrentFind = Standard_True;
P2d = P2[i2]; P2d = P2[i2];
U2 = fl2[i2]; U2 = fl2[i2];
U1 = (extr.Point(IndexMin)).Parameter(); U1 = (extr.Point(IndexMin)).Parameter();
@ -2451,12 +2455,14 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F,
if (!Inter.IsEmpty() && Inter.NbPoints() > 0) { if (!Inter.IsEmpty() && Inter.NbPoints() > 0) {
YaSol = Standard_True; YaSol = Standard_True;
aCurrentFind = Standard_True;
U1 = Inter.Point(1).ParamOnFirst(); U1 = Inter.Point(1).ParamOnFirst();
U2 = Inter.Point(1).ParamOnSecond(); U2 = Inter.Point(1).ParamOnSecond();
P2d = Inter.Point(1).Value(); P2d = Inter.Point(1).Value();
} }
else if (!Inter.IsEmpty() && Inter.NbSegments() > 0) { else if (!Inter.IsEmpty() && Inter.NbSegments() > 0) {
YaSol = Standard_True; YaSol = Standard_True;
aCurrentFind = Standard_True;
IntRes2d_IntersectionSegment Seg = Inter.Segment(1); IntRes2d_IntersectionSegment Seg = Inter.Segment(1);
IntRes2d_IntersectionPoint IntP1 = Seg.FirstPoint(); IntRes2d_IntersectionPoint IntP1 = Seg.FirstPoint();
IntRes2d_IntersectionPoint IntP2 = Seg.LastPoint(); IntRes2d_IntersectionPoint IntP2 = Seg.LastPoint();
@ -2479,7 +2485,7 @@ void BRepOffset_Tool::Inter2d (const TopoDS_Face& F,
P2d.SetY( (P2d1.Y() + P2d2.Y()) / 2.); P2d.SetY( (P2d1.Y() + P2d2.Y()) / 2.);
} }
} }
if (YaSol) { if (aCurrentFind) {
gp_Pnt P = S->Value(P2d.X(),P2d.Y()); gp_Pnt P = S->Value(P2d.X(),P2d.Y());
TopoDS_Vertex V = BRepLib_MakeVertex(P); TopoDS_Vertex V = BRepLib_MakeVertex(P);
V.Orientation(TopAbs_INTERNAL); V.Orientation(TopAbs_INTERNAL);

View File

@ -1,5 +1,3 @@
puts "TODO OCC25930 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "============" puts "============"
puts "OCC25930" puts "OCC25930"
puts "============" puts "============"

View File

@ -1,7 +1,3 @@
puts "TODO OCC27784 ALL: An exception was caught"
puts "TODO OCC27784 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO OCC27784 ALL: TEST INCOMPLETE"
puts "========" puts "========"
puts "OCC27784" puts "OCC27784"
puts "========" puts "========"