Salome HOME
Copyright update 2022
[modules/geom.git] / src / GEOM_SWIG / AdvancedGEOMBuilder.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 from GEOM import IAdvancedOperations
21
22 # Engine Library Name
23 __libraryName__ = "AdvancedEngine"
24
25 def GetAdvancedOperations(self):
26     anOp = self.GetPluginOperations(__libraryName__)
27     return anOp._narrow(IAdvancedOperations)
28
29 ## Create a T-shape object with specified caracteristics for the main
30 #  and the incident pipes (radius, width, half-length).
31 #  The extremities of the main pipe are located on junctions points P1 and P2.
32 #  The extremity of the incident pipe is located on junction point P3.
33 #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
34 #  the main plane of the T-shape is XOY.
35 #
36 #  @param theR1 Internal radius of main pipe
37 #  @param theW1 Width of main pipe
38 #  @param theL1 Half-length of main pipe
39 #  @param theR2 Internal radius of incident pipe (R2 < R1)
40 #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
41 #  @param theL2 Half-length of incident pipe
42 #
43 #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
44 #  @param theP1 1st junction point of main pipe
45 #  @param theP2 2nd junction point of main pipe
46 #  @param theP3 Junction point of incident pipe
47 #
48 #  @param theRL Internal radius of left thickness reduction
49 #  @param theWL Width of left thickness reduction
50 #  @param theLtransL Length of left transition part
51 #  @param theLthinL Length of left thin part
52 #
53 #  @param theRR Internal radius of right thickness reduction
54 #  @param theWR Width of right thickness reduction
55 #  @param theLtransR Length of right transition part
56 #  @param theLthinR Length of right thin part
57 #
58 #  @param theRI Internal radius of incident thickness reduction
59 #  @param theWI Width of incident thickness reduction
60 #  @param theLtransI Length of incident transition part
61 #  @param theLthinI Length of incident thin part
62 #
63 #  @param theName Object name; when specified, this parameter is used
64 # for result publication in the study. Otherwise, if automatic
65 # publication is switched on, default value is used for result name.
66 #
67 #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
68 #
69 #  @ref tui_creation_pipetshape "Example"
70 #  @ingroup l4_advanced
71 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
72     theHexMesh=True, theP1=None, theP2=None, theP3=None,
73     theRL=0, theWL=0, theLtransL=0, theLthinL=0,
74     theRR=0, theWR=0, theLtransR=0, theLthinR=0,
75     theRI=0, theWI=0, theLtransI=0, theLthinI=0,
76     theName=None):
77     """
78     Create a T-shape object with specified caracteristics for the main
79     and the incident pipes (radius, width, half-length).
80     The extremities of the main pipe are located on junctions points P1 and P2.
81     The extremity of the incident pipe is located on junction point P3.
82     If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
83     the main plane of the T-shape is XOY.
84
85     Parameters:
86         theR1 Internal radius of main pipe
87         theW1 Width of main pipe
88         theL1 Half-length of main pipe
89         theR2 Internal radius of incident pipe (R2 < R1)
90         theW2 Width of incident pipe (R2+W2 < R1+W1)
91         theL2 Half-length of incident pipe
92         theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
93         theP1 1st junction point of main pipe
94         theP2 2nd junction point of main pipe
95         theP3 Junction point of incident pipe
96         
97         theRL Internal radius of left thickness reduction
98         theWL Width of left thickness reduction
99         theLtransL Length of left transition part
100         theLthinL Length of left thin part
101         
102         theRR Internal radius of right thickness reduction
103         theWR Width of right thickness reduction
104         theLtransR Length of right transition part
105         theLthinR Length of right thin part
106         
107         theRI Internal radius of incident thickness reduction
108         theWI Width of incident thickness reduction
109         theLtransI Length of incident transition part
110         theLthinI Length of incident thin part
111         
112         theName Object name; when specified, this parameter is used
113         for result publication in the study. Otherwise, if automatic
114         publication is switched on, default value is used for result name.
115     
116     Returns:
117     List of GEOM_Object, containing the created shape and propagation groups.
118     
119     Example of usage:
120     # create PipeTShape object
121     pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
122     # create PipeTShape object with position
123     pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
124     # create PipeTShape object with left thickness reduction
125     pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
126     """
127     from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
128     theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
129     anOp = GetAdvancedOperations(self)
130     if (theP1 and theP2 and theP3):
131         anObj = anOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
132                                                   theRL, theWL, theLtransL, theLthinL,
133                                                   theRR, theWR, theLtransR, theLthinR,
134                                                   theRI, theWI, theLtransI, theLthinI,
135                                                   theHexMesh, theP1, theP2, theP3)
136     else:
137         anObj = anOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
138                                       theRL, theWL, theLtransL, theLthinL,
139                                       theRR, theWR, theLtransR, theLthinR,
140                                       theRI, theWI, theLtransI, theLthinI,
141                                       theHexMesh)
142         pass
143     RaiseIfFailed("MakePipeTShape", anOp)
144     if Parameters: anObj[0].SetParameters(Parameters)
145     self.def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
146     self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), self.def_names)
147     anOp.UnRegister()
148     return anObj
149
150 ## Create a T-shape object with chamfer and with specified caracteristics for the main
151 #  and the incident pipes (radius, width, half-length). The chamfer is
152 #  created on the junction of the pipes.
153 #  The extremities of the main pipe are located on junctions points P1 and P2.
154 #  The extremity of the incident pipe is located on junction point P3.
155 #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
156 #  the main plane of the T-shape is XOY.
157 #  @param theR1 Internal radius of main pipe
158 #  @param theW1 Width of main pipe
159 #  @param theL1 Half-length of main pipe
160 #  @param theR2 Internal radius of incident pipe (R2 < R1)
161 #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
162 #  @param theL2 Half-length of incident pipe
163 #  @param theH Height of the chamfer.
164 #  @param theW Width of the chamfer.
165 #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
166 #  @param theP1 1st junction point of main pipe
167 #  @param theP2 2nd junction point of main pipe
168 #  @param theP3 Junction point of incident pipe
169 #
170 #  @param theRL Internal radius of left thickness reduction
171 #  @param theWL Width of left thickness reduction
172 #  @param theLtransL Length of left transition part
173 #  @param theLthinL Length of left thin part
174 #
175 #  @param theRR Internal radius of right thickness reduction
176 #  @param theWR Width of right thickness reduction
177 #  @param theLtransR Length of right transition part
178 #  @param theLthinR Length of right thin part
179 #
180 #  @param theRI Internal radius of incident thickness reduction
181 #  @param theWI Width of incident thickness reduction
182 #  @param theLtransI Length of incident transition part
183 #  @param theLthinI Length of incident thin part
184 #
185 #  @param theName Object name; when specified, this parameter is used
186 #         for result publication in the study. Otherwise, if automatic
187 #         publication is switched on, default value is used for result name.
188 #
189 #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
190 #
191 #  @ref tui_creation_pipetshape "Example"
192 #  @ingroup l4_advanced
193 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
194                            theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
195                            theRL=0, theWL=0, theLtransL=0, theLthinL=0,
196                            theRR=0, theWR=0, theLtransR=0, theLthinR=0,
197                            theRI=0, theWI=0, theLtransI=0, theLthinI=0,
198                            theName=None):
199     """
200     Create a T-shape object with chamfer and with specified caracteristics for the main
201     and the incident pipes (radius, width, half-length). The chamfer is
202     created on the junction of the pipes.
203     The extremities of the main pipe are located on junctions points P1 and P2.
204     The extremity of the incident pipe is located on junction point P3.
205     If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
206     the main plane of the T-shape is XOY.
207     
208     Parameters:
209         theR1 Internal radius of main pipe
210         theW1 Width of main pipe
211         theL1 Half-length of main pipe
212         theR2 Internal radius of incident pipe (R2 < R1)
213         theW2 Width of incident pipe (R2+W2 < R1+W1)
214         theL2 Half-length of incident pipe
215         theH Height of the chamfer.
216         theW Width of the chamfer.
217         theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
218         theP1 1st junction point of main pipe
219         theP2 2nd junction point of main pipe
220         theP3 Junction point of incident pipe
221         
222         theRL Internal radius of left thickness reduction
223         theWL Width of left thickness reduction
224         theLtransL Length of left transition part
225         theLthinL Length of left thin part
226         
227         theRR Internal radius of right thickness reduction
228         theWR Width of right thickness reduction
229         theLtransR Length of right transition part
230         theLthinR Length of right thin part
231         
232         theRI Internal radius of incident thickness reduction
233         theWI Width of incident thickness reduction
234         theLtransI Length of incident transition part
235         theLthinI Length of incident thin part
236         
237         theName Object name; when specified, this parameter is used
238         for result publication in the study. Otherwise, if automatic
239         publication is switched on, default value is used for result name.
240         
241         Returns:
242             List of GEOM_Object, containing the created shape and propagation groups.
243
244         Example of usage:
245             # create PipeTShape with chamfer object
246             pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
247             # create PipeTShape with chamfer object with position
248             pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
249             # create PipeTShape with chamfer object with left thickness reduction
250             pipetshapechamfer_thr = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
251     """
252     from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
253     theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
254     anOp = GetAdvancedOperations(self)
255     if (theP1 and theP2 and theP3):
256         anObj = anOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
257                                                          theRL, theWL, theLtransL, theLthinL,
258                                                          theRR, theWR, theLtransR, theLthinR,
259                                                          theRI, theWI, theLtransI, theLthinI,
260                                                          theH, theW, theHexMesh, theP1, theP2, theP3)
261     else:
262         anObj = anOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
263                                              theRL, theWL, theLtransL, theLthinL,
264                                              theRR, theWR, theLtransR, theLthinR,
265                                              theRI, theWI, theLtransI, theLthinI,
266                                              theH, theW, theHexMesh)
267     pass
268
269     RaiseIfFailed("MakePipeTShapeChamfer", anOp)
270     if Parameters: anObj[0].SetParameters(Parameters)
271     self.def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
272     self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), self.def_names)
273     anOp.UnRegister()
274     return anObj
275
276 ## Create a T-shape object with fillet and with specified caracteristics for the main
277 #  and the incident pipes (radius, width, half-length). The fillet is
278 #  created on the junction of the pipes.
279 #  The extremities of the main pipe are located on junctions points P1 and P2.
280 #  The extremity of the incident pipe is located on junction point P3.
281 #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
282 #  the main plane of the T-shape is XOY.
283 #  @param theR1 Internal radius of main pipe
284 #  @param theW1 Width of main pipe
285 #  @param theL1 Half-length of main pipe
286 #  @param theR2 Internal radius of incident pipe (R2 < R1)
287 #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
288 #  @param theL2 Half-length of incident pipe
289 #  @param theRF Radius of curvature of fillet.
290 #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
291 #  @param theP1 1st junction point of main pipe
292 #  @param theP2 2nd junction point of main pipe
293 #  @param theP3 Junction point of incident pipe
294 #
295 #  @param theRL Internal radius of left thickness reduction
296 #  @param theWL Width of left thickness reduction
297 #  @param theLtransL Length of left transition part
298 #  @param theLthinL Length of left thin part
299 #
300 #  @param theRR Internal radius of right thickness reduction
301 #  @param theWR Width of right thickness reduction
302 #  @param theLtransR Length of right transition part
303 #  @param theLthinR Length of right thin part
304 #
305 #  @param theRI Internal radius of incident thickness reduction
306 #  @param theWI Width of incident thickness reduction
307 #  @param theLtransI Length of incident transition part
308 #  @param theLthinI Length of incident thin part
309 #
310 #  @param theName Object name; when specified, this parameter is used
311 #         for result publication in the study. Otherwise, if automatic
312 #         publication is switched on, default value is used for result name.
313 #
314 #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
315 #
316 #  @ref tui_creation_pipetshape "Example"
317 #  @ingroup l4_advanced
318 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
319                           theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
320                           theRL=0, theWL=0, theLtransL=0, theLthinL=0,
321                           theRR=0, theWR=0, theLtransR=0, theLthinR=0,
322                           theRI=0, theWI=0, theLtransI=0, theLthinI=0,
323                           theName=None):
324     """
325     Create a T-shape object with fillet and with specified caracteristics for the main
326     and the incident pipes (radius, width, half-length). The fillet is
327     created on the junction of the pipes.
328     The extremities of the main pipe are located on junctions points P1 and P2.
329     The extremity of the incident pipe is located on junction point P3.
330     
331     Parameters:
332         If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
333         the main plane of the T-shape is XOY.
334         theR1 Internal radius of main pipe
335         theW1 Width of main pipe
336         heL1 Half-length of main pipe
337         theR2 Internal radius of incident pipe (R2 < R1)
338         theW2 Width of incident pipe (R2+W2 < R1+W1)
339         theL2 Half-length of incident pipe
340         theRF Radius of curvature of fillet.
341         theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
342         theP1 1st junction point of main pipe
343         theP2 2nd junction point of main pipe
344         theP3 Junction point of incident pipe
345         
346         theRL Internal radius of left thickness reduction
347         theWL Width of left thickness reduction
348         theLtransL Length of left transition part
349         theLthinL Length of left thin part
350         
351         theRR Internal radius of right thickness reduction
352         theWR Width of right thickness reduction
353         theLtransR Length of right transition part
354         theLthinR Length of right thin part
355         
356         theRI Internal radius of incident thickness reduction
357         theWI Width of incident thickness reduction
358         theLtransI Length of incident transition part
359         theLthinI Length of incident thin part
360         
361         theName Object name; when specified, this parameter is used
362         for result publication in the study. Otherwise, if automatic
363         publication is switched on, default value is used for result name.
364                 
365         Returns:
366             List of GEOM_Object, containing the created shape and propagation groups.
367                 
368         Example of usage:
369             # create PipeTShape with fillet object
370             pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
371             # create PipeTShape with fillet object with position
372             pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
373             # create PipeTShape with fillet object with left thickness reduction
374             pipetshapefillet_thr = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
375     """
376     from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
377     theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
378     anOp = GetAdvancedOperations(self)    
379     if (theP1 and theP2 and theP3):
380         anObj = anOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
381                                                         theRL, theWL, theLtransL, theLthinL,
382                                                         theRR, theWR, theLtransR, theLthinR,
383                                                         theRI, theWI, theLtransI, theLthinI,
384                                                         theRF, theHexMesh, theP1, theP2, theP3)
385     else:
386         anObj = anOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
387                                                   theRL, theWL, theLtransL, theLthinL,
388                                                   theRR, theWR, theLtransR, theLthinR,
389                                                   theRI, theWI, theLtransI, theLthinI,
390                                                   theRF, theHexMesh)
391         pass
392     RaiseIfFailed("MakePipeTShapeFillet", anOp)
393     if Parameters: anObj[0].SetParameters(Parameters)
394     self.def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
395     self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), self.def_names)
396     anOp.UnRegister()
397     return anObj
398
399 ## This function allows creating a disk already divided into blocks. It
400 #  can be used to create divided pipes for later meshing in hexaedra.
401 #  @param theR Radius of the disk
402 #  @param theOrientation Orientation of the plane on which the disk will be built
403 #         1 = XOY, 2 = OYZ, 3 = OZX
404 #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
405 #  @param theName Object name; when specified, this parameter is used
406 #         for result publication in the study. Otherwise, if automatic
407 #         publication is switched on, default value is used for result name.
408 #
409 #  @return New GEOM_Object, containing the created shape.
410 #
411 #  @ref tui_creation_divideddisk "Example"
412 #  @ingroup l4_advanced
413 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
414     """
415     Creates a disk, divided into blocks. It can be used to create divided pipes
416     for later meshing in hexaedra.
417     
418     Parameters:
419         theR Radius of the disk
420         theOrientation Orientation of the plane on which the disk will be built:
421         1 = XOY, 2 = OYZ, 3 = OZX
422         thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
423         theName Object name; when specified, this parameter is used
424         for result publication in the study. Otherwise, if automatic
425         publication is switched on, default value is used for result name.
426         
427         Returns:
428             New GEOM_Object, containing the created shape.
429     """
430     from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
431     theR, Parameters = ParseParameters(theR)
432     anOp = GetAdvancedOperations(self)
433     anObj = anOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
434     RaiseIfFailed("MakeDividedDisk", anOp)
435     if Parameters: anObj.SetParameters(Parameters)
436     self._autoPublish(anObj, theName, "dividedDisk")
437     anOp.UnRegister()
438     return anObj
439             
440 ## This function allows creating a disk already divided into blocks. It
441 #  can be used to create divided pipes for later meshing in hexaedra.
442 #  @param theCenter Center of the disk
443 #  @param theVector Normal vector to the plane of the created disk
444 #  @param theRadius Radius of the disk
445 #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
446 #  @param theName Object name; when specified, this parameter is used
447 #         for result publication in the study. Otherwise, if automatic
448 #         publication is switched on, default value is used for result name.
449 #
450 #  @return New GEOM_Object, containing the created shape.
451 #
452 #  @ref tui_creation_divideddisk "Example"
453 #  @ingroup l4_advanced
454 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
455     """
456     Creates a disk already divided into blocks. It can be used to create divided pipes
457     for later meshing in hexaedra.
458     
459     Parameters:
460         theCenter Center of the disk
461         theVector Normal vector to the plane of the created disk
462         theRadius Radius of the disk
463         thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
464         theName Object name; when specified, this parameter is used
465         for result publication in the study. Otherwise, if automatic
466         publication is switched on, default value is used for result name.
467
468     Returns:
469         New GEOM_Object, containing the created shape.
470     """
471     from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
472     theRadius, Parameters = ParseParameters(theRadius)
473     anOp = GetAdvancedOperations(self)
474     anObj = anOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
475     RaiseIfFailed("MakeDividedDiskPntVecR", anOp)
476     if Parameters: anObj.SetParameters(Parameters)
477     self._autoPublish(anObj, theName, "dividedDisk")
478     anOp.UnRegister()
479     return anObj
480
481 ## Builds a cylinder prepared for hexa meshes
482 #  @param theR Radius of the cylinder
483 #  @param theH Height of the cylinder
484 #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
485 #  @param theName Object name; when specified, this parameter is used
486 #         for result publication in the study. Otherwise, if automatic
487 #         publication is switched on, default value is used for result name.
488 #
489 #  @return New GEOM_Object, containing the created shape.
490 #
491 #  @ref tui_creation_dividedcylinder "Example"
492 #  @ingroup l4_advanced
493 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
494     """
495     Builds a cylinder prepared for hexa meshes
496     
497     Parameters:
498         theR Radius of the cylinder
499         theH Height of the cylinder
500         thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
501         theName Object name; when specified, this parameter is used
502         for result publication in the study. Otherwise, if automatic
503         publication is switched on, default value is used for result name.
504         
505         Returns:
506         New GEOM_Object, containing the created shape.
507     """
508     from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
509     theR, theH, Parameters = ParseParameters(theR, theH)
510     anOp = GetAdvancedOperations(self)
511     anObj = anOp.MakeDividedCylinder(theR, theH, thePattern)
512     RaiseIfFailed("MakeDividedCylinder", anOp)
513     if Parameters: anObj.SetParameters(Parameters)
514     self._autoPublish(anObj, theName, "dividedCylinder")
515     anOp.UnRegister()
516     return anObj
517
518 ## Create a surface from a cloud of points
519 #  @param thelPoints list of points. Compounds of points are
520 #         accepted as well.
521 #  @param theNbMax maximum number of Bezier pieces in the resulting
522 #         surface.
523 #  @param theDegMax maximum degree of the resulting BSpline surface.
524 #  @param theDMax 3D tolerance of initial approximation.
525 #  @param theName Object name; when specified, this parameter is used
526 #         for result publication in the study. Otherwise, if automatic
527 #         publication is switched on, default value is used for result name.
528 #  @return New GEOM_Object, containing the created shape.
529 #  @note 3D tolerance of initial approximation represents a tolerance of
530 #        initial plate surface approximation. If this parameter is equal
531 #        to 0 (default value) it is computed. In this case an error of
532 #        initial plate surface computation is used as the approximation
533 #        tolerance. This error represents a maximal distance between
534 #        computed plate surface and given points.
535 #
536 #  @ref tui_creation_smoothingsurface "Example"
537 #  @ingroup l4_advanced
538 def MakeSmoothingSurface(self, thelPoints, theNbMax=2, theDegMax=8,
539                          theDMax=0.0, theName=None):
540     """
541     Create a surface from a cloud of points
542     
543     Parameters:
544         thelPoints list of points. Compounds of points are
545                    accepted as well.
546         theNbMax maximum number of Bezier pieces in the resulting
547                  surface.
548         theDegMax maximum degree of the resulting BSpline surface.
549         theDMax 3D tolerance of initial approximation.
550         theName Object name; when specified, this parameter is used
551                 for result publication in the study. Otherwise, if automatic
552                 publication is switched on, default value is used for result name.
553
554     Returns:
555         New GEOM_Object, containing the created shape.
556
557     Note:
558         3D tolerance of initial approximation represents a tolerance of
559         initial plate surface approximation. If this parameter is equal
560         to 0 (default value) it is computed. In this case an error of
561         initial plate surface computation is used as the approximation
562         tolerance. This error represents a maximal distance between
563         computed plate surface and given points.
564     """
565     from salome.geom.geomBuilder import RaiseIfFailed
566     anOp = GetAdvancedOperations(self)
567     anObj = anOp.MakeSmoothingSurface(thelPoints, theNbMax,
568                                       theDegMax, theDMax)
569     RaiseIfFailed("MakeSmoothingSurface", anOp)
570     self._autoPublish(anObj, theName, "smoothing")
571     anOp.UnRegister()
572     return anObj