Added QA command OCC24012 and test case bugs/modalg_5/bug24012 for issue 24012.
authorapn <apn@opencascade.com>
Thu, 13 Feb 2014 09:22:06 +0000 (13:22 +0400)
committerapn <apn@opencascade.com>
Thu, 13 Feb 2014 10:04:45 +0000 (14:04 +0400)
src/QABugs/QABugs_19.cxx
tests/bugs/modalg_5/bug24012 [new file with mode: 0644]

index 65e85d7..881dee7 100755 (executable)
@@ -1271,6 +1271,43 @@ static Standard_Integer OCC24005 (Draw_Interpretor& theDI, Standard_Integer theN
   return 0;
 }
 
+#include <BRepAlgo_NormalProjection.hxx>
+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 <Extrema_FuncExtPS.hxx>
 #include <math_FunctionSetRoot.hxx>
 #include <math_Vector.hxx>
@@ -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 (file)
index 0000000..13ef5f1
--- /dev/null
@@ -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