1 // Created on: 1994-06-20
2 // Created by: Modeling
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
27 #include <BRepTest.hxx>
28 #include <TColgp_Array1OfPnt2d.hxx>
30 #include <Draw_Interpretor.hxx>
31 #include <Draw_Appli.hxx>
32 #include <BRepFilletAPI_MakeFillet.hxx>
33 #include <BRepAlgo_BooleanOperation.hxx>
34 #include <BRepAlgo_Fuse.hxx>
35 #include <BRepAlgo_Cut.hxx>
36 #include <BiTgte_Blend.hxx>
37 #include <TopOpeBRepBuild_HBuilder.hxx>
38 #include <TopTools_ListIteratorOfListOfShape.hxx>
39 #include <TopAbs_ShapeEnum.hxx>
40 #include <TopoDS_Shape.hxx>
41 #include <TopoDS_Compound.hxx>
42 #include <TopoDS_Edge.hxx>
43 #include <TopoDS_Vertex.hxx>
46 #include <TopExp_Explorer.hxx>
48 //#include <BOPTools_DSFiller.hxx>
49 #include <BOPAlgo_PaveFiller.hxx>
51 #include <BRepAlgoAPI_BooleanOperation.hxx>
52 #include <BRepAlgoAPI_Fuse.hxx>
53 #include <BRepAlgoAPI_Cut.hxx>
54 #include <BRepAlgoAPI_Section.hxx>
56 #include <FilletSurf_Builder.hxx>
57 #include <ChFi3d_FilletShape.hxx>
58 #include <Geom_TrimmedCurve.hxx>
59 #include <TopTools_ListOfShape.hxx>
60 #include <FilletSurf_StatusType.hxx>
61 #include <FilletSurf_ErrorTypeStatus.hxx>
63 #include <DrawTrSurf.hxx>
66 //#define strcasecmp strcmp Already defined
75 static Standard_Real t3d = 1.e-4;
76 static Standard_Real t2d = 1.e-5;
77 static Standard_Real ta = 1.e-2;
78 static Standard_Real fl = 1.e-3;
79 static Standard_Real tapp_angle = 1.e-2;
80 static GeomAbs_Shape blend_cont = GeomAbs_C1;
82 static BRepFilletAPI_MakeFillet* Rakk = 0;
83 static BRepFilletAPI_MakeFillet* Rake = 0;
84 static char name[100];
87 static Standard_Integer contblend(Draw_Interpretor& di, Standard_Integer narg, const char** a)
90 //cout<<"tolerance angular of approximation : "<< tapp_angle <<endl;
91 //cout<<"internal continuity : ";
92 di<<"tolerance angular of approximation : "<< tapp_angle <<"\n";
93 di<<"internal continuity : ";
100 //cout << "C1"<<endl;
104 //cout << "C2"<<endl;
113 if (narg >3) return 1;
114 if (narg == 3) { tapp_angle = Abs(Draw::Atof(a[2])); }
118 blend_cont = GeomAbs_C0;
121 blend_cont = GeomAbs_C2;
124 blend_cont = GeomAbs_C1;
130 static void printtolblend(Draw_Interpretor& di)
132 //cout<<"tolerance ang : "<<ta<<endl;
133 //cout<<"tolerance 3d : "<<t3d<<endl;
134 //cout<<"tolerance 2d : "<<t2d<<endl;
135 //cout<<"fleche : "<<fl<<endl;
137 //cout<<"tolblend "<<ta<<" "<<t3d<<" "<<t2d<<" "<<fl<<endl;
139 di<<"tolerance ang : "<<ta<<"\n";
140 di<<"tolerance 3d : "<<t3d<<"\n";
141 di<<"tolerance 2d : "<<t2d<<"\n";
142 di<<"fleche : "<<fl<<"\n";
144 di<<"tolblend "<<ta<<" "<<t3d<<" "<<t2d<<" "<<fl<<"\n";
147 static Standard_Integer tolblend(Draw_Interpretor& di, Standard_Integer narg, const char** a)
154 ta = Draw::Atof(a[1]);
155 t3d = Draw::Atof(a[2]);
156 t2d = Draw::Atof(a[3]);
157 fl = Draw::Atof(a[4]);
162 static Standard_Integer BLEND(Draw_Interpretor& di, Standard_Integer narg, const char** a)
164 if(Rakk != 0) {delete Rakk; Rakk = 0;}
166 if (narg<5) return 1;
167 TopoDS_Shape V = DBRep::Get(a[2]);
168 if(V.IsNull()) return 1;
169 ChFi3d_FilletShape FSh = ChFi3d_Rational;
171 if (!strcasecmp(a[narg-1], "Q")) {
172 FSh = ChFi3d_QuasiAngular;
174 else if (!strcasecmp(a[narg-1], "P")) {
175 FSh = ChFi3d_Polynomial;
178 Rakk = new BRepFilletAPI_MakeFillet(V,FSh);
179 Rakk->SetParams(ta,t3d,t2d,t3d,t2d,fl);
180 Rakk->SetContinuity(blend_cont, tapp_angle);
183 Standard_Integer nbedge = 0;
184 for (Standard_Integer ii = 1; ii < (narg-1)/2; ii++){
185 Rad = Draw::Atof(a[2*ii + 1]);
186 TopoDS_Shape aLocalEdge(DBRep::Get(a[(2*ii+2)],TopAbs_EDGE));
187 E = TopoDS::Edge(aLocalEdge);
188 // E = TopoDS::Edge(DBRep::Get(a[(2*ii+2)],TopAbs_EDGE));
194 if(!nbedge) return 1;
196 if(!Rakk->IsDone()) return 1;
197 TopoDS_Shape res = Rakk->Shape();
198 DBRep::Set(a[1],res);
202 static void PrintHist(const TopoDS_Shape& S,
203 TopTools_ListIteratorOfListOfShape& It,
204 Standard_Integer& nbgen)
212 Sprintf(localname,"generated_00%d", nbgen++);
215 Sprintf(localname,"generated_0%d", nbgen++);
218 Sprintf(localname,"generated_%d", nbgen++);
220 for(; It.More(); It.Next()){
223 DBRep::Set(localname,C);
226 static Standard_Integer CheckHist(Draw_Interpretor& di,
231 //cout<<"No active Builder"<<endl;
232 di<<"No active Builder"<<"\n";
235 if(!Rakk->IsDone()) {
236 //cout<<"Active Builder Not Done"<<endl;
237 di<<"Active Builder Not Done"<<"\n";
240 Standard_Integer nbc = Rakk->NbContours();
241 Standard_Integer nbgen = 0;
242 TopTools_ListIteratorOfListOfShape It;
243 TopoDS_Shape curshape;
244 for(Standard_Integer i = 1; i <= nbc; i++){
245 curshape = Rakk->FirstVertex(i);
246 It.Initialize(Rakk->Generated(curshape));
247 PrintHist(curshape,It,nbgen);
248 Standard_Integer nbe = Rakk->NbEdges(i);
249 for(Standard_Integer j = 1; j <= nbe; j++){
250 curshape = Rakk->Edge(i,j);
251 It.Initialize(Rakk->Generated(curshape));
252 PrintHist(curshape,It,nbgen);
254 curshape = Rakk->LastVertex(i);
255 It.Initialize(Rakk->Generated(curshape));
256 PrintHist(curshape,It,nbgen);
258 //cout<<"foreach g [lsort [dir gen*]] { wclick; puts [dname $g]; donl $g; }"<<endl;
259 di<<"foreach g [lsort [dir gen*]] { wclick; puts [dname $g]; donl $g; }"<<"\n";
263 static Standard_Integer MKEVOL(Draw_Interpretor& di,
264 Standard_Integer narg,
267 if(Rake != 0) {delete Rake; Rake = 0;}
269 if (narg < 3) return 1;
270 TopoDS_Shape V = DBRep::Get(a[2]);
271 Rake = new BRepFilletAPI_MakeFillet(V);
272 Rake->SetParams(ta,t3d,t2d,t3d,t2d,fl);
273 Rake->SetContinuity(blend_cont, tapp_angle);
275 ChFi3d_FilletShape FSh = ChFi3d_Rational;
276 if (!strcasecmp(a[3], "Q")) {
277 FSh = ChFi3d_QuasiAngular;
279 else if (!strcasecmp(a[3], "P")) {
280 FSh = ChFi3d_Polynomial;
282 Rake->SetFilletShape(FSh);
288 static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
289 Standard_Integer narg,
293 //cout << "MakeFillet not initialized"<<endl;
294 di << "MakeFillet not initialized"<<"\n";
297 if(narg%2 != 0 || narg < 4) return 1;
298 TColgp_Array1OfPnt2d uandr(1,(narg/2)-1);
299 Standard_Real Rad, Par;
300 TopoDS_Shape aLocalEdge(DBRep::Get(a[1],TopAbs_EDGE));
301 TopoDS_Edge E = TopoDS::Edge(aLocalEdge);
302 // TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[1],TopAbs_EDGE));
303 for (Standard_Integer ii = 1; ii <= (narg/2)-1; ii++){
304 Par = Draw::Atof(a[2*ii]);
305 Rad = Draw::Atof(a[2*ii + 1]);
306 uandr.ChangeValue(ii).SetCoord(Par,Rad);
312 static Standard_Integer BUILDEVOL(Draw_Interpretor& di,
317 //cout << "MakeFillet not initialized"<<endl;
318 di << "MakeFillet not initialized"<<"\n";
323 TopoDS_Shape result = Rake->Shape();
324 DBRep::Set(name,result);
325 if(Rake != 0) {delete Rake; Rake = 0;}
328 if(Rake != 0) {delete Rake; Rake = 0;}
335 //**********************************************
336 // command fuse and cut with fillets *
337 //**********************************************
339 Standard_Integer topoblend(Draw_Interpretor& di, Standard_Integer narg, const char** a)
342 if(narg != 5) return 1;
343 Standard_Boolean fuse = !strcmp(a[0],"fubl");
344 TopoDS_Shape S1 = DBRep::Get(a[2]);
345 TopoDS_Shape S2 = DBRep::Get(a[3]);
346 Standard_Real Rad = Draw::Atof(a[4]);
347 BRepAlgo_BooleanOperation* BC;
349 BC = new BRepAlgo_Fuse(S1,S2);
352 BC = new BRepAlgo_Cut(S1,S2);
354 TopoDS_Shape ShapeCut = BC->Shape();
356 Handle(TopOpeBRepBuild_HBuilder) build = BC->Builder();
357 TopTools_ListIteratorOfListOfShape its;
359 TopoDS_Compound result;
361 B.MakeCompound(result);
364 for (ex.Init(ShapeCut,TopAbs_SOLID); ex.More(); ex.Next()) {
365 const TopoDS_Shape& cutsol = ex.Current();
367 BRepFilletAPI_MakeFillet fill(cutsol);
368 fill.SetParams(ta,t3d,t2d,t3d,t2d,fl);
369 fill.SetContinuity(blend_cont, tapp_angle);
370 its = build->Section();
372 TopoDS_Edge E = TopoDS::Edge(its.Value());
379 B.Add(result,fill.Shape());
382 B.Add(result,cutsol);
387 DBRep::Set(a[1],result);
391 //**********************************************
392 // bfuse or bcut and then blend the section
393 //**********************************************
395 Standard_Integer boptopoblend(Draw_Interpretor& di, Standard_Integer narg, const char** a)
398 if(narg != 5) return 1;
400 Standard_Boolean fuse = !strcmp(a[0],"bfuseblend");
401 TopoDS_Shape S1 = DBRep::Get(a[2]);
402 TopoDS_Shape S2 = DBRep::Get(a[3]);
403 if (S1.IsNull() || S2.IsNull()) {
404 printf(" Null shapes are not allowed \n");
407 Standard_Real Rad = Draw::Atof(a[4]);
409 BOPAlgo_PaveFiller theDSFiller;
410 BOPCol_ListOfShape aLS;
413 theDSFiller.SetArguments(aLS);
415 theDSFiller.Perform();
416 if (theDSFiller.ErrorStatus()) {
417 printf("Check types of the arguments, please\n");
421 BRepAlgoAPI_BooleanOperation* pBuilder=NULL;
424 pBuilder = new BRepAlgoAPI_Fuse( S1, S2, theDSFiller );
426 pBuilder = new BRepAlgoAPI_Cut ( S1, S2, theDSFiller );
428 Standard_Boolean anIsDone = pBuilder->IsDone();
431 printf("boolean operation not done ErrorStatus()=%d\n", pBuilder->ErrorStatus());
435 TopoDS_Shape ResultOfBop = pBuilder->Shape();
438 pBuilder = new BRepAlgoAPI_Section( S1, S2, theDSFiller );
439 TopoDS_Shape theSection = pBuilder->Shape();
441 TopoDS_Compound result;
443 BB.MakeCompound(result);
445 TopExp_Explorer Explo( ResultOfBop, TopAbs_SOLID );
446 for (; Explo.More(); Explo.Next())
448 const TopoDS_Shape& aSolid = Explo.Current();
450 BRepFilletAPI_MakeFillet Blender(aSolid);
451 Blender.SetParams(ta,t3d,t2d,t3d,t2d,fl);
452 Blender.SetContinuity( blend_cont, tapp_angle );
454 TopExp_Explorer expsec( theSection, TopAbs_EDGE );
455 for (; expsec.More(); expsec.Next())
457 TopoDS_Edge anEdge = TopoDS::Edge(expsec.Current());
458 Blender.Add( Rad, anEdge );
462 if (Blender.IsDone())
463 BB.Add( result, Blender.Shape() );
465 BB.Add( result, aSolid );
469 DBRep::Set( a[1], result );
474 static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, const char** a)
476 if (narg<5) return 1;
477 TopoDS_Shape V = DBRep::Get(a[2]);
478 if(V.IsNull()) return 1;
479 Standard_Integer nb ,i;
481 Standard_Boolean simul=Standard_False;
482 const char *ns0=(a[1]);
483 Rad = Draw::Atof(a[3]);
484 TopTools_ListOfShape E;
485 for (i=4; i <=(narg-1) ; i++){
486 TopoDS_Shape edge= DBRep::Get(a[i],TopAbs_EDGE);
487 if (edge.IsNull()) return 1 ;
488 if(edge.ShapeType()!=TopAbs_EDGE) return 1;
491 FilletSurf_Builder aRakk(V,E,Rad);
492 if (simul) aRakk.Simulate();
493 else aRakk.Perform();
495 //if (Rakk.IsDone()==FilletSurf_IsNotOk)
496 // { FilletSurf_ErrorTypeStatus err=Rakk.StatusError();
497 // if (err==FilletSurf_EmptyList) cout<< "StatusError=EmptyList"<<endl;
498 // else if (err==FilletSurf_EdgeNotG1) cout<< "StatusError=NotG1"<<endl;
499 // else if (err==FilletSurf_FacesNotG1) cout<< "StatusError=facesNotG1"<<endl;
500 // else if (err==FilletSurf_EdgeNotOnShape)
501 // cout<< "StatusError=edgenotonshape"<<endl;
502 // else if (err==FilletSurf_NotSharpEdge ) cout<< "StatusError=notsharpedge"<<endl;
503 // else if (err==FilletSurf_PbFilletCompute) cout <<"StatusError=PBFillet"<<endl;
506 // if (Rakk.IsDone()==FilletSurf_IsPartial) cout <<"resultat partiel"<<endl;
507 if (aRakk.IsDone()==FilletSurf_IsNotOk)
508 { FilletSurf_ErrorTypeStatus err=aRakk.StatusError();
509 if (err==FilletSurf_EmptyList) di<< "StatusError=EmptyList"<<"\n";
510 else if (err==FilletSurf_EdgeNotG1) di<< "StatusError=NotG1"<<"\n";
511 else if (err==FilletSurf_FacesNotG1) di<< "StatusError=facesNotG1"<<"\n";
512 else if (err==FilletSurf_EdgeNotOnShape)
513 di<< "StatusError=edgenotonshape"<<"\n";
514 else if (err==FilletSurf_NotSharpEdge ) di<< "StatusError=notsharpedge"<<"\n";
515 else if (err==FilletSurf_PbFilletCompute) di <<"StatusError=PBFillet"<<"\n";
518 if (aRakk.IsDone()==FilletSurf_IsPartial) di <<"partial result"<<"\n";
520 nb=aRakk.NbSurface();
521 char localname [100];
524 // affichage du type d'arret
528 //if (Rakk.StartSectionStatus()==FilletSurf_NoExtremityOnEdge)
529 // {cout<<" type deb conges = WLBLOUT"<<endl;}
530 //else if (Rakk.StartSectionStatus()==FilletSurf_OneExtremityOnEdge )
531 // { cout<<" type deb conges = WLBLSTOP"<<endl;}
532 //else if (Rakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge)
533 // {cout<<" type deb conges = WLBLEND"<<endl;}
534 if (aRakk.StartSectionStatus()==FilletSurf_NoExtremityOnEdge)
535 {di<<" type start fillets = WLBLOUT"<<"\n";}
536 else if (aRakk.StartSectionStatus()==FilletSurf_OneExtremityOnEdge)
537 { di<<" type start fillets = WLBLSTOP"<<"\n";}
538 else if (aRakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge)
539 {di<<" type start fillets = WLBLEND"<<"\n";}
541 //if (Rakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge)
542 // {cout<<" type fin conges = WLBLOUT"<<endl;}
543 //else if (Rakk.EndSectionStatus()==FilletSurf_OneExtremityOnEdge)
544 // {cout<<" type fin conges = WLBLSTOP"<<endl;}
545 //else if (Rakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge)
546 // { cout<<" type fin conges = WLBLEND"<<endl;}
547 if (aRakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge)
548 {di<<" type end fillets = WLBLOUT"<<"\n";}
549 else if (aRakk.EndSectionStatus()==FilletSurf_OneExtremityOnEdge)
550 {di<<" type end fillets = WLBLSTOP"<<"\n";}
551 else if (aRakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge)
552 { di<<" type end fillets = WLBLEND"<<"\n";}
554 f = aRakk.FirstParameter();
555 l = aRakk.LastParameter();
556 //cout<<"parameter on edge start : "<<f<<endl;
557 //cout<<"parameter on edge end : "<<l<<endl;
558 di<<"parametre on edge start : "<<f<<"\n";
559 di<<"parametre on edge end : "<<l<<"\n";
562 //cout<<"precision "<< i << "= "<<Rakk.TolApp3d(i)<<endl;
563 di<<"precision "<< i << "= "<<aRakk.TolApp3d(i)<<"\n";
565 // display resulting surfaces
566 Sprintf(localname, "%s%d" ,ns0,i);
568 DrawTrSurf::Set(temp,aRakk.SurfaceFillet(i));
569 di << localname<< " ";
572 Sprintf(localname, "%s%d" ,"courb1",i);
574 DrawTrSurf::Set(temp,aRakk.CurveOnFace1(i));
575 di << localname<< " ";
576 Sprintf(localname, "%s%d" ,"courb2",i);
578 DrawTrSurf::Set(temp,aRakk.CurveOnFace2(i));
579 di << localname<< " ";
582 Sprintf(localname, "%s%d" ,"face1",i);
584 DBRep::Set(temp,aRakk.SupportFace1(i));
585 di << localname<< " ";
586 Sprintf(localname, "%s%d" ,"face2",i);
588 DBRep::Set(temp,aRakk.SupportFace2(i));
589 di << localname<< " ";
591 // display Pcurves on faces
592 Sprintf(localname, "%s%d" ,"pcurveonface1",i);
594 DrawTrSurf::Set(temp,aRakk.PCurveOnFace1(i));
595 di << localname<< " ";
596 Sprintf(localname, "%s%d" ,"pcurveonface2",i);
598 DrawTrSurf::Set(temp,aRakk.PCurveOnFace2(i));
599 di << localname<< " ";
601 // display Pcurves on the fillet
602 Sprintf(localname, "%s%d" ,"pcurveonconge1",i);
604 DrawTrSurf::Set(temp,aRakk.PCurve1OnFillet(i));
605 di << localname<< " ";
606 Sprintf(localname, "%s%d" ,"pcurveonconge2",i);
608 DrawTrSurf::Set(temp,aRakk.PCurve2OnFillet(i));
609 di << localname<< " ";
616 {Standard_Integer s=aRakk.NbSection(i);
618 {Handle(Geom_TrimmedCurve Sec);
619 aRakk.Section(i,j,Sec);
620 Sprintf(localname, "%s%d%d" ,"sec",i,j);
622 DrawTrSurf::Set (temp,Sec);
623 di << localname<< " ";}
629 //=======================================================================
630 //function : rollingball
632 //=======================================================================
634 Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const char** a)
636 if ( n < 2) return 1;
638 TopoDS_Shape S = DBRep::Get(a[2]);
639 if ( S.IsNull()) return 1;
640 Standard_Real Rad = Draw::Atof(a[3]);
642 Standard_Real Tol = t3d; //the same as blend ! 1.e-7;
645 Roll.Init(S,Rad,Tol,Standard_False);
647 Standard_Integer Nb = 0;
648 for ( Standard_Integer i = 4; i <= n-1; i++) {
649 if ( !strcmp(a[i],"@")) {
654 if ( Nb == 0) { // return stop faces.
655 TopoDS_Shape aLocalFace(DBRep::Get(a[i],TopAbs_FACE));
656 TopoDS_Face F1 = TopoDS::Face(aLocalFace);
657 // TopoDS_Face F1 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
659 //cout << " Stop face not referenced." << endl;
660 di << " Stop face not referenced." << "\n";
663 Roll.SetStoppingFace(F1);
665 else if (Nb == 1) { // return faces on which the ball rotates
666 TopoDS_Shape aLocalFace(DBRep::Get(a[i],TopAbs_FACE));
667 TopoDS_Face F1 = TopoDS::Face(aLocalFace);
668 // TopoDS_Face F1 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
670 if ( !strcmp(a[i],"@")) {
671 //cout << " Even number of ball support faces is required " << endl;
672 di << " Even number of ball support faces is required " << "\n";
675 aLocalFace = DBRep::Get(a[i],TopAbs_FACE);
676 TopoDS_Face F2 = TopoDS::Face(aLocalFace);
677 // TopoDS_Face F2 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
678 if ( F1.IsNull() || F2.IsNull()) {
679 //cout << " Support face not referenced." << endl;
680 di << " Support face not referenced." << "\n";
683 Roll.SetFaces(F1,F2);
685 else if (Nb == 2) { // return the edge on which the ball rotates
686 TopoDS_Shape aLocalShape(DBRep::Get(a[i],TopAbs_EDGE));
687 TopoDS_Edge E = TopoDS::Edge(aLocalShape);
688 // TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[i],TopAbs_EDGE));
690 //cout << " Edge not referenced." << endl;
691 di << " Edge not referenced." << "\n";
698 Standard_Boolean BuildShape = (!strcmp(a[0],"brollingball"));
700 Roll.Perform(BuildShape);
702 Standard_Boolean ComputeBranches = (!strcmp(a[0],"trollingball"));
704 if (ComputeBranches) {
705 Standard_Integer NbBranches = Roll.NbBranches();
706 for (Standard_Integer i = 1; i <= NbBranches; i++) {
707 Standard_Integer From,To;
708 Roll.IndicesOfBranche(i,From,To);
709 //cout << " Indexes of the " << i << "th Branch : ";
710 //cout << " " << From << " " << To << endl;
711 di << " Indexes of the " << i << "th Branch : ";
712 di << " " << From << " " << To << "\n";
713 for (Standard_Integer j = From; j <= To; j++) {
714 const TopoDS_Shape& CurF = Roll.Face(j);
715 Sprintf(localname,"%s_%d_%d",a[1],i,j);
716 DBRep::Set(localname,CurF);
722 DBRep::Set(a[1],Roll.Shape());
727 //=======================================================================
728 //function : FilletCommands
730 //=======================================================================
732 void BRepTest::FilletCommands(Draw_Interpretor& theCommands)
734 static Standard_Boolean done = Standard_False;
736 done = Standard_True;
738 DBRep::BasicCommands(theCommands);
740 const char* g = "TOPOLOGY Fillet construction commands";
742 theCommands.Add("continuityblend",
743 "continuityblend C0/C1/C2 [tangle]",__FILE__,
746 theCommands.Add("tolblend",
747 "tolblend [ta t3d t2d fl]",__FILE__,
750 theCommands.Add("blend",
751 "blend result object rad1 ed1 rad2 ed2 ... [R/Q/P]",__FILE__,
754 theCommands.Add("checkhist",
755 "checkhist",__FILE__,
758 theCommands.Add("mkevol",
759 "mkevol result object (then use updatevol) [R/Q/P]",__FILE__,
762 theCommands.Add("updatevol",
763 "updatevol edge u1 rad1 u2 rad2 ...",__FILE__,
766 theCommands.Add("buildevol",
767 "buildevol end of the evol fillet computation",__FILE__,
770 theCommands.Add("fubl",
771 "fubl result shape1 shape2 radius",__FILE__,
774 theCommands.Add("cubl",
775 "cubl result shape tool radius",__FILE__,
778 theCommands.Add("bfuseblend",
779 "bfuseblend result shape1 shape2 radius",__FILE__,
782 theCommands.Add("bcutblend",
783 "bcutblend result shape tool radius",__FILE__,
786 theCommands.Add("blend1",
787 "blend1 result object rad ed1 ed2 ...",__FILE__,
790 theCommands.Add("rollingball",
791 "rollingball r S radius [stopf1 ..] @ [f1 f2 ..] @ [e1 ..]",
795 theCommands.Add("brollingball",
796 "brollingball r S radius [stopf1 ..] @ [f1 f2 ..] @ [e1 ..]",
800 theCommands.Add("trollingball",
801 "trollingball r S radius [stopf1 ..] @ [f1 f2 ..] @ [e1 ..]",