1 // File: BRepTest_BasicCommands.cxx
2 // Created: Tue Dec 13 09:48:16 1994
3 // Author: Jacques GOUSSARD
6 #include <Standard_Stream.hxx>
7 #include <Standard_Macro.hxx>
9 #include <BRepTest.hxx>
12 #include <Draw_Appli.hxx>
13 #include <Draw_Interpretor.hxx>
14 #include <Draw_Box.hxx>
16 #include <BRepBuilderAPI.hxx>
17 #include <BRepBuilderAPI_FindPlane.hxx>
18 #include <BRepBuilderAPI_Copy.hxx>
19 #include <BRepBuilderAPI_Transform.hxx>
20 #include <BRepBuilderAPI_GTransform.hxx>
21 #include <BRepBuilderAPI_NurbsConvert.hxx>
24 #include <gp_GTrsf.hxx>
25 #include <BRepOffsetAPI_NormalProjection.hxx>
26 #include <BRepLib.hxx>
27 #include <BRep_Builder.hxx>
28 #include <BRepBndLib.hxx>
29 #include <Bnd_Box.hxx>
30 #include <TopExp_Explorer.hxx>
32 #include <BRepTools_WireExplorer.hxx>
34 #include <GCPnts_QuasiUniformAbscissa.hxx>
35 #include <Geom2dAdaptor_Curve.hxx>
36 #include <GeomAdaptor_Curve.hxx>
37 #include <ProjLib_ComputeApproxOnPolarSurface.hxx>
38 #include <DrawTrSurf.hxx>
41 #include <Draw_Segment3D.hxx>
42 #include <Draw_Marker3D.hxx>
43 #include <Draw_MarkerShape.hxx>
45 #include <TopoDS_Face.hxx>
46 #include <TopoDS_Edge.hxx>
47 #include <TopoDS_Vertex.hxx>
48 #include <BRep_Tool.hxx>
49 #include <TopTools_ListOfShape.hxx>
53 Standard_IMPORT Draw_Viewer dout;
57 //=======================================================================
59 //=======================================================================
61 static Standard_Integer addpcurve(Draw_Interpretor& , Standard_Integer n, const char** a)
64 TopoDS_Shape E = DBRep::Get(a[1]);
65 if (E.IsNull()) return 1;
66 Handle(Geom2d_Curve) PC = DrawTrSurf::GetCurve2d(a[2]);
67 TopoDS_Shape F = DBRep::Get(a[3]);
68 Standard_Real tol = 1.e-7;
73 BB.UpdateEdge(TopoDS::Edge(E), PC, TopoDS::Face(F),tol);
79 //=======================================================================
81 //=======================================================================
83 static Standard_Integer transform(Draw_Interpretor& di,Standard_Integer n,const char** a)
88 Standard_Integer last = n;
90 if (!strcmp(a[0],"reset")) {
92 else if (!strcmp(a[0],"tmove")) {
94 TopoDS_Shape SL = DBRep::Get(a[n-1]);
95 if (SL.IsNull()) return 0;
96 T = SL.Location().Transformation();
99 else if (!strcmp(a[0],"ttranslate")) {
101 T.SetTranslation(gp_Vec(atof(a[n-3]),atof(a[n-2]),atof(a[n-1])));
104 else if (!strcmp(a[0],"trotate")) {
106 T.SetRotation(gp_Ax1(gp_Pnt(atof(a[n-7]),atof(a[n-6]),atof(a[n-5])),
107 gp_Vec(atof(a[n-4]),atof(a[n-3]),atof(a[n-2]))),
108 atof(a[n-1])* (M_PI / 180.0));
111 else if (!strcmp(a[0],"tmirror")) {
113 T.SetMirror(gp_Ax2(gp_Pnt(atof(a[n-6]),atof(a[n-5]),atof(a[n-4])),
114 gp_Vec(atof(a[n-3]),atof(a[n-2]),atof(a[n-1]))));
117 else if (!strcmp(a[0],"tscale")) {
119 T.SetScale(gp_Pnt(atof(a[n-4]),atof(a[n-3]),atof(a[n-2])),atof(a[n-1]));
124 if (T.Form() == gp_Identity) {
126 for (Standard_Integer i = 1; i < last; i++) {
127 TopoDS_Shape S = DBRep::Get(a[i]);
129 //cout << a[i] << " is not a valid shape" << endl;
130 di << a[i] << " is not a valid shape" << "\n";
133 DBRep::Set(a[i],S.Located(L));
138 BRepBuilderAPI_Transform trf(T);
139 for (Standard_Integer i = 1; i < last; i++) {
140 TopoDS_Shape S = DBRep::Get(a[i]);
142 //cout << a[i] << " is not a valid shape" << endl;
143 di << a[i] << " is not a valid shape" << "\n";
148 DBRep::Set(a[i],trf.Shape());
160 ///=======================================================================
162 //=======================================================================
164 static Standard_Integer deform(Draw_Interpretor& di,Standard_Integer n,const char** a)
166 if (n <= 1) return 1;
168 Standard_Integer last = n;
173 // gp_Mat rot(atof(a[last-3]),0,0,0,atof(a[last-2]),0,0,0,atof(a[last-1]));
174 gp_Mat rot(atof(a[3]),0,0,0,atof(a[4]),0,0,0,atof(a[5]));
175 GT.SetVectorialPart(rot);
177 BRepBuilderAPI_GTransform gtrf(GT);
178 BRepBuilderAPI_NurbsConvert nbscv;
179 // for (Standard_Integer i = 1; i < last; i++) {
180 // TopoDS_Shape S = DBRep::Get(a[i]);
181 TopoDS_Shape S = DBRep::Get(a[2]);
183 //cout << a[2] << " is not a valid shape" << endl;
184 di << a[2] << " is not a valid shape" << "\n";
189 DBRep::Set(a[1],gtrf.Shape());
199 //=======================================================================
201 //=======================================================================
203 static Standard_Integer tcopy(Draw_Interpretor& di,Standard_Integer n,const char** a)
205 Standard_Boolean copyGeom = Standard_True;
206 Standard_Integer iFirst = 1; // index of first shape argument
208 if (n > 1 && a[1][0] == '-' && a[1][1] == 'n' )
210 copyGeom = Standard_False;
214 if (n < 3 || (n - iFirst) % 2) {
215 cout << "Use: " << a[0] << " [-n(ogeom)] shape1 copy1 [shape2 copy2 [...]]" << endl;
216 cout << "Option -n forbids copying of geometry (it will be shared)" << endl;
220 BRepBuilderAPI_Copy cop;
221 Standard_Integer nbPairs = (n - iFirst) / 2;
222 for (Standard_Integer i=0; i < nbPairs; i++) {
223 cop.Perform(DBRep::Get(a[i+iFirst]), copyGeom);
224 DBRep::Set(a[i+iFirst+1],cop.Shape());
225 di << a[i+iFirst+1] << " ";
231 //=======================================================================
233 //=======================================================================
235 static Standard_Integer nurbsconvert(Draw_Interpretor& di,Standard_Integer n,const char** a)
238 if ((n-1)%2 != 0) return 1;
239 BRepBuilderAPI_NurbsConvert nbscv;
240 for (Standard_Integer i=0; i<(n-1)/2; i++) {
241 TopoDS_Shape S = DBRep::Get(a[2*i+2]);
243 //cout << a[2*i+2] << " is not a valid shape" << endl;
244 di << a[2*i+2] << " is not a valid shape" << "\n";
249 DBRep::Set(a[2*i+1],nbscv.Shape());
261 //=======================================================================
262 // make a 3D edge curve
263 //=======================================================================
265 static Standard_Integer mkedgecurve (Draw_Interpretor& ,Standard_Integer n,const char** a)
268 Standard_Boolean CurveDone ;
271 Standard_Real Tolerance = atof(a[2]) ;
273 TopoDS_Shape S = DBRep::Get(a[1]);
275 if (S.IsNull()) return 1;
278 BRepLib::BuildCurves3d(S,
283 //=======================================================================
285 //=======================================================================
287 static Standard_Integer sameparameter(Draw_Interpretor& ,Standard_Integer n,const char** a)
290 Standard_Real tol = 1.e-7;
291 TopoDS_Shape S = DBRep::Get(a[1]);
292 if (S.IsNull()) return 1;
293 Standard_Boolean force = !strcmp(a[0],"fsameparameter");
294 if (n == 3) tol = atof(a[2]);
296 BRepLib::SameParameter(S,tol,force);
301 //=======================================================================
302 //function : updatetol
304 //=======================================================================
305 static Standard_Integer updatetol(Draw_Interpretor& ,Standard_Integer n,const char** a)
309 TopoDS_Shape S = DBRep::Get(a[1]);
310 if (S.IsNull()) return 1;
312 if (n==2) BRepLib::UpdateTolerances(S);
313 else BRepLib::UpdateTolerances(S,Standard_True);
319 //=======================================================================
320 //function : OrienSolid
322 //=======================================================================
323 static Standard_Integer orientsolid(Draw_Interpretor& ,Standard_Integer n,const char** a)
327 TopoDS_Shape S = DBRep::Get(a[1]);
328 if (S.IsNull()) return 1;
329 if (S.ShapeType()!=TopAbs_SOLID) return 1;
331 BRepLib::OrientClosedSolid(TopoDS::Solid(S));
338 //=======================================================================
339 //function : boundingstr
341 //=======================================================================
342 static Standard_Integer boundingstr(Draw_Interpretor& di,Standard_Integer n,const char** a)
345 TopoDS_Shape S = DBRep::Get(a[1]);
346 if (S.IsNull()) return 1;
348 BRepBndLib::Add(S,B);
349 Standard_Real axmin,aymin,azmin,axmax,aymax,azmax;
350 B.Get(axmin,aymin,azmin,axmax,aymax,azmax);
351 di << axmin<<" "<< aymin<<" "<< azmin<<" "<< axmax<<" "<< aymax<<" "<< azmax;
353 Draw::Set(a[2],axmin) ;
354 Draw::Set(a[3],aymin) ;
355 Draw::Set(a[4],azmin) ;
356 Draw::Set(a[5],axmax) ;
357 Draw::Set(a[6],aymax) ;
358 Draw::Set(a[7],azmax) ;
363 //=======================================================================
364 //function : bounding
366 //=======================================================================
367 static Standard_Integer bounding(Draw_Interpretor& di,Standard_Integer n,const char** a)
370 Standard_Real axmin,aymin,azmin,axmax,aymax,azmax;
371 Bnd_Box B; Handle(Draw_Box) DB;
374 TopoDS_Shape S = DBRep::Get(a[1]);
375 if (S.IsNull()) return 1;
376 BRepBndLib::Add(S,B);
377 B.Get(axmin,aymin,azmin,axmax,aymax,azmax);
378 DB = new Draw_Box(gp_Pnt(axmin,aymin,azmin),gp_Pnt(axmax,aymax,azmax),Draw_orange);
380 di << axmin<<" "<< aymin<<" "<< azmin<<" "<< axmax<<" "<< aymax<<" "<< azmax;
389 DB = new Draw_Box(gp_Pnt(axmin,aymin,azmin),gp_Pnt(axmax,aymax,azmax),Draw_orange);
394 //=======================================================================
395 //function : findplane
397 //=======================================================================
398 static Standard_Integer findplane(Draw_Interpretor& di,Standard_Integer n,const char** a)
401 TopoDS_Shape S = DBRep::Get(a[1]);
402 if (S.IsNull()) return 1;
403 Standard_Real tolerance = 1.0e-5 ;
404 BRepBuilderAPI_FindPlane a_plane_finder(S,
406 if (a_plane_finder.Found()) {
407 //cout << " a plane is found " ;
408 di << " a plane is found \n";
409 DrawTrSurf::Set(a[2],a_plane_finder.Plane()) ;
413 //=======================================================================
414 //function : precision
416 //=======================================================================
418 static Standard_Integer precision(Draw_Interpretor& di,Standard_Integer n,const char** a)
423 //cout << " Current Precision = " << BRepBuilderAPI::Precision() << endl;
424 di << " Current Precision = " << BRepBuilderAPI::Precision() << "\n";
427 BRepBuilderAPI::Precision(atof(a[1]));
433 //=======================================================================
434 //function : reperage shape (Int lin Shape) + pointe double click + maxtol
436 //=======================================================================
437 #include <IntCurvesFace_ShapeIntersector.hxx>
438 #include <gp_Lin.hxx>
440 static Standard_Integer reperageshape(Draw_Interpretor& di, Standard_Integer narg , const char** a)
442 Standard_Integer details=0;
444 if(narg==3) details=1;
445 const char *id1 = a[1];
446 TopoDS_Shape TheShape1 = DBRep::Get(id1);
448 //cout << "Pick positions with button "<<endl;
449 di << "Pick positions with button "<< "\n";
450 Standard_Integer id,X,Y,b;
453 dout.Select(id,X,Y,b);
457 Standard_Real z = dout.Zoom(id);
458 P2.SetCoord((Standard_Real)X /z,(Standard_Real)Y /z, 0.0);
460 P1.SetCoord((Standard_Real)X /z,(Standard_Real)Y /z,-1.0);
464 gp_Ax1 Axe(P1,gp_Vec(P1,P2));
465 IntCurvesFace_ShapeIntersector Inter;
466 Inter.Load(TheShape1,1e-7);
468 Inter.Perform(Axe,-RealLast(),RealLast());
473 for(Standard_Integer i=1; i<=Inter.NbPnt(); i++) {
474 Standard_Integer numface=1;
476 for(ExF.Init(TheShape1,TopAbs_FACE);
478 ExF.Next(),numface++) {
479 TopoDS_Face Face=TopoDS::Face(ExF.Current());
480 if(Face.IsEqual(Inter.Face(i))) {
481 //cout<<" "<<a[1]<<"_"<<numface;
482 di<<" "<<a[1]<<"_"<<numface;
486 const gp_Pnt& P = Inter.Pnt(i);
487 Standard_Real PMin = Inter.WParameter(i);
489 //cout<<" w:"<<PMin<<endl;
490 di<<" w:"<<PMin<< "\n";
492 if(Inter.Transition(i) == IntCurveSurface_In) {
493 if(Inter.State(i) == TopAbs_IN) {
494 Handle(Draw_Marker3D) p = new Draw_Marker3D(P, Draw_Square, Draw_rouge,2);
495 dout << p; dout.Flush();
497 else if(Inter.State(i) == TopAbs_ON) {
498 Handle(Draw_Marker3D) p = new Draw_Marker3D(P, Draw_Square, Draw_vert,2);
499 dout << p; dout.Flush();
503 if(Inter.Transition(i) == IntCurveSurface_Out) {
504 if(Inter.State(i) == TopAbs_IN) {
505 Handle(Draw_Marker3D) p = new Draw_Marker3D(P, Draw_X, Draw_rouge,2);
506 dout << p; dout.Flush();
508 else if(Inter.State(i) == TopAbs_ON) {
509 Handle(Draw_Marker3D) p = new Draw_Marker3D(P, Draw_X, Draw_vert,2);
510 dout << p; dout.Flush();
522 static Standard_Integer maxtolerance(Draw_Interpretor& theCommands,
523 Standard_Integer n, const char** a) {
525 TopoDS_Shape TheShape = DBRep::Get(a[1]);
526 if(TheShape.IsNull()) return(1);
528 Standard_Real T,TMF,TME,TMV,TmF,TmE,TmV;
529 Standard_Integer nbF,nbE,nbV;
530 TMF=TME=TMV=-RealLast();
531 TmF=TmE=TmV=RealLast();
535 for(ExF.Init(TheShape,TopAbs_FACE);
538 TopoDS_Face Face=TopoDS::Face(ExF.Current());
539 T=BRep_Tool::Tolerance(Face);
545 for(ExE.Init(TheShape,TopAbs_EDGE);
548 TopoDS_Edge Edge=TopoDS::Edge(ExE.Current());
549 T=BRep_Tool::Tolerance(Edge);
555 for(ExV.Init(TheShape,TopAbs_VERTEX);
558 TopoDS_Vertex Vertex=TopoDS::Vertex(ExV.Current());
559 T=BRep_Tool::Tolerance(Vertex);
565 // printf("\n## Tolerances sur le shape %s (nbFaces:%3d nbEdges:%3d nbVtx:%3d)\n",a[1],nbF,nbE,nbV);
566 // if(TmF<=TMF) printf("\n Face : Min %+5.8e Max %+5.8e \n ",TmF,TMF);
567 // if(TmE<=TME) printf("\n Edge : Min %+5.8e Max %+5.8e \n ",TmE,TME);
568 // if(TmV<=TMV) printf("\n Vertex : Min %+5.8e Max %+5.8e \n\n ",TmV,TMV);
571 Standard_SStream sss;
572 sss << "\n## Tolerances on the shape " << a[1] << " (nbFaces:" << nbF
573 << " nbEdges:" << nbE << " nbVtx:" << nbV << ")\n" ;
575 sss.setf(ios::scientific);
576 if(TmF<=TMF) sss << "\n Face : Min " << setw(8) << TmF <<" Max " << setw(8) << TMF << " \n ";
577 if(TmE<=TME) sss << "\n Edge : Min " << setw(8) << TmE <<" Max " << setw(8) << TME << " \n ";
578 if(TmV<=TMV) sss << "\n Vertex : Min " << setw(8) << TmV <<" Max " << setw(8) << TMV << " \n ";
585 static Standard_Integer vecdc(Draw_Interpretor& di,Standard_Integer ,const char** ) {
586 //cout << "Pick positions with button "<<endl;
587 di << "Pick positions with button "<< "\n";
589 Standard_Integer id,X,Y,b;
591 gp_Pnt P1,P2,PP1,PP2;
593 //-----------------------------------------------------------
594 dout.Select(id,X,Y,b); dout.GetTrsf(id,T);
596 Standard_Real z = dout.Zoom(id);
597 P1.SetCoord((Standard_Real)X /z,(Standard_Real)Y /z,0.0);
600 dout.Select(id,X,Y,b); dout.GetTrsf(id,T);
601 T.Invert(); z = dout.Zoom(id);
603 P2.SetCoord((Standard_Real)X /z,(Standard_Real)Y /z,0.0);
605 Standard_Real xa,ya,za;
606 if(Abs(P1.X())>Abs(P2.X())) xa = P1.X(); else xa = P2.X();
607 if(Abs(P1.Y())>Abs(P2.Y())) ya = P1.Y(); else ya = P2.Y();
608 if(Abs(P1.Z())>Abs(P2.Z())) za = P1.Z(); else za = P2.Z();
609 P1.SetCoord(xa,ya,za);
610 Handle(Draw_Marker3D) D0 = new Draw_Marker3D(gp_Pnt(P1.X(),
613 Draw_Square,Draw_blanc,1);
617 //-----------------------------------------------------------
618 dout.Select(id,X,Y,b);
622 PP1.SetCoord((Standard_Real)X /z,(Standard_Real)Y /z,0.0);
624 dout.Select(id,X,Y,b);
628 PP2.SetCoord((Standard_Real)X /z,(Standard_Real)Y /z,0.0);
630 if(Abs(PP1.X())>Abs(PP2.X())) xa = PP1.X(); else xa = PP2.X();
631 if(Abs(PP1.Y())>Abs(PP2.Y())) ya = PP1.Y(); else ya = PP2.Y();
632 if(Abs(PP1.Z())>Abs(PP2.Z())) za = PP1.Z(); else za = PP2.Z();
633 PP1.SetCoord(xa,ya,za);
634 Handle(Draw_Segment3D) d = new Draw_Segment3D(P1,PP1,Draw_blanc);
637 //cout<<"\nttran "<<PP1.X()-P1.X()<<" "<<PP1.Y()-P1.Y()<<" "<<PP1.Z()-P1.Z()<<endl;
638 di <<"\nttran "<<PP1.X()-P1.X()<<" "<<PP1.Y()-P1.Y()<<" "<<PP1.Z()-P1.Z()<< "\n";
640 static Standard_Integer nboxvecdp=0;
641 //cout<<"\nbox b"<<++nboxvecdp<<" "<<Min(P1.X(),PP1.X())<<" "<<Min(P1.Y(),PP1.Y())<<" "<<Min(PP1.Z(),P1.Z());
642 //cout<<" "<<Abs(PP1.X()-P1.X())<<" "<<Abs(PP1.Y()-P1.Y())<<" "<<Abs(PP1.Z()-P1.Z())<<endl;
644 //cout<<"\nDistance :"<<sqrt( (PP1.X()-P1.X())*(PP1.X()-P1.X())
645 // +(PP1.Y()-P1.Y())*(PP1.Y()-P1.Y())
646 // +(PP1.Z()-P1.Z())*(PP1.Z()-P1.Z()))<<endl;
648 di <<"\nbox b"<<++nboxvecdp<<" "<<Min(P1.X(),PP1.X())<<" "<<Min(P1.Y(),PP1.Y())<<" "<<Min(PP1.Z(),P1.Z());
649 di <<" "<<Abs(PP1.X()-P1.X())<<" "<<Abs(PP1.Y()-P1.Y())<<" "<<Abs(PP1.Z()-P1.Z())<< "\n";
651 di <<"\nDistance :"<<sqrt( (PP1.X()-P1.X())*(PP1.X()-P1.X())
652 +(PP1.Y()-P1.Y())*(PP1.Y()-P1.Y())
653 +(PP1.Z()-P1.Z())*(PP1.Z()-P1.Z()))<< "\n";
656 //=======================================================================
658 //=======================================================================
660 #include <TopTools_SequenceOfShape.hxx>
661 static Standard_Integer nproject(Draw_Interpretor& di, Standard_Integer n, const char** a)
663 if ( n < 4) return 1;
664 TopoDS_Shape InpShape;
665 Standard_Integer arg = 2, i;
666 TopTools_SequenceOfShape Args;
668 Standard_Real Tol = 1.e-4;
670 Standard_Real MaxDistance = 1.e-3;
671 GeomAbs_Shape Continuity = GeomAbs_C2;
672 Standard_Integer MaxDeg = 14;
673 Standard_Integer MaxSeg = 16;
675 while((n > arg) && !(InpShape = DBRep::Get(a[arg])).IsNull()){
676 Args.Append(InpShape);
679 if(Args.Length() < 2) return 1;
681 BRepOffsetAPI_NormalProjection OrtProj(Args.Last());
683 for(i = 1; i < Args.Length(); i++)
684 OrtProj.Add(Args(i));
687 if (!strcmp(a[arg],"-g")) {
688 OrtProj.SetLimit(Standard_False);
693 if (!strcmp(a[arg],"-d")) {
696 MaxDistance = atof(a[arg++]);
697 OrtProj.SetMaxDistance(MaxDistance);
700 Tol = Max(atof(a[arg++]),1.e-10);
704 if (atoi(a[arg]) == 0) Continuity = GeomAbs_C0;
705 else if (atoi(a[arg]) == 1) Continuity = GeomAbs_C1;
711 MaxDeg = atoi(a[arg++]);
712 if (MaxDeg<1 || MaxDeg>14) MaxDeg = 14;
715 if(n > arg) MaxSeg = atoi(a[arg]);
717 Tol2d = Pow(Tol, 2./3);
719 OrtProj.SetParams(Tol, Tol2d, Continuity, MaxDeg, MaxSeg);
721 TopTools_ListOfShape Wire;
722 Standard_Boolean IsWire=OrtProj.BuildWire(Wire);
724 //cout << " BuildWire OK " << endl;
725 di << " BuildWire OK " << "\n";
727 DBRep::Set(a[1], OrtProj.Shape());
731 //==========================================================================
733 // exploration of a wire
734 //==========================================================================
735 static Standard_Integer wexplo (Draw_Interpretor&,
736 Standard_Integer argc, const char** argv)
739 if (argc < 2) return 1;
741 TopoDS_Shape C1 = DBRep::Get (argv[1],TopAbs_WIRE);
744 if (argc > 2) C2 = DBRep::Get (argv[2],TopAbs_FACE);
746 if (C1.IsNull()) return 1;
748 BRepTools_WireExplorer we;
749 if (C2.IsNull()) we.Init(TopoDS::Wire(C1));
750 else we.Init(TopoDS::Wire(C1),TopoDS::Face(C2));
752 Standard_Integer k = 1;
754 TopoDS_Edge E = we.Current();
755 sprintf(name,"WEDGE_%d",k);
764 static Standard_Integer scalexyz(Draw_Interpretor& di, Standard_Integer n, const char** a)
768 TopoDS_Shape aShapeBase = DBRep::Get(a[2]);
769 if (aShapeBase.IsNull()) return 1;
771 Standard_Real aFactorX = atof(a[3]);
772 Standard_Real aFactorY = atof(a[4]);
773 Standard_Real aFactorZ = atof(a[5]);
776 gp_Mat rot (aFactorX, 0, 0,
779 aGTrsf.SetVectorialPart(rot);
780 BRepBuilderAPI_GTransform aBRepGTrsf (aShapeBase, aGTrsf, Standard_False);
781 if (!aBRepGTrsf.IsDone())
782 Standard_ConstructionError::Raise("Scaling not done");
783 TopoDS_Shape Result = aBRepGTrsf.Shape();
785 DBRep::Set(a[1], Result);
789 void BRepTest::BasicCommands(Draw_Interpretor& theCommands)
791 static Standard_Boolean done = Standard_False;
793 done = Standard_True;
795 DBRep::BasicCommands(theCommands);
797 const char* g = "TOPOLOGY Basic shape commands";
799 theCommands.Add("addpcurve",
800 "addpcurve edge 2dcurve face [tol (default 1.e-7)]",
804 theCommands.Add("reset",
805 "reset name1 name2..., remove location",
809 theCommands.Add("tmove",
810 "tmove name1 name2 ... name(location)",
814 theCommands.Add("ttranslate",
815 "tmove name1 name2 ... dx dy dz",
819 theCommands.Add("trotate","trotate name1 name2 ... x y z dx dy dz angle",
823 theCommands.Add("tmirror",
824 "tmirror name x y z dx dy dz",
828 theCommands.Add("tscale",
829 "tscale name x y z scale",
833 theCommands.Add("tcopy",
834 "tcopy [-n(ogeom)] name1 result1 [name2 result2 ...]",
838 theCommands.Add("precision",
843 theCommands.Add("mkedgecurve",
844 "mkedgecurve name tolerance",
848 theCommands.Add("fsameparameter",
849 "fsameparameter shapename [tol (default 1.e-7)], \nforce sameparameter on all edges of the shape",
853 theCommands.Add("sameparameter",
854 "sameparameter shapename [tol (default 1.e-7)]",
858 theCommands.Add("updatetolerance",
859 "updatetolerance myShape [param] \n if [param] is absent - not verify of face tolerance, else - perform it",
863 theCommands.Add("solidorientation",
864 "orientsolid myClosedSolid",
868 theCommands.Add("bounding",
869 "bounding shape [ xmin ymin zmin xmax ymax zmax] ; draw bounds",
873 theCommands.Add("boundingstr",
874 "boundingstr shape [ xmin ymin zmin xmax ymax zmax] ; print bounding box",
878 theCommands.Add("nurbsconvert",
879 "nurbsconvert result name [result name]",
883 theCommands.Add("deform",
884 "deform newname name CoeffX CoeffY CoeffZ",
888 theCommands.Add("findplane",
889 "findplane name planename ",
893 theCommands.Add("maxtolerance",
894 "maxtolerance shape ",
898 theCommands.Add("reperageshape",
899 "reperage shape -> list of shape (result of interstion shape , line)",
903 theCommands.Add("vecdc",
904 "vecdc + Pointe double click ",
908 theCommands.Add("nproject","nproject pj e1 e2 e3 ... surf -g -d [dmax] [Tol [continuity [maxdeg [maxseg]]]",
912 theCommands.Add("wexplo","wexplo wire [face] create WEDGE_i",
916 theCommands.Add("scalexyz",
917 "scalexyz res shape factor_x factor_y factor_z",