1 // Created on: 1996-07-10
2 // Created by: Joelle CHAUVET
3 // Copyright (c) 1996-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 // Modified: Wed Mar 5 09:45:42 1997
19 // G1134 : new command "approxplate"
20 // Modified: Thu Jun 12 16:51:36 1997
21 // by: Jerome LEMONIER
22 // Mise a jour suite a la modification des methodes Curves2d
23 // et Sense GeomPlate_BuildPlateSurface.
24 // Modified: Mon Nov 3 10:24:07 1997
25 // utilisation de BRepFill_CurveConstraint
29 #include <GeometryTest.hxx>
30 #include <Draw_Interpretor.hxx>
31 #include <Draw_Appli.hxx>
32 #include <Draw_ProgressIndicator.hxx>
33 #include <DrawTrSurf.hxx>
34 #include <TopAbs_ShapeEnum.hxx>
36 #include <TopoDS_Edge.hxx>
37 #include <TopoDS_Face.hxx>
38 #include <TopExp_Explorer.hxx>
40 #include <BRepAdaptor_Surface.hxx>
41 #include <BRepAdaptor_Curve2d.hxx>
42 #include <BRepAdaptor_Curve.hxx>
43 #include <BRepTest.hxx>
45 #include <Adaptor3d_CurveOnSurface.hxx>
46 #include <TColStd_HArray1OfInteger.hxx>
47 #include <BRep_Tool.hxx>
49 #include <BRepLib.hxx>
50 #include <BRep_Builder.hxx>
51 #include <GeomPlate_BuildPlateSurface.hxx>
52 #include <GeomPlate_BuildAveragePlane.hxx>
53 #include <GeomPlate_Surface.hxx>
54 #include <GeomPlate_BuildAveragePlane.hxx>
55 #include <GeomPlate_HArray1OfHCurve.hxx>
57 #include <GeomPlate_MakeApprox.hxx>
58 #include <GeomPlate_PlateG0Criterion.hxx>
59 #include <GeomPlate_PlateG1Criterion.hxx>
60 #include <BRepFill_CurveConstraint.hxx>
61 #include <GeomPlate_PointConstraint.hxx>
62 #include <GeomAdaptor_Surface.hxx>
63 #include <Geom_Surface.hxx>
65 #include <TopoDS_Wire.hxx>
66 #include <BRepBuilderAPI_MakeEdge.hxx>
67 #include <BRepBuilderAPI_MakeWire.hxx>
68 #include <BRepBuilderAPI_WireError.hxx>
69 #include <BRepBuilderAPI_MakeFace.hxx>
70 #include <TColGeom2d_HArray1OfCurve.hxx>
72 #include <AdvApp2Var_ApproxAFunc2Var.hxx>
73 #include <AdvApp2Var_Context.hxx>
74 #include <AdvApprox_PrefCutting.hxx>
75 #include <AdvApprox_Cutting.hxx>
76 #include <AdvApprox_DichoCutting.hxx>
78 #include <Geom_BSplineSurface.hxx>
80 #include <TColStd_HArray1OfReal.hxx>
81 #include <TColStd_HArray2OfReal.hxx>
83 #include <TColgp_SequenceOfXY.hxx>
84 #include <TColgp_SequenceOfXYZ.hxx>
86 #include <BRepAdaptor_Curve.hxx>
87 #include <Adaptor3d_IsoCurve.hxx>
89 #include <Extrema_ExtPS.hxx>
90 #include <Extrema_POnSurf.hxx>
91 #include <Geom_Plane.hxx>
92 #include <BRepOffsetAPI_MakeFilling.hxx>
93 #include <TCollection_AsciiString.hxx>
94 #include <Geom2d_TrimmedCurve.hxx>
95 #include <GeomConvert_ApproxSurface.hxx>
97 #include <BRepTest_Objects.hxx>
100 #include <gp_Pnt.hxx>
104 #include <OSD_Chronometer.hxx>
105 #include <Geom_Line.hxx>
108 const Standard_Integer defDegree = 3;
109 const Standard_Integer defNbPtsOnCur = 10;
110 const Standard_Integer defNbIter = 3;
111 const Standard_Boolean defAnisotropie = Standard_False;
112 const Standard_Real defTol2d = 0.00001;
113 const Standard_Real defTol3d = 0.0001;
114 const Standard_Real defTolAng = 0.01;
115 const Standard_Real defTolCurv = 0.1;
116 const Standard_Integer defMaxDeg = 8;
117 const Standard_Integer defMaxSegments = 9;
119 Standard_Integer Degree = defDegree;
120 Standard_Integer NbPtsOnCur = defNbPtsOnCur ;
121 Standard_Integer NbIter = defNbIter;
122 Standard_Boolean Anisotropie = defAnisotropie ;
123 Standard_Real Tol2d = defTol2d;
124 Standard_Real Tol3d = defTol3d;
125 Standard_Real TolAng = defTolAng;
126 Standard_Real TolCurv = defTolCurv;
127 Standard_Integer MaxDeg = defMaxDeg;
128 Standard_Integer MaxSegments = defMaxSegments;
130 ////////////////////////////////////////////////////////////////////////////////
131 // commande plate : resultat face sur surface plate
132 ////////////////////////////////////////////////////////////////////////////////
134 static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const char** a)
136 if (n < 8 ) return 1;
137 Standard_Integer NbCurFront=Draw::Atoi(a[3]);
138 Handle(GeomPlate_HArray1OfHCurve) Fronts = new GeomPlate_HArray1OfHCurve(1,NbCurFront);
139 Handle(TColStd_HArray1OfInteger) Tang = new TColStd_HArray1OfInteger(1,NbCurFront);
140 Handle(TColStd_HArray1OfInteger) NbPtsCur = new TColStd_HArray1OfInteger(1,NbCurFront);
143 GeomPlate_BuildPlateSurface Henri(3,15,2);
146 for (i=1; i<=NbCurFront ; i++) {
147 TopoDS_Shape aLocalEdge(DBRep::Get(a[3*i+1],TopAbs_EDGE));
148 TopoDS_Edge E = TopoDS::Edge(aLocalEdge);
149 // TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[3*i+1],TopAbs_EDGE));
150 if(E.IsNull()) return 1;
151 TopoDS_Shape aLocalFace(DBRep::Get(a[3*i+2],TopAbs_FACE));
152 TopoDS_Face F = TopoDS::Face(aLocalFace);
153 // TopoDS_Face F = TopoDS::Face(DBRep::Get(a[3*i+2],TopAbs_FACE));
154 if(F.IsNull()) return 1;
155 Standard_Integer T = Draw::Atoi(a[3*i+3]);
157 NbPtsCur->SetValue(i,Draw::Atoi(a[2]));
158 Handle(BRepAdaptor_Surface) S = new BRepAdaptor_Surface();
160 Handle(BRepAdaptor_Curve2d) C = new BRepAdaptor_Curve2d();
162 Adaptor3d_CurveOnSurface ConS(C,S);
163 Handle (Adaptor3d_CurveOnSurface) HConS = new Adaptor3d_CurveOnSurface(ConS);
164 Fronts->SetValue(i,HConS);
165 Handle(GeomPlate_CurveConstraint) Cont
166 = new BRepFill_CurveConstraint(HConS,
171 Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
172 Henri.Perform(aProgress->Start());
173 if (aProgress->UserBreak())
175 di << "Error: UserBreak\n";
179 Standard_Real ErrG0 = 1.1*Henri.G0Error();
180 //std::cout<<" dist. max = "<<Henri.G0Error()<<" ; angle max = "<<Henri.G1Error()<<std::endl;
181 di<<" dist. max = "<<Henri.G0Error()<<" ; angle max = "<<Henri.G1Error()<<"\n";
183 BRepBuilderAPI_MakeWire MW;
184 for (i=1 ; i<=NbCurFront ; i++) {
185 Standard_Integer iInOrder=Henri.Order()->Value(i);
187 if (Henri.Sense()->Value(iInOrder)==1) {
188 BRepBuilderAPI_MakeEdge ME(Henri.Curves2d()->Value(iInOrder),
190 Fronts->Value(iInOrder)->LastParameter(),
191 Fronts->Value(iInOrder)->FirstParameter());
196 BRepBuilderAPI_MakeEdge ME(Henri.Curves2d()->Value(iInOrder),
198 Fronts->Value(iInOrder)->FirstParameter(),
199 Fronts->Value(iInOrder)->LastParameter());
202 B.UpdateVertex(TopExp::FirstVertex(E), ErrG0);
203 B.UpdateVertex(TopExp::LastVertex(E), ErrG0);
204 BRepLib::BuildCurve3d(E);
206 Sprintf(name,"Edge_%d", i);
209 if (MW.IsDone()==Standard_False) {
210 throw Standard_Failure("mkWire is over ");
216 if (!(W.Closed())) throw Standard_Failure("Wire is not closed");
217 BRepBuilderAPI_MakeFace MF(Henri.Surface(),W,Standard_True);
218 DBRep::Set(a[1],MF.Face());
222 ////////////////////////////////////////////////////////////////////////////////
223 // commande gplate : resultat face egale a la surface approchee
224 ////////////////////////////////////////////////////////////////////////////////
226 static Standard_Integer gplate (Draw_Interpretor & di,Standard_Integer n,const char** a)
228 if (n < 6 ) return 1;
229 Standard_Integer NbCurFront=Draw::Atoi(a[2]),
230 NbPointConstraint=Draw::Atoi(a[3]);
232 GeomPlate_BuildPlateSurface Henri(3,15,2);
235 Standard_Integer Conti;
236 Standard_Integer Indice=4;
238 TopoDS_Shape aLocalFace(DBRep::Get(a[Indice++],TopAbs_FACE));
239 TopoDS_Face SI = TopoDS::Face(aLocalFace);
240 // TopoDS_Face SI = TopoDS::Face(DBRep::Get(a[Indice++],TopAbs_FACE));
244 { Handle(BRepAdaptor_Surface) HSI = new BRepAdaptor_Surface();
246 Henri.LoadInitSurface( BRep_Tool::Surface(HSI->Face()));
248 for (i=1; i<=NbCurFront ; i++) {
249 TopoDS_Shape aLocalShape(DBRep::Get(a[Indice++],TopAbs_EDGE));
250 TopoDS_Edge E = TopoDS::Edge(aLocalShape);
251 // TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[Indice++],TopAbs_EDGE));
252 if(E.IsNull()) return 1;
253 Conti=Draw::Atoi(a[Indice++]);
254 if ((Conti==0)||(Conti==-1))
255 { Handle(BRepAdaptor_Curve) C = new BRepAdaptor_Curve();
257 const Handle(Adaptor3d_Curve)& aC = C; // to avoid ambiguity
258 Handle(GeomPlate_CurveConstraint) Cont= new BRepFill_CurveConstraint(aC,Conti);
263 aLocalFace = DBRep::Get(a[Indice++],TopAbs_FACE);
264 TopoDS_Face F = TopoDS::Face(aLocalFace);
265 // TopoDS_Face F = TopoDS::Face(DBRep::Get(a[Indice++],TopAbs_FACE));
268 Handle(BRepAdaptor_Surface) S = new BRepAdaptor_Surface();
270 Handle(BRepAdaptor_Curve2d) C = new BRepAdaptor_Curve2d();
272 Adaptor3d_CurveOnSurface ConS(C,S);
273 Handle (Adaptor3d_CurveOnSurface) HConS = new Adaptor3d_CurveOnSurface(ConS);
274 Handle(GeomPlate_CurveConstraint) Cont= new BRepFill_CurveConstraint(HConS,Conti);
279 for (i=1; i<=NbPointConstraint ; i++)
283 // gp_Vec V1,V2,V3,V4,V5;
285 if (DrawTrSurf::GetPoint(a[Indice], P1) )
287 Handle(GeomPlate_PointConstraint) PCont= new GeomPlate_PointConstraint(P1,0);
292 { Standard_Real u=Draw::Atof(a[Indice++]),
293 v=Draw::Atof(a[Indice++]);
295 Conti=Draw::Atoi(a[Indice++]);
296 aLocalFace = DBRep::Get(a[Indice++],TopAbs_FACE);
297 TopoDS_Face F = TopoDS::Face(aLocalFace);
298 // TopoDS_Face F = TopoDS::Face(DBRep::Get(a[Indice++],TopAbs_FACE));
301 Handle(BRepAdaptor_Surface) HF = new BRepAdaptor_Surface();
303 Handle(GeomPlate_PointConstraint) PCont= new GeomPlate_PointConstraint(u,v,BRep_Tool::Surface(HF->Face()),Conti,0.001,0.001,0.001);
307 Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
308 Henri.Perform(aProgress->Start());
309 if (aProgress->UserBreak())
311 di << "Error: UserBreak\n";
314 Standard_Integer nbcarreau=9;
315 Standard_Integer degmax=8;
318 Handle(GeomPlate_Surface) gpPlate = Henri.Surface();
319 TColgp_SequenceOfXY S2d;
320 TColgp_SequenceOfXYZ S3d;
323 Henri.Disc2dContour(4,S2d);
324 Henri.Disc3dContour(4,0,S3d);
325 seuil = Max(0.0001,10*Henri.G0Error());
326 GeomPlate_PlateG0Criterion critere (S2d,S3d,seuil);
327 GeomPlate_MakeApprox Mapp(gpPlate,critere,0.0001,nbcarreau,degmax);
328 Handle (Geom_Surface) Surf (Mapp.Surface());
330 Standard_Real Umin, Umax, Vmin, Vmax;
332 Henri.Surface()->Bounds( Umin, Umax, Vmin, Vmax);
334 BRepBuilderAPI_MakeFace MF(Surf, Umin, Umax, Vmin, Vmax, Precision::Confusion());
336 DBRep::Set(a[1],MF.Face());
341 ////////////////////////////////////////////////////////////////////////////////
342 // commande approxplate : resultat face sur surface approchee
343 ////////////////////////////////////////////////////////////////////////////////
345 static Standard_Integer approxplate (Draw_Interpretor & di,Standard_Integer n,const char** a)
347 if (n < 9 ) return 1;
348 Standard_Integer NbMedium=Draw::Atoi(a[2]);
349 Standard_Integer NbCurFront=Draw::Atoi(a[3]);
350 Handle(GeomPlate_HArray1OfHCurve) Fronts = new GeomPlate_HArray1OfHCurve(1,NbCurFront);
351 Handle(TColStd_HArray1OfInteger) Tang = new TColStd_HArray1OfInteger(1,NbCurFront);
352 Handle(TColStd_HArray1OfInteger) NbPtsCur = new TColStd_HArray1OfInteger(1,NbCurFront);
354 GeomPlate_BuildPlateSurface Henri(3,15,2);
357 for (i=1; i<=NbCurFront ; i++) {
358 TopoDS_Shape aLocalShape(DBRep::Get(a[3*i+1],TopAbs_EDGE));
359 TopoDS_Edge E = TopoDS::Edge(aLocalShape);
360 // TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[3*i+1],TopAbs_EDGE));
361 if(E.IsNull()) return 1;
362 TopoDS_Shape aLocalFace(DBRep::Get(a[3*i+2],TopAbs_FACE));
363 TopoDS_Face F = TopoDS::Face(aLocalFace);
364 // TopoDS_Face F = TopoDS::Face(DBRep::Get(a[3*i+2],TopAbs_FACE));
365 if(F.IsNull()) return 1;
366 Standard_Integer T = Draw::Atoi(a[3*i+3]);
368 NbPtsCur->SetValue(i,NbMedium);
369 Handle(BRepAdaptor_Surface) S = new BRepAdaptor_Surface();
371 Handle(BRepAdaptor_Curve2d) C = new BRepAdaptor_Curve2d();
373 Adaptor3d_CurveOnSurface ConS(C,S);
374 Handle (Adaptor3d_CurveOnSurface) HConS = new Adaptor3d_CurveOnSurface(ConS);
375 Fronts->SetValue(i,HConS);
376 Handle(GeomPlate_CurveConstraint) Cont
377 = new BRepFill_CurveConstraint(HConS,
383 Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
384 Henri.Perform(aProgress->Start());
385 if (aProgress->UserBreak())
387 di << "Error: UserBreak\n";
391 Standard_Real dmax = Henri.G0Error(),
392 anmax = Henri.G1Error();
393 //std::cout<<" dist. max = "<<dmax<<" ; angle max = "<<anmax<<std::endl;
394 di<<" dist. max = "<<dmax<<" ; angle max = "<<anmax<<"\n";
396 Tol3d = Draw::Atof(a[3*NbCurFront+4]);
397 Standard_Integer Nbmax = Draw::Atoi(a[3*NbCurFront+5]);
398 Standard_Integer degmax = Draw::Atoi(a[3*NbCurFront+6]);
399 Standard_Integer CritOrder = Draw::Atoi(a[3*NbCurFront+7]);
400 Handle(GeomPlate_Surface) surf = Henri.Surface();
401 Handle(Geom_BSplineSurface) support;
404 GeomPlate_MakeApprox MApp(surf,Tol3d,Nbmax,degmax,dmax,-1);
405 support = MApp.Surface();
407 else if (CritOrder>=0) {
408 TColgp_SequenceOfXY S2d;
409 TColgp_SequenceOfXYZ S3d;
414 Henri.Disc2dContour(4,S2d);
415 Henri.Disc3dContour(4,0,S3d);
416 seuil = Max(Tol3d,dmax*10);
417 GeomPlate_PlateG0Criterion Crit0(S2d,S3d,seuil);
418 GeomPlate_MakeApprox MApp(surf,Crit0,Tol3d,Nbmax,degmax);
419 support = MApp.Surface();
421 else if (CritOrder==1) {
422 Henri.Disc2dContour(4,S2d);
423 Henri.Disc3dContour(4,1,S3d);
424 seuil = Max(Tol3d,anmax*10);
425 GeomPlate_PlateG1Criterion Crit1(S2d,S3d,seuil);
426 GeomPlate_MakeApprox MApp(surf,Crit1,Tol3d,Nbmax,degmax);
427 support = MApp.Surface();
431 BRepBuilderAPI_MakeWire MW;
433 for (i=1 ; i<=NbCurFront ; i++) {
434 Standard_Integer iInOrder=Henri.Order()->Value(i);
436 if (Henri.Sense()->Value(iInOrder)==1) {
437 BRepBuilderAPI_MakeEdge ME(Henri.Curves2d()->Value(iInOrder),
439 Fronts->Value(iInOrder)->LastParameter(),
440 Fronts->Value(iInOrder)->FirstParameter());
444 BRepBuilderAPI_MakeEdge ME(Henri.Curves2d()->Value(iInOrder),
446 Fronts->Value(iInOrder)->FirstParameter(),
447 Fronts->Value(iInOrder)->LastParameter());
450 B.UpdateVertex(TopExp::FirstVertex(E), dmax);
451 B.UpdateVertex(TopExp::LastVertex(E), dmax);
452 BRepLib::BuildCurve3d(E);
454 if (MW.IsDone()==Standard_False) {
455 throw Standard_Failure("mkWire is over ");
460 if (!(W.Closed())) throw Standard_Failure("Wire is not closed");
461 BRepBuilderAPI_MakeFace MF(support,W,Standard_True);
462 DBRep::Set(a[1],MF.Face());
467 static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, const char** a )
471 OSD_Chronometer Chrono;
482 Standard_Integer NbBounds = Draw::Atoi( a[2] );
483 Standard_Integer NbConstraints = Draw::Atoi( a[3] );
484 Standard_Integer NbPoints = Draw::Atoi( a[4] );
486 BRepOffsetAPI_MakeFilling MakeFilling( Degree,
496 TopoDS_Face InitFace = TopoDS::Face( DBRep::Get(a[5], TopAbs_FACE) );
497 if (! InitFace.IsNull())
498 MakeFilling.LoadInitSurface( InitFace );
500 Standard_Integer i = (InitFace.IsNull())? 5 : 6, k;
504 Standard_Integer Order;
505 TopTools_ListOfShape ListForHistory;
506 for (k = 1; k <= NbBounds; k++)
510 E = TopoDS::Edge( DBRep::Get(a[i], TopAbs_EDGE) );
513 F = TopoDS::Face( DBRep::Get(a[i], TopAbs_FACE) );
517 Order = Draw::Atoi( a[i++] );
519 if (! E.IsNull() && ! F.IsNull())
520 MakeFilling.Add( E, F, (GeomAbs_Shape)Order );
525 di<<"\nWrong parameters\n\n";
529 MakeFilling.Add( F, (GeomAbs_Shape)Order );
532 MakeFilling.Add( E, (GeomAbs_Shape)Order );
536 ListForHistory.Append(E);
538 for (k = 1; k <= NbConstraints; k++)
542 E = TopoDS::Edge( DBRep::Get(a[i++], TopAbs_EDGE) );
545 di<<"Wrong parameters\n";
548 F = TopoDS::Face( DBRep::Get(a[i], TopAbs_FACE) );
552 Order = Draw::Atoi( a[i++] );
555 MakeFilling.Add( E, (GeomAbs_Shape)Order, Standard_False );
557 MakeFilling.Add( E, F, (GeomAbs_Shape)Order, Standard_False );
559 for (k = 1; k <= NbPoints; k++)
561 if (DrawTrSurf::GetPoint( a[i], Point ))
563 MakeFilling.Add( Point );
568 Standard_Real U = Draw::Atof( a[i++] ), V = Draw::Atof( a[i++] );
569 F = TopoDS::Face( DBRep::Get(a[i++], TopAbs_FACE));
572 di<<"Wrong parameters\n";
575 Order = Draw::Atoi( a[i++] );
577 MakeFilling.Add( U, V, F, (GeomAbs_Shape)Order );
582 if (! MakeFilling.IsDone())
584 di<<"filling failed\n";
588 Standard_Real dmax = MakeFilling.G0Error(),
589 angmax = MakeFilling.G1Error(),
590 curvmax = MakeFilling.G2Error();
591 di<<" dist. max = "<<dmax<<" ; angle max = "<<angmax<<" ; diffcurv max = "<<curvmax<<"\n";
593 TopoDS_Face ResFace= TopoDS::Face( MakeFilling.Shape() );
594 DBRep::Set( a[1], ResFace );
600 di<<"*** FIN DE FILLING ***\n";
601 di<<"Temps de calcul : "<<Tps<<"\n";
605 if (BRepTest_Objects::IsHistoryNeeded())
606 BRepTest_Objects::SetHistory(ListForHistory, MakeFilling);
611 static Standard_Integer fillingparam( Draw_Interpretor & di, Standard_Integer n, const char** a )
615 //std::cout << "fillingparam : options are" <<std::endl;
616 //std::cout << "-l : to list current values" << std::endl;
617 //std::cout << "-i : to set default values" << std::endl;
618 //std::cout << "-r deg nbPonC nbIt anis : to set filling options" <<std::endl;
619 //std::cout << "-c t2d t3d tang tcur : to set tolerances" << std::endl;
620 //std::cout << "-a maxdeg maxseg : Approximation option" << std::endl;
621 di << "fillingparam : options are" <<"\n";
622 di << "-l : to list current values\n";
623 di << "-i : to set default values" << "\n";
624 di << "-r deg nbPonC nbIt anis : to set filling options\n";
625 di << "-c t2d t3d tang tcur : to set tolerances\n";
626 di << "-a maxdeg maxseg : Approximation option\n";
630 TCollection_AsciiString AS( a[1] );
632 const char* flag = AS.ToCString();
633 if (strcmp( flag, "-l" ) == 0 && n == 2)
635 //std::cout<<std::endl;
636 //std::cout<<"Degree = "<<Degree<<std::endl;
637 //std::cout<<"NbPtsOnCur = "<<NbPtsOnCur<<std::endl;
638 //std::cout<<"NbIter = "<<NbIter<<std::endl;
639 //std::cout<<"Anisotropie = "<<Anisotropie<<std::endl<<std::endl;
641 //std::cout<<"Tol2d = "<<Tol2d<<std::endl;
642 //std::cout<<"Tol3d = "<<Tol3d<<std::endl;
643 //std::cout<<"TolAng = "<<TolAng<<std::endl;
644 //std::cout<<"TolCurv = "<<TolCurv<<std::endl<<std::endl;
646 //std::cout<<"MaxDeg = "<<MaxDeg<<std::endl;
647 //std::cout<<"MaxSegments = "<<MaxSegments<<std::endl<<std::endl;
649 di<<"Degree = "<<Degree<<"\n";
650 di<<"NbPtsOnCur = "<<NbPtsOnCur<<"\n";
651 di<<"NbIter = "<<NbIter<<"\n";
652 di<<"Anisotropie = "<< (Standard_Integer) Anisotropie<<"\n\n";
654 di<<"Tol2d = "<<Tol2d<<"\n";
655 di<<"Tol3d = "<<Tol3d<<"\n";
656 di<<"TolAng = "<<TolAng<<"\n";
657 di<<"TolCurv = "<<TolCurv<<"\n\n";
659 di<<"MaxDeg = "<<MaxDeg<<"\n";
660 di<<"MaxSegments = "<<MaxSegments<<"\n\n";
662 else if (strcmp( flag, "-i" ) == 0 && n == 2)
665 NbPtsOnCur = defNbPtsOnCur;
667 Anisotropie = defAnisotropie;
672 TolCurv = defTolCurv;
675 MaxSegments = defMaxSegments;
677 else if (strcmp( flag, "-r" ) == 0 && n == 6)
679 Degree = Draw::Atoi( a[2] );
680 NbPtsOnCur = Draw::Atoi( a[3] );
681 NbIter = Draw::Atoi( a[4] );
682 Anisotropie = Draw::Atoi( a[5] ) != 0;
684 else if (strcmp( flag, "-c" ) == 0 && n == 6)
686 Tol2d = Draw::Atof( a[2] );
687 Tol3d = Draw::Atof( a[3] );
688 TolAng = Draw::Atof( a[4] );
689 TolCurv = Draw::Atof( a[5] );
691 else if (strcmp( flag, "-a" ) == 0 && n == 4)
693 MaxDeg = Draw::Atoi( a[2] );
694 MaxSegments = Draw::Atoi( a[3] );
698 //std::cout<<"Wrong parameters"<<std::endl;
699 di<<"Wrong parameters\n";
709 void BRepTest::FillingCommands(Draw_Interpretor& theCommands)
711 static Standard_Boolean done = Standard_False;
713 done = Standard_True;
715 DBRep::BasicCommands(theCommands);
716 GeometryTest::SurfaceCommands(theCommands);
718 const char* g = "Surface filling topology commands";
719 theCommands.Add("plate",
720 "plate result nbrpntoncurve nbrcurfront edge face tang (0:vif;1:tang) ...",
725 theCommands.Add("gplate",
726 "gplate result nbrcurfront nbrpntconst [SurfInit] [edge 0] [edge tang (1:G1;2:G2) surf]... [point] [u v tang (1:G1;2:G2) surf] ...",
731 theCommands.Add("approxplate",
732 "approxplate result nbrpntoncurve nbrcurfront edge face tang (0:vif;1:tang) ... tol nmax degmax crit",
739 theCommands.Add("filling",
740 "filling result nbB nbC nbP [SurfInit] [edge][face]order... edge[face]order... point/u v face order...",
745 theCommands.Add("fillingparam",
746 "fillingparam : no arg give help",