Salome HOME
c0cd25a603a1e2946fdd62bc9c395b403650d9fe
[modules/geom.git] / src / GEOM_SWIG / geomBuilder.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2014  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
21 #  GEOM GEOM_SWIG : binding of C++ implementation with Python
22 #  File   : geomBuilder.py
23 #  Author : Paul RASCLE, EDF
24 #  Module : GEOM
25
26 """
27     \namespace geomBuilder
28     \brief Module geomBuilder
29 """
30
31 ##
32 ## @defgroup geomBuilder geomBuilder Python module
33 ## @{
34 ##
35 ## @details
36 ##
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
41 ## functions.
42 ##
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
49 ##
50 ## For example, consider the following Python script:
51 ##
52 ## @code
53 ## import salome
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New(salome.myStudy)
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box")             # explicit publishing
58 ## @endcode
59 ##
60 ## Last two lines can be replaced by one-line instruction:
61 ##
62 ## @code
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
64 ## @endcode
65 ##
66 ## ... or simply
67 ##
68 ## @code
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
70 ## @endcode
71 ##
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
76 ##
77 ## For example
78 ##
79 ## @code
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
84 ## @endcode
85 ##
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
89 ##
90 ## @code
91 ## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
92 ## @endcode
93 ##
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
95 ##
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ##   maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ##   value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ##   maximum number of sub-shapes allowed for publishing is set to specified value.
105 ##
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
112 ##
113 ## For example:
114 ##
115 ## @code
116 ## import salome
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New(salome.myStudy)
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
128 ## @endcode
129 ##
130 ## This feature can be used, for example, for debugging purposes.
131 ##
132 ## @note
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ##   \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ##   that can lead to the huge size of the study data tree.
136 ##   For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ##   command on the same main shape each time will publish all child objects, that will lead
138 ##   to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ##   shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ##   \a theName parameter (and, thus, do not support automatic publication).
143 ##   For example, some transformation operations like
144 ##   \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ##   Refer to the documentation to check if some function has such possibility.
146 ##
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
154 ##
155 ## For example:
156 ##
157 ## @code
158 ## import salome
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New(salome.myStudy)
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
167 ## @endcode
168 ##
169 ## Subfolders are also can be created by specifying another folder as a parent:
170 ##
171 ## @code
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
174 ## @endcode
175 ##
176 ## @note
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
186 ##
187 ##  \defgroup l1_publish_data
188 ##  \defgroup l1_geomBuilder_auxiliary
189 ##  \defgroup l1_geomBuilder_purpose
190 ## @}
191
192 ## @defgroup l1_publish_data Publishing results in SALOME study
193
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
195
196 ## @defgroup l1_geomBuilder_purpose   All package methods, grouped by their purpose
197 ## @{
198 ##   @defgroup l2_import_export Importing/exporting geometrical objects
199 ##   @defgroup l2_creating      Creating geometrical objects
200 ##   @{
201 ##     @defgroup l3_basic_go      Creating Basic Geometric Objects
202 ##     @{
203 ##       @defgroup l4_curves        Creating Curves
204
205 ##     @}
206 ##     @defgroup l3_3d_primitives Creating 3D Primitives
207 ##     @defgroup l3_complex       Creating Complex Objects
208 ##     @defgroup l3_groups        Working with groups
209 ##     @defgroup l3_blocks        Building by blocks
210 ##     @{
211 ##       @defgroup l4_blocks_measure Check and Improve
212
213 ##     @}
214 ##     @defgroup l3_sketcher      Sketcher
215 ##     @defgroup l3_advanced      Creating Advanced Geometrical Objects
216 ##     @{
217 ##       @defgroup l4_decompose     Decompose objects
218 ##       @defgroup l4_decompose_d   Decompose objects deprecated methods
219 ##       @defgroup l4_access        Access to sub-shapes by their unique IDs inside the main shape
220 ##       @defgroup l4_obtain        Access to sub-shapes by a criteria
221 ##       @defgroup l4_advanced      Advanced objects creation functions
222
223 ##     @}
224
225 ##   @}
226 ##   @defgroup l2_transforming  Transforming geometrical objects
227 ##   @{
228 ##     @defgroup l3_basic_op      Basic Operations
229 ##     @defgroup l3_boolean       Boolean Operations
230 ##     @defgroup l3_transform     Transformation Operations
231 ##     @defgroup l3_transform_d   Transformation Operations deprecated methods
232 ##     @defgroup l3_local         Local Operations (Fillet, Chamfer and other Features)
233 ##     @defgroup l3_blocks_op     Blocks Operations
234 ##     @defgroup l3_healing       Repairing Operations
235 ##     @defgroup l3_restore_ss    Restore presentation parameters and a tree of sub-shapes
236
237 ##   @}
238 ##   @defgroup l2_measure       Using measurement tools
239 ##   @defgroup l2_field         Field on Geometry
240
241 ## @}
242
243 # initialize SALOME session in try/except block
244 # to avoid problems in some cases, e.g. when generating documentation
245 try:
246     import salome
247     salome.salome_init()
248     from salome import *
249 except:
250     pass
251
252 from salome_notebook import *
253
254 import GEOM
255 import math
256 import os
257 import functools
258
259 from salome.geom.gsketcher import Sketcher3D, Sketcher2D
260
261 # service function
262 def _toListOfNames(_names, _size=-1):
263     l = []
264     import types
265     if type(_names) in [types.ListType, types.TupleType]:
266         for i in _names: l.append(i)
267     elif _names:
268         l.append(_names)
269     if l and len(l) < _size:
270         for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
271     return l
272
273 # Decorator function to manage transactions for all geometric operations.
274 def ManageTransactions(theOpeName):
275     def MTDecorator(theFunction):
276         # To keep the original function name an documentation.
277         @functools.wraps(theFunction)
278         def OpenCallClose(self, *args, **kwargs):
279             # Open transaction
280             anOperation = getattr(self, theOpeName)
281             anOperation.StartOperation()
282             try:
283                 # Call the function
284                 res = theFunction(self, *args, **kwargs)
285                 # Commit transaction
286                 anOperation.FinishOperation()
287                 return res
288             except:
289                 # Abort transaction
290                 anOperation.AbortOperation()
291                 raise
292         return OpenCallClose
293     return MTDecorator
294
295 ## Raise an Error, containing the Method_name, if Operation is Failed
296 ## @ingroup l1_geomBuilder_auxiliary
297 def RaiseIfFailed (Method_name, Operation):
298     if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
299         raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
300
301 ## Return list of variables value from salome notebook
302 ## @ingroup l1_geomBuilder_auxiliary
303 def ParseParameters(*parameters):
304     Result = []
305     StringResult = []
306     for parameter in parameters:
307         if isinstance(parameter, list):
308             lResults = ParseParameters(*parameter)
309             if len(lResults) > 0:
310                 Result.append(lResults[:-1])
311                 StringResult += lResults[-1].split(":")
312                 pass
313             pass
314         else:
315             if isinstance(parameter,str):
316                 if notebook.isVariable(parameter):
317                     Result.append(notebook.get(parameter))
318                 else:
319                     raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
320                 pass
321             else:
322                 Result.append(parameter)
323                 pass
324             StringResult.append(str(parameter))
325             pass
326         pass
327     if Result:
328         Result.append(":".join(StringResult))
329     else:
330         Result = ":".join(StringResult)
331     return Result
332
333 ## Return list of variables value from salome notebook
334 ## @ingroup l1_geomBuilder_auxiliary
335 def ParseList(list):
336     Result = []
337     StringResult = ""
338     for parameter in list:
339         if isinstance(parameter,str) and notebook.isVariable(parameter):
340             Result.append(str(notebook.get(parameter)))
341             pass
342         else:
343             Result.append(str(parameter))
344             pass
345
346         StringResult = StringResult + str(parameter)
347         StringResult = StringResult + ":"
348         pass
349     StringResult = StringResult[:len(StringResult)-1]
350     return Result, StringResult
351
352 ## Return list of variables value from salome notebook
353 ## @ingroup l1_geomBuilder_auxiliary
354 def ParseSketcherCommand(command):
355     Result = ""
356     StringResult = ""
357     sections = command.split(":")
358     for section in sections:
359         parameters = section.split(" ")
360         paramIndex = 1
361         for parameter in parameters:
362             if paramIndex > 1 and parameter.find("'") != -1:
363                 parameter = parameter.replace("'","")
364                 if notebook.isVariable(parameter):
365                     Result = Result + str(notebook.get(parameter)) + " "
366                     pass
367                 else:
368                     raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
369                     pass
370                 pass
371             else:
372                 Result = Result + str(parameter) + " "
373                 pass
374             if paramIndex > 1:
375                 StringResult = StringResult + parameter
376                 StringResult = StringResult + ":"
377                 pass
378             paramIndex = paramIndex + 1
379             pass
380         Result = Result[:len(Result)-1] + ":"
381         pass
382     Result = Result[:len(Result)-1]
383     return Result, StringResult
384
385 ## Helper function which can be used to pack the passed string to the byte data.
386 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
387 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
388 ## For example,
389 ## \code
390 ## val = PackData("10001110") # val = 0xAE
391 ## val = PackData("1")        # val = 0x80
392 ## \endcode
393 ## @param data unpacked data - a string containing '1' and '0' symbols
394 ## @return data packed to the byte stream
395 ## @ingroup l1_geomBuilder_auxiliary
396 def PackData(data):
397     """
398     Helper function which can be used to pack the passed string to the byte data.
399     Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
400     If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
401
402     Parameters:
403         data unpacked data - a string containing '1' and '0' symbols
404
405     Returns:
406         data packed to the byte stream
407
408     Example of usage:
409         val = PackData("10001110") # val = 0xAE
410         val = PackData("1")        # val = 0x80
411     """
412     bytes = len(data)/8
413     if len(data)%8: bytes += 1
414     res = ""
415     for b in range(bytes):
416         d = data[b*8:(b+1)*8]
417         val = 0
418         for i in range(8):
419             val *= 2
420             if i < len(d):
421                 if d[i] == "1": val += 1
422                 elif d[i] != "0":
423                     raise "Invalid symbol %s" % d[i]
424                 pass
425             pass
426         res += chr(val)
427         pass
428     return res
429
430 ## Read bitmap texture from the text file.
431 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
432 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
433 ## The function returns width and height of the pixmap in pixels and byte stream representing
434 ## texture bitmap itself.
435 ##
436 ## This function can be used to read the texture to the byte stream in order to pass it to
437 ## the AddTexture() function of geomBuilder class.
438 ## For example,
439 ## \code
440 ## from salome.geom import geomBuilder
441 ## geompy = geomBuilder.New(salome.myStudy)
442 ## texture = geompy.readtexture('mytexture.dat')
443 ## texture = geompy.AddTexture(*texture)
444 ## obj.SetMarkerTexture(texture)
445 ## \endcode
446 ## @param fname texture file name
447 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
448 ## @ingroup l1_geomBuilder_auxiliary
449 def ReadTexture(fname):
450     """
451     Read bitmap texture from the text file.
452     In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
453     A zero symbol ('0') represents transparent pixel of the texture bitmap.
454     The function returns width and height of the pixmap in pixels and byte stream representing
455     texture bitmap itself.
456     This function can be used to read the texture to the byte stream in order to pass it to
457     the AddTexture() function of geomBuilder class.
458
459     Parameters:
460         fname texture file name
461
462     Returns:
463         sequence of tree values: texture's width, height in pixels and its byte stream
464
465     Example of usage:
466         from salome.geom import geomBuilder
467         geompy = geomBuilder.New(salome.myStudy)
468         texture = geompy.readtexture('mytexture.dat')
469         texture = geompy.AddTexture(*texture)
470         obj.SetMarkerTexture(texture)
471     """
472     try:
473         f = open(fname)
474         lines = [ l.strip() for l in f.readlines()]
475         f.close()
476         maxlen = 0
477         if lines: maxlen = max([len(x) for x in lines])
478         lenbytes = maxlen/8
479         if maxlen%8: lenbytes += 1
480         bytedata=""
481         for line in lines:
482             if len(line)%8:
483                 lenline = (len(line)/8+1)*8
484                 pass
485             else:
486                 lenline = (len(line)/8)*8
487                 pass
488             for i in range(lenline/8):
489                 byte=""
490                 for j in range(8):
491                     if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
492                     else: byte += "0"
493                     pass
494                 bytedata += PackData(byte)
495                 pass
496             for i in range(lenline/8, lenbytes):
497                 bytedata += PackData("0")
498             pass
499         return lenbytes*8, len(lines), bytedata
500     except:
501         pass
502     return 0, 0, ""
503
504 ## Returns a long value from enumeration type
505 #  Can be used for CORBA enumerator types like GEOM.shape_type
506 #  @param theItem enumeration type
507 #  @ingroup l1_geomBuilder_auxiliary
508 def EnumToLong(theItem):
509     """
510     Returns a long value from enumeration type
511     Can be used for CORBA enumerator types like geomBuilder.ShapeType
512
513     Parameters:
514         theItem enumeration type
515     """
516     ret = theItem
517     if hasattr(theItem, "_v"): ret = theItem._v
518     return ret
519
520 ## Information about closed/unclosed state of shell or wire
521 #  @ingroup l1_geomBuilder_auxiliary
522 class info:
523     """
524     Information about closed/unclosed state of shell or wire
525     """
526     UNKNOWN  = 0
527     CLOSED   = 1
528     UNCLOSED = 2
529
530 ## Private class used to bind calls of plugin operations to geomBuilder
531 class PluginOperation:
532   def __init__(self, operation, function):
533     self.operation = operation
534     self.function = function
535     pass
536
537   @ManageTransactions("operation")
538   def __call__(self, *args):
539     res = self.function(self.operation, *args)
540     RaiseIfFailed(self.function.__name__, self.operation)
541     return res
542
543 # Warning: geom is a singleton
544 geom = None
545 engine = None
546 doLcc = False
547 created = False
548
549 class geomBuilder(object, GEOM._objref_GEOM_Gen):
550
551         ## Enumeration ShapeType as a dictionary. \n
552         ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
553         #  @ingroup l1_geomBuilder_auxiliary
554         ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
555
556         ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
557         #  and a list of parameters, describing the shape.
558         #  List of parameters, describing the shape:
559         #  - COMPOUND:            [nb_solids  nb_faces  nb_edges  nb_vertices]
560         #  - COMPSOLID:           [nb_solids  nb_faces  nb_edges  nb_vertices]
561         #
562         #  - SHELL:       [info.CLOSED / info.UNCLOSED  nb_faces  nb_edges  nb_vertices]
563         #
564         #  - WIRE:        [info.CLOSED / info.UNCLOSED nb_edges  nb_vertices]
565         #
566         #  - SPHERE:       [xc yc zc            R]
567         #  - CYLINDER:     [xb yb zb  dx dy dz  R         H]
568         #  - BOX:          [xc yc zc                      ax ay az]
569         #  - ROTATED_BOX:  [xc yc zc  zx zy zz  xx xy xz  ax ay az]
570         #  - TORUS:        [xc yc zc  dx dy dz  R_1  R_2]
571         #  - CONE:         [xb yb zb  dx dy dz  R_1  R_2  H]
572         #  - POLYHEDRON:                       [nb_faces  nb_edges  nb_vertices]
573         #  - SOLID:                            [nb_faces  nb_edges  nb_vertices]
574         #
575         #  - SPHERE2D:     [xc yc zc            R]
576         #  - CYLINDER2D:   [xb yb zb  dx dy dz  R         H]
577         #  - TORUS2D:      [xc yc zc  dx dy dz  R_1  R_2]
578         #  - CONE2D:       [xc yc zc  dx dy dz  R_1  R_2  H]
579         #  - DISK_CIRCLE:  [xc yc zc  dx dy dz  R]
580         #  - DISK_ELLIPSE: [xc yc zc  dx dy dz  R_1  R_2]
581         #  - POLYGON:      [xo yo zo  dx dy dz            nb_edges  nb_vertices]
582         #  - PLANE:        [xo yo zo  dx dy dz]
583         #  - PLANAR:       [xo yo zo  dx dy dz            nb_edges  nb_vertices]
584         #  - FACE:                                       [nb_edges  nb_vertices]
585         #
586         #  - CIRCLE:       [xc yc zc  dx dy dz  R]
587         #  - ARC_CIRCLE:   [xc yc zc  dx dy dz  R         x1 y1 z1  x2 y2 z2]
588         #  - ELLIPSE:      [xc yc zc  dx dy dz  R_1  R_2]
589         #  - ARC_ELLIPSE:  [xc yc zc  dx dy dz  R_1  R_2  x1 y1 z1  x2 y2 z2]
590         #  - LINE:         [xo yo zo  dx dy dz]
591         #  - SEGMENT:      [x1 y1 z1  x2 y2 z2]
592         #  - EDGE:                                                 [nb_vertices]
593         #
594         #  - VERTEX:       [x  y  z]
595         #  @ingroup l1_geomBuilder_auxiliary
596         kind = GEOM.GEOM_IKindOfShape
597
598         def __new__(cls):
599             global engine
600             global geom
601             global doLcc
602             global created
603             #print "==== __new__ ", engine, geom, doLcc, created
604             if geom is None:
605                 # geom engine is either retrieved from engine, or created
606                 geom = engine
607                 # Following test avoids a recursive loop
608                 if doLcc:
609                     if geom is not None:
610                         # geom engine not created: existing engine found
611                         doLcc = False
612                     if doLcc and not created:
613                         doLcc = False
614                         # FindOrLoadComponent called:
615                         # 1. CORBA resolution of server
616                         # 2. the __new__ method is called again
617                         #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
618                         geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
619                         #print "====1 ",geom
620                 else:
621                     # FindOrLoadComponent not called
622                     if geom is None:
623                         # geomBuilder instance is created from lcc.FindOrLoadComponent
624                         #print "==== super ", engine, geom, doLcc, created
625                         geom = super(geomBuilder,cls).__new__(cls)
626                         #print "====2 ",geom
627                     else:
628                         # geom engine not created: existing engine found
629                         #print "==== existing ", engine, geom, doLcc, created
630                         pass
631                 #print "return geom 1 ", geom
632                 return geom
633
634             #print "return geom 2 ", geom
635             return geom
636
637         def __init__(self):
638             global created
639             #print "-------- geomBuilder __init__ --- ", created, self
640             if not created:
641               created = True
642               GEOM._objref_GEOM_Gen.__init__(self)
643               self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
644               self.myBuilder = None
645               self.myStudyId = 0
646               self.father    = None
647
648               self.BasicOp  = None
649               self.CurvesOp = None
650               self.PrimOp   = None
651               self.ShapesOp = None
652               self.HealOp   = None
653               self.InsertOp = None
654               self.BoolOp   = None
655               self.TrsfOp   = None
656               self.LocalOp  = None
657               self.MeasuOp  = None
658               self.BlocksOp = None
659               self.GroupOp  = None
660               self.FieldOp  = None
661             pass
662
663         ## Process object publication in the study, as follows:
664         #  - if @a theName is specified (not None), the object is published in the study
665         #    with this name, not taking into account "auto-publishing" option;
666         #  - if @a theName is NOT specified, the object is published in the study
667         #    (using default name, which can be customized using @a theDefaultName parameter)
668         #    only if auto-publishing is switched on.
669         #
670         #  @param theObj  object, a subject for publishing
671         #  @param theName object name for study
672         #  @param theDefaultName default name for the auto-publishing
673         #
674         #  @sa addToStudyAuto()
675         def _autoPublish(self, theObj, theName, theDefaultName="noname"):
676             # ---
677             def _item_name(_names, _defname, _idx=-1):
678                 if not _names: _names = _defname
679                 if type(_names) in [types.ListType, types.TupleType]:
680                     if _idx >= 0:
681                         if _idx >= len(_names) or not _names[_idx]:
682                             if type(_defname) not in [types.ListType, types.TupleType]:
683                                 _name = "%s_%d"%(_defname, _idx+1)
684                             elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
685                                 _name = _defname[_idx]
686                             else:
687                                 _name = "%noname_%d"%(dn, _idx+1)
688                             pass
689                         else:
690                             _name = _names[_idx]
691                         pass
692                     else:
693                         # must be wrong  usage
694                         _name = _names[0]
695                     pass
696                 else:
697                     if _idx >= 0:
698                         _name = "%s_%d"%(_names, _idx+1)
699                     else:
700                         _name = _names
701                     pass
702                 return _name
703             # ---
704             def _publish( _name, _obj ):
705                 fatherObj = None
706                 if isinstance( _obj, GEOM._objref_GEOM_Field ):
707                     fatherObj = _obj.GetShape()
708                 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
709                     fatherObj = _obj.GetField()
710                 elif not _obj.IsMainShape():
711                     fatherObj = _obj.GetMainShape()
712                     pass
713                 if fatherObj and fatherObj.GetStudyEntry():
714                     self.addToStudyInFather(fatherObj, _obj, _name)
715                 else:
716                     self.addToStudy(_obj, _name)
717                     pass
718                 return
719             # ---
720             if not theObj:
721                 return # null object
722             if not theName and not self.myMaxNbSubShapesAllowed:
723                 return # nothing to do: auto-publishing is disabled
724             if not theName and not theDefaultName:
725                 return # neither theName nor theDefaultName is given
726             import types
727             if type(theObj) in [types.ListType, types.TupleType]:
728                 # list of objects is being published
729                 idx = 0
730                 for obj in theObj:
731                     if not obj: continue # bad object
732                     name = _item_name(theName, theDefaultName, idx)
733                     _publish( name, obj )
734                     idx = idx+1
735                     if not theName and idx == self.myMaxNbSubShapesAllowed: break
736                     pass
737                 pass
738             else:
739                 # single object is published
740                 name = _item_name(theName, theDefaultName)
741                 _publish( name, theObj )
742             pass
743
744         ## @addtogroup l1_geomBuilder_auxiliary
745         ## @{
746         def init_geom(self,theStudy):
747             self.myStudy = theStudy
748             self.myStudyId = self.myStudy._get_StudyId()
749             self.myBuilder = self.myStudy.NewBuilder()
750             self.father = self.myStudy.FindComponent("GEOM")
751             notebook.myStudy = theStudy
752             if self.father is None:
753                 self.father = self.myBuilder.NewComponent("GEOM")
754                 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
755                 FName = A1._narrow(SALOMEDS.AttributeName)
756                 FName.SetValue("Geometry")
757                 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
758                 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
759                 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
760                 self.myBuilder.DefineComponentInstance(self.father,self)
761                 pass
762             self.BasicOp  = self.GetIBasicOperations    (self.myStudyId)
763             self.CurvesOp = self.GetICurvesOperations   (self.myStudyId)
764             self.PrimOp   = self.GetI3DPrimOperations   (self.myStudyId)
765             self.ShapesOp = self.GetIShapesOperations   (self.myStudyId)
766             self.HealOp   = self.GetIHealingOperations  (self.myStudyId)
767             self.InsertOp = self.GetIInsertOperations   (self.myStudyId)
768             self.BoolOp   = self.GetIBooleanOperations  (self.myStudyId)
769             self.TrsfOp   = self.GetITransformOperations(self.myStudyId)
770             self.LocalOp  = self.GetILocalOperations    (self.myStudyId)
771             self.MeasuOp  = self.GetIMeasureOperations  (self.myStudyId)
772             self.BlocksOp = self.GetIBlocksOperations   (self.myStudyId)
773             self.GroupOp  = self.GetIGroupOperations    (self.myStudyId)
774             self.FieldOp  = self.GetIFieldOperations    (self.myStudyId)
775
776             # set GEOM as root in the use case tree
777             self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
778             self.myUseCaseBuilder.SetRootCurrent()
779             self.myUseCaseBuilder.Append(self.father)
780             pass
781
782         def GetPluginOperations(self, studyID, libraryName):
783             op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
784             return op
785
786         ## Enable / disable results auto-publishing
787         #
788         #  The automatic publishing is managed in the following way:
789         #  - if @a maxNbSubShapes = 0, automatic publishing is disabled.
790         #  - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
791         #  maximum number of sub-shapes allowed for publishing is unlimited; any negative
792         #  value passed as parameter has the same effect.
793         #  - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
794         #  maximum number of sub-shapes allowed for publishing is set to specified value.
795         #
796         #  @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
797         #  @ingroup l1_publish_data
798         def addToStudyAuto(self, maxNbSubShapes=-1):
799             """
800             Enable / disable results auto-publishing
801
802             The automatic publishing is managed in the following way:
803             - if @a maxNbSubShapes = 0, automatic publishing is disabled;
804             - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
805             maximum number of sub-shapes allowed for publishing is unlimited; any negative
806             value passed as parameter has the same effect.
807             - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
808             maximum number of sub-shapes allowed for publishing is set to this value.
809
810             Parameters:
811                 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
812
813             Example of usage:
814                 geompy.addToStudyAuto()   # enable auto-publishing
815                 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
816                 geompy.addToStudyAuto(0)  # disable auto-publishing
817             """
818             self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
819             pass
820
821         ## Dump component to the Python script
822         #  This method overrides IDL function to allow default values for the parameters.
823         def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
824             """
825             Dump component to the Python script
826             This method overrides IDL function to allow default values for the parameters.
827             """
828             return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
829
830         ## Get name for sub-shape aSubObj of shape aMainObj
831         #
832         # @ref swig_SubShapeName "Example"
833         @ManageTransactions("ShapesOp")
834         def SubShapeName(self,aSubObj, aMainObj):
835             """
836             Get name for sub-shape aSubObj of shape aMainObj
837             """
838             # Example: see GEOM_TestAll.py
839
840             #aSubId  = orb.object_to_string(aSubObj)
841             #aMainId = orb.object_to_string(aMainObj)
842             #index = gg.getIndexTopology(aSubId, aMainId)
843             #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
844             index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
845             name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
846             return name
847
848         ## Publish in study aShape with name aName
849         #
850         #  \param aShape the shape to be published
851         #  \param aName  the name for the shape
852         #  \param doRestoreSubShapes if True, finds and publishes also
853         #         sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
854         #         and published sub-shapes of arguments
855         #  \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
856         #                                                  these arguments description
857         #  \return study entry of the published shape in form of string
858         #
859         #  @ingroup l1_publish_data
860         #  @ref swig_all_addtostudy "Example"
861         def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
862                        theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
863             """
864             Publish in study aShape with name aName
865
866             Parameters:
867                 aShape the shape to be published
868                 aName  the name for the shape
869                 doRestoreSubShapes if True, finds and publishes also
870                                    sub-shapes of aShape, corresponding to its arguments
871                                    and published sub-shapes of arguments
872                 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
873                                                          these arguments description
874
875             Returns:
876                 study entry of the published shape in form of string
877
878             Example of usage:
879                 id_block1 = geompy.addToStudy(Block1, "Block 1")
880             """
881             # Example: see GEOM_TestAll.py
882             try:
883                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
884                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
885                 if doRestoreSubShapes:
886                     self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
887                                             theFindMethod, theInheritFirstArg, True )
888             except:
889                 print "addToStudy() failed"
890                 return ""
891             return aShape.GetStudyEntry()
892
893         ## Publish in study aShape with name aName as sub-object of previously published aFather
894         #  \param aFather previously published object
895         #  \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
896         #  \param aName  the name for the shape
897         #
898         #  \return study entry of the published shape in form of string
899         #
900         #  @ingroup l1_publish_data
901         #  @ref swig_all_addtostudyInFather "Example"
902         def addToStudyInFather(self, aFather, aShape, aName):
903             """
904             Publish in study aShape with name aName as sub-object of previously published aFather
905
906             Parameters:
907                 aFather previously published object
908                 aShape the shape to be published as sub-object of aFather
909                 aName  the name for the shape
910
911             Returns:
912                 study entry of the published shape in form of string
913             """
914             # Example: see GEOM_TestAll.py
915             try:
916                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
917                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
918             except:
919                 print "addToStudyInFather() failed"
920                 return ""
921             return aShape.GetStudyEntry()
922
923         ## Unpublish object in study
924         #
925         #  \param obj the object to be unpublished
926         def hideInStudy(self, obj):
927             """
928             Unpublish object in study
929
930             Parameters:
931                 obj the object to be unpublished
932             """
933             ior = salome.orb.object_to_string(obj)
934             aSObject = self.myStudy.FindObjectIOR(ior)
935             if aSObject is not None:
936                 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
937                 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
938                 drwAttribute.SetDrawable(False)
939                 # hide references if any
940                 vso = self.myStudy.FindDependances(aSObject);
941                 for refObj in vso :
942                     genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
943                     drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
944                     drwAttribute.SetDrawable(False)
945                     pass
946                 pass
947
948         # end of l1_geomBuilder_auxiliary
949         ## @}
950
951         ## @addtogroup l3_restore_ss
952         ## @{
953
954         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
955         #  To be used from python scripts out of addToStudy() (non-default usage)
956         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
957         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
958         #                   If this list is empty, all operation arguments will be published
959         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
960         #                       their sub-shapes. Value from enumeration GEOM.find_shape_method.
961         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
962         #                            Do not publish sub-shapes in place of arguments, but only
963         #                            in place of sub-shapes of the first argument,
964         #                            because the whole shape corresponds to the first argument.
965         #                            Mainly to be used after transformations, but it also can be
966         #                            usefull after partition with one object shape, and some other
967         #                            operations, where only the first argument has to be considered.
968         #                            If theObject has only one argument shape, this flag is automatically
969         #                            considered as True, not regarding really passed value.
970         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
971         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
972         #  \return list of published sub-shapes
973         #
974         #  @ref tui_restore_prs_params "Example"
975         def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
976                               theInheritFirstArg=False, theAddPrefix=True):
977             """
978             Publish sub-shapes, standing for arguments and sub-shapes of arguments
979             To be used from python scripts out of geompy.addToStudy (non-default usage)
980
981             Parameters:
982                 theObject published GEOM.GEOM_Object, arguments of which will be published
983                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
984                           If this list is empty, all operation arguments will be published
985                 theFindMethod method to search sub-shapes, corresponding to arguments and
986                               their sub-shapes. Value from enumeration GEOM.find_shape_method.
987                 theInheritFirstArg set properties of the first argument for theObject.
988                                    Do not publish sub-shapes in place of arguments, but only
989                                    in place of sub-shapes of the first argument,
990                                    because the whole shape corresponds to the first argument.
991                                    Mainly to be used after transformations, but it also can be
992                                    usefull after partition with one object shape, and some other
993                                    operations, where only the first argument has to be considered.
994                                    If theObject has only one argument shape, this flag is automatically
995                                    considered as True, not regarding really passed value.
996                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
997                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
998             Returns:
999                 list of published sub-shapes
1000             """
1001             # Example: see GEOM_TestAll.py
1002             return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1003                                           theFindMethod, theInheritFirstArg, theAddPrefix)
1004
1005         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1006         #  To be used from python scripts out of addToStudy() (non-default usage)
1007         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
1008         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1009         #                   If this list is empty, all operation arguments will be published
1010         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
1011         #                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
1012         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1013         #                            Do not publish sub-shapes in place of arguments, but only
1014         #                            in place of sub-shapes of the first argument,
1015         #                            because the whole shape corresponds to the first argument.
1016         #                            Mainly to be used after transformations, but it also can be
1017         #                            usefull after partition with one object shape, and some other
1018         #                            operations, where only the first argument has to be considered.
1019         #                            If theObject has only one argument shape, this flag is automatically
1020         #                            considered as True, not regarding really passed value.
1021         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1022         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1023         #  \return list of published sub-shapes
1024         #
1025         #  @ref tui_restore_prs_params "Example"
1026         def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1027                                    theInheritFirstArg=False, theAddPrefix=True):
1028             """
1029             Publish sub-shapes, standing for arguments and sub-shapes of arguments
1030             To be used from python scripts out of geompy.addToStudy() (non-default usage)
1031
1032             Parameters:
1033                 theObject published GEOM.GEOM_Object, arguments of which will be published
1034                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1035                           If this list is empty, all operation arguments will be published
1036                 theFindMethod method to search sub-shapes, corresponding to arguments and
1037                               their sub-shapes. Value from enumeration GEOM::find_shape_method.
1038                 theInheritFirstArg set properties of the first argument for theObject.
1039                                    Do not publish sub-shapes in place of arguments, but only
1040                                    in place of sub-shapes of the first argument,
1041                                    because the whole shape corresponds to the first argument.
1042                                    Mainly to be used after transformations, but it also can be
1043                                    usefull after partition with one object shape, and some other
1044                                    operations, where only the first argument has to be considered.
1045                                    If theObject has only one argument shape, this flag is automatically
1046                                    considered as True, not regarding really passed value.
1047                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1048                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1049
1050             Returns:
1051                 list of published sub-shapes
1052             """
1053             # Example: see GEOM_TestAll.py
1054             return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1055                                                theFindMethod, theInheritFirstArg, theAddPrefix)
1056
1057         # end of l3_restore_ss
1058         ## @}
1059
1060         ## @addtogroup l3_basic_go
1061         ## @{
1062
1063         ## Create point by three coordinates.
1064         #  @param theX The X coordinate of the point.
1065         #  @param theY The Y coordinate of the point.
1066         #  @param theZ The Z coordinate of the point.
1067         #  @param theName Object name; when specified, this parameter is used
1068         #         for result publication in the study. Otherwise, if automatic
1069         #         publication is switched on, default value is used for result name.
1070         #
1071         #  @return New GEOM.GEOM_Object, containing the created point.
1072         #
1073         #  @ref tui_creation_point "Example"
1074         @ManageTransactions("BasicOp")
1075         def MakeVertex(self, theX, theY, theZ, theName=None):
1076             """
1077             Create point by three coordinates.
1078
1079             Parameters:
1080                 theX The X coordinate of the point.
1081                 theY The Y coordinate of the point.
1082                 theZ The Z coordinate of the point.
1083                 theName Object name; when specified, this parameter is used
1084                         for result publication in the study. Otherwise, if automatic
1085                         publication is switched on, default value is used for result name.
1086
1087             Returns:
1088                 New GEOM.GEOM_Object, containing the created point.
1089             """
1090             # Example: see GEOM_TestAll.py
1091             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1092             anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1093             RaiseIfFailed("MakePointXYZ", self.BasicOp)
1094             anObj.SetParameters(Parameters)
1095             self._autoPublish(anObj, theName, "vertex")
1096             return anObj
1097
1098         ## Create a point, distant from the referenced point
1099         #  on the given distances along the coordinate axes.
1100         #  @param theReference The referenced point.
1101         #  @param theX Displacement from the referenced point along OX axis.
1102         #  @param theY Displacement from the referenced point along OY axis.
1103         #  @param theZ Displacement from the referenced point along OZ axis.
1104         #  @param theName Object name; when specified, this parameter is used
1105         #         for result publication in the study. Otherwise, if automatic
1106         #         publication is switched on, default value is used for result name.
1107         #
1108         #  @return New GEOM.GEOM_Object, containing the created point.
1109         #
1110         #  @ref tui_creation_point "Example"
1111         @ManageTransactions("BasicOp")
1112         def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1113             """
1114             Create a point, distant from the referenced point
1115             on the given distances along the coordinate axes.
1116
1117             Parameters:
1118                 theReference The referenced point.
1119                 theX Displacement from the referenced point along OX axis.
1120                 theY Displacement from the referenced point along OY axis.
1121                 theZ Displacement from the referenced point along OZ axis.
1122                 theName Object name; when specified, this parameter is used
1123                         for result publication in the study. Otherwise, if automatic
1124                         publication is switched on, default value is used for result name.
1125
1126             Returns:
1127                 New GEOM.GEOM_Object, containing the created point.
1128             """
1129             # Example: see GEOM_TestAll.py
1130             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1131             anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1132             RaiseIfFailed("MakePointWithReference", self.BasicOp)
1133             anObj.SetParameters(Parameters)
1134             self._autoPublish(anObj, theName, "vertex")
1135             return anObj
1136
1137         ## Create a point, corresponding to the given parameter on the given curve.
1138         #  @param theRefCurve The referenced curve.
1139         #  @param theParameter Value of parameter on the referenced curve.
1140         #  @param theName Object name; when specified, this parameter is used
1141         #         for result publication in the study. Otherwise, if automatic
1142         #         publication is switched on, default value is used for result name.
1143         #
1144         #  @return New GEOM.GEOM_Object, containing the created point.
1145         #
1146         #  @ref tui_creation_point "Example"
1147         @ManageTransactions("BasicOp")
1148         def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1149             """
1150             Create a point, corresponding to the given parameter on the given curve.
1151
1152             Parameters:
1153                 theRefCurve The referenced curve.
1154                 theParameter Value of parameter on the referenced curve.
1155                 theName Object name; when specified, this parameter is used
1156                         for result publication in the study. Otherwise, if automatic
1157                         publication is switched on, default value is used for result name.
1158
1159             Returns:
1160                 New GEOM.GEOM_Object, containing the created point.
1161
1162             Example of usage:
1163                 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1164             """
1165             # Example: see GEOM_TestAll.py
1166             theParameter, Parameters = ParseParameters(theParameter)
1167             anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1168             RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1169             anObj.SetParameters(Parameters)
1170             self._autoPublish(anObj, theName, "vertex")
1171             return anObj
1172
1173         ## Create a point by projection give coordinates on the given curve
1174         #  @param theRefCurve The referenced curve.
1175         #  @param theX X-coordinate in 3D space
1176         #  @param theY Y-coordinate in 3D space
1177         #  @param theZ Z-coordinate in 3D space
1178         #  @param theName Object name; when specified, this parameter is used
1179         #         for result publication in the study. Otherwise, if automatic
1180         #         publication is switched on, default value is used for result name.
1181         #
1182         #  @return New GEOM.GEOM_Object, containing the created point.
1183         #
1184         #  @ref tui_creation_point "Example"
1185         @ManageTransactions("BasicOp")
1186         def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1187             """
1188             Create a point by projection give coordinates on the given curve
1189
1190             Parameters:
1191                 theRefCurve The referenced curve.
1192                 theX X-coordinate in 3D space
1193                 theY Y-coordinate in 3D space
1194                 theZ Z-coordinate in 3D space
1195                 theName Object name; when specified, this parameter is used
1196                         for result publication in the study. Otherwise, if automatic
1197                         publication is switched on, default value is used for result name.
1198
1199             Returns:
1200                 New GEOM.GEOM_Object, containing the created point.
1201
1202             Example of usage:
1203                 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1204             """
1205             # Example: see GEOM_TestAll.py
1206             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1207             anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1208             RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1209             anObj.SetParameters(Parameters)
1210             self._autoPublish(anObj, theName, "vertex")
1211             return anObj
1212
1213         ## Create a point, corresponding to the given length on the given curve.
1214         #  @param theRefCurve The referenced curve.
1215         #  @param theLength Length on the referenced curve. It can be negative.
1216         #  @param theStartPoint Point allowing to choose the direction for the calculation
1217         #                       of the length. If None, start from the first point of theRefCurve.
1218         #  @param theName Object name; when specified, this parameter is used
1219         #         for result publication in the study. Otherwise, if automatic
1220         #         publication is switched on, default value is used for result name.
1221         #
1222         #  @return New GEOM.GEOM_Object, containing the created point.
1223         #
1224         #  @ref tui_creation_point "Example"
1225         @ManageTransactions("BasicOp")
1226         def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1227             """
1228             Create a point, corresponding to the given length on the given curve.
1229
1230             Parameters:
1231                 theRefCurve The referenced curve.
1232                 theLength Length on the referenced curve. It can be negative.
1233                 theStartPoint Point allowing to choose the direction for the calculation
1234                               of the length. If None, start from the first point of theRefCurve.
1235                 theName Object name; when specified, this parameter is used
1236                         for result publication in the study. Otherwise, if automatic
1237                         publication is switched on, default value is used for result name.
1238
1239             Returns:
1240                 New GEOM.GEOM_Object, containing the created point.
1241             """
1242             # Example: see GEOM_TestAll.py
1243             theLength, Parameters = ParseParameters(theLength)
1244             anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1245             RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1246             anObj.SetParameters(Parameters)
1247             self._autoPublish(anObj, theName, "vertex")
1248             return anObj
1249
1250         ## Create a point, corresponding to the given parameters on the
1251         #    given surface.
1252         #  @param theRefSurf The referenced surface.
1253         #  @param theUParameter Value of U-parameter on the referenced surface.
1254         #  @param theVParameter Value of V-parameter on the referenced surface.
1255         #  @param theName Object name; when specified, this parameter is used
1256         #         for result publication in the study. Otherwise, if automatic
1257         #         publication is switched on, default value is used for result name.
1258         #
1259         #  @return New GEOM.GEOM_Object, containing the created point.
1260         #
1261         #  @ref swig_MakeVertexOnSurface "Example"
1262         @ManageTransactions("BasicOp")
1263         def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1264             """
1265             Create a point, corresponding to the given parameters on the
1266             given surface.
1267
1268             Parameters:
1269                 theRefSurf The referenced surface.
1270                 theUParameter Value of U-parameter on the referenced surface.
1271                 theVParameter Value of V-parameter on the referenced surface.
1272                 theName Object name; when specified, this parameter is used
1273                         for result publication in the study. Otherwise, if automatic
1274                         publication is switched on, default value is used for result name.
1275
1276             Returns:
1277                 New GEOM.GEOM_Object, containing the created point.
1278
1279             Example of usage:
1280                 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1281             """
1282             theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1283             # Example: see GEOM_TestAll.py
1284             anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1285             RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1286             anObj.SetParameters(Parameters);
1287             self._autoPublish(anObj, theName, "vertex")
1288             return anObj
1289
1290         ## Create a point by projection give coordinates on the given surface
1291         #  @param theRefSurf The referenced surface.
1292         #  @param theX X-coordinate in 3D space
1293         #  @param theY Y-coordinate in 3D space
1294         #  @param theZ Z-coordinate in 3D space
1295         #  @param theName Object name; when specified, this parameter is used
1296         #         for result publication in the study. Otherwise, if automatic
1297         #         publication is switched on, default value is used for result name.
1298         #
1299         #  @return New GEOM.GEOM_Object, containing the created point.
1300         #
1301         #  @ref swig_MakeVertexOnSurfaceByCoord "Example"
1302         @ManageTransactions("BasicOp")
1303         def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1304             """
1305             Create a point by projection give coordinates on the given surface
1306
1307             Parameters:
1308                 theRefSurf The referenced surface.
1309                 theX X-coordinate in 3D space
1310                 theY Y-coordinate in 3D space
1311                 theZ Z-coordinate in 3D space
1312                 theName Object name; when specified, this parameter is used
1313                         for result publication in the study. Otherwise, if automatic
1314                         publication is switched on, default value is used for result name.
1315
1316             Returns:
1317                 New GEOM.GEOM_Object, containing the created point.
1318
1319             Example of usage:
1320                 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1321             """
1322             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1323             # Example: see GEOM_TestAll.py
1324             anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1325             RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1326             anObj.SetParameters(Parameters);
1327             self._autoPublish(anObj, theName, "vertex")
1328             return anObj
1329
1330         ## Create a point, which lays on the given face.
1331         #  The point will lay in arbitrary place of the face.
1332         #  The only condition on it is a non-zero distance to the face boundary.
1333         #  Such point can be used to uniquely identify the face inside any
1334         #  shape in case, when the shape does not contain overlapped faces.
1335         #  @param theFace The referenced face.
1336         #  @param theName Object name; when specified, this parameter is used
1337         #         for result publication in the study. Otherwise, if automatic
1338         #         publication is switched on, default value is used for result name.
1339         #
1340         #  @return New GEOM.GEOM_Object, containing the created point.
1341         #
1342         #  @ref swig_MakeVertexInsideFace "Example"
1343         @ManageTransactions("BasicOp")
1344         def MakeVertexInsideFace (self, theFace, theName=None):
1345             """
1346             Create a point, which lays on the given face.
1347             The point will lay in arbitrary place of the face.
1348             The only condition on it is a non-zero distance to the face boundary.
1349             Such point can be used to uniquely identify the face inside any
1350             shape in case, when the shape does not contain overlapped faces.
1351
1352             Parameters:
1353                 theFace The referenced face.
1354                 theName Object name; when specified, this parameter is used
1355                         for result publication in the study. Otherwise, if automatic
1356                         publication is switched on, default value is used for result name.
1357
1358             Returns:
1359                 New GEOM.GEOM_Object, containing the created point.
1360
1361             Example of usage:
1362                 p_on_face = geompy.MakeVertexInsideFace(Face)
1363             """
1364             # Example: see GEOM_TestAll.py
1365             anObj = self.BasicOp.MakePointOnFace(theFace)
1366             RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1367             self._autoPublish(anObj, theName, "vertex")
1368             return anObj
1369
1370         ## Create a point on intersection of two lines.
1371         #  @param theRefLine1, theRefLine2 The referenced lines.
1372         #  @param theName Object name; when specified, this parameter is used
1373         #         for result publication in the study. Otherwise, if automatic
1374         #         publication is switched on, default value is used for result name.
1375         #
1376         #  @return New GEOM.GEOM_Object, containing the created point.
1377         #
1378         #  @ref swig_MakeVertexOnLinesIntersection "Example"
1379         @ManageTransactions("BasicOp")
1380         def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1381             """
1382             Create a point on intersection of two lines.
1383
1384             Parameters:
1385                 theRefLine1, theRefLine2 The referenced lines.
1386                 theName Object name; when specified, this parameter is used
1387                         for result publication in the study. Otherwise, if automatic
1388                         publication is switched on, default value is used for result name.
1389
1390             Returns:
1391                 New GEOM.GEOM_Object, containing the created point.
1392             """
1393             # Example: see GEOM_TestAll.py
1394             anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1395             RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1396             self._autoPublish(anObj, theName, "vertex")
1397             return anObj
1398
1399         ## Create a tangent, corresponding to the given parameter on the given curve.
1400         #  @param theRefCurve The referenced curve.
1401         #  @param theParameter Value of parameter on the referenced curve.
1402         #  @param theName Object name; when specified, this parameter is used
1403         #         for result publication in the study. Otherwise, if automatic
1404         #         publication is switched on, default value is used for result name.
1405         #
1406         #  @return New GEOM.GEOM_Object, containing the created tangent.
1407         #
1408         #  @ref swig_MakeTangentOnCurve "Example"
1409         @ManageTransactions("BasicOp")
1410         def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1411             """
1412             Create a tangent, corresponding to the given parameter on the given curve.
1413
1414             Parameters:
1415                 theRefCurve The referenced curve.
1416                 theParameter Value of parameter on the referenced curve.
1417                 theName Object name; when specified, this parameter is used
1418                         for result publication in the study. Otherwise, if automatic
1419                         publication is switched on, default value is used for result name.
1420
1421             Returns:
1422                 New GEOM.GEOM_Object, containing the created tangent.
1423
1424             Example of usage:
1425                 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1426             """
1427             anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1428             RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1429             self._autoPublish(anObj, theName, "tangent")
1430             return anObj
1431
1432         ## Create a tangent plane, corresponding to the given parameter on the given face.
1433         #  @param theFace The face for which tangent plane should be built.
1434         #  @param theParameterV vertical value of the center point (0.0 - 1.0).
1435         #  @param theParameterU horisontal value of the center point (0.0 - 1.0).
1436         #  @param theTrimSize the size of plane.
1437         #  @param theName Object name; when specified, this parameter is used
1438         #         for result publication in the study. Otherwise, if automatic
1439         #         publication is switched on, default value is used for result name.
1440         #
1441         #  @return New GEOM.GEOM_Object, containing the created tangent.
1442         #
1443         #  @ref swig_MakeTangentPlaneOnFace "Example"
1444         @ManageTransactions("BasicOp")
1445         def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1446             """
1447             Create a tangent plane, corresponding to the given parameter on the given face.
1448
1449             Parameters:
1450                 theFace The face for which tangent plane should be built.
1451                 theParameterV vertical value of the center point (0.0 - 1.0).
1452                 theParameterU horisontal value of the center point (0.0 - 1.0).
1453                 theTrimSize the size of plane.
1454                 theName Object name; when specified, this parameter is used
1455                         for result publication in the study. Otherwise, if automatic
1456                         publication is switched on, default value is used for result name.
1457
1458            Returns:
1459                 New GEOM.GEOM_Object, containing the created tangent.
1460
1461            Example of usage:
1462                 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1463             """
1464             anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1465             RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1466             self._autoPublish(anObj, theName, "tangent")
1467             return anObj
1468
1469         ## Create a vector with the given components.
1470         #  @param theDX X component of the vector.
1471         #  @param theDY Y component of the vector.
1472         #  @param theDZ Z component of the vector.
1473         #  @param theName Object name; when specified, this parameter is used
1474         #         for result publication in the study. Otherwise, if automatic
1475         #         publication is switched on, default value is used for result name.
1476         #
1477         #  @return New GEOM.GEOM_Object, containing the created vector.
1478         #
1479         #  @ref tui_creation_vector "Example"
1480         @ManageTransactions("BasicOp")
1481         def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1482             """
1483             Create a vector with the given components.
1484
1485             Parameters:
1486                 theDX X component of the vector.
1487                 theDY Y component of the vector.
1488                 theDZ Z component of the vector.
1489                 theName Object name; when specified, this parameter is used
1490                         for result publication in the study. Otherwise, if automatic
1491                         publication is switched on, default value is used for result name.
1492
1493             Returns:
1494                 New GEOM.GEOM_Object, containing the created vector.
1495             """
1496             # Example: see GEOM_TestAll.py
1497             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1498             anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1499             RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1500             anObj.SetParameters(Parameters)
1501             self._autoPublish(anObj, theName, "vector")
1502             return anObj
1503
1504         ## Create a vector between two points.
1505         #  @param thePnt1 Start point for the vector.
1506         #  @param thePnt2 End point for the vector.
1507         #  @param theName Object name; when specified, this parameter is used
1508         #         for result publication in the study. Otherwise, if automatic
1509         #         publication is switched on, default value is used for result name.
1510         #
1511         #  @return New GEOM.GEOM_Object, containing the created vector.
1512         #
1513         #  @ref tui_creation_vector "Example"
1514         @ManageTransactions("BasicOp")
1515         def MakeVector(self, thePnt1, thePnt2, theName=None):
1516             """
1517             Create a vector between two points.
1518
1519             Parameters:
1520                 thePnt1 Start point for the vector.
1521                 thePnt2 End point for the vector.
1522                 theName Object name; when specified, this parameter is used
1523                         for result publication in the study. Otherwise, if automatic
1524                         publication is switched on, default value is used for result name.
1525
1526             Returns:
1527                 New GEOM.GEOM_Object, containing the created vector.
1528             """
1529             # Example: see GEOM_TestAll.py
1530             anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1531             RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1532             self._autoPublish(anObj, theName, "vector")
1533             return anObj
1534
1535         ## Create a line, passing through the given point
1536         #  and parrallel to the given direction
1537         #  @param thePnt Point. The resulting line will pass through it.
1538         #  @param theDir Direction. The resulting line will be parallel to it.
1539         #  @param theName Object name; when specified, this parameter is used
1540         #         for result publication in the study. Otherwise, if automatic
1541         #         publication is switched on, default value is used for result name.
1542         #
1543         #  @return New GEOM.GEOM_Object, containing the created line.
1544         #
1545         #  @ref tui_creation_line "Example"
1546         @ManageTransactions("BasicOp")
1547         def MakeLine(self, thePnt, theDir, theName=None):
1548             """
1549             Create a line, passing through the given point
1550             and parrallel to the given direction
1551
1552             Parameters:
1553                 thePnt Point. The resulting line will pass through it.
1554                 theDir Direction. The resulting line will be parallel to it.
1555                 theName Object name; when specified, this parameter is used
1556                         for result publication in the study. Otherwise, if automatic
1557                         publication is switched on, default value is used for result name.
1558
1559             Returns:
1560                 New GEOM.GEOM_Object, containing the created line.
1561             """
1562             # Example: see GEOM_TestAll.py
1563             anObj = self.BasicOp.MakeLine(thePnt, theDir)
1564             RaiseIfFailed("MakeLine", self.BasicOp)
1565             self._autoPublish(anObj, theName, "line")
1566             return anObj
1567
1568         ## Create a line, passing through the given points
1569         #  @param thePnt1 First of two points, defining the line.
1570         #  @param thePnt2 Second of two points, defining the line.
1571         #  @param theName Object name; when specified, this parameter is used
1572         #         for result publication in the study. Otherwise, if automatic
1573         #         publication is switched on, default value is used for result name.
1574         #
1575         #  @return New GEOM.GEOM_Object, containing the created line.
1576         #
1577         #  @ref tui_creation_line "Example"
1578         @ManageTransactions("BasicOp")
1579         def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1580             """
1581             Create a line, passing through the given points
1582
1583             Parameters:
1584                 thePnt1 First of two points, defining the line.
1585                 thePnt2 Second of two points, defining the line.
1586                 theName Object name; when specified, this parameter is used
1587                         for result publication in the study. Otherwise, if automatic
1588                         publication is switched on, default value is used for result name.
1589
1590             Returns:
1591                 New GEOM.GEOM_Object, containing the created line.
1592             """
1593             # Example: see GEOM_TestAll.py
1594             anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1595             RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1596             self._autoPublish(anObj, theName, "line")
1597             return anObj
1598
1599         ## Create a line on two faces intersection.
1600         #  @param theFace1 First of two faces, defining the line.
1601         #  @param theFace2 Second of two faces, defining the line.
1602         #  @param theName Object name; when specified, this parameter is used
1603         #         for result publication in the study. Otherwise, if automatic
1604         #         publication is switched on, default value is used for result name.
1605         #
1606         #  @return New GEOM.GEOM_Object, containing the created line.
1607         #
1608         #  @ref swig_MakeLineTwoFaces "Example"
1609         @ManageTransactions("BasicOp")
1610         def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1611             """
1612             Create a line on two faces intersection.
1613
1614             Parameters:
1615                 theFace1 First of two faces, defining the line.
1616                 theFace2 Second of two faces, defining the line.
1617                 theName Object name; when specified, this parameter is used
1618                         for result publication in the study. Otherwise, if automatic
1619                         publication is switched on, default value is used for result name.
1620
1621             Returns:
1622                 New GEOM.GEOM_Object, containing the created line.
1623             """
1624             # Example: see GEOM_TestAll.py
1625             anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1626             RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1627             self._autoPublish(anObj, theName, "line")
1628             return anObj
1629
1630         ## Create a plane, passing through the given point
1631         #  and normal to the given vector.
1632         #  @param thePnt Point, the plane has to pass through.
1633         #  @param theVec Vector, defining the plane normal direction.
1634         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1635         #  @param theName Object name; when specified, this parameter is used
1636         #         for result publication in the study. Otherwise, if automatic
1637         #         publication is switched on, default value is used for result name.
1638         #
1639         #  @return New GEOM.GEOM_Object, containing the created plane.
1640         #
1641         #  @ref tui_creation_plane "Example"
1642         @ManageTransactions("BasicOp")
1643         def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1644             """
1645             Create a plane, passing through the given point
1646             and normal to the given vector.
1647
1648             Parameters:
1649                 thePnt Point, the plane has to pass through.
1650                 theVec Vector, defining the plane normal direction.
1651                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1652                 theName Object name; when specified, this parameter is used
1653                         for result publication in the study. Otherwise, if automatic
1654                         publication is switched on, default value is used for result name.
1655
1656             Returns:
1657                 New GEOM.GEOM_Object, containing the created plane.
1658             """
1659             # Example: see GEOM_TestAll.py
1660             theTrimSize, Parameters = ParseParameters(theTrimSize);
1661             anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1662             RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1663             anObj.SetParameters(Parameters)
1664             self._autoPublish(anObj, theName, "plane")
1665             return anObj
1666
1667         ## Create a plane, passing through the three given points
1668         #  @param thePnt1 First of three points, defining the plane.
1669         #  @param thePnt2 Second of three points, defining the plane.
1670         #  @param thePnt3 Fird of three points, defining the plane.
1671         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1672         #  @param theName Object name; when specified, this parameter is used
1673         #         for result publication in the study. Otherwise, if automatic
1674         #         publication is switched on, default value is used for result name.
1675         #
1676         #  @return New GEOM.GEOM_Object, containing the created plane.
1677         #
1678         #  @ref tui_creation_plane "Example"
1679         @ManageTransactions("BasicOp")
1680         def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1681             """
1682             Create a plane, passing through the three given points
1683
1684             Parameters:
1685                 thePnt1 First of three points, defining the plane.
1686                 thePnt2 Second of three points, defining the plane.
1687                 thePnt3 Fird of three points, defining the plane.
1688                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1689                 theName Object name; when specified, this parameter is used
1690                         for result publication in the study. Otherwise, if automatic
1691                         publication is switched on, default value is used for result name.
1692
1693             Returns:
1694                 New GEOM.GEOM_Object, containing the created plane.
1695             """
1696             # Example: see GEOM_TestAll.py
1697             theTrimSize, Parameters = ParseParameters(theTrimSize);
1698             anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1699             RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1700             anObj.SetParameters(Parameters)
1701             self._autoPublish(anObj, theName, "plane")
1702             return anObj
1703
1704         ## Create a plane, similar to the existing one, but with another size of representing face.
1705         #  @param theFace Referenced plane or LCS(Marker).
1706         #  @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1707         #  @param theName Object name; when specified, this parameter is used
1708         #         for result publication in the study. Otherwise, if automatic
1709         #         publication is switched on, default value is used for result name.
1710         #
1711         #  @return New GEOM.GEOM_Object, containing the created plane.
1712         #
1713         #  @ref tui_creation_plane "Example"
1714         @ManageTransactions("BasicOp")
1715         def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1716             """
1717             Create a plane, similar to the existing one, but with another size of representing face.
1718
1719             Parameters:
1720                 theFace Referenced plane or LCS(Marker).
1721                 theTrimSize New half size of a side of quadrangle face, representing the plane.
1722                 theName Object name; when specified, this parameter is used
1723                         for result publication in the study. Otherwise, if automatic
1724                         publication is switched on, default value is used for result name.
1725
1726             Returns:
1727                 New GEOM.GEOM_Object, containing the created plane.
1728             """
1729             # Example: see GEOM_TestAll.py
1730             theTrimSize, Parameters = ParseParameters(theTrimSize);
1731             anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1732             RaiseIfFailed("MakePlaneFace", self.BasicOp)
1733             anObj.SetParameters(Parameters)
1734             self._autoPublish(anObj, theName, "plane")
1735             return anObj
1736
1737         ## Create a plane, passing through the 2 vectors
1738         #  with center in a start point of the first vector.
1739         #  @param theVec1 Vector, defining center point and plane direction.
1740         #  @param theVec2 Vector, defining the plane normal direction.
1741         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1742         #  @param theName Object name; when specified, this parameter is used
1743         #         for result publication in the study. Otherwise, if automatic
1744         #         publication is switched on, default value is used for result name.
1745         #
1746         #  @return New GEOM.GEOM_Object, containing the created plane.
1747         #
1748         #  @ref tui_creation_plane "Example"
1749         @ManageTransactions("BasicOp")
1750         def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1751             """
1752             Create a plane, passing through the 2 vectors
1753             with center in a start point of the first vector.
1754
1755             Parameters:
1756                 theVec1 Vector, defining center point and plane direction.
1757                 theVec2 Vector, defining the plane normal direction.
1758                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1759                 theName Object name; when specified, this parameter is used
1760                         for result publication in the study. Otherwise, if automatic
1761                         publication is switched on, default value is used for result name.
1762
1763             Returns:
1764                 New GEOM.GEOM_Object, containing the created plane.
1765             """
1766             # Example: see GEOM_TestAll.py
1767             theTrimSize, Parameters = ParseParameters(theTrimSize);
1768             anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1769             RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1770             anObj.SetParameters(Parameters)
1771             self._autoPublish(anObj, theName, "plane")
1772             return anObj
1773
1774         ## Create a plane, based on a Local coordinate system.
1775         #  @param theLCS  coordinate system, defining plane.
1776         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1777         #  @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1778         #  @param theName Object name; when specified, this parameter is used
1779         #         for result publication in the study. Otherwise, if automatic
1780         #         publication is switched on, default value is used for result name.
1781         #
1782         #  @return New GEOM.GEOM_Object, containing the created plane.
1783         #
1784         #  @ref tui_creation_plane "Example"
1785         @ManageTransactions("BasicOp")
1786         def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1787             """
1788             Create a plane, based on a Local coordinate system.
1789
1790            Parameters:
1791                 theLCS  coordinate system, defining plane.
1792                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1793                 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1794                 theName Object name; when specified, this parameter is used
1795                         for result publication in the study. Otherwise, if automatic
1796                         publication is switched on, default value is used for result name.
1797
1798             Returns:
1799                 New GEOM.GEOM_Object, containing the created plane.
1800             """
1801             # Example: see GEOM_TestAll.py
1802             theTrimSize, Parameters = ParseParameters(theTrimSize);
1803             anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1804             RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1805             anObj.SetParameters(Parameters)
1806             self._autoPublish(anObj, theName, "plane")
1807             return anObj
1808
1809         ## Create a local coordinate system.
1810         #  @param OX,OY,OZ Three coordinates of coordinate system origin.
1811         #  @param XDX,XDY,XDZ Three components of OX direction
1812         #  @param YDX,YDY,YDZ Three components of OY direction
1813         #  @param theName Object name; when specified, this parameter is used
1814         #         for result publication in the study. Otherwise, if automatic
1815         #         publication is switched on, default value is used for result name.
1816         #
1817         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1818         #
1819         #  @ref swig_MakeMarker "Example"
1820         @ManageTransactions("BasicOp")
1821         def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1822             """
1823             Create a local coordinate system.
1824
1825             Parameters:
1826                 OX,OY,OZ Three coordinates of coordinate system origin.
1827                 XDX,XDY,XDZ Three components of OX direction
1828                 YDX,YDY,YDZ Three components of OY direction
1829                 theName Object name; when specified, this parameter is used
1830                         for result publication in the study. Otherwise, if automatic
1831                         publication is switched on, default value is used for result name.
1832
1833             Returns:
1834                 New GEOM.GEOM_Object, containing the created coordinate system.
1835             """
1836             # Example: see GEOM_TestAll.py
1837             OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1838             anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1839             RaiseIfFailed("MakeMarker", self.BasicOp)
1840             anObj.SetParameters(Parameters)
1841             self._autoPublish(anObj, theName, "lcs")
1842             return anObj
1843
1844         ## Create a local coordinate system from shape.
1845         #  @param theShape The initial shape to detect the coordinate system.
1846         #  @param theName Object name; when specified, this parameter is used
1847         #         for result publication in the study. Otherwise, if automatic
1848         #         publication is switched on, default value is used for result name.
1849         #
1850         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1851         #
1852         #  @ref tui_creation_lcs "Example"
1853         @ManageTransactions("BasicOp")
1854         def MakeMarkerFromShape(self, theShape, theName=None):
1855             """
1856             Create a local coordinate system from shape.
1857
1858             Parameters:
1859                 theShape The initial shape to detect the coordinate system.
1860                 theName Object name; when specified, this parameter is used
1861                         for result publication in the study. Otherwise, if automatic
1862                         publication is switched on, default value is used for result name.
1863
1864             Returns:
1865                 New GEOM.GEOM_Object, containing the created coordinate system.
1866             """
1867             anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1868             RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1869             self._autoPublish(anObj, theName, "lcs")
1870             return anObj
1871
1872         ## Create a local coordinate system from point and two vectors.
1873         #  @param theOrigin Point of coordinate system origin.
1874         #  @param theXVec Vector of X direction
1875         #  @param theYVec Vector of Y direction
1876         #  @param theName Object name; when specified, this parameter is used
1877         #         for result publication in the study. Otherwise, if automatic
1878         #         publication is switched on, default value is used for result name.
1879         #
1880         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1881         #
1882         #  @ref tui_creation_lcs "Example"
1883         @ManageTransactions("BasicOp")
1884         def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1885             """
1886             Create a local coordinate system from point and two vectors.
1887
1888             Parameters:
1889                 theOrigin Point of coordinate system origin.
1890                 theXVec Vector of X direction
1891                 theYVec Vector of Y direction
1892                 theName Object name; when specified, this parameter is used
1893                         for result publication in the study. Otherwise, if automatic
1894                         publication is switched on, default value is used for result name.
1895
1896             Returns:
1897                 New GEOM.GEOM_Object, containing the created coordinate system.
1898
1899             """
1900             anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1901             RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1902             self._autoPublish(anObj, theName, "lcs")
1903             return anObj
1904
1905         # end of l3_basic_go
1906         ## @}
1907
1908         ## @addtogroup l4_curves
1909         ## @{
1910
1911         ##  Create an arc of circle, passing through three given points.
1912         #  @param thePnt1 Start point of the arc.
1913         #  @param thePnt2 Middle point of the arc.
1914         #  @param thePnt3 End point of the arc.
1915         #  @param theName Object name; when specified, this parameter is used
1916         #         for result publication in the study. Otherwise, if automatic
1917         #         publication is switched on, default value is used for result name.
1918         #
1919         #  @return New GEOM.GEOM_Object, containing the created arc.
1920         #
1921         #  @ref swig_MakeArc "Example"
1922         @ManageTransactions("CurvesOp")
1923         def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1924             """
1925             Create an arc of circle, passing through three given points.
1926
1927             Parameters:
1928                 thePnt1 Start point of the arc.
1929                 thePnt2 Middle point of the arc.
1930                 thePnt3 End point of the arc.
1931                 theName Object name; when specified, this parameter is used
1932                         for result publication in the study. Otherwise, if automatic
1933                         publication is switched on, default value is used for result name.
1934
1935             Returns:
1936                 New GEOM.GEOM_Object, containing the created arc.
1937             """
1938             # Example: see GEOM_TestAll.py
1939             anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1940             RaiseIfFailed("MakeArc", self.CurvesOp)
1941             self._autoPublish(anObj, theName, "arc")
1942             return anObj
1943
1944         ##  Create an arc of circle from a center and 2 points.
1945         #  @param thePnt1 Center of the arc
1946         #  @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1947         #  @param thePnt3 End point of the arc (Gives also a direction)
1948         #  @param theSense Orientation of the arc
1949         #  @param theName Object name; when specified, this parameter is used
1950         #         for result publication in the study. Otherwise, if automatic
1951         #         publication is switched on, default value is used for result name.
1952         #
1953         #  @return New GEOM.GEOM_Object, containing the created arc.
1954         #
1955         #  @ref swig_MakeArc "Example"
1956         @ManageTransactions("CurvesOp")
1957         def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1958             """
1959             Create an arc of circle from a center and 2 points.
1960
1961             Parameters:
1962                 thePnt1 Center of the arc
1963                 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1964                 thePnt3 End point of the arc (Gives also a direction)
1965                 theSense Orientation of the arc
1966                 theName Object name; when specified, this parameter is used
1967                         for result publication in the study. Otherwise, if automatic
1968                         publication is switched on, default value is used for result name.
1969
1970             Returns:
1971                 New GEOM.GEOM_Object, containing the created arc.
1972             """
1973             # Example: see GEOM_TestAll.py
1974             anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1975             RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1976             self._autoPublish(anObj, theName, "arc")
1977             return anObj
1978
1979         ##  Create an arc of ellipse, of center and two points.
1980         #  @param theCenter Center of the arc.
1981         #  @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1982         #  @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1983         #  @param theName Object name; when specified, this parameter is used
1984         #         for result publication in the study. Otherwise, if automatic
1985         #         publication is switched on, default value is used for result name.
1986         #
1987         #  @return New GEOM.GEOM_Object, containing the created arc.
1988         #
1989         #  @ref swig_MakeArc "Example"
1990         @ManageTransactions("CurvesOp")
1991         def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1992             """
1993             Create an arc of ellipse, of center and two points.
1994
1995             Parameters:
1996                 theCenter Center of the arc.
1997                 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1998                 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1999                 theName Object name; when specified, this parameter is used
2000                         for result publication in the study. Otherwise, if automatic
2001                         publication is switched on, default value is used for result name.
2002
2003             Returns:
2004                 New GEOM.GEOM_Object, containing the created arc.
2005             """
2006             # Example: see GEOM_TestAll.py
2007             anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2008             RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2009             self._autoPublish(anObj, theName, "arc")
2010             return anObj
2011
2012         ## Create a circle with given center, normal vector and radius.
2013         #  @param thePnt Circle center.
2014         #  @param theVec Vector, normal to the plane of the circle.
2015         #  @param theR Circle radius.
2016         #  @param theName Object name; when specified, this parameter is used
2017         #         for result publication in the study. Otherwise, if automatic
2018         #         publication is switched on, default value is used for result name.
2019         #
2020         #  @return New GEOM.GEOM_Object, containing the created circle.
2021         #
2022         #  @ref tui_creation_circle "Example"
2023         @ManageTransactions("CurvesOp")
2024         def MakeCircle(self, thePnt, theVec, theR, theName=None):
2025             """
2026             Create a circle with given center, normal vector and radius.
2027
2028             Parameters:
2029                 thePnt Circle center.
2030                 theVec Vector, normal to the plane of the circle.
2031                 theR Circle radius.
2032                 theName Object name; when specified, this parameter is used
2033                         for result publication in the study. Otherwise, if automatic
2034                         publication is switched on, default value is used for result name.
2035
2036             Returns:
2037                 New GEOM.GEOM_Object, containing the created circle.
2038             """
2039             # Example: see GEOM_TestAll.py
2040             theR, Parameters = ParseParameters(theR)
2041             anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2042             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2043             anObj.SetParameters(Parameters)
2044             self._autoPublish(anObj, theName, "circle")
2045             return anObj
2046
2047         ## Create a circle with given radius.
2048         #  Center of the circle will be in the origin of global
2049         #  coordinate system and normal vector will be codirected with Z axis
2050         #  @param theR Circle radius.
2051         #  @param theName Object name; when specified, this parameter is used
2052         #         for result publication in the study. Otherwise, if automatic
2053         #         publication is switched on, default value is used for result name.
2054         #
2055         #  @return New GEOM.GEOM_Object, containing the created circle.
2056         @ManageTransactions("CurvesOp")
2057         def MakeCircleR(self, theR, theName=None):
2058             """
2059             Create a circle with given radius.
2060             Center of the circle will be in the origin of global
2061             coordinate system and normal vector will be codirected with Z axis
2062
2063             Parameters:
2064                 theR Circle radius.
2065                 theName Object name; when specified, this parameter is used
2066                         for result publication in the study. Otherwise, if automatic
2067                         publication is switched on, default value is used for result name.
2068
2069             Returns:
2070                 New GEOM.GEOM_Object, containing the created circle.
2071             """
2072             anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2073             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2074             self._autoPublish(anObj, theName, "circle")
2075             return anObj
2076
2077         ## Create a circle, passing through three given points
2078         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2079         #  @param theName Object name; when specified, this parameter is used
2080         #         for result publication in the study. Otherwise, if automatic
2081         #         publication is switched on, default value is used for result name.
2082         #
2083         #  @return New GEOM.GEOM_Object, containing the created circle.
2084         #
2085         #  @ref tui_creation_circle "Example"
2086         @ManageTransactions("CurvesOp")
2087         def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2088             """
2089             Create a circle, passing through three given points
2090
2091             Parameters:
2092                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2093                 theName Object name; when specified, this parameter is used
2094                         for result publication in the study. Otherwise, if automatic
2095                         publication is switched on, default value is used for result name.
2096
2097             Returns:
2098                 New GEOM.GEOM_Object, containing the created circle.
2099             """
2100             # Example: see GEOM_TestAll.py
2101             anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2102             RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2103             self._autoPublish(anObj, theName, "circle")
2104             return anObj
2105
2106         ## Create a circle, with given point1 as center,
2107         #  passing through the point2 as radius and laying in the plane,
2108         #  defined by all three given points.
2109         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2110         #  @param theName Object name; when specified, this parameter is used
2111         #         for result publication in the study. Otherwise, if automatic
2112         #         publication is switched on, default value is used for result name.
2113         #
2114         #  @return New GEOM.GEOM_Object, containing the created circle.
2115         #
2116         #  @ref swig_MakeCircle "Example"
2117         @ManageTransactions("CurvesOp")
2118         def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2119             """
2120             Create a circle, with given point1 as center,
2121             passing through the point2 as radius and laying in the plane,
2122             defined by all three given points.
2123
2124             Parameters:
2125                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2126                 theName Object name; when specified, this parameter is used
2127                         for result publication in the study. Otherwise, if automatic
2128                         publication is switched on, default value is used for result name.
2129
2130             Returns:
2131                 New GEOM.GEOM_Object, containing the created circle.
2132             """
2133             # Example: see GEOM_example6.py
2134             anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2135             RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2136             self._autoPublish(anObj, theName, "circle")
2137             return anObj
2138
2139         ## Create an ellipse with given center, normal vector and radiuses.
2140         #  @param thePnt Ellipse center.
2141         #  @param theVec Vector, normal to the plane of the ellipse.
2142         #  @param theRMajor Major ellipse radius.
2143         #  @param theRMinor Minor ellipse radius.
2144         #  @param theVecMaj Vector, direction of the ellipse's main axis.
2145         #  @param theName Object name; when specified, this parameter is used
2146         #         for result publication in the study. Otherwise, if automatic
2147         #         publication is switched on, default value is used for result name.
2148         #
2149         #  @return New GEOM.GEOM_Object, containing the created ellipse.
2150         #
2151         #  @ref tui_creation_ellipse "Example"
2152         @ManageTransactions("CurvesOp")
2153         def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2154             """
2155             Create an ellipse with given center, normal vector and radiuses.
2156
2157             Parameters:
2158                 thePnt Ellipse center.
2159                 theVec Vector, normal to the plane of the ellipse.
2160                 theRMajor Major ellipse radius.
2161                 theRMinor Minor ellipse radius.
2162                 theVecMaj Vector, direction of the ellipse's main axis.
2163                 theName Object name; when specified, this parameter is used
2164                         for result publication in the study. Otherwise, if automatic
2165                         publication is switched on, default value is used for result name.
2166
2167             Returns:
2168                 New GEOM.GEOM_Object, containing the created ellipse.
2169             """
2170             # Example: see GEOM_TestAll.py
2171             theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2172             if theVecMaj is not None:
2173                 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2174             else:
2175                 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2176                 pass
2177             RaiseIfFailed("MakeEllipse", self.CurvesOp)
2178             anObj.SetParameters(Parameters)
2179             self._autoPublish(anObj, theName, "ellipse")
2180             return anObj
2181
2182         ## Create an ellipse with given radiuses.
2183         #  Center of the ellipse will be in the origin of global
2184         #  coordinate system and normal vector will be codirected with Z axis
2185         #  @param theRMajor Major ellipse radius.
2186         #  @param theRMinor Minor ellipse radius.
2187         #  @param theName Object name; when specified, this parameter is used
2188         #         for result publication in the study. Otherwise, if automatic
2189         #         publication is switched on, default value is used for result name.
2190         #
2191         #  @return New GEOM.GEOM_Object, containing the created ellipse.
2192         @ManageTransactions("CurvesOp")
2193         def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2194             """
2195             Create an ellipse with given radiuses.
2196             Center of the ellipse will be in the origin of global
2197             coordinate system and normal vector will be codirected with Z axis
2198
2199             Parameters:
2200                 theRMajor Major ellipse radius.
2201                 theRMinor Minor ellipse radius.
2202                 theName Object name; when specified, this parameter is used
2203                         for result publication in the study. Otherwise, if automatic
2204                         publication is switched on, default value is used for result name.
2205
2206             Returns:
2207             New GEOM.GEOM_Object, containing the created ellipse.
2208             """
2209             anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2210             RaiseIfFailed("MakeEllipse", self.CurvesOp)
2211             self._autoPublish(anObj, theName, "ellipse")
2212             return anObj
2213
2214         ## Create a polyline on the set of points.
2215         #  @param thePoints Sequence of points for the polyline.
2216         #  @param theIsClosed If True, build a closed wire.
2217         #  @param theName Object name; when specified, this parameter is used
2218         #         for result publication in the study. Otherwise, if automatic
2219         #         publication is switched on, default value is used for result name.
2220         #
2221         #  @return New GEOM.GEOM_Object, containing the created polyline.
2222         #
2223         #  @ref tui_creation_curve "Example"
2224         @ManageTransactions("CurvesOp")
2225         def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2226             """
2227             Create a polyline on the set of points.
2228
2229             Parameters:
2230                 thePoints Sequence of points for the polyline.
2231                 theIsClosed If True, build a closed wire.
2232                 theName Object name; when specified, this parameter is used
2233                         for result publication in the study. Otherwise, if automatic
2234                         publication is switched on, default value is used for result name.
2235
2236             Returns:
2237                 New GEOM.GEOM_Object, containing the created polyline.
2238             """
2239             # Example: see GEOM_TestAll.py
2240             anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2241             RaiseIfFailed("MakePolyline", self.CurvesOp)
2242             self._autoPublish(anObj, theName, "polyline")
2243             return anObj
2244
2245         ## Create bezier curve on the set of points.
2246         #  @param thePoints Sequence of points for the bezier curve.
2247         #  @param theIsClosed If True, build a closed curve.
2248         #  @param theName Object name; when specified, this parameter is used
2249         #         for result publication in the study. Otherwise, if automatic
2250         #         publication is switched on, default value is used for result name.
2251         #
2252         #  @return New GEOM.GEOM_Object, containing the created bezier curve.
2253         #
2254         #  @ref tui_creation_curve "Example"
2255         @ManageTransactions("CurvesOp")
2256         def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2257             """
2258             Create bezier curve on the set of points.
2259
2260             Parameters:
2261                 thePoints Sequence of points for the bezier curve.
2262                 theIsClosed If True, build a closed curve.
2263                 theName Object name; when specified, this parameter is used
2264                         for result publication in the study. Otherwise, if automatic
2265                         publication is switched on, default value is used for result name.
2266
2267             Returns:
2268                 New GEOM.GEOM_Object, containing the created bezier curve.
2269             """
2270             # Example: see GEOM_TestAll.py
2271             anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2272             RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2273             self._autoPublish(anObj, theName, "bezier")
2274             return anObj
2275
2276         ## Create B-Spline curve on the set of points.
2277         #  @param thePoints Sequence of points for the B-Spline curve.
2278         #  @param theIsClosed If True, build a closed curve.
2279         #  @param theDoReordering If TRUE, the algo does not follow the order of
2280         #                         \a thePoints but searches for the closest vertex.
2281         #  @param theName Object name; when specified, this parameter is used
2282         #         for result publication in the study. Otherwise, if automatic
2283         #         publication is switched on, default value is used for result name.
2284         #
2285         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2286         #
2287         #  @ref tui_creation_curve "Example"
2288         @ManageTransactions("CurvesOp")
2289         def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2290             """
2291             Create B-Spline curve on the set of points.
2292
2293             Parameters:
2294                 thePoints Sequence of points for the B-Spline curve.
2295                 theIsClosed If True, build a closed curve.
2296                 theDoReordering If True, the algo does not follow the order of
2297                                 thePoints but searches for the closest vertex.
2298                 theName Object name; when specified, this parameter is used
2299                         for result publication in the study. Otherwise, if automatic
2300                         publication is switched on, default value is used for result name.
2301
2302             Returns:
2303                 New GEOM.GEOM_Object, containing the created B-Spline curve.
2304             """
2305             # Example: see GEOM_TestAll.py
2306             anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2307             RaiseIfFailed("MakeInterpol", self.CurvesOp)
2308             self._autoPublish(anObj, theName, "bspline")
2309             return anObj
2310
2311         ## Create B-Spline curve on the set of points.
2312         #  @param thePoints Sequence of points for the B-Spline curve.
2313         #  @param theFirstVec Vector object, defining the curve direction at its first point.
2314         #  @param theLastVec Vector object, defining the curve direction at its last point.
2315         #  @param theName Object name; when specified, this parameter is used
2316         #         for result publication in the study. Otherwise, if automatic
2317         #         publication is switched on, default value is used for result name.
2318         #
2319         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2320         #
2321         #  @ref tui_creation_curve "Example"
2322         @ManageTransactions("CurvesOp")
2323         def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2324             """
2325             Create B-Spline curve on the set of points.
2326
2327             Parameters:
2328                 thePoints Sequence of points for the B-Spline curve.
2329                 theFirstVec Vector object, defining the curve direction at its first point.
2330                 theLastVec Vector object, defining the curve direction at its last point.
2331                 theName Object name; when specified, this parameter is used
2332                         for result publication in the study. Otherwise, if automatic
2333                         publication is switched on, default value is used for result name.
2334
2335             Returns:
2336                 New GEOM.GEOM_Object, containing the created B-Spline curve.
2337             """
2338             # Example: see GEOM_TestAll.py
2339             anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2340             RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2341             self._autoPublish(anObj, theName, "bspline")
2342             return anObj
2343
2344         ## Creates a curve using the parametric definition of the basic points.
2345         #  @param thexExpr parametric equation of the coordinates X.
2346         #  @param theyExpr parametric equation of the coordinates Y.
2347         #  @param thezExpr parametric equation of the coordinates Z.
2348         #  @param theParamMin the minimal value of the parameter.
2349         #  @param theParamMax the maximum value of the parameter.
2350         #  @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2351         #  @param theCurveType the type of the curve,
2352         #         one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2353         #  @param theNewMethod flag for switching to the new method if the flag is set to false a deprecated method is used which can lead to a bug.
2354         #  @param theName Object name; when specified, this parameter is used
2355         #         for result publication in the study. Otherwise, if automatic
2356         #         publication is switched on, default value is used for result name.
2357         #
2358         #  @return New GEOM.GEOM_Object, containing the created curve.
2359         #
2360         #  @ref tui_creation_curve "Example"
2361         @ManageTransactions("CurvesOp")
2362         def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2363                                 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2364             """
2365             Creates a curve using the parametric definition of the basic points.
2366
2367             Parameters:
2368                 thexExpr parametric equation of the coordinates X.
2369                 theyExpr parametric equation of the coordinates Y.
2370                 thezExpr parametric equation of the coordinates Z.
2371                 theParamMin the minimal value of the parameter.
2372                 theParamMax the maximum value of the parameter.
2373                 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2374                 theCurveType the type of the curve,
2375                              one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2376                 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2377                              method is used which can lead to a bug.
2378                 theName Object name; when specified, this parameter is used
2379                         for result publication in the study. Otherwise, if automatic
2380                         publication is switched on, default value is used for result name.
2381
2382             Returns:
2383                 New GEOM.GEOM_Object, containing the created curve.
2384             """
2385             theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2386             if theNewMethod:
2387               anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2388             else:
2389               anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2390             RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2391             anObj.SetParameters(Parameters)
2392             self._autoPublish(anObj, theName, "curve")
2393             return anObj
2394
2395         ## Create an isoline curve on a face.
2396         #  @param theFace the face for which an isoline is created.
2397         #  @param IsUIsoline True for U-isoline creation; False for V-isoline
2398         #         creation.
2399         #  @param theParameter the U parameter for U-isoline or V parameter
2400         #         for V-isoline.
2401         #  @param theName Object name; when specified, this parameter is used
2402         #         for result publication in the study. Otherwise, if automatic
2403         #         publication is switched on, default value is used for result name.
2404         #
2405         #  @return New GEOM.GEOM_Object, containing the created isoline edge or
2406         #          a compound of edges.
2407         #
2408         #  @ref tui_creation_curve "Example"
2409         @ManageTransactions("CurvesOp")
2410         def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2411             """
2412             Create an isoline curve on a face.
2413
2414             Parameters:
2415                 theFace the face for which an isoline is created.
2416                 IsUIsoline True for U-isoline creation; False for V-isoline
2417                            creation.
2418                 theParameter the U parameter for U-isoline or V parameter
2419                              for V-isoline.
2420                 theName Object name; when specified, this parameter is used
2421                         for result publication in the study. Otherwise, if automatic
2422                         publication is switched on, default value is used for result name.
2423
2424             Returns:
2425                 New GEOM.GEOM_Object, containing the created isoline edge or a
2426                 compound of edges.
2427             """
2428             # Example: see GEOM_TestAll.py
2429             anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2430             RaiseIfFailed("MakeIsoline", self.CurvesOp)
2431             if IsUIsoline:
2432                 self._autoPublish(anObj, theName, "U-Isoline")
2433             else:
2434                 self._autoPublish(anObj, theName, "V-Isoline")
2435             return anObj
2436
2437         # end of l4_curves
2438         ## @}
2439
2440         ## @addtogroup l3_sketcher
2441         ## @{
2442
2443         ## Create a sketcher (wire or face), following the textual description,
2444         #  passed through <VAR>theCommand</VAR> argument. \n
2445         #  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2446         #  Format of the description string have to be the following:
2447         #
2448         #  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2449         #
2450         #  Where:
2451         #  - x1, y1 are coordinates of the first sketcher point (zero by default),
2452         #  - CMD is one of
2453         #     - "R angle" : Set the direction by angle
2454         #     - "D dx dy" : Set the direction by DX & DY
2455         #     .
2456         #       \n
2457         #     - "TT x y" : Create segment by point at X & Y
2458         #     - "T dx dy" : Create segment by point with DX & DY
2459         #     - "L length" : Create segment by direction & Length
2460         #     - "IX x" : Create segment by direction & Intersect. X
2461         #     - "IY y" : Create segment by direction & Intersect. Y
2462         #     .
2463         #       \n
2464         #     - "C radius length" : Create arc by direction, radius and length(in degree)
2465         #     - "AA x y": Create arc by point at X & Y
2466         #     - "A dx dy" : Create arc by point with DX & DY
2467         #     - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2468         #     - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2469         #     - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2470         #     - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2471         #     .
2472         #       \n
2473         #     - "WW" : Close Wire (to finish)
2474         #     - "WF" : Close Wire and build face (to finish)
2475         #     .
2476         #        \n
2477         #  - Flag1 (= reverse) is 0 or 2 ...
2478         #     - if 0 the drawn arc is the one of lower angle (< Pi)
2479         #     - if 2 the drawn arc ius the one of greater angle (> Pi)
2480         #     .
2481         #        \n
2482         #  - Flag2 (= control tolerance) is 0 or 1 ...
2483         #     - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2484         #     - if 1 the wire is built only if the end point is on the arc
2485         #       with a tolerance of 10^-7 on the distance else the creation fails
2486         #
2487         #  @param theCommand String, defining the sketcher in local
2488         #                    coordinates of the working plane.
2489         #  @param theWorkingPlane Nine double values, defining origin,
2490         #                         OZ and OX directions of the working plane.
2491         #  @param theName Object name; when specified, this parameter is used
2492         #         for result publication in the study. Otherwise, if automatic
2493         #         publication is switched on, default value is used for result name.
2494         #
2495         #  @return New GEOM.GEOM_Object, containing the created wire.
2496         #
2497         #  @ref tui_sketcher_page "Example"
2498         @ManageTransactions("CurvesOp")
2499         def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2500             """
2501             Create a sketcher (wire or face), following the textual description, passed
2502             through theCommand argument.
2503             Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2504             Format of the description string have to be the following:
2505                 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2506             Where:
2507             - x1, y1 are coordinates of the first sketcher point (zero by default),
2508             - CMD is one of
2509                - "R angle" : Set the direction by angle
2510                - "D dx dy" : Set the direction by DX & DY
2511
2512                - "TT x y" : Create segment by point at X & Y
2513                - "T dx dy" : Create segment by point with DX & DY
2514                - "L length" : Create segment by direction & Length
2515                - "IX x" : Create segment by direction & Intersect. X
2516                - "IY y" : Create segment by direction & Intersect. Y
2517
2518                - "C radius length" : Create arc by direction, radius and length(in degree)
2519                - "AA x y": Create arc by point at X & Y
2520                - "A dx dy" : Create arc by point with DX & DY
2521                - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2522                - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2523                - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2524                - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2525
2526                - "WW" : Close Wire (to finish)
2527                - "WF" : Close Wire and build face (to finish)
2528
2529             - Flag1 (= reverse) is 0 or 2 ...
2530                - if 0 the drawn arc is the one of lower angle (< Pi)
2531                - if 2 the drawn arc ius the one of greater angle (> Pi)
2532
2533             - Flag2 (= control tolerance) is 0 or 1 ...
2534                - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2535                - if 1 the wire is built only if the end point is on the arc
2536                  with a tolerance of 10^-7 on the distance else the creation fails
2537
2538             Parameters:
2539                 theCommand String, defining the sketcher in local
2540                            coordinates of the working plane.
2541                 theWorkingPlane Nine double values, defining origin,
2542                                 OZ and OX directions of the working plane.
2543                 theName Object name; when specified, this parameter is used
2544                         for result publication in the study. Otherwise, if automatic
2545                         publication is switched on, default value is used for result name.
2546
2547             Returns:
2548                 New GEOM.GEOM_Object, containing the created wire.
2549             """
2550             # Example: see GEOM_TestAll.py
2551             theCommand,Parameters = ParseSketcherCommand(theCommand)
2552             anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2553             RaiseIfFailed("MakeSketcher", self.CurvesOp)
2554             anObj.SetParameters(Parameters)
2555             self._autoPublish(anObj, theName, "wire")
2556             return anObj
2557
2558         ## Create a sketcher (wire or face), following the textual description,
2559         #  passed through <VAR>theCommand</VAR> argument. \n
2560         #  For format of the description string see MakeSketcher() method.\n
2561         #  @param theCommand String, defining the sketcher in local
2562         #                    coordinates of the working plane.
2563         #  @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2564         #  @param theName Object name; when specified, this parameter is used
2565         #         for result publication in the study. Otherwise, if automatic
2566         #         publication is switched on, default value is used for result name.
2567         #
2568         #  @return New GEOM.GEOM_Object, containing the created wire.
2569         #
2570         #  @ref tui_sketcher_page "Example"
2571         @ManageTransactions("CurvesOp")
2572         def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2573             """
2574             Create a sketcher (wire or face), following the textual description,
2575             passed through theCommand argument.
2576             For format of the description string see geompy.MakeSketcher() method.
2577
2578             Parameters:
2579                 theCommand String, defining the sketcher in local
2580                            coordinates of the working plane.
2581                 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2582                 theName Object name; when specified, this parameter is used
2583                         for result publication in the study. Otherwise, if automatic
2584                         publication is switched on, default value is used for result name.
2585
2586             Returns:
2587                 New GEOM.GEOM_Object, containing the created wire.
2588             """
2589             theCommand,Parameters = ParseSketcherCommand(theCommand)
2590             anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2591             RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2592             anObj.SetParameters(Parameters)
2593             self._autoPublish(anObj, theName, "wire")
2594             return anObj
2595
2596         ## Obtain a 2D sketcher interface
2597         #  @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2598         def Sketcher2D (self):
2599             """
2600             Obtain a 2D sketcher interface.
2601
2602             Example of usage:
2603                sk = geompy.Sketcher2D()
2604                sk.addPoint(20, 20)
2605                sk.addSegmentRelative(15, 70)
2606                sk.addSegmentPerpY(50)
2607                sk.addArcRadiusRelative(25, 15, 14.5, 0)
2608                sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2609                sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2610                sk.close()
2611                Sketch_1 = sk.wire(geomObj_1)
2612             """
2613             sk = Sketcher2D (self)
2614             return sk
2615
2616         ## Create a sketcher wire, following the numerical description,
2617         #  passed through <VAR>theCoordinates</VAR> argument. \n
2618         #  @param theCoordinates double values, defining points to create a wire,
2619         #                                                      passing from it.
2620         #  @param theName Object name; when specified, this parameter is used
2621         #         for result publication in the study. Otherwise, if automatic
2622         #         publication is switched on, default value is used for result name.
2623         #
2624         #  @return New GEOM.GEOM_Object, containing the created wire.
2625         #
2626         #  @ref tui_3dsketcher_page "Example"
2627         @ManageTransactions("CurvesOp")
2628         def Make3DSketcher(self, theCoordinates, theName=None):
2629             """
2630             Create a sketcher wire, following the numerical description,
2631             passed through theCoordinates argument.
2632
2633             Parameters:
2634                 theCoordinates double values, defining points to create a wire,
2635                                passing from it.
2636                 theName Object name; when specified, this parameter is used
2637                         for result publication in the study. Otherwise, if automatic
2638                         publication is switched on, default value is used for result name.
2639
2640             Returns:
2641                 New GEOM_Object, containing the created wire.
2642             """
2643             theCoordinates,Parameters = ParseParameters(theCoordinates)
2644             anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2645             RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2646             anObj.SetParameters(Parameters)
2647             self._autoPublish(anObj, theName, "wire")
2648             return anObj
2649
2650         ## Obtain a 3D sketcher interface
2651         #  @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2652         #
2653         #  @ref tui_3dsketcher_page "Example"
2654         def Sketcher3D (self):
2655             """
2656             Obtain a 3D sketcher interface.
2657
2658             Example of usage:
2659                 sk = geompy.Sketcher3D()
2660                 sk.addPointsAbsolute(0,0,0, 70,0,0)
2661                 sk.addPointsRelative(0, 0, 130)
2662                 sk.addPointAnglesLength("OXY", 50, 0, 100)
2663                 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2664                 sk.close()
2665                 a3D_Sketcher_1 = sk.wire()
2666             """
2667             sk = Sketcher3D (self)
2668             return sk
2669
2670         # end of l3_sketcher
2671         ## @}
2672
2673         ## @addtogroup l3_3d_primitives
2674         ## @{
2675
2676         ## Create a box by coordinates of two opposite vertices.
2677         #
2678         #  @param x1,y1,z1 double values, defining first point it.
2679         #  @param x2,y2,z2 double values, defining first point it.
2680         #  @param theName Object name; when specified, this parameter is used
2681         #         for result publication in the study. Otherwise, if automatic
2682         #         publication is switched on, default value is used for result name.
2683         #
2684         #  @return New GEOM.GEOM_Object, containing the created box.
2685         #
2686         #  @ref tui_creation_box "Example"
2687         def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2688             """
2689             Create a box by coordinates of two opposite vertices.
2690
2691             Parameters:
2692                 x1,y1,z1 double values, defining first point.
2693                 x2,y2,z2 double values, defining second point.
2694                 theName Object name; when specified, this parameter is used
2695                         for result publication in the study. Otherwise, if automatic
2696                         publication is switched on, default value is used for result name.
2697
2698             Returns:
2699                 New GEOM.GEOM_Object, containing the created box.
2700             """
2701             # Example: see GEOM_TestAll.py
2702             pnt1 = self.MakeVertex(x1,y1,z1)
2703             pnt2 = self.MakeVertex(x2,y2,z2)
2704             # note: auto-publishing is done in self.MakeBoxTwoPnt()
2705             return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2706
2707         ## Create a box with specified dimensions along the coordinate axes
2708         #  and with edges, parallel to the coordinate axes.
2709         #  Center of the box will be at point (DX/2, DY/2, DZ/2).
2710         #  @param theDX Length of Box edges, parallel to OX axis.
2711         #  @param theDY Length of Box edges, parallel to OY axis.
2712         #  @param theDZ Length of Box edges, parallel to OZ axis.
2713         #  @param theName Object name; when specified, this parameter is used
2714         #         for result publication in the study. Otherwise, if automatic
2715         #         publication is switched on, default value is used for result name.
2716         #
2717         #  @return New GEOM.GEOM_Object, containing the created box.
2718         #
2719         #  @ref tui_creation_box "Example"
2720         @ManageTransactions("PrimOp")
2721         def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2722             """
2723             Create a box with specified dimensions along the coordinate axes
2724             and with edges, parallel to the coordinate axes.
2725             Center of the box will be at point (DX/2, DY/2, DZ/2).
2726
2727             Parameters:
2728                 theDX Length of Box edges, parallel to OX axis.
2729                 theDY Length of Box edges, parallel to OY axis.
2730                 theDZ Length of Box edges, parallel to OZ axis.
2731                 theName Object name; when specified, this parameter is used
2732                         for result publication in the study. Otherwise, if automatic
2733                         publication is switched on, default value is used for result name.
2734
2735             Returns:
2736                 New GEOM.GEOM_Object, containing the created box.
2737             """
2738             # Example: see GEOM_TestAll.py
2739             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2740             anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2741             RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2742             anObj.SetParameters(Parameters)
2743             self._autoPublish(anObj, theName, "box")
2744             return anObj
2745
2746         ## Create a box with two specified opposite vertices,
2747         #  and with edges, parallel to the coordinate axes
2748         #  @param thePnt1 First of two opposite vertices.
2749         #  @param thePnt2 Second of two opposite vertices.
2750         #  @param theName Object name; when specified, this parameter is used
2751         #         for result publication in the study. Otherwise, if automatic
2752         #         publication is switched on, default value is used for result name.
2753         #
2754         #  @return New GEOM.GEOM_Object, containing the created box.
2755         #
2756         #  @ref tui_creation_box "Example"
2757         @ManageTransactions("PrimOp")
2758         def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2759             """
2760             Create a box with two specified opposite vertices,
2761             and with edges, parallel to the coordinate axes
2762
2763             Parameters:
2764                 thePnt1 First of two opposite vertices.
2765                 thePnt2 Second of two opposite vertices.
2766                 theName Object name; when specified, this parameter is used
2767                         for result publication in the study. Otherwise, if automatic
2768                         publication is switched on, default value is used for result name.
2769
2770             Returns:
2771                 New GEOM.GEOM_Object, containing the created box.
2772             """
2773             # Example: see GEOM_TestAll.py
2774             anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2775             RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2776             self._autoPublish(anObj, theName, "box")
2777             return anObj
2778
2779         ## Create a face with specified dimensions with edges parallel to coordinate axes.
2780         #  @param theH height of Face.
2781         #  @param theW width of Face.
2782         #  @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2783         #  @param theName Object name; when specified, this parameter is used
2784         #         for result publication in the study. Otherwise, if automatic
2785         #         publication is switched on, default value is used for result name.
2786         #
2787         #  @return New GEOM.GEOM_Object, containing the created face.
2788         #
2789         #  @ref tui_creation_face "Example"
2790         @ManageTransactions("PrimOp")
2791         def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2792             """
2793             Create a face with specified dimensions with edges parallel to coordinate axes.
2794
2795             Parameters:
2796                 theH height of Face.
2797                 theW width of Face.
2798                 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2799                 theName Object name; when specified, this parameter is used
2800                         for result publication in the study. Otherwise, if automatic
2801                         publication is switched on, default value is used for result name.
2802
2803             Returns:
2804                 New GEOM.GEOM_Object, containing the created face.
2805             """
2806             # Example: see GEOM_TestAll.py
2807             theH,theW,Parameters = ParseParameters(theH, theW)
2808             anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2809             RaiseIfFailed("MakeFaceHW", self.PrimOp)
2810             anObj.SetParameters(Parameters)
2811             self._autoPublish(anObj, theName, "rectangle")
2812             return anObj
2813
2814         ## Create a face from another plane and two sizes,
2815         #  vertical size and horisontal size.
2816         #  @param theObj   Normale vector to the creating face or
2817         #  the face object.
2818         #  @param theH     Height (vertical size).
2819         #  @param theW     Width (horisontal size).
2820         #  @param theName Object name; when specified, this parameter is used
2821         #         for result publication in the study. Otherwise, if automatic
2822         #         publication is switched on, default value is used for result name.
2823         #
2824         #  @return New GEOM.GEOM_Object, containing the created face.
2825         #
2826         #  @ref tui_creation_face "Example"
2827         @ManageTransactions("PrimOp")
2828         def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2829             """
2830             Create a face from another plane and two sizes,
2831             vertical size and horisontal size.
2832
2833             Parameters:
2834                 theObj   Normale vector to the creating face or
2835                          the face object.
2836                 theH     Height (vertical size).
2837                 theW     Width (horisontal size).
2838                 theName Object name; when specified, this parameter is used
2839                         for result publication in the study. Otherwise, if automatic
2840                         publication is switched on, default value is used for result name.
2841
2842             Returns:
2843                 New GEOM_Object, containing the created face.
2844             """
2845             # Example: see GEOM_TestAll.py
2846             theH,theW,Parameters = ParseParameters(theH, theW)
2847             anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2848             RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2849             anObj.SetParameters(Parameters)
2850             self._autoPublish(anObj, theName, "rectangle")
2851             return anObj
2852
2853         ## Create a disk with given center, normal vector and radius.
2854         #  @param thePnt Disk center.
2855         #  @param theVec Vector, normal to the plane of the disk.
2856         #  @param theR Disk radius.
2857         #  @param theName Object name; when specified, this parameter is used
2858         #         for result publication in the study. Otherwise, if automatic
2859         #         publication is switched on, default value is used for result name.
2860         #
2861         #  @return New GEOM.GEOM_Object, containing the created disk.
2862         #
2863         #  @ref tui_creation_disk "Example"
2864         @ManageTransactions("PrimOp")
2865         def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2866             """
2867             Create a disk with given center, normal vector and radius.
2868
2869             Parameters:
2870                 thePnt Disk center.
2871                 theVec Vector, normal to the plane of the disk.
2872                 theR Disk radius.
2873                 theName Object name; when specified, this parameter is used
2874                         for result publication in the study. Otherwise, if automatic
2875                         publication is switched on, default value is used for result name.
2876
2877             Returns:
2878                 New GEOM.GEOM_Object, containing the created disk.
2879             """
2880             # Example: see GEOM_TestAll.py
2881             theR,Parameters = ParseParameters(theR)
2882             anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2883             RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2884             anObj.SetParameters(Parameters)
2885             self._autoPublish(anObj, theName, "disk")
2886             return anObj
2887
2888         ## Create a disk, passing through three given points
2889         #  @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2890         #  @param theName Object name; when specified, this parameter is used
2891         #         for result publication in the study. Otherwise, if automatic
2892         #         publication is switched on, default value is used for result name.
2893         #
2894         #  @return New GEOM.GEOM_Object, containing the created disk.
2895         #
2896         #  @ref tui_creation_disk "Example"
2897         @ManageTransactions("PrimOp")
2898         def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2899             """
2900             Create a disk, passing through three given points
2901
2902             Parameters:
2903                 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2904                 theName Object name; when specified, this parameter is used
2905                         for result publication in the study. Otherwise, if automatic
2906                         publication is switched on, default value is used for result name.
2907
2908             Returns:
2909                 New GEOM.GEOM_Object, containing the created disk.
2910             """
2911             # Example: see GEOM_TestAll.py
2912             anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2913             RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2914             self._autoPublish(anObj, theName, "disk")
2915             return anObj
2916
2917         ## Create a disk with specified dimensions along OX-OY coordinate axes.
2918         #  @param theR Radius of Face.
2919         #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2920         #  @param theName Object name; when specified, this parameter is used
2921         #         for result publication in the study. Otherwise, if automatic
2922         #         publication is switched on, default value is used for result name.
2923         #
2924         #  @return New GEOM.GEOM_Object, containing the created disk.
2925         #
2926         #  @ref tui_creation_face "Example"
2927         @ManageTransactions("PrimOp")
2928         def MakeDiskR(self, theR, theOrientation, theName=None):
2929             """
2930             Create a disk with specified dimensions along OX-OY coordinate axes.
2931
2932             Parameters:
2933                 theR Radius of Face.
2934                 theOrientation set the orientation belong axis OXY or OYZ or OZX
2935                 theName Object name; when specified, this parameter is used
2936                         for result publication in the study. Otherwise, if automatic
2937                         publication is switched on, default value is used for result name.
2938
2939             Returns:
2940                 New GEOM.GEOM_Object, containing the created disk.
2941
2942             Example of usage:
2943                 Disk3 = geompy.MakeDiskR(100., 1)
2944             """
2945             # Example: see GEOM_TestAll.py
2946             theR,Parameters = ParseParameters(theR)
2947             anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2948             RaiseIfFailed("MakeDiskR", self.PrimOp)
2949             anObj.SetParameters(Parameters)
2950             self._autoPublish(anObj, theName, "disk")
2951             return anObj
2952
2953         ## Create a cylinder with given base point, axis, radius and height.
2954         #  @param thePnt Central point of cylinder base.
2955         #  @param theAxis Cylinder axis.
2956         #  @param theR Cylinder radius.
2957         #  @param theH Cylinder height.
2958         #  @param theName Object name; when specified, this parameter is used
2959         #         for result publication in the study. Otherwise, if automatic
2960         #         publication is switched on, default value is used for result name.
2961         #
2962         #  @return New GEOM.GEOM_Object, containing the created cylinder.
2963         #
2964         #  @ref tui_creation_cylinder "Example"
2965         @ManageTransactions("PrimOp")
2966         def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2967             """
2968             Create a cylinder with given base point, axis, radius and height.
2969
2970             Parameters:
2971                 thePnt Central point of cylinder base.
2972                 theAxis Cylinder axis.
2973                 theR Cylinder radius.
2974                 theH Cylinder height.
2975                 theName Object name; when specified, this parameter is used
2976                         for result publication in the study. Otherwise, if automatic
2977                         publication is switched on, default value is used for result name.
2978
2979             Returns:
2980                 New GEOM.GEOM_Object, containing the created cylinder.
2981             """
2982             # Example: see GEOM_TestAll.py
2983             theR,theH,Parameters = ParseParameters(theR, theH)
2984             anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2985             RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2986             anObj.SetParameters(Parameters)
2987             self._autoPublish(anObj, theName, "cylinder")
2988             return anObj
2989             
2990         ## Create a portion of cylinder with given base point, axis, radius, height and angle.
2991         #  @param thePnt Central point of cylinder base.
2992         #  @param theAxis Cylinder axis.
2993         #  @param theR Cylinder radius.
2994         #  @param theH Cylinder height.
2995         #  @param theA Cylinder angle in radians.
2996         #  @param theName Object name; when specified, this parameter is used
2997         #         for result publication in the study. Otherwise, if automatic
2998         #         publication is switched on, default value is used for result name.
2999         #
3000         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3001         #
3002         #  @ref tui_creation_cylinder "Example"
3003         @ManageTransactions("PrimOp")
3004         def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3005             """
3006             Create a a portion of cylinder with given base point, axis, radius, height and angle.
3007
3008             Parameters:
3009                 thePnt Central point of cylinder base.
3010                 theAxis Cylinder axis.
3011                 theR Cylinder radius.
3012                 theH Cylinder height.
3013                 theA Cylinder angle in radians.
3014                 theName Object name; when specified, this parameter is used
3015                         for result publication in the study. Otherwise, if automatic
3016                         publication is switched on, default value is used for result name.
3017
3018             Returns:
3019                 New GEOM.GEOM_Object, containing the created cylinder.
3020             """
3021             # Example: see GEOM_TestAll.py
3022             flag = False
3023             if isinstance(theA,str):
3024                 flag = True
3025             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3026             if flag:
3027                 theA = theA*math.pi/180.
3028             anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3029             RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3030             anObj.SetParameters(Parameters)
3031             self._autoPublish(anObj, theName, "cylinder")
3032             return anObj
3033
3034         ## Create a cylinder with given radius and height at
3035         #  the origin of coordinate system. Axis of the cylinder
3036         #  will be collinear to the OZ axis of the coordinate system.
3037         #  @param theR Cylinder radius.
3038         #  @param theH Cylinder height.
3039         #  @param theName Object name; when specified, this parameter is used
3040         #         for result publication in the study. Otherwise, if automatic
3041         #         publication is switched on, default value is used for result name.
3042         #
3043         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3044         #
3045         #  @ref tui_creation_cylinder "Example"
3046         @ManageTransactions("PrimOp")
3047         def MakeCylinderRH(self, theR, theH, theName=None):
3048             """
3049             Create a cylinder with given radius and height at
3050             the origin of coordinate system. Axis of the cylinder
3051             will be collinear to the OZ axis of the coordinate system.
3052
3053             Parameters:
3054                 theR Cylinder radius.
3055                 theH Cylinder height.
3056                 theName Object name; when specified, this parameter is used
3057                         for result publication in the study. Otherwise, if automatic
3058                         publication is switched on, default value is used for result name.
3059
3060             Returns:
3061                 New GEOM.GEOM_Object, containing the created cylinder.
3062             """
3063             # Example: see GEOM_TestAll.py
3064             theR,theH,Parameters = ParseParameters(theR, theH)
3065             anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3066             RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3067             anObj.SetParameters(Parameters)
3068             self._autoPublish(anObj, theName, "cylinder")
3069             return anObj
3070             
3071         ## Create a portion of cylinder with given radius, height and angle at
3072         #  the origin of coordinate system. Axis of the cylinder
3073         #  will be collinear to the OZ axis of the coordinate system.
3074         #  @param theR Cylinder radius.
3075         #  @param theH Cylinder height.
3076         #  @param theA Cylinder angle in radians.
3077         #  @param theName Object name; when specified, this parameter is used
3078         #         for result publication in the study. Otherwise, if automatic
3079         #         publication is switched on, default value is used for result name.
3080         #
3081         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3082         #
3083         #  @ref tui_creation_cylinder "Example"
3084         @ManageTransactions("PrimOp")
3085         def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3086             """
3087             Create a portion of cylinder with given radius, height and angle at
3088             the origin of coordinate system. Axis of the cylinder
3089             will be collinear to the OZ axis of the coordinate system.
3090
3091             Parameters:
3092                 theR Cylinder radius.
3093                 theH Cylinder height.
3094                 theA Cylinder angle in radians.
3095                 theName Object name; when specified, this parameter is used
3096                         for result publication in the study. Otherwise, if automatic
3097                         publication is switched on, default value is used for result name.
3098
3099             Returns:
3100                 New GEOM.GEOM_Object, containing the created cylinder.
3101             """
3102             # Example: see GEOM_TestAll.py
3103             flag = False
3104             if isinstance(theA,str):
3105                 flag = True
3106             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3107             if flag:
3108                 theA = theA*math.pi/180.
3109             anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3110             RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3111             anObj.SetParameters(Parameters)
3112             self._autoPublish(anObj, theName, "cylinder")
3113             return anObj
3114
3115         ## Create a sphere with given center and radius.
3116         #  @param thePnt Sphere center.
3117         #  @param theR Sphere radius.
3118         #  @param theName Object name; when specified, this parameter is used
3119         #         for result publication in the study. Otherwise, if automatic
3120         #         publication is switched on, default value is used for result name.
3121         #
3122         #  @return New GEOM.GEOM_Object, containing the created sphere.
3123         #
3124         #  @ref tui_creation_sphere "Example"
3125         @ManageTransactions("PrimOp")
3126         def MakeSpherePntR(self, thePnt, theR, theName=None):
3127             """
3128             Create a sphere with given center and radius.
3129
3130             Parameters:
3131                 thePnt Sphere center.
3132                 theR Sphere radius.
3133                 theName Object name; when specified, this parameter is used
3134                         for result publication in the study. Otherwise, if automatic
3135                         publication is switched on, default value is used for result name.
3136
3137             Returns:
3138                 New GEOM.GEOM_Object, containing the created sphere.
3139             """
3140             # Example: see GEOM_TestAll.py
3141             theR,Parameters = ParseParameters(theR)
3142             anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3143             RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3144             anObj.SetParameters(Parameters)
3145             self._autoPublish(anObj, theName, "sphere")
3146             return anObj
3147
3148         ## Create a sphere with given center and radius.
3149         #  @param x,y,z Coordinates of sphere center.
3150         #  @param theR Sphere radius.
3151         #  @param theName Object name; when specified, this parameter is used
3152         #         for result publication in the study. Otherwise, if automatic
3153         #         publication is switched on, default value is used for result name.
3154         #
3155         #  @return New GEOM.GEOM_Object, containing the created sphere.
3156         #
3157         #  @ref tui_creation_sphere "Example"
3158         def MakeSphere(self, x, y, z, theR, theName=None):
3159             """
3160             Create a sphere with given center and radius.
3161
3162             Parameters:
3163                 x,y,z Coordinates of sphere center.
3164                 theR Sphere radius.
3165                 theName Object name; when specified, this parameter is used
3166                         for result publication in the study. Otherwise, if automatic
3167                         publication is switched on, default value is used for result name.
3168
3169             Returns:
3170                 New GEOM.GEOM_Object, containing the created sphere.
3171             """
3172             # Example: see GEOM_TestAll.py
3173             point = self.MakeVertex(x, y, z)
3174             # note: auto-publishing is done in self.MakeSpherePntR()
3175             anObj = self.MakeSpherePntR(point, theR, theName)
3176             return anObj
3177
3178         ## Create a sphere with given radius at the origin of coordinate system.
3179         #  @param theR Sphere radius.
3180         #  @param theName Object name; when specified, this parameter is used
3181         #         for result publication in the study. Otherwise, if automatic
3182         #         publication is switched on, default value is used for result name.
3183         #
3184         #  @return New GEOM.GEOM_Object, containing the created sphere.
3185         #
3186         #  @ref tui_creation_sphere "Example"
3187         @ManageTransactions("PrimOp")
3188         def MakeSphereR(self, theR, theName=None):
3189             """
3190             Create a sphere with given radius at the origin of coordinate system.
3191
3192             Parameters:
3193                 theR Sphere radius.
3194                 theName Object name; when specified, this parameter is used
3195                         for result publication in the study. Otherwise, if automatic
3196                         publication is switched on, default value is used for result name.
3197
3198             Returns:
3199                 New GEOM.GEOM_Object, containing the created sphere.
3200             """
3201             # Example: see GEOM_TestAll.py
3202             theR,Parameters = ParseParameters(theR)
3203             anObj = self.PrimOp.MakeSphereR(theR)
3204             RaiseIfFailed("MakeSphereR", self.PrimOp)
3205             anObj.SetParameters(Parameters)
3206             self._autoPublish(anObj, theName, "sphere")
3207             return anObj
3208
3209         ## Create a cone with given base point, axis, height and radiuses.
3210         #  @param thePnt Central point of the first cone base.
3211         #  @param theAxis Cone axis.
3212         #  @param theR1 Radius of the first cone base.
3213         #  @param theR2 Radius of the second cone base.
3214         #    \note If both radiuses are non-zero, the cone will be truncated.
3215         #    \note If the radiuses are equal, a cylinder will be created instead.
3216         #  @param theH Cone height.
3217         #  @param theName Object name; when specified, this parameter is used
3218         #         for result publication in the study. Otherwise, if automatic
3219         #         publication is switched on, default value is used for result name.
3220         #
3221         #  @return New GEOM.GEOM_Object, containing the created cone.
3222         #
3223         #  @ref tui_creation_cone "Example"
3224         @ManageTransactions("PrimOp")
3225         def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3226             """
3227             Create a cone with given base point, axis, height and radiuses.
3228
3229             Parameters:
3230                 thePnt Central point of the first cone base.
3231                 theAxis Cone axis.
3232                 theR1 Radius of the first cone base.
3233                 theR2 Radius of the second cone base.
3234                 theH Cone height.
3235                 theName Object name; when specified, this parameter is used
3236                         for result publication in the study. Otherwise, if automatic
3237                         publication is switched on, default value is used for result name.
3238
3239             Note:
3240                 If both radiuses are non-zero, the cone will be truncated.
3241                 If the radiuses are equal, a cylinder will be created instead.
3242
3243             Returns:
3244                 New GEOM.GEOM_Object, containing the created cone.
3245             """
3246             # Example: see GEOM_TestAll.py
3247             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3248             anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3249             RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3250             anObj.SetParameters(Parameters)
3251             self._autoPublish(anObj, theName, "cone")
3252             return anObj
3253
3254         ## Create a cone with given height and radiuses at
3255         #  the origin of coordinate system. Axis of the cone will
3256         #  be collinear to the OZ axis of the coordinate system.
3257         #  @param theR1 Radius of the first cone base.
3258         #  @param theR2 Radius of the second cone base.
3259         #    \note If both radiuses are non-zero, the cone will be truncated.
3260         #    \note If the radiuses are equal, a cylinder will be created instead.
3261         #  @param theH Cone height.
3262         #  @param theName Object name; when specified, this parameter is used
3263         #         for result publication in the study. Otherwise, if automatic
3264         #         publication is switched on, default value is used for result name.
3265         #
3266         #  @return New GEOM.GEOM_Object, containing the created cone.
3267         #
3268         #  @ref tui_creation_cone "Example"
3269         @ManageTransactions("PrimOp")
3270         def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3271             """
3272             Create a cone with given height and radiuses at
3273             the origin of coordinate system. Axis of the cone will
3274             be collinear to the OZ axis of the coordinate system.
3275
3276             Parameters:
3277                 theR1 Radius of the first cone base.
3278                 theR2 Radius of the second cone base.
3279                 theH Cone height.
3280                 theName Object name; when specified, this parameter is used
3281                         for result publication in the study. Otherwise, if automatic
3282                         publication is switched on, default value is used for result name.
3283
3284             Note:
3285                 If both radiuses are non-zero, the cone will be truncated.
3286                 If the radiuses are equal, a cylinder will be created instead.
3287
3288             Returns:
3289                 New GEOM.GEOM_Object, containing the created cone.
3290             """
3291             # Example: see GEOM_TestAll.py
3292             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3293             anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3294             RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3295             anObj.SetParameters(Parameters)
3296             self._autoPublish(anObj, theName, "cone")
3297             return anObj
3298
3299         ## Create a torus with given center, normal vector and radiuses.
3300         #  @param thePnt Torus central point.
3301         #  @param theVec Torus axis of symmetry.
3302         #  @param theRMajor Torus major radius.
3303         #  @param theRMinor Torus minor radius.
3304         #  @param theName Object name; when specified, this parameter is used
3305         #         for result publication in the study. Otherwise, if automatic
3306         #         publication is switched on, default value is used for result name.
3307         #
3308         #  @return New GEOM.GEOM_Object, containing the created torus.
3309         #
3310         #  @ref tui_creation_torus "Example"
3311         @ManageTransactions("PrimOp")
3312         def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3313             """
3314             Create a torus with given center, normal vector and radiuses.
3315
3316             Parameters:
3317                 thePnt Torus central point.
3318                 theVec Torus axis of symmetry.
3319                 theRMajor Torus major radius.
3320                 theRMinor Torus minor radius.
3321                 theName Object name; when specified, this parameter is used
3322                         for result publication in the study. Otherwise, if automatic
3323                         publication is switched on, default value is used for result name.
3324
3325            Returns:
3326                 New GEOM.GEOM_Object, containing the created torus.
3327             """
3328             # Example: see GEOM_TestAll.py
3329             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3330             anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3331             RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3332             anObj.SetParameters(Parameters)
3333             self._autoPublish(anObj, theName, "torus")
3334             return anObj
3335
3336         ## Create a torus with given radiuses at the origin of coordinate system.
3337         #  @param theRMajor Torus major radius.
3338         #  @param theRMinor Torus minor radius.
3339         #  @param theName Object name; when specified, this parameter is used
3340         #         for result publication in the study. Otherwise, if automatic
3341         #         publication is switched on, default value is used for result name.
3342         #
3343         #  @return New GEOM.GEOM_Object, containing the created torus.
3344         #
3345         #  @ref tui_creation_torus "Example"
3346         @ManageTransactions("PrimOp")
3347         def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3348             """
3349            Create a torus with given radiuses at the origin of coordinate system.
3350
3351            Parameters:
3352                 theRMajor Torus major radius.
3353                 theRMinor Torus minor radius.
3354                 theName Object name; when specified, this parameter is used
3355                         for result publication in the study. Otherwise, if automatic
3356                         publication is switched on, default value is used for result name.
3357
3358            Returns:
3359                 New GEOM.GEOM_Object, containing the created torus.
3360             """
3361             # Example: see GEOM_TestAll.py
3362             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3363             anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3364             RaiseIfFailed("MakeTorusRR", self.PrimOp)
3365             anObj.SetParameters(Parameters)
3366             self._autoPublish(anObj, theName, "torus")
3367             return anObj
3368
3369         # end of l3_3d_primitives
3370         ## @}
3371
3372         ## @addtogroup l3_complex
3373         ## @{
3374
3375         ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3376         #  @param theBase Base shape to be extruded.
3377         #  @param thePoint1 First end of extrusion vector.
3378         #  @param thePoint2 Second end of extrusion vector.
3379         #  @param theScaleFactor Use it to make prism with scaled second base.
3380         #                        Nagative value means not scaled second base.
3381         #  @param theName Object name; when specified, this parameter is used
3382         #         for result publication in the study. Otherwise, if automatic
3383         #         publication is switched on, default value is used for result name.
3384         #
3385         #  @return New GEOM.GEOM_Object, containing the created prism.
3386         #
3387         #  @ref tui_creation_prism "Example"
3388         @ManageTransactions("PrimOp")
3389         def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3390             """
3391             Create a shape by extrusion of the base shape along a vector, defined by two points.
3392
3393             Parameters:
3394                 theBase Base shape to be extruded.
3395                 thePoint1 First end of extrusion vector.
3396                 thePoint2 Second end of extrusion vector.
3397                 theScaleFactor Use it to make prism with scaled second base.
3398                                Nagative value means not scaled second base.
3399                 theName Object name; when specified, this parameter is used
3400                         for result publication in the study. Otherwise, if automatic
3401                         publication is switched on, default value is used for result name.
3402
3403             Returns:
3404                 New GEOM.GEOM_Object, containing the created prism.
3405             """
3406             # Example: see GEOM_TestAll.py
3407             anObj = None
3408             Parameters = ""
3409             if theScaleFactor > 0:
3410                 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3411                 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3412             else:
3413                 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3414             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3415             anObj.SetParameters(Parameters)
3416             self._autoPublish(anObj, theName, "prism")
3417             return anObj
3418
3419         ## Create a shape by extrusion of the base shape along a
3420         #  vector, defined by two points, in 2 Ways (forward/backward).
3421         #  @param theBase Base shape to be extruded.
3422         #  @param thePoint1 First end of extrusion vector.
3423         #  @param thePoint2 Second end of extrusion vector.
3424         #  @param theName Object name; when specified, this parameter is used
3425         #         for result publication in the study. Otherwise, if automatic
3426         #         publication is switched on, default value is used for result name.
3427         #
3428         #  @return New GEOM.GEOM_Object, containing the created prism.
3429         #
3430         #  @ref tui_creation_prism "Example"
3431         @ManageTransactions("PrimOp")
3432         def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3433             """
3434             Create a shape by extrusion of the base shape along a
3435             vector, defined by two points, in 2 Ways (forward/backward).
3436
3437             Parameters:
3438                 theBase Base shape to be extruded.
3439                 thePoint1 First end of extrusion vector.
3440                 thePoint2 Second end of extrusion vector.
3441                 theName Object name; when specified, this parameter is used
3442                         for result publication in the study. Otherwise, if automatic
3443                         publication is switched on, default value is used for result name.
3444
3445             Returns:
3446                 New GEOM.GEOM_Object, containing the created prism.
3447             """
3448             # Example: see GEOM_TestAll.py
3449             anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3450             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3451             self._autoPublish(anObj, theName, "prism")
3452             return anObj
3453
3454         ## Create a shape by extrusion of the base shape along the vector,
3455         #  i.e. all the space, transfixed by the base shape during its translation
3456         #  along the vector on the given distance.
3457         #  @param theBase Base shape to be extruded.
3458         #  @param theVec Direction of extrusion.
3459         #  @param theH Prism dimension along theVec.
3460         #  @param theScaleFactor Use it to make prism with scaled second base.
3461         #                        Negative value means not scaled second base.
3462         #  @param theName Object name; when specified, this parameter is used
3463         #         for result publication in the study. Otherwise, if automatic
3464         #         publication is switched on, default value is used for result name.
3465         #
3466         #  @return New GEOM.GEOM_Object, containing the created prism.
3467         #
3468         #  @ref tui_creation_prism "Example"
3469         @ManageTransactions("PrimOp")
3470         def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3471             """
3472             Create a shape by extrusion of the base shape along the vector,
3473             i.e. all the space, transfixed by the base shape during its translation
3474             along the vector on the given distance.
3475
3476             Parameters:
3477                 theBase Base shape to be extruded.
3478                 theVec Direction of extrusion.
3479                 theH Prism dimension along theVec.
3480                 theScaleFactor Use it to make prism with scaled second base.
3481                                Negative value means not scaled second base.
3482                 theName Object name; when specified, this parameter is used
3483                         for result publication in the study. Otherwise, if automatic
3484                         publication is switched on, default value is used for result name.
3485
3486             Returns:
3487                 New GEOM.GEOM_Object, containing the created prism.
3488             """
3489             # Example: see GEOM_TestAll.py
3490             anObj = None
3491             Parameters = ""
3492             if theScaleFactor > 0:
3493                 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3494                 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3495             else:
3496                 theH,Parameters = ParseParameters(theH)
3497                 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3498             RaiseIfFailed("MakePrismVecH", self.PrimOp)
3499             anObj.SetParameters(Parameters)
3500             self._autoPublish(anObj, theName, "prism")
3501             return anObj
3502
3503         ## Create a shape by extrusion of the base shape along the vector,
3504         #  i.e. all the space, transfixed by the base shape during its translation
3505         #  along the vector on the given distance in 2 Ways (forward/backward).
3506         #  @param theBase Base shape to be extruded.
3507         #  @param theVec Direction of extrusion.
3508         #  @param theH Prism dimension along theVec in forward direction.
3509         #  @param theName Object name; when specified, this parameter is used
3510         #         for result publication in the study. Otherwise, if automatic
3511         #         publication is switched on, default value is used for result name.
3512         #
3513         #  @return New GEOM.GEOM_Object, containing the created prism.
3514         #
3515         #  @ref tui_creation_prism "Example"
3516         @ManageTransactions("PrimOp")
3517         def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3518             """
3519             Create a shape by extrusion of the base shape along the vector,
3520             i.e. all the space, transfixed by the base shape during its translation
3521             along the vector on the given distance in 2 Ways (forward/backward).
3522
3523             Parameters:
3524                 theBase Base shape to be extruded.
3525                 theVec Direction of extrusion.
3526                 theH Prism dimension along theVec in forward direction.
3527                 theName Object name; when specified, this parameter is used
3528                         for result publication in the study. Otherwise, if automatic
3529                         publication is switched on, default value is used for result name.
3530
3531             Returns:
3532                 New GEOM.GEOM_Object, containing the created prism.
3533             """
3534             # Example: see GEOM_TestAll.py
3535             theH,Parameters = ParseParameters(theH)
3536             anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3537             RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3538             anObj.SetParameters(Parameters)
3539             self._autoPublish(anObj, theName, "prism")
3540             return anObj
3541
3542         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3543         #  @param theBase Base shape to be extruded.
3544         #  @param theDX, theDY, theDZ Directions of extrusion.
3545         #  @param theScaleFactor Use it to make prism with scaled second base.
3546         #                        Nagative value means not scaled second base.
3547         #  @param theName Object name; when specified, this parameter is used
3548         #         for result publication in the study. Otherwise, if automatic
3549         #         publication is switched on, default value is used for result name.
3550         #
3551         #  @return New GEOM.GEOM_Object, containing the created prism.
3552         #
3553         #  @ref tui_creation_prism "Example"
3554         @ManageTransactions("PrimOp")
3555         def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3556             """
3557             Create a shape by extrusion of the base shape along the dx, dy, dz direction
3558
3559             Parameters:
3560                 theBase Base shape to be extruded.
3561                 theDX, theDY, theDZ Directions of extrusion.
3562                 theScaleFactor Use it to make prism with scaled second base.
3563                                Nagative value means not scaled second base.
3564                 theName Object name; when specified, this parameter is used
3565                         for result publication in the study. Otherwise, if automatic
3566                         publication is switched on, default value is used for result name.
3567
3568             Returns:
3569                 New GEOM.GEOM_Object, containing the created prism.
3570             """
3571             # Example: see GEOM_TestAll.py
3572             anObj = None
3573             Parameters = ""
3574             if theScaleFactor > 0:
3575                 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3576                 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3577             else:
3578                 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3579                 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3580             RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3581             anObj.SetParameters(Parameters)
3582             self._autoPublish(anObj, theName, "prism")
3583             return anObj
3584
3585         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3586         #  i.e. all the space, transfixed by the base shape during its translation
3587         #  along the vector on the given distance in 2 Ways (forward/backward).
3588         #  @param theBase Base shape to be extruded.
3589         #  @param theDX, theDY, theDZ Directions of extrusion.
3590         #  @param theName Object name; when specified, this parameter is used
3591         #         for result publication in the study. Otherwise, if automatic
3592         #         publication is switched on, default value is used for result name.
3593         #
3594         #  @return New GEOM.GEOM_Object, containing the created prism.
3595         #
3596         #  @ref tui_creation_prism "Example"
3597         @ManageTransactions("PrimOp")
3598         def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3599             """
3600             Create a shape by extrusion of the base shape along the dx, dy, dz direction
3601             i.e. all the space, transfixed by the base shape during its translation
3602             along the vector on the given distance in 2 Ways (forward/backward).
3603
3604             Parameters:
3605                 theBase Base shape to be extruded.
3606                 theDX, theDY, theDZ Directions of extrusion.
3607                 theName Object name; when specified, this parameter is used
3608                         for result publication in the study. Otherwise, if automatic
3609                         publication is switched on, default value is used for result name.
3610
3611             Returns:
3612                 New GEOM.GEOM_Object, containing the created prism.
3613             """
3614             # Example: see GEOM_TestAll.py
3615             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3616             anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3617             RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3618             anObj.SetParameters(Parameters)
3619             self._autoPublish(anObj, theName, "prism")
3620             return anObj
3621
3622         ## Create a shape by revolution of the base shape around the axis
3623         #  on the given angle, i.e. all the space, transfixed by the base
3624         #  shape during its rotation around the axis on the given angle.
3625         #  @param theBase Base shape to be rotated.
3626         #  @param theAxis Rotation axis.
3627         #  @param theAngle Rotation angle in radians.
3628         #  @param theName Object name; when specified, this parameter is used
3629         #         for result publication in the study. Otherwise, if automatic
3630         #         publication is switched on, default value is used for result name.
3631         #
3632         #  @return New GEOM.GEOM_Object, containing the created revolution.
3633         #
3634         #  @ref tui_creation_revolution "Example"
3635         @ManageTransactions("PrimOp")
3636         def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3637             """
3638             Create a shape by revolution of the base shape around the axis
3639             on the given angle, i.e. all the space, transfixed by the base
3640             shape during its rotation around the axis on the given angle.
3641
3642             Parameters:
3643                 theBase Base shape to be rotated.
3644                 theAxis Rotation axis.
3645                 theAngle Rotation angle in radians.
3646                 theName Object name; when specified, this parameter is used
3647                         for result publication in the study. Otherwise, if automatic
3648                         publication is switched on, default value is used for result name.
3649
3650             Returns:
3651                 New GEOM.GEOM_Object, containing the created revolution.
3652             """
3653             # Example: see GEOM_TestAll.py
3654             theAngle,Parameters = ParseParameters(theAngle)
3655             anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3656             RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3657             anObj.SetParameters(Parameters)
3658             self._autoPublish(anObj, theName, "revolution")
3659             return anObj
3660
3661         ## Create a shape by revolution of the base shape around the axis
3662         #  on the given angle, i.e. all the space, transfixed by the base
3663         #  shape during its rotation around the axis on the given angle in
3664         #  both directions (forward/backward)
3665         #  @param theBase Base shape to be rotated.
3666         #  @param theAxis Rotation axis.
3667         #  @param theAngle Rotation angle in radians.
3668         #  @param theName Object name; when specified, this parameter is used
3669         #         for result publication in the study. Otherwise, if automatic
3670         #         publication is switched on, default value is used for result name.
3671         #
3672         #  @return New GEOM.GEOM_Object, containing the created revolution.
3673         #
3674         #  @ref tui_creation_revolution "Example"
3675         @ManageTransactions("PrimOp")
3676         def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3677             """
3678             Create a shape by revolution of the base shape around the axis
3679             on the given angle, i.e. all the space, transfixed by the base
3680             shape during its rotation around the axis on the given angle in
3681             both directions (forward/backward).
3682
3683             Parameters:
3684                 theBase Base shape to be rotated.
3685                 theAxis Rotation axis.
3686                 theAngle Rotation angle in radians.
3687                 theName Object name; when specified, this parameter is used
3688                         for result publication in the study. Otherwise, if automatic
3689                         publication is switched on, default value is used for result name.
3690
3691             Returns:
3692                 New GEOM.GEOM_Object, containing the created revolution.
3693             """
3694             theAngle,Parameters = ParseParameters(theAngle)
3695             anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3696             RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3697             anObj.SetParameters(Parameters)
3698             self._autoPublish(anObj, theName, "revolution")
3699             return anObj
3700
3701         ## Create a filling from the given compound of contours.
3702         #  @param theShape the compound of contours
3703         #  @param theMinDeg a minimal degree of BSpline surface to create
3704         #  @param theMaxDeg a maximal degree of BSpline surface to create
3705         #  @param theTol2D a 2d tolerance to be reached
3706         #  @param theTol3D a 3d tolerance to be reached
3707         #  @param theNbIter a number of iteration of approximation algorithm
3708         #  @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3709         #  @param isApprox if True, BSpline curves are generated in the process
3710         #                  of surface construction. By default it is False, that means
3711         #                  the surface is created using given curves. The usage of
3712         #                  Approximation makes the algorithm work slower, but allows
3713         #                  building the surface for rather complex cases.
3714         #  @param theName Object name; when specified, this parameter is used
3715         #         for result publication in the study. Otherwise, if automatic
3716         #         publication is switched on, default value is used for result name.
3717         #
3718         #  @return New GEOM.GEOM_Object, containing the created filling surface.
3719         #
3720         #  @ref tui_creation_filling "Example"
3721         @ManageTransactions("PrimOp")
3722         def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3723                         theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3724             """
3725             Create a filling from the given compound of contours.
3726
3727             Parameters:
3728                 theShape the compound of contours
3729                 theMinDeg a minimal degree of BSpline surface to create
3730                 theMaxDeg a maximal degree of BSpline surface to create
3731                 theTol2D a 2d tolerance to be reached
3732                 theTol3D a 3d tolerance to be reached
3733                 theNbIter a number of iteration of approximation algorithm
3734                 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3735                 isApprox if True, BSpline curves are generated in the process
3736                          of surface construction. By default it is False, that means
3737                          the surface is created using given curves. The usage of
3738                          Approximation makes the algorithm work slower, but allows
3739                          building the surface for rather complex cases
3740                 theName Object name; when specified, this parameter is used
3741                         for result publication in the study. Otherwise, if automatic
3742                         publication is switched on, default value is used for result name.
3743
3744             Returns:
3745                 New GEOM.GEOM_Object, containing the created filling surface.
3746
3747             Example of usage:
3748                 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3749             """
3750             # Example: see GEOM_TestAll.py
3751             theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3752             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3753                                             theTol2D, theTol3D, theNbIter,
3754                                             theMethod, isApprox)
3755             RaiseIfFailed("MakeFilling", self.PrimOp)
3756             anObj.SetParameters(Parameters)
3757             self._autoPublish(anObj, theName, "filling")
3758             return anObj
3759
3760
3761         ## Create a filling from the given compound of contours.
3762         #  This method corresponds to MakeFilling with isApprox=True
3763         #  @param theShape the compound of contours
3764         #  @param theMinDeg a minimal degree of BSpline surface to create
3765         #  @param theMaxDeg a maximal degree of BSpline surface to create
3766         #  @param theTol3D a 3d tolerance to be reached
3767         #  @param theName Object name; when specified, this parameter is used
3768         #         for result publication in the study. Otherwise, if automatic
3769         #         publication is switched on, default value is used for result name.
3770         #
3771         #  @return New GEOM.GEOM_Object, containing the created filling surface.
3772         #
3773         #  @ref tui_creation_filling "Example"
3774         @ManageTransactions("PrimOp")
3775         def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3776             """
3777             Create a filling from the given compound of contours.
3778             This method corresponds to MakeFilling with isApprox=True
3779
3780             Parameters:
3781                 theShape the compound of contours
3782                 theMinDeg a minimal degree of BSpline surface to create
3783                 theMaxDeg a maximal degree of BSpline surface to create
3784                 theTol3D a 3d tolerance to be reached
3785                 theName Object name; when specified, this parameter is used
3786                         for result publication in the study. Otherwise, if automatic
3787                         publication is switched on, default value is used for result name.
3788
3789             Returns:
3790                 New GEOM.GEOM_Object, containing the created filling surface.
3791
3792             Example of usage:
3793                 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3794             """
3795             # Example: see GEOM_TestAll.py
3796             theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3797             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3798                                             0, theTol3D, 0, GEOM.FOM_Default, True)
3799             RaiseIfFailed("MakeFillingNew", self.PrimOp)
3800             anObj.SetParameters(Parameters)
3801             self._autoPublish(anObj, theName, "filling")
3802             return anObj
3803
3804         ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3805         #  @param theSeqSections - set of specified sections.
3806         #  @param theModeSolid - mode defining building solid or shell
3807         #  @param thePreci - precision 3D used for smoothing
3808         #  @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3809         #  @param theName Object name; when specified, this parameter is used
3810         #         for result publication in the study. Otherwise, if automatic
3811         #         publication is switched on, default value is used for result name.
3812         #
3813         #  @return New GEOM.GEOM_Object, containing the created shell or solid.
3814         #
3815         #  @ref swig_todo "Example"
3816         @ManageTransactions("PrimOp")
3817         def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3818             """
3819             Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3820
3821             Parameters:
3822                 theSeqSections - set of specified sections.
3823                 theModeSolid - mode defining building solid or shell
3824                 thePreci - precision 3D used for smoothing
3825                 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3826                 theName Object name; when specified, this parameter is used
3827                         for result publication in the study. Otherwise, if automatic
3828                         publication is switched on, default value is used for result name.
3829
3830             Returns:
3831                 New GEOM.GEOM_Object, containing the created shell or solid.
3832             """
3833             # Example: see GEOM_TestAll.py
3834             anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3835             RaiseIfFailed("MakeThruSections", self.PrimOp)
3836             self._autoPublish(anObj, theName, "filling")
3837             return anObj
3838
3839         ## Create a shape by extrusion of the base shape along
3840         #  the path shape. The path shape can be a wire or an edge.
3841         #  @param theBase Base shape to be extruded.
3842         #  @param thePath Path shape to extrude the base shape along it.
3843         #  @param theName Object name; when specified, this parameter is used
3844         #         for result publication in the study. Otherwise, if automatic
3845         #         publication is switched on, default value is used for result name.
3846         #
3847         #  @return New GEOM.GEOM_Object, containing the created pipe.
3848         #
3849         #  @ref tui_creation_pipe "Example"
3850         @ManageTransactions("PrimOp")
3851         def MakePipe(self, theBase, thePath, theName=None):
3852             """
3853             Create a shape by extrusion of the base shape along
3854             the path shape. The path shape can be a wire or an edge.
3855
3856             Parameters:
3857                 theBase Base shape to be extruded.
3858                 thePath Path shape to extrude the base shape along it.
3859                 theName Object name; when specified, this parameter is used
3860                         for result publication in the study. Otherwise, if automatic
3861                         publication is switched on, default value is used for result name.
3862
3863             Returns:
3864                 New GEOM.GEOM_Object, containing the created pipe.
3865             """
3866             # Example: see GEOM_TestAll.py
3867             anObj = self.PrimOp.MakePipe(theBase, thePath)
3868             RaiseIfFailed("MakePipe", self.PrimOp)
3869             self._autoPublish(anObj, theName, "pipe")
3870             return anObj
3871
3872         ## Create a shape by extrusion of the profile shape along
3873         #  the path shape. The path shape can be a wire or an edge.
3874         #  the several profiles can be specified in the several locations of path.
3875         #  @param theSeqBases - list of  Bases shape to be extruded.
3876         #  @param theLocations - list of locations on the path corresponding
3877         #                        specified list of the Bases shapes. Number of locations
3878         #                        should be equal to number of bases or list of locations can be empty.
3879         #  @param thePath - Path shape to extrude the base shape along it.
3880         #  @param theWithContact - the mode defining that the section is translated to be in
3881         #                          contact with the spine.
3882         #  @param theWithCorrection - defining that the section is rotated to be
3883         #                             orthogonal to the spine tangent in the correspondent point
3884         #  @param theName Object name; when specified, this parameter is used
3885         #         for result publication in the study. Otherwise, if automatic
3886         #         publication is switched on, default value is used for result name.
3887         #
3888         #  @return New GEOM.GEOM_Object, containing the created pipe.
3889         #
3890         #  @ref tui_creation_pipe_with_diff_sec "Example"
3891         @ManageTransactions("PrimOp")
3892         def MakePipeWithDifferentSections(self, theSeqBases,
3893                                           theLocations, thePath,
3894                                           theWithContact, theWithCorrection, theName=None):
3895             """
3896             Create a shape by extrusion of the profile shape along
3897             the path shape. The path shape can be a wire or an edge.
3898             the several profiles can be specified in the several locations of path.
3899
3900             Parameters:
3901                 theSeqBases - list of  Bases shape to be extruded.
3902                 theLocations - list of locations on the path corresponding
3903                                specified list of the Bases shapes. Number of locations
3904                                should be equal to number of bases or list of locations can be empty.
3905                 thePath - Path shape to extrude the base shape along it.
3906                 theWithContact - the mode defining that the section is translated to be in
3907                                  contact with the spine(0/1)
3908                 theWithCorrection - defining that the section is rotated to be
3909                                     orthogonal to the spine tangent in the correspondent point (0/1)
3910                 theName Object name; when specified, this parameter is used
3911                         for result publication in the study. Otherwise, if automatic
3912                         publication is switched on, default value is used for result name.
3913
3914             Returns:
3915                 New GEOM.GEOM_Object, containing the created pipe.
3916             """
3917             anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3918                                                               theLocations, thePath,
3919                                                               theWithContact, theWithCorrection)
3920             RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3921             self._autoPublish(anObj, theName, "pipe")
3922             return anObj
3923
3924         ## Create a shape by extrusion of the profile shape along
3925         #  the path shape. The path shape can be a wire or a edge.
3926         #  the several profiles can be specified in the several locations of path.
3927         #  @param theSeqBases - list of  Bases shape to be extruded. Base shape must be
3928         #                       shell or face. If number of faces in neighbour sections
3929         #                       aren't coincided result solid between such sections will
3930         #                       be created using external boundaries of this shells.
3931         #  @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3932         #                          This list is used for searching correspondences between
3933         #                          faces in the sections. Size of this list must be equal
3934         #                          to size of list of base shapes.
3935         #  @param theLocations - list of locations on the path corresponding
3936         #                        specified list of the Bases shapes. Number of locations
3937         #                        should be equal to number of bases. First and last
3938         #                        locations must be coincided with first and last vertexes
3939         #                        of path correspondingly.
3940         #  @param thePath - Path shape to extrude the base shape along it.
3941         #  @param theWithContact - the mode defining that the section is translated to be in
3942         #                          contact with the spine.
3943         #  @param theWithCorrection - defining that the section is rotated to be
3944         #                             orthogonal to the spine tangent in the correspondent point
3945         #  @param theName Object name; when specified, this parameter is used
3946         #         for result publication in the study. Otherwise, if automatic
3947         #         publication is switched on, default value is used for result name.
3948         #
3949         #  @return New GEOM.GEOM_Object, containing the created solids.
3950         #
3951         #  @ref tui_creation_pipe_with_shell_sec "Example"
3952         @ManageTransactions("PrimOp")
3953         def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3954                                       theLocations, thePath,
3955                                       theWithContact, theWithCorrection, theName=None):
3956             """
3957             Create a shape by extrusion of the profile shape along
3958             the path shape. The path shape can be a wire or a edge.
3959             the several profiles can be specified in the several locations of path.
3960
3961             Parameters:
3962                 theSeqBases - list of  Bases shape to be extruded. Base shape must be
3963                               shell or face. If number of faces in neighbour sections
3964                               aren't coincided result solid between such sections will
3965                               be created using external boundaries of this shells.
3966                 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3967                                  This list is used for searching correspondences between
3968                                  faces in the sections. Size of this list must be equal
3969                                  to size of list of base shapes.
3970                 theLocations - list of locations on the path corresponding
3971                                specified list of the Bases shapes. Number of locations
3972                                should be equal to number of bases. First and last
3973                                locations must be coincided with first and last vertexes
3974                                of path correspondingly.
3975                 thePath - Path shape to extrude the base shape along it.
3976                 theWithContact - the mode defining that the section is translated to be in
3977                                  contact with the spine (0/1)
3978                 theWithCorrection - defining that the section is rotated to be
3979                                     orthogonal to the spine tangent in the correspondent point (0/1)
3980                 theName Object name; when specified, this parameter is used
3981                         for result publication in the study. Otherwise, if automatic
3982                         publication is switched on, default value is used for result name.
3983
3984             Returns:
3985                 New GEOM.GEOM_Object, containing the created solids.
3986             """
3987             anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3988                                                           theLocations, thePath,
3989                                                           theWithContact, theWithCorrection)
3990             RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3991             self._autoPublish(anObj, theName, "pipe")
3992             return anObj
3993
3994         ## Create a shape by extrusion of the profile shape along
3995         #  the path shape. This function is used only for debug pipe
3996         #  functionality - it is a version of function MakePipeWithShellSections()
3997         #  which give a possibility to recieve information about
3998         #  creating pipe between each pair of sections step by step.
3999         @ManageTransactions("PrimOp")
4000         def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4001                                              theLocations, thePath,
4002                                              theWithContact, theWithCorrection, theName=None):
4003             """
4004             Create a shape by extrusion of the profile shape along
4005             the path shape. This function is used only for debug pipe
4006             functionality - it is a version of previous function
4007             geompy.MakePipeWithShellSections() which give a possibility to
4008             recieve information about creating pipe between each pair of
4009             sections step by step.
4010             """
4011             res = []
4012             nbsect = len(theSeqBases)
4013             nbsubsect = len(theSeqSubBases)
4014             #print "nbsect = ",nbsect
4015             for i in range(1,nbsect):
4016                 #print "  i = ",i
4017                 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4018                 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4019                 tmpSeqSubBases = []
4020                 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4021                 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4022                                                               tmpLocations, thePath,
4023                                                               theWithContact, theWithCorrection)
4024                 if self.PrimOp.IsDone() == 0:
4025                     print "Problems with pipe creation between ",i," and ",i+1," sections"
4026                     RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4027                     break
4028                 else:
4029                     print "Pipe between ",i," and ",i+1," sections is OK"
4030                     res.append(anObj)
4031                     pass
4032                 pass
4033
4034             resc = self.MakeCompound(res)
4035             #resc = self.MakeSewing(res, 0.001)
4036             #print "resc: ",resc
4037             self._autoPublish(resc, theName, "pipe")
4038             return resc
4039
4040         ## Create solids between given sections
4041         #  @param theSeqBases - list of sections (shell or face).
4042         #  @param theLocations - list of corresponding vertexes
4043         #  @param theName Object name; when specified, this parameter is used
4044         #         for result publication in the study. Otherwise, if automatic
4045         #         publication is switched on, default value is used for result name.
4046         #
4047         #  @return New GEOM.GEOM_Object, containing the created solids.
4048         #
4049         #  @ref tui_creation_pipe_without_path "Example"
4050         @ManageTransactions("PrimOp")
4051         def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
4052             """
4053             Create solids between given sections
4054
4055             Parameters:
4056                 theSeqBases - list of sections (shell or face).
4057                 theLocations - list of corresponding vertexes
4058                 theName Object name; when specified, this parameter is used
4059                         for result publication in the study. Otherwise, if automatic
4060                         publication is switched on, default value is used for result name.
4061
4062             Returns:
4063                 New GEOM.GEOM_Object, containing the created solids.
4064             """
4065             anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4066             RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4067             self._autoPublish(anObj, theName, "pipe")
4068             return anObj
4069
4070         ## Create a shape by extrusion of the base shape along
4071         #  the path shape with constant bi-normal direction along the given vector.
4072         #  The path shape can be a wire or an edge.
4073         #  @param theBase Base shape to be extruded.
4074         #  @param thePath Path shape to extrude the base shape along it.
4075         #  @param theVec Vector defines a constant binormal direction to keep the
4076         #                same angle beetween the direction and the sections
4077         #                along the sweep surface.
4078         #  @param theName Object name; when specified, this parameter is used
4079         #         for result publication in the study. Otherwise, if automatic
4080         #         publication is switched on, default value is used for result name.
4081         #
4082         #  @return New GEOM.GEOM_Object, containing the created pipe.
4083         #
4084         #  @ref tui_creation_pipe "Example"
4085         @ManageTransactions("PrimOp")
4086         def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4087             """
4088             Create a shape by extrusion of the base shape along
4089             the path shape with constant bi-normal direction along the given vector.
4090             The path shape can be a wire or an edge.
4091
4092             Parameters:
4093                 theBase Base shape to be extruded.
4094                 thePath Path shape to extrude the base shape along it.
4095                 theVec Vector defines a constant binormal direction to keep the
4096                        same angle beetween the direction and the sections
4097                        along the sweep surface.
4098                 theName Object name; when specified, this parameter is used
4099                         for result publication in the study. Otherwise, if automatic
4100                         publication is switched on, default value is used for result name.
4101
4102             Returns:
4103                 New GEOM.GEOM_Object, containing the created pipe.
4104             """
4105             # Example: see GEOM_TestAll.py
4106             anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4107             RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4108             self._autoPublish(anObj, theName, "pipe")
4109             return anObj
4110
4111         ## Makes a thick solid from a face or a shell
4112         #  @param theShape Face or Shell to be thicken
4113         #  @param theThickness Thickness of the resulting solid
4114         #  @param theName Object name; when specified, this parameter is used
4115         #         for result publication in the study. Otherwise, if automatic
4116         #         publication is switched on, default value is used for result name.
4117         #
4118         #  @return New GEOM.GEOM_Object, containing the created solid
4119         #
4120         @ManageTransactions("PrimOp")
4121         def MakeThickSolid(self, theShape, theThickness, theName=None):
4122             """
4123             Make a thick solid from a face or a shell
4124
4125             Parameters:
4126                  theShape Face or Shell to be thicken
4127                  theThickness Thickness of the resulting solid
4128                  theName Object name; when specified, this parameter is used
4129                  for result publication in the study. Otherwise, if automatic
4130                  publication is switched on, default value is used for result name.
4131
4132             Returns:
4133                 New GEOM.GEOM_Object, containing the created solid
4134             """
4135             # Example: see GEOM_TestAll.py
4136             anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4137             RaiseIfFailed("MakeThickening", self.PrimOp)
4138             self._autoPublish(anObj, theName, "pipe")
4139             return anObj
4140
4141
4142         ## Modifies a face or a shell to make it a thick solid
4143         #  @param theShape Face or Shell to be thicken
4144         #  @param theThickness Thickness of the resulting solid
4145         #
4146         #  @return The modified shape
4147         #
4148         @ManageTransactions("PrimOp")
4149         def Thicken(self, theShape, theThickness):
4150             """
4151             Modifies a face or a shell to make it a thick solid
4152
4153             Parameters:
4154                 theBase Base shape to be extruded.
4155                 thePath Path shape to extrude the base shape along it.
4156                 theName Object name; when specified, this parameter is used
4157                         for result publication in the study. Otherwise, if automatic
4158                         publication is switched on, default value is used for result name.
4159
4160             Returns:
4161                 The modified shape
4162             """
4163             # Example: see GEOM_TestAll.py
4164             anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4165             RaiseIfFailed("MakeThickening", self.PrimOp)
4166             return anObj
4167
4168         ## Build a middle path of a pipe-like shape.
4169         #  The path shape can be a wire or an edge.
4170         #  @param theShape It can be closed or unclosed pipe-like shell
4171         #                  or a pipe-like solid.
4172         #  @param theBase1, theBase2 Two bases of the supposed pipe. This
4173         #                            should be wires or faces of theShape.
4174         #  @param theName Object name; when specified, this parameter is used
4175         #         for result publication in the study. Otherwise, if automatic
4176         #         publication is switched on, default value is used for result name.
4177         #
4178         #  @note It is not assumed that exact or approximate copy of theShape
4179         #        can be obtained by applying existing Pipe operation on the
4180         #        resulting "Path" wire taking theBase1 as the base - it is not
4181         #        always possible; though in some particular cases it might work
4182         #        it is not guaranteed. Thus, RestorePath function should not be
4183         #        considered as an exact reverse operation of the Pipe.
4184         #
4185         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
4186         #                                source pipe's "path".
4187         #
4188         #  @ref tui_creation_pipe_path "Example"
4189         @ManageTransactions("PrimOp")
4190         def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4191             """
4192             Build a middle path of a pipe-like shape.
4193             The path shape can be a wire or an edge.
4194
4195             Parameters:
4196                 theShape It can be closed or unclosed pipe-like shell
4197                          or a pipe-like solid.
4198                 theBase1, theBase2 Two bases of the supposed pipe. This
4199                                    should be wires or faces of theShape.
4200                 theName Object name; when specified, this parameter is used
4201                         for result publication in the study. Otherwise, if automatic
4202                         publication is switched on, default value is used for result name.
4203
4204             Returns:
4205                 New GEOM_Object, containing an edge or wire that represent
4206                                  source pipe's path.
4207             """
4208             anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4209             RaiseIfFailed("RestorePath", self.PrimOp)
4210             self._autoPublish(anObj, theName, "path")
4211             return anObj
4212
4213         ## Build a middle path of a pipe-like shape.
4214         #  The path shape can be a wire or an edge.
4215         #  @param theShape It can be closed or unclosed pipe-like shell
4216         #                  or a pipe-like solid.
4217         #  @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4218         #                                should be lists of edges of theShape.
4219         #  @param theName Object name; when specified, this parameter is used
4220         #         for result publication in the study. Otherwise, if automatic
4221         #         publication is switched on, default value is used for result name.
4222         #
4223         #  @note It is not assumed that exact or approximate copy of theShape
4224         #        can be obtained by applying existing Pipe operation on the
4225         #        resulting "Path" wire taking theBase1 as the base - it is not
4226         #        always possible; though in some particular cases it might work
4227         #        it is not guaranteed. Thus, RestorePath function should not be
4228         #        considered as an exact reverse operation of the Pipe.
4229         #
4230         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
4231         #                                source pipe's "path".
4232         #
4233         #  @ref tui_creation_pipe_path "Example"
4234         @ManageTransactions("PrimOp")
4235         def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4236             """
4237             Build a middle path of a pipe-like shape.
4238             The path shape can be a wire or an edge.
4239
4240             Parameters:
4241                 theShape It can be closed or unclosed pipe-like shell
4242                          or a pipe-like solid.
4243                 listEdges1, listEdges2 Two bases of the supposed pipe. This
4244                                        should be lists of edges of theShape.
4245                 theName Object name; when specified, this parameter is used
4246                         for result publication in the study. Otherwise, if automatic
4247                         publication is switched on, default value is used for result name.
4248
4249             Returns:
4250                 New GEOM_Object, containing an edge or wire that represent
4251                                  source pipe's path.
4252             """
4253             anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4254             RaiseIfFailed("RestorePath", self.PrimOp)
4255             self._autoPublish(anObj, theName, "path")
4256             return anObj
4257
4258         # end of l3_complex
4259         ## @}
4260
4261         ## @addtogroup l3_advanced
4262         ## @{
4263
4264         ## Create a linear edge with specified ends.
4265         #  @param thePnt1 Point for the first end of edge.
4266         #  @param thePnt2 Point for the second end of edge.
4267         #  @param theName Object name; when specified, this parameter is used
4268         #         for result publication in the study. Otherwise, if automatic
4269         #         publication is switched on, default value is used for result name.
4270         #
4271         #  @return New GEOM.GEOM_Object, containing the created edge.
4272         #
4273         #  @ref tui_creation_edge "Example"
4274         @ManageTransactions("ShapesOp")
4275         def MakeEdge(self, thePnt1, thePnt2, theName=None):
4276             """
4277             Create a linear edge with specified ends.
4278
4279             Parameters:
4280                 thePnt1 Point for the first end of edge.
4281                 thePnt2 Point for the second end of edge.
4282                 theName Object name; when specified, this parameter is used
4283                         for result publication in the study. Otherwise, if automatic
4284                         publication is switched on, default value is used for result name.
4285
4286             Returns:
4287                 New GEOM.GEOM_Object, containing the created edge.
4288             """
4289             # Example: see GEOM_TestAll.py
4290             anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4291             RaiseIfFailed("MakeEdge", self.ShapesOp)
4292             self._autoPublish(anObj, theName, "edge")
4293             return anObj
4294
4295         ## Create a new edge, corresponding to the given length on the given curve.
4296         #  @param theRefCurve The referenced curve (edge).
4297         #  @param theLength Length on the referenced curve. It can be negative.
4298         #  @param theStartPoint Any point can be selected for it, the new edge will begin
4299         #                       at the end of \a theRefCurve, close to the selected point.
4300         #                       If None, start from the first point of \a theRefCurve.
4301         #  @param theName Object name; when specified, this parameter is used
4302         #         for result publication in the study. Otherwise, if automatic
4303         #         publication is switched on, default value is used for result name.
4304         #
4305         #  @return New GEOM.GEOM_Object, containing the created edge.
4306         #
4307         #  @ref tui_creation_edge "Example"
4308         @ManageTransactions("ShapesOp")
4309         def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4310             """
4311             Create a new edge, corresponding to the given length on the given curve.
4312
4313             Parameters:
4314                 theRefCurve The referenced curve (edge).
4315                 theLength Length on the referenced curve. It can be negative.
4316                 theStartPoint Any point can be selected for it, the new edge will begin
4317                               at the end of theRefCurve, close to the selected point.
4318                               If None, start from the first point of theRefCurve.
4319                 theName Object name; when specified, this parameter is used
4320                         for result publication in the study. Otherwise, if automatic
4321                         publication is switched on, default value is used for result name.
4322
4323             Returns:
4324                 New GEOM.GEOM_Object, containing the created edge.
4325             """
4326             # Example: see GEOM_TestAll.py
4327             theLength, Parameters = ParseParameters(theLength)
4328             anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4329             RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4330             anObj.SetParameters(Parameters)
4331             self._autoPublish(anObj, theName, "edge")
4332             return anObj
4333
4334         ## Create an edge from specified wire.
4335         #  @param theWire source Wire
4336         #  @param theLinearTolerance linear tolerance value (default = 1e-07)
4337         #  @param theAngularTolerance angular tolerance value (default = 1e-12)
4338         #  @param theName Object name; when specified, this parameter is used
4339         #         for result publication in the study. Otherwise, if automatic
4340         #         publication is switched on, default value is used for result name.
4341         #
4342         #  @return New GEOM.GEOM_Object, containing the created edge.
4343         #
4344         #  @ref tui_creation_edge "Example"
4345         @ManageTransactions("ShapesOp")
4346         def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4347             """
4348             Create an edge from specified wire.
4349
4350             Parameters:
4351                 theWire source Wire
4352                 theLinearTolerance linear tolerance value (default = 1e-07)
4353                 theAngularTolerance angular tolerance value (default = 1e-12)
4354                 theName Object name; when specified, this parameter is used
4355                         for result publication in the study. Otherwise, if automatic
4356                         publication is switched on, default value is used for result name.
4357
4358             Returns:
4359                 New GEOM.GEOM_Object, containing the created edge.
4360             """
4361             # Example: see GEOM_TestAll.py
4362             anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4363             RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4364             self._autoPublish(anObj, theName, "edge")
4365             return anObj
4366
4367         ## Create a wire from the set of edges and wires.
4368         #  @param theEdgesAndWires List of edges and/or wires.
4369         #  @param theTolerance Maximum distance between vertices, that will be merged.
4370         #                      Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4371         #  @param theName Object name; when specified, this parameter is used
4372         #         for result publication in the study. Otherwise, if automatic
4373         #         publication is switched on, default value is used for result name.
4374         #
4375         #  @return New GEOM.GEOM_Object, containing the created wire.
4376         #
4377         #  @ref tui_creation_wire "Example"
4378         @ManageTransactions("ShapesOp")
4379         def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4380             """
4381             Create a wire from the set of edges and wires.
4382
4383             Parameters:
4384                 theEdgesAndWires List of edges and/or wires.
4385                 theTolerance Maximum distance between vertices, that will be merged.
4386                              Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4387                 theName Object name; when specified, this parameter is used
4388                         for result publication in the study. Otherwise, if automatic
4389                         publication is switched on, default value is used for result name.
4390
4391             Returns:
4392                 New GEOM.GEOM_Object, containing the created wire.
4393             """
4394             # Example: see GEOM_TestAll.py
4395             anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4396             RaiseIfFailed("MakeWire", self.ShapesOp)
4397             self._autoPublish(anObj, theName, "wire")
4398             return anObj
4399
4400         ## Create a face on the given wire.
4401         #  @param theWire closed Wire or Edge to build the face on.
4402         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4403         #                        If the tolerance of the obtained planar face is less
4404         #                        than 1e-06, this face will be returned, otherwise the
4405         #                        algorithm tries to build any suitable face on the given
4406         #                        wire and prints a warning message.
4407         #  @param theName Object name; when specified, this parameter is used
4408         #         for result publication in the study. Otherwise, if automatic
4409         #         publication is switched on, default value is used for result name.
4410         #
4411         #  @return New GEOM.GEOM_Object, containing the created face.
4412         #
4413         #  @ref tui_creation_face "Example"
4414         @ManageTransactions("ShapesOp")
4415         def MakeFace(self, theWire, isPlanarWanted, theName=None):
4416             """
4417             Create a face on the given wire.
4418
4419             Parameters:
4420                 theWire closed Wire or Edge to build the face on.
4421                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4422                                If the tolerance of the obtained planar face is less
4423                                than 1e-06, this face will be returned, otherwise the
4424                                algorithm tries to build any suitable face on the given
4425                                wire and prints a warning message.
4426                 theName Object name; when specified, this parameter is used
4427                         for result publication in the study. Otherwise, if automatic
4428                         publication is switched on, default value is used for result name.
4429
4430             Returns:
4431                 New GEOM.GEOM_Object, containing the created face.
4432             """
4433             # Example: see GEOM_TestAll.py
4434             anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4435             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4436                 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4437             else:
4438                 RaiseIfFailed("MakeFace", self.ShapesOp)
4439             self._autoPublish(anObj, theName, "face")
4440             return anObj
4441
4442         ## Create a face on the given wires set.
4443         #  @param theWires List of closed wires or edges to build the face on.
4444         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4445         #                        If the tolerance of the obtained planar face is less
4446         #                        than 1e-06, this face will be returned, otherwise the
4447         #                        algorithm tries to build any suitable face on the given
4448         #                        wire and prints a warning message.
4449         #  @param theName Object name; when specified, this parameter is used
4450         #         for result publication in the study. Otherwise, if automatic
4451         #         publication is switched on, default value is used for result name.
4452         #
4453         #  @return New GEOM.GEOM_Object, containing the created face.
4454         #
4455         #  @ref tui_creation_face "Example"
4456         @ManageTransactions("ShapesOp")
4457         def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4458             """
4459             Create a face on the given wires set.
4460
4461             Parameters:
4462                 theWires List of closed wires or edges to build the face on.
4463                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4464                                If the tolerance of the obtained planar face is less
4465                                than 1e-06, this face will be returned, otherwise the
4466                                algorithm tries to build any suitable face on the given
4467                                wire and prints a warning message.
4468                 theName Object name; when specified, this parameter is used
4469                         for result publication in the study. Otherwise, if automatic
4470                         publication is switched on, default value is used for result name.
4471
4472             Returns:
4473                 New GEOM.GEOM_Object, containing the created face.
4474             """
4475             # Example: see GEOM_TestAll.py
4476             anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4477             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4478                 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4479             else:
4480                 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4481             self._autoPublish(anObj, theName, "face")
4482             return anObj
4483
4484         ## See MakeFaceWires() method for details.
4485         #
4486         #  @ref tui_creation_face "Example 1"
4487         #  \n @ref swig_MakeFaces  "Example 2"
4488         def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4489             """
4490             See geompy.MakeFaceWires() method for details.
4491             """
4492             # Example: see GEOM_TestOthers.py
4493             # note: auto-publishing is done in self.MakeFaceWires()
4494             anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4495             return anObj
4496
4497         ## Create a shell from the set of faces and shells.
4498         #  @param theFacesAndShells List of faces and/or shells.
4499         #  @param theName Object name; when specified, this parameter is used
4500         #         for result publication in the study. Otherwise, if automatic
4501         #         publication is switched on, default value is used for result name.
4502         #
4503         #  @return New GEOM.GEOM_Object, containing the created shell.
4504         #
4505         #  @ref tui_creation_shell "Example"
4506         @ManageTransactions("ShapesOp")
4507         def MakeShell(self, theFacesAndShells, theName=None):
4508             """
4509             Create a shell from the set of faces and shells.
4510
4511             Parameters:
4512                 theFacesAndShells List of faces and/or shells.
4513                 theName Object name; when specified, this parameter is used
4514                         for result publication in the study. Otherwise, if automatic
4515                         publication is switched on, default value is used for result name.
4516
4517             Returns:
4518                 New GEOM.GEOM_Object, containing the created shell.
4519             """
4520             # Example: see GEOM_TestAll.py
4521             anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4522             RaiseIfFailed("MakeShell", self.ShapesOp)
4523             self._autoPublish(anObj, theName, "shell")
4524             return anObj
4525
4526         ## Create a solid, bounded by the given shells.
4527         #  @param theShells Sequence of bounding shells.
4528         #  @param theName Object name; when specified, this parameter is used
4529         #         for result publication in the study. Otherwise, if automatic
4530         #         publication is switched on, default value is used for result name.
4531         #
4532         #  @return New GEOM.GEOM_Object, containing the created solid.
4533         #
4534         #  @ref tui_creation_solid "Example"
4535         @ManageTransactions("ShapesOp")
4536         def MakeSolid(self, theShells, theName=None):
4537             """
4538             Create a solid, bounded by the given shells.
4539
4540             Parameters:
4541                 theShells Sequence of bounding shells.
4542                 theName Object name; when specified, this parameter is used
4543                         for result publication in the study. Otherwise, if automatic
4544                         publication is switched on, default value is used for result name.
4545
4546             Returns:
4547                 New GEOM.GEOM_Object, containing the created solid.
4548             """
4549             # Example: see GEOM_TestAll.py
4550             if len(theShells) == 1:
4551                 descr = self._IsGoodForSolid(theShells[0])
4552                 #if len(descr) > 0:
4553                 #    raise RuntimeError, "MakeSolidShells : " + descr
4554                 if descr == "WRN_SHAPE_UNCLOSED":
4555                     raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4556             anObj = self.ShapesOp.MakeSolidShells(theShells)
4557             RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4558             self._autoPublish(anObj, theName, "solid")
4559             return anObj
4560
4561         ## Create a compound of the given shapes.
4562         #  @param theShapes List of shapes to put in compound.
4563         #  @param theName Object name; when specified, this parameter is used
4564         #         for result publication in the study. Otherwise, if automatic
4565         #         publication is switched on, default value is used for result name.
4566         #
4567         #  @return New GEOM.GEOM_Object, containing the created compound.
4568         #
4569         #  @ref tui_creation_compound "Example"
4570         @ManageTransactions("ShapesOp")
4571         def MakeCompound(self, theShapes, theName=None):
4572             """
4573             Create a compound of the given shapes.
4574
4575             Parameters:
4576                 theShapes List of shapes to put in compound.
4577                 theName Object name; when specified, this parameter is used
4578                         for result publication in the study. Otherwise, if automatic
4579                         publication is switched on, default value is used for result name.
4580
4581             Returns:
4582                 New GEOM.GEOM_Object, containing the created compound.
4583             """
4584             # Example: see GEOM_TestAll.py
4585             anObj = self.ShapesOp.MakeCompound(theShapes)
4586             RaiseIfFailed("MakeCompound", self.ShapesOp)
4587             self._autoPublish(anObj, theName, "compound")
4588             return anObj
4589
4590         # end of l3_advanced
4591         ## @}
4592
4593         ## @addtogroup l2_measure
4594         ## @{
4595
4596         ## Gives quantity of faces in the given shape.
4597         #  @param theShape Shape to count faces of.
4598         #  @return Quantity of faces.
4599         #
4600         #  @ref swig_NumberOf "Example"
4601         @ManageTransactions("ShapesOp")
4602         def NumberOfFaces(self, theShape):
4603             """
4604             Gives quantity of faces in the given shape.
4605
4606             Parameters:
4607                 theShape Shape to count faces of.
4608
4609             Returns:
4610                 Quantity of faces.
4611             """
4612             # Example: see GEOM_TestOthers.py
4613             nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4614             RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4615             return nb_faces
4616
4617         ## Gives quantity of edges in the given shape.
4618         #  @param theShape Shape to count edges of.
4619         #  @return Quantity of edges.
4620         #
4621         #  @ref swig_NumberOf "Example"
4622         @ManageTransactions("ShapesOp")
4623         def NumberOfEdges(self, theShape):
4624             """
4625             Gives quantity of edges in the given shape.
4626
4627             Parameters:
4628                 theShape Shape to count edges of.
4629
4630             Returns:
4631                 Quantity of edges.
4632             """
4633             # Example: see GEOM_TestOthers.py
4634             nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4635             RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4636             return nb_edges
4637
4638         ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4639         #  @param theShape Shape to count sub-shapes of.
4640         #  @param theShapeType Type of sub-shapes to count (see ShapeType())
4641         #  @return Quantity of sub-shapes of given type.
4642         #
4643         #  @ref swig_NumberOf "Example"
4644         @ManageTransactions("ShapesOp")
4645         def NumberOfSubShapes(self, theShape, theShapeType):
4646             """
4647             Gives quantity of sub-shapes of type theShapeType in the given shape.
4648
4649             Parameters:
4650                 theShape Shape to count sub-shapes of.
4651                 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4652
4653             Returns:
4654                 Quantity of sub-shapes of given type.
4655             """
4656             # Example: see GEOM_TestOthers.py
4657             nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4658             RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4659             return nb_ss
4660
4661         ## Gives quantity of solids in the given shape.
4662         #  @param theShape Shape to count solids in.
4663         #  @return Quantity of solids.
4664         #
4665         #  @ref swig_NumberOf "Example"
4666         @ManageTransactions("ShapesOp")
4667         def NumberOfSolids(self, theShape):
4668             """
4669             Gives quantity of solids in the given shape.
4670
4671             Parameters:
4672                 theShape Shape to count solids in.
4673
4674             Returns:
4675                 Quantity of solids.
4676             """
4677             # Example: see GEOM_TestOthers.py
4678             nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4679             RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4680             return nb_solids
4681
4682         # end of l2_measure
4683         ## @}
4684
4685         ## @addtogroup l3_healing
4686         ## @{
4687
4688         ## Reverses an orientation the given shape.
4689         #  @param theShape Shape to be reversed.
4690         #  @param theName Object name; when specified, this parameter is used
4691         #         for result publication in the study. Otherwise, if automatic
4692         #         publication is switched on, default value is used for result name.
4693         #
4694         #  @return The reversed copy of theShape.
4695         #
4696         #  @ref swig_ChangeOrientation "Example"
4697         @ManageTransactions("ShapesOp")
4698         def ChangeOrientation(self, theShape, theName=None):
4699             """
4700             Reverses an orientation the given shape.
4701
4702             Parameters:
4703                 theShape Shape to be reversed.
4704                 theName Object name; when specified, this parameter is used
4705                         for result publication in the study. Otherwise, if automatic
4706                         publication is switched on, default value is used for result name.
4707
4708             Returns:
4709                 The reversed copy of theShape.
4710             """
4711             # Example: see GEOM_TestAll.py
4712             anObj = self.ShapesOp.ChangeOrientation(theShape)
4713             RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4714             self._autoPublish(anObj, theName, "reversed")
4715             return anObj
4716
4717         ## See ChangeOrientation() method for details.
4718         #
4719         #  @ref swig_OrientationChange "Example"
4720         def OrientationChange(self, theShape, theName=None):
4721             """
4722             See geompy.ChangeOrientation method for details.
4723             """
4724             # Example: see GEOM_TestOthers.py
4725             # note: auto-publishing is done in self.ChangeOrientation()
4726             anObj = self.ChangeOrientation(theShape, theName)
4727             return anObj
4728
4729         # end of l3_healing
4730         ## @}
4731
4732         ## @addtogroup l4_obtain
4733         ## @{
4734
4735         ## Retrieve all free faces from the given shape.
4736         #  Free face is a face, which is not shared between two shells of the shape.
4737         #  @param theShape Shape to find free faces in.
4738         #  @return List of IDs of all free faces, contained in theShape.
4739         #
4740         #  @ref tui_measurement_tools_page "Example"
4741         @ManageTransactions("ShapesOp")
4742         def GetFreeFacesIDs(self,theShape):
4743             """
4744             Retrieve all free faces from the given shape.
4745             Free face is a face, which is not shared between two shells of the shape.
4746
4747             Parameters:
4748                 theShape Shape to find free faces in.
4749
4750             Returns:
4751                 List of IDs of all free faces, contained in theShape.
4752             """
4753             # Example: see GEOM_TestOthers.py
4754             anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4755             RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4756             return anIDs
4757
4758         ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4759         #  @param theShape1 Shape to find sub-shapes in.
4760         #  @param theShape2 Shape to find shared sub-shapes with.
4761         #  @param theShapeType Type of sub-shapes to be retrieved.
4762         #  @param theName Object name; when specified, this parameter is used
4763         #         for result publication in the study. Otherwise, if automatic
4764         #         publication is switched on, default value is used for result name.
4765         #
4766         #  @return List of sub-shapes of theShape1, shared with theShape2.
4767         #
4768         #  @ref swig_GetSharedShapes "Example"
4769         @ManageTransactions("ShapesOp")
4770         def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4771             """
4772             Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4773
4774             Parameters:
4775                 theShape1 Shape to find sub-shapes in.
4776                 theShape2 Shape to find shared sub-shapes with.
4777                 theShapeType Type of sub-shapes to be retrieved.
4778                 theName Object name; when specified, this parameter is used
4779                         for result publication in the study. Otherwise, if automatic
4780                         publication is switched on, default value is used for result name.
4781
4782             Returns:
4783                 List of sub-shapes of theShape1, shared with theShape2.
4784             """
4785             # Example: see GEOM_TestOthers.py
4786             aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4787             RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4788             self._autoPublish(aList, theName, "shared")
4789             return aList
4790
4791         ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4792         #  @param theShapes Shapes to find common sub-shapes of.
4793         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4794         #  @param theName Object name; when specified, this parameter is used
4795         #         for result publication in the study. Otherwise, if automatic
4796         #         publication is switched on, default value is used for result name.
4797         #
4798         #  @return List of objects, that are sub-shapes of all given shapes.
4799         #
4800         #  @ref swig_GetSharedShapes "Example"
4801         @ManageTransactions("ShapesOp")
4802         def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4803             """
4804             Get all sub-shapes, shared by all shapes in the list theShapes.
4805
4806             Parameters:
4807                 theShapes Shapes to find common sub-shapes of.
4808                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4809                 theName Object name; when specified, this parameter is used
4810                         for result publication in the study. Otherwise, if automatic
4811                         publication is switched on, default value is used for result name.
4812
4813             Returns:
4814                 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4815             """
4816             # Example: see GEOM_TestOthers.py
4817             aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4818             RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4819             self._autoPublish(aList, theName, "shared")
4820             return aList
4821
4822         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4823         #  situated relatively the specified plane by the certain way,
4824         #  defined through <VAR>theState</VAR> parameter.
4825         #  @param theShape Shape to find sub-shapes of.
4826         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4827         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4828         #                direction and location of the plane to find shapes on.
4829         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4830         #  @param theName Object name; when specified, this parameter is used
4831         #         for result publication in the study. Otherwise, if automatic
4832         #         publication is switched on, default value is used for result name.
4833         #
4834         #  @return List of all found sub-shapes.
4835         #
4836         #  @ref swig_GetShapesOnPlane "Example"
4837         @ManageTransactions("ShapesOp")
4838         def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4839             """
4840             Find in theShape all sub-shapes of type theShapeType,
4841             situated relatively the specified plane by the certain way,
4842             defined through theState parameter.
4843
4844             Parameters:
4845                 theShape Shape to find sub-shapes of.
4846                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4847                 theAx1 Vector (or line, or linear edge), specifying normal
4848                        direction and location of the plane to find shapes on.
4849                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4850                 theName Object name; when specified, this parameter is used
4851                         for result publication in the study. Otherwise, if automatic
4852                         publication is switched on, default value is used for result name.
4853
4854             Returns:
4855                 List of all found sub-shapes.
4856             """
4857             # Example: see GEOM_TestOthers.py
4858             aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4859             RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4860             self._autoPublish(aList, theName, "shapeOnPlane")
4861             return aList
4862
4863         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4864         #  situated relatively the specified plane by the certain way,
4865         #  defined through <VAR>theState</VAR> parameter.
4866         #  @param theShape Shape to find sub-shapes of.
4867         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4868         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4869         #                direction and location of the plane to find shapes on.
4870         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4871         #
4872         #  @return List of all found sub-shapes indices.
4873         #
4874         #  @ref swig_GetShapesOnPlaneIDs "Example"
4875         @ManageTransactions("ShapesOp")
4876         def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4877             """
4878             Find in theShape all sub-shapes of type theShapeType,
4879             situated relatively the specified plane by the certain way,
4880             defined through theState parameter.
4881
4882             Parameters:
4883                 theShape Shape to find sub-shapes of.
4884                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4885                 theAx1 Vector (or line, or linear edge), specifying normal
4886                        direction and location of the plane to find shapes on.
4887                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4888
4889             Returns:
4890                 List of all found sub-shapes indices.
4891             """
4892             # Example: see GEOM_TestOthers.py
4893             aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4894             RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4895             return aList
4896
4897         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4898         #  situated relatively the specified plane by the certain way,
4899         #  defined through <VAR>theState</VAR> parameter.
4900         #  @param theShape Shape to find sub-shapes of.
4901         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4902         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4903         #                direction of the plane to find shapes on.
4904         #  @param thePnt Point specifying location of the plane to find shapes on.
4905         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4906         #  @param theName Object name; when specified, this parameter is used
4907         #         for result publication in the study. Otherwise, if automatic
4908         #         publication is switched on, default value is used for result name.
4909         #
4910         #  @return List of all found sub-shapes.
4911         #
4912         #  @ref swig_GetShapesOnPlaneWithLocation "Example"
4913         @ManageTransactions("ShapesOp")
4914         def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4915             """
4916             Find in theShape all sub-shapes of type theShapeType,
4917             situated relatively the specified plane by the certain way,
4918             defined through theState parameter.
4919
4920             Parameters:
4921                 theShape Shape to find sub-shapes of.
4922                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4923                 theAx1 Vector (or line, or linear edge), specifying normal
4924                        direction and location of the plane to find shapes on.
4925                 thePnt Point specifying location of the plane to find shapes on.
4926                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4927                 theName Object name; when specified, this parameter is used
4928                         for result publication in the study. Otherwise, if automatic
4929                         publication is switched on, default value is used for result name.
4930
4931             Returns:
4932                 List of all found sub-shapes.
4933             """
4934             # Example: see GEOM_TestOthers.py
4935             aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4936                                                                theAx1, thePnt, theState)
4937             RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4938             self._autoPublish(aList, theName, "shapeOnPlane")
4939             return aList
4940
4941         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4942         #  situated relatively the specified plane by the certain way,
4943         #  defined through <VAR>theState</VAR> parameter.
4944         #  @param theShape Shape to find sub-shapes of.
4945         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4946         #  @param theAx1 Vector (or line, or linear edge), specifying normal
4947         #                direction of the plane to find shapes on.
4948         #  @param thePnt Point specifying location of the plane to find shapes on.
4949         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4950         #
4951         #  @return List of all found sub-shapes indices.
4952         #
4953         #  @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4954         @ManageTransactions("ShapesOp")
4955         def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4956             """
4957             Find in theShape all sub-shapes of type theShapeType,
4958             situated relatively the specified plane by the certain way,
4959             defined through theState parameter.
4960
4961             Parameters:
4962                 theShape Shape to find sub-shapes of.
4963                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4964                 theAx1 Vector (or line, or linear edge), specifying normal
4965                        direction and location of the plane to find shapes on.
4966                 thePnt Point specifying location of the plane to find shapes on.
4967                 theState The state of the sub-shapes to find (see GEOM::shape_state)
4968
4969             Returns:
4970                 List of all found sub-shapes indices.
4971             """
4972             # Example: see GEOM_TestOthers.py
4973             aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4974                                                                   theAx1, thePnt, theState)
4975             RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4976             return aList
4977
4978         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4979         #  the specified cylinder by the certain way, defined through \a theState parameter.
4980         #  @param theShape Shape to find sub-shapes of.
4981         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4982         #  @param theAxis Vector (or line, or linear edge), specifying
4983         #                 axis of the cylinder to find shapes on.
4984         #  @param theRadius Radius of the cylinder to find shapes on.
4985         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4986         #  @param theName Object name; when specified, this parameter is used
4987         #         for result publication in the study. Otherwise, if automatic
4988         #         publication is switched on, default value is used for result name.
4989         #
4990         #  @return List of all found sub-shapes.
4991         #
4992         #  @ref swig_GetShapesOnCylinder "Example"
4993         @ManageTransactions("ShapesOp")
4994         def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4995             """
4996             Find in theShape all sub-shapes of type theShapeType, situated relatively
4997             the specified cylinder by the certain way, defined through theState parameter.
4998
4999             Parameters:
5000                 theShape Shape to find sub-shapes of.
5001                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5002                 theAxis Vector (or line, or linear edge), specifying
5003                         axis of the cylinder to find shapes on.
5004                 theRadius Radius of the cylinder to find shapes on.
5005                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5006                 theName Object name; when specified, this parameter is used
5007                         for result publication in the study. Otherwise, if automatic
5008                         publication is switched on, default value is used for result name.
5009
5010             Returns:
5011                 List of all found sub-shapes.
5012             """
5013             # Example: see GEOM_TestOthers.py
5014             aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5015             RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5016             self._autoPublish(aList, theName, "shapeOnCylinder")
5017             return aList
5018
5019         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5020         #  the specified cylinder by the certain way, defined through \a theState parameter.
5021         #  @param theShape Shape to find sub-shapes of.
5022         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5023         #  @param theAxis Vector (or line, or linear edge), specifying
5024         #                 axis of the cylinder to find shapes on.
5025         #  @param theRadius Radius of the cylinder to find shapes on.
5026         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5027         #
5028         #  @return List of all found sub-shapes indices.
5029         #
5030         #  @ref swig_GetShapesOnCylinderIDs "Example"
5031         @ManageTransactions("ShapesOp")
5032         def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5033             """
5034             Find in theShape all sub-shapes of type theShapeType, situated relatively
5035             the specified cylinder by the certain way, defined through theState parameter.
5036
5037             Parameters:
5038                 theShape Shape to find sub-shapes of.
5039                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5040                 theAxis Vector (or line, or linear edge), specifying
5041                         axis of the cylinder to find shapes on.
5042                 theRadius Radius of the cylinder to find shapes on.
5043                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5044
5045             Returns:
5046                 List of all found sub-shapes indices.
5047             """
5048             # Example: see GEOM_TestOthers.py
5049             aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5050             RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5051             return aList
5052
5053         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5054         #  the specified cylinder by the certain way, defined through \a theState parameter.
5055         #  @param theShape Shape to find sub-shapes of.
5056         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5057         #  @param theAxis Vector (or line, or linear edge), specifying
5058         #                 axis of the cylinder to find shapes on.
5059         #  @param thePnt Point specifying location of the bottom of the cylinder.
5060         #  @param theRadius Radius of the cylinder to find shapes on.
5061         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5062         #  @param theName Object name; when specified, this parameter is used
5063         #         for result publication in the study. Otherwise, if automatic
5064         #         publication is switched on, default value is used for result name.
5065         #
5066         #  @return List of all found sub-shapes.
5067         #
5068         #  @ref swig_GetShapesOnCylinderWithLocation "Example"
5069         @ManageTransactions("ShapesOp")
5070         def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5071             """
5072             Find in theShape all sub-shapes of type theShapeType, situated relatively
5073             the specified cylinder by the certain way, defined through theState parameter.
5074
5075             Parameters:
5076                 theShape Shape to find sub-shapes of.
5077                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5078                 theAxis Vector (or line, or linear edge), specifying
5079                         axis of the cylinder to find shapes on.
5080                 theRadius Radius of the cylinder to find shapes on.
5081                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5082                 theName Object name; when specified, this parameter is used
5083                         for result publication in the study. Otherwise, if automatic
5084                         publication is switched on, default value is used for result name.
5085
5086             Returns:
5087                 List of all found sub-shapes.
5088             """
5089             # Example: see GEOM_TestOthers.py
5090             aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5091             RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5092             self._autoPublish(aList, theName, "shapeOnCylinder")
5093             return aList
5094
5095         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5096         #  the specified cylinder by the certain way, defined through \a theState parameter.
5097         #  @param theShape Shape to find sub-shapes of.
5098         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5099         #  @param theAxis Vector (or line, or linear edge), specifying
5100         #                 axis of the cylinder to find shapes on.
5101         #  @param thePnt Point specifying location of the bottom of the cylinder.
5102         #  @param theRadius Radius of the cylinder to find shapes on.
5103         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5104         #
5105         #  @return List of all found sub-shapes indices
5106         #
5107         #  @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5108         @ManageTransactions("ShapesOp")
5109         def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5110             """
5111             Find in theShape all sub-shapes of type theShapeType, situated relatively
5112             the specified cylinder by the certain way, defined through theState parameter.
5113
5114             Parameters:
5115                 theShape Shape to find sub-shapes of.
5116                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5117                 theAxis Vector (or line, or linear edge), specifying
5118                         axis of the cylinder to find shapes on.
5119                 theRadius Radius of the cylinder to find shapes on.
5120                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5121
5122             Returns:
5123                 List of all found sub-shapes indices.
5124             """
5125             # Example: see GEOM_TestOthers.py
5126             aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5127             RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5128             return aList
5129
5130         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5131         #  the specified sphere by the certain way, defined through \a theState parameter.
5132         #  @param theShape Shape to find sub-shapes of.
5133         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5134         #  @param theCenter Point, specifying center of the sphere to find shapes on.
5135         #  @param theRadius Radius of the sphere to find shapes on.
5136         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5137         #  @param theName Object name; when specified, this parameter is used
5138         #         for result publication in the study. Otherwise, if automatic
5139         #         publication is switched on, default value is used for result name.
5140         #
5141         #  @return List of all found sub-shapes.
5142         #
5143         #  @ref swig_GetShapesOnSphere "Example"
5144         @ManageTransactions("ShapesOp")
5145         def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5146             """
5147             Find in theShape all sub-shapes of type theShapeType, situated relatively
5148             the specified sphere by the certain way, defined through theState parameter.
5149
5150             Parameters:
5151                 theShape Shape to find sub-shapes of.
5152                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5153                 theCenter Point, specifying center of the sphere to find shapes on.
5154                 theRadius Radius of the sphere to find shapes on.
5155                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5156                 theName Object name; when specified, this parameter is used
5157                         for result publication in the study. Otherwise, if automatic
5158                         publication is switched on, default value is used for result name.
5159
5160             Returns:
5161                 List of all found sub-shapes.
5162             """
5163             # Example: see GEOM_TestOthers.py
5164             aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5165             RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5166             self._autoPublish(aList, theName, "shapeOnSphere")
5167             return aList
5168
5169         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5170         #  the specified sphere by the certain way, defined through \a theState parameter.
5171         #  @param theShape Shape to find sub-shapes of.
5172         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5173         #  @param theCenter Point, specifying center of the sphere to find shapes on.
5174         #  @param theRadius Radius of the sphere to find shapes on.
5175         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5176         #
5177         #  @return List of all found sub-shapes indices.
5178         #
5179         #  @ref swig_GetShapesOnSphereIDs "Example"
5180         @ManageTransactions("ShapesOp")
5181         def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5182             """
5183             Find in theShape all sub-shapes of type theShapeType, situated relatively
5184             the specified sphere by the certain way, defined through theState parameter.
5185
5186             Parameters:
5187                 theShape Shape to find sub-shapes of.
5188                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5189                 theCenter Point, specifying center of the sphere to find shapes on.
5190                 theRadius Radius of the sphere to find shapes on.
5191                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5192
5193             Returns:
5194                 List of all found sub-shapes indices.
5195             """
5196             # Example: see GEOM_TestOthers.py
5197             aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5198             RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5199             return aList
5200
5201         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5202         #  the specified quadrangle by the certain way, defined through \a theState parameter.
5203         #  @param theShape Shape to find sub-shapes of.
5204         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5205         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5206         #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5207         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5208         #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5209         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5210         #  @param theName Object name; when specified, this parameter is used
5211         #         for result publication in the study. Otherwise, if automatic
5212         #         publication is switched on, default value is used for result name.
5213         #
5214         #  @return List of all found sub-shapes.
5215         #
5216         #  @ref swig_GetShapesOnQuadrangle "Example"
5217         @ManageTransactions("ShapesOp")
5218         def GetShapesOnQuadrangle(self, theShape, theShapeType,
5219                                   theTopLeftPoint, theTopRigthPoint,
5220                                   theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5221             """
5222             Find in theShape all sub-shapes of type theShapeType, situated relatively
5223             the specified quadrangle by the certain way, defined through theState parameter.
5224
5225             Parameters:
5226                 theShape Shape to find sub-shapes of.
5227                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5228                 theTopLeftPoint Point, specifying top left corner of a quadrangle
5229                 theTopRigthPoint Point, specifying top right corner of a quadrangle
5230                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5231                 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5232                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5233                 theName Object name; when specified, this parameter is used
5234                         for result publication in the study. Otherwise, if automatic
5235                         publication is switched on, default value is used for result name.
5236
5237             Returns:
5238                 List of all found sub-shapes.
5239             """
5240             # Example: see GEOM_TestOthers.py
5241             aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5242                                                         theTopLeftPoint, theTopRigthPoint,
5243                                                         theBottomLeftPoint, theBottomRigthPoint, theState)
5244             RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5245             self._autoPublish(aList, theName, "shapeOnQuadrangle")
5246             return aList
5247
5248         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5249         #  the specified quadrangle by the certain way, defined through \a theState parameter.
5250         #  @param theShape Shape to find sub-shapes of.
5251         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5252         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5253         #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5254         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5255         #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5256         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5257         #
5258         #  @return List of all found sub-shapes indices.
5259         #
5260         #  @ref swig_GetShapesOnQuadrangleIDs "Example"
5261         @ManageTransactions("ShapesOp")
5262         def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5263                                      theTopLeftPoint, theTopRigthPoint,
5264                                      theBottomLeftPoint, theBottomRigthPoint, theState):
5265             """
5266             Find in theShape all sub-shapes of type theShapeType, situated relatively
5267             the specified quadrangle by the certain way, defined through theState parameter.
5268
5269             Parameters:
5270                 theShape Shape to find sub-shapes of.
5271                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5272                 theTopLeftPoint Point, specifying top left corner of a quadrangle
5273                 theTopRigthPoint Point, specifying top right corner of a quadrangle
5274                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5275                 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5276                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5277
5278             Returns:
5279                 List of all found sub-shapes indices.
5280             """
5281
5282             # Example: see GEOM_TestOthers.py
5283             aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5284                                                            theTopLeftPoint, theTopRigthPoint,
5285                                                            theBottomLeftPoint, theBottomRigthPoint, theState)
5286             RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5287             return aList
5288
5289         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5290         #  the specified \a theBox by the certain way, defined through \a theState parameter.
5291         #  @param theBox Shape for relative comparing.
5292         #  @param theShape Shape to find sub-shapes of.
5293         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5294         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5295         #  @param theName Object name; when specified, this parameter is used
5296         #         for result publication in the study. Otherwise, if automatic
5297         #         publication is switched on, default value is used for result name.
5298         #
5299         #  @return List of all found sub-shapes.
5300         #
5301         #  @ref swig_GetShapesOnBox "Example"
5302         @ManageTransactions("ShapesOp")
5303         def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5304             """
5305             Find in theShape all sub-shapes of type theShapeType, situated relatively
5306             the specified theBox by the certain way, defined through theState parameter.
5307
5308             Parameters:
5309                 theBox Shape for relative comparing.
5310                 theShape Shape to find sub-shapes of.
5311                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5312                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5313                 theName Object name; when specified, this parameter is used
5314                         for result publication in the study. Otherwise, if automatic
5315                         publication is switched on, default value is used for result name.
5316
5317             Returns:
5318                 List of all found sub-shapes.
5319             """
5320             # Example: see GEOM_TestOthers.py
5321             aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5322             RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5323             self._autoPublish(aList, theName, "shapeOnBox")
5324             return aList
5325
5326         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5327         #  the specified \a theBox by the certain way, defined through \a theState parameter.
5328         #  @param theBox Shape for relative comparing.
5329         #  @param theShape Shape to find sub-shapes of.
5330         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5331         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5332         #
5333         #  @return List of all found sub-shapes indices.
5334         #
5335         #  @ref swig_GetShapesOnBoxIDs "Example"
5336         @ManageTransactions("ShapesOp")
5337         def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5338             """
5339             Find in theShape all sub-shapes of type theShapeType, situated relatively
5340             the specified theBox by the certain way, defined through theState parameter.
5341
5342             Parameters:
5343                 theBox Shape for relative comparing.
5344                 theShape Shape to find sub-shapes of.
5345                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5346                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5347
5348             Returns:
5349                 List of all found sub-shapes indices.
5350             """
5351             # Example: see GEOM_TestOthers.py
5352             aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5353             RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5354             return aList
5355
5356         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5357         #  situated relatively the specified \a theCheckShape by the
5358         #  certain way, defined through \a theState parameter.
5359         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5360         #  @param theShape Shape to find sub-shapes of.
5361         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5362         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5363         #  @param theName Object name; when specified, this parameter is used
5364         #         for result publication in the study. Otherwise, if automatic
5365         #         publication is switched on, default value is used for result name.
5366         #
5367         #  @return List of all found sub-shapes.
5368         #
5369         #  @ref swig_GetShapesOnShape "Example"
5370         @ManageTransactions("ShapesOp")
5371         def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5372             """
5373             Find in theShape all sub-shapes of type theShapeType,
5374             situated relatively the specified theCheckShape by the
5375             certain way, defined through theState parameter.
5376
5377             Parameters:
5378                 theCheckShape Shape for relative comparing. It must be a solid.
5379                 theShape Shape to find sub-shapes of.
5380                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5381                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5382                 theName Object name; when specified, this parameter is used
5383                         for result publication in the study. Otherwise, if automatic
5384                         publication is switched on, default value is used for result name.
5385
5386             Returns:
5387                 List of all found sub-shapes.
5388             """
5389             # Example: see GEOM_TestOthers.py
5390             aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5391                                                    theShapeType, theState)
5392             RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5393             self._autoPublish(aList, theName, "shapeOnShape")
5394             return aList
5395
5396         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5397         #  situated relatively the specified \a theCheckShape by the
5398         #  certain way, defined through \a theState parameter.
5399         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5400         #  @param theShape Shape to find sub-shapes of.
5401         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5402         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5403         #  @param theName Object name; when specified, this parameter is used
5404         #         for result publication in the study. Otherwise, if automatic
5405         #         publication is switched on, default value is used for result name.
5406         #
5407         #  @return All found sub-shapes as compound.
5408         #
5409         #  @ref swig_GetShapesOnShapeAsCompound "Example"
5410         @ManageTransactions("ShapesOp")
5411         def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5412             """
5413             Find in theShape all sub-shapes of type theShapeType,
5414             situated relatively the specified theCheckShape by the
5415             certain way, defined through theState parameter.
5416
5417             Parameters:
5418                 theCheckShape Shape for relative comparing. It must be a solid.
5419                 theShape Shape to find sub-shapes of.
5420                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5421                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5422                 theName Object name; when specified, this parameter is used
5423                         for result publication in the study. Otherwise, if automatic
5424                         publication is switched on, default value is used for result name.
5425
5426             Returns:
5427                 All found sub-shapes as compound.
5428             """
5429             # Example: see GEOM_TestOthers.py
5430             anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5431                                                              theShapeType, theState)
5432             RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5433             self._autoPublish(anObj, theName, "shapeOnShape")
5434             return anObj
5435
5436         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5437         #  situated relatively the specified \a theCheckShape by the
5438         #  certain way, defined through \a theState parameter.
5439         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5440         #  @param theShape Shape to find sub-shapes of.
5441         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5442         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5443         #
5444         #  @return List of all found sub-shapes indices.
5445         #
5446         #  @ref swig_GetShapesOnShapeIDs "Example"
5447         @ManageTransactions("ShapesOp")
5448         def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5449             """
5450             Find in theShape all sub-shapes of type theShapeType,
5451             situated relatively the specified theCheckShape by the
5452             certain way, defined through theState parameter.
5453
5454             Parameters:
5455                 theCheckShape Shape for relative comparing. It must be a solid.
5456                 theShape Shape to find sub-shapes of.
5457                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5458                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5459
5460             Returns:
5461                 List of all found sub-shapes indices.
5462             """
5463             # Example: see GEOM_TestOthers.py
5464             aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5465                                                       theShapeType, theState)
5466             RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5467             return aList
5468
5469         ## Get sub-shape(s) of theShapeWhere, which are
5470         #  coincident with \a theShapeWhat or could be a part of it.
5471         #  @param theShapeWhere Shape to find sub-shapes of.
5472         #  @param theShapeWhat Shape, specifying what to find.
5473         #  @param isNewImplementation implementation of GetInPlace functionality
5474         #             (default = False, old alghorithm based on shape properties)
5475         #  @param theName Object name; when specified, this parameter is used
5476         #         for result publication in the study. Otherwise, if automatic
5477         #         publication is switched on, default value is used for result name.
5478         #
5479         #  @return Group of all found sub-shapes or a single found sub-shape.
5480         #
5481         #  @note This function has a restriction on argument shapes.
5482         #        If \a theShapeWhere has curved parts with significantly
5483         #        outstanding centres (i.e. the mass centre of a part is closer to
5484         #        \a theShapeWhat than to the part), such parts will not be found.
5485         #        @image html get_in_place_lost_part.png
5486         #
5487         #  @ref swig_GetInPlace "Example"
5488         @ManageTransactions("ShapesOp")
5489         def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5490             """
5491             Get sub-shape(s) of theShapeWhere, which are
5492             coincident with  theShapeWhat or could be a part of it.
5493
5494             Parameters:
5495                 theShapeWhere Shape to find sub-shapes of.
5496                 theShapeWhat Shape, specifying what to find.
5497                 isNewImplementation Implementation of GetInPlace functionality
5498                                     (default = False, old alghorithm based on shape properties)
5499                 theName Object name; when specified, this parameter is used
5500                         for result publication in the study. Otherwise, if automatic
5501                         publication is switched on, default value is used for result name.
5502
5503             Returns:
5504                 Group of all found sub-shapes or a single found sub-shape.
5505
5506
5507             Note:
5508                 This function has a restriction on argument shapes.
5509                 If theShapeWhere has curved parts with significantly
5510                 outstanding centres (i.e. the mass centre of a part is closer to
5511                 theShapeWhat than to the part), such parts will not be found.
5512             """
5513             # Example: see GEOM_TestOthers.py
5514             anObj = None
5515             if isNewImplementation:
5516                 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5517             else:
5518                 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5519                 pass
5520             RaiseIfFailed("GetInPlace", self.ShapesOp)
5521             self._autoPublish(anObj, theName, "inplace")
5522             return anObj
5523
5524         ## Get sub-shape(s) of \a theShapeWhere, which are
5525         #  coincident with \a theShapeWhat or could be a part of it.
5526         #
5527         #  Implementation of this method is based on a saved history of an operation,
5528         #  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5529         #  arguments (an argument shape or a sub-shape of an argument shape).
5530         #  The operation could be the Partition or one of boolean operations,
5531         #  performed on simple shapes (not on compounds).
5532         #
5533         #  @param theShapeWhere Shape to find sub-shapes of.
5534         #  @param theShapeWhat Shape, specifying what to find (must be in the
5535         #                      building history of the ShapeWhere).
5536         #  @param theName Object name; when specified, this parameter is used
5537         #         for result publication in the study. Otherwise, if automatic
5538         #         publication is switched on, default value is used for result name.
5539         #
5540         #  @return Group of all found sub-shapes or a single found sub-shape.
5541         #
5542         #  @ref swig_GetInPlace "Example"
5543         @ManageTransactions("ShapesOp")
5544         def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5545             """
5546             Implementation of this method is based on a saved history of an operation,
5547             produced theShapeWhere. The theShapeWhat must be among this operation's
5548             arguments (an argument shape or a sub-shape of an argument shape).
5549             The operation could be the Partition or one of boolean operations,
5550             performed on simple shapes (not on compounds).
5551
5552             Parameters:
5553                 theShapeWhere Shape to find sub-shapes of.
5554                 theShapeWhat Shape, specifying what to find (must be in the
5555                                 building history of the ShapeWhere).
5556                 theName Object name; when specified, this parameter is used
5557                         for result publication in the study. Otherwise, if automatic
5558                         publication is switched on, default value is used for result name.
5559
5560             Returns:
5561                 Group of all found sub-shapes or a single found sub-shape.
5562             """
5563             # Example: see GEOM_TestOthers.py
5564             anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5565             RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5566             self._autoPublish(anObj, theName, "inplace")
5567             return anObj
5568
5569         ## Get sub-shape of theShapeWhere, which is
5570         #  equal to \a theShapeWhat.
5571         #  @param theShapeWhere Shape to find sub-shape of.
5572         #  @param theShapeWhat Shape, specifying what to find.
5573         #  @param theName Object name; when specified, this parameter is used
5574         #         for result publication in the study. Otherwise, if automatic
5575         #         publication is switched on, default value is used for result name.
5576         #
5577         #  @return New GEOM.GEOM_Object for found sub-shape.
5578         #
5579         #  @ref swig_GetSame "Example"
5580         @ManageTransactions("ShapesOp")
5581         def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5582             """
5583             Get sub-shape of theShapeWhere, which is
5584             equal to theShapeWhat.
5585
5586             Parameters:
5587                 theShapeWhere Shape to find sub-shape of.
5588                 theShapeWhat Shape, specifying what to find.
5589                 theName Object name; when specified, this parameter is used
5590                         for result publication in the study. Otherwise, if automatic
5591                         publication is switched on, default value is used for result name.
5592
5593             Returns:
5594                 New GEOM.GEOM_Object for found sub-shape.
5595             """
5596             anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5597             RaiseIfFailed("GetSame", self.ShapesOp)
5598             self._autoPublish(anObj, theName, "sameShape")
5599             return anObj
5600
5601
5602         ## Get sub-shape indices of theShapeWhere, which is
5603         #  equal to \a theShapeWhat.
5604         #  @param theShapeWhere Shape to find sub-shape of.
5605         #  @param theShapeWhat Shape, specifying what to find.
5606         #  @return List of all found sub-shapes indices.
5607         #
5608         #  @ref swig_GetSame "Example"
5609         @ManageTransactions("ShapesOp")
5610         def GetSameIDs(self, theShapeWhere, theShapeWhat):
5611             """
5612             Get sub-shape indices of theShapeWhere, which is
5613             equal to theShapeWhat.
5614
5615             Parameters:
5616                 theShapeWhere Shape to find sub-shape of.
5617                 theShapeWhat Shape, specifying what to find.
5618
5619             Returns:
5620                 List of all found sub-shapes indices.
5621             """
5622             anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5623             RaiseIfFailed("GetSameIDs", self.ShapesOp)
5624             return anObj
5625
5626
5627         # end of l4_obtain
5628         ## @}
5629
5630         ## @addtogroup l4_access
5631         ## @{
5632
5633         ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5634         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5635         #  @param aShape Shape to get sub-shape of.
5636         #  @param ListOfID List of sub-shapes indices.
5637         #  @param theName Object name; when specified, this parameter is used
5638         #         for result publication in the study. Otherwise, if automatic
5639         #         publication is switched on, default value is used for result name.
5640         #
5641         #  @return Found sub-shape.
5642         #
5643         #  @ref swig_all_decompose "Example"
5644         def GetSubShape(self, aShape, ListOfID, theName=None):
5645             """
5646             Obtain a composite sub-shape of aShape, composed from sub-shapes
5647             of aShape, selected by their unique IDs inside aShape
5648
5649             Parameters:
5650                 aShape Shape to get sub-shape of.
5651                 ListOfID List of sub-shapes indices.
5652                 theName Object name; when specified, this parameter is used
5653                         for result publication in the study. Otherwise, if automatic
5654                         publication is switched on, default value is used for result name.
5655
5656             Returns:
5657                 Found sub-shape.
5658             """
5659             # Example: see GEOM_TestAll.py
5660             anObj = self.AddSubShape(aShape,ListOfID)
5661             self._autoPublish(anObj, theName, "subshape")
5662             return anObj
5663
5664         ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5665         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5666         #  @param aShape Shape to get sub-shape of.
5667         #  @param aSubShape Sub-shapes of aShape.
5668         #  @return ID of found sub-shape.
5669         #
5670         #  @ref swig_all_decompose "Example"
5671         @ManageTransactions("LocalOp")
5672         def GetSubShapeID(self, aShape, aSubShape):
5673             """
5674             Obtain unique ID of sub-shape aSubShape inside aShape
5675             of aShape, selected by their unique IDs inside aShape
5676
5677             Parameters:
5678                aShape Shape to get sub-shape of.
5679                aSubShape Sub-shapes of aShape.
5680
5681             Returns:
5682                ID of found sub-shape.
5683             """
5684             # Example: see GEOM_TestAll.py
5685             anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5686             RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5687             return anID
5688
5689         ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5690         #  This function is provided for performance purpose. The complexity is O(n) with n
5691         #  the number of subobjects of aShape
5692         #  @param aShape Shape to get sub-shape of.
5693         #  @param aSubShapes Sub-shapes of aShape.
5694         #  @return list of IDs of found sub-shapes.
5695         #
5696         #  @ref swig_all_decompose "Example"
5697         @ManageTransactions("ShapesOp")
5698         def GetSubShapesIDs(self, aShape, aSubShapes):
5699             """
5700             Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5701             This function is provided for performance purpose. The complexity is O(n) with n
5702             the number of subobjects of aShape
5703
5704             Parameters:
5705                aShape Shape to get sub-shape of.
5706                aSubShapes Sub-shapes of aShape.
5707
5708             Returns:
5709                List of IDs of found sub-shape.
5710             """
5711             # Example: see GEOM_TestAll.py
5712             anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5713             RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5714             return anIDs
5715
5716         # end of l4_access
5717         ## @}
5718
5719         ## @addtogroup l4_decompose
5720         ## @{
5721
5722         ## Get all sub-shapes and groups of \a theShape,
5723         #  that were created already by any other methods.
5724         #  @param theShape Any shape.
5725         #  @param theGroupsOnly If this parameter is TRUE, only groups will be
5726         #                       returned, else all found sub-shapes and groups.
5727         #  @return List of existing sub-objects of \a theShape.
5728         #
5729         #  @ref swig_all_decompose "Example"
5730         @ManageTransactions("ShapesOp")
5731         def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5732             """
5733             Get all sub-shapes and groups of theShape,
5734             that were created already by any other methods.
5735
5736             Parameters:
5737                 theShape Any shape.
5738                 theGroupsOnly If this parameter is TRUE, only groups will be
5739                                  returned, else all found sub-shapes and groups.
5740
5741             Returns:
5742                 List of existing sub-objects of theShape.
5743             """
5744             # Example: see GEOM_TestAll.py
5745             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5746             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5747             return ListObj
5748
5749         ## Get all groups of \a theShape,
5750         #  that were created already by any other methods.
5751         #  @param theShape Any shape.
5752         #  @return List of existing groups of \a theShape.
5753         #
5754         #  @ref swig_all_decompose "Example"
5755         @ManageTransactions("ShapesOp")
5756         def GetGroups(self, theShape):
5757             """
5758             Get all groups of theShape,
5759             that were created already by any other methods.
5760
5761             Parameters:
5762                 theShape Any shape.
5763
5764             Returns:
5765                 List of existing groups of theShape.
5766             """
5767             # Example: see GEOM_TestAll.py
5768             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5769             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5770             return ListObj
5771
5772         ## Explode a shape on sub-shapes of a given type.
5773         #  If the shape itself matches the type, it is also returned.
5774         #  @param aShape Shape to be exploded.
5775         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5776         #  @param theName Object name; when specified, this parameter is used
5777         #         for result publication in the study. Otherwise, if automatic
5778         #         publication is switched on, default value is used for result name.
5779         #
5780         #  @return List of sub-shapes of type theShapeType, contained in theShape.
5781         #
5782         #  @ref swig_all_decompose "Example"
5783         @ManageTransactions("ShapesOp")
5784         def SubShapeAll(self, aShape, aType, theName=None):
5785             """
5786             Explode a shape on sub-shapes of a given type.
5787             If the shape itself matches the type, it is also returned.
5788
5789             Parameters:
5790                 aShape Shape to be exploded.
5791                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5792                 theName Object name; when specified, this parameter is used
5793                         for result publication in the study. Otherwise, if automatic
5794                         publication is switched on, default value is used for result name.
5795
5796             Returns:
5797                 List of sub-shapes of type theShapeType, contained in theShape.
5798             """
5799             # Example: see GEOM_TestAll.py
5800             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5801             RaiseIfFailed("SubShapeAll", self.ShapesOp)
5802             self._autoPublish(ListObj, theName, "subshape")
5803             return ListObj
5804
5805         ## Explode a shape on sub-shapes of a given type.
5806         #  @param aShape Shape to be exploded.
5807         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5808         #  @return List of IDs of sub-shapes.
5809         #
5810         #  @ref swig_all_decompose "Example"
5811         @ManageTransactions("ShapesOp")
5812         def SubShapeAllIDs(self, aShape, aType):
5813             """
5814             Explode a shape on sub-shapes of a given type.
5815
5816             Parameters:
5817                 aShape Shape to be exploded (see geompy.ShapeType)
5818                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5819
5820             Returns:
5821                 List of IDs of sub-shapes.
5822             """
5823             ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5824             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5825             return ListObj
5826
5827         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5828         #  selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5829         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5830         #  @param aShape Shape to get sub-shape of.
5831         #  @param ListOfInd List of sub-shapes indices.
5832         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5833         #  @param theName Object name; when specified, this parameter is used
5834         #         for result publication in the study. Otherwise, if automatic
5835         #         publication is switched on, default value is used for result name.
5836         #
5837         #  @return A compound of sub-shapes of aShape.
5838         #
5839         #  @ref swig_all_decompose "Example"
5840         def SubShape(self, aShape, aType, ListOfInd, theName=None):
5841             """
5842             Obtain a compound of sub-shapes of aShape,
5843             selected by their indices in list of all sub-shapes of type aType.
5844             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5845
5846             Parameters:
5847                 aShape Shape to get sub-shape of.
5848                 ListOfID List of sub-shapes indices.
5849                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5850                 theName Object name; when specified, this parameter is used
5851                         for result publication in the study. Otherwise, if automatic
5852                         publication is switched on, default value is used for result name.
5853
5854             Returns:
5855                 A compound of sub-shapes of aShape.
5856             """
5857             # Example: see GEOM_TestAll.py
5858             ListOfIDs = []
5859             AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5860             for ind in ListOfInd:
5861                 ListOfIDs.append(AllShapeIDsList[ind - 1])
5862             # note: auto-publishing is done in self.GetSubShape()
5863             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5864             return anObj
5865
5866         ## Explode a shape on sub-shapes of a given type.
5867         #  Sub-shapes will be sorted taking into account their gravity centers,
5868         #  to provide stable order of sub-shapes.
5869         #  If the shape itself matches the type, it is also returned.
5870         #  @param aShape Shape to be exploded.
5871         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5872         #  @param theName Object name; when specified, this parameter is used
5873         #         for result publication in the study. Otherwise, if automatic
5874         #         publication is switched on, default value is used for result name.
5875         #
5876         #  @return List of sub-shapes of type theShapeType, contained in theShape.
5877         #
5878         #  @ref swig_SubShapeAllSorted "Example"
5879         @ManageTransactions("ShapesOp")
5880         def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5881             """
5882             Explode a shape on sub-shapes of a given type.
5883             Sub-shapes will be sorted taking into account their gravity centers,
5884             to provide stable order of sub-shapes.
5885             If the shape itself matches the type, it is also returned.
5886
5887             Parameters:
5888                 aShape Shape to be exploded.
5889                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5890                 theName Object name; when specified, this parameter is used
5891                         for result publication in the study. Otherwise, if automatic
5892                         publication is switched on, default value is used for result name.
5893
5894             Returns:
5895                 List of sub-shapes of type theShapeType, contained in theShape.
5896             """
5897             # Example: see GEOM_TestAll.py
5898             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5899             RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5900             self._autoPublish(ListObj, theName, "subshape")
5901             return ListObj
5902
5903         ## Explode a shape on sub-shapes of a given type.
5904         #  Sub-shapes will be sorted taking into account their gravity centers,
5905         #  to provide stable order of sub-shapes.
5906         #  @param aShape Shape to be exploded.
5907         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5908         #  @return List of IDs of sub-shapes.
5909         #
5910         #  @ref swig_all_decompose "Example"
5911         @ManageTransactions("ShapesOp")
5912         def SubShapeAllSortedCentresIDs(self, aShape, aType):
5913             """
5914             Explode a shape on sub-shapes of a given type.
5915             Sub-shapes will be sorted taking into account their gravity centers,
5916             to provide stable order of sub-shapes.
5917
5918             Parameters:
5919                 aShape Shape to be exploded.
5920                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5921
5922             Returns:
5923                 List of IDs of sub-shapes.
5924             """
5925             ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5926             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5927             return ListIDs
5928
5929         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5930         #  selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5931         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5932         #  @param aShape Shape to get sub-shape of.
5933         #  @param ListOfInd List of sub-shapes indices.
5934         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
5935         #  @param theName Object name; when specified, this parameter is used
5936         #         for result publication in the study. Otherwise, if automatic
5937         #         publication is switched on, default value is used for result name.
5938         #
5939         #  @return A compound of sub-shapes of aShape.
5940         #
5941         #  @ref swig_all_decompose "Example"
5942         def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5943             """
5944             Obtain a compound of sub-shapes of aShape,
5945             selected by they indices in sorted list of all sub-shapes of type aType.
5946             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5947
5948             Parameters:
5949                 aShape Shape to get sub-shape of.
5950                 ListOfID List of sub-shapes indices.
5951                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5952                 theName Object name; when specified, this parameter is used
5953                         for result publication in the study. Otherwise, if automatic
5954                         publication is switched on, default value is used for result name.
5955
5956             Returns:
5957                 A compound of sub-shapes of aShape.
5958             """
5959             # Example: see GEOM_TestAll.py
5960             ListOfIDs = []
5961             AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5962             for ind in ListOfInd:
5963                 ListOfIDs.append(AllShapeIDsList[ind - 1])
5964             # note: auto-publishing is done in self.GetSubShape()
5965             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5966             return anObj
5967
5968         ## Extract shapes (excluding the main shape) of given type.
5969         #  @param aShape The shape.
5970         #  @param aType  The shape type (see ShapeType())
5971         #  @param isSorted Boolean flag to switch sorting on/off.
5972         #  @param theName Object name; when specified, this parameter is used
5973         #         for result publication in the study. Otherwise, if automatic
5974         #         publication is switched on, default value is used for result name.
5975         #
5976         #  @return List of sub-shapes of type aType, contained in aShape.
5977         #
5978         #  @ref swig_FilletChamfer "Example"
5979         @ManageTransactions("ShapesOp")
5980         def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5981             """
5982             Extract shapes (excluding the main shape) of given type.
5983
5984             Parameters:
5985                 aShape The shape.
5986                 aType  The shape type (see geompy.ShapeType)
5987                 isSorted Boolean flag to switch sorting on/off.
5988                 theName Object name; when specified, this parameter is used
5989                         for result publication in the study. Otherwise, if automatic
5990                         publication is switched on, default value is used for result name.
5991
5992             Returns:
5993                 List of sub-shapes of type aType, contained in aShape.
5994             """
5995             # Example: see GEOM_TestAll.py
5996             ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5997             RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5998             self._autoPublish(ListObj, theName, "subshape")
5999             return ListObj
6000
6001         ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6002         #  @param aShape Main shape.
6003         #  @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6004         #  @param theName Object name; when specified, this parameter is used
6005         #         for result publication in the study. Otherwise, if automatic
6006         #         publication is switched on, default value is used for result name.
6007         #  @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6008         #
6009         #  @ref swig_all_decompose "Example"
6010         @ManageTransactions("ShapesOp")
6011         def SubShapes(self, aShape, anIDs, theName=None):
6012             """
6013             Get a set of sub-shapes defined by their unique IDs inside theMainShape
6014
6015             Parameters:
6016                 aShape Main shape.
6017                 anIDs List of unique IDs of sub-shapes inside theMainShape.
6018                 theName Object name; when specified, this parameter is used
6019                         for result publication in the study. Otherwise, if automatic
6020                         publication is switched on, default value is used for result name.
6021
6022             Returns:
6023                 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6024             """
6025             # Example: see GEOM_TestAll.py
6026             ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6027             RaiseIfFailed("SubShapes", self.ShapesOp)
6028             self._autoPublish(ListObj, theName, "subshape")
6029             return ListObj
6030
6031         # end of l4_decompose
6032         ## @}
6033
6034         ## @addtogroup l4_decompose_d
6035         ## @{
6036
6037         ## Deprecated method
6038         #  It works like SubShapeAllSortedCentres(), but wrongly
6039         #  defines centres of faces, shells and solids.
6040         @ManageTransactions("ShapesOp")
6041         def SubShapeAllSorted(self, aShape, aType, theName=None):
6042             """
6043             Deprecated method
6044             It works like geompy.SubShapeAllSortedCentres, but wrongly
6045             defines centres of faces, shells and solids.
6046             """
6047             ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6048             RaiseIfFailed("MakeExplode", self.ShapesOp)
6049             self._autoPublish(ListObj, theName, "subshape")
6050             return ListObj
6051
6052         ## Deprecated method
6053         #  It works like SubShapeAllSortedCentresIDs(), but wrongly
6054         #  defines centres of faces, shells and solids.
6055         @ManageTransactions("ShapesOp")
6056         def SubShapeAllSortedIDs(self, aShape, aType):
6057             """
6058             Deprecated method
6059             It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6060             defines centres of faces, shells and solids.
6061             """
6062             ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6063             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6064             return ListIDs
6065
6066         ## Deprecated method
6067         #  It works like SubShapeSortedCentres(), but has a bug
6068         #  (wrongly defines centres of faces, shells and solids).
6069         def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6070             """
6071             Deprecated method
6072             It works like geompy.SubShapeSortedCentres, but has a bug
6073             (wrongly defines centres of faces, shells and solids).
6074             """
6075             ListOfIDs = []
6076             AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6077             for ind in ListOfInd:
6078                 ListOfIDs.append(AllShapeIDsList[ind - 1])
6079             # note: auto-publishing is done in self.GetSubShape()
6080             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6081             return anObj
6082
6083         # end of l4_decompose_d
6084         ## @}
6085
6086         ## @addtogroup l3_healing
6087         ## @{
6088
6089         ## Apply a sequence of Shape Healing operators to the given object.
6090         #  @param theShape Shape to be processed.
6091         #  @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6092         #  @param theParameters List of names of parameters
6093         #                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6094         #  @param theValues List of values of parameters, in the same order
6095         #                    as parameters are listed in <VAR>theParameters</VAR> list.
6096         #  @param theName Object name; when specified, this parameter is used
6097         #         for result publication in the study. Otherwise, if automatic
6098         #         publication is switched on, default value is used for result name.
6099         #
6100         #  <b> Operators and Parameters: </b> \n
6101         #
6102         #  * \b FixShape - corrects invalid shapes. \n
6103         #  - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6104         #  - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6105         #
6106         #  * \b FixFaceSize - removes small faces, such as spots and strips.\n
6107         #  - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6108         #  - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6109         #  - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6110         #
6111         #  * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6112         #    surfaces in segments using a certain angle. \n
6113         #  - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6114         #    if Angle=180, four if Angle=90, etc). \n
6115         #  - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6116         #
6117         #  * \b SplitClosedFaces - splits closed faces in segments.
6118         #    The number of segments depends on the number of splitting points.\n
6119         #  - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6120         #
6121         #  * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6122         #  - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6123         #  - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6124         #  - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6125         #   This and the previous parameters can take the following values:\n
6126         #   \b Parametric \b Continuity \n
6127         #   \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6128         #   are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6129         #   \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6130         #    ruling out sharp edges).\n
6131         #   \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6132         #       are of the same magnitude).\n
6133         #   \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6134         #    or surfaces (d/du C(u)) are the same at junction. \n
6135         #   \b Geometric \b Continuity \n
6136         #   \b G1: first derivatives are proportional at junction.\n
6137         #   The curve tangents thus have the same direction, but not necessarily the same magnitude.
6138         #      i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6139         #   \b G2: first and second derivatives are proportional at junction.
6140         #   As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6141         #    continuity requires that the underlying parameterization was continuous as well.
6142         #   Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6143         #
6144         #  * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6145         #  - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6146         #  - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6147         #  - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6148         #  - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6149         #       with the specified parameters.\n
6150         #  - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6151         #       with the specified parameters.\n
6152         #  - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6153         #  - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6154         #  - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6155         #  - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6156         #
6157         #  * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6158         #  - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6159         #  - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6160         #  - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6161         #  - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6162         #
6163         #  * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6164         #  - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6165         #
6166         #
6167         #  @return New GEOM.GEOM_Object, containing processed shape.
6168         #
6169         #  \n @ref tui_shape_processing "Example"
6170         @ManageTransactions("HealOp")
6171         def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6172             """
6173             Apply a sequence of Shape Healing operators to the given object.
6174
6175             Parameters:
6176                 theShape Shape to be processed.
6177                 theValues List of values of parameters, in the same order
6178                           as parameters are listed in theParameters list.
6179                 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6180                 theParameters List of names of parameters
6181                               ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6182                 theName Object name; when specified, this parameter is used
6183                         for result publication in the study. Otherwise, if automatic
6184                         publication is switched on, default value is used for result name.
6185
6186                 Operators and Parameters:
6187
6188                  * FixShape - corrects invalid shapes.
6189                      * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6190                      * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6191                  * FixFaceSize - removes small faces, such as spots and strips.
6192                      * FixFaceSize.Tolerance - defines minimum possible face size.
6193                      * DropSmallEdges - removes edges, which merge with neighbouring edges.
6194                      * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6195                  * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6196                                 in segments using a certain angle.
6197                      * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6198                                           if Angle=180, four if Angle=90, etc).
6199                      * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6200                  * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6201                                       splitting points.
6202                      * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6203                  * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6204                      * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6205                      * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6206                      * SplitContinuity.CurveContinuity - required continuity for curves.
6207                        This and the previous parameters can take the following values:
6208
6209                        Parametric Continuity:
6210                        C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6211                                                    coincidental. The curves or surfaces may still meet at an angle,
6212                                                    giving rise to a sharp corner or edge).
6213                        C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6214                                                    are parallel, ruling out sharp edges).
6215                        C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6216                                                   or surfaces are of the same magnitude).
6217                        CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6218                           curves or surfaces (d/du C(u)) are the same at junction.
6219
6220                        Geometric Continuity:
6221                        G1: first derivatives are proportional at junction.
6222                            The curve tangents thus have the same direction, but not necessarily the same magnitude.
6223                            i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6224                        G2: first and second derivatives are proportional at junction. As the names imply,
6225                            geometric continuity requires the geometry to be continuous, while parametric continuity requires
6226                            that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6227                            geometric continuity of order n, but not vice-versa.
6228                  * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6229                      * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6230                      * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6231                      * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6232                      * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6233                                                         the specified parameters.
6234                      * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6235                                                         the specified parameters.
6236                      * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6237                      * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6238                      * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6239                      * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6240                  * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6241                      * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6242                      * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6243                      * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6244                      * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6245                  * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6246                      * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6247
6248             Returns:
6249                 New GEOM.GEOM_Object, containing processed shape.
6250
6251             Note: For more information look through SALOME Geometry User's Guide->
6252                   -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6253             """
6254             # Example: see GEOM_TestHealing.py
6255             theValues,Parameters = ParseList(theValues)
6256             anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6257             # To avoid script failure in case of good argument shape
6258             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6259                 return theShape
6260             RaiseIfFailed("ProcessShape", self.HealOp)
6261             for string in (theOperators + theParameters):
6262                 Parameters = ":" + Parameters
6263                 pass
6264             anObj.SetParameters(Parameters)
6265             self._autoPublish(anObj, theName, "healed")
6266             return anObj
6267
6268         ## Remove faces from the given object (shape).
6269         #  @param theObject Shape to be processed.
6270         #  @param theFaces Indices of faces to be removed, if EMPTY then the method
6271         #                  removes ALL faces of the given object.
6272         #  @param theName Object name; when specified, this parameter is used
6273         #         for result publication in the study. Otherwise, if automatic
6274         #         publication is switched on, default value is used for result name.
6275         #
6276         #  @return New GEOM.GEOM_Object, containing processed shape.
6277         #
6278         #  @ref tui_suppress_faces "Example"
6279         @ManageTransactions("HealOp")
6280         def SuppressFaces(self, theObject, theFaces, theName=None):
6281             """
6282             Remove faces from the given object (shape).
6283
6284             Parameters:
6285                 theObject Shape to be processed.
6286                 theFaces Indices of faces to be removed, if EMPTY then the method
6287                          removes ALL faces of the given object.
6288                 theName Object name; when specified, this parameter is used
6289                         for result publication in the study. Otherwise, if automatic
6290                         publication is switched on, default value is used for result name.
6291
6292             Returns:
6293                 New GEOM.GEOM_Object, containing processed shape.
6294             """
6295             # Example: see GEOM_TestHealing.py
6296             anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6297             RaiseIfFailed("SuppressFaces", self.HealOp)
6298             self._autoPublish(anObj, theName, "suppressFaces")
6299             return anObj
6300
6301         ## Sewing of some shapes into single shape.
6302         #  @param ListShape Shapes to be processed.
6303         #  @param theTolerance Required tolerance value.
6304         #  @param AllowNonManifold Flag that allows non-manifold sewing.
6305         #  @param theName Object name; when specified, this parameter is used
6306         #         for result publication in the study. Otherwise, if automatic
6307         #         publication is switched on, default value is used for result name.
6308         #
6309         #  @return New GEOM.GEOM_Object, containing processed shape.
6310         #
6311         #  @ref tui_sewing "Example"
6312         def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6313             """
6314             Sewing of some shapes into single shape.
6315
6316             Parameters:
6317                 ListShape Shapes to be processed.
6318                 theTolerance Required tolerance value.
6319                 AllowNonManifold Flag that allows non-manifold sewing.
6320                 theName Object name; when specified, this parameter is used
6321                         for result publication in the study. Otherwise, if automatic
6322                         publication is switched on, default value is used for result name.
6323
6324             Returns:
6325                 New GEOM.GEOM_Object, containing processed shape.
6326             """
6327             # Example: see GEOM_TestHealing.py
6328             comp = self.MakeCompound(ListShape)
6329             # note: auto-publishing is done in self.Sew()
6330             anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6331             return anObj
6332
6333         ## Sewing of the given object.
6334         #  @param theObject Shape to be processed.
6335         #  @param theTolerance Required tolerance value.
6336         #  @param AllowNonManifold Flag that allows non-manifold sewing.
6337         #  @param theName Object name; when specified, this parameter is used
6338         #         for result publication in the study. Otherwise, if automatic
6339         #         publication is switched on, default value is used for result name.
6340         #
6341         #  @return New GEOM.GEOM_Object, containing processed shape.
6342         @ManageTransactions("HealOp")
6343         def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6344             """
6345             Sewing of the given object.
6346
6347             Parameters:
6348                 theObject Shape to be processed.
6349                 theTolerance Required tolerance value.
6350                 AllowNonManifold Flag that allows non-manifold sewing.
6351                 theName Object name; when specified, this parameter is used
6352                         for result publication in the study. Otherwise, if automatic
6353                         publication is switched on, default value is used for result name.
6354
6355             Returns:
6356                 New GEOM.GEOM_Object, containing processed shape.
6357             """
6358             # Example: see MakeSewing() above
6359             theTolerance,Parameters = ParseParameters(theTolerance)
6360             if AllowNonManifold:
6361                 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6362             else:
6363                 anObj = self.HealOp.Sew(theObject, theTolerance)
6364             # To avoid script failure in case of good argument shape
6365             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6366                 return theObject
6367             RaiseIfFailed("Sew", self.HealOp)
6368             anObj.SetParameters(Parameters)
6369             self._autoPublish(anObj, theName, "sewed")
6370             return anObj
6371
6372         ## Rebuild the topology of theCompound of solids by removing
6373         #  of the faces that are shared by several solids.
6374         #  @param theCompound Shape to be processed.
6375         #  @param theName Object name; when specified, this parameter is used
6376         #         for result publication in the study. Otherwise, if automatic
6377         #         publication is switched on, default value is used for result name.
6378         #
6379         #  @return New GEOM.GEOM_Object, containing processed shape.
6380         #
6381         #  @ref tui_remove_webs "Example"
6382         @ManageTransactions("HealOp")
6383         def RemoveInternalFaces (self, theCompound, theName=None):
6384             """
6385             Rebuild the topology of theCompound of solids by removing
6386             of the faces that are shared by several solids.
6387
6388             Parameters:
6389                 theCompound Shape to be processed.
6390                 theName Object name; when specified, this parameter is used
6391                         for result publication in the study. Otherwise, if automatic
6392                         publication is switched on, default value is used for result name.
6393
6394             Returns:
6395                 New GEOM.GEOM_Object, containing processed shape.
6396             """
6397             # Example: see GEOM_TestHealing.py
6398             anObj = self.HealOp.RemoveInternalFaces(theCompound)
6399             RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6400             self._autoPublish(anObj, theName, "removeWebs")
6401             return anObj
6402
6403         ## Remove internal wires and edges from the given object (face).
6404         #  @param theObject Shape to be processed.
6405         #  @param theWires Indices of wires to be removed, if EMPTY then the method
6406         #                  removes ALL internal wires of the given object.
6407         #  @param theName Object name; when specified, this parameter is used
6408         #         for result publication in the study. Otherwise, if automatic
6409         #         publication is switched on, default value is used for result name.
6410         #
6411         #  @return New GEOM.GEOM_Object, containing processed shape.
6412         #
6413         #  @ref tui_suppress_internal_wires "Example"
6414         @ManageTransactions("HealOp")
6415         def SuppressInternalWires(self, theObject, theWires, theName=None):
6416             """
6417             Remove internal wires and edges from the given object (face).
6418
6419             Parameters:
6420                 theObject Shape to be processed.
6421                 theWires Indices of wires to be removed, if EMPTY then the method
6422                          removes ALL internal wires of the given object.
6423                 theName Object name; when specified, this parameter is used
6424                         for result publication in the study. Otherwise, if automatic
6425                         publication is switched on, default value is used for result name.
6426
6427             Returns:
6428                 New GEOM.GEOM_Object, containing processed shape.
6429             """
6430             # Example: see GEOM_TestHealing.py
6431             anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6432             RaiseIfFailed("RemoveIntWires", self.HealOp)
6433             self._autoPublish(anObj, theName, "suppressWires")
6434             return anObj
6435
6436         ## Remove internal closed contours (holes) from the given object.
6437         #  @param theObject Shape to be processed.
6438         #  @param theWires Indices of wires to be removed, if EMPTY then the method
6439         #                  removes ALL internal holes of the given object
6440         #  @param theName Object name; when specified, this parameter is used
6441         #         for result publication in the study. Otherwise, if automatic
6442         #         publication is switched on, default value is used for result name.
6443         #
6444         #  @return New GEOM.GEOM_Object, containing processed shape.
6445         #
6446         #  @ref tui_suppress_holes "Example"
6447         @ManageTransactions("HealOp")
6448         def SuppressHoles(self, theObject, theWires, theName=None):
6449             """
6450             Remove internal closed contours (holes) from the given object.
6451
6452             Parameters:
6453                 theObject Shape to be processed.
6454                 theWires Indices of wires to be removed, if EMPTY then the method
6455                          removes ALL internal holes of the given object
6456                 theName Object name; when specified, this parameter is used
6457                         for result publication in the study. Otherwise, if automatic
6458                         publication is switched on, default value is used for result name.
6459
6460             Returns:
6461                 New GEOM.GEOM_Object, containing processed shape.
6462             """
6463             # Example: see GEOM_TestHealing.py
6464             anObj = self.HealOp.FillHoles(theObject, theWires)
6465             RaiseIfFailed("FillHoles", self.HealOp)
6466             self._autoPublish(anObj, theName, "suppressHoles")
6467             return anObj
6468
6469         ## Close an open wire.
6470         #  @param theObject Shape to be processed.
6471         #  @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6472         #                  if [ ], then <VAR>theObject</VAR> itself is a wire.
6473         #  @param isCommonVertex If True  : closure by creation of a common vertex,
6474         #                        If False : closure by creation of an edge between ends.
6475         #  @param theName Object name; when specified, this parameter is used
6476         #         for result publication in the study. Otherwise, if automatic
6477         #         publication is switched on, default value is used for result name.
6478         #
6479         #  @return New GEOM.GEOM_Object, containing processed shape.
6480         #
6481         #  @ref tui_close_contour "Example"
6482         @ManageTransactions("HealOp")
6483         def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6484             """
6485             Close an open wire.
6486
6487             Parameters:
6488                 theObject Shape to be processed.
6489                 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6490                          if [ ], then theObject itself is a wire.
6491                 isCommonVertex If True  : closure by creation of a common vertex,
6492                                If False : closure by creation of an edge between ends.
6493                 theName Object name; when specified, this parameter is used
6494                         for result publication in the study. Otherwise, if automatic
6495                         publication is switched on, default value is used for result name.
6496
6497             Returns:
6498                 New GEOM.GEOM_Object, containing processed shape.
6499             """
6500             # Example: see GEOM_TestHealing.py
6501             anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6502             RaiseIfFailed("CloseContour", self.HealOp)
6503             self._autoPublish(anObj, theName, "closeContour")
6504             return anObj
6505
6506         ## Addition of a point to a given edge object.
6507         #  @param theObject Shape to be processed.
6508         #  @param theEdgeIndex Index of edge to be divided within theObject's shape,
6509         #                      if -1, then theObject itself is the edge.
6510         #  @param theValue Value of parameter on edge or length parameter,
6511         #                  depending on \a isByParameter.
6512         #  @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6513         #                       if FALSE : \a theValue is treated as a length parameter [0..1]
6514         #  @param theName Object name; when specified, this parameter is used
6515         #         for result publication in the study. Otherwise, if automatic
6516         #         publication is switched on, default value is used for result name.
6517         #
6518         #  @return New GEOM.GEOM_Object, containing processed shape.
6519         #
6520         #  @ref tui_add_point_on_edge "Example"
6521         @ManageTransactions("HealOp")
6522         def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6523             """
6524             Addition of a point to a given edge object.
6525
6526             Parameters:
6527                 theObject Shape to be processed.
6528                 theEdgeIndex Index of edge to be divided within theObject's shape,
6529                              if -1, then theObject itself is the edge.
6530                 theValue Value of parameter on edge or length parameter,
6531                          depending on isByParameter.
6532                 isByParameter If TRUE :  theValue is treated as a curve parameter [0..1],
6533                               if FALSE : theValue is treated as a length parameter [0..1]
6534                 theName Object name; when specified, this parameter is used
6535                         for result publication in the study. Otherwise, if automatic
6536                         publication is switched on, default value is used for result name.
6537
6538             Returns:
6539                 New GEOM.GEOM_Object, containing processed shape.
6540             """
6541             # Example: see GEOM_TestHealing.py
6542             theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6543             anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6544             RaiseIfFailed("DivideEdge", self.HealOp)
6545             anObj.SetParameters(Parameters)
6546             self._autoPublish(anObj, theName, "divideEdge")
6547             return anObj
6548
6549         ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6550         #  @param theWire Wire to minimize the number of C1 continuous edges in.
6551         #  @param theVertices A list of vertices to suppress. If the list
6552         #                     is empty, all vertices in a wire will be assumed.
6553         #  @param theName Object name; when specified, this parameter is used
6554         #         for result publication in the study. Otherwise, if automatic
6555         #         publication is switched on, default value is used for result name.
6556         #
6557         #  @return New GEOM.GEOM_Object with modified wire.
6558         #
6559         #  @ref tui_fuse_collinear_edges "Example"
6560         @ManageTransactions("HealOp")
6561         def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6562             """
6563             Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6564
6565             Parameters:
6566                 theWire Wire to minimize the number of C1 continuous edges in.
6567                 theVertices A list of vertices to suppress. If the list
6568                             is empty, all vertices in a wire will be assumed.
6569                 theName Object name; when specified, this parameter is used
6570                         for result publication in the study. Otherwise, if automatic
6571                         publication is switched on, default value is used for result name.
6572
6573             Returns:
6574                 New GEOM.GEOM_Object with modified wire.
6575             """
6576             anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6577             RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6578             self._autoPublish(anObj, theName, "fuseEdges")
6579             return anObj
6580
6581         ## Change orientation of the given object. Updates given shape.
6582         #  @param theObject Shape to be processed.
6583         #  @return Updated <var>theObject</var>
6584         #
6585         #  @ref swig_todo "Example"
6586         @ManageTransactions("HealOp")
6587         def ChangeOrientationShell(self,theObject):
6588             """
6589             Change orientation of the given object. Updates given shape.
6590
6591             Parameters:
6592                 theObject Shape to be processed.
6593
6594             Returns:
6595                 Updated theObject
6596             """
6597             theObject = self.HealOp.ChangeOrientation(theObject)
6598             RaiseIfFailed("ChangeOrientation", self.HealOp)
6599             pass
6600
6601         ## Change orientation of the given object.
6602         #  @param theObject Shape to be processed.
6603         #  @param theName Object name; when specified, this parameter is used
6604         #         for result publication in the study. Otherwise, if automatic
6605         #         publication is switched on, default value is used for result name.
6606         #
6607         #  @return New GEOM.GEOM_Object, containing processed shape.
6608         #
6609         #  @ref swig_todo "Example"
6610         @ManageTransactions("HealOp")
6611         def ChangeOrientationShellCopy(self, theObject, theName=None):
6612             """
6613             Change orientation of the given object.
6614
6615             Parameters:
6616                 theObject Shape to be processed.
6617                 theName Object name; when specified, this parameter is used
6618                         for result publication in the study. Otherwise, if automatic
6619                         publication is switched on, default value is used for result name.
6620
6621             Returns:
6622                 New GEOM.GEOM_Object, containing processed shape.
6623             """
6624             anObj = self.HealOp.ChangeOrientationCopy(theObject)
6625             RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6626             self._autoPublish(anObj, theName, "reversed")
6627             return anObj
6628
6629         ## Try to limit tolerance of the given object by value \a theTolerance.
6630         #  @param theObject Shape to be processed.
6631         #  @param theTolerance Required tolerance value.
6632         #  @param theName Object name; when specified, this parameter is used
6633         #         for result publication in the study. Otherwise, if automatic
6634         #         publication is switched on, default value is used for result name.
6635         #
6636         #  @return New GEOM.GEOM_Object, containing processed shape.
6637         #
6638         #  @ref tui_limit_tolerance "Example"
6639         @ManageTransactions("HealOp")
6640         def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6641             """
6642             Try to limit tolerance of the given object by value theTolerance.
6643
6644             Parameters:
6645                 theObject Shape to be processed.
6646                 theTolerance Required tolerance value.
6647                 theName Object name; when specified, this parameter is used
6648                         for result publication in the study. Otherwise, if automatic
6649                         publication is switched on, default value is used for result name.
6650
6651             Returns:
6652                 New GEOM.GEOM_Object, containing processed shape.
6653             """
6654             anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6655             RaiseIfFailed("LimitTolerance", self.HealOp)
6656             self._autoPublish(anObj, theName, "limitTolerance")
6657             return anObj
6658
6659         ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6660         #  that constitute a free boundary of the given shape.
6661         #  @param theObject Shape to get free boundary of.
6662         #  @param theName Object name; when specified, this parameter is used
6663         #         for result publication in the study. Otherwise, if automatic
6664         #         publication is switched on, default value is used for result name.
6665         #
6666         #  @return [\a status, \a theClosedWires, \a theOpenWires]
6667         #  \n \a status: FALSE, if an error(s) occured during the method execution.
6668         #  \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6669         #  \n \a theOpenWires: Open wires on the free boundary of the given shape.
6670         #
6671         #  @ref tui_measurement_tools_page "Example"
6672         @ManageTransactions("HealOp")
6673         def GetFreeBoundary(self, theObject, theName=None):
6674             """
6675             Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6676             that constitute a free boundary of the given shape.
6677
6678             Parameters:
6679                 theObject Shape to get free boundary of.
6680                 theName Object name; when specified, this parameter is used
6681                         for result publication in the study. Otherwise, if automatic
6682                         publication is switched on, default value is used for result name.
6683
6684             Returns:
6685                 [status, theClosedWires, theOpenWires]
6686                  status: FALSE, if an error(s) occured during the method execution.
6687                  theClosedWires: Closed wires on the free boundary of the given shape.
6688                  theOpenWires: Open wires on the free boundary of the given shape.
6689             """
6690             # Example: see GEOM_TestHealing.py
6691             anObj = self.HealOp.GetFreeBoundary(theObject)
6692             RaiseIfFailed("GetFreeBoundary", self.HealOp)
6693             self._autoPublish(anObj[1], theName, "closedWire")
6694             self._autoPublish(anObj[2], theName, "openWire")
6695             return anObj
6696
6697         ## Replace coincident faces in theShape by one face.
6698         #  @param theShape Initial shape.
6699         #  @param theTolerance Maximum distance between faces, which can be considered as coincident.
6700         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
6701         #                         otherwise all initial shapes.
6702         #  @param theName Object name; when specified, this parameter is used
6703         #         for result publication in the study. Otherwise, if automatic
6704         #         publication is switched on, default value is used for result name.
6705         #
6706         #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6707         #
6708         #  @ref tui_glue_faces "Example"
6709         @ManageTransactions("ShapesOp")
6710         def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6711             """
6712             Replace coincident faces in theShape by one face.
6713
6714             Parameters:
6715                 theShape Initial shape.
6716                 theTolerance Maximum distance between faces, which can be considered as coincident.
6717                 doKeepNonSolids If FALSE, only solids will present in the result,
6718                                 otherwise all initial shapes.
6719                 theName Object name; when specified, this parameter is used
6720                         for result publication in the study. Otherwise, if automatic
6721                         publication is switched on, default value is used for result name.
6722
6723             Returns:
6724                 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6725             """
6726             # Example: see GEOM_Spanner.py
6727             theTolerance,Parameters = ParseParameters(theTolerance)
6728             anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6729             if anObj is None:
6730                 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6731             anObj.SetParameters(Parameters)
6732             self._autoPublish(anObj, theName, "glueFaces")
6733             return anObj
6734
6735         ## Find coincident faces in theShape for possible gluing.
6736         #  @param theShape Initial shape.
6737         #  @param theTolerance Maximum distance between faces,
6738         #                      which can be considered as coincident.
6739         #  @param theName Object name; when specified, this parameter is used
6740         #         for result publication in the study. Otherwise, if automatic
6741         #         publication is switched on, default value is used for result name.
6742         #
6743         #  @return GEOM.ListOfGO
6744         #
6745         #  @ref tui_glue_faces "Example"
6746         @ManageTransactions("ShapesOp")
6747         def GetGlueFaces(self, theShape, theTolerance, theName=None):
6748             """
6749             Find coincident faces in theShape for possible gluing.
6750
6751             Parameters:
6752                 theShape Initial shape.
6753                 theTolerance Maximum distance between faces,
6754                              which can be considered as coincident.
6755                 theName Object name; when specified, this parameter is used
6756                         for result publication in the study. Otherwise, if automatic
6757                         publication is switched on, default value is used for result name.
6758
6759             Returns:
6760                 GEOM.ListOfGO
6761             """
6762             anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6763             RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6764             self._autoPublish(anObj, theName, "facesToGlue")
6765             return anObj
6766
6767         ## Replace coincident faces in theShape by one face
6768         #  in compliance with given list of faces
6769         #  @param theShape Initial shape.
6770         #  @param theTolerance Maximum distance between faces,
6771         #                      which can be considered as coincident.
6772         #  @param theFaces List of faces for gluing.
6773         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
6774         #                         otherwise all initial shapes.
6775         #  @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6776         #                        will be glued, otherwise only the edges,
6777         #                        belonging to <VAR>theFaces</VAR>.
6778         #  @param theName Object name; when specified, this parameter is used
6779         #         for result publication in the study. Otherwise, if automatic
6780         #         publication is switched on, default value is used for result name.
6781         #
6782         #  @return New GEOM.GEOM_Object, containing a copy of theShape
6783         #          without some faces.
6784         #
6785         #  @ref tui_glue_faces "Example"
6786         @ManageTransactions("ShapesOp")
6787         def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6788                                 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6789             """
6790             Replace coincident faces in theShape by one face
6791             in compliance with given list of faces
6792
6793             Parameters:
6794                 theShape Initial shape.
6795                 theTolerance Maximum distance between faces,
6796                              which can be considered as coincident.
6797                 theFaces List of faces for gluing.
6798                 doKeepNonSolids If FALSE, only solids will present in the result,
6799                                 otherwise all initial shapes.
6800                 doGlueAllEdges If TRUE, all coincident edges of theShape
6801                                will be glued, otherwise only the edges,
6802                                belonging to theFaces.
6803                 theName Object name; when specified, this parameter is used
6804                         for result publication in the study. Otherwise, if automatic
6805                         publication is switched on, default value is used for result name.
6806
6807             Returns:
6808                 New GEOM.GEOM_Object, containing a copy of theShape
6809                     without some faces.
6810             """
6811             anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6812                                                       doKeepNonSolids, doGlueAllEdges)
6813             if anObj is None:
6814                 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6815             self._autoPublish(anObj, theName, "glueFaces")
6816             return anObj
6817
6818         ## Replace coincident edges in theShape by one edge.
6819         #  @param theShape Initial shape.
6820         #  @param theTolerance Maximum distance between edges, which can be considered as coincident.
6821         #  @param theName Object name; when specified, this parameter is used
6822         #         for result publication in the study. Otherwise, if automatic
6823         #         publication is switched on, default value is used for result name.
6824         #
6825         #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6826         #
6827         #  @ref tui_glue_edges "Example"
6828         @ManageTransactions("ShapesOp")
6829         def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6830             """
6831             Replace coincident edges in theShape by one edge.
6832
6833             Parameters:
6834                 theShape Initial shape.
6835                 theTolerance Maximum distance between edges, which can be considered as coincident.
6836                 theName Object name; when specified, this parameter is used
6837                         for result publication in the study. Otherwise, if automatic
6838                         publication is switched on, default value is used for result name.
6839
6840             Returns:
6841                 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6842             """
6843             theTolerance,Parameters = ParseParameters(theTolerance)
6844             anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6845             if anObj is None:
6846                 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6847             anObj.SetParameters(Parameters)
6848             self._autoPublish(anObj, theName, "glueEdges")
6849             return anObj
6850
6851         ## Find coincident edges in theShape for possible gluing.
6852         #  @param theShape Initial shape.
6853         #  @param theTolerance Maximum distance between edges,
6854         #                      which can be considered as coincident.
6855         #  @param theName Object name; when specified, this parameter is used
6856         #         for result publication in the study. Otherwise, if automatic
6857         #         publication is switched on, default value is used for result name.
6858         #
6859         #  @return GEOM.ListOfGO
6860         #
6861         #  @ref tui_glue_edges "Example"
6862         @ManageTransactions("ShapesOp")
6863         def GetGlueEdges(self, theShape, theTolerance, theName=None):
6864             """
6865             Find coincident edges in theShape for possible gluing.
6866
6867             Parameters:
6868                 theShape Initial shape.
6869                 theTolerance Maximum distance between edges,
6870                              which can be considered as coincident.
6871                 theName Object name; when specified, this parameter is used
6872                         for result publication in the study. Otherwise, if automatic
6873                         publication is switched on, default value is used for result name.
6874
6875             Returns:
6876                 GEOM.ListOfGO
6877             """
6878             anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6879             RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6880             self._autoPublish(anObj, theName, "edgesToGlue")
6881             return anObj
6882
6883         ## Replace coincident edges in theShape by one edge
6884         #  in compliance with given list of edges.
6885         #  @param theShape Initial shape.
6886         #  @param theTolerance Maximum distance between edges,
6887         #                      which can be considered as coincident.
6888         #  @param theEdges List of edges for gluing.
6889         #  @param theName Object name; when specified, this parameter is used
6890         #         for result publication in the study. Otherwise, if automatic
6891         #         publication is switched on, default value is used for result name.
6892         #
6893         #  @return New GEOM.GEOM_Object, containing a copy of theShape
6894         #          without some edges.
6895         #
6896         #  @ref tui_glue_edges "Example"
6897         @ManageTransactions("ShapesOp")
6898         def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6899             """
6900             Replace coincident edges in theShape by one edge
6901             in compliance with given list of edges.
6902
6903             Parameters:
6904                 theShape Initial shape.
6905                 theTolerance Maximum distance between edges,
6906                              which can be considered as coincident.
6907                 theEdges List of edges for gluing.
6908                 theName Object name; when specified, this parameter is used
6909                         for result publication in the study. Otherwise, if automatic
6910                         publication is switched on, default value is used for result name.
6911
6912             Returns:
6913                 New GEOM.GEOM_Object, containing a copy of theShape
6914                 without some edges.
6915             """
6916             anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6917             if anObj is None:
6918                 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6919             self._autoPublish(anObj, theName, "glueEdges")
6920             return anObj
6921
6922         # end of l3_healing
6923         ## @}
6924
6925         ## @addtogroup l3_boolean Boolean Operations
6926         ## @{
6927
6928         # -----------------------------------------------------------------------------
6929         # Boolean (Common, Cut, Fuse, Section)
6930         # -----------------------------------------------------------------------------
6931
6932         ## Perform one of boolean operations on two given shapes.
6933         #  @param theShape1 First argument for boolean operation.
6934         #  @param theShape2 Second argument for boolean operation.
6935         #  @param theOperation Indicates the operation to be done:\n
6936         #                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6937         #  @param checkSelfInte The flag that tells if the arguments should
6938         #         be checked for self-intersection prior to the operation.
6939         #  @param theName Object name; when specified, this parameter is used
6940         #         for result publication in the study. Otherwise, if automatic
6941         #         publication is switched on, default value is used for result name.
6942         #
6943         #  @note This algorithm doesn't find all types of self-intersections.
6944         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6945         #        vertex/face and edge/face intersections. Face/face
6946         #        intersections detection is switched off as it is a
6947         #        time-consuming operation that gives an impact on performance.
6948         #        To find all self-intersections please use
6949         #        CheckSelfIntersections() method.
6950         #
6951         #  @return New GEOM.GEOM_Object, containing the result shape.
6952         #
6953         #  @ref tui_fuse "Example"
6954         @ManageTransactions("BoolOp")
6955         def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6956             """
6957             Perform one of boolean operations on two given shapes.
6958
6959             Parameters:
6960                 theShape1 First argument for boolean operation.
6961                 theShape2 Second argument for boolean operation.
6962                 theOperation Indicates the operation to be done:
6963                              1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6964                 checkSelfInte The flag that tells if the arguments should
6965                               be checked for self-intersection prior to
6966                               the operation.
6967                 theName Object name; when specified, this parameter is used
6968                         for result publication in the study. Otherwise, if automatic
6969                         publication is switched on, default value is used for result name.
6970
6971             Note:
6972                     This algorithm doesn't find all types of self-intersections.
6973                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6974                     vertex/face and edge/face intersections. Face/face
6975                     intersections detection is switched off as it is a
6976                     time-consuming operation that gives an impact on performance.
6977                     To find all self-intersections please use
6978                     CheckSelfIntersections() method.
6979
6980             Returns:
6981                 New GEOM.GEOM_Object, containing the result shape.
6982             """
6983             # Example: see GEOM_TestAll.py
6984             anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6985             RaiseIfFailed("MakeBoolean", self.BoolOp)
6986             def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6987             self._autoPublish(anObj, theName, def_names[theOperation])
6988             return anObj
6989
6990         ## Perform Common boolean operation on two given shapes.
6991         #  @param theShape1 First argument for boolean operation.
6992         #  @param theShape2 Second argument for boolean operation.
6993         #  @param checkSelfInte The flag that tells if the arguments should
6994         #         be checked for self-intersection prior to the operation.
6995         #  @param theName Object name; when specified, this parameter is used
6996         #         for result publication in the study. Otherwise, if automatic
6997         #         publication is switched on, default value is used for result name.
6998         #
6999         #  @note This algorithm doesn't find all types of self-intersections.
7000         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7001         #        vertex/face and edge/face intersections. Face/face
7002         #        intersections detection is switched off as it is a
7003         #        time-consuming operation that gives an impact on performance.
7004         #        To find all self-intersections please use
7005         #        CheckSelfIntersections() method.
7006         #
7007         #  @return New GEOM.GEOM_Object, containing the result shape.
7008         #
7009         #  @ref tui_common "Example 1"
7010         #  \n @ref swig_MakeCommon "Example 2"
7011         def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7012             """
7013             Perform Common boolean operation on two given shapes.
7014
7015             Parameters:
7016                 theShape1 First argument for boolean operation.
7017                 theShape2 Second argument for boolean operation.
7018                 checkSelfInte The flag that tells if the arguments should
7019                               be checked for self-intersection prior to
7020                               the operation.
7021                 theName Object name; when specified, this parameter is used
7022                         for result publication in the study. Otherwise, if automatic
7023                         publication is switched on, default value is used for result name.
7024
7025             Note:
7026                     This algorithm doesn't find all types of self-intersections.
7027                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7028                     vertex/face and edge/face intersections. Face/face
7029                     intersections detection is switched off as it is a
7030                     time-consuming operation that gives an impact on performance.
7031                     To find all self-intersections please use
7032                     CheckSelfIntersections() method.
7033
7034             Returns:
7035                 New GEOM.GEOM_Object, containing the result shape.
7036             """
7037             # Example: see GEOM_TestOthers.py
7038             # note: auto-publishing is done in self.MakeBoolean()
7039             return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7040
7041         ## Perform Cut boolean operation on two given shapes.
7042         #  @param theShape1 First argument for boolean operation.
7043         #  @param theShape2 Second argument for boolean operation.
7044         #  @param checkSelfInte The flag that tells if the arguments should
7045         #         be checked for self-intersection prior to the operation.
7046         #  @param theName Object name; when specified, this parameter is used
7047         #         for result publication in the study. Otherwise, if automatic
7048         #         publication is switched on, default value is used for result name.
7049         #
7050         #  @note This algorithm doesn't find all types of self-intersections.
7051         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7052         #        vertex/face and edge/face intersections. Face/face
7053         #        intersections detection is switched off as it is a
7054         #        time-consuming operation that gives an impact on performance.
7055         #        To find all self-intersections please use
7056         #        CheckSelfIntersections() method.
7057         #
7058         #  @return New GEOM.GEOM_Object, containing the result shape.
7059         #
7060         #  @ref tui_cut "Example 1"
7061         #  \n @ref swig_MakeCommon "Example 2"
7062         def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7063             """
7064             Perform Cut boolean operation on two given shapes.
7065
7066             Parameters:
7067                 theShape1 First argument for boolean operation.
7068                 theShape2 Second argument for boolean operation.
7069                 checkSelfInte The flag that tells if the arguments should
7070                               be checked for self-intersection prior to
7071                               the operation.
7072                 theName Object name; when specified, this parameter is used
7073                         for result publication in the study. Otherwise, if automatic
7074                         publication is switched on, default value is used for result name.
7075
7076             Note:
7077                     This algorithm doesn't find all types of self-intersections.
7078                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7079                     vertex/face and edge/face intersections. Face/face
7080                     intersections detection is switched off as it is a
7081                     time-consuming operation that gives an impact on performance.
7082                     To find all self-intersections please use
7083                     CheckSelfIntersections() method.
7084
7085             Returns:
7086                 New GEOM.GEOM_Object, containing the result shape.
7087
7088             """
7089             # Example: see GEOM_TestOthers.py
7090             # note: auto-publishing is done in self.MakeBoolean()
7091             return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7092
7093         ## Perform Fuse boolean operation on two given shapes.
7094         #  @param theShape1 First argument for boolean operation.
7095         #  @param theShape2 Second argument for boolean operation.
7096         #  @param checkSelfInte The flag that tells if the arguments should
7097         #         be checked for self-intersection prior to the operation.
7098         #  @param rmExtraEdges The flag that tells if Remove Extra Edges
7099         #         operation should be performed during the operation.
7100         #  @param theName Object name; when specified, this parameter is used
7101         #         for result publication in the study. Otherwise, if automatic
7102         #         publication is switched on, default value is used for result name.
7103         #
7104         #  @note This algorithm doesn't find all types of self-intersections.
7105         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7106         #        vertex/face and edge/face intersections. Face/face
7107         #        intersections detection is switched off as it is a
7108         #        time-consuming operation that gives an impact on performance.
7109         #        To find all self-intersections please use
7110         #        CheckSelfIntersections() method.
7111         #
7112         #  @return New GEOM.GEOM_Object, containing the result shape.
7113         #
7114         #  @ref tui_fuse "Example 1"
7115         #  \n @ref swig_MakeCommon "Example 2"
7116         @ManageTransactions("BoolOp")
7117         def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7118                      rmExtraEdges=False, theName=None):
7119             """
7120             Perform Fuse boolean operation on two given shapes.
7121
7122             Parameters:
7123                 theShape1 First argument for boolean operation.
7124                 theShape2 Second argument for boolean operation.
7125                 checkSelfInte The flag that tells if the arguments should
7126                               be checked for self-intersection prior to
7127                               the operation.
7128                 rmExtraEdges The flag that tells if Remove Extra Edges
7129                              operation should be performed during the operation.
7130                 theName Object name; when specified, this parameter is used
7131                         for result publication in the study. Otherwise, if automatic
7132                         publication is switched on, default value is used for result name.
7133
7134             Note:
7135                     This algorithm doesn't find all types of self-intersections.
7136                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7137                     vertex/face and edge/face intersections. Face/face
7138                     intersections detection is switched off as it is a
7139                     time-consuming operation that gives an impact on performance.
7140                     To find all self-intersections please use
7141                     CheckSelfIntersections() method.
7142
7143             Returns:
7144                 New GEOM.GEOM_Object, containing the result shape.
7145
7146             """
7147             # Example: see GEOM_TestOthers.py
7148             anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7149                                          checkSelfInte, rmExtraEdges)
7150             RaiseIfFailed("MakeFuse", self.BoolOp)
7151             self._autoPublish(anObj, theName, "fuse")
7152             return anObj
7153
7154         ## Perform Section boolean operation on two given shapes.
7155         #  @param theShape1 First argument for boolean operation.
7156         #  @param theShape2 Second argument for boolean operation.
7157         #  @param checkSelfInte The flag that tells if the arguments should
7158         #         be checked for self-intersection prior to the operation.
7159         #  @param theName Object name; when specified, this parameter is used
7160         #         for result publication in the study. Otherwise, if automatic
7161         #         publication is switched on, default value is used for result name.
7162         #
7163         #  @note This algorithm doesn't find all types of self-intersections.
7164         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7165         #        vertex/face and edge/face intersections. Face/face
7166         #        intersections detection is switched off as it is a
7167         #        time-consuming operation that gives an impact on performance.
7168         #        To find all self-intersections please use
7169         #        CheckSelfIntersections() method.
7170         #
7171         #  @return New GEOM.GEOM_Object, containing the result shape.
7172         #
7173         #  @ref tui_section "Example 1"
7174         #  \n @ref swig_MakeCommon "Example 2"
7175         def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7176             """
7177             Perform Section boolean operation on two given shapes.
7178
7179             Parameters:
7180                 theShape1 First argument for boolean operation.
7181                 theShape2 Second argument for boolean operation.
7182                 checkSelfInte The flag that tells if the arguments should
7183                               be checked for self-intersection prior to
7184                               the operation.
7185                 theName Object name; when specified, this parameter is used
7186                         for result publication in the study. Otherwise, if automatic
7187                         publication is switched on, default value is used for result name.
7188
7189             Note:
7190                     This algorithm doesn't find all types of self-intersections.
7191                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7192                     vertex/face and edge/face intersections. Face/face
7193                     intersections detection is switched off as it is a
7194                     time-consuming operation that gives an impact on performance.
7195                     To find all self-intersections please use
7196                     CheckSelfIntersections() method.
7197
7198             Returns:
7199                 New GEOM.GEOM_Object, containing the result shape.
7200
7201             """
7202             # Example: see GEOM_TestOthers.py
7203             # note: auto-publishing is done in self.MakeBoolean()
7204             return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7205
7206         ## Perform Fuse boolean operation on the list of shapes.
7207         #  @param theShapesList Shapes to be fused.
7208         #  @param checkSelfInte The flag that tells if the arguments should
7209         #         be checked for self-intersection prior to the operation.
7210         #  @param rmExtraEdges The flag that tells if Remove Extra Edges
7211         #         operation should be performed during the operation.
7212         #  @param theName Object name; when specified, this parameter is used
7213         #         for result publication in the study. Otherwise, if automatic
7214         #         publication is switched on, default value is used for result name.
7215         #
7216         #  @note This algorithm doesn't find all types of self-intersections.
7217         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7218         #        vertex/face and edge/face intersections. Face/face
7219         #        intersections detection is switched off as it is a
7220         #        time-consuming operation that gives an impact on performance.
7221         #        To find all self-intersections please use
7222         #        CheckSelfIntersections() method.
7223         #
7224         #  @return New GEOM.GEOM_Object, containing the result shape.
7225         #
7226         #  @ref tui_fuse "Example 1"
7227         #  \n @ref swig_MakeCommon "Example 2"
7228         @ManageTransactions("BoolOp")
7229         def MakeFuseList(self, theShapesList, checkSelfInte=False,
7230                          rmExtraEdges=False, theName=None):
7231             """
7232             Perform Fuse boolean operation on the list of shapes.
7233
7234             Parameters:
7235                 theShapesList Shapes to be fused.
7236                 checkSelfInte The flag that tells if the arguments should
7237                               be checked for self-intersection prior to
7238                               the operation.
7239                 rmExtraEdges The flag that tells if Remove Extra Edges
7240                              operation should be performed during the operation.
7241                 theName Object name; when specified, this parameter is used
7242                         for result publication in the study. Otherwise, if automatic
7243                         publication is switched on, default value is used for result name.
7244
7245             Note:
7246                     This algorithm doesn't find all types of self-intersections.
7247                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7248                     vertex/face and edge/face intersections. Face/face
7249                     intersections detection is switched off as it is a
7250                     time-consuming operation that gives an impact on performance.
7251                     To find all self-intersections please use
7252                     CheckSelfIntersections() method.
7253
7254             Returns:
7255                 New GEOM.GEOM_Object, containing the result shape.
7256
7257             """
7258             # Example: see GEOM_TestOthers.py
7259             anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7260                                              rmExtraEdges)
7261             RaiseIfFailed("MakeFuseList", self.BoolOp)
7262             self._autoPublish(anObj, theName, "fuse")
7263             return anObj
7264
7265         ## Perform Common boolean operation on the list of shapes.
7266         #  @param theShapesList Shapes for Common operation.
7267         #  @param checkSelfInte The flag that tells if the arguments should
7268         #         be checked for self-intersection prior to the operation.
7269         #  @param theName Object name; when specified, this parameter is used
7270         #         for result publication in the study. Otherwise, if automatic
7271         #         publication is switched on, default value is used for result name.
7272         #
7273         #  @note This algorithm doesn't find all types of self-intersections.
7274         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7275         #        vertex/face and edge/face intersections. Face/face
7276         #        intersections detection is switched off as it is a
7277         #        time-consuming operation that gives an impact on performance.
7278         #        To find all self-intersections please use
7279         #        CheckSelfIntersections() method.
7280         #
7281         #  @return New GEOM.GEOM_Object, containing the result shape.
7282         #
7283         #  @ref tui_common "Example 1"
7284         #  \n @ref swig_MakeCommon "Example 2"
7285         @ManageTransactions("BoolOp")
7286         def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7287             """
7288             Perform Common boolean operation on the list of shapes.
7289
7290             Parameters:
7291                 theShapesList Shapes for Common operation.
7292                 checkSelfInte The flag that tells if the arguments should
7293                               be checked for self-intersection prior to
7294                               the operation.
7295                 theName Object name; when specified, this parameter is used
7296                         for result publication in the study. Otherwise, if automatic
7297                         publication is switched on, default value is used for result name.
7298
7299             Note:
7300                     This algorithm doesn't find all types of self-intersections.
7301                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7302                     vertex/face and edge/face intersections. Face/face
7303                     intersections detection is switched off as it is a
7304                     time-consuming operation that gives an impact on performance.
7305                     To find all self-intersections please use
7306                     CheckSelfIntersections() method.
7307
7308             Returns:
7309                 New GEOM.GEOM_Object, containing the result shape.
7310
7311             """
7312             # Example: see GEOM_TestOthers.py
7313             anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7314             RaiseIfFailed("MakeCommonList", self.BoolOp)
7315             self._autoPublish(anObj, theName, "common")
7316             return anObj
7317
7318         ## Perform Cut boolean operation on one object and the list of tools.
7319         #  @param theMainShape The object of the operation.
7320         #  @param theShapesList The list of tools of the operation.
7321         #  @param checkSelfInte The flag that tells if the arguments should
7322         #         be checked for self-intersection prior to the operation.
7323         #  @param theName Object name; when specified, this parameter is used
7324         #         for result publication in the study. Otherwise, if automatic
7325         #         publication is switched on, default value is used for result name.
7326         #
7327         #  @note This algorithm doesn't find all types of self-intersections.
7328         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7329         #        vertex/face and edge/face intersections. Face/face
7330         #        intersections detection is switched off as it is a
7331         #        time-consuming operation that gives an impact on performance.
7332         #        To find all self-intersections please use
7333         #        CheckSelfIntersections() method.
7334         #
7335         #  @return New GEOM.GEOM_Object, containing the result shape.
7336         #
7337         #  @ref tui_cut "Example 1"
7338         #  \n @ref swig_MakeCommon "Example 2"
7339         @ManageTransactions("BoolOp")
7340         def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7341             """
7342             Perform Cut boolean operation on one object and the list of tools.
7343
7344             Parameters:
7345                 theMainShape The object of the operation.
7346                 theShapesList The list of tools of the operation.
7347                 checkSelfInte The flag that tells if the arguments should
7348                               be checked for self-intersection prior to
7349                               the operation.
7350                 theName Object name; when specified, this parameter is used
7351                         for result publication in the study. Otherwise, if automatic
7352                         publication is switched on, default value is used for result name.
7353
7354             Note:
7355                     This algorithm doesn't find all types of self-intersections.
7356                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7357                     vertex/face and edge/face intersections. Face/face
7358                     intersections detection is switched off as it is a
7359                     time-consuming operation that gives an impact on performance.
7360                     To find all self-intersections please use
7361                     CheckSelfIntersections() method.
7362
7363             Returns:
7364                 New GEOM.GEOM_Object, containing the result shape.
7365
7366             """
7367             # Example: see GEOM_TestOthers.py
7368             anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7369             RaiseIfFailed("MakeCutList", self.BoolOp)
7370             self._autoPublish(anObj, theName, "cut")
7371             return anObj
7372
7373         # end of l3_boolean
7374         ## @}
7375
7376         ## @addtogroup l3_basic_op
7377         ## @{
7378
7379         ## Perform partition operation.
7380         #  @param ListShapes Shapes to be intersected.
7381         #  @param ListTools Shapes to intersect theShapes.
7382         #  @param Limit Type of resulting shapes (see ShapeType()).\n
7383         #         If this parameter is set to -1 ("Auto"), most appropriate shape limit
7384         #         type will be detected automatically.
7385         #  @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7386         #                             target type (equal to Limit) are kept in the result,
7387         #                             else standalone shapes of lower dimension
7388         #                             are kept also (if they exist).
7389         #
7390         #  @param theName Object name; when specified, this parameter is used
7391         #         for result publication in the study. Otherwise, if automatic
7392         #         publication is switched on, default value is used for result name.
7393         #
7394         #  @note Each compound from ListShapes and ListTools will be exploded
7395         #        in order to avoid possible intersection between shapes from this compound.
7396         #
7397         #  After implementation new version of PartitionAlgo (October 2006)
7398         #  other parameters are ignored by current functionality. They are kept
7399         #  in this function only for support old versions.
7400         #      @param ListKeepInside Shapes, outside which the results will be deleted.
7401         #         Each shape from theKeepInside must belong to theShapes also.
7402         #      @param ListRemoveInside Shapes, inside which the results will be deleted.
7403         #         Each shape from theRemoveInside must belong to theShapes also.
7404         #      @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7405         #      @param ListMaterials Material indices for each shape. Make sence,
7406         #         only if theRemoveWebs is TRUE.
7407         #
7408         #  @return New GEOM.GEOM_Object, containing the result shapes.
7409         #
7410         #  @ref tui_partition "Example"
7411         @ManageTransactions("BoolOp")
7412         def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7413                           Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7414                           KeepNonlimitShapes=0, theName=None):
7415             """
7416             Perform partition operation.
7417
7418             Parameters:
7419                 ListShapes Shapes to be intersected.
7420                 ListTools Shapes to intersect theShapes.
7421                 Limit Type of resulting shapes (see geompy.ShapeType)
7422                       If this parameter is set to -1 ("Auto"), most appropriate shape limit
7423                       type will be detected automatically.
7424                 KeepNonlimitShapes if this parameter == 0, then only shapes of
7425                                     target type (equal to Limit) are kept in the result,
7426                                     else standalone shapes of lower dimension
7427                                     are kept also (if they exist).
7428
7429                 theName Object name; when specified, this parameter is used
7430                         for result publication in the study. Otherwise, if automatic
7431                         publication is switched on, default value is used for result name.
7432             Note:
7433                     Each compound from ListShapes and ListTools will be exploded
7434                     in order to avoid possible intersection between shapes from
7435                     this compound.
7436
7437             After implementation new version of PartitionAlgo (October 2006) other
7438             parameters are ignored by current functionality. They are kept in this
7439             function only for support old versions.
7440
7441             Ignored parameters:
7442                 ListKeepInside Shapes, outside which the results will be deleted.
7443                                Each shape from theKeepInside must belong to theShapes also.
7444                 ListRemoveInside Shapes, inside which the results will be deleted.
7445                                  Each shape from theRemoveInside must belong to theShapes also.
7446                 RemoveWebs If TRUE, perform Glue 3D algorithm.
7447                 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7448
7449             Returns:
7450                 New GEOM.GEOM_Object, containing the result shapes.
7451             """
7452             # Example: see GEOM_TestAll.py
7453             if Limit == self.ShapeType["AUTO"]:
7454                 # automatic detection of the most appropriate shape limit type
7455                 lim = GEOM.SHAPE
7456                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7457                 Limit = EnumToLong(lim)
7458                 pass
7459             anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7460                                               ListKeepInside, ListRemoveInside,
7461                                               Limit, RemoveWebs, ListMaterials,
7462                                               KeepNonlimitShapes);
7463             RaiseIfFailed("MakePartition", self.BoolOp)
7464             self._autoPublish(anObj, theName, "partition")
7465             return anObj
7466
7467         ## Perform partition operation.
7468         #  This method may be useful if it is needed to make a partition for
7469         #  compound contains nonintersected shapes. Performance will be better
7470         #  since intersection between shapes from compound is not performed.
7471         #
7472         #  Description of all parameters as in previous method MakePartition().
7473         #  One additional parameter is provided:
7474         #  @param checkSelfInte The flag that tells if the arguments should
7475         #         be checked for self-intersection prior to the operation.
7476         #
7477         #  @note This algorithm doesn't find all types of self-intersections.
7478         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7479         #        vertex/face and edge/face intersections. Face/face
7480         #        intersections detection is switched off as it is a
7481         #        time-consuming operation that gives an impact on performance.
7482         #        To find all self-intersections please use
7483         #        CheckSelfIntersections() method.
7484         #
7485         #  @note Passed compounds (via ListShapes or via ListTools)
7486         #           have to consist of nonintersecting shapes.
7487         #
7488         #  @return New GEOM.GEOM_Object, containing the result shapes.
7489         #
7490         #  @ref swig_todo "Example"
7491         @ManageTransactions("BoolOp")
7492         def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7493                                                  ListKeepInside=[], ListRemoveInside=[],
7494                                                  Limit=ShapeType["AUTO"], RemoveWebs=0,
7495                                                  ListMaterials=[], KeepNonlimitShapes=0,
7496                                                  checkSelfInte=False, theName=None):
7497             """
7498             Perform partition operation.
7499             This method may be useful if it is needed to make a partition for
7500             compound contains nonintersected shapes. Performance will be better
7501             since intersection between shapes from compound is not performed.
7502
7503             Parameters:
7504                 Description of all parameters as in method geompy.MakePartition.
7505                 One additional parameter is provided:
7506                 checkSelfInte The flag that tells if the arguments should
7507                               be checked for self-intersection prior to
7508                               the operation.
7509
7510             Note:
7511                     This algorithm doesn't find all types of self-intersections.
7512                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7513                     vertex/face and edge/face intersections. Face/face
7514                     intersections detection is switched off as it is a
7515                     time-consuming operation that gives an impact on performance.
7516                     To find all self-intersections please use
7517                     CheckSelfIntersections() method.
7518
7519             NOTE:
7520                 Passed compounds (via ListShapes or via ListTools)
7521                 have to consist of nonintersecting shapes.
7522
7523             Returns:
7524                 New GEOM.GEOM_Object, containing the result shapes.
7525             """
7526             if Limit == self.ShapeType["AUTO"]:
7527                 # automatic detection of the most appropriate shape limit type
7528                 lim = GEOM.SHAPE
7529                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7530                 Limit = EnumToLong(lim)
7531                 pass
7532             anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7533                                                                      ListKeepInside, ListRemoveInside,
7534                                                                      Limit, RemoveWebs, ListMaterials,
7535                                                                      KeepNonlimitShapes, checkSelfInte);
7536             RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7537             self._autoPublish(anObj, theName, "partition")
7538             return anObj
7539
7540         ## See method MakePartition() for more information.
7541         #
7542         #  @ref tui_partition "Example 1"
7543         #  \n @ref swig_Partition "Example 2"
7544         def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7545                       Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7546                       KeepNonlimitShapes=0, theName=None):
7547             """
7548             See method geompy.MakePartition for more information.
7549             """
7550             # Example: see GEOM_TestOthers.py
7551             # note: auto-publishing is done in self.MakePartition()
7552             anObj = self.MakePartition(ListShapes, ListTools,
7553                                        ListKeepInside, ListRemoveInside,
7554                                        Limit, RemoveWebs, ListMaterials,
7555                                        KeepNonlimitShapes, theName);
7556             return anObj
7557
7558         ## Perform partition of the Shape with the Plane
7559         #  @param theShape Shape to be intersected.
7560         #  @param thePlane Tool shape, to intersect theShape.
7561         #  @param theName Object name; when specified, this parameter is used
7562         #         for result publication in the study. Otherwise, if automatic
7563         #         publication is switched on, default value is used for result name.
7564         #
7565         #  @return New GEOM.GEOM_Object, containing the result shape.
7566         #
7567         #  @ref tui_partition "Example"
7568         @ManageTransactions("BoolOp")
7569         def MakeHalfPartition(self, theShape, thePlane, theName=None):
7570             """
7571             Perform partition of the Shape with the Plane
7572
7573             Parameters:
7574                 theShape Shape to be intersected.
7575                 thePlane Tool shape, to intersect theShape.
7576                 theName Object name; when specified, this parameter is used
7577                         for result publication in the study. Otherwise, if automatic
7578                         publication is switched on, default value is used for result name.
7579
7580             Returns:
7581                 New GEOM.GEOM_Object, containing the result shape.
7582             """
7583             # Example: see GEOM_TestAll.py
7584             anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7585             RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7586             self._autoPublish(anObj, theName, "partition")
7587             return anObj
7588
7589         # end of l3_basic_op
7590         ## @}
7591
7592         ## @addtogroup l3_transform
7593         ## @{
7594
7595         ## Translate the given object along the vector, specified
7596         #  by its end points.
7597         #  @param theObject The object to be translated.
7598         #  @param thePoint1 Start point of translation vector.
7599         #  @param thePoint2 End point of translation vector.
7600         #  @param theCopy Flag used to translate object itself or create a copy.
7601         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7602         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7603         @ManageTransactions("TrsfOp")
7604         def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7605             """
7606             Translate the given object along the vector, specified by its end points.
7607
7608             Parameters:
7609                 theObject The object to be translated.
7610                 thePoint1 Start point of translation vector.
7611                 thePoint2 End point of translation vector.
7612                 theCopy Flag used to translate object itself or create a copy.
7613
7614             Returns:
7615                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7616                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7617             """
7618             if theCopy:
7619                 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7620             else:
7621                 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7622             RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7623             return anObj
7624
7625         ## Translate the given object along the vector, specified
7626         #  by its end points, creating its copy before the translation.
7627         #  @param theObject The object to be translated.
7628         #  @param thePoint1 Start point of translation vector.
7629         #  @param thePoint2 End point of translation vector.
7630         #  @param theName Object name; when specified, this parameter is used
7631         #         for result publication in the study. Otherwise, if automatic
7632         #         publication is switched on, default value is used for result name.
7633         #
7634         #  @return New GEOM.GEOM_Object, containing the translated object.
7635         #
7636         #  @ref tui_translation "Example 1"
7637         #  \n @ref swig_MakeTranslationTwoPoints "Example 2"
7638         @ManageTransactions("TrsfOp")
7639         def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7640             """
7641             Translate the given object along the vector, specified
7642             by its end points, creating its copy before the translation.
7643
7644             Parameters:
7645                 theObject The object to be translated.
7646                 thePoint1 Start point of translation vector.
7647                 thePoint2 End point of translation vector.
7648                 theName Object name; when specified, this parameter is used
7649                         for result publication in the study. Otherwise, if automatic
7650                         publication is switched on, default value is used for result name.
7651
7652             Returns:
7653                 New GEOM.GEOM_Object, containing the translated object.
7654             """
7655             # Example: see GEOM_TestAll.py
7656             anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7657             RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7658             self._autoPublish(anObj, theName, "translated")
7659             return anObj
7660
7661         ## Translate the given object along the vector, specified by its components.
7662         #  @param theObject The object to be translated.
7663         #  @param theDX,theDY,theDZ Components of translation vector.
7664         #  @param theCopy Flag used to translate object itself or create a copy.
7665         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7666         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7667         #
7668         #  @ref tui_translation "Example"
7669         @ManageTransactions("TrsfOp")
7670         def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7671             """
7672             Translate the given object along the vector, specified by its components.
7673
7674             Parameters:
7675                 theObject The object to be translated.
7676                 theDX,theDY,theDZ Components of translation vector.
7677                 theCopy Flag used to translate object itself or create a copy.
7678
7679             Returns:
7680                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7681                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7682             """
7683             # Example: see GEOM_TestAll.py
7684             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7685             if theCopy:
7686                 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7687             else:
7688                 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7689             anObj.SetParameters(Parameters)
7690             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7691             return anObj
7692
7693         ## Translate the given object along the vector, specified
7694         #  by its components, creating its copy before the translation.
7695         #  @param theObject The object to be translated.
7696         #  @param theDX,theDY,theDZ Components of translation vector.
7697         #  @param theName Object name; when specified, this parameter is used
7698         #         for result publication in the study. Otherwise, if automatic
7699         #         publication is switched on, default value is used for result name.
7700         #
7701         #  @return New GEOM.GEOM_Object, containing the translated object.
7702         #
7703         #  @ref tui_translation "Example"
7704         @ManageTransactions("TrsfOp")
7705         def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7706             """
7707             Translate the given object along the vector, specified
7708             by its components, creating its copy before the translation.
7709
7710             Parameters:
7711                 theObject The object to be translated.
7712                 theDX,theDY,theDZ Components of translation vector.
7713                 theName Object name; when specified, this parameter is used
7714                         for result publication in the study. Otherwise, if automatic
7715                         publication is switched on, default value is used for result name.
7716
7717             Returns:
7718                 New GEOM.GEOM_Object, containing the translated object.
7719             """
7720             # Example: see GEOM_TestAll.py
7721             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7722             anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7723             anObj.SetParameters(Parameters)
7724             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7725             self._autoPublish(anObj, theName, "translated")
7726             return anObj
7727
7728         ## Translate the given object along the given vector.
7729         #  @param theObject The object to be translated.
7730         #  @param theVector The translation vector.
7731         #  @param theCopy Flag used to translate object itself or create a copy.
7732         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7733         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7734         @ManageTransactions("TrsfOp")
7735         def TranslateVector(self, theObject, theVector, theCopy=False):
7736             """
7737             Translate the given object along the given vector.
7738
7739             Parameters:
7740                 theObject The object to be translated.
7741                 theVector The translation vector.
7742                 theCopy Flag used to translate object itself or create a copy.
7743
7744             Returns:
7745                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7746                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7747             """
7748             if theCopy:
7749                 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7750             else:
7751                 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7752             RaiseIfFailed("TranslateVector", self.TrsfOp)
7753             return anObj
7754
7755         ## Translate the given object along the given vector,
7756         #  creating its copy before the translation.
7757         #  @param theObject The object to be translated.
7758         #  @param theVector The translation vector.
7759         #  @param theName Object name; when specified, this parameter is used
7760         #         for result publication in the study. Otherwise, if automatic
7761         #         publication is switched on, default value is used for result name.
7762         #
7763         #  @return New GEOM.GEOM_Object, containing the translated object.
7764         #
7765         #  @ref tui_translation "Example"
7766         @ManageTransactions("TrsfOp")
7767         def MakeTranslationVector(self, theObject, theVector, theName=None):
7768             """
7769             Translate the given object along the given vector,
7770             creating its copy before the translation.
7771
7772             Parameters:
7773                 theObject The object to be translated.
7774                 theVector The translation vector.
7775                 theName Object name; when specified, this parameter is used
7776                         for result publication in the study. Otherwise, if automatic
7777                         publication is switched on, default value is used for result name.
7778
7779             Returns:
7780                 New GEOM.GEOM_Object, containing the translated object.
7781             """
7782             # Example: see GEOM_TestAll.py
7783             anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7784             RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7785             self._autoPublish(anObj, theName, "translated")
7786             return anObj
7787
7788         ## Translate the given object along the given vector on given distance.
7789         #  @param theObject The object to be translated.
7790         #  @param theVector The translation vector.
7791         #  @param theDistance The translation distance.
7792         #  @param theCopy Flag used to translate object itself or create a copy.
7793         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7794         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7795         #
7796         #  @ref tui_translation "Example"
7797         @ManageTransactions("TrsfOp")
7798         def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7799             """
7800             Translate the given object along the given vector on given distance.
7801
7802             Parameters:
7803                 theObject The object to be translated.
7804                 theVector The translation vector.
7805                 theDistance The translation distance.
7806                 theCopy Flag used to translate object itself or create a copy.
7807
7808             Returns:
7809                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7810                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7811             """
7812             # Example: see GEOM_TestAll.py
7813             theDistance,Parameters = ParseParameters(theDistance)
7814             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7815             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7816             anObj.SetParameters(Parameters)
7817             return anObj
7818
7819         ## Translate the given object along the given vector on given distance,
7820         #  creating its copy before the translation.
7821         #  @param theObject The object to be translated.
7822         #  @param theVector The translation vector.
7823         #  @param theDistance The translation distance.
7824         #  @param theName Object name; when specified, this parameter is used
7825         #         for result publication in the study. Otherwise, if automatic
7826         #         publication is switched on, default value is used for result name.
7827         #
7828         #  @return New GEOM.GEOM_Object, containing the translated object.
7829         #
7830         #  @ref tui_translation "Example"
7831         @ManageTransactions("TrsfOp")
7832         def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7833             """
7834             Translate the given object along the given vector on given distance,
7835             creating its copy before the translation.
7836
7837             Parameters:
7838                 theObject The object to be translated.
7839                 theVector The translation vector.
7840                 theDistance The translation distance.
7841                 theName Object name; when specified, this parameter is used
7842                         for result publication in the study. Otherwise, if automatic
7843                         publication is switched on, default value is used for result name.
7844
7845             Returns:
7846                 New GEOM.GEOM_Object, containing the translated object.
7847             """
7848             # Example: see GEOM_TestAll.py
7849             theDistance,Parameters = ParseParameters(theDistance)
7850             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7851             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7852             anObj.SetParameters(Parameters)
7853             self._autoPublish(anObj, theName, "translated")
7854             return anObj
7855
7856         ## Rotate the given object around the given axis on the given angle.
7857         #  @param theObject The object to be rotated.
7858         #  @param theAxis Rotation axis.
7859         #  @param theAngle Rotation angle in radians.
7860         #  @param theCopy Flag used to rotate object itself or create a copy.
7861         #
7862         #  @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7863         #  new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7864         #
7865         #  @ref tui_rotation "Example"
7866         @ManageTransactions("TrsfOp")
7867         def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7868             """
7869             Rotate the given object around the given axis on the given angle.
7870
7871             Parameters:
7872                 theObject The object to be rotated.
7873                 theAxis Rotation axis.
7874                 theAngle Rotation angle in radians.
7875                 theCopy Flag used to rotate object itself or create a copy.
7876
7877             Returns:
7878                 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7879                 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7880             """
7881             # Example: see GEOM_TestAll.py
7882             flag = False
7883             if isinstance(theAngle,str):
7884                 flag = True
7885             theAngle, Parameters = ParseParameters(theAngle)
7886             if flag:
7887                 theAngle = theAngle*math.pi/180.0
7888             if theCopy:
7889                 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7890             else:
7891                 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7892             RaiseIfFailed("Rotate", self.TrsfOp)
7893             anObj.SetParameters(Parameters)
7894             return anObj
7895
7896         ## Rotate the given object around the given axis
7897         #  on the given angle, creating its copy before the rotation.
7898         #  @param theObject The object to be rotated.
7899         #  @param theAxis Rotation axis.
7900         #  @param theAngle Rotation angle in radians.
7901         #  @param theName Object name; when specified, this parameter is used
7902         #         for result publication in the study. Otherwise, if automatic
7903         #         publication is switched on, default value is used for result name.
7904         #
7905         #  @return New GEOM.GEOM_Object, containing the rotated object.
7906         #
7907         #  @ref tui_rotation "Example"
7908         @ManageTransactions("TrsfOp")
7909         def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7910             """
7911             Rotate the given object around the given axis
7912             on the given angle, creating its copy before the rotatation.
7913
7914             Parameters:
7915                 theObject The object to be rotated.
7916                 theAxis Rotation axis.
7917                 theAngle Rotation angle in radians.
7918                 theName Object name; when specified, this parameter is used
7919                         for result publication in the study. Otherwise, if automatic
7920                         publication is switched on, default value is used for result name.
7921
7922             Returns:
7923                 New GEOM.GEOM_Object, containing the rotated object.
7924             """
7925             # Example: see GEOM_TestAll.py
7926             flag = False
7927             if isinstance(theAngle,str):
7928                 flag = True
7929             theAngle, Parameters = ParseParameters(theAngle)
7930             if flag:
7931                 theAngle = theAngle*math.pi/180.0
7932             anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7933             RaiseIfFailed("RotateCopy", self.TrsfOp)
7934             anObj.SetParameters(Parameters)
7935             self._autoPublish(anObj, theName, "rotated")
7936             return anObj
7937
7938         ## Rotate given object around vector perpendicular to plane
7939         #  containing three points.
7940         #  @param theObject The object to be rotated.
7941         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
7942         #  containing the three points.
7943         #  @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7944         #  @param theCopy Flag used to rotate object itself or create a copy.
7945         #  @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7946         #  new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7947         @ManageTransactions("TrsfOp")
7948         def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7949             """
7950             Rotate given object around vector perpendicular to plane
7951             containing three points.
7952
7953             Parameters:
7954                 theObject The object to be rotated.
7955                 theCentPoint central point  the axis is the vector perpendicular to the plane
7956                              containing the three points.
7957                 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7958                 theCopy Flag used to rotate object itself or create a copy.
7959
7960             Returns:
7961                 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7962                 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7963             """
7964             if theCopy:
7965                 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7966             else:
7967                 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7968             RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7969             return anObj
7970
7971         ## Rotate given object around vector perpendicular to plane
7972         #  containing three points, creating its copy before the rotatation.
7973         #  @param theObject The object to be rotated.
7974         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
7975         #  containing the three points.
7976         #  @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7977         #  @param theName Object name; when specified, this parameter is used
7978         #         for result publication in the study. Otherwise, if automatic
7979         #         publication is switched on, default value is used for result name.
7980         #
7981         #  @return New GEOM.GEOM_Object, containing the rotated object.
7982         #
7983         #  @ref tui_rotation "Example"
7984         @ManageTransactions("TrsfOp")
7985         def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7986             """
7987             Rotate given object around vector perpendicular to plane
7988             containing three points, creating its copy before the rotatation.
7989
7990             Parameters:
7991                 theObject The object to be rotated.
7992                 theCentPoint central point  the axis is the vector perpendicular to the plane
7993                              containing the three points.
7994                 thePoint1,thePoint2  in a perpendicular plane of the axis.
7995                 theName Object name; when specified, this parameter is used
7996                         for result publication in the study. Otherwise, if automatic
7997                         publication is switched on, default value is used for result name.
7998
7999             Returns:
8000                 New GEOM.GEOM_Object, containing the rotated object.
8001             """
8002             # Example: see GEOM_TestAll.py
8003             anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8004             RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8005             self._autoPublish(anObj, theName, "rotated")
8006             return anObj
8007
8008         ## Scale the given object by the specified factor.
8009         #  @param theObject The object to be scaled.
8010         #  @param thePoint Center point for scaling.
8011         #                  Passing None for it means scaling relatively the origin of global CS.
8012         #  @param theFactor Scaling factor value.
8013         #  @param theCopy Flag used to scale object itself or create a copy.
8014         #  @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8015         #  new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8016         @ManageTransactions("TrsfOp")
8017         def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8018             """
8019             Scale the given object by the specified factor.
8020
8021             Parameters:
8022                 theObject The object to be scaled.
8023                 thePoint Center point for scaling.
8024                          Passing None for it means scaling relatively the origin of global CS.
8025                 theFactor Scaling factor value.
8026                 theCopy Flag used to scale object itself or create a copy.
8027
8028             Returns:
8029                 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8030                 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8031             """
8032             # Example: see GEOM_TestAll.py
8033             theFactor, Parameters = ParseParameters(theFactor)
8034             if theCopy:
8035                 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8036             else:
8037                 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8038             RaiseIfFailed("Scale", self.TrsfOp)
8039             anObj.SetParameters(Parameters)
8040             return anObj
8041
8042         ## Scale the given object by the factor, creating its copy before the scaling.
8043         #  @param theObject The object to be scaled.
8044         #  @param thePoint Center point for scaling.
8045         #                  Passing None for it means scaling relatively the origin of global CS.
8046         #  @param theFactor Scaling factor value.
8047         #  @param theName Object name; when specified, this parameter is used
8048         #         for result publication in the study. Otherwise, if automatic
8049         #         publication is switched on, default value is used for result name.
8050         #
8051         #  @return New GEOM.GEOM_Object, containing the scaled shape.
8052         #
8053         #  @ref tui_scale "Example"
8054         @ManageTransactions("TrsfOp")
8055         def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8056             """
8057             Scale the given object by the factor, creating its copy before the scaling.
8058
8059             Parameters:
8060                 theObject The object to be scaled.
8061                 thePoint Center point for scaling.
8062                          Passing None for it means scaling relatively the origin of global CS.
8063                 theFactor Scaling factor value.
8064                 theName Object name; when specified, this parameter is used
8065                         for result publication in the study. Otherwise, if automatic
8066                         publication is switched on, default value is used for result name.
8067
8068             Returns:
8069                 New GEOM.GEOM_Object, containing the scaled shape.
8070             """
8071             # Example: see GEOM_TestAll.py
8072             theFactor, Parameters = ParseParameters(theFactor)
8073             anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8074             RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8075             anObj.SetParameters(Parameters)
8076             self._autoPublish(anObj, theName, "scaled")
8077             return anObj
8078
8079         ## Scale the given object by different factors along coordinate axes.
8080         #  @param theObject The object to be scaled.
8081         #  @param thePoint Center point for scaling.
8082         #                  Passing None for it means scaling relatively the origin of global CS.
8083         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8084         #  @param theCopy Flag used to scale object itself or create a copy.
8085         #  @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8086         #  new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8087         @ManageTransactions("TrsfOp")
8088         def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8089             """
8090             Scale the given object by different factors along coordinate axes.
8091
8092             Parameters:
8093                 theObject The object to be scaled.
8094                 thePoint Center point for scaling.
8095                             Passing None for it means scaling relatively the origin of global CS.
8096                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8097                 theCopy Flag used to scale object itself or create a copy.
8098
8099             Returns:
8100                 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8101                 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8102             """
8103             # Example: see GEOM_TestAll.py
8104             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8105             if theCopy:
8106                 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8107                                                             theFactorX, theFactorY, theFactorZ)
8108             else:
8109                 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8110                                                         theFactorX, theFactorY, theFactorZ)
8111             RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8112             anObj.SetParameters(Parameters)
8113             return anObj
8114
8115         ## Scale the given object by different factors along coordinate axes,
8116         #  creating its copy before the scaling.
8117         #  @param theObject The object to be scaled.
8118         #  @param thePoint Center point for scaling.
8119         #                  Passing None for it means scaling relatively the origin of global CS.
8120         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8121         #  @param theName Object name; when specified, this parameter is used
8122         #         for result publication in the study. Otherwise, if automatic
8123         #         publication is switched on, default value is used for result name.
8124         #
8125         #  @return New GEOM.GEOM_Object, containing the scaled shape.
8126         #
8127         #  @ref swig_scale "Example"
8128         @ManageTransactions("TrsfOp")
8129         def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8130             """
8131             Scale the given object by different factors along coordinate axes,
8132             creating its copy before the scaling.
8133
8134             Parameters:
8135                 theObject The object to be scaled.
8136                 thePoint Center point for scaling.
8137                             Passing None for it means scaling relatively the origin of global CS.
8138                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8139                 theName Object name; when specified, this parameter is used
8140                         for result publication in the study. Otherwise, if automatic
8141                         publication is switched on, default value is used for result name.
8142
8143             Returns:
8144                 New GEOM.GEOM_Object, containing the scaled shape.
8145             """
8146             # Example: see GEOM_TestAll.py
8147             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8148             anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8149                                                         theFactorX, theFactorY, theFactorZ)
8150             RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8151             anObj.SetParameters(Parameters)
8152             self._autoPublish(anObj, theName, "scaled")
8153             return anObj
8154
8155         ## Mirror an object relatively the given plane.
8156         #  @param theObject The object to be mirrored.
8157         #  @param thePlane Plane of symmetry.
8158         #  @param theCopy Flag used to mirror object itself or create a copy.
8159         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8160         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8161         @ManageTransactions("TrsfOp")
8162         def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8163             """
8164             Mirror an object relatively the given plane.
8165
8166             Parameters:
8167                 theObject The object to be mirrored.
8168                 thePlane Plane of symmetry.
8169                 theCopy Flag used to mirror object itself or create a copy.
8170
8171             Returns:
8172                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8173                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8174             """
8175             if theCopy:
8176                 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8177             else:
8178                 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8179             RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8180             return anObj
8181
8182         ## Create an object, symmetrical
8183         #  to the given one relatively the given plane.
8184         #  @param theObject The object to be mirrored.
8185         #  @param thePlane Plane of symmetry.
8186         #  @param theName Object name; when specified, this parameter is used
8187         #         for result publication in the study. Otherwise, if automatic
8188         #         publication is switched on, default value is used for result name.
8189         #
8190         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
8191         #
8192         #  @ref tui_mirror "Example"
8193         @ManageTransactions("TrsfOp")
8194         def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8195             """
8196             Create an object, symmetrical to the given one relatively the given plane.
8197
8198             Parameters:
8199                 theObject The object to be mirrored.
8200                 thePlane Plane of symmetry.
8201                 theName Object name; when specified, this parameter is used
8202                         for result publication in the study. Otherwise, if automatic
8203                         publication is switched on, default value is used for result name.
8204
8205             Returns:
8206                 New GEOM.GEOM_Object, containing the mirrored shape.
8207             """
8208             # Example: see GEOM_TestAll.py
8209             anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8210             RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8211             self._autoPublish(anObj, theName, "mirrored")
8212             return anObj
8213
8214         ## Mirror an object relatively the given axis.
8215         #  @param theObject The object to be mirrored.
8216         #  @param theAxis Axis of symmetry.
8217         #  @param theCopy Flag used to mirror object itself or create a copy.
8218         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8219         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8220         @ManageTransactions("TrsfOp")
8221         def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8222             """
8223             Mirror an object relatively the given axis.
8224
8225             Parameters:
8226                 theObject The object to be mirrored.
8227                 theAxis Axis of symmetry.
8228                 theCopy Flag used to mirror object itself or create a copy.
8229
8230             Returns:
8231                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8232                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8233             """
8234             if theCopy:
8235                 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8236             else:
8237                 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8238             RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8239             return anObj
8240
8241         ## Create an object, symmetrical
8242         #  to the given one relatively the given axis.
8243         #  @param theObject The object to be mirrored.
8244         #  @param theAxis Axis of symmetry.
8245         #  @param theName Object name; when specified, this parameter is used
8246         #         for result publication in the study. Otherwise, if automatic
8247         #         publication is switched on, default value is used for result name.
8248         #
8249         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
8250         #
8251         #  @ref tui_mirror "Example"
8252         @ManageTransactions("TrsfOp")
8253         def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8254             """
8255             Create an object, symmetrical to the given one relatively the given axis.
8256
8257             Parameters:
8258                 theObject The object to be mirrored.
8259                 theAxis Axis of symmetry.
8260                 theName Object name; when specified, this parameter is used
8261                         for result publication in the study. Otherwise, if automatic
8262                         publication is switched on, default value is used for result name.
8263
8264             Returns:
8265                 New GEOM.GEOM_Object, containing the mirrored shape.
8266             """
8267             # Example: see GEOM_TestAll.py
8268             anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8269             RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8270             self._autoPublish(anObj, theName, "mirrored")
8271             return anObj
8272
8273         ## Mirror an object relatively the given point.
8274         #  @param theObject The object to be mirrored.
8275         #  @param thePoint Point of symmetry.
8276         #  @param theCopy Flag used to mirror object itself or create a copy.
8277         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8278         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8279         @ManageTransactions("TrsfOp")
8280         def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8281             """
8282             Mirror an object relatively the given point.
8283
8284             Parameters:
8285                 theObject The object to be mirrored.
8286                 thePoint Point of symmetry.
8287                 theCopy Flag used to mirror object itself or create a copy.
8288
8289             Returns:
8290                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8291                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8292             """
8293             # Example: see GEOM_TestAll.py
8294             if theCopy:
8295                 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8296             else:
8297                 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8298             RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8299             return anObj
8300
8301         ## Create an object, symmetrical
8302         #  to the given one relatively the given point.
8303         #  @param theObject The object to be mirrored.
8304         #  @param thePoint Point of symmetry.
8305         #  @param theName Object name; when specified, this parameter is used
8306         #         for result publication in the study. Otherwise, if automatic
8307         #         publication is switched on, default value is used for result name.
8308         #
8309         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
8310         #
8311         #  @ref tui_mirror "Example"
8312         @ManageTransactions("TrsfOp")
8313         def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8314             """
8315             Create an object, symmetrical
8316             to the given one relatively the given point.
8317
8318             Parameters:
8319                 theObject The object to be mirrored.
8320                 thePoint Point of symmetry.
8321                 theName Object name; when specified, this parameter is used
8322                         for result publication in the study. Otherwise, if automatic
8323                         publication is switched on, default value is used for result name.
8324
8325             Returns:
8326                 New GEOM.GEOM_Object, containing the mirrored shape.
8327             """
8328             # Example: see GEOM_TestAll.py
8329             anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8330             RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8331             self._autoPublish(anObj, theName, "mirrored")
8332             return anObj
8333
8334         ## Modify the location of the given object.
8335         #  @param theObject The object to be displaced.
8336         #  @param theStartLCS Coordinate system to perform displacement from it.\n
8337         #                     If \a theStartLCS is NULL, displacement
8338         #                     will be performed from global CS.\n
8339         #                     If \a theObject itself is used as \a theStartLCS,
8340         #                     its location will be changed to \a theEndLCS.
8341         #  @param theEndLCS Coordinate system to perform displacement to it.
8342         #  @param theCopy Flag used to displace object itself or create a copy.
8343         #  @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8344         #  new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8345         @ManageTransactions("TrsfOp")
8346         def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8347             """
8348             Modify the Location of the given object by LCS, creating its copy before the setting.
8349
8350             Parameters:
8351                 theObject The object to be displaced.
8352                 theStartLCS Coordinate system to perform displacement from it.
8353                             If theStartLCS is NULL, displacement
8354                             will be performed from global CS.
8355                             If theObject itself is used as theStartLCS,
8356                             its location will be changed to theEndLCS.
8357                 theEndLCS Coordinate system to perform displacement to it.
8358                 theCopy Flag used to displace object itself or create a copy.
8359
8360             Returns:
8361                 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8362                 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8363             """
8364             # Example: see GEOM_TestAll.py
8365             if theCopy:
8366                 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8367             else:
8368                 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8369             RaiseIfFailed("Displace", self.TrsfOp)
8370             return anObj
8371
8372         ## Modify the Location of the given object by LCS,
8373         #  creating its copy before the setting.
8374         #  @param theObject The object to be displaced.
8375         #  @param theStartLCS Coordinate system to perform displacement from it.\n
8376         #                     If \a theStartLCS is NULL, displacement
8377         #                     will be performed from global CS.\n
8378         #                     If \a theObject itself is used as \a theStartLCS,
8379         #                     its location will be changed to \a theEndLCS.
8380         #  @param theEndLCS Coordinate system to perform displacement to it.
8381         #  @param theName Object name; when specified, this parameter is used
8382         #         for result publication in the study. Otherwise, if automatic
8383         #         publication is switched on, default value is used for result name.
8384         #
8385         #  @return New GEOM.GEOM_Object, containing the displaced shape.
8386         #
8387         #  @ref tui_modify_location "Example"
8388         @ManageTransactions("TrsfOp")
8389         def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8390             """
8391             Modify the Location of the given object by LCS, creating its copy before the setting.
8392
8393             Parameters:
8394                 theObject The object to be displaced.
8395                 theStartLCS Coordinate system to perform displacement from it.
8396                             If theStartLCS is NULL, displacement
8397                             will be performed from global CS.
8398                             If theObject itself is used as theStartLCS,
8399                             its location will be changed to theEndLCS.
8400                 theEndLCS Coordinate system to perform displacement to it.
8401                 theName Object name; when specified, this parameter is used
8402                         for result publication in the study. Otherwise, if automatic
8403                         publication is switched on, default value is used for result name.
8404
8405             Returns:
8406                 New GEOM.GEOM_Object, containing the displaced shape.
8407
8408             Example of usage:
8409                 # create local coordinate systems
8410                 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8411                 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8412                 # modify the location of the given object
8413                 position = geompy.MakePosition(cylinder, cs1, cs2)
8414             """
8415             # Example: see GEOM_TestAll.py
8416             anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8417             RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8418             self._autoPublish(anObj, theName, "displaced")
8419             return anObj
8420
8421         ## Modify the Location of the given object by Path.
8422         #  @param  theObject The object to be displaced.
8423         #  @param  thePath Wire or Edge along that the object will be translated.
8424         #  @param  theDistance progress of Path (0 = start location, 1 = end of path location).
8425         #  @param  theCopy is to create a copy objects if true.
8426         #  @param  theReverse  0 - for usual direction, 1 - to reverse path direction.
8427         #  @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8428         #          new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8429         #
8430         #  @ref tui_modify_location "Example"
8431         @ManageTransactions("TrsfOp")
8432         def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8433             """
8434             Modify the Location of the given object by Path.
8435
8436             Parameters:
8437                  theObject The object to be displaced.
8438                  thePath Wire or Edge along that the object will be translated.
8439                  theDistance progress of Path (0 = start location, 1 = end of path location).
8440                  theCopy is to create a copy objects if true.
8441                  theReverse  0 - for usual direction, 1 - to reverse path direction.
8442
8443             Returns:
8444                  Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8445                  new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8446
8447             Example of usage:
8448                 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8449             """
8450             # Example: see GEOM_TestAll.py
8451             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8452             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8453             return anObj
8454
8455         ## Modify the Location of the given object by Path, creating its copy before the operation.
8456         #  @param theObject The object to be displaced.
8457         #  @param thePath Wire or Edge along that the object will be translated.
8458         #  @param theDistance progress of Path (0 = start location, 1 = end of path location).
8459         #  @param theReverse  0 - for usual direction, 1 - to reverse path direction.
8460         #  @param theName Object name; when specified, this parameter is used
8461         #         for result publication in the study. Otherwise, if automatic
8462         #         publication is switched on, default value is used for result name.
8463         #
8464         #  @return New GEOM.GEOM_Object, containing the displaced shape.
8465         @ManageTransactions("TrsfOp")
8466         def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8467             """
8468             Modify the Location of the given object by Path, creating its copy before the operation.
8469
8470             Parameters:
8471                  theObject The object to be displaced.
8472                  thePath Wire or Edge along that the object will be translated.
8473                  theDistance progress of Path (0 = start location, 1 = end of path location).
8474                  theReverse  0 - for usual direction, 1 - to reverse path direction.
8475                  theName Object name; when specified, this parameter is used
8476                          for result publication in the study. Otherwise, if automatic
8477                          publication is switched on, default value is used for result name.
8478
8479             Returns:
8480                 New GEOM.GEOM_Object, containing the displaced shape.
8481             """
8482             # Example: see GEOM_TestAll.py
8483             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8484             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8485             self._autoPublish(anObj, theName, "displaced")
8486             return anObj
8487
8488         ## Offset given shape.
8489         #  @param theObject The base object for the offset.
8490         #  @param theOffset Offset value.
8491         #  @param theCopy Flag used to offset object itself or create a copy.
8492         #  @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8493         #  new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8494         @ManageTransactions("TrsfOp")
8495         def Offset(self, theObject, theOffset, theCopy=False):
8496             """
8497             Offset given shape.
8498
8499             Parameters:
8500                 theObject The base object for the offset.
8501                 theOffset Offset value.
8502                 theCopy Flag used to offset object itself or create a copy.
8503
8504             Returns:
8505                 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8506                 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8507             """
8508             theOffset, Parameters = ParseParameters(theOffset)
8509             if theCopy:
8510                 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8511             else:
8512                 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8513             RaiseIfFailed("Offset", self.TrsfOp)
8514             anObj.SetParameters(Parameters)
8515             return anObj
8516
8517         ## Create new object as offset of the given one.
8518         #  @param theObject The base object for the offset.
8519         #  @param theOffset Offset value.
8520         #  @param theName Object name; when specified, this parameter is used
8521         #         for result publication in the study. Otherwise, if automatic
8522         #         publication is switched on, default value is used for result name.
8523         #
8524         #  @return New GEOM.GEOM_Object, containing the offset object.
8525         #
8526         #  @ref tui_offset "Example"
8527         @ManageTransactions("TrsfOp")
8528         def MakeOffset(self, theObject, theOffset, theName=None):
8529             """
8530             Create new object as offset of the given one.
8531
8532             Parameters:
8533                 theObject The base object for the offset.
8534                 theOffset Offset value.
8535                 theName Object name; when specified, this parameter is used
8536                         for result publication in the study. Otherwise, if automatic
8537                         publication is switched on, default value is used for result name.
8538
8539             Returns:
8540                 New GEOM.GEOM_Object, containing the offset object.
8541
8542             Example of usage:
8543                  box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8544                  # create a new object as offset of the given object
8545                  offset = geompy.MakeOffset(box, 70.)
8546             """
8547             # Example: see GEOM_TestAll.py
8548             theOffset, Parameters = ParseParameters(theOffset)
8549             anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8550             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8551             anObj.SetParameters(Parameters)
8552             self._autoPublish(anObj, theName, "offset")
8553             return anObj
8554
8555         ## Create new object as projection of the given one on a 2D surface.
8556         #  @param theSource The source object for the projection. It can be a point, edge or wire.
8557         #  @param theTarget The target object. It can be planar or cylindrical face.
8558         #  @param theName Object name; when specified, this parameter is used
8559         #         for result publication in the study. Otherwise, if automatic
8560         #         publication is switched on, default value is used for result name.
8561         #
8562         #  @return New GEOM.GEOM_Object, containing the projection.
8563         #
8564         #  @ref tui_projection "Example"
8565         @ManageTransactions("TrsfOp")
8566         def MakeProjection(self, theSource, theTarget, theName=None):
8567             """
8568             Create new object as projection of the given one on a 2D surface.
8569
8570             Parameters:
8571                 theSource The source object for the projection. It can be a point, edge or wire.
8572                 theTarget The target object. It can be planar or cylindrical face.
8573                 theName Object name; when specified, this parameter is used
8574                         for result publication in the study. Otherwise, if automatic
8575                         publication is switched on, default value is used for result name.
8576
8577             Returns:
8578                 New GEOM.GEOM_Object, containing the projection.
8579             """
8580             # Example: see GEOM_TestAll.py
8581             anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8582             RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8583             self._autoPublish(anObj, theName, "projection")
8584             return anObj
8585
8586         ## Create a projection projection of the given point on a wire or an edge.
8587         #  If there are no solutions or there are 2 or more solutions It throws an
8588         #  exception.
8589         #  @param thePoint the point to be projected.
8590         #  @param theWire the wire. The edge is accepted as well.
8591         #  @param theName Object name; when specified, this parameter is used
8592         #         for result publication in the study. Otherwise, if automatic
8593         #         publication is switched on, default value is used for result name.
8594         #
8595         #  @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8596         #  \n \a u: The parameter of projection point on edge.
8597         #  \n \a PointOnEdge: The projection point.
8598         #  \n \a EdgeInWireIndex: The index of an edge in a wire.
8599         #
8600         #  @ref tui_projection "Example"
8601         @ManageTransactions("TrsfOp")
8602         def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8603             """
8604             Create a projection projection of the given point on a wire or an edge.
8605             If there are no solutions or there are 2 or more solutions It throws an
8606             exception.
8607
8608             Parameters:
8609                 thePoint the point to be projected.
8610                 theWire the wire. The edge is accepted as well.
8611                 theName Object name; when specified, this parameter is used
8612                         for result publication in the study. Otherwise, if automatic
8613                         publication is switched on, default value is used for result name.
8614
8615             Returns:
8616                 [u, PointOnEdge, EdgeInWireIndex]
8617                  u: The parameter of projection point on edge.
8618                  PointOnEdge: The projection point.
8619                  EdgeInWireIndex: The index of an edge in a wire.
8620             """
8621             # Example: see GEOM_TestAll.py
8622             anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8623             RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8624             self._autoPublish(anObj[1], theName, "projection")
8625             return anObj
8626
8627         # -----------------------------------------------------------------------------
8628         # Patterns
8629         # -----------------------------------------------------------------------------
8630
8631         ## Translate the given object along the given vector a given number times
8632         #  @param theObject The object to be translated.
8633         #  @param theVector Direction of the translation. DX if None.
8634         #  @param theStep Distance to translate on.
8635         #  @param theNbTimes Quantity of translations to be done.
8636         #  @param theName Object name; when specified, this parameter is used
8637         #         for result publication in the study. Otherwise, if automatic
8638         #         publication is switched on, default value is used for result name.
8639         #
8640         #  @return New GEOM.GEOM_Object, containing compound of all
8641         #          the shapes, obtained after each translation.
8642         #
8643         #  @ref tui_multi_translation "Example"
8644         @ManageTransactions("TrsfOp")
8645         def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8646             """
8647             Translate the given object along the given vector a given number times
8648
8649             Parameters:
8650                 theObject The object to be translated.
8651                 theVector Direction of the translation. DX if None.
8652                 theStep Distance to translate on.
8653                 theNbTimes Quantity of translations to be done.
8654                 theName Object name; when specified, this parameter is used
8655                         for result publication in the study. Otherwise, if automatic
8656                         publication is switched on, default value is used for result name.
8657
8658             Returns:
8659                 New GEOM.GEOM_Object, containing compound of all
8660                 the shapes, obtained after each translation.
8661
8662             Example of usage:
8663                 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8664             """
8665             # Example: see GEOM_TestAll.py
8666             theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8667             anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8668             RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8669             anObj.SetParameters(Parameters)
8670             self._autoPublish(anObj, theName, "multitranslation")
8671             return anObj
8672
8673         ## Conseqently apply two specified translations to theObject specified number of times.
8674         #  @param theObject The object to be translated.
8675         #  @param theVector1 Direction of the first translation. DX if None.
8676         #  @param theStep1 Step of the first translation.
8677         #  @param theNbTimes1 Quantity of translations to be done along theVector1.
8678         #  @param theVector2 Direction of the second translation. DY if None.
8679         #  @param theStep2 Step of the second translation.
8680         #  @param theNbTimes2 Quantity of translations to be done along theVector2.
8681         #  @param theName Object name; when specified, this parameter is used
8682         #         for result publication in the study. Otherwise, if automatic
8683         #         publication is switched on, default value is used for result name.
8684         #
8685         #  @return New GEOM.GEOM_Object, containing compound of all
8686         #          the shapes, obtained after each translation.
8687         #
8688         #  @ref tui_multi_translation "Example"
8689         @ManageTransactions("TrsfOp")
8690         def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8691                                    theVector2, theStep2, theNbTimes2, theName=None):
8692             """
8693             Conseqently apply two specified translations to theObject specified number of times.
8694
8695             Parameters:
8696                 theObject The object to be translated.
8697                 theVector1 Direction of the first translation. DX if None.
8698                 theStep1 Step of the first translation.
8699                 theNbTimes1 Quantity of translations to be done along theVector1.
8700                 theVector2 Direction of the second translation. DY if None.
8701                 theStep2 Step of the second translation.
8702                 theNbTimes2 Quantity of translations to be done along theVector2.
8703                 theName Object name; when specified, this parameter is used
8704                         for result publication in the study. Otherwise, if automatic
8705                         publication is switched on, default value is used for result name.
8706
8707             Returns:
8708                 New GEOM.GEOM_Object, containing compound of all
8709                 the shapes, obtained after each translation.
8710
8711             Example of usage:
8712                 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8713             """
8714             # Example: see GEOM_TestAll.py
8715             theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8716             anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8717                                                  theVector2, theStep2, theNbTimes2)
8718             RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8719             anObj.SetParameters(Parameters)
8720             self._autoPublish(anObj, theName, "multitranslation")
8721             return anObj
8722
8723         ## Rotate the given object around the given axis a given number times.
8724         #  Rotation angle will be 2*PI/theNbTimes.
8725         #  @param theObject The object to be rotated.
8726         #  @param theAxis The rotation axis. DZ if None.
8727         #  @param theNbTimes Quantity of rotations to be done.
8728         #  @param theName Object name; when specified, this parameter is used
8729         #         for result publication in the study. Otherwise, if automatic
8730         #         publication is switched on, default value is used for result name.
8731         #
8732         #  @return New GEOM.GEOM_Object, containing compound of all the
8733         #          shapes, obtained after each rotation.
8734         #
8735         #  @ref tui_multi_rotation "Example"
8736         @ManageTransactions("TrsfOp")
8737         def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8738             """
8739             Rotate the given object around the given axis a given number times.
8740             Rotation angle will be 2*PI/theNbTimes.
8741
8742             Parameters:
8743                 theObject The object to be rotated.
8744                 theAxis The rotation axis. DZ if None.
8745                 theNbTimes Quantity of rotations to be done.
8746                 theName Object name; when specified, this parameter is used
8747                         for result publication in the study. Otherwise, if automatic
8748                         publication is switched on, default value is used for result name.
8749
8750             Returns:
8751                 New GEOM.GEOM_Object, containing compound of all the
8752                 shapes, obtained after each rotation.
8753
8754             Example of usage:
8755                 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8756             """
8757             # Example: see GEOM_TestAll.py
8758             theNbTimes, Parameters = ParseParameters(theNbTimes)
8759             anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8760             RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8761             anObj.SetParameters(Parameters)
8762             self._autoPublish(anObj, theName, "multirotation")
8763             return anObj
8764
8765         ## Rotate the given object around the given axis
8766         #  a given number times on the given angle.
8767         #  @param theObject The object to be rotated.
8768         #  @param theAxis The rotation axis. DZ if None.
8769         #  @param theAngleStep Rotation angle in radians.
8770         #  @param theNbTimes Quantity of rotations to be done.
8771         #  @param theName Object name; when specified, this parameter is used
8772         #         for result publication in the study. Otherwise, if automatic
8773         #         publication is switched on, default value is used for result name.
8774         #
8775         #  @return New GEOM.GEOM_Object, containing compound of all the
8776         #          shapes, obtained after each rotation.
8777         #
8778         #  @ref tui_multi_rotation "Example"
8779         @ManageTransactions("TrsfOp")
8780         def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8781             """
8782             Rotate the given object around the given axis
8783             a given number times on the given angle.
8784
8785             Parameters:
8786                 theObject The object to be rotated.
8787                 theAxis The rotation axis. DZ if None.
8788                 theAngleStep Rotation angle in radians.
8789                 theNbTimes Quantity of rotations to be done.
8790                 theName Object name; when specified, this parameter is used
8791                         for result publication in the study. Otherwise, if automatic
8792                         publication is switched on, default value is used for result name.
8793
8794             Returns:
8795                 New GEOM.GEOM_Object, containing compound of all the
8796                 shapes, obtained after each rotation.
8797
8798             Example of usage:
8799                 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8800             """
8801             # Example: see GEOM_TestAll.py
8802             theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8803             anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8804             RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8805             anObj.SetParameters(Parameters)
8806             self._autoPublish(anObj, theName, "multirotation")
8807             return anObj
8808
8809         ## Rotate the given object around the given axis a given
8810         #  number times and multi-translate each rotation result.
8811         #  Rotation angle will be 2*PI/theNbTimes1.
8812         #  Translation direction passes through center of gravity
8813         #  of rotated shape and its projection on the rotation axis.
8814         #  @param theObject The object to be rotated.
8815         #  @param theAxis Rotation axis. DZ if None.
8816         #  @param theNbTimes1 Quantity of rotations to be done.
8817         #  @param theRadialStep Translation distance.
8818         #  @param theNbTimes2 Quantity of translations to be done.
8819         #  @param theName Object name; when specified, this parameter is used
8820         #         for result publication in the study. Otherwise, if automatic
8821         #         publication is switched on, default value is used for result name.
8822         #
8823         #  @return New GEOM.GEOM_Object, containing compound of all the
8824         #          shapes, obtained after each transformation.
8825         #
8826         #  @ref tui_multi_rotation "Example"
8827         @ManageTransactions("TrsfOp")
8828         def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8829             """
8830             Rotate the given object around the
8831             given axis on the given angle a given number
8832             times and multi-translate each rotation result.
8833             Translation direction passes through center of gravity
8834             of rotated shape and its projection on the rotation axis.
8835
8836             Parameters:
8837                 theObject The object to be rotated.
8838                 theAxis Rotation axis. DZ if None.
8839                 theNbTimes1 Quantity of rotations to be done.
8840                 theRadialStep Translation distance.
8841                 theNbTimes2 Quantity of translations to be done.
8842                 theName Object name; when specified, this parameter is used
8843                         for result publication in the study. Otherwise, if automatic
8844                         publication is switched on, default value is used for result name.
8845
8846             Returns:
8847                 New GEOM.GEOM_Object, containing compound of all the
8848                 shapes, obtained after each transformation.
8849
8850             Example of usage:
8851                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8852             """
8853             # Example: see GEOM_TestAll.py
8854             theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8855             anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8856             RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8857             anObj.SetParameters(Parameters)
8858             self._autoPublish(anObj, theName, "multirotation")
8859             return anObj
8860
8861         ## Rotate the given object around the
8862         #  given axis on the given angle a given number
8863         #  times and multi-translate each rotation result.
8864         #  Translation direction passes through center of gravity
8865         #  of rotated shape and its projection on the rotation axis.
8866         #  @param theObject The object to be rotated.
8867         #  @param theAxis Rotation axis. DZ if None.
8868         #  @param theAngleStep Rotation angle in radians.
8869         #  @param theNbTimes1 Quantity of rotations to be done.
8870         #  @param theRadialStep Translation distance.
8871         #  @param theNbTimes2 Quantity of translations to be done.
8872         #  @param theName Object name; when specified, this parameter is used
8873         #         for result publication in the study. Otherwise, if automatic
8874         #         publication is switched on, default value is used for result name.
8875         #
8876         #  @return New GEOM.GEOM_Object, containing compound of all the
8877         #          shapes, obtained after each transformation.
8878         #
8879         #  @ref tui_multi_rotation "Example"
8880         @ManageTransactions("TrsfOp")
8881         def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8882             """
8883             Rotate the given object around the
8884             given axis on the given angle a given number
8885             times and multi-translate each rotation result.
8886             Translation direction passes through center of gravity
8887             of rotated shape and its projection on the rotation axis.
8888
8889             Parameters:
8890                 theObject The object to be rotated.
8891                 theAxis Rotation axis. DZ if None.
8892                 theAngleStep Rotation angle in radians.
8893                 theNbTimes1 Quantity of rotations to be done.
8894                 theRadialStep Translation distance.
8895                 theNbTimes2 Quantity of translations to be done.
8896                 theName Object name; when specified, this parameter is used
8897                         for result publication in the study. Otherwise, if automatic
8898                         publication is switched on, default value is used for result name.
8899
8900             Returns:
8901                 New GEOM.GEOM_Object, containing compound of all the
8902                 shapes, obtained after each transformation.
8903
8904             Example of usage:
8905                 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8906             """
8907             # Example: see GEOM_TestAll.py
8908             theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8909             anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8910             RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8911             anObj.SetParameters(Parameters)
8912             self._autoPublish(anObj, theName, "multirotation")
8913             return anObj
8914
8915         ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8916         #
8917         #  @ref swig_MakeMultiRotation "Example"
8918         def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8919             """
8920             The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8921
8922             Example of usage:
8923                 pz = geompy.MakeVertex(0, 0, 100)
8924                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8925                 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8926             """
8927             # Example: see GEOM_TestOthers.py
8928             aVec = self.MakeLine(aPoint,aDir)
8929             # note: auto-publishing is done in self.MultiRotate1D()
8930             anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8931             return anObj
8932
8933         ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8934         #
8935         #  @ref swig_MakeMultiRotation "Example"
8936         def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8937             """
8938             The same, as geompy.MultiRotate1D, but axis is given by direction and point
8939
8940             Example of usage:
8941                 pz = geompy.MakeVertex(0, 0, 100)
8942                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8943                 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8944             """
8945             # Example: see GEOM_TestOthers.py
8946             aVec = self.MakeLine(aPoint,aDir)
8947             # note: auto-publishing is done in self.MultiRotate1D()
8948             anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8949             return anObj
8950
8951         ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8952         #
8953         #  @ref swig_MakeMultiRotation "Example"
8954         def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8955             """
8956             The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8957
8958             Example of usage:
8959                 pz = geompy.MakeVertex(0, 0, 100)
8960                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8961                 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8962             """
8963             # Example: see GEOM_TestOthers.py
8964             aVec = self.MakeLine(aPoint,aDir)
8965             # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8966             anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8967             return anObj
8968
8969         ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8970         #
8971         #  @ref swig_MakeMultiRotation "Example"
8972         def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8973             """
8974             The same, as MultiRotate2DByStep(), but axis is given by direction and point
8975
8976             Example of usage:
8977                 pz = geompy.MakeVertex(0, 0, 100)
8978                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8979                 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8980             """
8981             # Example: see GEOM_TestOthers.py
8982             aVec = self.MakeLine(aPoint,aDir)
8983             # note: auto-publishing is done in self.MultiRotate2D()
8984             anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8985             return anObj
8986
8987         # end of l3_transform
8988         ## @}
8989
8990         ## @addtogroup l3_transform_d
8991         ## @{
8992
8993         ## Deprecated method. Use MultiRotate1DNbTimes instead.
8994         def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8995             """
8996             Deprecated method. Use MultiRotate1DNbTimes instead.
8997             """
8998             print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8999             return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9000
9001         ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9002         #  This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9003         @ManageTransactions("TrsfOp")
9004         def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9005             """
9006             The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9007             This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9008
9009             Example of usage:
9010                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9011             """
9012             print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9013             theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9014             anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9015             RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9016             anObj.SetParameters(Parameters)
9017             self._autoPublish(anObj, theName, "multirotation")
9018             return anObj
9019
9020         ## The same, as MultiRotate1D(), but axis is given by direction and point
9021         #  This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9022         def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9023             """
9024             The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9025             This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9026
9027             Example of usage:
9028                 pz = geompy.MakeVertex(0, 0, 100)
9029                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9030                 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9031             """
9032             print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9033             aVec = self.MakeLine(aPoint,aDir)
9034             # note: auto-publishing is done in self.MultiRotate1D()
9035             anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9036             return anObj
9037
9038         ## The same, as MultiRotate2D(), but axis is given by direction and point
9039         #  This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9040         def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9041             """
9042             The same, as MultiRotate2D(), but axis is given by direction and point
9043             This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9044
9045             Example of usage:
9046                 pz = geompy.MakeVertex(0, 0, 100)
9047                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9048                 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9049             """
9050             print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9051             aVec = self.MakeLine(aPoint,aDir)
9052             # note: auto-publishing is done in self.MultiRotate2D()
9053             anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9054             return anObj
9055
9056         # end of l3_transform_d
9057         ## @}
9058
9059         ## @addtogroup l3_local
9060         ## @{
9061
9062         ## Perform a fillet on all edges of the given shape.
9063         #  @param theShape Shape, to perform fillet on.
9064         #  @param theR Fillet radius.
9065         #  @param theName Object name; when specified, this parameter is used
9066         #         for result publication in the study. Otherwise, if automatic
9067         #         publication is switched on, default value is used for result name.
9068         #
9069         #  @return New GEOM.GEOM_Object, containing the result shape.
9070         #
9071         #  @ref tui_fillet "Example 1"
9072         #  \n @ref swig_MakeFilletAll "Example 2"
9073         @ManageTransactions("LocalOp")
9074         def MakeFilletAll(self, theShape, theR, theName=None):
9075             """
9076             Perform a fillet on all edges of the given shape.
9077
9078             Parameters:
9079                 theShape Shape, to perform fillet on.
9080                 theR Fillet radius.
9081                 theName Object name; when specified, this parameter is used
9082                         for result publication in the study. Otherwise, if automatic
9083                         publication is switched on, default value is used for result name.
9084
9085             Returns:
9086                 New GEOM.GEOM_Object, containing the result shape.
9087
9088             Example of usage:
9089                filletall = geompy.MakeFilletAll(prism, 10.)
9090             """
9091             # Example: see GEOM_TestOthers.py
9092             theR,Parameters = ParseParameters(theR)
9093             anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9094             RaiseIfFailed("MakeFilletAll", self.LocalOp)
9095             anObj.SetParameters(Parameters)
9096             self._autoPublish(anObj, theName, "fillet")
9097             return anObj
9098
9099         ## Perform a fillet on the specified edges/faces of the given shape
9100         #  @param theShape Shape, to perform fillet on.
9101         #  @param theR Fillet radius.
9102         #  @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9103         #  @param theListShapes Global indices of edges/faces to perform fillet on.
9104         #  @param theName Object name; when specified, this parameter is used
9105         #         for result publication in the study. Otherwise, if automatic
9106         #         publication is switched on, default value is used for result name.
9107         #
9108         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9109         #
9110         #  @return New GEOM.GEOM_Object, containing the result shape.
9111         #
9112         #  @ref tui_fillet "Example"
9113         @ManageTransactions("LocalOp")
9114         def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9115             """
9116             Perform a fillet on the specified edges/faces of the given shape
9117
9118             Parameters:
9119                 theShape Shape, to perform fillet on.
9120                 theR Fillet radius.
9121                 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9122                 theListShapes Global indices of edges/faces to perform fillet on.
9123                 theName Object name; when specified, this parameter is used
9124                         for result publication in the study. Otherwise, if automatic
9125                         publication is switched on, default value is used for result name.
9126
9127             Note:
9128                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9129
9130             Returns:
9131                 New GEOM.GEOM_Object, containing the result shape.
9132
9133             Example of usage:
9134                 # get the list of IDs (IDList) for the fillet
9135                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9136                 IDlist_e = []
9137                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9138                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9139                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9140                 # make a fillet on the specified edges of the given shape
9141                 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9142             """
9143             # Example: see GEOM_TestAll.py
9144             theR,Parameters = ParseParameters(theR)
9145             anObj = None
9146             if theShapeType == self.ShapeType["EDGE"]:
9147                 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9148                 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9149             else:
9150                 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9151                 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9152             anObj.SetParameters(Parameters)
9153             self._autoPublish(anObj, theName, "fillet")
9154             return anObj
9155
9156         ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9157         @ManageTransactions("LocalOp")
9158         def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9159             """
9160             The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9161
9162             Example of usage:
9163                 # get the list of IDs (IDList) for the fillet
9164                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9165                 IDlist_e = []
9166                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9167                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9168                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9169                 # make a fillet on the specified edges of the given shape
9170                 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9171             """
9172             theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9173             anObj = None
9174             if theShapeType == self.ShapeType["EDGE"]:
9175                 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9176                 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9177             else:
9178                 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9179                 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9180             anObj.SetParameters(Parameters)
9181             self._autoPublish(anObj, theName, "fillet")
9182             return anObj
9183
9184         ## Perform a fillet on the specified edges of the given shape
9185         #  @param theShape  Wire Shape to perform fillet on.
9186         #  @param theR  Fillet radius.
9187         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
9188         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9189         #    \note The list of vertices could be empty,
9190         #          in this case fillet will done done at all vertices in wire
9191         #  @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9192         #         by the length of the edges, nearest to the fillet vertex.
9193         #         But sometimes the next edge is C1 continuous with the one, nearest to
9194         #         the fillet point, and such two (or more) edges can be united to allow
9195         #         bigger radius. Set this flag to TRUE to allow collinear edges union,
9196         #         thus ignoring the secant vertex (vertices).
9197         #  @param theName Object name; when specified, this parameter is used
9198         #         for result publication in the study. Otherwise, if automatic
9199         #         publication is switched on, default value is used for result name.
9200         #
9201         #  @return New GEOM.GEOM_Object, containing the result shape.
9202         #
9203         #  @ref tui_fillet2d "Example"
9204         @ManageTransactions("LocalOp")
9205         def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9206             """
9207             Perform a fillet on the specified edges of the given shape
9208
9209             Parameters:
9210                 theShape  Wire Shape to perform fillet on.
9211                 theR  Fillet radius.
9212                 theListOfVertexes Global indices of vertexes to perform fillet on.
9213                 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9214                     by the length of the edges, nearest to the fillet vertex.
9215                     But sometimes the next edge is C1 continuous with the one, nearest to
9216                     the fillet point, and such two (or more) edges can be united to allow
9217                     bigger radius. Set this flag to TRUE to allow collinear edges union,
9218                     thus ignoring the secant vertex (vertices).
9219                 theName Object name; when specified, this parameter is used
9220                         for result publication in the study. Otherwise, if automatic
9221                         publication is switched on, default value is used for result name.
9222             Note:
9223                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9224
9225                 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9226
9227             Returns:
9228                 New GEOM.GEOM_Object, containing the result shape.
9229
9230             Example of usage:
9231                 # create wire
9232                 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9233                 # make fillet at given wire vertices with giver radius
9234                 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9235             """
9236             # Example: see GEOM_TestAll.py
9237             theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9238             anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9239             RaiseIfFailed("MakeFillet1D", self.LocalOp)
9240             anObj.SetParameters(Parameters)
9241             self._autoPublish(anObj, theName, "fillet")
9242             return anObj
9243
9244         ## Perform a fillet at the specified vertices of the given face/shell.
9245         #  @param theShape Face or Shell shape to perform fillet on.
9246         #  @param theR Fillet radius.
9247         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
9248         #  @param theName Object name; when specified, this parameter is used
9249         #         for result publication in the study. Otherwise, if automatic
9250         #         publication is switched on, default value is used for result name.
9251         #
9252         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9253         #
9254         #  @return New GEOM.GEOM_Object, containing the result shape.
9255         #
9256         #  @ref tui_fillet2d "Example"
9257         @ManageTransactions("LocalOp")
9258         def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9259             """
9260             Perform a fillet at the specified vertices of the given face/shell.
9261
9262             Parameters:
9263                 theShape  Face or Shell shape to perform fillet on.
9264                 theR  Fillet radius.
9265                 theListOfVertexes Global indices of vertexes to perform fillet on.
9266                 theName Object name; when specified, this parameter is used
9267                         for result publication in the study. Otherwise, if automatic
9268                         publication is switched on, default value is used for result name.
9269             Note:
9270                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9271
9272             Returns:
9273                 New GEOM.GEOM_Object, containing the result shape.
9274
9275             Example of usage:
9276                 face = geompy.MakeFaceHW(100, 100, 1)
9277                 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9278             """
9279             # Example: see GEOM_TestAll.py
9280             theR,Parameters = ParseParameters(theR)
9281             anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9282             RaiseIfFailed("MakeFillet2D", self.LocalOp)
9283             anObj.SetParameters(Parameters)
9284             self._autoPublish(anObj, theName, "fillet")
9285             return anObj
9286
9287         ## Perform a symmetric chamfer on all edges of the given shape.
9288         #  @param theShape Shape, to perform chamfer on.
9289         #  @param theD Chamfer size along each face.
9290         #  @param theName Object name; when specified, this parameter is used
9291         #         for result publication in the study. Otherwise, if automatic
9292         #         publication is switched on, default value is used for result name.
9293         #
9294         #  @return New GEOM.GEOM_Object, containing the result shape.
9295         #
9296         #  @ref tui_chamfer "Example 1"
9297         #  \n @ref swig_MakeChamferAll "Example 2"
9298         @ManageTransactions("LocalOp")
9299         def MakeChamferAll(self, theShape, theD, theName=None):
9300             """
9301             Perform a symmetric chamfer on all edges of the given shape.
9302
9303             Parameters:
9304                 theShape Shape, to perform chamfer on.
9305                 theD Chamfer size along each face.
9306                 theName Object name; when specified, this parameter is used
9307                         for result publication in the study. Otherwise, if automatic
9308                         publication is switched on, default value is used for result name.
9309
9310             Returns:
9311                 New GEOM.GEOM_Object, containing the result shape.
9312
9313             Example of usage:
9314                 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9315             """
9316             # Example: see GEOM_TestOthers.py
9317             theD,Parameters = ParseParameters(theD)
9318             anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9319             RaiseIfFailed("MakeChamferAll", self.LocalOp)
9320             anObj.SetParameters(Parameters)
9321             self._autoPublish(anObj, theName, "chamfer")
9322             return anObj
9323
9324         ## Perform a chamfer on edges, common to the specified faces,
9325         #  with distance D1 on the Face1
9326         #  @param theShape Shape, to perform chamfer on.
9327         #  @param theD1 Chamfer size along \a theFace1.
9328         #  @param theD2 Chamfer size along \a theFace2.
9329         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
9330         #  @param theName Object name; when specified, this parameter is used
9331         #         for result publication in the study. Otherwise, if automatic
9332         #         publication is switched on, default value is used for result name.
9333         #
9334         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9335         #
9336         #  @return New GEOM.GEOM_Object, containing the result shape.
9337         #
9338         #  @ref tui_chamfer "Example"
9339         @ManageTransactions("LocalOp")
9340         def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9341             """
9342             Perform a chamfer on edges, common to the specified faces,
9343             with distance D1 on the Face1
9344
9345             Parameters:
9346                 theShape Shape, to perform chamfer on.
9347                 theD1 Chamfer size along theFace1.
9348                 theD2 Chamfer size along theFace2.
9349                 theFace1,theFace2 Global indices of two faces of theShape.
9350                 theName Object name; when specified, this parameter is used
9351                         for result publication in the study. Otherwise, if automatic
9352                         publication is switched on, default value is used for result name.
9353
9354             Note:
9355                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9356
9357             Returns:
9358                 New GEOM.GEOM_Object, containing the result shape.
9359
9360             Example of usage:
9361                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9362                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9363                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9364                 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9365             """
9366             # Example: see GEOM_TestAll.py
9367             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9368             anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9369             RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9370             anObj.SetParameters(Parameters)
9371             self._autoPublish(anObj, theName, "chamfer")
9372             return anObj
9373
9374         ## Perform a chamfer on edges
9375         #  @param theShape Shape, to perform chamfer on.
9376         #  @param theD Chamfer length
9377         #  @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9378         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
9379         #  @param theName Object name; when specified, this parameter is used
9380         #         for result publication in the study. Otherwise, if automatic
9381         #         publication is switched on, default value is used for result name.
9382         #
9383         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9384         #
9385         #  @return New GEOM.GEOM_Object, containing the result shape.
9386         @ManageTransactions("LocalOp")
9387         def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9388             """
9389             Perform a chamfer on edges
9390
9391             Parameters:
9392                 theShape Shape, to perform chamfer on.
9393                 theD1 Chamfer size along theFace1.
9394                 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9395                 theFace1,theFace2 Global indices of two faces of theShape.
9396                 theName Object name; when specified, this parameter is used
9397                         for result publication in the study. Otherwise, if automatic
9398                         publication is switched on, default value is used for result name.
9399
9400             Note:
9401                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9402
9403             Returns:
9404                 New GEOM.GEOM_Object, containing the result shape.
9405
9406             Example of usage:
9407                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9408                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9409                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9410                 ang = 30
9411                 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9412             """
9413             flag = False
9414             if isinstance(theAngle,str):
9415                 flag = True
9416             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9417             if flag:
9418                 theAngle = theAngle*math.pi/180.0
9419             anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9420             RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9421             anObj.SetParameters(Parameters)
9422             self._autoPublish(anObj, theName, "chamfer")
9423             return anObj
9424
9425         ## Perform a chamfer on all edges of the specified faces,
9426         #  with distance D1 on the first specified face (if several for one edge)
9427         #  @param theShape Shape, to perform chamfer on.
9428         #  @param theD1 Chamfer size along face from \a theFaces. If both faces,
9429         #               connected to the edge, are in \a theFaces, \a theD1
9430         #               will be get along face, which is nearer to \a theFaces beginning.
9431         #  @param theD2 Chamfer size along another of two faces, connected to the edge.
9432         #  @param theFaces Sequence of global indices of faces of \a theShape.
9433         #  @param theName Object name; when specified, this parameter is used
9434         #         for result publication in the study. Otherwise, if automatic
9435         #         publication is switched on, default value is used for result name.
9436         #
9437         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9438         #
9439         #  @return New GEOM.GEOM_Object, containing the result shape.
9440         #
9441         #  @ref tui_chamfer "Example"
9442         @ManageTransactions("LocalOp")
9443         def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9444             """
9445             Perform a chamfer on all edges of the specified faces,
9446             with distance D1 on the first specified face (if several for one edge)
9447
9448             Parameters:
9449                 theShape Shape, to perform chamfer on.
9450                 theD1 Chamfer size along face from  theFaces. If both faces,
9451                       connected to the edge, are in theFaces, theD1
9452                       will be get along face, which is nearer to theFaces beginning.
9453                 theD2 Chamfer size along another of two faces, connected to the edge.
9454                 theFaces Sequence of global indices of faces of theShape.
9455                 theName Object name; when specified, this parameter is used
9456                         for result publication in the study. Otherwise, if automatic
9457                         publication is switched on, default value is used for result name.
9458
9459             Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9460
9461             Returns:
9462                 New GEOM.GEOM_Object, containing the result shape.
9463             """
9464             # Example: see GEOM_TestAll.py
9465             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9466             anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9467             RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9468             anObj.SetParameters(Parameters)
9469             self._autoPublish(anObj, theName, "chamfer")
9470             return anObj
9471
9472         ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9473         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9474         #
9475         #  @ref swig_FilletChamfer "Example"
9476         @ManageTransactions("LocalOp")
9477         def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9478             """
9479             The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9480             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9481             """
9482             flag = False
9483             if isinstance(theAngle,str):
9484                 flag = True
9485             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9486             if flag:
9487                 theAngle = theAngle*math.pi/180.0
9488             anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9489             RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9490             anObj.SetParameters(Parameters)
9491             self._autoPublish(anObj, theName, "chamfer")
9492             return anObj
9493
9494         ## Perform a chamfer on edges,
9495         #  with distance D1 on the first specified face (if several for one edge)
9496         #  @param theShape Shape, to perform chamfer on.
9497         #  @param theD1,theD2 Chamfer size
9498         #  @param theEdges Sequence of edges of \a theShape.
9499         #  @param theName Object name; when specified, this parameter is used
9500         #         for result publication in the study. Otherwise, if automatic
9501         #         publication is switched on, default value is used for result name.
9502         #
9503         #  @return New GEOM.GEOM_Object, containing the result shape.
9504         #
9505         #  @ref swig_FilletChamfer "Example"
9506         @ManageTransactions("LocalOp")
9507         def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9508             """
9509             Perform a chamfer on edges,
9510             with distance D1 on the first specified face (if several for one edge)
9511
9512             Parameters:
9513                 theShape Shape, to perform chamfer on.
9514                 theD1,theD2 Chamfer size
9515                 theEdges Sequence of edges of theShape.
9516                 theName Object name; when specified, this parameter is used
9517                         for result publication in the study. Otherwise, if automatic
9518                         publication is switched on, default value is used for result name.
9519
9520             Returns:
9521                 New GEOM.GEOM_Object, containing the result shape.
9522             """
9523             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9524             anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9525             RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9526             anObj.SetParameters(Parameters)
9527             self._autoPublish(anObj, theName, "chamfer")
9528             return anObj
9529
9530         ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9531         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9532         @ManageTransactions("LocalOp")
9533         def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9534             """
9535             The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9536             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9537             """
9538             flag = False
9539             if isinstance(theAngle,str):
9540                 flag = True
9541             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9542             if flag:
9543                 theAngle = theAngle*math.pi/180.0
9544             anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9545             RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9546             anObj.SetParameters(Parameters)
9547             self._autoPublish(anObj, theName, "chamfer")
9548             return anObj
9549
9550         ## @sa MakeChamferEdge(), MakeChamferFaces()
9551         #
9552         #  @ref swig_MakeChamfer "Example"
9553         def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9554             """
9555             See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9556             """
9557             # Example: see GEOM_TestOthers.py
9558             anObj = None
9559             # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9560             if aShapeType == self.ShapeType["EDGE"]:
9561                 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9562             else:
9563                 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9564             return anObj
9565
9566         ## Remove material from a solid by extrusion of the base shape on the given distance.
9567         #  @param theInit Shape to remove material from. It must be a solid or
9568         #  a compound made of a single solid.
9569         #  @param theBase Closed edge or wire defining the base shape to be extruded.
9570         #  @param theH Prism dimension along the normal to theBase
9571         #  @param theAngle Draft angle in degrees.
9572         #  @param theName Object name; when specified, this parameter is used
9573         #         for result publication in the study. Otherwise, if automatic
9574         #         publication is switched on, default value is used for result name.
9575         #
9576         #  @return New GEOM.GEOM_Object, containing the initial shape with removed material
9577         #
9578         #  @ref tui_creation_prism "Example"
9579         @ManageTransactions("PrimOp")
9580         def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9581             """
9582             Add material to a solid by extrusion of the base shape on the given distance.
9583
9584             Parameters:
9585                 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9586                 theBase Closed edge or wire defining the base shape to be extruded.
9587                 theH Prism dimension along the normal  to theBase
9588                 theAngle Draft angle in degrees.
9589                 theName Object name; when specified, this parameter is used
9590                         for result publication in the study. Otherwise, if automatic
9591                         publication is switched on, default value is used for result name.
9592
9593             Returns:
9594                 New GEOM.GEOM_Object,  containing the initial shape with removed material.
9595             """
9596             # Example: see GEOM_TestAll.py
9597             #theH,Parameters = ParseParameters(theH)
9598             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9599             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9600             #anObj.SetParameters(Parameters)
9601             self._autoPublish(anObj, theName, "extrudedCut")
9602             return anObj
9603
9604         ## Add material to a solid by extrusion of the base shape on the given distance.
9605         #  @param theInit Shape to add material to. It must be a solid or
9606         #  a compound made of a single solid.
9607         #  @param theBase Closed edge or wire defining the base shape to be extruded.
9608         #  @param theH Prism dimension along the normal to theBase
9609         #  @param theAngle Draft angle in degrees.
9610         #  @param theName Object name; when specified, this parameter is used
9611         #         for result publication in the study. Otherwise, if automatic
9612         #         publication is switched on, default value is used for result name.
9613         #
9614         #  @return New GEOM.GEOM_Object, containing the initial shape with added material
9615         #
9616         #  @ref tui_creation_prism "Example"
9617         @ManageTransactions("PrimOp")
9618         def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9619             """
9620             Add material to a solid by extrusion of the base shape on the given distance.
9621
9622             Parameters:
9623                 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9624                 theBase Closed edge or wire defining the base shape to be extruded.
9625                 theH Prism dimension along the normal  to theBase
9626                 theAngle Draft angle in degrees.
9627                 theName Object name; when specified, this parameter is used
9628                         for result publication in the study. Otherwise, if automatic
9629                         publication is switched on, default value is used for result name.
9630
9631             Returns:
9632                 New GEOM.GEOM_Object,  containing the initial shape with added material.
9633             """
9634             # Example: see GEOM_TestAll.py
9635             #theH,Parameters = ParseParameters(theH)
9636             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9637             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9638             #anObj.SetParameters(Parameters)
9639             self._autoPublish(anObj, theName, "extrudedBoss")
9640             return anObj
9641
9642         # end of l3_local
9643         ## @}
9644
9645         ## @addtogroup l3_basic_op
9646         ## @{
9647
9648         ## Perform an Archimde operation on the given shape with given parameters.
9649         #  The object presenting the resulting face is returned.
9650         #  @param theShape Shape to be put in water.
9651         #  @param theWeight Weight og the shape.
9652         #  @param theWaterDensity Density of the water.
9653         #  @param theMeshDeflection Deflection of the mesh, using to compute the section.
9654         #  @param theName Object name; when specified, this parameter is used
9655         #         for result publication in the study. Otherwise, if automatic
9656         #         publication is switched on, default value is used for result name.
9657         #
9658         #  @return New GEOM.GEOM_Object, containing a section of \a theShape
9659         #          by a plane, corresponding to water level.
9660         #
9661         #  @ref tui_archimede "Example"
9662         @ManageTransactions("LocalOp")
9663         def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9664             """
9665             Perform an Archimde operation on the given shape with given parameters.
9666             The object presenting the resulting face is returned.
9667
9668             Parameters:
9669                 theShape Shape to be put in water.
9670                 theWeight Weight og the shape.
9671                 theWaterDensity Density of the water.
9672                 theMeshDeflection Deflection of the mesh, using to compute the section.
9673                 theName Object name; when specified, this parameter is used
9674                         for result publication in the study. Otherwise, if automatic
9675                         publication is switched on, default value is used for result name.
9676
9677             Returns:
9678                 New GEOM.GEOM_Object, containing a section of theShape
9679                 by a plane, corresponding to water level.
9680             """
9681             # Example: see GEOM_TestAll.py
9682             theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9683               theWeight,theWaterDensity,theMeshDeflection)
9684             anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9685             RaiseIfFailed("MakeArchimede", self.LocalOp)
9686             anObj.SetParameters(Parameters)
9687             self._autoPublish(anObj, theName, "archimede")
9688             return anObj
9689
9690         # end of l3_basic_op
9691         ## @}
9692
9693         ## @addtogroup l2_measure
9694         ## @{
9695
9696         ## Get point coordinates
9697         #  @return [x, y, z]
9698         #
9699         #  @ref tui_measurement_tools_page "Example"
9700         @ManageTransactions("MeasuOp")
9701         def PointCoordinates(self,Point):
9702             """
9703             Get point coordinates
9704
9705             Returns:
9706                 [x, y, z]
9707             """
9708             # Example: see GEOM_TestMeasures.py
9709             aTuple = self.MeasuOp.PointCoordinates(Point)
9710             RaiseIfFailed("PointCoordinates", self.MeasuOp)
9711             return aTuple
9712
9713         ## Get vector coordinates
9714         #  @return [x, y, z]
9715         #
9716         #  @ref tui_measurement_tools_page "Example"
9717         def VectorCoordinates(self,Vector):
9718             """
9719             Get vector coordinates
9720
9721             Returns:
9722                 [x, y, z]
9723             """
9724
9725             p1=self.GetFirstVertex(Vector)
9726             p2=self.GetLastVertex(Vector)
9727
9728             X1=self.PointCoordinates(p1)
9729             X2=self.PointCoordinates(p2)
9730
9731             return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9732
9733
9734         ## Compute cross product
9735         #  @return vector w=u^v
9736         #
9737         #  @ref tui_measurement_tools_page "Example"
9738         def CrossProduct(self, Vector1, Vector2):
9739             """
9740             Compute cross product
9741
9742             Returns: vector w=u^v
9743             """
9744             u=self.VectorCoordinates(Vector1)
9745             v=self.VectorCoordinates(Vector2)
9746             w=self.MakeVectorDXDYDZ(u[1]*v[2]-u[2]*v[1], u[2]*v[0]-u[0]*v[2], u[0]*v[1]-u[1]*v[0])
9747
9748             return w
9749
9750         ## Compute cross product
9751         #  @return dot product  p=u.v
9752         #
9753         #  @ref tui_measurement_tools_page "Example"
9754         def DotProduct(self, Vector1, Vector2):
9755             """
9756             Compute cross product
9757
9758             Returns: dot product  p=u.v
9759             """
9760             u=self.VectorCoordinates(Vector1)
9761             v=self.VectorCoordinates(Vector2)
9762             p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9763
9764             return p
9765
9766
9767         ## Get summarized length of all wires,
9768         #  area of surface and volume of the given shape.
9769         #  @param theShape Shape to define properties of.
9770         #  @return [theLength, theSurfArea, theVolume]\n
9771         #  theLength:   Summarized length of all wires of the given shape.\n
9772         #  theSurfArea: Area of surface of the given shape.\n
9773         #  theVolume:   Volume of the given shape.
9774         #
9775         #  @ref tui_measurement_tools_page "Example"
9776         @ManageTransactions("MeasuOp")
9777         def BasicProperties(self,theShape):
9778             """
9779             Get summarized length of all wires,
9780             area of surface and volume of the given shape.
9781
9782             Parameters:
9783                 theShape Shape to define properties of.
9784
9785             Returns:
9786                 [theLength, theSurfArea, theVolume]
9787                  theLength:   Summarized length of all wires of the given shape.
9788                  theSurfArea: Area of surface of the given shape.
9789                  theVolume:   Volume of the given shape.
9790             """
9791             # Example: see GEOM_TestMeasures.py
9792             aTuple = self.MeasuOp.GetBasicProperties(theShape)
9793             RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9794             return aTuple
9795
9796         ## Get parameters of bounding box of the given shape
9797         #  @param theShape Shape to obtain bounding box of.
9798         #  @param precise TRUE for precise computation; FALSE for fast one.
9799         #  @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9800         #  Xmin,Xmax: Limits of shape along OX axis.
9801         #  Ymin,Ymax: Limits of shape along OY axis.
9802         #  Zmin,Zmax: Limits of shape along OZ axis.
9803         #
9804         #  @ref tui_measurement_tools_page "Example"
9805         @ManageTransactions("MeasuOp")
9806         def BoundingBox (self, theShape, precise=False):
9807             """
9808             Get parameters of bounding box of the given shape
9809
9810             Parameters:
9811                 theShape Shape to obtain bounding box of.
9812                 precise TRUE for precise computation; FALSE for fast one.
9813
9814             Returns:
9815                 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9816                  Xmin,Xmax: Limits of shape along OX axis.
9817                  Ymin,Ymax: Limits of shape along OY axis.
9818                  Zmin,Zmax: Limits of shape along OZ axis.
9819             """
9820             # Example: see GEOM_TestMeasures.py
9821             aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9822             RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9823             return aTuple
9824
9825         ## Get bounding box of the given shape
9826         #  @param theShape Shape to obtain bounding box of.
9827         #  @param precise TRUE for precise computation; FALSE for fast one.
9828         #  @param theName Object name; when specified, this parameter is used
9829         #         for result publication in the study. Otherwise, if automatic
9830         #         publication is switched on, default value is used for result name.
9831         #
9832         #  @return New GEOM.GEOM_Object, containing the created box.
9833         #
9834         #  @ref tui_measurement_tools_page "Example"
9835         @ManageTransactions("MeasuOp")
9836         def MakeBoundingBox (self, theShape, precise=False, theName=None):
9837             """
9838             Get bounding box of the given shape
9839
9840             Parameters:
9841                 theShape Shape to obtain bounding box of.
9842                 precise TRUE for precise computation; FALSE for fast one.
9843                 theName Object name; when specified, this parameter is used
9844                         for result publication in the study. Otherwise, if automatic
9845                         publication is switched on, default value is used for result name.
9846
9847             Returns:
9848                 New GEOM.GEOM_Object, containing the created box.
9849             """
9850             # Example: see GEOM_TestMeasures.py
9851             anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9852             RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9853             self._autoPublish(anObj, theName, "bndbox")
9854             return anObj
9855
9856         ## Get inertia matrix and moments of inertia of theShape.
9857         #  @param theShape Shape to calculate inertia of.
9858         #  @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9859         #  I(1-3)(1-3): Components of the inertia matrix of the given shape.
9860         #  Ix,Iy,Iz:    Moments of inertia of the given shape.
9861         #
9862         #  @ref tui_measurement_tools_page "Example"
9863         @ManageTransactions("MeasuOp")
9864         def Inertia(self,theShape):
9865             """
9866             Get inertia matrix and moments of inertia of theShape.
9867
9868             Parameters:
9869                 theShape Shape to calculate inertia of.
9870
9871             Returns:
9872                 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9873                  I(1-3)(1-3): Components of the inertia matrix of the given shape.
9874                  Ix,Iy,Iz:    Moments of inertia of the given shape.
9875             """
9876             # Example: see GEOM_TestMeasures.py
9877             aTuple = self.MeasuOp.GetInertia(theShape)
9878             RaiseIfFailed("GetInertia", self.MeasuOp)
9879             return aTuple
9880
9881         ## Get if coords are included in the shape (ST_IN or ST_ON)
9882         #  @param theShape Shape
9883         #  @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9884         #  @param tolerance to be used (default is 1.0e-7)
9885         #  @return list_of_boolean = [res1, res2, ...]
9886         @ManageTransactions("MeasuOp")
9887         def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9888             """
9889             Get if coords are included in the shape (ST_IN or ST_ON)
9890
9891             Parameters:
9892                 theShape Shape
9893                 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9894                 tolerance to be used (default is 1.0e-7)
9895
9896             Returns:
9897                 list_of_boolean = [res1, res2, ...]
9898             """
9899             return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9900
9901         ## Get minimal distance between the given shapes.
9902         #  @param theShape1,theShape2 Shapes to find minimal distance between.
9903         #  @return Value of the minimal distance between the given shapes.
9904         #
9905         #  @ref tui_measurement_tools_page "Example"
9906         @ManageTransactions("MeasuOp")
9907         def MinDistance(self, theShape1, theShape2):
9908             """
9909             Get minimal distance between the given shapes.
9910
9911             Parameters:
9912                 theShape1,theShape2 Shapes to find minimal distance between.
9913
9914             Returns:
9915                 Value of the minimal distance between the given shapes.
9916             """
9917             # Example: see GEOM_TestMeasures.py
9918             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9919             RaiseIfFailed("GetMinDistance", self.MeasuOp)
9920             return aTuple[0]
9921
9922         ## Get minimal distance between the given shapes.
9923         #  @param theShape1,theShape2 Shapes to find minimal distance between.
9924         #  @return Value of the minimal distance between the given shapes, in form of list
9925         #          [Distance, DX, DY, DZ].
9926         #
9927         #  @ref swig_all_measure "Example"
9928         @ManageTransactions("MeasuOp")
9929         def MinDistanceComponents(self, theShape1, theShape2):
9930             """
9931             Get minimal distance between the given shapes.
9932
9933             Parameters:
9934                 theShape1,theShape2 Shapes to find minimal distance between.
9935
9936             Returns:
9937                 Value of the minimal distance between the given shapes, in form of list
9938                 [Distance, DX, DY, DZ]
9939             """
9940             # Example: see GEOM_TestMeasures.py
9941             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9942             RaiseIfFailed("GetMinDistance", self.MeasuOp)
9943             aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9944             return aRes
9945
9946         ## Get closest points of the given shapes.
9947         #  @param theShape1,theShape2 Shapes to find closest points of.
9948         #  @return The number of found solutions (-1 in case of infinite number of
9949         #          solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9950         #
9951         #  @ref tui_measurement_tools_page "Example"
9952         @ManageTransactions("MeasuOp")
9953         def ClosestPoints (self, theShape1, theShape2):
9954             """
9955             Get closest points of the given shapes.
9956
9957             Parameters:
9958                 theShape1,theShape2 Shapes to find closest points of.
9959
9960             Returns:
9961                 The number of found solutions (-1 in case of infinite number of
9962                 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9963             """
9964             # Example: see GEOM_TestMeasures.py
9965             aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9966             RaiseIfFailed("ClosestPoints", self.MeasuOp)
9967             return aTuple
9968
9969         ## Get angle between the given shapes in degrees.
9970         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
9971         #  @note If both arguments are vectors, the angle is computed in accordance
9972         #        with their orientations, otherwise the minimum angle is computed.
9973         #  @return Value of the angle between the given shapes in degrees.
9974         #
9975         #  @ref tui_measurement_tools_page "Example"
9976         @ManageTransactions("MeasuOp")
9977         def GetAngle(self, theShape1, theShape2):
9978             """
9979             Get angle between the given shapes in degrees.
9980
9981             Parameters:
9982                 theShape1,theShape2 Lines or linear edges to find angle between.
9983
9984             Note:
9985                 If both arguments are vectors, the angle is computed in accordance
9986                 with their orientations, otherwise the minimum angle is computed.
9987
9988             Returns:
9989                 Value of the angle between the given shapes in degrees.
9990             """
9991             # Example: see GEOM_TestMeasures.py
9992             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9993             RaiseIfFailed("GetAngle", self.MeasuOp)
9994             return anAngle
9995
9996         ## Get angle between the given shapes in radians.
9997         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
9998         #  @note If both arguments are vectors, the angle is computed in accordance
9999         #        with their orientations, otherwise the minimum angle is computed.
10000         #  @return Value of the angle between the given shapes in radians.
10001         #
10002         #  @ref tui_measurement_tools_page "Example"
10003         @ManageTransactions("MeasuOp")
10004         def GetAngleRadians(self, theShape1, theShape2):
10005             """
10006             Get angle between the given shapes in radians.
10007
10008             Parameters:
10009                 theShape1,theShape2 Lines or linear edges to find angle between.
10010
10011
10012             Note:
10013                 If both arguments are vectors, the angle is computed in accordance
10014                 with their orientations, otherwise the minimum angle is computed.
10015
10016             Returns:
10017                 Value of the angle between the given shapes in radians.
10018             """
10019             # Example: see GEOM_TestMeasures.py
10020             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10021             RaiseIfFailed("GetAngle", self.MeasuOp)
10022             return anAngle
10023
10024         ## Get angle between the given vectors in degrees.
10025         #  @param theShape1,theShape2 Vectors to find angle between.
10026         #  @param theFlag If True, the normal vector is defined by the two vectors cross,
10027         #                 if False, the opposite vector to the normal vector is used.
10028         #  @return Value of the angle between the given vectors in degrees.
10029         #
10030         #  @ref tui_measurement_tools_page "Example"
10031         @ManageTransactions("MeasuOp")
10032         def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10033             """
10034             Get angle between the given vectors in degrees.
10035
10036             Parameters:
10037                 theShape1,theShape2 Vectors to find angle between.
10038                 theFlag If True, the normal vector is defined by the two vectors cross,
10039                         if False, the opposite vector to the normal vector is used.
10040
10041             Returns:
10042                 Value of the angle between the given vectors in degrees.
10043             """
10044             anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10045             if not theFlag:
10046                 anAngle = 360. - anAngle
10047             RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10048             return anAngle
10049
10050         ## The same as GetAngleVectors, but the result is in radians.
10051         def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10052             """
10053             Get angle between the given vectors in radians.
10054
10055             Parameters:
10056                 theShape1,theShape2 Vectors to find angle between.
10057                 theFlag If True, the normal vector is defined by the two vectors cross,
10058                         if False, the opposite vector to the normal vector is used.
10059
10060             Returns:
10061                 Value of the angle between the given vectors in radians.
10062             """
10063             anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10064             return anAngle
10065
10066         ## @name Curve Curvature Measurement
10067         #  Methods for receiving radius of curvature of curves
10068         #  in the given point
10069         ## @{
10070
10071         ## Measure curvature of a curve at a point, set by parameter.
10072         #  @param theCurve a curve.
10073         #  @param theParam parameter.
10074         #  @return radius of curvature of \a theCurve.
10075         #
10076         #  @ref swig_todo "Example"
10077         @ManageTransactions("MeasuOp")
10078         def CurveCurvatureByParam(self, theCurve, theParam):
10079             """
10080             Measure curvature of a curve at a point, set by parameter.
10081
10082             Parameters:
10083                 theCurve a curve.
10084                 theParam parameter.
10085
10086             Returns:
10087                 radius of curvature of theCurve.
10088             """
10089             # Example: see GEOM_TestMeasures.py
10090             aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10091             RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10092             return aCurv
10093
10094         ## Measure curvature of a curve at a point.
10095         #  @param theCurve a curve.
10096         #  @param thePoint given point.
10097         #  @return radius of curvature of \a theCurve.
10098         #
10099         #  @ref swig_todo "Example"
10100         @ManageTransactions("MeasuOp")
10101         def CurveCurvatureByPoint(self, theCurve, thePoint):
10102             """
10103             Measure curvature of a curve at a point.
10104
10105             Parameters:
10106                 theCurve a curve.
10107                 thePoint given point.
10108
10109             Returns:
10110                 radius of curvature of theCurve.
10111             """
10112             aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10113             RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10114             return aCurv
10115         ## @}
10116
10117         ## @name Surface Curvature Measurement
10118         #  Methods for receiving max and min radius of curvature of surfaces
10119         #  in the given point
10120         ## @{
10121
10122         ## Measure max radius of curvature of surface.
10123         #  @param theSurf the given surface.
10124         #  @param theUParam Value of U-parameter on the referenced surface.
10125         #  @param theVParam Value of V-parameter on the referenced surface.
10126         #  @return max radius of curvature of theSurf.
10127         #
10128         ## @ref swig_todo "Example"
10129         @ManageTransactions("MeasuOp")
10130         def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10131             """
10132             Measure max radius of curvature of surface.
10133
10134             Parameters:
10135                 theSurf the given surface.
10136                 theUParam Value of U-parameter on the referenced surface.
10137                 theVParam Value of V-parameter on the referenced surface.
10138
10139             Returns:
10140                 max radius of curvature of theSurf.
10141             """
10142             # Example: see GEOM_TestMeasures.py
10143             aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10144             RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10145             return aSurf
10146
10147         ## Measure max radius of curvature of surface in the given point
10148         #  @param theSurf the given surface.
10149         #  @param thePoint given point.
10150         #  @return max radius of curvature of theSurf.
10151         #
10152         ## @ref swig_todo "Example"
10153         @ManageTransactions("MeasuOp")
10154         def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10155             """
10156             Measure max radius of curvature of surface in the given point.
10157
10158             Parameters:
10159                 theSurf the given surface.
10160                 thePoint given point.
10161
10162             Returns:
10163                 max radius of curvature of theSurf.
10164             """
10165             aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10166             RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10167             return aSurf
10168
10169         ## Measure min radius of curvature of surface.
10170         #  @param theSurf the given surface.
10171         #  @param theUParam Value of U-parameter on the referenced surface.
10172         #  @param theVParam Value of V-parameter on the referenced surface.
10173         #  @return min radius of curvature of theSurf.
10174         #
10175         ## @ref swig_todo "Example"
10176         @ManageTransactions("MeasuOp")
10177         def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10178             """
10179             Measure min radius of curvature of surface.
10180
10181             Parameters:
10182                 theSurf the given surface.
10183                 theUParam Value of U-parameter on the referenced surface.
10184                 theVParam Value of V-parameter on the referenced surface.
10185
10186             Returns:
10187                 Min radius of curvature of theSurf.
10188             """
10189             aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10190             RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10191             return aSurf
10192
10193         ## Measure min radius of curvature of surface in the given point
10194         #  @param theSurf the given surface.
10195         #  @param thePoint given point.
10196         #  @return min radius of curvature of theSurf.
10197         #
10198         ## @ref swig_todo "Example"
10199         @ManageTransactions("MeasuOp")
10200         def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10201             """
10202             Measure min radius of curvature of surface in the given point.
10203
10204             Parameters:
10205                 theSurf the given surface.
10206                 thePoint given point.
10207
10208             Returns:
10209                 Min radius of curvature of theSurf.
10210             """
10211             aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10212             RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10213             return aSurf
10214         ## @}
10215
10216         ## Get min and max tolerances of sub-shapes of theShape
10217         #  @param theShape Shape, to get tolerances of.
10218         #  @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10219         #  FaceMin,FaceMax: Min and max tolerances of the faces.\n
10220         #  EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10221         #  VertMin,VertMax: Min and max tolerances of the vertices.
10222         #
10223         #  @ref tui_measurement_tools_page "Example"
10224         @ManageTransactions("MeasuOp")
10225         def Tolerance(self,theShape):
10226             """
10227             Get min and max tolerances of sub-shapes of theShape
10228
10229             Parameters:
10230                 theShape Shape, to get tolerances of.
10231
10232             Returns:
10233                 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10234                  FaceMin,FaceMax: Min and max tolerances of the faces.
10235                  EdgeMin,EdgeMax: Min and max tolerances of the edges.
10236                  VertMin,VertMax: Min and max tolerances of the vertices.
10237             """
10238             # Example: see GEOM_TestMeasures.py
10239             aTuple = self.MeasuOp.GetTolerance(theShape)
10240             RaiseIfFailed("GetTolerance", self.MeasuOp)
10241             return aTuple
10242
10243         ## Obtain description of the given shape (number of sub-shapes of each type)
10244         #  @param theShape Shape to be described.
10245         #  @return Description of the given shape.
10246         #
10247         #  @ref tui_measurement_tools_page "Example"
10248         @ManageTransactions("MeasuOp")
10249         def WhatIs(self,theShape):
10250             """
10251             Obtain description of the given shape (number of sub-shapes of each type)
10252
10253             Parameters:
10254                 theShape Shape to be described.
10255
10256             Returns:
10257                 Description of the given shape.
10258             """
10259             # Example: see GEOM_TestMeasures.py
10260             aDescr = self.MeasuOp.WhatIs(theShape)
10261             RaiseIfFailed("WhatIs", self.MeasuOp)
10262             return aDescr
10263
10264         ## Obtain quantity of shapes of the given type in \a theShape.
10265         #  If \a theShape is of type \a theType, it is also counted.
10266         #  @param theShape Shape to be described.
10267         #  @param theType the given ShapeType().
10268         #  @return Quantity of shapes of type \a theType in \a theShape.
10269         #
10270         #  @ref tui_measurement_tools_page "Example"
10271         def NbShapes (self, theShape, theType):
10272             """
10273             Obtain quantity of shapes of the given type in theShape.
10274             If theShape is of type theType, it is also counted.
10275
10276             Parameters:
10277                 theShape Shape to be described.
10278                 theType the given geompy.ShapeType
10279
10280             Returns:
10281                 Quantity of shapes of type theType in theShape.
10282             """
10283             # Example: see GEOM_TestMeasures.py
10284             listSh = self.SubShapeAllIDs(theShape, theType)
10285             Nb = len(listSh)
10286             return Nb
10287
10288         ## Obtain quantity of shapes of each type in \a theShape.
10289         #  The \a theShape is also counted.
10290         #  @param theShape Shape to be described.
10291         #  @return Dictionary of ShapeType() with bound quantities of shapes.
10292         #
10293         #  @ref tui_measurement_tools_page "Example"
10294         def ShapeInfo (self, theShape):
10295             """
10296             Obtain quantity of shapes of each type in theShape.
10297             The theShape is also counted.
10298
10299             Parameters:
10300                 theShape Shape to be described.
10301
10302             Returns:
10303                 Dictionary of geompy.ShapeType with bound quantities of shapes.
10304             """
10305             # Example: see GEOM_TestMeasures.py
10306             aDict = {}
10307             for typeSh in self.ShapeType:
10308                 if typeSh in ( "AUTO", "SHAPE" ): continue
10309                 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10310                 Nb = len(listSh)
10311                 aDict[typeSh] = Nb
10312                 pass
10313             return aDict
10314
10315         def GetCreationInformation(self, theShape):
10316             info = theShape.GetCreationInformation()
10317             # operationName
10318             opName = info.operationName
10319             if not opName: opName = "no info available"
10320             res = "Operation: " + opName
10321             # parameters
10322             for parVal in info.params:
10323                 res += " \n %s = %s" % ( parVal.name, parVal.value )
10324             return res
10325
10326         ## Get a point, situated at the centre of mass of theShape.
10327         #  @param theShape Shape to define centre of mass of.
10328         #  @param theName Object name; when specified, this parameter is used
10329         #         for result publication in the study. Otherwise, if automatic
10330         #         publication is switched on, default value is used for result name.
10331         #
10332         #  @return New GEOM.GEOM_Object, containing the created point.
10333         #
10334         #  @ref tui_measurement_tools_page "Example"
10335         @ManageTransactions("MeasuOp")
10336         def MakeCDG(self, theShape, theName=None):
10337             """
10338             Get a point, situated at the centre of mass of theShape.
10339
10340             Parameters:
10341                 theShape Shape to define centre of mass of.
10342                 theName Object name; when specified, this parameter is used
10343                         for result publication in the study. Otherwise, if automatic
10344                         publication is switched on, default value is used for result name.
10345
10346             Returns:
10347                 New GEOM.GEOM_Object, containing the created point.
10348             """
10349             # Example: see GEOM_TestMeasures.py
10350             anObj = self.MeasuOp.GetCentreOfMass(theShape)
10351             RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10352             self._autoPublish(anObj, theName, "centerOfMass")
10353             return anObj
10354
10355         ## Get a vertex sub-shape by index depended with orientation.
10356         #  @param theShape Shape to find sub-shape.
10357         #  @param theIndex Index to find vertex by this index (starting from zero)
10358         #  @param theName Object name; when specified, this parameter is used
10359         #         for result publication in the study. Otherwise, if automatic
10360         #         publication is switched on, default value is used for result name.
10361         #
10362         #  @return New GEOM.GEOM_Object, containing the created vertex.
10363         #
10364         #  @ref tui_measurement_tools_page "Example"
10365         @ManageTransactions("MeasuOp")
10366         def GetVertexByIndex(self, theShape, theIndex, theName=None):
10367             """
10368             Get a vertex sub-shape by index depended with orientation.
10369
10370             Parameters:
10371                 theShape Shape to find sub-shape.
10372                 theIndex Index to find vertex by this index (starting from zero)
10373                 theName Object name; when specified, this parameter is used
10374                         for result publication in the study. Otherwise, if automatic
10375                         publication is switched on, default value is used for result name.
10376
10377             Returns:
10378                 New GEOM.GEOM_Object, containing the created vertex.
10379             """
10380             # Example: see GEOM_TestMeasures.py
10381             anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10382             RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10383             self._autoPublish(anObj, theName, "vertex")
10384             return anObj
10385
10386         ## Get the first vertex of wire/edge depended orientation.
10387         #  @param theShape Shape to find first vertex.
10388         #  @param theName Object name; when specified, this parameter is used
10389         #         for result publication in the study. Otherwise, if automatic
10390         #         publication is switched on, default value is used for result name.
10391         #
10392         #  @return New GEOM.GEOM_Object, containing the created vertex.
10393         #
10394         #  @ref tui_measurement_tools_page "Example"
10395         def GetFirstVertex(self, theShape, theName=None):
10396             """
10397             Get the first vertex of wire/edge depended orientation.
10398
10399             Parameters:
10400                 theShape Shape to find first vertex.
10401                 theName Object name; when specified, this parameter is used
10402                         for result publication in the study. Otherwise, if automatic
10403                         publication is switched on, default value is used for result name.
10404
10405             Returns:
10406                 New GEOM.GEOM_Object, containing the created vertex.
10407             """
10408             # Example: see GEOM_TestMeasures.py
10409             # note: auto-publishing is done in self.GetVertexByIndex()
10410             return self.GetVertexByIndex(theShape, 0, theName)
10411
10412         ## Get the last vertex of wire/edge depended orientation.
10413         #  @param theShape Shape to find last vertex.
10414         #  @param theName Object name; when specified, this parameter is used
10415         #         for result publication in the study. Otherwise, if automatic
10416         #         publication is switched on, default value is used for result name.
10417         #
10418         #  @return New GEOM.GEOM_Object, containing the created vertex.
10419         #
10420         #  @ref tui_measurement_tools_page "Example"
10421         def GetLastVertex(self, theShape, theName=None):
10422             """
10423             Get the last vertex of wire/edge depended orientation.
10424
10425             Parameters:
10426                 theShape Shape to find last vertex.
10427                 theName Object name; when specified, this parameter is used
10428                         for result publication in the study. Otherwise, if automatic
10429                         publication is switched on, default value is used for result name.
10430
10431             Returns:
10432                 New GEOM.GEOM_Object, containing the created vertex.
10433             """
10434             # Example: see GEOM_TestMeasures.py
10435             nb_vert =  self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10436             # note: auto-publishing is done in self.GetVertexByIndex()
10437             return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10438
10439         ## Get a normale to the given face. If the point is not given,
10440         #  the normale is calculated at the center of mass.
10441         #  @param theFace Face to define normale of.
10442         #  @param theOptionalPoint Point to compute the normale at.
10443         #  @param theName Object name; when specified, this parameter is used
10444         #         for result publication in the study. Otherwise, if automatic
10445         #         publication is switched on, default value is used for result name.
10446         #
10447         #  @return New GEOM.GEOM_Object, containing the created vector.
10448         #
10449         #  @ref swig_todo "Example"
10450         @ManageTransactions("MeasuOp")
10451         def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10452             """
10453             Get a normale to the given face. If the point is not given,
10454             the normale is calculated at the center of mass.
10455
10456             Parameters:
10457                 theFace Face to define normale of.
10458                 theOptionalPoint Point to compute the normale at.
10459                 theName Object name; when specified, this parameter is used
10460                         for result publication in the study. Otherwise, if automatic
10461                         publication is switched on, default value is used for result name.
10462
10463             Returns:
10464                 New GEOM.GEOM_Object, containing the created vector.
10465             """
10466             # Example: see GEOM_TestMeasures.py
10467             anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10468             RaiseIfFailed("GetNormal", self.MeasuOp)
10469             self._autoPublish(anObj, theName, "normal")
10470             return anObj
10471
10472         ## Print shape errors obtained from CheckShape.
10473         #  @param theShape Shape that was checked.
10474         #  @param theShapeErrors the shape errors obtained by CheckShape.
10475         #  @param theReturnStatus If 0 the description of problem is printed.
10476         #                         If 1 the description of problem is returned.
10477         #  @return If theReturnStatus is equal to 1 the description is returned.
10478         #          Otherwise doesn't return anything.
10479         #
10480         #  @ref tui_measurement_tools_page "Example"
10481         @ManageTransactions("MeasuOp")
10482         def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10483             """
10484             Print shape errors obtained from CheckShape.
10485
10486             Parameters:
10487                 theShape Shape that was checked.
10488                 theShapeErrors the shape errors obtained by CheckShape.
10489                 theReturnStatus If 0 the description of problem is printed.
10490                                 If 1 the description of problem is returned.
10491
10492             Returns:
10493                 If theReturnStatus is equal to 1 the description is returned.
10494                   Otherwise doesn't return anything.
10495             """
10496             # Example: see GEOM_TestMeasures.py
10497             Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10498             if theReturnStatus == 1:
10499                 return Descr
10500             print Descr
10501             pass
10502
10503         ## Check a topology of the given shape.
10504         #  @param theShape Shape to check validity of.
10505         #  @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10506         #                        if TRUE, the shape's geometry will be checked also.
10507         #  @param theReturnStatus If 0 and if theShape is invalid, a description
10508         #                         of problem is printed.
10509         #                         If 1 isValid flag and the description of
10510         #                         problem is returned.
10511         #                         If 2 isValid flag and the list of error data
10512         #                         is returned.
10513         #  @return TRUE, if the shape "seems to be valid".
10514         #          If theShape is invalid, prints a description of problem.
10515         #          If theReturnStatus is equal to 1 the description is returned
10516         #          along with IsValid flag.
10517         #          If theReturnStatus is equal to 2 the list of error data is
10518         #          returned along with IsValid flag.
10519         #
10520         #  @ref tui_measurement_tools_page "Example"
10521         @ManageTransactions("MeasuOp")
10522         def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10523             """
10524             Check a topology of the given shape.
10525
10526             Parameters:
10527                 theShape Shape to check validity of.
10528                 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10529                                if TRUE, the shape's geometry will be checked also.
10530                 theReturnStatus If 0 and if theShape is invalid, a description
10531                                 of problem is printed.
10532                                 If 1 IsValid flag and the description of
10533                                 problem is returned.
10534                                 If 2 IsValid flag and the list of error data
10535                                 is returned.
10536
10537             Returns:
10538                 TRUE, if the shape "seems to be valid".
10539                 If theShape is invalid, prints a description of problem.
10540                 If theReturnStatus is equal to 1 the description is returned
10541                 along with IsValid flag.
10542                 If theReturnStatus is equal to 2 the list of error data is
10543                 returned along with IsValid flag.
10544             """
10545             # Example: see GEOM_TestMeasures.py
10546             if theIsCheckGeom:
10547                 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10548                 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10549             else:
10550                 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10551                 RaiseIfFailed("CheckShape", self.MeasuOp)
10552             if IsValid == 0:
10553                 if theReturnStatus == 0:
10554                     Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10555                     print Descr
10556             if theReturnStatus == 1:
10557               Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10558               return (IsValid, Descr)
10559             elif theReturnStatus == 2:
10560               return (IsValid, ShapeErrors)
10561             return IsValid
10562
10563         ## Detect self-intersections in the given shape.
10564         #  @param theShape Shape to check.
10565         #  @return TRUE, if the shape contains no self-intersections.
10566         #
10567         #  @ref tui_measurement_tools_page "Example"
10568         @ManageTransactions("MeasuOp")
10569         def CheckSelfIntersections(self, theShape):
10570             """
10571             Detect self-intersections in the given shape.
10572
10573             Parameters:
10574                 theShape Shape to check.
10575
10576             Returns:
10577                 TRUE, if the shape contains no self-intersections.
10578             """
10579             # Example: see GEOM_TestMeasures.py
10580             (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10581             RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10582             return IsValid
10583
10584         ## Get position (LCS) of theShape.
10585         #
10586         #  Origin of the LCS is situated at the shape's center of mass.
10587         #  Axes of the LCS are obtained from shape's location or,
10588         #  if the shape is a planar face, from position of its plane.
10589         #
10590         #  @param theShape Shape to calculate position of.
10591         #  @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10592         #          Ox,Oy,Oz: Coordinates of shape's LCS origin.
10593         #          Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10594         #          Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10595         #
10596         #  @ref swig_todo "Example"
10597         @ManageTransactions("MeasuOp")
10598         def GetPosition(self,theShape):
10599             """
10600             Get position (LCS) of theShape.
10601             Origin of the LCS is situated at the shape's center of mass.
10602             Axes of the LCS are obtained from shape's location or,
10603             if the shape is a planar face, from position of its plane.
10604
10605             Parameters:
10606                 theShape Shape to calculate position of.
10607
10608             Returns:
10609                 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10610                  Ox,Oy,Oz: Coordinates of shape's LCS origin.
10611                  Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10612                  Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10613             """
10614             # Example: see GEOM_TestMeasures.py
10615             aTuple = self.MeasuOp.GetPosition(theShape)
10616             RaiseIfFailed("GetPosition", self.MeasuOp)
10617             return aTuple
10618
10619         ## Get kind of theShape.
10620         #
10621         #  @param theShape Shape to get a kind of.
10622         #  @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10623         #          and a list of parameters, describing the shape.
10624         #  @note  Concrete meaning of each value, returned via \a theIntegers
10625         #         or \a theDoubles list depends on the kind() of the shape.
10626         #
10627         #  @ref swig_todo "Example"
10628         @ManageTransactions("MeasuOp")
10629         def KindOfShape(self,theShape):
10630             """
10631             Get kind of theShape.
10632
10633             Parameters:
10634                 theShape Shape to get a kind of.
10635
10636             Returns:
10637                 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10638                     and a list of parameters, describing the shape.
10639             Note:
10640                 Concrete meaning of each value, returned via theIntegers
10641                 or theDoubles list depends on the geompy.kind of the shape
10642             """
10643             # Example: see GEOM_TestMeasures.py
10644             aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10645             RaiseIfFailed("KindOfShape", self.MeasuOp)
10646
10647             aKind  = aRoughTuple[0]
10648             anInts = aRoughTuple[1]
10649             aDbls  = aRoughTuple[2]
10650
10651             # Now there is no exception from this rule:
10652             aKindTuple = [aKind] + aDbls + anInts
10653
10654             # If they are we will regroup parameters for such kind of shape.
10655             # For example:
10656             #if aKind == kind.SOME_KIND:
10657             #    #  SOME_KIND     int int double int double double
10658             #    aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10659
10660             return aKindTuple
10661
10662         ## Returns the string that describes if the shell is good for solid.
10663         #  This is a support method for MakeSolid.
10664         #
10665         #  @param theShell the shell to be checked.
10666         #  @return Returns a string that describes the shell validity for
10667         #          solid construction.
10668         @ManageTransactions("MeasuOp")
10669         def _IsGoodForSolid(self, theShell):
10670             """
10671             Returns the string that describes if the shell is good for solid.
10672             This is a support method for MakeSolid.
10673
10674             Parameter:
10675                 theShell the shell to be checked.
10676
10677             Returns:
10678                 Returns a string that describes the shell validity for
10679                 solid construction.
10680             """
10681             aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10682             return aDescr
10683
10684         # end of l2_measure
10685         ## @}
10686
10687         ## @addtogroup l2_import_export
10688         ## @{
10689
10690         ## Import a shape from the BREP, IGES, STEP or other file
10691         #  (depends on given format) with given name.
10692         #
10693         #  Note: this function is deprecated, it is kept for backward compatibility only
10694         #  Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10695         #
10696         #  @param theFileName The file, containing the shape.
10697         #  @param theFormatName Specify format for the file reading.
10698         #         Available formats can be obtained with InsertOp.ImportTranslators() method.
10699         #         If format 'IGES_SCALE' is used instead of 'IGES' or
10700         #            format 'STEP_SCALE' is used instead of 'STEP',
10701         #            length unit will be set to 'meter' and result model will be scaled.
10702         #  @param theName Object name; when specified, this parameter is used
10703         #         for result publication in the study. Otherwise, if automatic
10704         #         publication is switched on, default value is used for result name.
10705         #
10706         #  @return New GEOM.GEOM_Object, containing the imported shape.
10707         #          If material names are imported it returns the list of
10708         #          objects. The first one is the imported object followed by
10709         #          material groups.
10710         #  @note Auto publishing is allowed for the shape itself. Imported
10711         #        material groups are not automatically published.
10712         #
10713         #  @ref swig_Import_Export "Example"
10714         @ManageTransactions("InsertOp")
10715         def ImportFile(self, theFileName, theFormatName, theName=None):
10716             """
10717             Import a shape from the BREP, IGES, STEP or other file
10718             (depends on given format) with given name.
10719
10720             Note: this function is deprecated, it is kept for backward compatibility only
10721             Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10722
10723             Parameters: 
10724                 theFileName The file, containing the shape.
10725                 theFormatName Specify format for the file reading.
10726                     Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10727                     If format 'IGES_SCALE' is used instead of 'IGES' or
10728                        format 'STEP_SCALE' is used instead of 'STEP',
10729                        length unit will be set to 'meter' and result model will be scaled.
10730                 theName Object name; when specified, this parameter is used
10731                         for result publication in the study. Otherwise, if automatic
10732                         publication is switched on, default value is used for result name.
10733
10734             Returns:
10735                 New GEOM.GEOM_Object, containing the imported shape.
10736                 If material names are imported it returns the list of
10737                 objects. The first one is the imported object followed by
10738                 material groups.
10739             Note:
10740                 Auto publishing is allowed for the shape itself. Imported
10741                 material groups are not automatically published.
10742             """
10743             # Example: see GEOM_TestOthers.py
10744             print """
10745             WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
10746             where <FormatName> is a name of desirable format for importing.
10747             """
10748             aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10749             RaiseIfFailed("ImportFile", self.InsertOp)
10750             aNbObj = len(aListObj)
10751             if aNbObj > 0:
10752                 self._autoPublish(aListObj[0], theName, "imported")
10753             if aNbObj == 1:
10754                 return aListObj[0]
10755             return aListObj
10756
10757         ## Deprecated analog of ImportFile()
10758         def Import(self, theFileName, theFormatName, theName=None):
10759             """
10760             Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10761             """
10762             # note: auto-publishing is done in self.ImportFile()
10763             return self.ImportFile(theFileName, theFormatName, theName)
10764
10765         ## Read a shape from the binary stream, containing its bounding representation (BRep).
10766         #  @note This method will not be dumped to the python script by DumpStudy functionality.
10767         #  @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10768         #  @param theStream The BRep binary stream.
10769         #  @param theName Object name; when specified, this parameter is used
10770         #         for result publication in the study. Otherwise, if automatic
10771         #         publication is switched on, default value is used for result name.
10772         #
10773         #  @return New GEOM_Object, containing the shape, read from theStream.
10774         #
10775         #  @ref swig_Import_Export "Example"
10776         @ManageTransactions("InsertOp")
10777         def RestoreShape (self, theStream, theName=None):
10778             """
10779             Read a shape from the binary stream, containing its bounding representation (BRep).
10780
10781             Note:
10782                 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10783
10784             Parameters:
10785                 theStream The BRep binary stream.
10786                 theName Object name; when specified, this parameter is used
10787                         for result publication in the study. Otherwise, if automatic
10788                         publication is switched on, default value is used for result name.
10789
10790             Returns:
10791                 New GEOM_Object, containing the shape, read from theStream.
10792             """
10793             # Example: see GEOM_TestOthers.py
10794             anObj = self.InsertOp.RestoreShape(theStream)
10795             RaiseIfFailed("RestoreShape", self.InsertOp)
10796             self._autoPublish(anObj, theName, "restored")
10797             return anObj
10798
10799         ## Export the given shape into a file with given name.
10800         #
10801         #  Note: this function is deprecated, it is kept for backward compatibility only
10802         #  Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10803         #
10804         #  @param theObject Shape to be stored in the file.
10805         #  @param theFileName Name of the file to store the given shape in.
10806         #  @param theFormatName Specify format for the shape storage.
10807         #         Available formats can be obtained with
10808         #         geompy.InsertOp.ExportTranslators()[0] method.
10809         #
10810         #  @ref swig_Import_Export "Example"
10811         @ManageTransactions("InsertOp")
10812         def Export(self, theObject, theFileName, theFormatName):
10813             """
10814             Export the given shape into a file with given name.
10815
10816             Note: this function is deprecated, it is kept for backward compatibility only
10817             Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10818             
10819             Parameters: 
10820                 theObject Shape to be stored in the file.
10821                 theFileName Name of the file to store the given shape in.
10822                 theFormatName Specify format for the shape storage.
10823                               Available formats can be obtained with
10824                               geompy.InsertOp.ExportTranslators()[0] method.
10825             """
10826             # Example: see GEOM_TestOthers.py
10827             print """
10828             WARNING: Function Export is deprecated, use Export<FormatName> instead,
10829             where <FormatName> is a name of desirable format for exporting.
10830             """
10831             self.InsertOp.Export(theObject, theFileName, theFormatName)
10832             if self.InsertOp.IsDone() == 0:
10833                 raise RuntimeError,  "Export : " + self.InsertOp.GetErrorCode()
10834                 pass
10835             pass
10836
10837         # end of l2_import_export
10838         ## @}
10839
10840         ## @addtogroup l3_blocks
10841         ## @{
10842
10843         ## Create a quadrangle face from four edges. Order of Edges is not
10844         #  important. It is  not necessary that edges share the same vertex.
10845         #  @param E1,E2,E3,E4 Edges for the face bound.
10846         #  @param theName Object name; when specified, this parameter is used
10847         #         for result publication in the study. Otherwise, if automatic
10848         #         publication is switched on, default value is used for result name.
10849         #
10850         #  @return New GEOM.GEOM_Object, containing the created face.
10851         #
10852         #  @ref tui_building_by_blocks_page "Example"
10853         @ManageTransactions("BlocksOp")
10854         def MakeQuad(self, E1, E2, E3, E4, theName=None):
10855             """
10856             Create a quadrangle face from four edges. Order of Edges is not
10857             important. It is  not necessary that edges share the same vertex.
10858
10859             Parameters:
10860                 E1,E2,E3,E4 Edges for the face bound.
10861                 theName Object name; when specified, this parameter is used
10862                         for result publication in the study. Otherwise, if automatic
10863                         publication is switched on, default value is used for result name.
10864
10865             Returns:
10866                 New GEOM.GEOM_Object, containing the created face.
10867
10868             Example of usage:
10869                 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10870             """
10871             # Example: see GEOM_Spanner.py
10872             anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10873             RaiseIfFailed("MakeQuad", self.BlocksOp)
10874             self._autoPublish(anObj, theName, "quad")
10875             return anObj
10876
10877         ## Create a quadrangle face on two edges.
10878         #  The missing edges will be built by creating the shortest ones.
10879         #  @param E1,E2 Two opposite edges for the face.
10880         #  @param theName Object name; when specified, this parameter is used
10881         #         for result publication in the study. Otherwise, if automatic
10882         #         publication is switched on, default value is used for result name.
10883         #
10884         #  @return New GEOM.GEOM_Object, containing the created face.
10885         #
10886         #  @ref tui_building_by_blocks_page "Example"
10887         @ManageTransactions("BlocksOp")
10888         def MakeQuad2Edges(self, E1, E2, theName=None):
10889             """
10890             Create a quadrangle face on two edges.
10891             The missing edges will be built by creating the shortest ones.
10892
10893             Parameters:
10894                 E1,E2 Two opposite edges for the face.
10895                 theName Object name; when specified, this parameter is used
10896                         for result publication in the study. Otherwise, if automatic
10897                         publication is switched on, default value is used for result name.
10898
10899             Returns:
10900                 New GEOM.GEOM_Object, containing the created face.
10901
10902             Example of usage:
10903                 # create vertices
10904                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
10905                 p2 = geompy.MakeVertex(150.,  30.,   0.)
10906                 p3 = geompy.MakeVertex(  0., 120.,  50.)
10907                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
10908                 # create edges
10909                 edge1 = geompy.MakeEdge(p1, p2)
10910                 edge2 = geompy.MakeEdge(p3, p4)
10911                 # create a quadrangle face from two edges
10912                 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10913             """
10914             # Example: see GEOM_Spanner.py
10915             anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10916             RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10917             self._autoPublish(anObj, theName, "quad")
10918             return anObj
10919
10920         ## Create a quadrangle face with specified corners.
10921         #  The missing edges will be built by creating the shortest ones.
10922         #  @param V1,V2,V3,V4 Corner vertices for the face.
10923         #  @param theName Object name; when specified, this parameter is used
10924         #         for result publication in the study. Otherwise, if automatic
10925         #         publication is switched on, default value is used for result name.
10926         #
10927         #  @return New GEOM.GEOM_Object, containing the created face.
10928         #
10929         #  @ref tui_building_by_blocks_page "Example 1"
10930         #  \n @ref swig_MakeQuad4Vertices "Example 2"
10931         @ManageTransactions("BlocksOp")
10932         def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10933             """
10934             Create a quadrangle face with specified corners.
10935             The missing edges will be built by creating the shortest ones.
10936
10937             Parameters:
10938                 V1,V2,V3,V4 Corner vertices for the face.
10939                 theName Object name; when specified, this parameter is used
10940                         for result publication in the study. Otherwise, if automatic
10941                         publication is switched on, default value is used for result name.
10942
10943             Returns:
10944                 New GEOM.GEOM_Object, containing the created face.
10945
10946             Example of usage:
10947                 # create vertices
10948                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
10949                 p2 = geompy.MakeVertex(150.,  30.,   0.)
10950                 p3 = geompy.MakeVertex(  0., 120.,  50.)
10951                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
10952                 # create a quadrangle from four points in its corners
10953                 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10954             """
10955             # Example: see GEOM_Spanner.py
10956             anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10957             RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10958             self._autoPublish(anObj, theName, "quad")
10959             return anObj
10960
10961         ## Create a hexahedral solid, bounded by the six given faces. Order of
10962         #  faces is not important. It is  not necessary that Faces share the same edge.
10963         #  @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10964         #  @param theName Object name; when specified, this parameter is used
10965         #         for result publication in the study. Otherwise, if automatic
10966         #         publication is switched on, default value is used for result name.
10967         #
10968         #  @return New GEOM.GEOM_Object, containing the created solid.
10969         #
10970         #  @ref tui_building_by_blocks_page "Example 1"
10971         #  \n @ref swig_MakeHexa "Example 2"
10972         @ManageTransactions("BlocksOp")
10973         def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10974             """
10975             Create a hexahedral solid, bounded by the six given faces. Order of
10976             faces is not important. It is  not necessary that Faces share the same edge.
10977
10978             Parameters:
10979                 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10980                 theName Object name; when specified, this parameter is used
10981                         for result publication in the study. Otherwise, if automatic
10982                         publication is switched on, default value is used for result name.
10983
10984             Returns:
10985                 New GEOM.GEOM_Object, containing the created solid.
10986
10987             Example of usage:
10988                 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10989             """
10990             # Example: see GEOM_Spanner.py
10991             anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10992             RaiseIfFailed("MakeHexa", self.BlocksOp)
10993             self._autoPublish(anObj, theName, "hexa")
10994             return anObj
10995
10996         ## Create a hexahedral solid between two given faces.
10997         #  The missing faces will be built by creating the smallest ones.
10998         #  @param F1,F2 Two opposite faces for the hexahedral solid.
10999         #  @param theName Object name; when specified, this parameter is used
11000         #         for result publication in the study. Otherwise, if automatic
11001         #         publication is switched on, default value is used for result name.
11002         #
11003         #  @return New GEOM.GEOM_Object, containing the created solid.
11004         #
11005         #  @ref tui_building_by_blocks_page "Example 1"
11006         #  \n @ref swig_MakeHexa2Faces "Example 2"
11007         @ManageTransactions("BlocksOp")
11008         def MakeHexa2Faces(self, F1, F2, theName=None):
11009             """
11010             Create a hexahedral solid between two given faces.
11011             The missing faces will be built by creating the smallest ones.
11012
11013             Parameters:
11014                 F1,F2 Two opposite faces for the hexahedral solid.
11015                 theName Object name; when specified, this parameter is used
11016                         for result publication in the study. Otherwise, if automatic
11017                         publication is switched on, default value is used for result name.
11018
11019             Returns:
11020                 New GEOM.GEOM_Object, containing the created solid.
11021
11022             Example of usage:
11023                 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11024             """
11025             # Example: see GEOM_Spanner.py
11026             anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11027             RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11028             self._autoPublish(anObj, theName, "hexa")
11029             return anObj
11030
11031         # end of l3_blocks
11032         ## @}
11033
11034         ## @addtogroup l3_blocks_op
11035         ## @{
11036
11037         ## Get a vertex, found in the given shape by its coordinates.
11038         #  @param theShape Block or a compound of blocks.
11039         #  @param theX,theY,theZ Coordinates of the sought vertex.
11040         #  @param theEpsilon Maximum allowed distance between the resulting
11041         #                    vertex and point with the given coordinates.
11042         #  @param theName Object name; when specified, this parameter is used
11043         #         for result publication in the study. Otherwise, if automatic
11044         #         publication is switched on, default value is used for result name.
11045         #
11046         #  @return New GEOM.GEOM_Object, containing the found vertex.
11047         #
11048         #  @ref swig_GetPoint "Example"
11049         @ManageTransactions("BlocksOp")
11050         def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11051             """
11052             Get a vertex, found in the given shape by its coordinates.
11053
11054             Parameters:
11055                 theShape Block or a compound of blocks.
11056                 theX,theY,theZ Coordinates of the sought vertex.
11057                 theEpsilon Maximum allowed distance between the resulting
11058                            vertex and point with the given coordinates.
11059                 theName Object name; when specified, this parameter is used
11060                         for result publication in the study. Otherwise, if automatic
11061                         publication is switched on, default value is used for result name.
11062
11063             Returns:
11064                 New GEOM.GEOM_Object, containing the found vertex.
11065
11066             Example of usage:
11067                 pnt = geompy.GetPoint(shape, -50,  50,  50, 0.01)
11068             """
11069             # Example: see GEOM_TestOthers.py
11070             anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11071             RaiseIfFailed("GetPoint", self.BlocksOp)
11072             self._autoPublish(anObj, theName, "vertex")
11073             return anObj
11074
11075         ## Find a vertex of the given shape, which has minimal distance to the given point.
11076         #  @param theShape Any shape.
11077         #  @param thePoint Point, close to the desired vertex.
11078         #  @param theName Object name; when specified, this parameter is used
11079         #         for result publication in the study. Otherwise, if automatic
11080         #         publication is switched on, default value is used for result name.
11081         #
11082         #  @return New GEOM.GEOM_Object, containing the found vertex.
11083         #
11084         #  @ref swig_GetVertexNearPoint "Example"
11085         @ManageTransactions("BlocksOp")
11086         def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11087             """
11088             Find a vertex of the given shape, which has minimal distance to the given point.
11089
11090             Parameters:
11091                 theShape Any shape.
11092                 thePoint Point, close to the desired vertex.
11093                 theName Object name; when specified, this parameter is used
11094                         for result publication in the study. Otherwise, if automatic
11095                         publication is switched on, default value is used for result name.
11096
11097             Returns:
11098                 New GEOM.GEOM_Object, containing the found vertex.
11099
11100             Example of usage:
11101                 pmidle = geompy.MakeVertex(50, 0, 50)
11102                 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11103             """
11104             # Example: see GEOM_TestOthers.py
11105             anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11106             RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11107             self._autoPublish(anObj, theName, "vertex")
11108             return anObj
11109
11110         ## Get an edge, found in the given shape by two given vertices.
11111         #  @param theShape Block or a compound of blocks.
11112         #  @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11113         #  @param theName Object name; when specified, this parameter is used
11114         #         for result publication in the study. Otherwise, if automatic
11115         #         publication is switched on, default value is used for result name.
11116         #
11117         #  @return New GEOM.GEOM_Object, containing the found edge.
11118         #
11119         #  @ref swig_GetEdge "Example"
11120         @ManageTransactions("BlocksOp")
11121         def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11122             """
11123             Get an edge, found in the given shape by two given vertices.
11124
11125             Parameters:
11126                 theShape Block or a compound of blocks.
11127                 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11128                 theName Object name; when specified, this parameter is used
11129                         for result publication in the study. Otherwise, if automatic
11130                         publication is switched on, default value is used for result name.
11131
11132             Returns:
11133                 New GEOM.GEOM_Object, containing the found edge.
11134             """
11135             # Example: see GEOM_Spanner.py
11136             anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11137             RaiseIfFailed("GetEdge", self.BlocksOp)
11138             self._autoPublish(anObj, theName, "edge")
11139             return anObj
11140
11141         ## Find an edge of the given shape, which has minimal distance to the given point.
11142         #  @param theShape Block or a compound of blocks.
11143         #  @param thePoint Point, close to the desired edge.
11144         #  @param theName Object name; when specified, this parameter is used
11145         #         for result publication in the study. Otherwise, if automatic
11146         #         publication is switched on, default value is used for result name.
11147         #
11148         #  @return New GEOM.GEOM_Object, containing the found edge.
11149         #
11150         #  @ref swig_GetEdgeNearPoint "Example"
11151         @ManageTransactions("BlocksOp")
11152         def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11153             """
11154             Find an edge of the given shape, which has minimal distance to the given point.
11155
11156             Parameters:
11157                 theShape Block or a compound of blocks.
11158                 thePoint Point, close to the desired edge.
11159                 theName Object name; when specified, this parameter is used
11160                         for result publication in the study. Otherwise, if automatic
11161                         publication is switched on, default value is used for result name.
11162
11163             Returns:
11164                 New GEOM.GEOM_Object, containing the found edge.
11165             """
11166             # Example: see GEOM_TestOthers.py
11167             anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11168             RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11169             self._autoPublish(anObj, theName, "edge")
11170             return anObj
11171
11172         ## Returns a face, found in the given shape by four given corner vertices.
11173         #  @param theShape Block or a compound of blocks.
11174         #  @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11175         #  @param theName Object name; when specified, this parameter is used
11176         #         for result publication in the study. Otherwise, if automatic
11177         #         publication is switched on, default value is used for result name.
11178         #
11179         #  @return New GEOM.GEOM_Object, containing the found face.
11180         #
11181         #  @ref swig_todo "Example"
11182         @ManageTransactions("BlocksOp")
11183         def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11184             """
11185             Returns a face, found in the given shape by four given corner vertices.
11186
11187             Parameters:
11188                 theShape Block or a compound of blocks.
11189                 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11190                 theName Object name; when specified, this parameter is used
11191                         for result publication in the study. Otherwise, if automatic
11192                         publication is switched on, default value is used for result name.
11193
11194             Returns:
11195                 New GEOM.GEOM_Object, containing the found face.
11196             """
11197             # Example: see GEOM_Spanner.py
11198             anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11199             RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11200             self._autoPublish(anObj, theName, "face")
11201             return anObj
11202
11203         ## Get a face of block, found in the given shape by two given edges.
11204         #  @param theShape Block or a compound of blocks.
11205         #  @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11206         #  @param theName Object name; when specified, this parameter is used
11207         #         for result publication in the study. Otherwise, if automatic
11208         #         publication is switched on, default value is used for result name.
11209         #
11210         #  @return New GEOM.GEOM_Object, containing the found face.
11211         #
11212         #  @ref swig_todo "Example"
11213         @ManageTransactions("BlocksOp")
11214         def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11215             """
11216             Get a face of block, found in the given shape by two given edges.
11217
11218             Parameters:
11219                 theShape Block or a compound of blocks.
11220                 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11221                 theName Object name; when specified, this parameter is used
11222                         for result publication in the study. Otherwise, if automatic
11223                         publication is switched on, default value is used for result name.
11224
11225             Returns:
11226                 New GEOM.GEOM_Object, containing the found face.
11227             """
11228             # Example: see GEOM_Spanner.py
11229             anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11230             RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11231             self._autoPublish(anObj, theName, "face")
11232             return anObj
11233
11234         ## Find a face, opposite to the given one in the given block.
11235         #  @param theBlock Must be a hexahedral solid.
11236         #  @param theFace Face of \a theBlock, opposite to the desired face.
11237         #  @param theName Object name; when specified, this parameter is used
11238         #         for result publication in the study. Otherwise, if automatic
11239         #         publication is switched on, default value is used for result name.
11240         #
11241         #  @return New GEOM.GEOM_Object, containing the found face.
11242         #
11243         #  @ref swig_GetOppositeFace "Example"
11244         @ManageTransactions("BlocksOp")
11245         def GetOppositeFace(self, theBlock, theFace, theName=None):
11246             """
11247             Find a face, opposite to the given one in the given block.
11248
11249             Parameters:
11250                 theBlock Must be a hexahedral solid.
11251                 theFace Face of theBlock, opposite to the desired face.
11252                 theName Object name; when specified, this parameter is used
11253                         for result publication in the study. Otherwise, if automatic
11254                         publication is switched on, default value is used for result name.
11255
11256             Returns:
11257                 New GEOM.GEOM_Object, containing the found face.
11258             """
11259             # Example: see GEOM_Spanner.py
11260             anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11261             RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11262             self._autoPublish(anObj, theName, "face")
11263             return anObj
11264
11265         ## Find a face of the given shape, which has minimal distance to the given point.
11266         #  @param theShape Block or a compound of blocks.
11267         #  @param thePoint Point, close to the desired face.
11268         #  @param theName Object name; when specified, this parameter is used
11269         #         for result publication in the study. Otherwise, if automatic
11270         #         publication is switched on, default value is used for result name.
11271         #
11272         #  @return New GEOM.GEOM_Object, containing the found face.
11273         #
11274         #  @ref swig_GetFaceNearPoint "Example"
11275         @ManageTransactions("BlocksOp")
11276         def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11277             """
11278             Find a face of the given shape, which has minimal distance to the given point.
11279
11280             Parameters:
11281                 theShape Block or a compound of blocks.
11282                 thePoint Point, close to the desired face.
11283                 theName Object name; when specified, this parameter is used
11284                         for result publication in the study. Otherwise, if automatic
11285                         publication is switched on, default value is used for result name.
11286
11287             Returns:
11288                 New GEOM.GEOM_Object, containing the found face.
11289             """
11290             # Example: see GEOM_Spanner.py
11291             anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11292             RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11293             self._autoPublish(anObj, theName, "face")
11294             return anObj
11295
11296         ## Find a face of block, whose outside normale has minimal angle with the given vector.
11297         #  @param theBlock Block or a compound of blocks.
11298         #  @param theVector Vector, close to the normale of the desired face.
11299         #  @param theName Object name; when specified, this parameter is used
11300         #         for result publication in the study. Otherwise, if automatic
11301         #         publication is switched on, default value is used for result name.
11302         #
11303         #  @return New GEOM.GEOM_Object, containing the found face.
11304         #
11305         #  @ref swig_todo "Example"
11306         @ManageTransactions("BlocksOp")
11307         def GetFaceByNormale(self, theBlock, theVector, theName=None):
11308             """
11309             Find a face of block, whose outside normale has minimal angle with the given vector.
11310
11311             Parameters:
11312                 theBlock Block or a compound of blocks.
11313                 theVector Vector, close to the normale of the desired face.
11314                 theName Object name; when specified, this parameter is used
11315                         for result publication in the study. Otherwise, if automatic
11316                         publication is switched on, default value is used for result name.
11317
11318             Returns:
11319                 New GEOM.GEOM_Object, containing the found face.
11320             """
11321             # Example: see GEOM_Spanner.py
11322             anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11323             RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11324             self._autoPublish(anObj, theName, "face")
11325             return anObj
11326
11327         ## Find all sub-shapes of type \a theShapeType of the given shape,
11328         #  which have minimal distance to the given point.
11329         #  @param theShape Any shape.
11330         #  @param thePoint Point, close to the desired shape.
11331         #  @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11332         #  @param theTolerance The tolerance for distances comparison. All shapes
11333         #                      with distances to the given point in interval
11334         #                      [minimal_distance, minimal_distance + theTolerance] will be gathered.
11335         #  @param theName Object name; when specified, this parameter is used
11336         #         for result publication in the study. Otherwise, if automatic
11337         #         publication is switched on, default value is used for result name.
11338         #
11339         #  @return New GEOM_Object, containing a group of all found shapes.
11340         #
11341         #  @ref swig_GetShapesNearPoint "Example"
11342         @ManageTransactions("BlocksOp")
11343         def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11344             """
11345             Find all sub-shapes of type theShapeType of the given shape,
11346             which have minimal distance to the given point.
11347
11348             Parameters:
11349                 theShape Any shape.
11350                 thePoint Point, close to the desired shape.
11351                 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11352                 theTolerance The tolerance for distances comparison. All shapes
11353                                 with distances to the given point in interval
11354                                 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11355                 theName Object name; when specified, this parameter is used
11356                         for result publication in the study. Otherwise, if automatic
11357                         publication is switched on, default value is used for result name.
11358
11359             Returns:
11360                 New GEOM_Object, containing a group of all found shapes.
11361             """
11362             # Example: see GEOM_TestOthers.py
11363             anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11364             RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11365             self._autoPublish(anObj, theName, "group")
11366             return anObj
11367
11368         # end of l3_blocks_op
11369         ## @}
11370
11371         ## @addtogroup l4_blocks_measure
11372         ## @{
11373
11374         ## Check, if the compound of blocks is given.
11375         #  To be considered as a compound of blocks, the
11376         #  given shape must satisfy the following conditions:
11377         #  - Each element of the compound should be a Block (6 faces and 12 edges).
11378         #  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11379         #  - The compound should be connexe.
11380         #  - The glue between two quadrangle faces should be applied.
11381         #  @param theCompound The compound to check.
11382         #  @return TRUE, if the given shape is a compound of blocks.
11383         #  If theCompound is not valid, prints all discovered errors.
11384         #
11385         #  @ref tui_measurement_tools_page "Example 1"
11386         #  \n @ref swig_CheckCompoundOfBlocks "Example 2"
11387         @ManageTransactions("BlocksOp")
11388         def CheckCompoundOfBlocks(self,theCompound):
11389             """
11390             Check, if the compound of blocks is given.
11391             To be considered as a compound of blocks, the
11392             given shape must satisfy the following conditions:
11393             - Each element of the compound should be a Block (6 faces and 12 edges).
11394             - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11395             - The compound should be connexe.
11396             - The glue between two quadrangle faces should be applied.
11397
11398             Parameters:
11399                 theCompound The compound to check.
11400
11401             Returns:
11402                 TRUE, if the given shape is a compound of blocks.
11403                 If theCompound is not valid, prints all discovered errors.
11404             """
11405             # Example: see GEOM_Spanner.py
11406             (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11407             RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11408             if IsValid == 0:
11409                 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11410                 print Descr
11411             return IsValid
11412
11413         ## Retrieve all non blocks solids and faces from \a theShape.
11414         #  @param theShape The shape to explore.
11415         #  @param theName Object name; when specified, this parameter is used
11416         #         for result publication in the study. Otherwise, if automatic
11417         #         publication is switched on, default value is used for result name.
11418         #
11419         #  @return A tuple of two GEOM_Objects. The first object is a group of all
11420         #          non block solids (= not 6 faces, or with 6 faces, but with the
11421         #          presence of non-quadrangular faces). The second object is a
11422         #          group of all non quadrangular faces.
11423         #
11424         #  @ref tui_measurement_tools_page "Example 1"
11425         #  \n @ref swig_GetNonBlocks "Example 2"
11426         @ManageTransactions("BlocksOp")
11427         def GetNonBlocks (self, theShape, theName=None):
11428             """
11429             Retrieve all non blocks solids and faces from theShape.
11430
11431             Parameters:
11432                 theShape The shape to explore.
11433                 theName Object name; when specified, this parameter is used
11434                         for result publication in the study. Otherwise, if automatic
11435                         publication is switched on, default value is used for result name.
11436
11437             Returns:
11438                 A tuple of two GEOM_Objects. The first object is a group of all
11439                 non block solids (= not 6 faces, or with 6 faces, but with the
11440                 presence of non-quadrangular faces). The second object is a
11441                 group of all non quadrangular faces.
11442
11443             Usage:
11444                 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11445             """
11446             # Example: see GEOM_Spanner.py
11447             aTuple = self.BlocksOp.GetNonBlocks(theShape)
11448             RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11449             self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11450             return aTuple
11451
11452         ## Remove all seam and degenerated edges from \a theShape.
11453         #  Unite faces and edges, sharing one surface. It means that
11454         #  this faces must have references to one C++ surface object (handle).
11455         #  @param theShape The compound or single solid to remove irregular edges from.
11456         #  @param doUnionFaces If True, then unite faces. If False (the default value),
11457         #         do not unite faces.
11458         #  @param theName Object name; when specified, this parameter is used
11459         #         for result publication in the study. Otherwise, if automatic
11460         #         publication is switched on, default value is used for result name.
11461         #
11462         #  @return Improved shape.
11463         #
11464         #  @ref swig_RemoveExtraEdges "Example"
11465         @ManageTransactions("BlocksOp")
11466         def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11467             """
11468             Remove all seam and degenerated edges from theShape.
11469             Unite faces and edges, sharing one surface. It means that
11470             this faces must have references to one C++ surface object (handle).
11471
11472             Parameters:
11473                 theShape The compound or single solid to remove irregular edges from.
11474                 doUnionFaces If True, then unite faces. If False (the default value),
11475                              do not unite faces.
11476                 theName Object name; when specified, this parameter is used
11477                         for result publication in the study. Otherwise, if automatic
11478                         publication is switched on, default value is used for result name.
11479
11480             Returns:
11481                 Improved shape.
11482             """
11483             # Example: see GEOM_TestOthers.py
11484             nbFacesOptimum = -1 # -1 means do not unite faces
11485             if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11486             anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11487             RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11488             self._autoPublish(anObj, theName, "removeExtraEdges")
11489             return anObj
11490
11491         ## Performs union faces of \a theShape
11492         #  Unite faces sharing one surface. It means that
11493         #  these faces must have references to one C++ surface object (handle).
11494         #  @param theShape The compound or single solid that contains faces
11495         #         to perform union.
11496         #  @param theName Object name; when specified, this parameter is used
11497         #         for result publication in the study. Otherwise, if automatic
11498         #         publication is switched on, default value is used for result name.
11499         #
11500         #  @return Improved shape.
11501         #
11502         #  @ref swig_UnionFaces "Example"
11503         @ManageTransactions("BlocksOp")
11504         def UnionFaces(self, theShape, theName=None):
11505             """
11506             Performs union faces of theShape.
11507             Unite faces sharing one surface. It means that
11508             these faces must have references to one C++ surface object (handle).
11509
11510             Parameters:
11511                 theShape The compound or single solid that contains faces
11512                          to perform union.
11513                 theName Object name; when specified, this parameter is used
11514                         for result publication in the study. Otherwise, if automatic
11515                         publication is switched on, default value is used for result name.
11516
11517             Returns:
11518                 Improved shape.
11519             """
11520             # Example: see GEOM_TestOthers.py
11521             anObj = self.BlocksOp.UnionFaces(theShape)
11522             RaiseIfFailed("UnionFaces", self.BlocksOp)
11523             self._autoPublish(anObj, theName, "unionFaces")
11524             return anObj
11525
11526         ## Check, if the given shape is a blocks compound.
11527         #  Fix all detected errors.
11528         #    \note Single block can be also fixed by this method.
11529         #  @param theShape The compound to check and improve.
11530         #  @param theName Object name; when specified, this parameter is used
11531         #         for result publication in the study. Otherwise, if automatic
11532         #         publication is switched on, default value is used for result name.
11533         #
11534         #  @return Improved compound.
11535         #
11536         #  @ref swig_CheckAndImprove "Example"
11537         @ManageTransactions("BlocksOp")
11538         def CheckAndImprove(self, theShape, theName=None):
11539             """
11540             Check, if the given shape is a blocks compound.
11541             Fix all detected errors.
11542
11543             Note:
11544                 Single block can be also fixed by this method.
11545
11546             Parameters:
11547                 theShape The compound to check and improve.
11548                 theName Object name; when specified, this parameter is used
11549                         for result publication in the study. Otherwise, if automatic
11550                         publication is switched on, default value is used for result name.
11551
11552             Returns:
11553                 Improved compound.
11554             """
11555             # Example: see GEOM_TestOthers.py
11556             anObj = self.BlocksOp.CheckAndImprove(theShape)
11557             RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11558             self._autoPublish(anObj, theName, "improved")
11559             return anObj
11560
11561         # end of l4_blocks_measure
11562         ## @}
11563
11564         ## @addtogroup l3_blocks_op
11565         ## @{
11566
11567         ## Get all the blocks, contained in the given compound.
11568         #  @param theCompound The compound to explode.
11569         #  @param theMinNbFaces If solid has lower number of faces, it is not a block.
11570         #  @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11571         #  @param theName Object name; when specified, this parameter is used
11572         #         for result publication in the study. Otherwise, if automatic
11573         #         publication is switched on, default value is used for result name.
11574         #
11575         #  @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11576         #
11577         #  @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11578         #
11579         #  @ref tui_explode_on_blocks "Example 1"
11580         #  \n @ref swig_MakeBlockExplode "Example 2"
11581         @ManageTransactions("BlocksOp")
11582         def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11583             """
11584             Get all the blocks, contained in the given compound.
11585
11586             Parameters:
11587                 theCompound The compound to explode.
11588                 theMinNbFaces If solid has lower number of faces, it is not a block.
11589                 theMaxNbFaces If solid has higher number of faces, it is not a block.
11590                 theName Object name; when specified, this parameter is used
11591                         for result publication in the study. Otherwise, if automatic
11592                         publication is switched on, default value is used for result name.
11593
11594             Note:
11595                 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11596
11597             Returns:
11598                 List of GEOM.GEOM_Object, containing the retrieved blocks.
11599             """
11600             # Example: see GEOM_TestOthers.py
11601             theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11602             aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11603             RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11604             for anObj in aList:
11605                 anObj.SetParameters(Parameters)
11606                 pass
11607             self._autoPublish(aList, theName, "block")
11608             return aList
11609
11610         ## Find block, containing the given point inside its volume or on boundary.
11611         #  @param theCompound Compound, to find block in.
11612         #  @param thePoint Point, close to the desired block. If the point lays on
11613         #         boundary between some blocks, we return block with nearest center.
11614         #  @param theName Object name; when specified, this parameter is used
11615         #         for result publication in the study. Otherwise, if automatic
11616         #         publication is switched on, default value is used for result name.
11617         #
11618         #  @return New GEOM.GEOM_Object, containing the found block.
11619         #
11620         #  @ref swig_todo "Example"
11621         @ManageTransactions("BlocksOp")
11622         def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11623             """
11624             Find block, containing the given point inside its volume or on boundary.
11625
11626             Parameters:
11627                 theCompound Compound, to find block in.
11628                 thePoint Point, close to the desired block. If the point lays on
11629                          boundary between some blocks, we return block with nearest center.
11630                 theName Object name; when specified, this parameter is used
11631                         for result publication in the study. Otherwise, if automatic
11632                         publication is switched on, default value is used for result name.
11633
11634             Returns:
11635                 New GEOM.GEOM_Object, containing the found block.
11636             """
11637             # Example: see GEOM_Spanner.py
11638             anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11639             RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11640             self._autoPublish(anObj, theName, "block")
11641             return anObj
11642
11643         ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11644         #  @param theCompound Compound, to find block in.
11645         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11646         #  @param theName Object name; when specified, this parameter is used
11647         #         for result publication in the study. Otherwise, if automatic
11648         #         publication is switched on, default value is used for result name.
11649         #
11650         #  @return New GEOM.GEOM_Object, containing the found block.
11651         #
11652         #  @ref swig_GetBlockByParts "Example"
11653         @ManageTransactions("BlocksOp")
11654         def GetBlockByParts(self, theCompound, theParts, theName=None):
11655             """
11656              Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11657
11658              Parameters:
11659                 theCompound Compound, to find block in.
11660                 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11661                 theName Object name; when specified, this parameter is used
11662                         for result publication in the study. Otherwise, if automatic
11663                         publication is switched on, default value is used for result name.
11664
11665             Returns:
11666                 New GEOM_Object, containing the found block.
11667             """
11668             # Example: see GEOM_TestOthers.py
11669             anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11670             RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11671             self._autoPublish(anObj, theName, "block")
11672             return anObj
11673
11674         ## Return all blocks, containing all the elements, passed as the parts.
11675         #  @param theCompound Compound, to find blocks in.
11676         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11677         #  @param theName Object name; when specified, this parameter is used
11678         #         for result publication in the study. Otherwise, if automatic
11679         #         publication is switched on, default value is used for result name.
11680         #
11681         #  @return List of GEOM.GEOM_Object, containing the found blocks.
11682         #
11683         #  @ref swig_todo "Example"
11684         @ManageTransactions("BlocksOp")
11685         def GetBlocksByParts(self, theCompound, theParts, theName=None):
11686             """
11687             Return all blocks, containing all the elements, passed as the parts.
11688
11689             Parameters:
11690                 theCompound Compound, to find blocks in.
11691                 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11692                 theName Object name; when specified, this parameter is used
11693                         for result publication in the study. Otherwise, if automatic
11694                         publication is switched on, default value is used for result name.
11695
11696             Returns:
11697                 List of GEOM.GEOM_Object, containing the found blocks.
11698             """
11699             # Example: see GEOM_Spanner.py
11700             aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11701             RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11702             self._autoPublish(aList, theName, "block")
11703             return aList
11704
11705         ## Multi-transformate block and glue the result.
11706         #  Transformation is defined so, as to superpose direction faces.
11707         #  @param Block Hexahedral solid to be multi-transformed.
11708         #  @param DirFace1 ID of First direction face.
11709         #  @param DirFace2 ID of Second direction face.
11710         #  @param NbTimes Quantity of transformations to be done.
11711         #  @param theName Object name; when specified, this parameter is used
11712         #         for result publication in the study. Otherwise, if automatic
11713         #         publication is switched on, default value is used for result name.
11714         #
11715         #  @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11716         #
11717         #  @return New GEOM.GEOM_Object, containing the result shape.
11718         #
11719         #  @ref tui_multi_transformation "Example"
11720         @ManageTransactions("BlocksOp")
11721         def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11722             """
11723             Multi-transformate block and glue the result.
11724             Transformation is defined so, as to superpose direction faces.
11725
11726             Parameters:
11727                 Block Hexahedral solid to be multi-transformed.
11728                 DirFace1 ID of First direction face.
11729                 DirFace2 ID of Second direction face.
11730                 NbTimes Quantity of transformations to be done.
11731                 theName Object name; when specified, this parameter is used
11732                         for result publication in the study. Otherwise, if automatic
11733                         publication is switched on, default value is used for result name.
11734
11735             Note:
11736                 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11737
11738             Returns:
11739                 New GEOM.GEOM_Object, containing the result shape.
11740             """
11741             # Example: see GEOM_Spanner.py
11742             DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11743             anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11744             RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11745             anObj.SetParameters(Parameters)
11746             self._autoPublish(anObj, theName, "transformed")
11747             return anObj
11748
11749         ## Multi-transformate block and glue the result.
11750         #  @param Block Hexahedral solid to be multi-transformed.
11751         #  @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11752         #  @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11753         #  @param NbTimesU,NbTimesV Quantity of transformations to be done.
11754         #  @param theName Object name; when specified, this parameter is used
11755         #         for result publication in the study. Otherwise, if automatic
11756         #         publication is switched on, default value is used for result name.
11757         #
11758         #  @return New GEOM.GEOM_Object, containing the result shape.
11759         #
11760         #  @ref tui_multi_transformation "Example"
11761         @ManageTransactions("BlocksOp")
11762         def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11763                                       DirFace1V, DirFace2V, NbTimesV, theName=None):
11764             """
11765             Multi-transformate block and glue the result.
11766
11767             Parameters:
11768                 Block Hexahedral solid to be multi-transformed.
11769                 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11770                 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11771                 NbTimesU,NbTimesV Quantity of transformations to be done.
11772                 theName Object name; when specified, this parameter is used
11773                         for result publication in the study. Otherwise, if automatic
11774                         publication is switched on, default value is used for result name.
11775
11776             Returns:
11777                 New GEOM.GEOM_Object, containing the result shape.
11778             """
11779             # Example: see GEOM_Spanner.py
11780             DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11781               DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11782             anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11783                                                             DirFace1V, DirFace2V, NbTimesV)
11784             RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11785             anObj.SetParameters(Parameters)
11786             self._autoPublish(anObj, theName, "transformed")
11787             return anObj
11788
11789         ## Build all possible propagation groups.
11790         #  Propagation group is a set of all edges, opposite to one (main)
11791         #  edge of this group directly or through other opposite edges.
11792         #  Notion of Opposite Edge make sence only on quadrangle face.
11793         #  @param theShape Shape to build propagation groups on.
11794         #  @param theName Object name; when specified, this parameter is used
11795         #         for result publication in the study. Otherwise, if automatic
11796         #         publication is switched on, default value is used for result name.
11797         #
11798         #  @return List of GEOM.GEOM_Object, each of them is a propagation group.
11799         #
11800         #  @ref swig_Propagate "Example"
11801         @ManageTransactions("BlocksOp")
11802         def Propagate(self, theShape, theName=None):
11803             """
11804             Build all possible propagation groups.
11805             Propagation group is a set of all edges, opposite to one (main)
11806             edge of this group directly or through other opposite edges.
11807             Notion of Opposite Edge make sence only on quadrangle face.
11808
11809             Parameters:
11810                 theShape Shape to build propagation groups on.
11811                 theName Object name; when specified, this parameter is used
11812                         for result publication in the study. Otherwise, if automatic
11813                         publication is switched on, default value is used for result name.
11814
11815             Returns:
11816                 List of GEOM.GEOM_Object, each of them is a propagation group.
11817             """
11818             # Example: see GEOM_TestOthers.py
11819             listChains = self.BlocksOp.Propagate(theShape)
11820             RaiseIfFailed("Propagate", self.BlocksOp)
11821             self._autoPublish(listChains, theName, "propagate")
11822             return listChains
11823
11824         # end of l3_blocks_op
11825         ## @}
11826
11827         ## @addtogroup l3_groups
11828         ## @{
11829
11830         ## Creates a new group which will store sub-shapes of theMainShape
11831         #  @param theMainShape is a GEOM object on which the group is selected
11832         #  @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11833         #  @param theName Object name; when specified, this parameter is used
11834         #         for result publication in the study. Otherwise, if automatic
11835         #         publication is switched on, default value is used for result name.
11836         #
11837         #  @return a newly created GEOM group (GEOM.GEOM_Object)
11838         #
11839         #  @ref tui_working_with_groups_page "Example 1"
11840         #  \n @ref swig_CreateGroup "Example 2"
11841         @ManageTransactions("GroupOp")
11842         def CreateGroup(self, theMainShape, theShapeType, theName=None):
11843             """
11844             Creates a new group which will store sub-shapes of theMainShape
11845
11846             Parameters:
11847                theMainShape is a GEOM object on which the group is selected
11848                theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11849                             "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11850                 theName Object name; when specified, this parameter is used
11851                         for result publication in the study. Otherwise, if automatic
11852                         publication is switched on, default value is used for result name.
11853
11854             Returns:
11855                a newly created GEOM group
11856
11857             Example of usage:
11858                 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11859
11860             """
11861             # Example: see GEOM_TestOthers.py
11862             anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11863             RaiseIfFailed("CreateGroup", self.GroupOp)
11864             self._autoPublish(anObj, theName, "group")
11865             return anObj
11866
11867         ## Adds a sub-object with ID theSubShapeId to the group
11868         #  @param theGroup is a GEOM group to which the new sub-shape is added
11869         #  @param theSubShapeID is a sub-shape ID in the main object.
11870         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11871         #
11872         #  @ref tui_working_with_groups_page "Example"
11873         @ManageTransactions("GroupOp")
11874         def AddObject(self,theGroup, theSubShapeID):
11875             """
11876             Adds a sub-object with ID theSubShapeId to the group
11877
11878             Parameters:
11879                 theGroup       is a GEOM group to which the new sub-shape is added
11880                 theSubShapeID  is a sub-shape ID in the main object.
11881
11882             Note:
11883                 Use method GetSubShapeID() to get an unique ID of the sub-shape
11884             """
11885             # Example: see GEOM_TestOthers.py
11886             self.GroupOp.AddObject(theGroup, theSubShapeID)
11887             if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11888                 RaiseIfFailed("AddObject", self.GroupOp)
11889                 pass
11890             pass
11891
11892         ## Removes a sub-object with ID \a theSubShapeId from the group
11893         #  @param theGroup is a GEOM group from which the new sub-shape is removed
11894         #  @param theSubShapeID is a sub-shape ID in the main object.
11895         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11896         #
11897         #  @ref tui_working_with_groups_page "Example"
11898         @ManageTransactions("GroupOp")
11899         def RemoveObject(self,theGroup, theSubShapeID):
11900             """
11901             Removes a sub-object with ID theSubShapeId from the group
11902
11903             Parameters:
11904                 theGroup is a GEOM group from which the new sub-shape is removed
11905                 theSubShapeID is a sub-shape ID in the main object.
11906
11907             Note:
11908                 Use method GetSubShapeID() to get an unique ID of the sub-shape
11909             """
11910             # Example: see GEOM_TestOthers.py
11911             self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11912             RaiseIfFailed("RemoveObject", self.GroupOp)
11913             pass
11914
11915         ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11916         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
11917         #  @param theSubShapes is a list of sub-shapes to be added.
11918         #
11919         #  @ref tui_working_with_groups_page "Example"
11920         @ManageTransactions("GroupOp")
11921         def UnionList (self,theGroup, theSubShapes):
11922             """
11923             Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11924
11925             Parameters:
11926                 theGroup is a GEOM group to which the new sub-shapes are added.
11927                 theSubShapes is a list of sub-shapes to be added.
11928             """
11929             # Example: see GEOM_TestOthers.py
11930             self.GroupOp.UnionList(theGroup, theSubShapes)
11931             RaiseIfFailed("UnionList", self.GroupOp)
11932             pass
11933
11934         ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11935         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
11936         #  @param theSubShapes is a list of indices of sub-shapes to be added.
11937         #
11938         #  @ref swig_UnionIDs "Example"
11939         @ManageTransactions("GroupOp")
11940         def UnionIDs(self,theGroup, theSubShapes):
11941             """
11942             Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11943
11944             Parameters:
11945                 theGroup is a GEOM group to which the new sub-shapes are added.
11946                 theSubShapes is a list of indices of sub-shapes to be added.
11947             """
11948             # Example: see GEOM_TestOthers.py
11949             self.GroupOp.UnionIDs(theGroup, theSubShapes)
11950             RaiseIfFailed("UnionIDs", self.GroupOp)
11951             pass
11952
11953         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11954         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
11955         #  @param theSubShapes is a list of sub-shapes to be removed.
11956         #
11957         #  @ref tui_working_with_groups_page "Example"
11958         @ManageTransactions("GroupOp")
11959         def DifferenceList (self,theGroup, theSubShapes):
11960             """
11961             Removes from the group all the given shapes. No errors, if some shapes are not included.
11962
11963             Parameters:
11964                 theGroup is a GEOM group from which the sub-shapes are removed.
11965                 theSubShapes is a list of sub-shapes to be removed.
11966             """
11967             # Example: see GEOM_TestOthers.py
11968             self.GroupOp.DifferenceList(theGroup, theSubShapes)
11969             RaiseIfFailed("DifferenceList", self.GroupOp)
11970             pass
11971
11972         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11973         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
11974         #  @param theSubShapes is a list of indices of sub-shapes to be removed.
11975         #
11976         #  @ref swig_DifferenceIDs "Example"
11977         @ManageTransactions("GroupOp")
11978         def DifferenceIDs(self,theGroup, theSubShapes):
11979             """
11980             Removes from the group all the given shapes. No errors, if some shapes are not included.
11981
11982             Parameters:
11983                 theGroup is a GEOM group from which the sub-shapes are removed.
11984                 theSubShapes is a list of indices of sub-shapes to be removed.
11985             """
11986             # Example: see GEOM_TestOthers.py
11987             self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11988             RaiseIfFailed("DifferenceIDs", self.GroupOp)
11989             pass
11990
11991         ## Union of two groups.
11992         #  New group is created. It will contain all entities
11993         #  which are present in groups theGroup1 and theGroup2.
11994         #  @param theGroup1, theGroup2 are the initial GEOM groups
11995         #                              to create the united group from.
11996         #  @param theName Object name; when specified, this parameter is used
11997         #         for result publication in the study. Otherwise, if automatic
11998         #         publication is switched on, default value is used for result name.
11999         #
12000         #  @return a newly created GEOM group.
12001         #
12002         #  @ref tui_union_groups_anchor "Example"
12003         @ManageTransactions("GroupOp")
12004         def UnionGroups (self, theGroup1, theGroup2, theName=None):
12005             """
12006             Union of two groups.
12007             New group is created. It will contain all entities
12008             which are present in groups theGroup1 and theGroup2.
12009
12010             Parameters:
12011                 theGroup1, theGroup2 are the initial GEOM groups
12012                                      to create the united group from.
12013                 theName Object name; when specified, this parameter is used
12014                         for result publication in the study. Otherwise, if automatic
12015                         publication is switched on, default value is used for result name.
12016
12017             Returns:
12018                 a newly created GEOM group.
12019             """
12020             # Example: see GEOM_TestOthers.py
12021             aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12022             RaiseIfFailed("UnionGroups", self.GroupOp)
12023             self._autoPublish(aGroup, theName, "group")
12024             return aGroup
12025
12026         ## Intersection of two groups.
12027         #  New group is created. It will contain only those entities
12028         #  which are present in both groups theGroup1 and theGroup2.
12029         #  @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12030         #  @param theName Object name; when specified, this parameter is used
12031         #         for result publication in the study. Otherwise, if automatic
12032         #         publication is switched on, default value is used for result name.
12033         #
12034         #  @return a newly created GEOM group.
12035         #
12036         #  @ref tui_intersect_groups_anchor "Example"
12037         @ManageTransactions("GroupOp")
12038         def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12039             """
12040             Intersection of two groups.
12041             New group is created. It will contain only those entities
12042             which are present in both groups theGroup1 and theGroup2.
12043
12044             Parameters:
12045                 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12046                 theName Object name; when specified, this parameter is used
12047                         for result publication in the study. Otherwise, if automatic
12048                         publication is switched on, default value is used for result name.
12049
12050             Returns:
12051                 a newly created GEOM group.
12052             """
12053             # Example: see GEOM_TestOthers.py
12054             aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12055             RaiseIfFailed("IntersectGroups", self.GroupOp)
12056             self._autoPublish(aGroup, theName, "group")
12057             return aGroup
12058
12059         ## Cut of two groups.
12060         #  New group is created. It will contain entities which are
12061         #  present in group theGroup1 but are not present in group theGroup2.
12062         #  @param theGroup1 is a GEOM group to include elements of.
12063         #  @param theGroup2 is a GEOM group to exclude elements of.
12064         #  @param theName Object name; when specified, this parameter is used
12065         #         for result publication in the study. Otherwise, if automatic
12066         #         publication is switched on, default value is used for result name.
12067         #
12068         #  @return a newly created GEOM group.
12069         #
12070         #  @ref tui_cut_groups_anchor "Example"
12071         @ManageTransactions("GroupOp")
12072         def CutGroups (self, theGroup1, theGroup2, theName=None):
12073             """
12074             Cut of two groups.
12075             New group is created. It will contain entities which are
12076             present in group theGroup1 but are not present in group theGroup2.
12077
12078             Parameters:
12079                 theGroup1 is a GEOM group to include elements of.
12080                 theGroup2 is a GEOM group to exclude elements of.
12081                 theName Object name; when specified, this parameter is used
12082                         for result publication in the study. Otherwise, if automatic
12083                         publication is switched on, default value is used for result name.
12084
12085             Returns:
12086                 a newly created GEOM group.
12087             """
12088             # Example: see GEOM_TestOthers.py
12089             aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12090             RaiseIfFailed("CutGroups", self.GroupOp)
12091             self._autoPublish(aGroup, theName, "group")
12092             return aGroup
12093
12094         ## Union of list of groups.
12095         #  New group is created. It will contain all entities that are
12096         #  present in groups listed in theGList.
12097         #  @param theGList is a list of GEOM groups to create the united group from.
12098         #  @param theName Object name; when specified, this parameter is used
12099         #         for result publication in the study. Otherwise, if automatic
12100         #         publication is switched on, default value is used for result name.
12101         #
12102         #  @return a newly created GEOM group.
12103         #
12104         #  @ref tui_union_groups_anchor "Example"
12105         @ManageTransactions("GroupOp")
12106         def UnionListOfGroups (self, theGList, theName=None):
12107             """
12108             Union of list of groups.
12109             New group is created. It will contain all entities that are
12110             present in groups listed in theGList.
12111
12112             Parameters:
12113                 theGList is a list of GEOM groups to create the united group from.
12114                 theName Object name; when specified, this parameter is used
12115                         for result publication in the study. Otherwise, if automatic
12116                         publication is switched on, default value is used for result name.
12117
12118             Returns:
12119                 a newly created GEOM group.
12120             """
12121             # Example: see GEOM_TestOthers.py
12122             aGroup = self.GroupOp.UnionListOfGroups(theGList)
12123             RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12124             self._autoPublish(aGroup, theName, "group")
12125             return aGroup
12126
12127         ## Cut of lists of groups.
12128         #  New group is created. It will contain only entities
12129         #  which are present in groups listed in theGList.
12130         #  @param theGList is a list of GEOM groups to include elements of.
12131         #  @param theName Object name; when specified, this parameter is used
12132         #         for result publication in the study. Otherwise, if automatic
12133         #         publication is switched on, default value is used for result name.
12134         #
12135         #  @return a newly created GEOM group.
12136         #
12137         #  @ref tui_intersect_groups_anchor "Example"
12138         @ManageTransactions("GroupOp")
12139         def IntersectListOfGroups (self, theGList, theName=None):
12140             """
12141             Cut of lists of groups.
12142             New group is created. It will contain only entities
12143             which are present in groups listed in theGList.
12144
12145             Parameters:
12146                 theGList is a list of GEOM groups to include elements of.
12147                 theName Object name; when specified, this parameter is used
12148                         for result publication in the study. Otherwise, if automatic
12149                         publication is switched on, default value is used for result name.
12150
12151             Returns:
12152                 a newly created GEOM group.
12153             """
12154             # Example: see GEOM_TestOthers.py
12155             aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12156             RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12157             self._autoPublish(aGroup, theName, "group")
12158             return aGroup
12159
12160         ## Cut of lists of groups.
12161         #  New group is created. It will contain only entities
12162         #  which are present in groups listed in theGList1 but
12163         #  are not present in groups from theGList2.
12164         #  @param theGList1 is a list of GEOM groups to include elements of.
12165         #  @param theGList2 is a list of GEOM groups to exclude elements of.
12166         #  @param theName Object name; when specified, this parameter is used
12167         #         for result publication in the study. Otherwise, if automatic
12168         #         publication is switched on, default value is used for result name.
12169         #
12170         #  @return a newly created GEOM group.
12171         #
12172         #  @ref tui_cut_groups_anchor "Example"
12173         @ManageTransactions("GroupOp")
12174         def CutListOfGroups (self, theGList1, theGList2, theName=None):
12175             """
12176             Cut of lists of groups.
12177             New group is created. It will contain only entities
12178             which are present in groups listed in theGList1 but
12179             are not present in groups from theGList2.
12180
12181             Parameters:
12182                 theGList1 is a list of GEOM groups to include elements of.
12183                 theGList2 is a list of GEOM groups to exclude elements of.
12184                 theName Object name; when specified, this parameter is used
12185                         for result publication in the study. Otherwise, if automatic
12186                         publication is switched on, default value is used for result name.
12187
12188             Returns:
12189                 a newly created GEOM group.
12190             """
12191             # Example: see GEOM_TestOthers.py
12192             aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12193             RaiseIfFailed("CutListOfGroups", self.GroupOp)
12194             self._autoPublish(aGroup, theName, "group")
12195             return aGroup
12196
12197         ## Returns a list of sub-objects ID stored in the group
12198         #  @param theGroup is a GEOM group for which a list of IDs is requested
12199         #
12200         #  @ref swig_GetObjectIDs "Example"
12201         @ManageTransactions("GroupOp")
12202         def GetObjectIDs(self,theGroup):
12203             """
12204             Returns a list of sub-objects ID stored in the group
12205
12206             Parameters:
12207                 theGroup is a GEOM group for which a list of IDs is requested
12208             """
12209             # Example: see GEOM_TestOthers.py
12210             ListIDs = self.GroupOp.GetObjects(theGroup)
12211             RaiseIfFailed("GetObjects", self.GroupOp)
12212             return ListIDs
12213
12214         ## Returns a type of sub-objects stored in the group
12215         #  @param theGroup is a GEOM group which type is returned.
12216         #
12217         #  @ref swig_GetType "Example"
12218         @ManageTransactions("GroupOp")
12219         def GetType(self,theGroup):
12220             """
12221             Returns a type of sub-objects stored in the group
12222
12223             Parameters:
12224                 theGroup is a GEOM group which type is returned.
12225             """
12226             # Example: see GEOM_TestOthers.py
12227             aType = self.GroupOp.GetType(theGroup)
12228             RaiseIfFailed("GetType", self.GroupOp)
12229             return aType
12230
12231         ## Convert a type of geom object from id to string value
12232         #  @param theId is a GEOM obect type id.
12233         #  @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12234         #  @ref swig_GetType "Example"
12235         def ShapeIdToType(self, theId):
12236             """
12237             Convert a type of geom object from id to string value
12238
12239             Parameters:
12240                 theId is a GEOM obect type id.
12241
12242             Returns:
12243                 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12244             """
12245             if theId == 0:
12246                 return "COPY"
12247             if theId == 1:
12248                 return "IMPORT"
12249             if theId == 2:
12250                 return "POINT"
12251             if theId == 3:
12252                 return "VECTOR"
12253             if theId == 4:
12254                 return "PLANE"
12255             if theId == 5:
12256                 return "LINE"
12257             if theId == 6:
12258                 return "TORUS"
12259             if theId == 7:
12260                 return "BOX"
12261             if theId == 8:
12262                 return "CYLINDER"
12263             if theId == 9:
12264                 return "CONE"
12265             if theId == 10:
12266                 return "SPHERE"
12267             if theId == 11:
12268                 return "PRISM"
12269             if theId == 12:
12270                 return "REVOLUTION"
12271             if theId == 13:
12272                 return "BOOLEAN"
12273             if theId == 14:
12274                 return "PARTITION"
12275             if theId == 15:
12276                 return "POLYLINE"
12277             if theId == 16:
12278                 return "CIRCLE"
12279             if theId == 17:
12280                 return "SPLINE"
12281             if theId == 18:
12282                 return "ELLIPSE"
12283             if theId == 19:
12284                 return "CIRC_ARC"
12285             if theId == 20:
12286                 return "FILLET"
12287             if theId == 21:
12288                 return "CHAMFER"
12289             if theId == 22:
12290                 return "EDGE"
12291             if theId == 23:
12292                 return "WIRE"
12293             if theId == 24:
12294                 return "FACE"
12295             if theId == 25:
12296                 return "SHELL"
12297             if theId == 26:
12298                 return "SOLID"
12299             if theId == 27:
12300                 return "COMPOUND"
12301             if theId == 28:
12302                 return "SUBSHAPE"
12303             if theId == 29:
12304                 return "PIPE"
12305             if theId == 30:
12306                 return "ARCHIMEDE"
12307             if theId == 31:
12308                 return "FILLING"
12309             if theId == 32:
12310                 return "EXPLODE"
12311             if theId == 33:
12312                 return "GLUED"
12313             if theId == 34:
12314                 return "SKETCHER"
12315             if theId == 35:
12316                 return "CDG"
12317             if theId == 36:
12318                 return "FREE_BOUNDS"
12319             if theId == 37:
12320                 return "GROUP"
12321             if theId == 38:
12322                 return "BLOCK"
12323             if theId == 39:
12324                 return "MARKER"
12325             if theId == 40:
12326                 return "THRUSECTIONS"
12327             if theId == 41:
12328                 return "COMPOUNDFILTER"
12329             if theId == 42:
12330                 return "SHAPES_ON_SHAPE"
12331             if theId == 43:
12332                 return "ELLIPSE_ARC"
12333             if theId == 44:
12334                 return "3DSKETCHER"
12335             if theId == 45:
12336                 return "FILLET_2D"
12337             if theId == 46:
12338                 return "FILLET_1D"
12339             if theId == 201:
12340                 return "PIPETSHAPE"
12341             return "Shape Id not exist."
12342
12343         ## Returns a main shape associated with the group
12344         #  @param theGroup is a GEOM group for which a main shape object is requested
12345         #  @return a GEOM object which is a main shape for theGroup
12346         #
12347         #  @ref swig_GetMainShape "Example"
12348         @ManageTransactions("GroupOp")
12349         def GetMainShape(self,theGroup):
12350             """
12351             Returns a main shape associated with the group
12352
12353             Parameters:
12354                 theGroup is a GEOM group for which a main shape object is requested
12355
12356             Returns:
12357                 a GEOM object which is a main shape for theGroup
12358
12359             Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12360             """
12361             # Example: see GEOM_TestOthers.py
12362             anObj = self.GroupOp.GetMainShape(theGroup)
12363             RaiseIfFailed("GetMainShape", self.GroupOp)
12364             return anObj
12365
12366         ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12367         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
12368         #  @param theShape given shape (see GEOM.GEOM_Object)
12369         #  @param min_length minimum length of edges of theShape
12370         #  @param max_length maximum length of edges of theShape
12371         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12372         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12373         #  @param theName Object name; when specified, this parameter is used
12374         #         for result publication in the study. Otherwise, if automatic
12375         #         publication is switched on, default value is used for result name.
12376         #
12377         #  @return a newly created GEOM group of edges
12378         #
12379         #  @@ref swig_todo "Example"
12380         def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12381             """
12382             Create group of edges of theShape, whose length is in range [min_length, max_length].
12383             If include_min/max == 0, edges with length == min/max_length will not be included in result.
12384
12385             Parameters:
12386                 theShape given shape
12387                 min_length minimum length of edges of theShape
12388                 max_length maximum length of edges of theShape
12389                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12390                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12391                 theName Object name; when specified, this parameter is used
12392                         for result publication in the study. Otherwise, if automatic
12393                         publication is switched on, default value is used for result name.
12394
12395              Returns:
12396                 a newly created GEOM group of edges.
12397             """
12398             edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12399             edges_in_range = []
12400             for edge in edges:
12401                 Props = self.BasicProperties(edge)
12402                 if min_length <= Props[0] and Props[0] <= max_length:
12403                     if (not include_min) and (min_length == Props[0]):
12404                         skip = 1
12405                     else:
12406                         if (not include_max) and (Props[0] == max_length):
12407                             skip = 1
12408                         else:
12409                             edges_in_range.append(edge)
12410
12411             if len(edges_in_range) <= 0:
12412                 print "No edges found by given criteria"
12413                 return None
12414
12415             # note: auto-publishing is done in self.CreateGroup()
12416             group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12417             self.UnionList(group_edges, edges_in_range)
12418
12419             return group_edges
12420
12421         ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12422         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
12423         #  @param min_length minimum length of edges of selected shape
12424         #  @param max_length maximum length of edges of selected shape
12425         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12426         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12427         #  @return a newly created GEOM group of edges
12428         #  @ref swig_todo "Example"
12429         def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12430             """
12431             Create group of edges of selected shape, whose length is in range [min_length, max_length].
12432             If include_min/max == 0, edges with length == min/max_length will not be included in result.
12433
12434             Parameters:
12435                 min_length minimum length of edges of selected shape
12436                 max_length maximum length of edges of selected shape
12437                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12438                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12439
12440              Returns:
12441                 a newly created GEOM group of edges.
12442             """
12443             nb_selected = sg.SelectedCount()
12444             if nb_selected < 1:
12445                 print "Select a shape before calling this function, please."
12446                 return 0
12447             if nb_selected > 1:
12448                 print "Only one shape must be selected"
12449                 return 0
12450
12451             id_shape = sg.getSelected(0)
12452             shape = IDToObject( id_shape )
12453
12454             group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12455
12456             left_str  = " < "
12457             right_str = " < "
12458             if include_min: left_str  = " <= "
12459             if include_max: right_str  = " <= "
12460
12461             self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12462                                     + left_str + "length" + right_str + `max_length`)
12463
12464             sg.updateObjBrowser(1)
12465
12466             return group_edges
12467
12468         # end of l3_groups
12469         ## @}
12470
12471         #@@ insert new functions before this line @@ do not remove this line @@#
12472
12473         ## Create a copy of the given object
12474         #
12475         #  @param theOriginal geometry object for copy
12476         #  @param theName Object name; when specified, this parameter is used
12477         #         for result publication in the study. Otherwise, if automatic
12478         #         publication is switched on, default value is used for result name.
12479         #
12480         #  @return New GEOM_Object, containing the copied shape.
12481         #
12482         #  @ingroup l1_geomBuilder_auxiliary
12483         #  @ref swig_MakeCopy "Example"
12484         @ManageTransactions("InsertOp")
12485         def MakeCopy(self, theOriginal, theName=None):
12486             """
12487             Create a copy of the given object
12488
12489             Parameters:
12490                 theOriginal geometry object for copy
12491                 theName Object name; when specified, this parameter is used
12492                         for result publication in the study. Otherwise, if automatic
12493                         publication is switched on, default value is used for result name.
12494
12495             Returns:
12496                 New GEOM_Object, containing the copied shape.
12497
12498             Example of usage: Copy = geompy.MakeCopy(Box)
12499             """
12500             # Example: see GEOM_TestAll.py
12501             anObj = self.InsertOp.MakeCopy(theOriginal)
12502             RaiseIfFailed("MakeCopy", self.InsertOp)
12503             self._autoPublish(anObj, theName, "copy")
12504             return anObj
12505
12506         ## Add Path to load python scripts from
12507         #  @param Path a path to load python scripts from
12508         #  @ingroup l1_geomBuilder_auxiliary
12509         def addPath(self,Path):
12510             """
12511             Add Path to load python scripts from
12512
12513             Parameters:
12514                 Path a path to load python scripts from
12515             """
12516             if (sys.path.count(Path) < 1):
12517                 sys.path.append(Path)
12518                 pass
12519             pass
12520
12521         ## Load marker texture from the file
12522         #  @param Path a path to the texture file
12523         #  @return unique texture identifier
12524         #  @ingroup l1_geomBuilder_auxiliary
12525         @ManageTransactions("InsertOp")
12526         def LoadTexture(self, Path):
12527             """
12528             Load marker texture from the file
12529
12530             Parameters:
12531                 Path a path to the texture file
12532
12533             Returns:
12534                 unique texture identifier
12535             """
12536             # Example: see GEOM_TestAll.py
12537             ID = self.InsertOp.LoadTexture(Path)
12538             RaiseIfFailed("LoadTexture", self.InsertOp)
12539             return ID
12540
12541         ## Get internal name of the object based on its study entry
12542         #  @note This method does not provide an unique identifier of the geometry object.
12543         #  @note This is internal function of GEOM component, though it can be used outside it for
12544         #  appropriate reason (e.g. for identification of geometry object).
12545         #  @param obj geometry object
12546         #  @return unique object identifier
12547         #  @ingroup l1_geomBuilder_auxiliary
12548         def getObjectID(self, obj):
12549             """
12550             Get internal name of the object based on its study entry.
12551             Note: this method does not provide an unique identifier of the geometry object.
12552             It is an internal function of GEOM component, though it can be used outside GEOM for
12553             appropriate reason (e.g. for identification of geometry object).
12554
12555             Parameters:
12556                 obj geometry object
12557
12558             Returns:
12559                 unique object identifier
12560             """
12561             ID = ""
12562             entry = salome.ObjectToID(obj)
12563             if entry is not None:
12564                 lst = entry.split(":")
12565                 if len(lst) > 0:
12566                     ID = lst[-1] # -1 means last item in the list
12567                     return "GEOM_" + ID
12568             return ID
12569
12570
12571
12572         ## Add marker texture. @a Width and @a Height parameters
12573         #  specify width and height of the texture in pixels.
12574         #  If @a RowData is @c True, @a Texture parameter should represent texture data
12575         #  packed into the byte array. If @a RowData is @c False (default), @a Texture
12576         #  parameter should be unpacked string, in which '1' symbols represent opaque
12577         #  pixels and '0' represent transparent pixels of the texture bitmap.
12578         #
12579         #  @param Width texture width in pixels
12580         #  @param Height texture height in pixels
12581         #  @param Texture texture data
12582         #  @param RowData if @c True, @a Texture data are packed in the byte stream
12583         #  @return unique texture identifier
12584         #  @ingroup l1_geomBuilder_auxiliary
12585         @ManageTransactions("InsertOp")
12586         def AddTexture(self, Width, Height, Texture, RowData=False):
12587             """
12588             Add marker texture. Width and Height parameters
12589             specify width and height of the texture in pixels.
12590             If RowData is True, Texture parameter should represent texture data
12591             packed into the byte array. If RowData is False (default), Texture
12592             parameter should be unpacked string, in which '1' symbols represent opaque
12593             pixels and '0' represent transparent pixels of the texture bitmap.
12594
12595             Parameters:
12596                 Width texture width in pixels
12597                 Height texture height in pixels
12598                 Texture texture data
12599                 RowData if True, Texture data are packed in the byte stream
12600
12601             Returns:
12602                 return unique texture identifier
12603             """
12604             if not RowData: Texture = PackData(Texture)
12605             ID = self.InsertOp.AddTexture(Width, Height, Texture)
12606             RaiseIfFailed("AddTexture", self.InsertOp)
12607             return ID
12608
12609         ## Creates a new folder object. It is a container for any GEOM objects.
12610         #  @param Name name of the container
12611         #  @param Father parent object. If None,
12612         #         folder under 'Geometry' root object will be created.
12613         #  @return a new created folder
12614         #  @ingroup l1_publish_data
12615         def NewFolder(self, Name, Father=None):
12616             """
12617             Create a new folder object. It is an auxiliary container for any GEOM objects.
12618
12619             Parameters:
12620                 Name name of the container
12621                 Father parent object. If None,
12622                 folder under 'Geometry' root object will be created.
12623
12624             Returns:
12625                 a new created folder
12626             """
12627             if not Father: Father = self.father
12628             return self.CreateFolder(Name, Father)
12629
12630         ## Move object to the specified folder
12631         #  @param Object object to move
12632         #  @param Folder target folder
12633         #  @ingroup l1_publish_data
12634         def PutToFolder(self, Object, Folder):
12635             """
12636             Move object to the specified folder
12637
12638             Parameters:
12639                 Object object to move
12640                 Folder target folder
12641             """
12642             self.MoveToFolder(Object, Folder)
12643             pass
12644
12645         ## Move list of objects to the specified folder
12646         #  @param ListOfSO list of objects to move
12647         #  @param Folder target folder
12648         #  @ingroup l1_publish_data
12649         def PutListToFolder(self, ListOfSO, Folder):
12650             """
12651             Move list of objects to the specified folder
12652
12653             Parameters:
12654                 ListOfSO list of objects to move
12655                 Folder target folder
12656             """
12657             self.MoveListToFolder(ListOfSO, Folder)
12658             pass
12659
12660         ## @addtogroup l2_field
12661         ## @{
12662
12663         ## Creates a field
12664         #  @param shape the shape the field lies on
12665         #  @param name the field name
12666         #  @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12667         #  @param dimension dimension of the shape the field lies on
12668         #         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12669         #  @param componentNames names of components
12670         #  @return a created field
12671         @ManageTransactions("FieldOp")
12672         def CreateField(self, shape, name, type, dimension, componentNames):
12673             """
12674             Creates a field
12675
12676             Parameters:
12677                 shape the shape the field lies on
12678                 name  the field name
12679                 type  type of field data
12680                 dimension dimension of the shape the field lies on
12681                           0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12682                 componentNames names of components
12683
12684             Returns:
12685                 a created field
12686             """
12687             if isinstance( type, int ):
12688                 if type < 0 or type > 3:
12689                     raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12690                 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12691
12692             f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12693             RaiseIfFailed("CreateField", self.FieldOp)
12694             global geom
12695             geom._autoPublish( f, "", name)
12696             return f
12697
12698         ## Removes a field from the GEOM component
12699         #  @param field the field to remove
12700         def RemoveField(self, field):
12701             "Removes a field from the GEOM component"
12702             global geom
12703             if isinstance( field, GEOM._objref_GEOM_Field ):
12704                 geom.RemoveObject( field )
12705             elif isinstance( field, geomField ):
12706                 geom.RemoveObject( field.field )
12707             else:
12708                 raise RuntimeError, "RemoveField() : the object is not a field"
12709             return
12710
12711         ## Returns number of fields on a shape
12712         @ManageTransactions("FieldOp")
12713         def CountFields(self, shape):
12714             "Returns number of fields on a shape"
12715             nb = self.FieldOp.CountFields( shape )
12716             RaiseIfFailed("CountFields", self.FieldOp)
12717             return nb
12718
12719         ## Returns all fields on a shape
12720         @ManageTransactions("FieldOp")
12721         def GetFields(self, shape):
12722             "Returns all fields on a shape"
12723             ff = self.FieldOp.GetFields( shape )
12724             RaiseIfFailed("GetFields", self.FieldOp)
12725             return ff
12726
12727         ## Returns a field on a shape by its name
12728         @ManageTransactions("FieldOp")
12729         def GetField(self, shape, name):
12730             "Returns a field on a shape by its name"
12731             f = self.FieldOp.GetField( shape, name )
12732             RaiseIfFailed("GetField", self.FieldOp)
12733             return f
12734
12735         # end of l2_field
12736         ## @}
12737
12738
12739 import omniORB
12740 # Register the new proxy for GEOM_Gen
12741 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12742
12743
12744 ## Field on Geometry
12745 #  @ingroup l2_field
12746 class geomField( GEOM._objref_GEOM_Field ):
12747
12748     def __init__(self):
12749         GEOM._objref_GEOM_Field.__init__(self)
12750         self.field = GEOM._objref_GEOM_Field
12751         return
12752
12753     ## Returns the shape the field lies on
12754     def getShape(self):
12755         "Returns the shape the field lies on"
12756         return self.field.GetShape(self)
12757
12758     ## Returns the field name
12759     def getName(self):
12760         "Returns the field name"
12761         return self.field.GetName(self)
12762
12763     ## Returns type of field data as integer [0-3]
12764     def getType(self):
12765         "Returns type of field data"
12766         return self.field.GetDataType(self)._v
12767
12768     ## Returns type of field data:
12769     #  one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12770     def getTypeEnum(self):
12771         "Returns type of field data"
12772         return self.field.GetDataType(self)
12773
12774     ## Returns dimension of the shape the field lies on:
12775     #  0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12776     def getDimension(self):
12777         """Returns dimension of the shape the field lies on:
12778         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12779         return self.field.GetDimension(self)
12780
12781     ## Returns names of components
12782     def getComponents(self):
12783         "Returns names of components"
12784         return self.field.GetComponents(self)
12785
12786     ## Adds a time step to the field
12787     #  @param step the time step number further used as the step identifier
12788     #  @param stamp the time step time
12789     #  @param values the values of the time step
12790     def addStep(self, step, stamp, values):
12791         "Adds a time step to the field"
12792         stp = self.field.AddStep( self, step, stamp )
12793         if not stp:
12794             raise RuntimeError, \
12795                   "Field.addStep() : Error: step %s already exists in this field"%step
12796         global geom
12797         geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12798         self.setValues( step, values )
12799         return stp
12800
12801     ## Remove a time step from the field
12802     def removeStep(self,step):
12803         "Remove a time step from the field"
12804         stepSO = None
12805         try:
12806             stepObj = self.field.GetStep( self, step )
12807             if stepObj:
12808                 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
12809         except:
12810             #import traceback
12811             #traceback.print_exc()
12812             pass
12813         self.field.RemoveStep( self, step )
12814         if stepSO:
12815             geom.myBuilder.RemoveObjectWithChildren( stepSO )
12816         return
12817
12818     ## Returns number of time steps in the field
12819     def countSteps(self):
12820         "Returns number of time steps in the field"
12821         return self.field.CountSteps(self)
12822
12823     ## Returns a list of time step IDs in the field
12824     def getSteps(self):
12825         "Returns a list of time step IDs in the field"
12826         return self.field.GetSteps(self)
12827
12828     ## Returns a time step by its ID
12829     def getStep(self,step):
12830         "Returns a time step by its ID"
12831         stp = self.field.GetStep(self, step)
12832         if not stp:
12833             raise RuntimeError, "Step %s is missing from this field"%step
12834         return stp
12835
12836     ## Returns the time of the field step
12837     def getStamp(self,step):
12838         "Returns the time of the field step"
12839         return self.getStep(step).GetStamp()
12840
12841     ## Changes the time of the field step
12842     def setStamp(self, step, stamp):
12843         "Changes the time of the field step"
12844         return self.getStep(step).SetStamp(stamp)
12845
12846     ## Returns values of the field step
12847     def getValues(self, step):
12848         "Returns values of the field step"
12849         return self.getStep(step).GetValues()
12850
12851     ## Changes values of the field step
12852     def setValues(self, step, values):
12853         "Changes values of the field step"
12854         stp = self.getStep(step)
12855         errBeg = "Field.setValues(values) : Error: "
12856         try:
12857             ok = stp.SetValues( values )
12858         except Exception, e:
12859             excStr = str(e)
12860             if excStr.find("WrongPythonType") > 0:
12861                 raise RuntimeError, errBeg +\
12862                       "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
12863             raise RuntimeError, errBeg + str(e)
12864         if not ok:
12865             nbOK = self.field.GetArraySize(self)
12866             nbKO = len(values)
12867             if nbOK != nbKO:
12868                 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
12869             else:
12870                 raise RuntimeError, errBeg + "failed"
12871         return
12872
12873     pass # end of class geomField
12874
12875 # Register the new proxy for GEOM_Field
12876 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
12877
12878
12879 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12880 #  interface to GEOM operations.
12881 #
12882 #  Typical use is:
12883 #  \code
12884 #    import salome
12885 #    salome.salome_init()
12886 #    from salome.geom import geomBuilder
12887 #    geompy = geomBuilder.New(salome.myStudy)
12888 #  \endcode
12889 #  @param  study     SALOME study, generally obtained by salome.myStudy.
12890 #  @param  instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
12891 #  @return geomBuilder instance
12892 def New( study, instance=None):
12893     """
12894     Create a new geomBuilder instance.The geomBuilder class provides the Python
12895     interface to GEOM operations.
12896
12897     Typical use is:
12898         import salome
12899         salome.salome_init()
12900         from salome.geom import geomBuilder
12901         geompy = geomBuilder.New(salome.myStudy)
12902
12903     Parameters:
12904         study     SALOME study, generally obtained by salome.myStudy.
12905         instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
12906     Returns:
12907         geomBuilder instance
12908     """
12909     #print "New geomBuilder ", study, instance
12910     global engine
12911     global geom
12912     global doLcc
12913     engine = instance
12914     if engine is None:
12915       doLcc = True
12916     geom = geomBuilder()
12917     assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12918     geom.init_geom(study)
12919     return geom
12920
12921
12922 # Register methods from the plug-ins in the geomBuilder class 
12923 plugins_var = os.environ.get( "GEOM_PluginsList" )
12924
12925 plugins = None
12926 if plugins_var is not None:
12927     plugins = plugins_var.split( ":" )
12928     plugins=filter(lambda x: len(x)>0, plugins)
12929 if plugins is not None:
12930     for pluginName in plugins:
12931         pluginBuilderName = pluginName + "Builder"
12932         try:
12933             exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
12934         except Exception, e:
12935             from salome_utils import verbose
12936             print "Exception while loading %s: %s" % ( pluginBuilderName, e )
12937             continue
12938         exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
12939         plugin = eval( pluginBuilderName )
12940         
12941         # add methods from plugin module to the geomBuilder class
12942         for k in dir( plugin ):
12943             if k[0] == '_': continue
12944             method = getattr( plugin, k )
12945             if type( method ).__name__ == 'function':
12946                 if not hasattr( geomBuilder, k ):
12947                     setattr( geomBuilder, k, method )
12948                 pass
12949             pass
12950         del pluginName
12951         pass
12952     pass