From aa9f1ba2de3bd9abdb6386e1baf5234c254e0a86 Mon Sep 17 00:00:00 2001 From: akaftasev Date: Thu, 9 Feb 2023 18:36:01 +0300 Subject: [PATCH] 0033263: Modeling Algorithms - BRepFilletAPI_MakeFillet doesn't work for current parameters Do not calculate edge state if there are more than 4 G1 connections for currect vertex. --- src/ChFi3d/ChFi3d_Builder_1.cxx | 7 +++++-- tests/bugs/modalg_8/bug33113 | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 tests/bugs/modalg_8/bug33113 diff --git a/src/ChFi3d/ChFi3d_Builder_1.cxx b/src/ChFi3d/ChFi3d_Builder_1.cxx index eca3b71ad8..3355704b5b 100644 --- a/src/ChFi3d/ChFi3d_Builder_1.cxx +++ b/src/ChFi3d/ChFi3d_Builder_1.cxx @@ -692,7 +692,6 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine) else{ sst = Spine->LastStatus(); iedge = Spine->NbEdges(); - E[0] = Spine->Edges(iedge); V = Spine->LastVertex(); } //Before all it is checked if the tangency is not dead. @@ -703,6 +702,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine) } if(sst == ChFiDS_BreakPoint){ + Standard_Integer aLocNbG1Connections = 0; TopTools_ListIteratorOfListOfShape It;//,Jt; Standard_Boolean sommetpourri = Standard_False; TopTools_IndexedMapOfOrientedShape EdgesOfV; @@ -720,7 +720,10 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine) if (!F2.IsNull() && ChFi3d::IsTangentFaces(anEdge, F1, F2, GeomAbs_G2)) //smooth edge { if (!F1.IsSame(F2)) + { NbG1Connections++; + aLocNbG1Connections++; + } continue; } @@ -759,7 +762,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine) if (EdgesOfV.Extent() != 3) sommetpourri = Standard_True; - if(!sommetpourri){ + if(!sommetpourri && aLocNbG1Connections < 4){ sst = ChFi3d_EdgeState(E,myEFMap); } if(ii==1)Spine->SetFirstStatus(sst); diff --git a/tests/bugs/modalg_8/bug33113 b/tests/bugs/modalg_8/bug33113 new file mode 100644 index 0000000000..26d80a1b82 --- /dev/null +++ b/tests/bugs/modalg_8/bug33113 @@ -0,0 +1,18 @@ +puts "================================" +puts "OCC33113: Modeling Algorithms - BRepFilletAPI_MakeFillet::Build SIGSEGV" +puts "================================" + +restore [locate_data_file bug33113.brep] sh + +explode sh e +copy sh_4 e + +explode sh So +copy sh_1 s + +fillet res s 0.1 e + +checkshape res + +checkview -display res -3d -path ${imagedir}/${test_image}.png +