1 // Created on: 1993-08-12
2 // Created by: Bruno DUMORTIER
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 under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <GeomliteTest.hxx>
18 #include <DrawTrSurf.hxx>
20 #include <Draw_Interpretor.hxx>
21 #include <Draw_Appli.hxx>
22 #include <Draw_Display.hxx>
24 #include <GeomAbs_SurfaceType.hxx>
25 #include <GeomAbs_IsoType.hxx>
26 #include <GeomAbs_Shape.hxx>
28 #include <Geom_Plane.hxx>
29 #include <Geom_CylindricalSurface.hxx>
30 #include <Geom_ConicalSurface.hxx>
31 #include <Geom_SphericalSurface.hxx>
32 #include <Geom_ToroidalSurface.hxx>
33 #include <Geom_BezierSurface.hxx>
34 #include <Geom_BSplineSurface.hxx>
35 #include <Geom_SurfaceOfLinearExtrusion.hxx>
36 #include <Geom_SurfaceOfRevolution.hxx>
37 #include <Geom_RectangularTrimmedSurface.hxx>
38 #include <Geom_OffsetSurface.hxx>
39 #include <Geom_Surface.hxx>
41 #include <Geom_TrimmedCurve.hxx>
42 #include <Geom_OffsetCurve.hxx>
43 #include <Geom_BezierCurve.hxx>
44 #include <Geom_BSplineCurve.hxx>
46 #include <Geom2d_TrimmedCurve.hxx>
47 #include <Geom2d_OffsetCurve.hxx>
49 #include <GeomAdaptor_Surface.hxx>
50 #include <GeomAdaptor_HSurface.hxx>
51 #include <GeomAdaptor_Curve.hxx>
52 #include <Geom2dAdaptor_Curve.hxx>
54 #include <TColGeom_Array2OfBezierSurface.hxx>
55 #include <TColgp_Array1OfPnt.hxx>
56 #include <TColgp_Array2OfPnt.hxx>
57 #include <TColStd_Array1OfReal.hxx>
58 #include <TColStd_Array2OfReal.hxx>
59 #include <TColStd_Array1OfInteger.hxx>
60 #include <TColStd_HArray1OfInteger.hxx>
61 #include <TColStd_HArray1OfReal.hxx>
62 #include <TColStd_HArray2OfReal.hxx>
66 #include <Precision.hxx>
67 #include <Convert_CompBezierCurvesToBSplineCurve.hxx>
68 #include <GeomConvert.hxx>
69 #include <GeomConvert_BSplineCurveToBezierCurve.hxx>
70 #include <GeomConvert_BSplineSurfaceToBezierSurface.hxx>
71 #include <GeomConvert_CompBezierSurfacesToBSplineSurface.hxx>
72 #include <Geom2dConvert.hxx>
73 #include <Geom2dConvert_BSplineCurveToBezierCurve.hxx>
74 #include <GeomLProp_SLProps.hxx>
77 #include <DrawTrSurf_BezierSurface.hxx>
78 #include <DrawTrSurf_BSplineSurface.hxx>
79 #include <GeomConvert_ApproxSurface.hxx>
80 #include <GeomLib_Tool.hxx>
81 #include <TopoDS_Shape.hxx>
83 #include <Geom_Curve.hxx>
87 Standard_IMPORT Draw_Viewer dout;
93 //=======================================================================
94 //function : compute min max radius of curvature on a surface
96 //=======================================================================
97 static Standard_Integer surface_radius (Draw_Interpretor& di,
101 Standard_Integer report_curvature = 0 ;
102 Standard_Real UParameter,VParameter,radius,tolerance = 1.0e-7 ;
105 if (n >= 6) report_curvature = 1 ;
107 UParameter = Draw::Atof(a[2]);
108 VParameter = Draw::Atof(a[3]);
109 Handle(Geom_Surface) SurfacePtr = DrawTrSurf::GetSurface(a[1]);
110 if (!SurfacePtr.IsNull()) {
111 GeomLProp_SLProps myProperties(SurfacePtr,
116 if (myProperties.IsCurvatureDefined()) {
117 radius = myProperties.MinCurvature();
119 if (report_curvature) Draw::Set(a[4],radius);
121 if (Abs(radius) > tolerance) {
122 radius = 1.0e0/ radius ;
123 di << "Min Radius of Curvature : " << radius << "\n";
126 di << "Min Radius of Curvature : infinite\n";
129 radius = myProperties.MaxCurvature();
130 if (report_curvature) Draw::Set(a[5],radius);
131 if (Abs(radius) > tolerance) {
132 radius = 1.0e0/ radius;
133 di << "Max Radius of Curvature : " << radius << "\n";
136 di << "Min Radius of Curvature : infinite\n";
139 di << "Curvature not defined.\n";
149 //=======================================================================
150 //function : anasurface
152 //=======================================================================
154 static Standard_Integer anasurface (Draw_Interpretor& ,
164 loc = gp_Ax3(gp_Pnt(0,0,0),gp_Dir(0,0,1),gp_Dir(1,0,0));
168 loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
169 gp_Dir(0,0,1),gp_Dir(1,0,0));
173 loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
174 gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])));
178 loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
179 gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
180 gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10])));
186 Handle(Geom_Geometry) result;
188 if (!strcasecmp(a[0],"plane")) {
189 Handle(Geom_Plane) C = new Geom_Plane(loc);
193 if (i >= n) return 1;
194 Standard_Real par1 = Draw::Atof(a[i]);
196 if (!strcasecmp(a[0],"cylinder")) {
197 Handle(Geom_CylindricalSurface) C =
198 new Geom_CylindricalSurface(loc,par1);
202 else if (!strcasecmp(a[0],"sphere")) {
203 Handle(Geom_SphericalSurface) C =
204 new Geom_SphericalSurface(loc,par1);
209 if (i+1 >= n) return 1;
210 Standard_Real par2 = Draw::Atof(a[i+1]);
212 if (!strcasecmp(a[0],"cone")) {
213 par1 *= (M_PI / 180.0);
214 Handle(Geom_ConicalSurface) C =
215 new Geom_ConicalSurface(loc,par1,par2);
219 else if (!strcasecmp(a[0],"torus")) {
220 Handle(Geom_ToroidalSurface) C =
221 new Geom_ToroidalSurface(loc,par1,par2);
227 DrawTrSurf::Set(a[1],result);
232 //=======================================================================
233 //function : polesurface
235 //=======================================================================
237 static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, const char** a)
239 Standard_Integer k,j,i;
244 if (!strcasecmp(a[0],"beziersurf")) {
246 Standard_Integer nup = Draw::Atoi(a[2]);
247 Standard_Integer nvp = Draw::Atoi(a[3]);
248 if (nup * nvp == 0) return 1;
250 i = (n - 4) / (nup * nvp);
251 if (i < 3 || i > 4) return 1;
252 Standard_Boolean hasw = i == 4;
254 TColgp_Array2OfPnt poles(1,nup,1,nvp);
255 TColStd_Array2OfReal weights(1,nup,1,nvp);
258 for (j = 1; j <= nvp; j++) {
259 for (i = 1; i <= nup; i++) {
260 poles(i, j).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
263 weights(i, j) = Draw::Atof(a[k]);
269 Handle(Geom_BezierSurface) result;
271 result = new Geom_BezierSurface(poles,weights);
273 result = new Geom_BezierSurface(poles);
275 DrawTrSurf::Set(a[1],result);
279 Standard_Integer udeg = Draw::Atoi(a[2]);
280 Standard_Integer nbuk = Draw::Atoi(a[3]);
282 Standard_Boolean uper = (*a[0] == 'u') || (*(a[0]+1) == 'u');
283 Standard_Boolean vper = (*a[0] == 'v') || (*(a[0]+1) == 'v');
285 TColStd_Array1OfReal uk (1, nbuk);
286 TColStd_Array1OfInteger umult(1, nbuk);
288 Standard_Integer SigmaU = 0;
289 for (i = 1; i<=nbuk; i++) {
290 uk( i) = Draw::Atof(a[k]);
292 umult( i) = Draw::Atoi(a[k]);
297 Standard_Integer vdeg = Draw::Atoi(a[k]);
299 Standard_Integer nbvk = Draw::Atoi(a[k]);
302 TColStd_Array1OfReal vk (1, nbvk);
303 TColStd_Array1OfInteger vmult(1, nbvk);
304 Standard_Integer SigmaV = 0;
305 for (i = 1; i<=nbvk; i++) {
306 vk( i) = Draw::Atof(a[k]);
308 vmult( i) = Draw::Atoi(a[k]);
313 Standard_Integer nup,nvp;
315 nup = SigmaU - umult(nbuk);
317 nup = SigmaU - udeg -1;
319 nvp = SigmaV - vmult(nbvk);
321 nvp = SigmaV - vdeg -1;
322 TColgp_Array2OfPnt poles (1, nup, 1, nvp);
323 TColStd_Array2OfReal weights(1, nup, 1, nvp);
325 for (j = 1; j <= nvp; j++) {
326 for (i = 1; i <= nup; i++) {
327 poles(i, j).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
329 weights(i, j) = Draw::Atof(a[k]);
334 Handle(Geom_BSplineSurface) result =
335 new Geom_BSplineSurface(poles, weights,
341 DrawTrSurf::Set(a[1],result);
347 //=======================================================================
348 //function : algosurface
350 //=======================================================================
352 static Standard_Integer algosurface (Draw_Interpretor& , Standard_Integer n, const char** a)
356 Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[2]);
357 if (GC.IsNull()) return 1;
362 if (!strcasecmp(a[0],"extsurf")) {
363 D.SetCoord(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
364 Handle(Geom_SurfaceOfLinearExtrusion) result =
365 new Geom_SurfaceOfLinearExtrusion(GC,D);
367 DrawTrSurf::Set(a[1],result);
370 else if (!strcasecmp(a[0],"revsurf")) {
372 P.SetCoord(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
373 D.SetCoord(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
375 Handle(Geom_SurfaceOfRevolution) result =
376 new Geom_SurfaceOfRevolution(GC,gp_Ax1(P,D));
378 DrawTrSurf::Set(a[1],result);
388 //=======================================================================
389 //function : trimming
391 //=======================================================================
393 static Standard_Integer trimming (Draw_Interpretor& ,
394 Standard_Integer n, const char** a)
398 Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[2]);
399 Handle(Geom2d_Curve) GC2d = DrawTrSurf::GetCurve2d(a[2]);
400 Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[2]);
404 Handle(Geom_TrimmedCurve) T = Handle(Geom_TrimmedCurve)::DownCast(GC);
405 if (!T.IsNull()) GC = T->BasisCurve();
406 DrawTrSurf::Set(a[1],GC);
408 else if (!GC2d.IsNull()) {
409 Handle(Geom2d_TrimmedCurve) T = Handle(Geom2d_TrimmedCurve)::DownCast(GC2d);
410 if (!T.IsNull()) GC2d = T->BasisCurve();
411 DrawTrSurf::Set(a[1],GC2d);
413 else if (!GS.IsNull()) {
414 Handle(Geom_RectangularTrimmedSurface) T = Handle(Geom_RectangularTrimmedSurface)::DownCast(GS);
415 if (!T.IsNull()) GS = T->BasisSurface();
416 DrawTrSurf::Set(a[1],GS);
423 Standard_Real u1 = Draw::Atof(a[3]);
424 Standard_Real u2 = Draw::Atof(a[4]);
426 Handle(Geom_Geometry) result;
427 Handle(Geom2d_Curve) result2d;
429 if (!strcasecmp(a[0],"trim")) {
433 new Geom_RectangularTrimmedSurface(GS,u1,u2,Draw::Atof(a[5]),Draw::Atof(a[6]));
435 else if (!GC.IsNull()) {
436 result = new Geom_TrimmedCurve(GC, u1, u2);
438 else if (!GC2d.IsNull()) {
439 result2d = new Geom2d_TrimmedCurve(GC2d, u1, u2);
445 if (GS.IsNull()) return 1;
446 result = new Geom_RectangularTrimmedSurface(GS,u1,u2,
447 !strcasecmp(a[0],"trimu"));
450 if (!result.IsNull())
451 DrawTrSurf::Set(a[1], result);
453 DrawTrSurf::Set(a[1],result2d);
458 //=======================================================================
459 //function : converting
461 //=======================================================================
463 static Standard_Integer converting(Draw_Interpretor& , Standard_Integer n, const char ** a)
465 if ( n < 3) return 1;
467 Convert_ParameterisationType
468 Parameterisation = Convert_TgtThetaOver2 ;
469 if (strcmp(a[n-1], "qa") == 0) {
470 Parameterisation = Convert_QuasiAngular ;
472 else if (strcmp(a[n-1], "c1") == 0) {
473 Parameterisation = Convert_RationalC1 ;
475 else if (strcmp (a[n-1], "s1") == 0) {
476 Parameterisation = Convert_TgtThetaOver2_1 ;
478 else if (strcmp (a[n-1], "s2") == 0) {
479 Parameterisation = Convert_TgtThetaOver2_2;
481 else if (strcmp (a[n-1], "s3") == 0) {
482 Parameterisation = Convert_TgtThetaOver2_3 ;
484 else if (strcmp (a[n-1], "s4") == 0) {
485 Parameterisation = Convert_TgtThetaOver2_4 ;
487 else if (strcmp (a[n-1], "po") == 0) {
488 Parameterisation = Convert_Polynomial;
491 Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[2]);
493 Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[2]);
495 Handle(Geom2d_Curve) G2d = DrawTrSurf::GetCurve2d(a[2]);
500 G2d = Geom2dConvert::CurveToBSplineCurve(G2d,
502 DrawTrSurf::Set(a[1], G2d);
506 GS = GeomConvert::SurfaceToBSplineSurface( GS);
507 DrawTrSurf::Set(a[1], GS);
511 GC = GeomConvert::CurveToBSplineCurve( GC,
513 DrawTrSurf::Set(a[1], GC);
520 //=======================================================================
521 //function : tobezier
523 //=======================================================================
525 static Standard_Integer tobezier(Draw_Interpretor& di,
526 Standard_Integer n, const char** a)
528 if ( n < 3) return 1;
529 Standard_Integer i,j,NbU,NbV,NbArc;
530 char* name = new char[100];
532 Handle(Geom2d_BSplineCurve) C2d =
533 DrawTrSurf::GetBSplineCurve2d(a[2]);
535 Handle(Geom_BSplineCurve) C3d =
536 DrawTrSurf::GetBSplineCurve(a[2]);
538 Handle(Geom_BSplineSurface) S =
539 DrawTrSurf::GetBSplineSurface(a[2]);
540 if ( S.IsNull()) return 1;
542 Standard_Real U1, U2, V1, V2;
543 U1 = Draw::Atof(a[3]);
544 U2 = Draw::Atof(a[4]);
545 V1 = Draw::Atof(a[5]);
546 V2 = Draw::Atof(a[6]);
547 GeomConvert_BSplineSurfaceToBezierSurface
548 Conv(S, U1, U2, V1, V2, Precision::PConfusion());
549 NbU = Conv.NbUPatches();
550 NbV = Conv.NbVPatches();
551 di << NbU << " X " << NbV << " patches in the result\n";
552 for (i = 1; i <= NbU; i++) {
553 for (j = 1; j <= NbV; j++) {
554 Sprintf(name,"%s_%i_%i",a[1],i,j);
556 DrawTrSurf::Set(temp,Conv.Patch(i,j));
561 GeomConvert_BSplineSurfaceToBezierSurface Conv(S);
562 NbU = Conv.NbUPatches();
563 NbV = Conv.NbVPatches();
564 di << NbU << " X " << NbV << " patches in the result\n";
565 for (i = 1; i <= NbU; i++) {
566 for (j = 1; j <= NbV; j++) {
567 Sprintf(name,"%s_%i_%i",a[1],i,j);
569 DrawTrSurf::Set(temp,Conv.Patch(i,j));
576 Standard_Real U1, U2;
577 U1 = Draw::Atof(a[3]);
578 U2 = Draw::Atof(a[4]);
579 GeomConvert_BSplineCurveToBezierCurve Conv(C3d, U1, U2,
580 Precision::PConfusion());
581 NbArc = Conv.NbArcs();
582 di << NbArc << " arcs in the result\n";
583 for (i = 1; i <= NbArc; i++) {
584 Sprintf(name,"%s_%i",a[1],i);
586 DrawTrSurf::Set(temp,Conv.Arc(i));
590 GeomConvert_BSplineCurveToBezierCurve Conv(C3d);
591 NbArc = Conv.NbArcs();
592 di << NbArc << " arcs in the result\n";
593 for (i = 1; i <= NbArc; i++) {
594 Sprintf(name,"%s_%i",a[1],i);
596 DrawTrSurf::Set(temp,Conv.Arc(i));
603 Standard_Real U1, U2;
604 U1 = Draw::Atof(a[3]);
605 U2 = Draw::Atof(a[4]);
606 Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d, U1, U2,
607 Precision::PConfusion());
608 NbArc = Conv.NbArcs();
609 di << NbArc << " arcs in the result\n";
610 for (i = 1; i <= NbArc; i++) {
611 Sprintf(name,"%s_%i",a[1],i);
613 DrawTrSurf::Set(temp,Conv.Arc(i));
617 Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d);
618 NbArc = Conv.NbArcs();
619 di << NbArc << " arcs in the result\n";
620 for (i = 1; i <= NbArc; i++) {
621 Sprintf(name,"%s_%i",a[1],i);
623 DrawTrSurf::Set(temp,Conv.Arc(i));
631 //=======================================================================
634 //=======================================================================
636 static Standard_Integer convbz(Draw_Interpretor& di,
637 Standard_Integer n, const char** a)
639 if ( n < 4) return 1;
641 Standard_Integer ii, jj, kk=0, NbU, NbV;
642 Standard_Real Tol = Precision::Confusion();
644 NbU = Draw::Atoi(a[2]);
645 Handle(Geom_Curve) aCurve (Handle(Geom_Curve)::DownCast(DrawTrSurf::Get(a[3])));
646 if (aCurve.IsNull()) {
648 NbV = Draw::Atoi(a[3]);
650 di << "The number of bezier surface have to be " << NbU*NbV << "\n";
653 TColGeom_Array2OfBezierSurface BZ(1, NbU, 1, NbV);
655 for (jj=1; jj<=NbV; jj++)
656 for(ii=1;ii<=NbU; ii++) {
658 Handle(Geom_BezierSurface)::DownCast(DrawTrSurf::Get(a[kk]));
659 if (BZ(ii,jj).IsNull()) {
660 di << "the Surface " << kk <<"is not a BezierSurface\n";
665 if (kk<n) Tol = Draw::Atof(a[kk]);
667 GeomConvert_CompBezierSurfacesToBSplineSurface Conv(BZ, Tol);
669 if (! Conv.IsDone()) {
670 di << "Convert Not Done\n";
674 Handle(Geom_BSplineSurface) BSurf =
675 new Geom_BSplineSurface(Conv.Poles()->Array2(),
676 Conv.UKnots()->Array1(),
677 Conv.VKnots()->Array1(),
678 Conv.UMultiplicities()->Array1(),
679 Conv.VMultiplicities()->Array1(),
683 DrawTrSurf::Set(a[1], BSurf);
685 else { // cas de courbes
686 Convert_CompBezierCurvesToBSplineCurve Conv;
687 Handle(Geom_BezierCurve) BZ;
688 for (ii=1, kk=3; ii<=NbU; ii++,kk++) {
689 BZ = Handle(Geom_BezierCurve)::DownCast(DrawTrSurf::Get(a[kk]));
691 di << "the curve " << kk <<"is not a BezierCurve\n";
694 TColgp_Array1OfPnt Poles(1, BZ->NbPoles());
696 Conv.AddCurve(Poles);
701 TColgp_Array1OfPnt Poles(1, Conv.NbPoles());
703 TColStd_Array1OfInteger Mults(1, Conv.NbKnots());
704 TColStd_Array1OfReal Knots(1, Conv.NbKnots());
705 Conv.KnotsAndMults(Knots, Mults);
706 Handle(Geom_BSplineCurve) BS =
707 new (Geom_BSplineCurve) (Poles, Knots, Mults,
709 DrawTrSurf::Set(a[1], BS);
715 //=======================================================================
716 //function : approxsurf
717 //purpose : Approximation d'une Surface par une BSpline non rationnelle
718 //=======================================================================
721 static Standard_Integer approxsurf(Draw_Interpretor& di, Standard_Integer n, const char** a)
723 // " Tolerance (par defaut 0.1mm) "
724 Standard_Real Tol = 1.e-4;
725 // " Ordres de continuites : 0, 1 ou 2 (par defaut 1)"
726 GeomAbs_Shape myUCont = GeomAbs_C1, myVCont = GeomAbs_C1;
727 // " Degre maximum des carreaux de Bezier 14 par defaut "
728 Standard_Integer degU = 14, degV = 14;
729 // " Nombre max de carreaux (par defaut 10)"
730 Standard_Integer nmax = 16;
731 // "Code de precision par defaults"
732 Standard_Integer myPrec = 1;
734 if ( n>10 || n<3) return 1;
736 if (n>3) Tol = Max(Draw::Atof(a[3]),1.e-10);
741 if (Draw::Atoi(a[4]) == 0) myUCont = GeomAbs_C0;
742 if (Draw::Atoi(a[4]) == 2) myUCont = GeomAbs_C2;
743 if (Draw::Atoi(a[5]) == 0) myVCont = GeomAbs_C0;
744 if (Draw::Atoi(a[5]) == 2) myVCont = GeomAbs_C2;
750 ( degU = (Draw::Atoi(a[6])));
751 ( degV = (Draw::Atoi(a[7])));
752 if ((degU<1) || (degU>24)) degU = 14;
753 if ((degV<1) || (degV>24)) degV = 14;
756 if (n>8) nmax = Draw::Atoi(a[8]);
757 if (n>9) myPrec = Draw::Atoi(a[9]);
759 Handle(Geom_Surface) surf = DrawTrSurf::GetSurface(a[2]);
760 if (surf.IsNull()) return 1;
761 GeomConvert_ApproxSurface myApprox(surf,Tol,myUCont,myVCont,degU,degV,nmax,myPrec);
762 if ( myApprox.HasResult()) DrawTrSurf::Set(a[1], myApprox.Surface());
767 //=======================================================================
768 //function : offseting
770 //=======================================================================
772 static Standard_Integer offseting (Draw_Interpretor& ,
773 Standard_Integer n, const char** a)
777 // test the Geom2d curve
778 Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
780 Handle(Geom2d_OffsetCurve) OC = new Geom2d_OffsetCurve(C2d,Draw::Atof(a[3]));
781 DrawTrSurf::Set(a[1],OC);
785 Standard_Boolean yasurf = Standard_False;
787 Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[2]);
788 Handle(Geom_Surface) GS;
790 GS = DrawTrSurf::GetSurface(a[2]);
793 yasurf = Standard_True;
796 Standard_Real dist = Draw::Atof(a[3]);
798 Handle(Geom_Geometry) result;
801 Handle(Geom_OffsetSurface) GO = new Geom_OffsetSurface(GS,dist);
806 gp_Dir D(Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]));
807 Handle(Geom_OffsetCurve) GT = new Geom_OffsetCurve(GC, dist, D);
811 DrawTrSurf::Set(a[1], result);
815 //=======================================================================
816 //function : sreverse
818 //=======================================================================
820 static Standard_Integer sreverse (Draw_Interpretor& , Standard_Integer n, const char** a)
825 for (i = 1; i < n; i++) {
827 Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[i]);
840 //=======================================================================
843 //=======================================================================
845 static Standard_Integer iso (Draw_Interpretor& , Standard_Integer n, const char** a)
849 Handle(Geom_Curve) C;
850 Standard_Real par = Draw::Atof(a[3]);
851 Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[2]);
857 DrawTrSurf::Set(a[1],C);
864 //=======================================================================
867 //=======================================================================
869 static Standard_Integer value (Draw_Interpretor& ,
870 Standard_Integer n, const char** a)
874 Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[1]);
875 if (GS.IsNull()) return 1;
877 Standard_Real U = Draw::Atof(a[2]);
878 Standard_Real V = Draw::Atof(a[3]);
880 Standard_Boolean DrawPoint = ( n%3 == 2);
888 GS->D2(U,V,P,DU,DV,D2U,D2V,D2UV);
889 Draw::Set(a[13],D2U.X());
890 Draw::Set(a[14],D2U.Y());
891 Draw::Set(a[15],D2U.Z());
892 Draw::Set(a[16],D2V.X());
893 Draw::Set(a[17],D2V.Y());
894 Draw::Set(a[18],D2V.Z());
895 Draw::Set(a[19],D2UV.X());
896 Draw::Set(a[20],D2UV.Y());
897 Draw::Set(a[21],D2UV.Z());
902 Draw::Set(a[7],DU.X());
903 Draw::Set(a[8],DU.Y());
904 Draw::Set(a[9],DU.Z());
905 Draw::Set(a[10],DV.X());
906 Draw::Set(a[11],DV.Y());
907 Draw::Set(a[12],DV.Z());
913 Draw::Set(a[4],P.X());
914 Draw::Set(a[5],P.Y());
915 Draw::Set(a[6],P.Z());
918 DrawTrSurf::Set(a[n],P);
924 //=======================================================================
925 //function : movepole
927 //=======================================================================
929 static Standard_Integer movepole (Draw_Interpretor& , Standard_Integer n, const char** a)
932 Standard_Boolean BSpline = Standard_False;
934 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
935 Handle(Geom_BSplineSurface) GBs;
937 GBs = DrawTrSurf::GetBSplineSurface(a[1]);
942 BSpline = Standard_True;
945 Standard_Real dx = Draw::Atof(a[n-3]);
946 Standard_Real dy = Draw::Atof(a[n-2]);
947 Standard_Real dz = Draw::Atof(a[n-1]);
949 Standard_Integer nup, nvp;
951 nup = GBz->NbUPoles();
952 nvp = GBz->NbVPoles();
955 nup = GBs->NbUPoles();
956 nvp = GBs->NbVPoles();
959 Standard_Integer FirstRow=0, LastRow=0, FirstCol=0, LastCol=0;
960 // Rem : Row = indice ligne. -> variation en U.
961 // Col = indice colonne.-> variation en V.
963 if (!strcasecmp(a[0],"movep")) {
965 FirstRow = Draw::Atoi(a[2]);
966 FirstCol = Draw::Atoi(a[3]);
967 if ( FirstRow < 1 || FirstRow > nup ||
968 FirstCol < 1 || FirstCol > nvp ) return 1;
972 else if (!strcasecmp(a[0],"moverowp")) {
973 FirstRow = Draw::Atoi(a[2]);
974 if ( FirstRow < 1 || FirstRow > nup ) return 1;
979 else if (!strcasecmp(a[0],"movecolp")) {
980 FirstCol = Draw::Atoi(a[2]);
981 if ( FirstCol < 1 || FirstCol > nvp ) return 1;
989 for ( Standard_Integer i = FirstRow; i<= LastRow; i++) {
990 for ( Standard_Integer j = FirstCol; j<= LastCol; j++) {
993 P.SetCoord(P.X()+dx, P.Y()+dy, P.Z()+dz);
998 P.SetCoord(P.X()+dx, P.Y()+dy, P.Z()+dz);
1010 //=======================================================================
1011 //function : movepoint
1013 //=======================================================================
1015 static Standard_Integer movepoint (Draw_Interpretor& , Standard_Integer n, const char** a)
1017 if (n < 7) return 1;
1019 Handle(Geom_BSplineSurface) GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1024 Standard_Real u = Draw::Atof(a[2]);
1025 Standard_Real v = Draw::Atof(a[3]);
1027 Standard_Real dx = Draw::Atof(a[4]);
1028 Standard_Real dy = Draw::Atof(a[5]);
1029 Standard_Real dz = Draw::Atof(a[6]);
1031 Standard_Integer index1u = 0;
1032 Standard_Integer index2u = 0;
1033 Standard_Integer index1v = 0;
1034 Standard_Integer index2v = 0;
1036 Standard_Integer fmodifu, lmodifu, fmodifv, lmodifv;
1038 index1u = Draw::Atoi(a[7]);
1039 index2u = Draw::Atoi(a[8]);
1040 index1v = Draw::Atoi(a[9]);
1041 index2v = Draw::Atoi(a[10]);
1045 index2u = GBs->NbUPoles()-1;
1047 index2v = GBs->NbVPoles()-1;
1052 p.SetCoord(p.X()+dx, p.Y()+dy, p.Z()+dz);
1053 GBs->MovePoint(u, v, p, index1u, index2u, index1v, index2v, fmodifu, lmodifu, fmodifv, lmodifv);
1059 //=======================================================================
1060 //function : insertknot
1062 //=======================================================================
1064 static Standard_Integer insertknot (Draw_Interpretor& , Standard_Integer n, const char** a)
1066 if (n < 3) return 1;
1068 Handle(Geom_BSplineSurface) GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1070 if (GBs.IsNull()) return 1;
1072 Standard_Real knot=0;
1073 Standard_Integer mult = 0;
1074 Standard_Integer index=0;
1075 if ( !strcasecmp(a[0],"insertuknot") ||
1076 !strcasecmp(a[0],"insertvknot") ) {
1078 knot = Draw::Atof(a[2]);
1079 mult = Draw::Atoi(a[3]);
1081 else if ( !strcasecmp(a[0],"remuknot") ||
1082 !strcasecmp(a[0],"remvknot") ) {
1083 index = Draw::Atoi(a[2]);
1084 if (n>=4) mult = Draw::Atoi(a[3]);
1087 Standard_Real tol = RealLast();
1089 if (!strcasecmp(a[0],"insertuknot")) {
1090 GBs->InsertUKnot(knot,mult,Precision::PConfusion());
1092 else if (!strcasecmp(a[0],"insertvknot")) {
1093 GBs->InsertVKnot(knot,mult,Precision::PConfusion());
1095 else if (!strcasecmp(a[0],"remuknot")) {
1096 if (n>=5) tol = Draw::Atof(a[4]);
1097 if (!GBs->RemoveUKnot(index,mult,tol))
1100 else if (!strcasecmp(a[0],"remvknot")) {
1101 if (n>=5) tol = Draw::Atof(a[4]);
1102 if (!GBs->RemoveVKnot(index,mult,tol))
1110 //=======================================================================
1111 //function : incdegree
1113 //=======================================================================
1115 static Standard_Integer incdegree (Draw_Interpretor& di, Standard_Integer n, const char** a)
1117 if (n < 3) return 1;
1119 Standard_Integer NewDeg = Draw::Atoi(a[2]);
1120 Standard_Boolean BSpline = Standard_False;
1122 Standard_Integer UDeg=0, VDeg=0;
1124 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
1125 Handle(Geom_BSplineSurface) GBs;
1128 GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1131 BSpline = Standard_True;
1134 Standard_Integer Degree=0;
1135 if ( !strcasecmp(a[0],"incudeg")) {
1138 Degree = GBs->UDegree();
1139 VDeg = GBs->VDegree();
1142 Degree = GBz->UDegree();
1143 VDeg = GBz->VDegree();
1146 else if ( !strcasecmp(a[0],"incvdeg")) {
1149 Degree = GBs->VDegree();
1150 UDeg = GBs->UDegree();
1153 Degree = GBz->VDegree();
1154 UDeg = GBz->UDegree();
1158 if (Degree > NewDeg) {
1159 di<<"The Degree must be greater than " << Degree <<"\n";
1164 GBs->IncreaseDegree(UDeg, VDeg);
1167 GBz->Increase(UDeg, VDeg);
1174 //=======================================================================
1175 //function : rempole
1177 //=======================================================================
1179 static Standard_Integer rempole (Draw_Interpretor& di, Standard_Integer n, const char** a)
1181 if (n < 3) return 1;
1183 Standard_Integer NewIndex = Draw::Atoi(a[2]);
1184 Standard_Boolean BSpline = Standard_False;
1186 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
1187 Handle(Geom_BSplineSurface) GBs;
1190 GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1193 BSpline = Standard_True;
1196 if ( !strcasecmp(a[0],"remrowpole")) {
1198 di << " Error : Cannot remove a polerow on a BSplineSurface \n";
1201 GBz->RemovePoleRow(NewIndex);
1204 else if ( !strcasecmp(a[0],"remcolpole")) {
1206 di << " Error : Cannot remove a polecol on a BSplineSurface \n";
1209 GBz->RemovePoleCol(NewIndex);
1217 //=======================================================================
1220 //=======================================================================
1222 static Standard_Integer sfindp (Draw_Interpretor& , Standard_Integer n, const char** a)
1224 if (n < 7) return 1;
1225 Standard_Boolean BSpline = Standard_False;
1227 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
1228 Handle(Geom_BSplineSurface) GBs;
1230 GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1235 BSpline = Standard_True;
1238 Standard_Integer UIndex = 0;
1239 Standard_Integer VIndex = 0;
1240 Standard_Integer view = Draw::Atoi(a[2]);
1241 Standard_Real x = Draw::Atof(a[3]);
1242 Standard_Real y = Draw::Atof(a[4]);
1244 Draw_Display d = dout.MakeDisplay(view);
1247 Handle(DrawTrSurf_BezierSurface) DBz =
1248 new DrawTrSurf_BezierSurface(GBz);
1249 DBz->FindPole( x, y, d, 5, UIndex,VIndex);
1252 Handle(DrawTrSurf_BSplineSurface) DBs =
1253 new DrawTrSurf_BSplineSurface(GBs);
1254 DBs->FindPole( x, y, d, 5, UIndex,VIndex);
1257 Draw::Set(a[5],UIndex);
1258 Draw::Set(a[6],VIndex);
1264 //=======================================================================
1265 //function : ssetperiodic
1267 //=======================================================================
1269 static Standard_Integer ssetperiodic (Draw_Interpretor& , Standard_Integer n, const char** a)
1271 if (n < 2) return 1;
1275 if (!strcasecmp(a[0],"setuperiodic")) {
1276 for (i = 1; i < n; i++) {
1277 Handle(Geom_BSplineSurface)
1278 GBs = DrawTrSurf::GetBSplineSurface(a[i]);
1279 if (!GBs.IsNull()) {
1280 GBs->SetUPeriodic();
1285 else if (!strcasecmp(a[0],"setvperiodic")){
1286 for (i = 1; i < n; i++) {
1287 Handle(Geom_BSplineSurface)
1288 GBs = DrawTrSurf::GetBSplineSurface(a[i]);
1289 if (!GBs.IsNull()) {
1290 GBs->SetVPeriodic();
1295 else if (!strcasecmp(a[0],"setunotperiodic")){
1296 for (i = 1; i < n; i++) {
1297 Handle(Geom_BSplineSurface)
1298 GBs = DrawTrSurf::GetBSplineSurface(a[i]);
1299 if (!GBs.IsNull()) {
1300 GBs->SetUNotPeriodic();
1305 else if (!strcasecmp(a[0],"setvnotperiodic")){
1306 for (i = 1; i < n; i++) {
1307 Handle(Geom_BSplineSurface)
1308 GBs = DrawTrSurf::GetBSplineSurface(a[i]);
1309 if (!GBs.IsNull()) {
1310 GBs->SetVNotPeriodic();
1318 //=======================================================================
1321 //=======================================================================
1323 static Standard_Integer exchuv (Draw_Interpretor& , Standard_Integer n, const char** a)
1325 if (n < 2) return 1;
1328 for (i = 1; i < n; i++) {
1330 Handle(Geom_BSplineSurface) GBs = DrawTrSurf::GetBSplineSurface(a[i]);
1331 if (!GBs.IsNull()) {
1336 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[i]);
1337 if (!GBz.IsNull()) {
1347 //=======================================================================
1350 //=======================================================================
1352 static Standard_Integer segsur (Draw_Interpretor& , Standard_Integer n, const char** a)
1354 if (n < 6 || n > 8) return 1;
1356 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
1357 Handle(Geom_BSplineSurface) GBs;
1359 GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1363 Standard_Real aUTolerance = Precision::PConfusion();
1364 Standard_Real aVTolerance = Precision::PConfusion();
1366 aUTolerance = aVTolerance = Draw::Atof(a[6]);
1368 aVTolerance = Draw::Atof(a[7]);
1370 GBs->Segment(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]), aUTolerance, aVTolerance);
1373 GBz->Segment(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
1380 static Standard_Integer compBsplSur (Draw_Interpretor& , Standard_Integer n, const char** a)
1384 std::cout<<"Invalid number of parameters"<<std::endl;
1388 Handle(Geom_BSplineSurface) GBs1 = DrawTrSurf::GetBSplineSurface(a[1]);
1389 Handle(Geom_BSplineSurface) GBs2 = DrawTrSurf::GetBSplineSurface(a[2]);
1390 if (GBs1.IsNull() || GBs2.IsNull()) {
1391 std::cout<<"Invalid surface"<<std::endl;
1395 Standard_Real aU11,aU12,aV11,aV12;
1396 GBs1->Bounds(aU11,aU12,aV11,aV12);
1398 Standard_Real aU21,aU22,aV21,aV22;
1399 GBs2->Bounds(aU21,aU22,aV21,aV22);
1401 Standard_Real aUmin = Max(aU11,aU21);
1402 Standard_Real aUmax = Min(aU12,aU22);
1404 Standard_Real aVmin = Max(aV11,aV21);
1405 Standard_Real aVmax = Min(aV12,aV22);
1407 Standard_Integer nbP = 100;
1408 Standard_Real aStepU = (aUmax - aUmin)/nbP;
1409 Standard_Real aStepV = (aVmax - aVmin)/nbP;
1410 Standard_Integer nbErr =0;
1411 Standard_Integer i =1;
1412 for( ; i <= nbP +1; i++)
1414 Standard_Real aU = aUmin + aStepU*(i-1);
1415 Standard_Integer j =1;
1416 for( ; j <= nbP +1; j++)
1418 Standard_Real aV = aVmin + aStepV*(j-1);
1419 gp_Pnt aP1 = GBs1->Value(aU,aV);
1420 gp_Pnt aP2 = GBs2->Value(aU,aV);
1421 Standard_Real aDist = aP1.SquareDistance(aP2);
1422 if(aDist > Precision::SquareConfusion())
1425 Standard_Real aD = sqrt(aDist);
1426 std::cout<<"Surfaces differ for U,V,Dist: "<<aU<<" "<<aV<<" "<<aD<<std::endl;
1436 //=======================================================================
1437 //function : setuvorigin
1439 //=======================================================================
1441 static Standard_Integer setuvorigin (Draw_Interpretor& , Standard_Integer n, const char** a)
1443 if (n < 3) return 1;
1445 Handle(Geom_BSplineSurface) GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1448 if ( !strcasecmp(a[0],"setuorigin")) {
1449 GBs->SetUOrigin(Draw::Atoi(a[2]));
1451 else if ( !strcasecmp(a[0],"setvorigin")) {
1452 GBs->SetVOrigin(Draw::Atoi(a[2]));
1462 //=======================================================================
1463 //function : parameters
1465 //=======================================================================
1467 static Standard_Integer parameters (Draw_Interpretor& di, Standard_Integer n, const char** a)
1471 // try to find parameters on a Surface
1472 Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[1]);
1473 if( S.IsNull() ) { di << "Unknown surface\n"; return 1; }
1474 gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
1475 Standard_Real Tol = Draw::Atof(a[5]), U = 0., V = 0.;
1476 Standard_Boolean res = GeomLib_Tool::Parameters(S,P,Tol,U,V);
1481 if( !res ) { di << "Wrong point\n"; return 1; }
1485 // try to find parameters on a 3d Curve
1486 Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[1]);
1487 if( C.IsNull() ) { di << "Unknown curve\n"; return 1; }
1488 gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
1489 Standard_Real Tol = Draw::Atof(a[5]), U = 0.;
1490 Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
1494 if( !res ) { di << "Wrong point\n"; return 1; }
1498 // try to find parameters on a 2d Curve
1499 Handle(Geom2d_Curve) C = DrawTrSurf::GetCurve2d(a[1]);
1500 if( C.IsNull() ) { di << "Unknown curve 2d\n"; return 1; }
1501 gp_Pnt2d P(Draw::Atof(a[2]), Draw::Atof(a[3]));
1502 Standard_Real Tol = Draw::Atof(a[4]), U = 0.;
1503 Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
1507 if( !res ) { di << "Wrong point\n"; return 1; }
1511 di << "Invalid parameters!\n";
1513 di << "parameters Surf X Y Z Tol U V\n";
1514 di << "parameters Curv X Y Z Tol U\n";
1515 di << "parameters Curv2d X Y Tol U\n";
1523 //=======================================================================
1526 //=======================================================================
1528 Standard_Integer bounds(Draw_Interpretor&, Standard_Integer n, const char** a)
1530 Standard_Real U1, U2, V1, V2;
1531 if ( n == 4) { // compute on a curve or a 2d curve
1532 Handle(Geom_Curve) C3d = DrawTrSurf::GetCurve(a[1]);
1533 if ( C3d.IsNull()) { // 2dcurve
1534 Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[1]);
1535 if ( C2d.IsNull()) return 1;
1536 U1 = C2d->FirstParameter();
1537 U2 = C2d->LastParameter();
1540 U1 = C3d->FirstParameter();
1541 U2 = C3d->LastParameter();
1546 else if ( n == 6) { // compute on a Surface
1547 Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[1]);
1548 if ( S.IsNull()) return 1;
1549 S->Bounds(U1,U2,V1,V2);
1560 //=======================================================================
1561 //function : SurfaceCommands
1563 //=======================================================================
1566 void GeomliteTest::SurfaceCommands(Draw_Interpretor& theCommands)
1568 static Standard_Boolean loaded = Standard_False;
1570 loaded = Standard_True;
1572 DrawTrSurf::BasicCommands(theCommands);
1575 // analytic surfaces
1576 g = "GEOMETRY surfaces creation";
1578 theCommands.Add("plane",
1579 "plane name [x y z [dx dy dz [ux uy uz]]]",
1583 theCommands.Add("cone",
1584 "cone name [x y z [dx dy dz [ux uy uz]]] semi-angle radius",
1588 theCommands.Add("cylinder",
1589 "cylinder name [x y z [dx dy dz [ux uy uz]]] radius",
1593 theCommands.Add("sphere",
1594 "sphere name [x y z [dx dy dz [ux uy uz]]] radius",
1598 theCommands.Add("torus",
1599 "torus name [x y z [dx dy dz [ux uy uz]]] major minor",
1603 theCommands.Add("beziersurf",
1604 "beziersurf name nbupoles nbvpoles pole, [weight]",
1608 theCommands.Add("bsplinesurf",
1609 "bsplinesurf name udegree nbuknots uknot, umult vdegree nbvknots vknot, vmult pole, weight",
1613 theCommands.Add("upbsplinesurf",
1614 "bsplinesurf name udegree nbuknots uknot, umult vdegree nbvknots vknot, vmult pole, weight",
1618 theCommands.Add("vpbsplinesurf",
1619 "bsplinesurf name udegree nbuknots uknot, umult vdegree nbvknots vknot, vmult pole, weight",
1623 theCommands.Add("uvpbsplinesurf",
1624 "bsplinesurf name udegree nbuknots uknot, umult vdegree nbvknots vknot, vmult pole, weight",
1628 theCommands.Add("extsurf",
1629 "extsurf name curvename dx dy dz",
1633 theCommands.Add("revsurf",
1634 "revsurf name curvename x y z dx dy dz",
1638 theCommands.Add("offset",
1639 "offset name basename distance [dx dy dz]",
1643 theCommands.Add("trim",
1644 "trim newname name [u1 u2 [v1 v2]], no args remove trim",
1648 theCommands.Add("trimu",
1649 "trim newname name u1 u2",
1653 theCommands.Add("trimv",
1654 "trim newname name v1 v2",
1658 theCommands.Add("convert",
1659 "convert result c2d/c3d/surf [qa,c1,s1,s2,s3,s4,po]",
1663 theCommands.Add("tobezier",
1664 "tobezier result c2d/c3d/surf [ufirst, ulast / ufirst, ulast, vfirst, vlast]",
1668 theCommands.Add("convertfrombezier",
1669 "convertfrombezier result nbu [nbv] bz1 [bz2 .... bzn] [tol]",
1673 theCommands.Add("approxsurf",
1674 "approxsurf name surf [Tol [CnU CnV [degU degV [nmax]]]] ",
1678 g = "GEOMETRY Curves and Surfaces modification";
1680 theCommands.Add("ureverse",
1681 "ureverse name ... ",
1685 theCommands.Add("vreverse",
1686 "vreverse name ... ",
1690 theCommands.Add("movep",
1691 "movep name row col dx dy dz",
1695 theCommands.Add("moverowp",
1696 "moverowp name row dx dy dz",
1700 theCommands.Add("movecolp",
1701 "movecolp name col dx dy dz",
1705 theCommands.Add("movepoint",
1706 "movepoint name u v dx dy dz [index1u index2u index2v index2v",
1710 theCommands.Add("insertuknot",
1711 "insertuknot name knot mult",
1715 theCommands.Add("insertvknot",
1716 "insertvknot name knot mult",
1720 theCommands.Add("remuknot",
1721 "remuknot name index [mult] [tol]",
1725 theCommands.Add("remvknot",
1726 "remvknot name index [mult] [tol]",
1730 theCommands.Add("incudeg",
1731 "incudeg name degree",
1735 theCommands.Add("incvdeg",
1736 "incvdeg name degree",
1740 theCommands.Add("remrowpole",
1741 "remrowpole name index",
1745 theCommands.Add("remcolpole",
1746 "remcolpole name index",
1750 theCommands.Add("sfindp",
1751 "sfindp name view x y Uindex Vindex",
1755 theCommands.Add("setuperiodic",
1756 "setuperiodic name ...",
1760 theCommands.Add("setvperiodic",
1761 "setvperiodic name ...",
1765 theCommands.Add("setunotperiodic",
1766 "setunotperiodic name ...",
1770 theCommands.Add("setvnotperiodic",
1771 "setvnotperiodic name ...",
1775 theCommands.Add("exchuv",
1780 theCommands.Add("segsur",
1781 "segsur name Ufirst Ulast Vfirst Vlast [Utol [Vtol]]",
1785 theCommands.Add("setuorigin",
1786 "setuorigin name knotindex",
1790 theCommands.Add("setvorigin",
1791 "setvorigin name knotindex",
1795 g = "GEOMETRY curves creation";
1798 theCommands.Add("uiso",
1799 "uiso curvename surfacename u",
1803 theCommands.Add("viso",
1804 "viso curvename surfacename v",
1809 g = "GEOMETRY curves and surfaces analysis";
1811 theCommands.Add("svalue",
1812 "svalue surfname U V X Y Z [DUX DUY DUZ DVX DVY DVZ [D2UX D2UY D2UZ D2VX D2VY D2VZ D2UVX D2UVY D2UVZ]]",
1816 theCommands.Add("parameters",
1817 "parameters surf/curve X Y [Z] Tol U [V] : {X Y Z} point, {U V} output parameter(s)",
1821 theCommands.Add("bounds",
1822 "bounds S/C/C2d U1 U2 [V1 V2]",
1826 theCommands.Add("surface_radius",
1827 "surface_radius surface Uvalue <Real> Vvalue <Real> returns min max radius of curvature",
1830 theCommands.Add("compBsplSur","BsplSurf1 BSplSurf2",__FILE__,compBsplSur,g);