1 // Created on: 1993-07-22
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-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
9 // under the terms of the GNU Lesser General Public 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 <GeometryTest.hxx>
19 #include <gp_Pnt2d.hxx>
23 #include <gp_Vec2d.hxx>
24 #include <TColgp_HArray1OfPnt2d.hxx>
25 #include <TColgp_Array1OfPnt2d.hxx>
26 #include <BRepBuilderAPI.hxx>
27 #include <BRepBuilderAPI_MakeVertex.hxx>
28 #include <BRepBuilderAPI_MakeEdge.hxx>
29 #include <BRepBuilderAPI_MakeEdge2d.hxx>
30 #include <BRepBuilderAPI_MakeFace.hxx>
31 #include <BRepBuilderAPI_MakeWire.hxx>
32 #include <BRepBuilderAPI_MakePolygon.hxx>
33 #include <BRepOffsetAPI_MakeOffset.hxx>
34 #include <BRepLib.hxx>
35 #include <BRepAlgo.hxx>
36 #include <BRepAdaptor_Curve.hxx>
37 #include <BRep_Builder.hxx>
38 #include <BRep_Tool.hxx>
39 #include <BRepTools.hxx>
40 #include <Geom_Curve.hxx>
41 #include <Geom_TrimmedCurve.hxx>
42 #include <Geom2d_BSplineCurve.hxx>
43 #include <Geom_Surface.hxx>
44 #include <Geom_RectangularTrimmedSurface.hxx>
45 #include <Geom_Plane.hxx>
46 #include <Geom2d_Line.hxx>
47 #include <Geom2d_Circle.hxx>
48 #include <Geom2dAPI_Interpolate.hxx>
49 #include <Geom2d_TrimmedCurve.hxx>
51 #include <TopoDS_Shape.hxx>
52 #include <TopoDS_Wire.hxx>
55 #include <DBRep_DrawableShape.hxx>
56 #include <Draw_Interpretor.hxx>
57 #include <Draw_Appli.hxx>
58 #include <DrawTrSurf.hxx>
59 #include <DrawTrSurf_BSplineCurve2d.hxx>
62 #include <Precision.hxx>
63 #include <GeomAPI.hxx>
64 #include <TopAbs_Orientation.hxx>
65 #include <TopExp_Explorer.hxx>
66 #include <TopOpeBRep_EdgesIntersector.hxx>
67 #include <TopOpeBRep_Point2d.hxx>
68 #include <TopOpeBRepDS_Transition.hxx>
72 Standard_IMPORT Draw_Viewer dout;
75 //=======================================================================
77 //=======================================================================
79 static Standard_Integer vertex(Draw_Interpretor& , Standard_Integer n, const char** a)
84 BRepBuilderAPI_MakeVertex(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]))));
87 TopoDS_Shape S = DBRep::Get(a[3]);
88 if (S.IsNull()) return 0;
89 if (S.ShapeType() != TopAbs_EDGE) return 0;
90 BRepAdaptor_Curve C(TopoDS::Edge(S));
92 C.D0(Draw::Atof(a[2]),P);
93 DBRep::Set(a[1], BRepBuilderAPI_MakeVertex(P));
98 //=======================================================================
100 //=======================================================================
102 static Standard_Integer range(Draw_Interpretor& , Standard_Integer n, const char** a)
105 TopoDS_Shape aLocalShape(DBRep::Get(a[1],TopAbs_EDGE));
106 TopoDS_Edge E = TopoDS::Edge(aLocalShape);
107 // TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[1],TopAbs_EDGE));
108 if (E.IsNull()) return 1;
109 Standard_Real f = Draw::Atof(a[n-2]);
110 Standard_Real l = Draw::Atof(a[n-1]);
115 aLocalShape = DBRep::Get(a[2],TopAbs_FACE);
116 TopoDS_Face F = TopoDS::Face(aLocalShape);
117 // TopoDS_Face F = TopoDS::Face(DBRep::Get(a[2],TopAbs_FACE));
118 if (F.IsNull()) return 1;
124 //=======================================================================
126 //=======================================================================
128 static Standard_Integer trim(Draw_Interpretor& di, Standard_Integer n, const char** a)
131 TopoDS_Shape e = DBRep::Get(a[1]);
132 if (e.IsNull()) return 1;
133 if (e.ShapeType() != TopAbs_EDGE) return 1;
134 TopoDS_Shape v1 = DBRep::Get(a[2]);
135 if (v1.IsNull()) return 1;
136 if (v1.ShapeType() != TopAbs_VERTEX) return 1;
139 v2 = DBRep::Get(a[3]);
140 if (v2.IsNull()) return 1;
141 if (v2.ShapeType() != TopAbs_VERTEX) return 1;
145 const Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(e),L,f,l);
146 TopLoc_Location LI = L.Inverted();
147 e.Orientation(TopAbs_FORWARD);
153 if (v1.Orientation() == TopAbs_REVERSED) {
158 BRepBuilderAPI_MakeEdge ME(C,TopoDS::Vertex(v1),TopoDS::Vertex(v2));
165 //cout <<"Error creating edge"<<endl;
166 di <<"Error creating edge"<<"\n";
172 //=======================================================================
174 //=======================================================================
176 static Standard_Integer polyline(Draw_Interpretor& , Standard_Integer n, const char** a)
179 if (((n-2) % 3) != 0) return 1;
180 Standard_Integer i, j, np = (n-2) / 3;
181 BRepBuilderAPI_MakePolygon W;
183 for (i = 1; i <= np; i ++) {
184 W.Add(gp_Pnt(Draw::Atof(a[j]),Draw::Atof(a[j+1]),Draw::Atof(a[j+2])));
187 DBRep::Set(a[1],W.Wire());
191 //=======================================================================
193 //=======================================================================
195 static Standard_Integer polyvertex(Draw_Interpretor& , Standard_Integer n, const char** a)
199 BRepBuilderAPI_MakePolygon W;
200 for (i = 2; i < n; i ++) {
201 TopoDS_Shape S = DBRep::Get(a[i]);
202 if (S.IsNull()) return 1;
203 if (S.ShapeType() != TopAbs_VERTEX) return 1;
204 W.Add(TopoDS::Vertex(S));
206 DBRep::Set(a[1],W.Wire());
210 //=======================================================================
212 //=======================================================================
214 static Standard_Integer wire(Draw_Interpretor& di, Standard_Integer n, const char** a)
218 BRepBuilderAPI_MakeWire MW;
219 for (i = 2; i < n; i ++) {
220 TopoDS_Shape S = DBRep::Get(a[i]);
221 if (S.IsNull()) continue;
222 if (S.ShapeType() == TopAbs_EDGE)
223 MW.Add(TopoDS::Edge(S));
224 else if (S.ShapeType() == TopAbs_WIRE)
225 MW.Add(TopoDS::Wire(S));
230 //cout << "Wire not done" << endl;
231 di << "Wire not done" << "\n";
238 //=======================================================================
240 //=======================================================================
242 static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const char** a)
246 Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
247 Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
248 if (C.IsNull() && C2d.IsNull()) {
249 //cout << a[2] << " is not a curve" << endl;
250 di << a[2] << " is not a curve" << "\n";
257 if (!C.IsNull()) edge = BRepBuilderAPI_MakeEdge(C);
258 else edge = BRepBuilderAPI_MakeEdge2d(C2d);
261 Handle(Geom_Surface) S;
262 Standard_Integer i = 0;
264 S = DrawTrSurf::GetSurface(a[3]);
265 if (!S.IsNull()) i = 1;
267 TopoDS_Shape aLocalShape(DBRep::Get(a[3+i],TopAbs_VERTEX));
268 TopoDS_Vertex V1 = TopoDS::Vertex(aLocalShape);
269 // TopoDS_Vertex V1 = TopoDS::Vertex(DBRep::Get(a[3+i],TopAbs_VERTEX));
273 edge = BRepBuilderAPI_MakeEdge(C,Draw::Atof(a[3]),Draw::Atof(a[4]));
275 edge = BRepBuilderAPI_MakeEdge2d(C2d,Draw::Atof(a[3]),Draw::Atof(a[4]));
277 edge = BRepBuilderAPI_MakeEdge(C2d,S,Draw::Atof(a[4]),Draw::Atof(a[5]));
280 aLocalShape = DBRep::Get(a[4+i],TopAbs_VERTEX);
281 TopoDS_Vertex V2 = TopoDS::Vertex(aLocalShape);
282 // TopoDS_Vertex V2 = TopoDS::Vertex(DBRep::Get(a[4+i],TopAbs_VERTEX));
284 edge = BRepBuilderAPI_MakeEdge(C,V1,V2);
286 edge = BRepBuilderAPI_MakeEdge2d(C2d,V1,V2);
288 edge = BRepBuilderAPI_MakeEdge(C2d,S,V1,V2);
292 aLocalShape = DBRep::Get(a[5+i],TopAbs_VERTEX);
293 TopoDS_Vertex V2 = TopoDS::Vertex(aLocalShape);
294 // TopoDS_Vertex V2 = TopoDS::Vertex(DBRep::Get(a[5+i],TopAbs_VERTEX));
296 edge = BRepBuilderAPI_MakeEdge(C,V1,V2,Draw::Atof(a[4]),Draw::Atof(a[6]));
298 edge = BRepBuilderAPI_MakeEdge2d(C2d,V1,V2,Draw::Atof(a[4]),Draw::Atof(a[6]));
300 edge = BRepBuilderAPI_MakeEdge(C2d,S,V1,V2,Draw::Atof(a[5]),Draw::Atof(a[7]));
306 DBRep::Set(a[1],edge);
310 //=======================================================================
312 //=======================================================================
313 Standard_IMPORT Draw_Color DrawTrSurf_CurveColor(const Draw_Color col);
314 Standard_IMPORT void DBRep_WriteColorOrientation ();
315 Standard_IMPORT Draw_Color DBRep_ColorOrientation (const TopAbs_Orientation Or);
317 static Standard_Integer mkcurve(Draw_Interpretor& di, Standard_Integer n, const char** a)
321 Standard_Boolean DispOrientation = !strcmp(a[0],"mkoricurve");
323 TopoDS_Shape S = DBRep::Get(a[2],TopAbs_EDGE);
324 if (S.IsNull()) return 1;
328 Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(S),L,f,l);
330 //cout << a[2] << " has no 3d curve" << endl;
331 di << a[2] << " has no 3d curve" << "\n";
334 C = new Geom_TrimmedCurve(C,f,l);
336 Draw_Color col,savecol;
338 if ( DispOrientation) {
339 DBRep_WriteColorOrientation ();
340 col = DBRep_ColorOrientation(TopoDS::Edge(S).Orientation());
341 savecol = DrawTrSurf_CurveColor(col);
343 DrawTrSurf::Set(a[1],C->Transformed(L.Transformation()));
344 if ( DispOrientation) {
345 DrawTrSurf_CurveColor(savecol);
351 //=======================================================================
354 //=======================================================================
356 static Standard_Integer mkpoint(Draw_Interpretor& ,
357 Standard_Integer n, const char** a)
361 TopoDS_Shape S = DBRep::Get(a[2],TopAbs_VERTEX);
362 if ( S.IsNull()) return 1;
364 TopoDS_Vertex V = TopoDS::Vertex(S);
366 gp_Pnt P = BRep_Tool::Pnt(V);
367 DrawTrSurf::Set(a[1],P);
372 //=======================================================================
374 //=======================================================================
376 static Standard_Integer mk2dcurve(Draw_Interpretor& di,
377 Standard_Integer na, const char** a)
379 if (na < 3) return 1;
382 S = DBRep::Get(a[2],TopAbs_EDGE);
386 TopoDS_Edge E = TopoDS::Edge(S);
389 Standard_Real f = 0., l = 0.;
390 Handle(Geom2d_Curve) C;
391 Handle(Geom_Surface) Surf;
393 Standard_Boolean hasFace = Standard_False;
396 // get the first PCurve connected to edge E
397 BRep_Tool::CurveOnSurface(E,C,Surf,L,f,l);
401 S = DBRep::Get(a[3],TopAbs_FACE);
404 Standard_Integer ind = Draw::Atoi(a[3]);
405 BRep_Tool::CurveOnSurface(E,C,Surf,L,f,l,ind);
409 hasFace = Standard_True;
410 TopoDS_Face F = TopoDS::Face(S);
411 C = BRep_Tool::CurveOnSurface(E,F,f,l);
416 //cout << a[2] << " has no 2d curve"; if (na == 4) cout << " on " << a[3];
418 di << a[2] << " has no 2d curve";
422 di << " on " << a[3];
428 C = new Geom2d_TrimmedCurve(C,f,l);
429 DrawTrSurf::Set(a[1],C);
434 //=======================================================================
436 //=======================================================================
438 static Standard_Integer edge(Draw_Interpretor& , Standard_Integer n, const char** a)
441 TopoDS_Shape V1 = DBRep::Get(a[2],TopAbs_VERTEX);
442 TopoDS_Shape V2 = DBRep::Get(a[3],TopAbs_VERTEX);
443 if (V1.IsNull() || V2.IsNull()) return 1;
444 TopoDS_Edge E = BRepBuilderAPI_MakeEdge(TopoDS::Vertex(V1),
450 //=======================================================================
452 //=======================================================================
454 static Standard_Integer isoedge(Draw_Interpretor& , Standard_Integer n, const char** a)
458 Standard_Boolean uiso = *a[0] == 'u';
459 Standard_Real p = Draw::Atof(a[3]);
460 Standard_Real p1 = Draw::Atof(a[4]);
461 Standard_Real p2 = Draw::Atof(a[5]);
462 TopoDS_Shape Sh = DBRep::Get(a[2],TopAbs_FACE);
463 if (Sh.IsNull()) return 1;
465 const Handle(Geom_Surface)& S = BRep_Tool::Surface(TopoDS::Face(Sh),Loc);
466 Standard_Real UMin,UMax,VMin,VMax;
467 BRepTools::UVBounds(TopoDS::Face(Sh),UMin,UMax,VMin,VMax);
469 VMin = Min (VMin , Min (p1,p2));
470 VMax = Max (VMax , Max (p1,p2));
473 UMin = Min (UMin , Min (p1,p2));
474 UMax = Max (VMax , Max (p1,p2));
477 Handle(Geom_RectangularTrimmedSurface) TS = new Geom_RectangularTrimmedSurface(S,UMin,UMax,VMin,VMax);
478 Handle(Geom_Curve) C;
479 Handle(Geom2d_Line) L;
482 L = new Geom2d_Line(gp_Pnt2d(p,0),gp_Dir2d(0,1));
486 L = new Geom2d_Line(gp_Pnt2d(0,p),gp_Dir2d(1,0));
489 TopoDS_Edge E = BRepBuilderAPI_MakeEdge(C,p1,p2);
492 B.UpdateEdge(E,L,TopoDS::Face(Sh),0.);
498 //=======================================================================
500 //=======================================================================
502 static Standard_Integer transfert(Draw_Interpretor& , Standard_Integer n, const char** a)
506 TopoDS_Shape E1 = DBRep::Get(a[1],TopAbs_EDGE);
507 TopoDS_Shape E2 = DBRep::Get(a[2],TopAbs_EDGE);
508 if (E1.IsNull() || E2.IsNull()) return 1;
511 B.Transfert(TopoDS::Edge(E1),TopoDS::Edge(E2));
515 //=======================================================================
517 // command to build a profile
518 //=======================================================================
520 static Standard_Integer profile(Draw_Interpretor& di,
524 // this command build a profile
525 // from a moving point
530 //cout << "profile name [code values] [code values] ...\n";
531 //cout << " Build a profile in the XY plane from a moving point and direction\n";
532 //cout << " The original point and direction are 0 0 and 1 0\n";
533 //cout << " Codes and values describe the point or direction change\n";
534 //cout << " When the point change the direction becomes the tangent\n";
535 //cout << " All angles are in degree (may be negative)\n";
536 //cout << " By default the profile is closed and a face is built\n";
538 //cout << " Instruction Parameters Action\n";
539 //cout << " O X Y Z Set the origin of the plane\n";
540 //cout << " P DX DY DZ UX UY UZ Set the normal and X of the plane\n";
541 //cout << " S Face Set the Plane (Face must be a Face)\n";
542 //cout << " F X Y Set the first point\n";
543 //cout << " X DX Translate point along X\n";
544 //cout << " Y DY Translate point along Y\n";
545 //cout << " L DL Translate point along direction\n";
546 //cout << " XX X Set point X coordinate\n";
547 //cout << " YY Y Set point Y coordinate\n";
548 //cout << " T DX DY Translate point\n";
549 //cout << " TT X Y Set point\n";
550 //cout << " R Angle Rotate direction\n";
551 //cout << " RR Angle Set direction\n";
552 //cout << " D DX DY Set direction\n";
553 //cout << " IX X Intersect with vertical\n";
554 //cout << " IY Y Intersect with horizontal\n";
555 //cout << " C Radius Angle Arc of circle tangent to direction\n";
556 //cout << " W Make a closed wire\n";
557 //cout << " WW Make an open wire\n";
559 di << "profile name [code values] [code values] ...\n";
560 di << " Build a profile in the XY plane from a moving point and direction\n";
561 di << " The original point and direction are 0 0 and 1 0\n";
562 di << " Codes and values describe the point or direction change\n";
563 di << " When the point change the direction becomes the tangent\n";
564 di << " All angles are in degree (may be negative)\n";
565 di << " By default the profile is closed and a face is built\n";
567 di << " Instruction Parameters Action\n";
568 di << " O X Y Z Set the origin of the plane\n";
569 di << " P DX DY DZ UX UY UZ Set the normal and X of the plane\n";
570 di << " S Face Set the Plane (Face must be a Face)\n";
571 di << " F X Y Set the first point\n";
572 di << " X DX Translate point along X\n";
573 di << " Y DY Translate point along Y\n";
574 di << " L DL Translate point along direction\n";
575 di << " XX X Set point X coordinate\n";
576 di << " YY Y Set point Y coordinate\n";
577 di << " T DX DY Translate point\n";
578 di << " TT X Y Set point\n";
579 di << " R Angle Rotate direction\n";
580 di << " RR Angle Set direction\n";
581 di << " D DX DY Set direction\n";
582 di << " IX X Intersect with vertical\n";
583 di << " IY Y Intersect with horizontal\n";
584 di << " C Radius Angle Arc of circle tangent to direction\n";
585 di << " W Make a closed wire\n";
586 di << " WW Make an open wire\n";
591 Standard_Integer i = 2;
592 Standard_Real x0 = 0, y0 = 0, x = 0, y = 0, dx = 1, dy = 0;
593 BRepBuilderAPI_MakeWire MW;
594 gp_Ax3 DummyHP(gp::XOY());
596 enum {line , circle, none} move;
597 Standard_Boolean face = Standard_True;
598 Standard_Boolean close = Standard_True;
599 Standard_Boolean first = Standard_True;
600 Standard_Boolean stayfirst = Standard_False;
601 Standard_Boolean isplanar = Standard_True;
603 TopLoc_Location TheLocation;
604 Handle(Geom_Surface) Surface;
607 Standard_Real length=0,radius=0,angle=0;
615 if (i >= n) goto badargs;
617 di << "profile: The F instruction must precede all moves";
620 x0 = x = Draw::Atof(a[i-1]);
621 y0 = y = Draw::Atof(a[i]);
622 stayfirst = Standard_True;
628 if (i >= n) goto badargs;
629 P.SetLocation(gp_Pnt(Draw::Atof(a[i-2]),Draw::Atof(a[i-1]),Draw::Atof(a[i])));
630 stayfirst = Standard_True;
636 if (i >= n) goto badargs;
638 gp_Vec vn(Draw::Atof(a[i-5]),Draw::Atof(a[i-4]),Draw::Atof(a[i-3]));
639 gp_Vec vx(Draw::Atof(a[i-2]),Draw::Atof(a[i-1]),Draw::Atof(a[i]));
640 if (vn.Magnitude() <= Precision::Confusion()) {
641 di << "profile : null direction";
644 if (vx.Magnitude() <= Precision::Confusion()) {
645 di << "profile : null direction";
648 gp_Ax2 ax(P.Location(),vn,vx);
651 stayfirst = Standard_True;
657 if (i >= n) goto badargs;
659 TopoDS_Shape aLocalShape(DBRep::Get(a[i],TopAbs_FACE));
660 TopoDS_Face Face = TopoDS::Face(aLocalShape);
661 // TopoDS_Face Face = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
663 di << "profile : no face found";
666 Surface = BRep_Tool::Surface(Face,TheLocation);
667 Handle(Geom_Plane) Plane = Handle(Geom_Plane)::DownCast(Surface);
668 if ( Plane.IsNull()) {
669 isplanar = Standard_False;
674 stayfirst = Standard_True;
680 if (i >= n) goto badargs;
681 length = Draw::Atof(a[i]);
682 if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
692 if (i >= n) goto badargs;
693 length = Draw::Atof(a[i]);
694 if ((a[i-1][1] == 'Y') || (a[i-1][1] == 'y')) {
704 if (i >= n) goto badargs;
705 length = Draw::Atof(a[i]);
712 if (i >= n) goto badargs;
714 Standard_Real vx = Draw::Atof(a[i-1]);
715 Standard_Real vy = Draw::Atof(a[i]);
716 if ((a[i-2][1] == 'T') || (a[i-2][1] == 't')) {
720 length = Sqrt(vx*vx+vy*vy);
721 if (length > Precision::Confusion()) {
732 if (i >= n) goto badargs;
733 angle = Draw::Atof(a[i]) * (M_PI / 180.0);
734 if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) {
739 Standard_Real c = Cos(angle);
740 Standard_Real s = Sin(angle);
741 Standard_Real t = c * dx - s * dy;
742 dy = s * dx + c * dy;
750 if (i >= n) goto badargs;
752 Standard_Real vx = Draw::Atof(a[i-1]);
753 Standard_Real vy = Draw::Atof(a[i]);
754 length = Sqrt(vx*vx+vy*vy);
755 if (length > Precision::Confusion()) {
766 if (i >= n) goto badargs;
767 radius = Draw::Atof(a[i-1]);
768 if (Abs(radius) > Precision::Confusion()) {
769 angle = Draw::Atof(a[i]) * (M_PI / 180.0);
777 if (i >= n) goto badargs;
778 length = Draw::Atof(a[i]);
779 if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
780 if (Abs(dx) < Precision::Confusion()) {
781 di << "Profile : cannot intersect, arg " << i-1;
784 length = (length - x) / dx;
787 else if ((a[i-1][1] == 'Y') || (a[i-1][1] == 'y')) {
788 if (Abs(dy) < Precision::Confusion()) {
789 di << "Profile : cannot intersect, arg " << i-1;
792 length = (length - y) / dy;
800 face = Standard_False;
801 if ((a[i][1] == 'W') || (a[i][1] == 'w')) {
802 close = Standard_False;
808 di <<"profile : unknown code " << a[i];
823 Handle(Geom2d_Line) l =
824 new Geom2d_Line(gp_Pnt2d(x,y),gp_Dir2d(dx,dy));
826 MW.Add(BRepBuilderAPI_MakeEdge(GeomAPI::To3d(l,P),0,length));
828 MW.Add(BRepBuilderAPI_MakeEdge(l,Surface,0,length));
836 Standard_Boolean sense = Standard_True;
843 gp_Ax2d ax(gp_Pnt2d(x-radius*dy,y+radius*dx),gp_Dir2d(dy,-dx));
848 Handle(Geom2d_Circle) c = new Geom2d_Circle(ax,radius,sense);
850 MW.Add(BRepBuilderAPI_MakeEdge(GeomAPI::To3d(c,P),0,angle));
852 MW.Add(BRepBuilderAPI_MakeEdge(c,Surface,0,angle));
869 stayfirst = Standard_False;
873 if ((i == n) && close) {
874 // the closing segment
877 length = Sqrt(dx*dx+dy*dy);
878 if (length > Precision::Confusion()) {
888 // get the result, face or wire
892 S = BRepBuilderAPI_MakeFace(P,MW.Wire());
894 BRepBuilderAPI_MakeFace MFace;
895 MFace.Init(Surface,Standard_False,Precision::Confusion());
896 MFace.Add(MW.Wire());
904 if (!TheLocation.IsIdentity())
908 Standard_Real Tol = 1.e-5;
909 BRepLib::BuildCurves3d(S,Tol);
917 di << "profile : bad number of arguments";
920 //=======================================================================
922 // command to build a profile
923 //=======================================================================
925 static Standard_Integer bsplineprof(Draw_Interpretor& di,
929 // this command build a profile
930 // from a moving point
935 //cout << " bsplineprof name [S face] [W WW] " << endl;
936 //cout << " for an edge : <digitizes> ... <mouse button 2> " << endl ;
937 //cout << " to end profile : <mouse button 3> " << endl ;
938 //cout << " Build a profile in the XY plane from digitizes" << endl ;
939 //cout << " By default the profile is closed and a face is built\n";
941 //cout << " W Make a closed wire\n";
942 //cout << " WW Make an open wire\n";
944 di << " bsplineprof name [S face] [W WW] " << "\n";
945 di << " for an edge : <digitizes> ... <mouse button 2> " << "\n";
946 di << " to end profile : <mouse button 3> " << "\n";
947 di << " Build a profile in the XY plane from digitizes" << "\n";
948 di << " By default the profile is closed and a face is built\n";
950 di << " W Make a closed wire\n";
951 di << " WW Make an open wire\n";
956 gp_Pnt2d last_point(0.0e0,
958 gp_Pnt2d first_point(0.0e0,
960 Standard_Integer i = 2,
962 // Standard_Real x0 = 0, y0 = 0, x = 0, y = 0, dx = 1, dy = 0;
963 Standard_Real x = 0, y = 0, dx = 1, dy = 0;
964 BRepBuilderAPI_MakeWire MW;
965 gp_Ax3 DummyHP(gp::XOY());
967 Standard_Boolean face = Standard_True;
968 Standard_Boolean close = Standard_True;
969 // Standard_Boolean first = Standard_True;
970 Standard_Boolean isplanar = Standard_True;
971 Standard_Real length ;
973 TopLoc_Location TheLocation;
974 Handle(Geom_Surface) Surface;
984 TopoDS_Shape aLocalShape(DBRep::Get(a[i],TopAbs_FACE));
985 TopoDS_Face Face = TopoDS::Face(aLocalShape);
986 // TopoDS_Face Face = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
988 di << "profile : no face found";
991 Surface = BRep_Tool::Surface(Face,TheLocation);
992 Handle(Geom_Plane) Plane = Handle(Geom_Plane)::DownCast(Surface);
993 if ( Plane.IsNull()) {
994 isplanar = Standard_False;
1004 face = Standard_False;
1005 if ((a[i][1] == 'W') || (a[i][1] == 'w')) {
1006 close = Standard_False;
1012 di <<"profile : unknown code " << a[i];
1018 // to be done : close the profile using the first point of the contour
1019 // and the point taken with mouse button 3
1021 Handle(Geom2d_BSplineCurve) C ;
1022 Handle(Geom_Curve) curve3d_ptr ;
1023 Standard_Integer id, ii;
1024 Standard_Integer X,Y,b, not_done;
1025 Standard_Integer num_points = 0 ;
1026 gp_Pnt2d a_point( 0.0e0,
1028 Handle(TColgp_HArray1OfPnt2d) points_array_ptr =
1029 new TColgp_HArray1OfPnt2d(1, 1);
1030 Handle(TColgp_HArray1OfPnt2d) new_points_array_ptr ;
1035 dout.Select(id,X,Y,b,wait);
1036 Standard_Real z = dout.Zoom(id);
1037 a_point.SetCoord(1,(Standard_Real)X /z) ;
1038 a_point.SetCoord(2,(Standard_Real)Y /z) ;
1039 if (num_points == 0) {
1041 new TColgp_HArray1OfPnt2d(1, 1);
1042 points_array_ptr->ChangeArray1()(1) = a_point ;
1043 first_point = a_point ;
1047 if (num_points >= 2) {
1048 new_points_array_ptr =
1049 new TColgp_HArray1OfPnt2d(1, num_points);
1050 for (ii = 1 ; ii <= num_points -1 ; ii++) {
1051 new_points_array_ptr->ChangeArray1()(ii) =
1052 points_array_ptr->Array1()(ii) ;
1054 new_points_array_ptr->ChangeArray1()(num_points) = a_point ;
1055 Geom2dAPI_Interpolate a2dInterpolator(new_points_array_ptr,
1058 a2dInterpolator.Perform() ;
1059 if (a2dInterpolator.IsDone()) {
1060 C = a2dInterpolator.Curve() ;
1062 GeomAPI::To3d(C,P) ;
1063 DrawTrSurf::Set(a[1], curve3d_ptr);
1064 dout.RepaintView(id);
1066 points_array_ptr = new_points_array_ptr ;
1070 if (b == 2 || b == 3) {
1071 if (num_points == 2) {
1072 x = last_point.Coord(1) ;
1073 y = last_point.Coord(2) ;
1074 dx = a_point.Coord(1) - x ;
1075 dy = a_point.Coord(2) - y ;
1076 gp_Vec2d a_vector(dx,
1078 length = a_vector.Magnitude() ;
1079 Handle(Geom2d_Line) l =
1080 new Geom2d_Line(gp_Pnt2d(x,y),gp_Dir2d(dx,dy));
1082 MW.Add(BRepBuilderAPI_MakeEdge(GeomAPI::To3d(l,P),0,length));
1085 MW.Add(BRepBuilderAPI_MakeEdge(l,Surface,0,length));
1089 else if (num_points > 2) {
1091 MW.Add(BRepBuilderAPI_MakeEdge(curve3d_ptr,
1092 curve3d_ptr->FirstParameter(),
1093 curve3d_ptr->LastParameter()));
1096 MW.Add(BRepBuilderAPI_MakeEdge(C,
1098 C->FirstParameter(),
1099 C->LastParameter()));
1102 if (num_points >= 2) {
1103 last_point = a_point ;
1104 points_array_ptr->ChangeArray1()(1) = a_point ;
1106 DBRep::Set(a[1], MW.Wire()) ;
1115 a_point = first_point ;
1118 x = last_point.Coord(1) ;
1119 y = last_point.Coord(2) ;
1120 dx = a_point.Coord(1) - x ;
1121 dy = a_point.Coord(2) - y ;
1122 gp_Vec2d a_vector(dx,
1124 length = a_vector.Magnitude() ;
1125 Handle(Geom2d_Line) l =
1126 new Geom2d_Line(gp_Pnt2d(x,y),gp_Dir2d(dx,dy));
1128 MW.Add(BRepBuilderAPI_MakeEdge(GeomAPI::To3d(l,P),0,length));
1130 MW.Add(BRepBuilderAPI_MakeEdge(l,Surface,0,length));
1134 S = BRepBuilderAPI_MakeFace(P,MW.Wire());
1136 BRepBuilderAPI_MakeFace MFace;
1137 MFace.Init(Surface,Standard_False,Precision::Confusion());
1138 MFace.Add(MW.Wire());
1146 if (!TheLocation.IsIdentity())
1147 S.Move(TheLocation);
1150 Standard_Real Tol = 1.e-5;
1151 BRepLib::BuildCurves3d(S,Tol);
1161 //=======================================================================
1163 // command to build a profile
1164 //=======================================================================
1166 static Standard_Integer profile2d(Draw_Interpretor& di,
1170 // this command build a profile with 2d curves.
1171 // from a moving point
1176 //cout << "profile name [code values] [code values] ...\n";
1177 //cout << " Build a profile in the UV plane from a moving point and direction\n";
1178 //cout << " The original point and direction are 0 0 and 1 0\n";
1179 //cout << " Codes and values describe the point or direction change\n";
1180 //cout << " When the point change the direction becomes the tangent\n";
1181 //cout << " All angles are in degree (may be negative)\n";
1182 //cout << " By default the profile is closed \n";
1184 //cout << " Instruction Parameters Action\n";
1185 //cout << " F X Y Set the first point\n";
1186 //cout << " X DX Translate point along X\n";
1187 //cout << " Y DY Translate point along Y\n";
1188 //cout << " L DL Translate point along direction\n";
1189 //cout << " XX X Set point X coordinate\n";
1190 //cout << " YY Y Set point Y coordinate\n";
1191 //cout << " T DX DY Translate point\n";
1192 //cout << " TT X Y Set point\n";
1193 //cout << " R Angle Rotate direction\n";
1194 //cout << " RR Angle Set direction\n";
1195 //cout << " D DX DY Set direction\n";
1196 //cout << " IX X Intersect with vertical\n";
1197 //cout << " IY Y Intersect with horizontal\n";
1198 //cout << " C Radius Angle Arc of circle tangent to direction\n";
1199 //cout << " W Make a closed wire\n";
1201 di << "profile name [code values] [code values] ...\n";
1202 di << " Build a profile in the UV plane from a moving point and direction\n";
1203 di << " The original point and direction are 0 0 and 1 0\n";
1204 di << " Codes and values describe the point or direction change\n";
1205 di << " When the point change the direction becomes the tangent\n";
1206 di << " All angles are in degree (may be negative)\n";
1207 di << " By default the profile is closed \n";
1209 di << " Instruction Parameters Action\n";
1210 di << " F X Y Set the first point\n";
1211 di << " X DX Translate point along X\n";
1212 di << " Y DY Translate point along Y\n";
1213 di << " L DL Translate point along direction\n";
1214 di << " XX X Set point X coordinate\n";
1215 di << " YY Y Set point Y coordinate\n";
1216 di << " T DX DY Translate point\n";
1217 di << " TT X Y Set point\n";
1218 di << " R Angle Rotate direction\n";
1219 di << " RR Angle Set direction\n";
1220 di << " D DX DY Set direction\n";
1221 di << " IX X Intersect with vertical\n";
1222 di << " IY Y Intersect with horizontal\n";
1223 di << " C Radius Angle Arc of circle tangent to direction\n";
1224 di << " W Make a closed wire\n";
1229 Standard_Integer i = 2, NbCurves = 0;
1230 Standard_Real x0 = 0, y0 = 0, x = 0, y = 0, dx = 1, dy = 0;
1231 enum {line , circle, none} move;
1232 Standard_Boolean close = Standard_True;
1233 Standard_Boolean first = Standard_True;
1234 Standard_Boolean stayfirst = Standard_False;
1235 char* name = new char[100];
1239 Standard_Real length=0,radius=0,angle=0;
1247 if (i >= n) goto badargs;
1249 di << "profile: The F instruction must precede all moves";
1252 x0 = x = Draw::Atof(a[i-1]);
1253 y0 = y = Draw::Atof(a[i]);
1254 stayfirst = Standard_True;
1260 if (i >= n) goto badargs;
1261 length = Draw::Atof(a[i]);
1262 if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
1272 if (i >= n) goto badargs;
1273 length = Draw::Atof(a[i]);
1274 if ((a[i-1][1] == 'Y') || (a[i-1][1] == 'y')) {
1284 if (i >= n) goto badargs;
1285 length = Draw::Atof(a[i]);
1292 if (i >= n) goto badargs;
1294 Standard_Real vx = Draw::Atof(a[i-1]);
1295 Standard_Real vy = Draw::Atof(a[i]);
1296 if ((a[i-2][1] == 'T') || (a[i-2][1] == 't')) {
1300 length = Sqrt(vx*vx+vy*vy);
1301 if (length > Precision::Confusion()) {
1312 if (i >= n) goto badargs;
1313 angle = Draw::Atof(a[i]) * (M_PI / 180.0);
1314 if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) {
1319 Standard_Real c = Cos(angle);
1320 Standard_Real s = Sin(angle);
1321 Standard_Real t = c * dx - s * dy;
1322 dy = s * dx + c * dy;
1330 if (i >= n) goto badargs;
1332 Standard_Real vx = Draw::Atof(a[i-1]);
1333 Standard_Real vy = Draw::Atof(a[i]);
1334 length = Sqrt(vx*vx+vy*vy);
1335 if (length > Precision::Confusion()) {
1346 if (i >= n) goto badargs;
1347 radius = Draw::Atof(a[i-1]);
1348 if (Abs(radius) > Precision::Confusion()) {
1349 angle = Draw::Atof(a[i]) * (M_PI / 180.0);
1357 if (i >= n) goto badargs;
1358 length = Draw::Atof(a[i]);
1359 if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
1360 if (Abs(dx) < Precision::Confusion()) {
1361 di << "Profile : cannot intersect, arg " << i-1;
1364 length = (length - x) / dx;
1367 else if ((a[i-1][1] == 'Y') || (a[i-1][1] == 'y')) {
1368 if (Abs(dy) < Precision::Confusion()) {
1369 di << "Profile : cannot intersect, arg " << i-1;
1372 length = (length - y) / dy;
1380 close = Standard_False;
1385 di <<"profile : unknown code " << a[i];
1400 Handle(Geom2d_Line) l = new Geom2d_Line(gp_Pnt2d(x,y),gp_Dir2d(dx,dy));
1401 Handle(Geom2d_TrimmedCurve) ct =
1402 new Geom2d_TrimmedCurve(l,0,length);
1404 Sprintf(name,"%s_%d",a[1],NbCurves);
1405 DrawTrSurf::Set(name,ct);
1406 di.AppendElement(name);
1414 Standard_Boolean sense = Standard_True;
1421 gp_Ax2d ax(gp_Pnt2d(x-radius*dy,y+radius*dx),gp_Dir2d(dy,-dx));
1426 Handle(Geom2d_Circle) c = new Geom2d_Circle(ax,radius,sense);
1427 Handle(Geom2d_TrimmedCurve) ct =
1428 new Geom2d_TrimmedCurve(c,0,angle);
1430 Sprintf(name,"%s_%d",a[1],NbCurves);
1431 DrawTrSurf::Set(name,ct);
1432 di.AppendElement(name);
1438 dx = v.X() / radius;
1439 dy = v.Y() / radius;
1449 stayfirst = Standard_False;
1453 if ((i == n) && close) {
1454 // the closing segment
1457 length = Sqrt(dx*dx+dy*dy);
1458 if (length > Precision::Confusion()) {
1468 Draw::Set(aName, x);
1470 Draw::Set(aName, y);
1472 Draw::Set(aName, dx);
1474 Draw::Set(aName, dy);
1479 di << "profile : bad number of arguments";
1485 //=======================================================================
1486 //function : mkoffset
1488 //=======================================================================
1490 Standard_Integer mkoffset(Draw_Interpretor& di,
1491 Standard_Integer n, const char** a)
1493 if (n < 5) return 1;
1496 BRepOffsetAPI_MakeOffset Paral;
1497 TopoDS_Shape Base = DBRep::Get(a[2],TopAbs_FACE);
1501 Base = DBRep::Get(a[2]);
1502 if (Base.IsNull()) return 1;
1503 Paral.Init(GeomAbs_Arc);
1504 TopExp_Explorer exp;
1505 for (exp.Init(Base,TopAbs_WIRE); exp.More(); exp.Next())
1507 TopoDS_Wire aLocalShape = TopoDS::Wire(exp.Current());
1508 Paral.AddWire(aLocalShape);
1513 Base.Orientation(TopAbs_FORWARD);
1514 Paral.Init(TopoDS::Face(Base));
1517 Standard_Real U, dU;
1518 Standard_Integer Nb;
1519 dU = Draw::Atof(a[4]);
1520 Nb = Draw::Atoi(a[3]);
1522 Standard_Real Alt = 0.;
1524 Alt = Draw::Atof(a[5]);
1526 Standard_Integer Compt = 1;
1528 for ( Standard_Integer i = 1; i <= Nb; i++)
1531 Paral.Perform(U,Alt);
1533 if ( !Paral.IsDone())
1535 di << " Error: Offset is not done." << "\n";
1540 Sprintf(name,"%s_%d", a[1], Compt++);
1541 char* temp = name; // portage WNT
1542 DBRep::Set(temp,Paral.Shape());
1549 //=======================================================================
1550 //function : pickface
1552 //=======================================================================
1554 Standard_Integer pickface(Draw_Interpretor& di,
1555 Standard_Integer , const char** )
1557 Standard_CString pick_name=".";
1559 TopoDS_Shape S = DBRep::Get(pick_name,TopAbs_FACE);
1560 if (S.IsNull()) return 1;
1562 char* name = new char[100];
1563 Sprintf(name,"PickedFace %s",pick_name);
1565 di.AppendElement(name);
1570 Standard_Integer edgeintersector(Draw_Interpretor& di,
1571 Standard_Integer n, const char** a)
1573 if (n < 5) return 1;
1576 TopoDS_Shape aLocalShape(DBRep::Get(a[2],TopAbs_EDGE));
1577 E[0] = TopoDS::Edge(aLocalShape);
1578 // E[0] = TopoDS::Edge(DBRep::Get(a[2],TopAbs_EDGE));
1579 if ( E[0].IsNull()) return 1;
1580 aLocalShape = DBRep::Get(a[3],TopAbs_EDGE);
1581 E[1] = TopoDS::Edge(aLocalShape);
1582 // E[1] = TopoDS::Edge(DBRep::Get(a[3],TopAbs_EDGE));
1583 if ( E[1].IsNull()) return 1;
1584 aLocalShape = DBRep::Get(a[4],TopAbs_FACE);
1585 TopoDS_Face F = TopoDS::Face(aLocalShape);
1586 // TopoDS_Face F = TopoDS::Face(DBRep::Get(a[4],TopAbs_FACE));
1587 if ( F.IsNull()) return 1;
1589 TopOpeBRep_EdgesIntersector EInter;
1591 //------------------------------------------------------
1592 // Calculate point of intersection 2D
1593 //-----------------------------------------------------
1594 EInter.SetFaces(F,F);
1595 Standard_Real TolInter = 1.e-7;
1596 if (n == 6) TolInter = Draw::Atof(a[5]);
1597 EInter.ForceTolerances(TolInter,TolInter);
1598 Standard_Boolean reducesegments = Standard_True;
1599 EInter.Perform (E[0],E[1],reducesegments);
1601 if (EInter.IsEmpty()) {
1602 //cout << " No intersection found" << endl;
1603 di << " No intersection found" << "\n";
1609 Standard_Integer NbV = 0;
1610 Standard_Real Tol = Precision::PConfusion();
1612 Standard_Boolean rejectreducedsegmentpoints = Standard_True;
1613 EInter.InitPoint(rejectreducedsegmentpoints);
1614 for (;EInter.MorePoint();EInter.NextPoint()) {
1615 const TopOpeBRep_Point2d& P2D = EInter.Point();
1616 gp_Pnt P = P2D.Value();
1617 TopoDS_Vertex V = BRepLib_MakeVertex(P);
1619 Sprintf(name,"%s_%d",a[1],NbV);
1621 for (Standard_Integer i = 1; i <= 2; i++) {
1622 //---------------------------------------------------------------
1623 // to be able to rank parameter on edge
1624 // it is necessary to code it internally
1625 //---------------------------------------------------------------
1626 Standard_Real U = P2D.Parameter(i);
1628 V.Orientation(TopAbs_INTERNAL);
1629 B.UpdateVertex(V,U,E[i-1],Tol);
1630 // B.UpdateVertex(TopoDS::Vertex(V.Oriented(TopAbs_INTERNAL)),
1632 //---------------------------------------------------------------
1633 // Orientation of vertex in the transition.
1634 //---------------------------------------------------------------
1635 TopAbs_Orientation OO = TopAbs_REVERSED;
1636 if (P2D.IsVertex(i)) {
1637 OO = P2D.Vertex(i).Orientation();
1639 else if (P2D.Transition(i).Before() == TopAbs_OUT) {
1640 OO = TopAbs_FORWARD;
1642 //cout << " Orientation of vertex " << NbV << " on " << a[i+1] << ": ";
1643 di << " Orientation of vertex " << NbV << " on " << a[i+1] << ": ";
1644 if (OO == TopAbs_FORWARD) {
1645 //cout << "FORWARD" << endl;
1646 di << "FORWARD" << "\n";
1648 //cout << "REVERSED" << endl;
1649 di << "REVERSED" << "\n";
1658 //=======================================================================
1659 //function : concatC0wire
1661 //=======================================================================
1663 Standard_Integer concatC0wire(Draw_Interpretor&, Standard_Integer n, const char** c)
1665 if ( n < 3 ) return 1;
1667 TopoDS_Shape S = DBRep::Get(c[2],TopAbs_WIRE) ;
1670 return 1; //test if the shape is empty
1672 TopoDS_Wire W = TopoDS::Wire(S) ;
1676 res = BRepAlgo::ConcatenateWireC0(W); //treatment
1677 DBRep::Set(c[1], res);
1681 //=======================================================================
1682 //function : concatwire
1683 //purpose : reduce the multiply degree of the knots to the minimum without
1684 // changing the geometry
1685 //=======================================================================
1687 static Standard_Integer concatwire(Draw_Interpretor&, Standard_Integer n, const char** c)
1689 GeomAbs_Shape Option=GeomAbs_C1;
1690 if ( n < 3 ) return 1;
1692 if(n==4) //check if it's C1 or G1
1693 if (! strcmp(c[3],"G1"))
1696 TopoDS_Shape S = DBRep::Get(c[2],TopAbs_WIRE) ;
1698 if (S.IsNull()) return 1 ; //test if the shape is empty
1700 TopoDS_Wire W = TopoDS::Wire(S) ;
1702 res=BRepAlgo::ConcatenateWire(W,Option); //processing
1703 DBRep::Set(c[1],res);
1707 //=======================================================================
1708 //function : build3d
1710 //=======================================================================
1712 Standard_Integer build3d(Draw_Interpretor& di,
1713 Standard_Integer n, const char** a)
1716 if ( (n <2) || (n>3) ) {
1717 //cout << " 1 or 2 arguments expected" << endl;
1718 di << " 1 or 2 arguments expected" << "\n";
1722 Standard_Boolean Ok;
1723 TopoDS_Shape S = DBRep::Get(a[1],TopAbs_FACE);
1724 if (S.IsNull()) return 1;
1726 if (n==2) { Ok = BRepLib::BuildCurves3d(S); }
1727 else { Ok = BRepLib::BuildCurves3d(S,Draw::Atof(a[2])); }
1728 //if (!Ok) {cout << " one of the computation failed" << endl;}
1729 if (!Ok) {di << " one of the computation failed" << "\n";}
1734 //=======================================================================
1735 //function : reducepcurves
1736 //purpose : remove pcurves that are unused in this shape
1737 //=======================================================================
1739 Standard_Integer reducepcurves(Draw_Interpretor& di,
1740 Standard_Integer n, const char** a)
1742 if (n < 2) return 1;
1745 for (i = 1; i < n; i++)
1747 TopoDS_Shape aShape = DBRep::Get(a[i]);
1748 if (aShape.IsNull())
1749 //cout << a[i] << " is not a valid shape" << endl;
1750 di << a[i] << " is not a valid shape" << "\n";
1752 BRepTools::RemoveUnusedPCurves(aShape);
1758 //=======================================================================
1759 //function : CurveCommands
1761 //=======================================================================
1763 void BRepTest::CurveCommands(Draw_Interpretor& theCommands)
1765 static Standard_Boolean done = Standard_False;
1767 done = Standard_True;
1769 DBRep::BasicCommands(theCommands);
1770 GeometryTest::CurveCommands(theCommands);
1772 const char* g = "TOPOLOGY Curve topology commands";
1774 theCommands.Add("vertex",
1775 "vertex name [x y z / p edge]",__FILE__,
1778 theCommands.Add("etrim",
1779 "etrim edge v1 [v2]",__FILE__,
1782 theCommands.Add("range",
1783 "range edge [face] first last",__FILE__,
1786 theCommands.Add("polyline",
1787 "polyline name x1 y1 z1 x2 y2 z2 ...",__FILE__,
1790 theCommands.Add("polyvertex",
1791 "polyvertex name v1 v2 ...",__FILE__,
1794 theCommands.Add("wire",
1795 "wire wirename e1/w1 [e2/w2 ...]",__FILE__,
1798 theCommands.Add("profile",
1799 "profile, no args to get help",__FILE__,
1802 theCommands.Add("bsplineprof",
1803 "bsplineprof, no args to get help",__FILE__,
1806 theCommands.Add("2dprofile",
1807 "2dprofile, no args to get help",__FILE__,
1810 theCommands.Add("mkoffset",
1811 "mkoffset result face/compound of wires nboffset stepoffset [alt]",__FILE__,
1815 theCommands.Add("mkedge",
1816 "mkedge edge curve [surface] [pfirst plast] [vfirst [pfirst] vlast [plast]] ",__FILE__,
1819 theCommands.Add("mkcurve",
1820 "mkcurve curve edge",__FILE__,
1823 theCommands.Add("mkoricurve",
1824 "mkoricurve curve edge: \n the curve is colored according to the orientation of the edge",
1828 theCommands.Add("mk2dcurve",
1829 "mk2dcurve curve edge [face OR index]",__FILE__,
1832 theCommands.Add("mkpoint",
1833 "mkpoint point vertex",__FILE__,
1836 theCommands.Add("uisoedge",
1837 "uisoedge edge face u v1 v2",__FILE__,
1840 theCommands.Add("edge",
1841 "edge edgename v1 v2",__FILE__,
1844 theCommands.Add("visoedge",
1845 "visoedge edge face v u1 u2",__FILE__,
1848 theCommands.Add("transfert",
1849 "transfert edge1 edge2",__FILE__,
1852 theCommands.Add("pickface",
1853 "pickface",__FILE__,
1856 theCommands.Add("edgeintersector",
1857 "edgeintersector r E1 E2 F [Tol]",__FILE__,
1860 theCommands.Add("build3d",
1864 theCommands.Add("reducepcurves",
1865 "reducepcurves shape1 shape2 ...",
1868 theCommands.Add("concatC0wire",
1869 "concatC0wire result wire",
1874 theCommands.Add("concatwire",
1875 "concatwire result wire [option](G1/C1)",