Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 1999-03-09 |
2 | // Created by: data exchange team | |
3 | // Copyright (c) 1999-1999 Matra Datavision | |
973c2be1 | 4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e | 5 | // |
973c2be1 | 6 | // This file is part of Open CASCADE Technology software library. |
b311480e | 7 | // |
d5f74e42 | 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 | |
973c2be1 | 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. | |
b311480e | 13 | // |
973c2be1 | 14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. | |
b311480e | 16 | |
7fd59977 | 17 | //gka,rln 30.04.99 S4137: new commands for testing ShapeDivide added, some removed |
18 | //abv,pdn 05.05.99 S4174: new commands for testing ShapeDivide added, some removed | |
19 | //pdn,gka 10.06.99 S4189: command DT_ShapeConvertRev added | |
20 | ||
21 | #include <SWDRAW_ShapeUpgrade.ixx> | |
2277323d | 22 | //#include <SWDRAW_ShapeUpgrade.hxx> |
7fd59977 | 23 | |
91322f44 | 24 | #include <Draw.hxx> |
7fd59977 | 25 | #include <DBRep.hxx> |
26 | #include <ShapeUpgrade.hxx> | |
27 | #include <ShapeUpgrade_SplitCurve3dContinuity.hxx> | |
28 | #include <ShapeUpgrade_SplitCurve2dContinuity.hxx> | |
29 | #include <ShapeUpgrade_SplitSurfaceContinuity.hxx> | |
30 | //#include <ShapeUpgrade_SupportModification.hxx> | |
31 | #include <Draw_Interpretor.hxx> | |
32 | #include <DrawTrSurf.hxx> | |
33 | #include <Geom_Curve.hxx> | |
34 | #include <Geom_Plane.hxx> | |
35 | #include <Geom_Surface.hxx> | |
36 | #include <Geom2d_Curve.hxx> | |
37 | #include <TColGeom_HArray1OfCurve.hxx> | |
38 | #include <TColGeom_HArray2OfSurface.hxx> | |
39 | #include <TColStd_Array1OfReal.hxx> | |
40 | #include <TColStd_HArray1OfReal.hxx> | |
41 | #include <TColStd_HSequenceOfReal.hxx> | |
42 | #include <TopoDS.hxx> | |
43 | #include <TopoDS_Edge.hxx> | |
44 | #include <TopoDS_Face.hxx> | |
45 | #include <TopoDS_Shape.hxx> | |
46 | #include <TopoDS_Shell.hxx> | |
47 | #include <TopoDS_Wire.hxx> | |
48 | #include <TopoDS_Compound.hxx> | |
49 | #include <TopExp_Explorer.hxx> | |
50 | #include <TColGeom_HArray2OfSurface.hxx> | |
51 | #include <TColGeom2d_HArray1OfCurve.hxx> | |
52 | #include <BRepBuilderAPI.hxx> | |
53 | #include <SWDRAW.hxx> | |
54 | #include <ShapeUpgrade_ShapeDivideArea.hxx> | |
55 | ||
56 | #include <stdio.h> | |
57 | //#include <ShapeExtend_WireData.hxx> | |
58 | //#include <ShapeAnalysis_Shell.hxx> | |
59 | //#include <ShapeAnalysis_WireOrder.hxx> | |
60 | //#include <ShapeAnalysis_Wire.hxx> | |
61 | //#include <ShapeUpgrade_ShellSewing.hxx> | |
62 | #include <Geom2d_Curve.hxx> | |
63 | #include <Geom2d_OffsetCurve.hxx> | |
64 | #include <Geom_OffsetCurve.hxx> | |
65 | #include <ShapeUpgrade_SplitCurve3dContinuity.hxx> | |
66 | #include <TopoDS_Iterator.hxx> | |
67 | #include <BRep_Tool.hxx> | |
68 | #include <ShapeExtend_CompositeSurface.hxx> | |
69 | #include <Geom_RectangularTrimmedSurface.hxx> | |
70 | #include <TColGeom_HArray2OfSurface.hxx> | |
71 | #include <ShapeFix_ComposeShell.hxx> | |
72 | #include <Precision.hxx> | |
73 | #include <ShapeBuild_ReShape.hxx> | |
74 | #include <BRepTools.hxx> | |
75 | #include <ShapeFix.hxx> | |
76 | #include <ShapeUpgrade_ShapeDivideContinuity.hxx> | |
77 | #include <ShapeUpgrade_ShapeDivideAngle.hxx> | |
78 | #include <ShapeUpgrade_ShapeConvertToBezier.hxx> | |
79 | #include <ShapeCustom.hxx> | |
80 | #include <ShapeUpgrade_ShapeDivideClosed.hxx> | |
81 | #include <ShapeUpgrade_RemoveInternalWires.hxx> | |
982a90fc | 82 | #include <ShapeUpgrade_RemoveLocations.hxx> |
2277323d | 83 | #include <ShapeUpgrade_UnifySameDomain.hxx> |
982a90fc G |
84 | #include <BRepBuilderAPI_Transform.hxx> |
85 | ||
7fd59977 | 86 | // the plane (equation z=0) shared by PlaneDividedFaceContinuity and PlaneGridShell |
87 | //static Handle(Geom_Plane) ThePlane= new Geom_Plane(0,0,1,0); | |
88 | ||
89 | ||
90 | //======================================================================= | |
91 | //function : DT_ShapeDivide | |
92 | //purpose : | |
93 | //======================================================================= | |
94 | ||
95 | static Standard_Integer DT_ShapeDivide (Draw_Interpretor& di, | |
96 | Standard_Integer n, const char** a) | |
97 | { | |
98 | // DT_ShapeDivide result Shape Tol | |
99 | // a[1]= result | |
100 | // a[2]= input Face/Surface | |
101 | // a[3] si n>3= Wire/Face | |
102 | // a[n-1]= Tolerance | |
103 | ||
104 | if (n<3) { | |
105 | di << "bad number of arguments" <<"\n"; | |
106 | return 1; | |
107 | } | |
108 | ||
109 | // try to read a shape: | |
110 | TopoDS_Shape inputShape=DBRep::Get(a[2]); | |
111 | if (inputShape.IsNull()) { | |
112 | di << "Unknown shape"<< "\n"; | |
113 | return 1; | |
114 | } | |
115 | // a[2] is a shape. managing: | |
116 | // DT_ShapeDivide result Face Tol | |
117 | ||
118 | // giving a face is available only in the constructor: | |
119 | // we make the whole and quit. | |
120 | ShapeUpgrade_ShapeDivideContinuity tool(inputShape); | |
121 | ||
122 | // tolerance is optional | |
123 | if (n==4) { | |
91322f44 | 124 | Standard_Real Tol=Draw::Atof(a[3]); |
7fd59977 | 125 | tool.SetTolerance(Tol); |
126 | } | |
127 | ||
128 | // theTool.SetGlobalCriterion(GeomAbs_C1); | |
129 | tool.Perform(); | |
130 | TopoDS_Shape res = tool.Result(); | |
131 | ||
132 | if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n"; | |
133 | if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n"; | |
134 | if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n"; | |
135 | if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n"; | |
136 | if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n"; | |
137 | if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n"; | |
138 | if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n"; | |
139 | if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n"; | |
140 | if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n"; | |
141 | if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n"; | |
142 | if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n"; | |
143 | if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n"; | |
144 | if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n"; | |
145 | if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n"; | |
146 | if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n"; | |
147 | if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n"; | |
148 | if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n"; | |
149 | ||
150 | // fixes | |
151 | ||
152 | ShapeFix::SameParameter ( res, Standard_False ); | |
153 | ||
154 | DBRep::Set(a[1],res); | |
155 | return 0; | |
156 | } | |
157 | ||
158 | static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di, | |
159 | Standard_Integer n, const char** a) | |
160 | { | |
161 | if (n<5) { | |
162 | di << "bad number of arguments" <<"\n"; | |
163 | return 1; | |
164 | } | |
165 | ||
166 | // try to read a shape: | |
167 | TopoDS_Shape inputShape=DBRep::Get(a[2]); | |
168 | if (inputShape.IsNull()) { | |
169 | di << "Unknown shape"<< "\n"; | |
170 | return 1; | |
171 | } | |
172 | ||
91322f44 | 173 | Standard_Integer c2d = Draw::Atoi(a[3]); |
174 | Standard_Integer c3d = Draw::Atoi(a[4]); | |
7fd59977 | 175 | TopoDS_Shape revsh = ShapeCustom::ConvertToRevolution (inputShape); |
176 | if (revsh.IsNull()) { di<<"NO RESULT"<<"\n"; return 1; } | |
177 | else if (revsh == inputShape) { di<<"No modif"<<"\n";} | |
178 | else di<<"ConvertToRevolution -> Result : "<<"\n"; | |
179 | ||
180 | ShapeUpgrade_ShapeConvertToBezier tool(revsh); | |
181 | tool.SetSurfaceConversion(Standard_True); | |
182 | if(c2d) | |
183 | tool.Set2dConversion(Standard_True); | |
184 | if(c3d) { | |
185 | tool.Set3dConversion(Standard_True); | |
186 | if(n > 5) | |
187 | tool.Set3dLineConversion(Standard_False); | |
188 | if(n > 6) | |
189 | tool.Set3dCircleConversion(Standard_False); | |
190 | if(n > 7) | |
191 | tool.Set3dConicConversion(Standard_False); | |
192 | } | |
193 | tool.Perform(); | |
194 | TopoDS_Shape res = tool.Result(); | |
195 | ||
196 | if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n"; | |
197 | if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n"; | |
198 | if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n"; | |
199 | if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n"; | |
200 | if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n"; | |
201 | if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n"; | |
202 | if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n"; | |
203 | if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n"; | |
204 | if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n"; | |
205 | if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n"; | |
206 | if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n"; | |
207 | if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n"; | |
208 | if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n"; | |
209 | if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n"; | |
210 | if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n"; | |
211 | if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n"; | |
212 | if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n"; | |
213 | ||
214 | // fixes | |
215 | ||
216 | ShapeFix::SameParameter ( res, Standard_False ); | |
217 | ||
218 | DBRep::Set(a[1],res); | |
219 | return 0; | |
220 | } | |
221 | ||
222 | ||
223 | /* | |
224 | if (!inputShape.IsNull()) { | |
225 | // a[2] is a shape. managing: | |
226 | // DT_ShapeDivide result Face Tol | |
227 | ||
228 | TopoDS_Face inputFace = TopoDS::Face(inputShape); | |
229 | if (inputFace.IsNull()) { | |
230 | di << a[2] << " is not a face" << "\n"; | |
231 | return 1; | |
232 | } | |
233 | ||
234 | // giving a face is available only in the constructor: | |
235 | // we make the whole and quit. | |
236 | ShapeUpgrade_ShapeDivideContinuity theTool(inputFace); | |
237 | ||
238 | // tolerance is optional | |
239 | if (n==4) { | |
91322f44 | 240 | Standard_Real Tol=Draw::Atof(a[n-1]); |
7fd59977 | 241 | theTool.SetTolerance(Tol); |
242 | } | |
243 | ||
244 | theTool.SetGlobalCriterion(GeomAbs_C1); | |
245 | theTool.Build(); | |
246 | if (!theTool.IsDone()) { | |
247 | ShapeUpgrade_Error theError=theTool.Error(); | |
248 | di << "Not done: error="; | |
249 | if (theError==ShapeUpgrade_Done) | |
250 | di << "Done"<<"\n"; | |
251 | else if (theError==ShapeUpgrade_NotDone) | |
252 | di << "NotDone"<<"\n"; | |
253 | else if (theError==ShapeUpgrade_EmptyShell) | |
254 | di << "EmptyShell"<<"\n"; | |
255 | else if (theError==ShapeUpgrade_InvalidCriterion) | |
256 | di << "InvalidCriterion"<<"\n"; | |
257 | else if (theError==ShapeUpgrade_InvalidGridSurface) | |
258 | di << "InvalidGridSurface"<<"\n"; | |
259 | else if (theError==ShapeUpgrade_DegeneratedEdge) | |
260 | di << "DegeneratedEdge"<<"\n"; | |
261 | else if (theError==ShapeUpgrade_NoSurface) | |
262 | di << "NoSurface"<<"\n"; | |
263 | else if (theError==ShapeUpgrade_NoTolerance) | |
264 | di << "NoTolerance"<<"\n"; | |
265 | return 1; | |
266 | } | |
267 | TopoDS_Shell res = theTool.Shell(); | |
268 | DBRep::Set(a[1],res); | |
269 | ||
270 | return 0; | |
271 | } | |
272 | else { | |
273 | // not a face: we can use the empty consturctor. | |
274 | ShapeUpgrade_ShapeDivideContinuity theTool; | |
91322f44 | 275 | Standard_Real Tol=Draw::Atof(a[n-1]); |
7fd59977 | 276 | theTool.SetTolerance(Tol); |
277 | theTool.SetGlobalCriterion(GeomAbs_C1); | |
278 | ||
279 | // try to read a surface: | |
280 | Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[2]); | |
281 | if (! GS.IsNull()) { | |
282 | // a[2] is a surface. managing the configurations: | |
283 | // DT_ShapeDivide result Surface Tol | |
284 | // DT_ShapeDivide result Surface Face Tol | |
285 | // DT_ShapeDivide result Surface Wire Surf Tol | |
286 | ||
287 | theTool.SetSupport(GS); | |
288 | ||
289 | // try to read a Wire or a Face: | |
290 | if (n>=5) { | |
291 | TopoDS_Shape inputBoundary=DBRep::Get(a[3]); | |
292 | if (inputBoundary.IsNull()) { | |
293 | di << "Invalid Boundary" << "\n"; | |
294 | return 1; | |
295 | } | |
296 | TopoDS_Wire WireBoundary = TopoDS::Wire(inputBoundary); | |
297 | if (!WireBoundary.IsNull()) { | |
298 | // DT_ShapeDivide result Surface Wire Surf Tol | |
299 | Handle(Geom_Surface) WireSupport = DrawTrSurf::GetSurface(a[4]); | |
300 | if (WireSupport.IsNull()) { | |
301 | di << "Invalid Surface supporting the Wire" << "\n"; | |
302 | return 1; | |
303 | } | |
304 | theTool.SetBoundary(WireBoundary, WireSupport); | |
305 | } | |
306 | else { | |
307 | TopoDS_Face FaceBoundary = TopoDS::Face(inputBoundary); | |
308 | // DT_ShapeDivide result Surface Face Tol | |
309 | theTool.SetBoundary(FaceBoundary); | |
310 | } | |
311 | } | |
312 | } | |
313 | else { | |
314 | // it must be a grid: managing the configurations: | |
315 | // DT_ShapeDivide result NbU NbV {Surf_u_v...} Tol | |
316 | // DT_ShapeDivide result NbU NbV {Surf_u_v...} Face Tol | |
317 | // DT_ShapeDivide result NbU NbV {Surf_u_v...} Wire Surf Tol | |
318 | if (n<6) { | |
319 | di << "bad number of arguments for grid input" <<"\n"; | |
320 | return 1; | |
321 | } | |
322 | // number of surf: | |
91322f44 | 323 | Standard_Integer NbU=Draw::Atoi(a[2]); |
324 | Standard_Integer NbV=Draw::Atoi(a[3]); | |
7fd59977 | 325 | if (n < 4+NbU*NbV+1) { |
326 | di << "bad number of arguments" <<"\n"; | |
327 | return 1; | |
328 | } | |
329 | ||
330 | Handle(TColGeom_HArray2OfSurface) | |
331 | TheGridSurf= new TColGeom_HArray2OfSurface(1,NbU,1,NbV); | |
332 | ||
333 | for (Standard_Integer iu=1; iu<=NbU; iu++) { | |
334 | for (Standard_Integer jv=1; jv<=NbV; jv++) { | |
335 | Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[4+(iu-1)*NbV+jv-1]); | |
336 | TheGridSurf->SetValue(iu,jv,GS); | |
337 | } | |
338 | } | |
339 | theTool.SetSupport(TheGridSurf,Tol); | |
340 | ||
341 | // try to read a Wire or a Face: | |
342 | if (n>=6+NbU*NbV) { | |
343 | TopoDS_Shape inputBoundary=DBRep::Get(a[4+NbU*NbV]); | |
344 | if (inputBoundary.IsNull()) { | |
345 | di << "Invalid Boundary" << "\n"; | |
346 | return 1; | |
347 | } | |
348 | TopoDS_Wire WireBoundary = TopoDS::Wire(inputBoundary); | |
349 | if (!WireBoundary.IsNull()) { | |
350 | // DT_ShapeDivide result Surface Wire Surf Tol | |
351 | Handle(Geom_Surface) WireSupport = DrawTrSurf::GetSurface(a[4+NbU*NbV+1]); | |
352 | if (WireSupport.IsNull()) { | |
353 | di << "Invalid Surface supporting the Wire" << "\n"; | |
354 | return 1; | |
355 | } | |
356 | theTool.SetBoundary(WireBoundary, WireSupport); | |
357 | } | |
358 | else { | |
359 | TopoDS_Face FaceBoundary = TopoDS::Face(inputBoundary); | |
360 | // DT_ShapeDivide result Surface Face Tol | |
361 | theTool.SetBoundary(FaceBoundary); | |
362 | } | |
363 | } | |
364 | } | |
365 | ||
366 | theTool.Build(); | |
367 | if (!theTool.IsDone()) { | |
368 | ShapeUpgrade_Error theError=theTool.Error(); | |
369 | di << "Not done: error="; | |
370 | if (theError==ShapeUpgrade_Done) | |
371 | di << "Done"<<"\n"; | |
372 | else if (theError==ShapeUpgrade_NotDone) | |
373 | di << "NotDone"<<"\n"; | |
374 | else if (theError==ShapeUpgrade_EmptyShell) | |
375 | di << "EmptyShell"<<"\n"; | |
376 | else if (theError==ShapeUpgrade_InvalidCriterion) | |
377 | di << "InvalidCriterion"<<"\n"; | |
378 | else if (theError==ShapeUpgrade_InvalidGridSurface) | |
379 | di << "InvalidGridSurface"<<"\n"; | |
380 | else if (theError==ShapeUpgrade_DegeneratedEdge) | |
381 | di << "DegeneratedEdge"<<"\n"; | |
382 | else if (theError==ShapeUpgrade_NoSurface) | |
383 | di << "NoSurface"<<"\n"; | |
384 | else if (theError==ShapeUpgrade_NoTolerance) | |
385 | di << "NoTolerance"<<"\n"; | |
386 | return 1; | |
387 | } | |
388 | ||
389 | TopoDS_Shell res = theTool.Shell(); | |
390 | DBRep::Set(a[1],res); | |
391 | ||
392 | return 0; | |
393 | } | |
394 | } | |
395 | */ | |
396 | static Standard_Integer DT_ShapeConvert (Draw_Interpretor& di, | |
397 | Standard_Integer n, const char** a) | |
398 | { | |
399 | if (n<5) { | |
400 | di << "bad number of arguments" <<"\n"; | |
401 | return 1; | |
402 | } | |
403 | ||
404 | // try to read a shape: | |
405 | TopoDS_Shape inputShape=DBRep::Get(a[2]); | |
406 | if (inputShape.IsNull()) { | |
407 | di << "Unknown shape"<< "\n"; | |
408 | return 1; | |
409 | } | |
410 | ||
91322f44 | 411 | Standard_Integer c2d = Draw::Atoi(a[3]); |
412 | Standard_Integer c3d = Draw::Atoi(a[4]); | |
7fd59977 | 413 | |
414 | ShapeUpgrade_ShapeConvertToBezier tool(inputShape); | |
415 | tool.SetSurfaceConversion(Standard_True); | |
416 | if(c2d) | |
417 | tool.Set2dConversion(Standard_True); | |
418 | if(c3d) | |
419 | tool.Set3dConversion(Standard_True); | |
420 | tool.Perform(); | |
421 | TopoDS_Shape res = tool.Result(); | |
422 | ||
423 | if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n"; | |
424 | if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n"; | |
425 | if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n"; | |
426 | if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n"; | |
427 | if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n"; | |
428 | if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n"; | |
429 | if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n"; | |
430 | if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n"; | |
431 | if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n"; | |
432 | if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n"; | |
433 | if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n"; | |
434 | if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n"; | |
435 | if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n"; | |
436 | if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n"; | |
437 | if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n"; | |
438 | if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n"; | |
439 | if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n"; | |
440 | ||
441 | // fixes | |
442 | ||
443 | ShapeFix::SameParameter ( res, Standard_False ); | |
444 | ||
445 | DBRep::Set(a[1],res); | |
446 | return 0; | |
447 | } | |
448 | static Standard_Integer DT_SplitAngle(Draw_Interpretor& di, | |
449 | Standard_Integer n, const char** a) | |
450 | { | |
451 | if (n<3) { | |
452 | di << "bad number of arguments" <<"\n"; | |
453 | return 1; | |
454 | } | |
455 | ||
456 | TopoDS_Shape inputShape=DBRep::Get(a[2]); | |
457 | if (inputShape.IsNull()) { | |
458 | di << "Unknown shape"<< "\n"; | |
459 | return 1; | |
460 | } | |
461 | ||
462 | Standard_Real maxangle = 95; | |
463 | if ( n >3 ) { | |
91322f44 | 464 | maxangle = Draw::Atof ( a[3] ); |
7fd59977 | 465 | if ( maxangle <1 ) maxangle = 1; |
466 | } | |
467 | ||
982a90fc | 468 | ShapeUpgrade_ShapeDivideAngle tool(maxangle * M_PI/180,inputShape); |
7fd59977 | 469 | tool.Perform(); |
470 | TopoDS_Shape res = tool.Result(); | |
471 | ||
472 | if ( tool.Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n"; | |
473 | if ( tool.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n"; | |
474 | if ( tool.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n"; | |
475 | if ( tool.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n"; | |
476 | if ( tool.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n"; | |
477 | if ( tool.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n"; | |
478 | if ( tool.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n"; | |
479 | if ( tool.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n"; | |
480 | if ( tool.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n"; | |
481 | if ( tool.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n"; | |
482 | if ( tool.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n"; | |
483 | if ( tool.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n"; | |
484 | if ( tool.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n"; | |
485 | if ( tool.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n"; | |
486 | if ( tool.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n"; | |
487 | if ( tool.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n"; | |
488 | if ( tool.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n"; | |
489 | ||
490 | // fixes | |
491 | ||
492 | ShapeFix::SameParameter ( res, Standard_False ); | |
493 | ||
494 | DBRep::Set(a[1],res); | |
495 | return 0; | |
496 | } | |
497 | ||
498 | /* | |
499 | //======================================================================= | |
500 | //function : DT_PlaneDividedFace | |
501 | //purpose : Transfer into a plane with boundary divided | |
502 | // | |
503 | // | |
504 | //======================================================================= | |
505 | static Standard_Integer DT_PlaneDividedFace (Draw_Interpretor& di, | |
506 | Standard_Integer n, const char** a) | |
507 | ||
508 | { | |
509 | // a[1]= result | |
510 | // a[2]= input Face | |
511 | // a[3]= Tolerance | |
512 | ||
513 | if (n !=4) { | |
514 | di << "bad number of arguments" <<"\n"; | |
515 | return 1; | |
516 | } | |
517 | ||
91322f44 | 518 | Standard_Real Tol=Draw::Atof(a[3]); |
7fd59977 | 519 | TopoDS_Shape inputShape=DBRep::Get(a[2]); |
520 | TopoDS_Face inputFace = TopoDS::Face(inputShape); | |
521 | if (inputFace.IsNull()) { | |
522 | di << a[2] << " is not a face" << "\n"; | |
523 | return 1; | |
524 | } | |
525 | ||
526 | ShapeUpgrade_PlaneDividedFace theTool(ThePlane); | |
527 | theTool.Init(inputFace); | |
528 | //theTool.SetBoundaryCriterion(GeomAbs_C1); | |
529 | //theTool.SetTolerance(Tol); | |
530 | theTool.Build(); | |
531 | if (!theTool.IsDone()) { | |
532 | di << "Not done" << "\n"; | |
533 | return 1; | |
534 | } | |
535 | ||
536 | TopoDS_Face res = theTool.Face(); | |
537 | DBRep::Set(a[1],res); | |
538 | ||
539 | Standard_Real the2d3dFactor=theTool.Get2d3dFactor(); | |
540 | di << "2d3dFactor="<<the2d3dFactor<< "\n"; | |
541 | return 0; | |
542 | } | |
543 | ||
544 | //======================================================================= | |
545 | //function : DT_PlaneGridShell | |
546 | //purpose : Create a Plane Grid Shell from U and V knots | |
547 | // | |
548 | // | |
549 | //======================================================================= | |
550 | static Standard_Integer DT_PlaneGridShell (Draw_Interpretor& di, | |
551 | Standard_Integer n, const char** a) | |
552 | ||
553 | { | |
554 | ||
555 | if (n < 4) return 1; | |
556 | // a[1]= result | |
557 | // a[2]= NbU >=2 | |
558 | // a[3]= NbV >=2 | |
559 | // a[4..]= {UKnots} | |
560 | // a[4+NbU...] = {VKnots} | |
561 | // a[4+NbU+NbV+1] = Tol | |
562 | ||
563 | // number of knots: | |
91322f44 | 564 | Standard_Integer NbU=Draw::Atoi(a[2]); |
565 | Standard_Integer NbV=Draw::Atoi(a[3]); | |
7fd59977 | 566 | if (n != 4+NbU+NbV+1) { |
567 | di << "bad number of arguments" <<"\n"; | |
568 | return 1; | |
569 | } | |
570 | ||
571 | TColStd_Array1OfReal TheUKnots(1,NbU); | |
572 | TColStd_Array1OfReal TheVKnots(1,NbV); | |
573 | ||
574 | for (Standard_Integer ii=1; ii<=NbU; ii++) { | |
91322f44 | 575 | TheUKnots(ii)=Draw::Atof(a[4+ii-1]); |
7fd59977 | 576 | } |
577 | for (ii=1; ii<=NbV; ii++) { | |
91322f44 | 578 | TheVKnots(ii)=Draw::Atof(a[4+NbU+ii-1]); |
7fd59977 | 579 | } |
580 | ||
91322f44 | 581 | Standard_Real Tol=Draw::Atof(a[4+NbU+NbV]); |
7fd59977 | 582 | |
583 | ShapeUpgrade_PlaneGridShell TheGrid(ThePlane,TheUKnots,TheVKnots,Tol); | |
584 | ||
585 | TopoDS_Shell res = TheGrid.Shell(); | |
586 | DBRep::Set(a[1],res); | |
587 | ||
588 | return 0; | |
589 | } | |
590 | ||
591 | //======================================================================= | |
592 | //function : DT_PlaneFaceCommon | |
593 | //purpose : Common between a plane Face and a Shell whose all Faces are | |
594 | // laying in the same plane | |
595 | // | |
596 | // | |
597 | //======================================================================= | |
598 | static Standard_Integer DT_PlaneFaceCommon (Draw_Interpretor& di, | |
599 | Standard_Integer n, const char** a) | |
600 | ||
601 | { | |
602 | // a[1]= result | |
603 | // a[2]= input Face | |
604 | // a[3]= input Shell | |
605 | ||
606 | if (n !=4) { | |
607 | di << "bad number of arguments" <<"\n"; | |
608 | return 1; | |
609 | } | |
610 | ||
611 | TopoDS_Shape inputShape= DBRep::Get(a[2]); | |
612 | TopoDS_Face inputFace = TopoDS::Face(inputShape); | |
613 | if (inputFace.IsNull()) { | |
614 | di << a[2] << " is not a face" << "\n"; | |
615 | return 1; | |
616 | } | |
617 | ||
618 | inputShape = DBRep::Get(a[3]); | |
619 | TopoDS_Shell inputShell = TopoDS::Shell(inputShape); | |
620 | if (inputShell.IsNull()) { | |
621 | di << a[3] << " is not a shell" << "\n"; | |
622 | return 1; | |
623 | } | |
624 | ||
625 | ShapeUpgrade_PlaneFaceCommon theTool; | |
626 | theTool.Init(inputFace,inputShell); | |
627 | ||
628 | TopoDS_Shell res = theTool.Shell(); | |
629 | DBRep::Set(a[1],res); | |
630 | ||
631 | return 0; | |
632 | }*/ | |
633 | ||
634 | //======================================================================= | |
635 | //function : DT_SplitCurve | |
636 | //purpose : Splits the curve with C1 criterion | |
637 | // | |
638 | // | |
639 | //======================================================================= | |
640 | static Standard_Integer DT_SplitCurve (Draw_Interpretor& di, | |
641 | Standard_Integer n, const char** a) | |
642 | ||
643 | { | |
644 | // a[1]= input curve. This name is used with a suffix to name the output curves | |
645 | // a[2]= Tolerance | |
646 | ||
647 | if (n < 3) { | |
648 | di << "bad number of arguments" <<"\n"; | |
649 | return 1; | |
650 | } | |
651 | ||
91322f44 | 652 | Standard_Real Tol=Draw::Atof(a[2]); |
7fd59977 | 653 | Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[1]); |
654 | if ( GC.IsNull()) return 1; | |
91322f44 | 655 | Standard_Integer Split = Draw::Atoi(a[3]); |
7fd59977 | 656 | Handle(ShapeUpgrade_SplitCurve3dContinuity) theTool = new ShapeUpgrade_SplitCurve3dContinuity; |
657 | theTool->Init(GC); | |
658 | theTool->SetTolerance (Tol); | |
659 | theTool->SetCriterion (GeomAbs_C1); | |
660 | if(Split == 1) { | |
661 | Handle(TColStd_HSequenceOfReal) spval = new TColStd_HSequenceOfReal; | |
662 | for(Standard_Integer i = 1; i<=5; i++) spval->Append(i); | |
663 | theTool->SetSplitValues(spval); | |
664 | } | |
665 | theTool->Perform (Standard_True); | |
666 | Handle(TColGeom_HArray1OfCurve) theCurves= theTool->GetCurves(); | |
667 | Standard_Integer NbC=theCurves->Length(); | |
668 | for (Standard_Integer icurv=1; icurv<=NbC; icurv++) { | |
669 | char name[100]; | |
91322f44 | 670 | Sprintf(name,"%s%s%d",a[1],"_",icurv); |
7fd59977 | 671 | char* newname = name; |
672 | DrawTrSurf::Set(newname, theCurves->Value(icurv)); | |
673 | di.AppendElement(newname); | |
674 | } | |
675 | return 0; | |
676 | } | |
677 | ||
678 | ||
679 | //======================================================================= | |
680 | //function : DT_SplitCurve2d | |
681 | //purpose : Splits the curve with C1 criterion | |
682 | // | |
683 | // | |
684 | //======================================================================= | |
685 | static Standard_Integer DT_SplitCurve2d (Draw_Interpretor& di, | |
686 | Standard_Integer n, const char** a) | |
687 | ||
688 | { | |
689 | // a[1]= input 2d curve. This name is used with a suffix to name the output curves | |
690 | // a[2]= Tolerance | |
691 | ||
692 | if (n < 3) { | |
693 | di << "bad number of arguments" <<"\n"; | |
694 | return 1; | |
695 | } | |
696 | ||
91322f44 | 697 | Standard_Real Tol=Draw::Atof(a[2]); |
7fd59977 | 698 | Handle(Geom2d_Curve) GC = DrawTrSurf::GetCurve2d(a[1]); |
699 | if ( GC.IsNull()) return 1; | |
91322f44 | 700 | Standard_Integer Split = Draw::Atoi(a[3]); |
7fd59977 | 701 | Handle(ShapeUpgrade_SplitCurve2dContinuity) theTool = new ShapeUpgrade_SplitCurve2dContinuity; |
702 | theTool->Init(GC); | |
703 | theTool->SetTolerance (Tol); | |
704 | theTool->SetCriterion (GeomAbs_C1); | |
705 | if(Split == 1) { | |
706 | Handle(TColStd_HSequenceOfReal) spval = new TColStd_HSequenceOfReal; | |
707 | for(Standard_Integer i = 1; i<=5; i++) spval->Append(i); | |
708 | theTool->SetSplitValues(spval); | |
709 | } | |
710 | theTool->Perform (Standard_True); | |
711 | Handle(TColGeom2d_HArray1OfCurve) theCurves= theTool->GetCurves(); | |
712 | Standard_Integer NbC=theCurves->Length(); | |
713 | for (Standard_Integer icurv=1; icurv<=NbC; icurv++) { | |
714 | char name[100]; | |
91322f44 | 715 | Sprintf(name,"%s%s%d",a[1],"_",icurv); |
7fd59977 | 716 | char* newname = name; |
717 | DrawTrSurf::Set(newname, theCurves->Value(icurv)); | |
718 | di.AppendElement(newname); | |
719 | } | |
720 | return 0; | |
721 | } | |
722 | ||
723 | ||
724 | //======================================================================= | |
725 | //function : DT_SplitSurface | |
726 | //purpose : Splits the surface with C1 criterion | |
727 | // | |
728 | // | |
729 | //======================================================================= | |
730 | /* | |
731 | static Standard_Integer DT_SplitWire (Draw_Interpretor& di, | |
732 | Standard_Integer n, const char** a) | |
733 | { | |
734 | ||
735 | if (n <3) { | |
736 | di << "bad number of arguments" <<"\n"; | |
737 | return 1; | |
738 | } | |
739 | ||
740 | TopoDS_Face source = TopoDS::Face(DBRep::Get(a[2])); | |
741 | if(source.IsNull()) { | |
742 | di <<"Shape is not face"<<"\n"; | |
743 | return 1; | |
744 | } | |
745 | TopoDS_Iterator wi(source); | |
746 | if(!wi.More()) { | |
747 | di <<"Shape is face without wire"<<"\n"; | |
748 | return 1; | |
749 | } | |
750 | ||
751 | TopoDS_Wire wire = TopoDS::Wire(wi.Value()); | |
752 | Handle(ShapeUpgrade_WireDivideContinuity) tool = new ShapeUpgrade_WireDivideContinuity; | |
753 | tool->Init(wire,source); | |
754 | if(n >=4 ) { | |
91322f44 | 755 | Standard_Real Tol=Draw::Atof(a[3]); |
7fd59977 | 756 | } |
757 | Handle(ShapeBuild_ReShape) context = new ShapeBuild_ReShape; | |
758 | tool->Perform(context); | |
759 | TopoDS_Wire result = tool->Wire(); | |
760 | DBRep::Set(a[1],result); | |
761 | return 0; | |
762 | } | |
763 | */ | |
764 | /* | |
765 | static Standard_Integer DT_SplitFace (Draw_Interpretor& di, | |
766 | Standard_Integer n, const char** a) | |
767 | { | |
768 | ||
769 | if (n <3) { | |
770 | di << "bad number of arguments" <<"\n"; | |
771 | return 1; | |
772 | } | |
773 | ||
774 | TopoDS_Face source = TopoDS::Face(DBRep::Get(a[2])); | |
775 | if(source.IsNull()) { | |
776 | di <<"Shape is not face"<<"\n"; | |
777 | return 1; | |
778 | } | |
779 | Handle(ShapeUpgrade_ShapeDivideContinuity) tool = new ShapeUpgrade_FaceDivideContinuity; | |
780 | tool->Init(source); | |
781 | if(n >=4 ) { | |
91322f44 | 782 | Standard_Real Tol=Draw::Atof(a[3]); |
7fd59977 | 783 | tool->SetPrecision(Tol); |
784 | } | |
785 | ||
786 | Handle(ShapeBuild_ReShape) context = new ShapeBuild_ReShape; | |
787 | tool->Perform(context); | |
788 | TopoDS_Shape result = tool->Result(); | |
789 | ||
790 | ||
791 | if ( tool->Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n"; | |
792 | if ( tool->Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n"; | |
793 | if ( tool->Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n"; | |
794 | if ( tool->Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n"; | |
795 | if ( tool->Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n"; | |
796 | if ( tool->Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n"; | |
797 | if ( tool->Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n"; | |
798 | if ( tool->Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n"; | |
799 | if ( tool->Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n"; | |
800 | if ( tool->Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n"; | |
801 | if ( tool->Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n"; | |
802 | if ( tool->Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n"; | |
803 | if ( tool->Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n"; | |
804 | if ( tool->Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n"; | |
805 | if ( tool->Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n"; | |
806 | if ( tool->Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n"; | |
807 | if ( tool->Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n"; | |
808 | ||
809 | // fixes | |
810 | ||
811 | ShapeFix::SameParameter ( result, Standard_False ); | |
812 | ||
813 | DBRep::Set(a[1],result); | |
814 | return 0; | |
815 | } | |
816 | */ | |
817 | ||
818 | static Standard_Integer DT_SplitSurface (Draw_Interpretor& di, | |
819 | Standard_Integer n, const char** a) | |
820 | ||
821 | { | |
822 | // a[1]= result (used with a suffix to name the output surfaces) | |
823 | // a[2]= input surface. | |
824 | // a[3]= Tolerance | |
825 | ||
826 | // a[1]= result | |
827 | // a[2]= nbU | |
828 | // a[3]= nbV | |
829 | // a[3+1]..a[3+nbU*nbV] = Input Surfaces | |
830 | // a[4+nbU*nbV]= Tolerance | |
831 | ||
832 | if (n <4) { | |
833 | di << "bad number of arguments" <<"\n"; | |
834 | return 1; | |
835 | } | |
836 | ||
837 | Handle(ShapeUpgrade_SplitSurfaceContinuity) theTool = new ShapeUpgrade_SplitSurfaceContinuity;//S4137 | |
838 | ||
91322f44 | 839 | Standard_Real Tol=Draw::Atof(a[3]); |
840 | Standard_Integer Split = Draw::Atoi(a[4]); | |
7fd59977 | 841 | theTool->SetTolerance(Tol); |
842 | theTool->SetCriterion(GeomAbs_C1); | |
843 | Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[2]); | |
844 | /* | |
845 | if ( GS.IsNull()) { | |
846 | // Case of composite grid surface | |
847 | di << "composite surf" << "\n"; | |
91322f44 | 848 | Standard_Integer nbU=Draw::Atoi(a[2]); |
849 | Standard_Integer nbV=Draw::Atoi(a[3]); | |
7fd59977 | 850 | if (nbU==0 || nbV==0) return 1; |
851 | Handle(TColGeom_HArray2OfSurface) | |
852 | theGrid= new TColGeom_HArray2OfSurface(1,nbU,1,nbV); | |
853 | for (Standard_Integer iu=1; iu<=nbU; iu++) { | |
854 | for (Standard_Integer iv=1; iv<=nbV; iv++) { | |
855 | Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[3+(iu-1)*nbV+iv]); | |
856 | theGrid->SetValue(iu,iv,GS); | |
857 | } | |
858 | } | |
859 | di << "appel a SplitSurface::Init" << "\n"; | |
860 | theTool->Init(theGrid); | |
861 | } | |
862 | else {*/ | |
863 | // Case of single surface | |
864 | di << "single surf" << "\n"; | |
865 | ||
866 | di << "appel a SplitSurface::Init" << "\n"; | |
867 | theTool->Init(GS); | |
868 | if(Split ==1) { | |
869 | Handle(TColStd_HSequenceOfReal) spval = new TColStd_HSequenceOfReal; | |
870 | for(Standard_Integer i = 1; i<=5; i++) spval->Append(i); | |
871 | theTool->SetUSplitValues(spval); | |
872 | theTool->SetVSplitValues(spval); | |
873 | } | |
874 | ||
875 | di << "appel a SplitSurface::Build" << "\n"; | |
876 | theTool->Build(Standard_True); | |
877 | ||
878 | di << "appel a SplitSurface::GlobalU/VKnots" << "\n"; | |
879 | Handle(ShapeExtend_CompositeSurface) Grid = theTool->ResSurfaces(); | |
880 | Handle(TColStd_HArray1OfReal) GlobalU=Grid->UJointValues(); | |
881 | Handle(TColStd_HArray1OfReal) GlobalV=Grid->VJointValues(); | |
882 | Standard_Integer nbGlU=GlobalU->Length(); | |
883 | Standard_Integer nbGlV=GlobalV->Length(); | |
884 | di << "nb GlobalU ; nb GlobalV="<<nbGlU<<" "<<nbGlV; | |
885 | for (Standard_Integer iu=1; iu<=nbGlU; iu++) | |
886 | di <<" "<< GlobalU->Value(iu); | |
887 | // di <<"\n"; | |
888 | // di << "nb GlobalV="<<nbGlV; | |
889 | for (Standard_Integer iv=1; iv<=nbGlV; iv++) | |
890 | di <<" "<< GlobalV->Value(iv); | |
891 | di <<"\n"; | |
892 | ||
893 | di << "appel a Surfaces" << "\n"; | |
894 | Handle(TColGeom_HArray2OfSurface) theSurfaces= Grid->Patches(); | |
895 | ||
896 | di << "transfert resultat" << "\n"; | |
897 | Standard_Integer NbRow=theSurfaces->ColLength(); | |
898 | Standard_Integer NbCol=theSurfaces->RowLength(); | |
899 | for (Standard_Integer irow=1; irow<=NbRow; irow++) { | |
900 | for (Standard_Integer icol=1; icol<=NbCol; icol++) { | |
901 | char name[100]; | |
91322f44 | 902 | Sprintf(name,"%s%s%d%s%d",a[1],"_",irow,"_",icol); |
7fd59977 | 903 | char* newname = name; |
904 | DrawTrSurf::Set(newname, theSurfaces->Value(irow, icol)); | |
905 | di.AppendElement(newname); | |
906 | } | |
907 | } | |
908 | return 0; | |
909 | } | |
910 | ||
7fd59977 | 911 | //---------------gka |
912 | //======================================================================= | |
913 | //function : offset2dcurve | |
914 | //purpose : | |
915 | // | |
916 | //======================================================================= | |
917 | static Standard_Integer offset2dcurve | |
918 | (Draw_Interpretor& di, Standard_Integer argc, const char** argv) | |
919 | { | |
920 | if (argc < 4) { | |
921 | di<<"result + curve + offset"<<"\n"; | |
922 | ||
923 | return 1 /* Error */; | |
924 | } | |
925 | // Standard_CString arg1 = argv[1]; | |
926 | // Standard_CString arg2 = argv[2]; | |
91322f44 | 927 | Standard_Real Offset = Draw::Atof(argv[3]); |
7fd59977 | 928 | Handle(Geom2d_Curve) GC = DrawTrSurf::GetCurve2d(argv[2]); |
929 | if ( GC.IsNull()) return 1; | |
930 | Handle(Geom2d_OffsetCurve) offcrv = new Geom2d_OffsetCurve(GC,Offset); | |
931 | DrawTrSurf::Set(argv[1], offcrv); | |
932 | return 0; | |
933 | } | |
934 | ||
935 | //======================================================================= | |
936 | //function : offsetcurve | |
937 | //purpose : | |
938 | // | |
939 | //======================================================================= | |
940 | static Standard_Integer offsetcurve | |
941 | (Draw_Interpretor& di, Standard_Integer argc, const char** argv) | |
942 | { | |
943 | if (argc < 5) { | |
944 | di<<"result + curve + offset + Dir"<<"\n"; | |
945 | ||
946 | return 1 /* Error */; | |
947 | } | |
948 | // Standard_CString arg1 = argv[1]; | |
949 | // Standard_CString arg2 = argv[2]; | |
91322f44 | 950 | Standard_Real Offset = Draw::Atof(argv[3]); |
7fd59977 | 951 | Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(argv[2]); |
952 | if ( GC.IsNull()) return 1; | |
953 | gp_Pnt point; | |
954 | DrawTrSurf::GetPoint(argv[4],point); | |
955 | gp_Dir dir(point.XYZ()); | |
956 | Handle(Geom_OffsetCurve) offcrv = new Geom_OffsetCurve(GC,Offset,dir); | |
957 | DrawTrSurf::Set(argv[1], offcrv); | |
958 | return 0; | |
959 | } | |
960 | ||
961 | //======================================================================= | |
962 | //function : compose shell | |
963 | //purpose : | |
964 | //======================================================================= | |
965 | static Standard_Integer splitface | |
966 | (Draw_Interpretor& di, Standard_Integer argc, const char** argv) | |
967 | { | |
968 | if (argc < 5) { | |
969 | di << "Split face: splitface result face [u usplit1 usplit2...] [v vsplit1 vsplit2 ...]" << "\n"; | |
970 | return 1; | |
971 | } | |
972 | ||
973 | TopoDS_Shape aLocalShape = DBRep::Get(argv[2]) ; | |
974 | TopoDS_Face face = TopoDS::Face ( aLocalShape ); | |
975 | if ( face.IsNull() ) { | |
976 | di << argv[2] << " is not Face" << "\n"; | |
977 | return 1; | |
978 | } | |
979 | ||
980 | Handle(Geom_Surface) S = BRep_Tool::Surface ( face ); | |
981 | Standard_Real Uf, Ul, Vf, Vl; | |
982 | BRepTools::UVBounds ( face, Uf, Ul, Vf, Vl ); | |
983 | Standard_Real Umin, Umax, Vmin, Vmax; | |
984 | S->Bounds ( Umin, Umax, Vmin, Vmax ); | |
985 | if ( Uf < Umin && ! S->IsUPeriodic() ) Uf = Umin; | |
eafb234b | 986 | else if ( Uf > Umin ) { |
7fd59977 | 987 | if ( Precision::IsInfinite(Umin) ) Uf -= 100; |
988 | else Uf = Umin; | |
eafb234b | 989 | } |
7fd59977 | 990 | if ( Vf < Vmin && ! S->IsVPeriodic() ) Vf = Vmin; |
eafb234b | 991 | else if ( Vf > Vmin ) { |
7fd59977 | 992 | if ( Precision::IsInfinite(Vmin) ) Vf -= 100; |
993 | else Vf = Vmin; | |
eafb234b | 994 | } |
7fd59977 | 995 | if ( Ul > Umax && ! S->IsUPeriodic() ) Ul = Umax; |
eafb234b | 996 | else if ( Ul < Umax ) { |
7fd59977 | 997 | if ( Precision::IsInfinite(Umax) ) Ul += 100; |
998 | else Ul = Umax; | |
eafb234b | 999 | } |
7fd59977 | 1000 | if ( Vl > Vmax && ! S->IsVPeriodic() ) Vl = Vmax; |
eafb234b | 1001 | else if ( Vl < Vmax ) { |
7fd59977 | 1002 | if ( Precision::IsInfinite(Vmax) ) Vl += 100; |
1003 | else Vl = Vmax; | |
eafb234b | 1004 | } |
7fd59977 | 1005 | |
1006 | TColStd_SequenceOfReal uval; | |
1007 | TColStd_SequenceOfReal vval; | |
1008 | ||
1009 | Standard_Boolean byV = Standard_False; | |
1010 | Standard_Integer i; // svv Jan11 2000 : porting on DEC | |
1011 | for ( i=3; i < argc; i++ ) { | |
1012 | if ( argv[i][0] == 'u' ) byV = Standard_False; | |
1013 | else if ( argv[i][0] == 'v' ) byV = Standard_True; | |
1014 | else { | |
91322f44 | 1015 | Standard_Real val = Draw::Atof ( argv[i] ); |
7fd59977 | 1016 | TColStd_SequenceOfReal &vals = ( byV ? vval : uval ); |
1017 | if ( vals.Length() >0 && val - vals.Last() < Precision::PConfusion() ) { | |
1018 | di << "Values should be sorted in increasing order; skipped" << "\n"; | |
1019 | continue; | |
1020 | } | |
1021 | if ( ( byV && ( val < Vf+Precision::PConfusion() || | |
1022 | val > Vl-Precision::PConfusion() ) ) || | |
1023 | (!byV && ( val < Uf+Precision::PConfusion() || | |
1024 | val > Ul-Precision::PConfusion() ) ) ) { | |
1025 | di << "Values should be inside range of surface; skipped" << "\n"; | |
1026 | continue; | |
1027 | } | |
1028 | vals.Append ( val ); | |
1029 | } | |
1030 | } | |
1031 | if ( uval.Length() <1 && vval.Length() <1 ) { | |
1032 | di << "No splitting defined" << "\n"; | |
1033 | return 1; | |
1034 | } | |
1035 | if ( uval.Length() >0 ) { | |
1036 | di << "Splitting by U: "; | |
1037 | for ( Standard_Integer j=1; j <= uval.Length(); j++ ) { | |
1038 | //cout << ( i >j ? ", " : "" ) << uval(j); | |
1039 | if (i >j) { | |
1040 | di << ", "; | |
1041 | } else { | |
1042 | di << ""; | |
1043 | } | |
1044 | di << uval(j); | |
1045 | } | |
1046 | di << "\n"; | |
1047 | } | |
1048 | if ( vval.Length() >0 ) { | |
1049 | di << "Splitting by V: "; | |
1050 | for ( Standard_Integer j=1; j <= vval.Length(); j++ ) { | |
1051 | //cout << ( j >1 ? ", " : "" ) << vval(j); | |
1052 | if (j >1) { | |
1053 | di << ", "; | |
1054 | } else { | |
1055 | di << ""; | |
1056 | } | |
1057 | di << vval(j); | |
1058 | } | |
1059 | di << "\n"; | |
1060 | } | |
1061 | ||
1062 | Handle(TColGeom_HArray2OfSurface) AS = new TColGeom_HArray2OfSurface ( 1, uval.Length()+1, | |
1063 | 1, vval.Length()+1 ); | |
1064 | for ( i=0; i <= uval.Length(); i++ ) { | |
1065 | Standard_Real umin = ( i ? uval(i) : Uf ); | |
1066 | Standard_Real umax = ( i < uval.Length() ? uval(i+1) : Ul ); | |
1067 | for ( Standard_Integer j=0; j <= vval.Length(); j++ ) { | |
1068 | Standard_Real vmin = ( j ? vval(j) : Vf ); | |
1069 | Standard_Real vmax = ( j < vval.Length() ? vval(j+1) : Vl ); | |
1070 | Handle(Geom_RectangularTrimmedSurface) rect = | |
1071 | new Geom_RectangularTrimmedSurface ( S, umin, umax, vmin, vmax ); | |
1072 | AS->SetValue ( i+1, j+1, rect ); | |
1073 | } | |
1074 | } | |
1075 | ||
1076 | Handle(ShapeExtend_CompositeSurface) Grid = new ShapeExtend_CompositeSurface; | |
1077 | if ( ! Grid->Init ( AS ) ) di << "Grid badly connected!" << "\n"; | |
1078 | ||
1079 | ShapeFix_ComposeShell SUCS; | |
1080 | TopLoc_Location l; | |
1081 | SUCS.Init ( Grid, l, face, Precision::Confusion() ); | |
1082 | Handle(ShapeBuild_ReShape) RS = new ShapeBuild_ReShape; | |
1083 | SUCS.SetContext( RS ); | |
1084 | SUCS.Perform (); | |
1085 | ||
1086 | if ( SUCS.Status ( ShapeExtend_OK ) ) di << "Status: OK" << "\n"; | |
1087 | if ( SUCS.Status ( ShapeExtend_DONE1 ) ) di << "Status: DONE1" << "\n"; | |
1088 | if ( SUCS.Status ( ShapeExtend_DONE2 ) ) di << "Status: DONE2" << "\n"; | |
1089 | if ( SUCS.Status ( ShapeExtend_DONE3 ) ) di << "Status: DONE3" << "\n"; | |
1090 | if ( SUCS.Status ( ShapeExtend_DONE4 ) ) di << "Status: DONE4" << "\n"; | |
1091 | if ( SUCS.Status ( ShapeExtend_DONE5 ) ) di << "Status: DONE5" << "\n"; | |
1092 | if ( SUCS.Status ( ShapeExtend_DONE6 ) ) di << "Status: DONE6" << "\n"; | |
1093 | if ( SUCS.Status ( ShapeExtend_DONE7 ) ) di << "Status: DONE7" << "\n"; | |
1094 | if ( SUCS.Status ( ShapeExtend_DONE8 ) ) di << "Status: DONE8" << "\n"; | |
1095 | if ( SUCS.Status ( ShapeExtend_FAIL1 ) ) di << "Status: FAIL1" << "\n"; | |
1096 | if ( SUCS.Status ( ShapeExtend_FAIL2 ) ) di << "Status: FAIL2" << "\n"; | |
1097 | if ( SUCS.Status ( ShapeExtend_FAIL3 ) ) di << "Status: FAIL3" << "\n"; | |
1098 | if ( SUCS.Status ( ShapeExtend_FAIL4 ) ) di << "Status: FAIL4" << "\n"; | |
1099 | if ( SUCS.Status ( ShapeExtend_FAIL5 ) ) di << "Status: FAIL5" << "\n"; | |
1100 | if ( SUCS.Status ( ShapeExtend_FAIL6 ) ) di << "Status: FAIL6" << "\n"; | |
1101 | if ( SUCS.Status ( ShapeExtend_FAIL7 ) ) di << "Status: FAIL7" << "\n"; | |
1102 | if ( SUCS.Status ( ShapeExtend_FAIL8 ) ) di << "Status: FAIL8" << "\n"; | |
1103 | ||
1104 | TopoDS_Shape sh = SUCS.Result(); | |
1105 | ShapeFix::SameParameter ( sh, Standard_False ); | |
1106 | DBRep::Set ( argv[1], sh ); | |
1107 | return 0; | |
1108 | } | |
1109 | ||
1110 | static Standard_Integer converttobspline | |
1111 | (Draw_Interpretor& di, Standard_Integer argc, const char** argv) | |
1112 | { | |
1113 | if (argc<3) { | |
1114 | di << "Use: " << argv[0] << " result shape [options=ero]\n"; | |
1115 | di << "where options is combination of letters indicating kinds of\n"; | |
1116 | di << "surfaces to be converted:\n"; | |
1117 | di << "e - extrusion\n"; | |
1118 | di << "r - revolution\n"; | |
1119 | di << "o - offset\n"; | |
1120 | di << "p - plane"; | |
1121 | return 1; | |
1122 | } | |
1123 | const char *options = ( argc > 3 ? argv[3] : "ero" ); | |
1124 | ||
1125 | TopoDS_Shape inputShape=DBRep::Get(argv[2]); | |
1126 | if (inputShape.IsNull()) { | |
1127 | di << "Unknown shape"<< "\n"; | |
1128 | return 1; | |
1129 | } | |
1130 | TopoDS_Shape revsh = ShapeCustom::ConvertToRevolution (inputShape); | |
1131 | TopoDS_Shape res = | |
1132 | ShapeCustom::ConvertToBSpline (revsh, strchr (options, 'e') != 0, | |
1133 | strchr (options, 'r') != 0, | |
1134 | strchr (options, 'o') != 0, | |
1135 | strchr (options, 'p') != 0); | |
1136 | ShapeFix::SameParameter ( res, Standard_False ); | |
1137 | DBRep::Set ( argv[1], res ); | |
1138 | return 0; | |
1139 | } | |
1140 | ||
1141 | ||
1142 | static Standard_Integer splitclosed (Draw_Interpretor& di, | |
1143 | Standard_Integer argc, | |
1144 | const char** argv) | |
1145 | { | |
1146 | if (argc<3) { | |
1147 | di << "bad number of arguments" <<"\n"; | |
1148 | return 1; | |
1149 | } | |
1150 | ||
1151 | TopoDS_Shape inputShape=DBRep::Get(argv[2]); | |
1152 | if (inputShape.IsNull()) { | |
1153 | di << "Unknown shape"<< "\n"; | |
1154 | return 1; | |
1155 | } | |
1156 | ||
1157 | ShapeUpgrade_ShapeDivideClosed tool (inputShape); | |
1158 | tool.Perform(); | |
1159 | TopoDS_Shape res = tool.Result(); | |
1160 | ||
1161 | ShapeFix::SameParameter ( res, Standard_False ); | |
1162 | DBRep::Set ( argv[1], res ); | |
1163 | return 0; | |
1164 | } | |
1165 | ||
1166 | static Standard_Integer splitarea (Draw_Interpretor& di, | |
1167 | Standard_Integer argc, | |
1168 | const char** argv) | |
1169 | { | |
1170 | if (argc<4) { | |
1171 | di << "bad number of arguments" <<"\n"; | |
1172 | return 1; | |
1173 | } | |
1174 | ||
1175 | TopoDS_Shape inputShape=DBRep::Get(argv[2]); | |
1176 | if (inputShape.IsNull()) { | |
1177 | di << "Unknown shape"<< "\n"; | |
1178 | return 1; | |
1179 | } | |
91322f44 | 1180 | Standard_Real aMaxArea = Draw::Atof(argv[3]); |
7fd59977 | 1181 | |
1182 | ||
1183 | ShapeUpgrade_ShapeDivideArea tool (inputShape); | |
1184 | if(argc >4) { | |
91322f44 | 1185 | Standard_Real prec = Draw::Atof(argv[4]); |
7fd59977 | 1186 | tool.SetPrecision(prec); |
1187 | } | |
1188 | tool.MaxArea() = aMaxArea; | |
1189 | tool.Perform(); | |
1190 | TopoDS_Shape res = tool.Result(); | |
1191 | ||
1192 | ShapeFix::SameParameter ( res, Standard_False ); | |
1193 | DBRep::Set ( argv[1], res ); | |
1194 | return 0; | |
1195 | } | |
1196 | ||
1197 | static Standard_Integer removeinternalwires (Draw_Interpretor& di, | |
1198 | Standard_Integer argc, | |
1199 | const char** argv) | |
1200 | { | |
1201 | if (argc<4) { | |
1202 | di << "bad number of arguments" <<"\n"; | |
1203 | return 1; | |
1204 | } | |
91322f44 | 1205 | Standard_Real aMinArea = Draw::Atof(argv[2]); |
7fd59977 | 1206 | TopoDS_Shape inputShape=DBRep::Get(argv[3]); |
1207 | if (inputShape.IsNull()) { | |
1208 | di << "Unknown shape"<< "\n"; | |
1209 | return 1; | |
1210 | } | |
1211 | Handle(ShapeUpgrade_RemoveInternalWires) aTool; | |
1212 | TopTools_SequenceOfShape aSeqShapes; | |
1213 | if(inputShape.ShapeType() < TopAbs_WIRE) | |
1214 | aTool = new ShapeUpgrade_RemoveInternalWires(inputShape); | |
1215 | else { | |
1216 | di<<"Invalid type of first shape: should be FACE,SHELL,SOLID or COMPOUND"<<"\n"; | |
1217 | return 1; | |
1218 | } | |
1219 | ||
1220 | Standard_Integer k = 4; | |
1221 | Standard_Boolean isShape = Standard_True; | |
1222 | Standard_Boolean aModeRemoveFaces =Standard_True; | |
1223 | ||
1224 | ||
1225 | for( ; k < argc; k++) { | |
1226 | if(isShape) { | |
1227 | TopoDS_Shape aShape=DBRep::Get(argv[k]); | |
1228 | isShape = !aShape.IsNull(); | |
1229 | if(isShape) { | |
1230 | if(aShape.ShapeType() == TopAbs_FACE || aShape.ShapeType() == TopAbs_WIRE) | |
1231 | aSeqShapes.Append(aShape); | |
1232 | } | |
1233 | } | |
1234 | if(!isShape) | |
91322f44 | 1235 | aModeRemoveFaces = (Draw::Atoi(argv[k]) == 1); |
7fd59977 | 1236 | } |
1237 | ||
1238 | aTool->MinArea() = aMinArea; | |
1239 | aTool->RemoveFaceMode() = aModeRemoveFaces; | |
1240 | if(aSeqShapes.Length()) | |
1241 | aTool->Perform(aSeqShapes); | |
1242 | else | |
1243 | aTool->Perform(); | |
1244 | if(aTool->Status(ShapeExtend_FAIL1)) | |
1245 | di<<"Initial shape has invalid type"<<"\n"; | |
1246 | else if(aTool->Status(ShapeExtend_FAIL2)) | |
1247 | di<<"Specified sub-shape is not belonged to whole shape"<<"\n"; | |
1248 | if(aTool->Status(ShapeExtend_DONE1)) { | |
1249 | const TopTools_SequenceOfShape& aRemovedWires =aTool->RemovedWires(); | |
1250 | di<<aRemovedWires.Length()<<" internal wires were removed"<<"\n"; | |
1251 | ||
1252 | } | |
1253 | if(aTool->Status(ShapeExtend_DONE2)) { | |
1254 | const TopTools_SequenceOfShape& aRemovedFaces =aTool->RemovedFaces(); | |
1255 | di<<aRemovedFaces.Length()<<" small faces were removed"<<"\n"; | |
1256 | ||
1257 | } | |
1258 | TopoDS_Shape res = aTool->GetResult(); | |
1259 | ||
1260 | ||
1261 | DBRep::Set ( argv[1], res ); | |
1262 | return 0; | |
1263 | } | |
1264 | ||
982a90fc G |
1265 | static Standard_Integer removeloc (Draw_Interpretor& di, |
1266 | Standard_Integer argc, | |
1267 | const char** argv) | |
1268 | { | |
1269 | if (argc<3) { | |
1270 | di << "bad number of arguments. Should be: removeloc res shape" <<"\n"; | |
1271 | return 1; | |
1272 | } | |
1273 | ||
1274 | TopoDS_Shape aShape = DBRep::Get(argv[2]); | |
1275 | if(aShape.IsNull()) | |
1276 | return 1; | |
1277 | ShapeUpgrade_RemoveLocations aRemLoc; | |
1278 | aRemLoc.Remove(aShape); | |
1279 | TopoDS_Shape aNewShape = aRemLoc.GetResult(); | |
1280 | ||
1281 | DBRep::Set(argv[1],aNewShape); | |
1282 | return 0; | |
1283 | } | |
2277323d | 1284 | |
1285 | //======================================================================= | |
1286 | // unifysamedom | |
1287 | //======================================================================= | |
1288 | static Standard_Integer unifysamedom(Draw_Interpretor& , Standard_Integer n, const char** a) | |
1289 | { | |
1290 | if (n < 3) | |
1291 | return 1; | |
1292 | ||
1293 | TopoDS_Shape aShape = DBRep::Get(a[2]); | |
1294 | if (aShape.IsNull()) | |
1295 | return 1; | |
1296 | ||
1297 | ShapeUpgrade_UnifySameDomain Unifier(aShape); | |
1298 | Unifier.Build(); | |
1299 | TopoDS_Shape Result = Unifier.Shape(); | |
1300 | ||
1301 | DBRep::Set(a[1], Result); | |
1302 | return 0; | |
1303 | } | |
1304 | ||
982a90fc G |
1305 | static Standard_Integer copytranslate(Draw_Interpretor& di, |
1306 | Standard_Integer argc, | |
1307 | const char** argv) | |
1308 | { | |
1309 | if (argc<6) { | |
1310 | di << "bad number of arguments. Should be: removeloc res shape dx dyy dz" <<"\n"; | |
1311 | return 1; | |
1312 | } | |
1313 | TopoDS_Shape aShape = DBRep::Get(argv[2]); | |
1314 | if(aShape.IsNull()) | |
1315 | return 1; | |
91322f44 | 1316 | Standard_Real aDx = Draw::Atof(argv[3]); |
1317 | Standard_Real aDy = Draw::Atof(argv[4]); | |
1318 | Standard_Real aDz = Draw::Atof(argv[5]); | |
982a90fc G |
1319 | gp_Trsf aTrsf; |
1320 | aTrsf.SetTranslation(gp_Vec(aDx, aDy, aDz)); | |
1321 | BRepBuilderAPI_Transform builderTransform(aTrsf); | |
1322 | builderTransform.Perform (aShape, true); | |
1323 | TopoDS_Shape aNewShape = builderTransform.Shape(); | |
1324 | DBRep::Set(argv[1],aNewShape); | |
1325 | return 0; | |
1326 | ||
1327 | } | |
1328 | ||
7fd59977 | 1329 | //======================================================================= |
1330 | //function : InitCommands | |
1331 | //purpose : | |
1332 | //======================================================================= | |
1333 | ||
1334 | void SWDRAW_ShapeUpgrade::InitCommands(Draw_Interpretor& theCommands) | |
1335 | { | |
1336 | static Standard_Integer initactor = 0; | |
1337 | if (initactor) return; initactor = 1; | |
1338 | ||
1339 | Standard_CString g = SWDRAW::GroupName(); // "Tests of DivideTool"; | |
1340 | ||
1341 | theCommands.Add("DT_ShapeDivide", | |
1342 | "DT_ShapeDivide Result Shape Tol: Divides shape with C1 Criterion", | |
1343 | __FILE__, | |
1344 | DT_ShapeDivide,g); | |
1345 | ||
1346 | theCommands.Add("DT_SplitAngle", | |
1347 | "DT_SplitAngle Result Shape [MaxAngle=95]: Divides revolved surfaces on segments less MaxAngle deg", | |
1348 | __FILE__, | |
1349 | DT_SplitAngle,g); | |
1350 | ||
1351 | theCommands.Add("DT_ShapeConvert", | |
1352 | "DT_ShapeConvert Result Shape convert2d convert3d: Converts curves to beziers", | |
1353 | __FILE__, | |
1354 | DT_ShapeConvert,g); | |
1355 | ||
1356 | theCommands.Add("DT_ShapeConvertRev", | |
1357 | "DT_ShapeConvert Result Shape convert2d convert3d: Converts curves to beziers", | |
1358 | __FILE__, | |
1359 | DT_ShapeConvertRev,g); | |
1360 | /* theCommands.Add("DT_PlaneDividedFace", | |
1361 | "DT_PlaneDividedFace Result Face Tol: Transfer into a plane with boundary divided", | |
1362 | __FILE__, | |
1363 | DT_PlaneDividedFace,g); | |
1364 | ||
1365 | theCommands.Add("DT_PlaneGridShell", | |
1366 | "DT_PlaneGridShell Result NbU NbV {UKnots} {VKnots} Tol : Create a plane grid Shell", | |
1367 | __FILE__, | |
1368 | DT_PlaneGridShell,g); | |
1369 | ||
1370 | theCommands.Add("DT_PlaneFaceCommon", | |
1371 | "DT_PlaneFaceCommon Result Face Shell: Common between a plane Face and a Shell", | |
1372 | __FILE__, | |
1373 | DT_PlaneFaceCommon,g);*/ | |
1374 | ||
1375 | theCommands.Add("DT_SplitCurve2d", | |
1376 | "DT_SplitCurve2d Curve Tol: Splits the curve with C1 criterion", | |
1377 | __FILE__, | |
1378 | DT_SplitCurve2d,g); | |
1379 | ||
1380 | theCommands.Add("DT_SplitCurve", | |
1381 | "DT_SplitCurve Curve Tol: Splits the curve with C1 criterion", | |
1382 | __FILE__, | |
1383 | DT_SplitCurve,g); | |
1384 | ||
1385 | theCommands.Add("DT_SplitSurface", | |
1386 | "DT_SplitSurface Result Surface/GridSurf Tol: Splits the surface with C1 criterion", | |
1387 | __FILE__, | |
1388 | DT_SplitSurface,g); | |
1389 | ||
1390 | /*theCommands.Add("DT_SupportModification", | |
1391 | "DT_SupportModification Result Shell Surface 2d3dFactor: Surface will support all the faces", | |
1392 | __FILE__, | |
1393 | DT_SupportModification,g);*/ | |
1394 | ||
1395 | // theCommands.Add("DT_SpltWire","DT_SpltWire Result Wire Tol", | |
1396 | // __FILE__,DT_SplitWire,g); | |
1397 | ||
1398 | // theCommands.Add("DT_SplitFace", "DT_SplitFace Result Face Tol", | |
1399 | // __FILE__, DT_SplitFace,g); | |
1400 | ||
1401 | // theCommands.Add("DT_Debug", "DT_Debug 0/1 : activation/desactivation of the debug messages", | |
1402 | // __FILE__, DT_Debug,g); | |
1403 | // theCommands.Add ("shellsolid","option[a-b-c-f] shape result", | |
1404 | // __FILE__,shellsolid,g); | |
1405 | theCommands.Add ("offset2dcurve","result curve offset", | |
1406 | __FILE__,offset2dcurve,g); | |
1407 | ||
1408 | theCommands.Add ("offsetcurve","result curve offset dir", | |
1409 | __FILE__,offsetcurve,g); | |
1410 | ||
1411 | theCommands.Add ("splitface","result face [u usplit1 usplit2...] [v vsplit1 vsplit2 ...]", | |
1412 | __FILE__,splitface,g); | |
1413 | ||
1414 | theCommands.Add ("DT_ToBspl","result shape [options=erop]", | |
1415 | __FILE__,converttobspline,g); | |
1416 | theCommands.Add ("DT_ClosedSplit","result shape", | |
1417 | __FILE__,splitclosed,g); | |
1418 | theCommands.Add ("DT_SplitByArea","result shape maxarea [preci]", | |
1419 | __FILE__,splitarea,g); | |
1420 | ||
1421 | theCommands.Add ("RemoveIntWires","result minarea wholeshape [faces or wires] [moderemoveface ]", | |
1422 | __FILE__,removeinternalwires,g); | |
982a90fc G |
1423 | |
1424 | theCommands.Add ("removeloc","result shape",__FILE__,removeloc,g); | |
2277323d | 1425 | |
1426 | theCommands.Add ("unifysamedom", | |
1427 | "unifysamedom result shape",__FILE__,unifysamedom,g); | |
1428 | ||
982a90fc | 1429 | theCommands.Add ("copytranslate","result shape dx dy dz",__FILE__,copytranslate,g); |
7fd59977 | 1430 | } |