Salome HOME
29470 - Point cloud on a face
[modules/geom.git] / src / GEOM_SWIG / geomBuilder.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20
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()
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, theName="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, theName=("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()
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 contains 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()
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 ##   @defgroup l2_testing       Testing
241
242 ## @}
243
244 import omniORB
245
246 # initialize SALOME session in try/except block
247 # to avoid problems in some cases, e.g. when generating documentation
248 try:
249     import salome
250     salome.salome_init()
251     from salome import *
252 except:
253     pass
254
255 from salome_notebook import *
256
257 import GEOM
258 import math
259 import os
260 import functools
261
262 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
263
264 # In case the omniORBpy EnumItem class does not fully support Python 3
265 # (for instance in version 4.2.1-2), the comparison ordering methods must be
266 # defined
267 #
268 try:
269     GEOM.COMPOUND < GEOM.SOLID
270 except TypeError:
271     def enumitem_eq(self, other):
272         try:
273             if isinstance(other, omniORB.EnumItem):
274                 if other._parent_id == self._parent_id:
275                     return self._v == other._v
276                 else:
277                     return self._parent_id == other._parent_id
278             else:
279                 return id(self) == id(other)
280         except:
281             return id(self) == id(other)
282
283     def enumitem_lt(self, other):
284         try:
285             if isinstance(other, omniORB.EnumItem):
286                 if other._parent_id == self._parent_id:
287                     return self._v < other._v
288                 else:
289                     return self._parent_id < other._parent_id
290             else:
291                 return id(self) < id(other)
292         except:
293             return id(self) < id(other)
294
295     def enumitem_le(self, other):
296         try:
297             if isinstance(other, omniORB.EnumItem):
298                 if other._parent_id == self._parent_id:
299                     return self._v <= other._v
300                 else:
301                     return self._parent_id <= other._parent_id
302             else:
303                 return id(self) <= id(other)
304         except:
305             return id(self) <= id(other)
306
307     def enumitem_gt(self, other):
308         try:
309             if isinstance(other, omniORB.EnumItem):
310                 if other._parent_id == self._parent_id:
311                     return self._v > other._v
312                 else:
313                     return self._parent_id > other._parent_id
314             else:
315                 return id(self) > id(other)
316         except:
317             return id(self) > id(other)
318
319     def enumitem_ge(self, other):
320         try:
321             if isinstance(other, omniORB.EnumItem):
322                 if other._parent_id == self._parent_id:
323                     return self._v >= other._v
324                 else:
325                     return self._parent_id >= other._parent_id
326             else:
327                 return id(self) >= id(other)
328         except:
329             return id(self) >= id(other)
330
331     GEOM.omniORB.EnumItem.__eq__ = enumitem_eq
332     GEOM.omniORB.EnumItem.__lt__ = enumitem_lt
333     GEOM.omniORB.EnumItem.__le__ = enumitem_le
334     GEOM.omniORB.EnumItem.__gt__ = enumitem_gt
335     GEOM.omniORB.EnumItem.__ge__ = enumitem_ge
336     omniORB.EnumItem.__eq__ = enumitem_eq
337     omniORB.EnumItem.__lt__ = enumitem_lt
338     omniORB.EnumItem.__le__ = enumitem_le
339     omniORB.EnumItem.__gt__ = enumitem_gt
340     omniORB.EnumItem.__ge__ = enumitem_ge
341
342 # service function
343 def _toListOfNames(_names, _size=-1):
344     l = []
345     import types
346     if type(_names) in [list, tuple]:
347         for i in _names: l.append(i)
348     elif _names:
349         l.append(_names)
350     if l and len(l) < _size:
351         for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
352     return l
353
354 # Decorator function to manage transactions for all geometric operations.
355 def ManageTransactions(theOpeName):
356     def MTDecorator(theFunction):
357         # To keep the original function name an documentation.
358         @functools.wraps(theFunction)
359         def OpenCallClose(self, *args, **kwargs):
360             # Open transaction
361             anOperation = getattr(self, theOpeName)
362             anOperation.StartOperation()
363             try:
364                 # Call the function
365                 res = theFunction(self, *args, **kwargs)
366                 # Commit transaction
367                 anOperation.FinishOperation()
368                 return res
369             except:
370                 # Abort transaction
371                 anOperation.AbortOperation()
372                 raise
373         return OpenCallClose
374     return MTDecorator
375
376 ## Raise an Error, containing the Method_name, if Operation is Failed
377 ## @ingroup l1_geomBuilder_auxiliary
378 def RaiseIfFailed (Method_name, Operation):
379     if not Operation.IsDone() and Operation.GetErrorCode() != "NOT_FOUND_ANY":
380         raise RuntimeError(Method_name + " : " + Operation.GetErrorCode())
381
382 def PrintOrRaise(message, raiseException=False):
383     if raiseException:
384         raise RuntimeError(message)
385     else:
386         print(message)
387
388 ## Return list of variables value from salome notebook
389 ## @ingroup l1_geomBuilder_auxiliary
390 def ParseParameters(*parameters):
391     Result = []
392     StringResult = []
393     for parameter in parameters:
394         if isinstance(parameter, list):
395             lResults = ParseParameters(*parameter)
396             if len(lResults) > 0:
397                 Result.append(lResults[:-1])
398                 StringResult += lResults[-1].split(":")
399                 pass
400             pass
401         else:
402             if isinstance(parameter,str):
403                 if notebook.isVariable(parameter):
404                     Result.append(notebook.get(parameter))
405                 else:
406                     raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
407                 pass
408             else:
409                 Result.append(parameter)
410                 pass
411             StringResult.append(str(parameter))
412             pass
413         pass
414     if Result:
415         Result.append(":".join(StringResult))
416     else:
417         Result = ":".join(StringResult)
418     return Result
419
420 ## Return list of variables value from salome notebook
421 ## @ingroup l1_geomBuilder_auxiliary
422 def ParseList(list):
423     Result = []
424     StringResult = ""
425     for parameter in list:
426         if isinstance(parameter,str) and notebook.isVariable(parameter):
427             Result.append(str(notebook.get(parameter)))
428             pass
429         else:
430             Result.append(str(parameter))
431             pass
432
433         StringResult = StringResult + str(parameter)
434         StringResult = StringResult + ":"
435         pass
436     StringResult = StringResult[:len(StringResult)-1]
437     return Result, StringResult
438
439 ## Return list of variables value from salome notebook
440 ## @ingroup l1_geomBuilder_auxiliary
441 def ParseSketcherCommand(command):
442     Result = ""
443     StringResult = ""
444     sections = command.split(":")
445     for section in sections:
446         parameters = section.split(" ")
447         paramIndex = 1
448         for parameter in parameters:
449             if paramIndex > 1 and parameter.find("'") != -1:
450                 parameter = parameter.replace("'","")
451                 if notebook.isVariable(parameter):
452                     Result = Result + str(notebook.get(parameter)) + " "
453                     pass
454                 else:
455                     raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
456                     pass
457                 pass
458             else:
459                 Result = Result + str(parameter) + " "
460                 pass
461             if paramIndex > 1:
462                 StringResult = StringResult + parameter
463                 StringResult = StringResult + ":"
464                 pass
465             paramIndex = paramIndex + 1
466             pass
467         Result = Result[:len(Result)-1] + ":"
468         pass
469     Result = Result[:len(Result)-1]
470     return Result, StringResult
471
472 ## Helper function which can be used to pack the passed string to the byte data.
473 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
474 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
475 ## For example,
476 ## \code
477 ## val = PackData("10001110") # val = 0xAE
478 ## val = PackData("1")        # val = 0x80
479 ## \endcode
480 ## @param data unpacked data - a string containing '1' and '0' symbols
481 ## @return data packed to the byte stream
482 ## @ingroup l1_geomBuilder_auxiliary
483 def PackData(data):
484     """
485     Helper function which can be used to pack the passed string to the byte data.
486     Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
487     If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
488
489     Parameters:
490         data unpacked data - a string containing '1' and '0' symbols
491
492     Returns:
493         data packed to the byte stream
494
495     Example of usage:
496         val = PackData("10001110") # val = 0xAE
497         val = PackData("1")        # val = 0x80
498     """
499     bytes = len(data)/8
500     if len(data)%8: bytes += 1
501     res = ""
502     for b in range(bytes):
503         d = data[b*8:(b+1)*8]
504         val = 0
505         for i in range(8):
506             val *= 2
507             if i < len(d):
508                 if d[i] == "1": val += 1
509                 elif d[i] != "0":
510                     raise "Invalid symbol %s" % d[i]
511                 pass
512             pass
513         res += chr(val)
514         pass
515     return res
516
517 ## Read bitmap texture from the text file.
518 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
519 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
520 ## The function returns width and height of the pixmap in pixels and byte stream representing
521 ## texture bitmap itself.
522 ##
523 ## This function can be used to read the texture to the byte stream in order to pass it to
524 ## the AddTexture() function of geomBuilder class.
525 ## For example,
526 ## \code
527 ## from salome.geom import geomBuilder
528 ## geompy = geomBuilder.New()
529 ## texture = geompy.readtexture('mytexture.dat')
530 ## texture = geompy.AddTexture(*texture)
531 ## obj.SetMarkerTexture(texture)
532 ## \endcode
533 ## @param fname texture file name
534 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
535 ## @ingroup l1_geomBuilder_auxiliary
536 def ReadTexture(fname):
537     """
538     Read bitmap texture from the text file.
539     In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
540     A zero symbol ('0') represents transparent pixel of the texture bitmap.
541     The function returns width and height of the pixmap in pixels and byte stream representing
542     texture bitmap itself.
543     This function can be used to read the texture to the byte stream in order to pass it to
544     the AddTexture() function of geomBuilder class.
545
546     Parameters:
547         fname texture file name
548
549     Returns:
550         sequence of tree values: texture's width, height in pixels and its byte stream
551
552     Example of usage:
553         from salome.geom import geomBuilder
554         geompy = geomBuilder.New()
555         texture = geompy.readtexture('mytexture.dat')
556         texture = geompy.AddTexture(*texture)
557         obj.SetMarkerTexture(texture)
558     """
559     try:
560         f = open(fname)
561         lines = [ l.strip() for l in f.readlines()]
562         f.close()
563         maxlen = 0
564         if lines: maxlen = max([len(x) for x in lines])
565         lenbytes = maxlen/8
566         if maxlen%8: lenbytes += 1
567         bytedata=""
568         for line in lines:
569             if len(line)%8:
570                 lenline = (len(line)/8+1)*8
571                 pass
572             else:
573                 lenline = (len(line)/8)*8
574                 pass
575             for i in range(lenline/8):
576                 byte=""
577                 for j in range(8):
578                     if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
579                     else: byte += "0"
580                     pass
581                 bytedata += PackData(byte)
582                 pass
583             for i in range(lenline/8, lenbytes):
584                 bytedata += PackData("0")
585             pass
586         return lenbytes*8, len(lines), bytedata
587     except:
588         pass
589     return 0, 0, ""
590
591 ## Returns a long value from enumeration type
592 #  Can be used for CORBA enumerator types like GEOM.shape_type
593 #  @param theItem enumeration type
594 #  @ingroup l1_geomBuilder_auxiliary
595 def EnumToLong(theItem):
596     """
597     Returns a long value from enumeration type
598     Can be used for CORBA enumerator types like geomBuilder.ShapeType
599
600     Parameters:
601         theItem enumeration type
602     """
603     ret = theItem
604     if hasattr(theItem, "_v"): ret = theItem._v
605     return ret
606
607 ## Pack an argument into a list
608 def ToList( arg ):
609     if isinstance( arg, list ):
610         return arg
611     if hasattr( arg, "__getitem__" ):
612         return list( arg )
613     return [ arg ]
614
615 ## Information about closed/unclosed state of shell or wire
616 #  @ingroup l1_geomBuilder_auxiliary
617 class info:
618     """
619     Information about closed/unclosed state of shell or wire
620     """
621     UNKNOWN  = 0
622     CLOSED   = 1
623     UNCLOSED = 2
624
625 ## Private class used to bind calls of plugin operations to geomBuilder
626 class PluginOperation:
627   def __init__(self, operation, function):
628     self.operation = operation
629     self.function = function
630     pass
631
632   @ManageTransactions("operation")
633   def __call__(self, *args):
634     res = self.function(self.operation, *args)
635     RaiseIfFailed(self.function.__name__, self.operation)
636     return res
637
638 # Warning: geom is a singleton
639 geom = None
640 engine = None
641 doLcc = False
642 created = False
643
644 class geomBuilder(GEOM._objref_GEOM_Gen):
645
646         ## Enumeration ShapeType as a dictionary. \n
647         ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
648         #  @ingroup l1_geomBuilder_auxiliary
649         ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
650
651         ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
652         #  and a list of parameters, describing the shape.
653         #  List of parameters, describing the shape:
654         #  - COMPOUND:            [nb_solids  nb_faces  nb_edges  nb_vertices]
655         #  - COMPSOLID:           [nb_solids  nb_faces  nb_edges  nb_vertices]
656         #
657         #  - SHELL:       [info.CLOSED / info.UNCLOSED  nb_faces  nb_edges  nb_vertices]
658         #
659         #  - WIRE:        [info.CLOSED / info.UNCLOSED nb_edges  nb_vertices]
660         #
661         #  - SPHERE:       [xc yc zc            R]
662         #  - CYLINDER:     [xb yb zb  dx dy dz  R         H]
663         #  - BOX:          [xc yc zc                      ax ay az]
664         #  - ROTATED_BOX:  [xc yc zc  zx zy zz  xx xy xz  ax ay az]
665         #  - TORUS:        [xc yc zc  dx dy dz  R_1  R_2]
666         #  - CONE:         [xb yb zb  dx dy dz  R_1  R_2  H]
667         #  - POLYHEDRON:                       [nb_faces  nb_edges  nb_vertices]
668         #  - SOLID:                            [nb_faces  nb_edges  nb_vertices]
669         #
670         #  - SPHERE2D:     [xc yc zc            R]
671         #  - CYLINDER2D:   [xb yb zb  dx dy dz  R         H]
672         #  - TORUS2D:      [xc yc zc  dx dy dz  R_1  R_2]
673         #  - CONE2D:       [xc yc zc  dx dy dz  R_1  R_2  H]
674         #  - DISK_CIRCLE:  [xc yc zc  dx dy dz  R]
675         #  - DISK_ELLIPSE: [xc yc zc  dx dy dz  R_1  R_2]
676         #  - POLYGON:      [xo yo zo  dx dy dz            nb_edges  nb_vertices]
677         #  - PLANE:        [xo yo zo  dx dy dz]
678         #  - PLANAR:       [xo yo zo  dx dy dz            nb_edges  nb_vertices]
679         #  - FACE:                                       [nb_edges  nb_vertices]
680         #
681         #  - CIRCLE:       [xc yc zc  dx dy dz  R]
682         #  - ARC_CIRCLE:   [xc yc zc  dx dy dz  R         x1 y1 z1  x2 y2 z2]
683         #  - ELLIPSE:      [xc yc zc  dx dy dz  R_1  R_2]
684         #  - ARC_ELLIPSE:  [xc yc zc  dx dy dz  R_1  R_2  x1 y1 z1  x2 y2 z2]
685         #  - LINE:         [xo yo zo  dx dy dz]
686         #  - SEGMENT:      [x1 y1 z1  x2 y2 z2]
687         #  - EDGE:                                                 [nb_vertices]
688         #
689         #  - VERTEX:       [x  y  z]
690         #
691         #  - LCS:          [x y z  xx xy xz  yx yy yz  zx zy zz]
692         #  @ingroup l1_geomBuilder_auxiliary
693         kind = GEOM.GEOM_IKindOfShape
694
695         def __new__(cls, *args):
696             global engine
697             global geom
698             global doLcc
699             global created
700             #print "==== __new__ ", engine, geom, doLcc, created
701             if geom is None:
702                 # geom engine is either retrieved from engine, or created
703                 geom = engine
704                 # Following test avoids a recursive loop
705                 if doLcc:
706                     if geom is not None:
707                         # geom engine not created: existing engine found
708                         doLcc = False
709                     if doLcc and not created:
710                         doLcc = False
711                         # FindOrLoadComponent called:
712                         # 1. CORBA resolution of server
713                         # 2. the __new__ method is called again
714                         #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
715                         geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
716                         #print "====1 ",geom
717                 else:
718                     # FindOrLoadComponent not called
719                     if geom is None:
720                         # geomBuilder instance is created from lcc.FindOrLoadComponent
721                         #print "==== super ", engine, geom, doLcc, created
722                         geom = super(geomBuilder,cls).__new__(cls)
723                         #print "====2 ",geom
724                     else:
725                         # geom engine not created: existing engine found
726                         #print "==== existing ", engine, geom, doLcc, created
727                         pass
728                 #print "return geom 1 ", geom
729                 return geom
730
731             #print "return geom 2 ", geom
732             return geom
733
734         def __init__(self, *args):
735             global created
736             #print "-------- geomBuilder __init__ --- ", created, self
737             if not created:
738               created = True
739               GEOM._objref_GEOM_Gen.__init__(self, *args)
740               self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
741               self.myBuilder = None
742               self.BasicOp  = None
743               self.CurvesOp = None
744               self.PrimOp   = None
745               self.ShapesOp = None
746               self.HealOp   = None
747               self.InsertOp = None
748               self.BoolOp   = None
749               self.TrsfOp   = None
750               self.LocalOp  = None
751               self.MeasuOp  = None
752               self.BlocksOp = None
753               self.GroupOp  = None
754               self.FieldOp  = None
755               self.TestOp   = None
756             pass
757
758         ## Process object publication in the study, as follows:
759         #  - if @a theName is specified (not None), the object is published in the study
760         #    with this name, not taking into account "auto-publishing" option;
761         #  - if @a theName is NOT specified, the object is published in the study
762         #    (using default name, which can be customized using @a theDefaultName parameter)
763         #    only if auto-publishing is switched on.
764         #
765         #  @param theObj  object, a subject for publishing
766         #  @param theName object name for study
767         #  @param theDefaultName default name for the auto-publishing
768         #
769         #  @sa addToStudyAuto()
770         def _autoPublish(self, theObj, theName, theDefaultName="noname"):
771             # ---
772             def _item_name(_names, _defname, _idx=-1):
773                 if not _names: _names = _defname
774                 if type(_names) in [list, tuple]:
775                     if _idx >= 0:
776                         if _idx >= len(_names) or not _names[_idx]:
777                             if type(_defname) not in [list, tuple]:
778                                 _name = "%s_%d"%(_defname, _idx+1)
779                             elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
780                                 _name = _defname[_idx]
781                             else:
782                                 _name = "%noname_%d"%(dn, _idx+1)
783                             pass
784                         else:
785                             _name = _names[_idx]
786                         pass
787                     else:
788                         # must be wrong  usage
789                         _name = _names[0]
790                     pass
791                 else:
792                     if _idx >= 0:
793                         _name = "%s_%d"%(_names, _idx+1)
794                     else:
795                         _name = _names
796                     pass
797                 return _name
798             # ---
799             def _publish( _name, _obj ):
800                 fatherObj = None
801                 if isinstance( _obj, GEOM._objref_GEOM_Field ):
802                     fatherObj = _obj.GetShape()
803                 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
804                     fatherObj = _obj.GetField()
805                 elif not _obj.IsMainShape():
806                     fatherObj = _obj.GetMainShape()
807                     pass
808                 if fatherObj and fatherObj.GetStudyEntry():
809                     self.addToStudyInFather(fatherObj, _obj, _name)
810                 else:
811                     self.addToStudy(_obj, _name)
812                     pass
813                 return
814             # ---
815             if not theObj:
816                 return # null object
817             if not theName and not self.myMaxNbSubShapesAllowed:
818                 return # nothing to do: auto-publishing is disabled
819             if not theName and not theDefaultName:
820                 return # neither theName nor theDefaultName is given
821             import types
822             if type(theObj) in [list, tuple]:
823                 # list of objects is being published
824                 idx = 0
825                 for obj in theObj:
826                     if not obj: continue # bad object
827                     name = _item_name(theName, theDefaultName, idx)
828                     _publish( name, obj )
829                     idx = idx+1
830                     if not theName and idx == self.myMaxNbSubShapesAllowed: break
831                     pass
832                 pass
833             else:
834                 # single object is published
835                 name = _item_name(theName, theDefaultName)
836                 _publish( name, theObj )
837             pass
838
839         ## @addtogroup l1_geomBuilder_auxiliary
840         ## @{
841         def init_geom(self):
842             self.myStudy = salome.myStudy
843             self.myBuilder = self.myStudy.NewBuilder()
844
845             # load data from the study file, if necessary
846             component = self.myStudy.FindComponent("GEOM")
847             if component:
848                 self.myBuilder.LoadWith(component, self)
849
850             self.BasicOp  = self.GetIBasicOperations    ()
851             self.CurvesOp = self.GetICurvesOperations   ()
852             self.PrimOp   = self.GetI3DPrimOperations   ()
853             self.ShapesOp = self.GetIShapesOperations   ()
854             self.HealOp   = self.GetIHealingOperations  ()
855             self.InsertOp = self.GetIInsertOperations   ()
856             self.BoolOp   = self.GetIBooleanOperations  ()
857             self.TrsfOp   = self.GetITransformOperations()
858             self.LocalOp  = self.GetILocalOperations    ()
859             self.MeasuOp  = self.GetIMeasureOperations  ()
860             self.BlocksOp = self.GetIBlocksOperations   ()
861             self.GroupOp  = self.GetIGroupOperations    ()
862             self.FieldOp  = self.GetIFieldOperations    ()
863             self.TestOp   = self.GetITestOperations     ()
864
865             notebook.myStudy = self.myStudy
866             pass
867
868         def GetPluginOperations(self, libraryName):
869             op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, libraryName)
870             return op
871
872         ## Enable / disable results auto-publishing
873         #
874         #  The automatic publishing is managed in the following way:
875         #  - if @a maxNbSubShapes = 0, automatic publishing is disabled.
876         #  - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
877         #  maximum number of sub-shapes allowed for publishing is unlimited; any negative
878         #  value passed as parameter has the same effect.
879         #  - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
880         #  maximum number of sub-shapes allowed for publishing is set to specified value.
881         #
882         #  @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
883         #  @ingroup l1_publish_data
884         def addToStudyAuto(self, maxNbSubShapes=-1):
885             """
886             Enable / disable results auto-publishing
887
888             The automatic publishing is managed in the following way:
889             - if @a maxNbSubShapes = 0, automatic publishing is disabled;
890             - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
891             maximum number of sub-shapes allowed for publishing is unlimited; any negative
892             value passed as parameter has the same effect.
893             - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
894             maximum number of sub-shapes allowed for publishing is set to this value.
895
896             Parameters:
897                 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
898
899             Example of usage:
900                 geompy.addToStudyAuto()   # enable auto-publishing
901                 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
902                 geompy.addToStudyAuto(0)  # disable auto-publishing
903             """
904             self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
905             pass
906
907         ## Dump component to the Python script
908         #  This method overrides IDL function to allow default values for the parameters.
909         def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
910             """
911             Dump component to the Python script
912             This method overrides IDL function to allow default values for the parameters.
913             """
914             return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
915
916         ## Get name for sub-shape aSubObj of shape aMainObj
917         #
918         # @ref swig_SubShapeName "Example"
919         @ManageTransactions("ShapesOp")
920         def SubShapeName(self,aSubObj, aMainObj):
921             """
922             Get name for sub-shape aSubObj of shape aMainObj
923             """
924             # Example: see GEOM_TestAll.py
925
926             #aSubId  = orb.object_to_string(aSubObj)
927             #aMainId = orb.object_to_string(aMainObj)
928             #index = gg.getIndexTopology(aSubId, aMainId)
929             #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
930             index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
931             name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
932             return name
933
934         ## Publish in study aShape with name aName
935         #
936         #  \param aShape the shape to be published
937         #  \param aName  the name for the shape
938         #  \param doRestoreSubShapes if True, finds and publishes also
939         #         sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
940         #         and published sub-shapes of arguments
941         #  \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
942         #                                                  these arguments description
943         #  \return study entry of the published shape in form of string
944         #
945         #  @ingroup l1_publish_data
946         #  @ref swig_all_addtostudy "Example"
947         def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
948                        theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
949             """
950             Publish in study aShape with name aName
951
952             Parameters:
953                 aShape the shape to be published
954                 aName  the name for the shape
955                 doRestoreSubShapes if True, finds and publishes also
956                                    sub-shapes of aShape, corresponding to its arguments
957                                    and published sub-shapes of arguments
958                 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
959                                                          these arguments description
960
961             Returns:
962                 study entry of the published shape in form of string
963
964             Example of usage:
965                 id_block1 = geompy.addToStudy(Block1, "Block 1")
966             """
967             # Example: see GEOM_TestAll.py
968             try:
969                 aSObject = self.AddInStudy(aShape, aName, None)
970                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
971                 if doRestoreSubShapes:
972                     self.RestoreSubShapesSO(aSObject, theArgs,
973                                             theFindMethod, theInheritFirstArg, True )
974             except:
975                 print("addToStudy() failed")
976                 return ""
977             return aShape.GetStudyEntry()
978
979         ## Publish in study aShape with name aName as sub-object of previously published aFather
980         #  \param aFather previously published object
981         #  \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
982         #  \param aName  the name for the shape
983         #
984         #  \return study entry of the published shape in form of string
985         #
986         #  @ingroup l1_publish_data
987         #  @ref swig_all_addtostudyInFather "Example"
988         def addToStudyInFather(self, aFather, aShape, aName):
989             """
990             Publish in study aShape with name aName as sub-object of previously published aFather
991
992             Parameters:
993                 aFather previously published object
994                 aShape the shape to be published as sub-object of aFather
995                 aName  the name for the shape
996
997             Returns:
998                 study entry of the published shape in form of string
999             """
1000             # Example: see GEOM_TestAll.py
1001             try:
1002                 aSObject = self.AddInStudy(aShape, aName, aFather)
1003                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
1004             except:
1005                 print("addToStudyInFather() failed")
1006                 return ""
1007             return aShape.GetStudyEntry()
1008
1009         ## Unpublish object in study
1010         #
1011         #  \param obj the object to be unpublished
1012         def hideInStudy(self, obj):
1013             """
1014             Unpublish object in study
1015
1016             Parameters:
1017                 obj the object to be unpublished
1018             """
1019             ior = salome.orb.object_to_string(obj)
1020             aSObject = self.myStudy.FindObjectIOR(ior)
1021             if aSObject is not None:
1022                 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
1023                 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1024                 drwAttribute.SetDrawable(False)
1025                 # hide references if any
1026                 vso = self.myStudy.FindDependances(aSObject);
1027                 for refObj in vso :
1028                     genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
1029                     drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1030                     drwAttribute.SetDrawable(False)
1031                     pass
1032                 pass
1033
1034         # end of l1_geomBuilder_auxiliary
1035         ## @}
1036
1037         ## @addtogroup l3_restore_ss
1038         ## @{
1039
1040         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1041         #  To be used from python scripts out of addToStudy() (non-default usage)
1042         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
1043         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1044         #                   If this list is empty, all operation arguments will be published
1045         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
1046         #                       their sub-shapes. Value from enumeration GEOM.find_shape_method.
1047         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1048         #                            Do not publish sub-shapes in place of arguments, but only
1049         #                            in place of sub-shapes of the first argument,
1050         #                            because the whole shape corresponds to the first argument.
1051         #                            Mainly to be used after transformations, but it also can be
1052         #                            useful after partition with one object shape, and some other
1053         #                            operations, where only the first argument has to be considered.
1054         #                            If theObject has only one argument shape, this flag is automatically
1055         #                            considered as True, not regarding really passed value.
1056         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1057         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1058         #  \return list of published sub-shapes
1059         #
1060         #  @ref tui_restore_prs_params "Example"
1061         def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1062                               theInheritFirstArg=False, theAddPrefix=True):
1063             """
1064             Publish sub-shapes, standing for arguments and sub-shapes of arguments
1065             To be used from python scripts out of geompy.addToStudy (non-default usage)
1066
1067             Parameters:
1068                 theObject published GEOM.GEOM_Object, arguments of which will be published
1069                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1070                           If this list is empty, all operation arguments will be published
1071                 theFindMethod method to search sub-shapes, corresponding to arguments and
1072                               their sub-shapes. Value from enumeration GEOM.find_shape_method.
1073                 theInheritFirstArg set properties of the first argument for theObject.
1074                                    Do not publish sub-shapes in place of arguments, but only
1075                                    in place of sub-shapes of the first argument,
1076                                    because the whole shape corresponds to the first argument.
1077                                    Mainly to be used after transformations, but it also can be
1078                                    useful after partition with one object shape, and some other
1079                                    operations, where only the first argument has to be considered.
1080                                    If theObject has only one argument shape, this flag is automatically
1081                                    considered as True, not regarding really passed value.
1082                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1083                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1084             Returns:
1085                 list of published sub-shapes
1086             """
1087             # Example: see GEOM_TestAll.py
1088             return self.RestoreSubShapesO(theObject, theArgs,
1089                                           theFindMethod, theInheritFirstArg, theAddPrefix)
1090
1091         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1092         #  To be used from python scripts out of addToStudy() (non-default usage)
1093         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
1094         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1095         #                   If this list is empty, all operation arguments will be published
1096         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
1097         #                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
1098         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1099         #                            Do not publish sub-shapes in place of arguments, but only
1100         #                            in place of sub-shapes of the first argument,
1101         #                            because the whole shape corresponds to the first argument.
1102         #                            Mainly to be used after transformations, but it also can be
1103         #                            useful after partition with one object shape, and some other
1104         #                            operations, where only the first argument has to be considered.
1105         #                            If theObject has only one argument shape, this flag is automatically
1106         #                            considered as True, not regarding really passed value.
1107         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1108         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1109         #  \return list of published sub-shapes
1110         #
1111         #  @ref tui_restore_prs_params "Example"
1112         def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1113                                    theInheritFirstArg=False, theAddPrefix=True):
1114             """
1115             Publish sub-shapes, standing for arguments and sub-shapes of arguments
1116             To be used from python scripts out of geompy.addToStudy() (non-default usage)
1117
1118             Parameters:
1119                 theObject published GEOM.GEOM_Object, arguments of which will be published
1120                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1121                           If this list is empty, all operation arguments will be published
1122                 theFindMethod method to search sub-shapes, corresponding to arguments and
1123                               their sub-shapes. Value from enumeration GEOM::find_shape_method.
1124                 theInheritFirstArg set properties of the first argument for theObject.
1125                                    Do not publish sub-shapes in place of arguments, but only
1126                                    in place of sub-shapes of the first argument,
1127                                    because the whole shape corresponds to the first argument.
1128                                    Mainly to be used after transformations, but it also can be
1129                                    useful after partition with one object shape, and some other
1130                                    operations, where only the first argument has to be considered.
1131                                    If theObject has only one argument shape, this flag is automatically
1132                                    considered as True, not regarding really passed value.
1133                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1134                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1135
1136             Returns:
1137                 list of published sub-shapes
1138             """
1139             # Example: see GEOM_TestAll.py
1140             return self.RestoreGivenSubShapesO(theObject, theArgs,
1141                                                theFindMethod, theInheritFirstArg, theAddPrefix)
1142
1143         # end of l3_restore_ss
1144         ## @}
1145
1146         ## @addtogroup l3_basic_go
1147         ## @{
1148
1149         ## Create point by three coordinates.
1150         #  @param theX The X coordinate of the point.
1151         #  @param theY The Y coordinate of the point.
1152         #  @param theZ The Z coordinate of the point.
1153         #  @param theName Object name; when specified, this parameter is used
1154         #         for result publication in the study. Otherwise, if automatic
1155         #         publication is switched on, default value is used for result name.
1156         #
1157         #  @return New GEOM.GEOM_Object, containing the created point.
1158         #
1159         #  @ref tui_creation_point "Example"
1160         @ManageTransactions("BasicOp")
1161         def MakeVertex(self, theX, theY, theZ, theName=None):
1162             """
1163             Create point by three coordinates.
1164
1165             Parameters:
1166                 theX The X coordinate of the point.
1167                 theY The Y coordinate of the point.
1168                 theZ The Z coordinate of the point.
1169                 theName Object name; when specified, this parameter is used
1170                         for result publication in the study. Otherwise, if automatic
1171                         publication is switched on, default value is used for result name.
1172
1173             Returns:
1174                 New GEOM.GEOM_Object, containing the created point.
1175             """
1176             # Example: see GEOM_TestAll.py
1177             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1178             anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1179             RaiseIfFailed("MakePointXYZ", self.BasicOp)
1180             anObj.SetParameters(Parameters)
1181             self._autoPublish(anObj, theName, "vertex")
1182             return anObj
1183
1184         ## Create a point, distant from the referenced point
1185         #  on the given distances along the coordinate axes.
1186         #  @param theReference The referenced point.
1187         #  @param theX Displacement from the referenced point along OX axis.
1188         #  @param theY Displacement from the referenced point along OY axis.
1189         #  @param theZ Displacement from the referenced point along OZ axis.
1190         #  @param theName Object name; when specified, this parameter is used
1191         #         for result publication in the study. Otherwise, if automatic
1192         #         publication is switched on, default value is used for result name.
1193         #
1194         #  @return New GEOM.GEOM_Object, containing the created point.
1195         #
1196         #  @ref tui_creation_point "Example"
1197         @ManageTransactions("BasicOp")
1198         def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1199             """
1200             Create a point, distant from the referenced point
1201             on the given distances along the coordinate axes.
1202
1203             Parameters:
1204                 theReference The referenced point.
1205                 theX Displacement from the referenced point along OX axis.
1206                 theY Displacement from the referenced point along OY axis.
1207                 theZ Displacement from the referenced point along OZ axis.
1208                 theName Object name; when specified, this parameter is used
1209                         for result publication in the study. Otherwise, if automatic
1210                         publication is switched on, default value is used for result name.
1211
1212             Returns:
1213                 New GEOM.GEOM_Object, containing the created point.
1214             """
1215             # Example: see GEOM_TestAll.py
1216             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1217             anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1218             RaiseIfFailed("MakePointWithReference", self.BasicOp)
1219             anObj.SetParameters(Parameters)
1220             self._autoPublish(anObj, theName, "vertex")
1221             return anObj
1222
1223         ## Create a point, corresponding to the given parameter on the given curve.
1224         #  @param theRefCurve The referenced curve.
1225         #  @param theParameter Value of parameter on the referenced curve.
1226         #  @param takeOrientationIntoAccount flag that tells if it is necessary
1227         #         to take the curve's orientation into account for the
1228         #         operation. I.e. if this flag is set, the results for the same
1229         #         parameters (except the value 0.5) is different for forward
1230         #         and reversed curves. If it is not set the result is the same.
1231         #  @param theName Object name; when specified, this parameter is used
1232         #         for result publication in the study. Otherwise, if automatic
1233         #         publication is switched on, default value is used for result name.
1234         #
1235         #  @return New GEOM.GEOM_Object, containing the created point.
1236         #
1237         #  @ref tui_creation_point "Example"
1238         @ManageTransactions("BasicOp")
1239         def MakeVertexOnCurve(self, theRefCurve, theParameter,
1240                               takeOrientationIntoAccount=False, theName=None):
1241             """
1242             Create a point, corresponding to the given parameter on the given curve.
1243
1244             Parameters:
1245                 theRefCurve The referenced curve.
1246                 theParameter Value of parameter on the referenced curve.
1247                 takeOrientationIntoAccount flag that tells if it is necessary
1248                         to take the curve's orientation into account for the
1249                         operation. I.e. if this flag is set, the results for
1250                         the same parameters (except the value 0.5) is different
1251                         for forward and reversed curves. If it is not set
1252                         the result is the same.
1253                 theName Object name; when specified, this parameter is used
1254                         for result publication in the study. Otherwise, if automatic
1255                         publication is switched on, default value is used for result name.
1256
1257             Returns:
1258                 New GEOM.GEOM_Object, containing the created point.
1259
1260             Example of usage:
1261                 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1262             """
1263             # Example: see GEOM_TestAll.py
1264             theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
1265                 theParameter, takeOrientationIntoAccount)
1266             anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
1267                                                   takeOrientationIntoAccount)
1268             RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1269             anObj.SetParameters(Parameters)
1270             self._autoPublish(anObj, theName, "vertex")
1271             return anObj
1272
1273         ## Create a point by projection give coordinates on the given curve
1274         #  @param theRefCurve The referenced curve.
1275         #  @param theX X-coordinate in 3D space
1276         #  @param theY Y-coordinate in 3D space
1277         #  @param theZ Z-coordinate in 3D space
1278         #  @param theName Object name; when specified, this parameter is used
1279         #         for result publication in the study. Otherwise, if automatic
1280         #         publication is switched on, default value is used for result name.
1281         #
1282         #  @return New GEOM.GEOM_Object, containing the created point.
1283         #
1284         #  @ref tui_creation_point "Example"
1285         @ManageTransactions("BasicOp")
1286         def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1287             """
1288             Create a point by projection give coordinates on the given curve
1289
1290             Parameters:
1291                 theRefCurve The referenced curve.
1292                 theX X-coordinate in 3D space
1293                 theY Y-coordinate in 3D space
1294                 theZ Z-coordinate in 3D space
1295                 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             Returns:
1300                 New GEOM.GEOM_Object, containing the created point.
1301
1302             Example of usage:
1303                 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1304             """
1305             # Example: see GEOM_TestAll.py
1306             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1307             anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1308             RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1309             anObj.SetParameters(Parameters)
1310             self._autoPublish(anObj, theName, "vertex")
1311             return anObj
1312
1313         ## Create a point, corresponding to the given length on the given curve.
1314         #  @param theRefCurve The referenced curve.
1315         #  @param theLength Length on the referenced curve. It can be negative.
1316         #  @param theStartPoint Point allowing to choose the direction for the calculation
1317         #                       of the length. If None, start from the first point of theRefCurve.
1318         #  @param theName Object name; when specified, this parameter is used
1319         #         for result publication in the study. Otherwise, if automatic
1320         #         publication is switched on, default value is used for result name.
1321         #
1322         #  @return New GEOM.GEOM_Object, containing the created point.
1323         #
1324         #  @ref tui_creation_point "Example"
1325         @ManageTransactions("BasicOp")
1326         def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1327             """
1328             Create a point, corresponding to the given length on the given curve.
1329
1330             Parameters:
1331                 theRefCurve The referenced curve.
1332                 theLength Length on the referenced curve. It can be negative.
1333                 theStartPoint Point allowing to choose the direction for the calculation
1334                               of the length. If None, start from the first point of theRefCurve.
1335                 theName Object name; when specified, this parameter is used
1336                         for result publication in the study. Otherwise, if automatic
1337                         publication is switched on, default value is used for result name.
1338
1339             Returns:
1340                 New GEOM.GEOM_Object, containing the created point.
1341             """
1342             # Example: see GEOM_TestAll.py
1343             theLength, Parameters = ParseParameters(theLength)
1344             anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1345             RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1346             anObj.SetParameters(Parameters)
1347             self._autoPublish(anObj, theName, "vertex")
1348             return anObj
1349
1350         ## Create a point, corresponding to the given parameters on the
1351         #    given surface.
1352         #  @param theRefSurf The referenced surface.
1353         #  @param theUParameter Value of U-parameter on the referenced surface.
1354         #  @param theVParameter Value of V-parameter on the referenced surface.
1355         #  @param theName Object name; when specified, this parameter is used
1356         #         for result publication in the study. Otherwise, if automatic
1357         #         publication is switched on, default value is used for result name.
1358         #
1359         #  @return New GEOM.GEOM_Object, containing the created point.
1360         #
1361         #  @ref swig_MakeVertexOnSurface "Example"
1362         @ManageTransactions("BasicOp")
1363         def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1364             """
1365             Create a point, corresponding to the given parameters on the
1366             given surface.
1367
1368             Parameters:
1369                 theRefSurf The referenced surface.
1370                 theUParameter Value of U-parameter on the referenced surface.
1371                 theVParameter Value of V-parameter on the referenced surface.
1372                 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             Returns:
1377                 New GEOM.GEOM_Object, containing the created point.
1378
1379             Example of usage:
1380                 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1381             """
1382             theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1383             # Example: see GEOM_TestAll.py
1384             anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1385             RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1386             anObj.SetParameters(Parameters);
1387             self._autoPublish(anObj, theName, "vertex")
1388             return anObj
1389
1390         ## Create a point by projection give coordinates on the given surface
1391         #  @param theRefSurf The referenced surface.
1392         #  @param theX X-coordinate in 3D space
1393         #  @param theY Y-coordinate in 3D space
1394         #  @param theZ Z-coordinate in 3D space
1395         #  @param theName Object name; when specified, this parameter is used
1396         #         for result publication in the study. Otherwise, if automatic
1397         #         publication is switched on, default value is used for result name.
1398         #
1399         #  @return New GEOM.GEOM_Object, containing the created point.
1400         #
1401         #  @ref swig_MakeVertexOnSurfaceByCoord "Example"
1402         @ManageTransactions("BasicOp")
1403         def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1404             """
1405             Create a point by projection give coordinates on the given surface
1406
1407             Parameters:
1408                 theRefSurf The referenced surface.
1409                 theX X-coordinate in 3D space
1410                 theY Y-coordinate in 3D space
1411                 theZ Z-coordinate in 3D space
1412                 theName Object name; when specified, this parameter is used
1413                         for result publication in the study. Otherwise, if automatic
1414                         publication is switched on, default value is used for result name.
1415
1416             Returns:
1417                 New GEOM.GEOM_Object, containing the created point.
1418
1419             Example of usage:
1420                 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1421             """
1422             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1423             # Example: see GEOM_TestAll.py
1424             anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1425             RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1426             anObj.SetParameters(Parameters);
1427             self._autoPublish(anObj, theName, "vertex")
1428             return anObj
1429
1430         ## Create a point, which lays on the given face.
1431         #  The point will lay in arbitrary place of the face.
1432         #  The only condition on it is a non-zero distance to the face boundary.
1433         #  Such point can be used to uniquely identify the face inside any
1434         #  shape in case, when the shape does not contain overlapped faces.
1435         #  @param theFace The referenced face.
1436         #  @param theName Object name; when specified, this parameter is used
1437         #         for result publication in the study. Otherwise, if automatic
1438         #         publication is switched on, default value is used for result name.
1439         #
1440         #  @return New GEOM.GEOM_Object, containing the created point.
1441         #
1442         #  @ref swig_MakeVertexInsideFace "Example"
1443         @ManageTransactions("BasicOp")
1444         def MakeVertexInsideFace (self, theFace, theNumberOfPnts=1, theName=None):
1445             """
1446             Create a point, which lays on the given face.
1447             The point will lay in arbitrary place of the face.
1448             The only condition on it is a non-zero distance to the face boundary.
1449             Such point can be used to uniquely identify the face inside any
1450             shape in case, when the shape does not contain overlapped faces.
1451
1452             Parameters:
1453                 theFace The referenced face.
1454                 theNumberOfPnts The number of points we want to get, 1 by default.
1455                 theName Object name; when specified, this parameter is used
1456                         for result publication in the study. Otherwise, if automatic
1457                         publication is switched on, default value is used for result name.
1458
1459             Returns:
1460                 New GEOM.GEOM_Object, containing the created point.
1461
1462             Example of usage:
1463                 p_on_face = geompy.MakeVertexInsideFace(Face)
1464             """
1465             # Example: see GEOM_TestAll.py
1466             anObj = self.BasicOp.MakePointOnFace(theFace, theNumberOfPnts)
1467             RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1468             self._autoPublish(anObj, theName, "vertex")
1469             return anObj
1470
1471         ## Create a point on intersection of two lines.
1472         #  @param theRefLine1, theRefLine2 The referenced lines.
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 point.
1478         #
1479         #  @ref swig_MakeVertexOnLinesIntersection "Example"
1480         @ManageTransactions("BasicOp")
1481         def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1482             """
1483             Create a point on intersection of two lines.
1484
1485             Parameters:
1486                 theRefLine1, theRefLine2 The referenced lines.
1487                 theName Object name; when specified, this parameter is used
1488                         for result publication in the study. Otherwise, if automatic
1489                         publication is switched on, default value is used for result name.
1490
1491             Returns:
1492                 New GEOM.GEOM_Object, containing the created point.
1493             """
1494             # Example: see GEOM_TestAll.py
1495             anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1496             RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1497             self._autoPublish(anObj, theName, "vertex")
1498             return anObj
1499
1500         ## Create a tangent, corresponding to the given parameter on the given curve.
1501         #  @param theRefCurve The referenced curve.
1502         #  @param theParameter Value of parameter on the referenced curve.
1503         #  @param theName Object name; when specified, this parameter is used
1504         #         for result publication in the study. Otherwise, if automatic
1505         #         publication is switched on, default value is used for result name.
1506         #
1507         #  @return New GEOM.GEOM_Object, containing the created tangent.
1508         #
1509         #  @ref swig_MakeTangentOnCurve "Example"
1510         @ManageTransactions("BasicOp")
1511         def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1512             """
1513             Create a tangent, corresponding to the given parameter on the given curve.
1514
1515             Parameters:
1516                 theRefCurve The referenced curve.
1517                 theParameter Value of parameter on the referenced curve.
1518                 theName Object name; when specified, this parameter is used
1519                         for result publication in the study. Otherwise, if automatic
1520                         publication is switched on, default value is used for result name.
1521
1522             Returns:
1523                 New GEOM.GEOM_Object, containing the created tangent.
1524
1525             Example of usage:
1526                 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1527             """
1528             anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1529             RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1530             self._autoPublish(anObj, theName, "tangent")
1531             return anObj
1532
1533         ## Create a tangent plane, corresponding to the given parameter on the given face.
1534         #  @param theFace The face for which tangent plane should be built.
1535         #  @param theParameterV vertical value of the center point (0.0 - 1.0).
1536         #  @param theParameterU horisontal value of the center point (0.0 - 1.0).
1537         #  @param theTrimSize the size of plane.
1538         #  @param theName Object name; when specified, this parameter is used
1539         #         for result publication in the study. Otherwise, if automatic
1540         #         publication is switched on, default value is used for result name.
1541         #
1542         #  @return New GEOM.GEOM_Object, containing the created tangent.
1543         #
1544         #  @ref swig_MakeTangentPlaneOnFace "Example"
1545         @ManageTransactions("BasicOp")
1546         def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1547             """
1548             Create a tangent plane, corresponding to the given parameter on the given face.
1549
1550             Parameters:
1551                 theFace The face for which tangent plane should be built.
1552                 theParameterV vertical value of the center point (0.0 - 1.0).
1553                 theParameterU horisontal value of the center point (0.0 - 1.0).
1554                 theTrimSize the size of plane.
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 tangent.
1561
1562            Example of usage:
1563                 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1564             """
1565             anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1566             RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1567             self._autoPublish(anObj, theName, "tangent")
1568             return anObj
1569
1570         ## Create a vector with the given components.
1571         #  @param theDX X component of the vector.
1572         #  @param theDY Y component of the vector.
1573         #  @param theDZ Z component of the vector.
1574         #  @param theName Object name; when specified, this parameter is used
1575         #         for result publication in the study. Otherwise, if automatic
1576         #         publication is switched on, default value is used for result name.
1577         #
1578         #  @return New GEOM.GEOM_Object, containing the created vector.
1579         #
1580         #  @ref tui_creation_vector "Example"
1581         @ManageTransactions("BasicOp")
1582         def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1583             """
1584             Create a vector with the given components.
1585
1586             Parameters:
1587                 theDX X component of the vector.
1588                 theDY Y component of the vector.
1589                 theDZ Z component of the vector.
1590                 theName Object name; when specified, this parameter is used
1591                         for result publication in the study. Otherwise, if automatic
1592                         publication is switched on, default value is used for result name.
1593
1594             Returns:
1595                 New GEOM.GEOM_Object, containing the created vector.
1596             """
1597             # Example: see GEOM_TestAll.py
1598             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1599             anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1600             RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1601             anObj.SetParameters(Parameters)
1602             self._autoPublish(anObj, theName, "vector")
1603             return anObj
1604
1605         ## Create a vector between two points.
1606         #  @param thePnt1 Start point for the vector.
1607         #  @param thePnt2 End point for the vector.
1608         #  @param theName Object name; when specified, this parameter is used
1609         #         for result publication in the study. Otherwise, if automatic
1610         #         publication is switched on, default value is used for result name.
1611         #
1612         #  @return New GEOM.GEOM_Object, containing the created vector.
1613         #
1614         #  @ref tui_creation_vector "Example"
1615         @ManageTransactions("BasicOp")
1616         def MakeVector(self, thePnt1, thePnt2, theName=None):
1617             """
1618             Create a vector between two points.
1619
1620             Parameters:
1621                 thePnt1 Start point for the vector.
1622                 thePnt2 End point for the vector.
1623                 theName Object name; when specified, this parameter is used
1624                         for result publication in the study. Otherwise, if automatic
1625                         publication is switched on, default value is used for result name.
1626
1627             Returns:
1628                 New GEOM.GEOM_Object, containing the created vector.
1629             """
1630             # Example: see GEOM_TestAll.py
1631             anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1632             RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1633             self._autoPublish(anObj, theName, "vector")
1634             return anObj
1635
1636         ## Create a line, passing through the given point
1637         #  and parallel to the given direction
1638         #  @param thePnt Point. The resulting line will pass through it.
1639         #  @param theDir Direction. The resulting line will be parallel to it.
1640         #  @param theName Object name; when specified, this parameter is used
1641         #         for result publication in the study. Otherwise, if automatic
1642         #         publication is switched on, default value is used for result name.
1643         #
1644         #  @return New GEOM.GEOM_Object, containing the created line.
1645         #
1646         #  @ref tui_creation_line "Example"
1647         @ManageTransactions("BasicOp")
1648         def MakeLine(self, thePnt, theDir, theName=None):
1649             """
1650             Create a line, passing through the given point
1651             and parallel to the given direction
1652
1653             Parameters:
1654                 thePnt Point. The resulting line will pass through it.
1655                 theDir Direction. The resulting line will be parallel to it.
1656                 theName Object name; when specified, this parameter is used
1657                         for result publication in the study. Otherwise, if automatic
1658                         publication is switched on, default value is used for result name.
1659
1660             Returns:
1661                 New GEOM.GEOM_Object, containing the created line.
1662             """
1663             # Example: see GEOM_TestAll.py
1664             anObj = self.BasicOp.MakeLine(thePnt, theDir)
1665             RaiseIfFailed("MakeLine", self.BasicOp)
1666             self._autoPublish(anObj, theName, "line")
1667             return anObj
1668
1669         ## Create a line, passing through the given points
1670         #  @param thePnt1 First of two points, defining the line.
1671         #  @param thePnt2 Second of two points, defining the line.
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 line.
1677         #
1678         #  @ref tui_creation_line "Example"
1679         @ManageTransactions("BasicOp")
1680         def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1681             """
1682             Create a line, passing through the given points
1683
1684             Parameters:
1685                 thePnt1 First of two points, defining the line.
1686                 thePnt2 Second of two points, defining the line.
1687                 theName Object name; when specified, this parameter is used
1688                         for result publication in the study. Otherwise, if automatic
1689                         publication is switched on, default value is used for result name.
1690
1691             Returns:
1692                 New GEOM.GEOM_Object, containing the created line.
1693             """
1694             # Example: see GEOM_TestAll.py
1695             anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1696             RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1697             self._autoPublish(anObj, theName, "line")
1698             return anObj
1699
1700         ## Create a line on two faces intersection.
1701         #  @param theFace1 First of two faces, defining the line.
1702         #  @param theFace2 Second of two faces, defining the line.
1703         #  @param theName Object name; when specified, this parameter is used
1704         #         for result publication in the study. Otherwise, if automatic
1705         #         publication is switched on, default value is used for result name.
1706         #
1707         #  @return New GEOM.GEOM_Object, containing the created line.
1708         #
1709         #  @ref swig_MakeLineTwoFaces "Example"
1710         @ManageTransactions("BasicOp")
1711         def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1712             """
1713             Create a line on two faces intersection.
1714
1715             Parameters:
1716                 theFace1 First of two faces, defining the line.
1717                 theFace2 Second of two faces, defining the line.
1718                 theName Object name; when specified, this parameter is used
1719                         for result publication in the study. Otherwise, if automatic
1720                         publication is switched on, default value is used for result name.
1721
1722             Returns:
1723                 New GEOM.GEOM_Object, containing the created line.
1724             """
1725             # Example: see GEOM_TestAll.py
1726             anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1727             RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1728             self._autoPublish(anObj, theName, "line")
1729             return anObj
1730
1731         ## Create a plane, passing through the given point
1732         #  and normal to the given vector.
1733         #  @param thePnt Point, the plane has to pass through.
1734         #  @param theVec Vector, defining the plane normal direction.
1735         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1736         #  @param theName Object name; when specified, this parameter is used
1737         #         for result publication in the study. Otherwise, if automatic
1738         #         publication is switched on, default value is used for result name.
1739         #
1740         #  @return New GEOM.GEOM_Object, containing the created plane.
1741         #
1742         #  @ref tui_creation_plane "Example"
1743         @ManageTransactions("BasicOp")
1744         def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1745             """
1746             Create a plane, passing through the given point
1747             and normal to the given vector.
1748
1749             Parameters:
1750                 thePnt Point, the plane has to pass through.
1751                 theVec Vector, defining the plane normal direction.
1752                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1753                 theName Object name; when specified, this parameter is used
1754                         for result publication in the study. Otherwise, if automatic
1755                         publication is switched on, default value is used for result name.
1756
1757             Returns:
1758                 New GEOM.GEOM_Object, containing the created plane.
1759             """
1760             # Example: see GEOM_TestAll.py
1761             theTrimSize, Parameters = ParseParameters(theTrimSize);
1762             anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1763             RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1764             anObj.SetParameters(Parameters)
1765             self._autoPublish(anObj, theName, "plane")
1766             return anObj
1767
1768         ## Create a plane, passing through the three given points
1769         #  @param thePnt1 First of three points, defining the plane.
1770         #  @param thePnt2 Second of three points, defining the plane.
1771         #  @param thePnt3 Third of three points, defining the plane.
1772         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1773         #  @param theName Object name; when specified, this parameter is used
1774         #         for result publication in the study. Otherwise, if automatic
1775         #         publication is switched on, default value is used for result name.
1776         #
1777         #  @return New GEOM.GEOM_Object, containing the created plane.
1778         #
1779         #  @ref tui_creation_plane "Example"
1780         @ManageTransactions("BasicOp")
1781         def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1782             """
1783             Create a plane, passing through the three given points
1784
1785             Parameters:
1786                 thePnt1 First of three points, defining the plane.
1787                 thePnt2 Second of three points, defining the plane.
1788                 thePnt3 Third of three points, defining the plane.
1789                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1790                 theName Object name; when specified, this parameter is used
1791                         for result publication in the study. Otherwise, if automatic
1792                         publication is switched on, default value is used for result name.
1793
1794             Returns:
1795                 New GEOM.GEOM_Object, containing the created plane.
1796             """
1797             # Example: see GEOM_TestAll.py
1798             theTrimSize, Parameters = ParseParameters(theTrimSize);
1799             anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1800             RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1801             anObj.SetParameters(Parameters)
1802             self._autoPublish(anObj, theName, "plane")
1803             return anObj
1804
1805         ## Create a plane, similar to the existing one, but with another size of representing face.
1806         #  @param theFace Referenced plane or LCS(Marker).
1807         #  @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1808         #  @param theName Object name; when specified, this parameter is used
1809         #         for result publication in the study. Otherwise, if automatic
1810         #         publication is switched on, default value is used for result name.
1811         #
1812         #  @return New GEOM.GEOM_Object, containing the created plane.
1813         #
1814         #  @ref tui_creation_plane "Example"
1815         @ManageTransactions("BasicOp")
1816         def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1817             """
1818             Create a plane, similar to the existing one, but with another size of representing face.
1819
1820             Parameters:
1821                 theFace Referenced plane or LCS(Marker).
1822                 theTrimSize New half size of a side of quadrangle face, representing the plane.
1823                 theName Object name; when specified, this parameter is used
1824                         for result publication in the study. Otherwise, if automatic
1825                         publication is switched on, default value is used for result name.
1826
1827             Returns:
1828                 New GEOM.GEOM_Object, containing the created plane.
1829             """
1830             # Example: see GEOM_TestAll.py
1831             theTrimSize, Parameters = ParseParameters(theTrimSize);
1832             anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1833             RaiseIfFailed("MakePlaneFace", self.BasicOp)
1834             anObj.SetParameters(Parameters)
1835             self._autoPublish(anObj, theName, "plane")
1836             return anObj
1837
1838         ## Create a plane, passing through the 2 vectors
1839         #  with center in a start point of the first vector.
1840         #  @param theVec1 Vector, defining center point and plane direction.
1841         #  @param theVec2 Vector, defining the plane normal direction.
1842         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1843         #  @param theName Object name; when specified, this parameter is used
1844         #         for result publication in the study. Otherwise, if automatic
1845         #         publication is switched on, default value is used for result name.
1846         #
1847         #  @return New GEOM.GEOM_Object, containing the created plane.
1848         #
1849         #  @ref tui_creation_plane "Example"
1850         @ManageTransactions("BasicOp")
1851         def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1852             """
1853             Create a plane, passing through the 2 vectors
1854             with center in a start point of the first vector.
1855
1856             Parameters:
1857                 theVec1 Vector, defining center point and plane direction.
1858                 theVec2 Vector, defining the plane normal direction.
1859                 theTrimSize Half size of a side of quadrangle face, representing the plane.
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 plane.
1866             """
1867             # Example: see GEOM_TestAll.py
1868             theTrimSize, Parameters = ParseParameters(theTrimSize);
1869             anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1870             RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1871             anObj.SetParameters(Parameters)
1872             self._autoPublish(anObj, theName, "plane")
1873             return anObj
1874
1875         ## Create a plane, based on a Local coordinate system.
1876         #  @param theLCS  coordinate system, defining plane.
1877         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1878         #  @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1879         #  @param theName Object name; when specified, this parameter is used
1880         #         for result publication in the study. Otherwise, if automatic
1881         #         publication is switched on, default value is used for result name.
1882         #
1883         #  @return New GEOM.GEOM_Object, containing the created plane.
1884         #
1885         #  @ref tui_creation_plane "Example"
1886         @ManageTransactions("BasicOp")
1887         def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1888             """
1889             Create a plane, based on a Local coordinate system.
1890
1891            Parameters:
1892                 theLCS  coordinate system, defining plane.
1893                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1894                 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1895                 theName Object name; when specified, this parameter is used
1896                         for result publication in the study. Otherwise, if automatic
1897                         publication is switched on, default value is used for result name.
1898
1899             Returns:
1900                 New GEOM.GEOM_Object, containing the created plane.
1901             """
1902             # Example: see GEOM_TestAll.py
1903             theTrimSize, Parameters = ParseParameters(theTrimSize);
1904             anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1905             RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1906             anObj.SetParameters(Parameters)
1907             self._autoPublish(anObj, theName, "plane")
1908             return anObj
1909
1910         ## Create a local coordinate system.
1911         #  @param OX,OY,OZ Three coordinates of coordinate system origin.
1912         #  @param XDX,XDY,XDZ Three components of OX direction
1913         #  @param YDX,YDY,YDZ Three components of OY direction
1914         #  @param theName Object name; when specified, this parameter is used
1915         #         for result publication in the study. Otherwise, if automatic
1916         #         publication is switched on, default value is used for result name.
1917         #
1918         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1919         #
1920         #  @ref swig_MakeMarker "Example"
1921         @ManageTransactions("BasicOp")
1922         def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1923             """
1924             Create a local coordinate system.
1925
1926             Parameters:
1927                 OX,OY,OZ Three coordinates of coordinate system origin.
1928                 XDX,XDY,XDZ Three components of OX direction
1929                 YDX,YDY,YDZ Three components of OY direction
1930                 theName Object name; when specified, this parameter is used
1931                         for result publication in the study. Otherwise, if automatic
1932                         publication is switched on, default value is used for result name.
1933
1934             Returns:
1935                 New GEOM.GEOM_Object, containing the created coordinate system.
1936             """
1937             # Example: see GEOM_TestAll.py
1938             OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1939             anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1940             RaiseIfFailed("MakeMarker", self.BasicOp)
1941             anObj.SetParameters(Parameters)
1942             self._autoPublish(anObj, theName, "lcs")
1943             return anObj
1944
1945         ## Create a local coordinate system from shape.
1946         #  @param theShape The initial shape to detect the coordinate system.
1947         #  @param theName Object name; when specified, this parameter is used
1948         #         for result publication in the study. Otherwise, if automatic
1949         #         publication is switched on, default value is used for result name.
1950         #
1951         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1952         #
1953         #  @ref tui_creation_lcs "Example"
1954         @ManageTransactions("BasicOp")
1955         def MakeMarkerFromShape(self, theShape, theName=None):
1956             """
1957             Create a local coordinate system from shape.
1958
1959             Parameters:
1960                 theShape The initial shape to detect the coordinate system.
1961                 theName Object name; when specified, this parameter is used
1962                         for result publication in the study. Otherwise, if automatic
1963                         publication is switched on, default value is used for result name.
1964
1965             Returns:
1966                 New GEOM.GEOM_Object, containing the created coordinate system.
1967             """
1968             anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1969             RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1970             self._autoPublish(anObj, theName, "lcs")
1971             return anObj
1972
1973         ## Create a local coordinate system from point and two vectors.
1974         #  @param theOrigin Point of coordinate system origin.
1975         #  @param theXVec Vector of X direction
1976         #  @param theYVec Vector of Y direction
1977         #  @param theName Object name; when specified, this parameter is used
1978         #         for result publication in the study. Otherwise, if automatic
1979         #         publication is switched on, default value is used for result name.
1980         #
1981         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1982         #
1983         #  @ref tui_creation_lcs "Example"
1984         @ManageTransactions("BasicOp")
1985         def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1986             """
1987             Create a local coordinate system from point and two vectors.
1988
1989             Parameters:
1990                 theOrigin Point of coordinate system origin.
1991                 theXVec Vector of X direction
1992                 theYVec Vector of Y direction
1993                 theName Object name; when specified, this parameter is used
1994                         for result publication in the study. Otherwise, if automatic
1995                         publication is switched on, default value is used for result name.
1996
1997             Returns:
1998                 New GEOM.GEOM_Object, containing the created coordinate system.
1999
2000             """
2001             anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
2002             RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
2003             self._autoPublish(anObj, theName, "lcs")
2004             return anObj
2005
2006         # end of l3_basic_go
2007         ## @}
2008
2009         ## @addtogroup l4_curves
2010         ## @{
2011
2012         ##  Create an arc of circle, passing through three given points.
2013         #  @param thePnt1 Start point of the arc.
2014         #  @param thePnt2 Middle point of the arc.
2015         #  @param thePnt3 End point of the arc.
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 arc.
2021         #
2022         #  @ref swig_MakeArc "Example"
2023         @ManageTransactions("CurvesOp")
2024         def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
2025             """
2026             Create an arc of circle, passing through three given points.
2027
2028             Parameters:
2029                 thePnt1 Start point of the arc.
2030                 thePnt2 Middle point of the arc.
2031                 thePnt3 End point of the arc.
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 arc.
2038             """
2039             # Example: see GEOM_TestAll.py
2040             anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
2041             RaiseIfFailed("MakeArc", self.CurvesOp)
2042             self._autoPublish(anObj, theName, "arc")
2043             return anObj
2044
2045         ##  Create an arc of circle from a center and 2 points.
2046         #  @param thePnt1 Center of the arc
2047         #  @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
2048         #  @param thePnt3 End point of the arc (Gives also a direction)
2049         #  @param theSense Orientation of the arc
2050         #  @param theName Object name; when specified, this parameter is used
2051         #         for result publication in the study. Otherwise, if automatic
2052         #         publication is switched on, default value is used for result name.
2053         #
2054         #  @return New GEOM.GEOM_Object, containing the created arc.
2055         #
2056         #  @ref swig_MakeArc "Example"
2057         @ManageTransactions("CurvesOp")
2058         def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
2059             """
2060             Create an arc of circle from a center and 2 points.
2061
2062             Parameters:
2063                 thePnt1 Center of the arc
2064                 thePnt2 Start point of the arc. (Gives also the radius of the arc)
2065                 thePnt3 End point of the arc (Gives also a direction)
2066                 theSense Orientation of the arc
2067                 theName Object name; when specified, this parameter is used
2068                         for result publication in the study. Otherwise, if automatic
2069                         publication is switched on, default value is used for result name.
2070
2071             Returns:
2072                 New GEOM.GEOM_Object, containing the created arc.
2073             """
2074             # Example: see GEOM_TestAll.py
2075             anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
2076             RaiseIfFailed("MakeArcCenter", self.CurvesOp)
2077             self._autoPublish(anObj, theName, "arc")
2078             return anObj
2079
2080         ##  Create an arc of ellipse, of center and two points.
2081         #  @param theCenter Center of the arc.
2082         #  @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2083         #  @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2084         #  @param theName Object name; when specified, this parameter is used
2085         #         for result publication in the study. Otherwise, if automatic
2086         #         publication is switched on, default value is used for result name.
2087         #
2088         #  @return New GEOM.GEOM_Object, containing the created arc.
2089         #
2090         #  @ref swig_MakeArc "Example"
2091         @ManageTransactions("CurvesOp")
2092         def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2093             """
2094             Create an arc of ellipse, of center and two points.
2095
2096             Parameters:
2097                 theCenter Center of the arc.
2098                 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2099                 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2100                 theName Object name; when specified, this parameter is used
2101                         for result publication in the study. Otherwise, if automatic
2102                         publication is switched on, default value is used for result name.
2103
2104             Returns:
2105                 New GEOM.GEOM_Object, containing the created arc.
2106             """
2107             # Example: see GEOM_TestAll.py
2108             anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2109             RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2110             self._autoPublish(anObj, theName, "arc")
2111             return anObj
2112
2113         ## Create a circle with given center, normal vector and radius.
2114         #  @param thePnt Circle center.
2115         #  @param theVec Vector, normal to the plane of the circle.
2116         #  @param theR Circle radius.
2117         #  @param theName Object name; when specified, this parameter is used
2118         #         for result publication in the study. Otherwise, if automatic
2119         #         publication is switched on, default value is used for result name.
2120         #
2121         #  @return New GEOM.GEOM_Object, containing the created circle.
2122         #
2123         #  @ref tui_creation_circle "Example"
2124         @ManageTransactions("CurvesOp")
2125         def MakeCircle(self, thePnt, theVec, theR, theName=None):
2126             """
2127             Create a circle with given center, normal vector and radius.
2128
2129             Parameters:
2130                 thePnt Circle center.
2131                 theVec Vector, normal to the plane of the circle.
2132                 theR Circle radius.
2133                 theName Object name; when specified, this parameter is used
2134                         for result publication in the study. Otherwise, if automatic
2135                         publication is switched on, default value is used for result name.
2136
2137             Returns:
2138                 New GEOM.GEOM_Object, containing the created circle.
2139             """
2140             # Example: see GEOM_TestAll.py
2141             theR, Parameters = ParseParameters(theR)
2142             anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2143             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2144             anObj.SetParameters(Parameters)
2145             self._autoPublish(anObj, theName, "circle")
2146             return anObj
2147
2148         ## Create a circle with given radius.
2149         #  Center of the circle will be in the origin of global
2150         #  coordinate system and normal vector will be codirected with Z axis
2151         #  @param theR Circle radius.
2152         #  @param theName Object name; when specified, this parameter is used
2153         #         for result publication in the study. Otherwise, if automatic
2154         #         publication is switched on, default value is used for result name.
2155         #
2156         #  @return New GEOM.GEOM_Object, containing the created circle.
2157         @ManageTransactions("CurvesOp")
2158         def MakeCircleR(self, theR, theName=None):
2159             """
2160             Create a circle with given radius.
2161             Center of the circle will be in the origin of global
2162             coordinate system and normal vector will be codirected with Z axis
2163
2164             Parameters:
2165                 theR Circle radius.
2166                 theName Object name; when specified, this parameter is used
2167                         for result publication in the study. Otherwise, if automatic
2168                         publication is switched on, default value is used for result name.
2169
2170             Returns:
2171                 New GEOM.GEOM_Object, containing the created circle.
2172             """
2173             anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2174             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2175             self._autoPublish(anObj, theName, "circle")
2176             return anObj
2177
2178         ## Create a circle, passing through three given points
2179         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2180         #  @param theName Object name; when specified, this parameter is used
2181         #         for result publication in the study. Otherwise, if automatic
2182         #         publication is switched on, default value is used for result name.
2183         #
2184         #  @return New GEOM.GEOM_Object, containing the created circle.
2185         #
2186         #  @ref tui_creation_circle "Example"
2187         @ManageTransactions("CurvesOp")
2188         def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2189             """
2190             Create a circle, passing through three given points
2191
2192             Parameters:
2193                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2194                 theName Object name; when specified, this parameter is used
2195                         for result publication in the study. Otherwise, if automatic
2196                         publication is switched on, default value is used for result name.
2197
2198             Returns:
2199                 New GEOM.GEOM_Object, containing the created circle.
2200             """
2201             # Example: see GEOM_TestAll.py
2202             anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2203             RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2204             self._autoPublish(anObj, theName, "circle")
2205             return anObj
2206
2207         ## Create a circle, with given point1 as center,
2208         #  passing through the point2 as radius and laying in the plane,
2209         #  defined by all three given points.
2210         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2211         #  @param theName Object name; when specified, this parameter is used
2212         #         for result publication in the study. Otherwise, if automatic
2213         #         publication is switched on, default value is used for result name.
2214         #
2215         #  @return New GEOM.GEOM_Object, containing the created circle.
2216         #
2217         #  @ref swig_MakeCircle "Example"
2218         @ManageTransactions("CurvesOp")
2219         def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2220             """
2221             Create a circle, with given point1 as center,
2222             passing through the point2 as radius and laying in the plane,
2223             defined by all three given points.
2224
2225             Parameters:
2226                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2227                 theName Object name; when specified, this parameter is used
2228                         for result publication in the study. Otherwise, if automatic
2229                         publication is switched on, default value is used for result name.
2230
2231             Returns:
2232                 New GEOM.GEOM_Object, containing the created circle.
2233             """
2234             # Example: see GEOM_example6.py
2235             anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2236             RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2237             self._autoPublish(anObj, theName, "circle")
2238             return anObj
2239
2240         ## Create an ellipse with given center, normal vector and radiuses.
2241         #  @param thePnt Ellipse center.
2242         #  @param theVec Vector, normal to the plane of the ellipse.
2243         #  @param theRMajor Major ellipse radius.
2244         #  @param theRMinor Minor ellipse radius.
2245         #  @param theVecMaj Vector, direction of the ellipse's main axis.
2246         #  @param theName Object name; when specified, this parameter is used
2247         #         for result publication in the study. Otherwise, if automatic
2248         #         publication is switched on, default value is used for result name.
2249         #
2250         #  @return New GEOM.GEOM_Object, containing the created ellipse.
2251         #
2252         #  @ref tui_creation_ellipse "Example"
2253         @ManageTransactions("CurvesOp")
2254         def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2255             """
2256             Create an ellipse with given center, normal vector and radiuses.
2257
2258             Parameters:
2259                 thePnt Ellipse center.
2260                 theVec Vector, normal to the plane of the ellipse.
2261                 theRMajor Major ellipse radius.
2262                 theRMinor Minor ellipse radius.
2263                 theVecMaj Vector, direction of the ellipse's main axis.
2264                 theName Object name; when specified, this parameter is used
2265                         for result publication in the study. Otherwise, if automatic
2266                         publication is switched on, default value is used for result name.
2267
2268             Returns:
2269                 New GEOM.GEOM_Object, containing the created ellipse.
2270             """
2271             # Example: see GEOM_TestAll.py
2272             theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2273             if theVecMaj is not None:
2274                 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2275             else:
2276                 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2277                 pass
2278             RaiseIfFailed("MakeEllipse", self.CurvesOp)
2279             anObj.SetParameters(Parameters)
2280             self._autoPublish(anObj, theName, "ellipse")
2281             return anObj
2282
2283         ## Create an ellipse with given radiuses.
2284         #  Center of the ellipse will be in the origin of global
2285         #  coordinate system and normal vector will be codirected with Z axis
2286         #  @param theRMajor Major ellipse radius.
2287         #  @param theRMinor Minor ellipse radius.
2288         #  @param theName Object name; when specified, this parameter is used
2289         #         for result publication in the study. Otherwise, if automatic
2290         #         publication is switched on, default value is used for result name.
2291         #
2292         #  @return New GEOM.GEOM_Object, containing the created ellipse.
2293         @ManageTransactions("CurvesOp")
2294         def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2295             """
2296             Create an ellipse with given radiuses.
2297             Center of the ellipse will be in the origin of global
2298             coordinate system and normal vector will be codirected with Z axis
2299
2300             Parameters:
2301                 theRMajor Major ellipse radius.
2302                 theRMinor Minor ellipse radius.
2303                 theName Object name; when specified, this parameter is used
2304                         for result publication in the study. Otherwise, if automatic
2305                         publication is switched on, default value is used for result name.
2306
2307             Returns:
2308             New GEOM.GEOM_Object, containing the created ellipse.
2309             """
2310             anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2311             RaiseIfFailed("MakeEllipse", self.CurvesOp)
2312             self._autoPublish(anObj, theName, "ellipse")
2313             return anObj
2314
2315         ## Create a polyline on the set of points.
2316         #  @param thePoints Sequence of points for the polyline.
2317         #  @param theIsClosed If True, build a closed wire.
2318         #  @param theName Object name; when specified, this parameter is used
2319         #         for result publication in the study. Otherwise, if automatic
2320         #         publication is switched on, default value is used for result name.
2321         #
2322         #  @return New GEOM.GEOM_Object, containing the created polyline.
2323         #
2324         #  @ref tui_creation_curve "Example"
2325         @ManageTransactions("CurvesOp")
2326         def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2327             """
2328             Create a polyline on the set of points.
2329
2330             Parameters:
2331                 thePoints Sequence of points for the polyline.
2332                 theIsClosed If True, build a closed wire.
2333                 theName Object name; when specified, this parameter is used
2334                         for result publication in the study. Otherwise, if automatic
2335                         publication is switched on, default value is used for result name.
2336
2337             Returns:
2338                 New GEOM.GEOM_Object, containing the created polyline.
2339             """
2340             # Example: see GEOM_TestAll.py
2341             anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2342             RaiseIfFailed("MakePolyline", self.CurvesOp)
2343             self._autoPublish(anObj, theName, "polyline")
2344             return anObj
2345
2346         ## Create bezier curve on the set of points.
2347         #  @param thePoints Sequence of points for the bezier curve.
2348         #  @param theIsClosed If True, build a closed curve.
2349         #  @param theName Object name; when specified, this parameter is used
2350         #         for result publication in the study. Otherwise, if automatic
2351         #         publication is switched on, default value is used for result name.
2352         #
2353         #  @return New GEOM.GEOM_Object, containing the created bezier curve.
2354         #
2355         #  @ref tui_creation_curve "Example"
2356         @ManageTransactions("CurvesOp")
2357         def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2358             """
2359             Create bezier curve on the set of points.
2360
2361             Parameters:
2362                 thePoints Sequence of points for the bezier curve.
2363                 theIsClosed If True, build a closed curve.
2364                 theName Object name; when specified, this parameter is used
2365                         for result publication in the study. Otherwise, if automatic
2366                         publication is switched on, default value is used for result name.
2367
2368             Returns:
2369                 New GEOM.GEOM_Object, containing the created bezier curve.
2370             """
2371             # Example: see GEOM_TestAll.py
2372             anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2373             RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2374             self._autoPublish(anObj, theName, "bezier")
2375             return anObj
2376
2377         ## Create B-Spline curve on the set of points.
2378         #  @param thePoints Sequence of points for the B-Spline curve.
2379         #  @param theIsClosed If True, build a closed curve.
2380         #  @param theDoReordering If TRUE, the algo does not follow the order of
2381         #                         \a thePoints but searches for the closest vertex.
2382         #  @param theName Object name; when specified, this parameter is used
2383         #         for result publication in the study. Otherwise, if automatic
2384         #         publication is switched on, default value is used for result name.
2385         #
2386         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2387         #
2388         #  @ref tui_creation_curve "Example"
2389         @ManageTransactions("CurvesOp")
2390         def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2391             """
2392             Create B-Spline curve on the set of points.
2393
2394             Parameters:
2395                 thePoints Sequence of points for the B-Spline curve.
2396                 theIsClosed If True, build a closed curve.
2397                 theDoReordering If True, the algo does not follow the order of
2398                                 thePoints but searches for the closest vertex.
2399                 theName Object name; when specified, this parameter is used
2400                         for result publication in the study. Otherwise, if automatic
2401                         publication is switched on, default value is used for result name.
2402
2403             Returns:
2404                 New GEOM.GEOM_Object, containing the created B-Spline curve.
2405             """
2406             # Example: see GEOM_TestAll.py
2407             anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2408             RaiseIfFailed("MakeInterpol", self.CurvesOp)
2409             self._autoPublish(anObj, theName, "bspline")
2410             return anObj
2411
2412         ## Create B-Spline curve on the set of points.
2413         #  @param thePoints Sequence of points for the B-Spline curve.
2414         #  @param theFirstVec Vector object, defining the curve direction at its first point.
2415         #  @param theLastVec Vector object, defining the curve direction at its last point.
2416         #  @param theName Object name; when specified, this parameter is used
2417         #         for result publication in the study. Otherwise, if automatic
2418         #         publication is switched on, default value is used for result name.
2419         #
2420         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2421         #
2422         #  @ref tui_creation_curve "Example"
2423         @ManageTransactions("CurvesOp")
2424         def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2425             """
2426             Create B-Spline curve on the set of points.
2427
2428             Parameters:
2429                 thePoints Sequence of points for the B-Spline curve.
2430                 theFirstVec Vector object, defining the curve direction at its first point.
2431                 theLastVec Vector object, defining the curve direction at its last point.
2432                 theName Object name; when specified, this parameter is used
2433                         for result publication in the study. Otherwise, if automatic
2434                         publication is switched on, default value is used for result name.
2435
2436             Returns:
2437                 New GEOM.GEOM_Object, containing the created B-Spline curve.
2438             """
2439             # Example: see GEOM_TestAll.py
2440             anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2441             RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2442             self._autoPublish(anObj, theName, "bspline")
2443             return anObj
2444
2445         ## Creates a curve using the parametric definition of the basic points.
2446         #  @param thexExpr parametric equation of the coordinates X.
2447         #  @param theyExpr parametric equation of the coordinates Y.
2448         #  @param thezExpr parametric equation of the coordinates Z.
2449         #  @param theParamMin the minimal value of the parameter.
2450         #  @param theParamMax the maximum value of the parameter.
2451         #  @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2452         #  @param theCurveType the type of the curve,
2453         #         one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2454         #  @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.
2455         #  @param theName Object name; when specified, this parameter is used
2456         #         for result publication in the study. Otherwise, if automatic
2457         #         publication is switched on, default value is used for result name.
2458         #
2459         #  @return New GEOM.GEOM_Object, containing the created curve.
2460         #
2461         #  @ref tui_creation_curve "Example"
2462         @ManageTransactions("CurvesOp")
2463         def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2464                                 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2465             """
2466             Creates a curve using the parametric definition of the basic points.
2467
2468             Parameters:
2469                 thexExpr parametric equation of the coordinates X.
2470                 theyExpr parametric equation of the coordinates Y.
2471                 thezExpr parametric equation of the coordinates Z.
2472                 theParamMin the minimal value of the parameter.
2473                 theParamMax the maximum value of the parameter.
2474                 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2475                 theCurveType the type of the curve,
2476                              one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2477                 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2478                              method is used which can lead to a bug.
2479                 theName Object name; when specified, this parameter is used
2480                         for result publication in the study. Otherwise, if automatic
2481                         publication is switched on, default value is used for result name.
2482
2483             Returns:
2484                 New GEOM.GEOM_Object, containing the created curve.
2485             """
2486             theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2487             if theNewMethod:
2488               anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2489             else:
2490               anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2491             RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
2492             anObj.SetParameters(Parameters)
2493             self._autoPublish(anObj, theName, "curve")
2494             return anObj
2495
2496         ## Create an isoline curve on a face.
2497         #  @param theFace the face for which an isoline is created.
2498         #  @param IsUIsoline True for U-isoline creation; False for V-isoline
2499         #         creation.
2500         #  @param theParameter the U parameter for U-isoline or V parameter
2501         #         for V-isoline.
2502         #  @param theName Object name; when specified, this parameter is used
2503         #         for result publication in the study. Otherwise, if automatic
2504         #         publication is switched on, default value is used for result name.
2505         #
2506         #  @return New GEOM.GEOM_Object, containing the created isoline edge or
2507         #          a compound of edges.
2508         #
2509         #  @ref tui_creation_curve "Example"
2510         @ManageTransactions("CurvesOp")
2511         def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2512             """
2513             Create an isoline curve on a face.
2514
2515             Parameters:
2516                 theFace the face for which an isoline is created.
2517                 IsUIsoline True for U-isoline creation; False for V-isoline
2518                            creation.
2519                 theParameter the U parameter for U-isoline or V parameter
2520                              for V-isoline.
2521                 theName Object name; when specified, this parameter is used
2522                         for result publication in the study. Otherwise, if automatic
2523                         publication is switched on, default value is used for result name.
2524
2525             Returns:
2526                 New GEOM.GEOM_Object, containing the created isoline edge or a
2527                 compound of edges.
2528             """
2529             # Example: see GEOM_TestAll.py
2530             anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2531             RaiseIfFailed("MakeIsoline", self.CurvesOp)
2532             if IsUIsoline:
2533                 self._autoPublish(anObj, theName, "U-Isoline")
2534             else:
2535                 self._autoPublish(anObj, theName, "V-Isoline")
2536             return anObj
2537
2538         # end of l4_curves
2539         ## @}
2540
2541         ## @addtogroup l3_sketcher
2542         ## @{
2543
2544         ## Create a sketcher (wire or face), following the textual description,
2545         #  passed through <VAR>theCommand</VAR> argument. \n
2546         #  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2547         #  Format of the description string have to be the following:
2548         #
2549         #  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2550         #
2551         #  Where:
2552         #  - x1, y1 are coordinates of the first sketcher point (zero by default),
2553         #  - CMD is one of
2554         #     - "R angle" : Set the direction by angle
2555         #     - "D dx dy" : Set the direction by DX & DY
2556         #     .
2557         #       \n
2558         #     - "TT x y" : Create segment by point at X & Y
2559         #     - "T dx dy" : Create segment by point with DX & DY
2560         #     - "L length" : Create segment by direction & Length
2561         #     - "IX x" : Create segment by direction & Intersect. X
2562         #     - "IY y" : Create segment by direction & Intersect. Y
2563         #     .
2564         #       \n
2565         #     - "C radius length" : Create arc by direction, radius and length(in degree)
2566         #     - "AA x y": Create arc by point at X & Y
2567         #     - "A dx dy" : Create arc by point with DX & DY
2568         #     - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2569         #     - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2570         #     - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2571         #     - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2572         #     .
2573         #       \n
2574         #     - "WW" : Close Wire (to finish)
2575         #     - "WF" : Close Wire and build face (to finish)
2576         #     .
2577         #        \n
2578         #  - Flag1 (= reverse) is 0 or 2 ...
2579         #     - if 0 the drawn arc is the one of lower angle (< Pi)
2580         #     - if 2 the drawn arc ius the one of greater angle (> Pi)
2581         #     .
2582         #        \n
2583         #  - Flag2 (= control tolerance) is 0 or 1 ...
2584         #     - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2585         #     - if 1 the wire is built only if the end point is on the arc
2586         #       with a tolerance of 10^-7 on the distance else the creation fails
2587         #
2588         #  @param theCommand String, defining the sketcher in local
2589         #                    coordinates of the working plane.
2590         #  @param theWorkingPlane Nine double values, defining origin,
2591         #                         OZ and OX directions of the working plane.
2592         #  @param theName Object name; when specified, this parameter is used
2593         #         for result publication in the study. Otherwise, if automatic
2594         #         publication is switched on, default value is used for result name.
2595         #
2596         #  @return New GEOM.GEOM_Object, containing the created wire.
2597         #
2598         #  @ref tui_sketcher_page "Example"
2599         @ManageTransactions("CurvesOp")
2600         def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2601             """
2602             Create a sketcher (wire or face), following the textual description, passed
2603             through theCommand argument.
2604             Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2605             Format of the description string have to be the following:
2606                 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2607             Where:
2608             - x1, y1 are coordinates of the first sketcher point (zero by default),
2609             - CMD is one of
2610                - "R angle" : Set the direction by angle
2611                - "D dx dy" : Set the direction by DX & DY
2612
2613                - "TT x y" : Create segment by point at X & Y
2614                - "T dx dy" : Create segment by point with DX & DY
2615                - "L length" : Create segment by direction & Length
2616                - "IX x" : Create segment by direction & Intersect. X
2617                - "IY y" : Create segment by direction & Intersect. Y
2618
2619                - "C radius length" : Create arc by direction, radius and length(in degree)
2620                - "AA x y": Create arc by point at X & Y
2621                - "A dx dy" : Create arc by point with DX & DY
2622                - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2623                - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2624                - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2625                - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2626
2627                - "WW" : Close Wire (to finish)
2628                - "WF" : Close Wire and build face (to finish)
2629
2630             - Flag1 (= reverse) is 0 or 2 ...
2631                - if 0 the drawn arc is the one of lower angle (< Pi)
2632                - if 2 the drawn arc ius the one of greater angle (> Pi)
2633
2634             - Flag2 (= control tolerance) is 0 or 1 ...
2635                - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2636                - if 1 the wire is built only if the end point is on the arc
2637                  with a tolerance of 10^-7 on the distance else the creation fails
2638
2639             Parameters:
2640                 theCommand String, defining the sketcher in local
2641                            coordinates of the working plane.
2642                 theWorkingPlane Nine double values, defining origin,
2643                                 OZ and OX directions of the working plane.
2644                 theName Object name; when specified, this parameter is used
2645                         for result publication in the study. Otherwise, if automatic
2646                         publication is switched on, default value is used for result name.
2647
2648             Returns:
2649                 New GEOM.GEOM_Object, containing the created wire.
2650             """
2651             # Example: see GEOM_TestAll.py
2652             theCommand,Parameters = ParseSketcherCommand(theCommand)
2653             anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2654             RaiseIfFailed("MakeSketcher", self.CurvesOp)
2655             anObj.SetParameters(Parameters)
2656             self._autoPublish(anObj, theName, "wire")
2657             return anObj
2658
2659         ## Create a sketcher (wire or face), following the textual description,
2660         #  passed through <VAR>theCommand</VAR> argument. \n
2661         #  For format of the description string see MakeSketcher() method.\n
2662         #  @param theCommand String, defining the sketcher in local
2663         #                    coordinates of the working plane.
2664         #  @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2665         #  @param theName Object name; when specified, this parameter is used
2666         #         for result publication in the study. Otherwise, if automatic
2667         #         publication is switched on, default value is used for result name.
2668         #
2669         #  @return New GEOM.GEOM_Object, containing the created wire.
2670         #
2671         #  @ref tui_sketcher_page "Example"
2672         @ManageTransactions("CurvesOp")
2673         def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2674             """
2675             Create a sketcher (wire or face), following the textual description,
2676             passed through theCommand argument.
2677             For format of the description string see geompy.MakeSketcher() method.
2678
2679             Parameters:
2680                 theCommand String, defining the sketcher in local
2681                            coordinates of the working plane.
2682                 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2683                 theName Object name; when specified, this parameter is used
2684                         for result publication in the study. Otherwise, if automatic
2685                         publication is switched on, default value is used for result name.
2686
2687             Returns:
2688                 New GEOM.GEOM_Object, containing the created wire.
2689             """
2690             theCommand,Parameters = ParseSketcherCommand(theCommand)
2691             anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2692             RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2693             anObj.SetParameters(Parameters)
2694             self._autoPublish(anObj, theName, "wire")
2695             return anObj
2696
2697         ## Obtain a 2D sketcher interface
2698         #  @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2699         def Sketcher2D (self):
2700             """
2701             Obtain a 2D sketcher interface.
2702
2703             Example of usage:
2704                sk = geompy.Sketcher2D()
2705                sk.addPoint(20, 20)
2706                sk.addSegmentRelative(15, 70)
2707                sk.addSegmentPerpY(50)
2708                sk.addArcRadiusRelative(25, 15, 14.5, 0)
2709                sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2710                sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2711                sk.close()
2712                Sketch_1 = sk.wire(geomObj_1)
2713             """
2714             sk = Sketcher2D (self)
2715             return sk
2716
2717         ## Create a sketcher wire, following the numerical description,
2718         #  passed through <VAR>theCoordinates</VAR> argument. \n
2719         #  @param theCoordinates double values, defining points to create a wire,
2720         #                                                      passing from it.
2721         #  @param theName Object name; when specified, this parameter is used
2722         #         for result publication in the study. Otherwise, if automatic
2723         #         publication is switched on, default value is used for result name.
2724         #
2725         #  @return New GEOM.GEOM_Object, containing the created wire.
2726         #
2727         #  @ref tui_3dsketcher_page "Example"
2728         @ManageTransactions("CurvesOp")
2729         def Make3DSketcher(self, theCoordinates, theName=None):
2730             """
2731             Create a sketcher wire, following the numerical description,
2732             passed through theCoordinates argument.
2733
2734             Parameters:
2735                 theCoordinates double values, defining points to create a wire,
2736                                passing from it.
2737                 theName Object name; when specified, this parameter is used
2738                         for result publication in the study. Otherwise, if automatic
2739                         publication is switched on, default value is used for result name.
2740
2741             Returns:
2742                 New GEOM_Object, containing the created wire.
2743             """
2744             theCoordinates,Parameters = ParseParameters(theCoordinates)
2745             anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2746             RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2747             anObj.SetParameters(Parameters)
2748             self._autoPublish(anObj, theName, "wire")
2749             return anObj
2750
2751         ## Obtain a 3D sketcher interface
2752         #  @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2753         #
2754         #  @ref tui_3dsketcher_page "Example"
2755         def Sketcher3D (self):
2756             """
2757             Obtain a 3D sketcher interface.
2758
2759             Example of usage:
2760                 sk = geompy.Sketcher3D()
2761                 sk.addPointsAbsolute(0,0,0, 70,0,0)
2762                 sk.addPointsRelative(0, 0, 130)
2763                 sk.addPointAnglesLength("OXY", 50, 0, 100)
2764                 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2765                 sk.close()
2766                 a3D_Sketcher_1 = sk.wire()
2767             """
2768             sk = Sketcher3D (self)
2769             return sk
2770
2771         ## Obtain a 2D polyline creation interface
2772         #  @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2773         #
2774         #  @ref tui_3dsketcher_page "Example"
2775         def Polyline2D (self):
2776             """
2777             Obtain a 2D polyline creation interface.
2778
2779             Example of usage:
2780                 pl = geompy.Polyline2D()
2781                 pl.addSection("section 1", GEOM.Polyline, True)
2782                 pl.addPoints(0, 0, 10, 0, 10, 10)
2783                 pl.addSection("section 2", GEOM.Interpolation, False)
2784                 pl.addPoints(20, 0, 30, 0, 30, 10)
2785                 resultObj = pl.result(WorkingPlane)
2786             """
2787             pl = Polyline2D (self)
2788             return pl
2789
2790         # end of l3_sketcher
2791         ## @}
2792
2793         ## @addtogroup l3_3d_primitives
2794         ## @{
2795
2796         ## Create a box by coordinates of two opposite vertices.
2797         #
2798         #  @param x1,y1,z1 double values, defining first point it.
2799         #  @param x2,y2,z2 double values, defining first point it.
2800         #  @param theName Object name; when specified, this parameter is used
2801         #         for result publication in the study. Otherwise, if automatic
2802         #         publication is switched on, default value is used for result name.
2803         #
2804         #  @return New GEOM.GEOM_Object, containing the created box.
2805         #
2806         #  @ref tui_creation_box "Example"
2807         def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2808             """
2809             Create a box by coordinates of two opposite vertices.
2810
2811             Parameters:
2812                 x1,y1,z1 double values, defining first point.
2813                 x2,y2,z2 double values, defining second point.
2814                 theName Object name; when specified, this parameter is used
2815                         for result publication in the study. Otherwise, if automatic
2816                         publication is switched on, default value is used for result name.
2817
2818             Returns:
2819                 New GEOM.GEOM_Object, containing the created box.
2820             """
2821             # Example: see GEOM_TestAll.py
2822             pnt1 = self.MakeVertex(x1,y1,z1)
2823             pnt2 = self.MakeVertex(x2,y2,z2)
2824             # note: auto-publishing is done in self.MakeBoxTwoPnt()
2825             return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2826
2827         ## Create a box with specified dimensions along the coordinate axes
2828         #  and with edges, parallel to the coordinate axes.
2829         #  Center of the box will be at point (DX/2, DY/2, DZ/2).
2830         #  @param theDX Length of Box edges, parallel to OX axis.
2831         #  @param theDY Length of Box edges, parallel to OY axis.
2832         #  @param theDZ Length of Box edges, parallel to OZ axis.
2833         #  @param theName Object name; when specified, this parameter is used
2834         #         for result publication in the study. Otherwise, if automatic
2835         #         publication is switched on, default value is used for result name.
2836         #
2837         #  @return New GEOM.GEOM_Object, containing the created box.
2838         #
2839         #  @ref tui_creation_box "Example"
2840         @ManageTransactions("PrimOp")
2841         def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2842             """
2843             Create a box with specified dimensions along the coordinate axes
2844             and with edges, parallel to the coordinate axes.
2845             Center of the box will be at point (DX/2, DY/2, DZ/2).
2846
2847             Parameters:
2848                 theDX Length of Box edges, parallel to OX axis.
2849                 theDY Length of Box edges, parallel to OY axis.
2850                 theDZ Length of Box edges, parallel to OZ axis.
2851                 theName Object name; when specified, this parameter is used
2852                         for result publication in the study. Otherwise, if automatic
2853                         publication is switched on, default value is used for result name.
2854
2855             Returns:
2856                 New GEOM.GEOM_Object, containing the created box.
2857             """
2858             # Example: see GEOM_TestAll.py
2859             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2860             anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2861             RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2862             anObj.SetParameters(Parameters)
2863             self._autoPublish(anObj, theName, "box")
2864             return anObj
2865
2866         ## Create a box with two specified opposite vertices,
2867         #  and with edges, parallel to the coordinate axes
2868         #  @param thePnt1 First of two opposite vertices.
2869         #  @param thePnt2 Second of two opposite vertices.
2870         #  @param theName Object name; when specified, this parameter is used
2871         #         for result publication in the study. Otherwise, if automatic
2872         #         publication is switched on, default value is used for result name.
2873         #
2874         #  @return New GEOM.GEOM_Object, containing the created box.
2875         #
2876         #  @ref tui_creation_box "Example"
2877         @ManageTransactions("PrimOp")
2878         def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2879             """
2880             Create a box with two specified opposite vertices,
2881             and with edges, parallel to the coordinate axes
2882
2883             Parameters:
2884                 thePnt1 First of two opposite vertices.
2885                 thePnt2 Second of two opposite vertices.
2886                 theName Object name; when specified, this parameter is used
2887                         for result publication in the study. Otherwise, if automatic
2888                         publication is switched on, default value is used for result name.
2889
2890             Returns:
2891                 New GEOM.GEOM_Object, containing the created box.
2892             """
2893             # Example: see GEOM_TestAll.py
2894             anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2895             RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2896             self._autoPublish(anObj, theName, "box")
2897             return anObj
2898
2899         ## Create a face with specified dimensions with edges parallel to coordinate axes.
2900         #  @param theH height of Face.
2901         #  @param theW width of Face.
2902         #  @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2903         #  @param theName Object name; when specified, this parameter is used
2904         #         for result publication in the study. Otherwise, if automatic
2905         #         publication is switched on, default value is used for result name.
2906         #
2907         #  @return New GEOM.GEOM_Object, containing the created face.
2908         #
2909         #  @ref tui_creation_face "Example"
2910         @ManageTransactions("PrimOp")
2911         def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2912             """
2913             Create a face with specified dimensions with edges parallel to coordinate axes.
2914
2915             Parameters:
2916                 theH height of Face.
2917                 theW width of Face.
2918                 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2919                 theName Object name; when specified, this parameter is used
2920                         for result publication in the study. Otherwise, if automatic
2921                         publication is switched on, default value is used for result name.
2922
2923             Returns:
2924                 New GEOM.GEOM_Object, containing the created face.
2925             """
2926             # Example: see GEOM_TestAll.py
2927             theH,theW,Parameters = ParseParameters(theH, theW)
2928             anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2929             RaiseIfFailed("MakeFaceHW", self.PrimOp)
2930             anObj.SetParameters(Parameters)
2931             self._autoPublish(anObj, theName, "rectangle")
2932             return anObj
2933
2934         ## Create a face from another plane and two sizes,
2935         #  vertical size and horisontal size.
2936         #  @param theObj   Normale vector to the creating face or
2937         #  the face object.
2938         #  @param theH     Height (vertical size).
2939         #  @param theW     Width (horisontal size).
2940         #  @param theName Object name; when specified, this parameter is used
2941         #         for result publication in the study. Otherwise, if automatic
2942         #         publication is switched on, default value is used for result name.
2943         #
2944         #  @return New GEOM.GEOM_Object, containing the created face.
2945         #
2946         #  @ref tui_creation_face "Example"
2947         @ManageTransactions("PrimOp")
2948         def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2949             """
2950             Create a face from another plane and two sizes,
2951             vertical size and horisontal size.
2952
2953             Parameters:
2954                 theObj   Normale vector to the creating face or
2955                          the face object.
2956                 theH     Height (vertical size).
2957                 theW     Width (horisontal size).
2958                 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             Returns:
2963                 New GEOM_Object, containing the created face.
2964             """
2965             # Example: see GEOM_TestAll.py
2966             theH,theW,Parameters = ParseParameters(theH, theW)
2967             anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2968             RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2969             anObj.SetParameters(Parameters)
2970             self._autoPublish(anObj, theName, "rectangle")
2971             return anObj
2972
2973         ## Create a disk with given center, normal vector and radius.
2974         #  @param thePnt Disk center.
2975         #  @param theVec Vector, normal to the plane of the disk.
2976         #  @param theR Disk radius.
2977         #  @param theName Object name; when specified, this parameter is used
2978         #         for result publication in the study. Otherwise, if automatic
2979         #         publication is switched on, default value is used for result name.
2980         #
2981         #  @return New GEOM.GEOM_Object, containing the created disk.
2982         #
2983         #  @ref tui_creation_disk "Example"
2984         @ManageTransactions("PrimOp")
2985         def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2986             """
2987             Create a disk with given center, normal vector and radius.
2988
2989             Parameters:
2990                 thePnt Disk center.
2991                 theVec Vector, normal to the plane of the disk.
2992                 theR Disk radius.
2993                 theName Object name; when specified, this parameter is used
2994                         for result publication in the study. Otherwise, if automatic
2995                         publication is switched on, default value is used for result name.
2996
2997             Returns:
2998                 New GEOM.GEOM_Object, containing the created disk.
2999             """
3000             # Example: see GEOM_TestAll.py
3001             theR,Parameters = ParseParameters(theR)
3002             anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
3003             RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
3004             anObj.SetParameters(Parameters)
3005             self._autoPublish(anObj, theName, "disk")
3006             return anObj
3007
3008         ## Create a disk, passing through three given points
3009         #  @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
3010         #  @param theName Object name; when specified, this parameter is used
3011         #         for result publication in the study. Otherwise, if automatic
3012         #         publication is switched on, default value is used for result name.
3013         #
3014         #  @return New GEOM.GEOM_Object, containing the created disk.
3015         #
3016         #  @ref tui_creation_disk "Example"
3017         @ManageTransactions("PrimOp")
3018         def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
3019             """
3020             Create a disk, passing through three given points
3021
3022             Parameters:
3023                 thePnt1,thePnt2,thePnt3 Points, defining the disk.
3024                 theName Object name; when specified, this parameter is used
3025                         for result publication in the study. Otherwise, if automatic
3026                         publication is switched on, default value is used for result name.
3027
3028             Returns:
3029                 New GEOM.GEOM_Object, containing the created disk.
3030             """
3031             # Example: see GEOM_TestAll.py
3032             anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
3033             RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
3034             self._autoPublish(anObj, theName, "disk")
3035             return anObj
3036
3037         ## Create a disk with specified dimensions along OX-OY coordinate axes.
3038         #  @param theR Radius of Face.
3039         #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX
3040         #  @param theName Object name; when specified, this parameter is used
3041         #         for result publication in the study. Otherwise, if automatic
3042         #         publication is switched on, default value is used for result name.
3043         #
3044         #  @return New GEOM.GEOM_Object, containing the created disk.
3045         #
3046         #  @ref tui_creation_face "Example"
3047         @ManageTransactions("PrimOp")
3048         def MakeDiskR(self, theR, theOrientation, theName=None):
3049             """
3050             Create a disk with specified dimensions along OX-OY coordinate axes.
3051
3052             Parameters:
3053                 theR Radius of Face.
3054                 theOrientation set the orientation belong axis OXY or OYZ or OZX
3055                 theName Object name; when specified, this parameter is used
3056                         for result publication in the study. Otherwise, if automatic
3057                         publication is switched on, default value is used for result name.
3058
3059             Returns:
3060                 New GEOM.GEOM_Object, containing the created disk.
3061
3062             Example of usage:
3063                 Disk3 = geompy.MakeDiskR(100., 1)
3064             """
3065             # Example: see GEOM_TestAll.py
3066             theR,Parameters = ParseParameters(theR)
3067             anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
3068             RaiseIfFailed("MakeDiskR", self.PrimOp)
3069             anObj.SetParameters(Parameters)
3070             self._autoPublish(anObj, theName, "disk")
3071             return anObj
3072
3073         ## Create a cylinder with given base point, axis, radius and height.
3074         #  @param thePnt Central point of cylinder base.
3075         #  @param theAxis Cylinder axis.
3076         #  @param theR Cylinder radius.
3077         #  @param theH Cylinder height.
3078         #  @param theName Object name; when specified, this parameter is used
3079         #         for result publication in the study. Otherwise, if automatic
3080         #         publication is switched on, default value is used for result name.
3081         #
3082         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3083         #
3084         #  @ref tui_creation_cylinder "Example"
3085         @ManageTransactions("PrimOp")
3086         def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
3087             """
3088             Create a cylinder with given base point, axis, radius and height.
3089
3090             Parameters:
3091                 thePnt Central point of cylinder base.
3092                 theAxis Cylinder axis.
3093                 theR Cylinder radius.
3094                 theH Cylinder height.
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             theR,theH,Parameters = ParseParameters(theR, theH)
3104             anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3105             RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3106             anObj.SetParameters(Parameters)
3107             self._autoPublish(anObj, theName, "cylinder")
3108             return anObj
3109             
3110         ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3111         #  @param thePnt Central point of cylinder base.
3112         #  @param theAxis Cylinder axis.
3113         #  @param theR Cylinder radius.
3114         #  @param theH Cylinder height.
3115         #  @param theA Cylinder angle in radians.
3116         #  @param theName Object name; when specified, this parameter is used
3117         #         for result publication in the study. Otherwise, if automatic
3118         #         publication is switched on, default value is used for result name.
3119         #
3120         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3121         #
3122         #  @ref tui_creation_cylinder "Example"
3123         @ManageTransactions("PrimOp")
3124         def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3125             """
3126             Create a portion of cylinder with given base point, axis, radius, height and angle.
3127
3128             Parameters:
3129                 thePnt Central point of cylinder base.
3130                 theAxis Cylinder axis.
3131                 theR Cylinder radius.
3132                 theH Cylinder height.
3133                 theA Cylinder angle in radians.
3134                 theName Object name; when specified, this parameter is used
3135                         for result publication in the study. Otherwise, if automatic
3136                         publication is switched on, default value is used for result name.
3137
3138             Returns:
3139                 New GEOM.GEOM_Object, containing the created cylinder.
3140             """
3141             # Example: see GEOM_TestAll.py
3142             flag = False
3143             if isinstance(theA,str):
3144                 flag = True
3145             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3146             if flag:
3147                 theA = theA*math.pi/180.
3148             if theA<=0. or theA>=2*math.pi:
3149                 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3150             anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3151             RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3152             anObj.SetParameters(Parameters)
3153             self._autoPublish(anObj, theName, "cylinder")
3154             return anObj
3155
3156         ## Create a cylinder with given radius and height at
3157         #  the origin of coordinate system. Axis of the cylinder
3158         #  will be collinear to the OZ axis of the coordinate system.
3159         #  @param theR Cylinder radius.
3160         #  @param theH Cylinder height.
3161         #  @param theName Object name; when specified, this parameter is used
3162         #         for result publication in the study. Otherwise, if automatic
3163         #         publication is switched on, default value is used for result name.
3164         #
3165         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3166         #
3167         #  @ref tui_creation_cylinder "Example"
3168         @ManageTransactions("PrimOp")
3169         def MakeCylinderRH(self, theR, theH, theName=None):
3170             """
3171             Create a cylinder with given radius and height at
3172             the origin of coordinate system. Axis of the cylinder
3173             will be collinear to the OZ axis of the coordinate system.
3174
3175             Parameters:
3176                 theR Cylinder radius.
3177                 theH Cylinder height.
3178                 theName Object name; when specified, this parameter is used
3179                         for result publication in the study. Otherwise, if automatic
3180                         publication is switched on, default value is used for result name.
3181
3182             Returns:
3183                 New GEOM.GEOM_Object, containing the created cylinder.
3184             """
3185             # Example: see GEOM_TestAll.py
3186             theR,theH,Parameters = ParseParameters(theR, theH)
3187             anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3188             RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3189             anObj.SetParameters(Parameters)
3190             self._autoPublish(anObj, theName, "cylinder")
3191             return anObj
3192             
3193         ## Create a portion of cylinder with given radius, height and angle at
3194         #  the origin of coordinate system. Axis of the cylinder
3195         #  will be collinear to the OZ axis of the coordinate system.
3196         #  @param theR Cylinder radius.
3197         #  @param theH Cylinder height.
3198         #  @param theA Cylinder angle in radians.
3199         #  @param theName Object name; when specified, this parameter is used
3200         #         for result publication in the study. Otherwise, if automatic
3201         #         publication is switched on, default value is used for result name.
3202         #
3203         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3204         #
3205         #  @ref tui_creation_cylinder "Example"
3206         @ManageTransactions("PrimOp")
3207         def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3208             """
3209             Create a portion of cylinder with given radius, height and angle at
3210             the origin of coordinate system. Axis of the cylinder
3211             will be collinear to the OZ axis of the coordinate system.
3212
3213             Parameters:
3214                 theR Cylinder radius.
3215                 theH Cylinder height.
3216                 theA Cylinder angle in radians.
3217                 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             Returns:
3222                 New GEOM.GEOM_Object, containing the created cylinder.
3223             """
3224             # Example: see GEOM_TestAll.py
3225             flag = False
3226             if isinstance(theA,str):
3227                 flag = True
3228             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3229             if flag:
3230                 theA = theA*math.pi/180.
3231             if theA<=0. or theA>=2*math.pi:
3232                 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3233             anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3234             RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3235             anObj.SetParameters(Parameters)
3236             self._autoPublish(anObj, theName, "cylinder")
3237             return anObj
3238
3239         ## Create a sphere with given center and radius.
3240         #  @param thePnt Sphere center.
3241         #  @param theR Sphere radius.
3242         #  @param theName Object name; when specified, this parameter is used
3243         #         for result publication in the study. Otherwise, if automatic
3244         #         publication is switched on, default value is used for result name.
3245         #
3246         #  @return New GEOM.GEOM_Object, containing the created sphere.
3247         #
3248         #  @ref tui_creation_sphere "Example"
3249         @ManageTransactions("PrimOp")
3250         def MakeSpherePntR(self, thePnt, theR, theName=None):
3251             """
3252             Create a sphere with given center and radius.
3253
3254             Parameters:
3255                 thePnt Sphere center.
3256                 theR Sphere radius.
3257                 theName Object name; when specified, this parameter is used
3258                         for result publication in the study. Otherwise, if automatic
3259                         publication is switched on, default value is used for result name.
3260
3261             Returns:
3262                 New GEOM.GEOM_Object, containing the created sphere.
3263             """
3264             # Example: see GEOM_TestAll.py
3265             theR,Parameters = ParseParameters(theR)
3266             anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3267             RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3268             anObj.SetParameters(Parameters)
3269             self._autoPublish(anObj, theName, "sphere")
3270             return anObj
3271
3272         ## Create a sphere with given center and radius.
3273         #  @param x,y,z Coordinates of sphere center.
3274         #  @param theR Sphere radius.
3275         #  @param theName Object name; when specified, this parameter is used
3276         #         for result publication in the study. Otherwise, if automatic
3277         #         publication is switched on, default value is used for result name.
3278         #
3279         #  @return New GEOM.GEOM_Object, containing the created sphere.
3280         #
3281         #  @ref tui_creation_sphere "Example"
3282         def MakeSphere(self, x, y, z, theR, theName=None):
3283             """
3284             Create a sphere with given center and radius.
3285
3286             Parameters:
3287                 x,y,z Coordinates of sphere center.
3288                 theR Sphere radius.
3289                 theName Object name; when specified, this parameter is used
3290                         for result publication in the study. Otherwise, if automatic
3291                         publication is switched on, default value is used for result name.
3292
3293             Returns:
3294                 New GEOM.GEOM_Object, containing the created sphere.
3295             """
3296             # Example: see GEOM_TestAll.py
3297             point = self.MakeVertex(x, y, z)
3298             # note: auto-publishing is done in self.MakeSpherePntR()
3299             anObj = self.MakeSpherePntR(point, theR, theName)
3300             return anObj
3301
3302         ## Create a sphere with given radius at the origin of coordinate system.
3303         #  @param theR Sphere 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 sphere.
3309         #
3310         #  @ref tui_creation_sphere "Example"
3311         @ManageTransactions("PrimOp")
3312         def MakeSphereR(self, theR, theName=None):
3313             """
3314             Create a sphere with given radius at the origin of coordinate system.
3315
3316             Parameters:
3317                 theR Sphere radius.
3318                 theName Object name; when specified, this parameter is used
3319                         for result publication in the study. Otherwise, if automatic
3320                         publication is switched on, default value is used for result name.
3321
3322             Returns:
3323                 New GEOM.GEOM_Object, containing the created sphere.
3324             """
3325             # Example: see GEOM_TestAll.py
3326             theR,Parameters = ParseParameters(theR)
3327             anObj = self.PrimOp.MakeSphereR(theR)
3328             RaiseIfFailed("MakeSphereR", self.PrimOp)
3329             anObj.SetParameters(Parameters)
3330             self._autoPublish(anObj, theName, "sphere")
3331             return anObj
3332
3333         ## Create a cone with given base point, axis, height and radiuses.
3334         #  @param thePnt Central point of the first cone base.
3335         #  @param theAxis Cone axis.
3336         #  @param theR1 Radius of the first cone base.
3337         #  @param theR2 Radius of the second cone base.
3338         #    \note If both radiuses are non-zero, the cone will be truncated.
3339         #    \note If the radiuses are equal, a cylinder will be created instead.
3340         #  @param theH Cone height.
3341         #  @param theName Object name; when specified, this parameter is used
3342         #         for result publication in the study. Otherwise, if automatic
3343         #         publication is switched on, default value is used for result name.
3344         #
3345         #  @return New GEOM.GEOM_Object, containing the created cone.
3346         #
3347         #  @ref tui_creation_cone "Example"
3348         @ManageTransactions("PrimOp")
3349         def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3350             """
3351             Create a cone with given base point, axis, height and radiuses.
3352
3353             Parameters:
3354                 thePnt Central point of the first cone base.
3355                 theAxis Cone axis.
3356                 theR1 Radius of the first cone base.
3357                 theR2 Radius of the second cone base.
3358                 theH Cone height.
3359                 theName Object name; when specified, this parameter is used
3360                         for result publication in the study. Otherwise, if automatic
3361                         publication is switched on, default value is used for result name.
3362
3363             Note:
3364                 If both radiuses are non-zero, the cone will be truncated.
3365                 If the radiuses are equal, a cylinder will be created instead.
3366
3367             Returns:
3368                 New GEOM.GEOM_Object, containing the created cone.
3369             """
3370             # Example: see GEOM_TestAll.py
3371             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3372             anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3373             RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3374             anObj.SetParameters(Parameters)
3375             self._autoPublish(anObj, theName, "cone")
3376             return anObj
3377
3378         ## Create a cone with given height and radiuses at
3379         #  the origin of coordinate system. Axis of the cone will
3380         #  be collinear to the OZ axis of the coordinate system.
3381         #  @param theR1 Radius of the first cone base.
3382         #  @param theR2 Radius of the second cone base.
3383         #    \note If both radiuses are non-zero, the cone will be truncated.
3384         #    \note If the radiuses are equal, a cylinder will be created instead.
3385         #  @param theH Cone height.
3386         #  @param theName Object name; when specified, this parameter is used
3387         #         for result publication in the study. Otherwise, if automatic
3388         #         publication is switched on, default value is used for result name.
3389         #
3390         #  @return New GEOM.GEOM_Object, containing the created cone.
3391         #
3392         #  @ref tui_creation_cone "Example"
3393         @ManageTransactions("PrimOp")
3394         def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3395             """
3396             Create a cone with given height and radiuses at
3397             the origin of coordinate system. Axis of the cone will
3398             be collinear to the OZ axis of the coordinate system.
3399
3400             Parameters:
3401                 theR1 Radius of the first cone base.
3402                 theR2 Radius of the second cone base.
3403                 theH Cone height.
3404                 theName Object name; when specified, this parameter is used
3405                         for result publication in the study. Otherwise, if automatic
3406                         publication is switched on, default value is used for result name.
3407
3408             Note:
3409                 If both radiuses are non-zero, the cone will be truncated.
3410                 If the radiuses are equal, a cylinder will be created instead.
3411
3412             Returns:
3413                 New GEOM.GEOM_Object, containing the created cone.
3414             """
3415             # Example: see GEOM_TestAll.py
3416             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3417             anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3418             RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3419             anObj.SetParameters(Parameters)
3420             self._autoPublish(anObj, theName, "cone")
3421             return anObj
3422
3423         ## Create a torus with given center, normal vector and radiuses.
3424         #  @param thePnt Torus central point.
3425         #  @param theVec Torus axis of symmetry.
3426         #  @param theRMajor Torus major radius.
3427         #  @param theRMinor Torus minor radius.
3428         #  @param theName Object name; when specified, this parameter is used
3429         #         for result publication in the study. Otherwise, if automatic
3430         #         publication is switched on, default value is used for result name.
3431         #
3432         #  @return New GEOM.GEOM_Object, containing the created torus.
3433         #
3434         #  @ref tui_creation_torus "Example"
3435         @ManageTransactions("PrimOp")
3436         def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3437             """
3438             Create a torus with given center, normal vector and radiuses.
3439
3440             Parameters:
3441                 thePnt Torus central point.
3442                 theVec Torus axis of symmetry.
3443                 theRMajor Torus major radius.
3444                 theRMinor Torus minor radius.
3445                 theName Object name; when specified, this parameter is used
3446                         for result publication in the study. Otherwise, if automatic
3447                         publication is switched on, default value is used for result name.
3448
3449            Returns:
3450                 New GEOM.GEOM_Object, containing the created torus.
3451             """
3452             # Example: see GEOM_TestAll.py
3453             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3454             anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3455             RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3456             anObj.SetParameters(Parameters)
3457             self._autoPublish(anObj, theName, "torus")
3458             return anObj
3459
3460         ## Create a torus with given radiuses at the origin of coordinate system.
3461         #  @param theRMajor Torus major radius.
3462         #  @param theRMinor Torus minor radius.
3463         #  @param theName Object name; when specified, this parameter is used
3464         #         for result publication in the study. Otherwise, if automatic
3465         #         publication is switched on, default value is used for result name.
3466         #
3467         #  @return New GEOM.GEOM_Object, containing the created torus.
3468         #
3469         #  @ref tui_creation_torus "Example"
3470         @ManageTransactions("PrimOp")
3471         def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3472             """
3473            Create a torus with given radiuses at the origin of coordinate system.
3474
3475            Parameters:
3476                 theRMajor Torus major radius.
3477                 theRMinor Torus minor radius.
3478                 theName Object name; when specified, this parameter is used
3479                         for result publication in the study. Otherwise, if automatic
3480                         publication is switched on, default value is used for result name.
3481
3482            Returns:
3483                 New GEOM.GEOM_Object, containing the created torus.
3484             """
3485             # Example: see GEOM_TestAll.py
3486             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3487             anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3488             RaiseIfFailed("MakeTorusRR", self.PrimOp)
3489             anObj.SetParameters(Parameters)
3490             self._autoPublish(anObj, theName, "torus")
3491             return anObj
3492
3493         # end of l3_3d_primitives
3494         ## @}
3495
3496         ## @addtogroup l3_complex
3497         ## @{
3498
3499         ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3500         #  @param theBase Base shape to be extruded.
3501         #  @param thePoint1 First end of extrusion vector.
3502         #  @param thePoint2 Second end of extrusion vector.
3503         #  @param theScaleFactor Use it to make prism with scaled second base.
3504         #                        Nagative value means not scaled second base.
3505         #  @param theName Object name; when specified, this parameter is used
3506         #         for result publication in the study. Otherwise, if automatic
3507         #         publication is switched on, default value is used for result name.
3508         #
3509         #  @return New GEOM.GEOM_Object, containing the created prism.
3510         #
3511         #  @ref tui_creation_prism "Example"
3512         @ManageTransactions("PrimOp")
3513         def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3514             """
3515             Create a shape by extrusion of the base shape along a vector, defined by two points.
3516
3517             Parameters:
3518                 theBase Base shape to be extruded.
3519                 thePoint1 First end of extrusion vector.
3520                 thePoint2 Second end of extrusion vector.
3521                 theScaleFactor Use it to make prism with scaled second base.
3522                                Nagative value means not scaled second base.
3523                 theName Object name; when specified, this parameter is used
3524                         for result publication in the study. Otherwise, if automatic
3525                         publication is switched on, default value is used for result name.
3526
3527             Returns:
3528                 New GEOM.GEOM_Object, containing the created prism.
3529             """
3530             # Example: see GEOM_TestAll.py
3531             anObj = None
3532             Parameters = ""
3533             if theScaleFactor > 0:
3534                 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3535                 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3536             else:
3537                 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3538             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3539             anObj.SetParameters(Parameters)
3540             self._autoPublish(anObj, theName, "prism")
3541             return anObj
3542
3543         ## Create a shape by extrusion of the base shape along a
3544         #  vector, defined by two points, in 2 Ways (forward/backward).
3545         #  @param theBase Base shape to be extruded.
3546         #  @param thePoint1 First end of extrusion vector.
3547         #  @param thePoint2 Second end of extrusion vector.
3548         #  @param theName Object name; when specified, this parameter is used
3549         #         for result publication in the study. Otherwise, if automatic
3550         #         publication is switched on, default value is used for result name.
3551         #
3552         #  @return New GEOM.GEOM_Object, containing the created prism.
3553         #
3554         #  @ref tui_creation_prism "Example"
3555         @ManageTransactions("PrimOp")
3556         def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3557             """
3558             Create a shape by extrusion of the base shape along a
3559             vector, defined by two points, in 2 Ways (forward/backward).
3560
3561             Parameters:
3562                 theBase Base shape to be extruded.
3563                 thePoint1 First end of extrusion vector.
3564                 thePoint2 Second end of extrusion vector.
3565                 theName Object name; when specified, this parameter is used
3566                         for result publication in the study. Otherwise, if automatic
3567                         publication is switched on, default value is used for result name.
3568
3569             Returns:
3570                 New GEOM.GEOM_Object, containing the created prism.
3571             """
3572             # Example: see GEOM_TestAll.py
3573             anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3574             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3575             self._autoPublish(anObj, theName, "prism")
3576             return anObj
3577
3578         ## Create a shape by extrusion of the base shape along the vector,
3579         #  i.e. all the space, transfixed by the base shape during its translation
3580         #  along the vector on the given distance.
3581         #  @param theBase Base shape to be extruded.
3582         #  @param theVec Direction of extrusion.
3583         #  @param theH Prism dimension along theVec.
3584         #  @param theScaleFactor Use it to make prism with scaled second base.
3585         #                        Negative value means not scaled second base.
3586         #  @param theName Object name; when specified, this parameter is used
3587         #         for result publication in the study. Otherwise, if automatic
3588         #         publication is switched on, default value is used for result name.
3589         #
3590         #  @return New GEOM.GEOM_Object, containing the created prism.
3591         #
3592         #  @ref tui_creation_prism "Example"
3593         @ManageTransactions("PrimOp")
3594         def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3595             """
3596             Create a shape by extrusion of the base shape along the vector,
3597             i.e. all the space, transfixed by the base shape during its translation
3598             along the vector on the given distance.
3599
3600             Parameters:
3601                 theBase Base shape to be extruded.
3602                 theVec Direction of extrusion.
3603                 theH Prism dimension along theVec.
3604                 theScaleFactor Use it to make prism with scaled second base.
3605                                Negative value means not scaled second base.
3606                 theName Object name; when specified, this parameter is used
3607                         for result publication in the study. Otherwise, if automatic
3608                         publication is switched on, default value is used for result name.
3609
3610             Returns:
3611                 New GEOM.GEOM_Object, containing the created prism.
3612             """
3613             # Example: see GEOM_TestAll.py
3614             anObj = None
3615             Parameters = ""
3616             if theScaleFactor > 0:
3617                 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3618                 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3619             else:
3620                 theH,Parameters = ParseParameters(theH)
3621                 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3622             RaiseIfFailed("MakePrismVecH", self.PrimOp)
3623             anObj.SetParameters(Parameters)
3624             self._autoPublish(anObj, theName, "prism")
3625             return anObj
3626
3627         ## Create a shape by extrusion of the base shape along the vector,
3628         #  i.e. all the space, transfixed by the base shape during its translation
3629         #  along the vector on the given distance in 2 Ways (forward/backward).
3630         #  @param theBase Base shape to be extruded.
3631         #  @param theVec Direction of extrusion.
3632         #  @param theH Prism dimension along theVec in forward direction.
3633         #  @param theName Object name; when specified, this parameter is used
3634         #         for result publication in the study. Otherwise, if automatic
3635         #         publication is switched on, default value is used for result name.
3636         #
3637         #  @return New GEOM.GEOM_Object, containing the created prism.
3638         #
3639         #  @ref tui_creation_prism "Example"
3640         @ManageTransactions("PrimOp")
3641         def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3642             """
3643             Create a shape by extrusion of the base shape along the vector,
3644             i.e. all the space, transfixed by the base shape during its translation
3645             along the vector on the given distance in 2 Ways (forward/backward).
3646
3647             Parameters:
3648                 theBase Base shape to be extruded.
3649                 theVec Direction of extrusion.
3650                 theH Prism dimension along theVec in forward direction.
3651                 theName Object name; when specified, this parameter is used
3652                         for result publication in the study. Otherwise, if automatic
3653                         publication is switched on, default value is used for result name.
3654
3655             Returns:
3656                 New GEOM.GEOM_Object, containing the created prism.
3657             """
3658             # Example: see GEOM_TestAll.py
3659             theH,Parameters = ParseParameters(theH)
3660             anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3661             RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3662             anObj.SetParameters(Parameters)
3663             self._autoPublish(anObj, theName, "prism")
3664             return anObj
3665
3666         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3667         #  @param theBase Base shape to be extruded.
3668         #  @param theDX, theDY, theDZ Directions of extrusion.
3669         #  @param theScaleFactor Use it to make prism with scaled second base.
3670         #                        Nagative value means not scaled second base.
3671         #  @param theName Object name; when specified, this parameter is used
3672         #         for result publication in the study. Otherwise, if automatic
3673         #         publication is switched on, default value is used for result name.
3674         #
3675         #  @return New GEOM.GEOM_Object, containing the created prism.
3676         #
3677         #  @ref tui_creation_prism "Example"
3678         @ManageTransactions("PrimOp")
3679         def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3680             """
3681             Create a shape by extrusion of the base shape along the dx, dy, dz direction
3682
3683             Parameters:
3684                 theBase Base shape to be extruded.
3685                 theDX, theDY, theDZ Directions of extrusion.
3686                 theScaleFactor Use it to make prism with scaled second base.
3687                                Nagative value means not scaled second base.
3688                 theName Object name; when specified, this parameter is used
3689                         for result publication in the study. Otherwise, if automatic
3690                         publication is switched on, default value is used for result name.
3691
3692             Returns:
3693                 New GEOM.GEOM_Object, containing the created prism.
3694             """
3695             # Example: see GEOM_TestAll.py
3696             anObj = None
3697             Parameters = ""
3698             if theScaleFactor > 0:
3699                 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3700                 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3701             else:
3702                 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3703                 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3704             RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3705             anObj.SetParameters(Parameters)
3706             self._autoPublish(anObj, theName, "prism")
3707             return anObj
3708
3709         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3710         #  i.e. all the space, transfixed by the base shape during its translation
3711         #  along the vector on the given distance in 2 Ways (forward/backward).
3712         #  @param theBase Base shape to be extruded.
3713         #  @param theDX, theDY, theDZ Directions of extrusion.
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 prism.
3719         #
3720         #  @ref tui_creation_prism "Example"
3721         @ManageTransactions("PrimOp")
3722         def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3723             """
3724             Create a shape by extrusion of the base shape along the dx, dy, dz direction
3725             i.e. all the space, transfixed by the base shape during its translation
3726             along the vector on the given distance in 2 Ways (forward/backward).
3727
3728             Parameters:
3729                 theBase Base shape to be extruded.
3730                 theDX, theDY, theDZ Directions of extrusion.
3731                 theName Object name; when specified, this parameter is used
3732                         for result publication in the study. Otherwise, if automatic
3733                         publication is switched on, default value is used for result name.
3734
3735             Returns:
3736                 New GEOM.GEOM_Object, containing the created prism.
3737             """
3738             # Example: see GEOM_TestAll.py
3739             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3740             anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3741             RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3742             anObj.SetParameters(Parameters)
3743             self._autoPublish(anObj, theName, "prism")
3744             return anObj
3745
3746         ## Create a shape by revolution of the base shape around the axis
3747         #  on the given angle, i.e. all the space, transfixed by the base
3748         #  shape during its rotation around the axis on the given angle.
3749         #  @param theBase Base shape to be rotated.
3750         #  @param theAxis Rotation axis.
3751         #  @param theAngle Rotation angle in radians.
3752         #  @param theName Object name; when specified, this parameter is used
3753         #         for result publication in the study. Otherwise, if automatic
3754         #         publication is switched on, default value is used for result name.
3755         #
3756         #  @return New GEOM.GEOM_Object, containing the created revolution.
3757         #
3758         #  @ref tui_creation_revolution "Example"
3759         @ManageTransactions("PrimOp")
3760         def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3761             """
3762             Create a shape by revolution of the base shape around the axis
3763             on the given angle, i.e. all the space, transfixed by the base
3764             shape during its rotation around the axis on the given angle.
3765
3766             Parameters:
3767                 theBase Base shape to be rotated.
3768                 theAxis Rotation axis.
3769                 theAngle Rotation angle in radians.
3770                 theName Object name; when specified, this parameter is used
3771                         for result publication in the study. Otherwise, if automatic
3772                         publication is switched on, default value is used for result name.
3773
3774             Returns:
3775                 New GEOM.GEOM_Object, containing the created revolution.
3776             """
3777             # Example: see GEOM_TestAll.py
3778             theAngle,Parameters = ParseParameters(theAngle)
3779             anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3780             RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3781             anObj.SetParameters(Parameters)
3782             self._autoPublish(anObj, theName, "revolution")
3783             return anObj
3784
3785         ## Create a shape by revolution of the base shape around the axis
3786         #  on the given angle, i.e. all the space, transfixed by the base
3787         #  shape during its rotation around the axis on the given angle in
3788         #  both directions (forward/backward)
3789         #  @param theBase Base shape to be rotated.
3790         #  @param theAxis Rotation axis.
3791         #  @param theAngle Rotation angle in radians.
3792         #  @param theName Object name; when specified, this parameter is used
3793         #         for result publication in the study. Otherwise, if automatic
3794         #         publication is switched on, default value is used for result name.
3795         #
3796         #  @return New GEOM.GEOM_Object, containing the created revolution.
3797         #
3798         #  @ref tui_creation_revolution "Example"
3799         @ManageTransactions("PrimOp")
3800         def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3801             """
3802             Create a shape by revolution of the base shape around the axis
3803             on the given angle, i.e. all the space, transfixed by the base
3804             shape during its rotation around the axis on the given angle in
3805             both directions (forward/backward).
3806
3807             Parameters:
3808                 theBase Base shape to be rotated.
3809                 theAxis Rotation axis.
3810                 theAngle Rotation angle in radians.
3811                 theName Object name; when specified, this parameter is used
3812                         for result publication in the study. Otherwise, if automatic
3813                         publication is switched on, default value is used for result name.
3814
3815             Returns:
3816                 New GEOM.GEOM_Object, containing the created revolution.
3817             """
3818             theAngle,Parameters = ParseParameters(theAngle)
3819             anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3820             RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3821             anObj.SetParameters(Parameters)
3822             self._autoPublish(anObj, theName, "revolution")
3823             return anObj
3824
3825         ## Create a face from a given set of contours.
3826         #  @param theContours either a list or a compound of edges/wires.
3827         #  @param theMinDeg a minimal degree of BSpline surface to create.
3828         #  @param theMaxDeg a maximal degree of BSpline surface to create.
3829         #  @param theTol2D a 2d tolerance to be reached.
3830         #  @param theTol3D a 3d tolerance to be reached.
3831         #  @param theNbIter a number of iteration of approximation algorithm.
3832         #  @param theMethod Kind of method to perform filling operation
3833         #         (see GEOM.filling_oper_method enum).
3834         #  @param isApprox if True, BSpline curves are generated in the process
3835         #                  of surface construction. By default it is False, that means
3836         #                  the surface is created using given curves. The usage of
3837         #                  Approximation makes the algorithm work slower, but allows
3838         #                  building the surface for rather complex cases.
3839         #  @param theName Object name; when specified, this parameter is used
3840         #         for result publication in the study. Otherwise, if automatic
3841         #         publication is switched on, default value is used for result name.
3842         #
3843         #  @return New GEOM.GEOM_Object (face), containing the created filling surface.
3844         #
3845         #  @ref tui_creation_filling "Example"
3846         @ManageTransactions("PrimOp")
3847         def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3848                         theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3849             """
3850             Create a face from a given set of contours.
3851
3852             Parameters:
3853                 theContours either a list or a compound of edges/wires.
3854                 theMinDeg a minimal degree of BSpline surface to create.
3855                 theMaxDeg a maximal degree of BSpline surface to create.
3856                 theTol2D a 2d tolerance to be reached.
3857                 theTol3D a 3d tolerance to be reached.
3858                 theNbIter a number of iteration of approximation algorithm.
3859                 theMethod Kind of method to perform filling operation
3860                           (see GEOM.filling_oper_method enum).
3861                 isApprox if True, BSpline curves are generated in the process
3862                          of surface construction. By default it is False, that means
3863                          the surface is created using given curves. The usage of
3864                          Approximation makes the algorithm work slower, but allows
3865                          building the surface for rather complex cases.
3866                 theName Object name; when specified, this parameter is used
3867                         for result publication in the study. Otherwise, if automatic
3868                         publication is switched on, default value is used for result name.
3869
3870             Returns:
3871                 New GEOM.GEOM_Object (face), containing the created filling surface.
3872
3873             Example of usage:
3874                 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3875             """
3876             # Example: see GEOM_TestAll.py
3877             theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3878             anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3879                                             theTol2D, theTol3D, theNbIter,
3880                                             theMethod, isApprox)
3881             RaiseIfFailed("MakeFilling", self.PrimOp)
3882             anObj.SetParameters(Parameters)
3883             self._autoPublish(anObj, theName, "filling")
3884             return anObj
3885
3886
3887         ## Create a face from a given set of contours.
3888         #  This method corresponds to MakeFilling() with isApprox=True.
3889         #  @param theContours either a list or a compound of edges/wires.
3890         #  @param theMinDeg a minimal degree of BSpline surface to create.
3891         #  @param theMaxDeg a maximal degree of BSpline surface to create.
3892         #  @param theTol3D a 3d tolerance to be reached.
3893         #  @param theName Object name; when specified, this parameter is used
3894         #         for result publication in the study. Otherwise, if automatic
3895         #         publication is switched on, default value is used for result name.
3896         #
3897         #  @return New GEOM.GEOM_Object (face), containing the created filling surface.
3898         #
3899         #  @ref tui_creation_filling "Example"
3900         @ManageTransactions("PrimOp")
3901         def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3902             """
3903             Create a filling from the given compound of contours.
3904             This method corresponds to MakeFilling() with isApprox=True.
3905
3906             Parameters:
3907                 theContours either a list or a compound of edges/wires.
3908                 theMinDeg a minimal degree of BSpline surface to create.
3909                 theMaxDeg a maximal degree of BSpline surface to create.
3910                 theTol3D a 3d tolerance to be reached.
3911                 theName Object name; when specified, this parameter is used
3912                         for result publication in the study. Otherwise, if automatic
3913                         publication is switched on, default value is used for result name.
3914
3915             Returns:
3916                 New GEOM.GEOM_Object (face), containing the created filling surface.
3917
3918             Example of usage:
3919                 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3920             """
3921             # Example: see GEOM_TestAll.py
3922             theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3923             anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3924                                             0, theTol3D, 0, GEOM.FOM_Default, True)
3925             RaiseIfFailed("MakeFillingNew", self.PrimOp)
3926             anObj.SetParameters(Parameters)
3927             self._autoPublish(anObj, theName, "filling")
3928             return anObj
3929
3930         ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3931         #  @param theSeqSections - set of specified sections.
3932         #  @param theModeSolid - mode defining building solid or shell
3933         #  @param thePreci - precision 3D used for smoothing
3934         #  @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3935         #  @param theName Object name; when specified, this parameter is used
3936         #         for result publication in the study. Otherwise, if automatic
3937         #         publication is switched on, default value is used for result name.
3938         #
3939         #  @return New GEOM.GEOM_Object, containing the created shell or solid.
3940         #
3941         #  @ref swig_todo "Example"
3942         @ManageTransactions("PrimOp")
3943         def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3944             """
3945             Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3946
3947             Parameters:
3948                 theSeqSections - set of specified sections.
3949                 theModeSolid - mode defining building solid or shell
3950                 thePreci - precision 3D used for smoothing
3951                 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3952                 theName Object name; when specified, this parameter is used
3953                         for result publication in the study. Otherwise, if automatic
3954                         publication is switched on, default value is used for result name.
3955
3956             Returns:
3957                 New GEOM.GEOM_Object, containing the created shell or solid.
3958             """
3959             # Example: see GEOM_TestAll.py
3960             anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3961             RaiseIfFailed("MakeThruSections", self.PrimOp)
3962             self._autoPublish(anObj, theName, "filling")
3963             return anObj
3964
3965         ## Create a shape by extrusion of the base shape along
3966         #  the path shape. The path shape can be a wire or an edge. It is
3967         #  possible to generate groups along with the result by means of
3968         #  setting the flag \a IsGenerateGroups.<BR>
3969         #  If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3970         #  set, an error is occurred. If \a thePath is not closed edge/wire,
3971         #  the following groups are returned:
3972         #  - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3973         #    "Side2";
3974         #  - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3975         #    "Other".
3976         #  .
3977         #  "Down" and "Up" groups contain:
3978         #  - Edges if \a theBase is edge or wire;
3979         #  - Faces if \a theBase is face or shell.<BR>
3980         #  .
3981         #  "Side1" and "Side2" groups contain edges generated from the first
3982         #  and last vertices of \a theBase. The first and last vertices are
3983         #  determined taking into account edge/wire orientation.<BR>
3984         #  "Other" group represents faces generated from the bounding edges of
3985         #  \a theBase.
3986         #
3987         #  @param theBase Base shape to be extruded.
3988         #  @param thePath Path shape to extrude the base shape along it.
3989         #  @param IsGenerateGroups flag that tells if it is necessary to
3990         #         create groups. It is equal to False by default.
3991         #  @param theName Object name; when specified, this parameter is used
3992         #         for result publication in the study. Otherwise, if automatic
3993         #         publication is switched on, default value is used for result name.
3994         #
3995         #  @return New GEOM.GEOM_Object, containing the created pipe if 
3996         #          \a IsGenerateGroups is not set. Otherwise it returns a
3997         #          list of GEOM.GEOM_Object. Its first element is the created pipe, the
3998         #          remaining ones are created groups.
3999         #
4000         #  @ref tui_creation_pipe "Example"
4001         @ManageTransactions("PrimOp")
4002         def MakePipe(self, theBase, thePath,
4003                      IsGenerateGroups=False, theName=None):
4004             """
4005             Create a shape by extrusion of the base shape along
4006             the path shape. The path shape can be a wire or an edge. It is
4007             possible to generate groups along with the result by means of
4008             setting the flag IsGenerateGroups.
4009             If thePath is a closed edge or wire and IsGenerateGroups is
4010             set, an error is occurred. If thePath is not closed edge/wire,
4011             the following groups are returned:
4012             - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
4013               "Side2";
4014             - If theBase is closed edge or wire, face or shell: "Down", "Up",
4015               "Other".
4016             "Down" and "Up" groups contain:
4017             - Edges if theBase is edge or wire;
4018             - Faces if theBase is face or shell.
4019             "Side1" and "Side2" groups contain edges generated from the first
4020             and last vertices of theBase. The first and last vertices are
4021             determined taking into account edge/wire orientation.
4022             "Other" group represents faces generated from the bounding edges of
4023             theBase.
4024
4025             Parameters:
4026                 theBase Base shape to be extruded.
4027                 thePath Path shape to extrude the base shape along it.
4028                 IsGenerateGroups flag that tells if it is necessary to
4029                         create groups. It is equal to False by default.
4030                 theName Object name; when specified, this parameter is used
4031                         for result publication in the study. Otherwise, if automatic
4032                         publication is switched on, default value is used for result name.
4033
4034             Returns:
4035                 New GEOM.GEOM_Object, containing the created pipe if 
4036                 IsGenerateGroups is not set. Otherwise it returns a
4037                 list of GEOM.GEOM_Object. Its first element is the created pipe, the
4038                 remaining ones are created groups.
4039             """
4040             # Example: see GEOM_TestAll.py
4041             aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
4042             RaiseIfFailed("MakePipe", self.PrimOp)
4043
4044             if IsGenerateGroups:
4045               self._autoPublish(aList, theName, "pipe")
4046               return aList
4047
4048             self._autoPublish(aList[0], theName, "pipe")
4049             return aList[0]
4050
4051         ## Create a shape by extrusion of the profile shape along
4052         #  the path shape. The path shape can be a wire or an edge.
4053         #  the several profiles can be specified in the several locations of path.
4054         #  It is possible to generate groups along with the result by means of
4055         #  setting the flag \a IsGenerateGroups. For detailed information on
4056         #  groups that can be created please see the method MakePipe().
4057         #  @param theSeqBases - list of  Bases shape to be extruded.
4058         #  @param theLocations - list of locations on the path corresponding
4059         #                        specified list of the Bases shapes. Number of locations
4060         #                        should be equal to number of bases or list of locations can be empty.
4061         #  @param thePath - Path shape to extrude the base shape along it.
4062         #  @param theWithContact - the mode defining that the section is translated to be in
4063         #                          contact with the spine.
4064         #  @param theWithCorrection - defining that the section is rotated to be
4065         #                             orthogonal to the spine tangent in the correspondent point
4066         #  @param IsGenerateGroups - flag that tells if it is necessary to
4067         #                          create groups. It is equal to False by default.
4068         #  @param theName Object name; when specified, this parameter is used
4069         #         for result publication in the study. Otherwise, if automatic
4070         #         publication is switched on, default value is used for result name.
4071         #
4072         #  @return New GEOM.GEOM_Object, containing the created pipe if 
4073         #          \a IsGenerateGroups is not set. Otherwise it returns new
4074         #          GEOM.ListOfGO. Its first element is the created pipe, the
4075         #          remaining ones are created groups.
4076         #
4077         #  @ref tui_creation_pipe_with_diff_sec "Example"
4078         @ManageTransactions("PrimOp")
4079         def MakePipeWithDifferentSections(self, theSeqBases,
4080                                           theLocations, thePath,
4081                                           theWithContact, theWithCorrection,
4082                                           IsGenerateGroups=False, theName=None):
4083             """
4084             Create a shape by extrusion of the profile shape along
4085             the path shape. The path shape can be a wire or an edge.
4086             the several profiles can be specified in the several locations of path.
4087             It is possible to generate groups along with the result by means of
4088             setting the flag IsGenerateGroups. For detailed information on
4089             groups that can be created please see the method geompy.MakePipe().
4090
4091             Parameters:
4092                 theSeqBases - list of  Bases shape to be extruded.
4093                 theLocations - list of locations on the path corresponding
4094                                specified list of the Bases shapes. Number of locations
4095                                should be equal to number of bases or list of locations can be empty.
4096                 thePath - Path shape to extrude the base shape along it.
4097                 theWithContact - the mode defining that the section is translated to be in
4098                                  contact with the spine(0/1)
4099                 theWithCorrection - defining that the section is rotated to be
4100                                     orthogonal to the spine tangent in the correspondent point (0/1)
4101                 IsGenerateGroups - flag that tells if it is necessary to
4102                                  create groups. It is equal to False by default.
4103                 theName Object name; when specified, this parameter is used
4104                         for result publication in the study. Otherwise, if automatic
4105                         publication is switched on, default value is used for result name.
4106
4107             Returns:
4108                 New GEOM.GEOM_Object, containing the created pipe if 
4109                 IsGenerateGroups is not set. Otherwise it returns new
4110                 GEOM.ListOfGO. Its first element is the created pipe, the
4111                 remaining ones are created groups.
4112             """
4113             aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4114                                                               theLocations, thePath,
4115                                                               theWithContact, theWithCorrection,
4116                                                               False, IsGenerateGroups)
4117             RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4118
4119             if IsGenerateGroups:
4120               self._autoPublish(aList, theName, "pipe")
4121               return aList
4122
4123             self._autoPublish(aList[0], theName, "pipe")
4124             return aList[0]
4125
4126         ## Create a shape by extrusion of the profile shape along
4127         #  the path shape. This function is a version of
4128         #  MakePipeWithDifferentSections() with the same parameters, except
4129         #  eliminated theWithContact and theWithCorrection. So it is
4130         #  possible to find the description of all parameters is in this
4131         #  method. The difference is that this method performs the operation
4132         #  step by step, i.e. it creates pipes between each pair of neighbor
4133         #  sections and fuses them into a single shape.
4134         #
4135         #  @ref tui_creation_pipe_with_diff_sec "Example"
4136         @ManageTransactions("PrimOp")
4137         def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
4138                                                  theLocations, thePath,
4139                                                  IsGenerateGroups=False, theName=None):
4140             """
4141             Create a shape by extrusion of the profile shape along
4142             the path shape. This function is a version of
4143             MakePipeWithDifferentSections() with the same parameters, except
4144             eliminated theWithContact and theWithCorrection. So it is
4145             possible to find the description of all parameters is in this
4146             method. The difference is that this method performs the operation
4147             step by step, i.e. it creates pipes between each pair of neighbor
4148             sections and fuses them into a single shape.
4149             """
4150             aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4151                                                               theLocations, thePath,
4152                                                               False, False,
4153                                                               True, IsGenerateGroups)
4154             RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
4155
4156             if IsGenerateGroups:
4157               self._autoPublish(aList, theName, "pipe")
4158               return aList
4159
4160             self._autoPublish(aList[0], theName, "pipe")
4161             return aList[0]
4162
4163         ## Create a shape by extrusion of the profile shape along
4164         #  the path shape. The path shape can be a wire or an edge.
4165         #  the several profiles can be specified in the several locations of path.
4166         #  It is possible to generate groups along with the result by means of
4167         #  setting the flag \a IsGenerateGroups. For detailed information on
4168         #  groups that can be created please see the method MakePipe().
4169         #  @param theSeqBases - list of  Bases shape to be extruded. Base shape must be
4170         #                       shell or face. If number of faces in neighbour sections
4171         #                       aren't coincided result solid between such sections will
4172         #                       be created using external boundaries of this shells.
4173         #  @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4174         #                          This list is used for searching correspondences between
4175         #                          faces in the sections. Size of this list must be equal
4176         #                          to size of list of base shapes.
4177         #  @param theLocations - list of locations on the path corresponding
4178         #                        specified list of the Bases shapes. Number of locations
4179         #                        should be equal to number of bases. First and last
4180         #                        locations must be coincided with first and last vertexes
4181         #                        of path correspondingly.
4182         #  @param thePath - Path shape to extrude the base shape along it.
4183         #  @param theWithContact - the mode defining that the section is translated to be in
4184         #                          contact with the spine.
4185         #  @param theWithCorrection - defining that the section is rotated to be
4186         #                             orthogonal to the spine tangent in the correspondent point
4187         #  @param IsGenerateGroups - flag that tells if it is necessary to
4188         #                          create groups. It is equal to False by default.
4189         #  @param theName Object name; when specified, this parameter is used
4190         #         for result publication in the study. Otherwise, if automatic
4191         #         publication is switched on, default value is used for result name.
4192         #
4193         #  @return New GEOM.GEOM_Object, containing the created solids if 
4194         #          \a IsGenerateGroups is not set. Otherwise it returns new
4195         #          GEOM.ListOfGO. Its first element is the created solids, the
4196         #          remaining ones are created groups.
4197         #
4198         #  @ref tui_creation_pipe_with_shell_sec "Example"
4199         @ManageTransactions("PrimOp")
4200         def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4201                                       theLocations, thePath,
4202                                       theWithContact, theWithCorrection,
4203                                       IsGenerateGroups=False, theName=None):
4204             """
4205             Create a shape by extrusion of the profile shape along
4206             the path shape. The path shape can be a wire or an edge.
4207             the several profiles can be specified in the several locations of path.
4208             It is possible to generate groups along with the result by means of
4209             setting the flag IsGenerateGroups. For detailed information on
4210             groups that can be created please see the method geompy.MakePipe().
4211
4212             Parameters:
4213                 theSeqBases - list of  Bases shape to be extruded. Base shape must be
4214                               shell or face. If number of faces in neighbour sections
4215                               aren't coincided result solid between such sections will
4216                               be created using external boundaries of this shells.
4217                 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4218                                  This list is used for searching correspondences between
4219                                  faces in the sections. Size of this list must be equal
4220                                  to size of list of base shapes.
4221                 theLocations - list of locations on the path corresponding
4222                                specified list of the Bases shapes. Number of locations
4223                                should be equal to number of bases. First and last
4224                                locations must be coincided with first and last vertexes
4225                                of path correspondingly.
4226                 thePath - Path shape to extrude the base shape along it.
4227                 theWithContact - the mode defining that the section is translated to be in
4228                                  contact with the spine (0/1)
4229                 theWithCorrection - defining that the section is rotated to be
4230                                     orthogonal to the spine tangent in the correspondent point (0/1)
4231                 IsGenerateGroups - flag that tells if it is necessary to
4232                                  create groups. It is equal to False by default.
4233                 theName Object name; when specified, this parameter is used
4234                         for result publication in the study. Otherwise, if automatic
4235                         publication is switched on, default value is used for result name.
4236
4237             Returns:
4238                 New GEOM.GEOM_Object, containing the created solids if 
4239                 IsGenerateGroups is not set. Otherwise it returns new
4240                 GEOM.ListOfGO. Its first element is the created solids, the
4241                 remaining ones are created groups.
4242             """
4243             aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4244                                                           theLocations, thePath,
4245                                                           theWithContact, theWithCorrection,
4246                                                           IsGenerateGroups)
4247             RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4248
4249             if IsGenerateGroups:
4250               self._autoPublish(aList, theName, "pipe")
4251               return aList
4252
4253             self._autoPublish(aList[0], theName, "pipe")
4254             return aList[0]
4255
4256         ## Create a shape by extrusion of the profile shape along
4257         #  the path shape. This function is used only for debug pipe
4258         #  functionality - it is a version of function MakePipeWithShellSections()
4259         #  which give a possibility to receive information about
4260         #  creating pipe between each pair of sections step by step.
4261         @ManageTransactions("PrimOp")
4262         def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4263                                              theLocations, thePath,
4264                                              theWithContact, theWithCorrection,
4265                                              IsGenerateGroups=False, theName=None):
4266             """
4267             Create a shape by extrusion of the profile shape along
4268             the path shape. This function is used only for debug pipe
4269             functionality - it is a version of previous function
4270             geompy.MakePipeWithShellSections() which give a possibility to
4271             receive information about creating pipe between each pair of
4272             sections step by step.
4273             """
4274             res = []
4275             nbsect = len(theSeqBases)
4276             nbsubsect = len(theSeqSubBases)
4277             #print "nbsect = ",nbsect
4278             for i in range(1,nbsect):
4279                 #print "  i = ",i
4280                 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4281                 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4282                 tmpSeqSubBases = []
4283                 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4284                 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4285                                                               tmpLocations, thePath,
4286                                                               theWithContact, theWithCorrection,
4287                                                               IsGenerateGroups)
4288                 if self.PrimOp.IsDone() == 0:
4289                     print("Problems with pipe creation between ",i," and ",i+1," sections")
4290                     RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4291                     break
4292                 else:
4293                     print("Pipe between ",i," and ",i+1," sections is OK")
4294                     res.append(aList[0])
4295                     pass
4296                 pass
4297
4298             resc = self.MakeCompound(res)
4299             #resc = self.MakeSewing(res, 0.001)
4300             #print "resc: ",resc
4301             self._autoPublish(resc, theName, "pipe")
4302             return resc
4303
4304         ## Create solids between given sections.
4305         #  It is possible to generate groups along with the result by means of
4306         #  setting the flag \a IsGenerateGroups. For detailed information on
4307         #  groups that can be created please see the method MakePipe().
4308         #  @param theSeqBases - list of sections (shell or face).
4309         #  @param theLocations - list of corresponding vertexes
4310         #  @param IsGenerateGroups - flag that tells if it is necessary to
4311         #         create groups. It is equal to False by default.
4312         #  @param theName Object name; when specified, this parameter is used
4313         #         for result publication in the study. Otherwise, if automatic
4314         #         publication is switched on, default value is used for result name.
4315         #
4316         #  @return New GEOM.GEOM_Object, containing the created solids if 
4317         #          \a IsGenerateGroups is not set. Otherwise it returns new
4318         #          GEOM.ListOfGO. Its first element is the created solids, the
4319         #          remaining ones are created groups.
4320         #
4321         #  @ref tui_creation_pipe_without_path "Example"
4322         @ManageTransactions("PrimOp")
4323         def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4324                                       IsGenerateGroups=False, theName=None):
4325             """
4326             Create solids between given sections.
4327             It is possible to generate groups along with the result by means of
4328             setting the flag IsGenerateGroups. For detailed information on
4329             groups that can be created please see the method geompy.MakePipe().
4330
4331             Parameters:
4332                 theSeqBases - list of sections (shell or face).
4333                 theLocations - list of corresponding vertexes
4334                 IsGenerateGroups - flag that tells if it is necessary to
4335                                  create groups. It is equal to False by default.
4336                 theName Object name; when specified, this parameter is used
4337                         for result publication in the study. Otherwise, if automatic
4338                         publication is switched on, default value is used for result name.
4339
4340             Returns:
4341                 New GEOM.GEOM_Object, containing the created solids if 
4342                 IsGenerateGroups is not set. Otherwise it returns new
4343                 GEOM.ListOfGO. Its first element is the created solids, the
4344                 remaining ones are created groups.
4345             """
4346             aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4347                                                           IsGenerateGroups)
4348             RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4349
4350             if IsGenerateGroups:
4351               self._autoPublish(aList, theName, "pipe")
4352               return aList
4353
4354             self._autoPublish(aList[0], theName, "pipe")
4355             return aList[0]
4356
4357         ## Create a shape by extrusion of the base shape along
4358         #  the path shape with constant bi-normal direction along the given vector.
4359         #  The path shape can be a wire or an edge.
4360         #  It is possible to generate groups along with the result by means of
4361         #  setting the flag \a IsGenerateGroups. For detailed information on
4362         #  groups that can be created please see the method MakePipe().
4363         #  @param theBase Base shape to be extruded.
4364         #  @param thePath Path shape to extrude the base shape along it.
4365         #  @param theVec Vector defines a constant binormal direction to keep the
4366         #                same angle between the direction and the sections
4367         #                along the sweep surface.
4368         #  @param IsGenerateGroups flag that tells if it is necessary to
4369         #         create groups. It is equal to False by default.
4370         #  @param theName Object name; when specified, this parameter is used
4371         #         for result publication in the study. Otherwise, if automatic
4372         #         publication is switched on, default value is used for result name.
4373         #
4374         #  @return New GEOM.GEOM_Object, containing the created pipe if 
4375         #          \a IsGenerateGroups is not set. Otherwise it returns new
4376         #          GEOM.ListOfGO. Its first element is the created pipe, the
4377         #          remaining ones are created groups.
4378         #
4379         #  @ref tui_creation_pipe "Example"
4380         @ManageTransactions("PrimOp")
4381         def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4382                                         IsGenerateGroups=False, theName=None):
4383             """
4384             Create a shape by extrusion of the base shape along
4385             the path shape with constant bi-normal direction along the given vector.
4386             The path shape can be a wire or an edge.
4387             It is possible to generate groups along with the result by means of
4388             setting the flag IsGenerateGroups. For detailed information on
4389             groups that can be created please see the method geompy.MakePipe().
4390
4391             Parameters:
4392                 theBase Base shape to be extruded.
4393                 thePath Path shape to extrude the base shape along it.
4394                 theVec Vector defines a constant binormal direction to keep the
4395                        same angle between the direction and the sections
4396                        along the sweep surface.
4397                 IsGenerateGroups flag that tells if it is necessary to
4398                                  create groups. It is equal to False by default.
4399                 theName Object name; when specified, this parameter is used
4400                         for result publication in the study. Otherwise, if automatic
4401                         publication is switched on, default value is used for result name.
4402
4403             Returns:
4404                 New GEOM.GEOM_Object, containing the created pipe if 
4405                 IsGenerateGroups is not set. Otherwise it returns new
4406                 GEOM.ListOfGO. Its first element is the created pipe, the
4407                 remaining ones are created groups.
4408             """
4409             # Example: see GEOM_TestAll.py
4410             aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4411                           theVec, IsGenerateGroups)
4412             RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4413
4414             if IsGenerateGroups:
4415               self._autoPublish(aList, theName, "pipe")
4416               return aList
4417
4418             self._autoPublish(aList[0], theName, "pipe")
4419             return aList[0]
4420
4421         ## Makes a thick solid from a shape. If the input is a surface shape
4422         #  (face or shell) the result is a thick solid. If an input shape is
4423         #  a solid the result is a hollowed solid with removed faces.
4424         #  @param theShape Face or Shell to get thick solid or solid to get
4425         #         hollowed solid.
4426         #  @param theThickness Thickness of the resulting solid
4427         #  @param theFacesIDs the list of face IDs to be removed from the
4428         #         result. It is ignored if \a theShape is a face or a shell.
4429         #         It is empty by default. 
4430         #  @param theInside If true the thickness is applied towards inside
4431         #  @param theName Object name; when specified, this parameter is used
4432         #         for result publication in the study. Otherwise, if automatic
4433         #         publication is switched on, default value is used for result name.
4434         #
4435         #  @return New GEOM.GEOM_Object, containing the created solid
4436         #
4437         #  @ref tui_creation_thickness "Example"
4438         @ManageTransactions("PrimOp")
4439         def MakeThickSolid(self, theShape, theThickness,
4440                            theFacesIDs=[], theInside=False, theName=None):
4441             """
4442             Make a thick solid from a shape. If the input is a surface shape
4443             (face or shell) the result is a thick solid. If an input shape is
4444             a solid the result is a hollowed solid with removed faces.
4445
4446             Parameters:
4447                  theShape Face or Shell to get thick solid or solid to get
4448                           hollowed solid.
4449                  theThickness Thickness of the resulting solid
4450                  theFacesIDs the list of face IDs to be removed from the
4451                           result. It is ignored if theShape is a face or a
4452                           shell. It is empty by default. 
4453                  theInside If true the thickness is applied towards inside
4454                  theName Object name; when specified, this parameter is used
4455                          for result publication in the study. Otherwise, if automatic
4456                          publication is switched on, default value is used for result name.
4457
4458             Returns:
4459                 New GEOM.GEOM_Object, containing the created solid
4460             """
4461             # Example: see GEOM_TestAll.py
4462             theThickness,Parameters = ParseParameters(theThickness)
4463             anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4464                                                theThickness, True, theInside)
4465             RaiseIfFailed("MakeThickSolid", self.PrimOp)
4466             anObj.SetParameters(Parameters)
4467             self._autoPublish(anObj, theName, "thickSolid")
4468             return anObj
4469
4470
4471         ## Modifies a shape to make it a thick solid. If the input is a surface
4472         #  shape (face or shell) the result is a thick solid. If an input shape
4473         #  is a solid the result is a hollowed solid with removed faces.
4474         #  @param theShape Face or Shell to get thick solid or solid to get
4475         #         hollowed solid.
4476         #  @param theThickness Thickness of the resulting solid
4477         #  @param theFacesIDs the list of face IDs to be removed from the
4478         #         result. It is ignored if \a theShape is a face or a shell.
4479         #         It is empty by default. 
4480         #  @param theInside If true the thickness is applied towards inside
4481         #
4482         #  @return The modified shape
4483         #
4484         #  @ref tui_creation_thickness "Example"
4485         @ManageTransactions("PrimOp")
4486         def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4487             """
4488             Modifies a shape to make it a thick solid. If the input is a
4489             surface shape (face or shell) the result is a thick solid. If
4490             an input shape is a solid the result is a hollowed solid with
4491             removed faces.
4492
4493             Parameters:
4494                 theShape Face or Shell to get thick solid or solid to get
4495                          hollowed solid.
4496                 theThickness Thickness of the resulting solid
4497                 theFacesIDs the list of face IDs to be removed from the
4498                          result. It is ignored if \a theShape is a face or
4499                          a shell. It is empty by default. 
4500                 theInside If true the thickness is applied towards inside
4501
4502             Returns:
4503                 The modified shape
4504             """
4505             # Example: see GEOM_TestAll.py
4506             theThickness,Parameters = ParseParameters(theThickness)
4507             anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4508                                                theThickness, False, theInside)
4509             RaiseIfFailed("Thicken", self.PrimOp)
4510             anObj.SetParameters(Parameters)
4511             return anObj
4512
4513         ## Build a middle path of a pipe-like shape.
4514         #  The path shape can be a wire or an edge.
4515         #  @param theShape It can be closed or unclosed pipe-like shell
4516         #                  or a pipe-like solid.
4517         #  @param theBase1, theBase2 Two bases of the supposed pipe. This
4518         #                            should be wires or faces of theShape.
4519         #  @param theName Object name; when specified, this parameter is used
4520         #         for result publication in the study. Otherwise, if automatic
4521         #         publication is switched on, default value is used for result name.
4522         #
4523         #  @note It is not assumed that exact or approximate copy of theShape
4524         #        can be obtained by applying existing Pipe operation on the
4525         #        resulting "Path" wire taking theBase1 as the base - it is not
4526         #        always possible; though in some particular cases it might work
4527         #        it is not guaranteed. Thus, RestorePath function should not be
4528         #        considered as an exact reverse operation of the Pipe.
4529         #
4530         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
4531         #                                source pipe's "path".
4532         #
4533         #  @ref tui_creation_pipe_path "Example"
4534         @ManageTransactions("PrimOp")
4535         def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4536             """
4537             Build a middle path of a pipe-like shape.
4538             The path shape can be a wire or an edge.
4539
4540             Parameters:
4541                 theShape It can be closed or unclosed pipe-like shell
4542                          or a pipe-like solid.
4543                 theBase1, theBase2 Two bases of the supposed pipe. This
4544                                    should be wires or faces of theShape.
4545                 theName Object name; when specified, this parameter is used
4546                         for result publication in the study. Otherwise, if automatic
4547                         publication is switched on, default value is used for result name.
4548
4549             Returns:
4550                 New GEOM_Object, containing an edge or wire that represent
4551                                  source pipe's path.
4552             """
4553             anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4554             RaiseIfFailed("RestorePath", self.PrimOp)
4555             self._autoPublish(anObj, theName, "path")
4556             return anObj
4557
4558         ## Build a middle path of a pipe-like shape.
4559         #  The path shape can be a wire or an edge.
4560         #  @param theShape It can be closed or unclosed pipe-like shell
4561         #                  or a pipe-like solid.
4562         #  @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4563         #                                should be lists of edges of theShape.
4564         #  @param theName Object name; when specified, this parameter is used
4565         #         for result publication in the study. Otherwise, if automatic
4566         #         publication is switched on, default value is used for result name.
4567         #
4568         #  @note It is not assumed that exact or approximate copy of theShape
4569         #        can be obtained by applying existing Pipe operation on the
4570         #        resulting "Path" wire taking theBase1 as the base - it is not
4571         #        always possible; though in some particular cases it might work
4572         #        it is not guaranteed. Thus, RestorePath function should not be
4573         #        considered as an exact reverse operation of the Pipe.
4574         #
4575         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
4576         #                                source pipe's "path".
4577         #
4578         #  @ref tui_creation_pipe_path "Example"
4579         @ManageTransactions("PrimOp")
4580         def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4581             """
4582             Build a middle path of a pipe-like shape.
4583             The path shape can be a wire or an edge.
4584
4585             Parameters:
4586                 theShape It can be closed or unclosed pipe-like shell
4587                          or a pipe-like solid.
4588                 listEdges1, listEdges2 Two bases of the supposed pipe. This
4589                                        should be lists of edges of theShape.
4590                 theName Object name; when specified, this parameter is used
4591                         for result publication in the study. Otherwise, if automatic
4592                         publication is switched on, default value is used for result name.
4593
4594             Returns:
4595                 New GEOM_Object, containing an edge or wire that represent
4596                                  source pipe's path.
4597             """
4598             anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4599             RaiseIfFailed("RestorePath", self.PrimOp)
4600             self._autoPublish(anObj, theName, "path")
4601             return anObj
4602
4603         # end of l3_complex
4604         ## @}
4605
4606         ## @addtogroup l3_basic_go
4607         ## @{
4608
4609         ## Create a linear edge with specified ends.
4610         #  @param thePnt1 Point for the first end of edge.
4611         #  @param thePnt2 Point for the second end of edge.
4612         #  @param theName Object name; when specified, this parameter is used
4613         #         for result publication in the study. Otherwise, if automatic
4614         #         publication is switched on, default value is used for result name.
4615         #
4616         #  @return New GEOM.GEOM_Object, containing the created edge.
4617         #
4618         #  @ref tui_creation_edge "Example"
4619         @ManageTransactions("ShapesOp")
4620         def MakeEdge(self, thePnt1, thePnt2, theName=None):
4621             """
4622             Create a linear edge with specified ends.
4623
4624             Parameters:
4625                 thePnt1 Point for the first end of edge.
4626                 thePnt2 Point for the second end of edge.
4627                 theName Object name; when specified, this parameter is used
4628                         for result publication in the study. Otherwise, if automatic
4629                         publication is switched on, default value is used for result name.
4630
4631             Returns:
4632                 New GEOM.GEOM_Object, containing the created edge.
4633             """
4634             # Example: see GEOM_TestAll.py
4635             anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4636             RaiseIfFailed("MakeEdge", self.ShapesOp)
4637             self._autoPublish(anObj, theName, "edge")
4638             return anObj
4639
4640         ## Create a new edge, corresponding to the given length on the given curve.
4641         #  @param theRefCurve The referenced curve (edge).
4642         #  @param theLength Length on the referenced curve. It can be negative.
4643         #  @param theStartPoint Any point can be selected for it, the new edge will begin
4644         #                       at the end of \a theRefCurve, close to the selected point.
4645         #                       If None, start from the first point of \a theRefCurve.
4646         #  @param theName Object name; when specified, this parameter is used
4647         #         for result publication in the study. Otherwise, if automatic
4648         #         publication is switched on, default value is used for result name.
4649         #
4650         #  @return New GEOM.GEOM_Object, containing the created edge.
4651         #
4652         #  @ref tui_creation_edge "Example"
4653         @ManageTransactions("ShapesOp")
4654         def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4655             """
4656             Create a new edge, corresponding to the given length on the given curve.
4657
4658             Parameters:
4659                 theRefCurve The referenced curve (edge).
4660                 theLength Length on the referenced curve. It can be negative.
4661                 theStartPoint Any point can be selected for it, the new edge will begin
4662                               at the end of theRefCurve, close to the selected point.
4663                               If None, start from the first point of theRefCurve.
4664                 theName Object name; when specified, this parameter is used
4665                         for result publication in the study. Otherwise, if automatic
4666                         publication is switched on, default value is used for result name.
4667
4668             Returns:
4669                 New GEOM.GEOM_Object, containing the created edge.
4670             """
4671             # Example: see GEOM_TestAll.py
4672             theLength, Parameters = ParseParameters(theLength)
4673             anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4674             RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4675             anObj.SetParameters(Parameters)
4676             self._autoPublish(anObj, theName, "edge")
4677             return anObj
4678
4679         ## Create an edge from specified wire.
4680         #  @param theWire source Wire
4681         #  @param theLinearTolerance linear tolerance value (default = 1e-07)
4682         #  @param theAngularTolerance angular tolerance value (default = 1e-12)
4683         #  @param theName Object name; when specified, this parameter is used
4684         #         for result publication in the study. Otherwise, if automatic
4685         #         publication is switched on, default value is used for result name.
4686         #
4687         #  @return New GEOM.GEOM_Object, containing the created edge.
4688         #
4689         #  @ref tui_creation_edge "Example"
4690         @ManageTransactions("ShapesOp")
4691         def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4692             """
4693             Create an edge from specified wire.
4694
4695             Parameters:
4696                 theWire source Wire
4697                 theLinearTolerance linear tolerance value (default = 1e-07)
4698                 theAngularTolerance angular tolerance value (default = 1e-12)
4699                 theName Object name; when specified, this parameter is used
4700                         for result publication in the study. Otherwise, if automatic
4701                         publication is switched on, default value is used for result name.
4702
4703             Returns:
4704                 New GEOM.GEOM_Object, containing the created edge.
4705             """
4706             # Example: see GEOM_TestAll.py
4707             anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4708             RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4709             self._autoPublish(anObj, theName, "edge")
4710             return anObj
4711
4712         ## Create a wire from the set of edges and wires.
4713         #  @param theEdgesAndWires List of edges and/or wires.
4714         #  @param theTolerance Maximum distance between vertices, that will be merged.
4715         #                      Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4716         #  @param theName Object name; when specified, this parameter is used
4717         #         for result publication in the study. Otherwise, if automatic
4718         #         publication is switched on, default value is used for result name.
4719         #
4720         #  @return New GEOM.GEOM_Object, containing the created wire.
4721         #
4722         #  @ref tui_creation_wire "Example"
4723         @ManageTransactions("ShapesOp")
4724         def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4725             """
4726             Create a wire from the set of edges and wires.
4727
4728             Parameters:
4729                 theEdgesAndWires List of edges and/or wires.
4730                 theTolerance Maximum distance between vertices, that will be merged.
4731                              Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4732                 theName Object name; when specified, this parameter is used
4733                         for result publication in the study. Otherwise, if automatic
4734                         publication is switched on, default value is used for result name.
4735
4736             Returns:
4737                 New GEOM.GEOM_Object, containing the created wire.
4738             """
4739             # Example: see GEOM_TestAll.py
4740             anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4741             RaiseIfFailed("MakeWire", self.ShapesOp)
4742             self._autoPublish(anObj, theName, "wire")
4743             return anObj
4744
4745         ## Create a face on the given wire.
4746         #  @param theWire closed Wire or Edge to build the face on.
4747         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4748         #                        If the tolerance of the obtained planar face is less
4749         #                        than 1e-06, this face will be returned, otherwise the
4750         #                        algorithm tries to build any suitable face on the given
4751         #                        wire and prints a warning message.
4752         #  @param theName Object name; when specified, this parameter is used
4753         #         for result publication in the study. Otherwise, if automatic
4754         #         publication is switched on, default value is used for result name.
4755         #
4756         #  @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4757         #
4758         #  @ref tui_creation_face "Example"
4759         @ManageTransactions("ShapesOp")
4760         def MakeFace(self, theWire, isPlanarWanted, theName=None, raiseException=False):
4761             """
4762             Create a face on the given wire.
4763
4764             Parameters:
4765                 theWire closed Wire or Edge to build the face on.
4766                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4767                                If the tolerance of the obtained planar face is less
4768                                than 1e-06, this face will be returned, otherwise the
4769                                algorithm tries to build any suitable face on the given
4770                                wire and prints a warning message.
4771                 theName Object name; when specified, this parameter is used
4772                         for result publication in the study. Otherwise, if automatic
4773                         publication is switched on, default value is used for result name.
4774
4775             Returns:
4776                 New GEOM.GEOM_Object, containing the created face (compound of faces).
4777             """
4778             # Example: see GEOM_TestAll.py
4779             anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4780             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4781                 PrintOrRaise("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.",raiseException)
4782             else:
4783                 RaiseIfFailed("MakeFace", self.ShapesOp)
4784             self._autoPublish(anObj, theName, "face")
4785             return anObj
4786
4787         ## Create a face on the given wires set.
4788         #  @param theWires List of closed wires or edges to build the face on.
4789         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4790         #                        If the tolerance of the obtained planar face is less
4791         #                        than 1e-06, this face will be returned, otherwise the
4792         #                        algorithm tries to build any suitable face on the given
4793         #                        wire and prints a warning message.
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 New GEOM.GEOM_Object, containing the created face (compound of faces).
4799         #
4800         #  @ref tui_creation_face "Example"
4801         @ManageTransactions("ShapesOp")
4802         def MakeFaceWires(self, theWires, isPlanarWanted, theName=None, raiseException=False):
4803             """
4804             Create a face on the given wires set.
4805
4806             Parameters:
4807                 theWires List of closed wires or edges to build the face on.
4808                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4809                                If the tolerance of the obtained planar face is less
4810                                than 1e-06, this face will be returned, otherwise the
4811                                algorithm tries to build any suitable face on the given
4812                                wire and prints a warning message.
4813                 theName Object name; when specified, this parameter is used
4814                         for result publication in the study. Otherwise, if automatic
4815                         publication is switched on, default value is used for result name.
4816
4817             Returns:
4818                 New GEOM.GEOM_Object, containing the created face (compound of faces).
4819             """
4820             # Example: see GEOM_TestAll.py
4821             anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4822             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4823                 PrintOrRaise("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.",raiseException)
4824             else:
4825                 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4826             self._autoPublish(anObj, theName, "face")
4827             return anObj
4828
4829         ## See MakeFaceWires() method for details.
4830         #
4831         #  @ref tui_creation_face "Example 1"
4832         #  \n @ref swig_MakeFaces  "Example 2"
4833         def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4834             """
4835             See geompy.MakeFaceWires() method for details.
4836             """
4837             # Example: see GEOM_TestOthers.py
4838             # note: auto-publishing is done in self.MakeFaceWires()
4839             anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4840             return anObj
4841
4842         ## Create a face based on a surface from given face bounded
4843         #  by given wire.
4844         #  @param theFace the face whose surface is used to create a new face.
4845         #  @param theWire the wire that will bound a new face.
4846         #  @param theName Object name; when specified, this parameter is used
4847         #         for result publication in the study. Otherwise, if automatic
4848         #         publication is switched on, default value is used for result name.
4849         #
4850         #  @return New GEOM.GEOM_Object, containing the created face.
4851         #
4852         #  @ref tui_creation_face "Example"
4853         @ManageTransactions("ShapesOp")
4854         def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4855             """
4856             Create a face based on a surface from given face bounded
4857             by given wire.
4858
4859             Parameters:
4860                 theFace the face whose surface is used to create a new face.
4861                 theWire the wire that will bound a new face.
4862                 theName Object name; when specified, this parameter is used
4863                         for result publication in the study. Otherwise, if automatic
4864                         publication is switched on, default value is used for result name.
4865
4866             Returns:
4867                 New GEOM.GEOM_Object, containing the created face.
4868             """
4869             # Example: see GEOM_TestAll.py
4870             anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4871             RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4872             self._autoPublish(anObj, theName, "face")
4873             return anObj
4874           
4875         ## Create a face from a set of edges with the given constraints.
4876         #  @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4877         #         - edges should form a closed wire;
4878         #         - for each edge, constraint face is optional: if a constraint face is missing
4879         #           for some edge, this means that there no constraint associated with this edge.
4880         #  @param theName Object name; when specified, this parameter is used
4881         #         for result publication in the study. Otherwise, if automatic
4882         #         publication is switched on, default value is used for result name.
4883         # 
4884         # @return New GEOM.GEOM_Object, containing the created face.
4885         # 
4886         # @ref tui_creation_face "Example"
4887         @ManageTransactions("ShapesOp")
4888         def MakeFaceWithConstraints(self, theConstraints, theName=None):
4889             """
4890             Create a face from a set of edges with the given constraints.
4891
4892             Parameters:
4893                 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4894                         - edges should form a closed wire;
4895                         - for each edge, constraint face is optional: if a constraint face is missing
4896                           for some edge, this means that there no constraint associated with this edge.
4897                 theName Object name; when specified, this parameter is used
4898                         for result publication in the study. Otherwise, if automatic
4899                         publication is switched on, default value is used for result name.
4900
4901             Returns:
4902                 New GEOM.GEOM_Object, containing the created face.
4903             """
4904             # Example: see GEOM_TestAll.py
4905             anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4906             if anObj is None:
4907                 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4908             self._autoPublish(anObj, theName, "face")
4909             return anObj
4910
4911         ## Create a shell from the set of faces, shells and/or compounds of faces.
4912         #  @param theFacesAndShells List of faces, shells and/or compounds of faces.
4913         #  @param theName Object name; when specified, this parameter is used
4914         #         for result publication in the study. Otherwise, if automatic
4915         #         publication is switched on, default value is used for result name.
4916         #
4917         #  @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
4918         #
4919         #  @ref tui_creation_shell "Example"
4920         @ManageTransactions("ShapesOp")
4921         def MakeShell(self, theFacesAndShells, theName=None):
4922             """
4923             Create a shell from the set of faces and shells.
4924
4925             Parameters:
4926                 theFacesAndShells List of faces and/or shells.
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                 New GEOM.GEOM_Object, containing the created shell (compound of shells).
4933             """
4934             # Example: see GEOM_TestAll.py
4935             anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4936             RaiseIfFailed("MakeShell", self.ShapesOp)
4937             self._autoPublish(anObj, theName, "shell")
4938             return anObj
4939
4940         ## Create a solid, bounded by the given shells.
4941         #  @param theShells Sequence of bounding shells.
4942         #  @param theName Object name; when specified, this parameter is used
4943         #         for result publication in the study. Otherwise, if automatic
4944         #         publication is switched on, default value is used for result name.
4945         #
4946         #  @return New GEOM.GEOM_Object, containing the created solid.
4947         #
4948         #  @ref tui_creation_solid "Example"
4949         @ManageTransactions("ShapesOp")
4950         def MakeSolid(self, theShells, theName=None):
4951             """
4952             Create a solid, bounded by the given shells.
4953
4954             Parameters:
4955                 theShells Sequence of bounding shells.
4956                 theName Object name; when specified, this parameter is used
4957                         for result publication in the study. Otherwise, if automatic
4958                         publication is switched on, default value is used for result name.
4959
4960             Returns:
4961                 New GEOM.GEOM_Object, containing the created solid.
4962             """
4963             # Example: see GEOM_TestAll.py
4964             theShells = ToList(theShells)
4965             if len(theShells) == 1:
4966                 descr = self._IsGoodForSolid(theShells[0])
4967                 #if len(descr) > 0:
4968                 #    raise RuntimeError, "MakeSolidShells : " + descr
4969                 if descr == "WRN_SHAPE_UNCLOSED":
4970                     raise RuntimeError("MakeSolidShells : Unable to create solid from unclosed shape")
4971             anObj = self.ShapesOp.MakeSolidShells(theShells)
4972             RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4973             self._autoPublish(anObj, theName, "solid")
4974             return anObj
4975
4976         ## Create a compound of the given shapes.
4977         #  @param theShapes List of shapes to put in compound.
4978         #  @param theName Object name; when specified, this parameter is used
4979         #         for result publication in the study. Otherwise, if automatic
4980         #         publication is switched on, default value is used for result name.
4981         #
4982         #  @return New GEOM.GEOM_Object, containing the created compound.
4983         #
4984         #  @ref tui_creation_compound "Example"
4985         @ManageTransactions("ShapesOp")
4986         def MakeCompound(self, theShapes, theName=None):
4987             """
4988             Create a compound of the given shapes.
4989
4990             Parameters:
4991                 theShapes List of shapes to put in compound.
4992                 theName Object name; when specified, this parameter is used
4993                         for result publication in the study. Otherwise, if automatic
4994                         publication is switched on, default value is used for result name.
4995
4996             Returns:
4997                 New GEOM.GEOM_Object, containing the created compound.
4998             """
4999             # Example: see GEOM_TestAll.py
5000             anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
5001             RaiseIfFailed("MakeCompound", self.ShapesOp)
5002             self._autoPublish(anObj, theName, "compound")
5003             return anObj
5004         
5005         ## Create a solid (or solids) from the set of faces and/or shells.
5006         #  @param theFacesOrShells List of faces and/or shells.
5007         #  @param isIntersect If TRUE, forces performing intersections
5008         #         between arguments; otherwise (default) intersection is not performed.
5009         #  @param theName Object name; when specified, this parameter is used
5010         #         for result publication in the study. Otherwise, if automatic
5011         #         publication is switched on, default value is used for result name.
5012         #
5013         #  @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5014         #
5015         #  @ref tui_creation_solid_from_faces "Example"
5016         @ManageTransactions("ShapesOp")
5017         def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
5018             """
5019             Create a solid (or solids) from the set of connected faces and/or shells.
5020
5021             Parameters:
5022                 theFacesOrShells List of faces and/or shells.
5023                 isIntersect If TRUE, forces performing intersections
5024                         between arguments; otherwise (default) intersection is not performed
5025                 theName Object name; when specified, this parameter is used.
5026                         for result publication in the study. Otherwise, if automatic
5027                         publication is switched on, default value is used for result name.
5028
5029             Returns:
5030                 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5031             """
5032             # Example: see GEOM_TestAll.py
5033             anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
5034             RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
5035             self._autoPublish(anObj, theName, "solid")
5036             return anObj
5037
5038         # end of l3_basic_go
5039         ## @}
5040
5041         ## @addtogroup l2_measure
5042         ## @{
5043
5044         ## Gives quantity of faces in the given shape.
5045         #  @param theShape Shape to count faces of.
5046         #  @return Quantity of faces.
5047         #
5048         #  @ref swig_NumberOf "Example"
5049         @ManageTransactions("ShapesOp")
5050         def NumberOfFaces(self, theShape):
5051             """
5052             Gives quantity of faces in the given shape.
5053
5054             Parameters:
5055                 theShape Shape to count faces of.
5056
5057             Returns:
5058                 Quantity of faces.
5059             """
5060             # Example: see GEOM_TestOthers.py
5061             nb_faces = self.ShapesOp.NumberOfFaces(theShape)
5062             RaiseIfFailed("NumberOfFaces", self.ShapesOp)
5063             return nb_faces
5064
5065         ## Gives quantity of edges in the given shape.
5066         #  @param theShape Shape to count edges of.
5067         #  @return Quantity of edges.
5068         #
5069         #  @ref swig_NumberOf "Example"
5070         @ManageTransactions("ShapesOp")
5071         def NumberOfEdges(self, theShape):
5072             """
5073             Gives quantity of edges in the given shape.
5074
5075             Parameters:
5076                 theShape Shape to count edges of.
5077
5078             Returns:
5079                 Quantity of edges.
5080             """
5081             # Example: see GEOM_TestOthers.py
5082             nb_edges = self.ShapesOp.NumberOfEdges(theShape)
5083             RaiseIfFailed("NumberOfEdges", self.ShapesOp)
5084             return nb_edges
5085
5086         ## Gives quantity of sub-shapes of type theShapeType in the given shape.
5087         #  @param theShape Shape to count sub-shapes of.
5088         #  @param theShapeType Type of sub-shapes to count (see ShapeType())
5089         #  @return Quantity of sub-shapes of given type.
5090         #
5091         #  @ref swig_NumberOf "Example"
5092         @ManageTransactions("ShapesOp")
5093         def NumberOfSubShapes(self, theShape, theShapeType):
5094             """
5095             Gives quantity of sub-shapes of type theShapeType in the given shape.
5096
5097             Parameters:
5098                 theShape Shape to count sub-shapes of.
5099                 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
5100
5101             Returns:
5102                 Quantity of sub-shapes of given type.
5103             """
5104             # Example: see GEOM_TestOthers.py
5105             nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
5106             RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
5107             return nb_ss
5108
5109         ## Gives quantity of solids in the given shape.
5110         #  @param theShape Shape to count solids in.
5111         #  @return Quantity of solids.
5112         #
5113         #  @ref swig_NumberOf "Example"
5114         @ManageTransactions("ShapesOp")
5115         def NumberOfSolids(self, theShape):
5116             """
5117             Gives quantity of solids in the given shape.
5118
5119             Parameters:
5120                 theShape Shape to count solids in.
5121
5122             Returns:
5123                 Quantity of solids.
5124             """
5125             # Example: see GEOM_TestOthers.py
5126             nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
5127             RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5128             return nb_solids
5129
5130         # end of l2_measure
5131         ## @}
5132
5133         ## @addtogroup l3_healing
5134         ## @{
5135
5136         ## Reverses an orientation the given shape.
5137         #  @param theShape Shape to be reversed.
5138         #  @param theName Object name; when specified, this parameter is used
5139         #         for result publication in the study. Otherwise, if automatic
5140         #         publication is switched on, default value is used for result name.
5141         #
5142         #  @return The reversed copy of theShape.
5143         #
5144         #  @ref swig_ChangeOrientation "Example"
5145         @ManageTransactions("ShapesOp")
5146         def ChangeOrientation(self, theShape, theName=None):
5147             """
5148             Reverses an orientation the given shape.
5149
5150             Parameters:
5151                 theShape Shape to be reversed.
5152                 theName Object name; when specified, this parameter is used
5153                         for result publication in the study. Otherwise, if automatic
5154                         publication is switched on, default value is used for result name.
5155
5156             Returns:
5157                 The reversed copy of theShape.
5158             """
5159             # Example: see GEOM_TestAll.py
5160             anObj = self.ShapesOp.ChangeOrientation(theShape)
5161             RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5162             self._autoPublish(anObj, theName, "reversed")
5163             return anObj
5164
5165         ## See ChangeOrientation() method for details.
5166         #
5167         #  @ref swig_OrientationChange "Example"
5168         def OrientationChange(self, theShape, theName=None):
5169             """
5170             See geompy.ChangeOrientation method for details.
5171             """
5172             # Example: see GEOM_TestOthers.py
5173             # note: auto-publishing is done in self.ChangeOrientation()
5174             anObj = self.ChangeOrientation(theShape, theName)
5175             return anObj
5176
5177         # end of l3_healing
5178         ## @}
5179
5180         ## @addtogroup l4_obtain
5181         ## @{
5182
5183         ## Retrieve all free faces from the given shape.
5184         #  Free face is a face, which is not shared between two shells of the shape.
5185         #  @param theShape Shape to find free faces in.
5186         #  @return List of IDs of all free faces, contained in theShape.
5187         #
5188         #  @ref tui_free_faces_page "Example"
5189         @ManageTransactions("ShapesOp")
5190         def GetFreeFacesIDs(self,theShape):
5191             """
5192             Retrieve all free faces from the given shape.
5193             Free face is a face, which is not shared between two shells of the shape.
5194
5195             Parameters:
5196                 theShape Shape to find free faces in.
5197
5198             Returns:
5199                 List of IDs of all free faces, contained in theShape.
5200             """
5201             # Example: see GEOM_TestOthers.py
5202             anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5203             RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5204             return anIDs
5205
5206         ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5207         #  @param theShape1 Shape to find sub-shapes in.
5208         #  @param theShape2 Shape to find shared sub-shapes with.
5209         #  @param theShapeType Type of sub-shapes to be retrieved.
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 sub-shapes of theShape1, shared with theShape2.
5215         #
5216         #  @ref swig_GetSharedShapes "Example"
5217         @ManageTransactions("ShapesOp")
5218         def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5219             """
5220             Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5221
5222             Parameters:
5223                 theShape1 Shape to find sub-shapes in.
5224                 theShape2 Shape to find shared sub-shapes with.
5225                 theShapeType Type of sub-shapes to be retrieved.
5226                 theName Object name; when specified, this parameter is used
5227                         for result publication in the study. Otherwise, if automatic
5228                         publication is switched on, default value is used for result name.
5229
5230             Returns:
5231                 List of sub-shapes of theShape1, shared with theShape2.
5232             """
5233             # Example: see GEOM_TestOthers.py
5234             aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5235             RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5236             self._autoPublish(aList, theName, "shared")
5237             return aList
5238
5239         ## Get sub-shapes, shared by input shapes.
5240         #  @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5241         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5242         #  @param theMultiShare Specifies what type of shares should be checked:
5243         #         - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5244         #         - @c False: causes to search sub-shapes shared between couples of input shapes.
5245         #  @param theName Object name; when specified, this parameter is used
5246         #         for result publication in the study. Otherwise, if automatic
5247         #         publication is switched on, default value is used for result name.
5248         #
5249         #  @note If @a theShapes contains single compound, the shares between all possible couples of 
5250         #        its top-level shapes are returned; otherwise, only shares between 1st input shape
5251         #        and all rest input shapes are returned.
5252         #
5253         #  @return List of all found sub-shapes.
5254         #
5255         #  Examples:
5256         #  - @ref tui_shared_shapes "Example 1"
5257         #  - @ref swig_GetSharedShapes "Example 2"
5258         @ManageTransactions("ShapesOp")
5259         def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5260             """
5261             Get sub-shapes, shared by input shapes.
5262
5263             Parameters:
5264                 theShapes Either a list or compound of shapes to find common sub-shapes of.
5265                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5266                 theMultiShare Specifies what type of shares should be checked:
5267                   - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5268                   - False: causes to search sub-shapes shared between couples of input shapes.
5269                 theName Object name; when specified, this parameter is used
5270                         for result publication in the study. Otherwise, if automatic
5271                         publication is switched on, default value is used for result name.
5272
5273             Note: if theShapes contains single compound, the shares between all possible couples of 
5274                   its top-level shapes are returned; otherwise, only shares between 1st input shape
5275                   and all rest input shapes are returned.
5276
5277             Returns:
5278                 List of all found sub-shapes.
5279             """
5280             # Example: see GEOM_TestOthers.py
5281             aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5282             RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5283             self._autoPublish(aList, theName, "shared")
5284             return aList
5285
5286         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5287         #  situated relatively the specified plane by the certain way,
5288         #  defined through <VAR>theState</VAR> parameter.
5289         #  @param theShape Shape to find sub-shapes of.
5290         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5291         #  @param theAx1 Vector (or line, or linear edge), specifying normal
5292         #                direction and location of the plane to find shapes on.
5293         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5294         #  @param theName Object name; when specified, this parameter is used
5295         #         for result publication in the study. Otherwise, if automatic
5296         #         publication is switched on, default value is used for result name.
5297         #
5298         #  @return List of all found sub-shapes.
5299         #
5300         #  @ref swig_GetShapesOnPlane "Example"
5301         @ManageTransactions("ShapesOp")
5302         def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5303             """
5304             Find in theShape all sub-shapes of type theShapeType,
5305             situated relatively the specified plane by the certain way,
5306             defined through theState parameter.
5307
5308             Parameters:
5309                 theShape Shape to find sub-shapes of.
5310                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5311                 theAx1 Vector (or line, or linear edge), specifying normal
5312                        direction and location of the plane to find shapes on.
5313                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5314                 theName Object name; when specified, this parameter is used
5315                         for result publication in the study. Otherwise, if automatic
5316                         publication is switched on, default value is used for result name.
5317
5318             Returns:
5319                 List of all found sub-shapes.
5320             """
5321             # Example: see GEOM_TestOthers.py
5322             aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5323             RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5324             self._autoPublish(aList, theName, "shapeOnPlane")
5325             return aList
5326
5327         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5328         #  situated relatively the specified plane by the certain way,
5329         #  defined through <VAR>theState</VAR> parameter.
5330         #  @param theShape Shape to find sub-shapes of.
5331         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5332         #  @param theAx1 Vector (or line, or linear edge), specifying normal
5333         #                direction and location of the plane to find shapes on.
5334         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5335         #
5336         #  @return List of all found sub-shapes indices.
5337         #
5338         #  @ref swig_GetShapesOnPlaneIDs "Example"
5339         @ManageTransactions("ShapesOp")
5340         def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5341             """
5342             Find in theShape all sub-shapes of type theShapeType,
5343             situated relatively the specified plane by the certain way,
5344             defined through theState parameter.
5345
5346             Parameters:
5347                 theShape Shape to find sub-shapes of.
5348                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5349                 theAx1 Vector (or line, or linear edge), specifying normal
5350                        direction and location of the plane to find shapes on.
5351                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5352
5353             Returns:
5354                 List of all found sub-shapes indices.
5355             """
5356             # Example: see GEOM_TestOthers.py
5357             aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5358             RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5359             return aList
5360
5361         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5362         #  situated relatively the specified plane by the certain way,
5363         #  defined through <VAR>theState</VAR> parameter.
5364         #  @param theShape Shape to find sub-shapes of.
5365         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5366         #  @param theAx1 Vector (or line, or linear edge), specifying normal
5367         #                direction of the plane to find shapes on.
5368         #  @param thePnt Point specifying location of the plane to find shapes on.
5369         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5370         #  @param theName Object name; when specified, this parameter is used
5371         #         for result publication in the study. Otherwise, if automatic
5372         #         publication is switched on, default value is used for result name.
5373         #
5374         #  @return List of all found sub-shapes.
5375         #
5376         #  @ref swig_GetShapesOnPlaneWithLocation "Example"
5377         @ManageTransactions("ShapesOp")
5378         def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5379             """
5380             Find in theShape all sub-shapes of type theShapeType,
5381             situated relatively the specified plane by the certain way,
5382             defined through theState parameter.
5383
5384             Parameters:
5385                 theShape Shape to find sub-shapes of.
5386                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5387                 theAx1 Vector (or line, or linear edge), specifying normal
5388                        direction and location of the plane to find shapes on.
5389                 thePnt Point specifying location of the plane to find shapes on.
5390                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5391                 theName Object name; when specified, this parameter is used
5392                         for result publication in the study. Otherwise, if automatic
5393                         publication is switched on, default value is used for result name.
5394
5395             Returns:
5396                 List of all found sub-shapes.
5397             """
5398             # Example: see GEOM_TestOthers.py
5399             aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5400                                                                theAx1, thePnt, theState)
5401             RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5402             self._autoPublish(aList, theName, "shapeOnPlane")
5403             return aList
5404
5405         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5406         #  situated relatively the specified plane by the certain way,
5407         #  defined through <VAR>theState</VAR> parameter.
5408         #  @param theShape Shape to find sub-shapes of.
5409         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5410         #  @param theAx1 Vector (or line, or linear edge), specifying normal
5411         #                direction of the plane to find shapes on.
5412         #  @param thePnt Point specifying location of the plane to find shapes on.
5413         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5414         #
5415         #  @return List of all found sub-shapes indices.
5416         #
5417         #  @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5418         @ManageTransactions("ShapesOp")
5419         def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5420             """
5421             Find in theShape all sub-shapes of type theShapeType,
5422             situated relatively the specified plane by the certain way,
5423             defined through theState parameter.
5424
5425             Parameters:
5426                 theShape Shape to find sub-shapes of.
5427                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5428                 theAx1 Vector (or line, or linear edge), specifying normal
5429                        direction and location of the plane to find shapes on.
5430                 thePnt Point specifying location of the plane to find shapes on.
5431                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5432
5433             Returns:
5434                 List of all found sub-shapes indices.
5435             """
5436             # Example: see GEOM_TestOthers.py
5437             aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5438                                                                   theAx1, thePnt, theState)
5439             RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5440             return aList
5441
5442         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5443         #  the specified cylinder by the certain way, defined through \a theState parameter.
5444         #  @param theShape Shape to find sub-shapes of.
5445         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5446         #  @param theAxis Vector (or line, or linear edge), specifying
5447         #                 axis of the cylinder to find shapes on.
5448         #  @param theRadius Radius of the cylinder to find shapes on.
5449         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5450         #  @param theName Object name; when specified, this parameter is used
5451         #         for result publication in the study. Otherwise, if automatic
5452         #         publication is switched on, default value is used for result name.
5453         #
5454         #  @return List of all found sub-shapes.
5455         #
5456         #  @ref swig_GetShapesOnCylinder "Example"
5457         @ManageTransactions("ShapesOp")
5458         def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5459             """
5460             Find in theShape all sub-shapes of type theShapeType, situated relatively
5461             the specified cylinder by the certain way, defined through theState parameter.
5462
5463             Parameters:
5464                 theShape Shape to find sub-shapes of.
5465                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5466                 theAxis Vector (or line, or linear edge), specifying
5467                         axis of the cylinder to find shapes on.
5468                 theRadius Radius of the cylinder to find shapes on.
5469                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5470                 theName Object name; when specified, this parameter is used
5471                         for result publication in the study. Otherwise, if automatic
5472                         publication is switched on, default value is used for result name.
5473
5474             Returns:
5475                 List of all found sub-shapes.
5476             """
5477             # Example: see GEOM_TestOthers.py
5478             aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5479             RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5480             self._autoPublish(aList, theName, "shapeOnCylinder")
5481             return aList
5482
5483         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5484         #  the specified cylinder by the certain way, defined through \a theState parameter.
5485         #  @param theShape Shape to find sub-shapes of.
5486         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5487         #  @param theAxis Vector (or line, or linear edge), specifying
5488         #                 axis of the cylinder to find shapes on.
5489         #  @param theRadius Radius of the cylinder to find shapes on.
5490         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5491         #
5492         #  @return List of all found sub-shapes indices.
5493         #
5494         #  @ref swig_GetShapesOnCylinderIDs "Example"
5495         @ManageTransactions("ShapesOp")
5496         def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5497             """
5498             Find in theShape all sub-shapes of type theShapeType, situated relatively
5499             the specified cylinder by the certain way, defined through theState parameter.
5500
5501             Parameters:
5502                 theShape Shape to find sub-shapes of.
5503                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5504                 theAxis Vector (or line, or linear edge), specifying
5505                         axis of the cylinder to find shapes on.
5506                 theRadius Radius of the cylinder to find shapes on.
5507                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5508
5509             Returns:
5510                 List of all found sub-shapes indices.
5511             """
5512             # Example: see GEOM_TestOthers.py
5513             aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5514             RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5515             return aList
5516
5517         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5518         #  the specified cylinder by the certain way, defined through \a theState parameter.
5519         #  @param theShape Shape to find sub-shapes of.
5520         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5521         #  @param theAxis Vector (or line, or linear edge), specifying
5522         #                 axis of the cylinder to find shapes on.
5523         #  @param thePnt Point specifying location of the bottom of the cylinder.
5524         #  @param theRadius Radius of the cylinder to find shapes on.
5525         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5526         #  @param theName Object name; when specified, this parameter is used
5527         #         for result publication in the study. Otherwise, if automatic
5528         #         publication is switched on, default value is used for result name.
5529         #
5530         #  @return List of all found sub-shapes.
5531         #
5532         #  @ref swig_GetShapesOnCylinderWithLocation "Example"
5533         @ManageTransactions("ShapesOp")
5534         def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5535             """
5536             Find in theShape all sub-shapes of type theShapeType, situated relatively
5537             the specified cylinder by the certain way, defined through theState parameter.
5538
5539             Parameters:
5540                 theShape Shape to find sub-shapes of.
5541                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5542                 theAxis Vector (or line, or linear edge), specifying
5543                         axis of the cylinder to find shapes on.
5544                 theRadius Radius of the cylinder to find shapes on.
5545                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5546                 theName Object name; when specified, this parameter is used
5547                         for result publication in the study. Otherwise, if automatic
5548                         publication is switched on, default value is used for result name.
5549
5550             Returns:
5551                 List of all found sub-shapes.
5552             """
5553             # Example: see GEOM_TestOthers.py
5554             aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5555             RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5556             self._autoPublish(aList, theName, "shapeOnCylinder")
5557             return aList
5558
5559         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5560         #  the specified cylinder by the certain way, defined through \a theState parameter.
5561         #  @param theShape Shape to find sub-shapes of.
5562         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5563         #  @param theAxis Vector (or line, or linear edge), specifying
5564         #                 axis of the cylinder to find shapes on.
5565         #  @param thePnt Point specifying location of the bottom of the cylinder.
5566         #  @param theRadius Radius of the cylinder to find shapes on.
5567         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5568         #
5569         #  @return List of all found sub-shapes indices
5570         #
5571         #  @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5572         @ManageTransactions("ShapesOp")
5573         def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5574             """
5575             Find in theShape all sub-shapes of type theShapeType, situated relatively
5576             the specified cylinder by the certain way, defined through theState parameter.
5577
5578             Parameters:
5579                 theShape Shape to find sub-shapes of.
5580                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5581                 theAxis Vector (or line, or linear edge), specifying
5582                         axis of the cylinder to find shapes on.
5583                 theRadius Radius of the cylinder to find shapes on.
5584                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5585
5586             Returns:
5587                 List of all found sub-shapes indices.
5588             """
5589             # Example: see GEOM_TestOthers.py
5590             aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5591             RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5592             return aList
5593
5594         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5595         #  the specified sphere by the certain way, defined through \a theState parameter.
5596         #  @param theShape Shape to find sub-shapes of.
5597         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5598         #  @param theCenter Point, specifying center of the sphere to find shapes on.
5599         #  @param theRadius Radius of the sphere to find shapes on.
5600         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5601         #  @param theName Object name; when specified, this parameter is used
5602         #         for result publication in the study. Otherwise, if automatic
5603         #         publication is switched on, default value is used for result name.
5604         #
5605         #  @return List of all found sub-shapes.
5606         #
5607         #  @ref swig_GetShapesOnSphere "Example"
5608         @ManageTransactions("ShapesOp")
5609         def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5610             """
5611             Find in theShape all sub-shapes of type theShapeType, situated relatively
5612             the specified sphere by the certain way, defined through theState parameter.
5613
5614             Parameters:
5615                 theShape Shape to find sub-shapes of.
5616                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5617                 theCenter Point, specifying center of the sphere to find shapes on.
5618                 theRadius Radius of the sphere to find shapes on.
5619                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5620                 theName Object name; when specified, this parameter is used
5621                         for result publication in the study. Otherwise, if automatic
5622                         publication is switched on, default value is used for result name.
5623
5624             Returns:
5625                 List of all found sub-shapes.
5626             """
5627             # Example: see GEOM_TestOthers.py
5628             aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5629             RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5630             self._autoPublish(aList, theName, "shapeOnSphere")
5631             return aList
5632
5633         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5634         #  the specified sphere by the certain way, defined through \a theState parameter.
5635         #  @param theShape Shape to find sub-shapes of.
5636         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5637         #  @param theCenter Point, specifying center of the sphere to find shapes on.
5638         #  @param theRadius Radius of the sphere to find shapes on.
5639         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5640         #
5641         #  @return List of all found sub-shapes indices.
5642         #
5643         #  @ref swig_GetShapesOnSphereIDs "Example"
5644         @ManageTransactions("ShapesOp")
5645         def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5646             """
5647             Find in theShape all sub-shapes of type theShapeType, situated relatively
5648             the specified sphere by the certain way, defined through theState parameter.
5649
5650             Parameters:
5651                 theShape Shape to find sub-shapes of.
5652                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5653                 theCenter Point, specifying center of the sphere to find shapes on.
5654                 theRadius Radius of the sphere to find shapes on.
5655                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5656
5657             Returns:
5658                 List of all found sub-shapes indices.
5659             """
5660             # Example: see GEOM_TestOthers.py
5661             aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5662             RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5663             return aList
5664
5665         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5666         #  the specified quadrangle by the certain way, defined through \a theState parameter.
5667         #  @param theShape Shape to find sub-shapes of.
5668         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5669         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5670         #  @param theTopRightPoint Point, specifying top right corner of a quadrangle
5671         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5672         #  @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5673         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5674         #  @param theName Object name; when specified, this parameter is used
5675         #         for result publication in the study. Otherwise, if automatic
5676         #         publication is switched on, default value is used for result name.
5677         #
5678         #  @return List of all found sub-shapes.
5679         #
5680         #  @ref swig_GetShapesOnQuadrangle "Example"
5681         @ManageTransactions("ShapesOp")
5682         def GetShapesOnQuadrangle(self, theShape, theShapeType,
5683                                   theTopLeftPoint, theTopRightPoint,
5684                                   theBottomLeftPoint, theBottomRightPoint, theState, theName=None):
5685             """
5686             Find in theShape all sub-shapes of type theShapeType, situated relatively
5687             the specified quadrangle by the certain way, defined through theState parameter.
5688
5689             Parameters:
5690                 theShape Shape to find sub-shapes of.
5691                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5692                 theTopLeftPoint Point, specifying top left corner of a quadrangle
5693                 theTopRightPoint Point, specifying top right corner of a quadrangle
5694                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5695                 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5696                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5697                 theName Object name; when specified, this parameter is used
5698                         for result publication in the study. Otherwise, if automatic
5699                         publication is switched on, default value is used for result name.
5700
5701             Returns:
5702                 List of all found sub-shapes.
5703             """
5704             # Example: see GEOM_TestOthers.py
5705             aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5706                                                         theTopLeftPoint, theTopRightPoint,
5707                                                         theBottomLeftPoint, theBottomRightPoint, theState)
5708             RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5709             self._autoPublish(aList, theName, "shapeOnQuadrangle")
5710             return aList
5711
5712         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5713         #  the specified quadrangle by the certain way, defined through \a theState parameter.
5714         #  @param theShape Shape to find sub-shapes of.
5715         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5716         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5717         #  @param theTopRightPoint Point, specifying top right corner of a quadrangle
5718         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5719         #  @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5720         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5721         #
5722         #  @return List of all found sub-shapes indices.
5723         #
5724         #  @ref swig_GetShapesOnQuadrangleIDs "Example"
5725         @ManageTransactions("ShapesOp")
5726         def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5727                                      theTopLeftPoint, theTopRightPoint,
5728                                      theBottomLeftPoint, theBottomRightPoint, theState):
5729             """
5730             Find in theShape all sub-shapes of type theShapeType, situated relatively
5731             the specified quadrangle by the certain way, defined through theState parameter.
5732
5733             Parameters:
5734                 theShape Shape to find sub-shapes of.
5735                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5736                 theTopLeftPoint Point, specifying top left corner of a quadrangle
5737                 theTopRightPoint Point, specifying top right corner of a quadrangle
5738                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5739                 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5740                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5741
5742             Returns:
5743                 List of all found sub-shapes indices.
5744             """
5745
5746             # Example: see GEOM_TestOthers.py
5747             aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5748                                                            theTopLeftPoint, theTopRightPoint,
5749                                                            theBottomLeftPoint, theBottomRightPoint, theState)
5750             RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5751             return aList
5752
5753         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5754         #  the specified \a theBox by the certain way, defined through \a theState parameter.
5755         #  @param theBox Shape for relative comparing.
5756         #  @param theShape Shape to find sub-shapes of.
5757         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5758         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5759         #  @param theName Object name; when specified, this parameter is used
5760         #         for result publication in the study. Otherwise, if automatic
5761         #         publication is switched on, default value is used for result name.
5762         #
5763         #  @return List of all found sub-shapes.
5764         #
5765         #  @ref swig_GetShapesOnBox "Example"
5766         @ManageTransactions("ShapesOp")
5767         def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5768             """
5769             Find in theShape all sub-shapes of type theShapeType, situated relatively
5770             the specified theBox by the certain way, defined through theState parameter.
5771
5772             Parameters:
5773                 theBox Shape for relative comparing.
5774                 theShape Shape to find sub-shapes of.
5775                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5776                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5777                 theName Object name; when specified, this parameter is used
5778                         for result publication in the study. Otherwise, if automatic
5779                         publication is switched on, default value is used for result name.
5780
5781             Returns:
5782                 List of all found sub-shapes.
5783             """
5784             # Example: see GEOM_TestOthers.py
5785             aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5786             RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5787             self._autoPublish(aList, theName, "shapeOnBox")
5788             return aList
5789
5790         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5791         #  the specified \a theBox by the certain way, defined through \a theState parameter.
5792         #  @param theBox Shape for relative comparing.
5793         #  @param theShape Shape to find sub-shapes of.
5794         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5795         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5796         #
5797         #  @return List of all found sub-shapes indices.
5798         #
5799         #  @ref swig_GetShapesOnBoxIDs "Example"
5800         @ManageTransactions("ShapesOp")
5801         def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5802             """
5803             Find in theShape all sub-shapes of type theShapeType, situated relatively
5804             the specified theBox by the certain way, defined through theState parameter.
5805
5806             Parameters:
5807                 theBox Shape for relative comparing.
5808                 theShape Shape to find sub-shapes of.
5809                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5810                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5811
5812             Returns:
5813                 List of all found sub-shapes indices.
5814             """
5815             # Example: see GEOM_TestOthers.py
5816             aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5817             RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5818             return aList
5819
5820         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5821         #  situated relatively the specified \a theCheckShape by the
5822         #  certain way, defined through \a theState parameter.
5823         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5824         #  @param theShape Shape to find sub-shapes of.
5825         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5826         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5827         #  @param theName Object name; when specified, this parameter is used
5828         #         for result publication in the study. Otherwise, if automatic
5829         #         publication is switched on, default value is used for result name.
5830         #
5831         #  @return List of all found sub-shapes.
5832         #
5833         #  @ref swig_GetShapesOnShape "Example"
5834         @ManageTransactions("ShapesOp")
5835         def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5836             """
5837             Find in theShape all sub-shapes of type theShapeType,
5838             situated relatively the specified theCheckShape by the
5839             certain way, defined through theState parameter.
5840
5841             Parameters:
5842                 theCheckShape Shape for relative comparing. It must be a solid.
5843                 theShape Shape to find sub-shapes of.
5844                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5845                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5846                 theName Object name; when specified, this parameter is used
5847                         for result publication in the study. Otherwise, if automatic
5848                         publication is switched on, default value is used for result name.
5849
5850             Returns:
5851                 List of all found sub-shapes.
5852             """
5853             # Example: see GEOM_TestOthers.py
5854             aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5855                                                    theShapeType, theState)
5856             RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5857             self._autoPublish(aList, theName, "shapeOnShape")
5858             return aList
5859
5860         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5861         #  situated relatively the specified \a theCheckShape by the
5862         #  certain way, defined through \a theState parameter.
5863         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5864         #  @param theShape Shape to find sub-shapes of.
5865         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5866         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5867         #  @param theName Object name; when specified, this parameter is used
5868         #         for result publication in the study. Otherwise, if automatic
5869         #         publication is switched on, default value is used for result name.
5870         #
5871         #  @return All found sub-shapes as compound.
5872         #
5873         #  @ref swig_GetShapesOnShapeAsCompound "Example"
5874         @ManageTransactions("ShapesOp")
5875         def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5876             """
5877             Find in theShape all sub-shapes of type theShapeType,
5878             situated relatively the specified theCheckShape by the
5879             certain way, defined through theState parameter.
5880
5881             Parameters:
5882                 theCheckShape Shape for relative comparing. It must be a solid.
5883                 theShape Shape to find sub-shapes of.
5884                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5885                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5886                 theName Object name; when specified, this parameter is used
5887                         for result publication in the study. Otherwise, if automatic
5888                         publication is switched on, default value is used for result name.
5889
5890             Returns:
5891                 All found sub-shapes as compound.
5892             """
5893             # Example: see GEOM_TestOthers.py
5894             anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5895                                                              theShapeType, theState)
5896             RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5897             self._autoPublish(anObj, theName, "shapeOnShape")
5898             return anObj
5899
5900         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5901         #  situated relatively the specified \a theCheckShape by the
5902         #  certain way, defined through \a theState parameter.
5903         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5904         #  @param theShape Shape to find sub-shapes of.
5905         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5906         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5907         #
5908         #  @return List of all found sub-shapes indices.
5909         #
5910         #  @ref swig_GetShapesOnShapeIDs "Example"
5911         @ManageTransactions("ShapesOp")
5912         def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5913             """
5914             Find in theShape all sub-shapes of type theShapeType,
5915             situated relatively the specified theCheckShape by the
5916             certain way, defined through theState parameter.
5917
5918             Parameters:
5919                 theCheckShape Shape for relative comparing. It must be a solid.
5920                 theShape Shape to find sub-shapes of.
5921                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5922                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5923
5924             Returns:
5925                 List of all found sub-shapes indices.
5926             """
5927             # Example: see GEOM_TestOthers.py
5928             aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5929                                                       theShapeType, theState)
5930             RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5931             return aList
5932
5933         ## Get sub-shape(s) of theShapeWhere, which are
5934         #  coincident with \a theShapeWhat or could be a part of it.
5935         #  @param theShapeWhere Shape to find sub-shapes of.
5936         #  @param theShapeWhat Shape, specifying what to find.
5937         #  @param isNewImplementation implementation of GetInPlace functionality
5938         #             (default = False, old alghorithm based on shape properties)
5939         #  @param theName Object name; when specified, this parameter is used
5940         #         for result publication in the study. Otherwise, if automatic
5941         #         publication is switched on, default value is used for result name.
5942         #
5943         #  @return Compound which includes all found sub-shapes if they have different types; 
5944         #          or group of all found shapes of the equal type; or a single found sub-shape.
5945         #
5946         #  @note This function has a restriction on argument shapes.
5947         #        If \a theShapeWhere has curved parts with significantly
5948         #        outstanding centres (i.e. the mass centre of a part is closer to
5949         #        \a theShapeWhat than to the part), such parts will not be found.
5950         #        @image html get_in_place_lost_part.png
5951         #
5952         #  @ref swig_GetInPlace "Example"
5953         @ManageTransactions("ShapesOp")
5954         def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5955             """
5956             Get sub-shape(s) of theShapeWhere, which are
5957             coincident with  theShapeWhat or could be a part of it.
5958
5959             Parameters:
5960                 theShapeWhere Shape to find sub-shapes of.
5961                 theShapeWhat Shape, specifying what to find.
5962                 isNewImplementation Implementation of GetInPlace functionality
5963                                     (default = False, old alghorithm based on shape properties)
5964                 theName Object name; when specified, this parameter is used
5965                         for result publication in the study. Otherwise, if automatic
5966                         publication is switched on, default value is used for result name.
5967
5968             Returns:
5969                 Compound which includes all found sub-shapes if they have different types; 
5970                 or group of all found shapes of the equal type; or a single found sub-shape.
5971
5972
5973             Note:
5974                 This function has a restriction on argument shapes.
5975                 If theShapeWhere has curved parts with significantly
5976                 outstanding centres (i.e. the mass centre of a part is closer to
5977                 theShapeWhat than to the part), such parts will not be found.
5978             """
5979             # Example: see GEOM_TestOthers.py
5980             anObj = None
5981             if isNewImplementation:
5982                 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5983             else:
5984                 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5985                 pass
5986             RaiseIfFailed("GetInPlace", self.ShapesOp)
5987             self._autoPublish(anObj, theName, "inplace")
5988             return anObj
5989
5990         ## Get sub-shape(s) of \a theShapeWhere, which are
5991         #  coincident with \a theShapeWhat or could be a part of it.
5992         #
5993         #  Implementation of this method is based on a saved history of an operation,
5994         #  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5995         #  arguments (an argument shape or a sub-shape of an argument shape).
5996         #  The operation could be the Partition or one of boolean operations,
5997         #  performed on simple shapes (not on compounds).
5998         #
5999         #  @param theShapeWhere Shape to find sub-shapes of.
6000         #  @param theShapeWhat Shape, specifying what to find (must be in the
6001         #                      building history of the ShapeWhere).
6002         #  @param theName Object name; when specified, this parameter is used
6003         #         for result publication in the study. Otherwise, if automatic
6004         #         publication is switched on, default value is used for result name.
6005         #
6006         #  @return Compound which includes all found sub-shapes if they have different types; 
6007         #          or group of all found shapes of the equal type; or a single found sub-shape.
6008         #
6009         #  @ref swig_GetInPlace "Example"
6010         @ManageTransactions("ShapesOp")
6011         def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
6012             """
6013             Implementation of this method is based on a saved history of an operation,
6014             produced theShapeWhere. The theShapeWhat must be among this operation's
6015             arguments (an argument shape or a sub-shape of an argument shape).
6016             The operation could be the Partition or one of boolean operations,
6017             performed on simple shapes (not on compounds).
6018
6019             Parameters:
6020                 theShapeWhere Shape to find sub-shapes of.
6021                 theShapeWhat Shape, specifying what to find (must be in the
6022                                 building history of the ShapeWhere).
6023                 theName Object name; when specified, this parameter is used
6024                         for result publication in the study. Otherwise, if automatic
6025                         publication is switched on, default value is used for result name.
6026
6027             Returns:
6028                 Compound which includes all found sub-shapes if they have different types; 
6029                 or group of all found shapes of the equal type; or a single found sub-shape.
6030             """
6031             # Example: see GEOM_TestOthers.py
6032             anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
6033             RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
6034             self._autoPublish(anObj, theName, "inplace")
6035             return anObj
6036
6037         ## A sort of GetInPlace functionality, returning IDs of sub-shapes.
6038         #  For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6039         #  IDs of @a theShapeWhere.
6040         #  For example, if theShapeWhat is a box and theShapeWhere is this box cut into 
6041         #  two parts by a plane, then the result can be as this: 
6042         #    len( result_list ) = 35,
6043         #    result_list[ 1 ] = [ 2, 36 ], which means that the box  (ID 1) turned into two
6044         #  solids with IDs 2 and 36 within theShapeWhere
6045         #
6046         #  @param theShapeWhere Shape to find sub-shapes of.
6047         #  @param theShapeWhat Shape, specifying what to find.
6048         #  @return List of lists of sub-shape IDS of theShapeWhere.
6049         def GetInPlaceMap(self, theShapeWhere, theShapeWhat):
6050             """
6051             A sort of GetInPlace functionality, returning IDs of sub-shapes.
6052             For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6053             IDs of @a theShapeWhere.
6054             For example, if theShapeWhat is a box and theShapeWhere is this box cut into 
6055             two parts by a plane, then the result can be as this: 
6056               len( result_list ) = 35,
6057               result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6058             solids with IDs 2 and 36 within theShapeWhere
6059
6060             Parameters:
6061                 theShapeWhere Shape to find sub-shapes of.
6062                 theShapeWhat Shape, specifying what to find.
6063
6064             Returns:
6065                 List of lists of sub-shape IDS of theShapeWhere.
6066             """
6067             return self.ShapesOp.GetInPlaceMap(theShapeWhere, theShapeWhat)
6068
6069         ## Get sub-shape of theShapeWhere, which is
6070         #  equal to \a theShapeWhat.
6071         #  @param theShapeWhere Shape to find sub-shape of.
6072         #  @param theShapeWhat Shape, specifying what to find.
6073         #  @param theName Object name; when specified, this parameter is used
6074         #         for result publication in the study. Otherwise, if automatic
6075         #         publication is switched on, default value is used for result name.
6076         #
6077         #  @return New GEOM.GEOM_Object for found sub-shape.
6078         #
6079         #  @ref swig_GetSame "Example"
6080         @ManageTransactions("ShapesOp")
6081         def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
6082             """
6083             Get sub-shape of theShapeWhere, which is
6084             equal to theShapeWhat.
6085
6086             Parameters:
6087                 theShapeWhere Shape to find sub-shape of.
6088                 theShapeWhat Shape, specifying what to find.
6089                 theName Object name; when specified, this parameter is used
6090                         for result publication in the study. Otherwise, if automatic
6091                         publication is switched on, default value is used for result name.
6092
6093             Returns:
6094                 New GEOM.GEOM_Object for found sub-shape.
6095             """
6096             anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
6097             RaiseIfFailed("GetSame", self.ShapesOp)
6098             self._autoPublish(anObj, theName, "sameShape")
6099             return anObj
6100
6101
6102         ## Get sub-shape indices of theShapeWhere, which is
6103         #  equal to \a theShapeWhat.
6104         #  @param theShapeWhere Shape to find sub-shape of.
6105         #  @param theShapeWhat Shape, specifying what to find.
6106         #  @return List of all found sub-shapes indices.
6107         #
6108         #  @ref swig_GetSame "Example"
6109         @ManageTransactions("ShapesOp")
6110         def GetSameIDs(self, theShapeWhere, theShapeWhat):
6111             """
6112             Get sub-shape indices of theShapeWhere, which is
6113             equal to theShapeWhat.
6114
6115             Parameters:
6116                 theShapeWhere Shape to find sub-shape of.
6117                 theShapeWhat Shape, specifying what to find.
6118
6119             Returns:
6120                 List of all found sub-shapes indices.
6121             """
6122             anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
6123             RaiseIfFailed("GetSameIDs", self.ShapesOp)
6124             return anObj
6125
6126         ## Resize the input edge with the new Min and Max parameters.
6127         #  The input edge parameters range is [0, 1]. If theMin parameter is
6128         #  negative, the input edge is extended, otherwise it is shrinked by
6129         #  theMin parameter. If theMax is greater than 1, the edge is extended,
6130         #  otherwise it is shrinked by theMax parameter.
6131         #  @param theEdge the input edge to be resized.
6132         #  @param theMin the minimal parameter value.
6133         #  @param theMax the maximal parameter value.
6134         #  @param theName Object name; when specified, this parameter is used
6135         #         for result publication in the study. Otherwise, if automatic
6136         #         publication is switched on, default value is used for result name.
6137         #  @return New GEOM.GEOM_Object, containing the created edge.
6138         #
6139         #  @ref tui_extend "Example"
6140         @ManageTransactions("ShapesOp")
6141         def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
6142             """
6143             Resize the input edge with the new Min and Max parameters.
6144             The input edge parameters range is [0, 1]. If theMin parameter is
6145             negative, the input edge is extended, otherwise it is shrinked by
6146             theMin parameter. If theMax is greater than 1, the edge is extended,
6147             otherwise it is shrinked by theMax parameter.
6148
6149             Parameters:
6150                 theEdge the input edge to be resized.
6151                 theMin the minimal parameter value.
6152                 theMax the maximal parameter value.
6153                 theName Object name; when specified, this parameter is used
6154                         for result publication in the study. Otherwise, if automatic
6155                         publication is switched on, default value is used for result name.
6156
6157             Returns:
6158                 New GEOM.GEOM_Object, containing the created edge.
6159             """
6160             theMin, theMax, Parameters = ParseParameters(theMin, theMax)
6161             anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
6162             RaiseIfFailed("ExtendEdge", self.ShapesOp)
6163             anObj.SetParameters(Parameters)
6164             self._autoPublish(anObj, theName, "edge")
6165             return anObj
6166
6167         ## Resize the input face with the new UMin, UMax, VMin and VMax
6168         #  parameters. The input face U and V parameters range is [0, 1]. If
6169         #  theUMin parameter is negative, the input face is extended, otherwise
6170         #  it is shrinked along U direction by theUMin parameter. If theUMax is
6171         #  greater than 1, the face is extended, otherwise it is shrinked along
6172         #  U direction by theUMax parameter. So as for theVMin, theVMax and
6173         #  V direction of the input face.
6174         #  @param theFace the input face to be resized.
6175         #  @param theUMin the minimal U parameter value.
6176         #  @param theUMax the maximal U parameter value.
6177         #  @param theVMin the minimal V parameter value.
6178         #  @param theVMax the maximal V parameter value.
6179         #  @param theName Object name; when specified, this parameter is used
6180         #         for result publication in the study. Otherwise, if automatic
6181         #         publication is switched on, default value is used for result name.
6182         #  @return New GEOM.GEOM_Object, containing the created face.
6183         #
6184         #  @ref tui_extend "Example"
6185         @ManageTransactions("ShapesOp")
6186         def ExtendFace(self, theFace, theUMin, theUMax,
6187                        theVMin, theVMax, theName=None):
6188             """
6189             Resize the input face with the new UMin, UMax, VMin and VMax
6190             parameters. The input face U and V parameters range is [0, 1]. If
6191             theUMin parameter is negative, the input face is extended, otherwise
6192             it is shrinked along U direction by theUMin parameter. If theUMax is
6193             greater than 1, the face is extended, otherwise it is shrinked along
6194             U direction by theUMax parameter. So as for theVMin, theVMax and
6195             V direction of the input face.
6196
6197             Parameters:
6198                 theFace the input face to be resized.
6199                 theUMin the minimal U parameter value.
6200                 theUMax the maximal U parameter value.
6201                 theVMin the minimal V parameter value.
6202                 theVMax the maximal V parameter value.
6203                 theName Object name; when specified, this parameter is used
6204                         for result publication in the study. Otherwise, if automatic
6205                         publication is switched on, default value is used for result name.
6206
6207             Returns:
6208                 New GEOM.GEOM_Object, containing the created face.
6209             """
6210             theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6211             anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6212                                              theVMin, theVMax)
6213             RaiseIfFailed("ExtendFace", self.ShapesOp)
6214             anObj.SetParameters(Parameters)
6215             self._autoPublish(anObj, theName, "face")
6216             return anObj
6217
6218         ## This function takes some face as input parameter and creates new
6219         #  GEOM_Object, i.e. topological shape by extracting underlying surface
6220         #  of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6221         #  parameters of the source face (in the parametrical space).
6222         #  @param theFace the input face.
6223         #  @param theName Object name; when specified, this parameter is used
6224         #         for result publication in the study. Otherwise, if automatic
6225         #         publication is switched on, default value is used for result name.
6226         #  @return New GEOM.GEOM_Object, containing the created face.
6227         #
6228         #  @ref tui_creation_surface "Example"
6229         @ManageTransactions("ShapesOp")
6230         def MakeSurfaceFromFace(self, theFace, theName=None):
6231             """
6232             This function takes some face as input parameter and creates new
6233             GEOM_Object, i.e. topological shape by extracting underlying surface
6234             of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6235             parameters of the source face (in the parametrical space).
6236
6237             Parameters:
6238                 theFace the input face.
6239                 theName Object name; when specified, this parameter is used
6240                         for result publication in the study. Otherwise, if automatic
6241                         publication is switched on, default value is used for result name.
6242
6243             Returns:
6244                 New GEOM.GEOM_Object, containing the created face.
6245             """
6246             anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6247             RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6248             self._autoPublish(anObj, theName, "surface")
6249             return anObj
6250
6251         # end of l4_obtain
6252         ## @}
6253
6254         ## @addtogroup l4_access
6255         ## @{
6256
6257         ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6258         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6259         #  @param aShape Shape to get sub-shape of.
6260         #  @param ListOfID List of sub-shapes indices.
6261         #  @param theName Object name; when specified, this parameter is used
6262         #         for result publication in the study. Otherwise, if automatic
6263         #         publication is switched on, default value is used for result name.
6264         #
6265         #  @return Found sub-shape.
6266         #
6267         #  @ref swig_all_decompose "Example"
6268         def GetSubShape(self, aShape, ListOfID, theName=None):
6269             """
6270             Obtain a composite sub-shape of aShape, composed from sub-shapes
6271             of aShape, selected by their unique IDs inside aShape
6272
6273             Parameters:
6274                 aShape Shape to get sub-shape of.
6275                 ListOfID List of sub-shapes indices.
6276                 theName Object name; when specified, this parameter is used
6277                         for result publication in the study. Otherwise, if automatic
6278                         publication is switched on, default value is used for result name.
6279
6280             Returns:
6281                 Found sub-shape.
6282             """
6283             # Example: see GEOM_TestAll.py
6284             anObj = self.AddSubShape(aShape,ListOfID)
6285             self._autoPublish(anObj, theName, "subshape")
6286             return anObj
6287
6288         ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6289         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6290         #  @param aShape Shape to get sub-shape of.
6291         #  @param aSubShape Sub-shapes of aShape.
6292         #  @return ID of found sub-shape.
6293         #
6294         #  @ref swig_all_decompose "Example"
6295         @ManageTransactions("LocalOp")
6296         def GetSubShapeID(self, aShape, aSubShape):
6297             """
6298             Obtain unique ID of sub-shape aSubShape inside aShape
6299             of aShape, selected by their unique IDs inside aShape
6300
6301             Parameters:
6302                aShape Shape to get sub-shape of.
6303                aSubShape Sub-shapes of aShape.
6304
6305             Returns:
6306                ID of found sub-shape.
6307             """
6308             # Example: see GEOM_TestAll.py
6309             anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6310             RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6311             return anID
6312
6313         ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6314         #  This function is provided for performance purpose. The complexity is O(n) with n
6315         #  the number of subobjects of aShape
6316         #  @param aShape Shape to get sub-shape of.
6317         #  @param aSubShapes Sub-shapes of aShape.
6318         #  @return list of IDs of found sub-shapes.
6319         #
6320         #  @ref swig_all_decompose "Example"
6321         @ManageTransactions("ShapesOp")
6322         def GetSubShapesIDs(self, aShape, aSubShapes):
6323             """
6324             Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6325             This function is provided for performance purpose. The complexity is O(n) with n
6326             the number of subobjects of aShape
6327
6328             Parameters:
6329                aShape Shape to get sub-shape of.
6330                aSubShapes Sub-shapes of aShape.
6331
6332             Returns:
6333                List of IDs of found sub-shape.
6334             """
6335             # Example: see GEOM_TestAll.py
6336             anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6337             RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6338             return anIDs
6339
6340         # end of l4_access
6341         ## @}
6342
6343         ## @addtogroup l4_decompose
6344         ## @{
6345
6346         ## Get all sub-shapes and groups of \a theShape,
6347         #  that were created already by any other methods.
6348         #  @param theShape Any shape.
6349         #  @param theGroupsOnly If this parameter is TRUE, only groups will be
6350         #                       returned, else all found sub-shapes and groups.
6351         #  @return List of existing sub-objects of \a theShape.
6352         #
6353         #  @ref swig_all_decompose "Example"
6354         @ManageTransactions("ShapesOp")
6355         def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6356             """
6357             Get all sub-shapes and groups of theShape,
6358             that were created already by any other methods.
6359
6360             Parameters:
6361                 theShape Any shape.
6362                 theGroupsOnly If this parameter is TRUE, only groups will be
6363                                  returned, else all found sub-shapes and groups.
6364
6365             Returns:
6366                 List of existing sub-objects of theShape.
6367             """
6368             # Example: see GEOM_TestAll.py
6369             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6370             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6371             return ListObj
6372
6373         ## Get all groups of \a theShape,
6374         #  that were created already by any other methods.
6375         #  @param theShape Any shape.
6376         #  @return List of existing groups of \a theShape.
6377         #
6378         #  @ref swig_all_decompose "Example"
6379         @ManageTransactions("ShapesOp")
6380         def GetGroups(self, theShape):
6381             """
6382             Get all groups of theShape,
6383             that were created already by any other methods.
6384
6385             Parameters:
6386                 theShape Any shape.
6387
6388             Returns:
6389                 List of existing groups of theShape.
6390             """
6391             # Example: see GEOM_TestAll.py
6392             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6393             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6394             return ListObj
6395
6396         ## Explode a shape on sub-shapes of a given type.
6397         #  If the shape itself matches the type, it is also returned.
6398         #  @param aShape Shape to be exploded.
6399         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6400         #  @param theName Object name; when specified, this parameter is used
6401         #         for result publication in the study. Otherwise, if automatic
6402         #         publication is switched on, default value is used for result name.
6403         #
6404         #  @return List of sub-shapes of type theShapeType, contained in theShape.
6405         #
6406         #  @ref swig_all_decompose "Example"
6407         @ManageTransactions("ShapesOp")
6408         def SubShapeAll(self, aShape, aType, theName=None):
6409             """
6410             Explode a shape on sub-shapes of a given type.
6411             If the shape itself matches the type, it is also returned.
6412
6413             Parameters:
6414                 aShape Shape to be exploded.
6415                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6416                 theName Object name; when specified, this parameter is used
6417                         for result publication in the study. Otherwise, if automatic
6418                         publication is switched on, default value is used for result name.
6419
6420             Returns:
6421                 List of sub-shapes of type theShapeType, contained in theShape.
6422             """
6423             # Example: see GEOM_TestAll.py
6424             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6425             RaiseIfFailed("SubShapeAll", self.ShapesOp)
6426             self._autoPublish(ListObj, theName, "subshape")
6427             return ListObj
6428
6429         ## Explode a shape on sub-shapes of a given type.
6430         #  @param aShape Shape to be exploded.
6431         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6432         #  @return List of IDs of sub-shapes.
6433         #
6434         #  @ref swig_all_decompose "Example"
6435         @ManageTransactions("ShapesOp")
6436         def SubShapeAllIDs(self, aShape, aType):
6437             """
6438             Explode a shape on sub-shapes of a given type.
6439
6440             Parameters:
6441                 aShape Shape to be exploded (see geompy.ShapeType)
6442                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6443
6444             Returns:
6445                 List of IDs of sub-shapes.
6446             """
6447             ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6448             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6449             return ListObj
6450
6451         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6452         #  selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6453         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6454         #  @param aShape Shape to get sub-shape of.
6455         #  @param ListOfInd List of sub-shapes indices.
6456         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6457         #  @param theName Object name; when specified, this parameter is used
6458         #         for result publication in the study. Otherwise, if automatic
6459         #         publication is switched on, default value is used for result name.
6460         #
6461         #  @return A compound of sub-shapes of aShape.
6462         #
6463         #  @ref swig_all_decompose "Example"
6464         def SubShape(self, aShape, aType, ListOfInd, theName=None):
6465             """
6466             Obtain a compound of sub-shapes of aShape,
6467             selected by their indices in list of all sub-shapes of type aType.
6468             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6469
6470             Parameters:
6471                 aShape Shape to get sub-shape of.
6472                 ListOfID List of sub-shapes indices.
6473                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6474                 theName Object name; when specified, this parameter is used
6475                         for result publication in the study. Otherwise, if automatic
6476                         publication is switched on, default value is used for result name.
6477
6478             Returns:
6479                 A compound of sub-shapes of aShape.
6480             """
6481             # Example: see GEOM_TestAll.py
6482             ListOfIDs = []
6483             AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6484             for ind in ListOfInd:
6485                 ListOfIDs.append(AllShapeIDsList[ind - 1])
6486             # note: auto-publishing is done in self.GetSubShape()
6487             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6488             return anObj
6489
6490         ## Explode a shape on sub-shapes of a given type.
6491         #  Sub-shapes will be sorted taking into account their gravity centers,
6492         #  to provide stable order of sub-shapes. Please see
6493         #  @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6494         #  If the shape itself matches the type, it is also returned.
6495         #  @param aShape Shape to be exploded.
6496         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6497         #  @param theName Object name; when specified, this parameter is used
6498         #         for result publication in the study. Otherwise, if automatic
6499         #         publication is switched on, default value is used for result name.
6500         #
6501         #  @return List of sub-shapes of type theShapeType, contained in theShape.
6502         #
6503         #  @ref swig_SubShapeAllSorted "Example"
6504         @ManageTransactions("ShapesOp")
6505         def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6506             """
6507             Explode a shape on sub-shapes of a given type.
6508             Sub-shapes will be sorted taking into account their gravity centers,
6509             to provide stable order of sub-shapes.
6510             If the shape itself matches the type, it is also returned.
6511
6512             Parameters:
6513                 aShape Shape to be exploded.
6514                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6515                 theName Object name; when specified, this parameter is used
6516                         for result publication in the study. Otherwise, if automatic
6517                         publication is switched on, default value is used for result name.
6518
6519             Returns:
6520                 List of sub-shapes of type theShapeType, contained in theShape.
6521             """
6522             # Example: see GEOM_TestAll.py
6523             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6524             RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6525             self._autoPublish(ListObj, theName, "subshape")
6526             return ListObj
6527
6528         ## Explode a shape on sub-shapes of a given type.
6529         #  Sub-shapes will be sorted taking into account their gravity centers,
6530         #  to provide stable order of sub-shapes. Please see
6531         #  @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6532         #  @param aShape Shape to be exploded.
6533         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6534         #  @return List of IDs of sub-shapes.
6535         #
6536         #  @ref swig_all_decompose "Example"
6537         @ManageTransactions("ShapesOp")
6538         def SubShapeAllSortedCentresIDs(self, aShape, aType):
6539             """
6540             Explode a shape on sub-shapes of a given type.
6541             Sub-shapes will be sorted taking into account their gravity centers,
6542             to provide stable order of sub-shapes.
6543
6544             Parameters:
6545                 aShape Shape to be exploded.
6546                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6547
6548             Returns:
6549                 List of IDs of sub-shapes.
6550             """
6551             ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6552             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6553             return ListIDs
6554
6555         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6556         #  selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6557         #  Please see @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6558         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6559         #  @param aShape Shape to get sub-shape of.
6560         #  @param ListOfInd List of sub-shapes indices.
6561         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6562         #  @param theName Object name; when specified, this parameter is used
6563         #         for result publication in the study. Otherwise, if automatic
6564         #         publication is switched on, default value is used for result name.
6565         #
6566         #  @return A compound of sub-shapes of aShape.
6567         #
6568         #  @ref swig_all_decompose "Example"
6569         def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6570             """
6571             Obtain a compound of sub-shapes of aShape,
6572             selected by they indices in sorted list of all sub-shapes of type aType.
6573             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6574
6575             Parameters:
6576                 aShape Shape to get sub-shape of.
6577                 ListOfID List of sub-shapes indices.
6578                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6579                 theName Object name; when specified, this parameter is used
6580                         for result publication in the study. Otherwise, if automatic
6581                         publication is switched on, default value is used for result name.
6582
6583             Returns:
6584                 A compound of sub-shapes of aShape.
6585             """
6586             # Example: see GEOM_TestAll.py
6587             ListOfIDs = []
6588             AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6589             for ind in ListOfInd:
6590                 ListOfIDs.append(AllShapeIDsList[ind - 1])
6591             # note: auto-publishing is done in self.GetSubShape()
6592             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6593             return anObj
6594
6595         ## Extract shapes (excluding the main shape) of given type.
6596         #  @param aShape The shape.
6597         #  @param aType  The shape type (see ShapeType())
6598         #  @param isSorted Boolean flag to switch sorting on/off. Please see
6599         #         @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6600         #  @param theName Object name; when specified, this parameter is used
6601         #         for result publication in the study. Otherwise, if automatic
6602         #         publication is switched on, default value is used for result name.
6603         #
6604         #  @return List of sub-shapes of type aType, contained in aShape.
6605         #
6606         #  @ref swig_FilletChamfer "Example"
6607         @ManageTransactions("ShapesOp")
6608         def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6609             """
6610             Extract shapes (excluding the main shape) of given type.
6611
6612             Parameters:
6613                 aShape The shape.
6614                 aType  The shape type (see geompy.ShapeType)
6615                 isSorted Boolean flag to switch sorting on/off.
6616                 theName Object name; when specified, this parameter is used
6617                         for result publication in the study. Otherwise, if automatic
6618                         publication is switched on, default value is used for result name.
6619
6620             Returns:
6621                 List of sub-shapes of type aType, contained in aShape.
6622             """
6623             # Example: see GEOM_TestAll.py
6624             ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6625             RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6626             self._autoPublish(ListObj, theName, "subshape")
6627             return ListObj
6628
6629         ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6630         #  @param aShape Main shape.
6631         #  @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
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         #  @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6636         #
6637         #  @ref swig_all_decompose "Example"
6638         @ManageTransactions("ShapesOp")
6639         def SubShapes(self, aShape, anIDs, theName=None):
6640             """
6641             Get a set of sub-shapes defined by their unique IDs inside theMainShape
6642
6643             Parameters:
6644                 aShape Main shape.
6645                 anIDs List of unique IDs of sub-shapes inside theMainShape.
6646                 theName Object name; when specified, this parameter is used
6647                         for result publication in the study. Otherwise, if automatic
6648                         publication is switched on, default value is used for result name.
6649
6650             Returns:
6651                 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6652             """
6653             # Example: see GEOM_TestAll.py
6654             ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6655             RaiseIfFailed("SubShapes", self.ShapesOp)
6656             self._autoPublish(ListObj, theName, "subshape")
6657             return ListObj
6658
6659         ## Explode a shape into edges sorted in a row from a starting point.
6660         #  @param theShape the shape to be exploded on edges.
6661         #  @param theStartPoint the starting point.
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         #  @return List of GEOM.GEOM_Object that is actually an ordered list
6666         #          of edges sorted in a row from a starting point.
6667         #
6668         #  @ref swig_GetSubShapeEdgeSorted "Example"
6669         @ManageTransactions("ShapesOp")
6670         def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6671             """
6672             Explode a shape into edges sorted in a row from a starting point.
6673
6674             Parameters:
6675                 theShape the shape to be exploded on edges.
6676                 theStartPoint the starting point.
6677                 theName Object name; when specified, this parameter is used
6678                         for result publication in the study. Otherwise, if automatic
6679                         publication is switched on, default value is used for result name.
6680
6681             Returns:
6682                 List of GEOM.GEOM_Object that is actually an ordered list
6683                 of edges sorted in a row from a starting point.
6684             """
6685             # Example: see GEOM_TestAll.py
6686             ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6687             RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6688             self._autoPublish(ListObj, theName, "SortedEdges")
6689             return ListObj
6690
6691         ##
6692         # Return the list of subshapes that satisfies a certain tolerance
6693         # criterion. The user defines the type of shapes to be returned, the
6694         # condition and the tolerance value. The operation is defined for
6695         # faces, edges and vertices only. E.g. for theShapeType FACE,
6696         # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6697         # all faces of theShape that have tolerances greater then 1.e7.
6698         #
6699         #  @param theShape the shape to be exploded
6700         #  @param theShapeType the type of sub-shapes to be returned (see
6701         #         ShapeType()). Can have the values FACE, EDGE and VERTEX only.
6702         #  @param theCondition the condition type (see GEOM::comparison_condition).
6703         #  @param theTolerance the tolerance filter.
6704         #  @param theName Object name; when specified, this parameter is used
6705         #         for result publication in the study. Otherwise, if automatic
6706         #         publication is switched on, default value is used for result name.
6707         #  @return the list of shapes that satisfy the conditions.
6708         #
6709         #  @ref swig_GetSubShapesWithTolerance "Example"
6710         @ManageTransactions("ShapesOp")
6711         def GetSubShapesWithTolerance(self, theShape, theShapeType,
6712                                       theCondition, theTolerance, theName=None):
6713             """
6714             Return the list of subshapes that satisfies a certain tolerance
6715             criterion. The user defines the type of shapes to be returned, the
6716             condition and the tolerance value. The operation is defined for
6717             faces, edges and vertices only. E.g. for theShapeType FACE,
6718             theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6719             all faces of theShape that have tolerances greater then 1.e7.
6720             
6721             Parameters:
6722                 theShape the shape to be exploded
6723                 theShapeType the type of sub-shapes to be returned (see
6724                              ShapeType()). Can have the values FACE,
6725                              EDGE and VERTEX only.
6726                 theCondition the condition type (see GEOM::comparison_condition).
6727                 theTolerance the tolerance filter.
6728                 theName Object name; when specified, this parameter is used
6729                         for result publication in the study. Otherwise, if automatic
6730                         publication is switched on, default value is used for result name.
6731
6732             Returns:
6733                 The list of shapes that satisfy the conditions.
6734             """
6735             # Example: see GEOM_TestAll.py
6736             ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
6737                                                               theCondition, theTolerance)
6738             RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
6739             self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
6740             return ListObj
6741
6742         ## Check if the object is a sub-object of another GEOM object.
6743         #  @param aSubObject Checked sub-object (or its parent object, in case if
6744         #         \a theSubObjectIndex is non-zero).
6745         #  @param anObject An object that is checked for ownership (or its parent object,
6746         #         in case if \a theObjectIndex is non-zero).
6747         #  @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6748         #         identifies a sub-object within its parent specified via \a theSubObject.
6749         #  @param anObjectIndex When non-zero, specifies a sub-shape index that
6750         #         identifies an object within its parent specified via \a theObject.
6751         #  @return TRUE, if the given object contains sub-object.
6752         @ManageTransactions("ShapesOp")
6753         def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6754             """
6755             Check if the object is a sub-object of another GEOM object.
6756             
6757             Parameters:
6758                 aSubObject Checked sub-object (or its parent object, in case if
6759                     \a theSubObjectIndex is non-zero).
6760                 anObject An object that is checked for ownership (or its parent object,
6761                     in case if \a theObjectIndex is non-zero).
6762                 aSubObjectIndex When non-zero, specifies a sub-shape index that
6763                     identifies a sub-object within its parent specified via \a theSubObject.
6764                 anObjectIndex When non-zero, specifies a sub-shape index that
6765                     identifies an object within its parent specified via \a theObject.
6766
6767             Returns
6768                 TRUE, if the given object contains sub-object.
6769             """
6770             IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6771             RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6772             return IsOk
6773
6774         ## Perform extraction of sub-shapes from the main shape.
6775         #
6776         #  @param theShape the main shape
6777         #  @param theListOfID the list of sub-shape IDs to be extracted from
6778         #         the main shape.
6779         #  @return New GEOM.GEOM_Object, containing the shape without
6780         #          extracted sub-shapes.
6781         #
6782         #  @ref swig_MakeExtraction "Example"
6783         @ManageTransactions("ShapesOp")
6784         def MakeExtraction(self, theShape, theListOfID, theName=None):
6785             """
6786             Perform extraction of sub-shapes from the main shape.
6787
6788             Parameters:
6789                 theShape the main shape
6790                 theListOfID the list of sub-shape IDs to be extracted from
6791                             the main shape.
6792
6793             Returns
6794                 New GEOM.GEOM_Object, containing the shape without
6795                 extracted sub-shapes.
6796             """
6797             # Example: see GEOM_TestAll.py
6798             (anObj, aStat) = self.ShapesOp.MakeExtraction(theShape, theListOfID)
6799             RaiseIfFailed("MakeExtraction", self.ShapesOp)
6800             self._autoPublish(anObj, theName, "Extraction")
6801             return anObj
6802
6803         # end of l4_decompose
6804         ## @}
6805
6806         ## @addtogroup l4_decompose_d
6807         ## @{
6808
6809         ## Deprecated method
6810         #  It works like SubShapeAllSortedCentres(), but wrongly
6811         #  defines centres of faces, shells and solids.
6812         @ManageTransactions("ShapesOp")
6813         def SubShapeAllSorted(self, aShape, aType, theName=None):
6814             """
6815             Deprecated method
6816             It works like geompy.SubShapeAllSortedCentres, but wrongly
6817             defines centres of faces, shells and solids.
6818             """
6819             ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6820             RaiseIfFailed("MakeExplode", self.ShapesOp)
6821             self._autoPublish(ListObj, theName, "subshape")
6822             return ListObj
6823
6824         ## Deprecated method
6825         #  It works like SubShapeAllSortedCentresIDs(), but wrongly
6826         #  defines centres of faces, shells and solids.
6827         @ManageTransactions("ShapesOp")
6828         def SubShapeAllSortedIDs(self, aShape, aType):
6829             """
6830             Deprecated method
6831             It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6832             defines centres of faces, shells and solids.
6833             """
6834             ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6835             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6836             return ListIDs
6837
6838         ## Deprecated method
6839         #  It works like SubShapeSortedCentres(), but has a bug
6840         #  (wrongly defines centres of faces, shells and solids).
6841         def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6842             """
6843             Deprecated method
6844             It works like geompy.SubShapeSortedCentres, but has a bug
6845             (wrongly defines centres of faces, shells and solids).
6846             """
6847             ListOfIDs = []
6848             AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6849             for ind in ListOfInd:
6850                 ListOfIDs.append(AllShapeIDsList[ind - 1])
6851             # note: auto-publishing is done in self.GetSubShape()
6852             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6853             return anObj
6854
6855         # end of l4_decompose_d
6856         ## @}
6857
6858         ## @addtogroup l3_healing
6859         ## @{
6860
6861         ## Apply a sequence of Shape Healing operators to the given object.
6862         #  @param theShape Shape to be processed.
6863         #  @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6864         #  @param theParameters List of names of parameters
6865         #                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6866         #  @param theValues List of values of parameters, in the same order
6867         #                    as parameters are listed in <VAR>theParameters</VAR> list.
6868         #  @param theName Object name; when specified, this parameter is used
6869         #         for result publication in the study. Otherwise, if automatic
6870         #         publication is switched on, default value is used for result name.
6871         #
6872         #  <b> Operators and Parameters: </b> \n
6873         #
6874         #  * \b FixShape - corrects invalid shapes. \n
6875         #  - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6876         #  - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6877         #
6878         #  * \b FixFaceSize - removes small faces, such as spots and strips.\n
6879         #  - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6880         #  - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6881         #  - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6882         #  - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6883         #  - \b DropSmallSolids.WidthFactorThreshold - defines maximum value of <em>2V/S</em> of a solid which is considered small, where \a V is volume and \a S is surface area of the solid. \n
6884         #  - \b DropSmallSolids.VolumeThreshold - defines maximum volume of a solid which is considered small. If the both tolerances are privided a solid is considered small if it meets the both criteria. \n
6885         #  - \b DropSmallSolids.MergeSolids - if "1", small solids are removed; if "0" small solids are merged to adjacent non-small solids or left untouched if cannot be merged. \n
6886         #
6887         #  * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6888         #    surfaces in segments using a certain angle. \n
6889         #  - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6890         #    if Angle=180, four if Angle=90, etc). \n
6891         #  - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6892         #
6893         #  * \b SplitClosedFaces - splits closed faces in segments.
6894         #    The number of segments depends on the number of splitting points.\n
6895         #  - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6896         #
6897         #  * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6898         #  - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6899         #  - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6900         #  - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6901         #   This and the previous parameters can take the following values:\n
6902         #   \b Parametric \b Continuity \n
6903         #   \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6904         #   are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6905         #   \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6906         #    ruling out sharp edges).\n
6907         #   \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6908         #       are of the same magnitude).\n
6909         #   \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6910         #    or surfaces (d/du C(u)) are the same at junction. \n
6911         #   \b Geometric \b Continuity \n
6912         #   \b G1: first derivatives are proportional at junction.\n
6913         #   The curve tangents thus have the same direction, but not necessarily the same magnitude.
6914         #      i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6915         #   \b G2: first and second derivatives are proportional at junction.
6916         #   As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6917         #    continuity requires that the underlying parameterization was continuous as well.
6918         #   Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6919         #
6920         #  * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6921         #  - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6922         #  - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6923         #  - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6924         #  - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6925         #       with the specified parameters.\n
6926         #  - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6927         #       with the specified parameters.\n
6928         #  - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6929         #  - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6930         #  - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6931         #  - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6932         #
6933         #  * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6934         #  - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6935         #  - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6936         #  - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6937         #  - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6938         #
6939         #  * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6940         #  - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6941         #
6942         #
6943         #  @return New GEOM.GEOM_Object, containing processed shape.
6944         #
6945         #  \n @ref tui_shape_processing "Example"
6946         @ManageTransactions("HealOp")
6947         def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6948             """
6949             Apply a sequence of Shape Healing operators to the given object.
6950
6951             Parameters:
6952                 theShape Shape to be processed.
6953                 theValues List of values of parameters, in the same order
6954                           as parameters are listed in theParameters list.
6955                 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6956                 theParameters List of names of parameters
6957                               ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6958                 theName Object name; when specified, this parameter is used
6959                         for result publication in the study. Otherwise, if automatic
6960                         publication is switched on, default value is used for result name.
6961
6962                 Operators and Parameters:
6963
6964                  * FixShape - corrects invalid shapes.
6965                      * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6966                      * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6967                  * FixFaceSize - removes small faces, such as spots and strips.
6968                      * FixFaceSize.Tolerance - defines minimum possible face size.
6969                  * DropSmallEdges - removes edges, which merge with neighbouring edges.
6970                      * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6971                  * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6972                      * DropSmallSolids.WidthFactorThreshold - defines maximum value of 2V/S of a solid which is considered small, where V is volume and S is surface area of the solid.
6973                      * DropSmallSolids.VolumeThreshold - defines maximum volume of a solid which is considered small. If the both tolerances are privided a solid is considered small if it meets the both criteria.
6974                      * DropSmallSolids.MergeSolids - if '1', small solids are removed; if '0' small solids are merged to adjacent non-small solids or left untouched if cannot be merged.
6975
6976                  * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6977                                 in segments using a certain angle.
6978                      * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6979                                           if Angle=180, four if Angle=90, etc).
6980                      * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6981                  * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6982                                       splitting points.
6983                      * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6984                  * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6985                      * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6986                      * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6987                      * SplitContinuity.CurveContinuity - required continuity for curves.
6988                        This and the previous parameters can take the following values:
6989
6990                        Parametric Continuity:
6991                        C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6992                                                    coincidental. The curves or surfaces may still meet at an angle,
6993                                                    giving rise to a sharp corner or edge).
6994                        C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6995                                                    are parallel, ruling out sharp edges).
6996                        C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6997                                                   or surfaces are of the same magnitude).
6998                        CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6999                           curves or surfaces (d/du C(u)) are the same at junction.
7000
7001                        Geometric Continuity:
7002                        G1: first derivatives are proportional at junction.
7003                            The curve tangents thus have the same direction, but not necessarily the same magnitude.
7004                            i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
7005                        G2: first and second derivatives are proportional at junction. As the names imply,
7006                            geometric continuity requires the geometry to be continuous, while parametric continuity requires
7007                            that the underlying parameterization was continuous as well. Parametric continuity of order n implies
7008                            geometric continuity of order n, but not vice-versa.
7009                  * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
7010                      * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
7011                      * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
7012                      * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
7013                      * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
7014                                                         the specified parameters.
7015                      * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
7016                                                         the specified parameters.
7017                      * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
7018                      * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
7019                      * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
7020                      * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
7021                  * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
7022                      * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
7023                      * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
7024                      * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
7025                      * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
7026                  * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
7027                      * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
7028
7029             Returns:
7030                 New GEOM.GEOM_Object, containing processed shape.
7031
7032             Note: For more information look through SALOME Geometry User's Guide->
7033                   -> Introduction to Geometry-> Repairing Operations-> Shape Processing
7034             """
7035             # Example: see GEOM_TestHealing.py
7036             theValues,Parameters = ParseList(theValues)
7037             anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
7038             # To avoid script failure in case of good argument shape
7039             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7040                 return theShape
7041             RaiseIfFailed("ProcessShape", self.HealOp)
7042             for string in (theOperators + theParameters):
7043                 Parameters = ":" + Parameters
7044                 pass
7045             anObj.SetParameters(Parameters)
7046             self._autoPublish(anObj, theName, "healed")
7047             return anObj
7048
7049         ## Remove faces from the given object (shape).
7050         #  @param theObject Shape to be processed.
7051         #  @param theFaces Indices of faces to be removed, if EMPTY then the method
7052         #                  removes ALL faces of the given object.
7053         #  @param theName Object name; when specified, this parameter is used
7054         #         for result publication in the study. Otherwise, if automatic
7055         #         publication is switched on, default value is used for result name.
7056         #
7057         #  @return New GEOM.GEOM_Object, containing processed shape.
7058         #
7059         #  @ref tui_suppress_faces "Example"
7060         @ManageTransactions("HealOp")
7061         def SuppressFaces(self, theObject, theFaces, theName=None):
7062             """
7063             Remove faces from the given object (shape).
7064
7065             Parameters:
7066                 theObject Shape to be processed.
7067                 theFaces Indices of faces to be removed, if EMPTY then the method
7068                          removes ALL faces of the given object.
7069                 theName Object name; when specified, this parameter is used
7070                         for result publication in the study. Otherwise, if automatic
7071                         publication is switched on, default value is used for result name.
7072
7073             Returns:
7074                 New GEOM.GEOM_Object, containing processed shape.
7075             """
7076             # Example: see GEOM_TestHealing.py
7077             anObj = self.HealOp.SuppressFaces(theObject, theFaces)
7078             RaiseIfFailed("SuppressFaces", self.HealOp)
7079             self._autoPublish(anObj, theName, "suppressFaces")
7080             return anObj
7081
7082         ## Sewing of faces into a single shell.
7083         #  @param ListShape Shapes to be processed.
7084         #  @param theTolerance Required tolerance value.
7085         #  @param AllowNonManifold Flag that allows non-manifold sewing.
7086         #  @param theName Object name; when specified, this parameter is used
7087         #         for result publication in the study. Otherwise, if automatic
7088         #         publication is switched on, default value is used for result name.
7089         #
7090         #  @return New GEOM.GEOM_Object, containing a result shell.
7091         #
7092         #  @ref tui_sewing "Example"
7093         def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7094             """
7095             Sewing of faces into a single shell.
7096
7097             Parameters:
7098                 ListShape Shapes to be processed.
7099                 theTolerance Required tolerance value.
7100                 AllowNonManifold Flag that allows non-manifold sewing.
7101                 theName Object name; when specified, this parameter is used
7102                         for result publication in the study. Otherwise, if automatic
7103                         publication is switched on, default value is used for result name.
7104
7105             Returns:
7106                 New GEOM.GEOM_Object, containing containing a result shell.
7107             """
7108             # Example: see GEOM_TestHealing.py
7109             # note: auto-publishing is done in self.Sew()
7110             anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
7111             return anObj
7112
7113         ## Sewing of faces into a single shell.
7114         #  @param ListShape Shapes to be processed.
7115         #  @param theTolerance Required tolerance value.
7116         #  @param AllowNonManifold Flag that allows non-manifold sewing.
7117         #  @param theName Object name; when specified, this parameter is used
7118         #         for result publication in the study. Otherwise, if automatic
7119         #         publication is switched on, default value is used for result name.
7120         #
7121         #  @return New GEOM.GEOM_Object, containing a result shell.
7122         @ManageTransactions("HealOp")
7123         def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7124             """
7125             Sewing of faces into a single shell.
7126
7127             Parameters:
7128                 ListShape Shapes to be processed.
7129                 theTolerance Required tolerance value.
7130                 AllowNonManifold Flag that allows non-manifold sewing.
7131                 theName Object name; when specified, this parameter is used
7132                         for result publication in the study. Otherwise, if automatic
7133                         publication is switched on, default value is used for result name.
7134
7135             Returns:
7136                 New GEOM.GEOM_Object, containing a result shell.
7137             """
7138             # Example: see MakeSewing() above
7139             theTolerance,Parameters = ParseParameters(theTolerance)
7140             if AllowNonManifold:
7141                 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
7142             else:
7143                 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
7144             # To avoid script failure in case of good argument shape
7145             # (Fix of test cases geom/bugs11/L7,L8)
7146             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7147                 return anObj
7148             RaiseIfFailed("Sew", self.HealOp)
7149             anObj.SetParameters(Parameters)
7150             self._autoPublish(anObj, theName, "sewed")
7151             return anObj
7152
7153         ## Rebuild the topology of theSolids by removing
7154         #  the faces that are shared by several solids.
7155         #  @param theSolids A compound or a list of solids to be processed.
7156         #  @param theName Object name; when specified, this parameter is used
7157         #         for result publication in the study. Otherwise, if automatic
7158         #         publication is switched on, default value is used for result name.
7159         #
7160         #  @return New GEOM.GEOM_Object, containing processed shape.
7161         #
7162         #  @ref tui_remove_webs "Example"
7163         @ManageTransactions("HealOp")
7164         def RemoveInternalFaces (self, theSolids, theName=None):
7165             """
7166             Rebuild the topology of theSolids by removing
7167             the faces that are shared by several solids.
7168
7169             Parameters:
7170                 theSolids A compound or a list of solids to be processed.
7171                 theName Object name; when specified, this parameter is used
7172                         for result publication in the study. Otherwise, if automatic
7173                         publication is switched on, default value is used for result name.
7174
7175             Returns:
7176                 New GEOM.GEOM_Object, containing processed shape.
7177             """
7178             # Example: see GEOM_TestHealing.py
7179             anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
7180             RaiseIfFailed("RemoveInternalFaces", self.HealOp)
7181             self._autoPublish(anObj, theName, "removeWebs")
7182             return anObj
7183
7184         ## Remove internal wires and edges from the given object (face).
7185         #  @param theObject Shape to be processed.
7186         #  @param theWires Indices of wires to be removed, if EMPTY then the method
7187         #                  removes ALL internal wires of the given object.
7188         #  @param theName Object name; when specified, this parameter is used
7189         #         for result publication in the study. Otherwise, if automatic
7190         #         publication is switched on, default value is used for result name.
7191         #
7192         #  @return New GEOM.GEOM_Object, containing processed shape.
7193         #
7194         #  @ref tui_suppress_internal_wires "Example"
7195         @ManageTransactions("HealOp")
7196         def SuppressInternalWires(self, theObject, theWires, theName=None):
7197             """
7198             Remove internal wires and edges from the given object (face).
7199
7200             Parameters:
7201                 theObject Shape to be processed.
7202                 theWires Indices of wires to be removed, if EMPTY then the method
7203                          removes ALL internal wires of the given object.
7204                 theName Object name; when specified, this parameter is used
7205                         for result publication in the study. Otherwise, if automatic
7206                         publication is switched on, default value is used for result name.
7207
7208             Returns:
7209                 New GEOM.GEOM_Object, containing processed shape.
7210             """
7211             # Example: see GEOM_TestHealing.py
7212             anObj = self.HealOp.RemoveIntWires(theObject, theWires)
7213             RaiseIfFailed("RemoveIntWires", self.HealOp)
7214             self._autoPublish(anObj, theName, "suppressWires")
7215             return anObj
7216
7217         ## Remove internal closed contours (holes) from the given object.
7218         #  @param theObject Shape to be processed.
7219         #  @param theWires Indices of wires to be removed, if EMPTY then the method
7220         #                  removes ALL internal holes of the given object
7221         #  @param theName Object name; when specified, this parameter is used
7222         #         for result publication in the study. Otherwise, if automatic
7223         #         publication is switched on, default value is used for result name.
7224         #
7225         #  @return New GEOM.GEOM_Object, containing processed shape.
7226         #
7227         #  @ref tui_suppress_holes "Example"
7228         @ManageTransactions("HealOp")
7229         def SuppressHoles(self, theObject, theWires, theName=None):
7230             """
7231             Remove internal closed contours (holes) from the given object.
7232
7233             Parameters:
7234                 theObject Shape to be processed.
7235                 theWires Indices of wires to be removed, if EMPTY then the method
7236                          removes ALL internal holes of the given object
7237                 theName Object name; when specified, this parameter is used
7238                         for result publication in the study. Otherwise, if automatic
7239                         publication is switched on, default value is used for result name.
7240
7241             Returns:
7242                 New GEOM.GEOM_Object, containing processed shape.
7243             """
7244             # Example: see GEOM_TestHealing.py
7245             anObj = self.HealOp.FillHoles(theObject, theWires)
7246             RaiseIfFailed("FillHoles", self.HealOp)
7247             self._autoPublish(anObj, theName, "suppressHoles")
7248             return anObj
7249
7250         ## Close an open wire.
7251         #  @param theObject Shape to be processed.
7252         #  @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7253         #                  if [ ], then <VAR>theObject</VAR> itself is a wire.
7254         #  @param isCommonVertex If True  : closure by creation of a common vertex,
7255         #                        If False : closure by creation of an edge between ends.
7256         #  @param theName Object name; when specified, this parameter is used
7257         #         for result publication in the study. Otherwise, if automatic
7258         #         publication is switched on, default value is used for result name.
7259         #
7260         #  @return New GEOM.GEOM_Object, containing processed shape.
7261         #
7262         #  @ref tui_close_contour "Example"
7263         @ManageTransactions("HealOp")
7264         def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7265             """
7266             Close an open wire.
7267
7268             Parameters:
7269                 theObject Shape to be processed.
7270                 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7271                          if [ ], then theObject itself is a wire.
7272                 isCommonVertex If True  : closure by creation of a common vertex,
7273                                If False : closure by creation of an edge between ends.
7274                 theName Object name; when specified, this parameter is used
7275                         for result publication in the study. Otherwise, if automatic
7276                         publication is switched on, default value is used for result name.
7277
7278             Returns:
7279                 New GEOM.GEOM_Object, containing processed shape.
7280             """
7281             # Example: see GEOM_TestHealing.py
7282             anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7283             RaiseIfFailed("CloseContour", self.HealOp)
7284             self._autoPublish(anObj, theName, "closeContour")
7285             return anObj
7286
7287         ## Addition of a point to a given edge object.
7288         #  @param theObject Shape to be processed.
7289         #  @param theEdgeIndex Index of edge to be divided within theObject's shape,
7290         #                      if -1, then theObject itself is the edge.
7291         #  @param theValue Value of parameter on edge or length parameter,
7292         #                  depending on \a isByParameter.
7293         #  @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7294         #                       if FALSE : \a theValue is treated as a length parameter [0..1]
7295         #  @param 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         #  @return New GEOM.GEOM_Object, containing processed shape.
7300         #
7301         #  @ref tui_add_point_on_edge "Example"
7302         @ManageTransactions("HealOp")
7303         def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7304             """
7305             Addition of a point to a given edge object.
7306
7307             Parameters:
7308                 theObject Shape to be processed.
7309                 theEdgeIndex Index of edge to be divided within theObject's shape,
7310                              if -1, then theObject itself is the edge.
7311                 theValue Value of parameter on edge or length parameter,
7312                          depending on isByParameter.
7313                 isByParameter If TRUE :  theValue is treated as a curve parameter [0..1],
7314                               if FALSE : theValue is treated as a length parameter [0..1]
7315                 theName Object name; when specified, this parameter is used
7316                         for result publication in the study. Otherwise, if automatic
7317                         publication is switched on, default value is used for result name.
7318
7319             Returns:
7320                 New GEOM.GEOM_Object, containing processed shape.
7321             """
7322             # Example: see GEOM_TestHealing.py
7323             theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7324             anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7325             RaiseIfFailed("DivideEdge", self.HealOp)
7326             anObj.SetParameters(Parameters)
7327             self._autoPublish(anObj, theName, "divideEdge")
7328             return anObj
7329
7330         ## Addition of points to a given edge of \a theObject by projecting
7331         #  other points to the given edge.
7332         #  @param theObject Shape to be processed.
7333         #  @param theEdgeIndex Index of edge to be divided within theObject's shape,
7334         #                      if -1, then theObject itself is the edge.
7335         #  @param thePoints List of points to project to theEdgeIndex-th edge.
7336         #  @param theName Object name; when specified, this parameter is used
7337         #         for result publication in the study. Otherwise, if automatic
7338         #         publication is switched on, default value is used for result name.
7339         #
7340         #  @return New GEOM.GEOM_Object, containing processed shape.
7341         #
7342         #  @ref tui_add_point_on_edge "Example"
7343         @ManageTransactions("HealOp")
7344         def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7345             """
7346             Addition of points to a given edge of \a theObject by projecting
7347             other points to the given edge.
7348
7349             Parameters:
7350                 theObject Shape to be processed.
7351                 theEdgeIndex The edge or its index to be divided within theObject's shape,
7352                              if -1, then theObject itself is the edge.
7353                 thePoints List of points to project to theEdgeIndex-th edge.
7354                 theName Object name; when specified, this parameter is used
7355                         for result publication in the study. Otherwise, if automatic
7356                         publication is switched on, default value is used for result name.
7357
7358             Returns:
7359                 New GEOM.GEOM_Object, containing processed shape.
7360             """
7361             # Example: see GEOM_TestHealing.py
7362             if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7363                 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7364             anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7365             RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7366             self._autoPublish(anObj, theName, "divideEdge")
7367             return anObj
7368
7369         ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7370         #  @param theWire Wire to minimize the number of C1 continuous edges in.
7371         #  @param theVertices A list of vertices to suppress. If the list
7372         #                     is empty, all vertices in a wire will be assumed.
7373         #  @param theName Object name; when specified, this parameter is used
7374         #         for result publication in the study. Otherwise, if automatic
7375         #         publication is switched on, default value is used for result name.
7376         #
7377         #  @return New GEOM.GEOM_Object with modified wire.
7378         #
7379         #  @ref tui_fuse_collinear_edges "Example"
7380         @ManageTransactions("HealOp")
7381         def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7382             """
7383             Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7384
7385             Parameters:
7386                 theWire Wire to minimize the number of C1 continuous edges in.
7387                 theVertices A list of vertices to suppress. If the list
7388                             is empty, all vertices in a wire will be assumed.
7389                 theName Object name; when specified, this parameter is used
7390                         for result publication in the study. Otherwise, if automatic
7391                         publication is switched on, default value is used for result name.
7392
7393             Returns:
7394                 New GEOM.GEOM_Object with modified wire.
7395             """
7396             anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7397             RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7398             self._autoPublish(anObj, theName, "fuseEdges")
7399             return anObj
7400
7401         ## Change orientation of the given object. Updates given shape.
7402         #  @param theObject Shape to be processed.
7403         #  @return Updated <var>theObject</var>
7404         #
7405         #  @ref swig_todo "Example"
7406         @ManageTransactions("HealOp")
7407         def ChangeOrientationShell(self,theObject):
7408             """
7409             Change orientation of the given object. Updates given shape.
7410
7411             Parameters:
7412                 theObject Shape to be processed.
7413
7414             Returns:
7415                 Updated theObject
7416             """
7417             theObject = self.HealOp.ChangeOrientation(theObject)
7418             RaiseIfFailed("ChangeOrientation", self.HealOp)
7419             pass
7420
7421         ## Change orientation of the given object.
7422         #  @param theObject Shape to be processed.
7423         #  @param theName Object name; when specified, this parameter is used
7424         #         for result publication in the study. Otherwise, if automatic
7425         #         publication is switched on, default value is used for result name.
7426         #
7427         #  @return New GEOM.GEOM_Object, containing processed shape.
7428         #
7429         #  @ref swig_todo "Example"
7430         @ManageTransactions("HealOp")
7431         def ChangeOrientationShellCopy(self, theObject, theName=None):
7432             """
7433             Change orientation of the given object.
7434
7435             Parameters:
7436                 theObject Shape to be processed.
7437                 theName Object name; when specified, this parameter is used
7438                         for result publication in the study. Otherwise, if automatic
7439                         publication is switched on, default value is used for result name.
7440
7441             Returns:
7442                 New GEOM.GEOM_Object, containing processed shape.
7443             """
7444             anObj = self.HealOp.ChangeOrientationCopy(theObject)
7445             RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7446             self._autoPublish(anObj, theName, "reversed")
7447             return anObj
7448
7449         ## Try to limit tolerance of the given object by value \a theTolerance.
7450         #  @param theObject Shape to be processed.
7451         #  @param theTolerance Required tolerance value.
7452         #  @param theName Object name; when specified, this parameter is used
7453         #         for result publication in the study. Otherwise, if automatic
7454         #         publication is switched on, default value is used for result name.
7455         #
7456         #  @return New GEOM.GEOM_Object, containing processed shape.
7457         #
7458         #  @ref tui_limit_tolerance "Example"
7459         @ManageTransactions("HealOp")
7460         def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7461             """
7462             Try to limit tolerance of the given object by value theTolerance.
7463
7464             Parameters:
7465                 theObject Shape to be processed.
7466                 theTolerance Required tolerance value.
7467                 theName Object name; when specified, this parameter is used
7468                         for result publication in the study. Otherwise, if automatic
7469                         publication is switched on, default value is used for result name.
7470
7471             Returns:
7472                 New GEOM.GEOM_Object, containing processed shape.
7473             """
7474             anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7475             RaiseIfFailed("LimitTolerance", self.HealOp)
7476             self._autoPublish(anObj, theName, "limitTolerance")
7477             return anObj
7478
7479         ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7480         #  that constitute a free boundary of the given shape.
7481         #  @param theObject Shape to get free boundary of.
7482         #  @param theName Object name; when specified, this parameter is used
7483         #         for result publication in the study. Otherwise, if automatic
7484         #         publication is switched on, default value is used for result name.
7485         #
7486         #  @return [\a status, \a theClosedWires, \a theOpenWires]
7487         #  \n \a status: FALSE, if an error(s) occurred during the method execution.
7488         #  \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7489         #  \n \a theOpenWires: Open wires on the free boundary of the given shape.
7490         #
7491         #  @ref tui_free_boundaries_page "Example"
7492         @ManageTransactions("HealOp")
7493         def GetFreeBoundary(self, theObject, theName=None):
7494             """
7495             Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7496             that constitute a free boundary of the given shape.
7497
7498             Parameters:
7499                 theObject Shape to get free boundary of.
7500                 theName Object name; when specified, this parameter is used
7501                         for result publication in the study. Otherwise, if automatic
7502                         publication is switched on, default value is used for result name.
7503
7504             Returns:
7505                 [status, theClosedWires, theOpenWires]
7506                  status: FALSE, if an error(s) occurred during the method execution.
7507                  theClosedWires: Closed wires on the free boundary of the given shape.
7508                  theOpenWires: Open wires on the free boundary of the given shape.
7509             """
7510             # Example: see GEOM_TestHealing.py
7511             anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7512             RaiseIfFailed("GetFreeBoundary", self.HealOp)
7513             self._autoPublish(anObj[1], theName, "closedWire")
7514             self._autoPublish(anObj[2], theName, "openWire")
7515             return anObj
7516
7517         ## Replace coincident faces in \a theShapes by one face.
7518         #  @param theShapes Initial shapes, either a list or compound of shapes.
7519         #  @param theTolerance Maximum distance between faces, which can be considered as coincident.
7520         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
7521         #                         otherwise all initial shapes.
7522         #  @param theName Object name; when specified, this parameter is used
7523         #         for result publication in the study. Otherwise, if automatic
7524         #         publication is switched on, default value is used for result name.
7525         #
7526         #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7527         #
7528         #  @ref tui_glue_faces "Example"
7529         @ManageTransactions("ShapesOp")
7530         def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7531             """
7532             Replace coincident faces in theShapes by one face.
7533
7534             Parameters:
7535                 theShapes Initial shapes, either a list or compound of shapes.
7536                 theTolerance Maximum distance between faces, which can be considered as coincident.
7537                 doKeepNonSolids If FALSE, only solids will present in the result,
7538                                 otherwise all initial shapes.
7539                 theName Object name; when specified, this parameter is used
7540                         for result publication in the study. Otherwise, if automatic
7541                         publication is switched on, default value is used for result name.
7542
7543             Returns:
7544                 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7545             """
7546             # Example: see GEOM_Spanner.py
7547             theTolerance,Parameters = ParseParameters(theTolerance)
7548             anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7549             if anObj is None:
7550                 raise RuntimeError("MakeGlueFaces : " + self.ShapesOp.GetErrorCode())
7551             anObj.SetParameters(Parameters)
7552             self._autoPublish(anObj, theName, "glueFaces")
7553             return anObj
7554
7555         ## Find coincident faces in \a theShapes for possible gluing.
7556         #  @param theShapes Initial shapes, either a list or compound of shapes.
7557         #  @param theTolerance Maximum distance between faces,
7558         #                      which can be considered as coincident.
7559         #  @param theName Object name; when specified, this parameter is used
7560         #         for result publication in the study. Otherwise, if automatic
7561         #         publication is switched on, default value is used for result name.
7562         #
7563         #  @return GEOM.ListOfGO
7564         #
7565         #  @ref tui_glue_faces "Example"
7566         @ManageTransactions("ShapesOp")
7567         def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7568             """
7569             Find coincident faces in theShapes for possible gluing.
7570
7571             Parameters:
7572                 theShapes Initial shapes, either a list or compound of shapes.
7573                 theTolerance Maximum distance between faces,
7574                              which can be considered as coincident.
7575                 theName Object name; when specified, this parameter is used
7576                         for result publication in the study. Otherwise, if automatic
7577                         publication is switched on, default value is used for result name.
7578
7579             Returns:
7580                 GEOM.ListOfGO
7581             """
7582             anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7583             RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7584             self._autoPublish(anObj, theName, "facesToGlue")
7585             return anObj
7586
7587         ## Replace coincident faces in \a theShapes by one face
7588         #  in compliance with given list of faces
7589         #  @param theShapes Initial shapes, either a list or compound of shapes.
7590         #  @param theTolerance Maximum distance between faces,
7591         #                      which can be considered as coincident.
7592         #  @param theFaces List of faces for gluing.
7593         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
7594         #                         otherwise all initial shapes.
7595         #  @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7596         #                        will be glued, otherwise only the edges,
7597         #                        belonging to <VAR>theFaces</VAR>.
7598         #  @param theName Object name; when specified, this parameter is used
7599         #         for result publication in the study. Otherwise, if automatic
7600         #         publication is switched on, default value is used for result name.
7601         #
7602         #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7603         #
7604         #  @ref tui_glue_faces "Example"
7605         @ManageTransactions("ShapesOp")
7606         def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7607                                 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7608             """
7609             Replace coincident faces in theShapes by one face
7610             in compliance with given list of faces
7611
7612             Parameters:
7613                 theShapes theShapes Initial shapes, either a list or compound of shapes.
7614                 theTolerance Maximum distance between faces,
7615                              which can be considered as coincident.
7616                 theFaces List of faces for gluing.
7617                 doKeepNonSolids If FALSE, only solids will present in the result,
7618                                 otherwise all initial shapes.
7619                 doGlueAllEdges If TRUE, all coincident edges of theShape
7620                                will be glued, otherwise only the edges,
7621                                belonging to theFaces.
7622                 theName Object name; when specified, this parameter is used
7623                         for result publication in the study. Otherwise, if automatic
7624                         publication is switched on, default value is used for result name.
7625
7626             Returns:
7627                 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7628             """
7629             anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7630                                                       doKeepNonSolids, doGlueAllEdges)
7631             if anObj is None:
7632                 raise RuntimeError("MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode())
7633             self._autoPublish(anObj, theName, "glueFaces")
7634             return anObj
7635
7636         ## Replace coincident edges in \a theShapes by one edge.
7637         #  @param theShapes Initial shapes, either a list or compound of shapes.
7638         #  @param theTolerance Maximum distance between edges, which can be considered as coincident.
7639         #  @param theName Object name; when specified, this parameter is used
7640         #         for result publication in the study. Otherwise, if automatic
7641         #         publication is switched on, default value is used for result name.
7642         #
7643         #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7644         #
7645         #  @ref tui_glue_edges "Example"
7646         @ManageTransactions("ShapesOp")
7647         def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7648             """
7649             Replace coincident edges in theShapes by one edge.
7650
7651             Parameters:
7652                 theShapes Initial shapes, either a list or compound of shapes.
7653                 theTolerance Maximum distance between edges, which can be considered as coincident.
7654                 theName Object name; when specified, this parameter is used
7655                         for result publication in the study. Otherwise, if automatic
7656                         publication is switched on, default value is used for result name.
7657
7658             Returns:
7659                 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7660             """
7661             theTolerance,Parameters = ParseParameters(theTolerance)
7662             anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7663             if anObj is None:
7664                 raise RuntimeError("MakeGlueEdges : " + self.ShapesOp.GetErrorCode())
7665             anObj.SetParameters(Parameters)
7666             self._autoPublish(anObj, theName, "glueEdges")
7667             return anObj
7668
7669         ## Find coincident edges in \a theShapes for possible gluing.
7670         #  @param theShapes Initial shapes, either a list or compound of shapes.
7671         #  @param theTolerance Maximum distance between edges,
7672         #                      which can be considered as coincident.
7673         #  @param theName Object name; when specified, this parameter is used
7674         #         for result publication in the study. Otherwise, if automatic
7675         #         publication is switched on, default value is used for result name.
7676         #
7677         #  @return GEOM.ListOfGO
7678         #
7679         #  @ref tui_glue_edges "Example"
7680         @ManageTransactions("ShapesOp")
7681         def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7682             """
7683             Find coincident edges in theShapes for possible gluing.
7684
7685             Parameters:
7686                 theShapes Initial shapes, either a list or compound of shapes.
7687                 theTolerance Maximum distance between edges,
7688                              which can be considered as coincident.
7689                 theName Object name; when specified, this parameter is used
7690                         for result publication in the study. Otherwise, if automatic
7691                         publication is switched on, default value is used for result name.
7692
7693             Returns:
7694                 GEOM.ListOfGO
7695             """
7696             anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7697             RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7698             self._autoPublish(anObj, theName, "edgesToGlue")
7699             return anObj
7700
7701         ## Replace coincident edges in theShapes by one edge
7702         #  in compliance with given list of edges.
7703         #  @param theShapes Initial shapes, either a list or compound of shapes.
7704         #  @param theTolerance Maximum distance between edges,
7705         #                      which can be considered as coincident.
7706         #  @param theEdges List of edges for gluing.
7707         #  @param theName Object name; when specified, this parameter is used
7708         #         for result publication in the study. Otherwise, if automatic
7709         #         publication is switched on, default value is used for result name.
7710         #
7711         #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7712         #
7713         #  @ref tui_glue_edges "Example"
7714         @ManageTransactions("ShapesOp")
7715         def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7716             """
7717             Replace coincident edges in theShapes by one edge
7718             in compliance with given list of edges.
7719
7720             Parameters:
7721                 theShapes Initial shapes, either a list or compound of shapes.
7722                 theTolerance Maximum distance between edges,
7723                              which can be considered as coincident.
7724                 theEdges List of edges for gluing.
7725                 theName Object name; when specified, this parameter is used
7726                         for result publication in the study. Otherwise, if automatic
7727                         publication is switched on, default value is used for result name.
7728
7729             Returns:
7730                 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7731             """
7732             anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7733             if anObj is None:
7734                 raise RuntimeError("MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode())
7735             self._autoPublish(anObj, theName, "glueEdges")
7736             return anObj
7737
7738         # end of l3_healing
7739         ## @}
7740
7741         ## @addtogroup l3_boolean Boolean Operations
7742         ## @{
7743
7744         # -----------------------------------------------------------------------------
7745         # Boolean (Common, Cut, Fuse, Section)
7746         # -----------------------------------------------------------------------------
7747
7748         ## Perform one of boolean operations on two given shapes.
7749         #  @param theShape1 First argument for boolean operation.
7750         #  @param theShape2 Second argument for boolean operation.
7751         #  @param theOperation Indicates the operation to be done:\n
7752         #                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7753         #  @param checkSelfInte The flag that tells if the arguments should
7754         #         be checked for self-intersection prior to the operation.
7755         #  @param theName Object name; when specified, this parameter is used
7756         #         for result publication in the study. Otherwise, if automatic
7757         #         publication is switched on, default value is used for result name.
7758         #
7759         #  @note This algorithm doesn't find all types of self-intersections.
7760         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7761         #        vertex/face and edge/face intersections. Face/face
7762         #        intersections detection is switched off as it is a
7763         #        time-consuming operation that gives an impact on performance.
7764         #        To find all self-intersections please use
7765         #        CheckSelfIntersections() method.
7766         #
7767         #  @return New GEOM.GEOM_Object, containing the result shape.
7768         #
7769         #  @ref tui_fuse "Example"
7770         @ManageTransactions("BoolOp")
7771         def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7772             """
7773             Perform one of boolean operations on two given shapes.
7774
7775             Parameters:
7776                 theShape1 First argument for boolean operation.
7777                 theShape2 Second argument for boolean operation.
7778                 theOperation Indicates the operation to be done:
7779                              1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7780                 checkSelfInte The flag that tells if the arguments should
7781                               be checked for self-intersection prior to
7782                               the operation.
7783                 theName Object name; when specified, this parameter is used
7784                         for result publication in the study. Otherwise, if automatic
7785                         publication is switched on, default value is used for result name.
7786
7787             Note:
7788                     This algorithm doesn't find all types of self-intersections.
7789                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7790                     vertex/face and edge/face intersections. Face/face
7791                     intersections detection is switched off as it is a
7792                     time-consuming operation that gives an impact on performance.
7793                     To find all self-intersections please use
7794                     CheckSelfIntersections() method.
7795
7796             Returns:
7797                 New GEOM.GEOM_Object, containing the result shape.
7798             """
7799             # Example: see GEOM_TestAll.py
7800             anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7801             RaiseIfFailed("MakeBoolean", self.BoolOp)
7802             def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7803             self._autoPublish(anObj, theName, def_names[theOperation])
7804             return anObj
7805
7806         ## Perform Common boolean operation on two given shapes.
7807         #  @param theShape1 First argument for boolean operation.
7808         #  @param theShape2 Second argument for boolean operation.
7809         #  @param checkSelfInte The flag that tells if the arguments should
7810         #         be checked for self-intersection prior to the operation.
7811         #  @param theName Object name; when specified, this parameter is used
7812         #         for result publication in the study. Otherwise, if automatic
7813         #         publication is switched on, default value is used for result name.
7814         #
7815         #  @note This algorithm doesn't find all types of self-intersections.
7816         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7817         #        vertex/face and edge/face intersections. Face/face
7818         #        intersections detection is switched off as it is a
7819         #        time-consuming operation that gives an impact on performance.
7820         #        To find all self-intersections please use
7821         #        CheckSelfIntersections() method.
7822         #
7823         #  @return New GEOM.GEOM_Object, containing the result shape.
7824         #
7825         #  @ref tui_common "Example 1"
7826         #  \n @ref swig_MakeCommon "Example 2"
7827         def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7828             """
7829             Perform Common boolean operation on two given shapes.
7830
7831             Parameters:
7832                 theShape1 First argument for boolean operation.
7833                 theShape2 Second argument for boolean operation.
7834                 checkSelfInte The flag that tells if the arguments should
7835                               be checked for self-intersection prior to
7836                               the operation.
7837                 theName Object name; when specified, this parameter is used
7838                         for result publication in the study. Otherwise, if automatic
7839                         publication is switched on, default value is used for result name.
7840
7841             Note:
7842                     This algorithm doesn't find all types of self-intersections.
7843                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7844                     vertex/face and edge/face intersections. Face/face
7845                     intersections detection is switched off as it is a
7846                     time-consuming operation that gives an impact on performance.
7847                     To find all self-intersections please use
7848                     CheckSelfIntersections() method.
7849
7850             Returns:
7851                 New GEOM.GEOM_Object, containing the result shape.
7852             """
7853             # Example: see GEOM_TestOthers.py
7854             # note: auto-publishing is done in self.MakeBoolean()
7855             return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7856
7857         ## Perform Cut boolean operation on two given shapes.
7858         #  @param theShape1 First argument for boolean operation.
7859         #  @param theShape2 Second argument for boolean operation.
7860         #  @param checkSelfInte The flag that tells if the arguments should
7861         #         be checked for self-intersection prior to the operation.
7862         #  @param theName Object name; when specified, this parameter is used
7863         #         for result publication in the study. Otherwise, if automatic
7864         #         publication is switched on, default value is used for result name.
7865         #
7866         #  @note This algorithm doesn't find all types of self-intersections.
7867         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7868         #        vertex/face and edge/face intersections. Face/face
7869         #        intersections detection is switched off as it is a
7870         #        time-consuming operation that gives an impact on performance.
7871         #        To find all self-intersections please use
7872         #        CheckSelfIntersections() method.
7873         #
7874         #  @return New GEOM.GEOM_Object, containing the result shape.
7875         #
7876         #  @ref tui_cut "Example 1"
7877         #  \n @ref swig_MakeCommon "Example 2"
7878         def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7879             """
7880             Perform Cut boolean operation on two given shapes.
7881
7882             Parameters:
7883                 theShape1 First argument for boolean operation.
7884                 theShape2 Second argument for boolean operation.
7885                 checkSelfInte The flag that tells if the arguments should
7886                               be checked for self-intersection prior to
7887                               the operation.
7888                 theName Object name; when specified, this parameter is used
7889                         for result publication in the study. Otherwise, if automatic
7890                         publication is switched on, default value is used for result name.
7891
7892             Note:
7893                     This algorithm doesn't find all types of self-intersections.
7894                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7895                     vertex/face and edge/face intersections. Face/face
7896                     intersections detection is switched off as it is a
7897                     time-consuming operation that gives an impact on performance.
7898                     To find all self-intersections please use
7899                     CheckSelfIntersections() method.
7900
7901             Returns:
7902                 New GEOM.GEOM_Object, containing the result shape.
7903
7904             """
7905             # Example: see GEOM_TestOthers.py
7906             # note: auto-publishing is done in self.MakeBoolean()
7907             return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7908
7909         ## Perform Fuse boolean operation on two given shapes.
7910         #  @param theShape1 First argument for boolean operation.
7911         #  @param theShape2 Second argument for boolean operation.
7912         #  @param checkSelfInte The flag that tells if the arguments should
7913         #         be checked for self-intersection prior to the operation.
7914         #  @param rmExtraEdges The flag that tells if Remove Extra Edges
7915         #         operation should be performed during the operation.
7916         #  @param theName Object name; when specified, this parameter is used
7917         #         for result publication in the study. Otherwise, if automatic
7918         #         publication is switched on, default value is used for result name.
7919         #
7920         #  @note This algorithm doesn't find all types of self-intersections.
7921         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7922         #        vertex/face and edge/face intersections. Face/face
7923         #        intersections detection is switched off as it is a
7924         #        time-consuming operation that gives an impact on performance.
7925         #        To find all self-intersections please use
7926         #        CheckSelfIntersections() method.
7927         #
7928         #  @return New GEOM.GEOM_Object, containing the result shape.
7929         #
7930         #  @ref tui_fuse "Example 1"
7931         #  \n @ref swig_MakeCommon "Example 2"
7932         @ManageTransactions("BoolOp")
7933         def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7934                      rmExtraEdges=False, theName=None):
7935             """
7936             Perform Fuse boolean operation on two given shapes.
7937
7938             Parameters:
7939                 theShape1 First argument for boolean operation.
7940                 theShape2 Second argument for boolean operation.
7941                 checkSelfInte The flag that tells if the arguments should
7942                               be checked for self-intersection prior to
7943                               the operation.
7944                 rmExtraEdges The flag that tells if Remove Extra Edges
7945                              operation should be performed during the operation.
7946                 theName Object name; when specified, this parameter is used
7947                         for result publication in the study. Otherwise, if automatic
7948                         publication is switched on, default value is used for result name.
7949
7950             Note:
7951                     This algorithm doesn't find all types of self-intersections.
7952                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7953                     vertex/face and edge/face intersections. Face/face
7954                     intersections detection is switched off as it is a
7955                     time-consuming operation that gives an impact on performance.
7956                     To find all self-intersections please use
7957                     CheckSelfIntersections() method.
7958
7959             Returns:
7960                 New GEOM.GEOM_Object, containing the result shape.
7961
7962             """
7963             # Example: see GEOM_TestOthers.py
7964             anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7965                                          checkSelfInte, rmExtraEdges)
7966             RaiseIfFailed("MakeFuse", self.BoolOp)
7967             self._autoPublish(anObj, theName, "fuse")
7968             return anObj
7969
7970         ## Perform Section boolean operation on two given shapes.
7971         #  @param theShape1 First argument for boolean operation.
7972         #  @param theShape2 Second argument for boolean operation.
7973         #  @param checkSelfInte The flag that tells if the arguments should
7974         #         be checked for self-intersection prior to the operation.
7975         #         If a self-intersection detected the operation fails.
7976         #  @param theName Object name; when specified, this parameter is used
7977         #         for result publication in the study. Otherwise, if automatic
7978         #         publication is switched on, default value is used for result name.
7979         #  @return New GEOM.GEOM_Object, containing the result shape.
7980         #
7981         #  @ref tui_section "Example 1"
7982         #  \n @ref swig_MakeCommon "Example 2"
7983         def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7984             """
7985             Perform Section boolean operation on two given shapes.
7986
7987             Parameters:
7988                 theShape1 First argument for boolean operation.
7989                 theShape2 Second argument for boolean operation.
7990                 checkSelfInte The flag that tells if the arguments should
7991                               be checked for self-intersection prior to the operation.
7992                               If a self-intersection detected the operation fails.
7993                 theName Object name; when specified, this parameter is used
7994                         for result publication in the study. Otherwise, if automatic
7995                         publication is switched on, default value is used for result name.
7996             Returns:
7997                 New GEOM.GEOM_Object, containing the result shape.
7998
7999             """
8000             # Example: see GEOM_TestOthers.py
8001             # note: auto-publishing is done in self.MakeBoolean()
8002             return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
8003
8004         ## Perform Fuse boolean operation on the list of shapes.
8005         #  @param theShapesList Shapes to be fused.
8006         #  @param checkSelfInte The flag that tells if the arguments should
8007         #         be checked for self-intersection prior to the operation.
8008         #  @param rmExtraEdges The flag that tells if Remove Extra Edges
8009         #         operation should be performed during the operation.
8010         #  @param theName Object name; when specified, this parameter is used
8011         #         for result publication in the study. Otherwise, if automatic
8012         #         publication is switched on, default value is used for result name.
8013         #
8014         #  @note This algorithm doesn't find all types of self-intersections.
8015         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8016         #        vertex/face and edge/face intersections. Face/face
8017         #        intersections detection is switched off as it is a
8018         #        time-consuming operation that gives an impact on performance.
8019         #        To find all self-intersections please use
8020         #        CheckSelfIntersections() method.
8021         #
8022         #  @return New GEOM.GEOM_Object, containing the result shape.
8023         #
8024         #  @ref tui_fuse "Example 1"
8025         #  \n @ref swig_MakeCommon "Example 2"
8026         @ManageTransactions("BoolOp")
8027         def MakeFuseList(self, theShapesList, checkSelfInte=False,
8028                          rmExtraEdges=False, theName=None):
8029             """
8030             Perform Fuse boolean operation on the list of shapes.
8031
8032             Parameters:
8033                 theShapesList Shapes to be fused.
8034                 checkSelfInte The flag that tells if the arguments should
8035                               be checked for self-intersection prior to
8036                               the operation.
8037                 rmExtraEdges The flag that tells if Remove Extra Edges
8038                              operation should be performed during the operation.
8039                 theName Object name; when specified, this parameter is used
8040                         for result publication in the study. Otherwise, if automatic
8041                         publication is switched on, default value is used for result name.
8042
8043             Note:
8044                     This algorithm doesn't find all types of self-intersections.
8045                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8046                     vertex/face and edge/face intersections. Face/face
8047                     intersections detection is switched off as it is a
8048                     time-consuming operation that gives an impact on performance.
8049                     To find all self-intersections please use
8050                     CheckSelfIntersections() method.
8051
8052             Returns:
8053                 New GEOM.GEOM_Object, containing the result shape.
8054
8055             """
8056             # Example: see GEOM_TestOthers.py
8057             anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
8058                                              rmExtraEdges)
8059             RaiseIfFailed("MakeFuseList", self.BoolOp)
8060             self._autoPublish(anObj, theName, "fuse")
8061             return anObj
8062
8063         ## Perform Common boolean operation on the list of shapes.
8064         #  @param theShapesList Shapes for Common operation.
8065         #  @param checkSelfInte The flag that tells if the arguments should
8066         #         be checked for self-intersection prior to the operation.
8067         #  @param theName Object name; when specified, this parameter is used
8068         #         for result publication in the study. Otherwise, if automatic
8069         #         publication is switched on, default value is used for result name.
8070         #
8071         #  @note This algorithm doesn't find all types of self-intersections.
8072         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8073         #        vertex/face and edge/face intersections. Face/face
8074         #        intersections detection is switched off as it is a
8075         #        time-consuming operation that gives an impact on performance.
8076         #        To find all self-intersections please use
8077         #        CheckSelfIntersections() method.
8078         #
8079         #  @return New GEOM.GEOM_Object, containing the result shape.
8080         #
8081         #  @ref tui_common "Example 1"
8082         #  \n @ref swig_MakeCommon "Example 2"
8083         @ManageTransactions("BoolOp")
8084         def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
8085             """
8086             Perform Common boolean operation on the list of shapes.
8087
8088             Parameters:
8089                 theShapesList Shapes for Common operation.
8090                 checkSelfInte The flag that tells if the arguments should
8091                               be checked for self-intersection prior to
8092                               the operation.
8093                 theName Object name; when specified, this parameter is used
8094                         for result publication in the study. Otherwise, if automatic
8095                         publication is switched on, default value is used for result name.
8096
8097             Note:
8098                     This algorithm doesn't find all types of self-intersections.
8099                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8100                     vertex/face and edge/face intersections. Face/face
8101                     intersections detection is switched off as it is a
8102                     time-consuming operation that gives an impact on performance.
8103                     To find all self-intersections please use
8104                     CheckSelfIntersections() method.
8105
8106             Returns:
8107                 New GEOM.GEOM_Object, containing the result shape.
8108
8109             """
8110             # Example: see GEOM_TestOthers.py
8111             anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
8112             RaiseIfFailed("MakeCommonList", self.BoolOp)
8113             self._autoPublish(anObj, theName, "common")
8114             return anObj
8115
8116         ## Perform Cut boolean operation on one object and the list of tools.
8117         #  @param theMainShape The object of the operation.
8118         #  @param theShapesList The list of tools of the operation.
8119         #  @param checkSelfInte The flag that tells if the arguments should
8120         #         be checked for self-intersection prior to the operation.
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         #  @note This algorithm doesn't find all types of self-intersections.
8126         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8127         #        vertex/face and edge/face intersections. Face/face
8128         #        intersections detection is switched off as it is a
8129         #        time-consuming operation that gives an impact on performance.
8130         #        To find all self-intersections please use
8131         #        CheckSelfIntersections() method.
8132         #
8133         #  @return New GEOM.GEOM_Object, containing the result shape.
8134         #
8135         #  @ref tui_cut "Example 1"
8136         #  \n @ref swig_MakeCommon "Example 2"
8137         @ManageTransactions("BoolOp")
8138         def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
8139             """
8140             Perform Cut boolean operation on one object and the list of tools.
8141
8142             Parameters:
8143                 theMainShape The object of the operation.
8144                 theShapesList The list of tools of the operation.
8145                 checkSelfInte The flag that tells if the arguments should
8146                               be checked for self-intersection prior to
8147                               the operation.
8148                 theName Object name; when specified, this parameter is used
8149                         for result publication in the study. Otherwise, if automatic
8150                         publication is switched on, default value is used for result name.
8151
8152             Note:
8153                     This algorithm doesn't find all types of self-intersections.
8154                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8155                     vertex/face and edge/face intersections. Face/face
8156                     intersections detection is switched off as it is a
8157                     time-consuming operation that gives an impact on performance.
8158                     To find all self-intersections please use
8159                     CheckSelfIntersections() method.
8160
8161             Returns:
8162                 New GEOM.GEOM_Object, containing the result shape.
8163
8164             """
8165             # Example: see GEOM_TestOthers.py
8166             anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
8167             RaiseIfFailed("MakeCutList", self.BoolOp)
8168             self._autoPublish(anObj, theName, "cut")
8169             return anObj
8170
8171         # end of l3_boolean
8172         ## @}
8173
8174         ## @addtogroup l3_basic_op
8175         ## @{
8176
8177         ## Perform partition operation.
8178         #  @param ListShapes Shapes to be intersected.
8179         #  @param ListTools Shapes to intersect theShapes.
8180         #  @param Limit Type of resulting shapes (see ShapeType()).\n
8181         #         If this parameter is set to -1 ("Auto"), most appropriate shape limit
8182         #         type will be detected automatically.
8183         #  @param KeepNonlimitShapes if this parameter == 0, then only shapes of
8184         #                             target type (equal to Limit) are kept in the result,
8185         #                             else standalone shapes of lower dimension
8186         #                             are kept also (if they exist).
8187         #
8188         #  @param theName Object name; when specified, this parameter is used
8189         #         for result publication in the study. Otherwise, if automatic
8190         #         publication is switched on, default value is used for result name.
8191         #
8192         #  @note Each compound from ListShapes and ListTools will be exploded
8193         #        in order to avoid possible intersection between shapes from this compound.
8194         #
8195         #  After implementation new version of PartitionAlgo (October 2006)
8196         #  other parameters are ignored by current functionality. They are kept
8197         #  in this function only for support old versions.
8198         #      @param ListKeepInside Shapes, outside which the results will be deleted.
8199         #         Each shape from theKeepInside must belong to theShapes also.
8200         #      @param ListRemoveInside Shapes, inside which the results will be deleted.
8201         #         Each shape from theRemoveInside must belong to theShapes also.
8202         #      @param RemoveWebs If TRUE, perform Glue 3D algorithm.
8203         #      @param ListMaterials Material indices for each shape. Make sense,
8204         #         only if theRemoveWebs is TRUE.
8205         #
8206         #  @return New GEOM.GEOM_Object, containing the result shapes.
8207         #
8208         #  @ref tui_partition "Example"
8209         @ManageTransactions("BoolOp")
8210         def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8211                           Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8212                           KeepNonlimitShapes=0, theName=None):
8213             """
8214             Perform partition operation.
8215
8216             Parameters:
8217                 ListShapes Shapes to be intersected.
8218                 ListTools Shapes to intersect theShapes.
8219                 Limit Type of resulting shapes (see geompy.ShapeType)
8220                       If this parameter is set to -1 ("Auto"), most appropriate shape limit
8221                       type will be detected automatically.
8222                 KeepNonlimitShapes if this parameter == 0, then only shapes of
8223                                     target type (equal to Limit) are kept in the result,
8224                                     else standalone shapes of lower dimension
8225                                     are kept also (if they exist).
8226
8227                 theName Object name; when specified, this parameter is used
8228                         for result publication in the study. Otherwise, if automatic
8229                         publication is switched on, default value is used for result name.
8230             Note:
8231                     Each compound from ListShapes and ListTools will be exploded
8232                     in order to avoid possible intersection between shapes from
8233                     this compound.
8234
8235             After implementation new version of PartitionAlgo (October 2006) other
8236             parameters are ignored by current functionality. They are kept in this
8237             function only for support old versions.
8238
8239             Ignored parameters:
8240                 ListKeepInside Shapes, outside which the results will be deleted.
8241                                Each shape from theKeepInside must belong to theShapes also.
8242                 ListRemoveInside Shapes, inside which the results will be deleted.
8243                                  Each shape from theRemoveInside must belong to theShapes also.
8244                 RemoveWebs If TRUE, perform Glue 3D algorithm.
8245                 ListMaterials Material indices for each shape. Make sense, only if theRemoveWebs is TRUE.
8246
8247             Returns:
8248                 New GEOM.GEOM_Object, containing the result shapes.
8249             """
8250             # Example: see GEOM_TestAll.py
8251             if Limit == self.ShapeType["AUTO"]:
8252                 # automatic detection of the most appropriate shape limit type
8253                 lim = GEOM.SHAPE
8254                 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8255                 Limit = EnumToLong(lim)
8256                 pass
8257             anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8258                                               ListKeepInside, ListRemoveInside,
8259                                               Limit, RemoveWebs, ListMaterials,
8260                                               KeepNonlimitShapes);
8261             RaiseIfFailed("MakePartition", self.BoolOp)
8262             self._autoPublish(anObj, theName, "partition")
8263             return anObj
8264
8265         ## Perform partition operation.
8266         #  This method may be useful if it is needed to make a partition for
8267         #  compound contains nonintersected shapes. Performance will be better
8268         #  since intersection between shapes from compound is not performed.
8269         #
8270         #  Description of all parameters as in previous method MakePartition().
8271         #  One additional parameter is provided:
8272         #  @param checkSelfInte The flag that tells if the arguments should
8273         #         be checked for self-intersection prior to the operation.
8274         #
8275         #  @note This algorithm doesn't find all types of self-intersections.
8276         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8277         #        vertex/face and edge/face intersections. Face/face
8278         #        intersections detection is switched off as it is a
8279         #        time-consuming operation that gives an impact on performance.
8280         #        To find all self-intersections please use
8281         #        CheckSelfIntersections() method.
8282         #
8283         #  @note Passed compounds (via ListShapes or via ListTools)
8284         #           have to consist of nonintersecting shapes.
8285         #
8286         #  @return New GEOM.GEOM_Object, containing the result shapes.
8287         #
8288         #  @ref swig_todo "Example"
8289         @ManageTransactions("BoolOp")
8290         def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8291                                                  ListKeepInside=[], ListRemoveInside=[],
8292                                                  Limit=ShapeType["AUTO"], RemoveWebs=0,
8293                                                  ListMaterials=[], KeepNonlimitShapes=0,
8294                                                  checkSelfInte=False, theName=None):
8295             """
8296             Perform partition operation.
8297             This method may be useful if it is needed to make a partition for
8298             compound contains nonintersected shapes. Performance will be better
8299             since intersection between shapes from compound is not performed.
8300
8301             Parameters:
8302                 Description of all parameters as in method geompy.MakePartition.
8303                 One additional parameter is provided:
8304                 checkSelfInte The flag that tells if the arguments should
8305                               be checked for self-intersection prior to
8306                               the operation.
8307
8308             Note:
8309                     This algorithm doesn't find all types of self-intersections.
8310                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8311                     vertex/face and edge/face intersections. Face/face
8312                     intersections detection is switched off as it is a
8313                     time-consuming operation that gives an impact on performance.
8314                     To find all self-intersections please use
8315                     CheckSelfIntersections() method.
8316
8317             NOTE:
8318                 Passed compounds (via ListShapes or via ListTools)
8319                 have to consist of nonintersecting shapes.
8320
8321             Returns:
8322                 New GEOM.GEOM_Object, containing the result shapes.
8323             """
8324             if Limit == self.ShapeType["AUTO"]:
8325                 # automatic detection of the most appropriate shape limit type
8326                 lim = GEOM.SHAPE
8327                 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8328                 Limit = EnumToLong(lim)
8329                 pass
8330             anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8331                                                                      ListKeepInside, ListRemoveInside,
8332                                                                      Limit, RemoveWebs, ListMaterials,
8333                                                                      KeepNonlimitShapes, checkSelfInte);
8334             RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8335             self._autoPublish(anObj, theName, "partition")
8336             return anObj
8337
8338         ## See method MakePartition() for more information.
8339         #
8340         #  @ref tui_partition "Example 1"
8341         #  \n @ref swig_Partition "Example 2"
8342         def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8343                       Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8344                       KeepNonlimitShapes=0, theName=None):
8345             """
8346             See method geompy.MakePartition for more information.
8347             """
8348             # Example: see GEOM_TestOthers.py
8349             # note: auto-publishing is done in self.MakePartition()
8350             anObj = self.MakePartition(ListShapes, ListTools,
8351                                        ListKeepInside, ListRemoveInside,
8352                                        Limit, RemoveWebs, ListMaterials,
8353                                        KeepNonlimitShapes, theName);
8354             return anObj
8355
8356         ## Perform partition of the Shape with the Plane
8357         #  @param theShape Shape to be intersected.
8358         #  @param thePlane Tool shape, to intersect theShape.
8359         #  @param theName Object name; when specified, this parameter is used
8360         #         for result publication in the study. Otherwise, if automatic
8361         #         publication is switched on, default value is used for result name.
8362         #
8363         #  @return New GEOM.GEOM_Object, containing the result shape.
8364         #
8365         #  @note This operation is a shortcut to the more general @ref MakePartition
8366         #  operation, where @a theShape specifies single "object" (shape being partitioned)
8367         #  and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8368         #  @ref MakePartition operation have default values:
8369         #  - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8370         #  - @a KeepNonlimitShapes: 0
8371         #  - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8372         #    @a Materials (obsolete parameters): empty
8373         #
8374         #  @note I.e. the following two operations are equivalent:
8375         #  @code
8376         #  Result = geompy.MakeHalfPartition(Object, Plane)
8377         #  Result = geompy.MakePartition([Object], [Plane])
8378         #  @endcode
8379         #
8380         #  @sa MakePartition, MakePartitionNonSelfIntersectedShape
8381         #
8382         #  @ref tui_partition "Example"
8383         @ManageTransactions("BoolOp")
8384         def MakeHalfPartition(self, theShape, thePlane, theName=None):
8385             """
8386             Perform partition of the Shape with the Plane
8387
8388             Parameters:
8389                 theShape Shape to be intersected.
8390                 thePlane Tool shape, to intersect theShape.
8391                 theName Object name; when specified, this parameter is used
8392                         for result publication in the study. Otherwise, if automatic
8393                         publication is switched on, default value is used for result name.
8394
8395             Returns:
8396                 New GEOM.GEOM_Object, containing the result shape.
8397          
8398             Note: This operation is a shortcut to the more general MakePartition
8399             operation, where theShape specifies single "object" (shape being partitioned)
8400             and thePlane specifies single "tool" (intersector shape). Other parameters of
8401             MakePartition operation have default values:
8402             - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8403             - KeepNonlimitShapes: 0
8404             - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8405          
8406             I.e. the following two operations are equivalent:
8407               Result = geompy.MakeHalfPartition(Object, Plane)
8408               Result = geompy.MakePartition([Object], [Plane])
8409             """
8410             # Example: see GEOM_TestAll.py
8411             anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8412             RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8413             self._autoPublish(anObj, theName, "partition")
8414             return anObj
8415
8416         # end of l3_basic_op
8417         ## @}
8418
8419         ## @addtogroup l3_transform
8420         ## @{
8421
8422         ## Translate the given object along the vector, specified
8423         #  by its end points.
8424         #  @param theObject The object to be translated.
8425         #  @param thePoint1 Start point of translation vector.
8426         #  @param thePoint2 End point of translation vector.
8427         #  @param theCopy Flag used to translate object itself or create a copy.
8428         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8429         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8430         @ManageTransactions("TrsfOp")
8431         def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8432             """
8433             Translate the given object along the vector, specified by its end points.
8434
8435             Parameters:
8436                 theObject The object to be translated.
8437                 thePoint1 Start point of translation vector.
8438                 thePoint2 End point of translation vector.
8439                 theCopy Flag used to translate object itself or create a copy.
8440
8441             Returns:
8442                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8443                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8444             """
8445             if theCopy:
8446                 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8447             else:
8448                 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8449             RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8450             return anObj
8451
8452         ## Translate the given object along the vector, specified
8453         #  by its end points, creating its copy before the translation.
8454         #  @param theObject The object to be translated.
8455         #  @param thePoint1 Start point of translation vector.
8456         #  @param thePoint2 End point of translation vector.
8457         #  @param theName Object name; when specified, this parameter is used
8458         #         for result publication in the study. Otherwise, if automatic
8459         #         publication is switched on, default value is used for result name.
8460         #
8461         #  @return New GEOM.GEOM_Object, containing the translated object.
8462         #
8463         #  @ref tui_translation "Example 1"
8464         #  \n @ref swig_MakeTranslationTwoPoints "Example 2"
8465         @ManageTransactions("TrsfOp")
8466         def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8467             """
8468             Translate the given object along the vector, specified
8469             by its end points, creating its copy before the translation.
8470
8471             Parameters:
8472                 theObject The object to be translated.
8473                 thePoint1 Start point of translation vector.
8474                 thePoint2 End point of translation vector.
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 translated object.
8481             """
8482             # Example: see GEOM_TestAll.py
8483             anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8484             RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8485             self._autoPublish(anObj, theName, "translated")
8486             return anObj
8487
8488         ## Translate the given object along the vector, specified by its components.
8489         #  @param theObject The object to be translated.
8490         #  @param theDX,theDY,theDZ Components of translation vector.
8491         #  @param theCopy Flag used to translate object itself or create a copy.
8492         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8493         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8494         #
8495         #  @ref tui_translation "Example"
8496         @ManageTransactions("TrsfOp")
8497         def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8498             """
8499             Translate the given object along the vector, specified by its components.
8500
8501             Parameters:
8502                 theObject The object to be translated.
8503                 theDX,theDY,theDZ Components of translation vector.
8504                 theCopy Flag used to translate object itself or create a copy.
8505
8506             Returns:
8507                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8508                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8509             """
8510             # Example: see GEOM_TestAll.py
8511             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8512             if theCopy:
8513                 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8514             else:
8515                 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8516             anObj.SetParameters(Parameters)
8517             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8518             return anObj
8519
8520         ## Translate the given object along the vector, specified
8521         #  by its components, creating its copy before the translation.
8522         #  @param theObject The object to be translated.
8523         #  @param theDX,theDY,theDZ Components of translation vector.
8524         #  @param theName Object name; when specified, this parameter is used
8525         #         for result publication in the study. Otherwise, if automatic
8526         #         publication is switched on, default value is used for result name.
8527         #
8528         #  @return New GEOM.GEOM_Object, containing the translated object.
8529         #
8530         #  @ref tui_translation "Example"
8531         @ManageTransactions("TrsfOp")
8532         def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8533             """
8534             Translate the given object along the vector, specified
8535             by its components, creating its copy before the translation.
8536
8537             Parameters:
8538                 theObject The object to be translated.
8539                 theDX,theDY,theDZ Components of translation vector.
8540                 theName Object name; when specified, this parameter is used
8541                         for result publication in the study. Otherwise, if automatic
8542                         publication is switched on, default value is used for result name.
8543
8544             Returns:
8545                 New GEOM.GEOM_Object, containing the translated object.
8546             """
8547             # Example: see GEOM_TestAll.py
8548             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8549             anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8550             anObj.SetParameters(Parameters)
8551             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8552             self._autoPublish(anObj, theName, "translated")
8553             return anObj
8554
8555         ## Translate the given object along the given vector.
8556         #  @param theObject The object to be translated.
8557         #  @param theVector The translation vector.
8558         #  @param theCopy Flag used to translate object itself or create a copy.
8559         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8560         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8561         @ManageTransactions("TrsfOp")
8562         def TranslateVector(self, theObject, theVector, theCopy=False):
8563             """
8564             Translate the given object along the given vector.
8565
8566             Parameters:
8567                 theObject The object to be translated.
8568                 theVector The translation vector.
8569                 theCopy Flag used to translate object itself or create a copy.
8570
8571             Returns:
8572                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8573                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8574             """
8575             if theCopy:
8576                 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8577             else:
8578                 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8579             RaiseIfFailed("TranslateVector", self.TrsfOp)
8580             return anObj
8581
8582         ## Translate the given object along the given vector,
8583         #  creating its copy before the translation.
8584         #  @param theObject The object to be translated.
8585         #  @param theVector The translation vector.
8586         #  @param theName Object name; when specified, this parameter is used
8587         #         for result publication in the study. Otherwise, if automatic
8588         #         publication is switched on, default value is used for result name.
8589         #
8590         #  @return New GEOM.GEOM_Object, containing the translated object.
8591         #
8592         #  @ref tui_translation "Example"
8593         @ManageTransactions("TrsfOp")
8594         def MakeTranslationVector(self, theObject, theVector, theName=None):
8595             """
8596             Translate the given object along the given vector,
8597             creating its copy before the translation.
8598
8599             Parameters:
8600                 theObject The object to be translated.
8601                 theVector The translation vector.
8602                 theName Object name; when specified, this parameter is used
8603                         for result publication in the study. Otherwise, if automatic
8604                         publication is switched on, default value is used for result name.
8605
8606             Returns:
8607                 New GEOM.GEOM_Object, containing the translated object.
8608             """
8609             # Example: see GEOM_TestAll.py
8610             anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8611             RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8612             self._autoPublish(anObj, theName, "translated")
8613             return anObj
8614
8615         ## Translate the given object along the given vector on given distance.
8616         #  @param theObject The object to be translated.
8617         #  @param theVector The translation vector.
8618         #  @param theDistance The translation distance.
8619         #  @param theCopy Flag used to translate object itself or create a copy.
8620         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8621         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8622         #
8623         #  @ref tui_translation "Example"
8624         @ManageTransactions("TrsfOp")
8625         def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8626             """
8627             Translate the given object along the given vector on given distance.
8628
8629             Parameters:
8630                 theObject The object to be translated.
8631                 theVector The translation vector.
8632                 theDistance The translation distance.
8633                 theCopy Flag used to translate object itself or create a copy.
8634
8635             Returns:
8636                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8637                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8638             """
8639             # Example: see GEOM_TestAll.py
8640             theDistance,Parameters = ParseParameters(theDistance)
8641             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8642             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8643             anObj.SetParameters(Parameters)
8644             return anObj
8645
8646         ## Translate the given object along the given vector on given distance,
8647         #  creating its copy before the translation.
8648         #  @param theObject The object to be translated.
8649         #  @param theVector The translation vector.
8650         #  @param theDistance The translation distance.
8651         #  @param theName Object name; when specified, this parameter is used
8652         #         for result publication in the study. Otherwise, if automatic
8653         #         publication is switched on, default value is used for result name.
8654         #
8655         #  @return New GEOM.GEOM_Object, containing the translated object.
8656         #
8657         #  @ref tui_translation "Example"
8658         @ManageTransactions("TrsfOp")
8659         def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8660             """
8661             Translate the given object along the given vector on given distance,
8662             creating its copy before the translation.
8663
8664             Parameters:
8665                 theObject The object to be translated.
8666                 theVector The translation vector.
8667                 theDistance The translation distance.
8668                 theName Object name; when specified, this parameter is used
8669                         for result publication in the study. Otherwise, if automatic
8670                         publication is switched on, default value is used for result name.
8671
8672             Returns:
8673                 New GEOM.GEOM_Object, containing the translated object.
8674             """
8675             # Example: see GEOM_TestAll.py
8676             theDistance,Parameters = ParseParameters(theDistance)
8677             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8678             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8679             anObj.SetParameters(Parameters)
8680             self._autoPublish(anObj, theName, "translated")
8681             return anObj
8682
8683         ## Rotate the given object around the given axis on the given angle.
8684         #  @param theObject The object to be rotated.
8685         #  @param theAxis Rotation axis.
8686         #  @param theAngle Rotation angle in radians.
8687         #  @param theCopy Flag used to rotate object itself or create a copy.
8688         #
8689         #  @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8690         #  new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8691         #
8692         #  @ref tui_rotation "Example"
8693         @ManageTransactions("TrsfOp")
8694         def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8695             """
8696             Rotate the given object around the given axis on the given angle.
8697
8698             Parameters:
8699                 theObject The object to be rotated.
8700                 theAxis Rotation axis.
8701                 theAngle Rotation angle in radians.
8702                 theCopy Flag used to rotate object itself or create a copy.
8703
8704             Returns:
8705                 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8706                 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8707             """
8708             # Example: see GEOM_TestAll.py
8709             flag = False
8710             if isinstance(theAngle,str):
8711                 flag = True
8712             theAngle, Parameters = ParseParameters(theAngle)
8713             if flag:
8714                 theAngle = theAngle*math.pi/180.0
8715             if theCopy:
8716                 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8717             else:
8718                 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8719             RaiseIfFailed("Rotate", self.TrsfOp)
8720             anObj.SetParameters(Parameters)
8721             return anObj
8722
8723         ## Rotate the given object around the given axis
8724         #  on the given angle, creating its copy before the rotation.
8725         #  @param theObject The object to be rotated.
8726         #  @param theAxis Rotation axis.
8727         #  @param theAngle Rotation angle in radians.
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 the rotated object.
8733         #
8734         #  @ref tui_rotation "Example"
8735         @ManageTransactions("TrsfOp")
8736         def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8737             """
8738             Rotate the given object around the given axis
8739             on the given angle, creating its copy before the rotatation.
8740
8741             Parameters:
8742                 theObject The object to be rotated.
8743                 theAxis Rotation axis.
8744                 theAngle Rotation angle in radians.
8745                 theName Object name; when specified, this parameter is used
8746                         for result publication in the study. Otherwise, if automatic
8747                         publication is switched on, default value is used for result name.
8748
8749             Returns:
8750                 New GEOM.GEOM_Object, containing the rotated object.
8751             """
8752             # Example: see GEOM_TestAll.py
8753             flag = False
8754             if isinstance(theAngle,str):
8755                 flag = True
8756             theAngle, Parameters = ParseParameters(theAngle)
8757             if flag:
8758                 theAngle = theAngle*math.pi/180.0
8759             anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8760             RaiseIfFailed("RotateCopy", self.TrsfOp)
8761             anObj.SetParameters(Parameters)
8762             self._autoPublish(anObj, theName, "rotated")
8763             return anObj
8764
8765         ## Rotate given object around vector perpendicular to plane
8766         #  containing three points.
8767         #  @param theObject The object to be rotated.
8768         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
8769         #  containing the three points.
8770         #  @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8771         #  @param theCopy Flag used to rotate object itself or create a copy.
8772         #  @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8773         #  new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8774         @ManageTransactions("TrsfOp")
8775         def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8776             """
8777             Rotate given object around vector perpendicular to plane
8778             containing three points.
8779
8780             Parameters:
8781                 theObject The object to be rotated.
8782                 theCentPoint central point  the axis is the vector perpendicular to the plane
8783                              containing the three points.
8784                 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8785                 theCopy Flag used to rotate object itself or create a copy.
8786
8787             Returns:
8788                 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8789                 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8790             """
8791             if theCopy:
8792                 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8793             else:
8794                 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8795             RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8796             return anObj
8797
8798         ## Rotate given object around vector perpendicular to plane
8799         #  containing three points, creating its copy before the rotatation.
8800         #  @param theObject The object to be rotated.
8801         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
8802         #  containing the three points.
8803         #  @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8804         #  @param theName Object name; when specified, this parameter is used
8805         #         for result publication in the study. Otherwise, if automatic
8806         #         publication is switched on, default value is used for result name.
8807         #
8808         #  @return New GEOM.GEOM_Object, containing the rotated object.
8809         #
8810         #  @ref tui_rotation "Example"
8811         @ManageTransactions("TrsfOp")
8812         def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8813             """
8814             Rotate given object around vector perpendicular to plane
8815             containing three points, creating its copy before the rotatation.
8816
8817             Parameters:
8818                 theObject The object to be rotated.
8819                 theCentPoint central point  the axis is the vector perpendicular to the plane
8820                              containing the three points.
8821                 thePoint1,thePoint2  in a perpendicular plane of the axis.
8822                 theName Object name; when specified, this parameter is used
8823                         for result publication in the study. Otherwise, if automatic
8824                         publication is switched on, default value is used for result name.
8825
8826             Returns:
8827                 New GEOM.GEOM_Object, containing the rotated object.
8828             """
8829             # Example: see GEOM_TestAll.py
8830             anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8831             RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8832             self._autoPublish(anObj, theName, "rotated")
8833             return anObj
8834
8835         ## Scale the given object by the specified factor.
8836         #  @param theObject The object to be scaled.
8837         #  @param thePoint Center point for scaling.
8838         #                  Passing None for it means scaling relatively the origin of global CS.
8839         #  @param theFactor Scaling factor value.
8840         #  @param theCopy Flag used to scale object itself or create a copy.
8841         #  @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8842         #  new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8843         @ManageTransactions("TrsfOp")
8844         def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8845             """
8846             Scale the given object by the specified factor.
8847
8848             Parameters:
8849                 theObject The object to be scaled.
8850                 thePoint Center point for scaling.
8851                          Passing None for it means scaling relatively the origin of global CS.
8852                 theFactor Scaling factor value.
8853                 theCopy Flag used to scale object itself or create a copy.
8854
8855             Returns:
8856                 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8857                 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8858             """
8859             # Example: see GEOM_TestAll.py
8860             theFactor, Parameters = ParseParameters(theFactor)
8861             if theCopy:
8862                 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8863             else:
8864                 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8865             RaiseIfFailed("Scale", self.TrsfOp)
8866             anObj.SetParameters(Parameters)
8867             return anObj
8868
8869         ## Scale the given object by the factor, creating its copy before the scaling.
8870         #  @param theObject The object to be scaled.
8871         #  @param thePoint Center point for scaling.
8872         #                  Passing None for it means scaling relatively the origin of global CS.
8873         #  @param theFactor Scaling factor value.
8874         #  @param theName Object name; when specified, this parameter is used
8875         #         for result publication in the study. Otherwise, if automatic
8876         #         publication is switched on, default value is used for result name.
8877         #
8878         #  @return New GEOM.GEOM_Object, containing the scaled shape.
8879         #
8880         #  @ref tui_scale "Example"
8881         @ManageTransactions("TrsfOp")
8882         def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8883             """
8884             Scale the given object by the factor, creating its copy before the scaling.
8885
8886             Parameters:
8887                 theObject The object to be scaled.
8888                 thePoint Center point for scaling.
8889                          Passing None for it means scaling relatively the origin of global CS.
8890                 theFactor Scaling factor value.
8891                 theName Object name; when specified, this parameter is used
8892                         for result publication in the study. Otherwise, if automatic
8893                         publication is switched on, default value is used for result name.
8894
8895             Returns:
8896                 New GEOM.GEOM_Object, containing the scaled shape.
8897             """
8898             # Example: see GEOM_TestAll.py
8899             theFactor, Parameters = ParseParameters(theFactor)
8900             anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8901             RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8902             anObj.SetParameters(Parameters)
8903             self._autoPublish(anObj, theName, "scaled")
8904             return anObj
8905
8906         ## Scale the given object by different factors along coordinate axes.
8907         #  @param theObject The object to be scaled.
8908         #  @param thePoint Center point for scaling.
8909         #                  Passing None for it means scaling relatively the origin of global CS.
8910         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8911         #  @param theCopy Flag used to scale object itself or create a copy.
8912         #  @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8913         #  new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8914         @ManageTransactions("TrsfOp")
8915         def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8916             """
8917             Scale the given object by different factors along coordinate axes.
8918
8919             Parameters:
8920                 theObject The object to be scaled.
8921                 thePoint Center point for scaling.
8922                             Passing None for it means scaling relatively the origin of global CS.
8923                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8924                 theCopy Flag used to scale object itself or create a copy.
8925
8926             Returns:
8927                 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8928                 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8929             """
8930             # Example: see GEOM_TestAll.py
8931             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8932             if theCopy:
8933                 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8934                                                             theFactorX, theFactorY, theFactorZ)
8935             else:
8936                 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8937                                                         theFactorX, theFactorY, theFactorZ)
8938             RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8939             anObj.SetParameters(Parameters)
8940             return anObj
8941
8942         ## Scale the given object by different factors along coordinate axes,
8943         #  creating its copy before the scaling.
8944         #  @param theObject The object to be scaled.
8945         #  @param thePoint Center point for scaling.
8946         #                  Passing None for it means scaling relatively the origin of global CS.
8947         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8948         #  @param theName Object name; when specified, this parameter is used
8949         #         for result publication in the study. Otherwise, if automatic
8950         #         publication is switched on, default value is used for result name.
8951         #
8952         #  @return New GEOM.GEOM_Object, containing the scaled shape.
8953         #
8954         #  @ref swig_scale "Example"
8955         @ManageTransactions("TrsfOp")
8956         def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8957             """
8958             Scale the given object by different factors along coordinate axes,
8959             creating its copy before the scaling.
8960
8961             Parameters:
8962                 theObject The object to be scaled.
8963                 thePoint Center point for scaling.
8964                             Passing None for it means scaling relatively the origin of global CS.
8965                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8966                 theName Object name; when specified, this parameter is used
8967                         for result publication in the study. Otherwise, if automatic
8968                         publication is switched on, default value is used for result name.
8969
8970             Returns:
8971                 New GEOM.GEOM_Object, containing the scaled shape.
8972             """
8973             # Example: see GEOM_TestAll.py
8974             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8975             anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8976                                                         theFactorX, theFactorY, theFactorZ)
8977             RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8978             anObj.SetParameters(Parameters)
8979             self._autoPublish(anObj, theName, "scaled")
8980             return anObj
8981
8982         ## Mirror an object relatively the given plane.
8983         #  @param theObject The object to be mirrored.
8984         #  @param thePlane Plane of symmetry.
8985         #  @param theCopy Flag used to mirror object itself or create a copy.
8986         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8987         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8988         @ManageTransactions("TrsfOp")
8989         def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8990             """
8991             Mirror an object relatively the given plane.
8992
8993             Parameters:
8994                 theObject The object to be mirrored.
8995                 thePlane Plane of symmetry.
8996                 theCopy Flag used to mirror object itself or create a copy.
8997
8998             Returns:
8999                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9000                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9001             """
9002             if theCopy:
9003                 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9004             else:
9005                 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
9006             RaiseIfFailed("MirrorByPlane", self.TrsfOp)
9007             return anObj
9008
9009         ## Create an object, symmetrical
9010         #  to the given one relatively the given plane.
9011         #  @param theObject The object to be mirrored.
9012         #  @param thePlane Plane of symmetry.
9013         #  @param theName Object name; when specified, this parameter is used
9014         #         for result publication in the study. Otherwise, if automatic
9015         #         publication is switched on, default value is used for result name.
9016         #
9017         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
9018         #
9019         #  @ref tui_mirror "Example"
9020         @ManageTransactions("TrsfOp")
9021         def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
9022             """
9023             Create an object, symmetrical to the given one relatively the given plane.
9024
9025             Parameters:
9026                 theObject The object to be mirrored.
9027                 thePlane Plane of symmetry.
9028                 theName Object name; when specified, this parameter is used
9029                         for result publication in the study. Otherwise, if automatic
9030                         publication is switched on, default value is used for result name.
9031
9032             Returns:
9033                 New GEOM.GEOM_Object, containing the mirrored shape.
9034             """
9035             # Example: see GEOM_TestAll.py
9036             anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9037             RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
9038             self._autoPublish(anObj, theName, "mirrored")
9039             return anObj
9040
9041         ## Mirror an object relatively the given axis.
9042         #  @param theObject The object to be mirrored.
9043         #  @param theAxis Axis of symmetry.
9044         #  @param theCopy Flag used to mirror object itself or create a copy.
9045         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9046         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9047         @ManageTransactions("TrsfOp")
9048         def MirrorByAxis(self, theObject, theAxis, theCopy=False):
9049             """
9050             Mirror an object relatively the given axis.
9051
9052             Parameters:
9053                 theObject The object to be mirrored.
9054                 theAxis Axis of symmetry.
9055                 theCopy Flag used to mirror object itself or create a copy.
9056
9057             Returns:
9058                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9059                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9060             """
9061             if theCopy:
9062                 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9063             else:
9064                 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
9065             RaiseIfFailed("MirrorByAxis", self.TrsfOp)
9066             return anObj
9067
9068         ## Create an object, symmetrical
9069         #  to the given one relatively the given axis.
9070         #  @param theObject The object to be mirrored.
9071         #  @param theAxis Axis of symmetry.
9072         #  @param theName Object name; when specified, this parameter is used
9073         #         for result publication in the study. Otherwise, if automatic
9074         #         publication is switched on, default value is used for result name.
9075         #
9076         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
9077         #
9078         #  @ref tui_mirror "Example"
9079         @ManageTransactions("TrsfOp")
9080         def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
9081             """
9082             Create an object, symmetrical to the given one relatively the given axis.
9083
9084             Parameters:
9085                 theObject The object to be mirrored.
9086                 theAxis Axis of symmetry.
9087                 theName Object name; when specified, this parameter is used
9088                         for result publication in the study. Otherwise, if automatic
9089                         publication is switched on, default value is used for result name.
9090
9091             Returns:
9092                 New GEOM.GEOM_Object, containing the mirrored shape.
9093             """
9094             # Example: see GEOM_TestAll.py
9095             anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9096             RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
9097             self._autoPublish(anObj, theName, "mirrored")
9098             return anObj
9099
9100         ## Mirror an object relatively the given point.
9101         #  @param theObject The object to be mirrored.
9102         #  @param thePoint Point of symmetry.
9103         #  @param theCopy Flag used to mirror object itself or create a copy.
9104         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9105         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9106         @ManageTransactions("TrsfOp")
9107         def MirrorByPoint(self, theObject, thePoint, theCopy=False):
9108             """
9109             Mirror an object relatively the given point.
9110
9111             Parameters:
9112                 theObject The object to be mirrored.
9113                 thePoint Point of symmetry.
9114                 theCopy Flag used to mirror object itself or create a copy.
9115
9116             Returns:
9117                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9118                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9119             """
9120             # Example: see GEOM_TestAll.py
9121             if theCopy:
9122                 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9123             else:
9124                 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
9125             RaiseIfFailed("MirrorByPoint", self.TrsfOp)
9126             return anObj
9127
9128         ## Create an object, symmetrical
9129         #  to the given one relatively the given point.
9130         #  @param theObject The object to be mirrored.
9131         #  @param thePoint Point of symmetry.
9132         #  @param theName Object name; when specified, this parameter is used
9133         #         for result publication in the study. Otherwise, if automatic
9134         #         publication is switched on, default value is used for result name.
9135         #
9136         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
9137         #
9138         #  @ref tui_mirror "Example"
9139         @ManageTransactions("TrsfOp")
9140         def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
9141             """
9142             Create an object, symmetrical
9143             to the given one relatively the given point.
9144
9145             Parameters:
9146                 theObject The object to be mirrored.
9147                 thePoint Point of symmetry.
9148                 theName Object name; when specified, this parameter is used
9149                         for result publication in the study. Otherwise, if automatic
9150                         publication is switched on, default value is used for result name.
9151
9152             Returns:
9153                 New GEOM.GEOM_Object, containing the mirrored shape.
9154             """
9155             # Example: see GEOM_TestAll.py
9156             anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9157             RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
9158             self._autoPublish(anObj, theName, "mirrored")
9159             return anObj
9160
9161         ## Modify the location of the given object.
9162         #  @param theObject The object to be displaced.
9163         #  @param theStartLCS Coordinate system to perform displacement from it.\n
9164         #                     If \a theStartLCS is NULL, displacement
9165         #                     will be performed from global CS.\n
9166         #                     If \a theObject itself is used as \a theStartLCS,
9167         #                     its location will be changed to \a theEndLCS.
9168         #  @param theEndLCS Coordinate system to perform displacement to it.
9169         #  @param theCopy Flag used to displace object itself or create a copy.
9170         #  @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9171         #  new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
9172         @ManageTransactions("TrsfOp")
9173         def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
9174             """
9175             Modify the Location of the given object by LCS, creating its copy before the setting.
9176
9177             Parameters:
9178                 theObject The object to be displaced.
9179                 theStartLCS Coordinate system to perform displacement from it.
9180                             If theStartLCS is NULL, displacement
9181                             will be performed from global CS.
9182                             If theObject itself is used as theStartLCS,
9183                             its location will be changed to theEndLCS.
9184                 theEndLCS Coordinate system to perform displacement to it.
9185                 theCopy Flag used to displace object itself or create a copy.
9186
9187             Returns:
9188                 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9189                 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
9190             """
9191             # Example: see GEOM_TestAll.py
9192             if theCopy:
9193                 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9194             else:
9195                 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
9196             RaiseIfFailed("Displace", self.TrsfOp)
9197             return anObj
9198
9199         ## Modify the Location of the given object by LCS,
9200         #  creating its copy before the setting.
9201         #  @param theObject The object to be displaced.
9202         #  @param theStartLCS Coordinate system to perform displacement from it.\n
9203         #                     If \a theStartLCS is NULL, displacement
9204         #                     will be performed from global CS.\n
9205         #                     If \a theObject itself is used as \a theStartLCS,
9206         #                     its location will be changed to \a theEndLCS.
9207         #  @param theEndLCS Coordinate system to perform displacement to it.
9208         #  @param theName Object name; when specified, this parameter is used
9209         #         for result publication in the study. Otherwise, if automatic
9210         #         publication is switched on, default value is used for result name.
9211         #
9212         #  @return New GEOM.GEOM_Object, containing the displaced shape.
9213         #
9214         #  @ref tui_modify_location "Example"
9215         @ManageTransactions("TrsfOp")
9216         def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
9217             """
9218             Modify the Location of the given object by LCS, creating its copy before the setting.
9219
9220             Parameters:
9221                 theObject The object to be displaced.
9222                 theStartLCS Coordinate system to perform displacement from it.
9223                             If theStartLCS is NULL, displacement
9224                             will be performed from global CS.
9225                             If theObject itself is used as theStartLCS,
9226                             its location will be changed to theEndLCS.
9227                 theEndLCS Coordinate system to perform displacement to it.
9228                 theName Object name; when specified, this parameter is used
9229                         for result publication in the study. Otherwise, if automatic
9230                         publication is switched on, default value is used for result name.
9231
9232             Returns:
9233                 New GEOM.GEOM_Object, containing the displaced shape.
9234
9235             Example of usage:
9236                 # create local coordinate systems
9237                 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
9238                 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
9239                 # modify the location of the given object
9240                 position = geompy.MakePosition(cylinder, cs1, cs2)
9241             """
9242             # Example: see GEOM_TestAll.py
9243             anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9244             RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
9245             self._autoPublish(anObj, theName, "displaced")
9246             return anObj
9247
9248         ## Modify the Location of the given object by Path.
9249         #  @param  theObject The object to be displaced.
9250         #  @param  thePath Wire or Edge along that the object will be translated.
9251         #  @param  theDistance progress of Path (0 = start location, 1 = end of path location).
9252         #  @param  theCopy is to create a copy objects if true.
9253         #  @param  theReverse  0 - for usual direction, 1 - to reverse path direction.
9254         #  @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9255         #          new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9256         #
9257         #  @ref tui_modify_location "Example"
9258         @ManageTransactions("TrsfOp")
9259         def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9260             """
9261             Modify the Location of the given object by Path.
9262
9263             Parameters:
9264                  theObject The object to be displaced.
9265                  thePath Wire or Edge along that the object will be translated.
9266                  theDistance progress of Path (0 = start location, 1 = end of path location).
9267                  theCopy is to create a copy objects if true.
9268                  theReverse  0 - for usual direction, 1 - to reverse path direction.
9269
9270             Returns:
9271                  Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9272                  new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9273
9274             Example of usage:
9275                 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9276             """
9277             # Example: see GEOM_TestAll.py
9278             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9279             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9280             return anObj
9281
9282         ## Modify the Location of the given object by Path, creating its copy before the operation.
9283         #  @param theObject The object to be displaced.
9284         #  @param thePath Wire or Edge along that the object will be translated.
9285         #  @param theDistance progress of Path (0 = start location, 1 = end of path location).
9286         #  @param theReverse  0 - for usual direction, 1 - to reverse path direction.
9287         #  @param theName Object name; when specified, this parameter is used
9288         #         for result publication in the study. Otherwise, if automatic
9289         #         publication is switched on, default value is used for result name.
9290         #
9291         #  @return New GEOM.GEOM_Object, containing the displaced shape.
9292         @ManageTransactions("TrsfOp")
9293         def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9294             """
9295             Modify the Location of the given object by Path, creating its copy before the operation.
9296
9297             Parameters:
9298                  theObject The object to be displaced.
9299                  thePath Wire or Edge along that the object will be translated.
9300                  theDistance progress of Path (0 = start location, 1 = end of path location).
9301                  theReverse  0 - for usual direction, 1 - to reverse path direction.
9302                  theName Object name; when specified, this parameter is used
9303                          for result publication in the study. Otherwise, if automatic
9304                          publication is switched on, default value is used for result name.
9305
9306             Returns:
9307                 New GEOM.GEOM_Object, containing the displaced shape.
9308             """
9309             # Example: see GEOM_TestAll.py
9310             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9311             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9312             self._autoPublish(anObj, theName, "displaced")
9313             return anObj
9314
9315         ## Offset given shape.
9316         #  @param theObject The base object for the offset.
9317         #  @param theOffset Offset value.
9318         #  @param theCopy Flag used to offset object itself or create a copy.
9319         #  @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9320         #  new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9321         @ManageTransactions("TrsfOp")
9322         def Offset(self, theObject, theOffset, theCopy=False):
9323             """
9324             Offset given shape.
9325
9326             Parameters:
9327                 theObject The base object for the offset.
9328                 theOffset Offset value.
9329                 theCopy Flag used to offset object itself or create a copy.
9330
9331             Returns:
9332                 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9333                 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9334             """
9335             theOffset, Parameters = ParseParameters(theOffset)
9336             if theCopy:
9337                 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset, True)
9338             else:
9339                 anObj = self.TrsfOp.OffsetShape(theObject, theOffset, True)
9340             RaiseIfFailed("Offset", self.TrsfOp)
9341             anObj.SetParameters(Parameters)
9342             return anObj
9343
9344         ## Create new object as offset of the given one. Gap between two adjacent
9345         #  offset surfaces is filled by a pipe.
9346         #  @param theObject The base object for the offset.
9347         #  @param theOffset Offset value.
9348         #  @param theName Object name; when specified, this parameter is used
9349         #         for result publication in the study. Otherwise, if automatic
9350         #         publication is switched on, default value is used for result name.
9351         #
9352         #  @return New GEOM.GEOM_Object, containing the offset object.
9353         #
9354         #  @sa MakeOffsetIntersectionJoin
9355         #  @ref tui_offset "Example"
9356         @ManageTransactions("TrsfOp")
9357         def MakeOffset(self, theObject, theOffset, theName=None):
9358             """
9359             Create new object as offset of the given one. Gap between adjacent
9360             offset surfaces is filled by a pipe.
9361
9362             Parameters:
9363                 theObject The base object for the offset.
9364                 theOffset Offset value.
9365                 theName Object name; when specified, this parameter is used
9366                         for result publication in the study. Otherwise, if automatic
9367                         publication is switched on, default value is used for result name.
9368
9369             Returns:
9370                 New GEOM.GEOM_Object, containing the offset object.
9371
9372             Example of usage:
9373                  box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9374                  # create a new object as offset of the given object
9375                  offset = geompy.MakeOffset(box, 70.)
9376             """
9377             # Example: see GEOM_TestAll.py
9378             theOffset, Parameters = ParseParameters(theOffset)
9379             anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, True )
9380             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9381             anObj.SetParameters(Parameters)
9382             self._autoPublish(anObj, theName, "offset")
9383             return anObj
9384
9385         ## Create new object as offset of the given one. Gap between adjacent
9386         #  offset surfaces is filled by extending and intersecting them.
9387         #  @param theObject The base object for the offset.
9388         #  @param theOffset Offset value.
9389         #  @param theName Object name; when specified, this parameter is used
9390         #         for result publication in the study. Otherwise, if automatic
9391         #         publication is switched on, default value is used for result name.
9392         #
9393         #  @return New GEOM.GEOM_Object, containing the offset object.
9394         #
9395         #  @sa MakeOffset
9396         #  @ref tui_offset "Example"
9397         @ManageTransactions("TrsfOp")
9398         def MakeOffsetIntersectionJoin(self, theObject, theOffset, theName=None):
9399             """
9400             Create new object as offset of the given one. Gap between adjacent
9401             offset surfaces is filled by extending and intersecting them.
9402
9403             Parameters:
9404                 theObject The base object for the offset.
9405                 theOffset Offset value.
9406                 theName Object name; when specified, this parameter is used
9407                         for result publication in the study. Otherwise, if automatic
9408                         publication is switched on, default value is used for result name.
9409
9410             Returns:
9411                 New GEOM.GEOM_Object, containing the offset object.
9412
9413             Example of usage:
9414                  box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9415                  # create a new box extended by 70
9416                  offset = geompy.MakeOffsetIntersectionJoin(box, 70.)
9417             """
9418             # Example: see GEOM_TestAll.py
9419             theOffset, Parameters = ParseParameters( theOffset )
9420             anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, False )
9421             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9422             anObj.SetParameters(Parameters)
9423             self._autoPublish(anObj, theName, "offset")
9424             return anObj
9425
9426         ## Create new object as projection of the given one on another.
9427         #  @param theSource The source object for the projection. It can be a point, edge or wire.
9428         #         Edge and wire are acceptable if @a theTarget is a face.
9429         #  @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9430         #  @param theName Object name; when specified, this parameter is used
9431         #         for result publication in the study. Otherwise, if automatic
9432         #         publication is switched on, default value is used for result name.
9433         #
9434         #  @return New GEOM.GEOM_Object, containing the projection.
9435         #
9436         #  @ref tui_projection "Example"
9437         @ManageTransactions("TrsfOp")
9438         def MakeProjection(self, theSource, theTarget, theName=None):
9439             """
9440             Create new object as projection of the given one on another.
9441
9442             Parameters:
9443                 theSource The source object for the projection. It can be a point, edge or wire.
9444                           Edge and wire are acceptable if theTarget is a face.
9445                 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9446                 theName Object name; when specified, this parameter is used
9447                         for result publication in the study. Otherwise, if automatic
9448                         publication is switched on, default value is used for result name.
9449
9450             Returns:
9451                 New GEOM.GEOM_Object, containing the projection.
9452             """
9453             # Example: see GEOM_TestAll.py
9454             anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9455             RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9456             self._autoPublish(anObj, theName, "projection")
9457             return anObj
9458
9459         ## Create a projection of the given point on a wire or an edge.
9460         #  If there are no solutions or there are 2 or more solutions It throws an
9461         #  exception.
9462         #  @param thePoint the point to be projected.
9463         #  @param theWire the wire. The edge is accepted as well.
9464         #  @param theName Object name; when specified, this parameter is used
9465         #         for result publication in the study. Otherwise, if automatic
9466         #         publication is switched on, default value is used for result name.
9467         #
9468         #  @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9469         #  \n \a u: The parameter of projection point on edge.
9470         #  \n \a PointOnEdge: The projection point.
9471         #  \n \a EdgeInWireIndex: The index of an edge in a wire.
9472         #
9473         #  @ref tui_projection "Example"
9474         @ManageTransactions("TrsfOp")
9475         def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9476             """
9477             Create a projection of the given point on a wire or an edge.
9478             If there are no solutions or there are 2 or more solutions It throws an
9479             exception.
9480
9481             Parameters:
9482                 thePoint the point to be projected.
9483                 theWire the wire. The edge is accepted as well.
9484                 theName Object name; when specified, this parameter is used
9485                         for result publication in the study. Otherwise, if automatic
9486                         publication is switched on, default value is used for result name.
9487
9488             Returns:
9489                 [u, PointOnEdge, EdgeInWireIndex]
9490                  u: The parameter of projection point on edge.
9491                  PointOnEdge: The projection point.
9492                  EdgeInWireIndex: The index of an edge in a wire.
9493             """
9494             # Example: see GEOM_TestAll.py
9495             anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9496             RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9497             self._autoPublish(anObj[1], theName, "projection")
9498             return anObj
9499
9500         # -----------------------------------------------------------------------------
9501         # Patterns
9502         # -----------------------------------------------------------------------------
9503
9504         ## Translate the given object along the given vector a given number times
9505         #  @param theObject The object to be translated.
9506         #  @param theVector Direction of the translation. DX if None.
9507         #  @param theStep Distance to translate on.
9508         #  @param theNbTimes Quantity of translations to be done.
9509         #  @param theName Object name; when specified, this parameter is used
9510         #         for result publication in the study. Otherwise, if automatic
9511         #         publication is switched on, default value is used for result name.
9512         #
9513         #  @return New GEOM.GEOM_Object, containing compound of all
9514         #          the shapes, obtained after each translation.
9515         #
9516         #  @ref tui_multi_translation "Example"
9517         @ManageTransactions("TrsfOp")
9518         def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9519             """
9520             Translate the given object along the given vector a given number times
9521
9522             Parameters:
9523                 theObject The object to be translated.
9524                 theVector Direction of the translation. DX if None.
9525                 theStep Distance to translate on.
9526                 theNbTimes Quantity of translations to be done.
9527                 theName Object name; when specified, this parameter is used
9528                         for result publication in the study. Otherwise, if automatic
9529                         publication is switched on, default value is used for result name.
9530
9531             Returns:
9532                 New GEOM.GEOM_Object, containing compound of all
9533                 the shapes, obtained after each translation.
9534
9535             Example of usage:
9536                 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9537             """
9538             # Example: see GEOM_TestAll.py
9539             theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9540             anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9541             RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9542             anObj.SetParameters(Parameters)
9543             self._autoPublish(anObj, theName, "multitranslation")
9544             return anObj
9545
9546         ## Conseqently apply two specified translations to theObject specified number of times.
9547         #  @param theObject The object to be translated.
9548         #  @param theVector1 Direction of the first translation. DX if None.
9549         #  @param theStep1 Step of the first translation.
9550         #  @param theNbTimes1 Quantity of translations to be done along theVector1.
9551         #  @param theVector2 Direction of the second translation. DY if None.
9552         #  @param theStep2 Step of the second translation.
9553         #  @param theNbTimes2 Quantity of translations to be done along theVector2.
9554         #  @param theName Object name; when specified, this parameter is used
9555         #         for result publication in the study. Otherwise, if automatic
9556         #         publication is switched on, default value is used for result name.
9557         #
9558         #  @return New GEOM.GEOM_Object, containing compound of all
9559         #          the shapes, obtained after each translation.
9560         #
9561         #  @ref tui_multi_translation "Example"
9562         @ManageTransactions("TrsfOp")
9563         def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9564                                    theVector2, theStep2, theNbTimes2, theName=None):
9565             """
9566             Conseqently apply two specified translations to theObject specified number of times.
9567
9568             Parameters:
9569                 theObject The object to be translated.
9570                 theVector1 Direction of the first translation. DX if None.
9571                 theStep1 Step of the first translation.
9572                 theNbTimes1 Quantity of translations to be done along theVector1.
9573                 theVector2 Direction of the second translation. DY if None.
9574                 theStep2 Step of the second translation.
9575                 theNbTimes2 Quantity of translations to be done along theVector2.
9576                 theName Object name; when specified, this parameter is used
9577                         for result publication in the study. Otherwise, if automatic
9578                         publication is switched on, default value is used for result name.
9579
9580             Returns:
9581                 New GEOM.GEOM_Object, containing compound of all
9582                 the shapes, obtained after each translation.
9583
9584             Example of usage:
9585                 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9586             """
9587             # Example: see GEOM_TestAll.py
9588             theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9589             anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9590                                                  theVector2, theStep2, theNbTimes2)
9591             RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9592             anObj.SetParameters(Parameters)
9593             self._autoPublish(anObj, theName, "multitranslation")
9594             return anObj
9595
9596         ## Rotate the given object around the given axis a given number times.
9597         #  Rotation angle will be 2*PI/theNbTimes.
9598         #  @param theObject The object to be rotated.
9599         #  @param theAxis The rotation axis. DZ if None.
9600         #  @param theNbTimes Quantity of rotations to be done.
9601         #  @param theName Object name; when specified, this parameter is used
9602         #         for result publication in the study. Otherwise, if automatic
9603         #         publication is switched on, default value is used for result name.
9604         #
9605         #  @return New GEOM.GEOM_Object, containing compound of all the
9606         #          shapes, obtained after each rotation.
9607         #
9608         #  @ref tui_multi_rotation "Example"
9609         @ManageTransactions("TrsfOp")
9610         def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9611             """
9612             Rotate the given object around the given axis a given number times.
9613             Rotation angle will be 2*PI/theNbTimes.
9614
9615             Parameters:
9616                 theObject The object to be rotated.
9617                 theAxis The rotation axis. DZ if None.
9618                 theNbTimes Quantity of rotations to be done.
9619                 theName Object name; when specified, this parameter is used
9620                         for result publication in the study. Otherwise, if automatic
9621                         publication is switched on, default value is used for result name.
9622
9623             Returns:
9624                 New GEOM.GEOM_Object, containing compound of all the
9625                 shapes, obtained after each rotation.
9626
9627             Example of usage:
9628                 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9629             """
9630             # Example: see GEOM_TestAll.py
9631             theNbTimes, Parameters = ParseParameters(theNbTimes)
9632             anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9633             RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9634             anObj.SetParameters(Parameters)
9635             self._autoPublish(anObj, theName, "multirotation")
9636             return anObj
9637
9638         ## Rotate the given object around the given axis
9639         #  a given number times on the given angle.
9640         #  @param theObject The object to be rotated.
9641         #  @param theAxis The rotation axis. DZ if None.
9642         #  @param theAngleStep Rotation angle in radians.
9643         #  @param theNbTimes Quantity of rotations to be done.
9644         #  @param theName Object name; when specified, this parameter is used
9645         #         for result publication in the study. Otherwise, if automatic
9646         #         publication is switched on, default value is used for result name.
9647         #
9648         #  @return New GEOM.GEOM_Object, containing compound of all the
9649         #          shapes, obtained after each rotation.
9650         #
9651         #  @ref tui_multi_rotation "Example"
9652         @ManageTransactions("TrsfOp")
9653         def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9654             """
9655             Rotate the given object around the given axis
9656             a given number times on the given angle.
9657
9658             Parameters:
9659                 theObject The object to be rotated.
9660                 theAxis The rotation axis. DZ if None.
9661                 theAngleStep Rotation angle in radians.
9662                 theNbTimes Quantity of rotations to be done.
9663                 theName Object name; when specified, this parameter is used
9664                         for result publication in the study. Otherwise, if automatic
9665                         publication is switched on, default value is used for result name.
9666
9667             Returns:
9668                 New GEOM.GEOM_Object, containing compound of all the
9669                 shapes, obtained after each rotation.
9670
9671             Example of usage:
9672                 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9673             """
9674             # Example: see GEOM_TestAll.py
9675             theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9676             anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9677             RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9678             anObj.SetParameters(Parameters)
9679             self._autoPublish(anObj, theName, "multirotation")
9680             return anObj
9681
9682         ## Rotate the given object around the given axis a given
9683         #  number times and multi-translate each rotation result.
9684         #  Rotation angle will be 2*PI/theNbTimes1.
9685         #  Translation direction passes through center of gravity
9686         #  of rotated shape and its projection on the rotation axis.
9687         #  @param theObject The object to be rotated.
9688         #  @param theAxis Rotation axis. DZ if None.
9689         #  @param theNbTimes1 Quantity of rotations to be done.
9690         #  @param theRadialStep Translation distance.
9691         #  @param theNbTimes2 Quantity of translations to be done.
9692         #  @param theName Object name; when specified, this parameter is used
9693         #         for result publication in the study. Otherwise, if automatic
9694         #         publication is switched on, default value is used for result name.
9695         #
9696         #  @return New GEOM.GEOM_Object, containing compound of all the
9697         #          shapes, obtained after each transformation.
9698         #
9699         #  @ref tui_multi_rotation "Example"
9700         @ManageTransactions("TrsfOp")
9701         def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9702             """
9703             Rotate the given object around the
9704             given axis on the given angle a given number
9705             times and multi-translate each rotation result.
9706             Translation direction passes through center of gravity
9707             of rotated shape and its projection on the rotation axis.
9708
9709             Parameters:
9710                 theObject The object to be rotated.
9711                 theAxis Rotation axis. DZ if None.
9712                 theNbTimes1 Quantity of rotations to be done.
9713                 theRadialStep Translation distance.
9714                 theNbTimes2 Quantity of translations to be done.
9715                 theName Object name; when specified, this parameter is used
9716                         for result publication in the study. Otherwise, if automatic
9717                         publication is switched on, default value is used for result name.
9718
9719             Returns:
9720                 New GEOM.GEOM_Object, containing compound of all the
9721                 shapes, obtained after each transformation.
9722
9723             Example of usage:
9724                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9725             """
9726             # Example: see GEOM_TestAll.py
9727             theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9728             anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9729             RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9730             anObj.SetParameters(Parameters)
9731             self._autoPublish(anObj, theName, "multirotation")
9732             return anObj
9733
9734         ## Rotate the given object around the
9735         #  given axis on the given angle a given number
9736         #  times and multi-translate each rotation result.
9737         #  Translation direction passes through center of gravity
9738         #  of rotated shape and its projection on the rotation axis.
9739         #  @param theObject The object to be rotated.
9740         #  @param theAxis Rotation axis. DZ if None.
9741         #  @param theAngleStep Rotation angle in radians.
9742         #  @param theNbTimes1 Quantity of rotations to be done.
9743         #  @param theRadialStep Translation distance.
9744         #  @param theNbTimes2 Quantity of translations to be done.
9745         #  @param theName Object name; when specified, this parameter is used
9746         #         for result publication in the study. Otherwise, if automatic
9747         #         publication is switched on, default value is used for result name.
9748         #
9749         #  @return New GEOM.GEOM_Object, containing compound of all the
9750         #          shapes, obtained after each transformation.
9751         #
9752         #  @ref tui_multi_rotation "Example"
9753         @ManageTransactions("TrsfOp")
9754         def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9755             """
9756             Rotate the given object around the
9757             given axis on the given angle a given number
9758             times and multi-translate each rotation result.
9759             Translation direction passes through center of gravity
9760             of rotated shape and its projection on the rotation axis.
9761
9762             Parameters:
9763                 theObject The object to be rotated.
9764                 theAxis Rotation axis. DZ if None.
9765                 theAngleStep Rotation angle in radians.
9766                 theNbTimes1 Quantity of rotations to be done.
9767                 theRadialStep Translation distance.
9768                 theNbTimes2 Quantity of translations to be done.
9769                 theName Object name; when specified, this parameter is used
9770                         for result publication in the study. Otherwise, if automatic
9771                         publication is switched on, default value is used for result name.
9772
9773             Returns:
9774                 New GEOM.GEOM_Object, containing compound of all the
9775                 shapes, obtained after each transformation.
9776
9777             Example of usage:
9778                 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9779             """
9780             # Example: see GEOM_TestAll.py
9781             theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9782             anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9783             RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9784             anObj.SetParameters(Parameters)
9785             self._autoPublish(anObj, theName, "multirotation")
9786             return anObj
9787
9788         ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9789         #
9790         #  @ref swig_MakeMultiRotation "Example"
9791         def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9792             """
9793             The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9794
9795             Example of usage:
9796                 pz = geompy.MakeVertex(0, 0, 100)
9797                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9798                 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9799             """
9800             # Example: see GEOM_TestOthers.py
9801             aVec = self.MakeLine(aPoint,aDir)
9802             # note: auto-publishing is done in self.MultiRotate1D()
9803             anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9804             return anObj
9805
9806         ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9807         #
9808         #  @ref swig_MakeMultiRotation "Example"
9809         def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9810             """
9811             The same, as geompy.MultiRotate1D, but axis is given by direction and point
9812
9813             Example of usage:
9814                 pz = geompy.MakeVertex(0, 0, 100)
9815                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9816                 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9817             """
9818             # Example: see GEOM_TestOthers.py
9819             aVec = self.MakeLine(aPoint,aDir)
9820             # note: auto-publishing is done in self.MultiRotate1D()
9821             anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9822             return anObj
9823
9824         ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9825         #
9826         #  @ref swig_MakeMultiRotation "Example"
9827         def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9828             """
9829             The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9830
9831             Example of usage:
9832                 pz = geompy.MakeVertex(0, 0, 100)
9833                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9834                 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9835             """
9836             # Example: see GEOM_TestOthers.py
9837             aVec = self.MakeLine(aPoint,aDir)
9838             # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9839             anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9840             return anObj
9841
9842         ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9843         #
9844         #  @ref swig_MakeMultiRotation "Example"
9845         def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9846             """
9847             The same, as MultiRotate2DByStep(), but axis is given by direction and point
9848
9849             Example of usage:
9850                 pz = geompy.MakeVertex(0, 0, 100)
9851                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9852                 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9853             """
9854             # Example: see GEOM_TestOthers.py
9855             aVec = self.MakeLine(aPoint,aDir)
9856             # note: auto-publishing is done in self.MultiRotate2D()
9857             anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9858             return anObj
9859
9860         ##
9861         #  Compute a wire or a face that represents a projection of the source
9862         #  shape onto cylinder. The cylinder's coordinate system is the same
9863         #  as the global coordinate system.
9864         #
9865         #  @param theObject The object to be projected. It can be either
9866         #         a planar wire or a face.
9867         #  @param theRadius The radius of the cylinder.
9868         #  @param theStartAngle The starting angle in radians from
9869         #         the cylinder's X axis around Z axis. The angle from which
9870         #         the projection is started.
9871         #  @param theAngleLength The projection length angle in radians.
9872         #         The angle in which to project the total length of the wire.
9873         #         If it is negative the projection is not scaled and natural
9874         #         wire length is kept for the projection.
9875         #  @param theAngleRotation The desired angle in radians between
9876         #         the tangent vector to the first curve at the first point of
9877         #         the theObject's projection in 2D space and U-direction of
9878         #         cylinder's 2D space.
9879         #  @param theName Object name; when specified, this parameter is used
9880         #         for result publication in the study. Otherwise, if automatic
9881         #         publication is switched on, default value is used for result name.
9882         #
9883         #  @return New GEOM.GEOM_Object, containing the result shape. The result
9884         #         represents a wire or a face that represents a projection of
9885         #         the source shape onto a cylinder.
9886         #
9887         #  @ref tui_projection "Example"
9888         def MakeProjectionOnCylinder (self, theObject, theRadius,
9889                                       theStartAngle=0.0, theAngleLength=-1.0,
9890                                       theAngleRotation=0.0,
9891                                       theName=None):
9892             """
9893             Compute a wire or a face that represents a projection of the source
9894             shape onto cylinder. The cylinder's coordinate system is the same
9895             as the global coordinate system.
9896
9897             Parameters:
9898                 theObject The object to be projected. It can be either
9899                         a planar wire or a face.
9900                 theRadius The radius of the cylinder.
9901                 theStartAngle The starting angle in radians from the cylinder's X axis
9902                         around Z axis. The angle from which the projection is started.
9903                 theAngleLength The projection length angle in radians. The angle in which
9904                         to project the total length of the wire. If it is negative the
9905                         projection is not scaled and natural wire length is kept for
9906                         the projection.
9907                 theAngleRotation The desired angle in radians between
9908                         the tangent vector to the first curve at the first
9909                         point of the theObject's projection in 2D space and
9910                         U-direction of cylinder's 2D space.
9911                 theName Object name; when specified, this parameter is used
9912                         for result publication in the study. Otherwise, if automatic
9913                         publication is switched on, default value is used for result name.
9914
9915             Returns:
9916                 New GEOM.GEOM_Object, containing the result shape. The result
9917                 represents a wire or a face that represents a projection of
9918                 the source shape onto a cylinder.
9919             """
9920             # Example: see GEOM_TestAll.py
9921             flagStartAngle = False
9922             if isinstance(theStartAngle,str):
9923                 flagStartAngle = True
9924             flagAngleLength = False
9925             if isinstance(theAngleLength,str):
9926                 flagAngleLength = True
9927             flagAngleRotation = False
9928             if isinstance(theAngleRotation,str):
9929                 flagAngleRotation = True
9930             theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
9931               theRadius, theStartAngle, theAngleLength, theAngleRotation)
9932             if flagStartAngle:
9933                 theStartAngle = theStartAngle*math.pi/180.
9934             if flagAngleLength:
9935                 theAngleLength = theAngleLength*math.pi/180.
9936             if flagAngleRotation:
9937                 theAngleRotation = theAngleRotation*math.pi/180.
9938             anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9939                 theStartAngle, theAngleLength, theAngleRotation)
9940             RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9941             anObj.SetParameters(Parameters)
9942             self._autoPublish(anObj, theName, "projection")
9943             return anObj
9944
9945         # end of l3_transform
9946         ## @}
9947
9948         ## @addtogroup l3_transform_d
9949         ## @{
9950
9951         ## Deprecated method. Use MultiRotate1DNbTimes instead.
9952         def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9953             """
9954             Deprecated method. Use MultiRotate1DNbTimes instead.
9955             """
9956             print("The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead.")
9957             return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9958
9959         ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9960         #  This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9961         @ManageTransactions("TrsfOp")
9962         def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9963             """
9964             The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9965             This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9966
9967             Example of usage:
9968                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9969             """
9970             print("The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead.")
9971             theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9972             anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9973             RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9974             anObj.SetParameters(Parameters)
9975             self._autoPublish(anObj, theName, "multirotation")
9976             return anObj
9977
9978         ## The same, as MultiRotate1D(), but axis is given by direction and point
9979         #  This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9980         def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9981             """
9982             The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9983             This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9984
9985             Example of usage:
9986                 pz = geompy.MakeVertex(0, 0, 100)
9987                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9988                 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9989             """
9990             print("The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.")
9991             aVec = self.MakeLine(aPoint,aDir)
9992             # note: auto-publishing is done in self.MultiRotate1D()
9993             anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9994             return anObj
9995
9996         ## The same, as MultiRotate2D(), but axis is given by direction and point
9997         #  This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9998         def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9999             """
10000             The same, as MultiRotate2D(), but axis is given by direction and point
10001             This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
10002
10003             Example of usage:
10004                 pz = geompy.MakeVertex(0, 0, 100)
10005                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
10006                 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
10007             """
10008             print("The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead.")
10009             aVec = self.MakeLine(aPoint,aDir)
10010             # note: auto-publishing is done in self.MultiRotate2D()
10011             anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
10012             return anObj
10013
10014         # end of l3_transform_d
10015         ## @}
10016
10017         ## @addtogroup l3_local
10018         ## @{
10019
10020         ## Perform a fillet on all edges of the given shape.
10021         #  @param theShape Shape, to perform fillet on.
10022         #  @param theR Fillet radius.
10023         #  @param theName Object name; when specified, this parameter is used
10024         #         for result publication in the study. Otherwise, if automatic
10025         #         publication is switched on, default value is used for result name.
10026         #
10027         #  @return New GEOM.GEOM_Object, containing the result shape.
10028         #
10029         #  @ref tui_fillet "Example 1"
10030         #  \n @ref swig_MakeFilletAll "Example 2"
10031         @ManageTransactions("LocalOp")
10032         def MakeFilletAll(self, theShape, theR, theName=None):
10033             """
10034             Perform a fillet on all edges of the given shape.
10035
10036             Parameters:
10037                 theShape Shape, to perform fillet on.
10038                 theR Fillet radius.
10039                 theName Object name; when specified, this parameter is used
10040                         for result publication in the study. Otherwise, if automatic
10041                         publication is switched on, default value is used for result name.
10042
10043             Returns:
10044                 New GEOM.GEOM_Object, containing the result shape.
10045
10046             Example of usage:
10047                filletall = geompy.MakeFilletAll(prism, 10.)
10048             """
10049             # Example: see GEOM_TestOthers.py
10050             theR,Parameters = ParseParameters(theR)
10051             anObj = self.LocalOp.MakeFilletAll(theShape, theR)
10052             RaiseIfFailed("MakeFilletAll", self.LocalOp)
10053             anObj.SetParameters(Parameters)
10054             self._autoPublish(anObj, theName, "fillet")
10055             return anObj
10056
10057         ## Perform a fillet on the specified edges/faces of the given shape
10058         #  @param theShape Shape, to perform fillet on.
10059         #  @param theR Fillet radius.
10060         #  @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
10061         #  @param theListShapes Global indices of edges/faces to perform fillet on.
10062         #  @param theName Object name; when specified, this parameter is used
10063         #         for result publication in the study. Otherwise, if automatic
10064         #         publication is switched on, default value is used for result name.
10065         #
10066         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10067         #
10068         #  @return New GEOM.GEOM_Object, containing the result shape.
10069         #
10070         #  @ref tui_fillet "Example"
10071         @ManageTransactions("LocalOp")
10072         def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
10073             """
10074             Perform a fillet on the specified edges/faces of the given shape
10075
10076             Parameters:
10077                 theShape Shape, to perform fillet on.
10078                 theR Fillet radius.
10079                 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
10080                 theListShapes Global indices of edges/faces to perform fillet on.
10081                 theName Object name; when specified, this parameter is used
10082                         for result publication in the study. Otherwise, if automatic
10083                         publication is switched on, default value is used for result name.
10084
10085             Note:
10086                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10087
10088             Returns:
10089                 New GEOM.GEOM_Object, containing the result shape.
10090
10091             Example of usage:
10092                 # get the list of IDs (IDList) for the fillet
10093                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10094                 IDlist_e = []
10095                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10096                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10097                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10098                 # make a fillet on the specified edges of the given shape
10099                 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
10100             """
10101             # Example: see GEOM_TestAll.py
10102             theR,Parameters = ParseParameters(theR)
10103             anObj = None
10104             if theShapeType == self.ShapeType["EDGE"]:
10105                 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
10106                 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
10107             else:
10108                 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
10109                 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
10110             anObj.SetParameters(Parameters)
10111             self._autoPublish(anObj, theName, "fillet")
10112             return anObj
10113
10114         ## The same that MakeFillet() but with two Fillet Radius R1 and R2
10115         @ManageTransactions("LocalOp")
10116         def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
10117             """
10118             The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
10119
10120             Example of usage:
10121                 # get the list of IDs (IDList) for the fillet
10122                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10123                 IDlist_e = []
10124                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10125                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10126                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10127                 # make a fillet on the specified edges of the given shape
10128                 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
10129             """
10130             theR1,theR2,Parameters = ParseParameters(theR1,theR2)
10131             anObj = None
10132             if theShapeType == self.ShapeType["EDGE"]:
10133                 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
10134                 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
10135             else:
10136                 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
10137                 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
10138             anObj.SetParameters(Parameters)
10139             self._autoPublish(anObj, theName, "fillet")
10140             return anObj
10141
10142         ## Perform a fillet on the specified edges of the given shape
10143         #  @param theShape  Wire Shape to perform fillet on.
10144         #  @param theR  Fillet radius.
10145         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
10146         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID()
10147         #    \note The list of vertices could be empty,
10148         #          in this case fillet will done done at all vertices in wire
10149         #  @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
10150         #         by the length of the edges, nearest to the fillet vertex.
10151         #         But sometimes the next edge is C1 continuous with the one, nearest to
10152         #         the fillet point, and such two (or more) edges can be united to allow
10153         #         bigger radius. Set this flag to TRUE to allow collinear edges union,
10154         #         thus ignoring the secant vertex (vertices).
10155         #  @param theName Object name; when specified, this parameter is used
10156         #         for result publication in the study. Otherwise, if automatic
10157         #         publication is switched on, default value is used for result name.
10158         #
10159         #  @return New GEOM.GEOM_Object, containing the result shape.
10160         #
10161         #  @ref tui_fillet2d "Example"
10162         @ManageTransactions("LocalOp")
10163         def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
10164             """
10165             Perform a fillet on the specified edges of the given shape
10166
10167             Parameters:
10168                 theShape  Wire Shape to perform fillet on.
10169                 theR  Fillet radius.
10170                 theListOfVertexes Global indices of vertexes to perform fillet on.
10171                 doIgnoreSecantVertices If FALSE, fillet radius is always limited
10172                     by the length of the edges, nearest to the fillet vertex.
10173                     But sometimes the next edge is C1 continuous with the one, nearest to
10174                     the fillet point, and such two (or more) edges can be united to allow
10175                     bigger radius. Set this flag to TRUE to allow collinear edges union,
10176                     thus ignoring the secant vertex (vertices).
10177                 theName Object name; when specified, this parameter is used
10178                         for result publication in the study. Otherwise, if automatic
10179                         publication is switched on, default value is used for result name.
10180             Note:
10181                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10182
10183                 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
10184
10185             Returns:
10186                 New GEOM.GEOM_Object, containing the result shape.
10187
10188             Example of usage:
10189                 # create wire
10190                 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
10191                 # make fillet at given wire vertices with giver radius
10192                 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
10193             """
10194             # Example: see GEOM_TestAll.py
10195             theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
10196             anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
10197             RaiseIfFailed("MakeFillet1D", self.LocalOp)
10198             anObj.SetParameters(Parameters)
10199             self._autoPublish(anObj, theName, "fillet")
10200             return anObj
10201
10202         ## Perform a fillet at the specified vertices of the given face/shell.
10203         #  @param theShape Face or Shell shape to perform fillet on.
10204         #  @param theR Fillet radius.
10205         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
10206         #  @param theName Object name; when specified, this parameter is used
10207         #         for result publication in the study. Otherwise, if automatic
10208         #         publication is switched on, default value is used for result name.
10209         #
10210         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10211         #
10212         #  @return New GEOM.GEOM_Object, containing the result shape.
10213         #
10214         #  @ref tui_fillet2d "Example"
10215         @ManageTransactions("LocalOp")
10216         def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
10217             """
10218             Perform a fillet at the specified vertices of the given face/shell.
10219
10220             Parameters:
10221                 theShape  Face or Shell shape to perform fillet on.
10222                 theR  Fillet radius.
10223                 theListOfVertexes Global indices of vertexes to perform fillet on.
10224                 theName Object name; when specified, this parameter is used
10225                         for result publication in the study. Otherwise, if automatic
10226                         publication is switched on, default value is used for result name.
10227             Note:
10228                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10229
10230             Returns:
10231                 New GEOM.GEOM_Object, containing the result shape.
10232
10233             Example of usage:
10234                 face = geompy.MakeFaceHW(100, 100, 1)
10235                 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
10236             """
10237             # Example: see GEOM_TestAll.py
10238             theR,Parameters = ParseParameters(theR)
10239             anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
10240             RaiseIfFailed("MakeFillet2D", self.LocalOp)
10241             anObj.SetParameters(Parameters)
10242             self._autoPublish(anObj, theName, "fillet")
10243             return anObj
10244
10245         ## Perform a symmetric chamfer on all edges of the given shape.
10246         #  @param theShape Shape, to perform chamfer on.
10247         #  @param theD Chamfer size along each face.
10248         #  @param theName Object name; when specified, this parameter is used
10249         #         for result publication in the study. Otherwise, if automatic
10250         #         publication is switched on, default value is used for result name.
10251         #
10252         #  @return New GEOM.GEOM_Object, containing the result shape.
10253         #
10254         #  @ref tui_chamfer "Example 1"
10255         #  \n @ref swig_MakeChamferAll "Example 2"
10256         @ManageTransactions("LocalOp")
10257         def MakeChamferAll(self, theShape, theD, theName=None):
10258             """
10259             Perform a symmetric chamfer on all edges of the given shape.
10260
10261             Parameters:
10262                 theShape Shape, to perform chamfer on.
10263                 theD Chamfer size along each face.
10264                 theName Object name; when specified, this parameter is used
10265                         for result publication in the study. Otherwise, if automatic
10266                         publication is switched on, default value is used for result name.
10267
10268             Returns:
10269                 New GEOM.GEOM_Object, containing the result shape.
10270
10271             Example of usage:
10272                 chamfer_all = geompy.MakeChamferAll(prism, 10.)
10273             """
10274             # Example: see GEOM_TestOthers.py
10275             theD,Parameters = ParseParameters(theD)
10276             anObj = self.LocalOp.MakeChamferAll(theShape, theD)
10277             RaiseIfFailed("MakeChamferAll", self.LocalOp)
10278             anObj.SetParameters(Parameters)
10279             self._autoPublish(anObj, theName, "chamfer")
10280             return anObj
10281
10282         ## Perform a chamfer on edges, common to the specified faces,
10283         #  with distance D1 on the Face1
10284         #  @param theShape Shape, to perform chamfer on.
10285         #  @param theD1 Chamfer size along \a theFace1.
10286         #  @param theD2 Chamfer size along \a theFace2.
10287         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
10288         #  @param theName Object name; when specified, this parameter is used
10289         #         for result publication in the study. Otherwise, if automatic
10290         #         publication is switched on, default value is used for result name.
10291         #
10292         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10293         #
10294         #  @return New GEOM.GEOM_Object, containing the result shape.
10295         #
10296         #  @ref tui_chamfer "Example"
10297         @ManageTransactions("LocalOp")
10298         def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
10299             """
10300             Perform a chamfer on edges, common to the specified faces,
10301             with distance D1 on the Face1
10302
10303             Parameters:
10304                 theShape Shape, to perform chamfer on.
10305                 theD1 Chamfer size along theFace1.
10306                 theD2 Chamfer size along theFace2.
10307                 theFace1,theFace2 Global indices of two faces of theShape.
10308                 theName Object name; when specified, this parameter is used
10309                         for result publication in the study. Otherwise, if automatic
10310                         publication is switched on, default value is used for result name.
10311
10312             Note:
10313                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10314
10315             Returns:
10316                 New GEOM.GEOM_Object, containing the result shape.
10317
10318             Example of usage:
10319                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10320                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10321                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10322                 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10323             """
10324             # Example: see GEOM_TestAll.py
10325             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10326             anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10327             RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10328             anObj.SetParameters(Parameters)
10329             self._autoPublish(anObj, theName, "chamfer")
10330             return anObj
10331
10332         ## Perform a chamfer on edges
10333         #  @param theShape Shape, to perform chamfer on.
10334         #  @param theD Chamfer length
10335         #  @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10336         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
10337         #  @param theName Object name; when specified, this parameter is used
10338         #         for result publication in the study. Otherwise, if automatic
10339         #         publication is switched on, default value is used for result name.
10340         #
10341         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10342         #
10343         #  @return New GEOM.GEOM_Object, containing the result shape.
10344         @ManageTransactions("LocalOp")
10345         def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10346             """
10347             Perform a chamfer on edges
10348
10349             Parameters:
10350                 theShape Shape, to perform chamfer on.
10351                 theD1 Chamfer size along theFace1.
10352                 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10353                 theFace1,theFace2 Global indices of two faces of theShape.
10354                 theName Object name; when specified, this parameter is used
10355                         for result publication in the study. Otherwise, if automatic
10356                         publication is switched on, default value is used for result name.
10357
10358             Note:
10359                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10360
10361             Returns:
10362                 New GEOM.GEOM_Object, containing the result shape.
10363
10364             Example of usage:
10365                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10366                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10367                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10368                 ang = 30
10369                 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10370             """
10371             flag = False
10372             if isinstance(theAngle,str):
10373                 flag = True
10374             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10375             if flag:
10376                 theAngle = theAngle*math.pi/180.0
10377             anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10378             RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10379             anObj.SetParameters(Parameters)
10380             self._autoPublish(anObj, theName, "chamfer")
10381             return anObj
10382
10383         ## Perform a chamfer on all edges of the specified faces,
10384         #  with distance D1 on the first specified face (if several for one edge)
10385         #  @param theShape Shape, to perform chamfer on.
10386         #  @param theD1 Chamfer size along face from \a theFaces. If both faces,
10387         #               connected to the edge, are in \a theFaces, \a theD1
10388         #               will be get along face, which is nearer to \a theFaces beginning.
10389         #  @param theD2 Chamfer size along another of two faces, connected to the edge.
10390         #  @param theFaces Sequence of global indices of faces of \a theShape.
10391         #  @param theName Object name; when specified, this parameter is used
10392         #         for result publication in the study. Otherwise, if automatic
10393         #         publication is switched on, default value is used for result name.
10394         #
10395         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10396         #
10397         #  @return New GEOM.GEOM_Object, containing the result shape.
10398         #
10399         #  @ref tui_chamfer "Example"
10400         @ManageTransactions("LocalOp")
10401         def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10402             """
10403             Perform a chamfer on all edges of the specified faces,
10404             with distance D1 on the first specified face (if several for one edge)
10405
10406             Parameters:
10407                 theShape Shape, to perform chamfer on.
10408                 theD1 Chamfer size along face from  theFaces. If both faces,
10409                       connected to the edge, are in theFaces, theD1
10410                       will be get along face, which is nearer to theFaces beginning.
10411                 theD2 Chamfer size along another of two faces, connected to the edge.
10412                 theFaces Sequence of global indices of faces of theShape.
10413                 theName Object name; when specified, this parameter is used
10414                         for result publication in the study. Otherwise, if automatic
10415                         publication is switched on, default value is used for result name.
10416
10417             Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10418
10419             Returns:
10420                 New GEOM.GEOM_Object, containing the result shape.
10421             """
10422             # Example: see GEOM_TestAll.py
10423             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10424             anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10425             RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10426             anObj.SetParameters(Parameters)
10427             self._autoPublish(anObj, theName, "chamfer")
10428             return anObj
10429
10430         ## The Same that MakeChamferFaces() but with params theD is chamfer length and
10431         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10432         #
10433         #  @ref swig_FilletChamfer "Example"
10434         @ManageTransactions("LocalOp")
10435         def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10436             """
10437             The Same that geompy.MakeChamferFaces but with params theD is chamfer length and
10438             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10439             """
10440             flag = False
10441             if isinstance(theAngle,str):
10442                 flag = True
10443             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10444             if flag:
10445                 theAngle = theAngle*math.pi/180.0
10446             anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10447             RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10448             anObj.SetParameters(Parameters)
10449             self._autoPublish(anObj, theName, "chamfer")
10450             return anObj
10451
10452         ## Perform a chamfer on edges,
10453         #  with distance D1 on the first specified face (if several for one edge)
10454         #  @param theShape Shape, to perform chamfer on.
10455         #  @param theD1,theD2 Chamfer size
10456         #  @param theEdges Sequence of edges of \a theShape.
10457         #  @param theName Object name; when specified, this parameter is used
10458         #         for result publication in the study. Otherwise, if automatic
10459         #         publication is switched on, default value is used for result name.
10460         #
10461         #  @return New GEOM.GEOM_Object, containing the result shape.
10462         #
10463         #  @ref swig_FilletChamfer "Example"
10464         @ManageTransactions("LocalOp")
10465         def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10466             """
10467             Perform a chamfer on edges,
10468             with distance D1 on the first specified face (if several for one edge)
10469
10470             Parameters:
10471                 theShape Shape, to perform chamfer on.
10472                 theD1,theD2 Chamfer size
10473                 theEdges Sequence of edges of theShape.
10474                 theName Object name; when specified, this parameter is used
10475                         for result publication in the study. Otherwise, if automatic
10476                         publication is switched on, default value is used for result name.
10477
10478             Returns:
10479                 New GEOM.GEOM_Object, containing the result shape.
10480             """
10481             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10482             anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10483             RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10484             anObj.SetParameters(Parameters)
10485             self._autoPublish(anObj, theName, "chamfer")
10486             return anObj
10487
10488         ## The Same that MakeChamferEdges() but with params theD is chamfer length and
10489         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10490         @ManageTransactions("LocalOp")
10491         def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10492             """
10493             The Same that geompy.MakeChamferEdges but with params theD is chamfer length and
10494             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10495             """
10496             flag = False
10497             if isinstance(theAngle,str):
10498                 flag = True
10499             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10500             if flag:
10501                 theAngle = theAngle*math.pi/180.0
10502             anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10503             RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10504             anObj.SetParameters(Parameters)
10505             self._autoPublish(anObj, theName, "chamfer")
10506             return anObj
10507
10508         ## @sa MakeChamferEdge(), MakeChamferFaces()
10509         #
10510         #  @ref swig_MakeChamfer "Example"
10511         def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10512             """
10513             See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10514             """
10515             # Example: see GEOM_TestOthers.py
10516             anObj = None
10517             # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10518             if aShapeType == self.ShapeType["EDGE"]:
10519                 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10520             else:
10521                 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10522             return anObj
10523
10524         ## Remove material from a solid by extrusion of the base shape on the given distance.
10525         #  @param theInit Shape to remove material from. It must be a solid or
10526         #  a compound made of a single solid.
10527         #  @param theBase Closed edge or wire defining the base shape to be extruded.
10528         #  @param theH Prism dimension along the normal to theBase
10529         #  @param theAngle Draft angle in degrees.
10530         #  @param theInvert If true material changes the direction
10531         #  @param theName Object name; when specified, this parameter is used
10532         #         for result publication in the study. Otherwise, if automatic
10533         #         publication is switched on, default value is used for result name.
10534         #
10535         #  @return New GEOM.GEOM_Object, containing the initial shape with removed material
10536         #
10537         #  @ref tui_creation_prism "Example"
10538         @ManageTransactions("PrimOp")
10539         def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10540             """
10541             Add material to a solid by extrusion of the base shape on the given distance.
10542
10543             Parameters:
10544                 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10545                 theBase Closed edge or wire defining the base shape to be extruded.
10546                 theH Prism dimension along the normal to theBase
10547                 theAngle Draft angle in degrees.
10548                 theInvert If true material changes the direction.
10549                 theName Object name; when specified, this parameter is used
10550                         for result publication in the study. Otherwise, if automatic
10551                         publication is switched on, default value is used for result name.
10552
10553             Returns:
10554                 New GEOM.GEOM_Object,  containing the initial shape with removed material.
10555             """
10556             # Example: see GEOM_TestAll.py
10557             theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10558             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10559             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10560             anObj.SetParameters(Parameters)
10561             self._autoPublish(anObj, theName, "extrudedCut")
10562             return anObj
10563
10564         ## Add material to a solid by extrusion of the base shape on the given distance.
10565         #  @param theInit Shape to add material to. It must be a solid or
10566         #  a compound made of a single solid.
10567         #  @param theBase Closed edge or wire defining the base shape to be extruded.
10568         #  @param theH Prism dimension along the normal to theBase
10569         #  @param theAngle Draft angle in degrees.
10570         #  @param theInvert If true material changes the direction
10571         #  @param theName Object name; when specified, this parameter is used
10572         #         for result publication in the study. Otherwise, if automatic
10573         #         publication is switched on, default value is used for result name.
10574         #
10575         #  @return New GEOM.GEOM_Object, containing the initial shape with added material
10576         #
10577         #  @ref tui_creation_prism "Example"
10578         @ManageTransactions("PrimOp")
10579         def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10580             """
10581             Add material to a solid by extrusion of the base shape on the given distance.
10582
10583             Parameters:
10584                 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10585                 theBase Closed edge or wire defining the base shape to be extruded.
10586                 theH Prism dimension along the normal to theBase
10587                 theAngle Draft angle in degrees.
10588                 theInvert If true material changes the direction.
10589                 theName Object name; when specified, this parameter is used
10590                         for result publication in the study. Otherwise, if automatic
10591                         publication is switched on, default value is used for result name.
10592
10593             Returns:
10594                 New GEOM.GEOM_Object,  containing the initial shape with added material.
10595             """
10596             # Example: see GEOM_TestAll.py
10597             theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10598             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10599             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10600             anObj.SetParameters(Parameters)
10601             self._autoPublish(anObj, theName, "extrudedBoss")
10602             return anObj
10603
10604         # end of l3_local
10605         ## @}
10606
10607         ## @addtogroup l3_basic_op
10608         ## @{
10609
10610         ## Perform an Archimde operation on the given shape with given parameters.
10611         #  The object presenting the resulting face is returned.
10612         #  @param theShape Shape to be put in water.
10613         #  @param theWeight Weight of the shape.
10614         #  @param theWaterDensity Density of the water.
10615         #  @param theMeshDeflection Deflection of the mesh, using to compute the section.
10616         #  @param theName Object name; when specified, this parameter is used
10617         #         for result publication in the study. Otherwise, if automatic
10618         #         publication is switched on, default value is used for result name.
10619         #
10620         #  @return New GEOM.GEOM_Object, containing a section of \a theShape
10621         #          by a plane, corresponding to water level.
10622         #
10623         #  @ref tui_archimede "Example"
10624         @ManageTransactions("LocalOp")
10625         def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10626             """
10627             Perform an Archimde operation on the given shape with given parameters.
10628             The object presenting the resulting face is returned.
10629
10630             Parameters:
10631                 theShape Shape to be put in water.
10632                 theWeight Weight of the shape.
10633                 theWaterDensity Density of the water.
10634                 theMeshDeflection Deflection of the mesh, using to compute the section.
10635                 theName Object name; when specified, this parameter is used
10636                         for result publication in the study. Otherwise, if automatic
10637                         publication is switched on, default value is used for result name.
10638
10639             Returns:
10640                 New GEOM.GEOM_Object, containing a section of theShape
10641                 by a plane, corresponding to water level.
10642             """
10643             # Example: see GEOM_TestAll.py
10644             theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10645               theWeight,theWaterDensity,theMeshDeflection)
10646             anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10647             RaiseIfFailed("MakeArchimede", self.LocalOp)
10648             anObj.SetParameters(Parameters)
10649             self._autoPublish(anObj, theName, "archimede")
10650             return anObj
10651
10652         # end of l3_basic_op
10653         ## @}
10654
10655         ## @addtogroup l2_measure
10656         ## @{
10657
10658         ## Get point coordinates
10659         #  @return [x, y, z]
10660         #
10661         #  @ref tui_point_coordinates_page "Example"
10662         @ManageTransactions("MeasuOp")
10663         def PointCoordinates(self,Point):
10664             """
10665             Get point coordinates
10666
10667             Returns:
10668                 [x, y, z]
10669             """
10670             # Example: see GEOM_TestMeasures.py
10671             aTuple = self.MeasuOp.PointCoordinates(Point)
10672             RaiseIfFailed("PointCoordinates", self.MeasuOp)
10673             return aTuple
10674
10675         ## Get vector coordinates
10676         #  @return [x, y, z]
10677         #
10678         #  @ref tui_measurement_tools_page "Example"
10679         def VectorCoordinates(self,Vector):
10680             """
10681             Get vector coordinates
10682
10683             Returns:
10684                 [x, y, z]
10685             """
10686
10687             p1=self.GetFirstVertex(Vector)
10688             p2=self.GetLastVertex(Vector)
10689
10690             X1=self.PointCoordinates(p1)
10691             X2=self.PointCoordinates(p2)
10692
10693             return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10694
10695
10696         ## Compute cross product
10697         #  @return vector w=u^v
10698         #
10699         #  @ref tui_measurement_tools_page "Example"
10700         def CrossProduct(self, Vector1, Vector2):
10701             """
10702             Compute cross product
10703
10704             Returns: vector w=u^v
10705             """
10706             u=self.VectorCoordinates(Vector1)
10707             v=self.VectorCoordinates(Vector2)
10708             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])
10709
10710             return w
10711
10712         ## Compute cross product
10713         #  @return dot product  p=u.v
10714         #
10715         #  @ref tui_measurement_tools_page "Example"
10716         def DotProduct(self, Vector1, Vector2):
10717             """
10718             Compute cross product
10719
10720             Returns: dot product  p=u.v
10721             """
10722             u=self.VectorCoordinates(Vector1)
10723             v=self.VectorCoordinates(Vector2)
10724             p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10725
10726             return p
10727
10728
10729         ## Get summarized length of all wires,
10730         #  area of surface and volume of the given shape.
10731         #  @param theShape Shape to define properties of.
10732         #  @param theTolerance maximal relative error of area
10733         #         and volume computation.
10734         #  @return [theLength, theSurfArea, theVolume]\n
10735         #  theLength:   Summarized length of all wires of the given shape.\n
10736         #  theSurfArea: Area of surface of the given shape.\n
10737         #  theVolume:   Volume of the given shape.
10738         #
10739         #  @ref tui_basic_properties_page "Example"
10740         @ManageTransactions("MeasuOp")
10741         def BasicProperties(self,theShape, theTolerance=1.e-6):
10742             """
10743             Get summarized length of all wires,
10744             area of surface and volume of the given shape.
10745
10746             Parameters:
10747                 theShape Shape to define properties of.
10748                 theTolerance maximal relative error of area
10749                              and volume computation.
10750
10751             Returns:
10752                 [theLength, theSurfArea, theVolume]
10753                  theLength:   Summarized length of all wires of the given shape.
10754                  theSurfArea: Area of surface of the given shape.
10755                  theVolume:   Volume of the given shape.
10756             """
10757             # Example: see GEOM_TestMeasures.py
10758             aTuple = self.MeasuOp.GetBasicProperties(theShape, theTolerance)
10759             RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10760             return aTuple
10761
10762         ## Get parameters of bounding box of the given shape
10763         #  @param theShape Shape to obtain bounding box of.
10764         #  @param precise TRUE for precise computation; FALSE for fast one.
10765         #  @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10766         #  Xmin,Xmax: Limits of shape along OX axis.
10767         #  Ymin,Ymax: Limits of shape along OY axis.
10768         #  Zmin,Zmax: Limits of shape along OZ axis.
10769         #
10770         #  @ref tui_bounding_box_page "Example"
10771         @ManageTransactions("MeasuOp")
10772         def BoundingBox (self, theShape, precise=False):
10773             """
10774             Get parameters of bounding box of the given shape
10775
10776             Parameters:
10777                 theShape Shape to obtain bounding box of.
10778                 precise TRUE for precise computation; FALSE for fast one.
10779
10780             Returns:
10781                 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10782                  Xmin,Xmax: Limits of shape along OX axis.
10783                  Ymin,Ymax: Limits of shape along OY axis.
10784                  Zmin,Zmax: Limits of shape along OZ axis.
10785             """
10786             # Example: see GEOM_TestMeasures.py
10787             aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10788             RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10789             return aTuple
10790
10791         ## Get bounding box of the given shape
10792         #  @param theShape Shape to obtain bounding box of.
10793         #  @param precise TRUE for precise computation; FALSE for fast one.
10794         #  @param theName Object name; when specified, this parameter is used
10795         #         for result publication in the study. Otherwise, if automatic
10796         #         publication is switched on, default value is used for result name.
10797         #
10798         #  @return New GEOM.GEOM_Object, containing the created box.
10799         #
10800         #  @ref tui_bounding_box_page "Example"
10801         @ManageTransactions("MeasuOp")
10802         def MakeBoundingBox (self, theShape, precise=False, theName=None):
10803             """
10804             Get bounding box of the given shape
10805
10806             Parameters:
10807                 theShape Shape to obtain bounding box of.
10808                 precise TRUE for precise computation; FALSE for fast one.
10809                 theName Object name; when specified, this parameter is used
10810                         for result publication in the study. Otherwise, if automatic
10811                         publication is switched on, default value is used for result name.
10812
10813             Returns:
10814                 New GEOM.GEOM_Object, containing the created box.
10815             """
10816             # Example: see GEOM_TestMeasures.py
10817             anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10818             RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10819             self._autoPublish(anObj, theName, "bndbox")
10820             return anObj
10821
10822         ## Get inertia matrix and moments of inertia of theShape.
10823         #  @param theShape Shape to calculate inertia of.
10824         #  @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10825         #  I(1-3)(1-3): Components of the inertia matrix of the given shape.
10826         #  Ix,Iy,Iz:    Moments of inertia of the given shape.
10827         #
10828         #  @ref tui_inertia_page "Example"
10829         @ManageTransactions("MeasuOp")
10830         def Inertia(self,theShape):
10831             """
10832             Get inertia matrix and moments of inertia of theShape.
10833
10834             Parameters:
10835                 theShape Shape to calculate inertia of.
10836
10837             Returns:
10838                 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10839                  I(1-3)(1-3): Components of the inertia matrix of the given shape.
10840                  Ix,Iy,Iz:    Moments of inertia of the given shape.
10841             """
10842             # Example: see GEOM_TestMeasures.py
10843             aTuple = self.MeasuOp.GetInertia(theShape)
10844             RaiseIfFailed("GetInertia", self.MeasuOp)
10845             return aTuple
10846
10847         ## Get if coords are included in the shape (ST_IN or ST_ON)
10848         #  @param theShape Shape
10849         #  @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10850         #  @param tolerance to be used (default is 1.0e-7)
10851         #  @return list_of_boolean = [res1, res2, ...]
10852         @ManageTransactions("MeasuOp")
10853         def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10854             """
10855             Get if coords are included in the shape (ST_IN or ST_ON)
10856
10857             Parameters:
10858                 theShape Shape
10859                 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10860                 tolerance to be used (default is 1.0e-7)
10861
10862             Returns:
10863                 list_of_boolean = [res1, res2, ...]
10864             """
10865             return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10866
10867         ## Get minimal distance between the given shapes.
10868         #  @param theShape1,theShape2 Shapes to find minimal distance between.
10869         #  @return Value of the minimal distance between the given shapes.
10870         #
10871         #  @ref tui_min_distance_page "Example"
10872         @ManageTransactions("MeasuOp")
10873         def MinDistance(self, theShape1, theShape2):
10874             """
10875             Get minimal distance between the given shapes.
10876
10877             Parameters:
10878                 theShape1,theShape2 Shapes to find minimal distance between.
10879
10880             Returns:
10881                 Value of the minimal distance between the given shapes.
10882             """
10883             # Example: see GEOM_TestMeasures.py
10884             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10885             RaiseIfFailed("GetMinDistance", self.MeasuOp)
10886             return aTuple[0]
10887
10888         ## Get minimal distance between the given shapes.
10889         #  @param theShape1,theShape2 Shapes to find minimal distance between.
10890         #  @return Value of the minimal distance between the given shapes, in form of list
10891         #          [Distance, DX, DY, DZ].
10892         #
10893         #  @ref tui_min_distance_page "Example"
10894         @ManageTransactions("MeasuOp")
10895         def MinDistanceComponents(self, theShape1, theShape2):
10896             """
10897             Get minimal distance between the given shapes.
10898
10899             Parameters:
10900                 theShape1,theShape2 Shapes to find minimal distance between.
10901
10902             Returns:
10903                 Value of the minimal distance between the given shapes, in form of list
10904                 [Distance, DX, DY, DZ]
10905             """
10906             # Example: see GEOM_TestMeasures.py
10907             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10908             RaiseIfFailed("GetMinDistance", self.MeasuOp)
10909             aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10910             return aRes
10911
10912         ## Get closest points of the given shapes.
10913         #  @param theShape1,theShape2 Shapes to find closest points of.
10914         #  @return The number of found solutions (-1 in case of infinite number of
10915         #          solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10916         #
10917         #  @ref tui_min_distance_page "Example"
10918         @ManageTransactions("MeasuOp")
10919         def ClosestPoints (self, theShape1, theShape2):
10920             """
10921             Get closest points of the given shapes.
10922
10923             Parameters:
10924                 theShape1,theShape2 Shapes to find closest points of.
10925
10926             Returns:
10927                 The number of found solutions (-1 in case of infinite number of
10928                 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10929             """
10930             # Example: see GEOM_TestMeasures.py
10931             aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10932             RaiseIfFailed("ClosestPoints", self.MeasuOp)
10933             return aTuple
10934
10935         ## Get angle between the given shapes in degrees.
10936         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
10937         #  @note If both arguments are vectors, the angle is computed in accordance
10938         #        with their orientations, otherwise the minimum angle is computed.
10939         #  @return Value of the angle between the given shapes in degrees.
10940         #
10941         #  @ref tui_angle_page "Example"
10942         @ManageTransactions("MeasuOp")
10943         def GetAngle(self, theShape1, theShape2):
10944             """
10945             Get angle between the given shapes in degrees.
10946
10947             Parameters:
10948                 theShape1,theShape2 Lines or linear edges to find angle between.
10949
10950             Note:
10951                 If both arguments are vectors, the angle is computed in accordance
10952                 with their orientations, otherwise the minimum angle is computed.
10953
10954             Returns:
10955                 Value of the angle between the given shapes in degrees.
10956             """
10957             # Example: see GEOM_TestMeasures.py
10958             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10959             RaiseIfFailed("GetAngle", self.MeasuOp)
10960             return anAngle
10961
10962         ## Get angle between the given shapes in radians.
10963         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
10964         #  @note If both arguments are vectors, the angle is computed in accordance
10965         #        with their orientations, otherwise the minimum angle is computed.
10966         #  @return Value of the angle between the given shapes in radians.
10967         #
10968         #  @ref tui_angle_page "Example"
10969         @ManageTransactions("MeasuOp")
10970         def GetAngleRadians(self, theShape1, theShape2):
10971             """
10972             Get angle between the given shapes in radians.
10973
10974             Parameters:
10975                 theShape1,theShape2 Lines or linear edges to find angle between.
10976
10977
10978             Note:
10979                 If both arguments are vectors, the angle is computed in accordance
10980                 with their orientations, otherwise the minimum angle is computed.
10981
10982             Returns:
10983                 Value of the angle between the given shapes in radians.
10984             """
10985             # Example: see GEOM_TestMeasures.py
10986             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10987             RaiseIfFailed("GetAngle", self.MeasuOp)
10988             return anAngle
10989
10990         ## Get angle between the given vectors in degrees.
10991         #  @param theShape1,theShape2 Vectors to find angle between.
10992         #  @param theFlag If True, the normal vector is defined by the two vectors cross,
10993         #                 if False, the opposite vector to the normal vector is used.
10994         #  @return Value of the angle between the given vectors in degrees.
10995         #
10996         #  @ref tui_angle_page "Example"
10997         @ManageTransactions("MeasuOp")
10998         def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10999             """
11000             Get angle between the given vectors in degrees.
11001
11002             Parameters:
11003                 theShape1,theShape2 Vectors to find angle between.
11004                 theFlag If True, the normal vector is defined by the two vectors cross,
11005                         if False, the opposite vector to the normal vector is used.
11006
11007             Returns:
11008                 Value of the angle between the given vectors in degrees.
11009             """
11010             anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
11011             if not theFlag:
11012                 anAngle = 360. - anAngle
11013             RaiseIfFailed("GetAngleVectors", self.MeasuOp)
11014             return anAngle
11015
11016         ## The same as GetAngleVectors, but the result is in radians.
11017         def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
11018             """
11019             Get angle between the given vectors in radians.
11020
11021             Parameters:
11022                 theShape1,theShape2 Vectors to find angle between.
11023                 theFlag If True, the normal vector is defined by the two vectors cross,
11024                         if False, the opposite vector to the normal vector is used.
11025
11026             Returns:
11027                 Value of the angle between the given vectors in radians.
11028             """
11029             anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
11030             return anAngle
11031
11032         ## @name Curve Curvature Measurement
11033         #  Methods for receiving radius of curvature of curves
11034         #  in the given point
11035         ## @{
11036
11037         ## Measure curvature of a curve at a point, set by parameter.
11038         #  @param theCurve a curve.
11039         #  @param theParam parameter.
11040         #  @return radius of curvature of \a theCurve.
11041         #
11042         #  @ref swig_todo "Example"
11043         @ManageTransactions("MeasuOp")
11044         def CurveCurvatureByParam(self, theCurve, theParam):
11045             """
11046             Measure curvature of a curve at a point, set by parameter.
11047
11048             Parameters:
11049                 theCurve a curve.
11050                 theParam parameter.
11051
11052             Returns:
11053                 radius of curvature of theCurve.
11054             """
11055             # Example: see GEOM_TestMeasures.py
11056             aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
11057             RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
11058             return aCurv
11059
11060         ## Measure curvature of a curve at a point.
11061         #  @param theCurve a curve.
11062         #  @param thePoint given point.
11063         #  @return radius of curvature of \a theCurve.
11064         #
11065         #  @ref swig_todo "Example"
11066         @ManageTransactions("MeasuOp")
11067         def CurveCurvatureByPoint(self, theCurve, thePoint):
11068             """
11069             Measure curvature of a curve at a point.
11070
11071             Parameters:
11072                 theCurve a curve.
11073                 thePoint given point.
11074
11075             Returns:
11076                 radius of curvature of theCurve.
11077             """
11078             aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
11079             RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
11080             return aCurv
11081         ## @}
11082
11083         ## @name Surface Curvature Measurement
11084         #  Methods for receiving max and min radius of curvature of surfaces
11085         #  in the given point
11086         ## @{
11087
11088         ## Measure max radius of curvature of surface.
11089         #  @param theSurf the given surface.
11090         #  @param theUParam Value of U-parameter on the referenced surface.
11091         #  @param theVParam Value of V-parameter on the referenced surface.
11092         #  @return max radius of curvature of theSurf.
11093         #
11094         ## @ref swig_todo "Example"
11095         @ManageTransactions("MeasuOp")
11096         def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11097             """
11098             Measure max radius of curvature of surface.
11099
11100             Parameters:
11101                 theSurf the given surface.
11102                 theUParam Value of U-parameter on the referenced surface.
11103                 theVParam Value of V-parameter on the referenced surface.
11104
11105             Returns:
11106                 max radius of curvature of theSurf.
11107             """
11108             # Example: see GEOM_TestMeasures.py
11109             aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11110             RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
11111             return aSurf
11112
11113         ## Measure max radius of curvature of surface in the given point
11114         #  @param theSurf the given surface.
11115         #  @param thePoint given point.
11116         #  @return max radius of curvature of theSurf.
11117         #
11118         ## @ref swig_todo "Example"
11119         @ManageTransactions("MeasuOp")
11120         def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
11121             """
11122             Measure max radius of curvature of surface in the given point.
11123
11124             Parameters:
11125                 theSurf the given surface.
11126                 thePoint given point.
11127
11128             Returns:
11129                 max radius of curvature of theSurf.
11130             """
11131             aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
11132             RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
11133             return aSurf
11134
11135         ## Measure min radius of curvature of surface.
11136         #  @param theSurf the given surface.
11137         #  @param theUParam Value of U-parameter on the referenced surface.
11138         #  @param theVParam Value of V-parameter on the referenced surface.
11139         #  @return min radius of curvature of theSurf.
11140         #
11141         ## @ref swig_todo "Example"
11142         @ManageTransactions("MeasuOp")
11143         def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11144             """
11145             Measure min radius of curvature of surface.
11146
11147             Parameters:
11148                 theSurf the given surface.
11149                 theUParam Value of U-parameter on the referenced surface.
11150                 theVParam Value of V-parameter on the referenced surface.
11151
11152             Returns:
11153                 Min radius of curvature of theSurf.
11154             """
11155             aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11156             RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
11157             return aSurf
11158
11159         ## Measure min radius of curvature of surface in the given point
11160         #  @param theSurf the given surface.
11161         #  @param thePoint given point.
11162         #  @return min radius of curvature of theSurf.
11163         #
11164         ## @ref swig_todo "Example"
11165         @ManageTransactions("MeasuOp")
11166         def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
11167             """
11168             Measure min radius of curvature of surface in the given point.
11169
11170             Parameters:
11171                 theSurf the given surface.
11172                 thePoint given point.
11173
11174             Returns:
11175                 Min radius of curvature of theSurf.
11176             """
11177             aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
11178             RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
11179             return aSurf
11180         ## @}
11181
11182         ## Measure curvature radius of surface in the given point along the given direction.
11183         #  @param theSurf the given face.
11184         #  @param thePoint given point.
11185         #  @param theDirection given direction.
11186         #  @param theName Object name; when specified, this parameter is used
11187         #         for result publication in the study. Otherwise, if automatic
11188         #         publication is switched on, default value is used for result name.
11189         #
11190         #  @return New GEOM.GEOM_Object, containing vector of curvature of theSurf.
11191         #          The returned vector is codirectional with the normal to the face
11192         #          in the given point in case of positive curvature value
11193         #          and opposite to the normal in case of negative curvature.
11194         #          The normal of the returned vector is equal to the
11195         #          absolute value of the curvature radius.
11196         #          Null shape is returned in case of infinite radius
11197         #          (zero curvature), for example, in case of flat face.
11198         #
11199         ## @ref swig_CurvatureOnFace "Example"
11200         @ManageTransactions("MeasuOp")
11201         def CurvatureOnFace(self, theSurf, thePoint, theDirection, theName=None):
11202             """
11203             Measure curvature radius of surface in the given point along the given direction.
11204
11205             Parameters:
11206                 theSurf the given face.
11207                 thePoint given point.
11208                 theDirection given direction.
11209                 theName Object name; when specified, this parameter is used
11210                         for result publication in the study. Otherwise, if automatic
11211                         publication is switched on, default value is used for result name.
11212
11213             Returns:
11214                 New GEOM.GEOM_Object, containing vector of curvature of theSurf.
11215                 The returned vector is codirectional with the normal to the face
11216                 in the given point in case of positive curvature value
11217                 and opposite to the normal in case of negative curvature.
11218                 The normal of the returned vector is equal to the
11219                 absolute value of the curvature radius.
11220                 Null shape is returned in case of infinite radius
11221                 (zero curvature), for example, in case of flat face.
11222
11223             Example of usage:
11224                 curvature_1 = geompy.CurvatureOnFace(Face_1, Vertex_1, OX)
11225             """
11226             aVec = self.MeasuOp.SurfaceCurvatureByPointAndDirection(theSurf,thePoint,theDirection)
11227             if self.MeasuOp.GetErrorCode() != "ZERO_CURVATURE":
11228                 RaiseIfFailed("CurvatureOnFace", self.MeasuOp)
11229                 self._autoPublish(aVec, theName, "curvature")
11230             return aVec
11231
11232         ## Get min and max tolerances of sub-shapes of theShape
11233         #  @param theShape Shape, to get tolerances of.
11234         #  @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
11235         #  FaceMin,FaceMax: Min and max tolerances of the faces.\n
11236         #  EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
11237         #  VertMin,VertMax: Min and max tolerances of the vertices.
11238         #
11239         #  @ref tui_tolerance_page "Example"
11240         @ManageTransactions("MeasuOp")
11241         def Tolerance(self,theShape):
11242             """
11243             Get min and max tolerances of sub-shapes of theShape
11244
11245             Parameters:
11246                 theShape Shape, to get tolerances of.
11247
11248             Returns:
11249                 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
11250                  FaceMin,FaceMax: Min and max tolerances of the faces.
11251                  EdgeMin,EdgeMax: Min and max tolerances of the edges.
11252                  VertMin,VertMax: Min and max tolerances of the vertices.
11253             """
11254             # Example: see GEOM_TestMeasures.py
11255             aTuple = self.MeasuOp.GetTolerance(theShape)
11256             RaiseIfFailed("GetTolerance", self.MeasuOp)
11257             return aTuple
11258
11259         ## Obtain description of the given shape (number of sub-shapes of each type)
11260         #  @param theShape Shape to be described.
11261         #  @return Description of the given shape.
11262         #
11263         #  @ref tui_whatis_page "Example"
11264         @ManageTransactions("MeasuOp")
11265         def WhatIs(self,theShape):
11266             """
11267             Obtain description of the given shape (number of sub-shapes of each type)
11268
11269             Parameters:
11270                 theShape Shape to be described.
11271
11272             Returns:
11273                 Description of the given shape.
11274             """
11275             # Example: see GEOM_TestMeasures.py
11276             aDescr = self.MeasuOp.WhatIs(theShape)
11277             RaiseIfFailed("WhatIs", self.MeasuOp)
11278             return aDescr
11279
11280         ## Obtain quantity of shapes of the given type in \a theShape.
11281         #  If \a theShape is of type \a theType, it is also counted.
11282         #  @param theShape Shape to be described.
11283         #  @param theType the given ShapeType().
11284         #  @return Quantity of shapes of type \a theType in \a theShape.
11285         #
11286         #  @ref tui_measurement_tools_page "Example"
11287         def NbShapes (self, theShape, theType):
11288             """
11289             Obtain quantity of shapes of the given type in theShape.
11290             If theShape is of type theType, it is also counted.
11291
11292             Parameters:
11293                 theShape Shape to be described.
11294                 theType the given geompy.ShapeType
11295
11296             Returns:
11297                 Quantity of shapes of type theType in theShape.
11298             """
11299             # Example: see GEOM_TestMeasures.py
11300             listSh = self.SubShapeAllIDs(theShape, theType)
11301             Nb = len(listSh)
11302             return Nb
11303
11304         ## Obtain quantity of shapes of each type in \a theShape.
11305         #  The \a theShape is also counted.
11306         #  @param theShape Shape to be described.
11307         #  @return Dictionary of ShapeType() with bound quantities of shapes.
11308         #
11309         #  @ref tui_measurement_tools_page "Example"
11310         def ShapeInfo (self, theShape):
11311             """
11312             Obtain quantity of shapes of each type in theShape.
11313             The theShape is also counted.
11314
11315             Parameters:
11316                 theShape Shape to be described.
11317
11318             Returns:
11319                 Dictionary of geompy.ShapeType with bound quantities of shapes.
11320             """
11321             # Example: see GEOM_TestMeasures.py
11322             aDict = {}
11323             for typeSh in self.ShapeType:
11324                 if typeSh in ( "AUTO", "SHAPE" ): continue
11325                 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
11326                 Nb = len(listSh)
11327                 aDict[typeSh] = Nb
11328                 pass
11329             return aDict
11330
11331         def GetCreationInformation(self, theShape):
11332             res = ''
11333             infos = theShape.GetCreationInformation()
11334             for info in infos:
11335                 # operationName
11336                 opName = info.operationName
11337                 if not opName: opName = "no info available"
11338                 if res: res += "\n"
11339                 res += "Operation: " + opName
11340                 # parameters
11341                 for parVal in info.params:
11342                     res += "\n \t%s = %s" % ( parVal.name, parVal.value )
11343             return res
11344
11345         ## Get a point, situated at the centre of mass of theShape.
11346         #  @param theShape Shape to define centre of mass of.
11347         #  @param theName Object name; when specified, this parameter is used
11348         #         for result publication in the study. Otherwise, if automatic
11349         #         publication is switched on, default value is used for result name.
11350         #
11351         #  @return New GEOM.GEOM_Object, containing the created point.
11352         #
11353         #  @ref tui_center_of_mass_page "Example"
11354         @ManageTransactions("MeasuOp")
11355         def MakeCDG(self, theShape, theName=None):
11356             """
11357             Get a point, situated at the centre of mass of theShape.
11358
11359             Parameters:
11360                 theShape Shape to define centre of mass of.
11361                 theName Object name; when specified, this parameter is used
11362                         for result publication in the study. Otherwise, if automatic
11363                         publication is switched on, default value is used for result name.
11364
11365             Returns:
11366                 New GEOM.GEOM_Object, containing the created point.
11367             """
11368             # Example: see GEOM_TestMeasures.py
11369             anObj = self.MeasuOp.GetCentreOfMass(theShape)
11370             RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11371             self._autoPublish(anObj, theName, "centerOfMass")
11372             return anObj
11373
11374         ## Get a vertex sub-shape by index.
11375         #  @param theShape Shape to find sub-shape.
11376         #  @param theIndex Index to find vertex by this index (starting from zero)
11377         #  @param theUseOri To consider edge/wire orientation or not
11378         #  @param theName Object name; when specified, this parameter is used
11379         #         for result publication in the study. Otherwise, if automatic
11380         #         publication is switched on, default value is used for result name.
11381         #
11382         #  @return New GEOM.GEOM_Object, containing the created vertex.
11383         #
11384         #  @ref tui_measurement_tools_page "Example"
11385         @ManageTransactions("MeasuOp")
11386         def GetVertexByIndex(self, theShape, theIndex, theUseOri=True, theName=None):
11387             """
11388             Get a vertex sub-shape by index.
11389
11390             Parameters:
11391                 theShape Shape to find sub-shape.
11392                 theIndex Index to find vertex by this index (starting from zero)
11393                 theUseOri To consider edge/wire orientation or not
11394                 theName Object name; when specified, this parameter is used
11395                         for result publication in the study. Otherwise, if automatic
11396                         publication is switched on, default value is used for result name.
11397
11398             Returns:
11399                 New GEOM.GEOM_Object, containing the created vertex.
11400             """
11401             # Example: see GEOM_TestMeasures.py
11402             if isinstance( theUseOri, str ): # theUseOri was inserted before theName
11403                 theUseOri, theName = True, theUseOri
11404             anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex, theUseOri)
11405             RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11406             self._autoPublish(anObj, theName, "vertex")
11407             return anObj
11408
11409         ## Get the first vertex of wire/edge depended orientation.
11410         #  @param theShape Shape to find first vertex.
11411         #  @param theName Object name; when specified, this parameter is used
11412         #         for result publication in the study. Otherwise, if automatic
11413         #         publication is switched on, default value is used for result name.
11414         #
11415         #  @return New GEOM.GEOM_Object, containing the created vertex.
11416         #
11417         #  @ref tui_measurement_tools_page "Example"
11418         def GetFirstVertex(self, theShape, theName=None):
11419             """
11420             Get the first vertex of wire/edge depended orientation.
11421
11422             Parameters:
11423                 theShape Shape to find first vertex.
11424                 theName Object name; when specified, this parameter is used
11425                         for result publication in the study. Otherwise, if automatic
11426                         publication is switched on, default value is used for result name.
11427
11428             Returns:
11429                 New GEOM.GEOM_Object, containing the created vertex.
11430             """
11431             # Example: see GEOM_TestMeasures.py
11432             # note: auto-publishing is done in self.GetVertexByIndex()
11433             return self.GetVertexByIndex(theShape, 0, True, theName)
11434
11435         ## Get the last vertex of wire/edge depended orientation.
11436         #  @param theShape Shape to find last vertex.
11437         #  @param theName Object name; when specified, this parameter is used
11438         #         for result publication in the study. Otherwise, if automatic
11439         #         publication is switched on, default value is used for result name.
11440         #
11441         #  @return New GEOM.GEOM_Object, containing the created vertex.
11442         #
11443         #  @ref tui_measurement_tools_page "Example"
11444         def GetLastVertex(self, theShape, theName=None):
11445             """
11446             Get the last vertex of wire/edge depended orientation.
11447
11448             Parameters:
11449                 theShape Shape to find last vertex.
11450                 theName Object name; when specified, this parameter is used
11451                         for result publication in the study. Otherwise, if automatic
11452                         publication is switched on, default value is used for result name.
11453
11454             Returns:
11455                 New GEOM.GEOM_Object, containing the created vertex.
11456             """
11457             # Example: see GEOM_TestMeasures.py
11458             nb_vert =  self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11459             # note: auto-publishing is done in self.GetVertexByIndex()
11460             return self.GetVertexByIndex(theShape, (nb_vert-1), True, theName)
11461
11462         ## Get a normale to the given face. If the point is not given,
11463         #  the normale is calculated at the center of mass.
11464         #  @param theFace Face to define normale of.
11465         #  @param theOptionalPoint Point to compute the normale at.
11466         #  @param theName Object name; when specified, this parameter is used
11467         #         for result publication in the study. Otherwise, if automatic
11468         #         publication is switched on, default value is used for result name.
11469         #
11470         #  @return New GEOM.GEOM_Object, containing the created vector.
11471         #
11472         #  @ref swig_todo "Example"
11473         @ManageTransactions("MeasuOp")
11474         def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11475             """
11476             Get a normale to the given face. If the point is not given,
11477             the normale is calculated at the center of mass.
11478
11479             Parameters:
11480                 theFace Face to define normale of.
11481                 theOptionalPoint Point to compute the normale at.
11482                 theName Object name; when specified, this parameter is used
11483                         for result publication in the study. Otherwise, if automatic
11484                         publication is switched on, default value is used for result name.
11485
11486             Returns:
11487                 New GEOM.GEOM_Object, containing the created vector.
11488             """
11489             # Example: see GEOM_TestMeasures.py
11490             anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11491             RaiseIfFailed("GetNormal", self.MeasuOp)
11492             self._autoPublish(anObj, theName, "normal")
11493             return anObj
11494
11495         ## Print shape errors obtained from CheckShape.
11496         #  @param theShape Shape that was checked.
11497         #  @param theShapeErrors the shape errors obtained by CheckShape.
11498         #  @param theReturnStatus If 0 the description of problem is printed.
11499         #                         If 1 the description of problem is returned.
11500         #  @return If theReturnStatus is equal to 1 the description is returned.
11501         #          Otherwise doesn't return anything.
11502         #
11503         #  @ref tui_check_shape_page "Example"
11504         @ManageTransactions("MeasuOp")
11505         def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11506             """
11507             Print shape errors obtained from CheckShape.
11508
11509             Parameters:
11510                 theShape Shape that was checked.
11511                 theShapeErrors the shape errors obtained by CheckShape.
11512                 theReturnStatus If 0 the description of problem is printed.
11513                                 If 1 the description of problem is returned.
11514
11515             Returns:
11516                 If theReturnStatus is equal to 1 the description is returned.
11517                   Otherwise doesn't return anything.
11518             """
11519             # Example: see GEOM_TestMeasures.py
11520             Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11521             if theReturnStatus == 1:
11522                 return Descr
11523             print(Descr)
11524             pass
11525
11526         ## Check a topology of the given shape.
11527         #  @param theShape Shape to check validity of.
11528         #  @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11529         #                        if TRUE, the shape's geometry will be checked also.
11530         #  @param theReturnStatus If 0 and if theShape is invalid, a description
11531         #                         of problem is printed.
11532         #                         If 1 isValid flag and the description of
11533         #                         problem is returned.
11534         #                         If 2 isValid flag and the list of error data
11535         #                         is returned.
11536         #  @return TRUE, if the shape "seems to be valid".
11537         #          If theShape is invalid, prints a description of problem.
11538         #          If theReturnStatus is equal to 1 the description is returned
11539         #          along with IsValid flag.
11540         #          If theReturnStatus is equal to 2 the list of error data is
11541         #          returned along with IsValid flag.
11542         #
11543         #  @ref tui_check_shape_page "Example"
11544         @ManageTransactions("MeasuOp")
11545         def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11546             """
11547             Check a topology of the given shape.
11548
11549             Parameters:
11550                 theShape Shape to check validity of.
11551                 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11552                                if TRUE, the shape's geometry will be checked also.
11553                 theReturnStatus If 0 and if theShape is invalid, a description
11554                                 of problem is printed.
11555                                 If 1 IsValid flag and the description of
11556                                 problem is returned.
11557                                 If 2 IsValid flag and the list of error data
11558                                 is returned.
11559
11560             Returns:
11561                 TRUE, if the shape "seems to be valid".
11562                 If theShape is invalid, prints a description of problem.
11563                 If theReturnStatus is equal to 1 the description is returned
11564                 along with IsValid flag.
11565                 If theReturnStatus is equal to 2 the list of error data is
11566                 returned along with IsValid flag.
11567             """
11568             # Example: see GEOM_TestMeasures.py
11569             if theIsCheckGeom:
11570                 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11571                 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11572             else:
11573                 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11574                 RaiseIfFailed("CheckShape", self.MeasuOp)
11575             if IsValid == 0:
11576                 if theReturnStatus == 0:
11577                     Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11578                     print(Descr)
11579             if theReturnStatus == 1:
11580               Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11581               return (IsValid, Descr)
11582             elif theReturnStatus == 2:
11583               return (IsValid, ShapeErrors)
11584             return IsValid
11585
11586         ## Detect self-intersections in the given shape.
11587         #  @param theShape Shape to check.
11588         #  @param theCheckLevel is the level of self-intersection check.
11589         #         Possible input values are:
11590         #         - GEOM.SI_V_V(0) - only V/V interferences
11591         #         - GEOM.SI_V_E(1) - V/V and V/E interferences
11592         #         - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11593         #         - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11594         #         - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11595         #         - GEOM.SI_ALL(5) - all interferences.
11596         #  @return TRUE, if the shape contains no self-intersections.
11597         #
11598         #  @ref tui_check_self_intersections_page "Example"
11599         @ManageTransactions("MeasuOp")
11600         def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11601             """
11602             Detect self-intersections in the given shape.
11603
11604             Parameters:
11605                 theShape Shape to check.
11606                 theCheckLevel is the level of self-intersection check.
11607                   Possible input values are:
11608                    - GEOM.SI_V_V(0) - only V/V interferences
11609                    - GEOM.SI_V_E(1) - V/V and V/E interferences
11610                    - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11611                    - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11612                    - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11613                    - GEOM.SI_ALL(5) - all interferences.
11614  
11615             Returns:
11616                 TRUE, if the shape contains no self-intersections.
11617             """
11618             # Example: see GEOM_TestMeasures.py
11619             (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11620             RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11621             return IsValid
11622
11623         ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
11624         #  @param theShape Shape to check.
11625         #  @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11626         #         - if \a theDeflection <= 0, default deflection 0.001 is used
11627         #  @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
11628         #         - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11629         #         - if \a theTolerance > 0, algorithm detects gaps
11630         #  @return TRUE, if the shape contains no self-intersections.
11631         #
11632         #  @ref tui_check_self_intersections_fast_page "Example"
11633         @ManageTransactions("MeasuOp")
11634         def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
11635             """
11636             Detect self-intersections of the given shape with algorithm based on mesh intersections.
11637
11638             Parameters:
11639                 theShape Shape to check.
11640                 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11641                     - if theDeflection <= 0, default deflection 0.001 is used
11642                 theTolerance Specifies a distance between shapes used for detecting gaps:
11643                     - if theTolerance <= 0, algorithm detects intersections (default behavior)
11644                     - if theTolerance > 0, algorithm detects gaps
11645  
11646             Returns:
11647                 TRUE, if the shape contains no self-intersections.
11648             """
11649             # Example: see GEOM_TestMeasures.py
11650             (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
11651             RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
11652             return IsValid
11653
11654         ## Check boolean and partition operations arguments.
11655         #  @param theShape the argument of an operation to be checked
11656         #  @return TRUE if the argument is valid for a boolean or partition
11657         #          operation; FALSE otherwise.
11658         @ManageTransactions("MeasuOp")
11659         def CheckBOPArguments(self, theShape):
11660             """
11661             Check boolean and partition operations arguments.
11662
11663             Parameters:
11664                 theShape the argument of an operation to be checked
11665
11666             Returns:
11667                 TRUE if the argument is valid for a boolean or partition
11668                 operation; FALSE otherwise.
11669             """
11670             return self.MeasuOp.CheckBOPArguments(theShape)
11671
11672         ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11673         #  @param theShape1 First source object
11674         #  @param theShape2 Second source object
11675         #  @param theTolerance Specifies a distance between shapes used for detecting gaps:
11676         #         - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11677         #         - if \a theTolerance > 0, algorithm detects gaps
11678         #  @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11679         #         - if \a theDeflection <= 0, default deflection 0.001 is used
11680         #  @return TRUE, if there are intersections (gaps) between source shapes
11681         #  @return List of sub-shapes IDs from 1st shape that localize intersection.
11682         #  @return List of sub-shapes IDs from 2nd shape that localize intersection.
11683         #
11684         #  @ref tui_fast_intersection_page "Example"
11685         @ManageTransactions("MeasuOp")
11686         def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11687             """
11688             Detect intersections of the given shapes with algorithm based on mesh intersections.
11689
11690             Parameters:
11691                 theShape1 First source object
11692                 theShape2 Second source object
11693                 theTolerance Specifies a distance between shapes used for detecting gaps:
11694                     - if theTolerance <= 0, algorithm detects intersections (default behavior)
11695                     - if theTolerance > 0, algorithm detects gaps
11696                 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11697                     - if theDeflection <= 0, default deflection 0.001 is used
11698  
11699             Returns:
11700                 TRUE, if there are intersections (gaps) between source shapes
11701                 List of sub-shapes IDs from 1st shape that localize intersection.
11702                 List of sub-shapes IDs from 2nd shape that localize intersection.
11703             """
11704             # Example: see GEOM_TestMeasures.py
11705             IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11706             RaiseIfFailed("FastIntersect", self.MeasuOp)
11707             return IsOk, Res1, Res2
11708
11709         ## Get position (LCS) of theShape.
11710         #
11711         #  Origin of the LCS is situated at the shape's center of mass.
11712         #  Axes of the LCS are obtained from shape's location or,
11713         #  if the shape is a planar face, from position of its plane.
11714         #
11715         #  @param theShape Shape to calculate position of.
11716         #  @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11717         #          Ox,Oy,Oz: Coordinates of shape's LCS origin.
11718         #          Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11719         #          Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11720         #
11721         #  @ref swig_todo "Example"
11722         @ManageTransactions("MeasuOp")
11723         def GetPosition(self,theShape):
11724             """
11725             Get position (LCS) of theShape.
11726             Origin of the LCS is situated at the shape's center of mass.
11727             Axes of the LCS are obtained from shape's location or,
11728             if the shape is a planar face, from position of its plane.
11729
11730             Parameters:
11731                 theShape Shape to calculate position of.
11732
11733             Returns:
11734                 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11735                  Ox,Oy,Oz: Coordinates of shape's LCS origin.
11736                  Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11737                  Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11738             """
11739             # Example: see GEOM_TestMeasures.py
11740             aTuple = self.MeasuOp.GetPosition(theShape)
11741             RaiseIfFailed("GetPosition", self.MeasuOp)
11742             return aTuple
11743
11744         ## Get kind of theShape.
11745         #
11746         #  @param theShape Shape to get a kind of.
11747         #  @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11748         #          and a list of parameters, describing the shape.
11749         #  @note  Concrete meaning of each value, returned via \a theIntegers
11750         #         or \a theDoubles list depends on the kind() of the shape.
11751         #
11752         #  @ref swig_todo "Example"
11753         @ManageTransactions("MeasuOp")
11754         def KindOfShape(self,theShape):
11755             """
11756             Get kind of theShape.
11757
11758             Parameters:
11759                 theShape Shape to get a kind of.
11760
11761             Returns:
11762                 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11763                     and a list of parameters, describing the shape.
11764             Note:
11765                 Concrete meaning of each value, returned via theIntegers
11766                 or theDoubles list depends on the geompy.kind of the shape
11767             """
11768             # Example: see GEOM_TestMeasures.py
11769             aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11770             RaiseIfFailed("KindOfShape", self.MeasuOp)
11771
11772             aKind  = aRoughTuple[0]
11773             anInts = aRoughTuple[1]
11774             aDbls  = aRoughTuple[2]
11775
11776             # Now there is no exception from this rule:
11777             aKindTuple = [aKind] + aDbls + anInts
11778
11779             # If they are we will regroup parameters for such kind of shape.
11780             # For example:
11781             #if aKind == kind.SOME_KIND:
11782             #    #  SOME_KIND     int int double int double double
11783             #    aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11784
11785             return aKindTuple
11786
11787         ## Returns the string that describes if the shell is good for solid.
11788         #  This is a support method for MakeSolid.
11789         #
11790         #  @param theShell the shell to be checked.
11791         #  @return Returns a string that describes the shell validity for
11792         #          solid construction.
11793         @ManageTransactions("MeasuOp")
11794         def _IsGoodForSolid(self, theShell):
11795             """
11796             Returns the string that describes if the shell is good for solid.
11797             This is a support method for MakeSolid.
11798
11799             Parameter:
11800                 theShell the shell to be checked.
11801
11802             Returns:
11803                 Returns a string that describes the shell validity for
11804                 solid construction.
11805             """
11806             aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11807             return aDescr
11808
11809         # end of l2_measure
11810         ## @}
11811
11812         ## @addtogroup l2_import_export
11813         ## @{
11814
11815         ## Import a shape from the BREP, IGES, STEP or other file
11816         #  (depends on given format) with given name.
11817         #
11818         #  Note: this function is deprecated, it is kept for backward compatibility only
11819         #  Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11820         #
11821         #  @param theFileName The file, containing the shape.
11822         #  @param theFormatName Specify format for the file reading.
11823         #         Available formats can be obtained with InsertOp.ImportTranslators() method.
11824         #         If format 'IGES_SCALE' is used instead of 'IGES' or
11825         #            format 'STEP_SCALE' is used instead of 'STEP',
11826         #            length unit will be set to 'meter' and result model will be scaled.
11827         #  @param theName Object name; when specified, this parameter is used
11828         #         for result publication in the study. Otherwise, if automatic
11829         #         publication is switched on, default value is used for result name.
11830         #
11831         #  @return New GEOM.GEOM_Object, containing the imported shape.
11832         #          If material names are imported it returns the list of
11833         #          objects. The first one is the imported object followed by
11834         #          material groups.
11835         #  @note Auto publishing is allowed for the shape itself. Imported
11836         #        material groups are not automatically published.
11837         #
11838         #  @ref swig_Import_Export "Example"
11839         @ManageTransactions("InsertOp")
11840         def ImportFile(self, theFileName, theFormatName, theName=None):
11841             """
11842             Import a shape from the BREP, IGES, STEP or other file
11843             (depends on given format) with given name.
11844
11845             Note: this function is deprecated, it is kept for backward compatibility only
11846             Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11847
11848             Parameters: 
11849                 theFileName The file, containing the shape.
11850                 theFormatName Specify format for the file reading.
11851                     Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11852                     If format 'IGES_SCALE' is used instead of 'IGES' or
11853                        format 'STEP_SCALE' is used instead of 'STEP',
11854                        length unit will be set to 'meter' and result model will be scaled.
11855                 theName Object name; when specified, this parameter is used
11856                         for result publication in the study. Otherwise, if automatic
11857                         publication is switched on, default value is used for result name.
11858
11859             Returns:
11860                 New GEOM.GEOM_Object, containing the imported shape.
11861                 If material names are imported it returns the list of
11862                 objects. The first one is the imported object followed by
11863                 material groups.
11864             Note:
11865                 Auto publishing is allowed for the shape itself. Imported
11866                 material groups are not automatically published.
11867             """
11868             # Example: see GEOM_TestOthers.py
11869             print("""
11870             WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11871             where <FormatName> is a name of desirable format for importing.
11872             """)
11873             aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11874             RaiseIfFailed("ImportFile", self.InsertOp)
11875             aNbObj = len(aListObj)
11876             if aNbObj > 0:
11877                 self._autoPublish(aListObj[0], theName, "imported")
11878             if aNbObj == 1:
11879                 return aListObj[0]
11880             return aListObj
11881
11882         ## Deprecated analog of ImportFile()
11883         def Import(self, theFileName, theFormatName, theName=None):
11884             """
11885             Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11886             """
11887             # note: auto-publishing is done in self.ImportFile()
11888             return self.ImportFile(theFileName, theFormatName, theName)
11889
11890         ## Read a shape from the binary stream, containing its bounding representation (BRep).
11891         #
11892         #  @note As the byte-stream representing the shape data can be quite large, this method
11893         #  is not automatically dumped to the Python script with the DumpStudy functionality;
11894         #  so please use this method carefully, only for strong reasons.
11895         #  
11896         #  @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
11897         #  data stream.
11898         #
11899         #  @param theStream The BRep binary stream.
11900         #  @param theName Object name; when specified, this parameter is used
11901         #         for result publication in the study. Otherwise, if automatic
11902         #         publication is switched on, default value is used for result name.
11903         #
11904         #  @return New GEOM_Object, containing the shape, read from theStream.
11905         #
11906         #  @ref swig_Import_Export "Example"
11907         @ManageTransactions("InsertOp")
11908         def RestoreShape (self, theStream, theName=None):
11909             """
11910             Read a shape from the binary stream, containing its bounding representation (BRep).
11911
11912             Note:
11913                 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11914
11915             Parameters:
11916                 theStream The BRep binary stream.
11917                 theName Object name; when specified, this parameter is used
11918                         for result publication in the study. Otherwise, if automatic
11919                         publication is switched on, default value is used for result name.
11920
11921             Returns:
11922                 New GEOM_Object, containing the shape, read from theStream.
11923             """
11924             # Example: see GEOM_TestOthers.py
11925             if not theStream:
11926                 # this is the workaround to ignore invalid case when data stream is empty
11927                 if int(os.getenv("GEOM_IGNORE_RESTORE_SHAPE", "0")) > 0:
11928                     print("WARNING: Result of RestoreShape is a NULL shape!")
11929                     return None
11930             anObj = self.InsertOp.RestoreShape(theStream)
11931             RaiseIfFailed("RestoreShape", self.InsertOp)
11932             self._autoPublish(anObj, theName, "restored")
11933             return anObj
11934
11935         ## Export the given shape into a file with given name.
11936         #
11937         #  Note: this function is deprecated, it is kept for backward compatibility only
11938         #  Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11939         #
11940         #  @param theObject Shape to be stored in the file.
11941         #  @param theFileName Name of the file to store the given shape in.
11942         #  @param theFormatName Specify format for the shape storage.
11943         #         Available formats can be obtained with
11944         #         geompy.InsertOp.ExportTranslators()[0] method.
11945         #
11946         #  @ref swig_Import_Export "Example"
11947         @ManageTransactions("InsertOp")
11948         def Export(self, theObject, theFileName, theFormatName):
11949             """
11950             Export the given shape into a file with given name.
11951
11952             Note: this function is deprecated, it is kept for backward compatibility only
11953             Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11954             
11955             Parameters: 
11956                 theObject Shape to be stored in the file.
11957                 theFileName Name of the file to store the given shape in.
11958                 theFormatName Specify format for the shape storage.
11959                               Available formats can be obtained with
11960                               geompy.InsertOp.ExportTranslators()[0] method.
11961             """
11962             # Example: see GEOM_TestOthers.py
11963             print("""
11964             WARNING: Function Export is deprecated, use Export<FormatName> instead,
11965             where <FormatName> is a name of desirable format for exporting.
11966             """)
11967             self.InsertOp.Export(theObject, theFileName, theFormatName)
11968             if self.InsertOp.IsDone() == 0:
11969                 raise RuntimeError("Export : " + self.InsertOp.GetErrorCode())
11970                 pass
11971             pass
11972
11973         # end of l2_import_export
11974         ## @}
11975
11976         ## @addtogroup l3_blocks
11977         ## @{
11978
11979         ## Create a quadrangle face from four edges. Order of Edges is not
11980         #  important. It is not necessary that edges share the same vertex.
11981         #  @param E1,E2,E3,E4 Edges for the face bound.
11982         #  @param theName Object name; when specified, this parameter is used
11983         #         for result publication in the study. Otherwise, if automatic
11984         #         publication is switched on, default value is used for result name.
11985         #
11986         #  @return New GEOM.GEOM_Object, containing the created face.
11987         #
11988         #  @ref tui_building_by_blocks_page "Example"
11989         @ManageTransactions("BlocksOp")
11990         def MakeQuad(self, E1, E2, E3, E4, theName=None):
11991             """
11992             Create a quadrangle face from four edges. Order of Edges is not
11993             important. It is not necessary that edges share the same vertex.
11994
11995             Parameters:
11996                 E1,E2,E3,E4 Edges for the face bound.
11997                 theName Object name; when specified, this parameter is used
11998                         for result publication in the study. Otherwise, if automatic
11999                         publication is switched on, default value is used for result name.
12000
12001             Returns:
12002                 New GEOM.GEOM_Object, containing the created face.
12003
12004             Example of usage:
12005                 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
12006             """
12007             # Example: see GEOM_Spanner.py
12008             anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
12009             RaiseIfFailed("MakeQuad", self.BlocksOp)
12010             self._autoPublish(anObj, theName, "quad")
12011             return anObj
12012
12013         ## Create a quadrangle face on two edges.
12014         #  The missing edges will be built by creating the shortest ones.
12015         #  @param E1,E2 Two opposite edges for the face.
12016         #  @param theName Object name; when specified, this parameter is used
12017         #         for result publication in the study. Otherwise, if automatic
12018         #         publication is switched on, default value is used for result name.
12019         #
12020         #  @return New GEOM.GEOM_Object, containing the created face.
12021         #
12022         #  @ref tui_building_by_blocks_page "Example"
12023         @ManageTransactions("BlocksOp")
12024         def MakeQuad2Edges(self, E1, E2, theName=None):
12025             """
12026             Create a quadrangle face on two edges.
12027             The missing edges will be built by creating the shortest ones.
12028
12029             Parameters:
12030                 E1,E2 Two opposite edges for the face.
12031                 theName Object name; when specified, this parameter is used
12032                         for result publication in the study. Otherwise, if automatic
12033                         publication is switched on, default value is used for result name.
12034
12035             Returns:
12036                 New GEOM.GEOM_Object, containing the created face.
12037
12038             Example of usage:
12039                 # create vertices
12040                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
12041                 p2 = geompy.MakeVertex(150.,  30.,   0.)
12042                 p3 = geompy.MakeVertex(  0., 120.,  50.)
12043                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
12044                 # create edges
12045                 edge1 = geompy.MakeEdge(p1, p2)
12046                 edge2 = geompy.MakeEdge(p3, p4)
12047                 # create a quadrangle face from two edges
12048                 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
12049             """
12050             # Example: see GEOM_Spanner.py
12051             anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
12052             RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
12053             self._autoPublish(anObj, theName, "quad")
12054             return anObj
12055
12056         ## Create a quadrangle face with specified corners.
12057         #  The missing edges will be built by creating the shortest ones.
12058         #  @param V1,V2,V3,V4 Corner vertices for the face.
12059         #  @param theName Object name; when specified, this parameter is used
12060         #         for result publication in the study. Otherwise, if automatic
12061         #         publication is switched on, default value is used for result name.
12062         #
12063         #  @return New GEOM.GEOM_Object, containing the created face.
12064         #
12065         #  @ref tui_building_by_blocks_page "Example 1"
12066         #  \n @ref swig_MakeQuad4Vertices "Example 2"
12067         @ManageTransactions("BlocksOp")
12068         def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
12069             """
12070             Create a quadrangle face with specified corners.
12071             The missing edges will be built by creating the shortest ones.
12072
12073             Parameters:
12074                 V1,V2,V3,V4 Corner vertices for the face.
12075                 theName Object name; when specified, this parameter is used
12076                         for result publication in the study. Otherwise, if automatic
12077                         publication is switched on, default value is used for result name.
12078
12079             Returns:
12080                 New GEOM.GEOM_Object, containing the created face.
12081
12082             Example of usage:
12083                 # create vertices
12084                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
12085                 p2 = geompy.MakeVertex(150.,  30.,   0.)
12086                 p3 = geompy.MakeVertex(  0., 120.,  50.)
12087                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
12088                 # create a quadrangle from four points in its corners
12089                 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
12090             """
12091             # Example: see GEOM_Spanner.py
12092             anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
12093             RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
12094             self._autoPublish(anObj, theName, "quad")
12095             return anObj
12096
12097         ## Create a hexahedral solid, bounded by the six given faces. Order of
12098         #  faces is not important. It is not necessary that Faces share the same edge.
12099         #  @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12100         #  @param theName Object name; when specified, this parameter is used
12101         #         for result publication in the study. Otherwise, if automatic
12102         #         publication is switched on, default value is used for result name.
12103         #
12104         #  @return New GEOM.GEOM_Object, containing the created solid.
12105         #
12106         #  @ref tui_building_by_blocks_page "Example 1"
12107         #  \n @ref swig_MakeHexa "Example 2"
12108         @ManageTransactions("BlocksOp")
12109         def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
12110             """
12111             Create a hexahedral solid, bounded by the six given faces. Order of
12112             faces is not important. It is not necessary that Faces share the same edge.
12113
12114             Parameters:
12115                 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12116                 theName Object name; when specified, this parameter is used
12117                         for result publication in the study. Otherwise, if automatic
12118                         publication is switched on, default value is used for result name.
12119
12120             Returns:
12121                 New GEOM.GEOM_Object, containing the created solid.
12122
12123             Example of usage:
12124                 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
12125             """
12126             # Example: see GEOM_Spanner.py
12127             anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
12128             RaiseIfFailed("MakeHexa", self.BlocksOp)
12129             self._autoPublish(anObj, theName, "hexa")
12130             return anObj
12131
12132         ## Create a hexahedral solid between two given faces.
12133         #  The missing faces will be built by creating the smallest ones.
12134         #  @param F1,F2 Two opposite faces for the hexahedral solid.
12135         #  @param theName Object name; when specified, this parameter is used
12136         #         for result publication in the study. Otherwise, if automatic
12137         #         publication is switched on, default value is used for result name.
12138         #
12139         #  @return New GEOM.GEOM_Object, containing the created solid.
12140         #
12141         #  @ref tui_building_by_blocks_page "Example 1"
12142         #  \n @ref swig_MakeHexa2Faces "Example 2"
12143         @ManageTransactions("BlocksOp")
12144         def MakeHexa2Faces(self, F1, F2, theName=None):
12145             """
12146             Create a hexahedral solid between two given faces.
12147             The missing faces will be built by creating the smallest ones.
12148
12149             Parameters:
12150                 F1,F2 Two opposite faces for the hexahedral solid.
12151                 theName Object name; when specified, this parameter is used
12152                         for result publication in the study. Otherwise, if automatic
12153                         publication is switched on, default value is used for result name.
12154
12155             Returns:
12156                 New GEOM.GEOM_Object, containing the created solid.
12157
12158             Example of usage:
12159                 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
12160             """
12161             # Example: see GEOM_Spanner.py
12162             anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
12163             RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
12164             self._autoPublish(anObj, theName, "hexa")
12165             return anObj
12166
12167         # end of l3_blocks
12168         ## @}
12169
12170         ## @addtogroup l3_blocks_op
12171         ## @{
12172
12173         ## Get a vertex, found in the given shape by its coordinates.
12174         #  @param theShape Block or a compound of blocks.
12175         #  @param theX,theY,theZ Coordinates of the sought vertex.
12176         #  @param theEpsilon Maximum allowed distance between the resulting
12177         #                    vertex and point with the given coordinates.
12178         #  @param theName Object name; when specified, this parameter is used
12179         #         for result publication in the study. Otherwise, if automatic
12180         #         publication is switched on, default value is used for result name.
12181         #
12182         #  @return New GEOM.GEOM_Object, containing the found vertex.
12183         #
12184         #  @ref swig_GetPoint "Example"
12185         @ManageTransactions("BlocksOp")
12186         def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
12187             """
12188             Get a vertex, found in the given shape by its coordinates.
12189
12190             Parameters:
12191                 theShape Block or a compound of blocks.
12192                 theX,theY,theZ Coordinates of the sought vertex.
12193                 theEpsilon Maximum allowed distance between the resulting
12194                            vertex and point with the given coordinates.
12195                 theName Object name; when specified, this parameter is used
12196                         for result publication in the study. Otherwise, if automatic
12197                         publication is switched on, default value is used for result name.
12198
12199             Returns:
12200                 New GEOM.GEOM_Object, containing the found vertex.
12201
12202             Example of usage:
12203                 pnt = geompy.GetPoint(shape, -50,  50,  50, 0.01)
12204             """
12205             # Example: see GEOM_TestOthers.py
12206             anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
12207             RaiseIfFailed("GetPoint", self.BlocksOp)
12208             self._autoPublish(anObj, theName, "vertex")
12209             return anObj
12210
12211         ## Find a vertex of the given shape, which has minimal distance to the given point.
12212         #  @param theShape Any shape.
12213         #  @param thePoint Point, close to the desired vertex.
12214         #  @param theName Object name; when specified, this parameter is used
12215         #         for result publication in the study. Otherwise, if automatic
12216         #         publication is switched on, default value is used for result name.
12217         #
12218         #  @return New GEOM.GEOM_Object, containing the found vertex.
12219         #
12220         #  @ref swig_GetVertexNearPoint "Example"
12221         @ManageTransactions("BlocksOp")
12222         def GetVertexNearPoint(self, theShape, thePoint, theName=None):
12223             """
12224             Find a vertex of the given shape, which has minimal distance to the given point.
12225
12226             Parameters:
12227                 theShape Any shape.
12228                 thePoint Point, close to the desired vertex.
12229                 theName Object name; when specified, this parameter is used
12230                         for result publication in the study. Otherwise, if automatic
12231                         publication is switched on, default value is used for result name.
12232
12233             Returns:
12234                 New GEOM.GEOM_Object, containing the found vertex.
12235
12236             Example of usage:
12237                 pmidle = geompy.MakeVertex(50, 0, 50)
12238                 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
12239             """
12240             # Example: see GEOM_TestOthers.py
12241             anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
12242             RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
12243             self._autoPublish(anObj, theName, "vertex")
12244             return anObj
12245
12246         ## Get an edge, found in the given shape by two given vertices.
12247         #  @param theShape Block or a compound of blocks.
12248         #  @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
12249         #  @param theName Object name; when specified, this parameter is used
12250         #         for result publication in the study. Otherwise, if automatic
12251         #         publication is switched on, default value is used for result name.
12252         #
12253         #  @return New GEOM.GEOM_Object, containing the found edge.
12254         #
12255         #  @ref swig_GetEdge "Example"
12256         @ManageTransactions("BlocksOp")
12257         def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
12258             """
12259             Get an edge, found in the given shape by two given vertices.
12260
12261             Parameters:
12262                 theShape Block or a compound of blocks.
12263                 thePoint1,thePoint2 Points, close to the ends of the desired edge.
12264                 theName Object name; when specified, this parameter is used
12265                         for result publication in the study. Otherwise, if automatic
12266                         publication is switched on, default value is used for result name.
12267
12268             Returns:
12269                 New GEOM.GEOM_Object, containing the found edge.
12270             """
12271             # Example: see GEOM_Spanner.py
12272             anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
12273             RaiseIfFailed("GetEdge", self.BlocksOp)
12274             self._autoPublish(anObj, theName, "edge")
12275             return anObj
12276
12277         ## Find an edge of the given shape, which has minimal distance to the given point.
12278         #  @param theShape Block or a compound of blocks.
12279         #  @param thePoint Point, close to the desired edge.
12280         #  @param theName Object name; when specified, this parameter is used
12281         #         for result publication in the study. Otherwise, if automatic
12282         #         publication is switched on, default value is used for result name.
12283         #
12284         #  @return New GEOM.GEOM_Object, containing the found edge.
12285         #
12286         #  @ref swig_GetEdgeNearPoint "Example"
12287         @ManageTransactions("BlocksOp")
12288         def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
12289             """
12290             Find an edge of the given shape, which has minimal distance to the given point.
12291
12292             Parameters:
12293                 theShape Block or a compound of blocks.
12294                 thePoint Point, close to the desired edge.
12295                 theName Object name; when specified, this parameter is used
12296                         for result publication in the study. Otherwise, if automatic
12297                         publication is switched on, default value is used for result name.
12298
12299             Returns:
12300                 New GEOM.GEOM_Object, containing the found edge.
12301             """
12302             # Example: see GEOM_TestOthers.py
12303             anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
12304             RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
12305             self._autoPublish(anObj, theName, "edge")
12306             return anObj
12307
12308         ## Returns a face, found in the given shape by four given corner vertices.
12309         #  @param theShape Block or a compound of blocks.
12310         #  @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12311         #  @param theName Object name; when specified, this parameter is used
12312         #         for result publication in the study. Otherwise, if automatic
12313         #         publication is switched on, default value is used for result name.
12314         #
12315         #  @return New GEOM.GEOM_Object, containing the found face.
12316         #
12317         #  @ref swig_todo "Example"
12318         @ManageTransactions("BlocksOp")
12319         def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
12320             """
12321             Returns a face, found in the given shape by four given corner vertices.
12322
12323             Parameters:
12324                 theShape Block or a compound of blocks.
12325                 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12326                 theName Object name; when specified, this parameter is used
12327                         for result publication in the study. Otherwise, if automatic
12328                         publication is switched on, default value is used for result name.
12329
12330             Returns:
12331                 New GEOM.GEOM_Object, containing the found face.
12332             """
12333             # Example: see GEOM_Spanner.py
12334             anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
12335             RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
12336             self._autoPublish(anObj, theName, "face")
12337             return anObj
12338
12339         ## Get a face of block, found in the given shape by two given edges.
12340         #  @param theShape Block or a compound of blocks.
12341         #  @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
12342         #  @param theName Object name; when specified, this parameter is used
12343         #         for result publication in the study. Otherwise, if automatic
12344         #         publication is switched on, default value is used for result name.
12345         #
12346         #  @return New GEOM.GEOM_Object, containing the found face.
12347         #
12348         #  @ref swig_todo "Example"
12349         @ManageTransactions("BlocksOp")
12350         def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
12351             """
12352             Get a face of block, found in the given shape by two given edges.
12353
12354             Parameters:
12355                 theShape Block or a compound of blocks.
12356                 theEdge1,theEdge2 Edges, close to the edges of the desired face.
12357                 theName Object name; when specified, this parameter is used
12358                         for result publication in the study. Otherwise, if automatic
12359                         publication is switched on, default value is used for result name.
12360
12361             Returns:
12362                 New GEOM.GEOM_Object, containing the found face.
12363             """
12364             # Example: see GEOM_Spanner.py
12365             anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
12366             RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
12367             self._autoPublish(anObj, theName, "face")
12368             return anObj
12369
12370         ## Find a face, opposite to the given one in the given block.
12371         #  @param theBlock Must be a hexahedral solid.
12372         #  @param theFace Face of \a theBlock, opposite to the desired face.
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 New GEOM.GEOM_Object, containing the found face.
12378         #
12379         #  @ref swig_GetOppositeFace "Example"
12380         @ManageTransactions("BlocksOp")
12381         def GetOppositeFace(self, theBlock, theFace, theName=None):
12382             """
12383             Find a face, opposite to the given one in the given block.
12384
12385             Parameters:
12386                 theBlock Must be a hexahedral solid.
12387                 theFace Face of theBlock, opposite to the desired face.
12388                 theName Object name; when specified, this parameter is used
12389                         for result publication in the study. Otherwise, if automatic
12390                         publication is switched on, default value is used for result name.
12391
12392             Returns:
12393                 New GEOM.GEOM_Object, containing the found face.
12394             """
12395             # Example: see GEOM_Spanner.py
12396             anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
12397             RaiseIfFailed("GetOppositeFace", self.BlocksOp)
12398             self._autoPublish(anObj, theName, "face")
12399             return anObj
12400
12401         ## Find a face of the given shape, which has minimal distance to the given point.
12402         #  @param theShape Block or a compound of blocks.
12403         #  @param thePoint Point, close to the desired face.
12404         #  @param theName Object name; when specified, this parameter is used
12405         #         for result publication in the study. Otherwise, if automatic
12406         #         publication is switched on, default value is used for result name.
12407         #
12408         #  @return New GEOM.GEOM_Object, containing the found face.
12409         #
12410         #  @ref swig_GetFaceNearPoint "Example"
12411         @ManageTransactions("BlocksOp")
12412         def GetFaceNearPoint(self, theShape, thePoint, theName=None):
12413             """
12414             Find a face of the given shape, which has minimal distance to the given point.
12415
12416             Parameters:
12417                 theShape Block or a compound of blocks.
12418                 thePoint Point, close to the desired face.
12419                 theName Object name; when specified, this parameter is used
12420                         for result publication in the study. Otherwise, if automatic
12421                         publication is switched on, default value is used for result name.
12422
12423             Returns:
12424                 New GEOM.GEOM_Object, containing the found face.
12425             """
12426             # Example: see GEOM_Spanner.py
12427             anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12428             RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12429             self._autoPublish(anObj, theName, "face")
12430             return anObj
12431
12432         ## Find a face of block, whose outside normale has minimal angle with the given vector.
12433         #  @param theBlock Block or a compound of blocks.
12434         #  @param theVector Vector, close to the normale of the desired face.
12435         #  @param theName Object name; when specified, this parameter is used
12436         #         for result publication in the study. Otherwise, if automatic
12437         #         publication is switched on, default value is used for result name.
12438         #
12439         #  @return New GEOM.GEOM_Object, containing the found face.
12440         #
12441         #  @ref swig_todo "Example"
12442         @ManageTransactions("BlocksOp")
12443         def GetFaceByNormale(self, theBlock, theVector, theName=None):
12444             """
12445             Find a face of block, whose outside normale has minimal angle with the given vector.
12446
12447             Parameters:
12448                 theBlock Block or a compound of blocks.
12449                 theVector Vector, close to the normale of the desired face.
12450                 theName Object name; when specified, this parameter is used
12451                         for result publication in the study. Otherwise, if automatic
12452                         publication is switched on, default value is used for result name.
12453
12454             Returns:
12455                 New GEOM.GEOM_Object, containing the found face.
12456             """
12457             # Example: see GEOM_Spanner.py
12458             anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12459             RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12460             self._autoPublish(anObj, theName, "face")
12461             return anObj
12462
12463         ## Find all sub-shapes of type \a theShapeType of the given shape,
12464         #  which have minimal distance to the given point.
12465         #  @param theShape Any shape.
12466         #  @param thePoint Point, close to the desired shape.
12467         #  @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12468         #  @param theTolerance The tolerance for distances comparison. All shapes
12469         #                      with distances to the given point in interval
12470         #                      [minimal_distance, minimal_distance + theTolerance] will be gathered.
12471         #  @param theName Object name; when specified, this parameter is used
12472         #         for result publication in the study. Otherwise, if automatic
12473         #         publication is switched on, default value is used for result name.
12474         #
12475         #  @return New GEOM_Object, containing a group of all found shapes.
12476         #
12477         #  @ref swig_GetShapesNearPoint "Example"
12478         @ManageTransactions("BlocksOp")
12479         def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12480             """
12481             Find all sub-shapes of type theShapeType of the given shape,
12482             which have minimal distance to the given point.
12483
12484             Parameters:
12485                 theShape Any shape.
12486                 thePoint Point, close to the desired shape.
12487                 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12488                 theTolerance The tolerance for distances comparison. All shapes
12489                                 with distances to the given point in interval
12490                                 [minimal_distance, minimal_distance + theTolerance] will be gathered.
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 a group of all found shapes.
12497             """
12498             # Example: see GEOM_TestOthers.py
12499             anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12500             RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12501             self._autoPublish(anObj, theName, "group")
12502             return anObj
12503
12504         # end of l3_blocks_op
12505         ## @}
12506
12507         ## @addtogroup l4_blocks_measure
12508         ## @{
12509
12510         ## Check, if the compound of blocks is given.
12511         #  To be considered as a compound of blocks, the
12512         #  given shape must satisfy the following conditions:
12513         #  - Each element of the compound should be a Block (6 faces).
12514         #  - Each face should be a quadrangle, i.e. it should have only 1 wire
12515         #       with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12516         #       there are more than 4 edges in the only wire of a face,
12517         #       this face is considered to be quadrangle if it has 4 bounds
12518         #       (1 or more edge) of C1 continuity.
12519         #  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12520         #  - The compound should be connexe.
12521         #  - The glue between two quadrangle faces should be applied.
12522         #  @param theCompound The compound to check.
12523         #  @param theIsUseC1 Flag to check if there are 4 bounds on a face
12524         #         taking into account C1 continuity.
12525         #  @param theAngTolerance the angular tolerance to check if two neighbor
12526         #         edges are codirectional in the common vertex with this
12527         #         tolerance. This parameter is used only if
12528         #         <VAR>theIsUseC1</VAR> is set to True.
12529         #  @return TRUE, if the given shape is a compound of blocks.
12530         #  If theCompound is not valid, prints all discovered errors.
12531         #
12532         #  @ref tui_check_compound_of_blocks_page "Example 1"
12533         #  \n @ref swig_CheckCompoundOfBlocks "Example 2"
12534         @ManageTransactions("BlocksOp")
12535         def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12536                                   theAngTolerance = 1.e-12):
12537             """
12538             Check, if the compound of blocks is given.
12539             To be considered as a compound of blocks, the
12540             given shape must satisfy the following conditions:
12541             - Each element of the compound should be a Block (6 faces).
12542             - Each face should be a quadrangle, i.e. it should have only 1 wire
12543                  with 4 edges. If theIsUseC1 is set to True and
12544                  there are more than 4 edges in the only wire of a face,
12545                  this face is considered to be quadrangle if it has 4 bounds
12546                  (1 or more edge) of C1 continuity.
12547             - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12548             - The compound should be connexe.
12549             - The glue between two quadrangle faces should be applied.
12550
12551             Parameters:
12552                 theCompound The compound to check.
12553                 theIsUseC1 Flag to check if there are 4 bounds on a face
12554                            taking into account C1 continuity.
12555                 theAngTolerance the angular tolerance to check if two neighbor
12556                            edges are codirectional in the common vertex with this
12557                            tolerance. This parameter is used only if
12558                            theIsUseC1 is set to True.
12559
12560             Returns:
12561                 TRUE, if the given shape is a compound of blocks.
12562                 If theCompound is not valid, prints all discovered errors.
12563             """
12564             # Example: see GEOM_Spanner.py
12565             aTolerance = -1.0
12566             if theIsUseC1:
12567                 aTolerance = theAngTolerance
12568             (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12569             RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12570             if IsValid == 0:
12571                 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12572                 print(Descr)
12573             return IsValid
12574
12575         ## Retrieve all non blocks solids and faces from \a theShape.
12576         #  @param theShape The shape to explore.
12577         #  @param theIsUseC1 Flag to check if there are 4 bounds on a face
12578         #         taking into account C1 continuity.
12579         #  @param theAngTolerance the angular tolerance to check if two neighbor
12580         #         edges are codirectional in the common vertex with this
12581         #         tolerance. This parameter is used only if
12582         #         <VAR>theIsUseC1</VAR> is set to True.
12583         #  @param theName Object name; when specified, this parameter is used
12584         #         for result publication in the study. Otherwise, if automatic
12585         #         publication is switched on, default value is used for result name.
12586         #
12587         #  @return A tuple of two GEOM_Objects. The first object is a group of all
12588         #          non block solids (= not 6 faces, or with 6 faces, but with the
12589         #          presence of non-quadrangular faces). The second object is a
12590         #          group of all non quadrangular faces (= faces with more then
12591         #          1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12592         #          with 1 wire with not 4 edges that do not form 4 bounds of
12593         #          C1 continuity).
12594         #
12595         #  @ref tui_get_non_blocks_page "Example 1"
12596         #  \n @ref swig_GetNonBlocks "Example 2"
12597         @ManageTransactions("BlocksOp")
12598         def GetNonBlocks (self, theShape, theIsUseC1 = False,
12599                           theAngTolerance = 1.e-12, theName=None):
12600             """
12601             Retrieve all non blocks solids and faces from theShape.
12602
12603             Parameters:
12604                 theShape The shape to explore.
12605                 theIsUseC1 Flag to check if there are 4 bounds on a face
12606                            taking into account C1 continuity.
12607                 theAngTolerance the angular tolerance to check if two neighbor
12608                            edges are codirectional in the common vertex with this
12609                            tolerance. This parameter is used only if
12610                            theIsUseC1 is set to True.
12611                 theName Object name; when specified, this parameter is used
12612                         for result publication in the study. Otherwise, if automatic
12613                         publication is switched on, default value is used for result name.
12614
12615             Returns:
12616                 A tuple of two GEOM_Objects. The first object is a group of all
12617                 non block solids (= not 6 faces, or with 6 faces, but with the
12618                 presence of non-quadrangular faces). The second object is a
12619                 group of all non quadrangular faces (= faces with more then
12620                 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12621                 with 1 wire with not 4 edges that do not form 4 bounds of
12622                 C1 continuity).
12623
12624             Usage:
12625                 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12626             """
12627             # Example: see GEOM_Spanner.py
12628             aTolerance = -1.0
12629             if theIsUseC1:
12630                 aTolerance = theAngTolerance
12631             aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12632             RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12633             self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12634             return aTuple
12635
12636         ## Remove all seam and degenerated edges from \a theShape.
12637         #  Unite faces and edges, sharing one surface. It means that
12638         #  this faces must have references to one C++ surface object (handle).
12639         #  @param theShape The compound or single solid to remove irregular edges from.
12640         #  @param doUnionFaces If True, then unite faces. If False (the default value),
12641         #         do not unite faces.
12642         #  @param theName Object name; when specified, this parameter is used
12643         #         for result publication in the study. Otherwise, if automatic
12644         #         publication is switched on, default value is used for result name.
12645         #
12646         #  @return Improved shape.
12647         #
12648         #  @ref swig_RemoveExtraEdges "Example"
12649         @ManageTransactions("BlocksOp")
12650         def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12651             """
12652             Remove all seam and degenerated edges from theShape.
12653             Unite faces and edges, sharing one surface. It means that
12654             this faces must have references to one C++ surface object (handle).
12655
12656             Parameters:
12657                 theShape The compound or single solid to remove irregular edges from.
12658                 doUnionFaces If True, then unite faces. If False (the default value),
12659                              do not unite faces.
12660                 theName Object name; when specified, this parameter is used
12661                         for result publication in the study. Otherwise, if automatic
12662                         publication is switched on, default value is used for result name.
12663
12664             Returns:
12665                 Improved shape.
12666             """
12667             # Example: see GEOM_TestOthers.py
12668             nbFacesOptimum = -1 # -1 means do not unite faces
12669             if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12670             anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12671             RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12672             self._autoPublish(anObj, theName, "removeExtraEdges")
12673             return anObj
12674
12675         ## Performs union faces of \a theShape
12676         #  Unite faces sharing one surface. It means that
12677         #  these faces must have references to one C++ surface object (handle).
12678         #  @param theShape The compound or single solid that contains faces
12679         #         to perform union.
12680         #  @param theName Object name; when specified, this parameter is used
12681         #         for result publication in the study. Otherwise, if automatic
12682         #         publication is switched on, default value is used for result name.
12683         #
12684         #  @return Improved shape.
12685         #
12686         #  @ref swig_UnionFaces "Example"
12687         @ManageTransactions("BlocksOp")
12688         def UnionFaces(self, theShape, theName=None):
12689             """
12690             Performs union faces of theShape.
12691             Unite faces sharing one surface. It means that
12692             these faces must have references to one C++ surface object (handle).
12693
12694             Parameters:
12695                 theShape The compound or single solid that contains faces
12696                          to perform union.
12697                 theName Object name; when specified, this parameter is used
12698                         for result publication in the study. Otherwise, if automatic
12699                         publication is switched on, default value is used for result name.
12700
12701             Returns:
12702                 Improved shape.
12703             """
12704             # Example: see GEOM_TestOthers.py
12705             anObj = self.BlocksOp.UnionFaces(theShape)
12706             RaiseIfFailed("UnionFaces", self.BlocksOp)
12707             self._autoPublish(anObj, theName, "unionFaces")
12708             return anObj
12709
12710         ## Check, if the given shape is a blocks compound.
12711         #  Fix all detected errors.
12712         #    \note Single block can be also fixed by this method.
12713         #  @param theShape The compound to check and improve.
12714         #  @param theName Object name; when specified, this parameter is used
12715         #         for result publication in the study. Otherwise, if automatic
12716         #         publication is switched on, default value is used for result name.
12717         #
12718         #  @return Improved compound.
12719         #
12720         #  @ref swig_CheckAndImprove "Example"
12721         @ManageTransactions("BlocksOp")
12722         def CheckAndImprove(self, theShape, theName=None):
12723             """
12724             Check, if the given shape is a blocks compound.
12725             Fix all detected errors.
12726
12727             Note:
12728                 Single block can be also fixed by this method.
12729
12730             Parameters:
12731                 theShape The compound to check and improve.
12732                 theName Object name; when specified, this parameter is used
12733                         for result publication in the study. Otherwise, if automatic
12734                         publication is switched on, default value is used for result name.
12735
12736             Returns:
12737                 Improved compound.
12738             """
12739             # Example: see GEOM_TestOthers.py
12740             anObj = self.BlocksOp.CheckAndImprove(theShape)
12741             RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12742             self._autoPublish(anObj, theName, "improved")
12743             return anObj
12744
12745         # end of l4_blocks_measure
12746         ## @}
12747
12748         ## @addtogroup l3_blocks_op
12749         ## @{
12750
12751         ## Get all the blocks, contained in the given compound.
12752         #  @param theCompound The compound to explode.
12753         #  @param theMinNbFaces If solid has lower number of faces, it is not a block.
12754         #  @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12755         #  @param theName Object name; when specified, this parameter is used
12756         #         for result publication in the study. Otherwise, if automatic
12757         #         publication is switched on, default value is used for result name.
12758         #
12759         #  @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12760         #
12761         #  @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12762         #
12763         #  @ref tui_explode_on_blocks "Example 1"
12764         #  \n @ref swig_MakeBlockExplode "Example 2"
12765         @ManageTransactions("BlocksOp")
12766         def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12767             """
12768             Get all the blocks, contained in the given compound.
12769
12770             Parameters:
12771                 theCompound The compound to explode.
12772                 theMinNbFaces If solid has lower number of faces, it is not a block.
12773                 theMaxNbFaces If solid has higher number of faces, it is not a block.
12774                 theName Object name; when specified, this parameter is used
12775                         for result publication in the study. Otherwise, if automatic
12776                         publication is switched on, default value is used for result name.
12777
12778             Note:
12779                 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12780
12781             Returns:
12782                 List of GEOM.GEOM_Object, containing the retrieved blocks.
12783             """
12784             # Example: see GEOM_TestOthers.py
12785             theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12786             aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12787             RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12788             for anObj in aList:
12789                 anObj.SetParameters(Parameters)
12790                 pass
12791             self._autoPublish(aList, theName, "block")
12792             return aList
12793
12794         ## Find block, containing the given point inside its volume or on boundary.
12795         #  @param theCompound Compound, to find block in.
12796         #  @param thePoint Point, close to the desired block. If the point lays on
12797         #         boundary between some blocks, we return block with nearest center.
12798         #  @param theName Object name; when specified, this parameter is used
12799         #         for result publication in the study. Otherwise, if automatic
12800         #         publication is switched on, default value is used for result name.
12801         #
12802         #  @return New GEOM.GEOM_Object, containing the found block.
12803         #
12804         #  @ref swig_todo "Example"
12805         @ManageTransactions("BlocksOp")
12806         def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12807             """
12808             Find block, containing the given point inside its volume or on boundary.
12809
12810             Parameters:
12811                 theCompound Compound, to find block in.
12812                 thePoint Point, close to the desired block. If the point lays on
12813                          boundary between some blocks, we return block with nearest center.
12814                 theName Object name; when specified, this parameter is used
12815                         for result publication in the study. Otherwise, if automatic
12816                         publication is switched on, default value is used for result name.
12817
12818             Returns:
12819                 New GEOM.GEOM_Object, containing the found block.
12820             """
12821             # Example: see GEOM_Spanner.py
12822             anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12823             RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12824             self._autoPublish(anObj, theName, "block")
12825             return anObj
12826
12827         ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12828         #  @param theCompound Compound, to find block in.
12829         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12830         #  @param theName Object name; when specified, this parameter is used
12831         #         for result publication in the study. Otherwise, if automatic
12832         #         publication is switched on, default value is used for result name.
12833         #
12834         #  @return New GEOM.GEOM_Object, containing the found block.
12835         #
12836         #  @ref swig_GetBlockByParts "Example"
12837         @ManageTransactions("BlocksOp")
12838         def GetBlockByParts(self, theCompound, theParts, theName=None):
12839             """
12840              Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12841
12842              Parameters:
12843                 theCompound Compound, to find block in.
12844                 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12845                 theName Object name; when specified, this parameter is used
12846                         for result publication in the study. Otherwise, if automatic
12847                         publication is switched on, default value is used for result name.
12848
12849             Returns:
12850                 New GEOM_Object, containing the found block.
12851             """
12852             # Example: see GEOM_TestOthers.py
12853             anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12854             RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12855             self._autoPublish(anObj, theName, "block")
12856             return anObj
12857
12858         ## Return all blocks, containing all the elements, passed as the parts.
12859         #  @param theCompound Compound, to find blocks in.
12860         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12861         #  @param theName Object name; when specified, this parameter is used
12862         #         for result publication in the study. Otherwise, if automatic
12863         #         publication is switched on, default value is used for result name.
12864         #
12865         #  @return List of GEOM.GEOM_Object, containing the found blocks.
12866         #
12867         #  @ref swig_todo "Example"
12868         @ManageTransactions("BlocksOp")
12869         def GetBlocksByParts(self, theCompound, theParts, theName=None):
12870             """
12871             Return all blocks, containing all the elements, passed as the parts.
12872
12873             Parameters:
12874                 theCompound Compound, to find blocks in.
12875                 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12876                 theName Object name; when specified, this parameter is used
12877                         for result publication in the study. Otherwise, if automatic
12878                         publication is switched on, default value is used for result name.
12879
12880             Returns:
12881                 List of GEOM.GEOM_Object, containing the found blocks.
12882             """
12883             # Example: see GEOM_Spanner.py
12884             aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12885             RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12886             self._autoPublish(aList, theName, "block")
12887             return aList
12888
12889         ## Multi-transformate block and glue the result.
12890         #  Transformation is defined so, as to superpose direction faces.
12891         #  @param Block Hexahedral solid to be multi-transformed.
12892         #  @param DirFace1 ID of First direction face.
12893         #  @param DirFace2 ID of Second direction face.
12894         #  @param NbTimes Quantity of transformations to be done.
12895         #  @param theName Object name; when specified, this parameter is used
12896         #         for result publication in the study. Otherwise, if automatic
12897         #         publication is switched on, default value is used for result name.
12898         #
12899         #  @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12900         #
12901         #  @return New GEOM.GEOM_Object, containing the result shape.
12902         #
12903         #  @ref tui_multi_transformation "Example"
12904         @ManageTransactions("BlocksOp")
12905         def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12906             """
12907             Multi-transformate block and glue the result.
12908             Transformation is defined so, as to superpose direction faces.
12909
12910             Parameters:
12911                 Block Hexahedral solid to be multi-transformed.
12912                 DirFace1 ID of First direction face.
12913                 DirFace2 ID of Second direction face.
12914                 NbTimes Quantity of transformations to be done.
12915                 theName Object name; when specified, this parameter is used
12916                         for result publication in the study. Otherwise, if automatic
12917                         publication is switched on, default value is used for result name.
12918
12919             Note:
12920                 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12921
12922             Returns:
12923                 New GEOM.GEOM_Object, containing the result shape.
12924             """
12925             # Example: see GEOM_Spanner.py
12926             DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12927             anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12928             RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12929             anObj.SetParameters(Parameters)
12930             self._autoPublish(anObj, theName, "transformed")
12931             return anObj
12932
12933         ## Multi-transformate block and glue the result.
12934         #  @param Block Hexahedral solid to be multi-transformed.
12935         #  @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12936         #  @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12937         #  @param NbTimesU,NbTimesV Quantity of transformations to be done.
12938         #  @param theName Object name; when specified, this parameter is used
12939         #         for result publication in the study. Otherwise, if automatic
12940         #         publication is switched on, default value is used for result name.
12941         #
12942         #  @return New GEOM.GEOM_Object, containing the result shape.
12943         #
12944         #  @ref tui_multi_transformation "Example"
12945         @ManageTransactions("BlocksOp")
12946         def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12947                                       DirFace1V, DirFace2V, NbTimesV, theName=None):
12948             """
12949             Multi-transformate block and glue the result.
12950
12951             Parameters:
12952                 Block Hexahedral solid to be multi-transformed.
12953                 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12954                 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12955                 NbTimesU,NbTimesV Quantity of transformations to be done.
12956                 theName Object name; when specified, this parameter is used
12957                         for result publication in the study. Otherwise, if automatic
12958                         publication is switched on, default value is used for result name.
12959
12960             Returns:
12961                 New GEOM.GEOM_Object, containing the result shape.
12962             """
12963             # Example: see GEOM_Spanner.py
12964             DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12965               DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12966             anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12967                                                             DirFace1V, DirFace2V, NbTimesV)
12968             RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12969             anObj.SetParameters(Parameters)
12970             self._autoPublish(anObj, theName, "transformed")
12971             return anObj
12972
12973         ## Build all possible propagation groups.
12974         #  Propagation group is a set of all edges, opposite to one (main)
12975         #  edge of this group directly or through other opposite edges.
12976         #  Notion of Opposite Edge make sense only on quadrangle face.
12977         #  @param theShape Shape to build propagation groups on.
12978         #  @param theName Object name; when specified, this parameter is used
12979         #         for result publication in the study. Otherwise, if automatic
12980         #         publication is switched on, default value is used for result name.
12981         #
12982         #  @return List of GEOM.GEOM_Object, each of them is a propagation group.
12983         #
12984         #  @ref swig_Propagate "Example"
12985         @ManageTransactions("BlocksOp")
12986         def Propagate(self, theShape, theName=None):
12987             """
12988             Build all possible propagation groups.
12989             Propagation group is a set of all edges, opposite to one (main)
12990             edge of this group directly or through other opposite edges.
12991             Notion of Opposite Edge make sense only on quadrangle face.
12992
12993             Parameters:
12994                 theShape Shape to build propagation groups on.
12995                 theName Object name; when specified, this parameter is used
12996                         for result publication in the study. Otherwise, if automatic
12997                         publication is switched on, default value is used for result name.
12998
12999             Returns:
13000                 List of GEOM.GEOM_Object, each of them is a propagation group.
13001             """
13002             # Example: see GEOM_TestOthers.py
13003             listChains = self.BlocksOp.Propagate(theShape)
13004             RaiseIfFailed("Propagate", self.BlocksOp)
13005             self._autoPublish(listChains, theName, "propagate")
13006             return listChains
13007
13008         # end of l3_blocks_op
13009         ## @}
13010
13011         ## @addtogroup l3_groups
13012         ## @{
13013
13014         ## Creates a new group which will store sub-shapes of theMainShape
13015         #  @param theMainShape is a GEOM object on which the group is selected
13016         #  @param theShapeType defines a shape type of the group (see GEOM::shape_type)
13017         #  @param theName Object name; when specified, this parameter is used
13018         #         for result publication in the study. Otherwise, if automatic
13019         #         publication is switched on, default value is used for result name.
13020         #
13021         #  @return a newly created GEOM group (GEOM.GEOM_Object)
13022         #
13023         #  @ref tui_working_with_groups_page "Example 1"
13024         #  \n @ref swig_CreateGroup "Example 2"
13025         @ManageTransactions("GroupOp")
13026         def CreateGroup(self, theMainShape, theShapeType, theName=None):
13027             """
13028             Creates a new group which will store sub-shapes of theMainShape
13029
13030             Parameters:
13031                theMainShape is a GEOM object on which the group is selected
13032                theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
13033                             "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
13034                 theName Object name; when specified, this parameter is used
13035                         for result publication in the study. Otherwise, if automatic
13036                         publication is switched on, default value is used for result name.
13037
13038             Returns:
13039                a newly created GEOM group
13040
13041             Example of usage:
13042                 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
13043
13044             """
13045             # Example: see GEOM_TestOthers.py
13046             anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
13047             RaiseIfFailed("CreateGroup", self.GroupOp)
13048             self._autoPublish(anObj, theName, "group")
13049             return anObj
13050
13051         ## Adds a sub-object with ID theSubShapeId to the group
13052         #  @param theGroup is a GEOM group to which the new sub-shape is added
13053         #  @param theSubShapeID is a sub-shape ID in the main object.
13054         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13055         #
13056         #  @ref tui_working_with_groups_page "Example"
13057         @ManageTransactions("GroupOp")
13058         def AddObject(self,theGroup, theSubShapeID):
13059             """
13060             Adds a sub-object with ID theSubShapeId to the group
13061
13062             Parameters:
13063                 theGroup       is a GEOM group to which the new sub-shape is added
13064                 theSubShapeID  is a sub-shape ID in the main object.
13065
13066             Note:
13067                 Use method GetSubShapeID() to get an unique ID of the sub-shape
13068             """
13069             # Example: see GEOM_TestOthers.py
13070             self.GroupOp.AddObject(theGroup, theSubShapeID)
13071             if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
13072                 RaiseIfFailed("AddObject", self.GroupOp)
13073                 pass
13074             pass
13075
13076         ## Removes a sub-object with ID \a theSubShapeId from the group
13077         #  @param theGroup is a GEOM group from which the new sub-shape is removed
13078         #  @param theSubShapeID is a sub-shape ID in the main object.
13079         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13080         #
13081         #  @ref tui_working_with_groups_page "Example"
13082         @ManageTransactions("GroupOp")
13083         def RemoveObject(self,theGroup, theSubShapeID):
13084             """
13085             Removes a sub-object with ID theSubShapeId from the group
13086
13087             Parameters:
13088                 theGroup is a GEOM group from which the new sub-shape is removed
13089                 theSubShapeID is a sub-shape ID in the main object.
13090
13091             Note:
13092                 Use method GetSubShapeID() to get an unique ID of the sub-shape
13093             """
13094             # Example: see GEOM_TestOthers.py
13095             self.GroupOp.RemoveObject(theGroup, theSubShapeID)
13096             RaiseIfFailed("RemoveObject", self.GroupOp)
13097             pass
13098
13099         ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13100         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
13101         #  @param theSubShapes is a list of sub-shapes to be added.
13102         #
13103         #  @ref tui_working_with_groups_page "Example"
13104         @ManageTransactions("GroupOp")
13105         def UnionList (self,theGroup, theSubShapes):
13106             """
13107             Adds to the group all the given shapes. No errors, if some shapes are already included.
13108
13109             Parameters:
13110                 theGroup is a GEOM group to which the new sub-shapes are added.
13111                 theSubShapes is a list of sub-shapes to be added.
13112             """
13113             # Example: see GEOM_TestOthers.py
13114             self.GroupOp.UnionList(theGroup, theSubShapes)
13115             RaiseIfFailed("UnionList", self.GroupOp)
13116             pass
13117
13118         ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13119         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
13120         #  @param theSubShapes is a list of indices of sub-shapes to be added.
13121         #
13122         #  @ref swig_UnionIDs "Example"
13123         @ManageTransactions("GroupOp")
13124         def UnionIDs(self,theGroup, theSubShapes):
13125             """
13126             Adds to the group all the given shapes. No errors, if some shapes are already included.
13127
13128             Parameters:
13129                 theGroup is a GEOM group to which the new sub-shapes are added.
13130                 theSubShapes is a list of indices of sub-shapes to be added.
13131             """
13132             # Example: see GEOM_TestOthers.py
13133             self.GroupOp.UnionIDs(theGroup, theSubShapes)
13134             RaiseIfFailed("UnionIDs", self.GroupOp)
13135             pass
13136
13137         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13138         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
13139         #  @param theSubShapes is a list of sub-shapes to be removed.
13140         #
13141         #  @ref tui_working_with_groups_page "Example"
13142         @ManageTransactions("GroupOp")
13143         def DifferenceList (self,theGroup, theSubShapes):
13144             """
13145             Removes from the group all the given shapes. No errors, if some shapes are not included.
13146
13147             Parameters:
13148                 theGroup is a GEOM group from which the sub-shapes are removed.
13149                 theSubShapes is a list of sub-shapes to be removed.
13150             """
13151             # Example: see GEOM_TestOthers.py
13152             self.GroupOp.DifferenceList(theGroup, theSubShapes)
13153             RaiseIfFailed("DifferenceList", self.GroupOp)
13154             pass
13155
13156         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13157         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
13158         #  @param theSubShapes is a list of indices of sub-shapes to be removed.
13159         #
13160         #  @ref swig_DifferenceIDs "Example"
13161         @ManageTransactions("GroupOp")
13162         def DifferenceIDs(self,theGroup, theSubShapes):
13163             """
13164             Removes from the group all the given shapes. No errors, if some shapes are not included.
13165
13166             Parameters:
13167                 theGroup is a GEOM group from which the sub-shapes are removed.
13168                 theSubShapes is a list of indices of sub-shapes to be removed.
13169             """
13170             # Example: see GEOM_TestOthers.py
13171             self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
13172             RaiseIfFailed("DifferenceIDs", self.GroupOp)
13173             pass
13174
13175         ## Union of two groups.
13176         #  New group is created. It will contain all entities
13177         #  which are present in groups theGroup1 and theGroup2.
13178         #  @param theGroup1, theGroup2 are the initial GEOM groups
13179         #                              to create the united group from.
13180         #  @param theName Object name; when specified, this parameter is used
13181         #         for result publication in the study. Otherwise, if automatic
13182         #         publication is switched on, default value is used for result name.
13183         #
13184         #  @return a newly created GEOM group.
13185         #
13186         #  @ref tui_union_groups_anchor "Example"
13187         @ManageTransactions("GroupOp")
13188         def UnionGroups (self, theGroup1, theGroup2, theName=None):
13189             """
13190             Union of two groups.
13191             New group is created. It will contain all entities
13192             which are present in groups theGroup1 and theGroup2.
13193
13194             Parameters:
13195                 theGroup1, theGroup2 are the initial GEOM groups
13196                                      to create the united group from.
13197                 theName Object name; when specified, this parameter is used
13198                         for result publication in the study. Otherwise, if automatic
13199                         publication is switched on, default value is used for result name.
13200
13201             Returns:
13202                 a newly created GEOM group.
13203             """
13204             # Example: see GEOM_TestOthers.py
13205             aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
13206             RaiseIfFailed("UnionGroups", self.GroupOp)
13207             self._autoPublish(aGroup, theName, "group")
13208             return aGroup
13209
13210         ## Intersection of two groups.
13211         #  New group is created. It will contain only those entities
13212         #  which are present in both groups theGroup1 and theGroup2.
13213         #  @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13214         #  @param theName Object name; when specified, this parameter is used
13215         #         for result publication in the study. Otherwise, if automatic
13216         #         publication is switched on, default value is used for result name.
13217         #
13218         #  @return a newly created GEOM group.
13219         #
13220         #  @ref tui_intersect_groups_anchor "Example"
13221         @ManageTransactions("GroupOp")
13222         def IntersectGroups (self, theGroup1, theGroup2, theName=None):
13223             """
13224             Intersection of two groups.
13225             New group is created. It will contain only those entities
13226             which are present in both groups theGroup1 and theGroup2.
13227
13228             Parameters:
13229                 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13230                 theName Object name; when specified, this parameter is used
13231                         for result publication in the study. Otherwise, if automatic
13232                         publication is switched on, default value is used for result name.
13233
13234             Returns:
13235                 a newly created GEOM group.
13236             """
13237             # Example: see GEOM_TestOthers.py
13238             aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
13239             RaiseIfFailed("IntersectGroups", self.GroupOp)
13240             self._autoPublish(aGroup, theName, "group")
13241             return aGroup
13242
13243         ## Cut of two groups.
13244         #  New group is created. It will contain entities which are
13245         #  present in group theGroup1 but are not present in group theGroup2.
13246         #  @param theGroup1 is a GEOM group to include elements of.
13247         #  @param theGroup2 is a GEOM group to exclude elements of.
13248         #  @param theName Object name; when specified, this parameter is used
13249         #         for result publication in the study. Otherwise, if automatic
13250         #         publication is switched on, default value is used for result name.
13251         #
13252         #  @return a newly created GEOM group.
13253         #
13254         #  @ref tui_cut_groups_anchor "Example"
13255         @ManageTransactions("GroupOp")
13256         def CutGroups (self, theGroup1, theGroup2, theName=None):
13257             """
13258             Cut of two groups.
13259             New group is created. It will contain entities which are
13260             present in group theGroup1 but are not present in group theGroup2.
13261
13262             Parameters:
13263                 theGroup1 is a GEOM group to include elements of.
13264                 theGroup2 is a GEOM group to exclude elements of.
13265                 theName Object name; when specified, this parameter is used
13266                         for result publication in the study. Otherwise, if automatic
13267                         publication is switched on, default value is used for result name.
13268
13269             Returns:
13270                 a newly created GEOM group.
13271             """
13272             # Example: see GEOM_TestOthers.py
13273             aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
13274             RaiseIfFailed("CutGroups", self.GroupOp)
13275             self._autoPublish(aGroup, theName, "group")
13276             return aGroup
13277
13278         ## Union of list of groups.
13279         #  New group is created. It will contain all entities that are
13280         #  present in groups listed in theGList.
13281         #  @param theGList is a list of GEOM groups to create the united group from.
13282         #  @param theName Object name; when specified, this parameter is used
13283         #         for result publication in the study. Otherwise, if automatic
13284         #         publication is switched on, default value is used for result name.
13285         #
13286         #  @return a newly created GEOM group.
13287         #
13288         #  @ref tui_union_groups_anchor "Example"
13289         @ManageTransactions("GroupOp")
13290         def UnionListOfGroups (self, theGList, theName=None):
13291             """
13292             Union of list of groups.
13293             New group is created. It will contain all entities that are
13294             present in groups listed in theGList.
13295
13296             Parameters:
13297                 theGList is a list of GEOM groups to create the united group from.
13298                 theName Object name; when specified, this parameter is used
13299                         for result publication in the study. Otherwise, if automatic
13300                         publication is switched on, default value is used for result name.
13301
13302             Returns:
13303                 a newly created GEOM group.
13304             """
13305             # Example: see GEOM_TestOthers.py
13306             aGroup = self.GroupOp.UnionListOfGroups(theGList)
13307             RaiseIfFailed("UnionListOfGroups", self.GroupOp)
13308             self._autoPublish(aGroup, theName, "group")
13309             return aGroup
13310
13311         ## Cut of lists of groups.
13312         #  New group is created. It will contain only entities
13313         #  which are present in groups listed in theGList.
13314         #  @param theGList is a list of GEOM groups to include elements of.
13315         #  @param theName Object name; when specified, this parameter is used
13316         #         for result publication in the study. Otherwise, if automatic
13317         #         publication is switched on, default value is used for result name.
13318         #
13319         #  @return a newly created GEOM group.
13320         #
13321         #  @ref tui_intersect_groups_anchor "Example"
13322         @ManageTransactions("GroupOp")
13323         def IntersectListOfGroups (self, theGList, theName=None):
13324             """
13325             Cut of lists of groups.
13326             New group is created. It will contain only entities
13327             which are present in groups listed in theGList.
13328
13329             Parameters:
13330                 theGList is a list of GEOM groups to include elements of.
13331                 theName Object name; when specified, this parameter is used
13332                         for result publication in the study. Otherwise, if automatic
13333                         publication is switched on, default value is used for result name.
13334
13335             Returns:
13336                 a newly created GEOM group.
13337             """
13338             # Example: see GEOM_TestOthers.py
13339             aGroup = self.GroupOp.IntersectListOfGroups(theGList)
13340             RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
13341             self._autoPublish(aGroup, theName, "group")
13342             return aGroup
13343
13344         ## Cut of lists of groups.
13345         #  New group is created. It will contain only entities
13346         #  which are present in groups listed in theGList1 but
13347         #  are not present in groups from theGList2.
13348         #  @param theGList1 is a list of GEOM groups to include elements of.
13349         #  @param theGList2 is a list of GEOM groups to exclude elements of.
13350         #  @param theName Object name; when specified, this parameter is used
13351         #         for result publication in the study. Otherwise, if automatic
13352         #         publication is switched on, default value is used for result name.
13353         #
13354         #  @return a newly created GEOM group.
13355         #
13356         #  @ref tui_cut_groups_anchor "Example"
13357         @ManageTransactions("GroupOp")
13358         def CutListOfGroups (self, theGList1, theGList2, theName=None):
13359             """
13360             Cut of lists of groups.
13361             New group is created. It will contain only entities
13362             which are present in groups listed in theGList1 but
13363             are not present in groups from theGList2.
13364
13365             Parameters:
13366                 theGList1 is a list of GEOM groups to include elements of.
13367                 theGList2 is a list of GEOM groups to exclude elements of.
13368                 theName Object name; when specified, this parameter is used
13369                         for result publication in the study. Otherwise, if automatic
13370                         publication is switched on, default value is used for result name.
13371
13372             Returns:
13373                 a newly created GEOM group.
13374             """
13375             # Example: see GEOM_TestOthers.py
13376             aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
13377             RaiseIfFailed("CutListOfGroups", self.GroupOp)
13378             self._autoPublish(aGroup, theName, "group")
13379             return aGroup
13380
13381         ## Returns a list of sub-objects ID stored in the group
13382         #  @param theGroup is a GEOM group for which a list of IDs is requested
13383         #
13384         #  @ref swig_GetObjectIDs "Example"
13385         @ManageTransactions("GroupOp")
13386         def GetObjectIDs(self,theGroup):
13387             """
13388             Returns a list of sub-objects ID stored in the group
13389
13390             Parameters:
13391                 theGroup is a GEOM group for which a list of IDs is requested
13392             """
13393             # Example: see GEOM_TestOthers.py
13394             ListIDs = self.GroupOp.GetObjects(theGroup)
13395             RaiseIfFailed("GetObjects", self.GroupOp)
13396             return ListIDs
13397
13398         ## Returns a type of sub-objects stored in the group
13399         #  @param theGroup is a GEOM group which type is returned.
13400         #
13401         #  @ref swig_GetType "Example"
13402         @ManageTransactions("GroupOp")
13403         def GetType(self,theGroup):
13404             """
13405             Returns a type of sub-objects stored in the group
13406
13407             Parameters:
13408                 theGroup is a GEOM group which type is returned.
13409             """
13410             # Example: see GEOM_TestOthers.py
13411             aType = self.GroupOp.GetType(theGroup)
13412             RaiseIfFailed("GetType", self.GroupOp)
13413             return aType
13414
13415         ## Convert a type of geom object from id to string value
13416         #  @param theId is a GEOM object type id.
13417         #  @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13418         #  @ref swig_GetType "Example"
13419         def ShapeIdToType(self, theId):
13420             """
13421             Convert a type of geom object from id to string value
13422
13423             Parameters:
13424                 theId is a GEOM object type id.
13425
13426             Returns:
13427                 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13428             """
13429             if theId == 0:
13430                 return "COPY"
13431             if theId == 1:
13432                 return "IMPORT"
13433             if theId == 2:
13434                 return "POINT"
13435             if theId == 3:
13436                 return "VECTOR"
13437             if theId == 4:
13438                 return "PLANE"
13439             if theId == 5:
13440                 return "LINE"
13441             if theId == 6:
13442                 return "TORUS"
13443             if theId == 7:
13444                 return "BOX"
13445             if theId == 8:
13446                 return "CYLINDER"
13447             if theId == 9:
13448                 return "CONE"
13449             if theId == 10:
13450                 return "SPHERE"
13451             if theId == 11:
13452                 return "PRISM"
13453             if theId == 12:
13454                 return "REVOLUTION"
13455             if theId == 13:
13456                 return "BOOLEAN"
13457             if theId == 14:
13458                 return "PARTITION"
13459             if theId == 15:
13460                 return "POLYLINE"
13461             if theId == 16:
13462                 return "CIRCLE"
13463             if theId == 17:
13464                 return "SPLINE"
13465             if theId == 18:
13466                 return "ELLIPSE"
13467             if theId == 19:
13468                 return "CIRC_ARC"
13469             if theId == 20:
13470                 return "FILLET"
13471             if theId == 21:
13472                 return "CHAMFER"
13473             if theId == 22:
13474                 return "EDGE"
13475             if theId == 23:
13476                 return "WIRE"
13477             if theId == 24:
13478                 return "FACE"
13479             if theId == 25:
13480                 return "SHELL"
13481             if theId == 26:
13482                 return "SOLID"
13483             if theId == 27:
13484                 return "COMPOUND"
13485             if theId == 28:
13486                 return "SUBSHAPE"
13487             if theId == 29:
13488                 return "PIPE"
13489             if theId == 30:
13490                 return "ARCHIMEDE"
13491             if theId == 31:
13492                 return "FILLING"
13493             if theId == 32:
13494                 return "EXPLODE"
13495             if theId == 33:
13496                 return "GLUED"
13497             if theId == 34:
13498                 return "SKETCHER"
13499             if theId == 35:
13500                 return "CDG"
13501             if theId == 36:
13502                 return "FREE_BOUNDS"
13503             if theId == 37:
13504                 return "GROUP"
13505             if theId == 38:
13506                 return "BLOCK"
13507             if theId == 39:
13508                 return "MARKER"
13509             if theId == 40:
13510                 return "THRUSECTIONS"
13511             if theId == 41:
13512                 return "COMPOUNDFILTER"
13513             if theId == 42:
13514                 return "SHAPES_ON_SHAPE"
13515             if theId == 43:
13516                 return "ELLIPSE_ARC"
13517             if theId == 44:
13518                 return "3DSKETCHER"
13519             if theId == 45:
13520                 return "FILLET_2D"
13521             if theId == 46:
13522                 return "FILLET_1D"
13523             if theId == 201:
13524                 return "PIPETSHAPE"
13525             return "Shape Id not exist."
13526
13527         ## Returns a main shape associated with the group
13528         #  @param theGroup is a GEOM group for which a main shape object is requested
13529         #  @return a GEOM object which is a main shape for theGroup
13530         #
13531         #  @ref swig_GetMainShape "Example"
13532         @ManageTransactions("GroupOp")
13533         def GetMainShape(self,theGroup):
13534             """
13535             Returns a main shape associated with the group
13536
13537             Parameters:
13538                 theGroup is a GEOM group for which a main shape object is requested
13539
13540             Returns:
13541                 a GEOM object which is a main shape for theGroup
13542
13543             Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13544             """
13545             # Example: see GEOM_TestOthers.py
13546             anObj = self.GroupOp.GetMainShape(theGroup)
13547             RaiseIfFailed("GetMainShape", self.GroupOp)
13548             return anObj
13549
13550         ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13551         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
13552         #  @param theShape given shape (see GEOM.GEOM_Object)
13553         #  @param min_length minimum length of edges of theShape
13554         #  @param max_length maximum length of edges of theShape
13555         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13556         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13557         #  @param theName Object name; when specified, this parameter is used
13558         #         for result publication in the study. Otherwise, if automatic
13559         #         publication is switched on, default value is used for result name.
13560         #
13561         #  @return a newly created GEOM group of edges
13562         #
13563         #  @@ref swig_todo "Example"
13564         def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13565             """
13566             Create group of edges of theShape, whose length is in range [min_length, max_length].
13567             If include_min/max == 0, edges with length == min/max_length will not be included in result.
13568
13569             Parameters:
13570                 theShape given shape
13571                 min_length minimum length of edges of theShape
13572                 max_length maximum length of edges of theShape
13573                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13574                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13575                 theName Object name; when specified, this parameter is used
13576                         for result publication in the study. Otherwise, if automatic
13577                         publication is switched on, default value is used for result name.
13578
13579              Returns:
13580                 a newly created GEOM group of edges.
13581             """
13582             edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13583             edges_in_range = []
13584             for edge in edges:
13585                 Props = self.BasicProperties(edge)
13586                 if min_length <= Props[0] and Props[0] <= max_length:
13587                     if (not include_min) and (min_length == Props[0]):
13588                         skip = 1
13589                     else:
13590                         if (not include_max) and (Props[0] == max_length):
13591                             skip = 1
13592                         else:
13593                             edges_in_range.append(edge)
13594
13595             if len(edges_in_range) <= 0:
13596                 print("No edges found by given criteria")
13597                 return None
13598
13599             # note: auto-publishing is done in self.CreateGroup()
13600             group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13601             self.UnionList(group_edges, edges_in_range)
13602
13603             return group_edges
13604
13605         ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13606         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
13607         #  @param min_length minimum length of edges of selected shape
13608         #  @param max_length maximum length of edges of selected shape
13609         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13610         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13611         #  @return a newly created GEOM group of edges
13612         #  @ref swig_todo "Example"
13613         def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13614             """
13615             Create group of edges of selected shape, whose length is in range [min_length, max_length].
13616             If include_min/max == 0, edges with length == min/max_length will not be included in result.
13617
13618             Parameters:
13619                 min_length minimum length of edges of selected shape
13620                 max_length maximum length of edges of selected shape
13621                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13622                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13623
13624              Returns:
13625                 a newly created GEOM group of edges.
13626             """
13627             nb_selected = sg.SelectedCount()
13628             if nb_selected < 1:
13629                 print("Select a shape before calling this function, please.")
13630                 return 0
13631             if nb_selected > 1:
13632                 print("Only one shape must be selected")
13633                 return 0
13634
13635             id_shape = sg.getSelected(0)
13636             shape = IDToObject( id_shape )
13637
13638             group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13639
13640             left_str  = " < "
13641             right_str = " < "
13642             if include_min: left_str  = " <= "
13643             if include_max: right_str  = " <= "
13644
13645             self.addToStudyInFather(shape, group_edges, "Group of edges with " + repr(min_length)
13646                                     + left_str + "length" + right_str + repr(max_length))
13647
13648             sg.updateObjBrowser()
13649
13650             return group_edges
13651
13652         # end of l3_groups
13653         ## @}
13654
13655         #@@ insert new functions before this line @@ do not remove this line @@#
13656
13657         ## Create a copy of the given object
13658         #
13659         #  @param theOriginal geometry object for copy
13660         #  @param theName Object name; when specified, this parameter is used
13661         #         for result publication in the study. Otherwise, if automatic
13662         #         publication is switched on, default value is used for result name.
13663         #
13664         #  @return New GEOM_Object, containing the copied shape.
13665         #
13666         #  @ingroup l1_geomBuilder_auxiliary
13667         #  @ref swig_MakeCopy "Example"
13668         @ManageTransactions("InsertOp")
13669         def MakeCopy(self, theOriginal, theName=None):
13670             """
13671             Create a copy of the given object
13672
13673             Parameters:
13674                 theOriginal geometry object for copy
13675                 theName Object name; when specified, this parameter is used
13676                         for result publication in the study. Otherwise, if automatic
13677                         publication is switched on, default value is used for result name.
13678
13679             Returns:
13680                 New GEOM_Object, containing the copied shape.
13681
13682             Example of usage: Copy = geompy.MakeCopy(Box)
13683             """
13684             # Example: see GEOM_TestAll.py
13685             anObj = self.InsertOp.MakeCopy(theOriginal)
13686             RaiseIfFailed("MakeCopy", self.InsertOp)
13687             self._autoPublish(anObj, theName, "copy")
13688             return anObj
13689
13690         ## Add Path to load python scripts from
13691         #  @param Path a path to load python scripts from
13692         #  @ingroup l1_geomBuilder_auxiliary
13693         def addPath(self,Path):
13694             """
13695             Add Path to load python scripts from
13696
13697             Parameters:
13698                 Path a path to load python scripts from
13699             """
13700             if (sys.path.count(Path) < 1):
13701                 sys.path.append(Path)
13702                 pass
13703             pass
13704
13705         ## Load marker texture from the file
13706         #  @param Path a path to the texture file
13707         #  @return unique texture identifier
13708         #  @ingroup l1_geomBuilder_auxiliary
13709         @ManageTransactions("InsertOp")
13710         def LoadTexture(self, Path):
13711             """
13712             Load marker texture from the file
13713
13714             Parameters:
13715                 Path a path to the texture file
13716
13717             Returns:
13718                 unique texture identifier
13719             """
13720             # Example: see GEOM_TestAll.py
13721             ID = self.InsertOp.LoadTexture(Path)
13722             RaiseIfFailed("LoadTexture", self.InsertOp)
13723             return ID
13724
13725         ## Get internal name of the object based on its study entry
13726         #  @note This method does not provide an unique identifier of the geometry object.
13727         #  @note This is internal function of GEOM component, though it can be used outside it for
13728         #  appropriate reason (e.g. for identification of geometry object).
13729         #  @param obj geometry object
13730         #  @return unique object identifier
13731         #  @ingroup l1_geomBuilder_auxiliary
13732         def getObjectID(self, obj):
13733             """
13734             Get internal name of the object based on its study entry.
13735             Note: this method does not provide an unique identifier of the geometry object.
13736             It is an internal function of GEOM component, though it can be used outside GEOM for
13737             appropriate reason (e.g. for identification of geometry object).
13738
13739             Parameters:
13740                 obj geometry object
13741
13742             Returns:
13743                 unique object identifier
13744             """
13745             ID = ""
13746             entry = salome.ObjectToID(obj)
13747             if entry is not None:
13748                 lst = entry.split(":")
13749                 if len(lst) > 0:
13750                     ID = lst[-1] # -1 means last item in the list
13751                     return "GEOM_" + ID
13752             return ID
13753
13754
13755
13756         ## Add marker texture. @a Width and @a Height parameters
13757         #  specify width and height of the texture in pixels.
13758         #  If @a RowData is @c True, @a Texture parameter should represent texture data
13759         #  packed into the byte array. If @a RowData is @c False (default), @a Texture
13760         #  parameter should be unpacked string, in which '1' symbols represent opaque
13761         #  pixels and '0' represent transparent pixels of the texture bitmap.
13762         #
13763         #  @param Width texture width in pixels
13764         #  @param Height texture height in pixels
13765         #  @param Texture texture data
13766         #  @param RowData if @c True, @a Texture data are packed in the byte stream
13767         #  @return unique texture identifier
13768         #  @ingroup l1_geomBuilder_auxiliary
13769         @ManageTransactions("InsertOp")
13770         def AddTexture(self, Width, Height, Texture, RowData=False):
13771             """
13772             Add marker texture. Width and Height parameters
13773             specify width and height of the texture in pixels.
13774             If RowData is True, Texture parameter should represent texture data
13775             packed into the byte array. If RowData is False (default), Texture
13776             parameter should be unpacked string, in which '1' symbols represent opaque
13777             pixels and '0' represent transparent pixels of the texture bitmap.
13778
13779             Parameters:
13780                 Width texture width in pixels
13781                 Height texture height in pixels
13782                 Texture texture data
13783                 RowData if True, Texture data are packed in the byte stream
13784
13785             Returns:
13786                 return unique texture identifier
13787             """
13788             if not RowData: Texture = PackData(Texture)
13789             ID = self.InsertOp.AddTexture(Width, Height, Texture)
13790             RaiseIfFailed("AddTexture", self.InsertOp)
13791             return ID
13792
13793         ## Transfer not topological data from one GEOM object to another.
13794         #
13795         #  @param theObjectFrom the source object of non-topological data
13796         #  @param theObjectTo the destination object of non-topological data
13797         #  @param theFindMethod method to search sub-shapes of theObjectFrom
13798         #         in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13799         #         GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13800         #         Other values of GEOM.find_shape_method are not supported.
13801         #
13802         #  @return True in case of success; False otherwise.
13803         #
13804         #  @ingroup l1_geomBuilder_auxiliary
13805         #
13806         #  @ref swig_TransferData "Example"
13807         @ManageTransactions("InsertOp")
13808         def TransferData(self, theObjectFrom, theObjectTo,
13809                          theFindMethod=GEOM.FSM_GetInPlace):
13810             """
13811             Transfer not topological data from one GEOM object to another.
13812
13813             Parameters:
13814                 theObjectFrom the source object of non-topological data
13815                 theObjectTo the destination object of non-topological data
13816                 theFindMethod method to search sub-shapes of theObjectFrom
13817                               in shape theObjectTo. Possible values are:
13818                               GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13819                               and GEOM.FSM_GetInPlace_Old. Other values of
13820                               GEOM.find_shape_method are not supported.
13821
13822             Returns:
13823                 True in case of success; False otherwise.
13824
13825             # Example: see GEOM_TestOthers.py
13826             """
13827             # Example: see GEOM_TestAll.py
13828             isOk = self.InsertOp.TransferData(theObjectFrom,
13829                                                theObjectTo, theFindMethod)
13830             RaiseIfFailed("TransferData", self.InsertOp)
13831             return isOk
13832
13833         ## Creates a new folder object. It is a container for any GEOM objects.
13834         #  @param Name name of the container
13835         #  @param Father parent object. If None,
13836         #         folder under 'Geometry' root object will be created.
13837         #  @return a new created folder
13838         #  @ingroup l1_publish_data
13839         def NewFolder(self, Name, Father=None):
13840             """
13841             Create a new folder object. It is an auxiliary container for any GEOM objects.
13842
13843             Parameters:
13844                 Name name of the container
13845                 Father parent object. If None,
13846                 folder under 'Geometry' root object will be created.
13847
13848             Returns:
13849                 a new created folder
13850             """
13851             return self.CreateFolder(Name, Father)
13852
13853         ## Move object to the specified folder
13854         #  @param Object object to move
13855         #  @param Folder target folder
13856         #  @ingroup l1_publish_data
13857         def PutToFolder(self, Object, Folder):
13858             """
13859             Move object to the specified folder
13860
13861             Parameters:
13862                 Object object to move
13863                 Folder target folder
13864             """
13865             self.MoveToFolder(Object, Folder)
13866             pass
13867
13868         ## Move list of objects to the specified folder
13869         #  @param ListOfSO list of objects to move
13870         #  @param Folder target folder
13871         #  @ingroup l1_publish_data
13872         def PutListToFolder(self, ListOfSO, Folder):
13873             """
13874             Move list of objects to the specified folder
13875
13876             Parameters:
13877                 ListOfSO list of objects to move
13878                 Folder target folder
13879             """
13880             self.MoveListToFolder(ListOfSO, Folder)
13881             pass
13882
13883         ## @addtogroup l2_field
13884         ## @{
13885
13886         ## Creates a field
13887         #  @param shape the shape the field lies on
13888         #  @param name the field name
13889         #  @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13890         #  @param dimension dimension of the shape the field lies on
13891         #         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13892         #  @param componentNames names of components
13893         #  @return a created field
13894         @ManageTransactions("FieldOp")
13895         def CreateField(self, shape, name, type, dimension, componentNames):
13896             """
13897             Creates a field
13898
13899             Parameters:
13900                 shape the shape the field lies on
13901                 name  the field name
13902                 type  type of field data
13903                 dimension dimension of the shape the field lies on
13904                           0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13905                 componentNames names of components
13906
13907             Returns:
13908                 a created field
13909             """
13910             if isinstance( type, int ):
13911                 if type < 0 or type > 3:
13912                     raise RuntimeError("CreateField : Error: data type must be within [0-3] range")
13913                 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13914
13915             f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13916             RaiseIfFailed("CreateField", self.FieldOp)
13917             global geom
13918             geom._autoPublish( f, "", name)
13919             return f
13920
13921         ## Removes a field from the GEOM component
13922         #  @param field the field to remove
13923         def RemoveField(self, field):
13924             "Removes a field from the GEOM component"
13925             global geom
13926             if isinstance( field, GEOM._objref_GEOM_Field ):
13927                 geom.RemoveObject( field )
13928             elif isinstance( field, geomField ):
13929                 geom.RemoveObject( field.field )
13930             else:
13931                 raise RuntimeError("RemoveField() : the object is not a field")
13932             return
13933
13934         ## Returns number of fields on a shape
13935         @ManageTransactions("FieldOp")
13936         def CountFields(self, shape):
13937             "Returns number of fields on a shape"
13938             nb = self.FieldOp.CountFields( shape )
13939             RaiseIfFailed("CountFields", self.FieldOp)
13940             return nb
13941
13942         ## Returns all fields on a shape
13943         @ManageTransactions("FieldOp")
13944         def GetFields(self, shape):
13945             "Returns all fields on a shape"
13946             ff = self.FieldOp.GetFields( shape )
13947             RaiseIfFailed("GetFields", self.FieldOp)
13948             return ff
13949
13950         ## Returns a field on a shape by its name
13951         @ManageTransactions("FieldOp")
13952         def GetField(self, shape, name):
13953             "Returns a field on a shape by its name"
13954             f = self.FieldOp.GetField( shape, name )
13955             RaiseIfFailed("GetField", self.FieldOp)
13956             return f
13957
13958         # end of l2_field
13959         ## @}
13960
13961         ## @addtogroup l2_testing
13962         ## @{
13963
13964         ## Build a mesh on the given shape.
13965         # @param shape the source shape
13966         # @param linear_deflection linear deflection coefficient
13967         # @param is_relative says if given value of deflection is relative to shape's bounding box
13968         # @param angular_deflection angular deflection for edges in degrees
13969         # @return True in case of success; otherwise False.
13970         @ManageTransactions("TestOp")
13971         def Tesselate(self, shape, linear_deflection=0, is_relative=True, angular_deflection=0):
13972             """Build a mesh on the given shape.
13973
13974             Parameters:
13975                 shape the source shape
13976                 linear_deflection linear deflection coefficient
13977                 is_relative says if given value of deflection is relative to shape's bounding box
13978                 angular_deflection angular deflection for edges in degrees
13979
13980             Returns:
13981                 True in case of success; otherwise False.
13982             """
13983             if angular_deflection > 0:
13984                 angular_deflection = angular_deflection * math.pi / 180.
13985             r = self.TestOp.Tesselate(shape, linear_deflection, is_relative, angular_deflection)
13986             RaiseIfFailed("Tesselate", self.TestOp)
13987             return r
13988
13989         # end of l2_testing
13990         ## @}
13991
13992
13993 # Register the new proxy for GEOM_Gen
13994 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13995
13996
13997 ## Field on Geometry
13998 #  @ingroup l2_field
13999 class geomField( GEOM._objref_GEOM_Field ):
14000
14001     def __init__(self, *args):
14002         GEOM._objref_GEOM_Field.__init__(self, *args)
14003         self.field = GEOM._objref_GEOM_Field
14004         return
14005
14006     ## Returns the shape the field lies on
14007     def getShape(self):
14008         "Returns the shape the field lies on"
14009         return self.field.GetShape(self)
14010
14011     ## Returns the field name
14012     def getName(self):
14013         "Returns the field name"
14014         return self.field.GetName(self)
14015
14016     ## Returns type of field data as integer [0-3]
14017     def getType(self):
14018         "Returns type of field data"
14019         return EnumToLong(self.field.GetDataType(self))
14020
14021     ## Returns type of field data:
14022     #  one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
14023     def getTypeEnum(self):
14024         "Returns type of field data"
14025         return self.field.GetDataType(self)
14026
14027     ## Returns dimension of the shape the field lies on:
14028     #  0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
14029     def getDimension(self):
14030         """Returns dimension of the shape the field lies on:
14031         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
14032         return self.field.GetDimension(self)
14033
14034     ## Returns names of components
14035     def getComponents(self):
14036         "Returns names of components"
14037         return self.field.GetComponents(self)
14038
14039     ## Adds a time step to the field
14040     #  @param step the time step number further used as the step identifier
14041     #  @param stamp the time step time
14042     #  @param values the values of the time step
14043     def addStep(self, step, stamp, values):
14044         "Adds a time step to the field"
14045         stp = self.field.AddStep( self, step, stamp )
14046         if not stp:
14047             raise RuntimeError("Field.addStep() : Error: step %s already exists in this field"%step)
14048         global geom
14049         geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
14050         self.setValues( step, values )
14051         return stp
14052
14053     ## Remove a time step from the field
14054     def removeStep(self,step):
14055         "Remove a time step from the field"
14056         stepSO = None
14057         try:
14058             stepObj = self.field.GetStep( self, step )
14059             if stepObj:
14060                 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
14061         except:
14062             #import traceback
14063             #traceback.print_exc()
14064             pass
14065         self.field.RemoveStep( self, step )
14066         if stepSO:
14067             geom.myBuilder.RemoveObjectWithChildren( stepSO )
14068         return
14069
14070     ## Returns number of time steps in the field
14071     def countSteps(self):
14072         "Returns number of time steps in the field"
14073         return self.field.CountSteps(self)
14074
14075     ## Returns a list of time step IDs in the field
14076     def getSteps(self):
14077         "Returns a list of time step IDs in the field"
14078         return self.field.GetSteps(self)
14079
14080     ## Returns a time step by its ID
14081     def getStep(self,step):
14082         "Returns a time step by its ID"
14083         stp = self.field.GetStep(self, step)
14084         if not stp:
14085             raise RuntimeError("Step %s is missing from this field"%step)
14086         return stp
14087
14088     ## Returns the time of the field step
14089     def getStamp(self,step):
14090         "Returns the time of the field step"
14091         return self.getStep(step).GetStamp()
14092
14093     ## Changes the time of the field step
14094     def setStamp(self, step, stamp):
14095         "Changes the time of the field step"
14096         return self.getStep(step).SetStamp(stamp)
14097
14098     ## Returns values of the field step
14099     def getValues(self, step):
14100         "Returns values of the field step"
14101         return self.getStep(step).GetValues()
14102
14103     ## Changes values of the field step
14104     def setValues(self, step, values):
14105         "Changes values of the field step"
14106         stp = self.getStep(step)
14107         errBeg = "Field.setValues(values) : Error: "
14108         try:
14109             ok = stp.SetValues( values )
14110         except Exception as e:
14111             excStr = str(e)
14112             if excStr.find("WrongPythonType") > 0:
14113                 raise RuntimeError(errBeg +\
14114                       "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:])
14115             raise RuntimeError(errBeg + str(e))
14116         if not ok:
14117             nbOK = self.field.GetArraySize(self)
14118             nbKO = len(values)
14119             if nbOK != nbKO:
14120                 raise RuntimeError(errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO))
14121             else:
14122                 raise RuntimeError(errBeg + "failed")
14123         return
14124
14125     pass # end of class geomField
14126
14127 # Register the new proxy for GEOM_Field
14128 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
14129
14130
14131 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
14132 #  interface to GEOM operations.
14133 #
14134 #  Typical use is:
14135 #  \code
14136 #    import salome
14137 #    salome.salome_init()
14138 #    from salome.geom import geomBuilder
14139 #    geompy = geomBuilder.New()
14140 #  \endcode
14141 #  @param  instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
14142 #  @return geomBuilder instance
14143 def New( instance=None):
14144     """
14145     Create a new geomBuilder instance.The geomBuilder class provides the Python
14146     interface to GEOM operations.
14147
14148     Typical use is:
14149         import salome
14150         salome.salome_init()
14151         from salome.geom import geomBuilder
14152         geompy = geomBuilder.New()
14153
14154     Parameters:
14155         instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
14156     Returns:
14157         geomBuilder instance
14158     """
14159     #print "New geomBuilder ", study, instance
14160     global engine
14161     global geom
14162     global doLcc
14163     if instance and isinstance( instance, SALOMEDS._objref_Study ):
14164         import sys
14165         sys.stderr.write("Warning: 'study' argument is no more needed in geomBuilder.New(). Consider updating your script!!!\n\n")
14166         instance = None
14167     engine = instance
14168     if engine is None:
14169       doLcc = True
14170     geom = geomBuilder()
14171     assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
14172     geom.init_geom()
14173     return geom
14174
14175
14176 # Register methods from the plug-ins in the geomBuilder class 
14177 plugins_var = os.environ.get( "GEOM_PluginsList" )
14178
14179 plugins = None
14180 if plugins_var is not None:
14181     plugins = plugins_var.split( ":" )
14182     plugins=[x for x in plugins if len(x)>0]
14183 if plugins is not None:
14184     for pluginName in plugins:
14185         pluginBuilderName = pluginName + "Builder"
14186         try:
14187             exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
14188         except Exception as e:
14189             from salome_utils import verbose
14190             print("Exception while loading %s: %s" % ( pluginBuilderName, e ))
14191             continue
14192         exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
14193         plugin = eval( pluginBuilderName )
14194         
14195         # add methods from plugin module to the geomBuilder class
14196         for k in dir( plugin ):
14197             if k[0] == '_': continue
14198             method = getattr( plugin, k )
14199             if type( method ).__name__ == 'function':
14200                 if not hasattr( geomBuilder, k ):
14201                     setattr( geomBuilder, k, method )
14202                 pass
14203             pass
14204         del pluginName
14205         pass
14206     pass