Salome HOME
baf55e6c40e77dc30c5b9ee6e26170f219affc81
[modules/geom.git] / src / GEOM_SWIG / geomBuilder.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2023  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 from salome.geom.canonicalrecognition import CanonicalRecognition
264 from salome.geom.conformity import CheckConformity
265 from salome.geom.proximity import ShapeProximity
266
267 # In case the omniORBpy EnumItem class does not fully support Python 3
268 # (for instance in version 4.2.1-2), the comparison ordering methods must be
269 # defined
270 #
271 try:
272     GEOM.COMPOUND < GEOM.SOLID
273 except TypeError:
274     def enumitem_eq(self, other):
275         try:
276             if isinstance(other, omniORB.EnumItem):
277                 if other._parent_id == self._parent_id:
278                     return self._v == other._v
279                 else:
280                     return self._parent_id == other._parent_id
281             else:
282                 return id(self) == id(other)
283         except:
284             return id(self) == id(other)
285
286     def enumitem_lt(self, other):
287         try:
288             if isinstance(other, omniORB.EnumItem):
289                 if other._parent_id == self._parent_id:
290                     return self._v < other._v
291                 else:
292                     return self._parent_id < other._parent_id
293             else:
294                 return id(self) < id(other)
295         except:
296             return id(self) < id(other)
297
298     def enumitem_le(self, other):
299         try:
300             if isinstance(other, omniORB.EnumItem):
301                 if other._parent_id == self._parent_id:
302                     return self._v <= other._v
303                 else:
304                     return self._parent_id <= other._parent_id
305             else:
306                 return id(self) <= id(other)
307         except:
308             return id(self) <= id(other)
309
310     def enumitem_gt(self, other):
311         try:
312             if isinstance(other, omniORB.EnumItem):
313                 if other._parent_id == self._parent_id:
314                     return self._v > other._v
315                 else:
316                     return self._parent_id > other._parent_id
317             else:
318                 return id(self) > id(other)
319         except:
320             return id(self) > id(other)
321
322     def enumitem_ge(self, other):
323         try:
324             if isinstance(other, omniORB.EnumItem):
325                 if other._parent_id == self._parent_id:
326                     return self._v >= other._v
327                 else:
328                     return self._parent_id >= other._parent_id
329             else:
330                 return id(self) >= id(other)
331         except:
332             return id(self) >= id(other)
333
334     GEOM.omniORB.EnumItem.__eq__ = enumitem_eq
335     GEOM.omniORB.EnumItem.__lt__ = enumitem_lt
336     GEOM.omniORB.EnumItem.__le__ = enumitem_le
337     GEOM.omniORB.EnumItem.__gt__ = enumitem_gt
338     GEOM.omniORB.EnumItem.__ge__ = enumitem_ge
339     omniORB.EnumItem.__eq__ = enumitem_eq
340     omniORB.EnumItem.__lt__ = enumitem_lt
341     omniORB.EnumItem.__le__ = enumitem_le
342     omniORB.EnumItem.__gt__ = enumitem_gt
343     omniORB.EnumItem.__ge__ = enumitem_ge
344
345 # service function
346 def _toListOfNames(_names, _size=-1):
347     l = []
348     import types
349     if type(_names) in [list, tuple]:
350         for i in _names: l.append(i)
351     elif _names:
352         l.append(_names)
353     if l and len(l) < _size:
354         for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
355     return l
356
357 # Decorator function to manage transactions for all geometric operations.
358 def ManageTransactions(theOpeName):
359     def MTDecorator(theFunction):
360         # To keep the original function name an documentation.
361         @functools.wraps(theFunction)
362         def OpenCallClose(self, *args, **kwargs):
363             # Open transaction
364             anOperation = getattr(self, theOpeName)
365             anOperation.StartOperation()
366             try:
367                 # Call the function
368                 res = theFunction(self, *args, **kwargs)
369                 # Commit transaction
370                 anOperation.FinishOperation()
371                 return res
372             except:
373                 # Abort transaction
374                 anOperation.AbortOperation()
375                 raise
376         return OpenCallClose
377     return MTDecorator
378
379 ## Raise an Error, containing the Method_name, if Operation is Failed
380 ## @ingroup l1_geomBuilder_auxiliary
381 def RaiseIfFailed (Method_name, Operation):
382     if not Operation.IsDone() and Operation.GetErrorCode() != "NOT_FOUND_ANY":
383         raise RuntimeError(Method_name + " : " + Operation.GetErrorCode())
384
385 def PrintOrRaise(message, raiseException=False):
386     if raiseException:
387         raise RuntimeError(message)
388     else:
389         print(message)
390
391 ## Return list of variables value from salome notebook
392 ## @ingroup l1_geomBuilder_auxiliary
393 def ParseParameters(*parameters):
394     Result = []
395     StringResult = []
396     for parameter in parameters:
397         if isinstance(parameter, list):
398             lResults = ParseParameters(*parameter)
399             if len(lResults) > 0:
400                 Result.append(lResults[:-1])
401                 StringResult += lResults[-1].split(":")
402                 pass
403             pass
404         else:
405             if isinstance(parameter,str):
406                 if notebook.isVariable(parameter):
407                     Result.append(notebook.get(parameter))
408                 else:
409                     raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
410                 pass
411             else:
412                 Result.append(parameter)
413                 pass
414             StringResult.append(str(parameter))
415             pass
416         pass
417     if Result:
418         Result.append(":".join(StringResult))
419     else:
420         Result = ":".join(StringResult)
421     return Result
422
423 ## Return list of variables value from salome notebook
424 ## @ingroup l1_geomBuilder_auxiliary
425 def ParseList(list):
426     Result = []
427     StringResult = ""
428     for parameter in list:
429         if isinstance(parameter,str) and notebook.isVariable(parameter):
430             Result.append(str(notebook.get(parameter)))
431             pass
432         else:
433             Result.append(str(parameter))
434             pass
435
436         StringResult = StringResult + str(parameter)
437         StringResult = StringResult + ":"
438         pass
439     StringResult = StringResult[:len(StringResult)-1]
440     return Result, StringResult
441
442 ## Return list of variables value from salome notebook
443 ## @ingroup l1_geomBuilder_auxiliary
444 def ParseSketcherCommand(command):
445     Result = ""
446     StringResult = ""
447     sections = command.split(":")
448     for section in sections:
449         parameters = section.split(" ")
450         paramIndex = 1
451         for parameter in parameters:
452             if paramIndex > 1 and parameter.find("'") != -1:
453                 parameter = parameter.replace("'","")
454                 if notebook.isVariable(parameter):
455                     Result = Result + str(notebook.get(parameter)) + " "
456                     pass
457                 else:
458                     raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
459                     pass
460                 pass
461             else:
462                 Result = Result + str(parameter) + " "
463                 pass
464             if paramIndex > 1:
465                 StringResult = StringResult + parameter
466                 StringResult = StringResult + ":"
467                 pass
468             paramIndex = paramIndex + 1
469             pass
470         Result = Result[:len(Result)-1] + ":"
471         pass
472     Result = Result[:len(Result)-1]
473     return Result, StringResult
474
475 ## Helper function which can be used to pack the passed string to the byte data.
476 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
477 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
478 ## For example,
479 ## \code
480 ## val = PackData("10001110") # val = 0xAE
481 ## val = PackData("1")        # val = 0x80
482 ## \endcode
483 ## @param data unpacked data - a string containing '1' and '0' symbols
484 ## @return data packed to the byte stream
485 ## @ingroup l1_geomBuilder_auxiliary
486 def PackData(data):
487     """
488     Helper function which can be used to pack the passed string to the byte data.
489     Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
490     If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
491
492     Parameters:
493         data unpacked data - a string containing '1' and '0' symbols
494
495     Returns:
496         data packed to the byte stream
497
498     Example of usage:
499         val = PackData("10001110") # val = 0xAE
500         val = PackData("1")        # val = 0x80
501     """
502     bytes = len(data)/8
503     if len(data)%8: bytes += 1
504     res = ""
505     for b in range(bytes):
506         d = data[b*8:(b+1)*8]
507         val = 0
508         for i in range(8):
509             val *= 2
510             if i < len(d):
511                 if d[i] == "1": val += 1
512                 elif d[i] != "0":
513                     raise "Invalid symbol %s" % d[i]
514                 pass
515             pass
516         res += chr(val)
517         pass
518     return res
519
520 ## Read bitmap texture from the text file.
521 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
522 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
523 ## The function returns width and height of the pixmap in pixels and byte stream representing
524 ## texture bitmap itself.
525 ##
526 ## This function can be used to read the texture to the byte stream in order to pass it to
527 ## the AddTexture() function of geomBuilder class.
528 ## For example,
529 ## \code
530 ## from salome.geom import geomBuilder
531 ## geompy = geomBuilder.New()
532 ## texture = geompy.readtexture('mytexture.dat')
533 ## texture = geompy.AddTexture(*texture)
534 ## obj.SetMarkerTexture(texture)
535 ## \endcode
536 ## @param fname texture file name
537 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
538 ## @ingroup l1_geomBuilder_auxiliary
539 def ReadTexture(fname):
540     """
541     Read bitmap texture from the text file.
542     In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
543     A zero symbol ('0') represents transparent pixel of the texture bitmap.
544     The function returns width and height of the pixmap in pixels and byte stream representing
545     texture bitmap itself.
546     This function can be used to read the texture to the byte stream in order to pass it to
547     the AddTexture() function of geomBuilder class.
548
549     Parameters:
550         fname texture file name
551
552     Returns:
553         sequence of tree values: texture's width, height in pixels and its byte stream
554
555     Example of usage:
556         from salome.geom import geomBuilder
557         geompy = geomBuilder.New()
558         texture = geompy.readtexture('mytexture.dat')
559         texture = geompy.AddTexture(*texture)
560         obj.SetMarkerTexture(texture)
561     """
562     try:
563         f = open(fname)
564         lines = [ l.strip() for l in f.readlines()]
565         f.close()
566         maxlen = 0
567         if lines: maxlen = max([len(x) for x in lines])
568         lenbytes = maxlen/8
569         if maxlen%8: lenbytes += 1
570         bytedata=""
571         for line in lines:
572             if len(line)%8:
573                 lenline = (len(line)/8+1)*8
574                 pass
575             else:
576                 lenline = (len(line)/8)*8
577                 pass
578             for i in range(lenline/8):
579                 byte=""
580                 for j in range(8):
581                     if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
582                     else: byte += "0"
583                     pass
584                 bytedata += PackData(byte)
585                 pass
586             for i in range(lenline/8, lenbytes):
587                 bytedata += PackData("0")
588             pass
589         return lenbytes*8, len(lines), bytedata
590     except:
591         pass
592     return 0, 0, ""
593
594 ## Returns a long value from enumeration type
595 #  Can be used for CORBA enumerator types like GEOM.shape_type
596 #  @param theItem enumeration type
597 #  @ingroup l1_geomBuilder_auxiliary
598 def EnumToLong(theItem):
599     """
600     Returns a long value from enumeration type
601     Can be used for CORBA enumerator types like geomBuilder.ShapeType
602
603     Parameters:
604         theItem enumeration type
605     """
606     ret = theItem
607     if hasattr(theItem, "_v"): ret = theItem._v
608     return ret
609
610 ## Pack an argument into a list
611 def ToList( arg ):
612     if isinstance( arg, list ):
613         return arg
614     if hasattr( arg, "__getitem__" ):
615         return list( arg )
616     return [ arg ]
617
618 ## Information about closed/unclosed state of shell or wire
619 #  @ingroup l1_geomBuilder_auxiliary
620 class info:
621     """
622     Information about closed/unclosed state of shell or wire
623     """
624     UNKNOWN  = 0
625     CLOSED   = 1
626     UNCLOSED = 2
627
628 ## Private class used to bind calls of plugin operations to geomBuilder
629 class PluginOperation:
630   def __init__(self, operation, function):
631     self.operation = operation
632     self.function = function
633     pass
634
635   @ManageTransactions("operation")
636   def __call__(self, *args):
637     res = self.function(self.operation, *args)
638     RaiseIfFailed(self.function.__name__, self.operation)
639     return res
640
641 # Warning: geom is a singleton
642 geom = None
643 engine = None
644 doLcc = False
645 created = False
646
647 class geomBuilder(GEOM._objref_GEOM_Gen):
648
649         ## Enumeration ShapeType as a dictionary. \n
650         ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
651         #  @ingroup l1_geomBuilder_auxiliary
652         ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
653
654         ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
655         #  and a list of parameters, describing the shape.
656         #  List of parameters, describing the shape:
657         #  - COMPOUND:            [nb_solids  nb_faces  nb_edges  nb_vertices]
658         #  - COMPSOLID:           [nb_solids  nb_faces  nb_edges  nb_vertices]
659         #
660         #  - SHELL:       [info.CLOSED / info.UNCLOSED  nb_faces  nb_edges  nb_vertices]
661         #
662         #  - WIRE:        [info.CLOSED / info.UNCLOSED nb_edges  nb_vertices]
663         #
664         #  - SPHERE:       [xc yc zc            R]
665         #  - CYLINDER:     [xb yb zb  dx dy dz  R         H]
666         #  - BOX:          [xc yc zc                      ax ay az]
667         #  - ROTATED_BOX:  [xc yc zc  zx zy zz  xx xy xz  ax ay az]
668         #  - TORUS:        [xc yc zc  dx dy dz  R_1  R_2]
669         #  - CONE:         [xb yb zb  dx dy dz  R_1  R_2  H]
670         #  - POLYHEDRON:                       [nb_faces  nb_edges  nb_vertices]
671         #  - SOLID:                            [nb_faces  nb_edges  nb_vertices]
672         #
673         #  - SPHERE2D:     [xc yc zc            R]
674         #  - CYLINDER2D:   [xb yb zb  dx dy dz  R         H]
675         #  - TORUS2D:      [xc yc zc  dx dy dz  R_1  R_2]
676         #  - CONE2D:       [xc yc zc  dx dy dz  R_1  R_2  H]
677         #  - DISK_CIRCLE:  [xc yc zc  dx dy dz  R]
678         #  - DISK_ELLIPSE: [xc yc zc  dx dy dz  R_1  R_2]
679         #  - POLYGON:      [xo yo zo  dx dy dz            nb_edges  nb_vertices]
680         #  - PLANE:        [xo yo zo  dx dy dz]
681         #  - PLANAR:       [xo yo zo  dx dy dz            nb_edges  nb_vertices]
682         #  - FACE:                                       [nb_edges  nb_vertices]
683         #
684         #  - CIRCLE:       [xc yc zc  dx dy dz  R]
685         #  - ARC_CIRCLE:   [xc yc zc  dx dy dz  R         x1 y1 z1  x2 y2 z2]
686         #  - ELLIPSE:      [xc yc zc  dx dy dz  R_1  R_2]
687         #  - ARC_ELLIPSE:  [xc yc zc  dx dy dz  R_1  R_2  x1 y1 z1  x2 y2 z2]
688         #  - LINE:         [xo yo zo  dx dy dz]
689         #  - SEGMENT:      [x1 y1 z1  x2 y2 z2]
690         #  - EDGE:                                                 [nb_vertices]
691         #
692         #  - VERTEX:       [x  y  z]
693         #
694         #  - LCS:          [x y z  xx xy xz  yx yy yz  zx zy zz]
695         #  @ingroup l1_geomBuilder_auxiliary
696         kind = GEOM.GEOM_IKindOfShape
697
698         def __new__(cls, *args):
699             global engine
700             global geom
701             global doLcc
702             global created
703             #print "==== __new__ ", engine, geom, doLcc, created
704             if geom is None:
705                 # geom engine is either retrieved from engine, or created
706                 geom = engine
707                 # Following test avoids a recursive loop
708                 if doLcc:
709                     if geom is not None:
710                         # geom engine not created: existing engine found
711                         doLcc = False
712                     if doLcc and not created:
713                         doLcc = False
714                         # FindOrLoadComponent called:
715                         # 1. CORBA resolution of server
716                         # 2. the __new__ method is called again
717                         #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
718                         geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
719                         #print "====1 ",geom
720                 else:
721                     # FindOrLoadComponent not called
722                     if geom is None:
723                         # geomBuilder instance is created from lcc.FindOrLoadComponent
724                         #print "==== super ", engine, geom, doLcc, created
725                         geom = super(geomBuilder,cls).__new__(cls)
726                         #print "====2 ",geom
727                     else:
728                         # geom engine not created: existing engine found
729                         #print "==== existing ", engine, geom, doLcc, created
730                         pass
731                 #print "return geom 1 ", geom
732                 return geom
733
734             #print "return geom 2 ", geom
735             return geom
736
737         def __init__(self, *args):
738             global created
739             #print "-------- geomBuilder __init__ --- ", created, self
740             if not created:
741               created = True
742               GEOM._objref_GEOM_Gen.__init__(self, *args)
743               self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
744               self.myBuilder = None
745               self.BasicOp  = None
746               self.CurvesOp = None
747               self.PrimOp   = None
748               self.ShapesOp = None
749               self.HealOp   = None
750               self.InsertOp = None
751               self.BoolOp   = None
752               self.TrsfOp   = None
753               self.LocalOp  = None
754               self.MeasuOp  = None
755               self.BlocksOp = None
756               self.GroupOp  = None
757               self.FieldOp  = None
758               self.TestOp   = None
759             pass
760
761         ## Process object publication in the study, as follows:
762         #  - if @a theName is specified (not None), the object is published in the study
763         #    with this name, not taking into account "auto-publishing" option;
764         #  - if @a theName is NOT specified, the object is published in the study
765         #    (using default name, which can be customized using @a theDefaultName parameter)
766         #    only if auto-publishing is switched on.
767         #
768         #  @param theObj  object, a subject for publishing
769         #  @param theName object name for study
770         #  @param theDefaultName default name for the auto-publishing
771         #
772         #  @sa addToStudyAuto()
773         def _autoPublish(self, theObj, theName, theDefaultName="noname"):
774             # ---
775             def _item_name(_names, _defname, _idx=-1):
776                 if not _names: _names = _defname
777                 if type(_names) in [list, tuple]:
778                     if _idx >= 0:
779                         if _idx >= len(_names) or not _names[_idx]:
780                             if type(_defname) not in [list, tuple]:
781                                 _name = "%s_%d"%(_defname, _idx+1)
782                             elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
783                                 _name = _defname[_idx]
784                             else:
785                                 _name = "%noname_%d"%(dn, _idx+1)
786                             pass
787                         else:
788                             _name = _names[_idx]
789                         pass
790                     else:
791                         # must be wrong  usage
792                         _name = _names[0]
793                     pass
794                 else:
795                     if _idx >= 0:
796                         _name = "%s_%d"%(_names, _idx+1)
797                     else:
798                         _name = _names
799                     pass
800                 return _name
801             # ---
802             def _publish( _name, _obj ):
803                 fatherObj = None
804                 if isinstance( _obj, GEOM._objref_GEOM_Field ):
805                     fatherObj = _obj.GetShape()
806                 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
807                     fatherObj = _obj.GetField()
808                 elif not _obj.IsMainShape():
809                     fatherObj = _obj.GetMainShape()
810                     pass
811                 if fatherObj and fatherObj.GetStudyEntry():
812                     self.addToStudyInFather(fatherObj, _obj, _name)
813                 else:
814                     self.addToStudy(_obj, _name)
815                     pass
816                 return
817             # ---
818             if not theObj:
819                 return # null object
820             if not theName and not self.myMaxNbSubShapesAllowed:
821                 return # nothing to do: auto-publishing is disabled
822             if not theName and not theDefaultName:
823                 return # neither theName nor theDefaultName is given
824             import types
825             if type(theObj) in [list, tuple]:
826                 # list of objects is being published
827                 idx = 0
828                 for obj in theObj:
829                     if not obj: continue # bad object
830                     name = _item_name(theName, theDefaultName, idx)
831                     _publish( name, obj )
832                     idx = idx+1
833                     if not theName and idx == self.myMaxNbSubShapesAllowed: break
834                     pass
835                 pass
836             else:
837                 # single object is published
838                 name = _item_name(theName, theDefaultName)
839                 _publish( name, theObj )
840             pass
841
842         ## @addtogroup l1_geomBuilder_auxiliary
843         ## @{
844         def init_geom(self):
845             self.myStudy = salome.myStudy
846             self.myBuilder = self.myStudy.NewBuilder()
847
848             # load data from the study file, if necessary
849             component = self.myStudy.FindComponent("GEOM")
850             if component:
851                 self.myBuilder.LoadWith(component, self)
852
853             self.BasicOp  = self.GetIBasicOperations    ()
854             self.CurvesOp = self.GetICurvesOperations   ()
855             self.PrimOp   = self.GetI3DPrimOperations   ()
856             self.ShapesOp = self.GetIShapesOperations   ()
857             self.HealOp   = self.GetIHealingOperations  ()
858             self.InsertOp = self.GetIInsertOperations   ()
859             self.BoolOp   = self.GetIBooleanOperations  ()
860             self.TrsfOp   = self.GetITransformOperations()
861             self.LocalOp  = self.GetILocalOperations    ()
862             self.MeasuOp  = self.GetIMeasureOperations  ()
863             self.BlocksOp = self.GetIBlocksOperations   ()
864             self.GroupOp  = self.GetIGroupOperations    ()
865             self.FieldOp  = self.GetIFieldOperations    ()
866             self.TestOp   = self.GetITestOperations     ()
867
868             notebook.myStudy = self.myStudy
869             pass
870
871         def GetPluginOperations(self, libraryName):
872             op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, libraryName)
873             return op
874
875         ## Enable / disable results auto-publishing
876         #
877         #  The automatic publishing is managed in the following way:
878         #  - if @a maxNbSubShapes = 0, automatic publishing is disabled.
879         #  - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
880         #  maximum number of sub-shapes allowed for publishing is unlimited; any negative
881         #  value passed as parameter has the same effect.
882         #  - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
883         #  maximum number of sub-shapes allowed for publishing is set to specified value.
884         #
885         #  @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
886         #  @ingroup l1_publish_data
887         def addToStudyAuto(self, maxNbSubShapes=-1):
888             """
889             Enable / disable results auto-publishing
890
891             The automatic publishing is managed in the following way:
892             - if @a maxNbSubShapes = 0, automatic publishing is disabled;
893             - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
894             maximum number of sub-shapes allowed for publishing is unlimited; any negative
895             value passed as parameter has the same effect.
896             - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
897             maximum number of sub-shapes allowed for publishing is set to this value.
898
899             Parameters:
900                 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
901
902             Example of usage:
903                 geompy.addToStudyAuto()   # enable auto-publishing
904                 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
905                 geompy.addToStudyAuto(0)  # disable auto-publishing
906             """
907             self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
908             pass
909
910         ## Dump component to the Python script
911         #  This method overrides IDL function to allow default values for the parameters.
912         def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
913             """
914             Dump component to the Python script
915             This method overrides IDL function to allow default values for the parameters.
916             """
917             return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
918
919         ## Get name for sub-shape aSubObj of shape aMainObj
920         #
921         # @ref swig_SubShapeName "Example"
922         @ManageTransactions("ShapesOp")
923         def SubShapeName(self,aSubObj, aMainObj):
924             """
925             Get name for sub-shape aSubObj of shape aMainObj
926             """
927             # Example: see GEOM_TestAll.py
928
929             #aSubId  = orb.object_to_string(aSubObj)
930             #aMainId = orb.object_to_string(aMainObj)
931             #index = gg.getIndexTopology(aSubId, aMainId)
932             #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
933             index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
934             name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
935             return name
936
937         ## Publish in study aShape with name aName
938         #
939         #  \param aShape the shape to be published
940         #  \param aName  the name for the shape
941         #  \param doRestoreSubShapes if True, finds and publishes also
942         #         sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
943         #         and published sub-shapes of arguments
944         #  \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
945         #                                                  these arguments description
946         #  \return study entry of the published shape in form of string
947         #
948         #  @ingroup l1_publish_data
949         #  @ref swig_all_addtostudy "Example"
950         def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
951                        theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
952             """
953             Publish in study aShape with name aName
954
955             Parameters:
956                 aShape the shape to be published
957                 aName  the name for the shape
958                 doRestoreSubShapes if True, finds and publishes also
959                                    sub-shapes of aShape, corresponding to its arguments
960                                    and published sub-shapes of arguments
961                 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
962                                                          these arguments description
963
964             Returns:
965                 study entry of the published shape in form of string
966
967             Example of usage:
968                 id_block1 = geompy.addToStudy(Block1, "Block 1")
969             """
970             # Example: see GEOM_TestAll.py
971             try:
972                 aSObject = self.AddInStudy(aShape, aName, None)
973                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
974                 if doRestoreSubShapes:
975                     self.RestoreSubShapesSO(aSObject, theArgs,
976                                             theFindMethod, theInheritFirstArg, True )
977             except:
978                 print("addToStudy() failed")
979                 return ""
980             return aShape.GetStudyEntry()
981
982         ## Publish in study aShape with name aName as sub-object of previously published aFather
983         #  \param aFather previously published object
984         #  \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
985         #  \param aName  the name for the shape
986         #
987         #  \return study entry of the published shape in form of string
988         #
989         #  @ingroup l1_publish_data
990         #  @ref swig_all_addtostudyInFather "Example"
991         def addToStudyInFather(self, aFather, aShape, aName):
992             """
993             Publish in study aShape with name aName as sub-object of previously published aFather
994
995             Parameters:
996                 aFather previously published object
997                 aShape the shape to be published as sub-object of aFather
998                 aName  the name for the shape
999
1000             Returns:
1001                 study entry of the published shape in form of string
1002             """
1003             # Example: see GEOM_TestAll.py
1004             try:
1005                 aSObject = self.AddInStudy(aShape, aName, aFather)
1006                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
1007             except:
1008                 print("addToStudyInFather() failed")
1009                 return ""
1010             return aShape.GetStudyEntry()
1011
1012         ## Unpublish object in study
1013         #
1014         #  \param obj the object to be unpublished
1015         def hideInStudy(self, obj):
1016             """
1017             Unpublish object in study
1018
1019             Parameters:
1020                 obj the object to be unpublished
1021             """
1022             ior = salome.orb.object_to_string(obj)
1023             aSObject = self.myStudy.FindObjectIOR(ior)
1024             if aSObject is not None:
1025                 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
1026                 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1027                 drwAttribute.SetDrawable(False)
1028                 # hide references if any
1029                 vso = self.myStudy.FindDependances(aSObject);
1030                 for refObj in vso :
1031                     genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
1032                     drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1033                     drwAttribute.SetDrawable(False)
1034                     pass
1035                 pass
1036
1037         # end of l1_geomBuilder_auxiliary
1038         ## @}
1039
1040         ## @addtogroup l3_restore_ss
1041         ## @{
1042
1043         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1044         #  To be used from python scripts out of addToStudy() (non-default usage)
1045         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
1046         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1047         #                   If this list is empty, all operation arguments will be published
1048         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
1049         #                       their sub-shapes. Value from enumeration GEOM.find_shape_method.
1050         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1051         #                            Do not publish sub-shapes in place of arguments, but only
1052         #                            in place of sub-shapes of the first argument,
1053         #                            because the whole shape corresponds to the first argument.
1054         #                            Mainly to be used after transformations, but it also can be
1055         #                            useful after partition with one object shape, and some other
1056         #                            operations, where only the first argument has to be considered.
1057         #                            If theObject has only one argument shape, this flag is automatically
1058         #                            considered as True, not regarding really passed value.
1059         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1060         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1061         #  \return list of published sub-shapes
1062         #
1063         #  @ref tui_restore_prs_params "Example"
1064         def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1065                               theInheritFirstArg=False, theAddPrefix=True):
1066             """
1067             Publish sub-shapes, standing for arguments and sub-shapes of arguments
1068             To be used from python scripts out of geompy.addToStudy (non-default usage)
1069
1070             Parameters:
1071                 theObject published GEOM.GEOM_Object, arguments of which will be published
1072                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1073                           If this list is empty, all operation arguments will be published
1074                 theFindMethod method to search sub-shapes, corresponding to arguments and
1075                               their sub-shapes. Value from enumeration GEOM.find_shape_method.
1076                 theInheritFirstArg set properties of the first argument for theObject.
1077                                    Do not publish sub-shapes in place of arguments, but only
1078                                    in place of sub-shapes of the first argument,
1079                                    because the whole shape corresponds to the first argument.
1080                                    Mainly to be used after transformations, but it also can be
1081                                    useful after partition with one object shape, and some other
1082                                    operations, where only the first argument has to be considered.
1083                                    If theObject has only one argument shape, this flag is automatically
1084                                    considered as True, not regarding really passed value.
1085                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1086                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1087             Returns:
1088                 list of published sub-shapes
1089             """
1090             # Example: see GEOM_TestAll.py
1091             return self.RestoreSubShapesO(theObject, theArgs,
1092                                           theFindMethod, theInheritFirstArg, theAddPrefix)
1093
1094         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1095         #  To be used from python scripts out of addToStudy() (non-default usage)
1096         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
1097         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1098         #                   If this list is empty, all operation arguments will be published
1099         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
1100         #                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
1101         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1102         #                            Do not publish sub-shapes in place of arguments, but only
1103         #                            in place of sub-shapes of the first argument,
1104         #                            because the whole shape corresponds to the first argument.
1105         #                            Mainly to be used after transformations, but it also can be
1106         #                            useful after partition with one object shape, and some other
1107         #                            operations, where only the first argument has to be considered.
1108         #                            If theObject has only one argument shape, this flag is automatically
1109         #                            considered as True, not regarding really passed value.
1110         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1111         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1112         #  \return list of published sub-shapes
1113         #
1114         #  @ref tui_restore_prs_params "Example"
1115         def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1116                                    theInheritFirstArg=False, theAddPrefix=True):
1117             """
1118             Publish sub-shapes, standing for arguments and sub-shapes of arguments
1119             To be used from python scripts out of geompy.addToStudy() (non-default usage)
1120
1121             Parameters:
1122                 theObject published GEOM.GEOM_Object, arguments of which will be published
1123                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
1124                           If this list is empty, all operation arguments will be published
1125                 theFindMethod method to search sub-shapes, corresponding to arguments and
1126                               their sub-shapes. Value from enumeration GEOM::find_shape_method.
1127                 theInheritFirstArg set properties of the first argument for theObject.
1128                                    Do not publish sub-shapes in place of arguments, but only
1129                                    in place of sub-shapes of the first argument,
1130                                    because the whole shape corresponds to the first argument.
1131                                    Mainly to be used after transformations, but it also can be
1132                                    useful after partition with one object shape, and some other
1133                                    operations, where only the first argument has to be considered.
1134                                    If theObject has only one argument shape, this flag is automatically
1135                                    considered as True, not regarding really passed value.
1136                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1137                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1138
1139             Returns:
1140                 list of published sub-shapes
1141             """
1142             # Example: see GEOM_TestAll.py
1143             return self.RestoreGivenSubShapesO(theObject, theArgs,
1144                                                theFindMethod, theInheritFirstArg, theAddPrefix)
1145
1146         # end of l3_restore_ss
1147         ## @}
1148
1149         ## @addtogroup l3_basic_go
1150         ## @{
1151
1152         ## Create point by three coordinates.
1153         #  @param theX The X coordinate of the point.
1154         #  @param theY The Y coordinate of the point.
1155         #  @param theZ The Z coordinate of the point.
1156         #  @param theName Object name; when specified, this parameter is used
1157         #         for result publication in the study. Otherwise, if automatic
1158         #         publication is switched on, default value is used for result name.
1159         #
1160         #  @return New GEOM.GEOM_Object, containing the created point.
1161         #
1162         #  @ref tui_creation_point "Example"
1163         @ManageTransactions("BasicOp")
1164         def MakeVertex(self, theX, theY, theZ, theName=None):
1165             """
1166             Create point by three coordinates.
1167
1168             Parameters:
1169                 theX The X coordinate of the point.
1170                 theY The Y coordinate of the point.
1171                 theZ The Z coordinate of the point.
1172                 theName Object name; when specified, this parameter is used
1173                         for result publication in the study. Otherwise, if automatic
1174                         publication is switched on, default value is used for result name.
1175
1176             Returns:
1177                 New GEOM.GEOM_Object, containing the created point.
1178             """
1179             # Example: see GEOM_TestAll.py
1180             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1181             anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1182             RaiseIfFailed("MakePointXYZ", self.BasicOp)
1183             anObj.SetParameters(Parameters)
1184             self._autoPublish(anObj, theName, "vertex")
1185             return anObj
1186
1187         ## Create a point, distant from the referenced point
1188         #  on the given distances along the coordinate axes.
1189         #  @param theReference The referenced point.
1190         #  @param theX Displacement from the referenced point along OX axis.
1191         #  @param theY Displacement from the referenced point along OY axis.
1192         #  @param theZ Displacement from the referenced point along OZ axis.
1193         #  @param theName Object name; when specified, this parameter is used
1194         #         for result publication in the study. Otherwise, if automatic
1195         #         publication is switched on, default value is used for result name.
1196         #
1197         #  @return New GEOM.GEOM_Object, containing the created point.
1198         #
1199         #  @ref tui_creation_point "Example"
1200         @ManageTransactions("BasicOp")
1201         def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1202             """
1203             Create a point, distant from the referenced point
1204             on the given distances along the coordinate axes.
1205
1206             Parameters:
1207                 theReference The referenced point.
1208                 theX Displacement from the referenced point along OX axis.
1209                 theY Displacement from the referenced point along OY axis.
1210                 theZ Displacement from the referenced point along OZ axis.
1211                 theName Object name; when specified, this parameter is used
1212                         for result publication in the study. Otherwise, if automatic
1213                         publication is switched on, default value is used for result name.
1214
1215             Returns:
1216                 New GEOM.GEOM_Object, containing the created point.
1217             """
1218             # Example: see GEOM_TestAll.py
1219             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1220             anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1221             RaiseIfFailed("MakePointWithReference", self.BasicOp)
1222             anObj.SetParameters(Parameters)
1223             self._autoPublish(anObj, theName, "vertex")
1224             return anObj
1225
1226         ## Create a point, corresponding to the given parameter on the given curve.
1227         #  @param theRefCurve The referenced curve.
1228         #  @param theParameter Value of parameter on the referenced curve.
1229         #  @param takeOrientationIntoAccount flag that tells if it is necessary
1230         #         to take the curve's orientation into account for the
1231         #         operation. I.e. if this flag is set, the results for the same
1232         #         parameters (except the value 0.5) is different for forward
1233         #         and reversed curves. If it is not set the result is the same.
1234         #  @param theName Object name; when specified, this parameter is used
1235         #         for result publication in the study. Otherwise, if automatic
1236         #         publication is switched on, default value is used for result name.
1237         #
1238         #  @return New GEOM.GEOM_Object, containing the created point.
1239         #
1240         #  @ref tui_creation_point "Example"
1241         @ManageTransactions("BasicOp")
1242         def MakeVertexOnCurve(self, theRefCurve, theParameter,
1243                               takeOrientationIntoAccount=False, theName=None):
1244             """
1245             Create a point, corresponding to the given parameter on the given curve.
1246
1247             Parameters:
1248                 theRefCurve The referenced curve.
1249                 theParameter Value of parameter on the referenced curve.
1250                 takeOrientationIntoAccount flag that tells if it is necessary
1251                         to take the curve's orientation into account for the
1252                         operation. I.e. if this flag is set, the results for
1253                         the same parameters (except the value 0.5) is different
1254                         for forward and reversed curves. If it is not set
1255                         the result is the same.
1256                 theName Object name; when specified, this parameter is used
1257                         for result publication in the study. Otherwise, if automatic
1258                         publication is switched on, default value is used for result name.
1259
1260             Returns:
1261                 New GEOM.GEOM_Object, containing the created point.
1262
1263             Example of usage:
1264                 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1265             """
1266             # Example: see GEOM_TestAll.py
1267             theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
1268                 theParameter, takeOrientationIntoAccount)
1269             anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
1270                                                   takeOrientationIntoAccount)
1271             RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1272             anObj.SetParameters(Parameters)
1273             self._autoPublish(anObj, theName, "vertex")
1274             return anObj
1275
1276         ## Create a point by projection give coordinates on the given curve
1277         #  @param theRefCurve The referenced curve.
1278         #  @param theX X-coordinate in 3D space
1279         #  @param theY Y-coordinate in 3D space
1280         #  @param theZ Z-coordinate in 3D space
1281         #  @param theName Object name; when specified, this parameter is used
1282         #         for result publication in the study. Otherwise, if automatic
1283         #         publication is switched on, default value is used for result name.
1284         #
1285         #  @return New GEOM.GEOM_Object, containing the created point.
1286         #
1287         #  @ref tui_creation_point "Example"
1288         @ManageTransactions("BasicOp")
1289         def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1290             """
1291             Create a point by projection give coordinates on the given curve
1292
1293             Parameters:
1294                 theRefCurve The referenced curve.
1295                 theX X-coordinate in 3D space
1296                 theY Y-coordinate in 3D space
1297                 theZ Z-coordinate in 3D space
1298                 theName Object name; when specified, this parameter is used
1299                         for result publication in the study. Otherwise, if automatic
1300                         publication is switched on, default value is used for result name.
1301
1302             Returns:
1303                 New GEOM.GEOM_Object, containing the created point.
1304
1305             Example of usage:
1306                 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1307             """
1308             # Example: see GEOM_TestAll.py
1309             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1310             anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1311             RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1312             anObj.SetParameters(Parameters)
1313             self._autoPublish(anObj, theName, "vertex")
1314             return anObj
1315
1316         ## Create a point, corresponding to the given length on the given curve.
1317         #  @param theRefCurve The referenced curve.
1318         #  @param theLength Length on the referenced curve. It can be negative.
1319         #  @param theStartPoint Point allowing to choose the direction for the calculation
1320         #                       of the length. If None, start from the first point of theRefCurve.
1321         #  @param theName Object name; when specified, this parameter is used
1322         #         for result publication in the study. Otherwise, if automatic
1323         #         publication is switched on, default value is used for result name.
1324         #
1325         #  @return New GEOM.GEOM_Object, containing the created point.
1326         #
1327         #  @ref tui_creation_point "Example"
1328         @ManageTransactions("BasicOp")
1329         def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1330             """
1331             Create a point, corresponding to the given length on the given curve.
1332
1333             Parameters:
1334                 theRefCurve The referenced curve.
1335                 theLength Length on the referenced curve. It can be negative.
1336                 theStartPoint Point allowing to choose the direction for the calculation
1337                               of the length. If None, start from the first point of theRefCurve.
1338                 theName Object name; when specified, this parameter is used
1339                         for result publication in the study. Otherwise, if automatic
1340                         publication is switched on, default value is used for result name.
1341
1342             Returns:
1343                 New GEOM.GEOM_Object, containing the created point.
1344             """
1345             # Example: see GEOM_TestAll.py
1346             theLength, Parameters = ParseParameters(theLength)
1347             anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1348             RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1349             anObj.SetParameters(Parameters)
1350             self._autoPublish(anObj, theName, "vertex")
1351             return anObj
1352
1353         ## Create a point, corresponding to the given parameters on the
1354         #    given surface.
1355         #  @param theRefSurf The referenced surface.
1356         #  @param theUParameter Value of U-parameter on the referenced surface.
1357         #  @param theVParameter Value of V-parameter on the referenced surface.
1358         #  @param theName Object name; when specified, this parameter is used
1359         #         for result publication in the study. Otherwise, if automatic
1360         #         publication is switched on, default value is used for result name.
1361         #
1362         #  @return New GEOM.GEOM_Object, containing the created point.
1363         #
1364         #  @ref swig_MakeVertexOnSurface "Example"
1365         @ManageTransactions("BasicOp")
1366         def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1367             """
1368             Create a point, corresponding to the given parameters on the
1369             given surface.
1370
1371             Parameters:
1372                 theRefSurf The referenced surface.
1373                 theUParameter Value of U-parameter on the referenced surface.
1374                 theVParameter Value of V-parameter on the referenced surface.
1375                 theName Object name; when specified, this parameter is used
1376                         for result publication in the study. Otherwise, if automatic
1377                         publication is switched on, default value is used for result name.
1378
1379             Returns:
1380                 New GEOM.GEOM_Object, containing the created point.
1381
1382             Example of usage:
1383                 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1384             """
1385             theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1386             # Example: see GEOM_TestAll.py
1387             anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1388             RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1389             anObj.SetParameters(Parameters);
1390             self._autoPublish(anObj, theName, "vertex")
1391             return anObj
1392
1393         ## Create a point by projection give coordinates on the given surface
1394         #  @param theRefSurf The referenced surface.
1395         #  @param theX X-coordinate in 3D space
1396         #  @param theY Y-coordinate in 3D space
1397         #  @param theZ Z-coordinate in 3D space
1398         #  @param theName Object name; when specified, this parameter is used
1399         #         for result publication in the study. Otherwise, if automatic
1400         #         publication is switched on, default value is used for result name.
1401         #
1402         #  @return New GEOM.GEOM_Object, containing the created point.
1403         #
1404         #  @ref swig_MakeVertexOnSurfaceByCoord "Example"
1405         @ManageTransactions("BasicOp")
1406         def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1407             """
1408             Create a point by projection give coordinates on the given surface
1409
1410             Parameters:
1411                 theRefSurf The referenced surface.
1412                 theX X-coordinate in 3D space
1413                 theY Y-coordinate in 3D space
1414                 theZ Z-coordinate in 3D space
1415                 theName Object name; when specified, this parameter is used
1416                         for result publication in the study. Otherwise, if automatic
1417                         publication is switched on, default value is used for result name.
1418
1419             Returns:
1420                 New GEOM.GEOM_Object, containing the created point.
1421
1422             Example of usage:
1423                 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1424             """
1425             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1426             # Example: see GEOM_TestAll.py
1427             anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1428             RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1429             anObj.SetParameters(Parameters);
1430             self._autoPublish(anObj, theName, "vertex")
1431             return anObj
1432
1433         ## Create a point, which lays on the given face.
1434         #  The point will lay in arbitrary place of the face.
1435         #  The only condition on it is a non-zero distance to the face boundary.
1436         #  Such point can be used to uniquely identify the face inside any
1437         #  shape in case, when the shape does not contain overlapped faces.
1438         #  @param theFace The referenced face.
1439         #  @param theName Object name; when specified, this parameter is used
1440         #         for result publication in the study. Otherwise, if automatic
1441         #         publication is switched on, default value is used for result name.
1442         #
1443         #  @return New GEOM.GEOM_Object, containing the created point.
1444         #
1445         #  @ref swig_MakeVertexInsideFace "Example"
1446         @ManageTransactions("BasicOp")
1447         def MakeVertexInsideFace (self, theFace, theNumberOfPnts=1, theName=None):
1448             """
1449             Create a point, which lays on the given face.
1450             The point will lay in arbitrary place of the face.
1451             The only condition on it is a non-zero distance to the face boundary.
1452             Such point can be used to uniquely identify the face inside any
1453             shape in case, when the shape does not contain overlapped faces.
1454
1455             Parameters:
1456                 theFace The referenced face.
1457                 theNumberOfPnts The number of points we want to get, 1 by default.
1458                 theName Object name; when specified, this parameter is used
1459                         for result publication in the study. Otherwise, if automatic
1460                         publication is switched on, default value is used for result name.
1461
1462             Returns:
1463                 New GEOM.GEOM_Object, containing the created point.
1464
1465             Example of usage:
1466                 p_on_face = geompy.MakeVertexInsideFace(Face)
1467             """
1468             # Example: see GEOM_TestAll.py
1469             anObj = self.BasicOp.MakePointOnFace(theFace, theNumberOfPnts)
1470             RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1471             self._autoPublish(anObj, theName, "vertex")
1472             return anObj
1473
1474         ## Create a point on intersection of two lines.
1475         #  @param theRefLine1, theRefLine2 The referenced lines.
1476         #  @param theName Object name; when specified, this parameter is used
1477         #         for result publication in the study. Otherwise, if automatic
1478         #         publication is switched on, default value is used for result name.
1479         #
1480         #  @return New GEOM.GEOM_Object, containing the created point.
1481         #
1482         #  @ref swig_MakeVertexOnLinesIntersection "Example"
1483         @ManageTransactions("BasicOp")
1484         def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1485             """
1486             Create a point on intersection of two lines.
1487
1488             Parameters:
1489                 theRefLine1, theRefLine2 The referenced lines.
1490                 theName Object name; when specified, this parameter is used
1491                         for result publication in the study. Otherwise, if automatic
1492                         publication is switched on, default value is used for result name.
1493
1494             Returns:
1495                 New GEOM.GEOM_Object, containing the created point.
1496             """
1497             # Example: see GEOM_TestAll.py
1498             anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1499             RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1500             self._autoPublish(anObj, theName, "vertex")
1501             return anObj
1502
1503         ## Create a tangent, corresponding to the given parameter on the given curve.
1504         #  @param theRefCurve The referenced curve.
1505         #  @param theParameter Value of parameter on the referenced curve.
1506         #  @param theName Object name; when specified, this parameter is used
1507         #         for result publication in the study. Otherwise, if automatic
1508         #         publication is switched on, default value is used for result name.
1509         #
1510         #  @return New GEOM.GEOM_Object, containing the created tangent.
1511         #
1512         #  @ref swig_MakeTangentOnCurve "Example"
1513         @ManageTransactions("BasicOp")
1514         def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1515             """
1516             Create a tangent, corresponding to the given parameter on the given curve.
1517
1518             Parameters:
1519                 theRefCurve The referenced curve.
1520                 theParameter Value of parameter on the referenced curve.
1521                 theName Object name; when specified, this parameter is used
1522                         for result publication in the study. Otherwise, if automatic
1523                         publication is switched on, default value is used for result name.
1524
1525             Returns:
1526                 New GEOM.GEOM_Object, containing the created tangent.
1527
1528             Example of usage:
1529                 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1530             """
1531             anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1532             RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1533             self._autoPublish(anObj, theName, "tangent")
1534             return anObj
1535
1536         ## Create a tangent plane, corresponding to the given parameter on the given face.
1537         #  @param theFace The face for which tangent plane should be built.
1538         #  @param theParameterV vertical value of the center point (0.0 - 1.0).
1539         #  @param theParameterU horisontal value of the center point (0.0 - 1.0).
1540         #  @param theTrimSize the size of plane.
1541         #  @param theName Object name; when specified, this parameter is used
1542         #         for result publication in the study. Otherwise, if automatic
1543         #         publication is switched on, default value is used for result name.
1544         #
1545         #  @return New GEOM.GEOM_Object, containing the created tangent.
1546         #
1547         #  @ref swig_MakeTangentPlaneOnFace "Example"
1548         @ManageTransactions("BasicOp")
1549         def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1550             """
1551             Create a tangent plane, corresponding to the given parameter on the given face.
1552
1553             Parameters:
1554                 theFace The face for which tangent plane should be built.
1555                 theParameterV vertical value of the center point (0.0 - 1.0).
1556                 theParameterU horisontal value of the center point (0.0 - 1.0).
1557                 theTrimSize the size of plane.
1558                 theName Object name; when specified, this parameter is used
1559                         for result publication in the study. Otherwise, if automatic
1560                         publication is switched on, default value is used for result name.
1561
1562            Returns:
1563                 New GEOM.GEOM_Object, containing the created tangent.
1564
1565            Example of usage:
1566                 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1567             """
1568             anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1569             RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1570             self._autoPublish(anObj, theName, "tangent")
1571             return anObj
1572
1573         ## Create a vector with the given components.
1574         #  @param theDX X component of the vector.
1575         #  @param theDY Y component of the vector.
1576         #  @param theDZ Z component of the vector.
1577         #  @param theName Object name; when specified, this parameter is used
1578         #         for result publication in the study. Otherwise, if automatic
1579         #         publication is switched on, default value is used for result name.
1580         #
1581         #  @return New GEOM.GEOM_Object, containing the created vector.
1582         #
1583         #  @ref tui_creation_vector "Example"
1584         @ManageTransactions("BasicOp")
1585         def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1586             """
1587             Create a vector with the given components.
1588
1589             Parameters:
1590                 theDX X component of the vector.
1591                 theDY Y component of the vector.
1592                 theDZ Z component of the vector.
1593                 theName Object name; when specified, this parameter is used
1594                         for result publication in the study. Otherwise, if automatic
1595                         publication is switched on, default value is used for result name.
1596
1597             Returns:
1598                 New GEOM.GEOM_Object, containing the created vector.
1599             """
1600             # Example: see GEOM_TestAll.py
1601             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1602             anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1603             RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1604             anObj.SetParameters(Parameters)
1605             self._autoPublish(anObj, theName, "vector")
1606             return anObj
1607
1608         ## Create a vector between two points.
1609         #  @param thePnt1 Start point for the vector.
1610         #  @param thePnt2 End point for the vector.
1611         #  @param theName Object name; when specified, this parameter is used
1612         #         for result publication in the study. Otherwise, if automatic
1613         #         publication is switched on, default value is used for result name.
1614         #
1615         #  @return New GEOM.GEOM_Object, containing the created vector.
1616         #
1617         #  @ref tui_creation_vector "Example"
1618         @ManageTransactions("BasicOp")
1619         def MakeVector(self, thePnt1, thePnt2, theName=None):
1620             """
1621             Create a vector between two points.
1622
1623             Parameters:
1624                 thePnt1 Start point for the vector.
1625                 thePnt2 End point for the vector.
1626                 theName Object name; when specified, this parameter is used
1627                         for result publication in the study. Otherwise, if automatic
1628                         publication is switched on, default value is used for result name.
1629
1630             Returns:
1631                 New GEOM.GEOM_Object, containing the created vector.
1632             """
1633             # Example: see GEOM_TestAll.py
1634             anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1635             RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1636             self._autoPublish(anObj, theName, "vector")
1637             return anObj
1638
1639         ## Create a line, passing through the given point
1640         #  and parallel to the given direction
1641         #  @param thePnt Point. The resulting line will pass through it.
1642         #  @param theDir Direction. The resulting line will be parallel to it.
1643         #  @param theName Object name; when specified, this parameter is used
1644         #         for result publication in the study. Otherwise, if automatic
1645         #         publication is switched on, default value is used for result name.
1646         #
1647         #  @return New GEOM.GEOM_Object, containing the created line.
1648         #
1649         #  @ref tui_creation_line "Example"
1650         @ManageTransactions("BasicOp")
1651         def MakeLine(self, thePnt, theDir, theName=None):
1652             """
1653             Create a line, passing through the given point
1654             and parallel to the given direction
1655
1656             Parameters:
1657                 thePnt Point. The resulting line will pass through it.
1658                 theDir Direction. The resulting line will be parallel to it.
1659                 theName Object name; when specified, this parameter is used
1660                         for result publication in the study. Otherwise, if automatic
1661                         publication is switched on, default value is used for result name.
1662
1663             Returns:
1664                 New GEOM.GEOM_Object, containing the created line.
1665             """
1666             # Example: see GEOM_TestAll.py
1667             anObj = self.BasicOp.MakeLine(thePnt, theDir)
1668             RaiseIfFailed("MakeLine", self.BasicOp)
1669             self._autoPublish(anObj, theName, "line")
1670             return anObj
1671
1672         ## Create a line, passing through the given points
1673         #  @param thePnt1 First of two points, defining the line.
1674         #  @param thePnt2 Second of two points, defining the line.
1675         #  @param theName Object name; when specified, this parameter is used
1676         #         for result publication in the study. Otherwise, if automatic
1677         #         publication is switched on, default value is used for result name.
1678         #
1679         #  @return New GEOM.GEOM_Object, containing the created line.
1680         #
1681         #  @ref tui_creation_line "Example"
1682         @ManageTransactions("BasicOp")
1683         def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1684             """
1685             Create a line, passing through the given points
1686
1687             Parameters:
1688                 thePnt1 First of two points, defining the line.
1689                 thePnt2 Second of two points, defining the line.
1690                 theName Object name; when specified, this parameter is used
1691                         for result publication in the study. Otherwise, if automatic
1692                         publication is switched on, default value is used for result name.
1693
1694             Returns:
1695                 New GEOM.GEOM_Object, containing the created line.
1696             """
1697             # Example: see GEOM_TestAll.py
1698             anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1699             RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1700             self._autoPublish(anObj, theName, "line")
1701             return anObj
1702
1703         ## Create a line on two faces intersection.
1704         #  @param theFace1 First of two faces, defining the line.
1705         #  @param theFace2 Second of two faces, defining the line.
1706         #  @param theName Object name; when specified, this parameter is used
1707         #         for result publication in the study. Otherwise, if automatic
1708         #         publication is switched on, default value is used for result name.
1709         #
1710         #  @return New GEOM.GEOM_Object, containing the created line.
1711         #
1712         #  @ref swig_MakeLineTwoFaces "Example"
1713         @ManageTransactions("BasicOp")
1714         def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1715             """
1716             Create a line on two faces intersection.
1717
1718             Parameters:
1719                 theFace1 First of two faces, defining the line.
1720                 theFace2 Second of two faces, defining the line.
1721                 theName Object name; when specified, this parameter is used
1722                         for result publication in the study. Otherwise, if automatic
1723                         publication is switched on, default value is used for result name.
1724
1725             Returns:
1726                 New GEOM.GEOM_Object, containing the created line.
1727             """
1728             # Example: see GEOM_TestAll.py
1729             anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1730             RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1731             self._autoPublish(anObj, theName, "line")
1732             return anObj
1733
1734         ## Create a plane, passing through the given point
1735         #  and normal to the given vector.
1736         #  @param thePnt Point, the plane has to pass through.
1737         #  @param theVec Vector, defining the plane normal direction.
1738         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1739         #  @param theName Object name; when specified, this parameter is used
1740         #         for result publication in the study. Otherwise, if automatic
1741         #         publication is switched on, default value is used for result name.
1742         #
1743         #  @return New GEOM.GEOM_Object, containing the created plane.
1744         #
1745         #  @ref tui_creation_plane "Example"
1746         @ManageTransactions("BasicOp")
1747         def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1748             """
1749             Create a plane, passing through the given point
1750             and normal to the given vector.
1751
1752             Parameters:
1753                 thePnt Point, the plane has to pass through.
1754                 theVec Vector, defining the plane normal direction.
1755                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1756                 theName Object name; when specified, this parameter is used
1757                         for result publication in the study. Otherwise, if automatic
1758                         publication is switched on, default value is used for result name.
1759
1760             Returns:
1761                 New GEOM.GEOM_Object, containing the created plane.
1762             """
1763             # Example: see GEOM_TestAll.py
1764             theTrimSize, Parameters = ParseParameters(theTrimSize);
1765             anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1766             RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1767             anObj.SetParameters(Parameters)
1768             self._autoPublish(anObj, theName, "plane")
1769             return anObj
1770
1771         ## Create a plane, passing through the three given points
1772         #  @param thePnt1 First of three points, defining the plane.
1773         #  @param thePnt2 Second of three points, defining the plane.
1774         #  @param thePnt3 Third of three points, defining the plane.
1775         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1776         #  @param theName Object name; when specified, this parameter is used
1777         #         for result publication in the study. Otherwise, if automatic
1778         #         publication is switched on, default value is used for result name.
1779         #
1780         #  @return New GEOM.GEOM_Object, containing the created plane.
1781         #
1782         #  @ref tui_creation_plane "Example"
1783         @ManageTransactions("BasicOp")
1784         def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1785             """
1786             Create a plane, passing through the three given points
1787
1788             Parameters:
1789                 thePnt1 First of three points, defining the plane.
1790                 thePnt2 Second of three points, defining the plane.
1791                 thePnt3 Third of three points, defining the plane.
1792                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1793                 theName Object name; when specified, this parameter is used
1794                         for result publication in the study. Otherwise, if automatic
1795                         publication is switched on, default value is used for result name.
1796
1797             Returns:
1798                 New GEOM.GEOM_Object, containing the created plane.
1799             """
1800             # Example: see GEOM_TestAll.py
1801             theTrimSize, Parameters = ParseParameters(theTrimSize);
1802             anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1803             RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1804             anObj.SetParameters(Parameters)
1805             self._autoPublish(anObj, theName, "plane")
1806             return anObj
1807
1808         ## Create a plane, similar to the existing one, but with another size of representing face.
1809         #  @param theFace Referenced plane or LCS(Marker).
1810         #  @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1811         #  @param theName Object name; when specified, this parameter is used
1812         #         for result publication in the study. Otherwise, if automatic
1813         #         publication is switched on, default value is used for result name.
1814         #
1815         #  @return New GEOM.GEOM_Object, containing the created plane.
1816         #
1817         #  @ref tui_creation_plane "Example"
1818         @ManageTransactions("BasicOp")
1819         def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1820             """
1821             Create a plane, similar to the existing one, but with another size of representing face.
1822
1823             Parameters:
1824                 theFace Referenced plane or LCS(Marker).
1825                 theTrimSize New half size of a side of quadrangle face, representing the plane.
1826                 theName Object name; when specified, this parameter is used
1827                         for result publication in the study. Otherwise, if automatic
1828                         publication is switched on, default value is used for result name.
1829
1830             Returns:
1831                 New GEOM.GEOM_Object, containing the created plane.
1832             """
1833             # Example: see GEOM_TestAll.py
1834             theTrimSize, Parameters = ParseParameters(theTrimSize);
1835             anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1836             RaiseIfFailed("MakePlaneFace", self.BasicOp)
1837             anObj.SetParameters(Parameters)
1838             self._autoPublish(anObj, theName, "plane")
1839             return anObj
1840
1841         ## Create a plane, passing through the 2 vectors
1842         #  with center in a start point of the first vector.
1843         #  @param theVec1 Vector, defining center point and plane direction.
1844         #  @param theVec2 Vector, defining the plane normal direction.
1845         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1846         #  @param theName Object name; when specified, this parameter is used
1847         #         for result publication in the study. Otherwise, if automatic
1848         #         publication is switched on, default value is used for result name.
1849         #
1850         #  @return New GEOM.GEOM_Object, containing the created plane.
1851         #
1852         #  @ref tui_creation_plane "Example"
1853         @ManageTransactions("BasicOp")
1854         def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1855             """
1856             Create a plane, passing through the 2 vectors
1857             with center in a start point of the first vector.
1858
1859             Parameters:
1860                 theVec1 Vector, defining center point and plane direction.
1861                 theVec2 Vector, defining the plane normal direction.
1862                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1863                 theName Object name; when specified, this parameter is used
1864                         for result publication in the study. Otherwise, if automatic
1865                         publication is switched on, default value is used for result name.
1866
1867             Returns:
1868                 New GEOM.GEOM_Object, containing the created plane.
1869             """
1870             # Example: see GEOM_TestAll.py
1871             theTrimSize, Parameters = ParseParameters(theTrimSize);
1872             anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1873             RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1874             anObj.SetParameters(Parameters)
1875             self._autoPublish(anObj, theName, "plane")
1876             return anObj
1877
1878         ## Create a plane, based on a Local coordinate system.
1879         #  @param theLCS  coordinate system, defining plane.
1880         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1881         #  @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1882         #  @param theName Object name; when specified, this parameter is used
1883         #         for result publication in the study. Otherwise, if automatic
1884         #         publication is switched on, default value is used for result name.
1885         #
1886         #  @return New GEOM.GEOM_Object, containing the created plane.
1887         #
1888         #  @ref tui_creation_plane "Example"
1889         @ManageTransactions("BasicOp")
1890         def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1891             """
1892             Create a plane, based on a Local coordinate system.
1893
1894            Parameters:
1895                 theLCS  coordinate system, defining plane.
1896                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1897                 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1898                 theName Object name; when specified, this parameter is used
1899                         for result publication in the study. Otherwise, if automatic
1900                         publication is switched on, default value is used for result name.
1901
1902             Returns:
1903                 New GEOM.GEOM_Object, containing the created plane.
1904             """
1905             # Example: see GEOM_TestAll.py
1906             theTrimSize, Parameters = ParseParameters(theTrimSize);
1907             anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1908             RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1909             anObj.SetParameters(Parameters)
1910             self._autoPublish(anObj, theName, "plane")
1911             return anObj
1912
1913         ## Create a local coordinate system.
1914         #  @param OX,OY,OZ Three coordinates of coordinate system origin.
1915         #  @param XDX,XDY,XDZ Three components of OX direction
1916         #  @param YDX,YDY,YDZ Three components of OY direction
1917         #  @param theName Object name; when specified, this parameter is used
1918         #         for result publication in the study. Otherwise, if automatic
1919         #         publication is switched on, default value is used for result name.
1920         #
1921         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1922         #
1923         #  @ref swig_MakeMarker "Example"
1924         @ManageTransactions("BasicOp")
1925         def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1926             """
1927             Create a local coordinate system.
1928
1929             Parameters:
1930                 OX,OY,OZ Three coordinates of coordinate system origin.
1931                 XDX,XDY,XDZ Three components of OX direction
1932                 YDX,YDY,YDZ Three components of OY direction
1933                 theName Object name; when specified, this parameter is used
1934                         for result publication in the study. Otherwise, if automatic
1935                         publication is switched on, default value is used for result name.
1936
1937             Returns:
1938                 New GEOM.GEOM_Object, containing the created coordinate system.
1939             """
1940             # Example: see GEOM_TestAll.py
1941             OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1942             anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1943             RaiseIfFailed("MakeMarker", self.BasicOp)
1944             anObj.SetParameters(Parameters)
1945             self._autoPublish(anObj, theName, "lcs")
1946             return anObj
1947
1948         ## Create a local coordinate system from shape.
1949         #  @param theShape The initial shape to detect the coordinate system.
1950         #  @param theName Object name; when specified, this parameter is used
1951         #         for result publication in the study. Otherwise, if automatic
1952         #         publication is switched on, default value is used for result name.
1953         #
1954         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1955         #
1956         #  @ref tui_creation_lcs "Example"
1957         @ManageTransactions("BasicOp")
1958         def MakeMarkerFromShape(self, theShape, theName=None):
1959             """
1960             Create a local coordinate system from shape.
1961
1962             Parameters:
1963                 theShape The initial shape to detect the coordinate system.
1964                 theName Object name; when specified, this parameter is used
1965                         for result publication in the study. Otherwise, if automatic
1966                         publication is switched on, default value is used for result name.
1967
1968             Returns:
1969                 New GEOM.GEOM_Object, containing the created coordinate system.
1970             """
1971             anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1972             RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1973             self._autoPublish(anObj, theName, "lcs")
1974             return anObj
1975
1976         ## Create a local coordinate system from point and two vectors.
1977         #  @param theOrigin Point of coordinate system origin.
1978         #  @param theXVec Vector of X direction
1979         #  @param theYVec Vector of Y direction
1980         #  @param theName Object name; when specified, this parameter is used
1981         #         for result publication in the study. Otherwise, if automatic
1982         #         publication is switched on, default value is used for result name.
1983         #
1984         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1985         #
1986         #  @ref tui_creation_lcs "Example"
1987         @ManageTransactions("BasicOp")
1988         def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1989             """
1990             Create a local coordinate system from point and two vectors.
1991
1992             Parameters:
1993                 theOrigin Point of coordinate system origin.
1994                 theXVec Vector of X direction
1995                 theYVec Vector of Y direction
1996                 theName Object name; when specified, this parameter is used
1997                         for result publication in the study. Otherwise, if automatic
1998                         publication is switched on, default value is used for result name.
1999
2000             Returns:
2001                 New GEOM.GEOM_Object, containing the created coordinate system.
2002
2003             """
2004             anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
2005             RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
2006             self._autoPublish(anObj, theName, "lcs")
2007             return anObj
2008
2009         # end of l3_basic_go
2010         ## @}
2011
2012         ## @addtogroup l4_curves
2013         ## @{
2014
2015         ##  Create an arc of circle, passing through three given points.
2016         #  @param thePnt1 Start point of the arc.
2017         #  @param thePnt2 Middle point of the arc.
2018         #  @param thePnt3 End point of the arc.
2019         #  @param theName Object name; when specified, this parameter is used
2020         #         for result publication in the study. Otherwise, if automatic
2021         #         publication is switched on, default value is used for result name.
2022         #
2023         #  @return New GEOM.GEOM_Object, containing the created arc.
2024         #
2025         #  @ref swig_MakeArc "Example"
2026         @ManageTransactions("CurvesOp")
2027         def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
2028             """
2029             Create an arc of circle, passing through three given points.
2030
2031             Parameters:
2032                 thePnt1 Start point of the arc.
2033                 thePnt2 Middle point of the arc.
2034                 thePnt3 End point of the arc.
2035                 theName Object name; when specified, this parameter is used
2036                         for result publication in the study. Otherwise, if automatic
2037                         publication is switched on, default value is used for result name.
2038
2039             Returns:
2040                 New GEOM.GEOM_Object, containing the created arc.
2041             """
2042             # Example: see GEOM_TestAll.py
2043             anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
2044             RaiseIfFailed("MakeArc", self.CurvesOp)
2045             self._autoPublish(anObj, theName, "arc")
2046             return anObj
2047
2048         ##  Create an arc of circle from a center and 2 points.
2049         #  @param thePnt1 Center of the arc
2050         #  @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
2051         #  @param thePnt3 End point of the arc (Gives also a direction)
2052         #  @param theSense Orientation of the arc
2053         #  @param theName Object name; when specified, this parameter is used
2054         #         for result publication in the study. Otherwise, if automatic
2055         #         publication is switched on, default value is used for result name.
2056         #
2057         #  @return New GEOM.GEOM_Object, containing the created arc.
2058         #
2059         #  @ref swig_MakeArc "Example"
2060         @ManageTransactions("CurvesOp")
2061         def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
2062             """
2063             Create an arc of circle from a center and 2 points.
2064
2065             Parameters:
2066                 thePnt1 Center of the arc
2067                 thePnt2 Start point of the arc. (Gives also the radius of the arc)
2068                 thePnt3 End point of the arc (Gives also a direction)
2069                 theSense Orientation of the arc
2070                 theName Object name; when specified, this parameter is used
2071                         for result publication in the study. Otherwise, if automatic
2072                         publication is switched on, default value is used for result name.
2073
2074             Returns:
2075                 New GEOM.GEOM_Object, containing the created arc.
2076             """
2077             # Example: see GEOM_TestAll.py
2078             anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
2079             RaiseIfFailed("MakeArcCenter", self.CurvesOp)
2080             self._autoPublish(anObj, theName, "arc")
2081             return anObj
2082
2083         ##  Create an arc of ellipse, of center and two points.
2084         #  @param theCenter Center of the arc.
2085         #  @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2086         #  @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2087         #  @param theName Object name; when specified, this parameter is used
2088         #         for result publication in the study. Otherwise, if automatic
2089         #         publication is switched on, default value is used for result name.
2090         #
2091         #  @return New GEOM.GEOM_Object, containing the created arc.
2092         #
2093         #  @ref swig_MakeArc "Example"
2094         @ManageTransactions("CurvesOp")
2095         def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2096             """
2097             Create an arc of ellipse, of center and two points.
2098
2099             Parameters:
2100                 theCenter Center of the arc.
2101                 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2102                 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2103                 theName Object name; when specified, this parameter is used
2104                         for result publication in the study. Otherwise, if automatic
2105                         publication is switched on, default value is used for result name.
2106
2107             Returns:
2108                 New GEOM.GEOM_Object, containing the created arc.
2109             """
2110             # Example: see GEOM_TestAll.py
2111             anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2112             RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2113             self._autoPublish(anObj, theName, "arc")
2114             return anObj
2115
2116         ## Create a circle with given center, normal vector and radius.
2117         #  @param thePnt Circle center.
2118         #  @param theVec Vector, normal to the plane of the circle.
2119         #  @param theR Circle radius.
2120         #  @param theName Object name; when specified, this parameter is used
2121         #         for result publication in the study. Otherwise, if automatic
2122         #         publication is switched on, default value is used for result name.
2123         #
2124         #  @return New GEOM.GEOM_Object, containing the created circle.
2125         #
2126         #  @ref tui_creation_circle "Example"
2127         @ManageTransactions("CurvesOp")
2128         def MakeCircle(self, thePnt, theVec, theR, theName=None):
2129             """
2130             Create a circle with given center, normal vector and radius.
2131
2132             Parameters:
2133                 thePnt Circle center.
2134                 theVec Vector, normal to the plane of the circle.
2135                 theR Circle radius.
2136                 theName Object name; when specified, this parameter is used
2137                         for result publication in the study. Otherwise, if automatic
2138                         publication is switched on, default value is used for result name.
2139
2140             Returns:
2141                 New GEOM.GEOM_Object, containing the created circle.
2142             """
2143             # Example: see GEOM_TestAll.py
2144             theR, Parameters = ParseParameters(theR)
2145             anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2146             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2147             anObj.SetParameters(Parameters)
2148             self._autoPublish(anObj, theName, "circle")
2149             return anObj
2150
2151         ## Create a circle with given radius.
2152         #  Center of the circle will be in the origin of global
2153         #  coordinate system and normal vector will be codirected with Z axis
2154         #  @param theR Circle radius.
2155         #  @param theName Object name; when specified, this parameter is used
2156         #         for result publication in the study. Otherwise, if automatic
2157         #         publication is switched on, default value is used for result name.
2158         #
2159         #  @return New GEOM.GEOM_Object, containing the created circle.
2160         @ManageTransactions("CurvesOp")
2161         def MakeCircleR(self, theR, theName=None):
2162             """
2163             Create a circle with given radius.
2164             Center of the circle will be in the origin of global
2165             coordinate system and normal vector will be codirected with Z axis
2166
2167             Parameters:
2168                 theR Circle radius.
2169                 theName Object name; when specified, this parameter is used
2170                         for result publication in the study. Otherwise, if automatic
2171                         publication is switched on, default value is used for result name.
2172
2173             Returns:
2174                 New GEOM.GEOM_Object, containing the created circle.
2175             """
2176             anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2177             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2178             self._autoPublish(anObj, theName, "circle")
2179             return anObj
2180
2181         ## Create a circle, passing through three given points
2182         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2183         #  @param theName Object name; when specified, this parameter is used
2184         #         for result publication in the study. Otherwise, if automatic
2185         #         publication is switched on, default value is used for result name.
2186         #
2187         #  @return New GEOM.GEOM_Object, containing the created circle.
2188         #
2189         #  @ref tui_creation_circle "Example"
2190         @ManageTransactions("CurvesOp")
2191         def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2192             """
2193             Create a circle, passing through three given points
2194
2195             Parameters:
2196                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2197                 theName Object name; when specified, this parameter is used
2198                         for result publication in the study. Otherwise, if automatic
2199                         publication is switched on, default value is used for result name.
2200
2201             Returns:
2202                 New GEOM.GEOM_Object, containing the created circle.
2203             """
2204             # Example: see GEOM_TestAll.py
2205             anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2206             RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2207             self._autoPublish(anObj, theName, "circle")
2208             return anObj
2209
2210         ## Create a circle, with given point1 as center,
2211         #  passing through the point2 as radius and laying in the plane,
2212         #  defined by all three given points.
2213         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2214         #  @param theName Object name; when specified, this parameter is used
2215         #         for result publication in the study. Otherwise, if automatic
2216         #         publication is switched on, default value is used for result name.
2217         #
2218         #  @return New GEOM.GEOM_Object, containing the created circle.
2219         #
2220         #  @ref swig_MakeCircle "Example"
2221         @ManageTransactions("CurvesOp")
2222         def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2223             """
2224             Create a circle, with given point1 as center,
2225             passing through the point2 as radius and laying in the plane,
2226             defined by all three given points.
2227
2228             Parameters:
2229                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2230                 theName Object name; when specified, this parameter is used
2231                         for result publication in the study. Otherwise, if automatic
2232                         publication is switched on, default value is used for result name.
2233
2234             Returns:
2235                 New GEOM.GEOM_Object, containing the created circle.
2236             """
2237             # Example: see GEOM_example6.py
2238             anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2239             RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2240             self._autoPublish(anObj, theName, "circle")
2241             return anObj
2242
2243         ## Create an ellipse with given center, normal vector and radiuses.
2244         #  @param thePnt Ellipse center.
2245         #  @param theVec Vector, normal to the plane of the ellipse.
2246         #  @param theRMajor Major ellipse radius.
2247         #  @param theRMinor Minor ellipse radius.
2248         #  @param theVecMaj Vector, direction of the ellipse's main axis.
2249         #  @param theName Object name; when specified, this parameter is used
2250         #         for result publication in the study. Otherwise, if automatic
2251         #         publication is switched on, default value is used for result name.
2252         #
2253         #  @return New GEOM.GEOM_Object, containing the created ellipse.
2254         #
2255         #  @ref tui_creation_ellipse "Example"
2256         @ManageTransactions("CurvesOp")
2257         def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2258             """
2259             Create an ellipse with given center, normal vector and radiuses.
2260
2261             Parameters:
2262                 thePnt Ellipse center.
2263                 theVec Vector, normal to the plane of the ellipse.
2264                 theRMajor Major ellipse radius.
2265                 theRMinor Minor ellipse radius.
2266                 theVecMaj Vector, direction of the ellipse's main axis.
2267                 theName Object name; when specified, this parameter is used
2268                         for result publication in the study. Otherwise, if automatic
2269                         publication is switched on, default value is used for result name.
2270
2271             Returns:
2272                 New GEOM.GEOM_Object, containing the created ellipse.
2273             """
2274             # Example: see GEOM_TestAll.py
2275             theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2276             if theVecMaj is not None:
2277                 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2278             else:
2279                 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2280                 pass
2281             RaiseIfFailed("MakeEllipse", self.CurvesOp)
2282             anObj.SetParameters(Parameters)
2283             self._autoPublish(anObj, theName, "ellipse")
2284             return anObj
2285
2286         ## Create an ellipse with given radiuses.
2287         #  Center of the ellipse will be in the origin of global
2288         #  coordinate system and normal vector will be codirected with Z axis
2289         #  @param theRMajor Major ellipse radius.
2290         #  @param theRMinor Minor ellipse radius.
2291         #  @param theName Object name; when specified, this parameter is used
2292         #         for result publication in the study. Otherwise, if automatic
2293         #         publication is switched on, default value is used for result name.
2294         #
2295         #  @return New GEOM.GEOM_Object, containing the created ellipse.
2296         @ManageTransactions("CurvesOp")
2297         def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2298             """
2299             Create an ellipse with given radiuses.
2300             Center of the ellipse will be in the origin of global
2301             coordinate system and normal vector will be codirected with Z axis
2302
2303             Parameters:
2304                 theRMajor Major ellipse radius.
2305                 theRMinor Minor ellipse radius.
2306                 theName Object name; when specified, this parameter is used
2307                         for result publication in the study. Otherwise, if automatic
2308                         publication is switched on, default value is used for result name.
2309
2310             Returns:
2311             New GEOM.GEOM_Object, containing the created ellipse.
2312             """
2313             anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2314             RaiseIfFailed("MakeEllipse", self.CurvesOp)
2315             self._autoPublish(anObj, theName, "ellipse")
2316             return anObj
2317
2318         ## Create a polyline on the set of points.
2319         #  @param thePoints Sequence of points for the polyline.
2320         #  @param theIsClosed If True, build a closed wire.
2321         #  @param theName Object name; when specified, this parameter is used
2322         #         for result publication in the study. Otherwise, if automatic
2323         #         publication is switched on, default value is used for result name.
2324         #
2325         #  @return New GEOM.GEOM_Object, containing the created polyline.
2326         #
2327         #  @ref tui_creation_curve "Example"
2328         @ManageTransactions("CurvesOp")
2329         def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2330             """
2331             Create a polyline on the set of points.
2332
2333             Parameters:
2334                 thePoints Sequence of points for the polyline.
2335                 theIsClosed If True, build a closed wire.
2336                 theName Object name; when specified, this parameter is used
2337                         for result publication in the study. Otherwise, if automatic
2338                         publication is switched on, default value is used for result name.
2339
2340             Returns:
2341                 New GEOM.GEOM_Object, containing the created polyline.
2342             """
2343             # Example: see GEOM_TestAll.py
2344             anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2345             RaiseIfFailed("MakePolyline", self.CurvesOp)
2346             self._autoPublish(anObj, theName, "polyline")
2347             return anObj
2348
2349         ## Create bezier curve on the set of points.
2350         #  @param thePoints Sequence of points for the bezier curve.
2351         #  @param theIsClosed If True, build a closed curve.
2352         #  @param theName Object name; when specified, this parameter is used
2353         #         for result publication in the study. Otherwise, if automatic
2354         #         publication is switched on, default value is used for result name.
2355         #
2356         #  @return New GEOM.GEOM_Object, containing the created bezier curve.
2357         #
2358         #  @ref tui_creation_curve "Example"
2359         @ManageTransactions("CurvesOp")
2360         def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2361             """
2362             Create bezier curve on the set of points.
2363
2364             Parameters:
2365                 thePoints Sequence of points for the bezier curve.
2366                 theIsClosed If True, build a closed curve.
2367                 theName Object name; when specified, this parameter is used
2368                         for result publication in the study. Otherwise, if automatic
2369                         publication is switched on, default value is used for result name.
2370
2371             Returns:
2372                 New GEOM.GEOM_Object, containing the created bezier curve.
2373             """
2374             # Example: see GEOM_TestAll.py
2375             anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2376             RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2377             self._autoPublish(anObj, theName, "bezier")
2378             return anObj
2379
2380         ## Create B-Spline curve on the set of points.
2381         #  @param thePoints Sequence of points for the B-Spline curve.
2382         #  @param theIsClosed If True, build a closed curve.
2383         #  @param theDoReordering If TRUE, the algo does not follow the order of
2384         #                         \a thePoints but searches for the closest vertex.
2385         #  @param theName Object name; when specified, this parameter is used
2386         #         for result publication in the study. Otherwise, if automatic
2387         #         publication is switched on, default value is used for result name.
2388         #
2389         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2390         #
2391         #  @ref tui_creation_curve "Example"
2392         @ManageTransactions("CurvesOp")
2393         def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2394             """
2395             Create B-Spline curve on the set of points.
2396
2397             Parameters:
2398                 thePoints Sequence of points for the B-Spline curve.
2399                 theIsClosed If True, build a closed curve.
2400                 theDoReordering If True, the algo does not follow the order of
2401                                 thePoints but searches for the closest vertex.
2402                 theName Object name; when specified, this parameter is used
2403                         for result publication in the study. Otherwise, if automatic
2404                         publication is switched on, default value is used for result name.
2405
2406             Returns:
2407                 New GEOM.GEOM_Object, containing the created B-Spline curve.
2408             """
2409             # Example: see GEOM_TestAll.py
2410             anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2411             RaiseIfFailed("MakeInterpol", self.CurvesOp)
2412             self._autoPublish(anObj, theName, "bspline")
2413             return anObj
2414
2415         ## Create B-Spline curve on the set of points.
2416         #  @param thePoints Sequence of points for the B-Spline curve.
2417         #  @param theFirstVec Vector object, defining the curve direction at its first point.
2418         #  @param theLastVec Vector object, defining the curve direction at its last point.
2419         #  @param theName Object name; when specified, this parameter is used
2420         #         for result publication in the study. Otherwise, if automatic
2421         #         publication is switched on, default value is used for result name.
2422         #
2423         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2424         #
2425         #  @ref tui_creation_curve "Example"
2426         @ManageTransactions("CurvesOp")
2427         def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2428             """
2429             Create B-Spline curve on the set of points.
2430
2431             Parameters:
2432                 thePoints Sequence of points for the B-Spline curve.
2433                 theFirstVec Vector object, defining the curve direction at its first point.
2434                 theLastVec Vector object, defining the curve direction at its last point.
2435                 theName Object name; when specified, this parameter is used
2436                         for result publication in the study. Otherwise, if automatic
2437                         publication is switched on, default value is used for result name.
2438
2439             Returns:
2440                 New GEOM.GEOM_Object, containing the created B-Spline curve.
2441             """
2442             # Example: see GEOM_TestAll.py
2443             anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2444             RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2445             self._autoPublish(anObj, theName, "bspline")
2446             return anObj
2447
2448         ## Creates a curve using the parametric definition of the basic points.
2449         #  @param thexExpr parametric equation of the coordinates X.
2450         #  @param theyExpr parametric equation of the coordinates Y.
2451         #  @param thezExpr parametric equation of the coordinates Z.
2452         #  @param theParamMin the minimal value of the parameter.
2453         #  @param theParamMax the maximum value of the parameter.
2454         #  @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2455         #  @param theCurveType the type of the curve,
2456         #         one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2457         #  @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.
2458         #  @param theName Object name; when specified, this parameter is used
2459         #         for result publication in the study. Otherwise, if automatic
2460         #         publication is switched on, default value is used for result name.
2461         #
2462         #  @return New GEOM.GEOM_Object, containing the created curve.
2463         #
2464         #  @ref tui_creation_curve "Example"
2465         @ManageTransactions("CurvesOp")
2466         def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2467                                 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2468             """
2469             Creates a curve using the parametric definition of the basic points.
2470
2471             Parameters:
2472                 thexExpr parametric equation of the coordinates X.
2473                 theyExpr parametric equation of the coordinates Y.
2474                 thezExpr parametric equation of the coordinates Z.
2475                 theParamMin the minimal value of the parameter.
2476                 theParamMax the maximum value of the parameter.
2477                 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2478                 theCurveType the type of the curve,
2479                              one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2480                 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2481                              method is used which can lead to a bug.
2482                 theName Object name; when specified, this parameter is used
2483                         for result publication in the study. Otherwise, if automatic
2484                         publication is switched on, default value is used for result name.
2485
2486             Returns:
2487                 New GEOM.GEOM_Object, containing the created curve.
2488             """
2489             theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2490             if theNewMethod:
2491               anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2492             else:
2493               anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2494             RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
2495             anObj.SetParameters(Parameters)
2496             self._autoPublish(anObj, theName, "curve")
2497             return anObj
2498
2499         ## Create an isoline curve on a face.
2500         #  @param theFace the face for which an isoline is created.
2501         #  @param IsUIsoline True for U-isoline creation; False for V-isoline
2502         #         creation.
2503         #  @param theParameter the U parameter for U-isoline or V parameter
2504         #         for V-isoline.
2505         #  @param theName Object name; when specified, this parameter is used
2506         #         for result publication in the study. Otherwise, if automatic
2507         #         publication is switched on, default value is used for result name.
2508         #
2509         #  @return New GEOM.GEOM_Object, containing the created isoline edge or
2510         #          a compound of edges.
2511         #
2512         #  @ref tui_creation_curve "Example"
2513         @ManageTransactions("CurvesOp")
2514         def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2515             """
2516             Create an isoline curve on a face.
2517
2518             Parameters:
2519                 theFace the face for which an isoline is created.
2520                 IsUIsoline True for U-isoline creation; False for V-isoline
2521                            creation.
2522                 theParameter the U parameter for U-isoline or V parameter
2523                              for V-isoline.
2524                 theName Object name; when specified, this parameter is used
2525                         for result publication in the study. Otherwise, if automatic
2526                         publication is switched on, default value is used for result name.
2527
2528             Returns:
2529                 New GEOM.GEOM_Object, containing the created isoline edge or a
2530                 compound of edges.
2531             """
2532             # Example: see GEOM_TestAll.py
2533             anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2534             RaiseIfFailed("MakeIsoline", self.CurvesOp)
2535             if IsUIsoline:
2536                 self._autoPublish(anObj, theName, "U-Isoline")
2537             else:
2538                 self._autoPublish(anObj, theName, "V-Isoline")
2539             return anObj
2540
2541         # end of l4_curves
2542         ## @}
2543
2544         ## @addtogroup l3_sketcher
2545         ## @{
2546
2547         ## Create a sketcher (wire or face), following the textual description,
2548         #  passed through <VAR>theCommand</VAR> argument. \n
2549         #  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2550         #  Format of the description string have to be the following:
2551         #
2552         #  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2553         #
2554         #  Where:
2555         #  - x1, y1 are coordinates of the first sketcher point (zero by default),
2556         #  - CMD is one of
2557         #     - "R angle" : Set the direction by angle
2558         #     - "D dx dy" : Set the direction by DX & DY
2559         #     .
2560         #       \n
2561         #     - "TT x y" : Create segment by point at X & Y
2562         #     - "T dx dy" : Create segment by point with DX & DY
2563         #     - "L length" : Create segment by direction & Length
2564         #     - "IX x" : Create segment by direction & Intersect. X
2565         #     - "IY y" : Create segment by direction & Intersect. Y
2566         #     .
2567         #       \n
2568         #     - "C radius length" : Create arc by direction, radius and length(in degree)
2569         #     - "AA x y": Create arc by point at X & Y
2570         #     - "A dx dy" : Create arc by point with DX & DY
2571         #     - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2572         #     - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2573         #     - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2574         #     - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2575         #     .
2576         #       \n
2577         #     - "WW" : Close Wire (to finish)
2578         #     - "WF" : Close Wire and build face (to finish)
2579         #     .
2580         #        \n
2581         #  - Flag1 (= reverse) is 0 or 2 ...
2582         #     - if 0 the drawn arc is the one of lower angle (< Pi)
2583         #     - if 2 the drawn arc ius the one of greater angle (> Pi)
2584         #     .
2585         #        \n
2586         #  - Flag2 (= control tolerance) is 0 or 1 ...
2587         #     - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2588         #     - if 1 the wire is built only if the end point is on the arc
2589         #       with a tolerance of 10^-7 on the distance else the creation fails
2590         #
2591         #  @param theCommand String, defining the sketcher in local
2592         #                    coordinates of the working plane.
2593         #  @param theWorkingPlane Nine double values, defining origin,
2594         #                         OZ and OX directions of the working plane.
2595         #  @param theName Object name; when specified, this parameter is used
2596         #         for result publication in the study. Otherwise, if automatic
2597         #         publication is switched on, default value is used for result name.
2598         #
2599         #  @return New GEOM.GEOM_Object, containing the created wire.
2600         #
2601         #  @ref tui_sketcher_page "Example"
2602         @ManageTransactions("CurvesOp")
2603         def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2604             """
2605             Create a sketcher (wire or face), following the textual description, passed
2606             through theCommand argument.
2607             Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2608             Format of the description string have to be the following:
2609                 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2610             Where:
2611             - x1, y1 are coordinates of the first sketcher point (zero by default),
2612             - CMD is one of
2613                - "R angle" : Set the direction by angle
2614                - "D dx dy" : Set the direction by DX & DY
2615
2616                - "TT x y" : Create segment by point at X & Y
2617                - "T dx dy" : Create segment by point with DX & DY
2618                - "L length" : Create segment by direction & Length
2619                - "IX x" : Create segment by direction & Intersect. X
2620                - "IY y" : Create segment by direction & Intersect. Y
2621
2622                - "C radius length" : Create arc by direction, radius and length(in degree)
2623                - "AA x y": Create arc by point at X & Y
2624                - "A dx dy" : Create arc by point with DX & DY
2625                - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2626                - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2627                - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2628                - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2629
2630                - "WW" : Close Wire (to finish)
2631                - "WF" : Close Wire and build face (to finish)
2632
2633             - Flag1 (= reverse) is 0 or 2 ...
2634                - if 0 the drawn arc is the one of lower angle (< Pi)
2635                - if 2 the drawn arc ius the one of greater angle (> Pi)
2636
2637             - Flag2 (= control tolerance) is 0 or 1 ...
2638                - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2639                - if 1 the wire is built only if the end point is on the arc
2640                  with a tolerance of 10^-7 on the distance else the creation fails
2641
2642             Parameters:
2643                 theCommand String, defining the sketcher in local
2644                            coordinates of the working plane.
2645                 theWorkingPlane Nine double values, defining origin,
2646                                 OZ and OX directions of the working plane.
2647                 theName Object name; when specified, this parameter is used
2648                         for result publication in the study. Otherwise, if automatic
2649                         publication is switched on, default value is used for result name.
2650
2651             Returns:
2652                 New GEOM.GEOM_Object, containing the created wire.
2653             """
2654             # Example: see GEOM_TestAll.py
2655             theCommand,Parameters = ParseSketcherCommand(theCommand)
2656             anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2657             RaiseIfFailed("MakeSketcher", self.CurvesOp)
2658             anObj.SetParameters(Parameters)
2659             self._autoPublish(anObj, theName, "wire")
2660             return anObj
2661
2662         ## Create a sketcher (wire or face), following the textual description,
2663         #  passed through <VAR>theCommand</VAR> argument. \n
2664         #  For format of the description string see MakeSketcher() method.\n
2665         #  @param theCommand String, defining the sketcher in local
2666         #                    coordinates of the working plane.
2667         #  @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2668         #  @param theName Object name; when specified, this parameter is used
2669         #         for result publication in the study. Otherwise, if automatic
2670         #         publication is switched on, default value is used for result name.
2671         #
2672         #  @return New GEOM.GEOM_Object, containing the created wire.
2673         #
2674         #  @ref tui_sketcher_page "Example"
2675         @ManageTransactions("CurvesOp")
2676         def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2677             """
2678             Create a sketcher (wire or face), following the textual description,
2679             passed through theCommand argument.
2680             For format of the description string see geompy.MakeSketcher() method.
2681
2682             Parameters:
2683                 theCommand String, defining the sketcher in local
2684                            coordinates of the working plane.
2685                 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2686                 theName Object name; when specified, this parameter is used
2687                         for result publication in the study. Otherwise, if automatic
2688                         publication is switched on, default value is used for result name.
2689
2690             Returns:
2691                 New GEOM.GEOM_Object, containing the created wire.
2692             """
2693             theCommand,Parameters = ParseSketcherCommand(theCommand)
2694             anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2695             RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2696             anObj.SetParameters(Parameters)
2697             self._autoPublish(anObj, theName, "wire")
2698             return anObj
2699
2700         ## Obtain a 2D sketcher interface
2701         #  @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2702         def Sketcher2D (self):
2703             """
2704             Obtain a 2D sketcher interface.
2705
2706             Example of usage:
2707                sk = geompy.Sketcher2D()
2708                sk.addPoint(20, 20)
2709                sk.addSegmentRelative(15, 70)
2710                sk.addSegmentPerpY(50)
2711                sk.addArcRadiusRelative(25, 15, 14.5, 0)
2712                sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2713                sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2714                sk.close()
2715                Sketch_1 = sk.wire(geomObj_1)
2716             """
2717             sk = Sketcher2D (self)
2718             return sk
2719
2720         ## Create a sketcher wire, following the numerical description,
2721         #  passed through <VAR>theCoordinates</VAR> argument. \n
2722         #  @param theCoordinates double values, defining points to create a wire,
2723         #                                                      passing from it.
2724         #  @param theName Object name; when specified, this parameter is used
2725         #         for result publication in the study. Otherwise, if automatic
2726         #         publication is switched on, default value is used for result name.
2727         #
2728         #  @return New GEOM.GEOM_Object, containing the created wire.
2729         #
2730         #  @ref tui_3dsketcher_page "Example"
2731         @ManageTransactions("CurvesOp")
2732         def Make3DSketcher(self, theCoordinates, theName=None):
2733             """
2734             Create a sketcher wire, following the numerical description,
2735             passed through theCoordinates argument.
2736
2737             Parameters:
2738                 theCoordinates double values, defining points to create a wire,
2739                                passing from it.
2740                 theName Object name; when specified, this parameter is used
2741                         for result publication in the study. Otherwise, if automatic
2742                         publication is switched on, default value is used for result name.
2743
2744             Returns:
2745                 New GEOM_Object, containing the created wire.
2746             """
2747             theCoordinates,Parameters = ParseParameters(theCoordinates)
2748             anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2749             RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2750             anObj.SetParameters(Parameters)
2751             self._autoPublish(anObj, theName, "wire")
2752             return anObj
2753
2754         ## Obtain a 3D sketcher interface
2755         #  @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2756         #
2757         #  @ref tui_3dsketcher_page "Example"
2758         def Sketcher3D (self):
2759             """
2760             Obtain a 3D sketcher interface.
2761
2762             Example of usage:
2763                 sk = geompy.Sketcher3D()
2764                 sk.addPointsAbsolute(0,0,0, 70,0,0)
2765                 sk.addPointsRelative(0, 0, 130)
2766                 sk.addPointAnglesLength("OXY", 50, 0, 100)
2767                 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2768                 sk.close()
2769                 a3D_Sketcher_1 = sk.wire()
2770             """
2771             sk = Sketcher3D (self)
2772             return sk
2773
2774         ## Obtain a 2D polyline creation interface
2775         #  @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2776         #
2777         #  @ref tui_3dsketcher_page "Example"
2778         def Polyline2D (self):
2779             """
2780             Obtain a 2D polyline creation interface.
2781
2782             Example of usage:
2783                 pl = geompy.Polyline2D()
2784                 pl.addSection("section 1", GEOM.Polyline, True)
2785                 pl.addPoints(0, 0, 10, 0, 10, 10)
2786                 pl.addSection("section 2", GEOM.Interpolation, False)
2787                 pl.addPoints(20, 0, 30, 0, 30, 10)
2788                 resultObj = pl.result(WorkingPlane)
2789             """
2790             pl = Polyline2D (self)
2791             return pl
2792
2793         # end of l3_sketcher
2794         ## @}
2795
2796         ## @addtogroup l3_3d_primitives
2797         ## @{
2798
2799         ## Create a box by coordinates of two opposite vertices.
2800         #
2801         #  @param x1,y1,z1 double values, defining first point it.
2802         #  @param x2,y2,z2 double values, defining first point it.
2803         #  @param theName Object name; when specified, this parameter is used
2804         #         for result publication in the study. Otherwise, if automatic
2805         #         publication is switched on, default value is used for result name.
2806         #
2807         #  @return New GEOM.GEOM_Object, containing the created box.
2808         #
2809         #  @ref tui_creation_box "Example"
2810         def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2811             """
2812             Create a box by coordinates of two opposite vertices.
2813
2814             Parameters:
2815                 x1,y1,z1 double values, defining first point.
2816                 x2,y2,z2 double values, defining second point.
2817                 theName Object name; when specified, this parameter is used
2818                         for result publication in the study. Otherwise, if automatic
2819                         publication is switched on, default value is used for result name.
2820
2821             Returns:
2822                 New GEOM.GEOM_Object, containing the created box.
2823             """
2824             # Example: see GEOM_TestAll.py
2825             pnt1 = self.MakeVertex(x1,y1,z1)
2826             pnt2 = self.MakeVertex(x2,y2,z2)
2827             # note: auto-publishing is done in self.MakeBoxTwoPnt()
2828             return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2829
2830         ## Create a box with specified dimensions along the coordinate axes
2831         #  and with edges, parallel to the coordinate axes.
2832         #  Center of the box will be at point (DX/2, DY/2, DZ/2).
2833         #  @param theDX Length of Box edges, parallel to OX axis.
2834         #  @param theDY Length of Box edges, parallel to OY axis.
2835         #  @param theDZ Length of Box edges, parallel to OZ axis.
2836         #  @param theName Object name; when specified, this parameter is used
2837         #         for result publication in the study. Otherwise, if automatic
2838         #         publication is switched on, default value is used for result name.
2839         #
2840         #  @return New GEOM.GEOM_Object, containing the created box.
2841         #
2842         #  @ref tui_creation_box "Example"
2843         @ManageTransactions("PrimOp")
2844         def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2845             """
2846             Create a box with specified dimensions along the coordinate axes
2847             and with edges, parallel to the coordinate axes.
2848             Center of the box will be at point (DX/2, DY/2, DZ/2).
2849
2850             Parameters:
2851                 theDX Length of Box edges, parallel to OX axis.
2852                 theDY Length of Box edges, parallel to OY axis.
2853                 theDZ Length of Box edges, parallel to OZ axis.
2854                 theName Object name; when specified, this parameter is used
2855                         for result publication in the study. Otherwise, if automatic
2856                         publication is switched on, default value is used for result name.
2857
2858             Returns:
2859                 New GEOM.GEOM_Object, containing the created box.
2860             """
2861             # Example: see GEOM_TestAll.py
2862             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2863             anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2864             RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2865             anObj.SetParameters(Parameters)
2866             self._autoPublish(anObj, theName, "box")
2867             return anObj
2868
2869         ## Create a box with two specified opposite vertices,
2870         #  and with edges, parallel to the coordinate axes
2871         #  @param thePnt1 First of two opposite vertices.
2872         #  @param thePnt2 Second of two opposite vertices.
2873         #  @param theName Object name; when specified, this parameter is used
2874         #         for result publication in the study. Otherwise, if automatic
2875         #         publication is switched on, default value is used for result name.
2876         #
2877         #  @return New GEOM.GEOM_Object, containing the created box.
2878         #
2879         #  @ref tui_creation_box "Example"
2880         @ManageTransactions("PrimOp")
2881         def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2882             """
2883             Create a box with two specified opposite vertices,
2884             and with edges, parallel to the coordinate axes
2885
2886             Parameters:
2887                 thePnt1 First of two opposite vertices.
2888                 thePnt2 Second of two opposite vertices.
2889                 theName Object name; when specified, this parameter is used
2890                         for result publication in the study. Otherwise, if automatic
2891                         publication is switched on, default value is used for result name.
2892
2893             Returns:
2894                 New GEOM.GEOM_Object, containing the created box.
2895             """
2896             # Example: see GEOM_TestAll.py
2897             anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2898             RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2899             self._autoPublish(anObj, theName, "box")
2900             return anObj
2901
2902         ## Create a face with specified dimensions with edges parallel to coordinate axes.
2903         #  @param theH height of Face.
2904         #  @param theW width of Face.
2905         #  @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2906         #  @param theName Object name; when specified, this parameter is used
2907         #         for result publication in the study. Otherwise, if automatic
2908         #         publication is switched on, default value is used for result name.
2909         #
2910         #  @return New GEOM.GEOM_Object, containing the created face.
2911         #
2912         #  @ref tui_creation_face "Example"
2913         @ManageTransactions("PrimOp")
2914         def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2915             """
2916             Create a face with specified dimensions with edges parallel to coordinate axes.
2917
2918             Parameters:
2919                 theH height of Face.
2920                 theW width of Face.
2921                 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2922                 theName Object name; when specified, this parameter is used
2923                         for result publication in the study. Otherwise, if automatic
2924                         publication is switched on, default value is used for result name.
2925
2926             Returns:
2927                 New GEOM.GEOM_Object, containing the created face.
2928             """
2929             # Example: see GEOM_TestAll.py
2930             theH,theW,Parameters = ParseParameters(theH, theW)
2931             anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2932             RaiseIfFailed("MakeFaceHW", self.PrimOp)
2933             anObj.SetParameters(Parameters)
2934             self._autoPublish(anObj, theName, "rectangle")
2935             return anObj
2936
2937         ## Create a face from another plane and two sizes,
2938         #  vertical size and horisontal size.
2939         #  @param theObj   Normale vector to the creating face or
2940         #  the face object.
2941         #  @param theH     Height (vertical size).
2942         #  @param theW     Width (horisontal size).
2943         #  @param theName Object name; when specified, this parameter is used
2944         #         for result publication in the study. Otherwise, if automatic
2945         #         publication is switched on, default value is used for result name.
2946         #
2947         #  @return New GEOM.GEOM_Object, containing the created face.
2948         #
2949         #  @ref tui_creation_face "Example"
2950         @ManageTransactions("PrimOp")
2951         def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2952             """
2953             Create a face from another plane and two sizes,
2954             vertical size and horisontal size.
2955
2956             Parameters:
2957                 theObj   Normale vector to the creating face or
2958                          the face object.
2959                 theH     Height (vertical size).
2960                 theW     Width (horisontal size).
2961                 theName Object name; when specified, this parameter is used
2962                         for result publication in the study. Otherwise, if automatic
2963                         publication is switched on, default value is used for result name.
2964
2965             Returns:
2966                 New GEOM_Object, containing the created face.
2967             """
2968             # Example: see GEOM_TestAll.py
2969             theH,theW,Parameters = ParseParameters(theH, theW)
2970             anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2971             RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2972             anObj.SetParameters(Parameters)
2973             self._autoPublish(anObj, theName, "rectangle")
2974             return anObj
2975
2976         ## Create a disk with given center, normal vector and radius.
2977         #  @param thePnt Disk center.
2978         #  @param theVec Vector, normal to the plane of the disk.
2979         #  @param theR Disk radius.
2980         #  @param theName Object name; when specified, this parameter is used
2981         #         for result publication in the study. Otherwise, if automatic
2982         #         publication is switched on, default value is used for result name.
2983         #
2984         #  @return New GEOM.GEOM_Object, containing the created disk.
2985         #
2986         #  @ref tui_creation_disk "Example"
2987         @ManageTransactions("PrimOp")
2988         def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2989             """
2990             Create a disk with given center, normal vector and radius.
2991
2992             Parameters:
2993                 thePnt Disk center.
2994                 theVec Vector, normal to the plane of the disk.
2995                 theR Disk radius.
2996                 theName Object name; when specified, this parameter is used
2997                         for result publication in the study. Otherwise, if automatic
2998                         publication is switched on, default value is used for result name.
2999
3000             Returns:
3001                 New GEOM.GEOM_Object, containing the created disk.
3002             """
3003             # Example: see GEOM_TestAll.py
3004             theR,Parameters = ParseParameters(theR)
3005             anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
3006             RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
3007             anObj.SetParameters(Parameters)
3008             self._autoPublish(anObj, theName, "disk")
3009             return anObj
3010
3011         ## Create a disk, passing through three given points
3012         #  @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
3013         #  @param theName Object name; when specified, this parameter is used
3014         #         for result publication in the study. Otherwise, if automatic
3015         #         publication is switched on, default value is used for result name.
3016         #
3017         #  @return New GEOM.GEOM_Object, containing the created disk.
3018         #
3019         #  @ref tui_creation_disk "Example"
3020         @ManageTransactions("PrimOp")
3021         def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
3022             """
3023             Create a disk, passing through three given points
3024
3025             Parameters:
3026                 thePnt1,thePnt2,thePnt3 Points, defining the disk.
3027                 theName Object name; when specified, this parameter is used
3028                         for result publication in the study. Otherwise, if automatic
3029                         publication is switched on, default value is used for result name.
3030
3031             Returns:
3032                 New GEOM.GEOM_Object, containing the created disk.
3033             """
3034             # Example: see GEOM_TestAll.py
3035             anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
3036             RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
3037             self._autoPublish(anObj, theName, "disk")
3038             return anObj
3039
3040         ## Create a disk with specified dimensions along OX-OY coordinate axes.
3041         #  @param theR Radius of Face.
3042         #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX
3043         #  @param theName Object name; when specified, this parameter is used
3044         #         for result publication in the study. Otherwise, if automatic
3045         #         publication is switched on, default value is used for result name.
3046         #
3047         #  @return New GEOM.GEOM_Object, containing the created disk.
3048         #
3049         #  @ref tui_creation_face "Example"
3050         @ManageTransactions("PrimOp")
3051         def MakeDiskR(self, theR, theOrientation, theName=None):
3052             """
3053             Create a disk with specified dimensions along OX-OY coordinate axes.
3054
3055             Parameters:
3056                 theR Radius of Face.
3057                 theOrientation set the orientation belong axis OXY or OYZ or OZX
3058                 theName Object name; when specified, this parameter is used
3059                         for result publication in the study. Otherwise, if automatic
3060                         publication is switched on, default value is used for result name.
3061
3062             Returns:
3063                 New GEOM.GEOM_Object, containing the created disk.
3064
3065             Example of usage:
3066                 Disk3 = geompy.MakeDiskR(100., 1)
3067             """
3068             # Example: see GEOM_TestAll.py
3069             theR,Parameters = ParseParameters(theR)
3070             anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
3071             RaiseIfFailed("MakeDiskR", self.PrimOp)
3072             anObj.SetParameters(Parameters)
3073             self._autoPublish(anObj, theName, "disk")
3074             return anObj
3075
3076         ## Create a cylinder with given base point, axis, radius and height.
3077         #  @param thePnt Central point of cylinder base.
3078         #  @param theAxis Cylinder axis.
3079         #  @param theR Cylinder radius.
3080         #  @param theH Cylinder height.
3081         #  @param theName Object name; when specified, this parameter is used
3082         #         for result publication in the study. Otherwise, if automatic
3083         #         publication is switched on, default value is used for result name.
3084         #
3085         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3086         #
3087         #  @ref tui_creation_cylinder "Example"
3088         @ManageTransactions("PrimOp")
3089         def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
3090             """
3091             Create a cylinder with given base point, axis, radius and height.
3092
3093             Parameters:
3094                 thePnt Central point of cylinder base.
3095                 theAxis Cylinder axis.
3096                 theR Cylinder radius.
3097                 theH Cylinder height.
3098                 theName Object name; when specified, this parameter is used
3099                         for result publication in the study. Otherwise, if automatic
3100                         publication is switched on, default value is used for result name.
3101
3102             Returns:
3103                 New GEOM.GEOM_Object, containing the created cylinder.
3104             """
3105             # Example: see GEOM_TestAll.py
3106             theR,theH,Parameters = ParseParameters(theR, theH)
3107             anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3108             RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3109             anObj.SetParameters(Parameters)
3110             self._autoPublish(anObj, theName, "cylinder")
3111             return anObj
3112             
3113         ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3114         #  @param thePnt Central point of cylinder base.
3115         #  @param theAxis Cylinder axis.
3116         #  @param theR Cylinder radius.
3117         #  @param theH Cylinder height.
3118         #  @param theA Cylinder angle in radians.
3119         #  @param theName Object name; when specified, this parameter is used
3120         #         for result publication in the study. Otherwise, if automatic
3121         #         publication is switched on, default value is used for result name.
3122         #
3123         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3124         #
3125         #  @ref tui_creation_cylinder "Example"
3126         @ManageTransactions("PrimOp")
3127         def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3128             """
3129             Create a portion of cylinder with given base point, axis, radius, height and angle.
3130
3131             Parameters:
3132                 thePnt Central point of cylinder base.
3133                 theAxis Cylinder axis.
3134                 theR Cylinder radius.
3135                 theH Cylinder height.
3136                 theA Cylinder angle in radians.
3137                 theName Object name; when specified, this parameter is used
3138                         for result publication in the study. Otherwise, if automatic
3139                         publication is switched on, default value is used for result name.
3140
3141             Returns:
3142                 New GEOM.GEOM_Object, containing the created cylinder.
3143             """
3144             # Example: see GEOM_TestAll.py
3145             flag = False
3146             if isinstance(theA,str):
3147                 flag = True
3148             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3149             if flag:
3150                 theA = theA*math.pi/180.
3151             if theA<=0. or theA>=2*math.pi:
3152                 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3153             anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3154             RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3155             anObj.SetParameters(Parameters)
3156             self._autoPublish(anObj, theName, "cylinder")
3157             return anObj
3158
3159         ## Create a cylinder with given radius and height at
3160         #  the origin of coordinate system. Axis of the cylinder
3161         #  will be collinear to the OZ axis of the coordinate system.
3162         #  @param theR Cylinder radius.
3163         #  @param theH Cylinder height.
3164         #  @param theName Object name; when specified, this parameter is used
3165         #         for result publication in the study. Otherwise, if automatic
3166         #         publication is switched on, default value is used for result name.
3167         #
3168         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3169         #
3170         #  @ref tui_creation_cylinder "Example"
3171         @ManageTransactions("PrimOp")
3172         def MakeCylinderRH(self, theR, theH, theName=None):
3173             """
3174             Create a cylinder with given radius and height at
3175             the origin of coordinate system. Axis of the cylinder
3176             will be collinear to the OZ axis of the coordinate system.
3177
3178             Parameters:
3179                 theR Cylinder radius.
3180                 theH Cylinder height.
3181                 theName Object name; when specified, this parameter is used
3182                         for result publication in the study. Otherwise, if automatic
3183                         publication is switched on, default value is used for result name.
3184
3185             Returns:
3186                 New GEOM.GEOM_Object, containing the created cylinder.
3187             """
3188             # Example: see GEOM_TestAll.py
3189             theR,theH,Parameters = ParseParameters(theR, theH)
3190             anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3191             RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3192             anObj.SetParameters(Parameters)
3193             self._autoPublish(anObj, theName, "cylinder")
3194             return anObj
3195             
3196         ## Create a portion of cylinder with given radius, height and angle at
3197         #  the origin of coordinate system. Axis of the cylinder
3198         #  will be collinear to the OZ axis of the coordinate system.
3199         #  @param theR Cylinder radius.
3200         #  @param theH Cylinder height.
3201         #  @param theA Cylinder angle in radians.
3202         #  @param theName Object name; when specified, this parameter is used
3203         #         for result publication in the study. Otherwise, if automatic
3204         #         publication is switched on, default value is used for result name.
3205         #
3206         #  @return New GEOM.GEOM_Object, containing the created cylinder.
3207         #
3208         #  @ref tui_creation_cylinder "Example"
3209         @ManageTransactions("PrimOp")
3210         def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3211             """
3212             Create a portion of cylinder with given radius, height and angle at
3213             the origin of coordinate system. Axis of the cylinder
3214             will be collinear to the OZ axis of the coordinate system.
3215
3216             Parameters:
3217                 theR Cylinder radius.
3218                 theH Cylinder height.
3219                 theA Cylinder angle in radians.
3220                 theName Object name; when specified, this parameter is used
3221                         for result publication in the study. Otherwise, if automatic
3222                         publication is switched on, default value is used for result name.
3223
3224             Returns:
3225                 New GEOM.GEOM_Object, containing the created cylinder.
3226             """
3227             # Example: see GEOM_TestAll.py
3228             flag = False
3229             if isinstance(theA,str):
3230                 flag = True
3231             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3232             if flag:
3233                 theA = theA*math.pi/180.
3234             if theA<=0. or theA>=2*math.pi:
3235                 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3236             anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3237             RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3238             anObj.SetParameters(Parameters)
3239             self._autoPublish(anObj, theName, "cylinder")
3240             return anObj
3241
3242         ## Create a sphere with given center and radius.
3243         #  @param thePnt Sphere center.
3244         #  @param theR Sphere radius.
3245         #  @param theName Object name; when specified, this parameter is used
3246         #         for result publication in the study. Otherwise, if automatic
3247         #         publication is switched on, default value is used for result name.
3248         #
3249         #  @return New GEOM.GEOM_Object, containing the created sphere.
3250         #
3251         #  @ref tui_creation_sphere "Example"
3252         @ManageTransactions("PrimOp")
3253         def MakeSpherePntR(self, thePnt, theR, theName=None):
3254             """
3255             Create a sphere with given center and radius.
3256
3257             Parameters:
3258                 thePnt Sphere center.
3259                 theR Sphere radius.
3260                 theName Object name; when specified, this parameter is used
3261                         for result publication in the study. Otherwise, if automatic
3262                         publication is switched on, default value is used for result name.
3263
3264             Returns:
3265                 New GEOM.GEOM_Object, containing the created sphere.
3266             """
3267             # Example: see GEOM_TestAll.py
3268             theR,Parameters = ParseParameters(theR)
3269             anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3270             RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3271             anObj.SetParameters(Parameters)
3272             self._autoPublish(anObj, theName, "sphere")
3273             return anObj
3274
3275         ## Create a sphere with given center and radius.
3276         #  @param x,y,z Coordinates of sphere center.
3277         #  @param theR Sphere radius.
3278         #  @param theName Object name; when specified, this parameter is used
3279         #         for result publication in the study. Otherwise, if automatic
3280         #         publication is switched on, default value is used for result name.
3281         #
3282         #  @return New GEOM.GEOM_Object, containing the created sphere.
3283         #
3284         #  @ref tui_creation_sphere "Example"
3285         def MakeSphere(self, x, y, z, theR, theName=None):
3286             """
3287             Create a sphere with given center and radius.
3288
3289             Parameters:
3290                 x,y,z Coordinates of sphere center.
3291                 theR Sphere radius.
3292                 theName Object name; when specified, this parameter is used
3293                         for result publication in the study. Otherwise, if automatic
3294                         publication is switched on, default value is used for result name.
3295
3296             Returns:
3297                 New GEOM.GEOM_Object, containing the created sphere.
3298             """
3299             # Example: see GEOM_TestAll.py
3300             point = self.MakeVertex(x, y, z)
3301             # note: auto-publishing is done in self.MakeSpherePntR()
3302             anObj = self.MakeSpherePntR(point, theR, theName)
3303             return anObj
3304
3305         ## Create a sphere with given radius at the origin of coordinate system.
3306         #  @param theR Sphere radius.
3307         #  @param theName Object name; when specified, this parameter is used
3308         #         for result publication in the study. Otherwise, if automatic
3309         #         publication is switched on, default value is used for result name.
3310         #
3311         #  @return New GEOM.GEOM_Object, containing the created sphere.
3312         #
3313         #  @ref tui_creation_sphere "Example"
3314         @ManageTransactions("PrimOp")
3315         def MakeSphereR(self, theR, theName=None):
3316             """
3317             Create a sphere with given radius at the origin of coordinate system.
3318
3319             Parameters:
3320                 theR Sphere radius.
3321                 theName Object name; when specified, this parameter is used
3322                         for result publication in the study. Otherwise, if automatic
3323                         publication is switched on, default value is used for result name.
3324
3325             Returns:
3326                 New GEOM.GEOM_Object, containing the created sphere.
3327             """
3328             # Example: see GEOM_TestAll.py
3329             theR,Parameters = ParseParameters(theR)
3330             anObj = self.PrimOp.MakeSphereR(theR)
3331             RaiseIfFailed("MakeSphereR", self.PrimOp)
3332             anObj.SetParameters(Parameters)
3333             self._autoPublish(anObj, theName, "sphere")
3334             return anObj
3335
3336         ## Create a cone with given base point, axis, height and radiuses.
3337         #  @param thePnt Central point of the first cone base.
3338         #  @param theAxis Cone axis.
3339         #  @param theR1 Radius of the first cone base.
3340         #  @param theR2 Radius of the second cone base.
3341         #    \note If both radiuses are non-zero, the cone will be truncated.
3342         #    \note If the radiuses are equal, a cylinder will be created instead.
3343         #  @param theH Cone height.
3344         #  @param theName Object name; when specified, this parameter is used
3345         #         for result publication in the study. Otherwise, if automatic
3346         #         publication is switched on, default value is used for result name.
3347         #
3348         #  @return New GEOM.GEOM_Object, containing the created cone.
3349         #
3350         #  @ref tui_creation_cone "Example"
3351         @ManageTransactions("PrimOp")
3352         def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3353             """
3354             Create a cone with given base point, axis, height and radiuses.
3355
3356             Parameters:
3357                 thePnt Central point of the first cone base.
3358                 theAxis Cone axis.
3359                 theR1 Radius of the first cone base.
3360                 theR2 Radius of the second cone base.
3361                 theH Cone height.
3362                 theName Object name; when specified, this parameter is used
3363                         for result publication in the study. Otherwise, if automatic
3364                         publication is switched on, default value is used for result name.
3365
3366             Note:
3367                 If both radiuses are non-zero, the cone will be truncated.
3368                 If the radiuses are equal, a cylinder will be created instead.
3369
3370             Returns:
3371                 New GEOM.GEOM_Object, containing the created cone.
3372             """
3373             # Example: see GEOM_TestAll.py
3374             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3375             anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3376             RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3377             anObj.SetParameters(Parameters)
3378             self._autoPublish(anObj, theName, "cone")
3379             return anObj
3380
3381         ## Create a cone with given height and radiuses at
3382         #  the origin of coordinate system. Axis of the cone will
3383         #  be collinear to the OZ axis of the coordinate system.
3384         #  @param theR1 Radius of the first cone base.
3385         #  @param theR2 Radius of the second cone base.
3386         #    \note If both radiuses are non-zero, the cone will be truncated.
3387         #    \note If the radiuses are equal, a cylinder will be created instead.
3388         #  @param theH Cone height.
3389         #  @param theName Object name; when specified, this parameter is used
3390         #         for result publication in the study. Otherwise, if automatic
3391         #         publication is switched on, default value is used for result name.
3392         #
3393         #  @return New GEOM.GEOM_Object, containing the created cone.
3394         #
3395         #  @ref tui_creation_cone "Example"
3396         @ManageTransactions("PrimOp")
3397         def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3398             """
3399             Create a cone with given height and radiuses at
3400             the origin of coordinate system. Axis of the cone will
3401             be collinear to the OZ axis of the coordinate system.
3402
3403             Parameters:
3404                 theR1 Radius of the first cone base.
3405                 theR2 Radius of the second cone base.
3406                 theH Cone height.
3407                 theName Object name; when specified, this parameter is used
3408                         for result publication in the study. Otherwise, if automatic
3409                         publication is switched on, default value is used for result name.
3410
3411             Note:
3412                 If both radiuses are non-zero, the cone will be truncated.
3413                 If the radiuses are equal, a cylinder will be created instead.
3414
3415             Returns:
3416                 New GEOM.GEOM_Object, containing the created cone.
3417             """
3418             # Example: see GEOM_TestAll.py
3419             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3420             anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3421             RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3422             anObj.SetParameters(Parameters)
3423             self._autoPublish(anObj, theName, "cone")
3424             return anObj
3425
3426         ## Create a torus with given center, normal vector and radiuses.
3427         #  @param thePnt Torus central point.
3428         #  @param theVec Torus axis of symmetry.
3429         #  @param theRMajor Torus major radius.
3430         #  @param theRMinor Torus minor radius.
3431         #  @param theName Object name; when specified, this parameter is used
3432         #         for result publication in the study. Otherwise, if automatic
3433         #         publication is switched on, default value is used for result name.
3434         #
3435         #  @return New GEOM.GEOM_Object, containing the created torus.
3436         #
3437         #  @ref tui_creation_torus "Example"
3438         @ManageTransactions("PrimOp")
3439         def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3440             """
3441             Create a torus with given center, normal vector and radiuses.
3442
3443             Parameters:
3444                 thePnt Torus central point.
3445                 theVec Torus axis of symmetry.
3446                 theRMajor Torus major radius.
3447                 theRMinor Torus minor radius.
3448                 theName Object name; when specified, this parameter is used
3449                         for result publication in the study. Otherwise, if automatic
3450                         publication is switched on, default value is used for result name.
3451
3452            Returns:
3453                 New GEOM.GEOM_Object, containing the created torus.
3454             """
3455             # Example: see GEOM_TestAll.py
3456             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3457             anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3458             RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3459             anObj.SetParameters(Parameters)
3460             self._autoPublish(anObj, theName, "torus")
3461             return anObj
3462
3463         ## Create a torus with given radiuses at the origin of coordinate system.
3464         #  @param theRMajor Torus major radius.
3465         #  @param theRMinor Torus minor radius.
3466         #  @param theName Object name; when specified, this parameter is used
3467         #         for result publication in the study. Otherwise, if automatic
3468         #         publication is switched on, default value is used for result name.
3469         #
3470         #  @return New GEOM.GEOM_Object, containing the created torus.
3471         #
3472         #  @ref tui_creation_torus "Example"
3473         @ManageTransactions("PrimOp")
3474         def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3475             """
3476            Create a torus with given radiuses at the origin of coordinate system.
3477
3478            Parameters:
3479                 theRMajor Torus major radius.
3480                 theRMinor Torus minor radius.
3481                 theName Object name; when specified, this parameter is used
3482                         for result publication in the study. Otherwise, if automatic
3483                         publication is switched on, default value is used for result name.
3484
3485            Returns:
3486                 New GEOM.GEOM_Object, containing the created torus.
3487             """
3488             # Example: see GEOM_TestAll.py
3489             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3490             anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3491             RaiseIfFailed("MakeTorusRR", self.PrimOp)
3492             anObj.SetParameters(Parameters)
3493             self._autoPublish(anObj, theName, "torus")
3494             return anObj
3495
3496         # end of l3_3d_primitives
3497         ## @}
3498
3499         ## @addtogroup l3_complex
3500         ## @{
3501
3502         ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3503         #  @param theBase Base shape to be extruded.
3504         #  @param thePoint1 First end of extrusion vector.
3505         #  @param thePoint2 Second end of extrusion vector.
3506         #  @param theScaleFactor Use it to make prism with scaled second base.
3507         #                        Nagative value means not scaled second base.
3508         #  @param theName Object name; when specified, this parameter is used
3509         #         for result publication in the study. Otherwise, if automatic
3510         #         publication is switched on, default value is used for result name.
3511         #
3512         #  @return New GEOM.GEOM_Object, containing the created prism.
3513         #
3514         #  @ref tui_creation_prism "Example"
3515         @ManageTransactions("PrimOp")
3516         def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3517             """
3518             Create a shape by extrusion of the base shape along a vector, defined by two points.
3519
3520             Parameters:
3521                 theBase Base shape to be extruded.
3522                 thePoint1 First end of extrusion vector.
3523                 thePoint2 Second end of extrusion vector.
3524                 theScaleFactor Use it to make prism with scaled second base.
3525                                Nagative value means not scaled second base.
3526                 theName Object name; when specified, this parameter is used
3527                         for result publication in the study. Otherwise, if automatic
3528                         publication is switched on, default value is used for result name.
3529
3530             Returns:
3531                 New GEOM.GEOM_Object, containing the created prism.
3532             """
3533             # Example: see GEOM_TestAll.py
3534             anObj = None
3535             Parameters = ""
3536             if theScaleFactor > 0:
3537                 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3538                 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3539             else:
3540                 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3541             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3542             anObj.SetParameters(Parameters)
3543             self._autoPublish(anObj, theName, "prism")
3544             return anObj
3545
3546         ## Create a shape by extrusion of the base shape along a
3547         #  vector, defined by two points, in 2 Ways (forward/backward).
3548         #  @param theBase Base shape to be extruded.
3549         #  @param thePoint1 First end of extrusion vector.
3550         #  @param thePoint2 Second end of extrusion vector.
3551         #  @param theName Object name; when specified, this parameter is used
3552         #         for result publication in the study. Otherwise, if automatic
3553         #         publication is switched on, default value is used for result name.
3554         #
3555         #  @return New GEOM.GEOM_Object, containing the created prism.
3556         #
3557         #  @ref tui_creation_prism "Example"
3558         @ManageTransactions("PrimOp")
3559         def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3560             """
3561             Create a shape by extrusion of the base shape along a
3562             vector, defined by two points, in 2 Ways (forward/backward).
3563
3564             Parameters:
3565                 theBase Base shape to be extruded.
3566                 thePoint1 First end of extrusion vector.
3567                 thePoint2 Second end of extrusion vector.
3568                 theName Object name; when specified, this parameter is used
3569                         for result publication in the study. Otherwise, if automatic
3570                         publication is switched on, default value is used for result name.
3571
3572             Returns:
3573                 New GEOM.GEOM_Object, containing the created prism.
3574             """
3575             # Example: see GEOM_TestAll.py
3576             anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3577             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3578             self._autoPublish(anObj, theName, "prism")
3579             return anObj
3580
3581         ## Create a shape by extrusion of the base shape along the vector,
3582         #  i.e. all the space, transfixed by the base shape during its translation
3583         #  along the vector on the given distance.
3584         #  @param theBase Base shape to be extruded.
3585         #  @param theVec Direction of extrusion.
3586         #  @param theH Prism dimension along theVec.
3587         #  @param theScaleFactor Use it to make prism with scaled second base.
3588         #                        Negative value means not scaled second base.
3589         #  @param theName Object name; when specified, this parameter is used
3590         #         for result publication in the study. Otherwise, if automatic
3591         #         publication is switched on, default value is used for result name.
3592         #
3593         #  @return New GEOM.GEOM_Object, containing the created prism.
3594         #
3595         #  @ref tui_creation_prism "Example"
3596         @ManageTransactions("PrimOp")
3597         def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3598             """
3599             Create a shape by extrusion of the base shape along the vector,
3600             i.e. all the space, transfixed by the base shape during its translation
3601             along the vector on the given distance.
3602
3603             Parameters:
3604                 theBase Base shape to be extruded.
3605                 theVec Direction of extrusion.
3606                 theH Prism dimension along theVec.
3607                 theScaleFactor Use it to make prism with scaled second base.
3608                                Negative value means not scaled second base.
3609                 theName Object name; when specified, this parameter is used
3610                         for result publication in the study. Otherwise, if automatic
3611                         publication is switched on, default value is used for result name.
3612
3613             Returns:
3614                 New GEOM.GEOM_Object, containing the created prism.
3615             """
3616             # Example: see GEOM_TestAll.py
3617             anObj = None
3618             Parameters = ""
3619             if theScaleFactor > 0:
3620                 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3621                 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3622             else:
3623                 theH,Parameters = ParseParameters(theH)
3624                 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3625             RaiseIfFailed("MakePrismVecH", self.PrimOp)
3626             anObj.SetParameters(Parameters)
3627             self._autoPublish(anObj, theName, "prism")
3628             return anObj
3629
3630         ## Create a shape by extrusion of the base shape along the vector,
3631         #  i.e. all the space, transfixed by the base shape during its translation
3632         #  along the vector on the given distance in 2 Ways (forward/backward).
3633         #  @param theBase Base shape to be extruded.
3634         #  @param theVec Direction of extrusion.
3635         #  @param theH Prism dimension along theVec in forward direction.
3636         #  @param theName Object name; when specified, this parameter is used
3637         #         for result publication in the study. Otherwise, if automatic
3638         #         publication is switched on, default value is used for result name.
3639         #
3640         #  @return New GEOM.GEOM_Object, containing the created prism.
3641         #
3642         #  @ref tui_creation_prism "Example"
3643         @ManageTransactions("PrimOp")
3644         def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3645             """
3646             Create a shape by extrusion of the base shape along the vector,
3647             i.e. all the space, transfixed by the base shape during its translation
3648             along the vector on the given distance in 2 Ways (forward/backward).
3649
3650             Parameters:
3651                 theBase Base shape to be extruded.
3652                 theVec Direction of extrusion.
3653                 theH Prism dimension along theVec in forward direction.
3654                 theName Object name; when specified, this parameter is used
3655                         for result publication in the study. Otherwise, if automatic
3656                         publication is switched on, default value is used for result name.
3657
3658             Returns:
3659                 New GEOM.GEOM_Object, containing the created prism.
3660             """
3661             # Example: see GEOM_TestAll.py
3662             theH,Parameters = ParseParameters(theH)
3663             anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3664             RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3665             anObj.SetParameters(Parameters)
3666             self._autoPublish(anObj, theName, "prism")
3667             return anObj
3668
3669         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3670         #  @param theBase Base shape to be extruded.
3671         #  @param theDX, theDY, theDZ Directions of extrusion.
3672         #  @param theScaleFactor Use it to make prism with scaled second base.
3673         #                        Nagative value means not scaled second base.
3674         #  @param theName Object name; when specified, this parameter is used
3675         #         for result publication in the study. Otherwise, if automatic
3676         #         publication is switched on, default value is used for result name.
3677         #
3678         #  @return New GEOM.GEOM_Object, containing the created prism.
3679         #
3680         #  @ref tui_creation_prism "Example"
3681         @ManageTransactions("PrimOp")
3682         def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3683             """
3684             Create a shape by extrusion of the base shape along the dx, dy, dz direction
3685
3686             Parameters:
3687                 theBase Base shape to be extruded.
3688                 theDX, theDY, theDZ Directions of extrusion.
3689                 theScaleFactor Use it to make prism with scaled second base.
3690                                Nagative value means not scaled second base.
3691                 theName Object name; when specified, this parameter is used
3692                         for result publication in the study. Otherwise, if automatic
3693                         publication is switched on, default value is used for result name.
3694
3695             Returns:
3696                 New GEOM.GEOM_Object, containing the created prism.
3697             """
3698             # Example: see GEOM_TestAll.py
3699             anObj = None
3700             Parameters = ""
3701             if theScaleFactor > 0:
3702                 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3703                 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3704             else:
3705                 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3706                 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3707             RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3708             anObj.SetParameters(Parameters)
3709             self._autoPublish(anObj, theName, "prism")
3710             return anObj
3711
3712         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3713         #  i.e. all the space, transfixed by the base shape during its translation
3714         #  along the vector on the given distance in 2 Ways (forward/backward).
3715         #  @param theBase Base shape to be extruded.
3716         #  @param theDX, theDY, theDZ Directions of extrusion.
3717         #  @param theName Object name; when specified, this parameter is used
3718         #         for result publication in the study. Otherwise, if automatic
3719         #         publication is switched on, default value is used for result name.
3720         #
3721         #  @return New GEOM.GEOM_Object, containing the created prism.
3722         #
3723         #  @ref tui_creation_prism "Example"
3724         @ManageTransactions("PrimOp")
3725         def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3726             """
3727             Create a shape by extrusion of the base shape along the dx, dy, dz direction
3728             i.e. all the space, transfixed by the base shape during its translation
3729             along the vector on the given distance in 2 Ways (forward/backward).
3730
3731             Parameters:
3732                 theBase Base shape to be extruded.
3733                 theDX, theDY, theDZ Directions of extrusion.
3734                 theName Object name; when specified, this parameter is used
3735                         for result publication in the study. Otherwise, if automatic
3736                         publication is switched on, default value is used for result name.
3737
3738             Returns:
3739                 New GEOM.GEOM_Object, containing the created prism.
3740             """
3741             # Example: see GEOM_TestAll.py
3742             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3743             anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3744             RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3745             anObj.SetParameters(Parameters)
3746             self._autoPublish(anObj, theName, "prism")
3747             return anObj
3748
3749         ## Create a shape by revolution of the base shape around the axis
3750         #  on the given angle, i.e. all the space, transfixed by the base
3751         #  shape during its rotation around the axis on the given angle.
3752         #  @param theBase Base shape to be rotated.
3753         #  @param theAxis Rotation axis.
3754         #  @param theAngle Rotation angle in radians.
3755         #  @param theName Object name; when specified, this parameter is used
3756         #         for result publication in the study. Otherwise, if automatic
3757         #         publication is switched on, default value is used for result name.
3758         #
3759         #  @return New GEOM.GEOM_Object, containing the created revolution.
3760         #
3761         #  @ref tui_creation_revolution "Example"
3762         @ManageTransactions("PrimOp")
3763         def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3764             """
3765             Create a shape by revolution of the base shape around the axis
3766             on the given angle, i.e. all the space, transfixed by the base
3767             shape during its rotation around the axis on the given angle.
3768
3769             Parameters:
3770                 theBase Base shape to be rotated.
3771                 theAxis Rotation axis.
3772                 theAngle Rotation angle in radians.
3773                 theName Object name; when specified, this parameter is used
3774                         for result publication in the study. Otherwise, if automatic
3775                         publication is switched on, default value is used for result name.
3776
3777             Returns:
3778                 New GEOM.GEOM_Object, containing the created revolution.
3779             """
3780             # Example: see GEOM_TestAll.py
3781             theAngle,Parameters = ParseParameters(theAngle)
3782             anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3783             RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3784             anObj.SetParameters(Parameters)
3785             self._autoPublish(anObj, theName, "revolution")
3786             return anObj
3787
3788         ## Create a shape by revolution of the base shape around the axis
3789         #  on the given angle, i.e. all the space, transfixed by the base
3790         #  shape during its rotation around the axis on the given angle in
3791         #  both directions (forward/backward)
3792         #  @param theBase Base shape to be rotated.
3793         #  @param theAxis Rotation axis.
3794         #  @param theAngle Rotation angle in radians.
3795         #  @param theName Object name; when specified, this parameter is used
3796         #         for result publication in the study. Otherwise, if automatic
3797         #         publication is switched on, default value is used for result name.
3798         #
3799         #  @return New GEOM.GEOM_Object, containing the created revolution.
3800         #
3801         #  @ref tui_creation_revolution "Example"
3802         @ManageTransactions("PrimOp")
3803         def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3804             """
3805             Create a shape by revolution of the base shape around the axis
3806             on the given angle, i.e. all the space, transfixed by the base
3807             shape during its rotation around the axis on the given angle in
3808             both directions (forward/backward).
3809
3810             Parameters:
3811                 theBase Base shape to be rotated.
3812                 theAxis Rotation axis.
3813                 theAngle Rotation angle in radians.
3814                 theName Object name; when specified, this parameter is used
3815                         for result publication in the study. Otherwise, if automatic
3816                         publication is switched on, default value is used for result name.
3817
3818             Returns:
3819                 New GEOM.GEOM_Object, containing the created revolution.
3820             """
3821             theAngle,Parameters = ParseParameters(theAngle)
3822             anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3823             RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3824             anObj.SetParameters(Parameters)
3825             self._autoPublish(anObj, theName, "revolution")
3826             return anObj
3827
3828         ## Create a face from a given set of contours.
3829         #  @param theContours either a list or a compound of edges/wires.
3830         #  @param theMinDeg a minimal degree of BSpline surface to create.
3831         #  @param theMaxDeg a maximal degree of BSpline surface to create.
3832         #  @param theTol2D a 2d tolerance to be reached.
3833         #  @param theTol3D a 3d tolerance to be reached.
3834         #  @param theNbIter a number of iteration of approximation algorithm.
3835         #  @param theMethod Kind of method to perform filling operation
3836         #         (see GEOM.filling_oper_method enum).
3837         #  @param isApprox if True, BSpline curves are generated in the process
3838         #                  of surface construction. By default it is False, that means
3839         #                  the surface is created using given curves. The usage of
3840         #                  Approximation makes the algorithm work slower, but allows
3841         #                  building the surface for rather complex cases.
3842         #  @param theName Object name; when specified, this parameter is used
3843         #         for result publication in the study. Otherwise, if automatic
3844         #         publication is switched on, default value is used for result name.
3845         #
3846         #  @return New GEOM.GEOM_Object (face), containing the created filling surface.
3847         #
3848         #  @ref tui_creation_filling "Example"
3849         @ManageTransactions("PrimOp")
3850         def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3851                         theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3852             """
3853             Create a face from a given set of contours.
3854
3855             Parameters:
3856                 theContours either a list or a compound of edges/wires.
3857                 theMinDeg a minimal degree of BSpline surface to create.
3858                 theMaxDeg a maximal degree of BSpline surface to create.
3859                 theTol2D a 2d tolerance to be reached.
3860                 theTol3D a 3d tolerance to be reached.
3861                 theNbIter a number of iteration of approximation algorithm.
3862                 theMethod Kind of method to perform filling operation
3863                           (see GEOM.filling_oper_method enum).
3864                 isApprox if True, BSpline curves are generated in the process
3865                          of surface construction. By default it is False, that means
3866                          the surface is created using given curves. The usage of
3867                          Approximation makes the algorithm work slower, but allows
3868                          building the surface for rather complex cases.
3869                 theName Object name; when specified, this parameter is used
3870                         for result publication in the study. Otherwise, if automatic
3871                         publication is switched on, default value is used for result name.
3872
3873             Returns:
3874                 New GEOM.GEOM_Object (face), containing the created filling surface.
3875
3876             Example of usage:
3877                 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3878             """
3879             # Example: see GEOM_TestAll.py
3880             theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3881             anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3882                                             theTol2D, theTol3D, theNbIter,
3883                                             theMethod, isApprox)
3884             RaiseIfFailed("MakeFilling", self.PrimOp)
3885             anObj.SetParameters(Parameters)
3886             self._autoPublish(anObj, theName, "filling")
3887             return anObj
3888
3889
3890         ## Create a face from a given set of contours.
3891         #  This method corresponds to MakeFilling() with isApprox=True.
3892         #  @param theContours either a list or a compound of edges/wires.
3893         #  @param theMinDeg a minimal degree of BSpline surface to create.
3894         #  @param theMaxDeg a maximal degree of BSpline surface to create.
3895         #  @param theTol3D a 3d tolerance to be reached.
3896         #  @param theName Object name; when specified, this parameter is used
3897         #         for result publication in the study. Otherwise, if automatic
3898         #         publication is switched on, default value is used for result name.
3899         #
3900         #  @return New GEOM.GEOM_Object (face), containing the created filling surface.
3901         #
3902         #  @ref tui_creation_filling "Example"
3903         @ManageTransactions("PrimOp")
3904         def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3905             """
3906             Create a filling from the given compound of contours.
3907             This method corresponds to MakeFilling() with isApprox=True.
3908
3909             Parameters:
3910                 theContours either a list or a compound of edges/wires.
3911                 theMinDeg a minimal degree of BSpline surface to create.
3912                 theMaxDeg a maximal degree of BSpline surface to create.
3913                 theTol3D a 3d tolerance to be reached.
3914                 theName Object name; when specified, this parameter is used
3915                         for result publication in the study. Otherwise, if automatic
3916                         publication is switched on, default value is used for result name.
3917
3918             Returns:
3919                 New GEOM.GEOM_Object (face), containing the created filling surface.
3920
3921             Example of usage:
3922                 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3923             """
3924             # Example: see GEOM_TestAll.py
3925             theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3926             anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3927                                             0, theTol3D, 0, GEOM.FOM_Default, True)
3928             RaiseIfFailed("MakeFillingNew", self.PrimOp)
3929             anObj.SetParameters(Parameters)
3930             self._autoPublish(anObj, theName, "filling")
3931             return anObj
3932
3933         ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3934         #  @param theSeqSections - set of specified sections.
3935         #  @param theModeSolid - mode defining building solid or shell
3936         #  @param thePreci - precision 3D used for smoothing
3937         #  @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3938         #  @param theName Object name; when specified, this parameter is used
3939         #         for result publication in the study. Otherwise, if automatic
3940         #         publication is switched on, default value is used for result name.
3941         #
3942         #  @return New GEOM.GEOM_Object, containing the created shell or solid.
3943         #
3944         #  @ref swig_todo "Example"
3945         @ManageTransactions("PrimOp")
3946         def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3947             """
3948             Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3949
3950             Parameters:
3951                 theSeqSections - set of specified sections.
3952                 theModeSolid - mode defining building solid or shell
3953                 thePreci - precision 3D used for smoothing
3954                 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3955                 theName Object name; when specified, this parameter is used
3956                         for result publication in the study. Otherwise, if automatic
3957                         publication is switched on, default value is used for result name.
3958
3959             Returns:
3960                 New GEOM.GEOM_Object, containing the created shell or solid.
3961             """
3962             # Example: see GEOM_TestAll.py
3963             anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3964             RaiseIfFailed("MakeThruSections", self.PrimOp)
3965             self._autoPublish(anObj, theName, "filling")
3966             return anObj
3967
3968         ## Create a shape by extrusion of the base shape along
3969         #  the path shape. The path shape can be a wire or an edge. It is
3970         #  possible to generate groups along with the result by means of
3971         #  setting the flag \a IsGenerateGroups.<BR>
3972         #  If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3973         #  set, an error is occurred. If \a thePath is not closed edge/wire,
3974         #  the following groups are returned:
3975         #  - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3976         #    "Side2";
3977         #  - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3978         #    "Other".
3979         #  .
3980         #  "Down" and "Up" groups contain:
3981         #  - Edges if \a theBase is edge or wire;
3982         #  - Faces if \a theBase is face or shell.<BR>
3983         #  .
3984         #  "Side1" and "Side2" groups contain edges generated from the first
3985         #  and last vertices of \a theBase. The first and last vertices are
3986         #  determined taking into account edge/wire orientation.<BR>
3987         #  "Other" group represents faces generated from the bounding edges of
3988         #  \a theBase.
3989         #
3990         #  @param theBase Base shape to be extruded.
3991         #  @param thePath Path shape to extrude the base shape along it.
3992         #  @param IsGenerateGroups flag that tells if it is necessary to
3993         #         create groups. It is equal to False by default.
3994         #  @param theName Object name; when specified, this parameter is used
3995         #         for result publication in the study. Otherwise, if automatic
3996         #         publication is switched on, default value is used for result name.
3997         #
3998         #  @return New GEOM.GEOM_Object, containing the created pipe if 
3999         #          \a IsGenerateGroups is not set. Otherwise it returns a
4000         #          list of GEOM.GEOM_Object. Its first element is the created pipe, the
4001         #          remaining ones are created groups.
4002         #
4003         #  @ref tui_creation_pipe "Example"
4004         @ManageTransactions("PrimOp")
4005         def MakePipe(self, theBase, thePath,
4006                      IsGenerateGroups=False, theName=None):
4007             """
4008             Create a shape by extrusion of the base shape along
4009             the path shape. The path shape can be a wire or an edge. It is
4010             possible to generate groups along with the result by means of
4011             setting the flag IsGenerateGroups.
4012             If thePath is a closed edge or wire and IsGenerateGroups is
4013             set, an error is occurred. If thePath is not closed edge/wire,
4014             the following groups are returned:
4015             - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
4016               "Side2";
4017             - If theBase is closed edge or wire, face or shell: "Down", "Up",
4018               "Other".
4019             "Down" and "Up" groups contain:
4020             - Edges if theBase is edge or wire;
4021             - Faces if theBase is face or shell.
4022             "Side1" and "Side2" groups contain edges generated from the first
4023             and last vertices of theBase. The first and last vertices are
4024             determined taking into account edge/wire orientation.
4025             "Other" group represents faces generated from the bounding edges of
4026             theBase.
4027
4028             Parameters:
4029                 theBase Base shape to be extruded.
4030                 thePath Path shape to extrude the base shape along it.
4031                 IsGenerateGroups flag that tells if it is necessary to
4032                         create groups. It is equal to False by default.
4033                 theName Object name; when specified, this parameter is used
4034                         for result publication in the study. Otherwise, if automatic
4035                         publication is switched on, default value is used for result name.
4036
4037             Returns:
4038                 New GEOM.GEOM_Object, containing the created pipe if 
4039                 IsGenerateGroups is not set. Otherwise it returns a
4040                 list of GEOM.GEOM_Object. Its first element is the created pipe, the
4041                 remaining ones are created groups.
4042             """
4043             # Example: see GEOM_TestAll.py
4044             aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
4045             RaiseIfFailed("MakePipe", self.PrimOp)
4046
4047             if IsGenerateGroups:
4048               self._autoPublish(aList, theName, "pipe")
4049               return aList
4050
4051             self._autoPublish(aList[0], theName, "pipe")
4052             return aList[0]
4053
4054         ## Create a shape by extrusion of the profile shape along
4055         #  the path shape. The path shape can be a wire or an edge.
4056         #  the several profiles can be specified in the several locations of path.
4057         #  It is possible to generate groups along with the result by means of
4058         #  setting the flag \a IsGenerateGroups. For detailed information on
4059         #  groups that can be created please see the method MakePipe().
4060         #  @param theSeqBases - list of  Bases shape to be extruded.
4061         #  @param theLocations - list of locations on the path corresponding
4062         #                        specified list of the Bases shapes. Number of locations
4063         #                        should be equal to number of bases or list of locations can be empty.
4064         #  @param thePath - Path shape to extrude the base shape along it.
4065         #  @param theWithContact - the mode defining that the section is translated to be in
4066         #                          contact with the spine.
4067         #  @param theWithCorrection - defining that the section is rotated to be
4068         #                             orthogonal to the spine tangent in the correspondent point
4069         #  @param IsGenerateGroups - flag that tells if it is necessary to
4070         #                          create groups. It is equal to False by default.
4071         #  @param theName Object name; when specified, this parameter is used
4072         #         for result publication in the study. Otherwise, if automatic
4073         #         publication is switched on, default value is used for result name.
4074         #
4075         #  @return New GEOM.GEOM_Object, containing the created pipe if 
4076         #          \a IsGenerateGroups is not set. Otherwise it returns new
4077         #          GEOM.ListOfGO. Its first element is the created pipe, the
4078         #          remaining ones are created groups.
4079         #
4080         #  @ref tui_creation_pipe_with_diff_sec "Example"
4081         @ManageTransactions("PrimOp")
4082         def MakePipeWithDifferentSections(self, theSeqBases,
4083                                           theLocations, thePath,
4084                                           theWithContact, theWithCorrection,
4085                                           IsGenerateGroups=False, theName=None):
4086             """
4087             Create a shape by extrusion of the profile shape along
4088             the path shape. The path shape can be a wire or an edge.
4089             the several profiles can be specified in the several locations of path.
4090             It is possible to generate groups along with the result by means of
4091             setting the flag IsGenerateGroups. For detailed information on
4092             groups that can be created please see the method geompy.MakePipe().
4093
4094             Parameters:
4095                 theSeqBases - list of  Bases shape to be extruded.
4096                 theLocations - list of locations on the path corresponding
4097                                specified list of the Bases shapes. Number of locations
4098                                should be equal to number of bases or list of locations can be empty.
4099                 thePath - Path shape to extrude the base shape along it.
4100                 theWithContact - the mode defining that the section is translated to be in
4101                                  contact with the spine(0/1)
4102                 theWithCorrection - defining that the section is rotated to be
4103                                     orthogonal to the spine tangent in the correspondent point (0/1)
4104                 IsGenerateGroups - flag that tells if it is necessary to
4105                                  create groups. It is equal to False by default.
4106                 theName Object name; when specified, this parameter is used
4107                         for result publication in the study. Otherwise, if automatic
4108                         publication is switched on, default value is used for result name.
4109
4110             Returns:
4111                 New GEOM.GEOM_Object, containing the created pipe if 
4112                 IsGenerateGroups is not set. Otherwise it returns new
4113                 GEOM.ListOfGO. Its first element is the created pipe, the
4114                 remaining ones are created groups.
4115             """
4116             aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4117                                                               theLocations, thePath,
4118                                                               theWithContact, theWithCorrection,
4119                                                               False, IsGenerateGroups)
4120             RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4121
4122             if IsGenerateGroups:
4123               self._autoPublish(aList, theName, "pipe")
4124               return aList
4125
4126             self._autoPublish(aList[0], theName, "pipe")
4127             return aList[0]
4128
4129         ## Create a shape by extrusion of the profile shape along
4130         #  the path shape. This function is a version of
4131         #  MakePipeWithDifferentSections() with the same parameters, except
4132         #  eliminated theWithContact and theWithCorrection. So it is
4133         #  possible to find the description of all parameters is in this
4134         #  method. The difference is that this method performs the operation
4135         #  step by step, i.e. it creates pipes between each pair of neighbor
4136         #  sections and fuses them into a single shape.
4137         #
4138         #  @ref tui_creation_pipe_with_diff_sec "Example"
4139         @ManageTransactions("PrimOp")
4140         def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
4141                                                  theLocations, thePath,
4142                                                  IsGenerateGroups=False, theName=None):
4143             """
4144             Create a shape by extrusion of the profile shape along
4145             the path shape. This function is a version of
4146             MakePipeWithDifferentSections() with the same parameters, except
4147             eliminated theWithContact and theWithCorrection. So it is
4148             possible to find the description of all parameters is in this
4149             method. The difference is that this method performs the operation
4150             step by step, i.e. it creates pipes between each pair of neighbor
4151             sections and fuses them into a single shape.
4152             """
4153             aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4154                                                               theLocations, thePath,
4155                                                               False, False,
4156                                                               True, IsGenerateGroups)
4157             RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
4158
4159             if IsGenerateGroups:
4160               self._autoPublish(aList, theName, "pipe")
4161               return aList
4162
4163             self._autoPublish(aList[0], theName, "pipe")
4164             return aList[0]
4165
4166         ## Create a shape by extrusion of the profile shape along
4167         #  the path shape. The path shape can be a wire or an edge.
4168         #  the several profiles can be specified in the several locations of path.
4169         #  It is possible to generate groups along with the result by means of
4170         #  setting the flag \a IsGenerateGroups. For detailed information on
4171         #  groups that can be created please see the method MakePipe().
4172         #  @param theSeqBases - list of  Bases shape to be extruded. Base shape must be
4173         #                       shell or face. If number of faces in neighbour sections
4174         #                       aren't coincided result solid between such sections will
4175         #                       be created using external boundaries of this shells.
4176         #  @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4177         #                          This list is used for searching correspondences between
4178         #                          faces in the sections. Size of this list must be equal
4179         #                          to size of list of base shapes.
4180         #  @param theLocations - list of locations on the path corresponding
4181         #                        specified list of the Bases shapes. Number of locations
4182         #                        should be equal to number of bases. First and last
4183         #                        locations must be coincided with first and last vertexes
4184         #                        of path correspondingly.
4185         #  @param thePath - Path shape to extrude the base shape along it.
4186         #  @param theWithContact - the mode defining that the section is translated to be in
4187         #                          contact with the spine.
4188         #  @param theWithCorrection - defining that the section is rotated to be
4189         #                             orthogonal to the spine tangent in the correspondent point
4190         #  @param IsGenerateGroups - flag that tells if it is necessary to
4191         #                          create groups. It is equal to False by default.
4192         #  @param theName Object name; when specified, this parameter is used
4193         #         for result publication in the study. Otherwise, if automatic
4194         #         publication is switched on, default value is used for result name.
4195         #
4196         #  @return New GEOM.GEOM_Object, containing the created solids if 
4197         #          \a IsGenerateGroups is not set. Otherwise it returns new
4198         #          GEOM.ListOfGO. Its first element is the created solids, the
4199         #          remaining ones are created groups.
4200         #
4201         #  @ref tui_creation_pipe_with_shell_sec "Example"
4202         @ManageTransactions("PrimOp")
4203         def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4204                                       theLocations, thePath,
4205                                       theWithContact, theWithCorrection,
4206                                       IsGenerateGroups=False, theName=None):
4207             """
4208             Create a shape by extrusion of the profile shape along
4209             the path shape. The path shape can be a wire or an edge.
4210             the several profiles can be specified in the several locations of path.
4211             It is possible to generate groups along with the result by means of
4212             setting the flag IsGenerateGroups. For detailed information on
4213             groups that can be created please see the method geompy.MakePipe().
4214
4215             Parameters:
4216                 theSeqBases - list of  Bases shape to be extruded. Base shape must be
4217                               shell or face. If number of faces in neighbour sections
4218                               aren't coincided result solid between such sections will
4219                               be created using external boundaries of this shells.
4220                 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4221                                  This list is used for searching correspondences between
4222                                  faces in the sections. Size of this list must be equal
4223                                  to size of list of base shapes.
4224                 theLocations - list of locations on the path corresponding
4225                                specified list of the Bases shapes. Number of locations
4226                                should be equal to number of bases. First and last
4227                                locations must be coincided with first and last vertexes
4228                                of path correspondingly.
4229                 thePath - Path shape to extrude the base shape along it.
4230                 theWithContact - the mode defining that the section is translated to be in
4231                                  contact with the spine (0/1)
4232                 theWithCorrection - defining that the section is rotated to be
4233                                     orthogonal to the spine tangent in the correspondent point (0/1)
4234                 IsGenerateGroups - flag that tells if it is necessary to
4235                                  create groups. It is equal to False by default.
4236                 theName Object name; when specified, this parameter is used
4237                         for result publication in the study. Otherwise, if automatic
4238                         publication is switched on, default value is used for result name.
4239
4240             Returns:
4241                 New GEOM.GEOM_Object, containing the created solids if 
4242                 IsGenerateGroups is not set. Otherwise it returns new
4243                 GEOM.ListOfGO. Its first element is the created solids, the
4244                 remaining ones are created groups.
4245             """
4246             aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4247                                                           theLocations, thePath,
4248                                                           theWithContact, theWithCorrection,
4249                                                           IsGenerateGroups)
4250             RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4251
4252             if IsGenerateGroups:
4253               self._autoPublish(aList, theName, "pipe")
4254               return aList
4255
4256             self._autoPublish(aList[0], theName, "pipe")
4257             return aList[0]
4258
4259         ## Create a shape by extrusion of the profile shape along
4260         #  the path shape. This function is used only for debug pipe
4261         #  functionality - it is a version of function MakePipeWithShellSections()
4262         #  which give a possibility to receive information about
4263         #  creating pipe between each pair of sections step by step.
4264         @ManageTransactions("PrimOp")
4265         def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4266                                              theLocations, thePath,
4267                                              theWithContact, theWithCorrection,
4268                                              IsGenerateGroups=False, theName=None):
4269             """
4270             Create a shape by extrusion of the profile shape along
4271             the path shape. This function is used only for debug pipe
4272             functionality - it is a version of previous function
4273             geompy.MakePipeWithShellSections() which give a possibility to
4274             receive information about creating pipe between each pair of
4275             sections step by step.
4276             """
4277             res = []
4278             nbsect = len(theSeqBases)
4279             nbsubsect = len(theSeqSubBases)
4280             #print "nbsect = ",nbsect
4281             for i in range(1,nbsect):
4282                 #print "  i = ",i
4283                 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4284                 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4285                 tmpSeqSubBases = []
4286                 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4287                 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4288                                                               tmpLocations, thePath,
4289                                                               theWithContact, theWithCorrection,
4290                                                               IsGenerateGroups)
4291                 if self.PrimOp.IsDone() == 0:
4292                     print("Problems with pipe creation between ",i," and ",i+1," sections")
4293                     RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4294                     break
4295                 else:
4296                     print("Pipe between ",i," and ",i+1," sections is OK")
4297                     res.append(aList[0])
4298                     pass
4299                 pass
4300
4301             resc = self.MakeCompound(res)
4302             #resc = self.MakeSewing(res, 0.001)
4303             #print "resc: ",resc
4304             self._autoPublish(resc, theName, "pipe")
4305             return resc
4306
4307         ## Create solids between given sections.
4308         #  It is possible to generate groups along with the result by means of
4309         #  setting the flag \a IsGenerateGroups. For detailed information on
4310         #  groups that can be created please see the method MakePipe().
4311         #  @param theSeqBases - list of sections (shell or face).
4312         #  @param theLocations - list of corresponding vertexes
4313         #  @param IsGenerateGroups - flag that tells if it is necessary to
4314         #         create groups. It is equal to False by default.
4315         #  @param theName Object name; when specified, this parameter is used
4316         #         for result publication in the study. Otherwise, if automatic
4317         #         publication is switched on, default value is used for result name.
4318         #
4319         #  @return New GEOM.GEOM_Object, containing the created solids if 
4320         #          \a IsGenerateGroups is not set. Otherwise it returns new
4321         #          GEOM.ListOfGO. Its first element is the created solids, the
4322         #          remaining ones are created groups.
4323         #
4324         #  @ref tui_creation_pipe_without_path "Example"
4325         @ManageTransactions("PrimOp")
4326         def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4327                                       IsGenerateGroups=False, theName=None):
4328             """
4329             Create solids between given sections.
4330             It is possible to generate groups along with the result by means of
4331             setting the flag IsGenerateGroups. For detailed information on
4332             groups that can be created please see the method geompy.MakePipe().
4333
4334             Parameters:
4335                 theSeqBases - list of sections (shell or face).
4336                 theLocations - list of corresponding vertexes
4337                 IsGenerateGroups - flag that tells if it is necessary to
4338                                  create groups. It is equal to False by default.
4339                 theName Object name; when specified, this parameter is used
4340                         for result publication in the study. Otherwise, if automatic
4341                         publication is switched on, default value is used for result name.
4342
4343             Returns:
4344                 New GEOM.GEOM_Object, containing the created solids if 
4345                 IsGenerateGroups is not set. Otherwise it returns new
4346                 GEOM.ListOfGO. Its first element is the created solids, the
4347                 remaining ones are created groups.
4348             """
4349             aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4350                                                           IsGenerateGroups)
4351             RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4352
4353             if IsGenerateGroups:
4354               self._autoPublish(aList, theName, "pipe")
4355               return aList
4356
4357             self._autoPublish(aList[0], theName, "pipe")
4358             return aList[0]
4359
4360         ## Create a shape by extrusion of the base shape along
4361         #  the path shape with constant bi-normal direction along the given vector.
4362         #  The path shape can be a wire or an edge.
4363         #  It is possible to generate groups along with the result by means of
4364         #  setting the flag \a IsGenerateGroups. For detailed information on
4365         #  groups that can be created please see the method MakePipe().
4366         #  @param theBase Base shape to be extruded.
4367         #  @param thePath Path shape to extrude the base shape along it.
4368         #  @param theVec Vector defines a constant binormal direction to keep the
4369         #                same angle between the direction and the sections
4370         #                along the sweep surface.
4371         #  @param IsGenerateGroups flag that tells if it is necessary to
4372         #         create groups. It is equal to False by default.
4373         #  @param theName Object name; when specified, this parameter is used
4374         #         for result publication in the study. Otherwise, if automatic
4375         #         publication is switched on, default value is used for result name.
4376         #
4377         #  @return New GEOM.GEOM_Object, containing the created pipe if 
4378         #          \a IsGenerateGroups is not set. Otherwise it returns new
4379         #          GEOM.ListOfGO. Its first element is the created pipe, the
4380         #          remaining ones are created groups.
4381         #
4382         #  @ref tui_creation_pipe "Example"
4383         @ManageTransactions("PrimOp")
4384         def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4385                                         IsGenerateGroups=False, theName=None):
4386             """
4387             Create a shape by extrusion of the base shape along
4388             the path shape with constant bi-normal direction along the given vector.
4389             The path shape can be a wire or an edge.
4390             It is possible to generate groups along with the result by means of
4391             setting the flag IsGenerateGroups. For detailed information on
4392             groups that can be created please see the method geompy.MakePipe().
4393
4394             Parameters:
4395                 theBase Base shape to be extruded.
4396                 thePath Path shape to extrude the base shape along it.
4397                 theVec Vector defines a constant binormal direction to keep the
4398                        same angle between the direction and the sections
4399                        along the sweep surface.
4400                 IsGenerateGroups flag that tells if it is necessary to
4401                                  create groups. It is equal to False by default.
4402                 theName Object name; when specified, this parameter is used
4403                         for result publication in the study. Otherwise, if automatic
4404                         publication is switched on, default value is used for result name.
4405
4406             Returns:
4407                 New GEOM.GEOM_Object, containing the created pipe if 
4408                 IsGenerateGroups is not set. Otherwise it returns new
4409                 GEOM.ListOfGO. Its first element is the created pipe, the
4410                 remaining ones are created groups.
4411             """
4412             # Example: see GEOM_TestAll.py
4413             aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4414                           theVec, IsGenerateGroups)
4415             RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4416
4417             if IsGenerateGroups:
4418               self._autoPublish(aList, theName, "pipe")
4419               return aList
4420
4421             self._autoPublish(aList[0], theName, "pipe")
4422             return aList[0]
4423
4424         ## Makes a thick solid from a shape. If the input is a surface shape
4425         #  (face or shell) the result is a thick solid. If an input shape is
4426         #  a solid the result is a hollowed solid with removed faces.
4427         #  @param theShape Face or Shell to get thick solid or solid to get
4428         #         hollowed solid.
4429         #  @param theThickness Thickness of the resulting solid
4430         #  @param theFacesIDs the list of face IDs to be removed from the
4431         #         result. It is ignored if \a theShape is a face or a shell.
4432         #         It is empty by default. 
4433         #  @param theInside If true the thickness is applied towards inside
4434         #  @param theName Object name; when specified, this parameter is used
4435         #         for result publication in the study. Otherwise, if automatic
4436         #         publication is switched on, default value is used for result name.
4437         #
4438         #  @return New GEOM.GEOM_Object, containing the created solid
4439         #
4440         #  @ref tui_creation_thickness "Example"
4441         @ManageTransactions("PrimOp")
4442         def MakeThickSolid(self, theShape, theThickness,
4443                            theFacesIDs=[], theInside=False, theName=None):
4444             """
4445             Make a thick solid from a shape. If the input is a surface shape
4446             (face or shell) the result is a thick solid. If an input shape is
4447             a solid the result is a hollowed solid with removed faces.
4448
4449             Parameters:
4450                  theShape Face or Shell to get thick solid or solid to get
4451                           hollowed solid.
4452                  theThickness Thickness of the resulting solid
4453                  theFacesIDs the list of face IDs to be removed from the
4454                           result. It is ignored if theShape is a face or a
4455                           shell. It is empty by default. 
4456                  theInside If true the thickness is applied towards inside
4457                  theName Object name; when specified, this parameter is used
4458                          for result publication in the study. Otherwise, if automatic
4459                          publication is switched on, default value is used for result name.
4460
4461             Returns:
4462                 New GEOM.GEOM_Object, containing the created solid
4463             """
4464             # Example: see GEOM_TestAll.py
4465             theThickness,Parameters = ParseParameters(theThickness)
4466             anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4467                                                theThickness, True, theInside)
4468             RaiseIfFailed("MakeThickSolid", self.PrimOp)
4469             anObj.SetParameters(Parameters)
4470             self._autoPublish(anObj, theName, "thickSolid")
4471             return anObj
4472
4473
4474         ## Modifies a shape to make it a thick solid. If the input is a surface
4475         #  shape (face or shell) the result is a thick solid. If an input shape
4476         #  is a solid the result is a hollowed solid with removed faces.
4477         #  @param theShape Face or Shell to get thick solid or solid to get
4478         #         hollowed solid.
4479         #  @param theThickness Thickness of the resulting solid
4480         #  @param theFacesIDs the list of face IDs to be removed from the
4481         #         result. It is ignored if \a theShape is a face or a shell.
4482         #         It is empty by default. 
4483         #  @param theInside If true the thickness is applied towards inside
4484         #
4485         #  @return The modified shape
4486         #
4487         #  @ref tui_creation_thickness "Example"
4488         @ManageTransactions("PrimOp")
4489         def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4490             """
4491             Modifies a shape to make it a thick solid. If the input is a
4492             surface shape (face or shell) the result is a thick solid. If
4493             an input shape is a solid the result is a hollowed solid with
4494             removed faces.
4495
4496             Parameters:
4497                 theShape Face or Shell to get thick solid or solid to get
4498                          hollowed solid.
4499                 theThickness Thickness of the resulting solid
4500                 theFacesIDs the list of face IDs to be removed from the
4501                          result. It is ignored if \a theShape is a face or
4502                          a shell. It is empty by default. 
4503                 theInside If true the thickness is applied towards inside
4504
4505             Returns:
4506                 The modified shape
4507             """
4508             # Example: see GEOM_TestAll.py
4509             theThickness,Parameters = ParseParameters(theThickness)
4510             anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4511                                                theThickness, False, theInside)
4512             RaiseIfFailed("Thicken", self.PrimOp)
4513             anObj.SetParameters(Parameters)
4514             return anObj
4515
4516         ## Build a middle path of a pipe-like shape.
4517         #  The path shape can be a wire or an edge.
4518         #  @param theShape It can be closed or unclosed pipe-like shell
4519         #                  or a pipe-like solid.
4520         #  @param theBase1, theBase2 Two bases of the supposed pipe. This
4521         #                            should be wires or faces of theShape.
4522         #  @param theName Object name; when specified, this parameter is used
4523         #         for result publication in the study. Otherwise, if automatic
4524         #         publication is switched on, default value is used for result name.
4525         #
4526         #  @note It is not assumed that exact or approximate copy of theShape
4527         #        can be obtained by applying existing Pipe operation on the
4528         #        resulting "Path" wire taking theBase1 as the base - it is not
4529         #        always possible; though in some particular cases it might work
4530         #        it is not guaranteed. Thus, RestorePath function should not be
4531         #        considered as an exact reverse operation of the Pipe.
4532         #
4533         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
4534         #                                source pipe's "path".
4535         #
4536         #  @ref tui_creation_pipe_path "Example"
4537         @ManageTransactions("PrimOp")
4538         def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4539             """
4540             Build a middle path of a pipe-like shape.
4541             The path shape can be a wire or an edge.
4542
4543             Parameters:
4544                 theShape It can be closed or unclosed pipe-like shell
4545                          or a pipe-like solid.
4546                 theBase1, theBase2 Two bases of the supposed pipe. This
4547                                    should be wires or faces of theShape.
4548                 theName Object name; when specified, this parameter is used
4549                         for result publication in the study. Otherwise, if automatic
4550                         publication is switched on, default value is used for result name.
4551
4552             Returns:
4553                 New GEOM_Object, containing an edge or wire that represent
4554                                  source pipe's path.
4555             """
4556             anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4557             RaiseIfFailed("RestorePath", self.PrimOp)
4558             self._autoPublish(anObj, theName, "path")
4559             return anObj
4560
4561         ## Build a middle path of a pipe-like shape.
4562         #  The path shape can be a wire or an edge.
4563         #  @param theShape It can be closed or unclosed pipe-like shell
4564         #                  or a pipe-like solid.
4565         #  @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4566         #                                should be lists of edges of theShape.
4567         #  @param theName Object name; when specified, this parameter is used
4568         #         for result publication in the study. Otherwise, if automatic
4569         #         publication is switched on, default value is used for result name.
4570         #
4571         #  @note It is not assumed that exact or approximate copy of theShape
4572         #        can be obtained by applying existing Pipe operation on the
4573         #        resulting "Path" wire taking theBase1 as the base - it is not
4574         #        always possible; though in some particular cases it might work
4575         #        it is not guaranteed. Thus, RestorePath function should not be
4576         #        considered as an exact reverse operation of the Pipe.
4577         #
4578         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
4579         #                                source pipe's "path".
4580         #
4581         #  @ref tui_creation_pipe_path "Example"
4582         @ManageTransactions("PrimOp")
4583         def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4584             """
4585             Build a middle path of a pipe-like shape.
4586             The path shape can be a wire or an edge.
4587
4588             Parameters:
4589                 theShape It can be closed or unclosed pipe-like shell
4590                          or a pipe-like solid.
4591                 listEdges1, listEdges2 Two bases of the supposed pipe. This
4592                                        should be lists of edges of theShape.
4593                 theName Object name; when specified, this parameter is used
4594                         for result publication in the study. Otherwise, if automatic
4595                         publication is switched on, default value is used for result name.
4596
4597             Returns:
4598                 New GEOM_Object, containing an edge or wire that represent
4599                                  source pipe's path.
4600             """
4601             anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4602             RaiseIfFailed("RestorePath", self.PrimOp)
4603             self._autoPublish(anObj, theName, "path")
4604             return anObj
4605
4606         # end of l3_complex
4607         ## @}
4608
4609         ## @addtogroup l3_basic_go
4610         ## @{
4611
4612         ## Create a linear edge with specified ends.
4613         #  @param thePnt1 Point for the first end of edge.
4614         #  @param thePnt2 Point for the second end of edge.
4615         #  @param theName Object name; when specified, this parameter is used
4616         #         for result publication in the study. Otherwise, if automatic
4617         #         publication is switched on, default value is used for result name.
4618         #
4619         #  @return New GEOM.GEOM_Object, containing the created edge.
4620         #
4621         #  @ref tui_creation_edge "Example"
4622         @ManageTransactions("ShapesOp")
4623         def MakeEdge(self, thePnt1, thePnt2, theName=None):
4624             """
4625             Create a linear edge with specified ends.
4626
4627             Parameters:
4628                 thePnt1 Point for the first end of edge.
4629                 thePnt2 Point for the second end of edge.
4630                 theName Object name; when specified, this parameter is used
4631                         for result publication in the study. Otherwise, if automatic
4632                         publication is switched on, default value is used for result name.
4633
4634             Returns:
4635                 New GEOM.GEOM_Object, containing the created edge.
4636             """
4637             # Example: see GEOM_TestAll.py
4638             anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4639             RaiseIfFailed("MakeEdge", self.ShapesOp)
4640             self._autoPublish(anObj, theName, "edge")
4641             return anObj
4642
4643         ## Create a new edge, corresponding to the given length on the given curve.
4644         #  @param theRefCurve The referenced curve (edge).
4645         #  @param theLength Length on the referenced curve. It can be negative.
4646         #  @param theStartPoint Any point can be selected for it, the new edge will begin
4647         #                       at the end of \a theRefCurve, close to the selected point.
4648         #                       If None, start from the first point of \a theRefCurve.
4649         #  @param theName Object name; when specified, this parameter is used
4650         #         for result publication in the study. Otherwise, if automatic
4651         #         publication is switched on, default value is used for result name.
4652         #
4653         #  @return New GEOM.GEOM_Object, containing the created edge.
4654         #
4655         #  @ref tui_creation_edge "Example"
4656         @ManageTransactions("ShapesOp")
4657         def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4658             """
4659             Create a new edge, corresponding to the given length on the given curve.
4660
4661             Parameters:
4662                 theRefCurve The referenced curve (edge).
4663                 theLength Length on the referenced curve. It can be negative.
4664                 theStartPoint Any point can be selected for it, the new edge will begin
4665                               at the end of theRefCurve, close to the selected point.
4666                               If None, start from the first point of theRefCurve.
4667                 theName Object name; when specified, this parameter is used
4668                         for result publication in the study. Otherwise, if automatic
4669                         publication is switched on, default value is used for result name.
4670
4671             Returns:
4672                 New GEOM.GEOM_Object, containing the created edge.
4673             """
4674             # Example: see GEOM_TestAll.py
4675             theLength, Parameters = ParseParameters(theLength)
4676             anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4677             RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4678             anObj.SetParameters(Parameters)
4679             self._autoPublish(anObj, theName, "edge")
4680             return anObj
4681
4682         ## Create an edge from specified wire.
4683         #  @param theWire source Wire
4684         #  @param theLinearTolerance linear tolerance value (default = 1e-07)
4685         #  @param theAngularTolerance angular tolerance value (default = 1e-12)
4686         #  @param theName Object name; when specified, this parameter is used
4687         #         for result publication in the study. Otherwise, if automatic
4688         #         publication is switched on, default value is used for result name.
4689         #
4690         #  @return New GEOM.GEOM_Object, containing the created edge.
4691         #
4692         #  @ref tui_creation_edge "Example"
4693         @ManageTransactions("ShapesOp")
4694         def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4695             """
4696             Create an edge from specified wire.
4697
4698             Parameters:
4699                 theWire source Wire
4700                 theLinearTolerance linear tolerance value (default = 1e-07)
4701                 theAngularTolerance angular tolerance value (default = 1e-12)
4702                 theName Object name; when specified, this parameter is used
4703                         for result publication in the study. Otherwise, if automatic
4704                         publication is switched on, default value is used for result name.
4705
4706             Returns:
4707                 New GEOM.GEOM_Object, containing the created edge.
4708             """
4709             # Example: see GEOM_TestAll.py
4710             anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4711             RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4712             self._autoPublish(anObj, theName, "edge")
4713             return anObj
4714
4715         ## Create a wire from the set of edges and wires.
4716         #  @param theEdgesAndWires List of edges and/or wires.
4717         #  @param theTolerance Maximum distance between vertices, that will be merged.
4718         #                      Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4719         #  @param theName Object name; when specified, this parameter is used
4720         #         for result publication in the study. Otherwise, if automatic
4721         #         publication is switched on, default value is used for result name.
4722         #
4723         #  @return New GEOM.GEOM_Object, containing the created wire.
4724         #
4725         #  @ref tui_creation_wire "Example"
4726         @ManageTransactions("ShapesOp")
4727         def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4728             """
4729             Create a wire from the set of edges and wires.
4730
4731             Parameters:
4732                 theEdgesAndWires List of edges and/or wires.
4733                 theTolerance Maximum distance between vertices, that will be merged.
4734                              Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4735                 theName Object name; when specified, this parameter is used
4736                         for result publication in the study. Otherwise, if automatic
4737                         publication is switched on, default value is used for result name.
4738
4739             Returns:
4740                 New GEOM.GEOM_Object, containing the created wire.
4741             """
4742             # Example: see GEOM_TestAll.py
4743             anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4744             RaiseIfFailed("MakeWire", self.ShapesOp)
4745             self._autoPublish(anObj, theName, "wire")
4746             return anObj
4747
4748         ## Create a face on the given wire.
4749         #  @param theWire closed Wire or Edge to build the face on.
4750         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4751         #                        If the tolerance of the obtained planar face is less
4752         #                        than 1e-06, this face will be returned, otherwise the
4753         #                        algorithm tries to build any suitable face on the given
4754         #                        wire and prints a warning message.
4755         #  @param theName Object name; when specified, this parameter is used
4756         #         for result publication in the study. Otherwise, if automatic
4757         #         publication is switched on, default value is used for result name.
4758         #
4759         #  @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4760         #
4761         #  @ref tui_creation_face "Example"
4762         @ManageTransactions("ShapesOp")
4763         def MakeFace(self, theWire, isPlanarWanted, theName=None, raiseException=False):
4764             """
4765             Create a face on the given wire.
4766
4767             Parameters:
4768                 theWire closed Wire or Edge to build the face on.
4769                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4770                                If the tolerance of the obtained planar face is less
4771                                than 1e-06, this face will be returned, otherwise the
4772                                algorithm tries to build any suitable face on the given
4773                                wire and prints a warning message.
4774                 theName Object name; when specified, this parameter is used
4775                         for result publication in the study. Otherwise, if automatic
4776                         publication is switched on, default value is used for result name.
4777
4778             Returns:
4779                 New GEOM.GEOM_Object, containing the created face (compound of faces).
4780             """
4781             # Example: see GEOM_TestAll.py
4782             anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4783             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4784                 PrintOrRaise("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.",raiseException)
4785             else:
4786                 RaiseIfFailed("MakeFace", self.ShapesOp)
4787             self._autoPublish(anObj, theName, "face")
4788             return anObj
4789
4790         ## Create a face on the given wires set.
4791         #  @param theWires List of closed wires or edges to build the face on.
4792         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4793         #                        If the tolerance of the obtained planar face is less
4794         #                        than 1e-06, this face will be returned, otherwise the
4795         #                        algorithm tries to build any suitable face on the given
4796         #                        wire and prints a warning message.
4797         #  @param theName Object name; when specified, this parameter is used
4798         #         for result publication in the study. Otherwise, if automatic
4799         #         publication is switched on, default value is used for result name.
4800         #
4801         #  @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4802         #
4803         #  @ref tui_creation_face "Example"
4804         @ManageTransactions("ShapesOp")
4805         def MakeFaceWires(self, theWires, isPlanarWanted, theName=None, raiseException=False):
4806             """
4807             Create a face on the given wires set.
4808
4809             Parameters:
4810                 theWires List of closed wires or edges to build the face on.
4811                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4812                                If the tolerance of the obtained planar face is less
4813                                than 1e-06, this face will be returned, otherwise the
4814                                algorithm tries to build any suitable face on the given
4815                                wire and prints a warning message.
4816                 theName Object name; when specified, this parameter is used
4817                         for result publication in the study. Otherwise, if automatic
4818                         publication is switched on, default value is used for result name.
4819
4820             Returns:
4821                 New GEOM.GEOM_Object, containing the created face (compound of faces).
4822             """
4823             # Example: see GEOM_TestAll.py
4824             anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4825             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4826                 PrintOrRaise("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.",raiseException)
4827             else:
4828                 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4829             self._autoPublish(anObj, theName, "face")
4830             return anObj
4831
4832         ## See MakeFaceWires() method for details.
4833         #
4834         #  @ref tui_creation_face "Example 1"
4835         #  \n @ref swig_MakeFaces  "Example 2"
4836         def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4837             """
4838             See geompy.MakeFaceWires() method for details.
4839             """
4840             # Example: see GEOM_TestOthers.py
4841             # note: auto-publishing is done in self.MakeFaceWires()
4842             anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4843             return anObj
4844
4845         ## Create a face based on a surface from given face bounded
4846         #  by given wire.
4847         #  @param theFace the face whose surface is used to create a new face.
4848         #  @param theWire the wire that will bound a new face.
4849         #  @param theName Object name; when specified, this parameter is used
4850         #         for result publication in the study. Otherwise, if automatic
4851         #         publication is switched on, default value is used for result name.
4852         #
4853         #  @return New GEOM.GEOM_Object, containing the created face.
4854         #
4855         #  @ref tui_creation_face "Example"
4856         @ManageTransactions("ShapesOp")
4857         def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4858             """
4859             Create a face based on a surface from given face bounded
4860             by given wire.
4861
4862             Parameters:
4863                 theFace the face whose surface is used to create a new face.
4864                 theWire the wire that will bound a new face.
4865                 theName Object name; when specified, this parameter is used
4866                         for result publication in the study. Otherwise, if automatic
4867                         publication is switched on, default value is used for result name.
4868
4869             Returns:
4870                 New GEOM.GEOM_Object, containing the created face.
4871             """
4872             # Example: see GEOM_TestAll.py
4873             anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4874             RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4875             self._autoPublish(anObj, theName, "face")
4876             return anObj
4877           
4878         ## Create a face from a set of edges with the given constraints.
4879         #  @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4880         #         - edges should form a closed wire;
4881         #         - for each edge, constraint face is optional: if a constraint face is missing
4882         #           for some edge, this means that there no constraint associated with this edge.
4883         #  @param theName Object name; when specified, this parameter is used
4884         #         for result publication in the study. Otherwise, if automatic
4885         #         publication is switched on, default value is used for result name.
4886         # 
4887         # @return New GEOM.GEOM_Object, containing the created face.
4888         # 
4889         # @ref tui_creation_face "Example"
4890         @ManageTransactions("ShapesOp")
4891         def MakeFaceWithConstraints(self, theConstraints, theName=None):
4892             """
4893             Create a face from a set of edges with the given constraints.
4894
4895             Parameters:
4896                 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4897                         - edges should form a closed wire;
4898                         - for each edge, constraint face is optional: if a constraint face is missing
4899                           for some edge, this means that there no constraint associated with this edge.
4900                 theName Object name; when specified, this parameter is used
4901                         for result publication in the study. Otherwise, if automatic
4902                         publication is switched on, default value is used for result name.
4903
4904             Returns:
4905                 New GEOM.GEOM_Object, containing the created face.
4906             """
4907             # Example: see GEOM_TestAll.py
4908             anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4909             if anObj is None:
4910                 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4911             self._autoPublish(anObj, theName, "face")
4912             return anObj
4913
4914         ## Create a shell from the set of faces, shells and/or compounds of faces.
4915         #  @param theFacesAndShells List of faces, shells and/or compounds of faces.
4916         #  @param theName Object name; when specified, this parameter is used
4917         #         for result publication in the study. Otherwise, if automatic
4918         #         publication is switched on, default value is used for result name.
4919         #
4920         #  @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
4921         #
4922         #  @ref tui_creation_shell "Example"
4923         @ManageTransactions("ShapesOp")
4924         def MakeShell(self, theFacesAndShells, theName=None):
4925             """
4926             Create a shell from the set of faces and shells.
4927
4928             Parameters:
4929                 theFacesAndShells List of faces and/or shells.
4930                 theName Object name; when specified, this parameter is used
4931                         for result publication in the study. Otherwise, if automatic
4932                         publication is switched on, default value is used for result name.
4933
4934             Returns:
4935                 New GEOM.GEOM_Object, containing the created shell (compound of shells).
4936             """
4937             # Example: see GEOM_TestAll.py
4938             anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4939             RaiseIfFailed("MakeShell", self.ShapesOp)
4940             self._autoPublish(anObj, theName, "shell")
4941             return anObj
4942
4943         ## Create a solid, bounded by the given shells.
4944         #  @param theShells Sequence of bounding shells.
4945         #  @param theName Object name; when specified, this parameter is used
4946         #         for result publication in the study. Otherwise, if automatic
4947         #         publication is switched on, default value is used for result name.
4948         #
4949         #  @return New GEOM.GEOM_Object, containing the created solid.
4950         #
4951         #  @ref tui_creation_solid "Example"
4952         @ManageTransactions("ShapesOp")
4953         def MakeSolid(self, theShells, theName=None):
4954             """
4955             Create a solid, bounded by the given shells.
4956
4957             Parameters:
4958                 theShells Sequence of bounding shells.
4959                 theName Object name; when specified, this parameter is used
4960                         for result publication in the study. Otherwise, if automatic
4961                         publication is switched on, default value is used for result name.
4962
4963             Returns:
4964                 New GEOM.GEOM_Object, containing the created solid.
4965             """
4966             # Example: see GEOM_TestAll.py
4967             theShells = ToList(theShells)
4968             if len(theShells) == 1:
4969                 descr = self._IsGoodForSolid(theShells[0])
4970                 #if len(descr) > 0:
4971                 #    raise RuntimeError, "MakeSolidShells : " + descr
4972                 if descr == "WRN_SHAPE_UNCLOSED":
4973                     raise RuntimeError("MakeSolidShells : Unable to create solid from unclosed shape")
4974             anObj = self.ShapesOp.MakeSolidShells(theShells)
4975             RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4976             self._autoPublish(anObj, theName, "solid")
4977             return anObj
4978
4979         ## Create a compound of the given shapes.
4980         #  @param theShapes List of shapes to put in compound.
4981         #  @param theName Object name; when specified, this parameter is used
4982         #         for result publication in the study. Otherwise, if automatic
4983         #         publication is switched on, default value is used for result name.
4984         #
4985         #  @return New GEOM.GEOM_Object, containing the created compound.
4986         #
4987         #  @ref tui_creation_compound "Example"
4988         @ManageTransactions("ShapesOp")
4989         def MakeCompound(self, theShapes, theName=None):
4990             """
4991             Create a compound of the given shapes.
4992
4993             Parameters:
4994                 theShapes List of shapes to put in compound.
4995                 theName Object name; when specified, this parameter is used
4996                         for result publication in the study. Otherwise, if automatic
4997                         publication is switched on, default value is used for result name.
4998
4999             Returns:
5000                 New GEOM.GEOM_Object, containing the created compound.
5001             """
5002             # Example: see GEOM_TestAll.py
5003             anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
5004             RaiseIfFailed("MakeCompound", self.ShapesOp)
5005             self._autoPublish(anObj, theName, "compound")
5006             return anObj
5007         
5008         ## Create a solid (or solids) from the set of faces and/or shells.
5009         #  @param theFacesOrShells List of faces and/or shells.
5010         #  @param isIntersect If TRUE, forces performing intersections
5011         #         between arguments; otherwise (default) intersection is not performed.
5012         #  @param theName Object name; when specified, this parameter is used
5013         #         for result publication in the study. Otherwise, if automatic
5014         #         publication is switched on, default value is used for result name.
5015         #
5016         #  @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5017         #
5018         #  @ref tui_creation_solid_from_faces "Example"
5019         @ManageTransactions("ShapesOp")
5020         def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
5021             """
5022             Create a solid (or solids) from the set of connected faces and/or shells.
5023
5024             Parameters:
5025                 theFacesOrShells List of faces and/or shells.
5026                 isIntersect If TRUE, forces performing intersections
5027                         between arguments; otherwise (default) intersection is not performed
5028                 theName Object name; when specified, this parameter is used.
5029                         for result publication in the study. Otherwise, if automatic
5030                         publication is switched on, default value is used for result name.
5031
5032             Returns:
5033                 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5034             """
5035             # Example: see GEOM_TestAll.py
5036             anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
5037             RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
5038             self._autoPublish(anObj, theName, "solid")
5039             return anObj
5040
5041         # end of l3_basic_go
5042         ## @}
5043
5044         ## @addtogroup l2_measure
5045         ## @{
5046
5047         ## Gives quantity of faces in the given shape.
5048         #  @param theShape Shape to count faces of.
5049         #  @return Quantity of faces.
5050         #
5051         #  @ref swig_NumberOf "Example"
5052         @ManageTransactions("ShapesOp")
5053         def NumberOfFaces(self, theShape):
5054             """
5055             Gives quantity of faces in the given shape.
5056
5057             Parameters:
5058                 theShape Shape to count faces of.
5059
5060             Returns:
5061                 Quantity of faces.
5062             """
5063             # Example: see GEOM_TestOthers.py
5064             nb_faces = self.ShapesOp.NumberOfFaces(theShape)
5065             RaiseIfFailed("NumberOfFaces", self.ShapesOp)
5066             return nb_faces
5067
5068         ## Gives quantity of edges in the given shape.
5069         #  @param theShape Shape to count edges of.
5070         #  @return Quantity of edges.
5071         #
5072         #  @ref swig_NumberOf "Example"
5073         @ManageTransactions("ShapesOp")
5074         def NumberOfEdges(self, theShape):
5075             """
5076             Gives quantity of edges in the given shape.
5077
5078             Parameters:
5079                 theShape Shape to count edges of.
5080
5081             Returns:
5082                 Quantity of edges.
5083             """
5084             # Example: see GEOM_TestOthers.py
5085             nb_edges = self.ShapesOp.NumberOfEdges(theShape)
5086             RaiseIfFailed("NumberOfEdges", self.ShapesOp)
5087             return nb_edges
5088
5089         ## Gives quantity of sub-shapes of type theShapeType in the given shape.
5090         #  @param theShape Shape to count sub-shapes of.
5091         #  @param theShapeType Type of sub-shapes to count (see ShapeType())
5092         #  @return Quantity of sub-shapes of given type.
5093         #
5094         #  @ref swig_NumberOf "Example"
5095         @ManageTransactions("ShapesOp")
5096         def NumberOfSubShapes(self, theShape, theShapeType):
5097             """
5098             Gives quantity of sub-shapes of type theShapeType in the given shape.
5099
5100             Parameters:
5101                 theShape Shape to count sub-shapes of.
5102                 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
5103
5104             Returns:
5105                 Quantity of sub-shapes of given type.
5106             """
5107             # Example: see GEOM_TestOthers.py
5108             nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
5109             RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
5110             return nb_ss
5111
5112         ## Gives quantity of solids in the given shape.
5113         #  @param theShape Shape to count solids in.
5114         #  @return Quantity of solids.
5115         #
5116         #  @ref swig_NumberOf "Example"
5117         @ManageTransactions("ShapesOp")
5118         def NumberOfSolids(self, theShape):
5119             """
5120             Gives quantity of solids in the given shape.
5121
5122             Parameters:
5123                 theShape Shape to count solids in.
5124
5125             Returns:
5126                 Quantity of solids.
5127             """
5128             # Example: see GEOM_TestOthers.py
5129             nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
5130             RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5131             return nb_solids
5132
5133         # end of l2_measure
5134         ## @}
5135
5136         ## @addtogroup l3_healing
5137         ## @{
5138
5139         ## Reverses an orientation the given shape.
5140         #  @param theShape Shape to be reversed.
5141         #  @param theName Object name; when specified, this parameter is used
5142         #         for result publication in the study. Otherwise, if automatic
5143         #         publication is switched on, default value is used for result name.
5144         #
5145         #  @return The reversed copy of theShape.
5146         #
5147         #  @ref swig_ChangeOrientation "Example"
5148         @ManageTransactions("ShapesOp")
5149         def ChangeOrientation(self, theShape, theName=None):
5150             """
5151             Reverses an orientation the given shape.
5152
5153             Parameters:
5154                 theShape Shape to be reversed.
5155                 theName Object name; when specified, this parameter is used
5156                         for result publication in the study. Otherwise, if automatic
5157                         publication is switched on, default value is used for result name.
5158
5159             Returns:
5160                 The reversed copy of theShape.
5161             """
5162             # Example: see GEOM_TestAll.py
5163             anObj = self.ShapesOp.ChangeOrientation(theShape)
5164             RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5165             self._autoPublish(anObj, theName, "reversed")
5166             return anObj
5167
5168         ## See ChangeOrientation() method for details.
5169         #
5170         #  @ref swig_OrientationChange "Example"
5171         def OrientationChange(self, theShape, theName=None):
5172             """
5173             See geompy.ChangeOrientation method for details.
5174             """
5175             # Example: see GEOM_TestOthers.py
5176             # note: auto-publishing is done in self.ChangeOrientation()
5177             anObj = self.ChangeOrientation(theShape, theName)
5178             return anObj
5179
5180         # end of l3_healing
5181         ## @}
5182
5183         ## @addtogroup l4_obtain
5184         ## @{
5185
5186         ## Retrieve all free faces from the given shape.
5187         #  Free face is a face, which is not shared between two shells of the shape.
5188         #  @param theShape Shape to find free faces in.
5189         #  @return List of IDs of all free faces, contained in theShape.
5190         #
5191         #  @ref tui_free_faces_page "Example"
5192         @ManageTransactions("ShapesOp")
5193         def GetFreeFacesIDs(self,theShape):
5194             """
5195             Retrieve all free faces from the given shape.
5196             Free face is a face, which is not shared between two shells of the shape.
5197
5198             Parameters:
5199                 theShape Shape to find free faces in.
5200
5201             Returns:
5202                 List of IDs of all free faces, contained in theShape.
5203             """
5204             # Example: see GEOM_TestOthers.py
5205             anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5206             RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5207             return anIDs
5208
5209         ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5210         #  @param theShape1 Shape to find sub-shapes in.
5211         #  @param theShape2 Shape to find shared sub-shapes with.
5212         #  @param theShapeType Type of sub-shapes to be retrieved.
5213         #  @param theName Object name; when specified, this parameter is used
5214         #         for result publication in the study. Otherwise, if automatic
5215         #         publication is switched on, default value is used for result name.
5216         #
5217         #  @return List of sub-shapes of theShape1, shared with theShape2.
5218         #
5219         #  @ref swig_GetSharedShapes "Example"
5220         @ManageTransactions("ShapesOp")
5221         def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5222             """
5223             Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5224
5225             Parameters:
5226                 theShape1 Shape to find sub-shapes in.
5227                 theShape2 Shape to find shared sub-shapes with.
5228                 theShapeType Type of sub-shapes to be retrieved.
5229                 theName Object name; when specified, this parameter is used
5230                         for result publication in the study. Otherwise, if automatic
5231                         publication is switched on, default value is used for result name.
5232
5233             Returns:
5234                 List of sub-shapes of theShape1, shared with theShape2.
5235             """
5236             # Example: see GEOM_TestOthers.py
5237             aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5238             RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5239             self._autoPublish(aList, theName, "shared")
5240             return aList
5241
5242         ## Get sub-shapes, shared by input shapes.
5243         #  @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5244         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5245         #  @param theMultiShare Specifies what type of shares should be checked:
5246         #         - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5247         #         - @c False: causes to search sub-shapes shared between couples of input shapes.
5248         #  @param theName Object name; when specified, this parameter is used
5249         #         for result publication in the study. Otherwise, if automatic
5250         #         publication is switched on, default value is used for result name.
5251         #
5252         #  @note If @a theShapes contains single compound, the shares between all possible couples of 
5253         #        its top-level shapes are returned; otherwise, only shares between 1st input shape
5254         #        and all rest input shapes are returned.
5255         #
5256         #  @return List of all found sub-shapes.
5257         #
5258         #  Examples:
5259         #  - @ref tui_shared_shapes "Example 1"
5260         #  - @ref swig_GetSharedShapes "Example 2"
5261         @ManageTransactions("ShapesOp")
5262         def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5263             """
5264             Get sub-shapes, shared by input shapes.
5265
5266             Parameters:
5267                 theShapes Either a list or compound of shapes to find common sub-shapes of.
5268                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5269                 theMultiShare Specifies what type of shares should be checked:
5270                   - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5271                   - False: causes to search sub-shapes shared between couples of input shapes.
5272                 theName Object name; when specified, this parameter is used
5273                         for result publication in the study. Otherwise, if automatic
5274                         publication is switched on, default value is used for result name.
5275
5276             Note: if theShapes contains single compound, the shares between all possible couples of 
5277                   its top-level shapes are returned; otherwise, only shares between 1st input shape
5278                   and all rest input shapes are returned.
5279
5280             Returns:
5281                 List of all found sub-shapes.
5282             """
5283             # Example: see GEOM_TestOthers.py
5284             aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5285             RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5286             self._autoPublish(aList, theName, "shared")
5287             return aList
5288
5289         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5290         #  situated relatively the specified plane by the certain way,
5291         #  defined through <VAR>theState</VAR> parameter.
5292         #  @param theShape Shape to find sub-shapes of.
5293         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5294         #  @param theAx1 Vector (or line, or linear edge), specifying normal
5295         #                direction and location of the plane to find shapes on.
5296         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5297         #  @param theName Object name; when specified, this parameter is used
5298         #         for result publication in the study. Otherwise, if automatic
5299         #         publication is switched on, default value is used for result name.
5300         #
5301         #  @return List of all found sub-shapes.
5302         #
5303         #  @ref swig_GetShapesOnPlane "Example"
5304         @ManageTransactions("ShapesOp")
5305         def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5306             """
5307             Find in theShape all sub-shapes of type theShapeType,
5308             situated relatively the specified plane by the certain way,
5309             defined through theState parameter.
5310
5311             Parameters:
5312                 theShape Shape to find sub-shapes of.
5313                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5314                 theAx1 Vector (or line, or linear edge), specifying normal
5315                        direction and location of the plane to find shapes on.
5316                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5317                 theName Object name; when specified, this parameter is used
5318                         for result publication in the study. Otherwise, if automatic
5319                         publication is switched on, default value is used for result name.
5320
5321             Returns:
5322                 List of all found sub-shapes.
5323             """
5324             # Example: see GEOM_TestOthers.py
5325             aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5326             RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5327             self._autoPublish(aList, theName, "shapeOnPlane")
5328             return aList
5329
5330         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5331         #  situated relatively the specified plane by the certain way,
5332         #  defined through <VAR>theState</VAR> parameter.
5333         #  @param theShape Shape to find sub-shapes of.
5334         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5335         #  @param theAx1 Vector (or line, or linear edge), specifying normal
5336         #                direction and location of the plane to find shapes on.
5337         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5338         #
5339         #  @return List of all found sub-shapes indices.
5340         #
5341         #  @ref swig_GetShapesOnPlaneIDs "Example"
5342         @ManageTransactions("ShapesOp")
5343         def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5344             """
5345             Find in theShape all sub-shapes of type theShapeType,
5346             situated relatively the specified plane by the certain way,
5347             defined through theState parameter.
5348
5349             Parameters:
5350                 theShape Shape to find sub-shapes of.
5351                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5352                 theAx1 Vector (or line, or linear edge), specifying normal
5353                        direction and location of the plane to find shapes on.
5354                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5355
5356             Returns:
5357                 List of all found sub-shapes indices.
5358             """
5359             # Example: see GEOM_TestOthers.py
5360             aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5361             RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5362             return aList
5363
5364         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5365         #  situated relatively the specified plane by the certain way,
5366         #  defined through <VAR>theState</VAR> parameter.
5367         #  @param theShape Shape to find sub-shapes of.
5368         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5369         #  @param theAx1 Vector (or line, or linear edge), specifying normal
5370         #                direction of the plane to find shapes on.
5371         #  @param thePnt Point specifying location of the plane to find shapes on.
5372         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5373         #  @param theName Object name; when specified, this parameter is used
5374         #         for result publication in the study. Otherwise, if automatic
5375         #         publication is switched on, default value is used for result name.
5376         #
5377         #  @return List of all found sub-shapes.
5378         #
5379         #  @ref swig_GetShapesOnPlaneWithLocation "Example"
5380         @ManageTransactions("ShapesOp")
5381         def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5382             """
5383             Find in theShape all sub-shapes of type theShapeType,
5384             situated relatively the specified plane by the certain way,
5385             defined through theState parameter.
5386
5387             Parameters:
5388                 theShape Shape to find sub-shapes of.
5389                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5390                 theAx1 Vector (or line, or linear edge), specifying normal
5391                        direction and location of the plane to find shapes on.
5392                 thePnt Point specifying location of the plane to find shapes on.
5393                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5394                 theName Object name; when specified, this parameter is used
5395                         for result publication in the study. Otherwise, if automatic
5396                         publication is switched on, default value is used for result name.
5397
5398             Returns:
5399                 List of all found sub-shapes.
5400             """
5401             # Example: see GEOM_TestOthers.py
5402             aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5403                                                                theAx1, thePnt, theState)
5404             RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5405             self._autoPublish(aList, theName, "shapeOnPlane")
5406             return aList
5407
5408         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5409         #  situated relatively the specified plane by the certain way,
5410         #  defined through <VAR>theState</VAR> parameter.
5411         #  @param theShape Shape to find sub-shapes of.
5412         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5413         #  @param theAx1 Vector (or line, or linear edge), specifying normal
5414         #                direction of the plane to find shapes on.
5415         #  @param thePnt Point specifying location of the plane to find shapes on.
5416         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5417         #
5418         #  @return List of all found sub-shapes indices.
5419         #
5420         #  @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5421         @ManageTransactions("ShapesOp")
5422         def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5423             """
5424             Find in theShape all sub-shapes of type theShapeType,
5425             situated relatively the specified plane by the certain way,
5426             defined through theState parameter.
5427
5428             Parameters:
5429                 theShape Shape to find sub-shapes of.
5430                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5431                 theAx1 Vector (or line, or linear edge), specifying normal
5432                        direction and location of the plane to find shapes on.
5433                 thePnt Point specifying location of the plane to find shapes on.
5434                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5435
5436             Returns:
5437                 List of all found sub-shapes indices.
5438             """
5439             # Example: see GEOM_TestOthers.py
5440             aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5441                                                                   theAx1, thePnt, theState)
5442             RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5443             return aList
5444
5445         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5446         #  the specified cylinder by the certain way, defined through \a theState parameter.
5447         #  @param theShape Shape to find sub-shapes of.
5448         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5449         #  @param theAxis Vector (or line, or linear edge), specifying
5450         #                 axis of the cylinder to find shapes on.
5451         #  @param theRadius Radius of the cylinder to find shapes on.
5452         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5453         #  @param theName Object name; when specified, this parameter is used
5454         #         for result publication in the study. Otherwise, if automatic
5455         #         publication is switched on, default value is used for result name.
5456         #
5457         #  @return List of all found sub-shapes.
5458         #
5459         #  @ref swig_GetShapesOnCylinder "Example"
5460         @ManageTransactions("ShapesOp")
5461         def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5462             """
5463             Find in theShape all sub-shapes of type theShapeType, situated relatively
5464             the specified cylinder by the certain way, defined through theState parameter.
5465
5466             Parameters:
5467                 theShape Shape to find sub-shapes of.
5468                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5469                 theAxis Vector (or line, or linear edge), specifying
5470                         axis of the cylinder to find shapes on.
5471                 theRadius Radius of the cylinder to find shapes on.
5472                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5473                 theName Object name; when specified, this parameter is used
5474                         for result publication in the study. Otherwise, if automatic
5475                         publication is switched on, default value is used for result name.
5476
5477             Returns:
5478                 List of all found sub-shapes.
5479             """
5480             # Example: see GEOM_TestOthers.py
5481             aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5482             RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5483             self._autoPublish(aList, theName, "shapeOnCylinder")
5484             return aList
5485
5486         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5487         #  the specified cylinder by the certain way, defined through \a theState parameter.
5488         #  @param theShape Shape to find sub-shapes of.
5489         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5490         #  @param theAxis Vector (or line, or linear edge), specifying
5491         #                 axis of the cylinder to find shapes on.
5492         #  @param theRadius Radius of the cylinder to find shapes on.
5493         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5494         #
5495         #  @return List of all found sub-shapes indices.
5496         #
5497         #  @ref swig_GetShapesOnCylinderIDs "Example"
5498         @ManageTransactions("ShapesOp")
5499         def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5500             """
5501             Find in theShape all sub-shapes of type theShapeType, situated relatively
5502             the specified cylinder by the certain way, defined through theState parameter.
5503
5504             Parameters:
5505                 theShape Shape to find sub-shapes of.
5506                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5507                 theAxis Vector (or line, or linear edge), specifying
5508                         axis of the cylinder to find shapes on.
5509                 theRadius Radius of the cylinder to find shapes on.
5510                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5511
5512             Returns:
5513                 List of all found sub-shapes indices.
5514             """
5515             # Example: see GEOM_TestOthers.py
5516             aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5517             RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5518             return aList
5519
5520         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5521         #  the specified cylinder by the certain way, defined through \a theState parameter.
5522         #  @param theShape Shape to find sub-shapes of.
5523         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5524         #  @param theAxis Vector (or line, or linear edge), specifying
5525         #                 axis of the cylinder to find shapes on.
5526         #  @param thePnt Point specifying location of the bottom of the cylinder.
5527         #  @param theRadius Radius of the cylinder to find shapes on.
5528         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5529         #  @param theName Object name; when specified, this parameter is used
5530         #         for result publication in the study. Otherwise, if automatic
5531         #         publication is switched on, default value is used for result name.
5532         #
5533         #  @return List of all found sub-shapes.
5534         #
5535         #  @ref swig_GetShapesOnCylinderWithLocation "Example"
5536         @ManageTransactions("ShapesOp")
5537         def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5538             """
5539             Find in theShape all sub-shapes of type theShapeType, situated relatively
5540             the specified cylinder by the certain way, defined through theState parameter.
5541
5542             Parameters:
5543                 theShape Shape to find sub-shapes of.
5544                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5545                 theAxis Vector (or line, or linear edge), specifying
5546                         axis of the cylinder to find shapes on.
5547                 theRadius Radius of the cylinder to find shapes on.
5548                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5549                 theName Object name; when specified, this parameter is used
5550                         for result publication in the study. Otherwise, if automatic
5551                         publication is switched on, default value is used for result name.
5552
5553             Returns:
5554                 List of all found sub-shapes.
5555             """
5556             # Example: see GEOM_TestOthers.py
5557             aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5558             RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5559             self._autoPublish(aList, theName, "shapeOnCylinder")
5560             return aList
5561
5562         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5563         #  the specified cylinder by the certain way, defined through \a theState parameter.
5564         #  @param theShape Shape to find sub-shapes of.
5565         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5566         #  @param theAxis Vector (or line, or linear edge), specifying
5567         #                 axis of the cylinder to find shapes on.
5568         #  @param thePnt Point specifying location of the bottom of the cylinder.
5569         #  @param theRadius Radius of the cylinder to find shapes on.
5570         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5571         #
5572         #  @return List of all found sub-shapes indices
5573         #
5574         #  @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5575         @ManageTransactions("ShapesOp")
5576         def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5577             """
5578             Find in theShape all sub-shapes of type theShapeType, situated relatively
5579             the specified cylinder by the certain way, defined through theState parameter.
5580
5581             Parameters:
5582                 theShape Shape to find sub-shapes of.
5583                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5584                 theAxis Vector (or line, or linear edge), specifying
5585                         axis of the cylinder to find shapes on.
5586                 theRadius Radius of the cylinder to find shapes on.
5587                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5588
5589             Returns:
5590                 List of all found sub-shapes indices.
5591             """
5592             # Example: see GEOM_TestOthers.py
5593             aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5594             RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5595             return aList
5596
5597         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5598         #  the specified sphere by the certain way, defined through \a theState parameter.
5599         #  @param theShape Shape to find sub-shapes of.
5600         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5601         #  @param theCenter Point, specifying center of the sphere to find shapes on.
5602         #  @param theRadius Radius of the sphere to find shapes on.
5603         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5604         #  @param theName Object name; when specified, this parameter is used
5605         #         for result publication in the study. Otherwise, if automatic
5606         #         publication is switched on, default value is used for result name.
5607         #
5608         #  @return List of all found sub-shapes.
5609         #
5610         #  @ref swig_GetShapesOnSphere "Example"
5611         @ManageTransactions("ShapesOp")
5612         def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5613             """
5614             Find in theShape all sub-shapes of type theShapeType, situated relatively
5615             the specified sphere by the certain way, defined through theState parameter.
5616
5617             Parameters:
5618                 theShape Shape to find sub-shapes of.
5619                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5620                 theCenter Point, specifying center of the sphere to find shapes on.
5621                 theRadius Radius of the sphere to find shapes on.
5622                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5623                 theName Object name; when specified, this parameter is used
5624                         for result publication in the study. Otherwise, if automatic
5625                         publication is switched on, default value is used for result name.
5626
5627             Returns:
5628                 List of all found sub-shapes.
5629             """
5630             # Example: see GEOM_TestOthers.py
5631             aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5632             RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5633             self._autoPublish(aList, theName, "shapeOnSphere")
5634             return aList
5635
5636         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5637         #  the specified sphere by the certain way, defined through \a theState parameter.
5638         #  @param theShape Shape to find sub-shapes of.
5639         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5640         #  @param theCenter Point, specifying center of the sphere to find shapes on.
5641         #  @param theRadius Radius of the sphere to find shapes on.
5642         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5643         #
5644         #  @return List of all found sub-shapes indices.
5645         #
5646         #  @ref swig_GetShapesOnSphereIDs "Example"
5647         @ManageTransactions("ShapesOp")
5648         def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5649             """
5650             Find in theShape all sub-shapes of type theShapeType, situated relatively
5651             the specified sphere by the certain way, defined through theState parameter.
5652
5653             Parameters:
5654                 theShape Shape to find sub-shapes of.
5655                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5656                 theCenter Point, specifying center of the sphere to find shapes on.
5657                 theRadius Radius of the sphere to find shapes on.
5658                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5659
5660             Returns:
5661                 List of all found sub-shapes indices.
5662             """
5663             # Example: see GEOM_TestOthers.py
5664             aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5665             RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5666             return aList
5667
5668         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5669         #  the specified quadrangle by the certain way, defined through \a theState parameter.
5670         #  @param theShape Shape to find sub-shapes of.
5671         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5672         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5673         #  @param theTopRightPoint Point, specifying top right corner of a quadrangle
5674         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5675         #  @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5676         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5677         #  @param theName Object name; when specified, this parameter is used
5678         #         for result publication in the study. Otherwise, if automatic
5679         #         publication is switched on, default value is used for result name.
5680         #
5681         #  @return List of all found sub-shapes.
5682         #
5683         #  @ref swig_GetShapesOnQuadrangle "Example"
5684         @ManageTransactions("ShapesOp")
5685         def GetShapesOnQuadrangle(self, theShape, theShapeType,
5686                                   theTopLeftPoint, theTopRightPoint,
5687                                   theBottomLeftPoint, theBottomRightPoint, theState, theName=None):
5688             """
5689             Find in theShape all sub-shapes of type theShapeType, situated relatively
5690             the specified quadrangle by the certain way, defined through theState parameter.
5691
5692             Parameters:
5693                 theShape Shape to find sub-shapes of.
5694                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5695                 theTopLeftPoint Point, specifying top left corner of a quadrangle
5696                 theTopRightPoint Point, specifying top right corner of a quadrangle
5697                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5698                 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5699                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5700                 theName Object name; when specified, this parameter is used
5701                         for result publication in the study. Otherwise, if automatic
5702                         publication is switched on, default value is used for result name.
5703
5704             Returns:
5705                 List of all found sub-shapes.
5706             """
5707             # Example: see GEOM_TestOthers.py
5708             aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5709                                                         theTopLeftPoint, theTopRightPoint,
5710                                                         theBottomLeftPoint, theBottomRightPoint, theState)
5711             RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5712             self._autoPublish(aList, theName, "shapeOnQuadrangle")
5713             return aList
5714
5715         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5716         #  the specified quadrangle by the certain way, defined through \a theState parameter.
5717         #  @param theShape Shape to find sub-shapes of.
5718         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5719         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5720         #  @param theTopRightPoint Point, specifying top right corner of a quadrangle
5721         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5722         #  @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5723         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5724         #
5725         #  @return List of all found sub-shapes indices.
5726         #
5727         #  @ref swig_GetShapesOnQuadrangleIDs "Example"
5728         @ManageTransactions("ShapesOp")
5729         def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5730                                      theTopLeftPoint, theTopRightPoint,
5731                                      theBottomLeftPoint, theBottomRightPoint, theState):
5732             """
5733             Find in theShape all sub-shapes of type theShapeType, situated relatively
5734             the specified quadrangle by the certain way, defined through theState parameter.
5735
5736             Parameters:
5737                 theShape Shape to find sub-shapes of.
5738                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5739                 theTopLeftPoint Point, specifying top left corner of a quadrangle
5740                 theTopRightPoint Point, specifying top right corner of a quadrangle
5741                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5742                 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5743                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5744
5745             Returns:
5746                 List of all found sub-shapes indices.
5747             """
5748
5749             # Example: see GEOM_TestOthers.py
5750             aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5751                                                            theTopLeftPoint, theTopRightPoint,
5752                                                            theBottomLeftPoint, theBottomRightPoint, theState)
5753             RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5754             return aList
5755
5756         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5757         #  the specified \a theBox by the certain way, defined through \a theState parameter.
5758         #  @param theBox Shape for relative comparing.
5759         #  @param theShape Shape to find sub-shapes of.
5760         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5761         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5762         #  @param theName Object name; when specified, this parameter is used
5763         #         for result publication in the study. Otherwise, if automatic
5764         #         publication is switched on, default value is used for result name.
5765         #
5766         #  @return List of all found sub-shapes.
5767         #
5768         #  @ref swig_GetShapesOnBox "Example"
5769         @ManageTransactions("ShapesOp")
5770         def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5771             """
5772             Find in theShape all sub-shapes of type theShapeType, situated relatively
5773             the specified theBox by the certain way, defined through theState parameter.
5774
5775             Parameters:
5776                 theBox Shape for relative comparing.
5777                 theShape Shape to find sub-shapes of.
5778                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5779                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5780                 theName Object name; when specified, this parameter is used
5781                         for result publication in the study. Otherwise, if automatic
5782                         publication is switched on, default value is used for result name.
5783
5784             Returns:
5785                 List of all found sub-shapes.
5786             """
5787             # Example: see GEOM_TestOthers.py
5788             aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5789             RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5790             self._autoPublish(aList, theName, "shapeOnBox")
5791             return aList
5792
5793         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5794         #  the specified \a theBox by the certain way, defined through \a theState parameter.
5795         #  @param theBox Shape for relative comparing.
5796         #  @param theShape Shape to find sub-shapes of.
5797         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5798         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5799         #
5800         #  @return List of all found sub-shapes indices.
5801         #
5802         #  @ref swig_GetShapesOnBoxIDs "Example"
5803         @ManageTransactions("ShapesOp")
5804         def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5805             """
5806             Find in theShape all sub-shapes of type theShapeType, situated relatively
5807             the specified theBox by the certain way, defined through theState parameter.
5808
5809             Parameters:
5810                 theBox Shape for relative comparing.
5811                 theShape Shape to find sub-shapes of.
5812                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5813                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5814
5815             Returns:
5816                 List of all found sub-shapes indices.
5817             """
5818             # Example: see GEOM_TestOthers.py
5819             aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5820             RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5821             return aList
5822
5823         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5824         #  situated relatively the specified \a theCheckShape by the
5825         #  certain way, defined through \a theState parameter.
5826         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5827         #  @param theShape Shape to find sub-shapes of.
5828         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5829         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5830         #  @param theName Object name; when specified, this parameter is used
5831         #         for result publication in the study. Otherwise, if automatic
5832         #         publication is switched on, default value is used for result name.
5833         #
5834         #  @return List of all found sub-shapes.
5835         #
5836         #  @ref swig_GetShapesOnShape "Example"
5837         @ManageTransactions("ShapesOp")
5838         def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5839             """
5840             Find in theShape all sub-shapes of type theShapeType,
5841             situated relatively the specified theCheckShape by the
5842             certain way, defined through theState parameter.
5843
5844             Parameters:
5845                 theCheckShape Shape for relative comparing. It must be a solid.
5846                 theShape Shape to find sub-shapes of.
5847                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5848                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5849                 theName Object name; when specified, this parameter is used
5850                         for result publication in the study. Otherwise, if automatic
5851                         publication is switched on, default value is used for result name.
5852
5853             Returns:
5854                 List of all found sub-shapes.
5855             """
5856             # Example: see GEOM_TestOthers.py
5857             aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5858                                                    theShapeType, theState)
5859             RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5860             self._autoPublish(aList, theName, "shapeOnShape")
5861             return aList
5862
5863         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5864         #  situated relatively the specified \a theCheckShape by the
5865         #  certain way, defined through \a theState parameter.
5866         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5867         #  @param theShape Shape to find sub-shapes of.
5868         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5869         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5870         #  @param theName Object name; when specified, this parameter is used
5871         #         for result publication in the study. Otherwise, if automatic
5872         #         publication is switched on, default value is used for result name.
5873         #
5874         #  @return All found sub-shapes as compound.
5875         #
5876         #  @ref swig_GetShapesOnShapeAsCompound "Example"
5877         @ManageTransactions("ShapesOp")
5878         def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5879             """
5880             Find in theShape all sub-shapes of type theShapeType,
5881             situated relatively the specified theCheckShape by the
5882             certain way, defined through theState parameter.
5883
5884             Parameters:
5885                 theCheckShape Shape for relative comparing. It must be a solid.
5886                 theShape Shape to find sub-shapes of.
5887                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5888                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5889                 theName Object name; when specified, this parameter is used
5890                         for result publication in the study. Otherwise, if automatic
5891                         publication is switched on, default value is used for result name.
5892
5893             Returns:
5894                 All found sub-shapes as compound.
5895             """
5896             # Example: see GEOM_TestOthers.py
5897             anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5898                                                              theShapeType, theState)
5899             RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5900             self._autoPublish(anObj, theName, "shapeOnShape")
5901             return anObj
5902
5903         ## Find in \a theShape all sub-shapes of type \a theShapeType,
5904         #  situated relatively the specified \a theCheckShape by the
5905         #  certain way, defined through \a theState parameter.
5906         #  @param theCheckShape Shape for relative comparing. It must be a solid.
5907         #  @param theShape Shape to find sub-shapes of.
5908         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5909         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5910         #
5911         #  @return List of all found sub-shapes indices.
5912         #
5913         #  @ref swig_GetShapesOnShapeIDs "Example"
5914         @ManageTransactions("ShapesOp")
5915         def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5916             """
5917             Find in theShape all sub-shapes of type theShapeType,
5918             situated relatively the specified theCheckShape by the
5919             certain way, defined through theState parameter.
5920
5921             Parameters:
5922                 theCheckShape Shape for relative comparing. It must be a solid.
5923                 theShape Shape to find sub-shapes of.
5924                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5925                 theState The state of the sub-shapes to find (see GEOM::shape_state)
5926
5927             Returns:
5928                 List of all found sub-shapes indices.
5929             """
5930             # Example: see GEOM_TestOthers.py
5931             aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5932                                                       theShapeType, theState)
5933             RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5934             return aList
5935
5936         ## Get sub-shape(s) of theShapeWhere, which are
5937         #  coincident with \a theShapeWhat or could be a part of it.
5938         #  @param theShapeWhere Shape to find sub-shapes of.
5939         #  @param theShapeWhat Shape, specifying what to find.
5940         #  @param isNewImplementation implementation of GetInPlace functionality
5941         #             (default = False, old alghorithm based on shape properties)
5942         #  @param theName Object name; when specified, this parameter is used
5943         #         for result publication in the study. Otherwise, if automatic
5944         #         publication is switched on, default value is used for result name.
5945         #
5946         #  @return Compound which includes all found sub-shapes if they have different types; 
5947         #          or group of all found shapes of the equal type; or a single found sub-shape.
5948         #
5949         #  @note This function has a restriction on argument shapes.
5950         #        If \a theShapeWhere has curved parts with significantly
5951         #        outstanding centres (i.e. the mass centre of a part is closer to
5952         #        \a theShapeWhat than to the part), such parts will not be found.
5953         #        @image html get_in_place_lost_part.png
5954         #
5955         #  @ref swig_GetInPlace "Example"
5956         @ManageTransactions("ShapesOp")
5957         def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5958             """
5959             Get sub-shape(s) of theShapeWhere, which are
5960             coincident with  theShapeWhat or could be a part of it.
5961
5962             Parameters:
5963                 theShapeWhere Shape to find sub-shapes of.
5964                 theShapeWhat Shape, specifying what to find.
5965                 isNewImplementation Implementation of GetInPlace functionality
5966                                     (default = False, old alghorithm based on shape properties)
5967                 theName Object name; when specified, this parameter is used
5968                         for result publication in the study. Otherwise, if automatic
5969                         publication is switched on, default value is used for result name.
5970
5971             Returns:
5972                 Compound which includes all found sub-shapes if they have different types; 
5973                 or group of all found shapes of the equal type; or a single found sub-shape.
5974
5975
5976             Note:
5977                 This function has a restriction on argument shapes.
5978                 If theShapeWhere has curved parts with significantly
5979                 outstanding centres (i.e. the mass centre of a part is closer to
5980                 theShapeWhat than to the part), such parts will not be found.
5981             """
5982             # Example: see GEOM_TestOthers.py
5983             anObj = None
5984             if isNewImplementation:
5985                 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5986             else:
5987                 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5988                 pass
5989             RaiseIfFailed("GetInPlace", self.ShapesOp)
5990             self._autoPublish(anObj, theName, "inplace")
5991             return anObj
5992
5993         ## Get sub-shape(s) of \a theShapeWhere, which are
5994         #  coincident with \a theShapeWhat or could be a part of it.
5995         #
5996         #  Implementation of this method is based on a saved history of an operation,
5997         #  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5998         #  arguments (an argument shape or a sub-shape of an argument shape).
5999         #  The operation could be the Partition or one of boolean operations,
6000         #  performed on simple shapes (not on compounds).
6001         #
6002         #  @param theShapeWhere Shape to find sub-shapes of.
6003         #  @param theShapeWhat Shape, specifying what to find (must be in the
6004         #                      building history of the ShapeWhere).
6005         #  @param theName Object name; when specified, this parameter is used
6006         #         for result publication in the study. Otherwise, if automatic
6007         #         publication is switched on, default value is used for result name.
6008         #
6009         #  @return Compound which includes all found sub-shapes if they have different types; 
6010         #          or group of all found shapes of the equal type; or a single found sub-shape.
6011         #
6012         #  @ref swig_GetInPlace "Example"
6013         @ManageTransactions("ShapesOp")
6014         def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
6015             """
6016             Implementation of this method is based on a saved history of an operation,
6017             produced theShapeWhere. The theShapeWhat must be among this operation's
6018             arguments (an argument shape or a sub-shape of an argument shape).
6019             The operation could be the Partition or one of boolean operations,
6020             performed on simple shapes (not on compounds).
6021
6022             Parameters:
6023                 theShapeWhere Shape to find sub-shapes of.
6024                 theShapeWhat Shape, specifying what to find (must be in the
6025                                 building history of the ShapeWhere).
6026                 theName Object name; when specified, this parameter is used
6027                         for result publication in the study. Otherwise, if automatic
6028                         publication is switched on, default value is used for result name.
6029
6030             Returns:
6031                 Compound which includes all found sub-shapes if they have different types; 
6032                 or group of all found shapes of the equal type; or a single found sub-shape.
6033             """
6034             # Example: see GEOM_TestOthers.py
6035             anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
6036             RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
6037             self._autoPublish(anObj, theName, "inplace")
6038             return anObj
6039
6040         ## A sort of GetInPlace functionality, returning IDs of sub-shapes.
6041         #  For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6042         #  IDs of @a theShapeWhere.
6043         #  For example, if theShapeWhat is a box and theShapeWhere is this box cut into 
6044         #  two parts by a plane, then the result can be as this: 
6045         #    len( result_list ) = 35,
6046         #    result_list[ 1 ] = [ 2, 36 ], which means that the box  (ID 1) turned into two
6047         #  solids with IDs 2 and 36 within theShapeWhere
6048         #
6049         #  @param theShapeWhere Shape to find sub-shapes of.
6050         #  @param theShapeWhat Shape, specifying what to find.
6051         #  @return List of lists of sub-shape IDS of theShapeWhere.
6052         def GetInPlaceMap(self, theShapeWhere, theShapeWhat):
6053             """
6054             A sort of GetInPlace functionality, returning IDs of sub-shapes.
6055             For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6056             IDs of @a theShapeWhere.
6057             For example, if theShapeWhat is a box and theShapeWhere is this box cut into 
6058             two parts by a plane, then the result can be as this: 
6059               len( result_list ) = 35,
6060               result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6061             solids with IDs 2 and 36 within theShapeWhere
6062
6063             Parameters:
6064                 theShapeWhere Shape to find sub-shapes of.
6065                 theShapeWhat Shape, specifying what to find.
6066
6067             Returns:
6068                 List of lists of sub-shape IDS of theShapeWhere.
6069             """
6070             return self.ShapesOp.GetInPlaceMap(theShapeWhere, theShapeWhat)
6071
6072         ## Get sub-shape of theShapeWhere, which is
6073         #  equal to \a theShapeWhat.
6074         #  @param theShapeWhere Shape to find sub-shape of.
6075         #  @param theShapeWhat Shape, specifying what to find.
6076         #  @param theName Object name; when specified, this parameter is used
6077         #         for result publication in the study. Otherwise, if automatic
6078         #         publication is switched on, default value is used for result name.
6079         #
6080         #  @return New GEOM.GEOM_Object for found sub-shape.
6081         #
6082         #  @ref swig_GetSame "Example"
6083         @ManageTransactions("ShapesOp")
6084         def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
6085             """
6086             Get sub-shape of theShapeWhere, which is
6087             equal to theShapeWhat.
6088
6089             Parameters:
6090                 theShapeWhere Shape to find sub-shape of.
6091                 theShapeWhat Shape, specifying what to find.
6092                 theName Object name; when specified, this parameter is used
6093                         for result publication in the study. Otherwise, if automatic
6094                         publication is switched on, default value is used for result name.
6095
6096             Returns:
6097                 New GEOM.GEOM_Object for found sub-shape.
6098             """
6099             anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
6100             RaiseIfFailed("GetSame", self.ShapesOp)
6101             self._autoPublish(anObj, theName, "sameShape")
6102             return anObj
6103
6104
6105         ## Get sub-shape indices of theShapeWhere, which is
6106         #  equal to \a theShapeWhat.
6107         #  @param theShapeWhere Shape to find sub-shape of.
6108         #  @param theShapeWhat Shape, specifying what to find.
6109         #  @return List of all found sub-shapes indices.
6110         #
6111         #  @ref swig_GetSame "Example"
6112         @ManageTransactions("ShapesOp")
6113         def GetSameIDs(self, theShapeWhere, theShapeWhat):
6114             """
6115             Get sub-shape indices of theShapeWhere, which is
6116             equal to theShapeWhat.
6117
6118             Parameters:
6119                 theShapeWhere Shape to find sub-shape of.
6120                 theShapeWhat Shape, specifying what to find.
6121
6122             Returns:
6123                 List of all found sub-shapes indices.
6124             """
6125             anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
6126             RaiseIfFailed("GetSameIDs", self.ShapesOp)
6127             return anObj
6128
6129         ## Resize the input edge with the new Min and Max parameters.
6130         #  The input edge parameters range is [0, 1]. If theMin parameter is
6131         #  negative, the input edge is extended, otherwise it is shrinked by
6132         #  theMin parameter. If theMax is greater than 1, the edge is extended,
6133         #  otherwise it is shrinked by theMax parameter.
6134         #  @param theEdge the input edge to be resized.
6135         #  @param theMin the minimal parameter value.
6136         #  @param theMax the maximal parameter value.
6137         #  @param theName Object name; when specified, this parameter is used
6138         #         for result publication in the study. Otherwise, if automatic
6139         #         publication is switched on, default value is used for result name.
6140         #  @return New GEOM.GEOM_Object, containing the created edge.
6141         #
6142         #  @ref tui_extend "Example"
6143         @ManageTransactions("ShapesOp")
6144         def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
6145             """
6146             Resize the input edge with the new Min and Max parameters.
6147             The input edge parameters range is [0, 1]. If theMin parameter is
6148             negative, the input edge is extended, otherwise it is shrinked by
6149             theMin parameter. If theMax is greater than 1, the edge is extended,
6150             otherwise it is shrinked by theMax parameter.
6151
6152             Parameters:
6153                 theEdge the input edge to be resized.
6154                 theMin the minimal parameter value.
6155                 theMax the maximal parameter value.
6156                 theName Object name; when specified, this parameter is used
6157                         for result publication in the study. Otherwise, if automatic
6158                         publication is switched on, default value is used for result name.
6159
6160             Returns:
6161                 New GEOM.GEOM_Object, containing the created edge.
6162             """
6163             theMin, theMax, Parameters = ParseParameters(theMin, theMax)
6164             anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
6165             RaiseIfFailed("ExtendEdge", self.ShapesOp)
6166             anObj.SetParameters(Parameters)
6167             self._autoPublish(anObj, theName, "edge")
6168             return anObj
6169
6170         ## Resize the input face with the new UMin, UMax, VMin and VMax
6171         #  parameters. The input face U and V parameters range is [0, 1]. If
6172         #  theUMin parameter is negative, the input face is extended, otherwise
6173         #  it is shrinked along U direction by theUMin parameter. If theUMax is
6174         #  greater than 1, the face is extended, otherwise it is shrinked along
6175         #  U direction by theUMax parameter. So as for theVMin, theVMax and
6176         #  V direction of the input face.
6177         #  @param theFace the input face to be resized.
6178         #  @param theUMin the minimal U parameter value.
6179         #  @param theUMax the maximal U parameter value.
6180         #  @param theVMin the minimal V parameter value.
6181         #  @param theVMax the maximal V parameter value.
6182         #  @param theName Object name; when specified, this parameter is used
6183         #         for result publication in the study. Otherwise, if automatic
6184         #         publication is switched on, default value is used for result name.
6185         #  @return New GEOM.GEOM_Object, containing the created face.
6186         #
6187         #  @ref tui_extend "Example"
6188         @ManageTransactions("ShapesOp")
6189         def ExtendFace(self, theFace, theUMin, theUMax,
6190                        theVMin, theVMax, theName=None):
6191             """
6192             Resize the input face with the new UMin, UMax, VMin and VMax
6193             parameters. The input face U and V parameters range is [0, 1]. If
6194             theUMin parameter is negative, the input face is extended, otherwise
6195             it is shrinked along U direction by theUMin parameter. If theUMax is
6196             greater than 1, the face is extended, otherwise it is shrinked along
6197             U direction by theUMax parameter. So as for theVMin, theVMax and
6198             V direction of the input face.
6199
6200             Parameters:
6201                 theFace the input face to be resized.
6202                 theUMin the minimal U parameter value.
6203                 theUMax the maximal U parameter value.
6204                 theVMin the minimal V parameter value.
6205                 theVMax the maximal V parameter value.
6206                 theName Object name; when specified, this parameter is used
6207                         for result publication in the study. Otherwise, if automatic
6208                         publication is switched on, default value is used for result name.
6209
6210             Returns:
6211                 New GEOM.GEOM_Object, containing the created face.
6212             """
6213             theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6214             anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6215                                              theVMin, theVMax)
6216             RaiseIfFailed("ExtendFace", self.ShapesOp)
6217             anObj.SetParameters(Parameters)
6218             self._autoPublish(anObj, theName, "face")
6219             return anObj
6220
6221         ## This function takes some face as input parameter and creates new
6222         #  GEOM_Object, i.e. topological shape by extracting underlying surface
6223         #  of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6224         #  parameters of the source face (in the parametrical space).
6225         #  @param theFace the input face.
6226         #  @param theName Object name; when specified, this parameter is used
6227         #         for result publication in the study. Otherwise, if automatic
6228         #         publication is switched on, default value is used for result name.
6229         #  @return New GEOM.GEOM_Object, containing the created face.
6230         #
6231         #  @ref tui_creation_surface "Example"
6232         @ManageTransactions("ShapesOp")
6233         def MakeSurfaceFromFace(self, theFace, theName=None):
6234             """
6235             This function takes some face as input parameter and creates new
6236             GEOM_Object, i.e. topological shape by extracting underlying surface
6237             of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6238             parameters of the source face (in the parametrical space).
6239
6240             Parameters:
6241                 theFace the input face.
6242                 theName Object name; when specified, this parameter is used
6243                         for result publication in the study. Otherwise, if automatic
6244                         publication is switched on, default value is used for result name.
6245
6246             Returns:
6247                 New GEOM.GEOM_Object, containing the created face.
6248             """
6249             anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6250             RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6251             self._autoPublish(anObj, theName, "surface")
6252             return anObj
6253
6254         # end of l4_obtain
6255         ## @}
6256
6257         ## @addtogroup l4_access
6258         ## @{
6259
6260         ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6261         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6262         #  @param aShape Shape to get sub-shape of.
6263         #  @param ListOfID List of sub-shapes indices.
6264         #  @param theName Object name; when specified, this parameter is used
6265         #         for result publication in the study. Otherwise, if automatic
6266         #         publication is switched on, default value is used for result name.
6267         #
6268         #  @return Found sub-shape.
6269         #
6270         #  @ref swig_all_decompose "Example"
6271         def GetSubShape(self, aShape, ListOfID, theName=None):
6272             """
6273             Obtain a composite sub-shape of aShape, composed from sub-shapes
6274             of aShape, selected by their unique IDs inside aShape
6275
6276             Parameters:
6277                 aShape Shape to get sub-shape of.
6278                 ListOfID List of sub-shapes indices.
6279                 theName Object name; when specified, this parameter is used
6280                         for result publication in the study. Otherwise, if automatic
6281                         publication is switched on, default value is used for result name.
6282
6283             Returns:
6284                 Found sub-shape.
6285             """
6286             # Example: see GEOM_TestAll.py
6287             anObj = self.AddSubShape(aShape,ListOfID)
6288             self._autoPublish(anObj, theName, "subshape")
6289             return anObj
6290
6291         ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6292         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6293         #  @param aShape Shape to get sub-shape of.
6294         #  @param aSubShape Sub-shapes of aShape.
6295         #  @return ID of found sub-shape.
6296         #
6297         #  @ref swig_all_decompose "Example"
6298         @ManageTransactions("LocalOp")
6299         def GetSubShapeID(self, aShape, aSubShape):
6300             """
6301             Obtain unique ID of sub-shape aSubShape inside aShape
6302             of aShape, selected by their unique IDs inside aShape
6303
6304             Parameters:
6305                aShape Shape to get sub-shape of.
6306                aSubShape Sub-shapes of aShape.
6307
6308             Returns:
6309                ID of found sub-shape.
6310             """
6311             # Example: see GEOM_TestAll.py
6312             anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6313             RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6314             return anID
6315
6316         ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6317         #  This function is provided for performance purpose. The complexity is O(n) with n
6318         #  the number of subobjects of aShape
6319         #  @param aShape Shape to get sub-shape of.
6320         #  @param aSubShapes Sub-shapes of aShape.
6321         #  @return list of IDs of found sub-shapes.
6322         #
6323         #  @ref swig_all_decompose "Example"
6324         @ManageTransactions("ShapesOp")
6325         def GetSubShapesIDs(self, aShape, aSubShapes):
6326             """
6327             Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6328             This function is provided for performance purpose. The complexity is O(n) with n
6329             the number of subobjects of aShape
6330
6331             Parameters:
6332                aShape Shape to get sub-shape of.
6333                aSubShapes Sub-shapes of aShape.
6334
6335             Returns:
6336                List of IDs of found sub-shape.
6337             """
6338             # Example: see GEOM_TestAll.py
6339             anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6340             RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6341             return anIDs
6342
6343         # end of l4_access
6344         ## @}
6345
6346         ## @addtogroup l4_decompose
6347         ## @{
6348
6349         ## Get all sub-shapes and groups of \a theShape,
6350         #  that were created already by any other methods.
6351         #  @param theShape Any shape.
6352         #  @param theGroupsOnly If this parameter is TRUE, only groups will be
6353         #                       returned, else all found sub-shapes and groups.
6354         #  @return List of existing sub-objects of \a theShape.
6355         #
6356         #  @ref swig_all_decompose "Example"
6357         @ManageTransactions("ShapesOp")
6358         def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6359             """
6360             Get all sub-shapes and groups of theShape,
6361             that were created already by any other methods.
6362
6363             Parameters:
6364                 theShape Any shape.
6365                 theGroupsOnly If this parameter is TRUE, only groups will be
6366                                  returned, else all found sub-shapes and groups.
6367
6368             Returns:
6369                 List of existing sub-objects of theShape.
6370             """
6371             # Example: see GEOM_TestAll.py
6372             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6373             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6374             return ListObj
6375
6376         ## Get all groups of \a theShape,
6377         #  that were created already by any other methods.
6378         #  @param theShape Any shape.
6379         #  @return List of existing groups of \a theShape.
6380         #
6381         #  @ref swig_all_decompose "Example"
6382         @ManageTransactions("ShapesOp")
6383         def GetGroups(self, theShape):
6384             """
6385             Get all groups of theShape,
6386             that were created already by any other methods.
6387
6388             Parameters:
6389                 theShape Any shape.
6390
6391             Returns:
6392                 List of existing groups of theShape.
6393             """
6394             # Example: see GEOM_TestAll.py
6395             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6396             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6397             return ListObj
6398
6399         ## Explode a shape on sub-shapes of a given type.
6400         #  If the shape itself matches the type, it is also returned.
6401         #  @param aShape Shape to be exploded.
6402         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6403         #  @param theName Object name; when specified, this parameter is used
6404         #         for result publication in the study. Otherwise, if automatic
6405         #         publication is switched on, default value is used for result name.
6406         #
6407         #  @return List of sub-shapes of type theShapeType, contained in theShape.
6408         #
6409         #  @ref swig_all_decompose "Example"
6410         @ManageTransactions("ShapesOp")
6411         def SubShapeAll(self, aShape, aType, theName=None):
6412             """
6413             Explode a shape on sub-shapes of a given type.
6414             If the shape itself matches the type, it is also returned.
6415
6416             Parameters:
6417                 aShape Shape to be exploded.
6418                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6419                 theName Object name; when specified, this parameter is used
6420                         for result publication in the study. Otherwise, if automatic
6421                         publication is switched on, default value is used for result name.
6422
6423             Returns:
6424                 List of sub-shapes of type theShapeType, contained in theShape.
6425             """
6426             # Example: see GEOM_TestAll.py
6427             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6428             RaiseIfFailed("SubShapeAll", self.ShapesOp)
6429             self._autoPublish(ListObj, theName, "subshape")
6430             return ListObj
6431
6432         ## Explode a shape on sub-shapes of a given type.
6433         #  @param aShape Shape to be exploded.
6434         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6435         #  @return List of IDs of sub-shapes.
6436         #
6437         #  @ref swig_all_decompose "Example"
6438         @ManageTransactions("ShapesOp")
6439         def SubShapeAllIDs(self, aShape, aType):
6440             """
6441             Explode a shape on sub-shapes of a given type.
6442
6443             Parameters:
6444                 aShape Shape to be exploded (see geompy.ShapeType)
6445                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6446
6447             Returns:
6448                 List of IDs of sub-shapes.
6449             """
6450             ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6451             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6452             return ListObj
6453
6454         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6455         #  selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6456         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6457         #  @param aShape Shape to get sub-shape of.
6458         #  @param ListOfInd List of sub-shapes indices.
6459         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6460         #  @param theName Object name; when specified, this parameter is used
6461         #         for result publication in the study. Otherwise, if automatic
6462         #         publication is switched on, default value is used for result name.
6463         #
6464         #  @return A compound of sub-shapes of aShape.
6465         #
6466         #  @ref swig_all_decompose "Example"
6467         def SubShape(self, aShape, aType, ListOfInd, theName=None):
6468             """
6469             Obtain a compound of sub-shapes of aShape,
6470             selected by their indices in list of all sub-shapes of type aType.
6471             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6472
6473             Parameters:
6474                 aShape Shape to get sub-shape of.
6475                 ListOfID List of sub-shapes indices.
6476                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6477                 theName Object name; when specified, this parameter is used
6478                         for result publication in the study. Otherwise, if automatic
6479                         publication is switched on, default value is used for result name.
6480
6481             Returns:
6482                 A compound of sub-shapes of aShape.
6483             """
6484             # Example: see GEOM_TestAll.py
6485             ListOfIDs = []
6486             AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6487             for ind in ListOfInd:
6488                 ListOfIDs.append(AllShapeIDsList[ind - 1])
6489             # note: auto-publishing is done in self.GetSubShape()
6490             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6491             return anObj
6492
6493         ## Explode a shape on sub-shapes of a given type.
6494         #  Sub-shapes will be sorted taking into account their gravity centers,
6495         #  to provide stable order of sub-shapes. Please see
6496         #  @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6497         #  If the shape itself matches the type, it is also returned.
6498         #  @param aShape Shape to be exploded.
6499         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6500         #  @param theName Object name; when specified, this parameter is used
6501         #         for result publication in the study. Otherwise, if automatic
6502         #         publication is switched on, default value is used for result name.
6503         #
6504         #  @return List of sub-shapes of type theShapeType, contained in theShape.
6505         #
6506         #  @ref swig_SubShapeAllSorted "Example"
6507         @ManageTransactions("ShapesOp")
6508         def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6509             """
6510             Explode a shape on sub-shapes of a given type.
6511             Sub-shapes will be sorted taking into account their gravity centers,
6512             to provide stable order of sub-shapes.
6513             If the shape itself matches the type, it is also returned.
6514
6515             Parameters:
6516                 aShape Shape to be exploded.
6517                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6518                 theName Object name; when specified, this parameter is used
6519                         for result publication in the study. Otherwise, if automatic
6520                         publication is switched on, default value is used for result name.
6521
6522             Returns:
6523                 List of sub-shapes of type theShapeType, contained in theShape.
6524             """
6525             # Example: see GEOM_TestAll.py
6526             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6527             RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6528             self._autoPublish(ListObj, theName, "subshape")
6529             return ListObj
6530
6531         ## Explode a shape on sub-shapes of a given type.
6532         #  Sub-shapes will be sorted taking into account their gravity centers,
6533         #  to provide stable order of sub-shapes. Please see
6534         #  @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6535         #  @param aShape Shape to be exploded.
6536         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6537         #  @return List of IDs of sub-shapes.
6538         #
6539         #  @ref swig_all_decompose "Example"
6540         @ManageTransactions("ShapesOp")
6541         def SubShapeAllSortedCentresIDs(self, aShape, aType):
6542             """
6543             Explode a shape on sub-shapes of a given type.
6544             Sub-shapes will be sorted taking into account their gravity centers,
6545             to provide stable order of sub-shapes.
6546
6547             Parameters:
6548                 aShape Shape to be exploded.
6549                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6550
6551             Returns:
6552                 List of IDs of sub-shapes.
6553             """
6554             ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6555             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6556             return ListIDs
6557
6558         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6559         #  selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6560         #  Please see @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6561         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6562         #  @param aShape Shape to get sub-shape of.
6563         #  @param ListOfInd List of sub-shapes indices.
6564         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
6565         #  @param theName Object name; when specified, this parameter is used
6566         #         for result publication in the study. Otherwise, if automatic
6567         #         publication is switched on, default value is used for result name.
6568         #
6569         #  @return A compound of sub-shapes of aShape.
6570         #
6571         #  @ref swig_all_decompose "Example"
6572         def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6573             """
6574             Obtain a compound of sub-shapes of aShape,
6575             selected by they indices in sorted list of all sub-shapes of type aType.
6576             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6577
6578             Parameters:
6579                 aShape Shape to get sub-shape of.
6580                 ListOfID List of sub-shapes indices.
6581                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6582                 theName Object name; when specified, this parameter is used
6583                         for result publication in the study. Otherwise, if automatic
6584                         publication is switched on, default value is used for result name.
6585
6586             Returns:
6587                 A compound of sub-shapes of aShape.
6588             """
6589             # Example: see GEOM_TestAll.py
6590             ListOfIDs = []
6591             AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6592             for ind in ListOfInd:
6593                 ListOfIDs.append(AllShapeIDsList[ind - 1])
6594             # note: auto-publishing is done in self.GetSubShape()
6595             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6596             return anObj
6597
6598         ## Extract shapes (excluding the main shape) of given type.
6599         #  @param aShape The shape.
6600         #  @param aType  The shape type (see ShapeType())
6601         #  @param isSorted Boolean flag to switch sorting on/off. Please see
6602         #         @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6603         #  @param theName Object name; when specified, this parameter is used
6604         #         for result publication in the study. Otherwise, if automatic
6605         #         publication is switched on, default value is used for result name.
6606         #
6607         #  @return List of sub-shapes of type aType, contained in aShape.
6608         #
6609         #  @ref swig_FilletChamfer "Example"
6610         @ManageTransactions("ShapesOp")
6611         def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6612             """
6613             Extract shapes (excluding the main shape) of given type.
6614
6615             Parameters:
6616                 aShape The shape.
6617                 aType  The shape type (see geompy.ShapeType)
6618                 isSorted Boolean flag to switch sorting on/off.
6619                 theName Object name; when specified, this parameter is used
6620                         for result publication in the study. Otherwise, if automatic
6621                         publication is switched on, default value is used for result name.
6622
6623             Returns:
6624                 List of sub-shapes of type aType, contained in aShape.
6625             """
6626             # Example: see GEOM_TestAll.py
6627             ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6628             RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6629             self._autoPublish(ListObj, theName, "subshape")
6630             return ListObj
6631
6632         ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6633         #  @param aShape Main shape.
6634         #  @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6635         #  @param theName Object name; when specified, this parameter is used
6636         #         for result publication in the study. Otherwise, if automatic
6637         #         publication is switched on, default value is used for result name.
6638         #  @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6639         #
6640         #  @ref swig_all_decompose "Example"
6641         @ManageTransactions("ShapesOp")
6642         def SubShapes(self, aShape, anIDs, theName=None):
6643             """
6644             Get a set of sub-shapes defined by their unique IDs inside theMainShape
6645
6646             Parameters:
6647                 aShape Main shape.
6648                 anIDs List of unique IDs of sub-shapes inside theMainShape.
6649                 theName Object name; when specified, this parameter is used
6650                         for result publication in the study. Otherwise, if automatic
6651                         publication is switched on, default value is used for result name.
6652
6653             Returns:
6654                 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6655             """
6656             # Example: see GEOM_TestAll.py
6657             ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6658             RaiseIfFailed("SubShapes", self.ShapesOp)
6659             self._autoPublish(ListObj, theName, "subshape")
6660             return ListObj
6661
6662         ## Explode a shape into edges sorted in a row from a starting point.
6663         #  @param theShape the shape to be exploded on edges.
6664         #  @param theStartPoint the starting point.
6665         #  @param theName Object name; when specified, this parameter is used
6666         #         for result publication in the study. Otherwise, if automatic
6667         #         publication is switched on, default value is used for result name.
6668         #  @return List of GEOM.GEOM_Object that is actually an ordered list
6669         #          of edges sorted in a row from a starting point.
6670         #
6671         #  @ref swig_GetSubShapeEdgeSorted "Example"
6672         @ManageTransactions("ShapesOp")
6673         def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6674             """
6675             Explode a shape into edges sorted in a row from a starting point.
6676
6677             Parameters:
6678                 theShape the shape to be exploded on edges.
6679                 theStartPoint the starting point.
6680                 theName Object name; when specified, this parameter is used
6681                         for result publication in the study. Otherwise, if automatic
6682                         publication is switched on, default value is used for result name.
6683
6684             Returns:
6685                 List of GEOM.GEOM_Object that is actually an ordered list
6686                 of edges sorted in a row from a starting point.
6687             """
6688             # Example: see GEOM_TestAll.py
6689             ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6690             RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6691             self._autoPublish(ListObj, theName, "SortedEdges")
6692             return ListObj
6693
6694         ##
6695         # Return the list of subshapes that satisfies a certain tolerance
6696         # criterion. The user defines the type of shapes to be returned, the
6697         # condition and the tolerance value. The operation is defined for
6698         # faces, edges and vertices only. E.g. for theShapeType FACE,
6699         # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6700         # all faces of theShape that have tolerances greater then 1.e7.
6701         #
6702         #  @param theShape the shape to be exploded
6703         #  @param theShapeType the type of sub-shapes to be returned (see
6704         #         ShapeType()). Can have the values FACE, EDGE and VERTEX only.
6705         #  @param theCondition the condition type (see GEOM::comparison_condition).
6706         #  @param theTolerance the tolerance filter.
6707         #  @param theName Object name; when specified, this parameter is used
6708         #         for result publication in the study. Otherwise, if automatic
6709         #         publication is switched on, default value is used for result name.
6710         #  @return the list of shapes that satisfy the conditions.
6711         #
6712         #  @ref swig_GetSubShapesWithTolerance "Example"
6713         @ManageTransactions("ShapesOp")
6714         def GetSubShapesWithTolerance(self, theShape, theShapeType,
6715                                       theCondition, theTolerance, theName=None):
6716             """
6717             Return the list of subshapes that satisfies a certain tolerance
6718             criterion. The user defines the type of shapes to be returned, the
6719             condition and the tolerance value. The operation is defined for
6720             faces, edges and vertices only. E.g. for theShapeType FACE,
6721             theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6722             all faces of theShape that have tolerances greater then 1.e7.
6723             
6724             Parameters:
6725                 theShape the shape to be exploded
6726                 theShapeType the type of sub-shapes to be returned (see
6727                              ShapeType()). Can have the values FACE,
6728                              EDGE and VERTEX only.
6729                 theCondition the condition type (see GEOM::comparison_condition).
6730                 theTolerance the tolerance filter.
6731                 theName Object name; when specified, this parameter is used
6732                         for result publication in the study. Otherwise, if automatic
6733                         publication is switched on, default value is used for result name.
6734
6735             Returns:
6736                 The list of shapes that satisfy the conditions.
6737             """
6738             # Example: see GEOM_TestAll.py
6739             ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
6740                                                               theCondition, theTolerance)
6741             RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
6742             self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
6743             return ListObj
6744
6745         ## Check if the object is a sub-object of another GEOM object.
6746         #  @param aSubObject Checked sub-object (or its parent object, in case if
6747         #         \a theSubObjectIndex is non-zero).
6748         #  @param anObject An object that is checked for ownership (or its parent object,
6749         #         in case if \a theObjectIndex is non-zero).
6750         #  @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6751         #         identifies a sub-object within its parent specified via \a theSubObject.
6752         #  @param anObjectIndex When non-zero, specifies a sub-shape index that
6753         #         identifies an object within its parent specified via \a theObject.
6754         #  @return TRUE, if the given object contains sub-object.
6755         @ManageTransactions("ShapesOp")
6756         def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6757             """
6758             Check if the object is a sub-object of another GEOM object.
6759             
6760             Parameters:
6761                 aSubObject Checked sub-object (or its parent object, in case if
6762                     \a theSubObjectIndex is non-zero).
6763                 anObject An object that is checked for ownership (or its parent object,
6764                     in case if \a theObjectIndex is non-zero).
6765                 aSubObjectIndex When non-zero, specifies a sub-shape index that
6766                     identifies a sub-object within its parent specified via \a theSubObject.
6767                 anObjectIndex When non-zero, specifies a sub-shape index that
6768                     identifies an object within its parent specified via \a theObject.
6769
6770             Returns
6771                 TRUE, if the given object contains sub-object.
6772             """
6773             IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6774             RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6775             return IsOk
6776
6777         ## Perform extraction of sub-shapes from the main shape.
6778         #
6779         #  @param theShape the main shape
6780         #  @param theListOfID the list of sub-shape IDs to be extracted from
6781         #         the main shape.
6782         #  @return New GEOM.GEOM_Object, containing the shape without
6783         #          extracted sub-shapes.
6784         #
6785         #  @ref swig_MakeExtraction "Example"
6786         @ManageTransactions("ShapesOp")
6787         def MakeExtraction(self, theShape, theListOfID, theName=None):
6788             """
6789             Perform extraction of sub-shapes from the main shape.
6790
6791             Parameters:
6792                 theShape the main shape
6793                 theListOfID the list of sub-shape IDs to be extracted from
6794                             the main shape.
6795
6796             Returns
6797                 New GEOM.GEOM_Object, containing the shape without
6798                 extracted sub-shapes.
6799             """
6800             # Example: see GEOM_TestAll.py
6801             (anObj, aStat) = self.ShapesOp.MakeExtraction(theShape, theListOfID)
6802             RaiseIfFailed("MakeExtraction", self.ShapesOp)
6803             self._autoPublish(anObj, theName, "Extraction")
6804             return anObj
6805
6806         # end of l4_decompose
6807         ## @}
6808
6809         ## @addtogroup l4_decompose_d
6810         ## @{
6811
6812         ## Deprecated method
6813         #  It works like SubShapeAllSortedCentres(), but wrongly
6814         #  defines centres of faces, shells and solids.
6815         @ManageTransactions("ShapesOp")
6816         def SubShapeAllSorted(self, aShape, aType, theName=None):
6817             """
6818             Deprecated method
6819             It works like geompy.SubShapeAllSortedCentres, but wrongly
6820             defines centres of faces, shells and solids.
6821             """
6822             ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6823             RaiseIfFailed("MakeExplode", self.ShapesOp)
6824             self._autoPublish(ListObj, theName, "subshape")
6825             return ListObj
6826
6827         ## Deprecated method
6828         #  It works like SubShapeAllSortedCentresIDs(), but wrongly
6829         #  defines centres of faces, shells and solids.
6830         @ManageTransactions("ShapesOp")
6831         def SubShapeAllSortedIDs(self, aShape, aType):
6832             """
6833             Deprecated method
6834             It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6835             defines centres of faces, shells and solids.
6836             """
6837             ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6838             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6839             return ListIDs
6840
6841         ## Deprecated method
6842         #  It works like SubShapeSortedCentres(), but has a bug
6843         #  (wrongly defines centres of faces, shells and solids).
6844         def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6845             """
6846             Deprecated method
6847             It works like geompy.SubShapeSortedCentres, but has a bug
6848             (wrongly defines centres of faces, shells and solids).
6849             """
6850             ListOfIDs = []
6851             AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6852             for ind in ListOfInd:
6853                 ListOfIDs.append(AllShapeIDsList[ind - 1])
6854             # note: auto-publishing is done in self.GetSubShape()
6855             anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6856             return anObj
6857
6858         # end of l4_decompose_d
6859         ## @}
6860
6861         ## @addtogroup l3_healing
6862         ## @{
6863
6864         ## Apply a sequence of Shape Healing operators to the given object.
6865         #  @param theShape Shape to be processed.
6866         #  @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6867         #  @param theParameters List of names of parameters
6868         #                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6869         #  @param theValues List of values of parameters, in the same order
6870         #                    as parameters are listed in <VAR>theParameters</VAR> list.
6871         #  @param theName Object name; when specified, this parameter is used
6872         #         for result publication in the study. Otherwise, if automatic
6873         #         publication is switched on, default value is used for result name.
6874         #
6875         #  <b> Operators and Parameters: </b> \n
6876         #
6877         #  * \b FixShape - corrects invalid shapes. \n
6878         #  - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6879         #  - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6880         #
6881         #  * \b FixFaceSize - removes small faces, such as spots and strips.\n
6882         #  - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6883         #  - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6884         #  - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6885         #  - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6886         #  - \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
6887         #  - \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
6888         #  - \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
6889         #
6890         #  * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6891         #    surfaces in segments using a certain angle. \n
6892         #  - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6893         #    if Angle=180, four if Angle=90, etc). \n
6894         #  - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6895         #
6896         #  * \b SplitClosedFaces - splits closed faces in segments.
6897         #    The number of segments depends on the number of splitting points.\n
6898         #  - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6899         #
6900         #  * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6901         #  - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6902         #  - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6903         #  - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6904         #   This and the previous parameters can take the following values:\n
6905         #   \b Parametric \b Continuity \n
6906         #   \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6907         #   are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6908         #   \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6909         #    ruling out sharp edges).\n
6910         #   \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6911         #       are of the same magnitude).\n
6912         #   \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6913         #    or surfaces (d/du C(u)) are the same at junction. \n
6914         #   \b Geometric \b Continuity \n
6915         #   \b G1: first derivatives are proportional at junction.\n
6916         #   The curve tangents thus have the same direction, but not necessarily the same magnitude.
6917         #      i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6918         #   \b G2: first and second derivatives are proportional at junction.
6919         #   As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6920         #    continuity requires that the underlying parameterization was continuous as well.
6921         #   Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6922         #
6923         #  * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6924         #  - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6925         #  - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6926         #  - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6927         #  - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6928         #       with the specified parameters.\n
6929         #  - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6930         #       with the specified parameters.\n
6931         #  - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6932         #  - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6933         #  - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6934         #  - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6935         #
6936         #  * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6937         #  - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6938         #  - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6939         #  - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6940         #  - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6941         #
6942         #  * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6943         #  - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6944         #
6945         #
6946         #  @return New GEOM.GEOM_Object, containing processed shape.
6947         #
6948         #  \n @ref tui_shape_processing "Example"
6949         @ManageTransactions("HealOp")
6950         def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6951             """
6952             Apply a sequence of Shape Healing operators to the given object.
6953
6954             Parameters:
6955                 theShape Shape to be processed.
6956                 theValues List of values of parameters, in the same order
6957                           as parameters are listed in theParameters list.
6958                 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6959                 theParameters List of names of parameters
6960                               ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6961                 theName Object name; when specified, this parameter is used
6962                         for result publication in the study. Otherwise, if automatic
6963                         publication is switched on, default value is used for result name.
6964
6965                 Operators and Parameters:
6966
6967                  * FixShape - corrects invalid shapes.
6968                      * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6969                      * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6970                  * FixFaceSize - removes small faces, such as spots and strips.
6971                      * FixFaceSize.Tolerance - defines minimum possible face size.
6972                  * DropSmallEdges - removes edges, which merge with neighbouring edges.
6973                      * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6974                  * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6975                      * 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.
6976                      * 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.
6977                      * 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.
6978
6979                  * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6980                                 in segments using a certain angle.
6981                      * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6982                                           if Angle=180, four if Angle=90, etc).
6983                      * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6984                  * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6985                                       splitting points.
6986                      * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6987                  * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6988                      * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6989                      * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6990                      * SplitContinuity.CurveContinuity - required continuity for curves.
6991                        This and the previous parameters can take the following values:
6992
6993                        Parametric Continuity:
6994                        C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6995                                                    coincidental. The curves or surfaces may still meet at an angle,
6996                                                    giving rise to a sharp corner or edge).
6997                        C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6998                                                    are parallel, ruling out sharp edges).
6999                        C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
7000                                                   or surfaces are of the same magnitude).
7001                        CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
7002                           curves or surfaces (d/du C(u)) are the same at junction.
7003
7004                        Geometric Continuity:
7005                        G1: first derivatives are proportional at junction.
7006                            The curve tangents thus have the same direction, but not necessarily the same magnitude.
7007                            i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
7008                        G2: first and second derivatives are proportional at junction. As the names imply,
7009                            geometric continuity requires the geometry to be continuous, while parametric continuity requires
7010                            that the underlying parameterization was continuous as well. Parametric continuity of order n implies
7011                            geometric continuity of order n, but not vice-versa.
7012                  * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
7013                      * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
7014                      * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
7015                      * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
7016                      * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
7017                                                         the specified parameters.
7018                      * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
7019                                                         the specified parameters.
7020                      * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
7021                      * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
7022                      * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
7023                      * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
7024                  * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
7025                      * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
7026                      * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
7027                      * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
7028                      * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
7029                  * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
7030                      * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
7031
7032             Returns:
7033                 New GEOM.GEOM_Object, containing processed shape.
7034
7035             Note: For more information look through SALOME Geometry User's Guide->
7036                   -> Introduction to Geometry-> Repairing Operations-> Shape Processing
7037             """
7038             # Example: see GEOM_TestHealing.py
7039             theValues,Parameters = ParseList(theValues)
7040             anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
7041             # To avoid script failure in case of good argument shape
7042             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7043                 return theShape
7044             RaiseIfFailed("ProcessShape", self.HealOp)
7045             for string in (theOperators + theParameters):
7046                 Parameters = ":" + Parameters
7047                 pass
7048             anObj.SetParameters(Parameters)
7049             self._autoPublish(anObj, theName, "healed")
7050             return anObj
7051
7052         ## Remove faces from the given object (shape).
7053         #  @param theObject Shape to be processed.
7054         #  @param theFaces Indices of faces to be removed, if EMPTY then the method
7055         #                  removes ALL faces of the given object.
7056         #  @param theName Object name; when specified, this parameter is used
7057         #         for result publication in the study. Otherwise, if automatic
7058         #         publication is switched on, default value is used for result name.
7059         #
7060         #  @return New GEOM.GEOM_Object, containing processed shape.
7061         #
7062         #  @ref tui_suppress_faces "Example"
7063         @ManageTransactions("HealOp")
7064         def SuppressFaces(self, theObject, theFaces, theName=None):
7065             """
7066             Remove faces from the given object (shape).
7067
7068             Parameters:
7069                 theObject Shape to be processed.
7070                 theFaces Indices of faces to be removed, if EMPTY then the method
7071                          removes ALL faces of the given object.
7072                 theName Object name; when specified, this parameter is used
7073                         for result publication in the study. Otherwise, if automatic
7074                         publication is switched on, default value is used for result name.
7075
7076             Returns:
7077                 New GEOM.GEOM_Object, containing processed shape.
7078             """
7079             # Example: see GEOM_TestHealing.py
7080             anObj = self.HealOp.SuppressFaces(theObject, theFaces)
7081             RaiseIfFailed("SuppressFaces", self.HealOp)
7082             self._autoPublish(anObj, theName, "suppressFaces")
7083             return anObj
7084
7085         ## Sewing of faces into a single shell.
7086         #  @param ListShape Shapes to be processed.
7087         #  @param theTolerance Required tolerance value.
7088         #  @param AllowNonManifold Flag that allows non-manifold sewing.
7089         #  @param theName Object name; when specified, this parameter is used
7090         #         for result publication in the study. Otherwise, if automatic
7091         #         publication is switched on, default value is used for result name.
7092         #
7093         #  @return New GEOM.GEOM_Object, containing a result shell.
7094         #
7095         #  @ref tui_sewing "Example"
7096         def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7097             """
7098             Sewing of faces into a single shell.
7099
7100             Parameters:
7101                 ListShape Shapes to be processed.
7102                 theTolerance Required tolerance value.
7103                 AllowNonManifold Flag that allows non-manifold sewing.
7104                 theName Object name; when specified, this parameter is used
7105                         for result publication in the study. Otherwise, if automatic
7106                         publication is switched on, default value is used for result name.
7107
7108             Returns:
7109                 New GEOM.GEOM_Object, containing containing a result shell.
7110             """
7111             # Example: see GEOM_TestHealing.py
7112             # note: auto-publishing is done in self.Sew()
7113             anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
7114             return anObj
7115
7116         ## Sewing of faces into a single shell.
7117         #  @param ListShape Shapes to be processed.
7118         #  @param theTolerance Required tolerance value.
7119         #  @param AllowNonManifold Flag that allows non-manifold sewing.
7120         #  @param theName Object name; when specified, this parameter is used
7121         #         for result publication in the study. Otherwise, if automatic
7122         #         publication is switched on, default value is used for result name.
7123         #
7124         #  @return New GEOM.GEOM_Object, containing a result shell.
7125         @ManageTransactions("HealOp")
7126         def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7127             """
7128             Sewing of faces into a single shell.
7129
7130             Parameters:
7131                 ListShape Shapes to be processed.
7132                 theTolerance Required tolerance value.
7133                 AllowNonManifold Flag that allows non-manifold sewing.
7134                 theName Object name; when specified, this parameter is used
7135                         for result publication in the study. Otherwise, if automatic
7136                         publication is switched on, default value is used for result name.
7137
7138             Returns:
7139                 New GEOM.GEOM_Object, containing a result shell.
7140             """
7141             # Example: see MakeSewing() above
7142             theTolerance,Parameters = ParseParameters(theTolerance)
7143             if AllowNonManifold:
7144                 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
7145             else:
7146                 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
7147             # To avoid script failure in case of good argument shape
7148             # (Fix of test cases geom/bugs11/L7,L8)
7149             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7150                 return anObj
7151             RaiseIfFailed("Sew", self.HealOp)
7152             anObj.SetParameters(Parameters)
7153             self._autoPublish(anObj, theName, "sewed")
7154             return anObj
7155
7156         ## Rebuild the topology of theSolids by removing
7157         #  the faces that are shared by several solids.
7158         #  @param theSolids A compound or a list of solids to be processed.
7159         #  @param theName Object name; when specified, this parameter is used
7160         #         for result publication in the study. Otherwise, if automatic
7161         #         publication is switched on, default value is used for result name.
7162         #
7163         #  @return New GEOM.GEOM_Object, containing processed shape.
7164         #
7165         #  @ref tui_remove_webs "Example"
7166         @ManageTransactions("HealOp")
7167         def RemoveInternalFaces (self, theSolids, theName=None):
7168             """
7169             Rebuild the topology of theSolids by removing
7170             the faces that are shared by several solids.
7171
7172             Parameters:
7173                 theSolids A compound or a list of solids to be processed.
7174                 theName Object name; when specified, this parameter is used
7175                         for result publication in the study. Otherwise, if automatic
7176                         publication is switched on, default value is used for result name.
7177
7178             Returns:
7179                 New GEOM.GEOM_Object, containing processed shape.
7180             """
7181             # Example: see GEOM_TestHealing.py
7182             anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
7183             RaiseIfFailed("RemoveInternalFaces", self.HealOp)
7184             self._autoPublish(anObj, theName, "removeWebs")
7185             return anObj
7186
7187         ## Remove internal wires and edges from the given object (face).
7188         #  @param theObject Shape to be processed.
7189         #  @param theWires Indices of wires to be removed, if EMPTY then the method
7190         #                  removes ALL internal wires of the given object.
7191         #  @param theName Object name; when specified, this parameter is used
7192         #         for result publication in the study. Otherwise, if automatic
7193         #         publication is switched on, default value is used for result name.
7194         #
7195         #  @return New GEOM.GEOM_Object, containing processed shape.
7196         #
7197         #  @ref tui_suppress_internal_wires "Example"
7198         @ManageTransactions("HealOp")
7199         def SuppressInternalWires(self, theObject, theWires, theName=None):
7200             """
7201             Remove internal wires and edges from the given object (face).
7202
7203             Parameters:
7204                 theObject Shape to be processed.
7205                 theWires Indices of wires to be removed, if EMPTY then the method
7206                          removes ALL internal wires of the given object.
7207                 theName Object name; when specified, this parameter is used
7208                         for result publication in the study. Otherwise, if automatic
7209                         publication is switched on, default value is used for result name.
7210
7211             Returns:
7212                 New GEOM.GEOM_Object, containing processed shape.
7213             """
7214             # Example: see GEOM_TestHealing.py
7215             anObj = self.HealOp.RemoveIntWires(theObject, theWires)
7216             RaiseIfFailed("RemoveIntWires", self.HealOp)
7217             self._autoPublish(anObj, theName, "suppressWires")
7218             return anObj
7219
7220         ## Remove internal closed contours (holes) from the given object.
7221         #  @param theObject Shape to be processed.
7222         #  @param theWires Indices of wires to be removed, if EMPTY then the method
7223         #                  removes ALL internal holes of the given object
7224         #  @param theName Object name; when specified, this parameter is used
7225         #         for result publication in the study. Otherwise, if automatic
7226         #         publication is switched on, default value is used for result name.
7227         #
7228         #  @return New GEOM.GEOM_Object, containing processed shape.
7229         #
7230         #  @ref tui_suppress_holes "Example"
7231         @ManageTransactions("HealOp")
7232         def SuppressHoles(self, theObject, theWires, theName=None):
7233             """
7234             Remove internal closed contours (holes) from the given object.
7235
7236             Parameters:
7237                 theObject Shape to be processed.
7238                 theWires Indices of wires to be removed, if EMPTY then the method
7239                          removes ALL internal holes of the given object
7240                 theName Object name; when specified, this parameter is used
7241                         for result publication in the study. Otherwise, if automatic
7242                         publication is switched on, default value is used for result name.
7243
7244             Returns:
7245                 New GEOM.GEOM_Object, containing processed shape.
7246             """
7247             # Example: see GEOM_TestHealing.py
7248             anObj = self.HealOp.FillHoles(theObject, theWires)
7249             RaiseIfFailed("FillHoles", self.HealOp)
7250             self._autoPublish(anObj, theName, "suppressHoles")
7251             return anObj
7252
7253         ## Close an open wire.
7254         #  @param theObject Shape to be processed.
7255         #  @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7256         #                  if [ ], then <VAR>theObject</VAR> itself is a wire.
7257         #  @param isCommonVertex If True  : closure by creation of a common vertex,
7258         #                        If False : closure by creation of an edge between ends.
7259         #  @param theName Object name; when specified, this parameter is used
7260         #         for result publication in the study. Otherwise, if automatic
7261         #         publication is switched on, default value is used for result name.
7262         #
7263         #  @return New GEOM.GEOM_Object, containing processed shape.
7264         #
7265         #  @ref tui_close_contour "Example"
7266         @ManageTransactions("HealOp")
7267         def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7268             """
7269             Close an open wire.
7270
7271             Parameters:
7272                 theObject Shape to be processed.
7273                 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7274                          if [ ], then theObject itself is a wire.
7275                 isCommonVertex If True  : closure by creation of a common vertex,
7276                                If False : closure by creation of an edge between ends.
7277                 theName Object name; when specified, this parameter is used
7278                         for result publication in the study. Otherwise, if automatic
7279                         publication is switched on, default value is used for result name.
7280
7281             Returns:
7282                 New GEOM.GEOM_Object, containing processed shape.
7283             """
7284             # Example: see GEOM_TestHealing.py
7285             anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7286             RaiseIfFailed("CloseContour", self.HealOp)
7287             self._autoPublish(anObj, theName, "closeContour")
7288             return anObj
7289
7290         ## Addition of a point to a given edge object.
7291         #  @param theObject Shape to be processed.
7292         #  @param theEdgeIndex Index of edge to be divided within theObject's shape,
7293         #                      if -1, then theObject itself is the edge.
7294         #  @param theValue Value of parameter on edge or length parameter,
7295         #                  depending on \a isByParameter.
7296         #  @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7297         #                       if FALSE : \a theValue is treated as a length parameter [0..1]
7298         #  @param theName Object name; when specified, this parameter is used
7299         #         for result publication in the study. Otherwise, if automatic
7300         #         publication is switched on, default value is used for result name.
7301         #
7302         #  @return New GEOM.GEOM_Object, containing processed shape.
7303         #
7304         #  @ref tui_add_point_on_edge "Example"
7305         @ManageTransactions("HealOp")
7306         def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7307             """
7308             Addition of a point to a given edge object.
7309
7310             Parameters:
7311                 theObject Shape to be processed.
7312                 theEdgeIndex Index of edge to be divided within theObject's shape,
7313                              if -1, then theObject itself is the edge.
7314                 theValue Value of parameter on edge or length parameter,
7315                          depending on isByParameter.
7316                 isByParameter If TRUE :  theValue is treated as a curve parameter [0..1],
7317                               if FALSE : theValue is treated as a length parameter [0..1]
7318                 theName Object name; when specified, this parameter is used
7319                         for result publication in the study. Otherwise, if automatic
7320                         publication is switched on, default value is used for result name.
7321
7322             Returns:
7323                 New GEOM.GEOM_Object, containing processed shape.
7324             """
7325             # Example: see GEOM_TestHealing.py
7326             theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7327             anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7328             RaiseIfFailed("DivideEdge", self.HealOp)
7329             anObj.SetParameters(Parameters)
7330             self._autoPublish(anObj, theName, "divideEdge")
7331             return anObj
7332
7333         ## Addition of points to a given edge of \a theObject by projecting
7334         #  other points to the given edge.
7335         #  @param theObject Shape to be processed.
7336         #  @param theEdgeIndex Index of edge to be divided within theObject's shape,
7337         #                      if -1, then theObject itself is the edge.
7338         #  @param thePoints List of points to project to theEdgeIndex-th edge.
7339         #  @param theName Object name; when specified, this parameter is used
7340         #         for result publication in the study. Otherwise, if automatic
7341         #         publication is switched on, default value is used for result name.
7342         #
7343         #  @return New GEOM.GEOM_Object, containing processed shape.
7344         #
7345         #  @ref tui_add_point_on_edge "Example"
7346         @ManageTransactions("HealOp")
7347         def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7348             """
7349             Addition of points to a given edge of \a theObject by projecting
7350             other points to the given edge.
7351
7352             Parameters:
7353                 theObject Shape to be processed.
7354                 theEdgeIndex The edge or its index to be divided within theObject's shape,
7355                              if -1, then theObject itself is the edge.
7356                 thePoints List of points to project to theEdgeIndex-th edge.
7357                 theName Object name; when specified, this parameter is used
7358                         for result publication in the study. Otherwise, if automatic
7359                         publication is switched on, default value is used for result name.
7360
7361             Returns:
7362                 New GEOM.GEOM_Object, containing processed shape.
7363             """
7364             # Example: see GEOM_TestHealing.py
7365             if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7366                 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7367             anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7368             RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7369             self._autoPublish(anObj, theName, "divideEdge")
7370             return anObj
7371
7372         ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7373         #  @param theWire Wire to minimize the number of C1 continuous edges in.
7374         #  @param theVertices A list of vertices to suppress. If the list
7375         #                     is empty, all vertices in a wire will be assumed.
7376         #  @param theName Object name; when specified, this parameter is used
7377         #         for result publication in the study. Otherwise, if automatic
7378         #         publication is switched on, default value is used for result name.
7379         #
7380         #  @return New GEOM.GEOM_Object with modified wire.
7381         #
7382         #  @ref tui_fuse_collinear_edges "Example"
7383         @ManageTransactions("HealOp")
7384         def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7385             """
7386             Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7387
7388             Parameters:
7389                 theWire Wire to minimize the number of C1 continuous edges in.
7390                 theVertices A list of vertices to suppress. If the list
7391                             is empty, all vertices in a wire will be assumed.
7392                 theName Object name; when specified, this parameter is used
7393                         for result publication in the study. Otherwise, if automatic
7394                         publication is switched on, default value is used for result name.
7395
7396             Returns:
7397                 New GEOM.GEOM_Object with modified wire.
7398             """
7399             anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7400             RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7401             self._autoPublish(anObj, theName, "fuseEdges")
7402             return anObj
7403
7404         ## Change orientation of the given object. Updates given shape.
7405         #  @param theObject Shape to be processed.
7406         #  @return Updated <var>theObject</var>
7407         #
7408         #  @ref swig_todo "Example"
7409         @ManageTransactions("HealOp")
7410         def ChangeOrientationShell(self,theObject):
7411             """
7412             Change orientation of the given object. Updates given shape.
7413
7414             Parameters:
7415                 theObject Shape to be processed.
7416
7417             Returns:
7418                 Updated theObject
7419             """
7420             theObject = self.HealOp.ChangeOrientation(theObject)
7421             RaiseIfFailed("ChangeOrientation", self.HealOp)
7422             pass
7423
7424         ## Change orientation of the given object.
7425         #  @param theObject Shape to be processed.
7426         #  @param theName Object name; when specified, this parameter is used
7427         #         for result publication in the study. Otherwise, if automatic
7428         #         publication is switched on, default value is used for result name.
7429         #
7430         #  @return New GEOM.GEOM_Object, containing processed shape.
7431         #
7432         #  @ref swig_todo "Example"
7433         @ManageTransactions("HealOp")
7434         def ChangeOrientationShellCopy(self, theObject, theName=None):
7435             """
7436             Change orientation of the given object.
7437
7438             Parameters:
7439                 theObject Shape to be processed.
7440                 theName Object name; when specified, this parameter is used
7441                         for result publication in the study. Otherwise, if automatic
7442                         publication is switched on, default value is used for result name.
7443
7444             Returns:
7445                 New GEOM.GEOM_Object, containing processed shape.
7446             """
7447             anObj = self.HealOp.ChangeOrientationCopy(theObject)
7448             RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7449             self._autoPublish(anObj, theName, "reversed")
7450             return anObj
7451
7452         ## Try to limit tolerance of the given object by value \a theTolerance.
7453         #  @param theObject Shape to be processed.
7454         #  @param theTolerance Required tolerance value.
7455         #  @param theName Object name; when specified, this parameter is used
7456         #         for result publication in the study. Otherwise, if automatic
7457         #         publication is switched on, default value is used for result name.
7458         #
7459         #  @return New GEOM.GEOM_Object, containing processed shape.
7460         #
7461         #  @ref tui_limit_tolerance "Example"
7462         @ManageTransactions("HealOp")
7463         def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7464             """
7465             Try to limit tolerance of the given object by value theTolerance.
7466
7467             Parameters:
7468                 theObject Shape to be processed.
7469                 theTolerance Required tolerance value.
7470                 theName Object name; when specified, this parameter is used
7471                         for result publication in the study. Otherwise, if automatic
7472                         publication is switched on, default value is used for result name.
7473
7474             Returns:
7475                 New GEOM.GEOM_Object, containing processed shape.
7476             """
7477             anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7478             RaiseIfFailed("LimitTolerance", self.HealOp)
7479             self._autoPublish(anObj, theName, "limitTolerance")
7480             return anObj
7481
7482         ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7483         #  that constitute a free boundary of the given shape.
7484         #  @param theObject Shape to get free boundary of.
7485         #  @param theName Object name; when specified, this parameter is used
7486         #         for result publication in the study. Otherwise, if automatic
7487         #         publication is switched on, default value is used for result name.
7488         #
7489         #  @return [\a status, \a theClosedWires, \a theOpenWires]
7490         #  \n \a status: FALSE, if an error(s) occurred during the method execution.
7491         #  \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7492         #  \n \a theOpenWires: Open wires on the free boundary of the given shape.
7493         #
7494         #  @ref tui_free_boundaries_page "Example"
7495         @ManageTransactions("HealOp")
7496         def GetFreeBoundary(self, theObject, theName=None):
7497             """
7498             Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7499             that constitute a free boundary of the given shape.
7500
7501             Parameters:
7502                 theObject Shape to get free boundary of.
7503                 theName Object name; when specified, this parameter is used
7504                         for result publication in the study. Otherwise, if automatic
7505                         publication is switched on, default value is used for result name.
7506
7507             Returns:
7508                 [status, theClosedWires, theOpenWires]
7509                  status: FALSE, if an error(s) occurred during the method execution.
7510                  theClosedWires: Closed wires on the free boundary of the given shape.
7511                  theOpenWires: Open wires on the free boundary of the given shape.
7512             """
7513             # Example: see GEOM_TestHealing.py
7514             anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7515             RaiseIfFailed("GetFreeBoundary", self.HealOp)
7516             self._autoPublish(anObj[1], theName, "closedWire")
7517             self._autoPublish(anObj[2], theName, "openWire")
7518             return anObj
7519
7520         ## Replace coincident faces in \a theShapes by one face.
7521         #  @param theShapes Initial shapes, either a list or compound of shapes.
7522         #  @param theTolerance Maximum distance between faces, which can be considered as coincident.
7523         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
7524         #                         otherwise all initial shapes.
7525         #  @param theName Object name; when specified, this parameter is used
7526         #         for result publication in the study. Otherwise, if automatic
7527         #         publication is switched on, default value is used for result name.
7528         #
7529         #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7530         #
7531         #  @ref tui_glue_faces "Example"
7532         @ManageTransactions("ShapesOp")
7533         def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7534             """
7535             Replace coincident faces in theShapes by one face.
7536
7537             Parameters:
7538                 theShapes Initial shapes, either a list or compound of shapes.
7539                 theTolerance Maximum distance between faces, which can be considered as coincident.
7540                 doKeepNonSolids If FALSE, only solids will present in the result,
7541                                 otherwise all initial shapes.
7542                 theName Object name; when specified, this parameter is used
7543                         for result publication in the study. Otherwise, if automatic
7544                         publication is switched on, default value is used for result name.
7545
7546             Returns:
7547                 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7548             """
7549             # Example: see GEOM_Spanner.py
7550             theTolerance,Parameters = ParseParameters(theTolerance)
7551             anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7552             if anObj is None:
7553                 raise RuntimeError("MakeGlueFaces : " + self.ShapesOp.GetErrorCode())
7554             anObj.SetParameters(Parameters)
7555             self._autoPublish(anObj, theName, "glueFaces")
7556             return anObj
7557
7558         ## Find coincident faces in \a theShapes for possible gluing.
7559         #  @param theShapes Initial shapes, either a list or compound of shapes.
7560         #  @param theTolerance Maximum distance between faces,
7561         #                      which can be considered as coincident.
7562         #  @param theName Object name; when specified, this parameter is used
7563         #         for result publication in the study. Otherwise, if automatic
7564         #         publication is switched on, default value is used for result name.
7565         #
7566         #  @return GEOM.ListOfGO
7567         #
7568         #  @ref tui_glue_faces "Example"
7569         @ManageTransactions("ShapesOp")
7570         def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7571             """
7572             Find coincident faces in theShapes for possible gluing.
7573
7574             Parameters:
7575                 theShapes Initial shapes, either a list or compound of shapes.
7576                 theTolerance Maximum distance between faces,
7577                              which can be considered as coincident.
7578                 theName Object name; when specified, this parameter is used
7579                         for result publication in the study. Otherwise, if automatic
7580                         publication is switched on, default value is used for result name.
7581
7582             Returns:
7583                 GEOM.ListOfGO
7584             """
7585             anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7586             RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7587             self._autoPublish(anObj, theName, "facesToGlue")
7588             return anObj
7589
7590         ## Replace coincident faces in \a theShapes by one face
7591         #  in compliance with given list of faces
7592         #  @param theShapes Initial shapes, either a list or compound of shapes.
7593         #  @param theTolerance Maximum distance between faces,
7594         #                      which can be considered as coincident.
7595         #  @param theFaces List of faces for gluing.
7596         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
7597         #                         otherwise all initial shapes.
7598         #  @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7599         #                        will be glued, otherwise only the edges,
7600         #                        belonging to <VAR>theFaces</VAR>.
7601         #  @param theName Object name; when specified, this parameter is used
7602         #         for result publication in the study. Otherwise, if automatic
7603         #         publication is switched on, default value is used for result name.
7604         #
7605         #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7606         #
7607         #  @ref tui_glue_faces "Example"
7608         @ManageTransactions("ShapesOp")
7609         def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7610                                 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7611             """
7612             Replace coincident faces in theShapes by one face
7613             in compliance with given list of faces
7614
7615             Parameters:
7616                 theShapes theShapes Initial shapes, either a list or compound of shapes.
7617                 theTolerance Maximum distance between faces,
7618                              which can be considered as coincident.
7619                 theFaces List of faces for gluing.
7620                 doKeepNonSolids If FALSE, only solids will present in the result,
7621                                 otherwise all initial shapes.
7622                 doGlueAllEdges If TRUE, all coincident edges of theShape
7623                                will be glued, otherwise only the edges,
7624                                belonging to theFaces.
7625                 theName Object name; when specified, this parameter is used
7626                         for result publication in the study. Otherwise, if automatic
7627                         publication is switched on, default value is used for result name.
7628
7629             Returns:
7630                 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7631             """
7632             anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7633                                                       doKeepNonSolids, doGlueAllEdges)
7634             if anObj is None:
7635                 raise RuntimeError("MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode())
7636             self._autoPublish(anObj, theName, "glueFaces")
7637             return anObj
7638
7639         ## Replace coincident edges in \a theShapes by one edge.
7640         #  @param theShapes Initial shapes, either a list or compound of shapes.
7641         #  @param theTolerance Maximum distance between edges, which can be considered as coincident.
7642         #  @param theName Object name; when specified, this parameter is used
7643         #         for result publication in the study. Otherwise, if automatic
7644         #         publication is switched on, default value is used for result name.
7645         #
7646         #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7647         #
7648         #  @ref tui_glue_edges "Example"
7649         @ManageTransactions("ShapesOp")
7650         def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7651             """
7652             Replace coincident edges in theShapes by one edge.
7653
7654             Parameters:
7655                 theShapes Initial shapes, either a list or compound of shapes.
7656                 theTolerance Maximum distance between edges, which can be considered as coincident.
7657                 theName Object name; when specified, this parameter is used
7658                         for result publication in the study. Otherwise, if automatic
7659                         publication is switched on, default value is used for result name.
7660
7661             Returns:
7662                 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7663             """
7664             theTolerance,Parameters = ParseParameters(theTolerance)
7665             anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7666             if anObj is None:
7667                 raise RuntimeError("MakeGlueEdges : " + self.ShapesOp.GetErrorCode())
7668             anObj.SetParameters(Parameters)
7669             self._autoPublish(anObj, theName, "glueEdges")
7670             return anObj
7671
7672         ## Find coincident edges in \a theShapes for possible gluing.
7673         #  @param theShapes Initial shapes, either a list or compound of shapes.
7674         #  @param theTolerance Maximum distance between edges,
7675         #                      which can be considered as coincident.
7676         #  @param theName Object name; when specified, this parameter is used
7677         #         for result publication in the study. Otherwise, if automatic
7678         #         publication is switched on, default value is used for result name.
7679         #
7680         #  @return GEOM.ListOfGO
7681         #
7682         #  @ref tui_glue_edges "Example"
7683         @ManageTransactions("ShapesOp")
7684         def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7685             """
7686             Find coincident edges in theShapes for possible gluing.
7687
7688             Parameters:
7689                 theShapes Initial shapes, either a list or compound of shapes.
7690                 theTolerance Maximum distance between edges,
7691                              which can be considered as coincident.
7692                 theName Object name; when specified, this parameter is used
7693                         for result publication in the study. Otherwise, if automatic
7694                         publication is switched on, default value is used for result name.
7695
7696             Returns:
7697                 GEOM.ListOfGO
7698             """
7699             anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7700             RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7701             self._autoPublish(anObj, theName, "edgesToGlue")
7702             return anObj
7703
7704         ## Replace coincident edges in theShapes by one edge
7705         #  in compliance with given list of edges.
7706         #  @param theShapes Initial shapes, either a list or compound of shapes.
7707         #  @param theTolerance Maximum distance between edges,
7708         #                      which can be considered as coincident.
7709         #  @param theEdges List of edges for gluing.
7710         #  @param theName Object name; when specified, this parameter is used
7711         #         for result publication in the study. Otherwise, if automatic
7712         #         publication is switched on, default value is used for result name.
7713         #
7714         #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7715         #
7716         #  @ref tui_glue_edges "Example"
7717         @ManageTransactions("ShapesOp")
7718         def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7719             """
7720             Replace coincident edges in theShapes by one edge
7721             in compliance with given list of edges.
7722
7723             Parameters:
7724                 theShapes Initial shapes, either a list or compound of shapes.
7725                 theTolerance Maximum distance between edges,
7726                              which can be considered as coincident.
7727                 theEdges List of edges for gluing.
7728                 theName Object name; when specified, this parameter is used
7729                         for result publication in the study. Otherwise, if automatic
7730                         publication is switched on, default value is used for result name.
7731
7732             Returns:
7733                 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7734             """
7735             anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7736             if anObj is None:
7737                 raise RuntimeError("MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode())
7738             self._autoPublish(anObj, theName, "glueEdges")
7739             return anObj
7740
7741         # end of l3_healing
7742         ## @}
7743
7744         ## @addtogroup l3_boolean Boolean Operations
7745         ## @{
7746
7747         # -----------------------------------------------------------------------------
7748         # Boolean (Common, Cut, Fuse, Section)
7749         # -----------------------------------------------------------------------------
7750
7751         ## Perform one of boolean operations on two given shapes.
7752         #  @param theShape1 First argument for boolean operation.
7753         #  @param theShape2 Second argument for boolean operation.
7754         #  @param theOperation Indicates the operation to be done:\n
7755         #                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7756         #  @param checkSelfInte The flag that tells if the arguments should
7757         #         be checked for self-intersection prior to the operation.
7758         #  @param theName Object name; when specified, this parameter is used
7759         #         for result publication in the study. Otherwise, if automatic
7760         #         publication is switched on, default value is used for result name.
7761         #
7762         #  @note This algorithm doesn't find all types of self-intersections.
7763         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7764         #        vertex/face and edge/face intersections. Face/face
7765         #        intersections detection is switched off as it is a
7766         #        time-consuming operation that gives an impact on performance.
7767         #        To find all self-intersections please use
7768         #        CheckSelfIntersections() method.
7769         #
7770         #  @return New GEOM.GEOM_Object, containing the result shape.
7771         #
7772         #  @ref tui_fuse "Example"
7773         @ManageTransactions("BoolOp")
7774         def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7775             """
7776             Perform one of boolean operations on two given shapes.
7777
7778             Parameters:
7779                 theShape1 First argument for boolean operation.
7780                 theShape2 Second argument for boolean operation.
7781                 theOperation Indicates the operation to be done:
7782                              1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7783                 checkSelfInte The flag that tells if the arguments should
7784                               be checked for self-intersection prior to
7785                               the operation.
7786                 theName Object name; when specified, this parameter is used
7787                         for result publication in the study. Otherwise, if automatic
7788                         publication is switched on, default value is used for result name.
7789
7790             Note:
7791                     This algorithm doesn't find all types of self-intersections.
7792                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7793                     vertex/face and edge/face intersections. Face/face
7794                     intersections detection is switched off as it is a
7795                     time-consuming operation that gives an impact on performance.
7796                     To find all self-intersections please use
7797                     CheckSelfIntersections() method.
7798
7799             Returns:
7800                 New GEOM.GEOM_Object, containing the result shape.
7801             """
7802             # Example: see GEOM_TestAll.py
7803             anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7804             RaiseIfFailed("MakeBoolean", self.BoolOp)
7805             def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7806             self._autoPublish(anObj, theName, def_names[theOperation])
7807             return anObj
7808
7809         ## Perform Common boolean operation on two given shapes.
7810         #  @param theShape1 First argument for boolean operation.
7811         #  @param theShape2 Second argument for boolean operation.
7812         #  @param checkSelfInte The flag that tells if the arguments should
7813         #         be checked for self-intersection prior to the operation.
7814         #  @param theName Object name; when specified, this parameter is used
7815         #         for result publication in the study. Otherwise, if automatic
7816         #         publication is switched on, default value is used for result name.
7817         #
7818         #  @note This algorithm doesn't find all types of self-intersections.
7819         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7820         #        vertex/face and edge/face intersections. Face/face
7821         #        intersections detection is switched off as it is a
7822         #        time-consuming operation that gives an impact on performance.
7823         #        To find all self-intersections please use
7824         #        CheckSelfIntersections() method.
7825         #
7826         #  @return New GEOM.GEOM_Object, containing the result shape.
7827         #
7828         #  @ref tui_common "Example 1"
7829         #  \n @ref swig_MakeCommon "Example 2"
7830         def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7831             """
7832             Perform Common boolean operation on two given shapes.
7833
7834             Parameters:
7835                 theShape1 First argument for boolean operation.
7836                 theShape2 Second argument for boolean operation.
7837                 checkSelfInte The flag that tells if the arguments should
7838                               be checked for self-intersection prior to
7839                               the operation.
7840                 theName Object name; when specified, this parameter is used
7841                         for result publication in the study. Otherwise, if automatic
7842                         publication is switched on, default value is used for result name.
7843
7844             Note:
7845                     This algorithm doesn't find all types of self-intersections.
7846                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7847                     vertex/face and edge/face intersections. Face/face
7848                     intersections detection is switched off as it is a
7849                     time-consuming operation that gives an impact on performance.
7850                     To find all self-intersections please use
7851                     CheckSelfIntersections() method.
7852
7853             Returns:
7854                 New GEOM.GEOM_Object, containing the result shape.
7855             """
7856             # Example: see GEOM_TestOthers.py
7857             # note: auto-publishing is done in self.MakeBoolean()
7858             return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7859
7860         ## Perform Cut boolean operation on two given shapes.
7861         #  @param theShape1 First argument for boolean operation.
7862         #  @param theShape2 Second argument for boolean operation.
7863         #  @param checkSelfInte The flag that tells if the arguments should
7864         #         be checked for self-intersection prior to the operation.
7865         #  @param theName Object name; when specified, this parameter is used
7866         #         for result publication in the study. Otherwise, if automatic
7867         #         publication is switched on, default value is used for result name.
7868         #
7869         #  @note This algorithm doesn't find all types of self-intersections.
7870         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7871         #        vertex/face and edge/face intersections. Face/face
7872         #        intersections detection is switched off as it is a
7873         #        time-consuming operation that gives an impact on performance.
7874         #        To find all self-intersections please use
7875         #        CheckSelfIntersections() method.
7876         #
7877         #  @return New GEOM.GEOM_Object, containing the result shape.
7878         #
7879         #  @ref tui_cut "Example 1"
7880         #  \n @ref swig_MakeCommon "Example 2"
7881         def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7882             """
7883             Perform Cut boolean operation on two given shapes.
7884
7885             Parameters:
7886                 theShape1 First argument for boolean operation.
7887                 theShape2 Second argument for boolean operation.
7888                 checkSelfInte The flag that tells if the arguments should
7889                               be checked for self-intersection prior to
7890                               the operation.
7891                 theName Object name; when specified, this parameter is used
7892                         for result publication in the study. Otherwise, if automatic
7893                         publication is switched on, default value is used for result name.
7894
7895             Note:
7896                     This algorithm doesn't find all types of self-intersections.
7897                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7898                     vertex/face and edge/face intersections. Face/face
7899                     intersections detection is switched off as it is a
7900                     time-consuming operation that gives an impact on performance.
7901                     To find all self-intersections please use
7902                     CheckSelfIntersections() method.
7903
7904             Returns:
7905                 New GEOM.GEOM_Object, containing the result shape.
7906
7907             """
7908             # Example: see GEOM_TestOthers.py
7909             # note: auto-publishing is done in self.MakeBoolean()
7910             return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7911
7912         ## Perform Fuse boolean operation on two given shapes.
7913         #  @param theShape1 First argument for boolean operation.
7914         #  @param theShape2 Second argument for boolean operation.
7915         #  @param checkSelfInte The flag that tells if the arguments should
7916         #         be checked for self-intersection prior to the operation.
7917         #  @param rmExtraEdges The flag that tells if Remove Extra Edges
7918         #         operation should be performed during the operation.
7919         #  @param theName Object name; when specified, this parameter is used
7920         #         for result publication in the study. Otherwise, if automatic
7921         #         publication is switched on, default value is used for result name.
7922         #
7923         #  @note This algorithm doesn't find all types of self-intersections.
7924         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7925         #        vertex/face and edge/face intersections. Face/face
7926         #        intersections detection is switched off as it is a
7927         #        time-consuming operation that gives an impact on performance.
7928         #        To find all self-intersections please use
7929         #        CheckSelfIntersections() method.
7930         #
7931         #  @return New GEOM.GEOM_Object, containing the result shape.
7932         #
7933         #  @ref tui_fuse "Example 1"
7934         #  \n @ref swig_MakeCommon "Example 2"
7935         @ManageTransactions("BoolOp")
7936         def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7937                      rmExtraEdges=False, theName=None):
7938             """
7939             Perform Fuse boolean operation on two given shapes.
7940
7941             Parameters:
7942                 theShape1 First argument for boolean operation.
7943                 theShape2 Second argument for boolean operation.
7944                 checkSelfInte The flag that tells if the arguments should
7945                               be checked for self-intersection prior to
7946                               the operation.
7947                 rmExtraEdges The flag that tells if Remove Extra Edges
7948                              operation should be performed during the operation.
7949                 theName Object name; when specified, this parameter is used
7950                         for result publication in the study. Otherwise, if automatic
7951                         publication is switched on, default value is used for result name.
7952
7953             Note:
7954                     This algorithm doesn't find all types of self-intersections.
7955                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7956                     vertex/face and edge/face intersections. Face/face
7957                     intersections detection is switched off as it is a
7958                     time-consuming operation that gives an impact on performance.
7959                     To find all self-intersections please use
7960                     CheckSelfIntersections() method.
7961
7962             Returns:
7963                 New GEOM.GEOM_Object, containing the result shape.
7964
7965             """
7966             # Example: see GEOM_TestOthers.py
7967             anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7968                                          checkSelfInte, rmExtraEdges)
7969             RaiseIfFailed("MakeFuse", self.BoolOp)
7970             self._autoPublish(anObj, theName, "fuse")
7971             return anObj
7972
7973         ## Perform Section boolean operation on two given shapes.
7974         #  @param theShape1 First argument for boolean operation.
7975         #  @param theShape2 Second argument for boolean operation.
7976         #  @param checkSelfInte The flag that tells if the arguments should
7977         #         be checked for self-intersection prior to the operation.
7978         #         If a self-intersection detected the operation fails.
7979         #  @param theName Object name; when specified, this parameter is used
7980         #         for result publication in the study. Otherwise, if automatic
7981         #         publication is switched on, default value is used for result name.
7982         #  @return New GEOM.GEOM_Object, containing the result shape.
7983         #
7984         #  @ref tui_section "Example 1"
7985         #  \n @ref swig_MakeCommon "Example 2"
7986         def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7987             """
7988             Perform Section boolean operation on two given shapes.
7989
7990             Parameters:
7991                 theShape1 First argument for boolean operation.
7992                 theShape2 Second argument for boolean operation.
7993                 checkSelfInte The flag that tells if the arguments should
7994                               be checked for self-intersection prior to the operation.
7995                               If a self-intersection detected the operation fails.
7996                 theName Object name; when specified, this parameter is used
7997                         for result publication in the study. Otherwise, if automatic
7998                         publication is switched on, default value is used for result name.
7999             Returns:
8000                 New GEOM.GEOM_Object, containing the result shape.
8001
8002             """
8003             # Example: see GEOM_TestOthers.py
8004             # note: auto-publishing is done in self.MakeBoolean()
8005             return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
8006
8007         ## Perform Fuse boolean operation on the list of shapes.
8008         #  @param theShapesList Shapes to be fused.
8009         #  @param checkSelfInte The flag that tells if the arguments should
8010         #         be checked for self-intersection prior to the operation.
8011         #  @param rmExtraEdges The flag that tells if Remove Extra Edges
8012         #         operation should be performed during the operation.
8013         #  @param theName Object name; when specified, this parameter is used
8014         #         for result publication in the study. Otherwise, if automatic
8015         #         publication is switched on, default value is used for result name.
8016         #
8017         #  @note This algorithm doesn't find all types of self-intersections.
8018         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8019         #        vertex/face and edge/face intersections. Face/face
8020         #        intersections detection is switched off as it is a
8021         #        time-consuming operation that gives an impact on performance.
8022         #        To find all self-intersections please use
8023         #        CheckSelfIntersections() method.
8024         #
8025         #  @return New GEOM.GEOM_Object, containing the result shape.
8026         #
8027         #  @ref tui_fuse "Example 1"
8028         #  \n @ref swig_MakeCommon "Example 2"
8029         @ManageTransactions("BoolOp")
8030         def MakeFuseList(self, theShapesList, checkSelfInte=False,
8031                          rmExtraEdges=False, theName=None):
8032             """
8033             Perform Fuse boolean operation on the list of shapes.
8034
8035             Parameters:
8036                 theShapesList Shapes to be fused.
8037                 checkSelfInte The flag that tells if the arguments should
8038                               be checked for self-intersection prior to
8039                               the operation.
8040                 rmExtraEdges The flag that tells if Remove Extra Edges
8041                              operation should be performed during the operation.
8042                 theName Object name; when specified, this parameter is used
8043                         for result publication in the study. Otherwise, if automatic
8044                         publication is switched on, default value is used for result name.
8045
8046             Note:
8047                     This algorithm doesn't find all types of self-intersections.
8048                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8049                     vertex/face and edge/face intersections. Face/face
8050                     intersections detection is switched off as it is a
8051                     time-consuming operation that gives an impact on performance.
8052                     To find all self-intersections please use
8053                     CheckSelfIntersections() method.
8054
8055             Returns:
8056                 New GEOM.GEOM_Object, containing the result shape.
8057
8058             """
8059             # Example: see GEOM_TestOthers.py
8060             anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
8061                                              rmExtraEdges)
8062             RaiseIfFailed("MakeFuseList", self.BoolOp)
8063             self._autoPublish(anObj, theName, "fuse")
8064             return anObj
8065
8066         ## Perform Common boolean operation on the list of shapes.
8067         #  @param theShapesList Shapes for Common operation.
8068         #  @param checkSelfInte The flag that tells if the arguments should
8069         #         be checked for self-intersection prior to the operation.
8070         #  @param theName Object name; when specified, this parameter is used
8071         #         for result publication in the study. Otherwise, if automatic
8072         #         publication is switched on, default value is used for result name.
8073         #
8074         #  @note This algorithm doesn't find all types of self-intersections.
8075         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8076         #        vertex/face and edge/face intersections. Face/face
8077         #        intersections detection is switched off as it is a
8078         #        time-consuming operation that gives an impact on performance.
8079         #        To find all self-intersections please use
8080         #        CheckSelfIntersections() method.
8081         #
8082         #  @return New GEOM.GEOM_Object, containing the result shape.
8083         #
8084         #  @ref tui_common "Example 1"
8085         #  \n @ref swig_MakeCommon "Example 2"
8086         @ManageTransactions("BoolOp")
8087         def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
8088             """
8089             Perform Common boolean operation on the list of shapes.
8090
8091             Parameters:
8092                 theShapesList Shapes for Common operation.
8093                 checkSelfInte The flag that tells if the arguments should
8094                               be checked for self-intersection prior to
8095                               the operation.
8096                 theName Object name; when specified, this parameter is used
8097                         for result publication in the study. Otherwise, if automatic
8098                         publication is switched on, default value is used for result name.
8099
8100             Note:
8101                     This algorithm doesn't find all types of self-intersections.
8102                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8103                     vertex/face and edge/face intersections. Face/face
8104                     intersections detection is switched off as it is a
8105                     time-consuming operation that gives an impact on performance.
8106                     To find all self-intersections please use
8107                     CheckSelfIntersections() method.
8108
8109             Returns:
8110                 New GEOM.GEOM_Object, containing the result shape.
8111
8112             """
8113             # Example: see GEOM_TestOthers.py
8114             anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
8115             RaiseIfFailed("MakeCommonList", self.BoolOp)
8116             self._autoPublish(anObj, theName, "common")
8117             return anObj
8118
8119         ## Perform Cut boolean operation on one object and the list of tools.
8120         #  @param theMainShape The object of the operation.
8121         #  @param theShapesList The list of tools of the operation.
8122         #  @param checkSelfInte The flag that tells if the arguments should
8123         #         be checked for self-intersection prior to the operation.
8124         #  @param theName Object name; when specified, this parameter is used
8125         #         for result publication in the study. Otherwise, if automatic
8126         #         publication is switched on, default value is used for result name.
8127         #
8128         #  @note This algorithm doesn't find all types of self-intersections.
8129         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8130         #        vertex/face and edge/face intersections. Face/face
8131         #        intersections detection is switched off as it is a
8132         #        time-consuming operation that gives an impact on performance.
8133         #        To find all self-intersections please use
8134         #        CheckSelfIntersections() method.
8135         #
8136         #  @return New GEOM.GEOM_Object, containing the result shape.
8137         #
8138         #  @ref tui_cut "Example 1"
8139         #  \n @ref swig_MakeCommon "Example 2"
8140         @ManageTransactions("BoolOp")
8141         def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
8142             """
8143             Perform Cut boolean operation on one object and the list of tools.
8144
8145             Parameters:
8146                 theMainShape The object of the operation.
8147                 theShapesList The list of tools of the operation.
8148                 checkSelfInte The flag that tells if the arguments should
8149                               be checked for self-intersection prior to
8150                               the operation.
8151                 theName Object name; when specified, this parameter is used
8152                         for result publication in the study. Otherwise, if automatic
8153                         publication is switched on, default value is used for result name.
8154
8155             Note:
8156                     This algorithm doesn't find all types of self-intersections.
8157                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8158                     vertex/face and edge/face intersections. Face/face
8159                     intersections detection is switched off as it is a
8160                     time-consuming operation that gives an impact on performance.
8161                     To find all self-intersections please use
8162                     CheckSelfIntersections() method.
8163
8164             Returns:
8165                 New GEOM.GEOM_Object, containing the result shape.
8166
8167             """
8168             # Example: see GEOM_TestOthers.py
8169             anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
8170             RaiseIfFailed("MakeCutList", self.BoolOp)
8171             self._autoPublish(anObj, theName, "cut")
8172             return anObj
8173
8174         # end of l3_boolean
8175         ## @}
8176
8177         ## @addtogroup l3_basic_op
8178         ## @{
8179
8180         ## Perform partition operation.
8181         #  @param ListShapes Shapes to be intersected.
8182         #  @param ListTools Shapes to intersect theShapes.
8183         #  @param Limit Type of resulting shapes (see ShapeType()).\n
8184         #         If this parameter is set to -1 ("Auto"), most appropriate shape limit
8185         #         type will be detected automatically.
8186         #  @param KeepNonlimitShapes if this parameter == 0, then only shapes of
8187         #                             target type (equal to Limit) are kept in the result,
8188         #                             else standalone shapes of lower dimension
8189         #                             are kept also (if they exist).
8190         #
8191         #  @param theName Object name; when specified, this parameter is used
8192         #         for result publication in the study. Otherwise, if automatic
8193         #         publication is switched on, default value is used for result name.
8194         #
8195         #  @note Each compound from ListShapes and ListTools will be exploded
8196         #        in order to avoid possible intersection between shapes from this compound.
8197         #
8198         #  After implementation new version of PartitionAlgo (October 2006)
8199         #  other parameters are ignored by current functionality. They are kept
8200         #  in this function only for support old versions.
8201         #      @param ListKeepInside Shapes, outside which the results will be deleted.
8202         #         Each shape from theKeepInside must belong to theShapes also.
8203         #      @param ListRemoveInside Shapes, inside which the results will be deleted.
8204         #         Each shape from theRemoveInside must belong to theShapes also.
8205         #      @param RemoveWebs If TRUE, perform Glue 3D algorithm.
8206         #      @param ListMaterials Material indices for each shape. Make sense,
8207         #         only if theRemoveWebs is TRUE.
8208         #
8209         #  @return New GEOM.GEOM_Object, containing the result shapes.
8210         #
8211         #  @ref tui_partition "Example"
8212         @ManageTransactions("BoolOp")
8213         def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8214                           Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8215                           KeepNonlimitShapes=0, theName=None):
8216             """
8217             Perform partition operation.
8218
8219             Parameters:
8220                 ListShapes Shapes to be intersected.
8221                 ListTools Shapes to intersect theShapes.
8222                 Limit Type of resulting shapes (see geompy.ShapeType)
8223                       If this parameter is set to -1 ("Auto"), most appropriate shape limit
8224                       type will be detected automatically.
8225                 KeepNonlimitShapes if this parameter == 0, then only shapes of
8226                                     target type (equal to Limit) are kept in the result,
8227                                     else standalone shapes of lower dimension
8228                                     are kept also (if they exist).
8229
8230                 theName Object name; when specified, this parameter is used
8231                         for result publication in the study. Otherwise, if automatic
8232                         publication is switched on, default value is used for result name.
8233             Note:
8234                     Each compound from ListShapes and ListTools will be exploded
8235                     in order to avoid possible intersection between shapes from
8236                     this compound.
8237
8238             After implementation new version of PartitionAlgo (October 2006) other
8239             parameters are ignored by current functionality. They are kept in this
8240             function only for support old versions.
8241
8242             Ignored parameters:
8243                 ListKeepInside Shapes, outside which the results will be deleted.
8244                                Each shape from theKeepInside must belong to theShapes also.
8245                 ListRemoveInside Shapes, inside which the results will be deleted.
8246                                  Each shape from theRemoveInside must belong to theShapes also.
8247                 RemoveWebs If TRUE, perform Glue 3D algorithm.
8248                 ListMaterials Material indices for each shape. Make sense, only if theRemoveWebs is TRUE.
8249
8250             Returns:
8251                 New GEOM.GEOM_Object, containing the result shapes.
8252             """
8253             # Example: see GEOM_TestAll.py
8254             if Limit == self.ShapeType["AUTO"]:
8255                 # automatic detection of the most appropriate shape limit type
8256                 lim = GEOM.SHAPE
8257                 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8258                 Limit = EnumToLong(lim)
8259                 pass
8260             anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8261                                               ListKeepInside, ListRemoveInside,
8262                                               Limit, RemoveWebs, ListMaterials,
8263                                               KeepNonlimitShapes);
8264             RaiseIfFailed("MakePartition", self.BoolOp)
8265             self._autoPublish(anObj, theName, "partition")
8266             return anObj
8267
8268         ## Perform partition operation.
8269         #  This method may be useful if it is needed to make a partition for
8270         #  compound contains nonintersected shapes. Performance will be better
8271         #  since intersection between shapes from compound is not performed.
8272         #
8273         #  Description of all parameters as in previous method MakePartition().
8274         #  One additional parameter is provided:
8275         #  @param checkSelfInte The flag that tells if the arguments should
8276         #         be checked for self-intersection prior to the operation.
8277         #
8278         #  @note This algorithm doesn't find all types of self-intersections.
8279         #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8280         #        vertex/face and edge/face intersections. Face/face
8281         #        intersections detection is switched off as it is a
8282         #        time-consuming operation that gives an impact on performance.
8283         #        To find all self-intersections please use
8284         #        CheckSelfIntersections() method.
8285         #
8286         #  @note Passed compounds (via ListShapes or via ListTools)
8287         #           have to consist of nonintersecting shapes.
8288         #
8289         #  @return New GEOM.GEOM_Object, containing the result shapes.
8290         #
8291         #  @ref swig_todo "Example"
8292         @ManageTransactions("BoolOp")
8293         def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8294                                                  ListKeepInside=[], ListRemoveInside=[],
8295                                                  Limit=ShapeType["AUTO"], RemoveWebs=0,
8296                                                  ListMaterials=[], KeepNonlimitShapes=0,
8297                                                  checkSelfInte=False, theName=None):
8298             """
8299             Perform partition operation.
8300             This method may be useful if it is needed to make a partition for
8301             compound contains nonintersected shapes. Performance will be better
8302             since intersection between shapes from compound is not performed.
8303
8304             Parameters:
8305                 Description of all parameters as in method geompy.MakePartition.
8306                 One additional parameter is provided:
8307                 checkSelfInte The flag that tells if the arguments should
8308                               be checked for self-intersection prior to
8309                               the operation.
8310
8311             Note:
8312                     This algorithm doesn't find all types of self-intersections.
8313                     It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8314                     vertex/face and edge/face intersections. Face/face
8315                     intersections detection is switched off as it is a
8316                     time-consuming operation that gives an impact on performance.
8317                     To find all self-intersections please use
8318                     CheckSelfIntersections() method.
8319
8320             NOTE:
8321                 Passed compounds (via ListShapes or via ListTools)
8322                 have to consist of nonintersecting shapes.
8323
8324             Returns:
8325                 New GEOM.GEOM_Object, containing the result shapes.
8326             """
8327             if Limit == self.ShapeType["AUTO"]:
8328                 # automatic detection of the most appropriate shape limit type
8329                 lim = GEOM.SHAPE
8330                 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8331                 Limit = EnumToLong(lim)
8332                 pass
8333             anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8334                                                                      ListKeepInside, ListRemoveInside,
8335                                                                      Limit, RemoveWebs, ListMaterials,
8336                                                                      KeepNonlimitShapes, checkSelfInte);
8337             RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8338             self._autoPublish(anObj, theName, "partition")
8339             return anObj
8340
8341         ## See method MakePartition() for more information.
8342         #
8343         #  @ref tui_partition "Example 1"
8344         #  \n @ref swig_Partition "Example 2"
8345         def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8346                       Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8347                       KeepNonlimitShapes=0, theName=None):
8348             """
8349             See method geompy.MakePartition for more information.
8350             """
8351             # Example: see GEOM_TestOthers.py
8352             # note: auto-publishing is done in self.MakePartition()
8353             anObj = self.MakePartition(ListShapes, ListTools,
8354                                        ListKeepInside, ListRemoveInside,
8355                                        Limit, RemoveWebs, ListMaterials,
8356                                        KeepNonlimitShapes, theName);
8357             return anObj
8358
8359         ## Perform partition of the Shape with the Plane
8360         #  @param theShape Shape to be intersected.
8361         #  @param thePlane Tool shape, to intersect theShape.
8362         #  @param theName Object name; when specified, this parameter is used
8363         #         for result publication in the study. Otherwise, if automatic
8364         #         publication is switched on, default value is used for result name.
8365         #
8366         #  @return New GEOM.GEOM_Object, containing the result shape.
8367         #
8368         #  @note This operation is a shortcut to the more general @ref MakePartition
8369         #  operation, where @a theShape specifies single "object" (shape being partitioned)
8370         #  and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8371         #  @ref MakePartition operation have default values:
8372         #  - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8373         #  - @a KeepNonlimitShapes: 0
8374         #  - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8375         #    @a Materials (obsolete parameters): empty
8376         #
8377         #  @note I.e. the following two operations are equivalent:
8378         #  @code
8379         #  Result = geompy.MakeHalfPartition(Object, Plane)
8380         #  Result = geompy.MakePartition([Object], [Plane])
8381         #  @endcode
8382         #
8383         #  @sa MakePartition, MakePartitionNonSelfIntersectedShape
8384         #
8385         #  @ref tui_partition "Example"
8386         @ManageTransactions("BoolOp")
8387         def MakeHalfPartition(self, theShape, thePlane, theName=None):
8388             """
8389             Perform partition of the Shape with the Plane
8390
8391             Parameters:
8392                 theShape Shape to be intersected.
8393                 thePlane Tool shape, to intersect theShape.
8394                 theName Object name; when specified, this parameter is used
8395                         for result publication in the study. Otherwise, if automatic
8396                         publication is switched on, default value is used for result name.
8397
8398             Returns:
8399                 New GEOM.GEOM_Object, containing the result shape.
8400          
8401             Note: This operation is a shortcut to the more general MakePartition
8402             operation, where theShape specifies single "object" (shape being partitioned)
8403             and thePlane specifies single "tool" (intersector shape). Other parameters of
8404             MakePartition operation have default values:
8405             - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8406             - KeepNonlimitShapes: 0
8407             - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8408          
8409             I.e. the following two operations are equivalent:
8410               Result = geompy.MakeHalfPartition(Object, Plane)
8411               Result = geompy.MakePartition([Object], [Plane])
8412             """
8413             # Example: see GEOM_TestAll.py
8414             anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8415             RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8416             self._autoPublish(anObj, theName, "partition")
8417             return anObj
8418
8419         # end of l3_basic_op
8420         ## @}
8421
8422         ## @addtogroup l3_transform
8423         ## @{
8424
8425         ## Translate the given object along the vector, specified
8426         #  by its end points.
8427         #  @param theObject The object to be translated.
8428         #  @param thePoint1 Start point of translation vector.
8429         #  @param thePoint2 End point of translation vector.
8430         #  @param theCopy Flag used to translate object itself or create a copy.
8431         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8432         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8433         @ManageTransactions("TrsfOp")
8434         def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8435             """
8436             Translate the given object along the vector, specified by its end points.
8437
8438             Parameters:
8439                 theObject The object to be translated.
8440                 thePoint1 Start point of translation vector.
8441                 thePoint2 End point of translation vector.
8442                 theCopy Flag used to translate object itself or create a copy.
8443
8444             Returns:
8445                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8446                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8447             """
8448             if theCopy:
8449                 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8450             else:
8451                 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8452             RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8453             return anObj
8454
8455         ## Translate the given object along the vector, specified
8456         #  by its end points, creating its copy before the translation.
8457         #  @param theObject The object to be translated.
8458         #  @param thePoint1 Start point of translation vector.
8459         #  @param thePoint2 End point of translation vector.
8460         #  @param theName Object name; when specified, this parameter is used
8461         #         for result publication in the study. Otherwise, if automatic
8462         #         publication is switched on, default value is used for result name.
8463         #
8464         #  @return New GEOM.GEOM_Object, containing the translated object.
8465         #
8466         #  @ref tui_translation "Example 1"
8467         #  \n @ref swig_MakeTranslationTwoPoints "Example 2"
8468         @ManageTransactions("TrsfOp")
8469         def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8470             """
8471             Translate the given object along the vector, specified
8472             by its end points, creating its copy before the translation.
8473
8474             Parameters:
8475                 theObject The object to be translated.
8476                 thePoint1 Start point of translation vector.
8477                 thePoint2 End point of translation vector.
8478                 theName Object name; when specified, this parameter is used
8479                         for result publication in the study. Otherwise, if automatic
8480                         publication is switched on, default value is used for result name.
8481
8482             Returns:
8483                 New GEOM.GEOM_Object, containing the translated object.
8484             """
8485             # Example: see GEOM_TestAll.py
8486             anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8487             RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8488             self._autoPublish(anObj, theName, "translated")
8489             return anObj
8490
8491         ## Translate the given object along the vector, specified by its components.
8492         #  @param theObject The object to be translated.
8493         #  @param theDX,theDY,theDZ Components of translation vector.
8494         #  @param theCopy Flag used to translate object itself or create a copy.
8495         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8496         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8497         #
8498         #  @ref tui_translation "Example"
8499         @ManageTransactions("TrsfOp")
8500         def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8501             """
8502             Translate the given object along the vector, specified by its components.
8503
8504             Parameters:
8505                 theObject The object to be translated.
8506                 theDX,theDY,theDZ Components of translation vector.
8507                 theCopy Flag used to translate object itself or create a copy.
8508
8509             Returns:
8510                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8511                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8512             """
8513             # Example: see GEOM_TestAll.py
8514             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8515             if theCopy:
8516                 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8517             else:
8518                 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8519             anObj.SetParameters(Parameters)
8520             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8521             return anObj
8522
8523         ## Translate the given object along the vector, specified
8524         #  by its components, creating its copy before the translation.
8525         #  @param theObject The object to be translated.
8526         #  @param theDX,theDY,theDZ Components of translation vector.
8527         #  @param theName Object name; when specified, this parameter is used
8528         #         for result publication in the study. Otherwise, if automatic
8529         #         publication is switched on, default value is used for result name.
8530         #
8531         #  @return New GEOM.GEOM_Object, containing the translated object.
8532         #
8533         #  @ref tui_translation "Example"
8534         @ManageTransactions("TrsfOp")
8535         def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8536             """
8537             Translate the given object along the vector, specified
8538             by its components, creating its copy before the translation.
8539
8540             Parameters:
8541                 theObject The object to be translated.
8542                 theDX,theDY,theDZ Components of translation vector.
8543                 theName Object name; when specified, this parameter is used
8544                         for result publication in the study. Otherwise, if automatic
8545                         publication is switched on, default value is used for result name.
8546
8547             Returns:
8548                 New GEOM.GEOM_Object, containing the translated object.
8549             """
8550             # Example: see GEOM_TestAll.py
8551             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8552             anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8553             anObj.SetParameters(Parameters)
8554             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8555             self._autoPublish(anObj, theName, "translated")
8556             return anObj
8557
8558         ## Translate the given object along the given vector.
8559         #  @param theObject The object to be translated.
8560         #  @param theVector The translation vector.
8561         #  @param theCopy Flag used to translate object itself or create a copy.
8562         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8563         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8564         @ManageTransactions("TrsfOp")
8565         def TranslateVector(self, theObject, theVector, theCopy=False):
8566             """
8567             Translate the given object along the given vector.
8568
8569             Parameters:
8570                 theObject The object to be translated.
8571                 theVector The translation vector.
8572                 theCopy Flag used to translate object itself or create a copy.
8573
8574             Returns:
8575                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8576                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8577             """
8578             if theCopy:
8579                 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8580             else:
8581                 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8582             RaiseIfFailed("TranslateVector", self.TrsfOp)
8583             return anObj
8584
8585         ## Translate the given object along the given vector,
8586         #  creating its copy before the translation.
8587         #  @param theObject The object to be translated.
8588         #  @param theVector The translation vector.
8589         #  @param theName Object name; when specified, this parameter is used
8590         #         for result publication in the study. Otherwise, if automatic
8591         #         publication is switched on, default value is used for result name.
8592         #
8593         #  @return New GEOM.GEOM_Object, containing the translated object.
8594         #
8595         #  @ref tui_translation "Example"
8596         @ManageTransactions("TrsfOp")
8597         def MakeTranslationVector(self, theObject, theVector, theName=None):
8598             """
8599             Translate the given object along the given vector,
8600             creating its copy before the translation.
8601
8602             Parameters:
8603                 theObject The object to be translated.
8604                 theVector The translation vector.
8605                 theName Object name; when specified, this parameter is used
8606                         for result publication in the study. Otherwise, if automatic
8607                         publication is switched on, default value is used for result name.
8608
8609             Returns:
8610                 New GEOM.GEOM_Object, containing the translated object.
8611             """
8612             # Example: see GEOM_TestAll.py
8613             anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8614             RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8615             self._autoPublish(anObj, theName, "translated")
8616             return anObj
8617
8618         ## Translate the given object along the given vector on given distance.
8619         #  @param theObject The object to be translated.
8620         #  @param theVector The translation vector.
8621         #  @param theDistance The translation distance.
8622         #  @param theCopy Flag used to translate object itself or create a copy.
8623         #  @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8624         #  new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8625         #
8626         #  @ref tui_translation "Example"
8627         @ManageTransactions("TrsfOp")
8628         def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8629             """
8630             Translate the given object along the given vector on given distance.
8631
8632             Parameters:
8633                 theObject The object to be translated.
8634                 theVector The translation vector.
8635                 theDistance The translation distance.
8636                 theCopy Flag used to translate object itself or create a copy.
8637
8638             Returns:
8639                 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8640                 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8641             """
8642             # Example: see GEOM_TestAll.py
8643             theDistance,Parameters = ParseParameters(theDistance)
8644             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8645             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8646             anObj.SetParameters(Parameters)
8647             return anObj
8648
8649         ## Translate the given object along the given vector on given distance,
8650         #  creating its copy before the translation.
8651         #  @param theObject The object to be translated.
8652         #  @param theVector The translation vector.
8653         #  @param theDistance The translation distance.
8654         #  @param theName Object name; when specified, this parameter is used
8655         #         for result publication in the study. Otherwise, if automatic
8656         #         publication is switched on, default value is used for result name.
8657         #
8658         #  @return New GEOM.GEOM_Object, containing the translated object.
8659         #
8660         #  @ref tui_translation "Example"
8661         @ManageTransactions("TrsfOp")
8662         def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8663             """
8664             Translate the given object along the given vector on given distance,
8665             creating its copy before the translation.
8666
8667             Parameters:
8668                 theObject The object to be translated.
8669                 theVector The translation vector.
8670                 theDistance The translation distance.
8671                 theName Object name; when specified, this parameter is used
8672                         for result publication in the study. Otherwise, if automatic
8673                         publication is switched on, default value is used for result name.
8674
8675             Returns:
8676                 New GEOM.GEOM_Object, containing the translated object.
8677             """
8678             # Example: see GEOM_TestAll.py
8679             theDistance,Parameters = ParseParameters(theDistance)
8680             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8681             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8682             anObj.SetParameters(Parameters)
8683             self._autoPublish(anObj, theName, "translated")
8684             return anObj
8685
8686         ## Rotate the given object around the given axis on the given angle.
8687         #  @param theObject The object to be rotated.
8688         #  @param theAxis Rotation axis.
8689         #  @param theAngle Rotation angle in radians.
8690         #  @param theCopy Flag used to rotate object itself or create a copy.
8691         #
8692         #  @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8693         #  new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8694         #
8695         #  @ref tui_rotation "Example"
8696         @ManageTransactions("TrsfOp")
8697         def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8698             """
8699             Rotate the given object around the given axis on the given angle.
8700
8701             Parameters:
8702                 theObject The object to be rotated.
8703                 theAxis Rotation axis.
8704                 theAngle Rotation angle in radians.
8705                 theCopy Flag used to rotate object itself or create a copy.
8706
8707             Returns:
8708                 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8709                 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8710             """
8711             # Example: see GEOM_TestAll.py
8712             flag = False
8713             if isinstance(theAngle,str):
8714                 flag = True
8715             theAngle, Parameters = ParseParameters(theAngle)
8716             if flag:
8717                 theAngle = theAngle*math.pi/180.0
8718             if theCopy:
8719                 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8720             else:
8721                 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8722             RaiseIfFailed("Rotate", self.TrsfOp)
8723             anObj.SetParameters(Parameters)
8724             return anObj
8725
8726         ## Rotate the given object around the given axis
8727         #  on the given angle, creating its copy before the rotation.
8728         #  @param theObject The object to be rotated.
8729         #  @param theAxis Rotation axis.
8730         #  @param theAngle Rotation angle in radians.
8731         #  @param theName Object name; when specified, this parameter is used
8732         #         for result publication in the study. Otherwise, if automatic
8733         #         publication is switched on, default value is used for result name.
8734         #
8735         #  @return New GEOM.GEOM_Object, containing the rotated object.
8736         #
8737         #  @ref tui_rotation "Example"
8738         @ManageTransactions("TrsfOp")
8739         def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8740             """
8741             Rotate the given object around the given axis
8742             on the given angle, creating its copy before the rotatation.
8743
8744             Parameters:
8745                 theObject The object to be rotated.
8746                 theAxis Rotation axis.
8747                 theAngle Rotation angle in radians.
8748                 theName Object name; when specified, this parameter is used
8749                         for result publication in the study. Otherwise, if automatic
8750                         publication is switched on, default value is used for result name.
8751
8752             Returns:
8753                 New GEOM.GEOM_Object, containing the rotated object.
8754             """
8755             # Example: see GEOM_TestAll.py
8756             flag = False
8757             if isinstance(theAngle,str):
8758                 flag = True
8759             theAngle, Parameters = ParseParameters(theAngle)
8760             if flag:
8761                 theAngle = theAngle*math.pi/180.0
8762             anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8763             RaiseIfFailed("RotateCopy", self.TrsfOp)
8764             anObj.SetParameters(Parameters)
8765             self._autoPublish(anObj, theName, "rotated")
8766             return anObj
8767
8768         ## Rotate given object around vector perpendicular to plane
8769         #  containing three points.
8770         #  @param theObject The object to be rotated.
8771         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
8772         #  containing the three points.
8773         #  @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8774         #  @param theCopy Flag used to rotate object itself or create a copy.
8775         #  @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8776         #  new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8777         @ManageTransactions("TrsfOp")
8778         def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8779             """
8780             Rotate given object around vector perpendicular to plane
8781             containing three points.
8782
8783             Parameters:
8784                 theObject The object to be rotated.
8785                 theCentPoint central point  the axis is the vector perpendicular to the plane
8786                              containing the three points.
8787                 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8788                 theCopy Flag used to rotate object itself or create a copy.
8789
8790             Returns:
8791                 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8792                 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8793             """
8794             if theCopy:
8795                 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8796             else:
8797                 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8798             RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8799             return anObj
8800
8801         ## Rotate given object around vector perpendicular to plane
8802         #  containing three points, creating its copy before the rotatation.
8803         #  @param theObject The object to be rotated.
8804         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
8805         #  containing the three points.
8806         #  @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8807         #  @param theName Object name; when specified, this parameter is used
8808         #         for result publication in the study. Otherwise, if automatic
8809         #         publication is switched on, default value is used for result name.
8810         #
8811         #  @return New GEOM.GEOM_Object, containing the rotated object.
8812         #
8813         #  @ref tui_rotation "Example"
8814         @ManageTransactions("TrsfOp")
8815         def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8816             """
8817             Rotate given object around vector perpendicular to plane
8818             containing three points, creating its copy before the rotatation.
8819
8820             Parameters:
8821                 theObject The object to be rotated.
8822                 theCentPoint central point  the axis is the vector perpendicular to the plane
8823                              containing the three points.
8824                 thePoint1,thePoint2  in a perpendicular plane of the axis.
8825                 theName Object name; when specified, this parameter is used
8826                         for result publication in the study. Otherwise, if automatic
8827                         publication is switched on, default value is used for result name.
8828
8829             Returns:
8830                 New GEOM.GEOM_Object, containing the rotated object.
8831             """
8832             # Example: see GEOM_TestAll.py
8833             anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8834             RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8835             self._autoPublish(anObj, theName, "rotated")
8836             return anObj
8837
8838         ## Scale the given object by the specified factor.
8839         #  @param theObject The object to be scaled.
8840         #  @param thePoint Center point for scaling.
8841         #                  Passing None for it means scaling relatively the origin of global CS.
8842         #  @param theFactor Scaling factor value.
8843         #  @param theCopy Flag used to scale object itself or create a copy.
8844         #  @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8845         #  new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8846         @ManageTransactions("TrsfOp")
8847         def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8848             """
8849             Scale the given object by the specified factor.
8850
8851             Parameters:
8852                 theObject The object to be scaled.
8853                 thePoint Center point for scaling.
8854                          Passing None for it means scaling relatively the origin of global CS.
8855                 theFactor Scaling factor value.
8856                 theCopy Flag used to scale object itself or create a copy.
8857
8858             Returns:
8859                 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8860                 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8861             """
8862             # Example: see GEOM_TestAll.py
8863             theFactor, Parameters = ParseParameters(theFactor)
8864             if theCopy:
8865                 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8866             else:
8867                 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8868             RaiseIfFailed("Scale", self.TrsfOp)
8869             anObj.SetParameters(Parameters)
8870             return anObj
8871
8872         ## Scale the given object by the factor, creating its copy before the scaling.
8873         #  @param theObject The object to be scaled.
8874         #  @param thePoint Center point for scaling.
8875         #                  Passing None for it means scaling relatively the origin of global CS.
8876         #  @param theFactor Scaling factor value.
8877         #  @param theName Object name; when specified, this parameter is used
8878         #         for result publication in the study. Otherwise, if automatic
8879         #         publication is switched on, default value is used for result name.
8880         #
8881         #  @return New GEOM.GEOM_Object, containing the scaled shape.
8882         #
8883         #  @ref tui_scale "Example"
8884         @ManageTransactions("TrsfOp")
8885         def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8886             """
8887             Scale the given object by the factor, creating its copy before the scaling.
8888
8889             Parameters:
8890                 theObject The object to be scaled.
8891                 thePoint Center point for scaling.
8892                          Passing None for it means scaling relatively the origin of global CS.
8893                 theFactor Scaling factor value.
8894                 theName Object name; when specified, this parameter is used
8895                         for result publication in the study. Otherwise, if automatic
8896                         publication is switched on, default value is used for result name.
8897
8898             Returns:
8899                 New GEOM.GEOM_Object, containing the scaled shape.
8900             """
8901             # Example: see GEOM_TestAll.py
8902             theFactor, Parameters = ParseParameters(theFactor)
8903             anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8904             RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8905             anObj.SetParameters(Parameters)
8906             self._autoPublish(anObj, theName, "scaled")
8907             return anObj
8908
8909         ## Scale the given object by different factors along coordinate axes.
8910         #  @param theObject The object to be scaled.
8911         #  @param thePoint Center point for scaling.
8912         #                  Passing None for it means scaling relatively the origin of global CS.
8913         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8914         #  @param theCopy Flag used to scale object itself or create a copy.
8915         #  @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8916         #  new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8917         @ManageTransactions("TrsfOp")
8918         def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8919             """
8920             Scale the given object by different factors along coordinate axes.
8921
8922             Parameters:
8923                 theObject The object to be scaled.
8924                 thePoint Center point for scaling.
8925                             Passing None for it means scaling relatively the origin of global CS.
8926                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8927                 theCopy Flag used to scale object itself or create a copy.
8928
8929             Returns:
8930                 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8931                 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8932             """
8933             # Example: see GEOM_TestAll.py
8934             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8935             if theCopy:
8936                 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8937                                                             theFactorX, theFactorY, theFactorZ)
8938             else:
8939                 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8940                                                         theFactorX, theFactorY, theFactorZ)
8941             RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8942             anObj.SetParameters(Parameters)
8943             return anObj
8944
8945         ## Scale the given object by different factors along coordinate axes,
8946         #  creating its copy before the scaling.
8947         #  @param theObject The object to be scaled.
8948         #  @param thePoint Center point for scaling.
8949         #                  Passing None for it means scaling relatively the origin of global CS.
8950         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8951         #  @param theName Object name; when specified, this parameter is used
8952         #         for result publication in the study. Otherwise, if automatic
8953         #         publication is switched on, default value is used for result name.
8954         #
8955         #  @return New GEOM.GEOM_Object, containing the scaled shape.
8956         #
8957         #  @ref swig_scale "Example"
8958         @ManageTransactions("TrsfOp")
8959         def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8960             """
8961             Scale the given object by different factors along coordinate axes,
8962             creating its copy before the scaling.
8963
8964             Parameters:
8965                 theObject The object to be scaled.
8966                 thePoint Center point for scaling.
8967                             Passing None for it means scaling relatively the origin of global CS.
8968                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8969                 theName Object name; when specified, this parameter is used
8970                         for result publication in the study. Otherwise, if automatic
8971                         publication is switched on, default value is used for result name.
8972
8973             Returns:
8974                 New GEOM.GEOM_Object, containing the scaled shape.
8975             """
8976             # Example: see GEOM_TestAll.py
8977             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8978             anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8979                                                         theFactorX, theFactorY, theFactorZ)
8980             RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8981             anObj.SetParameters(Parameters)
8982             self._autoPublish(anObj, theName, "scaled")
8983             return anObj
8984
8985         ## Mirror an object relatively the given plane.
8986         #  @param theObject The object to be mirrored.
8987         #  @param thePlane Plane of symmetry.
8988         #  @param theCopy Flag used to mirror object itself or create a copy.
8989         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8990         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8991         @ManageTransactions("TrsfOp")
8992         def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8993             """
8994             Mirror an object relatively the given plane.
8995
8996             Parameters:
8997                 theObject The object to be mirrored.
8998                 thePlane Plane of symmetry.
8999                 theCopy Flag used to mirror object itself or create a copy.
9000
9001             Returns:
9002                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9003                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9004             """
9005             if theCopy:
9006                 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9007             else:
9008                 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
9009             RaiseIfFailed("MirrorByPlane", self.TrsfOp)
9010             return anObj
9011
9012         ## Create an object, symmetrical
9013         #  to the given one relatively the given plane.
9014         #  @param theObject The object to be mirrored.
9015         #  @param thePlane Plane of symmetry.
9016         #  @param theName Object name; when specified, this parameter is used
9017         #         for result publication in the study. Otherwise, if automatic
9018         #         publication is switched on, default value is used for result name.
9019         #
9020         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
9021         #
9022         #  @ref tui_mirror "Example"
9023         @ManageTransactions("TrsfOp")
9024         def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
9025             """
9026             Create an object, symmetrical to the given one relatively the given plane.
9027
9028             Parameters:
9029                 theObject The object to be mirrored.
9030                 thePlane Plane of symmetry.
9031                 theName Object name; when specified, this parameter is used
9032                         for result publication in the study. Otherwise, if automatic
9033                         publication is switched on, default value is used for result name.
9034
9035             Returns:
9036                 New GEOM.GEOM_Object, containing the mirrored shape.
9037             """
9038             # Example: see GEOM_TestAll.py
9039             anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9040             RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
9041             self._autoPublish(anObj, theName, "mirrored")
9042             return anObj
9043
9044         ## Mirror an object relatively the given axis.
9045         #  @param theObject The object to be mirrored.
9046         #  @param theAxis Axis of symmetry.
9047         #  @param theCopy Flag used to mirror object itself or create a copy.
9048         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9049         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9050         @ManageTransactions("TrsfOp")
9051         def MirrorByAxis(self, theObject, theAxis, theCopy=False):
9052             """
9053             Mirror an object relatively the given axis.
9054
9055             Parameters:
9056                 theObject The object to be mirrored.
9057                 theAxis Axis of symmetry.
9058                 theCopy Flag used to mirror object itself or create a copy.
9059
9060             Returns:
9061                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9062                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9063             """
9064             if theCopy:
9065                 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9066             else:
9067                 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
9068             RaiseIfFailed("MirrorByAxis", self.TrsfOp)
9069             return anObj
9070
9071         ## Create an object, symmetrical
9072         #  to the given one relatively the given axis.
9073         #  @param theObject The object to be mirrored.
9074         #  @param theAxis Axis of symmetry.
9075         #  @param theName Object name; when specified, this parameter is used
9076         #         for result publication in the study. Otherwise, if automatic
9077         #         publication is switched on, default value is used for result name.
9078         #
9079         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
9080         #
9081         #  @ref tui_mirror "Example"
9082         @ManageTransactions("TrsfOp")
9083         def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
9084             """
9085             Create an object, symmetrical to the given one relatively the given axis.
9086
9087             Parameters:
9088                 theObject The object to be mirrored.
9089                 theAxis Axis of symmetry.
9090                 theName Object name; when specified, this parameter is used
9091                         for result publication in the study. Otherwise, if automatic
9092                         publication is switched on, default value is used for result name.
9093
9094             Returns:
9095                 New GEOM.GEOM_Object, containing the mirrored shape.
9096             """
9097             # Example: see GEOM_TestAll.py
9098             anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9099             RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
9100             self._autoPublish(anObj, theName, "mirrored")
9101             return anObj
9102
9103         ## Mirror an object relatively the given point.
9104         #  @param theObject The object to be mirrored.
9105         #  @param thePoint Point of symmetry.
9106         #  @param theCopy Flag used to mirror object itself or create a copy.
9107         #  @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9108         #  new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9109         @ManageTransactions("TrsfOp")
9110         def MirrorByPoint(self, theObject, thePoint, theCopy=False):
9111             """
9112             Mirror an object relatively the given point.
9113
9114             Parameters:
9115                 theObject The object to be mirrored.
9116                 thePoint Point of symmetry.
9117                 theCopy Flag used to mirror object itself or create a copy.
9118
9119             Returns:
9120                 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9121                 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9122             """
9123             # Example: see GEOM_TestAll.py
9124             if theCopy:
9125                 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9126             else:
9127                 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
9128             RaiseIfFailed("MirrorByPoint", self.TrsfOp)
9129             return anObj
9130
9131         ## Create an object, symmetrical
9132         #  to the given one relatively the given point.
9133         #  @param theObject The object to be mirrored.
9134         #  @param thePoint Point of symmetry.
9135         #  @param theName Object name; when specified, this parameter is used
9136         #         for result publication in the study. Otherwise, if automatic
9137         #         publication is switched on, default value is used for result name.
9138         #
9139         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
9140         #
9141         #  @ref tui_mirror "Example"
9142         @ManageTransactions("TrsfOp")
9143         def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
9144             """
9145             Create an object, symmetrical
9146             to the given one relatively the given point.
9147
9148             Parameters:
9149                 theObject The object to be mirrored.
9150                 thePoint Point of symmetry.
9151                 theName Object name; when specified, this parameter is used
9152                         for result publication in the study. Otherwise, if automatic
9153                         publication is switched on, default value is used for result name.
9154
9155             Returns:
9156                 New GEOM.GEOM_Object, containing the mirrored shape.
9157             """
9158             # Example: see GEOM_TestAll.py
9159             anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9160             RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
9161             self._autoPublish(anObj, theName, "mirrored")
9162             return anObj
9163
9164         ## Modify the location of the given object.
9165         #  @param theObject The object to be displaced.
9166         #  @param theStartLCS Coordinate system to perform displacement from it.\n
9167         #                     If \a theStartLCS is NULL, displacement
9168         #                     will be performed from global CS.\n
9169         #                     If \a theObject itself is used as \a theStartLCS,
9170         #                     its location will be changed to \a theEndLCS.
9171         #  @param theEndLCS Coordinate system to perform displacement to it.
9172         #  @param theCopy Flag used to displace object itself or create a copy.
9173         #  @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9174         #  new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
9175         @ManageTransactions("TrsfOp")
9176         def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
9177             """
9178             Modify the Location of the given object by LCS, creating its copy before the setting.
9179
9180             Parameters:
9181                 theObject The object to be displaced.
9182                 theStartLCS Coordinate system to perform displacement from it.
9183                             If theStartLCS is NULL, displacement
9184                             will be performed from global CS.
9185                             If theObject itself is used as theStartLCS,
9186                             its location will be changed to theEndLCS.
9187                 theEndLCS Coordinate system to perform displacement to it.
9188                 theCopy Flag used to displace object itself or create a copy.
9189
9190             Returns:
9191                 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9192                 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
9193             """
9194             # Example: see GEOM_TestAll.py
9195             if theCopy:
9196                 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9197             else:
9198                 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
9199             RaiseIfFailed("Displace", self.TrsfOp)
9200             return anObj
9201
9202         ## Modify the Location of the given object by LCS,
9203         #  creating its copy before the setting.
9204         #  @param theObject The object to be displaced.
9205         #  @param theStartLCS Coordinate system to perform displacement from it.\n
9206         #                     If \a theStartLCS is NULL, displacement
9207         #                     will be performed from global CS.\n
9208         #                     If \a theObject itself is used as \a theStartLCS,
9209         #                     its location will be changed to \a theEndLCS.
9210         #  @param theEndLCS Coordinate system to perform displacement to it.
9211         #  @param theName Object name; when specified, this parameter is used
9212         #         for result publication in the study. Otherwise, if automatic
9213         #         publication is switched on, default value is used for result name.
9214         #
9215         #  @return New GEOM.GEOM_Object, containing the displaced shape.
9216         #
9217         #  @ref tui_modify_location "Example"
9218         @ManageTransactions("TrsfOp")
9219         def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
9220             """
9221             Modify the Location of the given object by LCS, creating its copy before the setting.
9222
9223             Parameters:
9224                 theObject The object to be displaced.
9225                 theStartLCS Coordinate system to perform displacement from it.
9226                             If theStartLCS is NULL, displacement
9227                             will be performed from global CS.
9228                             If theObject itself is used as theStartLCS,
9229                             its location will be changed to theEndLCS.
9230                 theEndLCS Coordinate system to perform displacement to it.
9231                 theName Object name; when specified, this parameter is used
9232                         for result publication in the study. Otherwise, if automatic
9233                         publication is switched on, default value is used for result name.
9234
9235             Returns:
9236                 New GEOM.GEOM_Object, containing the displaced shape.
9237
9238             Example of usage:
9239                 # create local coordinate systems
9240                 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
9241                 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
9242                 # modify the location of the given object
9243                 position = geompy.MakePosition(cylinder, cs1, cs2)
9244             """
9245             # Example: see GEOM_TestAll.py
9246             anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9247             RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
9248             self._autoPublish(anObj, theName, "displaced")
9249             return anObj
9250
9251         ## Modify the Location of the given object by Path.
9252         #  @param  theObject The object to be displaced.
9253         #  @param  thePath Wire or Edge along that the object will be translated.
9254         #  @param  theDistance progress of Path (0 = start location, 1 = end of path location).
9255         #  @param  theCopy is to create a copy objects if true.
9256         #  @param  theReverse  0 - for usual direction, 1 - to reverse path direction.
9257         #  @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9258         #          new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9259         #
9260         #  @ref tui_modify_location "Example"
9261         @ManageTransactions("TrsfOp")
9262         def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9263             """
9264             Modify the Location of the given object by Path.
9265
9266             Parameters:
9267                  theObject The object to be displaced.
9268                  thePath Wire or Edge along that the object will be translated.
9269                  theDistance progress of Path (0 = start location, 1 = end of path location).
9270                  theCopy is to create a copy objects if true.
9271                  theReverse  0 - for usual direction, 1 - to reverse path direction.
9272
9273             Returns:
9274                  Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9275                  new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9276
9277             Example of usage:
9278                 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9279             """
9280             # Example: see GEOM_TestAll.py
9281             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9282             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9283             return anObj
9284
9285         ## Modify the Location of the given object by Path, creating its copy before the operation.
9286         #  @param theObject The object to be displaced.
9287         #  @param thePath Wire or Edge along that the object will be translated.
9288         #  @param theDistance progress of Path (0 = start location, 1 = end of path location).
9289         #  @param theReverse  0 - for usual direction, 1 - to reverse path direction.
9290         #  @param theName Object name; when specified, this parameter is used
9291         #         for result publication in the study. Otherwise, if automatic
9292         #         publication is switched on, default value is used for result name.
9293         #
9294         #  @return New GEOM.GEOM_Object, containing the displaced shape.
9295         @ManageTransactions("TrsfOp")
9296         def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9297             """
9298             Modify the Location of the given object by Path, creating its copy before the operation.
9299
9300             Parameters:
9301                  theObject The object to be displaced.
9302                  thePath Wire or Edge along that the object will be translated.
9303                  theDistance progress of Path (0 = start location, 1 = end of path location).
9304                  theReverse  0 - for usual direction, 1 - to reverse path direction.
9305                  theName Object name; when specified, this parameter is used
9306                          for result publication in the study. Otherwise, if automatic
9307                          publication is switched on, default value is used for result name.
9308
9309             Returns:
9310                 New GEOM.GEOM_Object, containing the displaced shape.
9311             """
9312             # Example: see GEOM_TestAll.py
9313             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9314             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9315             self._autoPublish(anObj, theName, "displaced")
9316             return anObj
9317
9318         ## Offset given shape.
9319         #  @param theObject The base object for the offset.
9320         #  @param theOffset Offset value.
9321         #  @param theCopy Flag used to offset object itself or create a copy.
9322         #  @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9323         #  new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9324         @ManageTransactions("TrsfOp")
9325         def Offset(self, theObject, theOffset, theCopy=False):
9326             """
9327             Offset given shape.
9328
9329             Parameters:
9330                 theObject The base object for the offset.
9331                 theOffset Offset value.
9332                 theCopy Flag used to offset object itself or create a copy.
9333
9334             Returns:
9335                 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9336                 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9337             """
9338             theOffset, Parameters = ParseParameters(theOffset)
9339             if theCopy:
9340                 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset, True)
9341             else:
9342                 anObj = self.TrsfOp.OffsetShape(theObject, theOffset, True)
9343             RaiseIfFailed("Offset", self.TrsfOp)
9344             anObj.SetParameters(Parameters)
9345             return anObj
9346
9347         ## Create new object as offset of the given one. Gap between two adjacent
9348         #  offset surfaces is filled by a pipe.
9349         #  @param theObject The base object for the offset.
9350         #  @param theOffset Offset value.
9351         #  @param theName Object name; when specified, this parameter is used
9352         #         for result publication in the study. Otherwise, if automatic
9353         #         publication is switched on, default value is used for result name.
9354         #
9355         #  @return New GEOM.GEOM_Object, containing the offset object.
9356         #
9357         #  @sa MakeOffsetIntersectionJoin
9358         #  @ref tui_offset "Example"
9359         @ManageTransactions("TrsfOp")
9360         def MakeOffset(self, theObject, theOffset, theName=None):
9361             """
9362             Create new object as offset of the given one. Gap between adjacent
9363             offset surfaces is filled by a pipe.
9364
9365             Parameters:
9366                 theObject The base object for the offset.
9367                 theOffset Offset value.
9368                 theName Object name; when specified, this parameter is used
9369                         for result publication in the study. Otherwise, if automatic
9370                         publication is switched on, default value is used for result name.
9371
9372             Returns:
9373                 New GEOM.GEOM_Object, containing the offset object.
9374
9375             Example of usage:
9376                  box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9377                  # create a new object as offset of the given object
9378                  offset = geompy.MakeOffset(box, 70.)
9379             """
9380             # Example: see GEOM_TestAll.py
9381             theOffset, Parameters = ParseParameters(theOffset)
9382             anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, True )
9383             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9384             anObj.SetParameters(Parameters)
9385             self._autoPublish(anObj, theName, "offset")
9386             return anObj
9387
9388         ## Create new object as offset of the given one. Gap between adjacent
9389         #  offset surfaces is filled by extending and intersecting them.
9390         #  @param theObject The base object for the offset.
9391         #  @param theOffset Offset value.
9392         #  @param theName Object name; when specified, this parameter is used
9393         #         for result publication in the study. Otherwise, if automatic
9394         #         publication is switched on, default value is used for result name.
9395         #
9396         #  @return New GEOM.GEOM_Object, containing the offset object.
9397         #
9398         #  @sa MakeOffset
9399         #  @ref tui_offset "Example"
9400         @ManageTransactions("TrsfOp")
9401         def MakeOffsetIntersectionJoin(self, theObject, theOffset, theName=None):
9402             """
9403             Create new object as offset of the given one. Gap between adjacent
9404             offset surfaces is filled by extending and intersecting them.
9405
9406             Parameters:
9407                 theObject The base object for the offset.
9408                 theOffset Offset value.
9409                 theName Object name; when specified, this parameter is used
9410                         for result publication in the study. Otherwise, if automatic
9411                         publication is switched on, default value is used for result name.
9412
9413             Returns:
9414                 New GEOM.GEOM_Object, containing the offset object.
9415
9416             Example of usage:
9417                  box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9418                  # create a new box extended by 70
9419                  offset = geompy.MakeOffsetIntersectionJoin(box, 70.)
9420             """
9421             # Example: see GEOM_TestAll.py
9422             theOffset, Parameters = ParseParameters( theOffset )
9423             anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, False )
9424             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9425             anObj.SetParameters(Parameters)
9426             self._autoPublish(anObj, theName, "offset")
9427             return anObj
9428
9429         ## Create new object as projection of the given one on another.
9430         #  @param theSource The source object for the projection. It can be a point, edge or wire.
9431         #         Edge and wire are acceptable if @a theTarget is a face.
9432         #  @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9433         #  @param theName Object name; when specified, this parameter is used
9434         #         for result publication in the study. Otherwise, if automatic
9435         #         publication is switched on, default value is used for result name.
9436         #
9437         #  @return New GEOM.GEOM_Object, containing the projection.
9438         #
9439         #  @ref tui_projection "Example"
9440         @ManageTransactions("TrsfOp")
9441         def MakeProjection(self, theSource, theTarget, theName=None):
9442             """
9443             Create new object as projection of the given one on another.
9444
9445             Parameters:
9446                 theSource The source object for the projection. It can be a point, edge or wire.
9447                           Edge and wire are acceptable if theTarget is a face.
9448                 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9449                 theName Object name; when specified, this parameter is used
9450                         for result publication in the study. Otherwise, if automatic
9451                         publication is switched on, default value is used for result name.
9452
9453             Returns:
9454                 New GEOM.GEOM_Object, containing the projection.
9455             """
9456             # Example: see GEOM_TestAll.py
9457             anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9458             RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9459             self._autoPublish(anObj, theName, "projection")
9460             return anObj
9461
9462         ## Create a projection of the given point on a wire or an edge.
9463         #  If there are no solutions or there are 2 or more solutions It throws an
9464         #  exception.
9465         #  @param thePoint the point to be projected.
9466         #  @param theWire the wire. The edge is accepted as well.
9467         #  @param theName Object name; when specified, this parameter is used
9468         #         for result publication in the study. Otherwise, if automatic
9469         #         publication is switched on, default value is used for result name.
9470         #
9471         #  @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9472         #  \n \a u: The parameter of projection point on edge.
9473         #  \n \a PointOnEdge: The projection point.
9474         #  \n \a EdgeInWireIndex: The index of an edge in a wire.
9475         #
9476         #  @ref tui_projection "Example"
9477         @ManageTransactions("TrsfOp")
9478         def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9479             """
9480             Create a projection of the given point on a wire or an edge.
9481             If there are no solutions or there are 2 or more solutions It throws an
9482             exception.
9483
9484             Parameters:
9485                 thePoint the point to be projected.
9486                 theWire the wire. The edge is accepted as well.
9487                 theName Object name; when specified, this parameter is used
9488                         for result publication in the study. Otherwise, if automatic
9489                         publication is switched on, default value is used for result name.
9490
9491             Returns:
9492                 [u, PointOnEdge, EdgeInWireIndex]
9493                  u: The parameter of projection point on edge.
9494                  PointOnEdge: The projection point.
9495                  EdgeInWireIndex: The index of an edge in a wire.
9496             """
9497             # Example: see GEOM_TestAll.py
9498             anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9499             RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9500             self._autoPublish(anObj[1], theName, "projection")
9501             return anObj
9502
9503         # -----------------------------------------------------------------------------
9504         # Patterns
9505         # -----------------------------------------------------------------------------
9506
9507         ## Translate the given object along the given vector a given number times
9508         #  @param theObject The object to be translated.
9509         #  @param theVector Direction of the translation. DX if None.
9510         #  @param theStep Distance to translate on.
9511         #  @param theNbTimes Quantity of translations to be done.
9512         #  @param theName Object name; when specified, this parameter is used
9513         #         for result publication in the study. Otherwise, if automatic
9514         #         publication is switched on, default value is used for result name.
9515         #
9516         #  @return New GEOM.GEOM_Object, containing compound of all
9517         #          the shapes, obtained after each translation.
9518         #
9519         #  @ref tui_multi_translation "Example"
9520         @ManageTransactions("TrsfOp")
9521         def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9522             """
9523             Translate the given object along the given vector a given number times
9524
9525             Parameters:
9526                 theObject The object to be translated.
9527                 theVector Direction of the translation. DX if None.
9528                 theStep Distance to translate on.
9529                 theNbTimes Quantity of translations to be done.
9530                 theName Object name; when specified, this parameter is used
9531                         for result publication in the study. Otherwise, if automatic
9532                         publication is switched on, default value is used for result name.
9533
9534             Returns:
9535                 New GEOM.GEOM_Object, containing compound of all
9536                 the shapes, obtained after each translation.
9537
9538             Example of usage:
9539                 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9540             """
9541             # Example: see GEOM_TestAll.py
9542             theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9543             anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9544             RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9545             anObj.SetParameters(Parameters)
9546             self._autoPublish(anObj, theName, "multitranslation")
9547             return anObj
9548
9549         ## Conseqently apply two specified translations to theObject specified number of times.
9550         #  @param theObject The object to be translated.
9551         #  @param theVector1 Direction of the first translation. DX if None.
9552         #  @param theStep1 Step of the first translation.
9553         #  @param theNbTimes1 Quantity of translations to be done along theVector1.
9554         #  @param theVector2 Direction of the second translation. DY if None.
9555         #  @param theStep2 Step of the second translation.
9556         #  @param theNbTimes2 Quantity of translations to be done along theVector2.
9557         #  @param theName Object name; when specified, this parameter is used
9558         #         for result publication in the study. Otherwise, if automatic
9559         #         publication is switched on, default value is used for result name.
9560         #
9561         #  @return New GEOM.GEOM_Object, containing compound of all
9562         #          the shapes, obtained after each translation.
9563         #
9564         #  @ref tui_multi_translation "Example"
9565         @ManageTransactions("TrsfOp")
9566         def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9567                                    theVector2, theStep2, theNbTimes2, theName=None):
9568             """
9569             Conseqently apply two specified translations to theObject specified number of times.
9570
9571             Parameters:
9572                 theObject The object to be translated.
9573                 theVector1 Direction of the first translation. DX if None.
9574                 theStep1 Step of the first translation.
9575                 theNbTimes1 Quantity of translations to be done along theVector1.
9576                 theVector2 Direction of the second translation. DY if None.
9577                 theStep2 Step of the second translation.
9578                 theNbTimes2 Quantity of translations to be done along theVector2.
9579                 theName Object name; when specified, this parameter is used
9580                         for result publication in the study. Otherwise, if automatic
9581                         publication is switched on, default value is used for result name.
9582
9583             Returns:
9584                 New GEOM.GEOM_Object, containing compound of all
9585                 the shapes, obtained after each translation.
9586
9587             Example of usage:
9588                 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9589             """
9590             # Example: see GEOM_TestAll.py
9591             theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9592             anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9593                                                  theVector2, theStep2, theNbTimes2)
9594             RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9595             anObj.SetParameters(Parameters)
9596             self._autoPublish(anObj, theName, "multitranslation")
9597             return anObj
9598
9599         ## Rotate the given object around the given axis a given number times.
9600         #  Rotation angle will be 2*PI/theNbTimes.
9601         #  @param theObject The object to be rotated.
9602         #  @param theAxis The rotation axis. DZ if None.
9603         #  @param theNbTimes Quantity of rotations to be done.
9604         #  @param theName Object name; when specified, this parameter is used
9605         #         for result publication in the study. Otherwise, if automatic
9606         #         publication is switched on, default value is used for result name.
9607         #
9608         #  @return New GEOM.GEOM_Object, containing compound of all the
9609         #          shapes, obtained after each rotation.
9610         #
9611         #  @ref tui_multi_rotation "Example"
9612         @ManageTransactions("TrsfOp")
9613         def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9614             """
9615             Rotate the given object around the given axis a given number times.
9616             Rotation angle will be 2*PI/theNbTimes.
9617
9618             Parameters:
9619                 theObject The object to be rotated.
9620                 theAxis The rotation axis. DZ if None.
9621                 theNbTimes Quantity of rotations to be done.
9622                 theName Object name; when specified, this parameter is used
9623                         for result publication in the study. Otherwise, if automatic
9624                         publication is switched on, default value is used for result name.
9625
9626             Returns:
9627                 New GEOM.GEOM_Object, containing compound of all the
9628                 shapes, obtained after each rotation.
9629
9630             Example of usage:
9631                 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9632             """
9633             # Example: see GEOM_TestAll.py
9634             theNbTimes, Parameters = ParseParameters(theNbTimes)
9635             anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9636             RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9637             anObj.SetParameters(Parameters)
9638             self._autoPublish(anObj, theName, "multirotation")
9639             return anObj
9640
9641         ## Rotate the given object around the given axis
9642         #  a given number times on the given angle.
9643         #  @param theObject The object to be rotated.
9644         #  @param theAxis The rotation axis. DZ if None.
9645         #  @param theAngleStep Rotation angle in radians.
9646         #  @param theNbTimes Quantity of rotations to be done.
9647         #  @param theName Object name; when specified, this parameter is used
9648         #         for result publication in the study. Otherwise, if automatic
9649         #         publication is switched on, default value is used for result name.
9650         #
9651         #  @return New GEOM.GEOM_Object, containing compound of all the
9652         #          shapes, obtained after each rotation.
9653         #
9654         #  @ref tui_multi_rotation "Example"
9655         @ManageTransactions("TrsfOp")
9656         def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9657             """
9658             Rotate the given object around the given axis
9659             a given number times on the given angle.
9660
9661             Parameters:
9662                 theObject The object to be rotated.
9663                 theAxis The rotation axis. DZ if None.
9664                 theAngleStep Rotation angle in radians.
9665                 theNbTimes Quantity of rotations to be done.
9666                 theName Object name; when specified, this parameter is used
9667                         for result publication in the study. Otherwise, if automatic
9668                         publication is switched on, default value is used for result name.
9669
9670             Returns:
9671                 New GEOM.GEOM_Object, containing compound of all the
9672                 shapes, obtained after each rotation.
9673
9674             Example of usage:
9675                 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9676             """
9677             # Example: see GEOM_TestAll.py
9678             theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9679             anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9680             RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9681             anObj.SetParameters(Parameters)
9682             self._autoPublish(anObj, theName, "multirotation")
9683             return anObj
9684
9685         ## Rotate the given object around the given axis a given
9686         #  number times and multi-translate each rotation result.
9687         #  Rotation angle will be 2*PI/theNbTimes1.
9688         #  Translation direction passes through center of gravity
9689         #  of rotated shape and its projection on the rotation axis.
9690         #  @param theObject The object to be rotated.
9691         #  @param theAxis Rotation axis. DZ if None.
9692         #  @param theNbTimes1 Quantity of rotations to be done.
9693         #  @param theRadialStep Translation distance.
9694         #  @param theNbTimes2 Quantity of translations to be done.
9695         #  @param theName Object name; when specified, this parameter is used
9696         #         for result publication in the study. Otherwise, if automatic
9697         #         publication is switched on, default value is used for result name.
9698         #
9699         #  @return New GEOM.GEOM_Object, containing compound of all the
9700         #          shapes, obtained after each transformation.
9701         #
9702         #  @ref tui_multi_rotation "Example"
9703         @ManageTransactions("TrsfOp")
9704         def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9705             """
9706             Rotate the given object around the
9707             given axis on the given angle a given number
9708             times and multi-translate each rotation result.
9709             Translation direction passes through center of gravity
9710             of rotated shape and its projection on the rotation axis.
9711
9712             Parameters:
9713                 theObject The object to be rotated.
9714                 theAxis Rotation axis. DZ if None.
9715                 theNbTimes1 Quantity of rotations to be done.
9716                 theRadialStep Translation distance.
9717                 theNbTimes2 Quantity of translations to be done.
9718                 theName Object name; when specified, this parameter is used
9719                         for result publication in the study. Otherwise, if automatic
9720                         publication is switched on, default value is used for result name.
9721
9722             Returns:
9723                 New GEOM.GEOM_Object, containing compound of all the
9724                 shapes, obtained after each transformation.
9725
9726             Example of usage:
9727                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9728             """
9729             # Example: see GEOM_TestAll.py
9730             theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9731             anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9732             RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9733             anObj.SetParameters(Parameters)
9734             self._autoPublish(anObj, theName, "multirotation")
9735             return anObj
9736
9737         ## Rotate the given object around the
9738         #  given axis on the given angle a given number
9739         #  times and multi-translate each rotation result.
9740         #  Translation direction passes through center of gravity
9741         #  of rotated shape and its projection on the rotation axis.
9742         #  @param theObject The object to be rotated.
9743         #  @param theAxis Rotation axis. DZ if None.
9744         #  @param theAngleStep Rotation angle in radians.
9745         #  @param theNbTimes1 Quantity of rotations to be done.
9746         #  @param theRadialStep Translation distance.
9747         #  @param theNbTimes2 Quantity of translations to be done.
9748         #  @param theName Object name; when specified, this parameter is used
9749         #         for result publication in the study. Otherwise, if automatic
9750         #         publication is switched on, default value is used for result name.
9751         #
9752         #  @return New GEOM.GEOM_Object, containing compound of all the
9753         #          shapes, obtained after each transformation.
9754         #
9755         #  @ref tui_multi_rotation "Example"
9756         @ManageTransactions("TrsfOp")
9757         def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9758             """
9759             Rotate the given object around the
9760             given axis on the given angle a given number
9761             times and multi-translate each rotation result.
9762             Translation direction passes through center of gravity
9763             of rotated shape and its projection on the rotation axis.
9764
9765             Parameters:
9766                 theObject The object to be rotated.
9767                 theAxis Rotation axis. DZ if None.
9768                 theAngleStep Rotation angle in radians.
9769                 theNbTimes1 Quantity of rotations to be done.
9770                 theRadialStep Translation distance.
9771                 theNbTimes2 Quantity of translations to be done.
9772                 theName Object name; when specified, this parameter is used
9773                         for result publication in the study. Otherwise, if automatic
9774                         publication is switched on, default value is used for result name.
9775
9776             Returns:
9777                 New GEOM.GEOM_Object, containing compound of all the
9778                 shapes, obtained after each transformation.
9779
9780             Example of usage:
9781                 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9782             """
9783             # Example: see GEOM_TestAll.py
9784             theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9785             anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9786             RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9787             anObj.SetParameters(Parameters)
9788             self._autoPublish(anObj, theName, "multirotation")
9789             return anObj
9790
9791         ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9792         #
9793         #  @ref swig_MakeMultiRotation "Example"
9794         def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9795             """
9796             The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9797
9798             Example of usage:
9799                 pz = geompy.MakeVertex(0, 0, 100)
9800                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9801                 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9802             """
9803             # Example: see GEOM_TestOthers.py
9804             aVec = self.MakeLine(aPoint,aDir)
9805             # note: auto-publishing is done in self.MultiRotate1D()
9806             anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9807             return anObj
9808
9809         ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9810         #
9811         #  @ref swig_MakeMultiRotation "Example"
9812         def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9813             """
9814             The same, as geompy.MultiRotate1D, but axis is given by direction and point
9815
9816             Example of usage:
9817                 pz = geompy.MakeVertex(0, 0, 100)
9818                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9819                 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9820             """
9821             # Example: see GEOM_TestOthers.py
9822             aVec = self.MakeLine(aPoint,aDir)
9823             # note: auto-publishing is done in self.MultiRotate1D()
9824             anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9825             return anObj
9826
9827         ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9828         #
9829         #  @ref swig_MakeMultiRotation "Example"
9830         def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9831             """
9832             The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9833
9834             Example of usage:
9835                 pz = geompy.MakeVertex(0, 0, 100)
9836                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9837                 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9838             """
9839             # Example: see GEOM_TestOthers.py
9840             aVec = self.MakeLine(aPoint,aDir)
9841             # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9842             anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9843             return anObj
9844
9845         ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9846         #
9847         #  @ref swig_MakeMultiRotation "Example"
9848         def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9849             """
9850             The same, as MultiRotate2DByStep(), but axis is given by direction and point
9851
9852             Example of usage:
9853                 pz = geompy.MakeVertex(0, 0, 100)
9854                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9855                 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9856             """
9857             # Example: see GEOM_TestOthers.py
9858             aVec = self.MakeLine(aPoint,aDir)
9859             # note: auto-publishing is done in self.MultiRotate2D()
9860             anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9861             return anObj
9862
9863         ##
9864         #  Compute a wire or a face that represents a projection of the source
9865         #  shape onto cylinder. The cylinder's coordinate system is the same
9866         #  as the global coordinate system.
9867         #
9868         #  @param theObject The object to be projected. It can be either
9869         #         a planar wire or a face.
9870         #  @param theRadius The radius of the cylinder.
9871         #  @param theStartAngle The starting angle in radians from
9872         #         the cylinder's X axis around Z axis. The angle from which
9873         #         the projection is started.
9874         #  @param theAngleLength The projection length angle in radians.
9875         #         The angle in which to project the total length of the wire.
9876         #         If it is negative the projection is not scaled and natural
9877         #         wire length is kept for the projection.
9878         #  @param theAngleRotation The desired angle in radians between
9879         #         the tangent vector to the first curve at the first point of
9880         #         the theObject's projection in 2D space and U-direction of
9881         #         cylinder's 2D space.
9882         #  @param theName Object name; when specified, this parameter is used
9883         #         for result publication in the study. Otherwise, if automatic
9884         #         publication is switched on, default value is used for result name.
9885         #
9886         #  @return New GEOM.GEOM_Object, containing the result shape. The result
9887         #         represents a wire or a face that represents a projection of
9888         #         the source shape onto a cylinder.
9889         #
9890         #  @ref tui_projection "Example"
9891         def MakeProjectionOnCylinder (self, theObject, theRadius,
9892                                       theStartAngle=0.0, theAngleLength=-1.0,
9893                                       theAngleRotation=0.0,
9894                                       theName=None):
9895             """
9896             Compute a wire or a face that represents a projection of the source
9897             shape onto cylinder. The cylinder's coordinate system is the same
9898             as the global coordinate system.
9899
9900             Parameters:
9901                 theObject The object to be projected. It can be either
9902                         a planar wire or a face.
9903                 theRadius The radius of the cylinder.
9904                 theStartAngle The starting angle in radians from the cylinder's X axis
9905                         around Z axis. The angle from which the projection is started.
9906                 theAngleLength The projection length angle in radians. The angle in which
9907                         to project the total length of the wire. If it is negative the
9908                         projection is not scaled and natural wire length is kept for
9909                         the projection.
9910                 theAngleRotation The desired angle in radians between
9911                         the tangent vector to the first curve at the first
9912                         point of the theObject's projection in 2D space and
9913                         U-direction of cylinder's 2D space.
9914                 theName Object name; when specified, this parameter is used
9915                         for result publication in the study. Otherwise, if automatic
9916                         publication is switched on, default value is used for result name.
9917
9918             Returns:
9919                 New GEOM.GEOM_Object, containing the result shape. The result
9920                 represents a wire or a face that represents a projection of
9921                 the source shape onto a cylinder.
9922             """
9923             # Example: see GEOM_TestAll.py
9924             flagStartAngle = False
9925             if isinstance(theStartAngle,str):
9926                 flagStartAngle = True
9927             flagAngleLength = False
9928             if isinstance(theAngleLength,str):
9929                 flagAngleLength = True
9930             flagAngleRotation = False
9931             if isinstance(theAngleRotation,str):
9932                 flagAngleRotation = True
9933             theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
9934               theRadius, theStartAngle, theAngleLength, theAngleRotation)
9935             if flagStartAngle:
9936                 theStartAngle = theStartAngle*math.pi/180.
9937             if flagAngleLength:
9938                 theAngleLength = theAngleLength*math.pi/180.
9939             if flagAngleRotation:
9940                 theAngleRotation = theAngleRotation*math.pi/180.
9941             anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9942                 theStartAngle, theAngleLength, theAngleRotation)
9943             RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9944             anObj.SetParameters(Parameters)
9945             self._autoPublish(anObj, theName, "projection")
9946             return anObj
9947
9948         # end of l3_transform
9949         ## @}
9950
9951         ## @addtogroup l3_transform_d
9952         ## @{
9953
9954         ## Deprecated method. Use MultiRotate1DNbTimes instead.
9955         def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9956             """
9957             Deprecated method. Use MultiRotate1DNbTimes instead.
9958             """
9959             print("The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead.")
9960             return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9961
9962         ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9963         #  This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9964         @ManageTransactions("TrsfOp")
9965         def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9966             """
9967             The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9968             This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9969
9970             Example of usage:
9971                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9972             """
9973             print("The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead.")
9974             theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9975             anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9976             RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9977             anObj.SetParameters(Parameters)
9978             self._autoPublish(anObj, theName, "multirotation")
9979             return anObj
9980
9981         ## The same, as MultiRotate1D(), but axis is given by direction and point
9982         #  This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9983         def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9984             """
9985             The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9986             This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9987
9988             Example of usage:
9989                 pz = geompy.MakeVertex(0, 0, 100)
9990                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9991                 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9992             """
9993             print("The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.")
9994             aVec = self.MakeLine(aPoint,aDir)
9995             # note: auto-publishing is done in self.MultiRotate1D()
9996             anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9997             return anObj
9998
9999         ## The same, as MultiRotate2D(), but axis is given by direction and point
10000         #  This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
10001         def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
10002             """
10003             The same, as MultiRotate2D(), but axis is given by direction and point
10004             This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
10005
10006             Example of usage:
10007                 pz = geompy.MakeVertex(0, 0, 100)
10008                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
10009                 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
10010             """
10011             print("The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead.")
10012             aVec = self.MakeLine(aPoint,aDir)
10013             # note: auto-publishing is done in self.MultiRotate2D()
10014             anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
10015             return anObj
10016
10017         # end of l3_transform_d
10018         ## @}
10019
10020         ## @addtogroup l3_local
10021         ## @{
10022
10023         ## Perform a fillet on all edges of the given shape.
10024         #  @param theShape Shape, to perform fillet on.
10025         #  @param theR Fillet radius.
10026         #  @param theName Object name; when specified, this parameter is used
10027         #         for result publication in the study. Otherwise, if automatic
10028         #         publication is switched on, default value is used for result name.
10029         #
10030         #  @return New GEOM.GEOM_Object, containing the result shape.
10031         #
10032         #  @ref tui_fillet "Example 1"
10033         #  \n @ref swig_MakeFilletAll "Example 2"
10034         @ManageTransactions("LocalOp")
10035         def MakeFilletAll(self, theShape, theR, theName=None):
10036             """
10037             Perform a fillet on all edges of the given shape.
10038
10039             Parameters:
10040                 theShape Shape, to perform fillet on.
10041                 theR Fillet radius.
10042                 theName Object name; when specified, this parameter is used
10043                         for result publication in the study. Otherwise, if automatic
10044                         publication is switched on, default value is used for result name.
10045
10046             Returns:
10047                 New GEOM.GEOM_Object, containing the result shape.
10048
10049             Example of usage:
10050                filletall = geompy.MakeFilletAll(prism, 10.)
10051             """
10052             # Example: see GEOM_TestOthers.py
10053             theR,Parameters = ParseParameters(theR)
10054             anObj = self.LocalOp.MakeFilletAll(theShape, theR)
10055             RaiseIfFailed("MakeFilletAll", self.LocalOp)
10056             anObj.SetParameters(Parameters)
10057             self._autoPublish(anObj, theName, "fillet")
10058             return anObj
10059
10060         ## Perform a fillet on the specified edges/faces of the given shape
10061         #  @param theShape Shape, to perform fillet on.
10062         #  @param theR Fillet radius.
10063         #  @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
10064         #  @param theListShapes Global indices of edges/faces to perform fillet on.
10065         #  @param theName Object name; when specified, this parameter is used
10066         #         for result publication in the study. Otherwise, if automatic
10067         #         publication is switched on, default value is used for result name.
10068         #
10069         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10070         #
10071         #  @return New GEOM.GEOM_Object, containing the result shape.
10072         #
10073         #  @ref tui_fillet "Example"
10074         @ManageTransactions("LocalOp")
10075         def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
10076             """
10077             Perform a fillet on the specified edges/faces of the given shape
10078
10079             Parameters:
10080                 theShape Shape, to perform fillet on.
10081                 theR Fillet radius.
10082                 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
10083                 theListShapes Global indices of edges/faces to perform fillet on.
10084                 theName Object name; when specified, this parameter is used
10085                         for result publication in the study. Otherwise, if automatic
10086                         publication is switched on, default value is used for result name.
10087
10088             Note:
10089                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10090
10091             Returns:
10092                 New GEOM.GEOM_Object, containing the result shape.
10093
10094             Example of usage:
10095                 # get the list of IDs (IDList) for the fillet
10096                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10097                 IDlist_e = []
10098                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10099                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10100                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10101                 # make a fillet on the specified edges of the given shape
10102                 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
10103             """
10104             # Example: see GEOM_TestAll.py
10105             theR,Parameters = ParseParameters(theR)
10106             anObj = None
10107             if theShapeType == self.ShapeType["EDGE"]:
10108                 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
10109                 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
10110             else:
10111                 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
10112                 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
10113             anObj.SetParameters(Parameters)
10114             self._autoPublish(anObj, theName, "fillet")
10115             return anObj
10116
10117         ## The same that MakeFillet() but with two Fillet Radius R1 and R2
10118         @ManageTransactions("LocalOp")
10119         def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
10120             """
10121             The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
10122
10123             Example of usage:
10124                 # get the list of IDs (IDList) for the fillet
10125                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10126                 IDlist_e = []
10127                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10128                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10129                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10130                 # make a fillet on the specified edges of the given shape
10131                 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
10132             """
10133             theR1,theR2,Parameters = ParseParameters(theR1,theR2)
10134             anObj = None
10135             if theShapeType == self.ShapeType["EDGE"]:
10136                 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
10137                 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
10138             else:
10139                 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
10140                 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
10141             anObj.SetParameters(Parameters)
10142             self._autoPublish(anObj, theName, "fillet")
10143             return anObj
10144
10145         ## Perform a fillet on the specified edges of the given shape
10146         #  @param theShape  Wire Shape to perform fillet on.
10147         #  @param theR  Fillet radius.
10148         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
10149         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID()
10150         #    \note The list of vertices could be empty,
10151         #          in this case fillet will done done at all vertices in wire
10152         #  @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
10153         #         by the length of the edges, nearest to the fillet vertex.
10154         #         But sometimes the next edge is C1 continuous with the one, nearest to
10155         #         the fillet point, and such two (or more) edges can be united to allow
10156         #         bigger radius. Set this flag to TRUE to allow collinear edges union,
10157         #         thus ignoring the secant vertex (vertices).
10158         #  @param theName Object name; when specified, this parameter is used
10159         #         for result publication in the study. Otherwise, if automatic
10160         #         publication is switched on, default value is used for result name.
10161         #
10162         #  @return New GEOM.GEOM_Object, containing the result shape.
10163         #
10164         #  @ref tui_fillet2d "Example"
10165         @ManageTransactions("LocalOp")
10166         def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
10167             """
10168             Perform a fillet on the specified edges of the given shape
10169
10170             Parameters:
10171                 theShape  Wire Shape to perform fillet on.
10172                 theR  Fillet radius.
10173                 theListOfVertexes Global indices of vertexes to perform fillet on.
10174                 doIgnoreSecantVertices If FALSE, fillet radius is always limited
10175                     by the length of the edges, nearest to the fillet vertex.
10176                     But sometimes the next edge is C1 continuous with the one, nearest to
10177                     the fillet point, and such two (or more) edges can be united to allow
10178                     bigger radius. Set this flag to TRUE to allow collinear edges union,
10179                     thus ignoring the secant vertex (vertices).
10180                 theName Object name; when specified, this parameter is used
10181                         for result publication in the study. Otherwise, if automatic
10182                         publication is switched on, default value is used for result name.
10183             Note:
10184                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10185
10186                 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
10187
10188             Returns:
10189                 New GEOM.GEOM_Object, containing the result shape.
10190
10191             Example of usage:
10192                 # create wire
10193                 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
10194                 # make fillet at given wire vertices with giver radius
10195                 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
10196             """
10197             # Example: see GEOM_TestAll.py
10198             theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
10199             anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
10200             RaiseIfFailed("MakeFillet1D", self.LocalOp)
10201             anObj.SetParameters(Parameters)
10202             self._autoPublish(anObj, theName, "fillet")
10203             return anObj
10204
10205         ## Perform a fillet at the specified vertices of the given face/shell.
10206         #  @param theShape Face or Shell shape to perform fillet on.
10207         #  @param theR Fillet radius.
10208         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
10209         #  @param theName Object name; when specified, this parameter is used
10210         #         for result publication in the study. Otherwise, if automatic
10211         #         publication is switched on, default value is used for result name.
10212         #
10213         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10214         #
10215         #  @return New GEOM.GEOM_Object, containing the result shape.
10216         #
10217         #  @ref tui_fillet2d "Example"
10218         @ManageTransactions("LocalOp")
10219         def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
10220             """
10221             Perform a fillet at the specified vertices of the given face/shell.
10222
10223             Parameters:
10224                 theShape  Face or Shell shape to perform fillet on.
10225                 theR  Fillet radius.
10226                 theListOfVertexes Global indices of vertexes to perform fillet on.
10227                 theName Object name; when specified, this parameter is used
10228                         for result publication in the study. Otherwise, if automatic
10229                         publication is switched on, default value is used for result name.
10230             Note:
10231                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10232
10233             Returns:
10234                 New GEOM.GEOM_Object, containing the result shape.
10235
10236             Example of usage:
10237                 face = geompy.MakeFaceHW(100, 100, 1)
10238                 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
10239             """
10240             # Example: see GEOM_TestAll.py
10241             theR,Parameters = ParseParameters(theR)
10242             anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
10243             RaiseIfFailed("MakeFillet2D", self.LocalOp)
10244             anObj.SetParameters(Parameters)
10245             self._autoPublish(anObj, theName, "fillet")
10246             return anObj
10247
10248         ## Perform a symmetric chamfer on all edges of the given shape.
10249         #  @param theShape Shape, to perform chamfer on.
10250         #  @param theD Chamfer size along each face.
10251         #  @param theName Object name; when specified, this parameter is used
10252         #         for result publication in the study. Otherwise, if automatic
10253         #         publication is switched on, default value is used for result name.
10254         #
10255         #  @return New GEOM.GEOM_Object, containing the result shape.
10256         #
10257         #  @ref tui_chamfer "Example 1"
10258         #  \n @ref swig_MakeChamferAll "Example 2"
10259         @ManageTransactions("LocalOp")
10260         def MakeChamferAll(self, theShape, theD, theName=None):
10261             """
10262             Perform a symmetric chamfer on all edges of the given shape.
10263
10264             Parameters:
10265                 theShape Shape, to perform chamfer on.
10266                 theD Chamfer size along each face.
10267                 theName Object name; when specified, this parameter is used
10268                         for result publication in the study. Otherwise, if automatic
10269                         publication is switched on, default value is used for result name.
10270
10271             Returns:
10272                 New GEOM.GEOM_Object, containing the result shape.
10273
10274             Example of usage:
10275                 chamfer_all = geompy.MakeChamferAll(prism, 10.)
10276             """
10277             # Example: see GEOM_TestOthers.py
10278             theD,Parameters = ParseParameters(theD)
10279             anObj = self.LocalOp.MakeChamferAll(theShape, theD)
10280             RaiseIfFailed("MakeChamferAll", self.LocalOp)
10281             anObj.SetParameters(Parameters)
10282             self._autoPublish(anObj, theName, "chamfer")
10283             return anObj
10284
10285         ## Perform a chamfer on edges, common to the specified faces,
10286         #  with distance D1 on the Face1
10287         #  @param theShape Shape, to perform chamfer on.
10288         #  @param theD1 Chamfer size along \a theFace1.
10289         #  @param theD2 Chamfer size along \a theFace2.
10290         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
10291         #  @param theName Object name; when specified, this parameter is used
10292         #         for result publication in the study. Otherwise, if automatic
10293         #         publication is switched on, default value is used for result name.
10294         #
10295         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10296         #
10297         #  @return New GEOM.GEOM_Object, containing the result shape.
10298         #
10299         #  @ref tui_chamfer "Example"
10300         @ManageTransactions("LocalOp")
10301         def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
10302             """
10303             Perform a chamfer on edges, common to the specified faces,
10304             with distance D1 on the Face1
10305
10306             Parameters:
10307                 theShape Shape, to perform chamfer on.
10308                 theD1 Chamfer size along theFace1.
10309                 theD2 Chamfer size along theFace2.
10310                 theFace1,theFace2 Global indices of two faces of theShape.
10311                 theName Object name; when specified, this parameter is used
10312                         for result publication in the study. Otherwise, if automatic
10313                         publication is switched on, default value is used for result name.
10314
10315             Note:
10316                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10317
10318             Returns:
10319                 New GEOM.GEOM_Object, containing the result shape.
10320
10321             Example of usage:
10322                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10323                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10324                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10325                 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10326             """
10327             # Example: see GEOM_TestAll.py
10328             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10329             anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10330             RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10331             anObj.SetParameters(Parameters)
10332             self._autoPublish(anObj, theName, "chamfer")
10333             return anObj
10334
10335         ## Perform a chamfer on edges
10336         #  @param theShape Shape, to perform chamfer on.
10337         #  @param theD Chamfer length
10338         #  @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10339         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
10340         #  @param theName Object name; when specified, this parameter is used
10341         #         for result publication in the study. Otherwise, if automatic
10342         #         publication is switched on, default value is used for result name.
10343         #
10344         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10345         #
10346         #  @return New GEOM.GEOM_Object, containing the result shape.
10347         @ManageTransactions("LocalOp")
10348         def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10349             """
10350             Perform a chamfer on edges
10351
10352             Parameters:
10353                 theShape Shape, to perform chamfer on.
10354                 theD1 Chamfer size along theFace1.
10355                 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10356                 theFace1,theFace2 Global indices of two faces of theShape.
10357                 theName Object name; when specified, this parameter is used
10358                         for result publication in the study. Otherwise, if automatic
10359                         publication is switched on, default value is used for result name.
10360
10361             Note:
10362                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10363
10364             Returns:
10365                 New GEOM.GEOM_Object, containing the result shape.
10366
10367             Example of usage:
10368                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10369                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10370                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10371                 ang = 30
10372                 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10373             """
10374             flag = False
10375             if isinstance(theAngle,str):
10376                 flag = True
10377             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10378             if flag:
10379                 theAngle = theAngle*math.pi/180.0
10380             anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10381             RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10382             anObj.SetParameters(Parameters)
10383             self._autoPublish(anObj, theName, "chamfer")
10384             return anObj
10385
10386         ## Perform a chamfer on all edges of the specified faces,
10387         #  with distance D1 on the first specified face (if several for one edge)
10388         #  @param theShape Shape, to perform chamfer on.
10389         #  @param theD1 Chamfer size along face from \a theFaces. If both faces,
10390         #               connected to the edge, are in \a theFaces, \a theD1
10391         #               will be get along face, which is nearer to \a theFaces beginning.
10392         #  @param theD2 Chamfer size along another of two faces, connected to the edge.
10393         #  @param theFaces Sequence of global indices of faces of \a theShape.
10394         #  @param theName Object name; when specified, this parameter is used
10395         #         for result publication in the study. Otherwise, if automatic
10396         #         publication is switched on, default value is used for result name.
10397         #
10398         #  @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10399         #
10400         #  @return New GEOM.GEOM_Object, containing the result shape.
10401         #
10402         #  @ref tui_chamfer "Example"
10403         @ManageTransactions("LocalOp")
10404         def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10405             """
10406             Perform a chamfer on all edges of the specified faces,
10407             with distance D1 on the first specified face (if several for one edge)
10408
10409             Parameters:
10410                 theShape Shape, to perform chamfer on.
10411                 theD1 Chamfer size along face from  theFaces. If both faces,
10412                       connected to the edge, are in theFaces, theD1
10413                       will be get along face, which is nearer to theFaces beginning.
10414                 theD2 Chamfer size along another of two faces, connected to the edge.
10415                 theFaces Sequence of global indices of faces of theShape.
10416                 theName Object name; when specified, this parameter is used
10417                         for result publication in the study. Otherwise, if automatic
10418                         publication is switched on, default value is used for result name.
10419
10420             Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10421
10422             Returns:
10423                 New GEOM.GEOM_Object, containing the result shape.
10424             """
10425             # Example: see GEOM_TestAll.py
10426             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10427             anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10428             RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10429             anObj.SetParameters(Parameters)
10430             self._autoPublish(anObj, theName, "chamfer")
10431             return anObj
10432
10433         ## The Same that MakeChamferFaces() but with params theD is chamfer length and
10434         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10435         #
10436         #  @ref swig_FilletChamfer "Example"
10437         @ManageTransactions("LocalOp")
10438         def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10439             """
10440             The Same that geompy.MakeChamferFaces but with params theD is chamfer length and
10441             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10442             """
10443             flag = False
10444             if isinstance(theAngle,str):
10445                 flag = True
10446             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10447             if flag:
10448                 theAngle = theAngle*math.pi/180.0
10449             anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10450             RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10451             anObj.SetParameters(Parameters)
10452             self._autoPublish(anObj, theName, "chamfer")
10453             return anObj
10454
10455         ## Perform a chamfer on edges,
10456         #  with distance D1 on the first specified face (if several for one edge)
10457         #  @param theShape Shape, to perform chamfer on.
10458         #  @param theD1,theD2 Chamfer size
10459         #  @param theEdges Sequence of edges of \a theShape.
10460         #  @param theName Object name; when specified, this parameter is used
10461         #         for result publication in the study. Otherwise, if automatic
10462         #         publication is switched on, default value is used for result name.
10463         #
10464         #  @return New GEOM.GEOM_Object, containing the result shape.
10465         #
10466         #  @ref swig_FilletChamfer "Example"
10467         @ManageTransactions("LocalOp")
10468         def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10469             """
10470             Perform a chamfer on edges,
10471             with distance D1 on the first specified face (if several for one edge)
10472
10473             Parameters:
10474                 theShape Shape, to perform chamfer on.
10475                 theD1,theD2 Chamfer size
10476                 theEdges Sequence of edges of theShape.
10477                 theName Object name; when specified, this parameter is used
10478                         for result publication in the study. Otherwise, if automatic
10479                         publication is switched on, default value is used for result name.
10480
10481             Returns:
10482                 New GEOM.GEOM_Object, containing the result shape.
10483             """
10484             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10485             anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10486             RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10487             anObj.SetParameters(Parameters)
10488             self._autoPublish(anObj, theName, "chamfer")
10489             return anObj
10490
10491         ## The Same that MakeChamferEdges() but with params theD is chamfer length and
10492         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10493         @ManageTransactions("LocalOp")
10494         def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10495             """
10496             The Same that geompy.MakeChamferEdges but with params theD is chamfer length and
10497             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10498             """
10499             flag = False
10500             if isinstance(theAngle,str):
10501                 flag = True
10502             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10503             if flag:
10504                 theAngle = theAngle*math.pi/180.0
10505             anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10506             RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10507             anObj.SetParameters(Parameters)
10508             self._autoPublish(anObj, theName, "chamfer")
10509             return anObj
10510
10511         ## @sa MakeChamferEdge(), MakeChamferFaces()
10512         #
10513         #  @ref swig_MakeChamfer "Example"
10514         def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10515             """
10516             See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10517             """
10518             # Example: see GEOM_TestOthers.py
10519             anObj = None
10520             # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10521             if aShapeType == self.ShapeType["EDGE"]:
10522                 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10523             else:
10524                 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10525             return anObj
10526
10527         ## Remove material from a solid by extrusion of the base shape on the given distance.
10528         #  @param theInit Shape to remove material from. It must be a solid or
10529         #  a compound made of a single solid.
10530         #  @param theBase Closed edge or wire defining the base shape to be extruded.
10531         #  @param theH Prism dimension along the normal to theBase
10532         #  @param theAngle Draft angle in degrees.
10533         #  @param theInvert If true material changes the direction
10534         #  @param theName Object name; when specified, this parameter is used
10535         #         for result publication in the study. Otherwise, if automatic
10536         #         publication is switched on, default value is used for result name.
10537         #
10538         #  @return New GEOM.GEOM_Object, containing the initial shape with removed material
10539         #
10540         #  @ref tui_creation_prism "Example"
10541         @ManageTransactions("PrimOp")
10542         def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10543             """
10544             Add material to a solid by extrusion of the base shape on the given distance.
10545
10546             Parameters:
10547                 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10548                 theBase Closed edge or wire defining the base shape to be extruded.
10549                 theH Prism dimension along the normal to theBase
10550                 theAngle Draft angle in degrees.
10551                 theInvert If true material changes the direction.
10552                 theName Object name; when specified, this parameter is used
10553                         for result publication in the study. Otherwise, if automatic
10554                         publication is switched on, default value is used for result name.
10555
10556             Returns:
10557                 New GEOM.GEOM_Object,  containing the initial shape with removed material.
10558             """
10559             # Example: see GEOM_TestAll.py
10560             theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10561             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10562             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10563             anObj.SetParameters(Parameters)
10564             self._autoPublish(anObj, theName, "extrudedCut")
10565             return anObj
10566
10567         ## Add material to a solid by extrusion of the base shape on the given distance.
10568         #  @param theInit Shape to add material to. It must be a solid or
10569         #  a compound made of a single solid.
10570         #  @param theBase Closed edge or wire defining the base shape to be extruded.
10571         #  @param theH Prism dimension along the normal to theBase
10572         #  @param theAngle Draft angle in degrees.
10573         #  @param theInvert If true material changes the direction
10574         #  @param theName Object name; when specified, this parameter is used
10575         #         for result publication in the study. Otherwise, if automatic
10576         #         publication is switched on, default value is used for result name.
10577         #
10578         #  @return New GEOM.GEOM_Object, containing the initial shape with added material
10579         #
10580         #  @ref tui_creation_prism "Example"
10581         @ManageTransactions("PrimOp")
10582         def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10583             """
10584             Add material to a solid by extrusion of the base shape on the given distance.
10585
10586             Parameters:
10587                 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10588                 theBase Closed edge or wire defining the base shape to be extruded.
10589                 theH Prism dimension along the normal to theBase
10590                 theAngle Draft angle in degrees.
10591                 theInvert If true material changes the direction.
10592                 theName Object name; when specified, this parameter is used
10593                         for result publication in the study. Otherwise, if automatic
10594                         publication is switched on, default value is used for result name.
10595
10596             Returns:
10597                 New GEOM.GEOM_Object,  containing the initial shape with added material.
10598             """
10599             # Example: see GEOM_TestAll.py
10600             theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10601             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10602             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10603             anObj.SetParameters(Parameters)
10604             self._autoPublish(anObj, theName, "extrudedBoss")
10605             return anObj
10606
10607         # end of l3_local
10608         ## @}
10609
10610         ## @addtogroup l3_basic_op
10611         ## @{
10612
10613         ## Perform an Archimde operation on the given shape with given parameters.
10614         #  The object presenting the resulting face is returned.
10615         #  @param theShape Shape to be put in water.
10616         #  @param theWeight Weight of the shape.
10617         #  @param theWaterDensity Density of the water.
10618         #  @param theMeshDeflection Deflection of the mesh, using to compute the section.
10619         #  @param theName Object name; when specified, this parameter is used
10620         #         for result publication in the study. Otherwise, if automatic
10621         #         publication is switched on, default value is used for result name.
10622         #
10623         #  @return New GEOM.GEOM_Object, containing a section of \a theShape
10624         #          by a plane, corresponding to water level.
10625         #
10626         #  @ref tui_archimede "Example"
10627         @ManageTransactions("LocalOp")
10628         def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10629             """
10630             Perform an Archimde operation on the given shape with given parameters.
10631             The object presenting the resulting face is returned.
10632
10633             Parameters:
10634                 theShape Shape to be put in water.
10635                 theWeight Weight of the shape.
10636                 theWaterDensity Density of the water.
10637                 theMeshDeflection Deflection of the mesh, using to compute the section.
10638                 theName Object name; when specified, this parameter is used
10639                         for result publication in the study. Otherwise, if automatic
10640                         publication is switched on, default value is used for result name.
10641
10642             Returns:
10643                 New GEOM.GEOM_Object, containing a section of theShape
10644                 by a plane, corresponding to water level.
10645             """
10646             # Example: see GEOM_TestAll.py
10647             theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10648               theWeight,theWaterDensity,theMeshDeflection)
10649             anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10650             RaiseIfFailed("MakeArchimede", self.LocalOp)
10651             anObj.SetParameters(Parameters)
10652             self._autoPublish(anObj, theName, "archimede")
10653             return anObj
10654
10655         # end of l3_basic_op
10656         ## @}
10657
10658         ## @addtogroup l2_measure
10659         ## @{
10660
10661         ## Get point coordinates
10662         #  @return [x, y, z]
10663         #
10664         #  @ref tui_point_coordinates_page "Example"
10665         @ManageTransactions("MeasuOp")
10666         def PointCoordinates(self,Point):
10667             """
10668             Get point coordinates
10669
10670             Returns:
10671                 [x, y, z]
10672             """
10673             # Example: see GEOM_TestMeasures.py
10674             aTuple = self.MeasuOp.PointCoordinates(Point)
10675             RaiseIfFailed("PointCoordinates", self.MeasuOp)
10676             return aTuple
10677
10678         ## Get vector coordinates
10679         #  @return [x, y, z]
10680         #
10681         #  @ref tui_measurement_tools_page "Example"
10682         def VectorCoordinates(self,Vector):
10683             """
10684             Get vector coordinates
10685
10686             Returns:
10687                 [x, y, z]
10688             """
10689
10690             p1=self.GetFirstVertex(Vector)
10691             p2=self.GetLastVertex(Vector)
10692
10693             X1=self.PointCoordinates(p1)
10694             X2=self.PointCoordinates(p2)
10695
10696             return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10697
10698
10699         ## Compute cross product
10700         #  @return vector w=u^v
10701         #
10702         #  @ref tui_measurement_tools_page "Example"
10703         def CrossProduct(self, Vector1, Vector2):
10704             """
10705             Compute cross product
10706
10707             Returns: vector w=u^v
10708             """
10709             u=self.VectorCoordinates(Vector1)
10710             v=self.VectorCoordinates(Vector2)
10711             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])
10712
10713             return w
10714
10715         ## Compute cross product
10716         #  @return dot product  p=u.v
10717         #
10718         #  @ref tui_measurement_tools_page "Example"
10719         def DotProduct(self, Vector1, Vector2):
10720             """
10721             Compute cross product
10722
10723             Returns: dot product  p=u.v
10724             """
10725             u=self.VectorCoordinates(Vector1)
10726             v=self.VectorCoordinates(Vector2)
10727             p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10728
10729             return p
10730
10731
10732         ## Get summarized length of all wires,
10733         #  area of surface and volume of the given shape.
10734         #  @param theShape Shape to define properties of.
10735         #  @param theTolerance maximal relative error of area
10736         #         and volume computation.
10737         #  @return [theLength, theSurfArea, theVolume]\n
10738         #  theLength:   Summarized length of all wires of the given shape.\n
10739         #  theSurfArea: Area of surface of the given shape.\n
10740         #  theVolume:   Volume of the given shape.
10741         #
10742         #  @ref tui_basic_properties_page "Example"
10743         @ManageTransactions("MeasuOp")
10744         def BasicProperties(self,theShape, theTolerance=1.e-6):
10745             """
10746             Get summarized length of all wires,
10747             area of surface and volume of the given shape.
10748
10749             Parameters:
10750                 theShape Shape to define properties of.
10751                 theTolerance maximal relative error of area
10752                              and volume computation.
10753
10754             Returns:
10755                 [theLength, theSurfArea, theVolume]
10756                  theLength:   Summarized length of all wires of the given shape.
10757                  theSurfArea: Area of surface of the given shape.
10758                  theVolume:   Volume of the given shape.
10759             """
10760             # Example: see GEOM_TestMeasures.py
10761             aTuple = self.MeasuOp.GetBasicProperties(theShape, theTolerance)
10762             RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10763             return aTuple
10764
10765         ## Get parameters of bounding box of the given shape
10766         #  @param theShape Shape to obtain bounding box of.
10767         #  @param precise TRUE for precise computation; FALSE for fast one.
10768         #  @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10769         #  Xmin,Xmax: Limits of shape along OX axis.
10770         #  Ymin,Ymax: Limits of shape along OY axis.
10771         #  Zmin,Zmax: Limits of shape along OZ axis.
10772         #
10773         #  @ref tui_bounding_box_page "Example"
10774         @ManageTransactions("MeasuOp")
10775         def BoundingBox (self, theShape, precise=False):
10776             """
10777             Get parameters of bounding box of the given shape
10778
10779             Parameters:
10780                 theShape Shape to obtain bounding box of.
10781                 precise TRUE for precise computation; FALSE for fast one.
10782
10783             Returns:
10784                 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10785                  Xmin,Xmax: Limits of shape along OX axis.
10786                  Ymin,Ymax: Limits of shape along OY axis.
10787                  Zmin,Zmax: Limits of shape along OZ axis.
10788             """
10789             # Example: see GEOM_TestMeasures.py
10790             aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10791             RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10792             return aTuple
10793
10794         ## Get bounding box of the given shape
10795         #  @param theShape Shape to obtain bounding box of.
10796         #  @param precise TRUE for precise computation; FALSE for fast one.
10797         #  @param theName Object name; when specified, this parameter is used
10798         #         for result publication in the study. Otherwise, if automatic
10799         #         publication is switched on, default value is used for result name.
10800         #
10801         #  @return New GEOM.GEOM_Object, containing the created box.
10802         #
10803         #  @ref tui_bounding_box_page "Example"
10804         @ManageTransactions("MeasuOp")
10805         def MakeBoundingBox (self, theShape, precise=False, theName=None):
10806             """
10807             Get bounding box of the given shape
10808
10809             Parameters:
10810                 theShape Shape to obtain bounding box of.
10811                 precise TRUE for precise computation; FALSE for fast one.
10812                 theName Object name; when specified, this parameter is used
10813                         for result publication in the study. Otherwise, if automatic
10814                         publication is switched on, default value is used for result name.
10815
10816             Returns:
10817                 New GEOM.GEOM_Object, containing the created box.
10818             """
10819             # Example: see GEOM_TestMeasures.py
10820             anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10821             RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10822             self._autoPublish(anObj, theName, "bndbox")
10823             return anObj
10824
10825         ## Get inertia matrix and moments of inertia of theShape.
10826         #  @param theShape Shape to calculate inertia of.
10827         #  @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10828         #  I(1-3)(1-3): Components of the inertia matrix of the given shape.
10829         #  Ix,Iy,Iz:    Moments of inertia of the given shape.
10830         #
10831         #  @ref tui_inertia_page "Example"
10832         @ManageTransactions("MeasuOp")
10833         def Inertia(self,theShape):
10834             """
10835             Get inertia matrix and moments of inertia of theShape.
10836
10837             Parameters:
10838                 theShape Shape to calculate inertia of.
10839
10840             Returns:
10841                 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10842                  I(1-3)(1-3): Components of the inertia matrix of the given shape.
10843                  Ix,Iy,Iz:    Moments of inertia of the given shape.
10844             """
10845             # Example: see GEOM_TestMeasures.py
10846             aTuple = self.MeasuOp.GetInertia(theShape)
10847             RaiseIfFailed("GetInertia", self.MeasuOp)
10848             return aTuple
10849
10850         ## Get if coords are included in the shape (ST_IN or ST_ON)
10851         #  @param theShape Shape
10852         #  @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10853         #  @param tolerance to be used (default is 1.0e-7)
10854         #  @return list_of_boolean = [res1, res2, ...]
10855         @ManageTransactions("MeasuOp")
10856         def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10857             """
10858             Get if coords are included in the shape (ST_IN or ST_ON)
10859
10860             Parameters:
10861                 theShape Shape
10862                 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10863                 tolerance to be used (default is 1.0e-7)
10864
10865             Returns:
10866                 list_of_boolean = [res1, res2, ...]
10867             """
10868             return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10869
10870         ## Get minimal distance between the given shapes.
10871         #  @param theShape1,theShape2 Shapes to find minimal distance between.
10872         #  @return Value of the minimal distance between the given shapes.
10873         #
10874         #  @ref tui_min_distance_page "Example"
10875         @ManageTransactions("MeasuOp")
10876         def MinDistance(self, theShape1, theShape2):
10877             """
10878             Get minimal distance between the given shapes.
10879
10880             Parameters:
10881                 theShape1,theShape2 Shapes to find minimal distance between.
10882
10883             Returns:
10884                 Value of the minimal distance between the given shapes.
10885             """
10886             # Example: see GEOM_TestMeasures.py
10887             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10888             RaiseIfFailed("GetMinDistance", self.MeasuOp)
10889             return aTuple[0]
10890
10891         ## Get minimal distance between the given shapes.
10892         #  @param theShape1,theShape2 Shapes to find minimal distance between.
10893         #  @return Value of the minimal distance between the given shapes, in form of list
10894         #          [Distance, DX, DY, DZ].
10895         #
10896         #  @ref tui_min_distance_page "Example"
10897         @ManageTransactions("MeasuOp")
10898         def MinDistanceComponents(self, theShape1, theShape2):
10899             """
10900             Get minimal distance between the given shapes.
10901
10902             Parameters:
10903                 theShape1,theShape2 Shapes to find minimal distance between.
10904
10905             Returns:
10906                 Value of the minimal distance between the given shapes, in form of list
10907                 [Distance, DX, DY, DZ]
10908             """
10909             # Example: see GEOM_TestMeasures.py
10910             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10911             RaiseIfFailed("GetMinDistance", self.MeasuOp)
10912             aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10913             return aRes
10914
10915         ## Get closest points of the given shapes.
10916         #  @param theShape1,theShape2 Shapes to find closest points of.
10917         #  @return The number of found solutions (-1 in case of infinite number of
10918         #          solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10919         #
10920         #  @ref tui_min_distance_page "Example"
10921         @ManageTransactions("MeasuOp")
10922         def ClosestPoints (self, theShape1, theShape2):
10923             """
10924             Get closest points of the given shapes.
10925
10926             Parameters:
10927                 theShape1,theShape2 Shapes to find closest points of.
10928
10929             Returns:
10930                 The number of found solutions (-1 in case of infinite number of
10931                 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10932             """
10933             # Example: see GEOM_TestMeasures.py
10934             aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10935             RaiseIfFailed("ClosestPoints", self.MeasuOp)
10936             return aTuple
10937
10938         ## Get angle between the given shapes in degrees.
10939         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
10940         #  @note If both arguments are vectors, the angle is computed in accordance
10941         #        with their orientations, otherwise the minimum angle is computed.
10942         #  @return Value of the angle between the given shapes in degrees.
10943         #
10944         #  @ref tui_angle_page "Example"
10945         @ManageTransactions("MeasuOp")
10946         def GetAngle(self, theShape1, theShape2):
10947             """
10948             Get angle between the given shapes in degrees.
10949
10950             Parameters:
10951                 theShape1,theShape2 Lines or linear edges to find angle between.
10952
10953             Note:
10954                 If both arguments are vectors, the angle is computed in accordance
10955                 with their orientations, otherwise the minimum angle is computed.
10956
10957             Returns:
10958                 Value of the angle between the given shapes in degrees.
10959             """
10960             # Example: see GEOM_TestMeasures.py
10961             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10962             RaiseIfFailed("GetAngle", self.MeasuOp)
10963             return anAngle
10964
10965         ## Get angle between the given shapes in radians.
10966         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
10967         #  @note If both arguments are vectors, the angle is computed in accordance
10968         #        with their orientations, otherwise the minimum angle is computed.
10969         #  @return Value of the angle between the given shapes in radians.
10970         #
10971         #  @ref tui_angle_page "Example"
10972         @ManageTransactions("MeasuOp")
10973         def GetAngleRadians(self, theShape1, theShape2):
10974             """
10975             Get angle between the given shapes in radians.
10976
10977             Parameters:
10978                 theShape1,theShape2 Lines or linear edges to find angle between.
10979
10980
10981             Note:
10982                 If both arguments are vectors, the angle is computed in accordance
10983                 with their orientations, otherwise the minimum angle is computed.
10984
10985             Returns:
10986                 Value of the angle between the given shapes in radians.
10987             """
10988             # Example: see GEOM_TestMeasures.py
10989             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10990             RaiseIfFailed("GetAngle", self.MeasuOp)
10991             return anAngle
10992
10993         ## Get angle between the given vectors in degrees.
10994         #  @param theShape1,theShape2 Vectors to find angle between.
10995         #  @param theFlag If True, the normal vector is defined by the two vectors cross,
10996         #                 if False, the opposite vector to the normal vector is used.
10997         #  @return Value of the angle between the given vectors in degrees.
10998         #
10999         #  @ref tui_angle_page "Example"
11000         @ManageTransactions("MeasuOp")
11001         def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
11002             """
11003             Get angle between the given vectors in degrees.
11004
11005             Parameters:
11006                 theShape1,theShape2 Vectors to find angle between.
11007                 theFlag If True, the normal vector is defined by the two vectors cross,
11008                         if False, the opposite vector to the normal vector is used.
11009
11010             Returns:
11011                 Value of the angle between the given vectors in degrees.
11012             """
11013             anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
11014             if not theFlag:
11015                 anAngle = 360. - anAngle
11016             RaiseIfFailed("GetAngleVectors", self.MeasuOp)
11017             return anAngle
11018
11019         ## The same as GetAngleVectors, but the result is in radians.
11020         def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
11021             """
11022             Get angle between the given vectors in radians.
11023
11024             Parameters:
11025                 theShape1,theShape2 Vectors to find angle between.
11026                 theFlag If True, the normal vector is defined by the two vectors cross,
11027                         if False, the opposite vector to the normal vector is used.
11028
11029             Returns:
11030                 Value of the angle between the given vectors in radians.
11031             """
11032             anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
11033             return anAngle
11034
11035         ## @name Curve Curvature Measurement
11036         #  Methods for receiving radius of curvature of curves
11037         #  in the given point
11038         ## @{
11039
11040         ## Measure curvature of a curve at a point, set by parameter.
11041         #  @param theCurve a curve.
11042         #  @param theParam parameter.
11043         #  @return radius of curvature of \a theCurve.
11044         #
11045         #  @ref swig_todo "Example"
11046         @ManageTransactions("MeasuOp")
11047         def CurveCurvatureByParam(self, theCurve, theParam):
11048             """
11049             Measure curvature of a curve at a point, set by parameter.
11050
11051             Parameters:
11052                 theCurve a curve.
11053                 theParam parameter.
11054
11055             Returns:
11056                 radius of curvature of theCurve.
11057             """
11058             # Example: see GEOM_TestMeasures.py
11059             aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
11060             RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
11061             return aCurv
11062
11063         ## Measure curvature of a curve at a point.
11064         #  @param theCurve a curve.
11065         #  @param thePoint given point.
11066         #  @return radius of curvature of \a theCurve.
11067         #
11068         #  @ref swig_todo "Example"
11069         @ManageTransactions("MeasuOp")
11070         def CurveCurvatureByPoint(self, theCurve, thePoint):
11071             """
11072             Measure curvature of a curve at a point.
11073
11074             Parameters:
11075                 theCurve a curve.
11076                 thePoint given point.
11077
11078             Returns:
11079                 radius of curvature of theCurve.
11080             """
11081             aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
11082             RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
11083             return aCurv
11084         ## @}
11085
11086         ## @name Surface Curvature Measurement
11087         #  Methods for receiving max and min radius of curvature of surfaces
11088         #  in the given point
11089         ## @{
11090
11091         ## Measure max radius of curvature of surface.
11092         #  @param theSurf the given surface.
11093         #  @param theUParam Value of U-parameter on the referenced surface.
11094         #  @param theVParam Value of V-parameter on the referenced surface.
11095         #  @return max radius of curvature of theSurf.
11096         #
11097         ## @ref swig_todo "Example"
11098         @ManageTransactions("MeasuOp")
11099         def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11100             """
11101             Measure max radius of curvature of surface.
11102
11103             Parameters:
11104                 theSurf the given surface.
11105                 theUParam Value of U-parameter on the referenced surface.
11106                 theVParam Value of V-parameter on the referenced surface.
11107
11108             Returns:
11109                 max radius of curvature of theSurf.
11110             """
11111             # Example: see GEOM_TestMeasures.py
11112             aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11113             RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
11114             return aSurf
11115
11116         ## Measure max radius of curvature of surface in the given point
11117         #  @param theSurf the given surface.
11118         #  @param thePoint given point.
11119         #  @return max radius of curvature of theSurf.
11120         #
11121         ## @ref swig_todo "Example"
11122         @ManageTransactions("MeasuOp")
11123         def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
11124             """
11125             Measure max radius of curvature of surface in the given point.
11126
11127             Parameters:
11128                 theSurf the given surface.
11129                 thePoint given point.
11130
11131             Returns:
11132                 max radius of curvature of theSurf.
11133             """
11134             aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
11135             RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
11136             return aSurf
11137
11138         ## Measure min radius of curvature of surface.
11139         #  @param theSurf the given surface.
11140         #  @param theUParam Value of U-parameter on the referenced surface.
11141         #  @param theVParam Value of V-parameter on the referenced surface.
11142         #  @return min radius of curvature of theSurf.
11143         #
11144         ## @ref swig_todo "Example"
11145         @ManageTransactions("MeasuOp")
11146         def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11147             """
11148             Measure min radius of curvature of surface.
11149
11150             Parameters:
11151                 theSurf the given surface.
11152                 theUParam Value of U-parameter on the referenced surface.
11153                 theVParam Value of V-parameter on the referenced surface.
11154
11155             Returns:
11156                 Min radius of curvature of theSurf.
11157             """
11158             aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11159             RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
11160             return aSurf
11161
11162         ## Measure min radius of curvature of surface in the given point
11163         #  @param theSurf the given surface.
11164         #  @param thePoint given point.
11165         #  @return min radius of curvature of theSurf.
11166         #
11167         ## @ref swig_todo "Example"
11168         @ManageTransactions("MeasuOp")
11169         def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
11170             """
11171             Measure min radius of curvature of surface in the given point.
11172
11173             Parameters:
11174                 theSurf the given surface.
11175                 thePoint given point.
11176
11177             Returns:
11178                 Min radius of curvature of theSurf.
11179             """
11180             aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
11181             RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
11182             return aSurf
11183         ## @}
11184
11185         ## Measure curvature radius of surface in the given point along the given direction.
11186         #  @param theSurf the given face.
11187         #  @param thePoint given point.
11188         #  @param theDirection given direction.
11189         #  @param theName Object name; when specified, this parameter is used
11190         #         for result publication in the study. Otherwise, if automatic
11191         #         publication is switched on, default value is used for result name.
11192         #
11193         #  @return New GEOM.GEOM_Object, containing vector of curvature of theSurf.
11194         #          The returned vector is codirectional with the normal to the face
11195         #          in the given point in case of positive curvature value
11196         #          and opposite to the normal in case of negative curvature.
11197         #          The normal of the returned vector is equal to the
11198         #          absolute value of the curvature radius.
11199         #          Null shape is returned in case of infinite radius
11200         #          (zero curvature), for example, in case of flat face.
11201         #
11202         ## @ref swig_CurvatureOnFace "Example"
11203         @ManageTransactions("MeasuOp")
11204         def CurvatureOnFace(self, theSurf, thePoint, theDirection, theName=None):
11205             """
11206             Measure curvature radius of surface in the given point along the given direction.
11207
11208             Parameters:
11209                 theSurf the given face.
11210                 thePoint given point.
11211                 theDirection given direction.
11212                 theName Object name; when specified, this parameter is used
11213                         for result publication in the study. Otherwise, if automatic
11214                         publication is switched on, default value is used for result name.
11215
11216             Returns:
11217                 New GEOM.GEOM_Object, containing vector of curvature of theSurf.
11218                 The returned vector is codirectional with the normal to the face
11219                 in the given point in case of positive curvature value
11220                 and opposite to the normal in case of negative curvature.
11221                 The normal of the returned vector is equal to the
11222                 absolute value of the curvature radius.
11223                 Null shape is returned in case of infinite radius
11224                 (zero curvature), for example, in case of flat face.
11225
11226             Example of usage:
11227                 curvature_1 = geompy.CurvatureOnFace(Face_1, Vertex_1, OX)
11228             """
11229             aVec = self.MeasuOp.SurfaceCurvatureByPointAndDirection(theSurf,thePoint,theDirection)
11230             if self.MeasuOp.GetErrorCode() != "ZERO_CURVATURE":
11231                 RaiseIfFailed("CurvatureOnFace", self.MeasuOp)
11232                 self._autoPublish(aVec, theName, "curvature")
11233             return aVec
11234
11235         ## Convert X,Y,Z points coordinates to UV parameters on the given surface.
11236         #  @param theSurf the given face. It can be also a shell or a compound with one face.
11237         #  @param theXYZlist float list of size 3*N where N is the number of points
11238         #                    for which we want their U,V coordinates.
11239         #                    If the user enters a list of size not divisible by 3
11240         #                    an exception will be thrown.
11241         #  @param theIsNormalized if True, the returned parameters will be in range [0, 1].
11242         #
11243         #  @return list of float of size 2*N.
11244         #
11245         #  @ref tui_xyz_to_uv_page "Example"
11246         @ManageTransactions("MeasuOp")
11247         def XYZtoUV(self, theSurf, theXYZlist, theIsNormalized = True):
11248             """
11249             Convert X,Y,Z points coordinates to UV parameters on the given surface.
11250
11251             Parameters:
11252                 theSurf the given face. It can be also a shell or a compound with one face.
11253                 theXYZlist float list of size 3*N where N is the number of points
11254                            for which we want their U,V coordinates.
11255                            If the user enters a list of size not divisible by 3
11256                            an exception will be thrown.
11257                 theIsNormalized if True, the returned parameters will be in range [0, 1].
11258
11259             Returns:
11260                 list of float of size 2*N.
11261
11262             Example of usage:
11263                 [u1,v1, u2,v2] = geompy.XYZtoUV(Face_1, [0,0,0, 0,10,10])
11264             """
11265             aUVlist = self.MeasuOp.XYZtoUV(theSurf, theXYZlist, theIsNormalized)
11266             RaiseIfFailed("XYZtoUV", self.MeasuOp)
11267             return aUVlist
11268
11269         ## Convert UV parameters on the given surface to 3D points coordinates.
11270         #  @param theSurf the given face. It can be also a shell or a compound with one face.
11271         #  @param theUVlist float list of size 2*N where N is the number of points
11272         #                   for which we want their X,Y,Z coordinates.
11273         #                   If the user enters a list of non-even size
11274         #                   an exception will be thrown.
11275         #  @param theIsNormalized if True, the input parameters are expected to be in range [0, 1].
11276         #
11277         #  @return list of float of size 3*N.
11278         #
11279         #  @ref tui_xyz_to_uv_page "Example"
11280         @ManageTransactions("MeasuOp")
11281         def UVtoXYZ(self, theSurf, theUVlist, theIsNormalized = True):
11282             """
11283             Convert UV parameters on the given surface to 3D points coordinates.
11284
11285             Parameters:
11286                 theSurf the given face. It can be also a shell or a compound with one face.
11287                 theUVlist float list of size 2*N where N is the number of points
11288                           for which we want their X,Y,Z coordinates.
11289                           If the user enters a list of non-even size
11290                           an exception will be thrown.
11291                 theIsNormalized if True, the input parameters are expected to be in range [0, 1].
11292
11293             Returns:
11294                 list of float of size 3*N.
11295
11296             Example of usage:
11297                 [x1,y1,z1, x2,y2,z2] = geompy.UVtoXYZ(Face_1, [0,0, 10,10])
11298             """
11299             aXYZlist = self.MeasuOp.UVtoXYZ(theSurf, theUVlist, theIsNormalized)
11300             RaiseIfFailed("UVtoXYZ", self.MeasuOp)
11301             return aXYZlist
11302
11303         ## Get min and max tolerances of sub-shapes of theShape
11304         #  @param theShape Shape, to get tolerances of.
11305         #  @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
11306         #  FaceMin,FaceMax: Min and max tolerances of the faces.\n
11307         #  EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
11308         #  VertMin,VertMax: Min and max tolerances of the vertices.
11309         #
11310         #  @ref tui_tolerance_page "Example"
11311         @ManageTransactions("MeasuOp")
11312         def Tolerance(self,theShape):
11313             """
11314             Get min and max tolerances of sub-shapes of theShape
11315
11316             Parameters:
11317                 theShape Shape, to get tolerances of.
11318
11319             Returns:
11320                 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
11321                  FaceMin,FaceMax: Min and max tolerances of the faces.
11322                  EdgeMin,EdgeMax: Min and max tolerances of the edges.
11323                  VertMin,VertMax: Min and max tolerances of the vertices.
11324             """
11325             # Example: see GEOM_TestMeasures.py
11326             aTuple = self.MeasuOp.GetTolerance(theShape)
11327             RaiseIfFailed("GetTolerance", self.MeasuOp)
11328             return aTuple
11329
11330         ## Obtain description of the given shape (number of sub-shapes of each type)
11331         #  @param theShape Shape to be described.
11332         #  @return Description of the given shape.
11333         #
11334         #  @ref tui_whatis_page "Example"
11335         @ManageTransactions("MeasuOp")
11336         def WhatIs(self,theShape):
11337             """
11338             Obtain description of the given shape (number of sub-shapes of each type)
11339
11340             Parameters:
11341                 theShape Shape to be described.
11342
11343             Returns:
11344                 Description of the given shape.
11345             """
11346             # Example: see GEOM_TestMeasures.py
11347             aDescr = self.MeasuOp.WhatIs(theShape)
11348             RaiseIfFailed("WhatIs", self.MeasuOp)
11349             return aDescr
11350
11351         ## Obtain quantity of shapes of the given type in \a theShape.
11352         #  If \a theShape is of type \a theType, it is also counted.
11353         #  @param theShape Shape to be described.
11354         #  @param theType the given ShapeType().
11355         #  @return Quantity of shapes of type \a theType in \a theShape.
11356         #
11357         #  @ref tui_measurement_tools_page "Example"
11358         def NbShapes (self, theShape, theType):
11359             """
11360             Obtain quantity of shapes of the given type in theShape.
11361             If theShape is of type theType, it is also counted.
11362
11363             Parameters:
11364                 theShape Shape to be described.
11365                 theType the given geompy.ShapeType
11366
11367             Returns:
11368                 Quantity of shapes of type theType in theShape.
11369             """
11370             # Example: see GEOM_TestMeasures.py
11371             listSh = self.SubShapeAllIDs(theShape, theType)
11372             Nb = len(listSh)
11373             return Nb
11374
11375         ## Obtain quantity of shapes of each type in \a theShape.
11376         #  The \a theShape is also counted.
11377         #  @param theShape Shape to be described.
11378         #  @return Dictionary of ShapeType() with bound quantities of shapes.
11379         #
11380         #  @ref tui_measurement_tools_page "Example"
11381         def ShapeInfo (self, theShape):
11382             """
11383             Obtain quantity of shapes of each type in theShape.
11384             The theShape is also counted.
11385
11386             Parameters:
11387                 theShape Shape to be described.
11388
11389             Returns:
11390                 Dictionary of geompy.ShapeType with bound quantities of shapes.
11391             """
11392             # Example: see GEOM_TestMeasures.py
11393             aDict = {}
11394             for typeSh in self.ShapeType:
11395                 if typeSh in ( "AUTO", "SHAPE" ): continue
11396                 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
11397                 Nb = len(listSh)
11398                 aDict[typeSh] = Nb
11399                 pass
11400             return aDict
11401
11402         def GetCreationInformation(self, theShape):
11403             res = ''
11404             infos = theShape.GetCreationInformation()
11405             for info in infos:
11406                 # operationName
11407                 opName = info.operationName
11408                 if not opName: opName = "no info available"
11409                 if res: res += "\n"
11410                 res += "Operation: " + opName
11411                 # parameters
11412                 for parVal in info.params:
11413                     res += "\n \t%s = %s" % ( parVal.name, parVal.value )
11414             return res
11415
11416         ## Get a point, situated at the centre of mass of theShape.
11417         #  @param theShape Shape to define centre of mass of.
11418         #  @param theName Object name; when specified, this parameter is used
11419         #         for result publication in the study. Otherwise, if automatic
11420         #         publication is switched on, default value is used for result name.
11421         #
11422         #  @return New GEOM.GEOM_Object, containing the created point.
11423         #
11424         #  @ref tui_center_of_mass_page "Example"
11425         @ManageTransactions("MeasuOp")
11426         def MakeCDG(self, theShape, theName=None):
11427             """
11428             Get a point, situated at the centre of mass of theShape.
11429
11430             Parameters:
11431                 theShape Shape to define centre of mass of.
11432                 theName Object name; when specified, this parameter is used
11433                         for result publication in the study. Otherwise, if automatic
11434                         publication is switched on, default value is used for result name.
11435
11436             Returns:
11437                 New GEOM.GEOM_Object, containing the created point.
11438             """
11439             # Example: see GEOM_TestMeasures.py
11440             anObj = self.MeasuOp.GetCentreOfMass(theShape)
11441             RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11442             self._autoPublish(anObj, theName, "centerOfMass")
11443             return anObj
11444
11445         ## Get a vertex sub-shape by index.
11446         #  @param theShape Shape to find sub-shape.
11447         #  @param theIndex Index to find vertex by this index (starting from zero)
11448         #  @param theUseOri To consider edge/wire orientation or not
11449         #  @param theName Object name; when specified, this parameter is used
11450         #         for result publication in the study. Otherwise, if automatic
11451         #         publication is switched on, default value is used for result name.
11452         #
11453         #  @return New GEOM.GEOM_Object, containing the created vertex.
11454         #
11455         #  @ref tui_measurement_tools_page "Example"
11456         @ManageTransactions("MeasuOp")
11457         def GetVertexByIndex(self, theShape, theIndex, theUseOri=True, theName=None):
11458             """
11459             Get a vertex sub-shape by index.
11460
11461             Parameters:
11462                 theShape Shape to find sub-shape.
11463                 theIndex Index to find vertex by this index (starting from zero)
11464                 theUseOri To consider edge/wire orientation or not
11465                 theName Object name; when specified, this parameter is used
11466                         for result publication in the study. Otherwise, if automatic
11467                         publication is switched on, default value is used for result name.
11468
11469             Returns:
11470                 New GEOM.GEOM_Object, containing the created vertex.
11471             """
11472             # Example: see GEOM_TestMeasures.py
11473             if isinstance( theUseOri, str ): # theUseOri was inserted before theName
11474                 theUseOri, theName = True, theUseOri
11475             anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex, theUseOri)
11476             RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11477             self._autoPublish(anObj, theName, "vertex")
11478             return anObj
11479
11480         ## Get the first vertex of wire/edge depended orientation.
11481         #  @param theShape Shape to find first vertex.
11482         #  @param 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         #  @return New GEOM.GEOM_Object, containing the created vertex.
11487         #
11488         #  @ref tui_measurement_tools_page "Example"
11489         def GetFirstVertex(self, theShape, theName=None):
11490             """
11491             Get the first vertex of wire/edge depended orientation.
11492
11493             Parameters:
11494                 theShape Shape to find first vertex.
11495                 theName Object name; when specified, this parameter is used
11496                         for result publication in the study. Otherwise, if automatic
11497                         publication is switched on, default value is used for result name.
11498
11499             Returns:
11500                 New GEOM.GEOM_Object, containing the created vertex.
11501             """
11502             # Example: see GEOM_TestMeasures.py
11503             # note: auto-publishing is done in self.GetVertexByIndex()
11504             return self.GetVertexByIndex(theShape, 0, True, theName)
11505
11506         ## Get the last vertex of wire/edge depended orientation.
11507         #  @param theShape Shape to find last vertex.
11508         #  @param theName Object name; when specified, this parameter is used
11509         #         for result publication in the study. Otherwise, if automatic
11510         #         publication is switched on, default value is used for result name.
11511         #
11512         #  @return New GEOM.GEOM_Object, containing the created vertex.
11513         #
11514         #  @ref tui_measurement_tools_page "Example"
11515         def GetLastVertex(self, theShape, theName=None):
11516             """
11517             Get the last vertex of wire/edge depended orientation.
11518
11519             Parameters:
11520                 theShape Shape to find last vertex.
11521                 theName Object name; when specified, this parameter is used
11522                         for result publication in the study. Otherwise, if automatic
11523                         publication is switched on, default value is used for result name.
11524
11525             Returns:
11526                 New GEOM.GEOM_Object, containing the created vertex.
11527             """
11528             # Example: see GEOM_TestMeasures.py
11529             nb_vert =  self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11530             # note: auto-publishing is done in self.GetVertexByIndex()
11531             return self.GetVertexByIndex(theShape, (nb_vert-1), True, theName)
11532
11533         ## Get a normale to the given face. If the point is not given,
11534         #  the normale is calculated at the center of mass.
11535         #  @param theFace Face to define normale of.
11536         #  @param theOptionalPoint Point to compute the normale at.
11537         #  @param theName Object name; when specified, this parameter is used
11538         #         for result publication in the study. Otherwise, if automatic
11539         #         publication is switched on, default value is used for result name.
11540         #
11541         #  @return New GEOM.GEOM_Object, containing the created vector.
11542         #
11543         #  @ref swig_todo "Example"
11544         @ManageTransactions("MeasuOp")
11545         def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11546             """
11547             Get a normale to the given face. If the point is not given,
11548             the normale is calculated at the center of mass.
11549
11550             Parameters:
11551                 theFace Face to define normale of.
11552                 theOptionalPoint Point to compute the normale at.
11553                 theName Object name; when specified, this parameter is used
11554                         for result publication in the study. Otherwise, if automatic
11555                         publication is switched on, default value is used for result name.
11556
11557             Returns:
11558                 New GEOM.GEOM_Object, containing the created vector.
11559             """
11560             # Example: see GEOM_TestMeasures.py
11561             anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11562             RaiseIfFailed("GetNormal", self.MeasuOp)
11563             self._autoPublish(anObj, theName, "normal")
11564             return anObj
11565
11566         ## Print shape errors obtained from CheckShape.
11567         #  @param theShape Shape that was checked.
11568         #  @param theShapeErrors the shape errors obtained by CheckShape.
11569         #  @param theReturnStatus If 0 the description of problem is printed.
11570         #                         If 1 the description of problem is returned.
11571         #  @return If theReturnStatus is equal to 1 the description is returned.
11572         #          Otherwise doesn't return anything.
11573         #
11574         #  @ref tui_check_shape_page "Example"
11575         @ManageTransactions("MeasuOp")
11576         def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11577             """
11578             Print shape errors obtained from CheckShape.
11579
11580             Parameters:
11581                 theShape Shape that was checked.
11582                 theShapeErrors the shape errors obtained by CheckShape.
11583                 theReturnStatus If 0 the description of problem is printed.
11584                                 If 1 the description of problem is returned.
11585
11586             Returns:
11587                 If theReturnStatus is equal to 1 the description is returned.
11588                   Otherwise doesn't return anything.
11589             """
11590             # Example: see GEOM_TestMeasures.py
11591             Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11592             if theReturnStatus == 1:
11593                 return Descr
11594             print(Descr)
11595             pass
11596
11597         ## Check a topology of the given shape.
11598         #  @param theShape Shape to check validity of.
11599         #  @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11600         #                        if TRUE, the shape's geometry will be checked also.
11601         #  @param theReturnStatus If 0 and if theShape is invalid, a description
11602         #                         of problem is printed.
11603         #                         If 1 isValid flag and the description of
11604         #                         problem is returned.
11605         #                         If 2 isValid flag and the list of error data
11606         #                         is returned.
11607         #  @return TRUE, if the shape "seems to be valid".
11608         #          If theShape is invalid, prints a description of problem.
11609         #          If theReturnStatus is equal to 1 the description is returned
11610         #          along with IsValid flag.
11611         #          If theReturnStatus is equal to 2 the list of error data is
11612         #          returned along with IsValid flag.
11613         #
11614         #  @ref tui_check_shape_page "Example"
11615         @ManageTransactions("MeasuOp")
11616         def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11617             """
11618             Check a topology of the given shape.
11619
11620             Parameters:
11621                 theShape Shape to check validity of.
11622                 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11623                                if TRUE, the shape's geometry will be checked also.
11624                 theReturnStatus If 0 and if theShape is invalid, a description
11625                                 of problem is printed.
11626                                 If 1 IsValid flag and the description of
11627                                 problem is returned.
11628                                 If 2 IsValid flag and the list of error data
11629                                 is returned.
11630
11631             Returns:
11632                 TRUE, if the shape "seems to be valid".
11633                 If theShape is invalid, prints a description of problem.
11634                 If theReturnStatus is equal to 1 the description is returned
11635                 along with IsValid flag.
11636                 If theReturnStatus is equal to 2 the list of error data is
11637                 returned along with IsValid flag.
11638             """
11639             # Example: see GEOM_TestMeasures.py
11640             if theIsCheckGeom:
11641                 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11642                 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11643             else:
11644                 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11645                 RaiseIfFailed("CheckShape", self.MeasuOp)
11646             if IsValid == 0:
11647                 if theReturnStatus == 0:
11648                     Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11649                     print(Descr)
11650             if theReturnStatus == 1:
11651               Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11652               return (IsValid, Descr)
11653             elif theReturnStatus == 2:
11654               return (IsValid, ShapeErrors)
11655             return IsValid
11656
11657         ## Detect self-intersections in the given shape.
11658         #  @param theShape Shape to check.
11659         #  @param theCheckLevel is the level of self-intersection check.
11660         #         Possible input values are:
11661         #         - GEOM.SI_V_V(0) - only V/V interferences
11662         #         - GEOM.SI_V_E(1) - V/V and V/E interferences
11663         #         - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11664         #         - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11665         #         - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11666         #         - GEOM.SI_ALL(5) - all interferences.
11667         #  @return TRUE, if the shape contains no self-intersections.
11668         #
11669         #  @ref tui_check_self_intersections_page "Example"
11670         @ManageTransactions("MeasuOp")
11671         def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11672             """
11673             Detect self-intersections in the given shape.
11674
11675             Parameters:
11676                 theShape Shape to check.
11677                 theCheckLevel is the level of self-intersection check.
11678                   Possible input values are:
11679                    - GEOM.SI_V_V(0) - only V/V interferences
11680                    - GEOM.SI_V_E(1) - V/V and V/E interferences
11681                    - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11682                    - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11683                    - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11684                    - GEOM.SI_ALL(5) - all interferences.
11685  
11686             Returns:
11687                 TRUE, if the shape contains no self-intersections.
11688             """
11689             # Example: see GEOM_TestMeasures.py
11690             (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11691             RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11692             return IsValid
11693
11694         ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
11695         #  @param theShape Shape to check.
11696         #  @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11697         #         - if \a theDeflection <= 0, default deflection 0.001 is used
11698         #  @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
11699         #         - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11700         #         - if \a theTolerance > 0, algorithm detects gaps
11701         #  @return TRUE, if the shape contains no self-intersections.
11702         #
11703         #  @ref tui_check_self_intersections_fast_page "Example"
11704         @ManageTransactions("MeasuOp")
11705         def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
11706             """
11707             Detect self-intersections of the given shape with algorithm based on mesh intersections.
11708
11709             Parameters:
11710                 theShape Shape to check.
11711                 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11712                     - if theDeflection <= 0, default deflection 0.001 is used
11713                 theTolerance Specifies a distance between shapes used for detecting gaps:
11714                     - if theTolerance <= 0, algorithm detects intersections (default behavior)
11715                     - if theTolerance > 0, algorithm detects gaps
11716  
11717             Returns:
11718                 TRUE, if the shape contains no self-intersections.
11719             """
11720             # Example: see GEOM_TestMeasures.py
11721             (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
11722             RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
11723             return IsValid
11724
11725         ## Check boolean and partition operations arguments.
11726         #  @param theShape the argument of an operation to be checked
11727         #  @return TRUE if the argument is valid for a boolean or partition
11728         #          operation; FALSE otherwise.
11729         @ManageTransactions("MeasuOp")
11730         def CheckBOPArguments(self, theShape):
11731             """
11732             Check boolean and partition operations arguments.
11733
11734             Parameters:
11735                 theShape the argument of an operation to be checked
11736
11737             Returns:
11738                 TRUE if the argument is valid for a boolean or partition
11739                 operation; FALSE otherwise.
11740             """
11741             return self.MeasuOp.CheckBOPArguments(theShape)
11742
11743         ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11744         #  @param theShape1 First source object
11745         #  @param theShape2 Second source object
11746         #  @param theTolerance Specifies a distance between shapes used for detecting gaps:
11747         #         - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11748         #         - if \a theTolerance > 0, algorithm detects gaps
11749         #  @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11750         #         - if \a theDeflection <= 0, default deflection 0.001 is used
11751         #  @return TRUE, if there are intersections (gaps) between source shapes
11752         #  @return List of sub-shapes IDs from 1st shape that localize intersection.
11753         #  @return List of sub-shapes IDs from 2nd shape that localize intersection.
11754         #
11755         #  @ref tui_fast_intersection_page "Example"
11756         @ManageTransactions("MeasuOp")
11757         def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11758             """
11759             Detect intersections of the given shapes with algorithm based on mesh intersections.
11760
11761             Parameters:
11762                 theShape1 First source object
11763                 theShape2 Second source object
11764                 theTolerance Specifies a distance between shapes used for detecting gaps:
11765                     - if theTolerance <= 0, algorithm detects intersections (default behavior)
11766                     - if theTolerance > 0, algorithm detects gaps
11767                 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11768                     - if theDeflection <= 0, default deflection 0.001 is used
11769  
11770             Returns:
11771                 TRUE, if there are intersections (gaps) between source shapes
11772                 List of sub-shapes IDs from 1st shape that localize intersection.
11773                 List of sub-shapes IDs from 2nd shape that localize intersection.
11774             """
11775             # Example: see GEOM_TestMeasures.py
11776             IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11777             RaiseIfFailed("FastIntersect", self.MeasuOp)
11778             return IsOk, Res1, Res2
11779
11780         ## Get position (LCS) of theShape.
11781         #
11782         #  Origin of the LCS is situated at the shape's center of mass.
11783         #  Axes of the LCS are obtained from shape's location or,
11784         #  if the shape is a planar face, from position of its plane.
11785         #
11786         #  @param theShape Shape to calculate position of.
11787         #  @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11788         #          Ox,Oy,Oz: Coordinates of shape's LCS origin.
11789         #          Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11790         #          Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11791         #
11792         #  @ref swig_todo "Example"
11793         @ManageTransactions("MeasuOp")
11794         def GetPosition(self,theShape):
11795             """
11796             Get position (LCS) of theShape.
11797             Origin of the LCS is situated at the shape's center of mass.
11798             Axes of the LCS are obtained from shape's location or,
11799             if the shape is a planar face, from position of its plane.
11800
11801             Parameters:
11802                 theShape Shape to calculate position of.
11803
11804             Returns:
11805                 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11806                  Ox,Oy,Oz: Coordinates of shape's LCS origin.
11807                  Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11808                  Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11809             """
11810             # Example: see GEOM_TestMeasures.py
11811             aTuple = self.MeasuOp.GetPosition(theShape)
11812             RaiseIfFailed("GetPosition", self.MeasuOp)
11813             return aTuple
11814
11815         ## Get kind of theShape.
11816         #
11817         #  @param theShape Shape to get a kind of.
11818         #  @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11819         #          and a list of parameters, describing the shape.
11820         #  @note  Concrete meaning of each value, returned via \a theIntegers
11821         #         or \a theDoubles list depends on the kind() of the shape.
11822         #
11823         #  @ref swig_todo "Example"
11824         @ManageTransactions("MeasuOp")
11825         def KindOfShape(self,theShape):
11826             """
11827             Get kind of theShape.
11828
11829             Parameters:
11830                 theShape Shape to get a kind of.
11831
11832             Returns:
11833                 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11834                     and a list of parameters, describing the shape.
11835             Note:
11836                 Concrete meaning of each value, returned via theIntegers
11837                 or theDoubles list depends on the geompy.kind of the shape
11838             """
11839             # Example: see GEOM_TestMeasures.py
11840             aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11841             RaiseIfFailed("KindOfShape", self.MeasuOp)
11842
11843             aKind  = aRoughTuple[0]
11844             anInts = aRoughTuple[1]
11845             aDbls  = aRoughTuple[2]
11846
11847             # Now there is no exception from this rule:
11848             aKindTuple = [aKind] + aDbls + anInts
11849
11850             # If they are we will regroup parameters for such kind of shape.
11851             # For example:
11852             #if aKind == kind.SOME_KIND:
11853             #    #  SOME_KIND     int int double int double double
11854             #    aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11855
11856             return aKindTuple
11857
11858         ## The function takes a single face with holes and returns a list of faces,
11859         #  first of them is the original face without holes, and the other faces are placed
11860         #  on the same surface as the original face but bounded by each hole wire.
11861         #  If the original face has no holes, it will be returned as an output
11862         #  @param theShape Face to perform operation on.
11863         #
11864         #  @return GEOM.ListOfGO, list created faces, where first of them is the original face without holes
11865         @ManageTransactions("MeasuOp")
11866         def PatchFace(self, theShape):
11867             """
11868             The function takes a single face with holes and returns a list of faces,
11869             first of them is the original face without holes, and the other faces are placed
11870             on the same surface as the original face but bounded by each hole wire.
11871             If the original face has no holes, it will be returned as an output
11872
11873             Parameters:
11874                 theShape  Face to perform operation on.
11875
11876             Returns:
11877                 GEOM.ListOfGO, list created faces, where first of them is the original face without holes
11878
11879             Example of usage:
11880                 Circle_1 = geompy.MakeCircle(None, None, 190)
11881                 Circle_2 = geompy.MakeCircle(None, None, 100)
11882                 Face_1 = geompy.MakeFaceWires([Circle_1], 1)
11883                 Face_2 = geompy.MakeFaceWires([Circle_2], 1)
11884                 Cut_1 = geompy.MakeCutList(Face_1, [Face_2], True)
11885                 faces = geompy.PatchFace(Cut_1)
11886             """
11887             aList = self.MeasuOp.PatchFace(theShape)
11888             RaiseIfFailed("PatchFace", self.MeasuOp)
11889             return aList
11890
11891         ## Returns the string that describes if the shell is good for solid.
11892         #  This is a support method for MakeSolid.
11893         #
11894         #  @param theShell the shell to be checked.
11895         #  @return Returns a string that describes the shell validity for
11896         #          solid construction.
11897         @ManageTransactions("MeasuOp")
11898         def _IsGoodForSolid(self, theShell):
11899             """
11900             Returns the string that describes if the shell is good for solid.
11901             This is a support method for MakeSolid.
11902
11903             Parameter:
11904                 theShell the shell to be checked.
11905
11906             Returns:
11907                 Returns a string that describes the shell validity for
11908                 solid construction.
11909             """
11910             aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11911             return aDescr
11912
11913         ## Obtain a canonical recognition interface.
11914         #  @return An instance of
11915         #          @ref canonicalrecognition.CanonicalRecognition "CanonicalRecognition" interface
11916         #
11917         #  @ref tui_3dsketcher_page "Example"
11918         def CanonicalRecognition (self):
11919             """
11920             Obtain a canonical recognition interface.
11921
11922             Example of usage:
11923                 cr = geompy.CanonicalRecognition()
11924                 cr.isLine(aLine, tolerance)
11925             """
11926             cr = CanonicalRecognition (self)
11927             return cr
11928
11929         # end of l2_measure
11930         ## @}
11931
11932         ## @addtogroup l2_import_export
11933         ## @{
11934
11935         ## Import a shape from the BREP, IGES, STEP or other file
11936         #  (depends on given format) with given name.
11937         #
11938         #  Note: this function is deprecated, it is kept for backward compatibility only
11939         #  Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11940         #
11941         #  @param theFileName The file, containing the shape.
11942         #  @param theFormatName Specify format for the file reading.
11943         #         Available formats can be obtained with InsertOp.ImportTranslators() method.
11944         #         If format 'IGES_SCALE' is used instead of 'IGES' or
11945         #            format 'STEP_SCALE' is used instead of 'STEP',
11946         #            length unit will be set to 'meter' and result model will be scaled.
11947         #  @param theName Object name; when specified, this parameter is used
11948         #         for result publication in the study. Otherwise, if automatic
11949         #         publication is switched on, default value is used for result name.
11950         #
11951         #  @return New GEOM.GEOM_Object, containing the imported shape.
11952         #          If material names are imported it returns the list of
11953         #          objects. The first one is the imported object followed by
11954         #          material groups.
11955         #  @note Auto publishing is allowed for the shape itself. Imported
11956         #        material groups are not automatically published.
11957         #
11958         #  @ref swig_Import_Export "Example"
11959         @ManageTransactions("InsertOp")
11960         def ImportFile(self, theFileName, theFormatName, theName=None):
11961             """
11962             Import a shape from the BREP, IGES, STEP or other file
11963             (depends on given format) with given name.
11964
11965             Note: this function is deprecated, it is kept for backward compatibility only
11966             Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11967
11968             Parameters: 
11969                 theFileName The file, containing the shape.
11970                 theFormatName Specify format for the file reading.
11971                     Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11972                     If format 'IGES_SCALE' is used instead of 'IGES' or
11973                        format 'STEP_SCALE' is used instead of 'STEP',
11974                        length unit will be set to 'meter' and result model will be scaled.
11975                 theName Object name; when specified, this parameter is used
11976                         for result publication in the study. Otherwise, if automatic
11977                         publication is switched on, default value is used for result name.
11978
11979             Returns:
11980                 New GEOM.GEOM_Object, containing the imported shape.
11981                 If material names are imported it returns the list of
11982                 objects. The first one is the imported object followed by
11983                 material groups.
11984             Note:
11985                 Auto publishing is allowed for the shape itself. Imported
11986                 material groups are not automatically published.
11987             """
11988             # Example: see GEOM_TestOthers.py
11989             print("""
11990             WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11991             where <FormatName> is a name of desirable format for importing.
11992             """)
11993             aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11994             RaiseIfFailed("ImportFile", self.InsertOp)
11995             aNbObj = len(aListObj)
11996             if aNbObj > 0:
11997                 self._autoPublish(aListObj[0], theName, "imported")
11998             if aNbObj == 1:
11999                 return aListObj[0]
12000             return aListObj
12001
12002         ## Deprecated analog of ImportFile()
12003         def Import(self, theFileName, theFormatName, theName=None):
12004             """
12005             Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
12006             """
12007             # note: auto-publishing is done in self.ImportFile()
12008             return self.ImportFile(theFileName, theFormatName, theName)
12009
12010         ## Read a shape from the binary stream, containing its bounding representation (BRep).
12011         #
12012         #  @note As the byte-stream representing the shape data can be quite large, this method
12013         #  is not automatically dumped to the Python script with the DumpStudy functionality;
12014         #  so please use this method carefully, only for strong reasons.
12015         #  
12016         #  @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
12017         #  data stream.
12018         #
12019         #  @param theStream The BRep binary stream.
12020         #  @param theName Object name; when specified, this parameter is used
12021         #         for result publication in the study. Otherwise, if automatic
12022         #         publication is switched on, default value is used for result name.
12023         #
12024         #  @return New GEOM_Object, containing the shape, read from theStream.
12025         #
12026         #  @ref swig_Import_Export "Example"
12027         @ManageTransactions("InsertOp")
12028         def RestoreShape (self, theStream, theName=None):
12029             """
12030             Read a shape from the binary stream, containing its bounding representation (BRep).
12031
12032             Note:
12033                 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
12034
12035             Parameters:
12036                 theStream The BRep binary stream.
12037                 theName Object name; when specified, this parameter is used
12038                         for result publication in the study. Otherwise, if automatic
12039                         publication is switched on, default value is used for result name.
12040
12041             Returns:
12042                 New GEOM_Object, containing the shape, read from theStream.
12043             """
12044             # Example: see GEOM_TestOthers.py
12045             if not theStream:
12046                 # this is the workaround to ignore invalid case when data stream is empty
12047                 if int(os.getenv("GEOM_IGNORE_RESTORE_SHAPE", "0")) > 0:
12048                     print("WARNING: Result of RestoreShape is a NULL shape!")
12049                     return None
12050             anObj = self.InsertOp.RestoreShape(theStream)
12051             RaiseIfFailed("RestoreShape", self.InsertOp)
12052             self._autoPublish(anObj, theName, "restored")
12053             return anObj
12054
12055         ## Export the given shape into a file with given name.
12056         #
12057         #  Note: this function is deprecated, it is kept for backward compatibility only
12058         #  Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
12059         #
12060         #  @param theObject Shape to be stored in the file.
12061         #  @param theFileName Name of the file to store the given shape in.
12062         #  @param theFormatName Specify format for the shape storage.
12063         #         Available formats can be obtained with
12064         #         geompy.InsertOp.ExportTranslators()[0] method.
12065         #
12066         #  @ref swig_Import_Export "Example"
12067         @ManageTransactions("InsertOp")
12068         def Export(self, theObject, theFileName, theFormatName):
12069             """
12070             Export the given shape into a file with given name.
12071
12072             Note: this function is deprecated, it is kept for backward compatibility only
12073             Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
12074             
12075             Parameters: 
12076                 theObject Shape to be stored in the file.
12077                 theFileName Name of the file to store the given shape in.
12078                 theFormatName Specify format for the shape storage.
12079                               Available formats can be obtained with
12080                               geompy.InsertOp.ExportTranslators()[0] method.
12081             """
12082             # Example: see GEOM_TestOthers.py
12083             print("""
12084             WARNING: Function Export is deprecated, use Export<FormatName> instead,
12085             where <FormatName> is a name of desirable format for exporting.
12086             """)
12087             self.InsertOp.Export(theObject, theFileName, theFormatName)
12088             if self.InsertOp.IsDone() == 0:
12089                 raise RuntimeError("Export : " + self.InsertOp.GetErrorCode())
12090                 pass
12091             pass
12092
12093         # end of l2_import_export
12094         ## @}
12095
12096         ## @addtogroup l3_blocks
12097         ## @{
12098
12099         ## Create a quadrangle face from four edges. Order of Edges is not
12100         #  important. It is not necessary that edges share the same vertex.
12101         #  @param E1,E2,E3,E4 Edges for the face bound.
12102         #  @param theName Object name; when specified, this parameter is used
12103         #         for result publication in the study. Otherwise, if automatic
12104         #         publication is switched on, default value is used for result name.
12105         #
12106         #  @return New GEOM.GEOM_Object, containing the created face.
12107         #
12108         #  @ref tui_building_by_blocks_page "Example"
12109         @ManageTransactions("BlocksOp")
12110         def MakeQuad(self, E1, E2, E3, E4, theName=None):
12111             """
12112             Create a quadrangle face from four edges. Order of Edges is not
12113             important. It is not necessary that edges share the same vertex.
12114
12115             Parameters:
12116                 E1,E2,E3,E4 Edges for the face bound.
12117                 theName Object name; when specified, this parameter is used
12118                         for result publication in the study. Otherwise, if automatic
12119                         publication is switched on, default value is used for result name.
12120
12121             Returns:
12122                 New GEOM.GEOM_Object, containing the created face.
12123
12124             Example of usage:
12125                 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
12126             """
12127             # Example: see GEOM_Spanner.py
12128             anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
12129             RaiseIfFailed("MakeQuad", self.BlocksOp)
12130             self._autoPublish(anObj, theName, "quad")
12131             return anObj
12132
12133         ## Create a quadrangle face on two edges.
12134         #  The missing edges will be built by creating the shortest ones.
12135         #  @param E1,E2 Two opposite edges for the face.
12136         #  @param theName Object name; when specified, this parameter is used
12137         #         for result publication in the study. Otherwise, if automatic
12138         #         publication is switched on, default value is used for result name.
12139         #
12140         #  @return New GEOM.GEOM_Object, containing the created face.
12141         #
12142         #  @ref tui_building_by_blocks_page "Example"
12143         @ManageTransactions("BlocksOp")
12144         def MakeQuad2Edges(self, E1, E2, theName=None):
12145             """
12146             Create a quadrangle face on two edges.
12147             The missing edges will be built by creating the shortest ones.
12148
12149             Parameters:
12150                 E1,E2 Two opposite edges for the face.
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 face.
12157
12158             Example of usage:
12159                 # create vertices
12160                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
12161                 p2 = geompy.MakeVertex(150.,  30.,   0.)
12162                 p3 = geompy.MakeVertex(  0., 120.,  50.)
12163                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
12164                 # create edges
12165                 edge1 = geompy.MakeEdge(p1, p2)
12166                 edge2 = geompy.MakeEdge(p3, p4)
12167                 # create a quadrangle face from two edges
12168                 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
12169             """
12170             # Example: see GEOM_Spanner.py
12171             anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
12172             RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
12173             self._autoPublish(anObj, theName, "quad")
12174             return anObj
12175
12176         ## Create a quadrangle face with specified corners.
12177         #  The missing edges will be built by creating the shortest ones.
12178         #  @param V1,V2,V3,V4 Corner vertices for the face.
12179         #  @param theName Object name; when specified, this parameter is used
12180         #         for result publication in the study. Otherwise, if automatic
12181         #         publication is switched on, default value is used for result name.
12182         #
12183         #  @return New GEOM.GEOM_Object, containing the created face.
12184         #
12185         #  @ref tui_building_by_blocks_page "Example 1"
12186         #  \n @ref swig_MakeQuad4Vertices "Example 2"
12187         @ManageTransactions("BlocksOp")
12188         def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
12189             """
12190             Create a quadrangle face with specified corners.
12191             The missing edges will be built by creating the shortest ones.
12192
12193             Parameters:
12194                 V1,V2,V3,V4 Corner vertices for the face.
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 created face.
12201
12202             Example of usage:
12203                 # create vertices
12204                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
12205                 p2 = geompy.MakeVertex(150.,  30.,   0.)
12206                 p3 = geompy.MakeVertex(  0., 120.,  50.)
12207                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
12208                 # create a quadrangle from four points in its corners
12209                 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
12210             """
12211             # Example: see GEOM_Spanner.py
12212             anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
12213             RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
12214             self._autoPublish(anObj, theName, "quad")
12215             return anObj
12216
12217         ## Create a hexahedral solid, bounded by the six given faces. Order of
12218         #  faces is not important. It is not necessary that Faces share the same edge.
12219         #  @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12220         #  @param theName Object name; when specified, this parameter is used
12221         #         for result publication in the study. Otherwise, if automatic
12222         #         publication is switched on, default value is used for result name.
12223         #
12224         #  @return New GEOM.GEOM_Object, containing the created solid.
12225         #
12226         #  @ref tui_building_by_blocks_page "Example 1"
12227         #  \n @ref swig_MakeHexa "Example 2"
12228         @ManageTransactions("BlocksOp")
12229         def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
12230             """
12231             Create a hexahedral solid, bounded by the six given faces. Order of
12232             faces is not important. It is not necessary that Faces share the same edge.
12233
12234             Parameters:
12235                 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12236                 theName Object name; when specified, this parameter is used
12237                         for result publication in the study. Otherwise, if automatic
12238                         publication is switched on, default value is used for result name.
12239
12240             Returns:
12241                 New GEOM.GEOM_Object, containing the created solid.
12242
12243             Example of usage:
12244                 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
12245             """
12246             # Example: see GEOM_Spanner.py
12247             anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
12248             RaiseIfFailed("MakeHexa", self.BlocksOp)
12249             self._autoPublish(anObj, theName, "hexa")
12250             return anObj
12251
12252         ## Create a hexahedral solid between two given faces.
12253         #  The missing faces will be built by creating the smallest ones.
12254         #  @param F1,F2 Two opposite faces for the hexahedral solid.
12255         #  @param theName Object name; when specified, this parameter is used
12256         #         for result publication in the study. Otherwise, if automatic
12257         #         publication is switched on, default value is used for result name.
12258         #
12259         #  @return New GEOM.GEOM_Object, containing the created solid.
12260         #
12261         #  @ref tui_building_by_blocks_page "Example 1"
12262         #  \n @ref swig_MakeHexa2Faces "Example 2"
12263         @ManageTransactions("BlocksOp")
12264         def MakeHexa2Faces(self, F1, F2, theName=None):
12265             """
12266             Create a hexahedral solid between two given faces.
12267             The missing faces will be built by creating the smallest ones.
12268
12269             Parameters:
12270                 F1,F2 Two opposite faces for the hexahedral solid.
12271                 theName Object name; when specified, this parameter is used
12272                         for result publication in the study. Otherwise, if automatic
12273                         publication is switched on, default value is used for result name.
12274
12275             Returns:
12276                 New GEOM.GEOM_Object, containing the created solid.
12277
12278             Example of usage:
12279                 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
12280             """
12281             # Example: see GEOM_Spanner.py
12282             anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
12283             RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
12284             self._autoPublish(anObj, theName, "hexa")
12285             return anObj
12286
12287         # end of l3_blocks
12288         ## @}
12289
12290         ## @addtogroup l3_blocks_op
12291         ## @{
12292
12293         ## Get a vertex, found in the given shape by its coordinates.
12294         #  @param theShape Block or a compound of blocks.
12295         #  @param theX,theY,theZ Coordinates of the sought vertex.
12296         #  @param theEpsilon Maximum allowed distance between the resulting
12297         #                    vertex and point with the given coordinates.
12298         #  @param theName Object name; when specified, this parameter is used
12299         #         for result publication in the study. Otherwise, if automatic
12300         #         publication is switched on, default value is used for result name.
12301         #
12302         #  @return New GEOM.GEOM_Object, containing the found vertex.
12303         #
12304         #  @ref swig_GetPoint "Example"
12305         @ManageTransactions("BlocksOp")
12306         def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
12307             """
12308             Get a vertex, found in the given shape by its coordinates.
12309
12310             Parameters:
12311                 theShape Block or a compound of blocks.
12312                 theX,theY,theZ Coordinates of the sought vertex.
12313                 theEpsilon Maximum allowed distance between the resulting
12314                            vertex and point with the given coordinates.
12315                 theName Object name; when specified, this parameter is used
12316                         for result publication in the study. Otherwise, if automatic
12317                         publication is switched on, default value is used for result name.
12318
12319             Returns:
12320                 New GEOM.GEOM_Object, containing the found vertex.
12321
12322             Example of usage:
12323                 pnt = geompy.GetPoint(shape, -50,  50,  50, 0.01)
12324             """
12325             # Example: see GEOM_TestOthers.py
12326             anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
12327             RaiseIfFailed("GetPoint", self.BlocksOp)
12328             self._autoPublish(anObj, theName, "vertex")
12329             return anObj
12330
12331         ## Find a vertex of the given shape, which has minimal distance to the given point.
12332         #  @param theShape Any shape.
12333         #  @param thePoint Point, close to the desired vertex.
12334         #  @param theName Object name; when specified, this parameter is used
12335         #         for result publication in the study. Otherwise, if automatic
12336         #         publication is switched on, default value is used for result name.
12337         #
12338         #  @return New GEOM.GEOM_Object, containing the found vertex.
12339         #
12340         #  @ref swig_GetVertexNearPoint "Example"
12341         @ManageTransactions("BlocksOp")
12342         def GetVertexNearPoint(self, theShape, thePoint, theName=None):
12343             """
12344             Find a vertex of the given shape, which has minimal distance to the given point.
12345
12346             Parameters:
12347                 theShape Any shape.
12348                 thePoint Point, close to the desired vertex.
12349                 theName Object name; when specified, this parameter is used
12350                         for result publication in the study. Otherwise, if automatic
12351                         publication is switched on, default value is used for result name.
12352
12353             Returns:
12354                 New GEOM.GEOM_Object, containing the found vertex.
12355
12356             Example of usage:
12357                 pmidle = geompy.MakeVertex(50, 0, 50)
12358                 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
12359             """
12360             # Example: see GEOM_TestOthers.py
12361             anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
12362             RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
12363             self._autoPublish(anObj, theName, "vertex")
12364             return anObj
12365
12366         ## Get an edge, found in the given shape by two given vertices.
12367         #  @param theShape Block or a compound of blocks.
12368         #  @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
12369         #  @param theName Object name; when specified, this parameter is used
12370         #         for result publication in the study. Otherwise, if automatic
12371         #         publication is switched on, default value is used for result name.
12372         #
12373         #  @return New GEOM.GEOM_Object, containing the found edge.
12374         #
12375         #  @ref swig_GetEdge "Example"
12376         @ManageTransactions("BlocksOp")
12377         def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
12378             """
12379             Get an edge, found in the given shape by two given vertices.
12380
12381             Parameters:
12382                 theShape Block or a compound of blocks.
12383                 thePoint1,thePoint2 Points, close to the ends of the desired edge.
12384                 theName Object name; when specified, this parameter is used
12385                         for result publication in the study. Otherwise, if automatic
12386                         publication is switched on, default value is used for result name.
12387
12388             Returns:
12389                 New GEOM.GEOM_Object, containing the found edge.
12390             """
12391             # Example: see GEOM_Spanner.py
12392             anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
12393             RaiseIfFailed("GetEdge", self.BlocksOp)
12394             self._autoPublish(anObj, theName, "edge")
12395             return anObj
12396
12397         ## Find an edge of the given shape, which has minimal distance to the given point.
12398         #  @param theShape Block or a compound of blocks.
12399         #  @param thePoint Point, close to the desired edge.
12400         #  @param theName Object name; when specified, this parameter is used
12401         #         for result publication in the study. Otherwise, if automatic
12402         #         publication is switched on, default value is used for result name.
12403         #
12404         #  @return New GEOM.GEOM_Object, containing the found edge.
12405         #
12406         #  @ref swig_GetEdgeNearPoint "Example"
12407         @ManageTransactions("BlocksOp")
12408         def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
12409             """
12410             Find an edge of the given shape, which has minimal distance to the given point.
12411
12412             Parameters:
12413                 theShape Block or a compound of blocks.
12414                 thePoint Point, close to the desired edge.
12415                 theName Object name; when specified, this parameter is used
12416                         for result publication in the study. Otherwise, if automatic
12417                         publication is switched on, default value is used for result name.
12418
12419             Returns:
12420                 New GEOM.GEOM_Object, containing the found edge.
12421             """
12422             # Example: see GEOM_TestOthers.py
12423             anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
12424             RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
12425             self._autoPublish(anObj, theName, "edge")
12426             return anObj
12427
12428         ## Returns a face, found in the given shape by four given corner vertices.
12429         #  @param theShape Block or a compound of blocks.
12430         #  @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12431         #  @param theName Object name; when specified, this parameter is used
12432         #         for result publication in the study. Otherwise, if automatic
12433         #         publication is switched on, default value is used for result name.
12434         #
12435         #  @return New GEOM.GEOM_Object, containing the found face.
12436         #
12437         #  @ref swig_todo "Example"
12438         @ManageTransactions("BlocksOp")
12439         def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
12440             """
12441             Returns a face, found in the given shape by four given corner vertices.
12442
12443             Parameters:
12444                 theShape Block or a compound of blocks.
12445                 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12446                 theName Object name; when specified, this parameter is used
12447                         for result publication in the study. Otherwise, if automatic
12448                         publication is switched on, default value is used for result name.
12449
12450             Returns:
12451                 New GEOM.GEOM_Object, containing the found face.
12452             """
12453             # Example: see GEOM_Spanner.py
12454             anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
12455             RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
12456             self._autoPublish(anObj, theName, "face")
12457             return anObj
12458
12459         ## Get a face of block, found in the given shape by two given edges.
12460         #  @param theShape Block or a compound of blocks.
12461         #  @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
12462         #  @param theName Object name; when specified, this parameter is used
12463         #         for result publication in the study. Otherwise, if automatic
12464         #         publication is switched on, default value is used for result name.
12465         #
12466         #  @return New GEOM.GEOM_Object, containing the found face.
12467         #
12468         #  @ref swig_todo "Example"
12469         @ManageTransactions("BlocksOp")
12470         def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
12471             """
12472             Get a face of block, found in the given shape by two given edges.
12473
12474             Parameters:
12475                 theShape Block or a compound of blocks.
12476                 theEdge1,theEdge2 Edges, close to the edges of the desired face.
12477                 theName Object name; when specified, this parameter is used
12478                         for result publication in the study. Otherwise, if automatic
12479                         publication is switched on, default value is used for result name.
12480
12481             Returns:
12482                 New GEOM.GEOM_Object, containing the found face.
12483             """
12484             # Example: see GEOM_Spanner.py
12485             anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
12486             RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
12487             self._autoPublish(anObj, theName, "face")
12488             return anObj
12489
12490         ## Find a face, opposite to the given one in the given block.
12491         #  @param theBlock Must be a hexahedral solid.
12492         #  @param theFace Face of \a theBlock, opposite to the desired face.
12493         #  @param theName Object name; when specified, this parameter is used
12494         #         for result publication in the study. Otherwise, if automatic
12495         #         publication is switched on, default value is used for result name.
12496         #
12497         #  @return New GEOM.GEOM_Object, containing the found face.
12498         #
12499         #  @ref swig_GetOppositeFace "Example"
12500         @ManageTransactions("BlocksOp")
12501         def GetOppositeFace(self, theBlock, theFace, theName=None):
12502             """
12503             Find a face, opposite to the given one in the given block.
12504
12505             Parameters:
12506                 theBlock Must be a hexahedral solid.
12507                 theFace Face of theBlock, opposite to the desired face.
12508                 theName Object name; when specified, this parameter is used
12509                         for result publication in the study. Otherwise, if automatic
12510                         publication is switched on, default value is used for result name.
12511
12512             Returns:
12513                 New GEOM.GEOM_Object, containing the found face.
12514             """
12515             # Example: see GEOM_Spanner.py
12516             anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
12517             RaiseIfFailed("GetOppositeFace", self.BlocksOp)
12518             self._autoPublish(anObj, theName, "face")
12519             return anObj
12520
12521         ## Find a face of the given shape, which has minimal distance to the given point.
12522         #  @param theShape Block or a compound of blocks.
12523         #  @param thePoint Point, close to the desired face.
12524         #  @param theName Object name; when specified, this parameter is used
12525         #         for result publication in the study. Otherwise, if automatic
12526         #         publication is switched on, default value is used for result name.
12527         #
12528         #  @return New GEOM.GEOM_Object, containing the found face.
12529         #
12530         #  @ref swig_GetFaceNearPoint "Example"
12531         @ManageTransactions("BlocksOp")
12532         def GetFaceNearPoint(self, theShape, thePoint, theName=None):
12533             """
12534             Find a face of the given shape, which has minimal distance to the given point.
12535
12536             Parameters:
12537                 theShape Block or a compound of blocks.
12538                 thePoint Point, close to the desired face.
12539                 theName Object name; when specified, this parameter is used
12540                         for result publication in the study. Otherwise, if automatic
12541                         publication is switched on, default value is used for result name.
12542
12543             Returns:
12544                 New GEOM.GEOM_Object, containing the found face.
12545             """
12546             # Example: see GEOM_Spanner.py
12547             anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12548             RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12549             self._autoPublish(anObj, theName, "face")
12550             return anObj
12551
12552         ## Find a face of block, whose outside normale has minimal angle with the given vector.
12553         #  @param theBlock Block or a compound of blocks.
12554         #  @param theVector Vector, close to the normale of the desired face.
12555         #  @param theName Object name; when specified, this parameter is used
12556         #         for result publication in the study. Otherwise, if automatic
12557         #         publication is switched on, default value is used for result name.
12558         #
12559         #  @return New GEOM.GEOM_Object, containing the found face.
12560         #
12561         #  @ref swig_todo "Example"
12562         @ManageTransactions("BlocksOp")
12563         def GetFaceByNormale(self, theBlock, theVector, theName=None):
12564             """
12565             Find a face of block, whose outside normale has minimal angle with the given vector.
12566
12567             Parameters:
12568                 theBlock Block or a compound of blocks.
12569                 theVector Vector, close to the normale of the desired face.
12570                 theName Object name; when specified, this parameter is used
12571                         for result publication in the study. Otherwise, if automatic
12572                         publication is switched on, default value is used for result name.
12573
12574             Returns:
12575                 New GEOM.GEOM_Object, containing the found face.
12576             """
12577             # Example: see GEOM_Spanner.py
12578             anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12579             RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12580             self._autoPublish(anObj, theName, "face")
12581             return anObj
12582
12583         ## Find all sub-shapes of type \a theShapeType of the given shape,
12584         #  which have minimal distance to the given point.
12585         #  @param theShape Any shape.
12586         #  @param thePoint Point, close to the desired shape.
12587         #  @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12588         #  @param theTolerance The tolerance for distances comparison. All shapes
12589         #                      with distances to the given point in interval
12590         #                      [minimal_distance, minimal_distance + theTolerance] will be gathered.
12591         #  @param theName Object name; when specified, this parameter is used
12592         #         for result publication in the study. Otherwise, if automatic
12593         #         publication is switched on, default value is used for result name.
12594         #
12595         #  @return New GEOM_Object, containing a group of all found shapes.
12596         #
12597         #  @ref swig_GetShapesNearPoint "Example"
12598         @ManageTransactions("BlocksOp")
12599         def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12600             """
12601             Find all sub-shapes of type theShapeType of the given shape,
12602             which have minimal distance to the given point.
12603
12604             Parameters:
12605                 theShape Any shape.
12606                 thePoint Point, close to the desired shape.
12607                 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12608                 theTolerance The tolerance for distances comparison. All shapes
12609                                 with distances to the given point in interval
12610                                 [minimal_distance, minimal_distance + theTolerance] will be gathered.
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                 New GEOM_Object, containing a group of all found shapes.
12617             """
12618             # Example: see GEOM_TestOthers.py
12619             anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12620             RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12621             self._autoPublish(anObj, theName, "group")
12622             return anObj
12623
12624         # end of l3_blocks_op
12625         ## @}
12626
12627         ## @addtogroup l4_blocks_measure
12628         ## @{
12629
12630         ## Check, if the compound of blocks is given.
12631         #  To be considered as a compound of blocks, the
12632         #  given shape must satisfy the following conditions:
12633         #  - Each element of the compound should be a Block (6 faces).
12634         #  - Each face should be a quadrangle, i.e. it should have only 1 wire
12635         #       with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12636         #       there are more than 4 edges in the only wire of a face,
12637         #       this face is considered to be quadrangle if it has 4 bounds
12638         #       (1 or more edge) of C1 continuity.
12639         #  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12640         #  - The compound should be connexe.
12641         #  - The glue between two quadrangle faces should be applied.
12642         #  @param theCompound The compound to check.
12643         #  @param theIsUseC1 Flag to check if there are 4 bounds on a face
12644         #         taking into account C1 continuity.
12645         #  @param theAngTolerance the angular tolerance to check if two neighbor
12646         #         edges are codirectional in the common vertex with this
12647         #         tolerance. This parameter is used only if
12648         #         <VAR>theIsUseC1</VAR> is set to True.
12649         #  @return TRUE, if the given shape is a compound of blocks.
12650         #  If theCompound is not valid, prints all discovered errors.
12651         #
12652         #  @ref tui_check_compound_of_blocks_page "Example 1"
12653         #  \n @ref swig_CheckCompoundOfBlocks "Example 2"
12654         @ManageTransactions("BlocksOp")
12655         def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12656                                   theAngTolerance = 1.e-12):
12657             """
12658             Check, if the compound of blocks is given.
12659             To be considered as a compound of blocks, the
12660             given shape must satisfy the following conditions:
12661             - Each element of the compound should be a Block (6 faces).
12662             - Each face should be a quadrangle, i.e. it should have only 1 wire
12663                  with 4 edges. If theIsUseC1 is set to True and
12664                  there are more than 4 edges in the only wire of a face,
12665                  this face is considered to be quadrangle if it has 4 bounds
12666                  (1 or more edge) of C1 continuity.
12667             - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12668             - The compound should be connexe.
12669             - The glue between two quadrangle faces should be applied.
12670
12671             Parameters:
12672                 theCompound The compound to check.
12673                 theIsUseC1 Flag to check if there are 4 bounds on a face
12674                            taking into account C1 continuity.
12675                 theAngTolerance the angular tolerance to check if two neighbor
12676                            edges are codirectional in the common vertex with this
12677                            tolerance. This parameter is used only if
12678                            theIsUseC1 is set to True.
12679
12680             Returns:
12681                 TRUE, if the given shape is a compound of blocks.
12682                 If theCompound is not valid, prints all discovered errors.
12683             """
12684             # Example: see GEOM_Spanner.py
12685             aTolerance = -1.0
12686             if theIsUseC1:
12687                 aTolerance = theAngTolerance
12688             (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12689             RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12690             if IsValid == 0:
12691                 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12692                 print(Descr)
12693             return IsValid
12694
12695         ## Retrieve all non blocks solids and faces from \a theShape.
12696         #  @param theShape The shape to explore.
12697         #  @param theIsUseC1 Flag to check if there are 4 bounds on a face
12698         #         taking into account C1 continuity.
12699         #  @param theAngTolerance the angular tolerance to check if two neighbor
12700         #         edges are codirectional in the common vertex with this
12701         #         tolerance. This parameter is used only if
12702         #         <VAR>theIsUseC1</VAR> is set to True.
12703         #  @param theName Object name; when specified, this parameter is used
12704         #         for result publication in the study. Otherwise, if automatic
12705         #         publication is switched on, default value is used for result name.
12706         #
12707         #  @return A tuple of two GEOM_Objects. The first object is a group of all
12708         #          non block solids (= not 6 faces, or with 6 faces, but with the
12709         #          presence of non-quadrangular faces). The second object is a
12710         #          group of all non quadrangular faces (= faces with more then
12711         #          1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12712         #          with 1 wire with not 4 edges that do not form 4 bounds of
12713         #          C1 continuity).
12714         #
12715         #  @ref tui_get_non_blocks_page "Example 1"
12716         #  \n @ref swig_GetNonBlocks "Example 2"
12717         @ManageTransactions("BlocksOp")
12718         def GetNonBlocks (self, theShape, theIsUseC1 = False,
12719                           theAngTolerance = 1.e-12, theName=None):
12720             """
12721             Retrieve all non blocks solids and faces from theShape.
12722
12723             Parameters:
12724                 theShape The shape to explore.
12725                 theIsUseC1 Flag to check if there are 4 bounds on a face
12726                            taking into account C1 continuity.
12727                 theAngTolerance the angular tolerance to check if two neighbor
12728                            edges are codirectional in the common vertex with this
12729                            tolerance. This parameter is used only if
12730                            theIsUseC1 is set to True.
12731                 theName Object name; when specified, this parameter is used
12732                         for result publication in the study. Otherwise, if automatic
12733                         publication is switched on, default value is used for result name.
12734
12735             Returns:
12736                 A tuple of two GEOM_Objects. The first object is a group of all
12737                 non block solids (= not 6 faces, or with 6 faces, but with the
12738                 presence of non-quadrangular faces). The second object is a
12739                 group of all non quadrangular faces (= faces with more then
12740                 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12741                 with 1 wire with not 4 edges that do not form 4 bounds of
12742                 C1 continuity).
12743
12744             Usage:
12745                 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12746             """
12747             # Example: see GEOM_Spanner.py
12748             aTolerance = -1.0
12749             if theIsUseC1:
12750                 aTolerance = theAngTolerance
12751             aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12752             RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12753             self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12754             return aTuple
12755
12756         ## Remove all seam and degenerated edges from \a theShape.
12757         #  Unite faces and edges, sharing one surface. It means that
12758         #  this faces must have references to one C++ surface object (handle).
12759         #  @param theShape The compound or single solid to remove irregular edges from.
12760         #  @param doUnionFaces If True, then unite faces. If False (the default value),
12761         #         do not unite faces.
12762         #  @param theName Object name; when specified, this parameter is used
12763         #         for result publication in the study. Otherwise, if automatic
12764         #         publication is switched on, default value is used for result name.
12765         #
12766         #  @return Improved shape.
12767         #
12768         #  @ref swig_RemoveExtraEdges "Example"
12769         @ManageTransactions("BlocksOp")
12770         def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12771             """
12772             Remove all seam and degenerated edges from theShape.
12773             Unite faces and edges, sharing one surface. It means that
12774             this faces must have references to one C++ surface object (handle).
12775
12776             Parameters:
12777                 theShape The compound or single solid to remove irregular edges from.
12778                 doUnionFaces If True, then unite faces. If False (the default value),
12779                              do not unite faces.
12780                 theName Object name; when specified, this parameter is used
12781                         for result publication in the study. Otherwise, if automatic
12782                         publication is switched on, default value is used for result name.
12783
12784             Returns:
12785                 Improved shape.
12786             """
12787             # Example: see GEOM_TestOthers.py
12788             nbFacesOptimum = -1 # -1 means do not unite faces
12789             if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12790             anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12791             RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12792             self._autoPublish(anObj, theName, "removeExtraEdges")
12793             return anObj
12794
12795         ## Performs union faces of \a theShape
12796         #  Unite faces sharing one surface. It means that
12797         #  these faces must have references to one C++ surface object (handle).
12798         #  @param theShape The compound or single solid that contains faces
12799         #         to perform union.
12800         #  @param theName Object name; when specified, this parameter is used
12801         #         for result publication in the study. Otherwise, if automatic
12802         #         publication is switched on, default value is used for result name.
12803         #
12804         #  @return Improved shape.
12805         #
12806         #  @ref swig_UnionFaces "Example"
12807         @ManageTransactions("BlocksOp")
12808         def UnionFaces(self, theShape, theName=None):
12809             """
12810             Performs union faces of theShape.
12811             Unite faces sharing one surface. It means that
12812             these faces must have references to one C++ surface object (handle).
12813
12814             Parameters:
12815                 theShape The compound or single solid that contains faces
12816                          to perform union.
12817                 theName Object name; when specified, this parameter is used
12818                         for result publication in the study. Otherwise, if automatic
12819                         publication is switched on, default value is used for result name.
12820
12821             Returns:
12822                 Improved shape.
12823             """
12824             # Example: see GEOM_TestOthers.py
12825             anObj = self.BlocksOp.UnionFaces(theShape)
12826             RaiseIfFailed("UnionFaces", self.BlocksOp)
12827             self._autoPublish(anObj, theName, "unionFaces")
12828             return anObj
12829
12830         ## Check, if the given shape is a blocks compound.
12831         #  Fix all detected errors.
12832         #    \note Single block can be also fixed by this method.
12833         #  @param theShape The compound to check and improve.
12834         #  @param theName Object name; when specified, this parameter is used
12835         #         for result publication in the study. Otherwise, if automatic
12836         #         publication is switched on, default value is used for result name.
12837         #
12838         #  @return Improved compound.
12839         #
12840         #  @ref swig_CheckAndImprove "Example"
12841         @ManageTransactions("BlocksOp")
12842         def CheckAndImprove(self, theShape, theName=None):
12843             """
12844             Check, if the given shape is a blocks compound.
12845             Fix all detected errors.
12846
12847             Note:
12848                 Single block can be also fixed by this method.
12849
12850             Parameters:
12851                 theShape The compound to check and improve.
12852                 theName Object name; when specified, this parameter is used
12853                         for result publication in the study. Otherwise, if automatic
12854                         publication is switched on, default value is used for result name.
12855
12856             Returns:
12857                 Improved compound.
12858             """
12859             # Example: see GEOM_TestOthers.py
12860             anObj = self.BlocksOp.CheckAndImprove(theShape)
12861             RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12862             self._autoPublish(anObj, theName, "improved")
12863             return anObj
12864
12865         # end of l4_blocks_measure
12866         ## @}
12867
12868         ## @addtogroup l3_blocks_op
12869         ## @{
12870
12871         ## Get all the blocks, contained in the given compound.
12872         #  @param theCompound The compound to explode.
12873         #  @param theMinNbFaces If solid has lower number of faces, it is not a block.
12874         #  @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12875         #  @param theName Object name; when specified, this parameter is used
12876         #         for result publication in the study. Otherwise, if automatic
12877         #         publication is switched on, default value is used for result name.
12878         #
12879         #  @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12880         #
12881         #  @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12882         #
12883         #  @ref tui_explode_on_blocks "Example 1"
12884         #  \n @ref swig_MakeBlockExplode "Example 2"
12885         @ManageTransactions("BlocksOp")
12886         def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12887             """
12888             Get all the blocks, contained in the given compound.
12889
12890             Parameters:
12891                 theCompound The compound to explode.
12892                 theMinNbFaces If solid has lower number of faces, it is not a block.
12893                 theMaxNbFaces If solid has higher number of faces, it is not a block.
12894                 theName Object name; when specified, this parameter is used
12895                         for result publication in the study. Otherwise, if automatic
12896                         publication is switched on, default value is used for result name.
12897
12898             Note:
12899                 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12900
12901             Returns:
12902                 List of GEOM.GEOM_Object, containing the retrieved blocks.
12903             """
12904             # Example: see GEOM_TestOthers.py
12905             theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12906             aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12907             RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12908             for anObj in aList:
12909                 anObj.SetParameters(Parameters)
12910                 pass
12911             self._autoPublish(aList, theName, "block")
12912             return aList
12913
12914         ## Find block, containing the given point inside its volume or on boundary.
12915         #  @param theCompound Compound, to find block in.
12916         #  @param thePoint Point, close to the desired block. If the point lays on
12917         #         boundary between some blocks, we return block with nearest center.
12918         #  @param theName Object name; when specified, this parameter is used
12919         #         for result publication in the study. Otherwise, if automatic
12920         #         publication is switched on, default value is used for result name.
12921         #
12922         #  @return New GEOM.GEOM_Object, containing the found block.
12923         #
12924         #  @ref swig_todo "Example"
12925         @ManageTransactions("BlocksOp")
12926         def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12927             """
12928             Find block, containing the given point inside its volume or on boundary.
12929
12930             Parameters:
12931                 theCompound Compound, to find block in.
12932                 thePoint Point, close to the desired block. If the point lays on
12933                          boundary between some blocks, we return block with nearest center.
12934                 theName Object name; when specified, this parameter is used
12935                         for result publication in the study. Otherwise, if automatic
12936                         publication is switched on, default value is used for result name.
12937
12938             Returns:
12939                 New GEOM.GEOM_Object, containing the found block.
12940             """
12941             # Example: see GEOM_Spanner.py
12942             anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12943             RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12944             self._autoPublish(anObj, theName, "block")
12945             return anObj
12946
12947         ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12948         #  @param theCompound Compound, to find block in.
12949         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12950         #  @param theName Object name; when specified, this parameter is used
12951         #         for result publication in the study. Otherwise, if automatic
12952         #         publication is switched on, default value is used for result name.
12953         #
12954         #  @return New GEOM.GEOM_Object, containing the found block.
12955         #
12956         #  @ref swig_GetBlockByParts "Example"
12957         @ManageTransactions("BlocksOp")
12958         def GetBlockByParts(self, theCompound, theParts, theName=None):
12959             """
12960              Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12961
12962              Parameters:
12963                 theCompound Compound, to find block in.
12964                 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12965                 theName Object name; when specified, this parameter is used
12966                         for result publication in the study. Otherwise, if automatic
12967                         publication is switched on, default value is used for result name.
12968
12969             Returns:
12970                 New GEOM_Object, containing the found block.
12971             """
12972             # Example: see GEOM_TestOthers.py
12973             anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12974             RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12975             self._autoPublish(anObj, theName, "block")
12976             return anObj
12977
12978         ## Return all blocks, containing all the elements, passed as the parts.
12979         #  @param theCompound Compound, to find blocks in.
12980         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12981         #  @param theName Object name; when specified, this parameter is used
12982         #         for result publication in the study. Otherwise, if automatic
12983         #         publication is switched on, default value is used for result name.
12984         #
12985         #  @return List of GEOM.GEOM_Object, containing the found blocks.
12986         #
12987         #  @ref swig_todo "Example"
12988         @ManageTransactions("BlocksOp")
12989         def GetBlocksByParts(self, theCompound, theParts, theName=None):
12990             """
12991             Return all blocks, containing all the elements, passed as the parts.
12992
12993             Parameters:
12994                 theCompound Compound, to find blocks in.
12995                 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12996                 theName Object name; when specified, this parameter is used
12997                         for result publication in the study. Otherwise, if automatic
12998                         publication is switched on, default value is used for result name.
12999
13000             Returns:
13001                 List of GEOM.GEOM_Object, containing the found blocks.
13002             """
13003             # Example: see GEOM_Spanner.py
13004             aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
13005             RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
13006             self._autoPublish(aList, theName, "block")
13007             return aList
13008
13009         ## Multi-transformate block and glue the result.
13010         #  Transformation is defined so, as to superpose direction faces.
13011         #  @param Block Hexahedral solid to be multi-transformed.
13012         #  @param DirFace1 ID of First direction face.
13013         #  @param DirFace2 ID of Second direction face.
13014         #  @param NbTimes Quantity of transformations to be done.
13015         #  @param theName Object name; when specified, this parameter is used
13016         #         for result publication in the study. Otherwise, if automatic
13017         #         publication is switched on, default value is used for result name.
13018         #
13019         #  @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
13020         #
13021         #  @return New GEOM.GEOM_Object, containing the result shape.
13022         #
13023         #  @ref tui_multi_transformation "Example"
13024         @ManageTransactions("BlocksOp")
13025         def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
13026             """
13027             Multi-transformate block and glue the result.
13028             Transformation is defined so, as to superpose direction faces.
13029
13030             Parameters:
13031                 Block Hexahedral solid to be multi-transformed.
13032                 DirFace1 ID of First direction face.
13033                 DirFace2 ID of Second direction face.
13034                 NbTimes Quantity of transformations to be done.
13035                 theName Object name; when specified, this parameter is used
13036                         for result publication in the study. Otherwise, if automatic
13037                         publication is switched on, default value is used for result name.
13038
13039             Note:
13040                 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
13041
13042             Returns:
13043                 New GEOM.GEOM_Object, containing the result shape.
13044             """
13045             # Example: see GEOM_Spanner.py
13046             DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
13047             anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
13048             RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
13049             anObj.SetParameters(Parameters)
13050             self._autoPublish(anObj, theName, "transformed")
13051             return anObj
13052
13053         ## Multi-transformate block and glue the result.
13054         #  @param Block Hexahedral solid to be multi-transformed.
13055         #  @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
13056         #  @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
13057         #  @param NbTimesU,NbTimesV Quantity of transformations to be done.
13058         #  @param theName Object name; when specified, this parameter is used
13059         #         for result publication in the study. Otherwise, if automatic
13060         #         publication is switched on, default value is used for result name.
13061         #
13062         #  @return New GEOM.GEOM_Object, containing the result shape.
13063         #
13064         #  @ref tui_multi_transformation "Example"
13065         @ManageTransactions("BlocksOp")
13066         def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
13067                                       DirFace1V, DirFace2V, NbTimesV, theName=None):
13068             """
13069             Multi-transformate block and glue the result.
13070
13071             Parameters:
13072                 Block Hexahedral solid to be multi-transformed.
13073                 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
13074                 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
13075                 NbTimesU,NbTimesV Quantity of transformations to be done.
13076                 theName Object name; when specified, this parameter is used
13077                         for result publication in the study. Otherwise, if automatic
13078                         publication is switched on, default value is used for result name.
13079
13080             Returns:
13081                 New GEOM.GEOM_Object, containing the result shape.
13082             """
13083             # Example: see GEOM_Spanner.py
13084             DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
13085               DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
13086             anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
13087                                                             DirFace1V, DirFace2V, NbTimesV)
13088             RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
13089             anObj.SetParameters(Parameters)
13090             self._autoPublish(anObj, theName, "transformed")
13091             return anObj
13092
13093         ## Build all possible propagation groups.
13094         #  Propagation group is a set of all edges, opposite to one (main)
13095         #  edge of this group directly or through other opposite edges.
13096         #  Notion of Opposite Edge make sense only on quadrangle face.
13097         #  @param theShape Shape to build propagation groups on.
13098         #  @param theName Object name; when specified, this parameter is used
13099         #         for result publication in the study. Otherwise, if automatic
13100         #         publication is switched on, default value is used for result name.
13101         #
13102         #  @return List of GEOM.GEOM_Object, each of them is a propagation group.
13103         #
13104         #  @ref swig_Propagate "Example"
13105         @ManageTransactions("BlocksOp")
13106         def Propagate(self, theShape, theName=None):
13107             """
13108             Build all possible propagation groups.
13109             Propagation group is a set of all edges, opposite to one (main)
13110             edge of this group directly or through other opposite edges.
13111             Notion of Opposite Edge make sense only on quadrangle face.
13112
13113             Parameters:
13114                 theShape Shape to build propagation groups on.
13115                 theName Object name; when specified, this parameter is used
13116                         for result publication in the study. Otherwise, if automatic
13117                         publication is switched on, default value is used for result name.
13118
13119             Returns:
13120                 List of GEOM.GEOM_Object, each of them is a propagation group.
13121             """
13122             # Example: see GEOM_TestOthers.py
13123             listChains = self.BlocksOp.Propagate(theShape)
13124             RaiseIfFailed("Propagate", self.BlocksOp)
13125             self._autoPublish(listChains, theName, "propagate")
13126             return listChains
13127
13128         # end of l3_blocks_op
13129         ## @}
13130
13131         ## @addtogroup l3_groups
13132         ## @{
13133
13134         ## Creates a new group which will store sub-shapes of theMainShape
13135         #  @param theMainShape is a GEOM object on which the group is selected
13136         #  @param theShapeType defines a shape type of the group (see GEOM::shape_type)
13137         #  @param theName Object name; when specified, this parameter is used
13138         #         for result publication in the study. Otherwise, if automatic
13139         #         publication is switched on, default value is used for result name.
13140         #
13141         #  @return a newly created GEOM group (GEOM.GEOM_Object)
13142         #
13143         #  @ref tui_working_with_groups_page "Example 1"
13144         #  \n @ref swig_CreateGroup "Example 2"
13145         @ManageTransactions("GroupOp")
13146         def CreateGroup(self, theMainShape, theShapeType, theName=None):
13147             """
13148             Creates a new group which will store sub-shapes of theMainShape
13149
13150             Parameters:
13151                theMainShape is a GEOM object on which the group is selected
13152                theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
13153                             "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
13154                 theName Object name; when specified, this parameter is used
13155                         for result publication in the study. Otherwise, if automatic
13156                         publication is switched on, default value is used for result name.
13157
13158             Returns:
13159                a newly created GEOM group
13160
13161             Example of usage:
13162                 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
13163
13164             """
13165             # Example: see GEOM_TestOthers.py
13166             anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
13167             RaiseIfFailed("CreateGroup", self.GroupOp)
13168             self._autoPublish(anObj, theName, "group")
13169             return anObj
13170
13171         ## Adds a sub-object with ID theSubShapeId to the group
13172         #  @param theGroup is a GEOM group to which the new sub-shape is added
13173         #  @param theSubShapeID is a sub-shape ID in the main object.
13174         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13175         #
13176         #  @ref tui_working_with_groups_page "Example"
13177         @ManageTransactions("GroupOp")
13178         def AddObject(self,theGroup, theSubShapeID):
13179             """
13180             Adds a sub-object with ID theSubShapeId to the group
13181
13182             Parameters:
13183                 theGroup       is a GEOM group to which the new sub-shape is added
13184                 theSubShapeID  is a sub-shape ID in the main object.
13185
13186             Note:
13187                 Use method GetSubShapeID() to get an unique ID of the sub-shape
13188             """
13189             # Example: see GEOM_TestOthers.py
13190             self.GroupOp.AddObject(theGroup, theSubShapeID)
13191             if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
13192                 RaiseIfFailed("AddObject", self.GroupOp)
13193                 pass
13194             pass
13195
13196         ## Removes a sub-object with ID \a theSubShapeId from the group
13197         #  @param theGroup is a GEOM group from which the new sub-shape is removed
13198         #  @param theSubShapeID is a sub-shape ID in the main object.
13199         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13200         #
13201         #  @ref tui_working_with_groups_page "Example"
13202         @ManageTransactions("GroupOp")
13203         def RemoveObject(self,theGroup, theSubShapeID):
13204             """
13205             Removes a sub-object with ID theSubShapeId from the group
13206
13207             Parameters:
13208                 theGroup is a GEOM group from which the new sub-shape is removed
13209                 theSubShapeID is a sub-shape ID in the main object.
13210
13211             Note:
13212                 Use method GetSubShapeID() to get an unique ID of the sub-shape
13213             """
13214             # Example: see GEOM_TestOthers.py
13215             self.GroupOp.RemoveObject(theGroup, theSubShapeID)
13216             RaiseIfFailed("RemoveObject", self.GroupOp)
13217             pass
13218
13219         ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13220         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
13221         #  @param theSubShapes is a list of sub-shapes to be added.
13222         #
13223         #  @ref tui_working_with_groups_page "Example"
13224         @ManageTransactions("GroupOp")
13225         def UnionList (self,theGroup, theSubShapes):
13226             """
13227             Adds to the group all the given shapes. No errors, if some shapes are already included.
13228
13229             Parameters:
13230                 theGroup is a GEOM group to which the new sub-shapes are added.
13231                 theSubShapes is a list of sub-shapes to be added.
13232             """
13233             # Example: see GEOM_TestOthers.py
13234             self.GroupOp.UnionList(theGroup, theSubShapes)
13235             RaiseIfFailed("UnionList", self.GroupOp)
13236             pass
13237
13238         ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13239         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
13240         #  @param theSubShapes is a list of indices of sub-shapes to be added.
13241         #
13242         #  @ref swig_UnionIDs "Example"
13243         @ManageTransactions("GroupOp")
13244         def UnionIDs(self,theGroup, theSubShapes):
13245             """
13246             Adds to the group all the given shapes. No errors, if some shapes are already included.
13247
13248             Parameters:
13249                 theGroup is a GEOM group to which the new sub-shapes are added.
13250                 theSubShapes is a list of indices of sub-shapes to be added.
13251             """
13252             # Example: see GEOM_TestOthers.py
13253             self.GroupOp.UnionIDs(theGroup, theSubShapes)
13254             RaiseIfFailed("UnionIDs", self.GroupOp)
13255             pass
13256
13257         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13258         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
13259         #  @param theSubShapes is a list of sub-shapes to be removed.
13260         #
13261         #  @ref tui_working_with_groups_page "Example"
13262         @ManageTransactions("GroupOp")
13263         def DifferenceList (self,theGroup, theSubShapes):
13264             """
13265             Removes from the group all the given shapes. No errors, if some shapes are not included.
13266
13267             Parameters:
13268                 theGroup is a GEOM group from which the sub-shapes are removed.
13269                 theSubShapes is a list of sub-shapes to be removed.
13270             """
13271             # Example: see GEOM_TestOthers.py
13272             self.GroupOp.DifferenceList(theGroup, theSubShapes)
13273             RaiseIfFailed("DifferenceList", self.GroupOp)
13274             pass
13275
13276         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13277         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
13278         #  @param theSubShapes is a list of indices of sub-shapes to be removed.
13279         #
13280         #  @ref swig_DifferenceIDs "Example"
13281         @ManageTransactions("GroupOp")
13282         def DifferenceIDs(self,theGroup, theSubShapes):
13283             """
13284             Removes from the group all the given shapes. No errors, if some shapes are not included.
13285
13286             Parameters:
13287                 theGroup is a GEOM group from which the sub-shapes are removed.
13288                 theSubShapes is a list of indices of sub-shapes to be removed.
13289             """
13290             # Example: see GEOM_TestOthers.py
13291             self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
13292             RaiseIfFailed("DifferenceIDs", self.GroupOp)
13293             pass
13294
13295         ## Union of two groups.
13296         #  New group is created. It will contain all entities
13297         #  which are present in groups theGroup1 and theGroup2.
13298         #  @param theGroup1, theGroup2 are the initial GEOM groups
13299         #                              to create the united group from.
13300         #  @param theName Object name; when specified, this parameter is used
13301         #         for result publication in the study. Otherwise, if automatic
13302         #         publication is switched on, default value is used for result name.
13303         #
13304         #  @return a newly created GEOM group.
13305         #
13306         #  @ref tui_union_groups_anchor "Example"
13307         @ManageTransactions("GroupOp")
13308         def UnionGroups (self, theGroup1, theGroup2, theName=None):
13309             """
13310             Union of two groups.
13311             New group is created. It will contain all entities
13312             which are present in groups theGroup1 and theGroup2.
13313
13314             Parameters:
13315                 theGroup1, theGroup2 are the initial GEOM groups
13316                                      to create the united group from.
13317                 theName Object name; when specified, this parameter is used
13318                         for result publication in the study. Otherwise, if automatic
13319                         publication is switched on, default value is used for result name.
13320
13321             Returns:
13322                 a newly created GEOM group.
13323             """
13324             # Example: see GEOM_TestOthers.py
13325             aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
13326             RaiseIfFailed("UnionGroups", self.GroupOp)
13327             self._autoPublish(aGroup, theName, "group")
13328             return aGroup
13329
13330         ## Intersection of two groups.
13331         #  New group is created. It will contain only those entities
13332         #  which are present in both groups theGroup1 and theGroup2.
13333         #  @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13334         #  @param theName Object name; when specified, this parameter is used
13335         #         for result publication in the study. Otherwise, if automatic
13336         #         publication is switched on, default value is used for result name.
13337         #
13338         #  @return a newly created GEOM group.
13339         #
13340         #  @ref tui_intersect_groups_anchor "Example"
13341         @ManageTransactions("GroupOp")
13342         def IntersectGroups (self, theGroup1, theGroup2, theName=None):
13343             """
13344             Intersection of two groups.
13345             New group is created. It will contain only those entities
13346             which are present in both groups theGroup1 and theGroup2.
13347
13348             Parameters:
13349                 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13350                 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             Returns:
13355                 a newly created GEOM group.
13356             """
13357             # Example: see GEOM_TestOthers.py
13358             aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
13359             RaiseIfFailed("IntersectGroups", self.GroupOp)
13360             self._autoPublish(aGroup, theName, "group")
13361             return aGroup
13362
13363         ## Cut of two groups.
13364         #  New group is created. It will contain entities which are
13365         #  present in group theGroup1 but are not present in group theGroup2.
13366         #  @param theGroup1 is a GEOM group to include elements of.
13367         #  @param theGroup2 is a GEOM group to exclude elements of.
13368         #  @param 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         #  @return a newly created GEOM group.
13373         #
13374         #  @ref tui_cut_groups_anchor "Example"
13375         @ManageTransactions("GroupOp")
13376         def CutGroups (self, theGroup1, theGroup2, theName=None):
13377             """
13378             Cut of two groups.
13379             New group is created. It will contain entities which are
13380             present in group theGroup1 but are not present in group theGroup2.
13381
13382             Parameters:
13383                 theGroup1 is a GEOM group to include elements of.
13384                 theGroup2 is a GEOM group to exclude elements of.
13385                 theName Object name; when specified, this parameter is used
13386                         for result publication in the study. Otherwise, if automatic
13387                         publication is switched on, default value is used for result name.
13388
13389             Returns:
13390                 a newly created GEOM group.
13391             """
13392             # Example: see GEOM_TestOthers.py
13393             aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
13394             RaiseIfFailed("CutGroups", self.GroupOp)
13395             self._autoPublish(aGroup, theName, "group")
13396             return aGroup
13397
13398         ## Union of list of groups.
13399         #  New group is created. It will contain all entities that are
13400         #  present in groups listed in theGList.
13401         #  @param theGList is a list of GEOM groups to create the united group from.
13402         #  @param theName Object name; when specified, this parameter is used
13403         #         for result publication in the study. Otherwise, if automatic
13404         #         publication is switched on, default value is used for result name.
13405         #
13406         #  @return a newly created GEOM group.
13407         #
13408         #  @ref tui_union_groups_anchor "Example"
13409         @ManageTransactions("GroupOp")
13410         def UnionListOfGroups (self, theGList, theName=None):
13411             """
13412             Union of list of groups.
13413             New group is created. It will contain all entities that are
13414             present in groups listed in theGList.
13415
13416             Parameters:
13417                 theGList is a list of GEOM groups to create the united group from.
13418                 theName Object name; when specified, this parameter is used
13419                         for result publication in the study. Otherwise, if automatic
13420                         publication is switched on, default value is used for result name.
13421
13422             Returns:
13423                 a newly created GEOM group.
13424             """
13425             # Example: see GEOM_TestOthers.py
13426             aGroup = self.GroupOp.UnionListOfGroups(theGList)
13427             RaiseIfFailed("UnionListOfGroups", self.GroupOp)
13428             self._autoPublish(aGroup, theName, "group")
13429             return aGroup
13430
13431         ## Cut of lists of groups.
13432         #  New group is created. It will contain only entities
13433         #  which are present in groups listed in theGList.
13434         #  @param theGList is a list of GEOM groups to include elements of.
13435         #  @param theName Object name; when specified, this parameter is used
13436         #         for result publication in the study. Otherwise, if automatic
13437         #         publication is switched on, default value is used for result name.
13438         #
13439         #  @return a newly created GEOM group.
13440         #
13441         #  @ref tui_intersect_groups_anchor "Example"
13442         @ManageTransactions("GroupOp")
13443         def IntersectListOfGroups (self, theGList, theName=None):
13444             """
13445             Cut of lists of groups.
13446             New group is created. It will contain only entities
13447             which are present in groups listed in theGList.
13448
13449             Parameters:
13450                 theGList is a list of GEOM groups to include elements of.
13451                 theName Object name; when specified, this parameter is used
13452                         for result publication in the study. Otherwise, if automatic
13453                         publication is switched on, default value is used for result name.
13454
13455             Returns:
13456                 a newly created GEOM group.
13457             """
13458             # Example: see GEOM_TestOthers.py
13459             aGroup = self.GroupOp.IntersectListOfGroups(theGList)
13460             RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
13461             self._autoPublish(aGroup, theName, "group")
13462             return aGroup
13463
13464         ## Cut of lists of groups.
13465         #  New group is created. It will contain only entities
13466         #  which are present in groups listed in theGList1 but
13467         #  are not present in groups from theGList2.
13468         #  @param theGList1 is a list of GEOM groups to include elements of.
13469         #  @param theGList2 is a list of GEOM groups to exclude elements of.
13470         #  @param theName Object name; when specified, this parameter is used
13471         #         for result publication in the study. Otherwise, if automatic
13472         #         publication is switched on, default value is used for result name.
13473         #
13474         #  @return a newly created GEOM group.
13475         #
13476         #  @ref tui_cut_groups_anchor "Example"
13477         @ManageTransactions("GroupOp")
13478         def CutListOfGroups (self, theGList1, theGList2, theName=None):
13479             """
13480             Cut of lists of groups.
13481             New group is created. It will contain only entities
13482             which are present in groups listed in theGList1 but
13483             are not present in groups from theGList2.
13484
13485             Parameters:
13486                 theGList1 is a list of GEOM groups to include elements of.
13487                 theGList2 is a list of GEOM groups to exclude elements of.
13488                 theName Object name; when specified, this parameter is used
13489                         for result publication in the study. Otherwise, if automatic
13490                         publication is switched on, default value is used for result name.
13491
13492             Returns:
13493                 a newly created GEOM group.
13494             """
13495             # Example: see GEOM_TestOthers.py
13496             aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
13497             RaiseIfFailed("CutListOfGroups", self.GroupOp)
13498             self._autoPublish(aGroup, theName, "group")
13499             return aGroup
13500
13501         ## Returns a list of sub-objects ID stored in the group
13502         #  @param theGroup is a GEOM group for which a list of IDs is requested
13503         #
13504         #  @ref swig_GetObjectIDs "Example"
13505         @ManageTransactions("GroupOp")
13506         def GetObjectIDs(self,theGroup):
13507             """
13508             Returns a list of sub-objects ID stored in the group
13509
13510             Parameters:
13511                 theGroup is a GEOM group for which a list of IDs is requested
13512             """
13513             # Example: see GEOM_TestOthers.py
13514             ListIDs = self.GroupOp.GetObjects(theGroup)
13515             RaiseIfFailed("GetObjects", self.GroupOp)
13516             return ListIDs
13517
13518         ## Returns a type of sub-objects stored in the group
13519         #  @param theGroup is a GEOM group which type is returned.
13520         #
13521         #  @ref swig_GetType "Example"
13522         @ManageTransactions("GroupOp")
13523         def GetType(self,theGroup):
13524             """
13525             Returns a type of sub-objects stored in the group
13526
13527             Parameters:
13528                 theGroup is a GEOM group which type is returned.
13529             """
13530             # Example: see GEOM_TestOthers.py
13531             aType = self.GroupOp.GetType(theGroup)
13532             RaiseIfFailed("GetType", self.GroupOp)
13533             return aType
13534
13535         ## Convert a type of geom object from id to string value
13536         #  @param theId is a GEOM object type id.
13537         #  @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13538         #  @ref swig_GetType "Example"
13539         def ShapeIdToType(self, theId):
13540             """
13541             Convert a type of geom object from id to string value
13542
13543             Parameters:
13544                 theId is a GEOM object type id.
13545
13546             Returns:
13547                 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13548             """
13549             if theId == 0:
13550                 return "COPY"
13551             if theId == 1:
13552                 return "IMPORT"
13553             if theId == 2:
13554                 return "POINT"
13555             if theId == 3:
13556                 return "VECTOR"
13557             if theId == 4:
13558                 return "PLANE"
13559             if theId == 5:
13560                 return "LINE"
13561             if theId == 6:
13562                 return "TORUS"
13563             if theId == 7:
13564                 return "BOX"
13565             if theId == 8:
13566                 return "CYLINDER"
13567             if theId == 9:
13568                 return "CONE"
13569             if theId == 10:
13570                 return "SPHERE"
13571             if theId == 11:
13572                 return "PRISM"
13573             if theId == 12:
13574                 return "REVOLUTION"
13575             if theId == 13:
13576                 return "BOOLEAN"
13577             if theId == 14:
13578                 return "PARTITION"
13579             if theId == 15:
13580                 return "POLYLINE"
13581             if theId == 16:
13582                 return "CIRCLE"
13583             if theId == 17:
13584                 return "SPLINE"
13585             if theId == 18:
13586                 return "ELLIPSE"
13587             if theId == 19:
13588                 return "CIRC_ARC"
13589             if theId == 20:
13590                 return "FILLET"
13591             if theId == 21:
13592                 return "CHAMFER"
13593             if theId == 22:
13594                 return "EDGE"
13595             if theId == 23:
13596                 return "WIRE"
13597             if theId == 24:
13598                 return "FACE"
13599             if theId == 25:
13600                 return "SHELL"
13601             if theId == 26:
13602                 return "SOLID"
13603             if theId == 27:
13604                 return "COMPOUND"
13605             if theId == 28:
13606                 return "SUBSHAPE"
13607             if theId == 29:
13608                 return "PIPE"
13609             if theId == 30:
13610                 return "ARCHIMEDE"
13611             if theId == 31:
13612                 return "FILLING"
13613             if theId == 32:
13614                 return "EXPLODE"
13615             if theId == 33:
13616                 return "GLUED"
13617             if theId == 34:
13618                 return "SKETCHER"
13619             if theId == 35:
13620                 return "CDG"
13621             if theId == 36:
13622                 return "FREE_BOUNDS"
13623             if theId == 37:
13624                 return "GROUP"
13625             if theId == 38:
13626                 return "BLOCK"
13627             if theId == 39:
13628                 return "MARKER"
13629             if theId == 40:
13630                 return "THRUSECTIONS"
13631             if theId == 41:
13632                 return "COMPOUNDFILTER"
13633             if theId == 42:
13634                 return "SHAPES_ON_SHAPE"
13635             if theId == 43:
13636                 return "ELLIPSE_ARC"
13637             if theId == 44:
13638                 return "3DSKETCHER"
13639             if theId == 45:
13640                 return "FILLET_2D"
13641             if theId == 46:
13642                 return "FILLET_1D"
13643             if theId == 201:
13644                 return "PIPETSHAPE"
13645             return "Shape Id not exist."
13646
13647         ## Returns a main shape associated with the group
13648         #  @param theGroup is a GEOM group for which a main shape object is requested
13649         #  @return a GEOM object which is a main shape for theGroup
13650         #
13651         #  @ref swig_GetMainShape "Example"
13652         @ManageTransactions("GroupOp")
13653         def GetMainShape(self,theGroup):
13654             """
13655             Returns a main shape associated with the group
13656
13657             Parameters:
13658                 theGroup is a GEOM group for which a main shape object is requested
13659
13660             Returns:
13661                 a GEOM object which is a main shape for theGroup
13662
13663             Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13664             """
13665             # Example: see GEOM_TestOthers.py
13666             anObj = self.GroupOp.GetMainShape(theGroup)
13667             RaiseIfFailed("GetMainShape", self.GroupOp)
13668             return anObj
13669
13670         ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13671         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
13672         #  @param theShape given shape (see GEOM.GEOM_Object)
13673         #  @param min_length minimum length of edges of theShape
13674         #  @param max_length maximum length of edges of theShape
13675         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13676         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13677         #  @param theName Object name; when specified, this parameter is used
13678         #         for result publication in the study. Otherwise, if automatic
13679         #         publication is switched on, default value is used for result name.
13680         #
13681         #  @return a newly created GEOM group of edges
13682         #
13683         #  @@ref swig_todo "Example"
13684         def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13685             """
13686             Create group of edges of theShape, whose length is in range [min_length, max_length].
13687             If include_min/max == 0, edges with length == min/max_length will not be included in result.
13688
13689             Parameters:
13690                 theShape given shape
13691                 min_length minimum length of edges of theShape
13692                 max_length maximum length of edges of theShape
13693                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13694                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13695                 theName Object name; when specified, this parameter is used
13696                         for result publication in the study. Otherwise, if automatic
13697                         publication is switched on, default value is used for result name.
13698
13699              Returns:
13700                 a newly created GEOM group of edges.
13701             """
13702             edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13703             edges_in_range = []
13704             for edge in edges:
13705                 Props = self.BasicProperties(edge)
13706                 if min_length <= Props[0] and Props[0] <= max_length:
13707                     if (not include_min) and (min_length == Props[0]):
13708                         skip = 1
13709                     else:
13710                         if (not include_max) and (Props[0] == max_length):
13711                             skip = 1
13712                         else:
13713                             edges_in_range.append(edge)
13714
13715             if len(edges_in_range) <= 0:
13716                 print("No edges found by given criteria")
13717                 return None
13718
13719             # note: auto-publishing is done in self.CreateGroup()
13720             group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13721             self.UnionList(group_edges, edges_in_range)
13722
13723             return group_edges
13724
13725         ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13726         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
13727         #  @param min_length minimum length of edges of selected shape
13728         #  @param max_length maximum length of edges of selected shape
13729         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13730         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13731         #  @return a newly created GEOM group of edges
13732         #  @ref swig_todo "Example"
13733         def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13734             """
13735             Create group of edges of selected shape, whose length is in range [min_length, max_length].
13736             If include_min/max == 0, edges with length == min/max_length will not be included in result.
13737
13738             Parameters:
13739                 min_length minimum length of edges of selected shape
13740                 max_length maximum length of edges of selected shape
13741                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13742                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13743
13744              Returns:
13745                 a newly created GEOM group of edges.
13746             """
13747             nb_selected = sg.SelectedCount()
13748             if nb_selected < 1:
13749                 print("Select a shape before calling this function, please.")
13750                 return 0
13751             if nb_selected > 1:
13752                 print("Only one shape must be selected")
13753                 return 0
13754
13755             id_shape = sg.getSelected(0)
13756             shape = IDToObject( id_shape )
13757
13758             group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13759
13760             left_str  = " < "
13761             right_str = " < "
13762             if include_min: left_str  = " <= "
13763             if include_max: right_str  = " <= "
13764
13765             self.addToStudyInFather(shape, group_edges, "Group of edges with " + repr(min_length)
13766                                     + left_str + "length" + right_str + repr(max_length))
13767
13768             sg.updateObjBrowser()
13769
13770             return group_edges
13771
13772         # end of l3_groups
13773         ## @}
13774
13775         #@@ insert new functions before this line @@ do not remove this line @@#
13776
13777         ## Create a copy of the given object
13778         #
13779         #  @param theOriginal geometry object for copy
13780         #  @param theName Object name; when specified, this parameter is used
13781         #         for result publication in the study. Otherwise, if automatic
13782         #         publication is switched on, default value is used for result name.
13783         #
13784         #  @return New GEOM_Object, containing the copied shape.
13785         #
13786         #  @ingroup l1_geomBuilder_auxiliary
13787         #  @ref swig_MakeCopy "Example"
13788         @ManageTransactions("InsertOp")
13789         def MakeCopy(self, theOriginal, theName=None):
13790             """
13791             Create a copy of the given object
13792
13793             Parameters:
13794                 theOriginal geometry object for copy
13795                 theName Object name; when specified, this parameter is used
13796                         for result publication in the study. Otherwise, if automatic
13797                         publication is switched on, default value is used for result name.
13798
13799             Returns:
13800                 New GEOM_Object, containing the copied shape.
13801
13802             Example of usage: Copy = geompy.MakeCopy(Box)
13803             """
13804             # Example: see GEOM_TestAll.py
13805             anObj = self.InsertOp.MakeCopy(theOriginal)
13806             RaiseIfFailed("MakeCopy", self.InsertOp)
13807             self._autoPublish(anObj, theName, "copy")
13808             return anObj
13809
13810         ## Add Path to load python scripts from
13811         #  @param Path a path to load python scripts from
13812         #  @ingroup l1_geomBuilder_auxiliary
13813         def addPath(self,Path):
13814             """
13815             Add Path to load python scripts from
13816
13817             Parameters:
13818                 Path a path to load python scripts from
13819             """
13820             if (sys.path.count(Path) < 1):
13821                 sys.path.append(Path)
13822                 pass
13823             pass
13824
13825         ## Load marker texture from the file
13826         #  @param Path a path to the texture file
13827         #  @return unique texture identifier
13828         #  @ingroup l1_geomBuilder_auxiliary
13829         @ManageTransactions("InsertOp")
13830         def LoadTexture(self, Path):
13831             """
13832             Load marker texture from the file
13833
13834             Parameters:
13835                 Path a path to the texture file
13836
13837             Returns:
13838                 unique texture identifier
13839             """
13840             # Example: see GEOM_TestAll.py
13841             ID = self.InsertOp.LoadTexture(Path)
13842             RaiseIfFailed("LoadTexture", self.InsertOp)
13843             return ID
13844
13845         ## Get internal name of the object based on its study entry
13846         #  @note This method does not provide an unique identifier of the geometry object.
13847         #  @note This is internal function of GEOM component, though it can be used outside it for
13848         #  appropriate reason (e.g. for identification of geometry object).
13849         #  @param obj geometry object
13850         #  @return unique object identifier
13851         #  @ingroup l1_geomBuilder_auxiliary
13852         def getObjectID(self, obj):
13853             """
13854             Get internal name of the object based on its study entry.
13855             Note: this method does not provide an unique identifier of the geometry object.
13856             It is an internal function of GEOM component, though it can be used outside GEOM for
13857             appropriate reason (e.g. for identification of geometry object).
13858
13859             Parameters:
13860                 obj geometry object
13861
13862             Returns:
13863                 unique object identifier
13864             """
13865             ID = ""
13866             entry = salome.ObjectToID(obj)
13867             if entry is not None:
13868                 lst = entry.split(":")
13869                 if len(lst) > 0:
13870                     ID = lst[-1] # -1 means last item in the list
13871                     return "GEOM_" + ID
13872             return ID
13873
13874
13875
13876         ## Add marker texture. @a Width and @a Height parameters
13877         #  specify width and height of the texture in pixels.
13878         #  If @a RowData is @c True, @a Texture parameter should represent texture data
13879         #  packed into the byte array. If @a RowData is @c False (default), @a Texture
13880         #  parameter should be unpacked string, in which '1' symbols represent opaque
13881         #  pixels and '0' represent transparent pixels of the texture bitmap.
13882         #
13883         #  @param Width texture width in pixels
13884         #  @param Height texture height in pixels
13885         #  @param Texture texture data
13886         #  @param RowData if @c True, @a Texture data are packed in the byte stream
13887         #  @return unique texture identifier
13888         #  @ingroup l1_geomBuilder_auxiliary
13889         @ManageTransactions("InsertOp")
13890         def AddTexture(self, Width, Height, Texture, RowData=False):
13891             """
13892             Add marker texture. Width and Height parameters
13893             specify width and height of the texture in pixels.
13894             If RowData is True, Texture parameter should represent texture data
13895             packed into the byte array. If RowData is False (default), Texture
13896             parameter should be unpacked string, in which '1' symbols represent opaque
13897             pixels and '0' represent transparent pixels of the texture bitmap.
13898
13899             Parameters:
13900                 Width texture width in pixels
13901                 Height texture height in pixels
13902                 Texture texture data
13903                 RowData if True, Texture data are packed in the byte stream
13904
13905             Returns:
13906                 return unique texture identifier
13907             """
13908             if not RowData: Texture = PackData(Texture)
13909             ID = self.InsertOp.AddTexture(Width, Height, Texture)
13910             RaiseIfFailed("AddTexture", self.InsertOp)
13911             return ID
13912
13913         ## Transfer not topological data from one GEOM object to another.
13914         #
13915         #  @param theObjectFrom the source object of non-topological data
13916         #  @param theObjectTo the destination object of non-topological data
13917         #  @param theFindMethod method to search sub-shapes of theObjectFrom
13918         #         in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13919         #         GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13920         #         Other values of GEOM.find_shape_method are not supported.
13921         #
13922         #  @return True in case of success; False otherwise.
13923         #
13924         #  @ingroup l1_geomBuilder_auxiliary
13925         #
13926         #  @ref swig_TransferData "Example"
13927         @ManageTransactions("InsertOp")
13928         def TransferData(self, theObjectFrom, theObjectTo,
13929                          theFindMethod=GEOM.FSM_GetInPlace):
13930             """
13931             Transfer not topological data from one GEOM object to another.
13932
13933             Parameters:
13934                 theObjectFrom the source object of non-topological data
13935                 theObjectTo the destination object of non-topological data
13936                 theFindMethod method to search sub-shapes of theObjectFrom
13937                               in shape theObjectTo. Possible values are:
13938                               GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13939                               and GEOM.FSM_GetInPlace_Old. Other values of
13940                               GEOM.find_shape_method are not supported.
13941
13942             Returns:
13943                 True in case of success; False otherwise.
13944
13945             # Example: see GEOM_TestOthers.py
13946             """
13947             # Example: see GEOM_TestAll.py
13948             isOk = self.InsertOp.TransferData(theObjectFrom,
13949                                                theObjectTo, theFindMethod)
13950             RaiseIfFailed("TransferData", self.InsertOp)
13951             return isOk
13952
13953         ## Creates a new folder object. It is a container for any GEOM objects.
13954         #  @param Name name of the container
13955         #  @param Father parent object. If None,
13956         #         folder under 'Geometry' root object will be created.
13957         #  @return a new created folder
13958         #  @ingroup l1_publish_data
13959         def NewFolder(self, Name, Father=None):
13960             """
13961             Create a new folder object. It is an auxiliary container for any GEOM objects.
13962
13963             Parameters:
13964                 Name name of the container
13965                 Father parent object. If None,
13966                 folder under 'Geometry' root object will be created.
13967
13968             Returns:
13969                 a new created folder
13970             """
13971             return self.CreateFolder(Name, Father)
13972
13973         ## Move object to the specified folder
13974         #  @param Object object to move
13975         #  @param Folder target folder
13976         #  @ingroup l1_publish_data
13977         def PutToFolder(self, Object, Folder):
13978             """
13979             Move object to the specified folder
13980
13981             Parameters:
13982                 Object object to move
13983                 Folder target folder
13984             """
13985             self.MoveToFolder(Object, Folder)
13986             pass
13987
13988         ## Move list of objects to the specified folder
13989         #  @param ListOfSO list of objects to move
13990         #  @param Folder target folder
13991         #  @ingroup l1_publish_data
13992         def PutListToFolder(self, ListOfSO, Folder):
13993             """
13994             Move list of objects to the specified folder
13995
13996             Parameters:
13997                 ListOfSO list of objects to move
13998                 Folder target folder
13999             """
14000             self.MoveListToFolder(ListOfSO, Folder)
14001             pass
14002
14003         ## @addtogroup l2_field
14004         ## @{
14005
14006         ## Creates a field
14007         #  @param shape the shape the field lies on
14008         #  @param name the field name
14009         #  @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
14010         #  @param dimension dimension of the shape the field lies on
14011         #         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
14012         #  @param componentNames names of components
14013         #  @return a created field
14014         @ManageTransactions("FieldOp")
14015         def CreateField(self, shape, name, type, dimension, componentNames):
14016             """
14017             Creates a field
14018
14019             Parameters:
14020                 shape the shape the field lies on
14021                 name  the field name
14022                 type  type of field data
14023                 dimension dimension of the shape the field lies on
14024                           0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
14025                 componentNames names of components
14026
14027             Returns:
14028                 a created field
14029             """
14030             if isinstance( type, int ):
14031                 if type < 0 or type > 3:
14032                     raise RuntimeError("CreateField : Error: data type must be within [0-3] range")
14033                 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
14034
14035             f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
14036             RaiseIfFailed("CreateField", self.FieldOp)
14037             global geom
14038             geom._autoPublish( f, "", name)
14039             return f
14040
14041         ## Removes a field from the GEOM component
14042         #  @param field the field to remove
14043         def RemoveField(self, field):
14044             "Removes a field from the GEOM component"
14045             global geom
14046             if isinstance( field, GEOM._objref_GEOM_Field ):
14047                 geom.RemoveObject( field )
14048             elif isinstance( field, geomField ):
14049                 geom.RemoveObject( field.field )
14050             else:
14051                 raise RuntimeError("RemoveField() : the object is not a field")
14052             return
14053
14054         ## Returns number of fields on a shape
14055         @ManageTransactions("FieldOp")
14056         def CountFields(self, shape):
14057             "Returns number of fields on a shape"
14058             nb = self.FieldOp.CountFields( shape )
14059             RaiseIfFailed("CountFields", self.FieldOp)
14060             return nb
14061
14062         ## Returns all fields on a shape
14063         @ManageTransactions("FieldOp")
14064         def GetFields(self, shape):
14065             "Returns all fields on a shape"
14066             ff = self.FieldOp.GetFields( shape )
14067             RaiseIfFailed("GetFields", self.FieldOp)
14068             return ff
14069
14070         ## Returns a field on a shape by its name
14071         @ManageTransactions("FieldOp")
14072         def GetField(self, shape, name):
14073             "Returns a field on a shape by its name"
14074             f = self.FieldOp.GetField( shape, name )
14075             RaiseIfFailed("GetField", self.FieldOp)
14076             return f
14077
14078         # end of l2_field
14079         ## @}
14080
14081         ## @addtogroup l2_testing
14082         ## @{
14083
14084         ## Build a mesh on the given shape.
14085         # @param shape the source shape
14086         # @param linear_deflection linear deflection coefficient
14087         # @param is_relative says if given value of deflection is relative to shape's bounding box
14088         # @param angular_deflection angular deflection for edges in degrees
14089         # @return True in case of success; otherwise False.
14090         @ManageTransactions("TestOp")
14091         def Tesselate(self, shape, linear_deflection=0, is_relative=True, angular_deflection=0):
14092             """Build a mesh on the given shape.
14093
14094             Parameters:
14095                 shape the source shape
14096                 linear_deflection linear deflection coefficient
14097                 is_relative says if given value of deflection is relative to shape's bounding box
14098                 angular_deflection angular deflection for edges in degrees
14099
14100             Returns:
14101                 True in case of success; otherwise False.
14102             """
14103             if angular_deflection > 0:
14104                 angular_deflection = angular_deflection * math.pi / 180.
14105             r = self.TestOp.Tesselate(shape, linear_deflection, is_relative, angular_deflection)
14106             RaiseIfFailed("Tesselate", self.TestOp)
14107             return r
14108
14109         ## Obtain a shape checker
14110         #  @return An instance of @ref conformity.CheckConformity "CheckConformity" interface
14111         #
14112         #  @ref tui_conformity_page "Example"
14113         def CheckConformity (self, shape):
14114             """
14115             Obtain a shape checker.
14116
14117             Example of usage:
14118                 conf = geompy.CheckConformity(shape)
14119                 valid = conf.isValid()
14120                 si2d = conf.selfIntersected2D()
14121                 dist = conf.distantShapes()
14122                 small = conf.smallEdges()
14123                 interfer = cc.interferingSubshapes()
14124             """
14125             conf = CheckConformity (shape, self)
14126             return conf
14127
14128         ## Obtain a shape proximity calculator
14129         #  @return An instance of @ref proximity.ShapeProximity "ShapeProximity" interface
14130         #
14131         #  @ref tui_proximity_page "Example"
14132         def ShapeProximity (self):
14133             """
14134             Obtain a shape proximity calculator.
14135
14136             Example of usage:
14137                 prox = geompy.ShapeProximity()
14138                 value = prox.proximity(shape1, shape2)
14139             """
14140             prox = ShapeProximity (self)
14141             return prox
14142
14143         # end of l2_testing
14144         ## @}
14145
14146
14147 # Register the new proxy for GEOM_Gen
14148 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
14149
14150
14151 ## Field on Geometry
14152 #  @ingroup l2_field
14153 class geomField( GEOM._objref_GEOM_Field ):
14154
14155     def __init__(self, *args):
14156         GEOM._objref_GEOM_Field.__init__(self, *args)
14157         self.field = GEOM._objref_GEOM_Field
14158         return
14159
14160     ## Returns the shape the field lies on
14161     def getShape(self):
14162         "Returns the shape the field lies on"
14163         return self.field.GetShape(self)
14164
14165     ## Returns the field name
14166     def getName(self):
14167         "Returns the field name"
14168         return self.field.GetName(self)
14169
14170     ## Returns type of field data as integer [0-3]
14171     def getType(self):
14172         "Returns type of field data"
14173         return EnumToLong(self.field.GetDataType(self))
14174
14175     ## Returns type of field data:
14176     #  one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
14177     def getTypeEnum(self):
14178         "Returns type of field data"
14179         return self.field.GetDataType(self)
14180
14181     ## Returns dimension of the shape the field lies on:
14182     #  0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
14183     def getDimension(self):
14184         """Returns dimension of the shape the field lies on:
14185         0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
14186         return self.field.GetDimension(self)
14187
14188     ## Returns names of components
14189     def getComponents(self):
14190         "Returns names of components"
14191         return self.field.GetComponents(self)
14192
14193     ## Adds a time step to the field
14194     #  @param step the time step number further used as the step identifier
14195     #  @param stamp the time step time
14196     #  @param values the values of the time step
14197     def addStep(self, step, stamp, values):
14198         "Adds a time step to the field"
14199         stp = self.field.AddStep( self, step, stamp )
14200         if not stp:
14201             raise RuntimeError("Field.addStep() : Error: step %s already exists in this field"%step)
14202         global geom
14203         geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
14204         self.setValues( step, values )
14205         return stp
14206
14207     ## Remove a time step from the field
14208     def removeStep(self,step):
14209         "Remove a time step from the field"
14210         stepSO = None
14211         try:
14212             stepObj = self.field.GetStep( self, step )
14213             if stepObj:
14214                 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
14215         except:
14216             #import traceback
14217             #traceback.print_exc()
14218             pass
14219         self.field.RemoveStep( self, step )
14220         if stepSO:
14221             geom.myBuilder.RemoveObjectWithChildren( stepSO )
14222         return
14223
14224     ## Returns number of time steps in the field
14225     def countSteps(self):
14226         "Returns number of time steps in the field"
14227         return self.field.CountSteps(self)
14228
14229     ## Returns a list of time step IDs in the field
14230     def getSteps(self):
14231         "Returns a list of time step IDs in the field"
14232         return self.field.GetSteps(self)
14233
14234     ## Returns a time step by its ID
14235     def getStep(self,step):
14236         "Returns a time step by its ID"
14237         stp = self.field.GetStep(self, step)
14238         if not stp:
14239             raise RuntimeError("Step %s is missing from this field"%step)
14240         return stp
14241
14242     ## Returns the time of the field step
14243     def getStamp(self,step):
14244         "Returns the time of the field step"
14245         return self.getStep(step).GetStamp()
14246
14247     ## Changes the time of the field step
14248     def setStamp(self, step, stamp):
14249         "Changes the time of the field step"
14250         return self.getStep(step).SetStamp(stamp)
14251
14252     ## Returns values of the field step
14253     def getValues(self, step):
14254         "Returns values of the field step"
14255         return self.getStep(step).GetValues()
14256
14257     ## Changes values of the field step
14258     def setValues(self, step, values):
14259         "Changes values of the field step"
14260         stp = self.getStep(step)
14261         errBeg = "Field.setValues(values) : Error: "
14262         try:
14263             ok = stp.SetValues( values )
14264         except Exception as e:
14265             excStr = str(e)
14266             if excStr.find("WrongPythonType") > 0:
14267                 raise RuntimeError(errBeg +\
14268                       "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:])
14269             raise RuntimeError(errBeg + str(e))
14270         if not ok:
14271             nbOK = self.field.GetArraySize(self)
14272             nbKO = len(values)
14273             if nbOK != nbKO:
14274                 raise RuntimeError(errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO))
14275             else:
14276                 raise RuntimeError(errBeg + "failed")
14277         return
14278
14279     pass # end of class geomField
14280
14281 # Register the new proxy for GEOM_Field
14282 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
14283
14284
14285 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
14286 #  interface to GEOM operations.
14287 #
14288 #  Typical use is:
14289 #  \code
14290 #    import salome
14291 #    salome.salome_init()
14292 #    from salome.geom import geomBuilder
14293 #    geompy = geomBuilder.New()
14294 #  \endcode
14295 #  @param  instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
14296 #  @return geomBuilder instance
14297 def New( instance=None):
14298     """
14299     Create a new geomBuilder instance.The geomBuilder class provides the Python
14300     interface to GEOM operations.
14301
14302     Typical use is:
14303         import salome
14304         salome.salome_init()
14305         from salome.geom import geomBuilder
14306         geompy = geomBuilder.New()
14307
14308     Parameters:
14309         instance  CORBA proxy of GEOM Engine. If None, the default Engine is used.
14310     Returns:
14311         geomBuilder instance
14312     """
14313     #print "New geomBuilder ", study, instance
14314     global engine
14315     global geom
14316     global doLcc
14317     if instance and isinstance( instance, SALOMEDS._objref_Study ):
14318         import sys
14319         sys.stderr.write("Warning: 'study' argument is no more needed in geomBuilder.New(). Consider updating your script!!!\n\n")
14320         instance = None
14321     engine = instance
14322     if engine is None:
14323       doLcc = True
14324     geom = geomBuilder()
14325     assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
14326     geom.init_geom()
14327     return geom
14328
14329
14330 # Register methods from the plug-ins in the geomBuilder class 
14331 plugins_var = os.environ.get( "GEOM_PluginsList" )
14332
14333 plugins = None
14334 if plugins_var is not None:
14335     plugins = plugins_var.split( ":" )
14336     plugins=[x for x in plugins if len(x)>0]
14337 if plugins is not None:
14338     for pluginName in plugins:
14339         pluginBuilderName = pluginName + "Builder"
14340         try:
14341             exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
14342         except Exception as e:
14343             from salome_utils import verbose
14344             print("Exception while loading %s: %s" % ( pluginBuilderName, e ))
14345             continue
14346         exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
14347         plugin = eval( pluginBuilderName )
14348         
14349         # add methods from plugin module to the geomBuilder class
14350         for k in dir( plugin ):
14351             if k[0] == '_': continue
14352             method = getattr( plugin, k )
14353             if type( method ).__name__ == 'function':
14354                 if not hasattr( geomBuilder, k ):
14355                     setattr( geomBuilder, k, method )
14356                 pass
14357             pass
14358         del pluginName
14359         pass
14360     pass