1 // Created on: 1994-06-20
2 // Created by: Modeling
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <BRepTest.hxx>
18 #include <TColgp_Array1OfPnt2d.hxx>
20 #include <Draw_Interpretor.hxx>
21 #include <Draw_Appli.hxx>
22 #include <BRepFilletAPI_MakeFillet.hxx>
23 #include <BRepAlgo_BooleanOperation.hxx>
24 #include <BRepAlgo_Fuse.hxx>
25 #include <BRepAlgo_Cut.hxx>
26 #include <BiTgte_Blend.hxx>
27 #include <TopOpeBRepBuild_HBuilder.hxx>
28 #include <TopTools_ListIteratorOfListOfShape.hxx>
29 #include <TopAbs_ShapeEnum.hxx>
30 #include <TopoDS_Shape.hxx>
31 #include <TopoDS_Compound.hxx>
32 #include <TopoDS_Edge.hxx>
33 #include <TopoDS_Vertex.hxx>
36 #include <TopExp_Explorer.hxx>
38 //#include <BOPTools_DSFiller.hxx>
39 #include <BOPAlgo_PaveFiller.hxx>
41 #include <BRepAlgoAPI_BooleanOperation.hxx>
42 #include <BRepAlgoAPI_Fuse.hxx>
43 #include <BRepAlgoAPI_Cut.hxx>
44 #include <BRepAlgoAPI_Section.hxx>
46 #include <FilletSurf_Builder.hxx>
47 #include <ChFi3d_FilletShape.hxx>
48 #include <Geom_TrimmedCurve.hxx>
49 #include <Geom_Surface.hxx>
50 #include <Geom_Curve.hxx>
51 #include <Geom2d_Curve.hxx>
52 #include <TopTools_ListOfShape.hxx>
53 #include <FilletSurf_StatusType.hxx>
54 #include <FilletSurf_ErrorTypeStatus.hxx>
56 #include <DrawTrSurf.hxx>
61 static Standard_Real t3d = 1.e-4;
62 static Standard_Real t2d = 1.e-5;
63 static Standard_Real ta = 1.e-2;
64 static Standard_Real fl = 1.e-3;
65 static Standard_Real tapp_angle = 1.e-2;
66 static GeomAbs_Shape blend_cont = GeomAbs_C1;
68 static BRepFilletAPI_MakeFillet* Rakk = 0;
69 static BRepFilletAPI_MakeFillet* Rake = 0;
70 static char name[100];
73 static Standard_Integer contblend(Draw_Interpretor& di, Standard_Integer narg, const char** a)
76 //cout<<"tolerance angular of approximation : "<< tapp_angle <<endl;
77 //cout<<"internal continuity : ";
78 di<<"tolerance angular of approximation : "<< tapp_angle <<"\n";
79 di<<"internal continuity : ";
99 if (narg >3) return 1;
100 if (narg == 3) { tapp_angle = Abs(Draw::Atof(a[2])); }
104 blend_cont = GeomAbs_C0;
107 blend_cont = GeomAbs_C2;
110 blend_cont = GeomAbs_C1;
116 static void printtolblend(Draw_Interpretor& di)
118 //cout<<"tolerance ang : "<<ta<<endl;
119 //cout<<"tolerance 3d : "<<t3d<<endl;
120 //cout<<"tolerance 2d : "<<t2d<<endl;
121 //cout<<"fleche : "<<fl<<endl;
123 //cout<<"tolblend "<<ta<<" "<<t3d<<" "<<t2d<<" "<<fl<<endl;
125 di<<"tolerance ang : "<<ta<<"\n";
126 di<<"tolerance 3d : "<<t3d<<"\n";
127 di<<"tolerance 2d : "<<t2d<<"\n";
128 di<<"fleche : "<<fl<<"\n";
130 di<<"tolblend "<<ta<<" "<<t3d<<" "<<t2d<<" "<<fl<<"\n";
133 static Standard_Integer tolblend(Draw_Interpretor& di, Standard_Integer narg, const char** a)
140 ta = Draw::Atof(a[1]);
141 t3d = Draw::Atof(a[2]);
142 t2d = Draw::Atof(a[3]);
143 fl = Draw::Atof(a[4]);
148 static Standard_Integer BLEND(Draw_Interpretor& di, Standard_Integer narg, const char** a)
150 if(Rakk != 0) {delete Rakk; Rakk = 0;}
152 if (narg<5) return 1;
153 TopoDS_Shape V = DBRep::Get(a[2]);
154 if(V.IsNull()) return 1;
155 ChFi3d_FilletShape FSh = ChFi3d_Rational;
157 if (!strcasecmp(a[narg-1], "Q")) {
158 FSh = ChFi3d_QuasiAngular;
160 else if (!strcasecmp(a[narg-1], "P")) {
161 FSh = ChFi3d_Polynomial;
164 Rakk = new BRepFilletAPI_MakeFillet(V,FSh);
165 Rakk->SetParams(ta,t3d,t2d,t3d,t2d,fl);
166 Rakk->SetContinuity(blend_cont, tapp_angle);
169 Standard_Integer nbedge = 0;
170 for (Standard_Integer ii = 1; ii < (narg-1)/2; ii++){
171 Rad = Draw::Atof(a[2*ii + 1]);
172 TopoDS_Shape aLocalEdge(DBRep::Get(a[(2*ii+2)],TopAbs_EDGE));
173 E = TopoDS::Edge(aLocalEdge);
174 // E = TopoDS::Edge(DBRep::Get(a[(2*ii+2)],TopAbs_EDGE));
180 if(!nbedge) return 1;
182 if(!Rakk->IsDone()) return 1;
183 TopoDS_Shape res = Rakk->Shape();
184 DBRep::Set(a[1],res);
188 static void PrintHist(const TopoDS_Shape& S,
189 TopTools_ListIteratorOfListOfShape& It,
190 Standard_Integer& nbgen)
198 Sprintf(localname,"generated_00%d", nbgen++);
201 Sprintf(localname,"generated_0%d", nbgen++);
204 Sprintf(localname,"generated_%d", nbgen++);
206 for(; It.More(); It.Next()){
209 DBRep::Set(localname,C);
212 static Standard_Integer CheckHist(Draw_Interpretor& di,
217 //cout<<"No active Builder"<<endl;
218 di<<"No active Builder\n";
221 if(!Rakk->IsDone()) {
222 //cout<<"Active Builder Not Done"<<endl;
223 di<<"Active Builder Not Done\n";
226 Standard_Integer nbc = Rakk->NbContours();
227 Standard_Integer nbgen = 0;
228 TopTools_ListIteratorOfListOfShape It;
229 TopoDS_Shape curshape;
230 for(Standard_Integer i = 1; i <= nbc; i++){
231 curshape = Rakk->FirstVertex(i);
232 It.Initialize(Rakk->Generated(curshape));
233 PrintHist(curshape,It,nbgen);
234 Standard_Integer nbe = Rakk->NbEdges(i);
235 for(Standard_Integer j = 1; j <= nbe; j++){
236 curshape = Rakk->Edge(i,j);
237 It.Initialize(Rakk->Generated(curshape));
238 PrintHist(curshape,It,nbgen);
240 curshape = Rakk->LastVertex(i);
241 It.Initialize(Rakk->Generated(curshape));
242 PrintHist(curshape,It,nbgen);
244 //cout<<"foreach g [lsort [dir gen*]] { wclick; puts [dname $g]; donl $g; }"<<endl;
245 di<<"foreach g [lsort [dir gen*]] { wclick; puts [dname $g]; donl $g; }\n";
249 static Standard_Integer MKEVOL(Draw_Interpretor& di,
250 Standard_Integer narg,
253 if(Rake != 0) {delete Rake; Rake = 0;}
255 if (narg < 3) return 1;
256 TopoDS_Shape V = DBRep::Get(a[2]);
257 Rake = new BRepFilletAPI_MakeFillet(V);
258 Rake->SetParams(ta,t3d,t2d,t3d,t2d,fl);
259 Rake->SetContinuity(blend_cont, tapp_angle);
261 ChFi3d_FilletShape FSh = ChFi3d_Rational;
262 if (!strcasecmp(a[3], "Q")) {
263 FSh = ChFi3d_QuasiAngular;
265 else if (!strcasecmp(a[3], "P")) {
266 FSh = ChFi3d_Polynomial;
268 Rake->SetFilletShape(FSh);
274 static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
275 Standard_Integer narg,
279 //cout << "MakeFillet not initialized"<<endl;
280 di << "MakeFillet not initialized\n";
283 if(narg%2 != 0 || narg < 4) return 1;
284 TColgp_Array1OfPnt2d uandr(1,(narg/2)-1);
285 Standard_Real Rad, Par;
286 TopoDS_Shape aLocalEdge(DBRep::Get(a[1],TopAbs_EDGE));
287 TopoDS_Edge E = TopoDS::Edge(aLocalEdge);
288 // TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[1],TopAbs_EDGE));
289 for (Standard_Integer ii = 1; ii <= (narg/2)-1; ii++){
290 Par = Draw::Atof(a[2*ii]);
291 Rad = Draw::Atof(a[2*ii + 1]);
292 uandr.ChangeValue(ii).SetCoord(Par,Rad);
298 static Standard_Integer BUILDEVOL(Draw_Interpretor& di,
303 //cout << "MakeFillet not initialized"<<endl;
304 di << "MakeFillet not initialized\n";
309 TopoDS_Shape result = Rake->Shape();
310 DBRep::Set(name,result);
311 if(Rake != 0) {delete Rake; Rake = 0;}
314 if(Rake != 0) {delete Rake; Rake = 0;}
321 //**********************************************
322 // command fuse and cut with fillets *
323 //**********************************************
325 Standard_Integer topoblend(Draw_Interpretor& di, Standard_Integer narg, const char** a)
328 if(narg != 5) return 1;
329 Standard_Boolean fuse = !strcmp(a[0],"fubl");
330 TopoDS_Shape S1 = DBRep::Get(a[2]);
331 TopoDS_Shape S2 = DBRep::Get(a[3]);
332 Standard_Real Rad = Draw::Atof(a[4]);
333 BRepAlgo_BooleanOperation* BC;
335 BC = new BRepAlgo_Fuse(S1,S2);
338 BC = new BRepAlgo_Cut(S1,S2);
340 TopoDS_Shape ShapeCut = BC->Shape();
342 Handle(TopOpeBRepBuild_HBuilder) build = BC->Builder();
343 TopTools_ListIteratorOfListOfShape its;
345 TopoDS_Compound result;
347 B.MakeCompound(result);
350 for (ex.Init(ShapeCut,TopAbs_SOLID); ex.More(); ex.Next()) {
351 const TopoDS_Shape& cutsol = ex.Current();
353 BRepFilletAPI_MakeFillet fill(cutsol);
354 fill.SetParams(ta,t3d,t2d,t3d,t2d,fl);
355 fill.SetContinuity(blend_cont, tapp_angle);
356 its = build->Section();
358 TopoDS_Edge E = TopoDS::Edge(its.Value());
365 B.Add(result,fill.Shape());
368 B.Add(result,cutsol);
373 DBRep::Set(a[1],result);
377 //**********************************************
378 // bfuse or bcut and then blend the section
379 //**********************************************
381 Standard_Integer boptopoblend(Draw_Interpretor& di, Standard_Integer narg, const char** a)
386 cout << "Use <command name> result shape1 shape2 radius [-d]" << endl;
390 Standard_Boolean fuse = !strcmp(a[0],"bfuseblend");
391 TopoDS_Shape S1 = DBRep::Get(a[2]);
392 TopoDS_Shape S2 = DBRep::Get(a[3]);
393 if (S1.IsNull() || S2.IsNull()) {
394 printf(" Null shapes are not allowed \n");
397 Standard_Real Rad = Draw::Atof(a[4]);
398 Standard_Boolean isDebug = Standard_False;
402 if(!strcmp(a[5], "-d"))
404 isDebug = Standard_True;
408 BOPAlgo_PaveFiller theDSFiller;
409 BOPCol_ListOfShape aLS;
412 theDSFiller.SetArguments(aLS);
414 theDSFiller.Perform();
415 if (theDSFiller.ErrorStatus()) {
416 printf("Check types of the arguments, please\n");
420 BRepAlgoAPI_BooleanOperation* pBuilder=NULL;
423 pBuilder = new BRepAlgoAPI_Fuse( S1, S2, theDSFiller );
425 pBuilder = new BRepAlgoAPI_Cut ( S1, S2, theDSFiller );
427 Standard_Boolean anIsDone = pBuilder->IsDone();
430 printf("boolean operation not done ErrorStatus()=%d\n", pBuilder->ErrorStatus());
434 TopoDS_Shape ResultOfBop = pBuilder->Shape();
438 const int aStrLen = 1000;
444 DBRep::Set( strcat(aBuff, "_bop"), ResultOfBop );
446 di << "Intermediate result of BOP-operation is saved to \"" << aBuff << "\" variable\n";
449 pBuilder = new BRepAlgoAPI_Section( S1, S2, theDSFiller );
450 TopoDS_Shape theSection = pBuilder->Shape();
455 DBRep::Set( strcat(aBuff, "_sec"), theSection );
456 di << "Intermediate bopsection result is saved to \"" << aBuff << "\" variable\n";
459 TopoDS_Compound result;
461 BB.MakeCompound(result);
463 TopExp_Explorer Explo( ResultOfBop, TopAbs_SOLID );
464 for (; Explo.More(); Explo.Next())
466 const TopoDS_Shape& aSolid = Explo.Current();
468 BRepFilletAPI_MakeFillet Blender(aSolid);
469 Blender.SetParams(ta,t3d,t2d,t3d,t2d,fl);
470 Blender.SetContinuity( blend_cont, tapp_angle );
472 TopExp_Explorer expsec( theSection, TopAbs_EDGE );
473 for (; expsec.More(); expsec.Next())
475 TopoDS_Edge anEdge = TopoDS::Edge(expsec.Current());
476 Blender.Add( Rad, anEdge );
480 if (Blender.IsDone())
481 BB.Add( result, Blender.Shape() );
484 di << "Error: Cannot find the result of BLEND-operation."
485 " The result of BOP operation will be returned.\n";
486 BB.Add( result, aSolid );
491 DBRep::Set( a[1], result );
496 static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, const char** a)
498 if (narg<5) return 1;
499 TopoDS_Shape V = DBRep::Get(a[2]);
500 if(V.IsNull()) return 1;
501 Standard_Integer nb ,i;
503 Standard_Boolean simul=Standard_False;
504 const char *ns0=(a[1]);
505 Rad = Draw::Atof(a[3]);
506 TopTools_ListOfShape E;
507 for (i=4; i <=(narg-1) ; i++){
508 TopoDS_Shape edge= DBRep::Get(a[i],TopAbs_EDGE);
509 if (edge.IsNull()) return 1 ;
510 if(edge.ShapeType()!=TopAbs_EDGE) return 1;
513 FilletSurf_Builder aRakk(V,E,Rad);
514 if (simul) aRakk.Simulate();
515 else aRakk.Perform();
517 //if (Rakk.IsDone()==FilletSurf_IsNotOk)
518 // { FilletSurf_ErrorTypeStatus err=Rakk.StatusError();
519 // if (err==FilletSurf_EmptyList) cout<< "StatusError=EmptyList"<<endl;
520 // else if (err==FilletSurf_EdgeNotG1) cout<< "StatusError=NotG1"<<endl;
521 // else if (err==FilletSurf_FacesNotG1) cout<< "StatusError=facesNotG1"<<endl;
522 // else if (err==FilletSurf_EdgeNotOnShape)
523 // cout<< "StatusError=edgenotonshape"<<endl;
524 // else if (err==FilletSurf_NotSharpEdge ) cout<< "StatusError=notsharpedge"<<endl;
525 // else if (err==FilletSurf_PbFilletCompute) cout <<"StatusError=PBFillet"<<endl;
528 // if (Rakk.IsDone()==FilletSurf_IsPartial) cout <<"resultat partiel"<<endl;
529 if (aRakk.IsDone()==FilletSurf_IsNotOk)
530 { FilletSurf_ErrorTypeStatus err=aRakk.StatusError();
531 if (err==FilletSurf_EmptyList) di<< "StatusError=EmptyList\n";
532 else if (err==FilletSurf_EdgeNotG1) di<< "StatusError=NotG1\n";
533 else if (err==FilletSurf_FacesNotG1) di<< "StatusError=facesNotG1\n";
534 else if (err==FilletSurf_EdgeNotOnShape)
535 di<< "StatusError=edgenotonshape\n";
536 else if (err==FilletSurf_NotSharpEdge ) di<< "StatusError=notsharpedge\n";
537 else if (err==FilletSurf_PbFilletCompute) di <<"StatusError=PBFillet\n";
540 if (aRakk.IsDone()==FilletSurf_IsPartial) di <<"partial result\n";
542 nb=aRakk.NbSurface();
543 char localname [100];
546 // affichage du type d'arret
550 //if (Rakk.StartSectionStatus()==FilletSurf_NoExtremityOnEdge)
551 // {cout<<" type deb conges = WLBLOUT"<<endl;}
552 //else if (Rakk.StartSectionStatus()==FilletSurf_OneExtremityOnEdge )
553 // { cout<<" type deb conges = WLBLSTOP"<<endl;}
554 //else if (Rakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge)
555 // {cout<<" type deb conges = WLBLEND"<<endl;}
556 if (aRakk.StartSectionStatus()==FilletSurf_NoExtremityOnEdge)
557 {di<<" type start fillets = WLBLOUT\n";}
558 else if (aRakk.StartSectionStatus()==FilletSurf_OneExtremityOnEdge)
559 { di<<" type start fillets = WLBLSTOP\n";}
560 else if (aRakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge)
561 {di<<" type start fillets = WLBLEND\n";}
563 //if (Rakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge)
564 // {cout<<" type fin conges = WLBLOUT"<<endl;}
565 //else if (Rakk.EndSectionStatus()==FilletSurf_OneExtremityOnEdge)
566 // {cout<<" type fin conges = WLBLSTOP"<<endl;}
567 //else if (Rakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge)
568 // { cout<<" type fin conges = WLBLEND"<<endl;}
569 if (aRakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge)
570 {di<<" type end fillets = WLBLOUT\n";}
571 else if (aRakk.EndSectionStatus()==FilletSurf_OneExtremityOnEdge)
572 {di<<" type end fillets = WLBLSTOP\n";}
573 else if (aRakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge)
574 { di<<" type end fillets = WLBLEND\n";}
576 f = aRakk.FirstParameter();
577 l = aRakk.LastParameter();
578 //cout<<"parameter on edge start : "<<f<<endl;
579 //cout<<"parameter on edge end : "<<l<<endl;
580 di<<"parametre on edge start : "<<f<<"\n";
581 di<<"parametre on edge end : "<<l<<"\n";
584 //cout<<"precision "<< i << "= "<<Rakk.TolApp3d(i)<<endl;
585 di<<"precision "<< i << "= "<<aRakk.TolApp3d(i)<<"\n";
587 // display resulting surfaces
588 Sprintf(localname, "%s%d" ,ns0,i);
590 DrawTrSurf::Set(temp,aRakk.SurfaceFillet(i));
591 di << localname<< " ";
594 Sprintf(localname, "%s%d" ,"courb1",i);
596 DrawTrSurf::Set(temp,aRakk.CurveOnFace1(i));
597 di << localname<< " ";
598 Sprintf(localname, "%s%d" ,"courb2",i);
600 DrawTrSurf::Set(temp,aRakk.CurveOnFace2(i));
601 di << localname<< " ";
604 Sprintf(localname, "%s%d" ,"face1",i);
606 DBRep::Set(temp,aRakk.SupportFace1(i));
607 di << localname<< " ";
608 Sprintf(localname, "%s%d" ,"face2",i);
610 DBRep::Set(temp,aRakk.SupportFace2(i));
611 di << localname<< " ";
613 // display Pcurves on faces
614 Sprintf(localname, "%s%d" ,"pcurveonface1",i);
616 DrawTrSurf::Set(temp,aRakk.PCurveOnFace1(i));
617 di << localname<< " ";
618 Sprintf(localname, "%s%d" ,"pcurveonface2",i);
620 DrawTrSurf::Set(temp,aRakk.PCurveOnFace2(i));
621 di << localname<< " ";
623 // display Pcurves on the fillet
624 Sprintf(localname, "%s%d" ,"pcurveonconge1",i);
626 DrawTrSurf::Set(temp,aRakk.PCurve1OnFillet(i));
627 di << localname<< " ";
628 Sprintf(localname, "%s%d" ,"pcurveonconge2",i);
630 DrawTrSurf::Set(temp,aRakk.PCurve2OnFillet(i));
631 di << localname<< " ";
638 {Standard_Integer s=aRakk.NbSection(i);
640 {Handle(Geom_TrimmedCurve) Sec;
641 aRakk.Section(i,j,Sec);
642 Sprintf(localname, "%s%d%d" ,"sec",i,j);
644 DrawTrSurf::Set (temp,Sec);
645 di << localname<< " ";}
651 //=======================================================================
652 //function : rollingball
654 //=======================================================================
656 Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const char** a)
658 if ( n < 2) return 1;
660 TopoDS_Shape S = DBRep::Get(a[2]);
661 if ( S.IsNull()) return 1;
662 Standard_Real Rad = Draw::Atof(a[3]);
664 Standard_Real Tol = t3d; //the same as blend ! 1.e-7;
667 Roll.Init(S,Rad,Tol,Standard_False);
669 Standard_Integer Nb = 0;
670 for ( Standard_Integer i = 4; i <= n-1; i++) {
671 if ( !strcmp(a[i],"@")) {
676 if ( Nb == 0) { // return stop faces.
677 TopoDS_Shape aLocalFace(DBRep::Get(a[i],TopAbs_FACE));
678 TopoDS_Face F1 = TopoDS::Face(aLocalFace);
679 // TopoDS_Face F1 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
681 //cout << " Stop face not referenced." << endl;
682 di << " Stop face not referenced.\n";
685 Roll.SetStoppingFace(F1);
687 else if (Nb == 1) { // return faces on which the ball rotates
688 TopoDS_Shape aLocalFace(DBRep::Get(a[i],TopAbs_FACE));
689 TopoDS_Face F1 = TopoDS::Face(aLocalFace);
690 // TopoDS_Face F1 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
692 if ( !strcmp(a[i],"@")) {
693 //cout << " Even number of ball support faces is required " << endl;
694 di << " Even number of ball support faces is required \n";
697 aLocalFace = DBRep::Get(a[i],TopAbs_FACE);
698 TopoDS_Face F2 = TopoDS::Face(aLocalFace);
699 // TopoDS_Face F2 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
700 if ( F1.IsNull() || F2.IsNull()) {
701 //cout << " Support face not referenced." << endl;
702 di << " Support face not referenced.\n";
705 Roll.SetFaces(F1,F2);
707 else if (Nb == 2) { // return the edge on which the ball rotates
708 TopoDS_Shape aLocalShape(DBRep::Get(a[i],TopAbs_EDGE));
709 TopoDS_Edge E = TopoDS::Edge(aLocalShape);
710 // TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[i],TopAbs_EDGE));
712 //cout << " Edge not referenced." << endl;
713 di << " Edge not referenced.\n";
720 Standard_Boolean BuildShape = (!strcmp(a[0],"brollingball"));
722 Roll.Perform(BuildShape);
724 Standard_Boolean ComputeBranches = (!strcmp(a[0],"trollingball"));
726 if (ComputeBranches) {
727 Standard_Integer NbBranches = Roll.NbBranches();
728 for (Standard_Integer i = 1; i <= NbBranches; i++) {
729 Standard_Integer From,To;
730 Roll.IndicesOfBranche(i,From,To);
731 //cout << " Indexes of the " << i << "th Branch : ";
732 //cout << " " << From << " " << To << endl;
733 di << " Indexes of the " << i << "th Branch : ";
734 di << " " << From << " " << To << "\n";
735 for (Standard_Integer j = From; j <= To; j++) {
736 const TopoDS_Shape& CurF = Roll.Face(j);
737 Sprintf(localname,"%s_%d_%d",a[1],i,j);
738 DBRep::Set(localname,CurF);
744 DBRep::Set(a[1],Roll.Shape());
749 //=======================================================================
750 //function : FilletCommands
752 //=======================================================================
754 void BRepTest::FilletCommands(Draw_Interpretor& theCommands)
756 static Standard_Boolean done = Standard_False;
758 done = Standard_True;
760 DBRep::BasicCommands(theCommands);
762 const char* g = "TOPOLOGY Fillet construction commands";
764 theCommands.Add("continuityblend",
765 "continuityblend C0/C1/C2 [tangle]",__FILE__,
768 theCommands.Add("tolblend",
769 "tolblend [ta t3d t2d fl]",__FILE__,
772 theCommands.Add("blend",
773 "blend result object rad1 ed1 rad2 ed2 ... [R/Q/P]",__FILE__,
776 theCommands.Add("checkhist",
777 "checkhist",__FILE__,
780 theCommands.Add("mkevol",
781 "mkevol result object (then use updatevol) [R/Q/P]",__FILE__,
784 theCommands.Add("updatevol",
785 "updatevol edge u1 rad1 u2 rad2 ...",__FILE__,
788 theCommands.Add("buildevol",
789 "buildevol end of the evol fillet computation",__FILE__,
792 theCommands.Add("fubl",
793 "fubl result shape1 shape2 radius",__FILE__,
796 theCommands.Add("cubl",
797 "cubl result shape tool radius",__FILE__,
800 theCommands.Add("bfuseblend",
801 "bfuseblend result shape1 shape2 radius [-d]",__FILE__,
804 theCommands.Add("bcutblend",
805 "bcutblend result shape1 tool radius [-d]",__FILE__,
808 theCommands.Add("blend1",
809 "blend1 result object rad ed1 ed2 ...",__FILE__,
812 theCommands.Add("rollingball",
813 "rollingball r S radius [stopf1 ..] @ [f1 f2 ..] @ [e1 ..]",
817 theCommands.Add("brollingball",
818 "brollingball r S radius [stopf1 ..] @ [f1 f2 ..] @ [e1 ..]",
822 theCommands.Add("trollingball",
823 "trollingball r S radius [stopf1 ..] @ [f1 f2 ..] @ [e1 ..]",