From 1b7602c84a6f01ec30152eab31e71a4743c6318a Mon Sep 17 00:00:00 2001 From: apn Date: Thu, 13 Feb 2014 13:22:06 +0400 Subject: [PATCH] Added QA command OCC24012 and test case bugs/modalg_5/bug24012 for issue 24012. --- src/QABugs/QABugs_19.cxx | 38 +++++++++++++++++++++++++++++++++ tests/bugs/modalg_5/bug24012 | 41 ++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 tests/bugs/modalg_5/bug24012 diff --git a/src/QABugs/QABugs_19.cxx b/src/QABugs/QABugs_19.cxx index 65e85d7cb2..881dee7132 100755 --- a/src/QABugs/QABugs_19.cxx +++ b/src/QABugs/QABugs_19.cxx @@ -1271,6 +1271,43 @@ static Standard_Integer OCC24005 (Draw_Interpretor& theDI, Standard_Integer theN return 0; } +#include +static Standard_Integer OCC24012 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) +{ + if (argc != 3) { + di << "Usage : " << argv[0] << " should be 2 arguments (face and edge)"; + return 1; + } + + Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext(); + if(myAISContext.IsNull()) { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + + TopoDS_Face m_Face1 = TopoDS::Face(DBRep::Get(argv[1])); + TopoDS_Edge m_Edge = TopoDS::Edge(DBRep::Get(argv[2])); + + BRepAlgo_NormalProjection anormpro(m_Face1); + anormpro.Add(m_Edge); + anormpro.SetDefaultParams(); + + //anormpro.Compute3d(); + //anormpro.SetLimit(); + + anormpro.Build(); + + if (anormpro.IsDone()) + { + TopoDS_Shape rshape = anormpro.Projection(); + Handle(AIS_InteractiveObject) myShape = new AIS_Shape (rshape); + myAISContext->SetColor(myShape, Quantity_Color(Quantity_NOC_YELLOW)); + myAISContext->Display(myShape, Standard_True); + } + + return 0; +} + #include #include #include @@ -1590,5 +1627,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) { theCommands.Add ("OCC24271", "Boolean operations on NCollection_Map", __FILE__, OCC24271, group); theCommands.Add ("OCC24370", "OCC24370 edge pcurve surface prec", __FILE__, OCC24370, group); theCommands.Add ("OCC24533", "OCC24533", __FILE__, OCC24533, group); + theCommands.Add ("OCC24012", "OCC24012 face edge", __FILE__, OCC24012, group); return; } diff --git a/tests/bugs/modalg_5/bug24012 b/tests/bugs/modalg_5/bug24012 new file mode 100644 index 0000000000..13ef5f18f3 --- /dev/null +++ b/tests/bugs/modalg_5/bug24012 @@ -0,0 +1,41 @@ +puts "============" +puts "OCC24012" +puts "============" +puts "" +############################################ +# problem with BRepAlgo_NormalProjection +############################################ + +pload XDE +pload QAcommands + +igesread [locate_data_file bug24012_face.igs] face * +igesread [locate_data_file bug24012_line.igs] edge * + +vinit +OCC24012 face edge +vsetdispmode 0 +vdisplay face +vdisplay edge +vfit + + +set scale 71.101493567712652 +set center_X 8.280398902360842 +set center_Y 7.1615404015522026 +set proj_X -0.14605970947882216 +set proj_Y -0.18639384905183365 +set proj_Z 0.97155745805516014 +set up_X -0.587582742029223 +set up_Y 0.80643668322534767 +set up_Z 0.066380699137021923 +set at_X 3.9226062794202492 +set at_Y -3.6740070074451168 +set at_Z 6.1530005464201167 + +vviewparams ${scale} ${center_X} ${center_Y} \ +${proj_X} ${proj_Y} ${proj_Z} \ +${up_X} ${up_Y} ${up_Z} \ +${at_X} ${at_Y} ${at_Z} + +set only_screen 1 -- 2.20.1