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>
84 #include <Message.hxx>
88 Standard_IMPORT Draw_Viewer dout;
94 //=======================================================================
95 //function : compute min max radius of curvature on a surface
97 //=======================================================================
98 static Standard_Integer surface_radius (Draw_Interpretor& di,
102 Standard_Integer report_curvature = 0 ;
103 Standard_Real UParameter,VParameter,radius,tolerance = 1.0e-7 ;
106 if (n >= 6) report_curvature = 1 ;
108 UParameter = Draw::Atof(a[2]);
109 VParameter = Draw::Atof(a[3]);
110 Handle(Geom_Surface) SurfacePtr = DrawTrSurf::GetSurface(a[1]);
111 if (!SurfacePtr.IsNull()) {
112 GeomLProp_SLProps myProperties(SurfacePtr,
117 if (myProperties.IsCurvatureDefined()) {
118 radius = myProperties.MinCurvature();
120 if (report_curvature) Draw::Set(a[4],radius);
122 if (Abs(radius) > tolerance) {
123 radius = 1.0e0/ radius ;
124 di << "Min Radius of Curvature : " << radius << "\n";
127 di << "Min Radius of Curvature : infinite\n";
130 radius = myProperties.MaxCurvature();
131 if (report_curvature) Draw::Set(a[5],radius);
132 if (Abs(radius) > tolerance) {
133 radius = 1.0e0/ radius;
134 di << "Max Radius of Curvature : " << radius << "\n";
137 di << "Min Radius of Curvature : infinite\n";
140 di << "Curvature not defined.\n";
150 //=======================================================================
151 //function : anasurface
153 //=======================================================================
155 static Standard_Integer anasurface (Draw_Interpretor& ,
165 loc = gp_Ax3(gp_Pnt(0,0,0),gp_Dir(0,0,1),gp_Dir(1,0,0));
169 loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
170 gp_Dir(0,0,1),gp_Dir(1,0,0));
174 loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
175 gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])));
179 loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
180 gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
181 gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10])));
187 Handle(Geom_Geometry) result;
189 if (!strcasecmp(a[0],"plane")) {
190 Handle(Geom_Plane) C = new Geom_Plane(loc);
194 if (i >= n) return 1;
195 Standard_Real par1 = Draw::Atof(a[i]);
197 if (!strcasecmp(a[0],"cylinder")) {
198 Handle(Geom_CylindricalSurface) C =
199 new Geom_CylindricalSurface(loc,par1);
203 else if (!strcasecmp(a[0],"sphere")) {
204 Handle(Geom_SphericalSurface) C =
205 new Geom_SphericalSurface(loc,par1);
210 if (i+1 >= n) return 1;
211 Standard_Real par2 = Draw::Atof(a[i+1]);
213 if (!strcasecmp(a[0],"cone")) {
214 par1 *= (M_PI / 180.0);
215 Handle(Geom_ConicalSurface) C =
216 new Geom_ConicalSurface(loc,par1,par2);
220 else if (!strcasecmp(a[0],"torus")) {
221 Handle(Geom_ToroidalSurface) C =
222 new Geom_ToroidalSurface(loc,par1,par2);
228 DrawTrSurf::Set(a[1],result);
233 //=======================================================================
234 //function : polesurface
236 //=======================================================================
238 static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, const char** a)
240 Standard_Integer k,j,i;
245 if (!strcasecmp(a[0],"beziersurf")) {
247 Standard_Integer nup = Draw::Atoi(a[2]);
248 Standard_Integer nvp = Draw::Atoi(a[3]);
249 if (nup * nvp == 0) return 1;
251 i = (n - 4) / (nup * nvp);
252 if (i < 3 || i > 4) return 1;
253 Standard_Boolean hasw = i == 4;
255 TColgp_Array2OfPnt poles(1,nup,1,nvp);
256 TColStd_Array2OfReal weights(1,nup,1,nvp);
259 for (j = 1; j <= nvp; j++) {
260 for (i = 1; i <= nup; i++) {
261 poles(i, j).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
264 weights(i, j) = Draw::Atof(a[k]);
270 Handle(Geom_BezierSurface) result;
272 result = new Geom_BezierSurface(poles,weights);
274 result = new Geom_BezierSurface(poles);
276 DrawTrSurf::Set(a[1],result);
280 Standard_Integer udeg = Draw::Atoi(a[2]);
281 Standard_Integer nbuk = Draw::Atoi(a[3]);
283 Standard_Boolean uper = (*a[0] == 'u') || (*(a[0]+1) == 'u');
284 Standard_Boolean vper = (*a[0] == 'v') || (*(a[0]+1) == 'v');
286 TColStd_Array1OfReal uk (1, nbuk);
287 TColStd_Array1OfInteger umult(1, nbuk);
289 Standard_Integer SigmaU = 0;
290 for (i = 1; i<=nbuk; i++) {
291 uk( i) = Draw::Atof(a[k]);
293 umult( i) = Draw::Atoi(a[k]);
298 Standard_Integer vdeg = Draw::Atoi(a[k]);
300 Standard_Integer nbvk = Draw::Atoi(a[k]);
303 TColStd_Array1OfReal vk (1, nbvk);
304 TColStd_Array1OfInteger vmult(1, nbvk);
305 Standard_Integer SigmaV = 0;
306 for (i = 1; i<=nbvk; i++) {
307 vk( i) = Draw::Atof(a[k]);
309 vmult( i) = Draw::Atoi(a[k]);
314 Standard_Integer nup,nvp;
316 nup = SigmaU - umult(nbuk);
318 nup = SigmaU - udeg -1;
320 nvp = SigmaV - vmult(nbvk);
322 nvp = SigmaV - vdeg -1;
323 TColgp_Array2OfPnt poles (1, nup, 1, nvp);
324 TColStd_Array2OfReal weights(1, nup, 1, nvp);
326 for (j = 1; j <= nvp; j++) {
327 for (i = 1; i <= nup; i++) {
328 poles(i, j).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
330 weights(i, j) = Draw::Atof(a[k]);
335 Handle(Geom_BSplineSurface) result =
336 new Geom_BSplineSurface(poles, weights,
342 DrawTrSurf::Set(a[1],result);
348 //=======================================================================
349 //function : algosurface
351 //=======================================================================
353 static Standard_Integer algosurface (Draw_Interpretor& , Standard_Integer n, const char** a)
357 Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[2]);
358 if (GC.IsNull()) return 1;
363 if (!strcasecmp(a[0],"extsurf")) {
364 D.SetCoord(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
365 Handle(Geom_SurfaceOfLinearExtrusion) result =
366 new Geom_SurfaceOfLinearExtrusion(GC,D);
368 DrawTrSurf::Set(a[1],result);
371 else if (!strcasecmp(a[0],"revsurf")) {
373 P.SetCoord(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
374 D.SetCoord(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
376 Handle(Geom_SurfaceOfRevolution) result =
377 new Geom_SurfaceOfRevolution(GC,gp_Ax1(P,D));
379 DrawTrSurf::Set(a[1],result);
389 //=======================================================================
390 //function : trimming
392 //=======================================================================
394 static Standard_Integer trimming (Draw_Interpretor& ,
395 Standard_Integer n, const char** a)
399 Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[2]);
400 Handle(Geom2d_Curve) GC2d = DrawTrSurf::GetCurve2d(a[2]);
401 Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[2]);
405 Handle(Geom_TrimmedCurve) T = Handle(Geom_TrimmedCurve)::DownCast(GC);
406 if (!T.IsNull()) GC = T->BasisCurve();
407 DrawTrSurf::Set(a[1],GC);
409 else if (!GC2d.IsNull()) {
410 Handle(Geom2d_TrimmedCurve) T = Handle(Geom2d_TrimmedCurve)::DownCast(GC2d);
411 if (!T.IsNull()) GC2d = T->BasisCurve();
412 DrawTrSurf::Set(a[1],GC2d);
414 else if (!GS.IsNull()) {
415 Handle(Geom_RectangularTrimmedSurface) T = Handle(Geom_RectangularTrimmedSurface)::DownCast(GS);
416 if (!T.IsNull()) GS = T->BasisSurface();
417 DrawTrSurf::Set(a[1],GS);
424 Standard_Real u1 = Draw::Atof(a[3]);
425 Standard_Real u2 = Draw::Atof(a[4]);
427 Handle(Geom_Geometry) result;
428 Handle(Geom2d_Curve) result2d;
430 if (!strcasecmp(a[0],"trim")) {
434 new Geom_RectangularTrimmedSurface(GS,u1,u2,Draw::Atof(a[5]),Draw::Atof(a[6]));
436 else if (!GC.IsNull()) {
437 result = new Geom_TrimmedCurve(GC, u1, u2);
439 else if (!GC2d.IsNull()) {
440 result2d = new Geom2d_TrimmedCurve(GC2d, u1, u2);
446 if (GS.IsNull()) return 1;
447 result = new Geom_RectangularTrimmedSurface(GS,u1,u2,
448 !strcasecmp(a[0],"trimu"));
451 if (!result.IsNull())
452 DrawTrSurf::Set(a[1], result);
454 DrawTrSurf::Set(a[1],result2d);
459 //=======================================================================
460 //function : converting
462 //=======================================================================
464 static Standard_Integer converting(Draw_Interpretor& , Standard_Integer n, const char ** a)
466 if ( n < 3) return 1;
468 Convert_ParameterisationType
469 Parameterisation = Convert_TgtThetaOver2 ;
470 if (strcmp(a[n-1], "qa") == 0) {
471 Parameterisation = Convert_QuasiAngular ;
473 else if (strcmp(a[n-1], "c1") == 0) {
474 Parameterisation = Convert_RationalC1 ;
476 else if (strcmp (a[n-1], "s1") == 0) {
477 Parameterisation = Convert_TgtThetaOver2_1 ;
479 else if (strcmp (a[n-1], "s2") == 0) {
480 Parameterisation = Convert_TgtThetaOver2_2;
482 else if (strcmp (a[n-1], "s3") == 0) {
483 Parameterisation = Convert_TgtThetaOver2_3 ;
485 else if (strcmp (a[n-1], "s4") == 0) {
486 Parameterisation = Convert_TgtThetaOver2_4 ;
488 else if (strcmp (a[n-1], "po") == 0) {
489 Parameterisation = Convert_Polynomial;
492 Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[2]);
494 Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[2]);
496 Handle(Geom2d_Curve) G2d = DrawTrSurf::GetCurve2d(a[2]);
501 G2d = Geom2dConvert::CurveToBSplineCurve(G2d,
503 DrawTrSurf::Set(a[1], G2d);
507 GS = GeomConvert::SurfaceToBSplineSurface( GS);
508 DrawTrSurf::Set(a[1], GS);
512 GC = GeomConvert::CurveToBSplineCurve( GC,
514 DrawTrSurf::Set(a[1], GC);
521 //=======================================================================
522 //function : tobezier
524 //=======================================================================
526 static Standard_Integer tobezier(Draw_Interpretor& di,
527 Standard_Integer n, const char** a)
529 if ( n < 3) return 1;
530 Standard_Integer i,j,NbU,NbV,NbArc;
531 char* name = new char[100];
533 Handle(Geom2d_BSplineCurve) C2d =
534 DrawTrSurf::GetBSplineCurve2d(a[2]);
536 Handle(Geom_BSplineCurve) C3d =
537 DrawTrSurf::GetBSplineCurve(a[2]);
539 Handle(Geom_BSplineSurface) S =
540 DrawTrSurf::GetBSplineSurface(a[2]);
541 if ( S.IsNull()) return 1;
543 Standard_Real U1, U2, V1, V2;
544 U1 = Draw::Atof(a[3]);
545 U2 = Draw::Atof(a[4]);
546 V1 = Draw::Atof(a[5]);
547 V2 = Draw::Atof(a[6]);
548 GeomConvert_BSplineSurfaceToBezierSurface
549 Conv(S, U1, U2, V1, V2, Precision::PConfusion());
550 NbU = Conv.NbUPatches();
551 NbV = Conv.NbVPatches();
552 di << NbU << " X " << NbV << " patches in the result\n";
553 for (i = 1; i <= NbU; i++) {
554 for (j = 1; j <= NbV; j++) {
555 Sprintf(name,"%s_%i_%i",a[1],i,j);
557 DrawTrSurf::Set(temp,Conv.Patch(i,j));
562 GeomConvert_BSplineSurfaceToBezierSurface Conv(S);
563 NbU = Conv.NbUPatches();
564 NbV = Conv.NbVPatches();
565 di << NbU << " X " << NbV << " patches in the result\n";
566 for (i = 1; i <= NbU; i++) {
567 for (j = 1; j <= NbV; j++) {
568 Sprintf(name,"%s_%i_%i",a[1],i,j);
570 DrawTrSurf::Set(temp,Conv.Patch(i,j));
577 Standard_Real U1, U2;
578 U1 = Draw::Atof(a[3]);
579 U2 = Draw::Atof(a[4]);
580 GeomConvert_BSplineCurveToBezierCurve Conv(C3d, U1, U2,
581 Precision::PConfusion());
582 NbArc = Conv.NbArcs();
583 di << NbArc << " arcs in the result\n";
584 for (i = 1; i <= NbArc; i++) {
585 Sprintf(name,"%s_%i",a[1],i);
587 DrawTrSurf::Set(temp,Conv.Arc(i));
591 GeomConvert_BSplineCurveToBezierCurve Conv(C3d);
592 NbArc = Conv.NbArcs();
593 di << NbArc << " arcs in the result\n";
594 for (i = 1; i <= NbArc; i++) {
595 Sprintf(name,"%s_%i",a[1],i);
597 DrawTrSurf::Set(temp,Conv.Arc(i));
604 Standard_Real U1, U2;
605 U1 = Draw::Atof(a[3]);
606 U2 = Draw::Atof(a[4]);
607 Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d, U1, U2,
608 Precision::PConfusion());
609 NbArc = Conv.NbArcs();
610 di << NbArc << " arcs in the result\n";
611 for (i = 1; i <= NbArc; i++) {
612 Sprintf(name,"%s_%i",a[1],i);
614 DrawTrSurf::Set(temp,Conv.Arc(i));
618 Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d);
619 NbArc = Conv.NbArcs();
620 di << NbArc << " arcs in the result\n";
621 for (i = 1; i <= NbArc; i++) {
622 Sprintf(name,"%s_%i",a[1],i);
624 DrawTrSurf::Set(temp,Conv.Arc(i));
632 //=======================================================================
635 //=======================================================================
637 static Standard_Integer convbz(Draw_Interpretor& di,
638 Standard_Integer n, const char** a)
640 if ( n < 4) return 1;
642 Standard_Integer ii, jj, kk=0, NbU, NbV;
643 Standard_Real Tol = Precision::Confusion();
645 NbU = Draw::Atoi(a[2]);
646 Handle(Geom_Curve) aCurve (Handle(Geom_Curve)::DownCast(DrawTrSurf::Get(a[3])));
647 if (aCurve.IsNull()) {
649 NbV = Draw::Atoi(a[3]);
651 di << "The number of bezier surface have to be " << NbU*NbV << "\n";
654 TColGeom_Array2OfBezierSurface BZ(1, NbU, 1, NbV);
656 for (jj=1; jj<=NbV; jj++)
657 for(ii=1;ii<=NbU; ii++) {
659 Handle(Geom_BezierSurface)::DownCast(DrawTrSurf::Get(a[kk]));
660 if (BZ(ii,jj).IsNull()) {
661 di << "the Surface " << kk <<"is not a BezierSurface\n";
666 if (kk<n) Tol = Draw::Atof(a[kk]);
668 GeomConvert_CompBezierSurfacesToBSplineSurface Conv(BZ, Tol);
670 if (! Conv.IsDone()) {
671 di << "Convert Not Done\n";
675 Handle(Geom_BSplineSurface) BSurf =
676 new Geom_BSplineSurface(Conv.Poles()->Array2(),
677 Conv.UKnots()->Array1(),
678 Conv.VKnots()->Array1(),
679 Conv.UMultiplicities()->Array1(),
680 Conv.VMultiplicities()->Array1(),
684 DrawTrSurf::Set(a[1], BSurf);
686 else { // cas de courbes
687 Convert_CompBezierCurvesToBSplineCurve Conv;
688 Handle(Geom_BezierCurve) BZ;
689 for (ii=1, kk=3; ii<=NbU; ii++,kk++) {
690 BZ = Handle(Geom_BezierCurve)::DownCast(DrawTrSurf::Get(a[kk]));
692 di << "the curve " << kk <<"is not a BezierCurve\n";
695 TColgp_Array1OfPnt Poles(1, BZ->NbPoles());
697 Conv.AddCurve(Poles);
702 TColgp_Array1OfPnt Poles(1, Conv.NbPoles());
704 TColStd_Array1OfInteger Mults(1, Conv.NbKnots());
705 TColStd_Array1OfReal Knots(1, Conv.NbKnots());
706 Conv.KnotsAndMults(Knots, Mults);
707 Handle(Geom_BSplineCurve) BS =
708 new (Geom_BSplineCurve) (Poles, Knots, Mults,
710 DrawTrSurf::Set(a[1], BS);
716 //=======================================================================
717 //function : approxsurf
718 //purpose : Approximation d'une Surface par une BSpline non rationnelle
719 //=======================================================================
722 static Standard_Integer approxsurf(Draw_Interpretor& di, Standard_Integer n, const char** a)
724 // " Tolerance (par defaut 0.1mm) "
725 Standard_Real Tol = 1.e-4;
726 // " Ordres de continuites : 0, 1 ou 2 (par defaut 1)"
727 GeomAbs_Shape myUCont = GeomAbs_C1, myVCont = GeomAbs_C1;
728 // " Degre maximum des carreaux de Bezier 14 par defaut "
729 Standard_Integer degU = 14, degV = 14;
730 // " Nombre max de carreaux (par defaut 10)"
731 Standard_Integer nmax = 16;
732 // "Code de precision par defaults"
733 Standard_Integer myPrec = 1;
735 if ( n>10 || n<3) return 1;
737 if (n>3) Tol = Max(Draw::Atof(a[3]),1.e-10);
742 if (Draw::Atoi(a[4]) == 0) myUCont = GeomAbs_C0;
743 if (Draw::Atoi(a[4]) == 2) myUCont = GeomAbs_C2;
744 if (Draw::Atoi(a[5]) == 0) myVCont = GeomAbs_C0;
745 if (Draw::Atoi(a[5]) == 2) myVCont = GeomAbs_C2;
751 ( degU = (Draw::Atoi(a[6])));
752 ( degV = (Draw::Atoi(a[7])));
753 if ((degU<1) || (degU>24)) degU = 14;
754 if ((degV<1) || (degV>24)) degV = 14;
757 if (n>8) nmax = Draw::Atoi(a[8]);
758 if (n>9) myPrec = Draw::Atoi(a[9]);
760 Handle(Geom_Surface) surf = DrawTrSurf::GetSurface(a[2]);
761 if (surf.IsNull()) return 1;
762 GeomConvert_ApproxSurface myApprox(surf,Tol,myUCont,myVCont,degU,degV,nmax,myPrec);
763 if ( myApprox.HasResult()) DrawTrSurf::Set(a[1], myApprox.Surface());
768 //=======================================================================
769 //function : offseting
771 //=======================================================================
773 static Standard_Integer offseting (Draw_Interpretor& ,
774 Standard_Integer n, const char** a)
778 // test the Geom2d curve
779 Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
781 Handle(Geom2d_OffsetCurve) OC = new Geom2d_OffsetCurve(C2d,Draw::Atof(a[3]));
782 DrawTrSurf::Set(a[1],OC);
786 Standard_Boolean yasurf = Standard_False;
788 Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[2]);
789 Handle(Geom_Surface) GS;
791 GS = DrawTrSurf::GetSurface(a[2]);
794 yasurf = Standard_True;
797 Standard_Real dist = Draw::Atof(a[3]);
799 Handle(Geom_Geometry) result;
802 Handle(Geom_OffsetSurface) GO = new Geom_OffsetSurface(GS,dist);
807 gp_Dir D(Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]));
808 Handle(Geom_OffsetCurve) GT = new Geom_OffsetCurve(GC, dist, D);
812 DrawTrSurf::Set(a[1], result);
816 //=======================================================================
817 //function : sreverse
819 //=======================================================================
821 static Standard_Integer sreverse (Draw_Interpretor& , Standard_Integer n, const char** a)
826 for (i = 1; i < n; i++) {
828 Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[i]);
841 //=======================================================================
844 //=======================================================================
846 static Standard_Integer iso (Draw_Interpretor& , Standard_Integer n, const char** a)
850 Handle(Geom_Curve) C;
851 Standard_Real par = Draw::Atof(a[3]);
852 Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[2]);
858 DrawTrSurf::Set(a[1],C);
865 //=======================================================================
868 //=======================================================================
870 static Standard_Integer value (Draw_Interpretor& ,
871 Standard_Integer n, const char** a)
875 Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[1]);
876 if (GS.IsNull()) return 1;
878 Standard_Real U = Draw::Atof(a[2]);
879 Standard_Real V = Draw::Atof(a[3]);
881 Standard_Boolean DrawPoint = ( n%3 == 2);
889 GS->D2(U,V,P,DU,DV,D2U,D2V,D2UV);
890 Draw::Set(a[13],D2U.X());
891 Draw::Set(a[14],D2U.Y());
892 Draw::Set(a[15],D2U.Z());
893 Draw::Set(a[16],D2V.X());
894 Draw::Set(a[17],D2V.Y());
895 Draw::Set(a[18],D2V.Z());
896 Draw::Set(a[19],D2UV.X());
897 Draw::Set(a[20],D2UV.Y());
898 Draw::Set(a[21],D2UV.Z());
903 Draw::Set(a[7],DU.X());
904 Draw::Set(a[8],DU.Y());
905 Draw::Set(a[9],DU.Z());
906 Draw::Set(a[10],DV.X());
907 Draw::Set(a[11],DV.Y());
908 Draw::Set(a[12],DV.Z());
914 Draw::Set(a[4],P.X());
915 Draw::Set(a[5],P.Y());
916 Draw::Set(a[6],P.Z());
919 DrawTrSurf::Set(a[n],P);
925 //=======================================================================
926 //function : movepole
928 //=======================================================================
930 static Standard_Integer movepole (Draw_Interpretor& , Standard_Integer n, const char** a)
933 Standard_Boolean BSpline = Standard_False;
935 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
936 Handle(Geom_BSplineSurface) GBs;
938 GBs = DrawTrSurf::GetBSplineSurface(a[1]);
943 BSpline = Standard_True;
946 Standard_Real dx = Draw::Atof(a[n-3]);
947 Standard_Real dy = Draw::Atof(a[n-2]);
948 Standard_Real dz = Draw::Atof(a[n-1]);
950 Standard_Integer nup, nvp;
952 nup = GBz->NbUPoles();
953 nvp = GBz->NbVPoles();
956 nup = GBs->NbUPoles();
957 nvp = GBs->NbVPoles();
960 Standard_Integer FirstRow=0, LastRow=0, FirstCol=0, LastCol=0;
961 // Rem : Row = indice ligne. -> variation en U.
962 // Col = indice colonne.-> variation en V.
964 if (!strcasecmp(a[0],"movep")) {
966 FirstRow = Draw::Atoi(a[2]);
967 FirstCol = Draw::Atoi(a[3]);
968 if ( FirstRow < 1 || FirstRow > nup ||
969 FirstCol < 1 || FirstCol > nvp ) return 1;
973 else if (!strcasecmp(a[0],"moverowp")) {
974 FirstRow = Draw::Atoi(a[2]);
975 if ( FirstRow < 1 || FirstRow > nup ) return 1;
980 else if (!strcasecmp(a[0],"movecolp")) {
981 FirstCol = Draw::Atoi(a[2]);
982 if ( FirstCol < 1 || FirstCol > nvp ) return 1;
990 for ( Standard_Integer i = FirstRow; i<= LastRow; i++) {
991 for ( Standard_Integer j = FirstCol; j<= LastCol; j++) {
994 P.SetCoord(P.X()+dx, P.Y()+dy, P.Z()+dz);
999 P.SetCoord(P.X()+dx, P.Y()+dy, P.Z()+dz);
1000 GBs->SetPole(i,j,P);
1011 //=======================================================================
1012 //function : movepoint
1014 //=======================================================================
1016 static Standard_Integer movepoint (Draw_Interpretor& , Standard_Integer n, const char** a)
1018 if (n < 7) return 1;
1020 Handle(Geom_BSplineSurface) GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1025 Standard_Real u = Draw::Atof(a[2]);
1026 Standard_Real v = Draw::Atof(a[3]);
1028 Standard_Real dx = Draw::Atof(a[4]);
1029 Standard_Real dy = Draw::Atof(a[5]);
1030 Standard_Real dz = Draw::Atof(a[6]);
1032 Standard_Integer index1u = 0;
1033 Standard_Integer index2u = 0;
1034 Standard_Integer index1v = 0;
1035 Standard_Integer index2v = 0;
1037 Standard_Integer fmodifu, lmodifu, fmodifv, lmodifv;
1039 index1u = Draw::Atoi(a[7]);
1040 index2u = Draw::Atoi(a[8]);
1041 index1v = Draw::Atoi(a[9]);
1042 index2v = Draw::Atoi(a[10]);
1046 index2u = GBs->NbUPoles()-1;
1048 index2v = GBs->NbVPoles()-1;
1053 p.SetCoord(p.X()+dx, p.Y()+dy, p.Z()+dz);
1054 GBs->MovePoint(u, v, p, index1u, index2u, index1v, index2v, fmodifu, lmodifu, fmodifv, lmodifv);
1060 //=======================================================================
1061 //function : insertknot
1063 //=======================================================================
1065 static Standard_Integer insertknot (Draw_Interpretor& , Standard_Integer n, const char** a)
1067 if (n < 3) return 1;
1069 Handle(Geom_BSplineSurface) GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1071 if (GBs.IsNull()) return 1;
1073 Standard_Real knot=0;
1074 Standard_Integer mult = 0;
1075 Standard_Integer index=0;
1076 if ( !strcasecmp(a[0],"insertuknot") ||
1077 !strcasecmp(a[0],"insertvknot") ) {
1079 knot = Draw::Atof(a[2]);
1080 mult = Draw::Atoi(a[3]);
1082 else if ( !strcasecmp(a[0],"remuknot") ||
1083 !strcasecmp(a[0],"remvknot") ) {
1084 index = Draw::Atoi(a[2]);
1085 if (n>=4) mult = Draw::Atoi(a[3]);
1088 Standard_Real tol = RealLast();
1090 if (!strcasecmp(a[0],"insertuknot")) {
1091 GBs->InsertUKnot(knot,mult,Precision::PConfusion());
1093 else if (!strcasecmp(a[0],"insertvknot")) {
1094 GBs->InsertVKnot(knot,mult,Precision::PConfusion());
1096 else if (!strcasecmp(a[0],"remuknot")) {
1097 if (n>=5) tol = Draw::Atof(a[4]);
1098 if (!GBs->RemoveUKnot(index,mult,tol))
1101 else if (!strcasecmp(a[0],"remvknot")) {
1102 if (n>=5) tol = Draw::Atof(a[4]);
1103 if (!GBs->RemoveVKnot(index,mult,tol))
1111 //=======================================================================
1112 //function : incdegree
1114 //=======================================================================
1116 static Standard_Integer incdegree (Draw_Interpretor& di, Standard_Integer n, const char** a)
1118 if (n < 3) return 1;
1120 Standard_Integer NewDeg = Draw::Atoi(a[2]);
1121 Standard_Boolean BSpline = Standard_False;
1123 Standard_Integer UDeg=0, VDeg=0;
1125 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
1126 Handle(Geom_BSplineSurface) GBs;
1129 GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1132 BSpline = Standard_True;
1135 Standard_Integer Degree=0;
1136 if ( !strcasecmp(a[0],"incudeg")) {
1139 Degree = GBs->UDegree();
1140 VDeg = GBs->VDegree();
1143 Degree = GBz->UDegree();
1144 VDeg = GBz->VDegree();
1147 else if ( !strcasecmp(a[0],"incvdeg")) {
1150 Degree = GBs->VDegree();
1151 UDeg = GBs->UDegree();
1154 Degree = GBz->VDegree();
1155 UDeg = GBz->UDegree();
1159 if (Degree > NewDeg) {
1160 di<<"The Degree must be greater than " << Degree <<"\n";
1165 GBs->IncreaseDegree(UDeg, VDeg);
1168 GBz->Increase(UDeg, VDeg);
1175 //=======================================================================
1176 //function : rempole
1178 //=======================================================================
1180 static Standard_Integer rempole (Draw_Interpretor& di, Standard_Integer n, const char** a)
1182 if (n < 3) return 1;
1184 Standard_Integer NewIndex = Draw::Atoi(a[2]);
1185 Standard_Boolean BSpline = Standard_False;
1187 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
1188 Handle(Geom_BSplineSurface) GBs;
1191 GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1194 BSpline = Standard_True;
1197 if ( !strcasecmp(a[0],"remrowpole")) {
1199 di << " Error : Cannot remove a polerow on a BSplineSurface \n";
1202 GBz->RemovePoleRow(NewIndex);
1205 else if ( !strcasecmp(a[0],"remcolpole")) {
1207 di << " Error : Cannot remove a polecol on a BSplineSurface \n";
1210 GBz->RemovePoleCol(NewIndex);
1218 //=======================================================================
1221 //=======================================================================
1223 static Standard_Integer sfindp (Draw_Interpretor& , Standard_Integer n, const char** a)
1225 if (n < 7) return 1;
1226 Standard_Boolean BSpline = Standard_False;
1228 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
1229 Handle(Geom_BSplineSurface) GBs;
1231 GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1236 BSpline = Standard_True;
1239 Standard_Integer UIndex = 0;
1240 Standard_Integer VIndex = 0;
1241 Standard_Integer view = Draw::Atoi(a[2]);
1242 Standard_Real x = Draw::Atof(a[3]);
1243 Standard_Real y = Draw::Atof(a[4]);
1245 Draw_Display d = dout.MakeDisplay(view);
1248 Handle(DrawTrSurf_BezierSurface) DBz =
1249 new DrawTrSurf_BezierSurface(GBz);
1250 DBz->FindPole( x, y, d, 5, UIndex,VIndex);
1253 Handle(DrawTrSurf_BSplineSurface) DBs =
1254 new DrawTrSurf_BSplineSurface(GBs);
1255 DBs->FindPole( x, y, d, 5, UIndex,VIndex);
1258 Draw::Set(a[5],UIndex);
1259 Draw::Set(a[6],VIndex);
1265 //=======================================================================
1266 //function : ssetperiodic
1268 //=======================================================================
1270 static Standard_Integer ssetperiodic (Draw_Interpretor& , Standard_Integer n, const char** a)
1272 if (n < 2) return 1;
1276 if (!strcasecmp(a[0],"setuperiodic")) {
1277 for (i = 1; i < n; i++) {
1278 Handle(Geom_BSplineSurface)
1279 GBs = DrawTrSurf::GetBSplineSurface(a[i]);
1280 if (!GBs.IsNull()) {
1281 GBs->SetUPeriodic();
1286 else if (!strcasecmp(a[0],"setvperiodic")){
1287 for (i = 1; i < n; i++) {
1288 Handle(Geom_BSplineSurface)
1289 GBs = DrawTrSurf::GetBSplineSurface(a[i]);
1290 if (!GBs.IsNull()) {
1291 GBs->SetVPeriodic();
1296 else if (!strcasecmp(a[0],"setunotperiodic")){
1297 for (i = 1; i < n; i++) {
1298 Handle(Geom_BSplineSurface)
1299 GBs = DrawTrSurf::GetBSplineSurface(a[i]);
1300 if (!GBs.IsNull()) {
1301 GBs->SetUNotPeriodic();
1306 else if (!strcasecmp(a[0],"setvnotperiodic")){
1307 for (i = 1; i < n; i++) {
1308 Handle(Geom_BSplineSurface)
1309 GBs = DrawTrSurf::GetBSplineSurface(a[i]);
1310 if (!GBs.IsNull()) {
1311 GBs->SetVNotPeriodic();
1319 //=======================================================================
1322 //=======================================================================
1324 static Standard_Integer exchuv (Draw_Interpretor& , Standard_Integer n, const char** a)
1326 if (n < 2) return 1;
1329 for (i = 1; i < n; i++) {
1331 Handle(Geom_BSplineSurface) GBs = DrawTrSurf::GetBSplineSurface(a[i]);
1332 if (!GBs.IsNull()) {
1337 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[i]);
1338 if (!GBz.IsNull()) {
1348 //=======================================================================
1351 //=======================================================================
1353 static Standard_Integer segsur (Draw_Interpretor& , Standard_Integer n, const char** a)
1355 if (n < 6 || n > 8) return 1;
1357 Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
1358 Handle(Geom_BSplineSurface) GBs;
1360 GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1364 Standard_Real aUTolerance = Precision::PConfusion();
1365 Standard_Real aVTolerance = Precision::PConfusion();
1367 aUTolerance = aVTolerance = Draw::Atof(a[6]);
1369 aVTolerance = Draw::Atof(a[7]);
1371 GBs->Segment(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]), aUTolerance, aVTolerance);
1374 GBz->Segment(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
1381 static Standard_Integer compBsplSur (Draw_Interpretor& , Standard_Integer n, const char** a)
1385 Message::SendFail() << "Syntax error: Invalid number of parameters";
1389 Handle(Geom_BSplineSurface) GBs1 = DrawTrSurf::GetBSplineSurface(a[1]);
1390 Handle(Geom_BSplineSurface) GBs2 = DrawTrSurf::GetBSplineSurface(a[2]);
1391 if (GBs1.IsNull() || GBs2.IsNull()) {
1392 Message::SendFail() << "Syntax error: Invalid surface";
1396 Standard_Real aU11,aU12,aV11,aV12;
1397 GBs1->Bounds(aU11,aU12,aV11,aV12);
1399 Standard_Real aU21,aU22,aV21,aV22;
1400 GBs2->Bounds(aU21,aU22,aV21,aV22);
1402 Standard_Real aUmin = Max(aU11,aU21);
1403 Standard_Real aUmax = Min(aU12,aU22);
1405 Standard_Real aVmin = Max(aV11,aV21);
1406 Standard_Real aVmax = Min(aV12,aV22);
1408 Standard_Integer nbP = 100;
1409 Standard_Real aStepU = (aUmax - aUmin)/nbP;
1410 Standard_Real aStepV = (aVmax - aVmin)/nbP;
1411 Standard_Integer nbErr =0;
1412 Standard_Integer i =1;
1413 for( ; i <= nbP +1; i++)
1415 Standard_Real aU = aUmin + aStepU*(i-1);
1416 Standard_Integer j =1;
1417 for( ; j <= nbP +1; j++)
1419 Standard_Real aV = aVmin + aStepV*(j-1);
1420 gp_Pnt aP1 = GBs1->Value(aU,aV);
1421 gp_Pnt aP2 = GBs2->Value(aU,aV);
1422 Standard_Real aDist = aP1.SquareDistance(aP2);
1423 if(aDist > Precision::SquareConfusion())
1426 Standard_Real aD = sqrt(aDist);
1427 std::cout<<"Surfaces differ for U,V,Dist: "<<aU<<" "<<aV<<" "<<aD<<std::endl;
1437 //=======================================================================
1438 //function : setuvorigin
1440 //=======================================================================
1442 static Standard_Integer setuvorigin (Draw_Interpretor& , Standard_Integer n, const char** a)
1444 if (n < 3) return 1;
1446 Handle(Geom_BSplineSurface) GBs = DrawTrSurf::GetBSplineSurface(a[1]);
1449 if ( !strcasecmp(a[0],"setuorigin")) {
1450 GBs->SetUOrigin(Draw::Atoi(a[2]));
1452 else if ( !strcasecmp(a[0],"setvorigin")) {
1453 GBs->SetVOrigin(Draw::Atoi(a[2]));
1463 //=======================================================================
1464 //function : parameters
1466 //=======================================================================
1468 static Standard_Integer parameters (Draw_Interpretor& di, Standard_Integer n, const char** a)
1472 // try to find parameters on a Surface
1473 Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[1]);
1474 if( S.IsNull() ) { di << "Unknown surface\n"; return 1; }
1475 gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
1476 Standard_Real Tol = Draw::Atof(a[5]), U = 0., V = 0.;
1477 Standard_Boolean res = GeomLib_Tool::Parameters(S,P,Tol,U,V);
1482 if( !res ) { di << "Wrong point\n"; return 1; }
1486 // try to find parameters on a 3d Curve
1487 Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[1]);
1488 if( C.IsNull() ) { di << "Unknown curve\n"; return 1; }
1489 gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
1490 Standard_Real Tol = Draw::Atof(a[5]), U = 0.;
1491 Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
1495 if( !res ) { di << "Wrong point\n"; return 1; }
1499 // try to find parameters on a 2d Curve
1500 Handle(Geom2d_Curve) C = DrawTrSurf::GetCurve2d(a[1]);
1501 if( C.IsNull() ) { di << "Unknown curve 2d\n"; return 1; }
1502 gp_Pnt2d P(Draw::Atof(a[2]), Draw::Atof(a[3]));
1503 Standard_Real Tol = Draw::Atof(a[4]), U = 0.;
1504 Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
1508 if( !res ) { di << "Wrong point\n"; return 1; }
1512 di << "Invalid parameters!\n";
1514 di << "parameters Surf X Y Z Tol U V\n";
1515 di << "parameters Curv X Y Z Tol U\n";
1516 di << "parameters Curv2d X Y Tol U\n";
1524 //=======================================================================
1527 //=======================================================================
1529 Standard_Integer bounds(Draw_Interpretor&, Standard_Integer n, const char** a)
1531 Standard_Real U1, U2, V1, V2;
1532 if ( n == 4) { // compute on a curve or a 2d curve
1533 Handle(Geom_Curve) C3d = DrawTrSurf::GetCurve(a[1]);
1534 if ( C3d.IsNull()) { // 2dcurve
1535 Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[1]);
1536 if ( C2d.IsNull()) return 1;
1537 U1 = C2d->FirstParameter();
1538 U2 = C2d->LastParameter();
1541 U1 = C3d->FirstParameter();
1542 U2 = C3d->LastParameter();
1547 else if ( n == 6) { // compute on a Surface
1548 Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[1]);
1549 if ( S.IsNull()) return 1;
1550 S->Bounds(U1,U2,V1,V2);
1561 //=======================================================================
1562 //function : SurfaceCommands
1564 //=======================================================================
1567 void GeomliteTest::SurfaceCommands(Draw_Interpretor& theCommands)
1569 static Standard_Boolean loaded = Standard_False;
1571 loaded = Standard_True;
1573 DrawTrSurf::BasicCommands(theCommands);
1576 // analytic surfaces
1577 g = "GEOMETRY surfaces creation";
1579 theCommands.Add("plane",
1580 "plane name [x y z [dx dy dz [ux uy uz]]]",
1584 theCommands.Add("cone",
1585 "cone name [x y z [dx dy dz [ux uy uz]]] semi-angle radius",
1589 theCommands.Add("cylinder",
1590 "cylinder name [x y z [dx dy dz [ux uy uz]]] radius",
1594 theCommands.Add("sphere",
1595 "sphere name [x y z [dx dy dz [ux uy uz]]] radius",
1599 theCommands.Add("torus",
1600 "torus name [x y z [dx dy dz [ux uy uz]]] major minor",
1604 theCommands.Add("beziersurf",
1605 "beziersurf name nbupoles nbvpoles pole, [weight]",
1609 theCommands.Add("bsplinesurf",
1610 "bsplinesurf name udegree nbuknots uknot, umult vdegree nbvknots vknot, vmult pole, weight",
1614 theCommands.Add("upbsplinesurf",
1615 "bsplinesurf name udegree nbuknots uknot, umult vdegree nbvknots vknot, vmult pole, weight",
1619 theCommands.Add("vpbsplinesurf",
1620 "bsplinesurf name udegree nbuknots uknot, umult vdegree nbvknots vknot, vmult pole, weight",
1624 theCommands.Add("uvpbsplinesurf",
1625 "bsplinesurf name udegree nbuknots uknot, umult vdegree nbvknots vknot, vmult pole, weight",
1629 theCommands.Add("extsurf",
1630 "extsurf name curvename dx dy dz",
1634 theCommands.Add("revsurf",
1635 "revsurf name curvename x y z dx dy dz",
1639 theCommands.Add("offset",
1640 "offset name basename distance [dx dy dz]",
1644 theCommands.Add("trim",
1645 "trim newname name [u1 u2 [v1 v2]], no args remove trim",
1649 theCommands.Add("trimu",
1650 "trim newname name u1 u2",
1654 theCommands.Add("trimv",
1655 "trim newname name v1 v2",
1659 theCommands.Add("convert",
1660 "convert result c2d/c3d/surf [qa,c1,s1,s2,s3,s4,po]",
1664 theCommands.Add("tobezier",
1665 "tobezier result c2d/c3d/surf [ufirst, ulast / ufirst, ulast, vfirst, vlast]",
1669 theCommands.Add("convertfrombezier",
1670 "convertfrombezier result nbu [nbv] bz1 [bz2 .... bzn] [tol]",
1674 theCommands.Add("approxsurf",
1675 "approxsurf name surf [Tol [CnU CnV [degU degV [nmax]]]] ",
1679 g = "GEOMETRY Curves and Surfaces modification";
1681 theCommands.Add("ureverse",
1682 "ureverse name ... ",
1686 theCommands.Add("vreverse",
1687 "vreverse name ... ",
1691 theCommands.Add("movep",
1692 "movep name row col dx dy dz",
1696 theCommands.Add("moverowp",
1697 "moverowp name row dx dy dz",
1701 theCommands.Add("movecolp",
1702 "movecolp name col dx dy dz",
1706 theCommands.Add("movepoint",
1707 "movepoint name u v dx dy dz [index1u index2u index2v index2v",
1711 theCommands.Add("insertuknot",
1712 "insertuknot name knot mult",
1716 theCommands.Add("insertvknot",
1717 "insertvknot name knot mult",
1721 theCommands.Add("remuknot",
1722 "remuknot name index [mult] [tol]",
1726 theCommands.Add("remvknot",
1727 "remvknot name index [mult] [tol]",
1731 theCommands.Add("incudeg",
1732 "incudeg name degree",
1736 theCommands.Add("incvdeg",
1737 "incvdeg name degree",
1741 theCommands.Add("remrowpole",
1742 "remrowpole name index",
1746 theCommands.Add("remcolpole",
1747 "remcolpole name index",
1751 theCommands.Add("sfindp",
1752 "sfindp name view x y Uindex Vindex",
1756 theCommands.Add("setuperiodic",
1757 "setuperiodic name ...",
1761 theCommands.Add("setvperiodic",
1762 "setvperiodic name ...",
1766 theCommands.Add("setunotperiodic",
1767 "setunotperiodic name ...",
1771 theCommands.Add("setvnotperiodic",
1772 "setvnotperiodic name ...",
1776 theCommands.Add("exchuv",
1781 theCommands.Add("segsur",
1782 "segsur name Ufirst Ulast Vfirst Vlast [Utol [Vtol]]",
1786 theCommands.Add("setuorigin",
1787 "setuorigin name knotindex",
1791 theCommands.Add("setvorigin",
1792 "setvorigin name knotindex",
1796 g = "GEOMETRY curves creation";
1799 theCommands.Add("uiso",
1800 "uiso curvename surfacename u",
1804 theCommands.Add("viso",
1805 "viso curvename surfacename v",
1810 g = "GEOMETRY curves and surfaces analysis";
1812 theCommands.Add("svalue",
1813 "svalue surfname U V X Y Z [DUX DUY DUZ DVX DVY DVZ [D2UX D2UY D2UZ D2VX D2VY D2VZ D2UVX D2UVY D2UVZ]]",
1817 theCommands.Add("parameters",
1818 "parameters surf/curve X Y [Z] Tol U [V] : {X Y Z} point, {U V} output parameter(s)",
1822 theCommands.Add("bounds",
1823 "bounds S/C/C2d U1 U2 [V1 V2]",
1827 theCommands.Add("surface_radius",
1828 "surface_radius surface Uvalue <Real> Vvalue <Real> returns min max radius of curvature",
1831 theCommands.Add("compBsplSur","BsplSurf1 BSplSurf2",__FILE__,compBsplSur,g);