1 // Created on: 2002-03-18
2 // Created by: QA Admin
3 // Copyright (c) 2002-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
26 #include <Draw_Interpretor.hxx>
28 #include <DrawTrSurf.hxx>
29 #include <AIS_InteractiveContext.hxx>
30 #include <ViewerTest.hxx>
31 #include <ViewerTest_EventManager.hxx>
32 #include <AIS_Shape.hxx>
33 #include <TopoDS_Shape.hxx>
35 #include <Geom_Circle.hxx>
36 #include <Geom_Ellipse.hxx>
37 #include <Geom_Plane.hxx>
39 #include <Geom2d_Curve.hxx>
40 #include <GeomAPI.hxx>
41 #include <Geom2dAdaptor_Curve.hxx>
42 #include <Geom2dGcc_QualifiedCurve.hxx>
43 #include <Geom2dGcc_Lin2d2Tan.hxx>
44 #include <Geom2d_Line.hxx>
45 #include <BRepBuilderAPI_MakeEdge.hxx>
46 #include <TopoDS_Edge.hxx>
47 #include <Precision.hxx>
48 #include <Geom2d_Circle.hxx>
49 #include <Geom2dGcc_MyQCurve.hxx>
50 #include <GccEnt_QualifiedCirc.hxx>
51 #include <Geom2dGcc_MyL2d2Tan.hxx>
52 #include <BRepBuilderAPI_MakeWire.hxx>
53 #include <TopExp_Explorer.hxx>
55 #include <TopoDS_Wire.hxx>
56 #include <BRep_Tool.hxx>
57 #include <gp_Circ.hxx>
58 #include <BRepOffsetAPI_MakePipeShell.hxx>
59 #include <AIS_Trihedron.hxx>
60 #include <Geom_Axis2Placement.hxx>
61 #include <V3d_View.hxx>
62 #include <ViewerTest_Tool.hxx>
63 #include <BRepBuilderAPI_MakeVertex.hxx>
64 #include <AIS_LengthDimension.hxx>
65 #include <AIS_RadiusDimension.hxx>
66 #include <BRepPrimAPI_MakeBox.hxx>
67 #include <GeomAdaptor_Surface.hxx>
68 #include <Extrema_ExtPS.hxx>
69 #include <Geom_CartesianPoint.hxx>
70 #include <Geom2d_CartesianPoint.hxx>
71 #include <Geom2dGcc_Circ2d3Tan.hxx>
72 #include <Aspect_Window.hxx>
74 #include <TopoDS_Compound.hxx>
75 #include <TopoDS_CompSolid.hxx>
76 #include <StdSelect_ShapeTypeFilter.hxx>
77 #include <QABugs_MyText.hxx>
78 #include <Prs3d_Projector.hxx>
79 #include <HLRAlgo_Projector.hxx>
80 #include <Standard_ErrorHandler.hxx>
81 #include <Font_NameOfFont.hxx>
83 static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*/,const char ** /*argv*/)
85 Standard_Character abuf[16];
86 //Standard_Character * abuf = new Standard_Character[16];
88 Standard_CString st = abuf;
90 Handle(Geom_Circle) cir = new Geom_Circle (gp_Ax2 (gp_Pnt (823.687192, 502.366825, 478.960440), gp_Dir (0.173648, 0.984808, 0.000000), gp_Dir (-0.932169, 0.164367, -0.322560)), 50);
91 Handle(Geom_Ellipse) ell = new Geom_Ellipse (gp_Ax2 (gp_Pnt (1262.224429, 425.040878, 363.609716), gp_Dir (0.173648, 0.984808, 0.000000), gp_Dir (-0.932169, 0.164367, -0.322560)), 150, 100);
92 Handle(Geom_Plane) plne = new Geom_Plane (gp_Ax3 (gp_Ax2 (gp_Pnt (1262.224429, 425.040878, 363.609716), gp_Dir (0.173648, 0.984808, 0.000000), gp_Dir (-0.932169, 0.164367, -0.322560))));
94 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
96 gp_Pln pln = plne->Pln();
97 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d (ell, pln);
99 DrawTrSurf::Set(st,curve2d);
100 if(!aContext.IsNull()) {
101 Handle(AIS_Shape) aisp =
102 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
103 aContext->Display (aisp);
106 Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d (cir, pln);
108 DrawTrSurf::Set(st,fromcurve2d);
109 if(!aContext.IsNull()) {
110 Handle(AIS_Shape) aisp =
111 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
112 aContext->Display (aisp);
115 Geom2dAdaptor_Curve acur (curve2d), afromcur (fromcurve2d);
116 Geom2dGcc_QualifiedCurve qcur (acur, GccEnt_outside);
117 Geom2dGcc_QualifiedCurve qfromcur (afromcur, GccEnt_outside);
118 Geom2dGcc_Lin2d2Tan lintan (qcur, qfromcur, 0.1, 0.0, 0.0);
119 Standard_Integer i=0;
120 for(i=0;i<lintan.NbSolutions();i++) {
121 Sprintf(abuf,"lintan_%d",i);
122 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
123 DrawTrSurf::Set(st,glin);
124 if(!aContext.IsNull()) {
125 Handle(AIS_Shape) aisp =
126 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
129 di << " Is Done = \n" << (Standard_Integer) lintan.IsDone();
133 static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
135 if (argc != 4 && argc != 5 && argc != 6 && argc != 7) {
136 di << "Usage : " << argv[0] << "result_shape name_of_circle name_of_curve [ par1 [ tol ] ]" << "\n";
140 Standard_Real par1 = 0.0, par2 = 0.0;
141 Standard_Real tol = Precision::Angular();
143 par1 = Draw::Atof(argv[4]);
145 par2 = Draw::Atof(argv[5]);
147 tol = Draw::Atof(argv[6]);
148 Handle(Geom2d_Curve) aCur2d1 = DrawTrSurf::GetCurve2d(argv[2]);
149 Handle(Geom2d_Curve) aCur2d2 = DrawTrSurf::GetCurve2d(argv[3]);
150 if (aCur2d1.IsNull() || aCur2d2.IsNull()) {
151 di << "Faulty : not curves" << "\n";
154 Standard_Boolean c1IsCircle = Standard_False;
155 Handle(Geom2d_Circle) aCir2d = Handle(Geom2d_Circle)::DownCast(aCur2d1);
156 if (!aCir2d.IsNull()) {
157 c1IsCircle = Standard_True;
158 if (argc == 6) tol = Draw::Atof(argv[5]);
161 Geom2dAdaptor_Curve acur(aCur2d2);
162 Geom2dGcc_MyQCurve qcur(acur, GccEnt_unqualified);
163 GccEnt_QualifiedCirc qfromcur(aCir2d->Circ2d(), GccEnt_unqualified);
164 Geom2dGcc_MyL2d2Tan lintan(qfromcur, qcur , par1, tol);
165 if (lintan.IsDone()) {
166 gp_Lin2d lin = lintan.ThisSolution();
167 Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
168 DrawTrSurf::Set(argv[1], glin);
170 di << "Faulty : tangent line is not done." << "\n";
174 Geom2dAdaptor_Curve acur1(aCur2d1);
175 Geom2dAdaptor_Curve acur2(aCur2d2);
176 Geom2dGcc_MyQCurve qcur1(acur1, GccEnt_unqualified);
177 Geom2dGcc_MyQCurve qcur2(acur2, GccEnt_unqualified);
178 Geom2dGcc_MyL2d2Tan lintan(qcur1, qcur2 , par1, par2, tol);
179 if (lintan.IsDone()) {
180 gp_Lin2d lin = lintan.ThisSolution();
181 Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
182 DrawTrSurf::Set(argv[1], glin);
184 di << "Faulty : tangent line is not done." << "\n";
190 static Standard_Integer BUC60970 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
194 di << "Usage : " << argv[0] << " shape result" <<"\n";
198 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
199 if(aContext.IsNull()) {
200 di << "use 'vinit' command before " << argv[0] << "\n";
204 TopoDS_Shape aResult = DBRep::Get(argv[1]);
206 BRepBuilderAPI_MakeWire bRepSpineWire;
207 TopExp_Explorer exp_(aResult, TopAbs_WIRE);
209 Standard_Integer i = 0;
210 for(;exp_.More();exp_.Next()){
212 bRepSpineWire.Add(TopoDS::Wire(exp_.Current()));
215 //printf("total no of wires are ............. %d\n", i);
216 di << "total no of wires are ............. " << i << "\n";
218 TopoDS_Wire spineWire = bRepSpineWire.Wire();
219 aContext->Display(new AIS_Shape(spineWire));
221 DBRep::Set("slineW",spineWire);
223 TopExp_Explorer spineWireExp(spineWire, TopAbs_EDGE);
224 Standard_Real first, last;
225 Handle_Geom_Curve curl_ = BRep_Tool::Curve(TopoDS::Edge(spineWireExp.Current()), first, last);
228 curl_->D1(first, firstPnt, tanVec);
230 gp_Dir tanDir(tanVec.X(), tanVec.Y(), tanVec.Z());
231 gp_Ax2 gpAx2(firstPnt, tanDir);
232 gp_Circ gpCirc(gpAx2, 2.5);
233 BRepBuilderAPI_MakeWire aMWire(BRepBuilderAPI_MakeEdge(new Geom_Circle(gpCirc)).Edge());
234 TopoDS_Wire topoWire(aMWire);
235 aContext->Display(new AIS_Shape(topoWire));
237 DBRep::Set("topoW",topoWire);
239 BRepOffsetAPI_MakePipeShell bRepPipe(spineWire);
240 bRepPipe.Add(topoWire);
243 aContext->Display(new AIS_Shape(bRepPipe.Shape()));
245 DBRep::Set(argv[2],bRepPipe.Shape());
250 static Standard_Integer BUC60818(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
254 di << "Usage : " << argv[0] << "\n";
258 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
259 if(myAISContext.IsNull())
261 di << "use 'vinit' command before " << argv[0] << "\n";
266 Handle(AIS_Trihedron) aTrihedron;
267 Handle(Geom_Axis2Placement) aTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
268 aTrihedron=new AIS_Trihedron(aTrihedronAxis);
269 myAISContext->Display(aTrihedron);
271 myAISContext->OpenLocalContext();
272 myAISContext->Load(aTrihedron,0);
274 myAISContext->SetAutomaticHilight( Standard_False );
276 Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
278 myV3dView->Project(0,0,0,Xv,Yv);
280 Standard_Integer Xp,Yp;
281 myV3dView->Convert(Xv,Yv,Xp,Yp);
283 myAISContext->MoveTo( Xp,Yp, myV3dView );
284 myAISContext->MoveTo( Xp,Yp, myV3dView );
286 if (myAISContext->HasDetected( ))
287 di << "has detected shape : OK" << "\n";
288 else di << "has detected shape : bugged - Faulty " << "\n";
290 myAISContext->SetAutomaticHilight( Standard_True );
295 static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, const char ** /*argv*/)
298 di<<"Function don't has parameters"<<"\n";
302 Handle(AIS_InteractiveContext) context= ViewerTest_Tool::MakeContext ("buc60915");
303 ViewerTest_Tool::InitViewerTest (context);
305 //The following dimesion code has problems regarding arrow_size. The desired effect is not produced.
306 /***************************************/
308 /***************************************/
309 gp_Pnt p1 = gp_Pnt(602.51,50.,0.);
310 gp_Pnt p2 = gp_Pnt(602.51,200.,0.);
311 gp_Pnt p3 = gp_Pnt(102.51,200.,0.);
312 gp_Pnt p4 = gp_Pnt(102.51,170.,0.);
313 gp_Pnt p5 = gp_Pnt(502.51,170.,0.);
314 gp_Pnt p6 = gp_Pnt(502.51,80.,0.);
315 gp_Pnt p7 = gp_Pnt(102.51,80.,0.);
316 gp_Pnt p8 = gp_Pnt(102.51,50.,0.);
317 TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(p1);
318 TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(p2);
319 TopoDS_Vertex V3 = BRepBuilderAPI_MakeVertex(p3);
320 TopoDS_Vertex V4 = BRepBuilderAPI_MakeVertex(p4);
321 TopoDS_Vertex V5 = BRepBuilderAPI_MakeVertex(p5);
322 TopoDS_Vertex V6 = BRepBuilderAPI_MakeVertex(p6);
323 TopoDS_Vertex V7 = BRepBuilderAPI_MakeVertex(p7);
324 TopoDS_Vertex V8 = BRepBuilderAPI_MakeVertex(p8);
325 gp_Pnt plnpt(0, 0, 0);
326 gp_Dir plndir(0, 0, 1);
327 Handle(Geom_Plane) pln = new Geom_Plane(plnpt,plndir);
328 /***************************************/
329 //dimension "L 502.51"
330 /***************************************/
331 Handle(AIS_LengthDimension) len = new AIS_LengthDimension(V2, V3, pln->Pln());
332 context->Display(len);
333 /***************************************/
335 /***************************************/
336 Handle(AIS_LengthDimension) len1 = new AIS_LengthDimension(V4, V7, pln->Pln());
337 context->Display(len1);
338 /***************************************/
340 /***************************************/
341 Handle(AIS_LengthDimension) len2 = new AIS_LengthDimension(V1, V2, pln->Pln());
342 context->Display(len2);
343 /***************************************/
344 //dimension "R 88.58"
345 /***************************************/
346 gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 88.58);
347 TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(cir,gp_Pnt(191.09,0,0.),gp_Pnt(191.09,-177.16,0.) );
348 Handle(AIS_RadiusDimension) dim1 = new AIS_RadiusDimension(E1);
349 context->Display(dim1);
350 /***************************************/
351 //dimension "R 43.80"
352 /***************************************/
353 gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 43.80);
354 TopoDS_Edge E_cir1 = BRepBuilderAPI_MakeEdge(cir1);
355 dim1 = new AIS_RadiusDimension(E_cir1);
356 context->Display(dim1);
357 /***************************************/
358 //dimension "R 17.86"
359 /***************************************/
360 gp_Circ cir2 = gp_Circ(gp_Ax2(gp_Pnt(566.11, -88.58, 0), gp_Dir(0, 0, -1)), 17.86);
361 TopoDS_Edge E_cir2 = BRepBuilderAPI_MakeEdge(cir2);
362 dim1 = new AIS_RadiusDimension(E_cir2);
363 context->Display(dim1);
368 static Standard_Integer OCC138 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
370 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
371 if(aContext.IsNull()) {
372 di << "use 'vinit' command before " << argv[0] << "\n";
376 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
377 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
378 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
380 Handle_AIS_Shape ais1 = new AIS_Shape(box1.Shape());
381 Handle_AIS_Shape ais2 = new AIS_Shape(box2.Shape());
382 Handle_AIS_Shape ais3 = new AIS_Shape(box3.Shape());
384 aContext->Display(ais1);
385 aContext->Display(ais2);
386 aContext->Display(ais3);
388 aContext->AddOrRemoveCurrentObject(ais1);
389 aContext->AddOrRemoveCurrentObject(ais2);
390 aContext->AddOrRemoveCurrentObject(ais3);
392 di << "\n No of currents = " << aContext->NbCurrents();
394 aContext->InitCurrent();
397 while(aContext->MoreCurrent())
399 di << "\n count is = " << count++;
400 Handle_AIS_InteractiveObject ais = aContext->Current();
401 aContext->AddOrRemoveCurrentObject(ais);
402 aContext->InitCurrent();
408 static Standard_Integer BUC60821(Draw_Interpretor& di, Standard_Integer argc,const char ** argv )
412 di << "Usage: " << argv[0] << " TextHight1 TextHight2 TextHight2";
416 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
418 if(aContext.IsNull())
420 di << "use 'vinit' command before " << argv[0] << "\n";
424 Handle(QABugs_MyText) txt1 = new QABugs_MyText("Gosha1",gp_Pnt(0,0,0),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_RED,Draw::Atoi(argv[1]));
425 aContext->Display(txt1);
427 Handle(QABugs_MyText) txt2 = new QABugs_MyText("Gosha2",gp_Pnt(0,0,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_YELLOW,Draw::Atoi(argv[2]));
428 aContext->Display(txt2);
430 Handle(QABugs_MyText) txt3 = new QABugs_MyText("Gosha3",gp_Pnt(0,100,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_SKYBLUE,Draw::Atoi(argv[3]));
431 aContext->Display(txt3);
436 static int geom_get_2Dpt_from_3Dpt(const gp_Pnt& pnt3d, const gp_Pln& pln, gp_Pnt2d& pnt2d)
439 Handle_Geom_Plane gpln = new Geom_Plane(pln);
440 GeomAdaptor_Surface adsur(gpln);
441 Extrema_ExtPS extps(pnt3d, adsur, 0.001, 0.001);
445 for(index=1; index<= extps.NbExt(); index++ )
447 Extrema_POnSurf pons = extps.Point(index);
449 pons.Parameter(U, V);
450 pnt2d.SetCoord(U, V);
457 static Standard_Integer OCC353 (Draw_Interpretor& di, Standard_Integer , const char ** )
459 gp_Ax2 ax21( gp_Pnt(100,0,0), gp_Dir(0,0,1) );
460 Handle_Geom_Circle h_cir1 = new Geom_Circle( ax21, 25 );
462 gp_Ax2 ax22( gp_Pnt(-100,0,0), gp_Dir(0,0,1) );
463 Handle_Geom_Circle h_cir2 = new Geom_Circle( ax22, 25 );
465 gp_Pln refpln( gp_Pnt(0,0,0), gp_Dir(0,0,1) );
466 Handle_Geom2d_Curve cir2d1 = GeomAPI::To2d(h_cir1, refpln);
467 Handle_Geom2d_Curve cir2d2 = GeomAPI::To2d(h_cir2, refpln);
469 Geom2dAdaptor_Curve adop1(cir2d1);
470 Geom2dAdaptor_Curve adop2(cir2d2);
472 Geom2dGcc_QualifiedCurve qcur1(adop1, GccEnt_enclosing);
473 Geom2dGcc_QualifiedCurve qcur2(adop2, GccEnt_enclosing);
475 Handle_Geom_CartesianPoint h_carpt = new Geom_CartesianPoint(0,175,0);
477 gp_Pnt pt3d = h_carpt->Pnt();
479 geom_get_2Dpt_from_3Dpt(pt3d, refpln, pt2d);
483 DrawTrSurf::Set(st,cir2d1);
485 DrawTrSurf::Set(st,cir2d2);
487 DrawTrSurf::Set(st,pt2d);
489 Handle_Geom2d_CartesianPoint pt = new Geom2d_CartesianPoint(pt2d);
490 Geom2dGcc_Circ2d3Tan sol( qcur1, qcur2, pt, 0.001, 0.0, 0.0);
493 Standard_Character buf[10];
497 res = sol.NbSolutions();
498 for(Standard_Integer i=1;i<=res;i++) {
499 Handle(Geom2d_Circle) aC = new Geom2d_Circle(sol.ThisSolution(i));
500 Sprintf(buf,"Result_%d",i);
502 DrawTrSurf::Set(st,aC);
506 di << "\n Faulty: no solutions found ";
507 //printf("\n Faulty: no solutions found ");
509 //printf("\n Num of solutions are %d ", res );
510 di << "\n Num of solutions are " << res << " ";
515 static Standard_Integer OCC280 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
517 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
518 if(aContext.IsNull())
520 di << "use 'vinit' command before " << argv[0] << "\n";
524 di << "ERROR : Usage : " << argv[0] << " hlr=0/1 setsurfecedetail=0/1; set perspecrive view" << "\n";
528 Standard_Integer HLR = Draw::Atoi(argv[1]);
533 TCollection_AsciiString anOldName = ViewerTest::GetCurrentViewName();
534 Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
535 if (Draw::Atoi (argv[2]))
537 aViewer->SetDefaultSurfaceDetail (V3d_TEX_ALL);
539 aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE);
540 Handle(Aspect_Window) asp = ViewerTest::CurrentView()->Window();
541 Handle(V3d_View) aNewView = aViewer->CreateView();
542 ViewerTest::CurrentView (aNewView);
543 TCollection_AsciiString aNewName=anOldName + "_new";
544 ViewerTest::InitViewName(aNewName,ViewerTest::CurrentView());
545 aNewView->SetWindow (asp);
546 if (!asp->IsMapped()) asp->Map();
548 ViewerTest::RemoveView(anOldName,false);
549 ViewerTest::UnsetEventManager();
550 ViewerTest::SetEventManager (new ViewerTest_EventManager (aNewView, ViewerTest::GetAISContext()));
555 ViewerTest::CurrentView()->SetComputedMode (Standard_True);
561 static Standard_Integer OCC232 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
563 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
564 if(aContext.IsNull()) {
565 di << "use 'vinit' command before " << argv[0] << "\n";
569 BRep_Builder builder;
570 TopoDS_Compound comp;
571 TopoDS_CompSolid cs1, cs2;
573 builder.MakeCompound(comp);
574 builder.MakeCompSolid(cs1);
575 builder.MakeCompSolid(cs2);
577 TopoDS_Shape sh1 = BRepPrimAPI_MakeBox(gp_Pnt(0, 0, 0), 100, 100, 100).Shape();
578 TopoDS_Shape sh2 = BRepPrimAPI_MakeBox(gp_Pnt(100, 0, 0), 100, 100, 100).Shape();
579 TopoDS_Shape sh3 = BRepPrimAPI_MakeBox(gp_Pnt(200, 0, 0), 100, 100, 100).Shape();
580 builder.Add(cs1, sh1);
581 builder.Add(cs1, sh2);
582 builder.Add(cs1, sh3);
584 TopoDS_Shape sh4 = BRepPrimAPI_MakeBox(gp_Pnt(0, 500, 0), 100, 100, 100).Shape();
585 TopoDS_Shape sh5 = BRepPrimAPI_MakeBox(gp_Pnt(100, 500, 0), 100, 100, 100).Shape();
586 TopoDS_Shape sh6 = BRepPrimAPI_MakeBox(gp_Pnt(200, 500, 0), 100, 100, 100).Shape();
588 builder.Add(cs2, sh4);
589 builder.Add(cs2, sh5);
590 builder.Add(cs2, sh6);
592 builder.Add(comp, cs1);
593 builder.Add(comp, cs2);
595 Handle_AIS_Shape ais = new AIS_Shape(comp);
596 aContext->Display(ais);
598 TopExp_Explorer exp(comp, TopAbs_COMPSOLID);
601 //printf("\n TopAbs_COMPSOLID is there \n");
602 di << "\n TopAbs_COMPSOLID is there \n";
606 Handle (StdSelect_ShapeTypeFilter) filt = new StdSelect_ShapeTypeFilter(TopAbs_COMPSOLID);
607 aContext->AddFilter(filt);
608 aContext->CloseAllContexts();
609 aContext->OpenLocalContext();
610 aContext->ActivateStandardMode(TopAbs_SOLID);
615 static Standard_Integer OCC138LC (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
617 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
618 if(aContext.IsNull()) {
619 di << "use 'vinit' command before " << argv[0] << "\n";
623 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
624 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
625 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
627 Handle_AIS_Shape ais1 = new AIS_Shape(box1.Shape());
628 Handle_AIS_Shape ais2 = new AIS_Shape(box2.Shape());
629 Handle_AIS_Shape ais3 = new AIS_Shape(box3.Shape());
631 aContext->Display(ais1);
632 aContext->Display(ais2);
633 aContext->Display(ais3);
635 aContext->AddOrRemoveSelected(ais1);
636 aContext->AddOrRemoveSelected(ais2);
637 aContext->AddOrRemoveSelected(ais3);
639 di << "\n No of selected = " << aContext->NbSelected();
641 aContext->InitSelected();
644 while(aContext->MoreSelected())
646 di << "\n count is = %d" << count++;
647 Handle_AIS_InteractiveObject ais = aContext->SelectedInteractive();
648 aContext->AddOrRemoveSelected(ais);
649 aContext->InitSelected();
655 static Standard_Integer OCC189 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
657 Handle(AIS_InteractiveContext) aContext1 = ViewerTest::GetAISContext();
658 if(aContext1.IsNull()) {
659 di << "use 'vinit' command before " << argv[0] << "\n";
662 Handle(AIS_InteractiveContext) aContext2 = ViewerTest::GetAISContext();
663 if(aContext2.IsNull()) {
664 di << "use 'vinit' command before " << argv[0] << "\n";
668 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
669 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300, 300));
670 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500, 500));
672 Handle_AIS_Shape ais1 = new AIS_Shape(box1.Shape());
673 Handle_AIS_Shape ais2 = new AIS_Shape(box2.Shape());
674 Handle_AIS_Shape ais3 = new AIS_Shape(box3.Shape());
676 aContext1->Display(ais1);
677 aContext1->Display(ais2);
678 aContext1->Display(ais3);
680 aContext2->Display(ais1);
681 aContext2->Display(ais2);
682 aContext2->Display(ais3);
684 aContext1->AddOrRemoveCurrentObject(ais1);
685 aContext1->AddOrRemoveCurrentObject(ais2);
686 aContext1->AddOrRemoveCurrentObject(ais3);
688 di << "\n Stage : 1";
689 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
690 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
692 di << "\n aContext1->IsCurrent = " << (Standard_Integer) aContext1->IsCurrent(ais1) << ", aContext2->IsCurrent = " << (Standard_Integer) aContext2->IsCurrent(ais1) << " ";
694 aContext2->AddOrRemoveCurrentObject(ais1);
695 aContext2->AddOrRemoveCurrentObject(ais2);
696 aContext2->AddOrRemoveCurrentObject(ais3);
698 di << "\n Stage : 2";
699 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
700 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
702 aContext1->InitCurrent();
704 while(aContext1->MoreCurrent())
706 di << "\n count1 is = " << count1++;
707 Handle_AIS_InteractiveObject ais = aContext1->Current();
708 aContext1->AddOrRemoveCurrentObject(ais);
709 aContext1->InitCurrent();
712 di << "\n Stage : 3";
713 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
714 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
716 aContext2->InitCurrent();
718 while(aContext2->MoreCurrent())
720 di << "\n count2 is = " << count2++;
721 Handle_AIS_InteractiveObject ais = aContext2->Current();
722 aContext2->AddOrRemoveCurrentObject(ais);
723 aContext2->InitCurrent();
726 di << "\n\n Stage : 4";
727 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
728 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents();
733 #include <BRepBndLib.hxx>
735 //=======================================================================
738 //=======================================================================
739 static Standard_Integer OCC566(Draw_Interpretor& di,Standard_Integer n,const char ** a)
742 di<<"Usage: " << a[0] << " shape [ xmin ymin zmin xmax ymax zmax]"<<"\n";
745 TopoDS_Shape S = DBRep::Get(a[1]);
746 if (S.IsNull()) return 1;
748 BRepBndLib::AddClose(S,B);
749 Standard_Real axmin,aymin,azmin,axmax,aymax,azmax;
750 B.Get(axmin,aymin,azmin,axmax,aymax,azmax);
751 di << axmin<<" "<< aymin<<" "<< azmin<<" "<< axmax<<" "<< aymax<<" "<< azmax;
753 Draw::Set(a[2],axmin) ;
754 Draw::Set(a[3],aymin) ;
755 Draw::Set(a[4],azmin) ;
756 Draw::Set(a[5],axmax) ;
757 Draw::Set(a[6],aymax) ;
758 Draw::Set(a[7],azmax) ;
763 #include <BRepFilletAPI_MakeFillet.hxx>
764 //=======================================================================
767 //=======================================================================
768 static Standard_Integer OCC570 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
771 di<<"Usage: " << argv[0] << " result"<<"\n";
775 BRepPrimAPI_MakeBox mkBox(100.,100.,100.);
776 TopoDS_Shape aBox = mkBox.Shape();
778 TopExp_Explorer aExp;
779 aExp.Init(aBox,TopAbs_WIRE);
782 TopoDS_Shape aWire = aExp.Current();
784 aExp.Init(aWire,TopAbs_EDGE);
785 TopoDS_Edge e1 = TopoDS::Edge(aExp.Current()); aExp.Next();
786 TopoDS_Edge e2 = TopoDS::Edge(aExp.Current()); aExp.Next();
787 TopoDS_Edge e3 = TopoDS::Edge(aExp.Current()); aExp.Next();
788 TopoDS_Edge e4 = TopoDS::Edge(aExp.Current());
793 BRepFilletAPI_MakeFillet mkFillet(aBox);
794 mkFillet.SetContinuity(GeomAbs_C1,.001);
796 // Setup variable fillet data
797 TColgp_Array1OfPnt2d t_pnt(1,4);
798 t_pnt.SetValue(1,gp_Pnt2d(0.0,5.0));
799 t_pnt.SetValue(2,gp_Pnt2d(0.3,15.0));
800 t_pnt.SetValue(3,gp_Pnt2d(0.7,15.0));
801 t_pnt.SetValue(4,gp_Pnt2d(1.0,5.0));
804 // It is impossible to build fillet if at least one edge
805 // with variable radius is added!!! If all are constant, everything is ok.
806 mkFillet.Add(t_pnt,e1);
807 mkFillet.Add(5.0,e2);
808 mkFillet.Add(t_pnt,e3);
809 mkFillet.Add(5.0,e4);
812 TopoDS_Shape aFinalShape = mkFillet.Shape();
814 DBRep::Set(argv[1],aFinalShape);
816 catch(Standard_Failure)
818 di << argv[0] << ": Exception in fillet"<<"\n";
826 #include <Law_Interpol.hxx>
828 static Standard_Real t3d = 1.e-4;
829 static Standard_Real t2d = 1.e-5;
830 static Standard_Real ta = 1.e-2;
831 static Standard_Real fl = 1.e-3;
832 static Standard_Real tapp_angle = 1.e-2;
833 static GeomAbs_Shape blend_cont = GeomAbs_C1;
835 static BRepFilletAPI_MakeFillet* Rake = 0;
836 static char name[100];
838 static void printtolblend(Draw_Interpretor& di)
840 di<<"tolerance ang : "<<ta<<"\n";
841 di<<"tolerance 3d : "<<t3d<<"\n";
842 di<<"tolerance 2d : "<<t2d<<"\n";
843 di<<"fleche : "<<fl<<"\n";
845 di<<"tolblend "<<ta<<" "<<t3d<<" "<<t2d<<" "<<fl<<"\n";
848 static Standard_Integer MKEVOL(Draw_Interpretor& di,
849 Standard_Integer narg,
852 if(Rake != 0) {delete Rake; Rake = 0;}
854 if (narg < 3) return 1;
855 TopoDS_Shape V = DBRep::Get(a[2]);
856 Rake = new BRepFilletAPI_MakeFillet(V);
857 Rake->SetParams(ta,t3d,t2d,t3d,t2d,fl);
858 Rake->SetContinuity(blend_cont, tapp_angle);
860 ChFi3d_FilletShape FSh = ChFi3d_Rational;
861 if (!strcasecmp(a[3], "Q")) {
862 FSh = ChFi3d_QuasiAngular;
864 else if (!strcasecmp(a[3], "P")) {
865 FSh = ChFi3d_Polynomial;
867 Rake->SetFilletShape(FSh);
873 static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
874 Standard_Integer narg,
878 di << "MakeFillet non initialise"<<"\n";
881 if(narg%2 != 0 || narg < 4) return 1;
882 TColgp_Array1OfPnt2d uandr(1,(narg/2)-1);
883 Standard_Real Rad, Par;
884 TopoDS_Shape aLocalEdge(DBRep::Get(a[1],TopAbs_EDGE));
885 TopoDS_Edge E = TopoDS::Edge(aLocalEdge);
886 for (Standard_Integer ii = 1; ii <= (narg/2)-1; ii++){
887 Par = Draw::Atof(a[2*ii]);
888 Rad = Draw::Atof(a[2*ii + 1]);
889 uandr.ChangeValue(ii).SetCoord(Par,Rad);
891 //HELPDESK: Add law creation
892 const Standard_Boolean aLawMode = !strcmp(a[0],"OCC570evollaw");
895 di<<"INFO: Using law to define variable fillet"<<"\n";
896 Handle(Law_Interpol) law = new Law_Interpol;
906 static Standard_Integer BUILDEVOL(Draw_Interpretor& di,
911 di << "MakeFillet non initialise"<<"\n";
916 TopoDS_Shape result = Rake->Shape();
917 DBRep::Set(name,result);
918 if(Rake != 0) {delete Rake; Rake = 0;}
921 if(Rake != 0) {delete Rake; Rake = 0;}
925 #include <TColGeom_SequenceOfCurve.hxx>
926 #include <Geom_TrimmedCurve.hxx>
927 #include <GeomFill_NSections.hxx>
928 #include <BRepBuilderAPI_MakeFace.hxx>
929 //=======================================================================
932 //=======================================================================
933 static Standard_Integer OCC606 ( Draw_Interpretor& di, Standard_Integer n, const char ** a )
935 if (n != 3 && n != 4)
937 di << "Usage : " << a[0] << " result shape [-t]" << "\n";
941 Standard_Boolean TrimMode = (n == 4);
942 if (TrimMode) di<<"INFO: Using trimmed curves..."<<"\n";
943 else di<<"INFO: Using non trimmed curves..."<<"\n";
945 TopoDS_Shape S = DBRep::Get(a[2]);
947 TopExp_Explorer t_exp(S,TopAbs_EDGE);
948 TColGeom_SequenceOfCurve n_curves1;
949 TColStd_SequenceOfReal np;
950 Standard_Real param = 5.0;
952 for (;t_exp.More();t_exp.Next())
955 Handle(Geom_Curve) h_cur = BRep_Tool::Curve(TopoDS::Edge(t_exp.Current()),f,l);
958 if (TrimMode) h_cur = new Geom_TrimmedCurve(h_cur,f,l);
960 n_curves1.Append(h_cur);
966 if (n_curves1.Length()>1 && !np.IsEmpty())
971 GeomFill_NSections b_surface1(n_curves1, np);
972 b_surface1.ComputeSurface();
973 Handle(Geom_BSplineSurface) result_surf1 = b_surface1.BSplineSurface();
974 if (!result_surf1.IsNull())
976 BRepBuilderAPI_MakeFace b_face1(result_surf1, Precision::Confusion());
977 TopoDS_Face bsp_face1 = b_face1.Face();
978 DBRep::Set(a[1],bsp_face1);
981 catch(Standard_Failure)
983 di<<"ERROR: Exception in GeomFill_NSections"<<"\n";
991 //=======================================================================
994 //=======================================================================
995 static Standard_Integer OCC813 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
999 di << "Usage : " << argv[0] << " U V" << "\n";
1003 Standard_CString str;
1004 Standard_Real U = Draw::Atof(argv[1]);
1005 Standard_Real V = Draw::Atof(argv[2]);
1007 //Between ellipse and point:
1009 Handle(Geom_Ellipse) ell = new Geom_Ellipse(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1010 gp_Dir(0.173648,0.984808,0.000000),
1011 gp_Dir(-0.932169,0.164367,-0.322560)), 150, 100);
1012 Handle(Geom_Plane) plne = new Geom_Plane(gp_Ax3(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1013 gp_Dir(0.173648,0.984808,0.000000),
1014 gp_Dir(-0.932169,0.164367,-0.322560))) );
1016 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1019 gp_Pln pln = plne->Pln();
1021 str = "OCC813_pnt"; DrawTrSurf::Set(str,pt2d);
1023 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d(ell,pln);
1024 Geom2dAdaptor_Curve acur(curve2d);
1025 Geom2dGcc_QualifiedCurve qcur(acur, GccEnt_outside);
1027 str = "OCC813_ell"; DrawTrSurf::Set(str,curve2d);
1028 if(!aContext.IsNull()) {
1029 Handle(AIS_Shape) aisp =
1030 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
1031 aContext->Display (aisp);
1034 //This does not give any solutions.
1035 Geom2dGcc_Lin2d2Tan lintan(qcur, pt2d, 0.1);
1036 di<<"OCC813 nb of solutions = "<<lintan.NbSolutions()<<"\n";
1038 Standard_Character abuf[16];
1039 Standard_CString st = abuf;
1042 for(i=1;i<=lintan.NbSolutions();i++) {
1043 Sprintf(abuf,"lintan_%d",i);
1044 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
1045 DrawTrSurf::Set(st,glin);
1046 if(!aContext.IsNull()) {
1047 Handle(AIS_Shape) aisp =
1048 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
1055 //=======================================================================
1058 //=======================================================================
1059 static Standard_Integer OCC814 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
1063 di << "Usage : " << argv[0] << "\n";
1067 Standard_CString str;
1069 //Between Ellipse and Circle:
1071 Handle(Geom_Circle) cir = new Geom_Circle(gp_Ax2(gp_Pnt(823.687192,502.366825,478.960440),
1072 gp_Dir(0.173648,0.984808,0.000000),
1073 gp_Dir(-0.932169,0.164367,-0.322560)), 50);
1074 Handle(Geom_Ellipse) ell = new Geom_Ellipse(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1075 gp_Dir(0.173648,0.984808,0.000000),
1076 gp_Dir(-0.932169,0.164367,-0.322560)), 150, 100);
1077 Handle(Geom_Plane) plne = new Geom_Plane(gp_Ax3(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1078 gp_Dir(0.173648,0.984808,0.000000),
1079 gp_Dir(-0.932169,0.164367,-0.322560))) );
1081 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1083 gp_Pln pln = plne->Pln();
1084 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d(ell, pln);
1085 Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d(cir, pln);
1087 str = "OCC814_cir"; DrawTrSurf::Set(str,curve2d);
1088 str = "OCC814_ell"; DrawTrSurf::Set(str,fromcurve2d);
1089 if(!aContext.IsNull()) {
1090 Handle(AIS_Shape) aisp =
1091 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
1092 aContext->Display (aisp);
1094 if(!aContext.IsNull()) {
1095 Handle(AIS_Shape) aisp =
1096 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
1097 aContext->Display (aisp);
1100 Geom2dAdaptor_Curve acur(curve2d), afromcur(fromcurve2d);
1102 Geom2dGcc_QualifiedCurve qcur(acur, GccEnt_outside) ;
1103 Geom2dGcc_QualifiedCurve qfromcur(afromcur, GccEnt_outside) ;
1105 //This does not give any solutions.
1106 Geom2dGcc_Lin2d2Tan lintan(qcur, qfromcur, 0.1);
1107 di<<"OCC814 nb of solutions = "<<lintan.NbSolutions()<<"\n";
1109 Standard_Character abuf[16];
1110 Standard_CString st = abuf;
1113 for(i=1;i<=lintan.NbSolutions();i++) {
1114 Sprintf(abuf,"lintan_%d",i);
1115 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
1116 DrawTrSurf::Set(st,glin);
1117 if(!aContext.IsNull()) {
1118 Handle(AIS_Shape) aisp =
1119 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
1126 #include <ShapeAnalysis_Wire.hxx>
1127 #include <IntRes2d_SequenceOfIntersectionPoint.hxx>
1128 #include <TColgp_SequenceOfPnt.hxx>
1129 #include <ShapeFix_Wire.hxx>
1130 //=======================================================================
1133 //=======================================================================
1134 static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1136 if (argc < 3 || argc > 5)
1138 di << "Usage : " << argv[0] << " result shape [toler [maxtoler]]" << "\n";
1142 TopoDS_Shape shape = DBRep::Get(argv[2]); //read the shape
1144 TopExp_Explorer exp(shape, TopAbs_EDGE);
1147 di<<"Error: no edge found"<<"\n";
1151 BRep_Builder builder;
1153 builder.MakeWire(wire);
1154 builder.Add(wire, TopoDS::Edge(exp.Current()));
1156 // HelpDesk: Create planar face if possible
1157 TopoDS_Face face = BRepBuilderAPI_MakeFace(wire,Standard_True);
1159 Handle(ShapeAnalysis_Wire) advWA = new ShapeAnalysis_Wire;
1161 advWA->SetFace(face);
1162 advWA->SetPrecision(0.001);
1164 IntRes2d_SequenceOfIntersectionPoint points2d;
1165 TColgp_SequenceOfPnt points3d;
1167 di << "Info: CheckSelfIntersectingEdge = " << (Standard_Integer) advWA->CheckSelfIntersectingEdge(1,points2d,points3d) << "\n";
1169 ShapeExtend_Status status = ShapeExtend_FAIL1;
1170 if (advWA->StatusSelfIntersection(status))
1171 di << "Info: No P Curve found in the edge\n";
1173 status = ShapeExtend_FAIL2;
1174 if (advWA->StatusSelfIntersection(status))
1175 di << "Info: No Vertices found in the edge\n";
1177 status = ShapeExtend_DONE1;
1178 if (advWA->StatusSelfIntersection(status))
1179 di << "Info: Self-intersection found in the edge\n";
1181 Standard_Integer i, num = points2d.Length();
1182 di << "Info: No. of self-intersection points : " << num << "\n";
1185 Standard_CString aName = str;
1186 for (i = 1; i <= num; ++i)
1188 gp_Pnt pt = points3d(i);
1189 di << "Info: Intersecting pt : (" << pt.X() << ", " << pt.Y() << ", " << pt.Z() << ")\n";
1190 Sprintf(str,"p_%d",i);
1191 DrawTrSurf::Set(aName,pt);
1194 Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire;
1198 if (argc > 3) sfw->SetPrecision(Draw::Atof(argv[3])/*0.1*/);
1199 if (argc > 4) sfw->SetMaxTolerance(Draw::Atof(argv[4]));
1200 di << "Info: Precision is set to " << sfw->Precision() << "\n";
1201 di << "Info: MaxTolerance is set to " << sfw->MaxTolerance() << "\n";
1203 sfw->ModifyTopologyMode() = 1;
1204 sfw->ModifyGeometryMode() = 1;
1205 sfw->FixSelfIntersectingEdgeMode() = 1;
1206 //printf("Info: FixSelfIntersection = %d\n",sfw->FixSelfIntersection());
1207 di << "Info: FixSelfIntersection = " << (Standard_Integer) sfw->FixSelfIntersection() << "\n";
1209 DBRep::Set(argv[1],sfw->Wire());
1211 status = ShapeExtend_OK;
1212 if (sfw->StatusSelfIntersection(status))
1213 di << "Info: ShapeExtend_OK : No intersection found\n";
1214 //printf("Info: ShapeExtend_OK : No intersection found\n");
1216 status = ShapeExtend_FAIL1;
1217 if (sfw->StatusSelfIntersection(status))
1218 di << "Info: ShapeExtend_FAIL1 : analysis failed (edge has no pcurve, or no vertices etc.)\n";
1220 status = ShapeExtend_FAIL2;
1221 if (sfw->StatusSelfIntersection(status))
1222 di << "Info: ShapeExtend_FAIL2 : self-intersection was found, but not fixed because of limit of increasing tolerance (MaxTolerance)\n";
1224 status = ShapeExtend_FAIL3;
1225 if (sfw->StatusSelfIntersection(status))
1226 di << "Info: ShapeExtend_FAIL3 : intercestion of non adjacent edges found, but not fixed because of limit of increasing tolerance (MaxTolerance)\n";
1228 status = ShapeExtend_DONE1;
1229 if (sfw->StatusSelfIntersection(status))
1230 di << "Info: ShapeExtend_DONE1 : tolerance of vertex was increased to fix self-intersection\n";
1232 status = ShapeExtend_DONE2;
1233 if (sfw->StatusSelfIntersection(status))
1234 di << "Info: ShapeExtend_DONE2 : vertex was moved to fix self-intersection\n";
1236 status = ShapeExtend_DONE3;
1237 if (sfw->StatusSelfIntersection(status))
1238 di << "Info: ShapeExtend_DONE3 : some edges were removed because of intersection\n";
1240 status = ShapeExtend_DONE4;
1241 if (sfw->StatusSelfIntersection(status))
1242 di << "Info: ShapeExtend_DONE4 : pcurve(s) was(were) modified\n";
1244 status = ShapeExtend_DONE5;
1245 if (sfw->StatusSelfIntersection(status))
1246 di << "Info: ShapeExtend_DONE5 : non adjacent intersection fixed by increasing tolerance of vertex(vertices)\n";
1248 status = ShapeExtend_DONE6;
1249 if (sfw->StatusSelfIntersection(status))
1250 di << "Info: ShapeExtend_DONE6 : tolerance of edge was increased to hide intersection\n";
1252 status = ShapeExtend_DONE7;
1253 if (sfw->StatusSelfIntersection(status))
1254 di << "Info: ShapeExtend_DONE7 : range of some edges was decreased to avoid intersection\n";
1259 #include <Aspect_FillMethod.hxx>
1260 //=======================================================================
1261 //function : OCC1188
1263 //=======================================================================
1264 static Standard_Integer OCC1188 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1266 if (argc < 2 || argc > 3)
1268 di << "Usage : " << argv[0] << " imagefile [filltype] : Load image as background" << "\n";
1272 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1273 if(AISContext.IsNull())
1275 di << "use 'vinit' command before " << argv[0] << "\n";
1279 Aspect_FillMethod aFillType = Aspect_FM_CENTERED;
1282 const char* szType = argv[2];
1283 if (strcmp(szType, "NONE" ) == 0) aFillType = Aspect_FM_NONE;
1284 else if (strcmp(szType, "CENTERED") == 0) aFillType = Aspect_FM_CENTERED;
1285 else if (strcmp(szType, "TILED" ) == 0) aFillType = Aspect_FM_TILED;
1286 else if (strcmp(szType, "STRETCH" ) == 0) aFillType = Aspect_FM_STRETCH;
1289 di << "Wrong fill type : " << szType << "\n";
1290 di << "Must be one of CENTERED, TILED, STRETCH, NONE" << "\n";
1295 Handle(V3d_View) V3dView = ViewerTest::CurrentView();
1296 V3dView->SetBackgroundImage(argv[1], aFillType, Standard_True);
1301 #include <AIS_Drawer.hxx>
1302 #include <Graphic3d_MaterialAspect.hxx>
1303 #include <Prs3d_ShadingAspect.hxx>
1304 //=======================================================================
1305 //function : OCC1174_1
1307 //=======================================================================
1308 static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1312 di << "Usage : " << argv[0] << " shape" << "\n";
1316 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1317 if(AISContext.IsNull())
1319 di << "use 'vinit' command before " << argv[0] << "\n";
1323 TopoDS_Shape sh = DBRep::Get(argv[1]);
1325 Handle(AIS_Shape) ais = new AIS_Shape(sh);
1327 Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
1328 Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
1330 Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
1332 Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
1333 front.SetAmbientColor(colf);
1334 front.SetDiffuseColor(colf);
1335 front.SetSpecularColor(colf);
1336 front.SetEmissiveColor(colf);
1337 front.SetTransparency(0.0);
1338 sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
1340 Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
1341 back.SetAmbientColor(colb);
1342 back.SetDiffuseColor(colb);
1343 back.SetSpecularColor(colb);
1344 back.SetEmissiveColor(colb);
1345 back.SetTransparency(0.0);
1346 sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
1348 AISContext->Display(ais,1,0);
1350 Standard_Real r, g, b;
1351 sa->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_RGB);
1352 di << "Info: color on front side (" << r << "," << g << "," << b << ")\n";
1353 sa->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_RGB);
1354 di << "Info: color on back side (" << r << "," << g << "," << b << ")\n";
1359 //=======================================================================
1360 //function : OCC1174_2
1362 //=======================================================================
1363 static Standard_Integer OCC1174_2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1367 di << "Usage : " << argv[0] << " shape" << "\n";
1371 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1372 if(AISContext.IsNull())
1374 di << "use 'vinit' command before " << argv[0] << "\n";
1378 TopoDS_Shape sh = DBRep::Get(argv[1]);
1380 Handle(AIS_Shape) ais = new AIS_Shape(sh);
1381 AISContext->Display(ais,1,0);
1382 AISContext->SetMaterial(ais,Graphic3d_NOM_SHINY_PLASTIC);
1384 Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
1385 Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
1386 Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
1388 Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
1389 front.SetAmbientColor(colf);
1390 front.SetDiffuseColor(colf);
1391 front.SetSpecularColor(colf);
1392 front.SetEmissiveColor(colf);
1393 front.SetTransparency(0.4);
1394 sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
1396 Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
1397 back.SetAmbientColor(colb);
1398 back.SetDiffuseColor(colb);
1399 back.SetSpecularColor(colb);
1400 back.SetEmissiveColor(colb);
1401 back.SetTransparency(0.2);
1402 sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
1404 AISContext->Redisplay(ais,1,0);
1409 #include <TopoDS_Solid.hxx>
1410 #include <BRepFeat_MakeDPrism.hxx>
1411 //=======================================================================
1413 //purpose : FEATURE OPERATION (BOSS and SLOT)
1414 //=======================================================================
1415 static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1419 di << "Usage : " << argv[0] << " angle fuse(1 for boss / 0 for slot) length" << "\n";
1423 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1424 if(aContext.IsNull())
1426 di << "use 'vinit' command before " << argv[0] << "\n";
1429 Standard_Real angle = Draw::Atof(argv[1]);
1430 Standard_Integer fuse = Draw::Atoi(argv[2]);
1431 Standard_Real length = Draw::Atof(argv[3]);
1433 BRepBuilderAPI_MakeEdge edge1(gp_Pnt(0, 0, 0), gp_Pnt(50, 0, 0));
1434 BRepBuilderAPI_MakeEdge edge2(gp_Pnt(50, 0, 0), gp_Pnt(50, 50, 0));
1435 BRepBuilderAPI_MakeEdge edge3(gp_Pnt(50, 50, 0), gp_Pnt(0, 50, 0));
1436 BRepBuilderAPI_MakeEdge edge4(gp_Pnt(0, 50, 0), gp_Pnt(0, 0, 0));
1437 TopoDS_Edge ted1 = edge1.Edge();
1438 TopoDS_Edge ted2 = edge2.Edge();
1439 TopoDS_Edge ted3 = edge3.Edge();
1440 TopoDS_Edge ted4 = edge4.Edge();
1442 BRepBuilderAPI_MakeWire wire(ted1, ted2, ted3, ted4);
1443 TopoDS_Wire twire = wire.Wire();
1445 BRepBuilderAPI_MakeFace face(twire);
1446 TopoDS_Face tface = face.Face();
1447 ////////Handle_AIS_Shape face_ais = new AIS_Shape( tface );
1448 ////////aContext->Display(face_ais);
1451 BRepPrimAPI_MakeBox block(gp_Pnt(-50, -50, -150), 150, 150, 100);
1452 box = block.Solid();
1454 TopoDS_Face top_face;
1455 top_face = block.TopFace();
1457 BRepFeat_MakeDPrism slot(box, tface, top_face, angle, fuse,
1460 slot.Perform(length);
1461 TopoDS_Shape S2 = slot.Shape();
1463 DBRep::Set("OCCN1_tface",tface);
1464 DBRep::Set("OCCN1_slot",S2);
1469 #include <BRepPrimAPI_MakeCylinder.hxx>
1470 #include <BRepPrimAPI_MakeSphere.hxx>
1471 #include <BRepAlgoAPI_Section.hxx>
1472 #include <BRepAlgo_Section.hxx>
1473 //=======================================================================
1475 //purpose : BOOLEAN OPERATION
1476 //=======================================================================
1477 static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1480 di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
1483 Standard_Boolean IsBRepAlgoAPI = Standard_True;
1485 Standard_Integer IsB = Draw::Atoi(argv[1]);
1487 IsBRepAlgoAPI = Standard_False;
1488 #if ! defined(BRepAlgo_def04)
1493 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1494 if(aContext.IsNull())
1496 di << "use 'vinit' command before " << argv[0] << "\n";
1500 BRepPrimAPI_MakeCylinder cylinder(50,200);
1501 TopoDS_Shape cylinder_sh = cylinder.Shape();
1503 BRepPrimAPI_MakeSphere sphere(gp_Pnt(60,0,100),50);
1504 TopoDS_Shape sphere_sh = sphere.Shape();
1506 //BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
1507 //TopoDS_Shape shape = section.Shape();
1510 if (IsBRepAlgoAPI) {
1511 di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)" <<"\n";
1512 BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
1514 if(!section.IsDone()){
1515 di << "Error performing intersection: not done." << "\n";
1517 shape = section.Shape();
1519 di << "BRepAlgo_Section section(cylinder_sh, sphere_sh)" <<"\n";
1520 BRepAlgo_Section section(cylinder_sh, sphere_sh);
1522 if(!section.IsDone()){
1523 di << "Error performing intersection: not done." << "\n";
1525 shape = section.Shape();
1528 DBRep::Set("OCCN2_cylinder",cylinder_sh);
1529 DBRep::Set("OCCN2_sphere",sphere_sh);
1530 DBRep::Set("OCCN2_section",shape);
1535 #include <TColgp_Array1OfPnt.hxx>
1536 #include <Geom_BezierCurve.hxx>
1538 static Standard_Integer OCC2569 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1540 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1541 if(aContext.IsNull())
1543 di << "use 'vinit' command before " << argv[0] << "\n";
1547 di << "Usage : " << argv[0] << " nbpoles result" << "\n";
1551 int poles=Draw::Atoi(argv[1]);
1553 TColgp_Array1OfPnt arr(1, poles);
1554 for(int i=1; i<=poles; i++)
1555 arr.SetValue(i, gp_Pnt(i+10, i*2+20, i*3+45));
1557 Handle_Geom_BezierCurve bez = new Geom_BezierCurve(arr);
1559 di << "\n The curve is not created.\n";
1561 di << "\n Degree = " << bez->Degree() << "\n";
1563 TopoDS_Edge sh = BRepBuilderAPI_MakeEdge(bez).Edge();
1564 Handle_AIS_Shape ais = new AIS_Shape(sh);
1565 aContext->Display(ais);
1566 DrawTrSurf::Set(argv[2],bez);
1570 #include <TopTools_IndexedMapOfShape.hxx>
1571 #include <TopExp.hxx>
1573 static Standard_Integer OCC1642 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1576 di<<"Usage: " << argv[0] << " FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection"<<"\n";
1580 TopoDS_Shape shape = DBRep::Get(argv[5]);
1582 TopExp_Explorer exp(shape, TopAbs_WIRE);
1583 TopoDS_Shape wire = exp.Current();
1585 Handle(ShapeAnalysis_Wire) advWA = new ShapeAnalysis_Wire;
1586 advWA->Load(TopoDS::Wire(wire));
1588 DBRep::Set(argv[3],wire);
1591 BRepBuilderAPI_MakeFace(TopoDS::Wire(wire),Standard_True);
1593 DBRep::Set(argv[4],face);
1595 advWA->SetFace(face);
1596 Standard_Real precision_to_ana = 0.0001;
1597 advWA->SetPrecision(precision_to_ana);
1599 TopTools_IndexedMapOfShape M;
1600 TopExp::MapShapes(wire, TopAbs_EDGE, M);
1603 for(j= 1; j<=M.Extent(); ++j) {
1604 Standard_Integer num=1;
1605 IntRes2d_SequenceOfIntersectionPoint points2d;
1606 TColgp_SequenceOfPnt points3d;
1608 cout << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
1609 advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
1612 ShapeExtend_Status status = ShapeExtend_FAIL1;
1613 if(advWA->StatusSelfIntersection(status))
1615 status = ShapeExtend_FAIL2;
1616 if(advWA->StatusSelfIntersection(status))
1617 di << "\n No Vertices found in the edge";
1619 status = ShapeExtend_DONE1;
1620 if(advWA->StatusSelfIntersection(status))
1621 di << "\n Self-intersection found in the edge";
1623 num = points2d.Length();
1624 di << "\n No. of self-intersecting edges : " << num;
1626 for(int i=1; i<=num; ++i) {
1627 gp_Pnt pt = points3d(i);
1628 di << "\n Intersecting pt : (" << pt.X() << ", " << pt.Y()<< ", " << pt.Z() << ")";
1633 Handle_ShapeFix_Wire sfw = new ShapeFix_Wire;
1634 sfw->Load(TopoDS::Wire(wire));
1636 sfw->SetPrecision(Precision::Confusion());
1638 sfw->FixReorderMode() = 1;
1639 sfw->ClosedWireMode() = 1;
1640 sfw->FixDegeneratedMode() = 1;
1641 sfw->FixConnectedMode() = 1;
1642 sfw->ModifyTopologyMode() = 1;
1643 sfw->ModifyGeometryMode() = 1;
1644 sfw->FixSelfIntersectionMode() = 1;
1645 sfw->FixSelfIntersectingEdgeMode() = 1;
1646 sfw->FixIntersectingEdgesMode() = 1;
1647 sfw->FixNonAdjacentIntersectingEdgesMode() = 1;
1648 sfw->FixEdgeCurvesMode() = 1;
1650 sfw->ModifyRemoveLoopMode() = 1;
1651 sfw->SetMaxTolerance(1.0);
1653 di << "\n FixReorder = " << (Standard_Integer) sfw->FixReorder();
1654 di << "\n FixDegenerated = " << (Standard_Integer) sfw->FixDegenerated();
1655 di << "\n FixConnected = " << (Standard_Integer) sfw->FixConnected();
1657 di << "\n FixSelfIntersection = " << (Standard_Integer) sfw->FixSelfIntersection();
1660 Draw::Set(argv[6],sfw->FixReorder()) ;
1661 Draw::Set(argv[7],sfw->FixDegenerated()) ;
1662 Draw::Set(argv[8],sfw->FixConnected()) ;
1663 Draw::Set(argv[9],sfw->FixSelfIntersection()) ;
1665 ShapeExtend_Status status = ShapeExtend_OK;
1666 if(sfw->StatusSelfIntersection(status))
1667 di << "\n ShapeExtend_OK : No intersection found";
1669 status = ShapeExtend_FAIL1;
1670 if(sfw->StatusSelfIntersection(status))
1671 di << "\n ShapeExtend_FAIL1 : analysis failed (edge has no pcurve,or no vertices etc.)";
1673 status = ShapeExtend_FAIL2;
1674 if(sfw->StatusSelfIntersection(status))
1675 di << "\n ShapeExtend_FAIL2 : self-intersection was found, but not fixed because of limit of increasing tolerance (MaxTolerance)";
1677 status = ShapeExtend_FAIL3;
1678 if(sfw->StatusSelfIntersection(status))
1679 di << "\n ShapeExtend_FAIL3 : intercestion of non adjacent edges found, but not fixed because of limit of increasing tolerance (MaxTolerance)";
1681 status = ShapeExtend_DONE1;
1682 if(sfw->StatusSelfIntersection(status))
1683 di << "\n ShapeExtend_DONE1 : tolerance of vertex was increased to fix self-intersection";
1685 status = ShapeExtend_DONE2;
1686 if(sfw->StatusSelfIntersection(status))
1687 di << "\n ShapeExtend_DONE2 : vertex was moved to fix self-intersection";
1689 status = ShapeExtend_DONE3;
1690 if(sfw->StatusSelfIntersection(status))
1691 di << "\n ShapeExtend_DONE3 : some edges were removed because of intersection";
1693 status = ShapeExtend_DONE4;
1694 if(sfw->StatusSelfIntersection(status))
1695 di << "\n ShapeExtend_DONE4 : pcurve(s) was(were) modified";
1697 status = ShapeExtend_DONE5;
1698 if(sfw->StatusSelfIntersection(status))
1699 di << "\n ShapeExtend_DONE5 : non adjacent intersection fixed by increasing tolerance of vertex(vertices)";
1701 status = ShapeExtend_DONE6;
1702 if(sfw->StatusSelfIntersection(status))
1703 di << "\n ShapeExtend_DONE6 : tolerance of edge was increased to hide intersection";
1705 status = ShapeExtend_DONE7;
1706 if(sfw->StatusSelfIntersection(status))
1707 di << "\n ShapeExtend_DONE7 : range of some edges was decreased to avoid intersection";
1709 TopoDS_Wire finalwire = sfw->Wire();
1711 DBRep::Set(argv[1],finalwire);
1714 advWA->Load(TopoDS::Wire(finalwire));
1717 BRepBuilderAPI_MakeFace(TopoDS::Wire(finalwire),Standard_True);
1719 DBRep::Set(argv[2],fface);
1721 advWA->SetFace(fface);
1723 TopTools_IndexedMapOfShape fM;
1724 TopExp::MapShapes(finalwire, TopAbs_EDGE, fM);
1726 for(j= 1; j<=fM.Extent(); ++j) {
1727 Standard_Integer num=1;
1728 IntRes2d_SequenceOfIntersectionPoint points2d;
1729 TColgp_SequenceOfPnt points3d;
1731 di << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
1732 (Standard_Integer) advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
1735 ShapeExtend_Status status = ShapeExtend_FAIL1;
1736 if(advWA->StatusSelfIntersection(status))
1738 status = ShapeExtend_FAIL2;
1739 if(advWA->StatusSelfIntersection(status))
1740 di << "\n No Vertices found in the edge";
1742 status = ShapeExtend_DONE1;
1743 if(advWA->StatusSelfIntersection(status))
1744 di << "\n Self-intersection found in the edge";
1746 num = points2d.Length();
1747 di << "\n No. of self-intersecting edges : " << num;
1749 for(int i=1; i<=num; ++i) {
1750 gp_Pnt pt = points3d(i);
1751 di << "\n Intersecting pt : (" << pt.X() << ", " << pt.Y() << ", " << pt.Z() << ")";
1761 void QABugs::Commands_17(Draw_Interpretor& theCommands) {
1762 const char *group = "QABugs";
1764 theCommands.Add ("BUC60842", "BUC60842", __FILE__, BUC60842, group);
1765 theCommands.Add ("BUC60843", "BUC60843 result_shape name_of_circle name_of_curve [ par1 [ tol ] ]", __FILE__, BUC60843, group);
1766 theCommands.Add ("BUC60970", "BUC60970 shape result", __FILE__, BUC60970, group);
1767 theCommands.Add ("BUC60818", "BUC60818", __FILE__, BUC60818, group);
1768 theCommands.Add ("BUC60915", "BUC60915", __FILE__, BUC60915_1, group);
1769 theCommands.Add ("OCC138", "OCC138", __FILE__, OCC138, group);
1770 theCommands.Add ("BUC60821","BUC60821",__FILE__,BUC60821,group);
1771 theCommands.Add ("OCC353","OCC353",__FILE__,OCC353,group);
1772 theCommands.Add ("OCC280","OCC280 hlr=0/1 setsurfecedetail=0/1; set perspecrive view",__FILE__,OCC280,group);
1773 theCommands.Add ("OCC232", "OCC232", __FILE__, OCC232 , group);
1774 theCommands.Add ("OCC138LC", "OCC138LC", __FILE__, OCC138LC, group);
1775 theCommands.Add ("OCC189", "OCC189", __FILE__, OCC189, group);
1776 theCommands.Add ("OCC566", "OCC566 shape [ xmin ymin zmin xmax ymax zmax] ; print bounding box", __FILE__, OCC566, group);
1777 theCommands.Add ("OCC570", "OCC570 result", __FILE__, OCC570, group);
1779 theCommands.Add("OCC570mkevol",
1780 "OCC570mkevol result object (then use updatevol) [R/Q/P]; mkevol",
1781 __FILE__, MKEVOL,group);
1782 theCommands.Add("OCC570updatevol",
1783 "OCC570updatevol edge u1 rad1 u2 rad2 ...; updatevol",
1784 __FILE__, UPDATEVOL,group);
1785 theCommands.Add("OCC570updatevollaw",
1786 "OCC570updatevollaw edge u1 rad1 u2 rad2 ...; updatevollaw",
1787 __FILE__, UPDATEVOL,group);
1788 theCommands.Add("OCC570buildevol",
1789 "OCC570buildevol; end of the evol fillet computation",
1790 __FILE__, BUILDEVOL,group);
1792 theCommands.Add ("OCC606", "OCC606 result shape [-t]", __FILE__, OCC606, group);
1794 theCommands.Add ("OCC813", "OCC813 U V", __FILE__, OCC813, group);
1795 theCommands.Add ("OCC814", "OCC814", __FILE__, OCC814, group);
1796 theCommands.Add ("OCC884", "OCC884 result shape [toler [maxtoler]]", __FILE__, OCC884, group);
1797 theCommands.Add ("OCC1188", "OCC1188 imagefile [filltype] : Load image as background", __FILE__, OCC1188, group);
1799 theCommands.Add ("OCC1174_1", "OCC1174_1 shape", __FILE__, OCC1174_1, group);
1800 theCommands.Add ("OCC1174_2", "OCC1174_2 shape", __FILE__, OCC1174_2, group);
1802 theCommands.Add ("OCCN1", "OCCN1 angle fuse(1 for boss / 0 for slot) length", __FILE__, OCCN1, group);
1803 theCommands.Add ("OCCN2", "OCCN2", __FILE__, OCCN2, group);
1805 theCommands.Add ("OCC2569", "OCC2569 nbpoles result", __FILE__, OCC2569, group);
1807 theCommands.Add ("OCC1642", "OCC1642 FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection", __FILE__, OCC1642, group);