From df69c264726dce2ce10ad93eac0a072898f9bfb8 Mon Sep 17 00:00:00 2001 From: mgerus Date: Wed, 18 May 2022 09:45:05 +0300 Subject: [PATCH] 0026697: BRepFeat_MakePrism returns empty compound Add fix in direction of prism calculation --- src/BRepFeat/BRepFeat_MakePrism.cxx | 4 ++-- tests/bugs/modalg_7/bug26697 | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/BRepFeat/BRepFeat_MakePrism.cxx b/src/BRepFeat/BRepFeat_MakePrism.cxx index 34ed188e4f..daa4a39a7f 100644 --- a/src/BRepFeat/BRepFeat_MakePrism.cxx +++ b/src/BRepFeat/BRepFeat_MakePrism.cxx @@ -987,8 +987,8 @@ Standard_Integer SensOfPrism(const Handle(Geom_Curve) C, ASI1.Perform(scur); Standard_Integer sens = 1; if(ASI1.IsDone() && ASI1.NbPoints(1) >= 1) { - if(ASI1.Point(1, 1).Parameter() < 0. && - ASI1.Point(1, ASI1.NbPoints(1)).Parameter() < 0.) { + if(ASI1.Point(1, 1).Parameter() + Precision::Confusion() < 0. && + ASI1.Point(1, ASI1.NbPoints(1)).Parameter() + Precision::Confusion() < 0.) { sens = -1; } } diff --git a/tests/bugs/modalg_7/bug26697 b/tests/bugs/modalg_7/bug26697 index 2ee70f5fbc..4ce799ef81 100644 --- a/tests/bugs/modalg_7/bug26697 +++ b/tests/bugs/modalg_7/bug26697 @@ -1,20 +1,15 @@ -puts "TODO CR26697 ALL: Error : is WRONG because number of SHAPE entities" - puts "================" -puts "CR26697" +puts "bug26697: BRepFeat_MakePrism returns empty compound" puts "================" puts "" -############################################### -## BRepFeat_MakePrism returns empty compound -############################################### restore [locate_data_file bug26697_aBase.brep] aB restore [locate_data_file bug26697_aFrom.brep] aF restore [locate_data_file bug26697_aTo.brep] aT featprism aB aB aB 0 -1 0 2 1 -featperform prism aR aF aT +featperform prism result aF aT -checknbshapes aR -shape 2 +checknbshapes result -face 3 checkview -display result -2d -path ${imagedir}/${test_image}.png