Salome HOME
PR: distributed geom and smesh scripts: first step
[modules/geom.git] / src / GEOM_SWIG / geompyDC.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2012  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.
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   : geompyDC.py
23 #  Author : Paul RASCLE, EDF
24 #  Module : GEOM
25
26 """
27     \namespace geompyDC
28     \brief Module geompyDC
29 """
30
31 ## @defgroup l1_geompyDC_auxiliary Auxiliary data structures and methods
32
33 ## @defgroup l1_geompyDC_purpose   All package methods, grouped by their purpose
34 ## @{
35 ##   @defgroup l2_import_export Importing/exporting geometrical objects
36 ##   @defgroup l2_creating      Creating geometrical objects
37 ##   @{
38 ##     @defgroup l3_basic_go      Creating Basic Geometric Objects
39 ##     @{
40 ##       @defgroup l4_curves        Creating Curves
41
42 ##     @}
43 ##     @defgroup l3_3d_primitives Creating 3D Primitives
44 ##     @defgroup l3_complex       Creating Complex Objects
45 ##     @defgroup l3_groups        Working with groups
46 ##     @defgroup l3_blocks        Building by blocks
47 ##     @{
48 ##       @defgroup l4_blocks_measure Check and Improve
49
50 ##     @}
51 ##     @defgroup l3_sketcher      Sketcher
52 ##     @defgroup l3_advanced      Creating Advanced Geometrical Objects
53 ##     @{
54 ##       @defgroup l4_decompose     Decompose objects
55 ##       @defgroup l4_decompose_d   Decompose objects deprecated methods
56 ##       @defgroup l4_access        Access to sub-shapes by their unique IDs inside the main shape
57 ##       @defgroup l4_obtain        Access to sub-shapes by a criteria
58 ##       @defgroup l4_advanced      Advanced objects creation functions
59
60 ##     @}
61
62 ##   @}
63 ##   @defgroup l2_transforming  Transforming geometrical objects
64 ##   @{
65 ##     @defgroup l3_basic_op      Basic Operations
66 ##     @defgroup l3_boolean       Boolean Operations
67 ##     @defgroup l3_transform     Transformation Operations
68 ##     @defgroup l3_local         Local Operations (Fillet, Chamfer and other Features)
69 ##     @defgroup l3_blocks_op     Blocks Operations
70 ##     @defgroup l3_healing       Repairing Operations
71 ##     @defgroup l3_restore_ss    Restore presentation parameters and a tree of sub-shapes
72
73 ##   @}
74 ##   @defgroup l2_measure       Using measurement tools
75
76 ## @}
77
78 # initialize SALOME session in try/except block
79 # to avoid problems in some cases, e.g. when generating documentation
80 try:
81     import salome
82     salome.salome_init()
83     from salome import *
84 except:
85     pass
86
87 from salome_notebook import *
88
89 import GEOM
90 import math
91 import os
92
93 from gsketcher import Sketcher3D
94
95 ## Enumeration ShapeType as a dictionary. \n
96 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
97 #  @ingroup l1_geompyDC_auxiliary
98 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
99
100 ## Raise an Error, containing the Method_name, if Operation is Failed
101 ## @ingroup l1_geompyDC_auxiliary
102 def RaiseIfFailed (Method_name, Operation):
103     if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
104         raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
105
106 ## Return list of variables value from salome notebook
107 ## @ingroup l1_geompyDC_auxiliary
108 def ParseParameters(*parameters):
109     Result = []
110     StringResult = []
111     for parameter in parameters:
112         if isinstance(parameter, list):
113             lResults = ParseParameters(*parameter)
114             if len(lResults) > 0:
115                 Result.append(lResults[:-1])
116                 StringResult += lResults[-1].split(":")
117                 pass
118             pass
119         else:
120             if isinstance(parameter,str):
121                 if notebook.isVariable(parameter):
122                     Result.append(notebook.get(parameter))
123                 else:
124                     raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
125                 pass
126             else:
127                 Result.append(parameter)
128                 pass
129             StringResult.append(str(parameter))
130             pass
131         pass
132     if Result:
133         Result.append(":".join(StringResult))
134     else:
135         Result = ":".join(StringResult)
136     return Result
137
138 ## Return list of variables value from salome notebook
139 ## @ingroup l1_geompyDC_auxiliary
140 def ParseList(list):
141     Result = []
142     StringResult = ""
143     for parameter in list:
144         if isinstance(parameter,str) and notebook.isVariable(parameter):
145             Result.append(str(notebook.get(parameter)))
146             pass
147         else:
148             Result.append(str(parameter))
149             pass
150
151         StringResult = StringResult + str(parameter)
152         StringResult = StringResult + ":"
153         pass
154     StringResult = StringResult[:len(StringResult)-1]
155     return Result, StringResult
156
157 ## Return list of variables value from salome notebook
158 ## @ingroup l1_geompyDC_auxiliary
159 def ParseSketcherCommand(command):
160     Result = ""
161     StringResult = ""
162     sections = command.split(":")
163     for section in sections:
164         parameters = section.split(" ")
165         paramIndex = 1
166         for parameter in parameters:
167             if paramIndex > 1 and parameter.find("'") != -1:
168                 parameter = parameter.replace("'","")
169                 if notebook.isVariable(parameter):
170                     Result = Result + str(notebook.get(parameter)) + " "
171                     pass
172                 else:
173                     raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
174                     pass
175                 pass
176             else:
177                 Result = Result + str(parameter) + " "
178                 pass
179             if paramIndex > 1:
180                 StringResult = StringResult + parameter
181                 StringResult = StringResult + ":"
182                 pass
183             paramIndex = paramIndex + 1
184             pass
185         Result = Result[:len(Result)-1] + ":"
186         pass
187     Result = Result[:len(Result)-1]
188     return Result, StringResult
189
190 ## Helper function which can be used to pack the passed string to the byte data.
191 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
192 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
193 ## For example,
194 ## \code
195 ## val = PackData("10001110") # val = 0xAE
196 ## val = PackData("1")        # val = 0x80
197 ## \endcode
198 ## @param data unpacked data - a string containing '1' and '0' symbols
199 ## @return data packed to the byte stream
200 ## @ingroup l1_geompyDC_auxiliary
201 def PackData(data):
202     """
203     Helper function which can be used to pack the passed string to the byte data.
204     Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
205     If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
206
207     Parameters:
208         data unpacked data - a string containing '1' and '0' symbols
209
210     Returns:
211         data packed to the byte stream
212         
213     Example of usage:
214         val = PackData("10001110") # val = 0xAE
215         val = PackData("1")        # val = 0x80
216     """
217     bytes = len(data)/8
218     if len(data)%8: bytes += 1
219     res = ""
220     for b in range(bytes):
221         d = data[b*8:(b+1)*8]
222         val = 0
223         for i in range(8):
224             val *= 2
225             if i < len(d):
226                 if d[i] == "1": val += 1
227                 elif d[i] != "0":
228                     raise "Invalid symbol %s" % d[i]
229                 pass
230             pass
231         res += chr(val)
232         pass
233     return res
234
235 ## Read bitmap texture from the text file.
236 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
237 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
238 ## The function returns width and height of the pixmap in pixels and byte stream representing
239 ## texture bitmap itself.
240 ##
241 ## This function can be used to read the texture to the byte stream in order to pass it to
242 ## the AddTexture() function of geompyDC class.
243 ## For example,
244 ## \code
245 ## import geompyDC
246 ## geompy = geompyDC.geomInstance(salome.myStudy)
247 ## texture = geompy.readtexture('mytexture.dat')
248 ## texture = geompy.AddTexture(*texture)
249 ## obj.SetMarkerTexture(texture)
250 ## \endcode
251 ## @param fname texture file name
252 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
253 ## @ingroup l1_geompyDC_auxiliary
254 def ReadTexture(fname):
255     """
256     Read bitmap texture from the text file.
257     In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
258     A zero symbol ('0') represents transparent pixel of the texture bitmap.
259     The function returns width and height of the pixmap in pixels and byte stream representing
260     texture bitmap itself.
261     This function can be used to read the texture to the byte stream in order to pass it to
262     the AddTexture() function of geompyDC class.
263     
264     Parameters:
265         fname texture file name
266
267     Returns:
268         sequence of tree values: texture's width, height in pixels and its byte stream
269     
270     Example of usage:
271         import geompyDC
272         geompy = geompyDC.geomInstance(salome.myStudy)
273         texture = geompy.readtexture('mytexture.dat')
274         texture = geompy.AddTexture(*texture)
275         obj.SetMarkerTexture(texture)
276     """
277     try:
278         f = open(fname)
279         lines = [ l.strip() for l in f.readlines()]
280         f.close()
281         maxlen = 0
282         if lines: maxlen = max([len(x) for x in lines])
283         lenbytes = maxlen/8
284         if maxlen%8: lenbytes += 1
285         bytedata=""
286         for line in lines:
287             if len(line)%8:
288                 lenline = (len(line)/8+1)*8
289                 pass
290             else:
291                 lenline = (len(line)/8)*8
292                 pass
293             for i in range(lenline/8):
294                 byte=""
295                 for j in range(8):
296                     if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
297                     else: byte += "0"
298                     pass
299                 bytedata += PackData(byte)
300                 pass
301             for i in range(lenline/8, lenbytes):
302                 bytedata += PackData("0")
303             pass
304         return lenbytes*8, len(lines), bytedata
305     except:
306         pass
307     return 0, 0, ""
308
309 ## Returns a long value from enumeration type
310 #  Can be used for CORBA enumerator types like GEOM.shape_type
311 #  @param theItem enumeration type
312 #  @ingroup l1_geompyDC_auxiliary
313 def EnumToLong(theItem):
314     """
315     Returns a long value from enumeration type
316     Can be used for CORBA enumerator types like geompyDC.ShapeType
317
318     Parameters:
319         theItem enumeration type
320     """
321     ret = theItem
322     if hasattr(theItem, "_v"): ret = theItem._v
323     return ret
324
325 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
326 #  and a list of parameters, describing the shape.
327 #  List of parameters, describing the shape:
328 #  - COMPOUND:            [nb_solids  nb_faces  nb_edges  nb_vertices]
329 #  - COMPSOLID:           [nb_solids  nb_faces  nb_edges  nb_vertices]
330 #
331 #  - SHELL:       [info.CLOSED / info.UNCLOSED  nb_faces  nb_edges  nb_vertices]
332 #
333 #  - WIRE:        [info.CLOSED / info.UNCLOSED nb_edges  nb_vertices]
334 #
335 #  - SPHERE:       [xc yc zc            R]
336 #  - CYLINDER:     [xb yb zb  dx dy dz  R         H]
337 #  - BOX:          [xc yc zc                      ax ay az]
338 #  - ROTATED_BOX:  [xc yc zc  zx zy zz  xx xy xz  ax ay az]
339 #  - TORUS:        [xc yc zc  dx dy dz  R_1  R_2]
340 #  - CONE:         [xb yb zb  dx dy dz  R_1  R_2  H]
341 #  - POLYHEDRON:                       [nb_faces  nb_edges  nb_vertices]
342 #  - SOLID:                            [nb_faces  nb_edges  nb_vertices]
343 #
344 #  - SPHERE2D:     [xc yc zc            R]
345 #  - CYLINDER2D:   [xb yb zb  dx dy dz  R         H]
346 #  - TORUS2D:      [xc yc zc  dx dy dz  R_1  R_2]
347 #  - CONE2D:       [xc yc zc  dx dy dz  R_1  R_2  H]
348 #  - DISK_CIRCLE:  [xc yc zc  dx dy dz  R]
349 #  - DISK_ELLIPSE: [xc yc zc  dx dy dz  R_1  R_2]
350 #  - POLYGON:      [xo yo zo  dx dy dz            nb_edges  nb_vertices]
351 #  - PLANE:        [xo yo zo  dx dy dz]
352 #  - PLANAR:       [xo yo zo  dx dy dz            nb_edges  nb_vertices]
353 #  - FACE:                                       [nb_edges  nb_vertices]
354 #
355 #  - CIRCLE:       [xc yc zc  dx dy dz  R]
356 #  - ARC_CIRCLE:   [xc yc zc  dx dy dz  R         x1 y1 z1  x2 y2 z2]
357 #  - ELLIPSE:      [xc yc zc  dx dy dz  R_1  R_2]
358 #  - ARC_ELLIPSE:  [xc yc zc  dx dy dz  R_1  R_2  x1 y1 z1  x2 y2 z2]
359 #  - LINE:         [xo yo zo  dx dy dz]
360 #  - SEGMENT:      [x1 y1 z1  x2 y2 z2]
361 #  - EDGE:                                                 [nb_vertices]
362 #
363 #  - VERTEX:       [x  y  z]
364 #  @ingroup l1_geompyDC_auxiliary
365 kind = GEOM.GEOM_IKindOfShape
366
367 ## Information about closed/unclosed state of shell or wire
368 #  @ingroup l1_geompyDC_auxiliary
369 class info:
370     """
371     Information about closed/unclosed state of shell or wire
372     """
373     UNKNOWN  = 0
374     CLOSED   = 1
375     UNCLOSED = 2
376
377 # Warning: geom is a singleton
378 geom = None
379 engine = None
380 doLcc = False
381 created = False
382
383 class geompyDC(object, GEOM._objref_GEOM_Gen):
384
385         def __new__(cls):
386             global engine
387             global geom
388             global doLcc
389             global created
390             print "__new__ ", engine, geom, doLcc, created
391             if geom is None:
392                 # geom engine is either retrieved from engine, or created
393                 geom = engine
394                 # Following test avoids a recursive loop
395                 if doLcc:
396                     if geom is not None:
397                         # geom engine not created: existing engine found
398                         doLcc = False
399                     if doLcc and not created:
400                         doLcc = False
401                         created = True
402                         # FindOrLoadComponent called:
403                         # 1. CORBA resolution of server
404                         # 2. the __new__ method is called again
405                         print "FindOrLoadComponent ", engine, geom, doLcc, created
406                         geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
407                 else:
408                     # FindOrLoadComponent not called
409                     if geom is None:
410                         # geompyDC instance is created from lcc.FindOrLoadComponent
411                         created = True
412                         print "super ", engine, geom, doLcc, created
413                         geom = super(geompyDC,cls).__new__(cls)
414                     else:
415                         # geom engine not created: existing engine found
416                         print "existing ", engine, geom, doLcc, created
417                         pass
418
419                 return geom
420
421             return geom
422
423         def __init__(self):
424             #global created
425             #print "-------- geompyDC __init__ --- ", created, self
426             GEOM._objref_GEOM_Gen.__init__(self)
427             self.myBuilder = None
428             self.myStudyId = 0
429             self.father    = None
430
431             self.BasicOp  = None
432             self.CurvesOp = None
433             self.PrimOp   = None
434             self.ShapesOp = None
435             self.HealOp   = None
436             self.InsertOp = None
437             self.BoolOp   = None
438             self.TrsfOp   = None
439             self.LocalOp  = None
440             self.MeasuOp  = None
441             self.BlocksOp = None
442             self.GroupOp  = None
443             self.AdvOp    = None
444             pass
445
446         ## @addtogroup l1_geompyDC_auxiliary
447         ## @{
448         def init_geom(self,theStudy):
449             self.myStudy = theStudy
450             self.myStudyId = self.myStudy._get_StudyId()
451             self.myBuilder = self.myStudy.NewBuilder()
452             self.father = self.myStudy.FindComponent("GEOM")
453             if self.father is None:
454                 self.father = self.myBuilder.NewComponent("GEOM")
455                 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
456                 FName = A1._narrow(SALOMEDS.AttributeName)
457                 FName.SetValue("Geometry")
458                 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
459                 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
460                 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
461                 self.myBuilder.DefineComponentInstance(self.father,self)
462                 pass
463             self.BasicOp  = self.GetIBasicOperations    (self.myStudyId)
464             self.CurvesOp = self.GetICurvesOperations   (self.myStudyId)
465             self.PrimOp   = self.GetI3DPrimOperations   (self.myStudyId)
466             self.ShapesOp = self.GetIShapesOperations   (self.myStudyId)
467             self.HealOp   = self.GetIHealingOperations  (self.myStudyId)
468             self.InsertOp = self.GetIInsertOperations   (self.myStudyId)
469             self.BoolOp   = self.GetIBooleanOperations  (self.myStudyId)
470             self.TrsfOp   = self.GetITransformOperations(self.myStudyId)
471             self.LocalOp  = self.GetILocalOperations    (self.myStudyId)
472             self.MeasuOp  = self.GetIMeasureOperations  (self.myStudyId)
473             self.BlocksOp = self.GetIBlocksOperations   (self.myStudyId)
474             self.GroupOp  = self.GetIGroupOperations    (self.myStudyId)
475             self.AdvOp    = self.GetIAdvancedOperations (self.myStudyId)
476             pass
477
478         ## Dump component to the Python script
479         #  This method overrides IDL function to allow default values for the parameters.
480         def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
481             """
482             Dump component to the Python script
483             This method overrides IDL function to allow default values for the parameters.
484             """
485             return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
486
487         ## Get name for sub-shape aSubObj of shape aMainObj
488         #
489         # @ref swig_SubShapeName "Example"
490         def SubShapeName(self,aSubObj, aMainObj):
491             """
492             Get name for sub-shape aSubObj of shape aMainObj
493             """
494             # Example: see GEOM_TestAll.py
495
496             #aSubId  = orb.object_to_string(aSubObj)
497             #aMainId = orb.object_to_string(aMainObj)
498             #index = gg.getIndexTopology(aSubId, aMainId)
499             #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
500             index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
501             name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
502             return name
503
504         ## Publish in study aShape with name aName
505         #
506         #  \param aShape the shape to be published
507         #  \param aName  the name for the shape
508         #  \param doRestoreSubShapes if True, finds and publishes also
509         #         sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
510         #         and published sub-shapes of arguments
511         #  \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
512         #                                                  these arguments description
513         #  \return study entry of the published shape in form of string
514         #
515         #  @ref swig_all_addtostudy "Example"
516         def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
517                        theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
518             """
519             Publish in study aShape with name aName
520
521             Parameters:
522                 aShape the shape to be published
523                 aName  the name for the shape
524                 doRestoreSubShapes if True, finds and publishes also
525                                    sub-shapes of aShape, corresponding to its arguments
526                                    and published sub-shapes of arguments
527                 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
528                                                          these arguments description
529
530             Returns:
531                 study entry of the published shape in form of string
532
533             Example of usage:
534                 id_block1 = geompy.addToStudy(Block1, "Block 1")
535             """
536             # Example: see GEOM_TestAll.py
537             try:
538                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
539                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
540                 if doRestoreSubShapes:
541                     self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
542                                             theFindMethod, theInheritFirstArg, True )
543             except:
544                 print "addToStudy() failed"
545                 return ""
546             return aShape.GetStudyEntry()
547
548         ## Publish in study aShape with name aName as sub-object of previously published aFather
549         #  \param aFather previously published object
550         #  \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
551         #  \param aName  the name for the shape
552         #
553         #  \return study entry of the published shape in form of string
554         #  @ref swig_all_addtostudyInFather "Example"
555         def addToStudyInFather(self, aFather, aShape, aName):
556             """
557             Publish in study aShape with name aName as sub-object of previously published aFather
558
559             Parameters:
560                 aFather previously published object
561                 aShape the shape to be published as sub-object of aFather
562                 aName  the name for the shape
563
564             Returns:
565                 study entry of the published shape in form of string
566             """
567             # Example: see GEOM_TestAll.py
568             try:
569                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
570                 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
571             except:
572                 print "addToStudyInFather() failed"
573                 return ""
574             return aShape.GetStudyEntry()
575
576         ## Unpublish object in study
577         #
578         #  \param obj the object to be unpublished
579         def hideInStudy(self, obj):
580             """
581             Unpublish object in study
582
583             Parameters:
584                 obj the object to be unpublished
585             """
586             ior = salome.orb.object_to_string(obj)
587             aSObject = self.myStudy.FindObjectIOR(ior)
588             if aSObject is not None:
589                 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
590                 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
591                 drwAttribute.SetDrawable(False)
592                 pass
593
594         # end of l1_geompyDC_auxiliary
595         ## @}
596
597         ## @addtogroup l3_restore_ss
598         ## @{
599
600         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
601         #  To be used from python scripts out of addToStudy() (non-default usage)
602         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
603         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
604         #                   If this list is empty, all operation arguments will be published
605         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
606         #                       their sub-shapes. Value from enumeration GEOM.find_shape_method.
607         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
608         #                            Do not publish sub-shapes in place of arguments, but only
609         #                            in place of sub-shapes of the first argument,
610         #                            because the whole shape corresponds to the first argument.
611         #                            Mainly to be used after transformations, but it also can be
612         #                            usefull after partition with one object shape, and some other
613         #                            operations, where only the first argument has to be considered.
614         #                            If theObject has only one argument shape, this flag is automatically
615         #                            considered as True, not regarding really passed value.
616         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
617         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
618         #  \return list of published sub-shapes
619         #
620         #  @ref tui_restore_prs_params "Example"
621         def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
622                               theInheritFirstArg=False, theAddPrefix=True):
623             """
624             Publish sub-shapes, standing for arguments and sub-shapes of arguments
625             To be used from python scripts out of geompy.addToStudy (non-default usage)
626
627             Parameters:
628                 theObject published GEOM.GEOM_Object, arguments of which will be published
629                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
630                           If this list is empty, all operation arguments will be published
631                 theFindMethod method to search sub-shapes, corresponding to arguments and
632                               their sub-shapes. Value from enumeration GEOM.find_shape_method.
633                 theInheritFirstArg set properties of the first argument for theObject.
634                                    Do not publish sub-shapes in place of arguments, but only
635                                    in place of sub-shapes of the first argument,
636                                    because the whole shape corresponds to the first argument.
637                                    Mainly to be used after transformations, but it also can be
638                                    usefull after partition with one object shape, and some other
639                                    operations, where only the first argument has to be considered.
640                                    If theObject has only one argument shape, this flag is automatically
641                                    considered as True, not regarding really passed value.
642                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
643                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
644             Returns:
645                 list of published sub-shapes
646             """
647             # Example: see GEOM_TestAll.py
648             return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
649                                           theFindMethod, theInheritFirstArg, theAddPrefix)
650
651         ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
652         #  To be used from python scripts out of addToStudy() (non-default usage)
653         #  \param theObject published GEOM.GEOM_Object, arguments of which will be published
654         #  \param theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
655         #                   If this list is empty, all operation arguments will be published
656         #  \param theFindMethod method to search sub-shapes, corresponding to arguments and
657         #                       their sub-shapes. Value from enumeration GEOM::find_shape_method.
658         #  \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
659         #                            Do not publish sub-shapes in place of arguments, but only
660         #                            in place of sub-shapes of the first argument,
661         #                            because the whole shape corresponds to the first argument.
662         #                            Mainly to be used after transformations, but it also can be
663         #                            usefull after partition with one object shape, and some other
664         #                            operations, where only the first argument has to be considered.
665         #                            If theObject has only one argument shape, this flag is automatically
666         #                            considered as True, not regarding really passed value.
667         #  \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
668         #                      and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
669         #  \return list of published sub-shapes
670         #
671         #  @ref tui_restore_prs_params "Example"
672         def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
673                                    theInheritFirstArg=False, theAddPrefix=True):
674             """
675             Publish sub-shapes, standing for arguments and sub-shapes of arguments
676             To be used from python scripts out of geompy.addToStudy() (non-default usage)
677
678             Parameters:
679                 theObject published GEOM.GEOM_Object, arguments of which will be published
680                 theArgs   list of GEOM.GEOM_Object, operation arguments to be published.
681                           If this list is empty, all operation arguments will be published
682                 theFindMethod method to search sub-shapes, corresponding to arguments and
683                               their sub-shapes. Value from enumeration GEOM::find_shape_method.
684                 theInheritFirstArg set properties of the first argument for theObject.
685                                    Do not publish sub-shapes in place of arguments, but only
686                                    in place of sub-shapes of the first argument,
687                                    because the whole shape corresponds to the first argument.
688                                    Mainly to be used after transformations, but it also can be
689                                    usefull after partition with one object shape, and some other
690                                    operations, where only the first argument has to be considered.
691                                    If theObject has only one argument shape, this flag is automatically
692                                    considered as True, not regarding really passed value.
693                 theAddPrefix add prefix "from_" to names of restored sub-shapes,
694                              and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
695
696             Returns: 
697                 list of published sub-shapes
698             """
699             # Example: see GEOM_TestAll.py
700             return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
701                                                theFindMethod, theInheritFirstArg, theAddPrefix)
702
703         # end of l3_restore_ss
704         ## @}
705
706         ## @addtogroup l3_basic_go
707         ## @{
708
709         ## Create point by three coordinates.
710         #  @param theX The X coordinate of the point.
711         #  @param theY The Y coordinate of the point.
712         #  @param theZ The Z coordinate of the point.
713         #  @return New GEOM.GEOM_Object, containing the created point.
714         #
715         #  @ref tui_creation_point "Example"
716         def MakeVertex(self, theX, theY, theZ):
717             """
718             Create point by three coordinates.
719
720             Parameters:
721                 theX The X coordinate of the point.
722                 theY The Y coordinate of the point.
723                 theZ The Z coordinate of the point.
724                 
725             Returns: 
726                 New GEOM.GEOM_Object, containing the created point.
727             """
728             # Example: see GEOM_TestAll.py
729             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
730             anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
731             RaiseIfFailed("MakePointXYZ", self.BasicOp)
732             anObj.SetParameters(Parameters)
733             return anObj
734
735         ## Create a point, distant from the referenced point
736         #  on the given distances along the coordinate axes.
737         #  @param theReference The referenced point.
738         #  @param theX Displacement from the referenced point along OX axis.
739         #  @param theY Displacement from the referenced point along OY axis.
740         #  @param theZ Displacement from the referenced point along OZ axis.
741         #  @return New GEOM.GEOM_Object, containing the created point.
742         #
743         #  @ref tui_creation_point "Example"
744         def MakeVertexWithRef(self,theReference, theX, theY, theZ):
745             """
746             Create a point, distant from the referenced point
747             on the given distances along the coordinate axes.
748
749             Parameters:
750                 theReference The referenced point.
751                 theX Displacement from the referenced point along OX axis.
752                 theY Displacement from the referenced point along OY axis.
753                 theZ Displacement from the referenced point along OZ axis.
754
755             Returns:
756                 New GEOM.GEOM_Object, containing the created point.
757             """
758             # Example: see GEOM_TestAll.py
759             theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
760             anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
761             RaiseIfFailed("MakePointWithReference", self.BasicOp)
762             anObj.SetParameters(Parameters)
763             return anObj
764
765         ## Create a point, corresponding to the given parameter on the given curve.
766         #  @param theRefCurve The referenced curve.
767         #  @param theParameter Value of parameter on the referenced curve.
768         #  @return New GEOM.GEOM_Object, containing the created point.
769         #
770         #  @ref tui_creation_point "Example"
771         def MakeVertexOnCurve(self,theRefCurve, theParameter):
772             """
773             Create a point, corresponding to the given parameter on the given curve.
774
775             Parameters:
776                 theRefCurve The referenced curve.
777                 theParameter Value of parameter on the referenced curve.
778
779             Returns:
780                 New GEOM.GEOM_Object, containing the created point.
781
782             Example of usage:
783                 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
784             """
785             # Example: see GEOM_TestAll.py
786             theParameter, Parameters = ParseParameters(theParameter)
787             anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
788             RaiseIfFailed("MakePointOnCurve", self.BasicOp)
789             anObj.SetParameters(Parameters)
790             return anObj
791
792         ## Create a point by projection give coordinates on the given curve
793         #  @param theRefCurve The referenced curve.
794         #  @param theX X-coordinate in 3D space
795         #  @param theY Y-coordinate in 3D space
796         #  @param theZ Z-coordinate in 3D space
797         #  @return New GEOM.GEOM_Object, containing the created point.
798         #
799         #  @ref tui_creation_point "Example"
800         def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
801             """
802             Create a point by projection give coordinates on the given curve
803             
804             Parameters:
805                 theRefCurve The referenced curve.
806                 theX X-coordinate in 3D space
807                 theY Y-coordinate in 3D space
808                 theZ Z-coordinate in 3D space
809
810             Returns:
811                 New GEOM.GEOM_Object, containing the created point.
812
813             Example of usage:
814                 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
815             """
816             # Example: see GEOM_TestAll.py
817             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
818             anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
819             RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
820             anObj.SetParameters(Parameters)
821             return anObj
822
823         ## Create a point, corresponding to the given length on the given curve.
824         #  @param theRefCurve The referenced curve.
825         #  @param theLength Length on the referenced curve. It can be negative.
826         #  @param theStartPoint Point allowing to choose the direction for the calculation
827         #                       of the length. If None, start from the first point of theRefCurve.
828         #  @return New GEOM.GEOM_Object, containing the created point.
829         #
830         #  @ref tui_creation_point "Example"
831         def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
832             """
833             Create a point, corresponding to the given length on the given curve.
834
835             Parameters:
836                 theRefCurve The referenced curve.
837                 theLength Length on the referenced curve. It can be negative.
838                 theStartPoint Point allowing to choose the direction for the calculation
839                               of the length. If None, start from the first point of theRefCurve.
840
841             Returns:
842                 New GEOM.GEOM_Object, containing the created point.
843             """
844             # Example: see GEOM_TestAll.py
845             theLength, Parameters = ParseParameters(theLength)
846             anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
847             RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
848             anObj.SetParameters(Parameters)
849             return anObj
850
851         ## Create a point, corresponding to the given parameters on the
852         #    given surface.
853         #  @param theRefSurf The referenced surface.
854         #  @param theUParameter Value of U-parameter on the referenced surface.
855         #  @param theVParameter Value of V-parameter on the referenced surface.
856         #  @return New GEOM.GEOM_Object, containing the created point.
857         #
858         #  @ref swig_MakeVertexOnSurface "Example"
859         def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
860             """
861             Create a point, corresponding to the given parameters on the
862             given surface.
863
864             Parameters:
865                 theRefSurf The referenced surface.
866                 theUParameter Value of U-parameter on the referenced surface.
867                 theVParameter Value of V-parameter on the referenced surface.
868
869             Returns:
870                 New GEOM.GEOM_Object, containing the created point.
871
872             Example of usage:
873                 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
874             """
875             theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
876             # Example: see GEOM_TestAll.py
877             anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
878             RaiseIfFailed("MakePointOnSurface", self.BasicOp)
879             anObj.SetParameters(Parameters);
880             return anObj
881
882         ## Create a point by projection give coordinates on the given surface
883         #  @param theRefSurf The referenced surface.
884         #  @param theX X-coordinate in 3D space
885         #  @param theY Y-coordinate in 3D space
886         #  @param theZ Z-coordinate in 3D space
887         #  @return New GEOM.GEOM_Object, containing the created point.
888         #
889         #  @ref swig_MakeVertexOnSurfaceByCoord "Example"
890         def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
891             """
892             Create a point by projection give coordinates on the given surface
893
894             Parameters:
895                 theRefSurf The referenced surface.
896                 theX X-coordinate in 3D space
897                 theY Y-coordinate in 3D space
898                 theZ Z-coordinate in 3D space
899
900             Returns:
901                 New GEOM.GEOM_Object, containing the created point.
902
903             Example of usage:
904                 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
905             """
906             theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
907             # Example: see GEOM_TestAll.py
908             anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
909             RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
910             anObj.SetParameters(Parameters);
911             return anObj
912
913         ## Create a point, which lays on the given face.
914         #  The point will lay in arbitrary place of the face.
915         #  The only condition on it is a non-zero distance to the face boundary.
916         #  Such point can be used to uniquely identify the face inside any
917         #  shape in case, when the shape does not contain overlapped faces.
918         #  @param theFace The referenced face.
919         #  @return New GEOM.GEOM_Object, containing the created point.
920         #
921         #  @ref swig_MakeVertexInsideFace "Example"
922         def MakeVertexInsideFace (self, theFace):
923             """
924             Create a point, which lays on the given face.
925             The point will lay in arbitrary place of the face.
926             The only condition on it is a non-zero distance to the face boundary.
927             Such point can be used to uniquely identify the face inside any
928             shape in case, when the shape does not contain overlapped faces.
929
930             Parameters:
931                 theFace The referenced face.
932
933             Returns:
934                 New GEOM.GEOM_Object, containing the created point.
935
936             Example of usage:
937                 p_on_face = geompy.MakeVertexInsideFace(Face)
938             """
939             # Example: see GEOM_TestAll.py
940             anObj = self.BasicOp.MakePointOnFace(theFace)
941             RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
942             return anObj
943
944         ## Create a point on intersection of two lines.
945         #  @param theRefLine1, theRefLine2 The referenced lines.
946         #  @return New GEOM.GEOM_Object, containing the created point.
947         #
948         #  @ref swig_MakeVertexOnLinesIntersection "Example"
949         def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
950             """
951             Create a point on intersection of two lines.
952
953             Parameters:
954                 theRefLine1, theRefLine2 The referenced lines.
955
956             Returns:
957                 New GEOM.GEOM_Object, containing the created point.
958             """
959             # Example: see GEOM_TestAll.py
960             anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
961             RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
962             return anObj
963
964         ## Create a tangent, corresponding to the given parameter on the given curve.
965         #  @param theRefCurve The referenced curve.
966         #  @param theParameter Value of parameter on the referenced curve.
967         #  @return New GEOM.GEOM_Object, containing the created tangent.
968         #
969         #  @ref swig_MakeTangentOnCurve "Example"
970         def MakeTangentOnCurve(self, theRefCurve, theParameter):
971             """
972             Create a tangent, corresponding to the given parameter on the given curve.
973
974             Parameters:
975                 theRefCurve The referenced curve.
976                 theParameter Value of parameter on the referenced curve.
977
978             Returns:
979                 New GEOM.GEOM_Object, containing the created tangent.
980
981             Example of usage:
982                 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
983             """
984             anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
985             RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
986             return anObj
987
988         ## Create a tangent plane, corresponding to the given parameter on the given face.
989         #  @param theFace The face for which tangent plane should be built.
990         #  @param theParameterV vertical value of the center point (0.0 - 1.0).
991         #  @param theParameterU horisontal value of the center point (0.0 - 1.0).
992         #  @param theTrimSize the size of plane.
993         #  @return New GEOM.GEOM_Object, containing the created tangent.
994         #
995         #  @ref swig_MakeTangentPlaneOnFace "Example"
996         def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
997             """
998             Create a tangent plane, corresponding to the given parameter on the given face.
999
1000             Parameters:
1001                 theFace The face for which tangent plane should be built.
1002                 theParameterV vertical value of the center point (0.0 - 1.0).
1003                 theParameterU horisontal value of the center point (0.0 - 1.0).
1004                 theTrimSize the size of plane.
1005
1006            Returns: 
1007                 New GEOM.GEOM_Object, containing the created tangent.
1008
1009            Example of usage:
1010                 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1011             """
1012             anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1013             RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1014             return anObj
1015
1016         ## Create a vector with the given components.
1017         #  @param theDX X component of the vector.
1018         #  @param theDY Y component of the vector.
1019         #  @param theDZ Z component of the vector.
1020         #  @return New GEOM.GEOM_Object, containing the created vector.
1021         #
1022         #  @ref tui_creation_vector "Example"
1023         def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
1024             """
1025             Create a vector with the given components.
1026
1027             Parameters:
1028                 theDX X component of the vector.
1029                 theDY Y component of the vector.
1030                 theDZ Z component of the vector.
1031
1032             Returns:     
1033                 New GEOM.GEOM_Object, containing the created vector.
1034             """
1035             # Example: see GEOM_TestAll.py
1036             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1037             anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1038             RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1039             anObj.SetParameters(Parameters)
1040             return anObj
1041
1042         ## Create a vector between two points.
1043         #  @param thePnt1 Start point for the vector.
1044         #  @param thePnt2 End point for the vector.
1045         #  @return New GEOM.GEOM_Object, containing the created vector.
1046         #
1047         #  @ref tui_creation_vector "Example"
1048         def MakeVector(self,thePnt1, thePnt2):
1049             """
1050             Create a vector between two points.
1051
1052             Parameters:
1053                 thePnt1 Start point for the vector.
1054                 thePnt2 End point for the vector.
1055
1056             Returns:        
1057                 New GEOM.GEOM_Object, containing the created vector.
1058             """
1059             # Example: see GEOM_TestAll.py
1060             anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1061             RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1062             return anObj
1063
1064         ## Create a line, passing through the given point
1065         #  and parrallel to the given direction
1066         #  @param thePnt Point. The resulting line will pass through it.
1067         #  @param theDir Direction. The resulting line will be parallel to it.
1068         #  @return New GEOM.GEOM_Object, containing the created line.
1069         #
1070         #  @ref tui_creation_line "Example"
1071         def MakeLine(self,thePnt, theDir):
1072             """
1073             Create a line, passing through the given point
1074             and parrallel to the given direction
1075
1076             Parameters:
1077                 thePnt Point. The resulting line will pass through it.
1078                 theDir Direction. The resulting line will be parallel to it.
1079
1080             Returns:
1081                 New GEOM.GEOM_Object, containing the created line.
1082             """
1083             # Example: see GEOM_TestAll.py
1084             anObj = self.BasicOp.MakeLine(thePnt, theDir)
1085             RaiseIfFailed("MakeLine", self.BasicOp)
1086             return anObj
1087
1088         ## Create a line, passing through the given points
1089         #  @param thePnt1 First of two points, defining the line.
1090         #  @param thePnt2 Second of two points, defining the line.
1091         #  @return New GEOM.GEOM_Object, containing the created line.
1092         #
1093         #  @ref tui_creation_line "Example"
1094         def MakeLineTwoPnt(self,thePnt1, thePnt2):
1095             """
1096             Create a line, passing through the given points
1097
1098             Parameters:
1099                 thePnt1 First of two points, defining the line.
1100                 thePnt2 Second of two points, defining the line.
1101
1102             Returns:
1103                 New GEOM.GEOM_Object, containing the created line.
1104             """
1105             # Example: see GEOM_TestAll.py
1106             anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1107             RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1108             return anObj
1109
1110         ## Create a line on two faces intersection.
1111         #  @param theFace1 First of two faces, defining the line.
1112         #  @param theFace2 Second of two faces, defining the line.
1113         #  @return New GEOM.GEOM_Object, containing the created line.
1114         #
1115         #  @ref swig_MakeLineTwoFaces "Example"
1116         def MakeLineTwoFaces(self, theFace1, theFace2):
1117             """
1118             Create a line on two faces intersection.
1119
1120             Parameters:
1121                 theFace1 First of two faces, defining the line.
1122                 theFace2 Second of two faces, defining the line.
1123
1124             Returns:
1125                 New GEOM.GEOM_Object, containing the created line.
1126             """
1127             # Example: see GEOM_TestAll.py
1128             anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1129             RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1130             return anObj
1131
1132         ## Create a plane, passing through the given point
1133         #  and normal to the given vector.
1134         #  @param thePnt Point, the plane has to pass through.
1135         #  @param theVec Vector, defining the plane normal direction.
1136         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1137         #  @return New GEOM.GEOM_Object, containing the created plane.
1138         #
1139         #  @ref tui_creation_plane "Example"
1140         def MakePlane(self,thePnt, theVec, theTrimSize):
1141             """
1142             Create a plane, passing through the given point
1143             and normal to the given vector.
1144
1145             Parameters:
1146                 thePnt Point, the plane has to pass through.
1147                 theVec Vector, defining the plane normal direction.
1148                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1149
1150             Returns:    
1151                 New GEOM.GEOM_Object, containing the created plane.
1152             """
1153             # Example: see GEOM_TestAll.py
1154             theTrimSize, Parameters = ParseParameters(theTrimSize);
1155             anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1156             RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1157             anObj.SetParameters(Parameters)
1158             return anObj
1159
1160         ## Create a plane, passing through the three given points
1161         #  @param thePnt1 First of three points, defining the plane.
1162         #  @param thePnt2 Second of three points, defining the plane.
1163         #  @param thePnt3 Fird of three points, defining the plane.
1164         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1165         #  @return New GEOM.GEOM_Object, containing the created plane.
1166         #
1167         #  @ref tui_creation_plane "Example"
1168         def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
1169             """
1170             Create a plane, passing through the three given points
1171
1172             Parameters:
1173                 thePnt1 First of three points, defining the plane.
1174                 thePnt2 Second of three points, defining the plane.
1175                 thePnt3 Fird of three points, defining the plane.
1176                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1177
1178             Returns:
1179                 New GEOM.GEOM_Object, containing the created plane.
1180             """
1181             # Example: see GEOM_TestAll.py
1182             theTrimSize, Parameters = ParseParameters(theTrimSize);
1183             anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1184             RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1185             anObj.SetParameters(Parameters)
1186             return anObj
1187
1188         ## Create a plane, similar to the existing one, but with another size of representing face.
1189         #  @param theFace Referenced plane or LCS(Marker).
1190         #  @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1191         #  @return New GEOM.GEOM_Object, containing the created plane.
1192         #
1193         #  @ref tui_creation_plane "Example"
1194         def MakePlaneFace(self,theFace, theTrimSize):
1195             """
1196             Create a plane, similar to the existing one, but with another size of representing face.
1197
1198             Parameters:
1199                 theFace Referenced plane or LCS(Marker).
1200                 theTrimSize New half size of a side of quadrangle face, representing the plane.
1201
1202             Returns:
1203                 New GEOM.GEOM_Object, containing the created plane.
1204             """
1205             # Example: see GEOM_TestAll.py
1206             theTrimSize, Parameters = ParseParameters(theTrimSize);
1207             anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1208             RaiseIfFailed("MakePlaneFace", self.BasicOp)
1209             anObj.SetParameters(Parameters)
1210             return anObj
1211
1212         ## Create a plane, passing through the 2 vectors
1213         #  with center in a start point of the first vector.
1214         #  @param theVec1 Vector, defining center point and plane direction.
1215         #  @param theVec2 Vector, defining the plane normal direction.
1216         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1217         #  @return New GEOM.GEOM_Object, containing the created plane.
1218         #
1219         #  @ref tui_creation_plane "Example"
1220         def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
1221             """
1222             Create a plane, passing through the 2 vectors
1223             with center in a start point of the first vector.
1224
1225             Parameters:
1226                 theVec1 Vector, defining center point and plane direction.
1227                 theVec2 Vector, defining the plane normal direction.
1228                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1229
1230             Returns: 
1231                 New GEOM.GEOM_Object, containing the created plane.
1232             """
1233             # Example: see GEOM_TestAll.py
1234             theTrimSize, Parameters = ParseParameters(theTrimSize);
1235             anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1236             RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1237             anObj.SetParameters(Parameters)
1238             return anObj
1239
1240         ## Create a plane, based on a Local coordinate system.
1241         #  @param theLCS  coordinate system, defining plane.
1242         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1243         #  @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1244         #  @return New GEOM.GEOM_Object, containing the created plane.
1245         #
1246         #  @ref tui_creation_plane "Example"
1247         def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
1248             """
1249             Create a plane, based on a Local coordinate system.
1250
1251            Parameters: 
1252                 theLCS  coordinate system, defining plane.
1253                 theTrimSize Half size of a side of quadrangle face, representing the plane.
1254                 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1255
1256             Returns: 
1257                 New GEOM.GEOM_Object, containing the created plane.
1258             """
1259             # Example: see GEOM_TestAll.py
1260             theTrimSize, Parameters = ParseParameters(theTrimSize);
1261             anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1262             RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1263             anObj.SetParameters(Parameters)
1264             return anObj
1265
1266         ## Create a local coordinate system.
1267         #  @param OX,OY,OZ Three coordinates of coordinate system origin.
1268         #  @param XDX,XDY,XDZ Three components of OX direction
1269         #  @param YDX,YDY,YDZ Three components of OY direction
1270         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1271         #
1272         #  @ref swig_MakeMarker "Example"
1273         def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
1274             """
1275             Create a local coordinate system.
1276
1277             Parameters: 
1278                 OX,OY,OZ Three coordinates of coordinate system origin.
1279                 XDX,XDY,XDZ Three components of OX direction
1280                 YDX,YDY,YDZ Three components of OY direction
1281
1282             Returns: 
1283                 New GEOM.GEOM_Object, containing the created coordinate system.
1284             """
1285             # Example: see GEOM_TestAll.py
1286             OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1287             anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1288             RaiseIfFailed("MakeMarker", self.BasicOp)
1289             anObj.SetParameters(Parameters)
1290             return anObj
1291
1292         ## Create a local coordinate system from shape.
1293         #  @param theShape The initial shape to detect the coordinate system.
1294         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1295         #
1296         #  @ref tui_creation_lcs "Example"
1297         def MakeMarkerFromShape(self, theShape):
1298             """
1299             Create a local coordinate system from shape.
1300
1301             Parameters:
1302                 theShape The initial shape to detect the coordinate system.
1303                 
1304             Returns: 
1305                 New GEOM.GEOM_Object, containing the created coordinate system.
1306             """
1307             anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1308             RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1309             return anObj
1310
1311         ## Create a local coordinate system from point and two vectors.
1312         #  @param theOrigin Point of coordinate system origin.
1313         #  @param theXVec Vector of X direction
1314         #  @param theYVec Vector of Y direction
1315         #  @return New GEOM.GEOM_Object, containing the created coordinate system.
1316         #
1317         #  @ref tui_creation_lcs "Example"
1318         def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
1319             """
1320             Create a local coordinate system from point and two vectors.
1321
1322             Parameters:
1323                 theOrigin Point of coordinate system origin.
1324                 theXVec Vector of X direction
1325                 theYVec Vector of Y direction
1326
1327             Returns: 
1328                 New GEOM.GEOM_Object, containing the created coordinate system.
1329
1330             """
1331             anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1332             RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1333             return anObj
1334
1335         # end of l3_basic_go
1336         ## @}
1337
1338         ## @addtogroup l4_curves
1339         ## @{
1340
1341         ##  Create an arc of circle, passing through three given points.
1342         #  @param thePnt1 Start point of the arc.
1343         #  @param thePnt2 Middle point of the arc.
1344         #  @param thePnt3 End point of the arc.
1345         #  @return New GEOM.GEOM_Object, containing the created arc.
1346         #
1347         #  @ref swig_MakeArc "Example"
1348         def MakeArc(self,thePnt1, thePnt2, thePnt3):
1349             """
1350             Create an arc of circle, passing through three given points.
1351
1352             Parameters:
1353                 thePnt1 Start point of the arc.
1354                 thePnt2 Middle point of the arc.
1355                 thePnt3 End point of the arc.
1356
1357             Returns: 
1358                 New GEOM.GEOM_Object, containing the created arc.
1359             """
1360             # Example: see GEOM_TestAll.py
1361             anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1362             RaiseIfFailed("MakeArc", self.CurvesOp)
1363             return anObj
1364
1365         ##  Create an arc of circle from a center and 2 points.
1366         #  @param thePnt1 Center of the arc
1367         #  @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1368         #  @param thePnt3 End point of the arc (Gives also a direction)
1369         #  @param theSense Orientation of the arc
1370         #  @return New GEOM.GEOM_Object, containing the created arc.
1371         #
1372         #  @ref swig_MakeArc "Example"
1373         def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
1374             """
1375             Create an arc of circle from a center and 2 points.
1376
1377             Parameters:
1378                 thePnt1 Center of the arc
1379                 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1380                 thePnt3 End point of the arc (Gives also a direction)
1381                 theSense Orientation of the arc
1382
1383             Returns:
1384                 New GEOM.GEOM_Object, containing the created arc.
1385             """
1386             # Example: see GEOM_TestAll.py
1387             anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1388             RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1389             return anObj
1390
1391         ##  Create an arc of ellipse, of center and two points.
1392         #  @param theCenter Center of the arc.
1393         #  @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1394         #  @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1395         #  @return New GEOM.GEOM_Object, containing the created arc.
1396         #
1397         #  @ref swig_MakeArc "Example"
1398         def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
1399             """
1400             Create an arc of ellipse, of center and two points.
1401
1402             Parameters:
1403                 theCenter Center of the arc.
1404                 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1405                 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1406
1407             Returns:
1408                 New GEOM.GEOM_Object, containing the created arc.
1409             """
1410             # Example: see GEOM_TestAll.py
1411             anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1412             RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1413             return anObj
1414
1415         ## Create a circle with given center, normal vector and radius.
1416         #  @param thePnt Circle center.
1417         #  @param theVec Vector, normal to the plane of the circle.
1418         #  @param theR Circle radius.
1419         #  @return New GEOM.GEOM_Object, containing the created circle.
1420         #
1421         #  @ref tui_creation_circle "Example"
1422         def MakeCircle(self, thePnt, theVec, theR):
1423             """
1424             Create a circle with given center, normal vector and radius.
1425
1426             Parameters:
1427                 thePnt Circle center.
1428                 theVec Vector, normal to the plane of the circle.
1429                 theR Circle radius.
1430
1431             Returns:
1432                 New GEOM.GEOM_Object, containing the created circle.
1433             """
1434             # Example: see GEOM_TestAll.py
1435             theR, Parameters = ParseParameters(theR)
1436             anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1437             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1438             anObj.SetParameters(Parameters)
1439             return anObj
1440
1441         ## Create a circle with given radius.
1442         #  Center of the circle will be in the origin of global
1443         #  coordinate system and normal vector will be codirected with Z axis
1444         #  @param theR Circle radius.
1445         #  @return New GEOM.GEOM_Object, containing the created circle.
1446         def MakeCircleR(self, theR):
1447             """
1448             Create a circle with given radius.
1449             Center of the circle will be in the origin of global
1450             coordinate system and normal vector will be codirected with Z axis
1451
1452             Parameters:
1453                 theR Circle radius.
1454
1455             Returns:
1456                 New GEOM.GEOM_Object, containing the created circle.
1457             """
1458             anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1459             RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1460             return anObj
1461
1462         ## Create a circle, passing through three given points
1463         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1464         #  @return New GEOM.GEOM_Object, containing the created circle.
1465         #
1466         #  @ref tui_creation_circle "Example"
1467         def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
1468             """
1469             Create a circle, passing through three given points
1470
1471             Parameters:
1472                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1473
1474             Returns:
1475                 New GEOM.GEOM_Object, containing the created circle.
1476             """
1477             # Example: see GEOM_TestAll.py
1478             anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1479             RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1480             return anObj
1481
1482         ## Create a circle, with given point1 as center,
1483         #  passing through the point2 as radius and laying in the plane,
1484         #  defined by all three given points.
1485         #  @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1486         #  @return New GEOM.GEOM_Object, containing the created circle.
1487         #
1488         #  @ref swig_MakeCircle "Example"
1489         def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
1490             """
1491             Create a circle, with given point1 as center,
1492             passing through the point2 as radius and laying in the plane,
1493             defined by all three given points.
1494
1495             Parameters:
1496                 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1497
1498             Returns:
1499                 New GEOM.GEOM_Object, containing the created circle.
1500             """
1501             # Example: see GEOM_example6.py
1502             anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
1503             RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
1504             return anObj
1505
1506         ## Create an ellipse with given center, normal vector and radiuses.
1507         #  @param thePnt Ellipse center.
1508         #  @param theVec Vector, normal to the plane of the ellipse.
1509         #  @param theRMajor Major ellipse radius.
1510         #  @param theRMinor Minor ellipse radius.
1511         #  @param theVecMaj Vector, direction of the ellipse's main axis.
1512         #  @return New GEOM.GEOM_Object, containing the created ellipse.
1513         #
1514         #  @ref tui_creation_ellipse "Example"
1515         def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
1516             """
1517             Create an ellipse with given center, normal vector and radiuses.
1518
1519             Parameters:
1520                 thePnt Ellipse center.
1521                 theVec Vector, normal to the plane of the ellipse.
1522                 theRMajor Major ellipse radius.
1523                 theRMinor Minor ellipse radius.
1524                 theVecMaj Vector, direction of the ellipse's main axis.
1525
1526             Returns:    
1527                 New GEOM.GEOM_Object, containing the created ellipse.
1528             """
1529             # Example: see GEOM_TestAll.py
1530             theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
1531             if theVecMaj is not None:
1532                 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
1533             else:
1534                 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
1535                 pass
1536             RaiseIfFailed("MakeEllipse", self.CurvesOp)
1537             anObj.SetParameters(Parameters)
1538             return anObj
1539
1540         ## Create an ellipse with given radiuses.
1541         #  Center of the ellipse will be in the origin of global
1542         #  coordinate system and normal vector will be codirected with Z axis
1543         #  @param theRMajor Major ellipse radius.
1544         #  @param theRMinor Minor ellipse radius.
1545         #  @return New GEOM.GEOM_Object, containing the created ellipse.
1546         def MakeEllipseRR(self, theRMajor, theRMinor):
1547             """
1548             Create an ellipse with given radiuses.
1549             Center of the ellipse will be in the origin of global
1550             coordinate system and normal vector will be codirected with Z axis
1551
1552             Parameters:
1553                 theRMajor Major ellipse radius.
1554                 theRMinor Minor ellipse radius.
1555
1556             Returns:
1557                 New GEOM.GEOM_Object, containing the created ellipse.
1558             """
1559             anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
1560             RaiseIfFailed("MakeEllipse", self.CurvesOp)
1561             return anObj
1562
1563         ## Create a polyline on the set of points.
1564         #  @param thePoints Sequence of points for the polyline.
1565         #  @param theIsClosed If True, build a closed wire.
1566         #  @return New GEOM.GEOM_Object, containing the created polyline.
1567         #
1568         #  @ref tui_creation_curve "Example"
1569         def MakePolyline(self, thePoints, theIsClosed=False):
1570             """
1571             Create a polyline on the set of points.
1572
1573             Parameters:
1574                 thePoints Sequence of points for the polyline.
1575                 theIsClosed If True, build a closed wire.
1576
1577             Returns:
1578                 New GEOM.GEOM_Object, containing the created polyline.
1579             """
1580             # Example: see GEOM_TestAll.py
1581             anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
1582             RaiseIfFailed("MakePolyline", self.CurvesOp)
1583             return anObj
1584
1585         ## Create bezier curve on the set of points.
1586         #  @param thePoints Sequence of points for the bezier curve.
1587         #  @param theIsClosed If True, build a closed curve.
1588         #  @return New GEOM.GEOM_Object, containing the created bezier curve.
1589         #
1590         #  @ref tui_creation_curve "Example"
1591         def MakeBezier(self, thePoints, theIsClosed=False):
1592             """
1593             Create bezier curve on the set of points.
1594
1595             Parameters:
1596                 thePoints Sequence of points for the bezier curve.
1597                 theIsClosed If True, build a closed curve.
1598
1599             Returns:
1600                 New GEOM.GEOM_Object, containing the created bezier curve.
1601             """
1602             # Example: see GEOM_TestAll.py
1603             anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
1604             RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
1605             return anObj
1606
1607         ## Create B-Spline curve on the set of points.
1608         #  @param thePoints Sequence of points for the B-Spline curve.
1609         #  @param theIsClosed If True, build a closed curve.
1610         #  @param theDoReordering If TRUE, the algo does not follow the order of
1611         #                         \a thePoints but searches for the closest vertex.
1612         #  @return New GEOM.GEOM_Object, containing the created B-Spline curve.
1613         #
1614         #  @ref tui_creation_curve "Example"
1615         def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False):
1616             """
1617             Create B-Spline curve on the set of points.
1618
1619             Parameters:
1620                 thePoints Sequence of points for the B-Spline curve.
1621                 theIsClosed If True, build a closed curve.
1622                 theDoReordering If True, the algo does not follow the order of
1623                                 thePoints but searches for the closest vertex.
1624
1625             Returns:                     
1626                 New GEOM.GEOM_Object, containing the created B-Spline curve.
1627             """
1628             # Example: see GEOM_TestAll.py
1629             anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
1630             RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1631             return anObj
1632
1633
1634         ## Creates a curve using the parametric definition of the basic points.
1635         #  @param thexExpr parametric equation of the coordinates X.
1636         #  @param theyExpr parametric equation of the coordinates Y.
1637         #  @param thezExpr parametric equation of the coordinates Z.
1638         #  @param theParamMin the minimal value of the parameter.
1639         #  @param theParamMax the maximum value of the parameter.
1640         #  @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1641         #  @param theCurveType the type of the curve.
1642         #  @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.
1643         #  @return New GEOM.GEOM_Object, containing the created curve.
1644         #
1645         #  @ref tui_creation_curve "Example"
1646         def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
1647                                 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False ):
1648             """
1649             Creates a curve using the parametric definition of the basic points.
1650
1651             Parameters:
1652                 thexExpr parametric equation of the coordinates X.
1653                 theyExpr parametric equation of the coordinates Y.
1654                 thezExpr parametric equation of the coordinates Z.
1655                 theParamMin the minimal value of the parameter.
1656                 theParamMax the maximum value of the parameter.
1657                 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
1658                 theCurveType the type of the curve.
1659                 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
1660                              method is used which can lead to a bug.
1661
1662             Returns:
1663                 New GEOM.GEOM_Object, containing the created curve.
1664             """
1665             theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
1666             if theNewMethod:
1667               anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
1668             else:
1669               anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)   
1670             RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
1671             anObj.SetParameters(Parameters)
1672             return anObj
1673             
1674
1675
1676         # end of l4_curves
1677         ## @}
1678
1679         ## @addtogroup l3_sketcher
1680         ## @{
1681
1682         ## Create a sketcher (wire or face), following the textual description,
1683         #  passed through <VAR>theCommand</VAR> argument. \n
1684         #  Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
1685         #  Format of the description string have to be the following:
1686         #
1687         #  "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1688         #
1689         #  Where:
1690         #  - x1, y1 are coordinates of the first sketcher point (zero by default),
1691         #  - CMD is one of
1692         #     - "R angle" : Set the direction by angle
1693         #     - "D dx dy" : Set the direction by DX & DY
1694         #     .
1695         #       \n
1696         #     - "TT x y" : Create segment by point at X & Y
1697         #     - "T dx dy" : Create segment by point with DX & DY
1698         #     - "L length" : Create segment by direction & Length
1699         #     - "IX x" : Create segment by direction & Intersect. X
1700         #     - "IY y" : Create segment by direction & Intersect. Y
1701         #     .
1702         #       \n
1703         #     - "C radius length" : Create arc by direction, radius and length(in degree)
1704         #     - "AA x y": Create arc by point at X & Y
1705         #     - "A dx dy" : Create arc by point with DX & DY
1706         #     - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1707         #     - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1708         #     - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1709         #     - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1710         #     .
1711         #       \n
1712         #     - "WW" : Close Wire (to finish)
1713         #     - "WF" : Close Wire and build face (to finish)
1714         #     .
1715         #        \n
1716         #  - Flag1 (= reverse) is 0 or 2 ...
1717         #     - if 0 the drawn arc is the one of lower angle (< Pi)
1718         #     - if 2 the drawn arc ius the one of greater angle (> Pi)
1719         #     .
1720         #        \n
1721         #  - Flag2 (= control tolerance) is 0 or 1 ...
1722         #     - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1723         #     - if 1 the wire is built only if the end point is on the arc
1724         #       with a tolerance of 10^-7 on the distance else the creation fails
1725         #
1726         #  @param theCommand String, defining the sketcher in local
1727         #                    coordinates of the working plane.
1728         #  @param theWorkingPlane Nine double values, defining origin,
1729         #                         OZ and OX directions of the working plane.
1730         #  @return New GEOM.GEOM_Object, containing the created wire.
1731         #
1732         #  @ref tui_sketcher_page "Example"
1733         def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
1734             """
1735             Create a sketcher (wire or face), following the textual description, passed
1736             through theCommand argument.
1737             Edges of the resulting wire or face will be arcs of circles and/or linear segments.
1738             Format of the description string have to be the following:
1739                 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
1740             Where:
1741             - x1, y1 are coordinates of the first sketcher point (zero by default),
1742             - CMD is one of
1743                - "R angle" : Set the direction by angle
1744                - "D dx dy" : Set the direction by DX & DY
1745                
1746                - "TT x y" : Create segment by point at X & Y
1747                - "T dx dy" : Create segment by point with DX & DY
1748                - "L length" : Create segment by direction & Length
1749                - "IX x" : Create segment by direction & Intersect. X
1750                - "IY y" : Create segment by direction & Intersect. Y
1751
1752                - "C radius length" : Create arc by direction, radius and length(in degree)
1753                - "AA x y": Create arc by point at X & Y
1754                - "A dx dy" : Create arc by point with DX & DY
1755                - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
1756                - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
1757                - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
1758                - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
1759
1760                - "WW" : Close Wire (to finish)
1761                - "WF" : Close Wire and build face (to finish)
1762             
1763             - Flag1 (= reverse) is 0 or 2 ...
1764                - if 0 the drawn arc is the one of lower angle (< Pi)
1765                - if 2 the drawn arc ius the one of greater angle (> Pi)
1766         
1767             - Flag2 (= control tolerance) is 0 or 1 ...
1768                - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1769                - if 1 the wire is built only if the end point is on the arc
1770                  with a tolerance of 10^-7 on the distance else the creation fails
1771
1772             Parameters:
1773                 theCommand String, defining the sketcher in local
1774                            coordinates of the working plane.
1775                 theWorkingPlane Nine double values, defining origin,
1776                                 OZ and OX directions of the working plane.
1777
1778             Returns:
1779                 New GEOM.GEOM_Object, containing the created wire.
1780             """
1781             # Example: see GEOM_TestAll.py
1782             theCommand,Parameters = ParseSketcherCommand(theCommand)
1783             anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
1784             RaiseIfFailed("MakeSketcher", self.CurvesOp)
1785             anObj.SetParameters(Parameters)
1786             return anObj
1787
1788         ## Create a sketcher (wire or face), following the textual description,
1789         #  passed through <VAR>theCommand</VAR> argument. \n
1790         #  For format of the description string see MakeSketcher() method.\n
1791         #  @param theCommand String, defining the sketcher in local
1792         #                    coordinates of the working plane.
1793         #  @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1794         #  @return New GEOM.GEOM_Object, containing the created wire.
1795         #
1796         #  @ref tui_sketcher_page "Example"
1797         def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
1798             """
1799             Create a sketcher (wire or face), following the textual description,
1800             passed through theCommand argument.
1801             For format of the description string see geompy.MakeSketcher() method.
1802
1803             Parameters:
1804                 theCommand String, defining the sketcher in local
1805                            coordinates of the working plane.
1806                 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1807
1808             Returns:
1809                 New GEOM.GEOM_Object, containing the created wire.
1810             """
1811             theCommand,Parameters = ParseSketcherCommand(theCommand)
1812             anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
1813             RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
1814             anObj.SetParameters(Parameters)
1815             return anObj
1816
1817         ## Create a sketcher wire, following the numerical description,
1818         #  passed through <VAR>theCoordinates</VAR> argument. \n
1819         #  @param theCoordinates double values, defining points to create a wire,
1820         #                                                      passing from it.
1821         #  @return New GEOM.GEOM_Object, containing the created wire.
1822         #
1823         #  @ref tui_3dsketcher_page "Example"
1824         def Make3DSketcher(self, theCoordinates):
1825             """
1826             Create a sketcher wire, following the numerical description,
1827             passed through theCoordinates argument.
1828
1829             Parameters:
1830                 theCoordinates double values, defining points to create a wire,
1831                                passing from it.
1832
1833             Returns:
1834                 New GEOM_Object, containing the created wire.
1835             """
1836             theCoordinates,Parameters = ParseParameters(theCoordinates)
1837             anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1838             RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1839             anObj.SetParameters(Parameters)
1840             return anObj
1841
1842         ## Obtain a 3D sketcher interface
1843         #  @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
1844         #
1845         #  @ref tui_3dsketcher_page "Example"
1846         def Sketcher3D (self):
1847             """
1848             Obtain a 3D sketcher interface.
1849
1850             Example of usage:
1851                 sk = geompy.Sketcher3D()
1852                 sk.addPointsAbsolute(0,0,0, 70,0,0)
1853                 sk.addPointsRelative(0, 0, 130)
1854                 sk.addPointAnglesLength("OXY", 50, 0, 100)
1855                 sk.addPointAnglesLength("OXZ", 30, 80, 130)
1856                 sk.close()
1857                 a3D_Sketcher_1 = sk.wire()
1858             """
1859             sk = Sketcher3D (self)
1860             return sk
1861
1862         # end of l3_sketcher
1863         ## @}
1864
1865         ## @addtogroup l3_3d_primitives
1866         ## @{
1867
1868         ## Create a box by coordinates of two opposite vertices.
1869         #
1870         #  @param x1,y1,z1 double values, defining first point it.
1871         #  @param x2,y2,z2 double values, defining first point it.
1872         #
1873         #  @return New GEOM.GEOM_Object, containing the created box.
1874         #  @ref tui_creation_box "Example"
1875         def MakeBox (self, x1,y1,z1, x2,y2,z2):
1876             """
1877             Create a box by coordinates of two opposite vertices.
1878             
1879             Parameters:
1880                 x1,y1,z1 double values, defining first point.
1881                 x2,y2,z2 double values, defining second point.
1882                 
1883             Returns:
1884                 New GEOM.GEOM_Object, containing the created box.
1885             """
1886             # Example: see GEOM_TestAll.py
1887             pnt1 = self.MakeVertex(x1,y1,z1)
1888             pnt2 = self.MakeVertex(x2,y2,z2)
1889             return self.MakeBoxTwoPnt(pnt1,pnt2)
1890
1891         ## Create a box with specified dimensions along the coordinate axes
1892         #  and with edges, parallel to the coordinate axes.
1893         #  Center of the box will be at point (DX/2, DY/2, DZ/2).
1894         #  @param theDX Length of Box edges, parallel to OX axis.
1895         #  @param theDY Length of Box edges, parallel to OY axis.
1896         #  @param theDZ Length of Box edges, parallel to OZ axis.
1897         #  @return New GEOM.GEOM_Object, containing the created box.
1898         #
1899         #  @ref tui_creation_box "Example"
1900         def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1901             """
1902             Create a box with specified dimensions along the coordinate axes
1903             and with edges, parallel to the coordinate axes.
1904             Center of the box will be at point (DX/2, DY/2, DZ/2).
1905
1906             Parameters:
1907                 theDX Length of Box edges, parallel to OX axis.
1908                 theDY Length of Box edges, parallel to OY axis.
1909                 theDZ Length of Box edges, parallel to OZ axis.
1910
1911             Returns:   
1912                 New GEOM.GEOM_Object, containing the created box.
1913             """
1914             # Example: see GEOM_TestAll.py
1915             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1916             anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1917             RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1918             anObj.SetParameters(Parameters)
1919             return anObj
1920
1921         ## Create a box with two specified opposite vertices,
1922         #  and with edges, parallel to the coordinate axes
1923         #  @param thePnt1 First of two opposite vertices.
1924         #  @param thePnt2 Second of two opposite vertices.
1925         #  @return New GEOM.GEOM_Object, containing the created box.
1926         #
1927         #  @ref tui_creation_box "Example"
1928         def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1929             """
1930             Create a box with two specified opposite vertices,
1931             and with edges, parallel to the coordinate axes
1932
1933             Parameters:
1934                 thePnt1 First of two opposite vertices.
1935                 thePnt2 Second of two opposite vertices.
1936
1937             Returns:
1938                 New GEOM.GEOM_Object, containing the created box.
1939             """
1940             # Example: see GEOM_TestAll.py
1941             anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1942             RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1943             return anObj
1944
1945         ## Create a face with specified dimensions with edges parallel to coordinate axes.
1946         #  @param theH height of Face.
1947         #  @param theW width of Face.
1948         #  @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1949         #  @return New GEOM.GEOM_Object, containing the created face.
1950         #
1951         #  @ref tui_creation_face "Example"
1952         def MakeFaceHW(self,theH, theW, theOrientation):
1953             """
1954             Create a face with specified dimensions with edges parallel to coordinate axes.
1955
1956             Parameters:
1957                 theH height of Face.
1958                 theW width of Face.
1959                 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
1960
1961             Returns:
1962                 New GEOM.GEOM_Object, containing the created face.
1963             """
1964             # Example: see GEOM_TestAll.py
1965             theH,theW,Parameters = ParseParameters(theH, theW)
1966             anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1967             RaiseIfFailed("MakeFaceHW", self.PrimOp)
1968             anObj.SetParameters(Parameters)
1969             return anObj
1970
1971         ## Create a face from another plane and two sizes,
1972         #  vertical size and horisontal size.
1973         #  @param theObj   Normale vector to the creating face or
1974         #  the face object.
1975         #  @param theH     Height (vertical size).
1976         #  @param theW     Width (horisontal size).
1977         #  @return New GEOM.GEOM_Object, containing the created face.
1978         #
1979         #  @ref tui_creation_face "Example"
1980         def MakeFaceObjHW(self, theObj, theH, theW):
1981             """
1982             Create a face from another plane and two sizes,
1983             vertical size and horisontal size.
1984
1985             Parameters:
1986                 theObj   Normale vector to the creating face or
1987                          the face object.
1988                 theH     Height (vertical size).
1989                 theW     Width (horisontal size).
1990
1991             Returns:
1992                 New GEOM_Object, containing the created face.
1993             """
1994             # Example: see GEOM_TestAll.py
1995             theH,theW,Parameters = ParseParameters(theH, theW)
1996             anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1997             RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1998             anObj.SetParameters(Parameters)
1999             return anObj
2000
2001         ## Create a disk with given center, normal vector and radius.
2002         #  @param thePnt Disk center.
2003         #  @param theVec Vector, normal to the plane of the disk.
2004         #  @param theR Disk radius.
2005         #  @return New GEOM.GEOM_Object, containing the created disk.
2006         #
2007         #  @ref tui_creation_disk "Example"
2008         def MakeDiskPntVecR(self,thePnt, theVec, theR):
2009             """
2010             Create a disk with given center, normal vector and radius.
2011
2012             Parameters:
2013                 thePnt Disk center.
2014                 theVec Vector, normal to the plane of the disk.
2015                 theR Disk radius.
2016
2017             Returns:    
2018                 New GEOM.GEOM_Object, containing the created disk.
2019             """
2020             # Example: see GEOM_TestAll.py
2021             theR,Parameters = ParseParameters(theR)
2022             anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2023             RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2024             anObj.SetParameters(Parameters)
2025             return anObj
2026
2027         ## Create a disk, passing through three given points
2028         #  @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2029         #  @return New GEOM.GEOM_Object, containing the created disk.
2030         #
2031         #  @ref tui_creation_disk "Example"
2032         def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
2033             """
2034             Create a disk, passing through three given points
2035
2036             Parameters:
2037                 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2038
2039             Returns:    
2040                 New GEOM.GEOM_Object, containing the created disk.
2041             """
2042             # Example: see GEOM_TestAll.py
2043             anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2044             RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2045             return anObj
2046
2047         ## Create a disk with specified dimensions along OX-OY coordinate axes.
2048         #  @param theR Radius of Face.
2049         #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2050         #  @return New GEOM.GEOM_Object, containing the created disk.
2051         #
2052         #  @ref tui_creation_face "Example"
2053         def MakeDiskR(self,theR, theOrientation):
2054             """
2055             Create a disk with specified dimensions along OX-OY coordinate axes.
2056
2057             Parameters:
2058                 theR Radius of Face.
2059                 theOrientation set the orientation belong axis OXY or OYZ or OZX
2060
2061             Returns: 
2062                 New GEOM.GEOM_Object, containing the created disk.
2063
2064             Example of usage:
2065                 Disk3 = geompy.MakeDiskR(100., 1)
2066             """
2067             # Example: see GEOM_TestAll.py
2068             theR,Parameters = ParseParameters(theR)
2069             anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2070             RaiseIfFailed("MakeDiskR", self.PrimOp)
2071             anObj.SetParameters(Parameters)
2072             return anObj
2073
2074         ## Create a cylinder with given base point, axis, radius and height.
2075         #  @param thePnt Central point of cylinder base.
2076         #  @param theAxis Cylinder axis.
2077         #  @param theR Cylinder radius.
2078         #  @param theH Cylinder height.
2079         #  @return New GEOM.GEOM_Object, containing the created cylinder.
2080         #
2081         #  @ref tui_creation_cylinder "Example"
2082         def MakeCylinder(self,thePnt, theAxis, theR, theH):
2083             """
2084             Create a cylinder with given base point, axis, radius and height.
2085
2086             Parameters:
2087                 thePnt Central point of cylinder base.
2088                 theAxis Cylinder axis.
2089                 theR Cylinder radius.
2090                 theH Cylinder height.
2091
2092             Returns: 
2093                 New GEOM.GEOM_Object, containing the created cylinder.
2094             """
2095             # Example: see GEOM_TestAll.py
2096             theR,theH,Parameters = ParseParameters(theR, theH)
2097             anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2098             RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2099             anObj.SetParameters(Parameters)
2100             return anObj
2101
2102         ## Create a cylinder with given radius and height at
2103         #  the origin of coordinate system. Axis of the cylinder
2104         #  will be collinear to the OZ axis of the coordinate system.
2105         #  @param theR Cylinder radius.
2106         #  @param theH Cylinder height.
2107         #  @return New GEOM.GEOM_Object, containing the created cylinder.
2108         #
2109         #  @ref tui_creation_cylinder "Example"
2110         def MakeCylinderRH(self,theR, theH):
2111             """
2112             Create a cylinder with given radius and height at
2113             the origin of coordinate system. Axis of the cylinder
2114             will be collinear to the OZ axis of the coordinate system.
2115
2116             Parameters:
2117                 theR Cylinder radius.
2118                 theH Cylinder height.
2119
2120             Returns:    
2121                 New GEOM.GEOM_Object, containing the created cylinder.
2122             """
2123             # Example: see GEOM_TestAll.py
2124             theR,theH,Parameters = ParseParameters(theR, theH)
2125             anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2126             RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2127             anObj.SetParameters(Parameters)
2128             return anObj
2129
2130         ## Create a sphere with given center and radius.
2131         #  @param thePnt Sphere center.
2132         #  @param theR Sphere radius.
2133         #  @return New GEOM.GEOM_Object, containing the created sphere.
2134         #
2135         #  @ref tui_creation_sphere "Example"
2136         def MakeSpherePntR(self, thePnt, theR):
2137             """
2138             Create a sphere with given center and radius.
2139
2140             Parameters:
2141                 thePnt Sphere center.
2142                 theR Sphere radius.
2143
2144             Returns:    
2145                 New GEOM.GEOM_Object, containing the created sphere.            
2146             """
2147             # Example: see GEOM_TestAll.py
2148             theR,Parameters = ParseParameters(theR)
2149             anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2150             RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2151             anObj.SetParameters(Parameters)
2152             return anObj
2153
2154         ## Create a sphere with given center and radius.
2155         #  @param x,y,z Coordinates of sphere center.
2156         #  @param theR Sphere radius.
2157         #  @return New GEOM.GEOM_Object, containing the created sphere.
2158         #
2159         #  @ref tui_creation_sphere "Example"
2160         def MakeSphere(self, x, y, z, theR):
2161             """
2162             Create a sphere with given center and radius.
2163
2164             Parameters: 
2165                 x,y,z Coordinates of sphere center.
2166                 theR Sphere radius.
2167
2168             Returns:
2169                 New GEOM.GEOM_Object, containing the created sphere.
2170             """
2171             # Example: see GEOM_TestAll.py
2172             point = self.MakeVertex(x, y, z)
2173             anObj = self.MakeSpherePntR(point, theR)
2174             return anObj
2175
2176         ## Create a sphere with given radius at the origin of coordinate system.
2177         #  @param theR Sphere radius.
2178         #  @return New GEOM.GEOM_Object, containing the created sphere.
2179         #
2180         #  @ref tui_creation_sphere "Example"
2181         def MakeSphereR(self, theR):
2182             """
2183             Create a sphere with given radius at the origin of coordinate system.
2184
2185             Parameters: 
2186                 theR Sphere radius.
2187
2188             Returns:
2189                 New GEOM.GEOM_Object, containing the created sphere.            
2190             """
2191             # Example: see GEOM_TestAll.py
2192             theR,Parameters = ParseParameters(theR)
2193             anObj = self.PrimOp.MakeSphereR(theR)
2194             RaiseIfFailed("MakeSphereR", self.PrimOp)
2195             anObj.SetParameters(Parameters)
2196             return anObj
2197
2198         ## Create a cone with given base point, axis, height and radiuses.
2199         #  @param thePnt Central point of the first cone base.
2200         #  @param theAxis Cone axis.
2201         #  @param theR1 Radius of the first cone base.
2202         #  @param theR2 Radius of the second cone base.
2203         #    \note If both radiuses are non-zero, the cone will be truncated.
2204         #    \note If the radiuses are equal, a cylinder will be created instead.
2205         #  @param theH Cone height.
2206         #  @return New GEOM.GEOM_Object, containing the created cone.
2207         #
2208         #  @ref tui_creation_cone "Example"
2209         def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
2210             """
2211             Create a cone with given base point, axis, height and radiuses.
2212
2213             Parameters: 
2214                 thePnt Central point of the first cone base.
2215                 theAxis Cone axis.
2216                 theR1 Radius of the first cone base.
2217                 theR2 Radius of the second cone base.
2218                 theH Cone height.
2219
2220             Note:
2221                 If both radiuses are non-zero, the cone will be truncated.
2222                 If the radiuses are equal, a cylinder will be created instead.
2223
2224             Returns:
2225                 New GEOM.GEOM_Object, containing the created cone.
2226             """
2227             # Example: see GEOM_TestAll.py
2228             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2229             anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2230             RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2231             anObj.SetParameters(Parameters)
2232             return anObj
2233
2234         ## Create a cone with given height and radiuses at
2235         #  the origin of coordinate system. Axis of the cone will
2236         #  be collinear to the OZ axis of the coordinate system.
2237         #  @param theR1 Radius of the first cone base.
2238         #  @param theR2 Radius of the second cone base.
2239         #    \note If both radiuses are non-zero, the cone will be truncated.
2240         #    \note If the radiuses are equal, a cylinder will be created instead.
2241         #  @param theH Cone height.
2242         #  @return New GEOM.GEOM_Object, containing the created cone.
2243         #
2244         #  @ref tui_creation_cone "Example"
2245         def MakeConeR1R2H(self,theR1, theR2, theH):
2246             """
2247             Create a cone with given height and radiuses at
2248             the origin of coordinate system. Axis of the cone will
2249             be collinear to the OZ axis of the coordinate system.
2250
2251             Parameters: 
2252                 theR1 Radius of the first cone base.
2253                 theR2 Radius of the second cone base.
2254                 theH Cone height.
2255
2256             Note:
2257                 If both radiuses are non-zero, the cone will be truncated.
2258                 If the radiuses are equal, a cylinder will be created instead.
2259
2260             Returns:
2261                 New GEOM.GEOM_Object, containing the created cone.
2262             """
2263             # Example: see GEOM_TestAll.py
2264             theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2265             anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2266             RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2267             anObj.SetParameters(Parameters)
2268             return anObj
2269
2270         ## Create a torus with given center, normal vector and radiuses.
2271         #  @param thePnt Torus central point.
2272         #  @param theVec Torus axis of symmetry.
2273         #  @param theRMajor Torus major radius.
2274         #  @param theRMinor Torus minor radius.
2275         #  @return New GEOM.GEOM_Object, containing the created torus.
2276         #
2277         #  @ref tui_creation_torus "Example"
2278         def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
2279             """
2280             Create a torus with given center, normal vector and radiuses.
2281
2282             Parameters: 
2283                 thePnt Torus central point.
2284                 theVec Torus axis of symmetry.
2285                 theRMajor Torus major radius.
2286                 theRMinor Torus minor radius.
2287
2288            Returns:
2289                 New GEOM.GEOM_Object, containing the created torus.
2290             """
2291             # Example: see GEOM_TestAll.py
2292             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2293             anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
2294             RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
2295             anObj.SetParameters(Parameters)
2296             return anObj
2297
2298         ## Create a torus with given radiuses at the origin of coordinate system.
2299         #  @param theRMajor Torus major radius.
2300         #  @param theRMinor Torus minor radius.
2301         #  @return New GEOM.GEOM_Object, containing the created torus.
2302         #
2303         #  @ref tui_creation_torus "Example"
2304         def MakeTorusRR(self, theRMajor, theRMinor):
2305             """
2306            Create a torus with given radiuses at the origin of coordinate system.
2307
2308            Parameters: 
2309                 theRMajor Torus major radius.
2310                 theRMinor Torus minor radius.
2311
2312            Returns:
2313                 New GEOM.GEOM_Object, containing the created torus.            
2314             """
2315             # Example: see GEOM_TestAll.py
2316             theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2317             anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
2318             RaiseIfFailed("MakeTorusRR", self.PrimOp)
2319             anObj.SetParameters(Parameters)
2320             return anObj
2321
2322         # end of l3_3d_primitives
2323         ## @}
2324
2325         ## @addtogroup l3_complex
2326         ## @{
2327
2328         ## Create a shape by extrusion of the base shape along a vector, defined by two points.
2329         #  @param theBase Base shape to be extruded.
2330         #  @param thePoint1 First end of extrusion vector.
2331         #  @param thePoint2 Second end of extrusion vector.
2332         #  @param theScaleFactor Use it to make prism with scaled second base.
2333         #                        Nagative value means not scaled second base.
2334         #  @return New GEOM.GEOM_Object, containing the created prism.
2335         #
2336         #  @ref tui_creation_prism "Example"
2337         def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0):
2338             """
2339             Create a shape by extrusion of the base shape along a vector, defined by two points.
2340
2341             Parameters: 
2342                 theBase Base shape to be extruded.
2343                 thePoint1 First end of extrusion vector.
2344                 thePoint2 Second end of extrusion vector.
2345                 theScaleFactor Use it to make prism with scaled second base.
2346                                Nagative value means not scaled second base.
2347
2348             Returns:
2349                 New GEOM.GEOM_Object, containing the created prism.
2350             """
2351             # Example: see GEOM_TestAll.py
2352             anObj = None
2353             Parameters = ""
2354             if theScaleFactor > 0:
2355                 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
2356                 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
2357             else:
2358                 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
2359             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2360             anObj.SetParameters(Parameters)
2361             return anObj
2362
2363         ## Create a shape by extrusion of the base shape along a
2364         #  vector, defined by two points, in 2 Ways (forward/backward).
2365         #  @param theBase Base shape to be extruded.
2366         #  @param thePoint1 First end of extrusion vector.
2367         #  @param thePoint2 Second end of extrusion vector.
2368         #  @return New GEOM.GEOM_Object, containing the created prism.
2369         #
2370         #  @ref tui_creation_prism "Example"
2371         def MakePrism2Ways(self, theBase, thePoint1, thePoint2):
2372             """
2373             Create a shape by extrusion of the base shape along a
2374             vector, defined by two points, in 2 Ways (forward/backward).
2375
2376             Parameters: 
2377                 theBase Base shape to be extruded.
2378                 thePoint1 First end of extrusion vector.
2379                 thePoint2 Second end of extrusion vector.
2380
2381             Returns:
2382                 New GEOM.GEOM_Object, containing the created prism.
2383             """
2384             # Example: see GEOM_TestAll.py
2385             anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
2386             RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
2387             return anObj
2388
2389         ## Create a shape by extrusion of the base shape along the vector,
2390         #  i.e. all the space, transfixed by the base shape during its translation
2391         #  along the vector on the given distance.
2392         #  @param theBase Base shape to be extruded.
2393         #  @param theVec Direction of extrusion.
2394         #  @param theH Prism dimension along theVec.
2395         #  @param theScaleFactor Use it to make prism with scaled second base.
2396         #                        Negative value means not scaled second base.
2397         #  @return New GEOM.GEOM_Object, containing the created prism.
2398         #
2399         #  @ref tui_creation_prism "Example"
2400         def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0):
2401             """
2402             Create a shape by extrusion of the base shape along the vector,
2403             i.e. all the space, transfixed by the base shape during its translation
2404             along the vector on the given distance.
2405
2406             Parameters: 
2407                 theBase Base shape to be extruded.
2408                 theVec Direction of extrusion.
2409                 theH Prism dimension along theVec.
2410                 theScaleFactor Use it to make prism with scaled second base.
2411                                Negative value means not scaled second base.
2412
2413             Returns:
2414                 New GEOM.GEOM_Object, containing the created prism.
2415             """
2416             # Example: see GEOM_TestAll.py
2417             anObj = None
2418             Parameters = ""
2419             if theScaleFactor > 0:
2420                 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
2421                 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
2422             else:
2423                 theH,Parameters = ParseParameters(theH)
2424                 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
2425             RaiseIfFailed("MakePrismVecH", self.PrimOp)
2426             anObj.SetParameters(Parameters)
2427             return anObj
2428
2429         ## Create a shape by extrusion of the base shape along the vector,
2430         #  i.e. all the space, transfixed by the base shape during its translation
2431         #  along the vector on the given distance in 2 Ways (forward/backward).
2432         #  @param theBase Base shape to be extruded.
2433         #  @param theVec Direction of extrusion.
2434         #  @param theH Prism dimension along theVec in forward direction.
2435         #  @return New GEOM.GEOM_Object, containing the created prism.
2436         #
2437         #  @ref tui_creation_prism "Example"
2438         def MakePrismVecH2Ways(self, theBase, theVec, theH):
2439             """
2440             Create a shape by extrusion of the base shape along the vector,
2441             i.e. all the space, transfixed by the base shape during its translation
2442             along the vector on the given distance in 2 Ways (forward/backward).
2443
2444             Parameters:
2445                 theBase Base shape to be extruded.
2446                 theVec Direction of extrusion.
2447                 theH Prism dimension along theVec in forward direction.
2448
2449             Returns:
2450                 New GEOM.GEOM_Object, containing the created prism.
2451             """
2452             # Example: see GEOM_TestAll.py
2453             theH,Parameters = ParseParameters(theH)
2454             anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
2455             RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
2456             anObj.SetParameters(Parameters)
2457             return anObj
2458
2459         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2460         #  @param theBase Base shape to be extruded.
2461         #  @param theDX, theDY, theDZ Directions of extrusion.
2462         #  @param theScaleFactor Use it to make prism with scaled second base.
2463         #                        Nagative value means not scaled second base.
2464         #  @return New GEOM.GEOM_Object, containing the created prism.
2465         #
2466         #  @ref tui_creation_prism "Example"
2467         def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0):
2468             """
2469             Create a shape by extrusion of the base shape along the dx, dy, dz direction
2470
2471             Parameters:
2472                 theBase Base shape to be extruded.
2473                 theDX, theDY, theDZ Directions of extrusion.
2474                 theScaleFactor Use it to make prism with scaled second base.
2475                                Nagative value means not scaled second base.
2476
2477             Returns: 
2478                 New GEOM.GEOM_Object, containing the created prism.
2479             """
2480             # Example: see GEOM_TestAll.py
2481             anObj = None
2482             Parameters = ""
2483             if theScaleFactor > 0:
2484                 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
2485                 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
2486             else:
2487                 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2488                 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
2489             RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
2490             anObj.SetParameters(Parameters)
2491             return anObj
2492
2493         ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
2494         #  i.e. all the space, transfixed by the base shape during its translation
2495         #  along the vector on the given distance in 2 Ways (forward/backward).
2496         #  @param theBase Base shape to be extruded.
2497         #  @param theDX, theDY, theDZ Directions of extrusion.
2498         #  @return New GEOM.GEOM_Object, containing the created prism.
2499         #
2500         #  @ref tui_creation_prism "Example"
2501         def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
2502             """
2503             Create a shape by extrusion of the base shape along the dx, dy, dz direction
2504             i.e. all the space, transfixed by the base shape during its translation
2505             along the vector on the given distance in 2 Ways (forward/backward).
2506
2507             Parameters:
2508                 theBase Base shape to be extruded.
2509                 theDX, theDY, theDZ Directions of extrusion.
2510
2511             Returns:
2512                 New GEOM.GEOM_Object, containing the created prism.
2513             """
2514             # Example: see GEOM_TestAll.py
2515             theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2516             anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
2517             RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
2518             anObj.SetParameters(Parameters)
2519             return anObj
2520
2521         ## Create a shape by revolution of the base shape around the axis
2522         #  on the given angle, i.e. all the space, transfixed by the base
2523         #  shape during its rotation around the axis on the given angle.
2524         #  @param theBase Base shape to be rotated.
2525         #  @param theAxis Rotation axis.
2526         #  @param theAngle Rotation angle in radians.
2527         #  @return New GEOM.GEOM_Object, containing the created revolution.
2528         #
2529         #  @ref tui_creation_revolution "Example"
2530         def MakeRevolution(self, theBase, theAxis, theAngle):
2531             """
2532             Create a shape by revolution of the base shape around the axis
2533             on the given angle, i.e. all the space, transfixed by the base
2534             shape during its rotation around the axis on the given angle.
2535
2536             Parameters:
2537                 theBase Base shape to be rotated.
2538                 theAxis Rotation axis.
2539                 theAngle Rotation angle in radians.
2540
2541             Returns: 
2542                 New GEOM.GEOM_Object, containing the created revolution.
2543             """
2544             # Example: see GEOM_TestAll.py
2545             theAngle,Parameters = ParseParameters(theAngle)
2546             anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
2547             RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
2548             anObj.SetParameters(Parameters)
2549             return anObj
2550
2551         ## Create a shape by revolution of the base shape around the axis
2552         #  on the given angle, i.e. all the space, transfixed by the base
2553         #  shape during its rotation around the axis on the given angle in
2554         #  both directions (forward/backward)
2555         #  @param theBase Base shape to be rotated.
2556         #  @param theAxis Rotation axis.
2557         #  @param theAngle Rotation angle in radians.
2558         #  @return New GEOM.GEOM_Object, containing the created revolution.
2559         #
2560         #  @ref tui_creation_revolution "Example"
2561         def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
2562             """
2563             Create a shape by revolution of the base shape around the axis
2564             on the given angle, i.e. all the space, transfixed by the base
2565             shape during its rotation around the axis on the given angle in
2566             both directions (forward/backward).
2567
2568             Parameters:
2569                 theBase Base shape to be rotated.
2570                 theAxis Rotation axis.
2571                 theAngle Rotation angle in radians.
2572
2573             Returns: 
2574                 New GEOM.GEOM_Object, containing the created revolution.
2575             """
2576             theAngle,Parameters = ParseParameters(theAngle)
2577             anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
2578             RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
2579             anObj.SetParameters(Parameters)
2580             return anObj
2581
2582         ## Create a filling from the given compound of contours.
2583         #  @param theShape the compound of contours
2584         #  @param theMinDeg a minimal degree of BSpline surface to create
2585         #  @param theMaxDeg a maximal degree of BSpline surface to create
2586         #  @param theTol2D a 2d tolerance to be reached
2587         #  @param theTol3D a 3d tolerance to be reached
2588         #  @param theNbIter a number of iteration of approximation algorithm
2589         #  @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2590         #  @param isApprox if True, BSpline curves are generated in the process
2591         #                  of surface construction. By default it is False, that means
2592         #                  the surface is created using given curves. The usage of
2593         #                  Approximation makes the algorithm work slower, but allows
2594         #                  building the surface for rather complex cases.
2595         #  @return New GEOM.GEOM_Object, containing the created filling surface.
2596         #
2597         #  @ref tui_creation_filling "Example"
2598         def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
2599                         theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0):
2600             """
2601             Create a filling from the given compound of contours.
2602
2603             Parameters:
2604                 theShape the compound of contours
2605                 theMinDeg a minimal degree of BSpline surface to create
2606                 theMaxDeg a maximal degree of BSpline surface to create
2607                 theTol2D a 2d tolerance to be reached
2608                 theTol3D a 3d tolerance to be reached
2609                 theNbIter a number of iteration of approximation algorithm
2610                 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
2611                 isApprox if True, BSpline curves are generated in the process
2612                          of surface construction. By default it is False, that means
2613                          the surface is created using given curves. The usage of
2614                          Approximation makes the algorithm work slower, but allows
2615                          building the surface for rather complex cases
2616
2617             Returns: 
2618                 New GEOM.GEOM_Object, containing the created filling surface.
2619
2620             Example of usage:
2621                 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
2622             """
2623             # Example: see GEOM_TestAll.py
2624             theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
2625             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2626                                             theTol2D, theTol3D, theNbIter,
2627                                             theMethod, isApprox)
2628             RaiseIfFailed("MakeFilling", self.PrimOp)
2629             anObj.SetParameters(Parameters)
2630             return anObj
2631
2632
2633         ## Create a filling from the given compound of contours.
2634         #  This method corresponds to MakeFilling with isApprox=True
2635         #  @param theShape the compound of contours
2636         #  @param theMinDeg a minimal degree of BSpline surface to create
2637         #  @param theMaxDeg a maximal degree of BSpline surface to create
2638         #  @param theTol3D a 3d tolerance to be reached
2639         #  @return New GEOM.GEOM_Object, containing the created filling surface.
2640         #
2641         #  @ref tui_creation_filling "Example"
2642         def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001):
2643             """
2644             Create a filling from the given compound of contours.
2645             This method corresponds to MakeFilling with isApprox=True
2646
2647             Parameters:
2648                 theShape the compound of contours
2649                 theMinDeg a minimal degree of BSpline surface to create
2650                 theMaxDeg a maximal degree of BSpline surface to create
2651                 theTol3D a 3d tolerance to be reached
2652
2653             Returns: 
2654                 New GEOM.GEOM_Object, containing the created filling surface.
2655
2656             Example of usage:
2657                 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
2658             """
2659             # Example: see GEOM_TestAll.py
2660             theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
2661             anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
2662                                             0, theTol3D, 0, GEOM.FOM_Default, True)
2663             RaiseIfFailed("MakeFillingNew", self.PrimOp)
2664             anObj.SetParameters(Parameters)
2665             return anObj
2666
2667         ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2668         #  @param theSeqSections - set of specified sections.
2669         #  @param theModeSolid - mode defining building solid or shell
2670         #  @param thePreci - precision 3D used for smoothing
2671         #  @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
2672         #  @return New GEOM.GEOM_Object, containing the created shell or solid.
2673         #
2674         #  @ref swig_todo "Example"
2675         def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
2676             """
2677             Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
2678
2679             Parameters:
2680                 theSeqSections - set of specified sections.
2681                 theModeSolid - mode defining building solid or shell
2682                 thePreci - precision 3D used for smoothing
2683                 theRuled - mode defining type of the result surfaces (ruled or smoothed).
2684
2685             Returns:
2686                 New GEOM.GEOM_Object, containing the created shell or solid.
2687             """
2688             # Example: see GEOM_TestAll.py
2689             anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
2690             RaiseIfFailed("MakeThruSections", self.PrimOp)
2691             return anObj
2692
2693         ## Create a shape by extrusion of the base shape along
2694         #  the path shape. The path shape can be a wire or an edge.
2695         #  @param theBase Base shape to be extruded.
2696         #  @param thePath Path shape to extrude the base shape along it.
2697         #  @return New GEOM.GEOM_Object, containing the created pipe.
2698         #
2699         #  @ref tui_creation_pipe "Example"
2700         def MakePipe(self,theBase, thePath):
2701             """
2702             Create a shape by extrusion of the base shape along
2703             the path shape. The path shape can be a wire or an edge.
2704
2705             Parameters:
2706                 theBase Base shape to be extruded.
2707                 thePath Path shape to extrude the base shape along it.
2708
2709             Returns:
2710                 New GEOM.GEOM_Object, containing the created pipe.
2711             """
2712             # Example: see GEOM_TestAll.py
2713             anObj = self.PrimOp.MakePipe(theBase, thePath)
2714             RaiseIfFailed("MakePipe", self.PrimOp)
2715             return anObj
2716
2717         ## Create a shape by extrusion of the profile shape along
2718         #  the path shape. The path shape can be a wire or an edge.
2719         #  the several profiles can be specified in the several locations of path.
2720         #  @param theSeqBases - list of  Bases shape to be extruded.
2721         #  @param theLocations - list of locations on the path corresponding
2722         #                        specified list of the Bases shapes. Number of locations
2723         #                        should be equal to number of bases or list of locations can be empty.
2724         #  @param thePath - Path shape to extrude the base shape along it.
2725         #  @param theWithContact - the mode defining that the section is translated to be in
2726         #                          contact with the spine.
2727         #  @param theWithCorrection - defining that the section is rotated to be
2728         #                             orthogonal to the spine tangent in the correspondent point
2729         #  @return New GEOM.GEOM_Object, containing the created pipe.
2730         #
2731         #  @ref tui_creation_pipe_with_diff_sec "Example"
2732         def MakePipeWithDifferentSections(self, theSeqBases,
2733                                           theLocations, thePath,
2734                                           theWithContact, theWithCorrection):
2735             """
2736             Create a shape by extrusion of the profile shape along
2737             the path shape. The path shape can be a wire or an edge.
2738             the several profiles can be specified in the several locations of path.
2739
2740             Parameters:
2741                 theSeqBases - list of  Bases shape to be extruded.
2742                 theLocations - list of locations on the path corresponding
2743                                specified list of the Bases shapes. Number of locations
2744                                should be equal to number of bases or list of locations can be empty.
2745                 thePath - Path shape to extrude the base shape along it.
2746                 theWithContact - the mode defining that the section is translated to be in
2747                                  contact with the spine(0/1)
2748                 theWithCorrection - defining that the section is rotated to be
2749                                     orthogonal to the spine tangent in the correspondent point (0/1)
2750
2751             Returns:
2752                 New GEOM.GEOM_Object, containing the created pipe.
2753             """
2754             anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
2755                                                               theLocations, thePath,
2756                                                               theWithContact, theWithCorrection)
2757             RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
2758             return anObj
2759
2760         ## Create a shape by extrusion of the profile shape along
2761         #  the path shape. The path shape can be a wire or a edge.
2762         #  the several profiles can be specified in the several locations of path.
2763         #  @param theSeqBases - list of  Bases shape to be extruded. Base shape must be
2764         #                       shell or face. If number of faces in neighbour sections
2765         #                       aren't coincided result solid between such sections will
2766         #                       be created using external boundaries of this shells.
2767         #  @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
2768         #                          This list is used for searching correspondences between
2769         #                          faces in the sections. Size of this list must be equal
2770         #                          to size of list of base shapes.
2771         #  @param theLocations - list of locations on the path corresponding
2772         #                        specified list of the Bases shapes. Number of locations
2773         #                        should be equal to number of bases. First and last
2774         #                        locations must be coincided with first and last vertexes
2775         #                        of path correspondingly.
2776         #  @param thePath - Path shape to extrude the base shape along it.
2777         #  @param theWithContact - the mode defining that the section is translated to be in
2778         #                          contact with the spine.
2779         #  @param theWithCorrection - defining that the section is rotated to be
2780         #                             orthogonal to the spine tangent in the correspondent point
2781         #  @return New GEOM.GEOM_Object, containing the created solids.
2782         #
2783         #  @ref tui_creation_pipe_with_shell_sec "Example"
2784         def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
2785                                       theLocations, thePath,
2786                                       theWithContact, theWithCorrection):
2787             """
2788             Create a shape by extrusion of the profile shape along
2789             the path shape. The path shape can be a wire or a edge.
2790             the several profiles can be specified in the several locations of path.
2791
2792             Parameters:
2793                 theSeqBases - list of  Bases shape to be extruded. Base shape must be
2794                               shell or face. If number of faces in neighbour sections
2795                               aren't coincided result solid between such sections will
2796                               be created using external boundaries of this shells.
2797                 theSeqSubBases - list of corresponding sub-shapes of section shapes.
2798                                  This list is used for searching correspondences between
2799                                  faces in the sections. Size of this list must be equal
2800                                  to size of list of base shapes.
2801                 theLocations - list of locations on the path corresponding
2802                                specified list of the Bases shapes. Number of locations
2803                                should be equal to number of bases. First and last
2804                                locations must be coincided with first and last vertexes
2805                                of path correspondingly.
2806                 thePath - Path shape to extrude the base shape along it.
2807                 theWithContact - the mode defining that the section is translated to be in
2808                                  contact with the spine (0/1)
2809                 theWithCorrection - defining that the section is rotated to be
2810                                     orthogonal to the spine tangent in the correspondent point (0/1)
2811
2812             Returns:                           
2813                 New GEOM.GEOM_Object, containing the created solids.
2814             """
2815             anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
2816                                                           theLocations, thePath,
2817                                                           theWithContact, theWithCorrection)
2818             RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2819             return anObj
2820
2821         ## Create a shape by extrusion of the profile shape along
2822         #  the path shape. This function is used only for debug pipe
2823         #  functionality - it is a version of function MakePipeWithShellSections()
2824         #  which give a possibility to recieve information about
2825         #  creating pipe between each pair of sections step by step.
2826         def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
2827                                              theLocations, thePath,
2828                                              theWithContact, theWithCorrection):
2829             """
2830             Create a shape by extrusion of the profile shape along
2831             the path shape. This function is used only for debug pipe
2832             functionality - it is a version of previous function
2833             geompy.MakePipeWithShellSections() which give a possibility to
2834             recieve information about creating pipe between each pair of
2835             sections step by step.
2836             """
2837             res = []
2838             nbsect = len(theSeqBases)
2839             nbsubsect = len(theSeqSubBases)
2840             #print "nbsect = ",nbsect
2841             for i in range(1,nbsect):
2842                 #print "  i = ",i
2843                 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
2844                 tmpLocations = [ theLocations[i-1], theLocations[i] ]
2845                 tmpSeqSubBases = []
2846                 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
2847                 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
2848                                                               tmpLocations, thePath,
2849                                                               theWithContact, theWithCorrection)
2850                 if self.PrimOp.IsDone() == 0:
2851                     print "Problems with pipe creation between ",i," and ",i+1," sections"
2852                     RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
2853                     break
2854                 else:
2855                     print "Pipe between ",i," and ",i+1," sections is OK"
2856                     res.append(anObj)
2857                     pass
2858                 pass
2859
2860             resc = self.MakeCompound(res)
2861             #resc = self.MakeSewing(res, 0.001)
2862             #print "resc: ",resc
2863             return resc
2864
2865         ## Create solids between given sections
2866         #  @param theSeqBases - list of sections (shell or face).
2867         #  @param theLocations - list of corresponding vertexes
2868         #  @return New GEOM.GEOM_Object, containing the created solids.
2869         #
2870         #  @ref tui_creation_pipe_without_path "Example"
2871         def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
2872             """
2873             Create solids between given sections
2874
2875             Parameters:
2876                 theSeqBases - list of sections (shell or face).
2877                 theLocations - list of corresponding vertexes
2878
2879             Returns:
2880                 New GEOM.GEOM_Object, containing the created solids.
2881             """
2882             anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
2883             RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
2884             return anObj
2885
2886         ## Create a shape by extrusion of the base shape along
2887         #  the path shape with constant bi-normal direction along the given vector.
2888         #  The path shape can be a wire or an edge.
2889         #  @param theBase Base shape to be extruded.
2890         #  @param thePath Path shape to extrude the base shape along it.
2891         #  @param theVec Vector defines a constant binormal direction to keep the
2892         #                same angle beetween the direction and the sections
2893         #                along the sweep surface.
2894         #  @return New GEOM.GEOM_Object, containing the created pipe.
2895         #
2896         #  @ref tui_creation_pipe "Example"
2897         def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
2898             """
2899             Create a shape by extrusion of the base shape along
2900             the path shape with constant bi-normal direction along the given vector.
2901             The path shape can be a wire or an edge.
2902
2903             Parameters:
2904                 theBase Base shape to be extruded.
2905                 thePath Path shape to extrude the base shape along it.
2906                 theVec Vector defines a constant binormal direction to keep the
2907                        same angle beetween the direction and the sections
2908                        along the sweep surface.
2909
2910             Returns:              
2911                 New GEOM.GEOM_Object, containing the created pipe.
2912             """
2913             # Example: see GEOM_TestAll.py
2914             anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
2915             RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
2916             return anObj
2917
2918         ## Build a middle path of a pipe-like shape.
2919         #  The path shape can be a wire or an edge.
2920         #  @param theShape It can be closed or unclosed pipe-like shell
2921         #                  or a pipe-like solid.
2922         #  @param theBase1, theBase2 Two bases of the supposed pipe. This
2923         #                            should be wires or faces of theShape.
2924         #  @note It is not assumed that exact or approximate copy of theShape
2925         #        can be obtained by applying existing Pipe operation on the
2926         #        resulting "Path" wire taking theBase1 as the base - it is not
2927         #        always possible; though in some particular cases it might work
2928         #        it is not guaranteed. Thus, RestorePath function should not be
2929         #        considered as an exact reverse operation of the Pipe.
2930         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
2931         #                                source pipe's "path".
2932         #
2933         #  @ref tui_creation_pipe_path "Example"
2934         def RestorePath (self, theShape, theBase1, theBase2):
2935             """
2936             Build a middle path of a pipe-like shape.
2937             The path shape can be a wire or an edge.
2938
2939             Parameters:
2940                 theShape It can be closed or unclosed pipe-like shell
2941                          or a pipe-like solid.
2942                 theBase1, theBase2 Two bases of the supposed pipe. This
2943                                    should be wires or faces of theShape.
2944
2945             Returns:
2946                 New GEOM_Object, containing an edge or wire that represent
2947                                  source pipe's path.
2948             """
2949             anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
2950             RaiseIfFailed("RestorePath", self.PrimOp)
2951             return anObj
2952
2953         ## Build a middle path of a pipe-like shape.
2954         #  The path shape can be a wire or an edge.
2955         #  @param theShape It can be closed or unclosed pipe-like shell
2956         #                  or a pipe-like solid.
2957         #  @param listEdges1, listEdges2 Two bases of the supposed pipe. This
2958         #                                should be lists of edges of theShape.
2959         #  @note It is not assumed that exact or approximate copy of theShape
2960         #        can be obtained by applying existing Pipe operation on the
2961         #        resulting "Path" wire taking theBase1 as the base - it is not
2962         #        always possible; though in some particular cases it might work
2963         #        it is not guaranteed. Thus, RestorePath function should not be
2964         #        considered as an exact reverse operation of the Pipe.
2965         #  @return New GEOM.GEOM_Object, containing an edge or wire that represent
2966         #                                source pipe's "path".
2967         #
2968         #  @ref tui_creation_pipe_path "Example"
2969         def RestorePathEdges (self, theShape, listEdges1, listEdges2):
2970             """
2971             Build a middle path of a pipe-like shape.
2972             The path shape can be a wire or an edge.
2973
2974             Parameters:
2975                 theShape It can be closed or unclosed pipe-like shell
2976                          or a pipe-like solid.
2977                 listEdges1, listEdges2 Two bases of the supposed pipe. This
2978                                        should be lists of edges of theShape.
2979
2980             Returns:
2981                 New GEOM_Object, containing an edge or wire that represent
2982                                  source pipe's path.
2983             """
2984             anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
2985             RaiseIfFailed("RestorePath", self.PrimOp)
2986             return anObj
2987
2988         # end of l3_complex
2989         ## @}
2990
2991         ## @addtogroup l3_advanced
2992         ## @{
2993
2994         ## Create a linear edge with specified ends.
2995         #  @param thePnt1 Point for the first end of edge.
2996         #  @param thePnt2 Point for the second end of edge.
2997         #  @return New GEOM.GEOM_Object, containing the created edge.
2998         #
2999         #  @ref tui_creation_edge "Example"
3000         def MakeEdge(self,thePnt1, thePnt2):
3001             """
3002             Create a linear edge with specified ends.
3003
3004             Parameters:
3005                 thePnt1 Point for the first end of edge.
3006                 thePnt2 Point for the second end of edge.
3007
3008             Returns:           
3009                 New GEOM.GEOM_Object, containing the created edge.
3010             """
3011             # Example: see GEOM_TestAll.py
3012             anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
3013             RaiseIfFailed("MakeEdge", self.ShapesOp)
3014             return anObj
3015
3016         ## Create a new edge, corresponding to the given length on the given curve.
3017         #  @param theRefCurve The referenced curve (edge).
3018         #  @param theLength Length on the referenced curve. It can be negative.
3019         #  @param theStartPoint Any point can be selected for it, the new edge will begin
3020         #                       at the end of \a theRefCurve, close to the selected point.
3021         #                       If None, start from the first point of \a theRefCurve.
3022         #  @return New GEOM.GEOM_Object, containing the created edge.
3023         #
3024         #  @ref tui_creation_edge "Example"
3025         def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
3026             """
3027             Create a new edge, corresponding to the given length on the given curve.
3028
3029             Parameters:
3030                 theRefCurve The referenced curve (edge).
3031                 theLength Length on the referenced curve. It can be negative.
3032                 theStartPoint Any point can be selected for it, the new edge will begin
3033                               at the end of theRefCurve, close to the selected point.
3034                               If None, start from the first point of theRefCurve.
3035
3036             Returns:              
3037                 New GEOM.GEOM_Object, containing the created edge.
3038             """
3039             # Example: see GEOM_TestAll.py
3040             theLength, Parameters = ParseParameters(theLength)
3041             anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
3042             RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
3043             anObj.SetParameters(Parameters)
3044             return anObj
3045
3046         ## Create an edge from specified wire.
3047         #  @param theWire source Wire
3048         #  @param theLinearTolerance linear tolerance value (default = 1e-07)
3049         #  @param theAngularTolerance angular tolerance value (default = 1e-12)
3050         #  @return New GEOM.GEOM_Object, containing the created edge.
3051         #
3052         #  @ref tui_creation_edge "Example"
3053         def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
3054             """
3055             Create an edge from specified wire.
3056
3057             Parameters:
3058                 theWire source Wire
3059                 theLinearTolerance linear tolerance value (default = 1e-07)
3060                 theAngularTolerance angular tolerance value (default = 1e-12)
3061
3062             Returns:
3063                 New GEOM.GEOM_Object, containing the created edge.
3064             """
3065             # Example: see GEOM_TestAll.py
3066             anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
3067             RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
3068             return anObj
3069
3070         ## Create a wire from the set of edges and wires.
3071         #  @param theEdgesAndWires List of edges and/or wires.
3072         #  @param theTolerance Maximum distance between vertices, that will be merged.
3073         #                      Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
3074         #  @return New GEOM.GEOM_Object, containing the created wire.
3075         #
3076         #  @ref tui_creation_wire "Example"
3077         def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
3078             """
3079             Create a wire from the set of edges and wires.
3080
3081             Parameters:
3082                 theEdgesAndWires List of edges and/or wires.
3083                 theTolerance Maximum distance between vertices, that will be merged.
3084                              Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
3085
3086             Returns:                    
3087                 New GEOM.GEOM_Object, containing the created wire.
3088             """
3089             # Example: see GEOM_TestAll.py
3090             anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
3091             RaiseIfFailed("MakeWire", self.ShapesOp)
3092             return anObj
3093
3094         ## Create a face on the given wire.
3095         #  @param theWire closed Wire or Edge to build the face on.
3096         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3097         #                        If the tolerance of the obtained planar face is less
3098         #                        than 1e-06, this face will be returned, otherwise the
3099         #                        algorithm tries to build any suitable face on the given
3100         #                        wire and prints a warning message.
3101         #  @return New GEOM.GEOM_Object, containing the created face.
3102         #
3103         #  @ref tui_creation_face "Example"
3104         def MakeFace(self, theWire, isPlanarWanted):
3105             """
3106             Create a face on the given wire.
3107
3108             Parameters:
3109                 theWire closed Wire or Edge to build the face on.
3110                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3111                                If the tolerance of the obtained planar face is less
3112                                than 1e-06, this face will be returned, otherwise the
3113                                algorithm tries to build any suitable face on the given
3114                                wire and prints a warning message.
3115
3116             Returns:
3117                 New GEOM.GEOM_Object, containing the created face.
3118             """
3119             # Example: see GEOM_TestAll.py
3120             anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
3121             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3122                 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3123             else:
3124                 RaiseIfFailed("MakeFace", self.ShapesOp)
3125             return anObj
3126
3127         ## Create a face on the given wires set.
3128         #  @param theWires List of closed wires or edges to build the face on.
3129         #  @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3130         #                        If the tolerance of the obtained planar face is less
3131         #                        than 1e-06, this face will be returned, otherwise the
3132         #                        algorithm tries to build any suitable face on the given
3133         #                        wire and prints a warning message.
3134         #  @return New GEOM.GEOM_Object, containing the created face.
3135         #
3136         #  @ref tui_creation_face "Example"
3137         def MakeFaceWires(self, theWires, isPlanarWanted):
3138             """
3139             Create a face on the given wires set.
3140
3141             Parameters:
3142                 theWires List of closed wires or edges to build the face on.
3143                 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3144                                If the tolerance of the obtained planar face is less
3145                                than 1e-06, this face will be returned, otherwise the
3146                                algorithm tries to build any suitable face on the given
3147                                wire and prints a warning message.
3148
3149             Returns: 
3150                 New GEOM.GEOM_Object, containing the created face.
3151             """
3152             # Example: see GEOM_TestAll.py
3153             anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
3154             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
3155                 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
3156             else:
3157                 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
3158             return anObj
3159
3160         ## See MakeFaceWires() method for details.
3161         #
3162         #  @ref tui_creation_face "Example 1"
3163         #  \n @ref swig_MakeFaces  "Example 2"
3164         def MakeFaces(self, theWires, isPlanarWanted):
3165             """
3166             See geompy.MakeFaceWires() method for details.
3167             """
3168             # Example: see GEOM_TestOthers.py
3169             anObj = self.MakeFaceWires(theWires, isPlanarWanted)
3170             return anObj
3171
3172         ## Create a shell from the set of faces and shells.
3173         #  @param theFacesAndShells List of faces and/or shells.
3174         #  @return New GEOM.GEOM_Object, containing the created shell.
3175         #
3176         #  @ref tui_creation_shell "Example"
3177         def MakeShell(self,theFacesAndShells):
3178             """
3179             Create a shell from the set of faces and shells.
3180
3181             Parameters:
3182                 theFacesAndShells List of faces and/or shells.
3183
3184             Returns:
3185                 New GEOM.GEOM_Object, containing the created shell.
3186             """
3187             # Example: see GEOM_TestAll.py
3188             anObj = self.ShapesOp.MakeShell(theFacesAndShells)
3189             RaiseIfFailed("MakeShell", self.ShapesOp)
3190             return anObj
3191
3192         ## Create a solid, bounded by the given shells.
3193         #  @param theShells Sequence of bounding shells.
3194         #  @return New GEOM.GEOM_Object, containing the created solid.
3195         #
3196         #  @ref tui_creation_solid "Example"
3197         def MakeSolid(self, theShells):
3198             """
3199             Create a solid, bounded by the given shells.
3200
3201             Parameters:
3202                 theShells Sequence of bounding shells.
3203
3204             Returns:
3205                 New GEOM.GEOM_Object, containing the created solid.
3206             """
3207             # Example: see GEOM_TestAll.py
3208             if len(theShells) == 1:
3209                 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
3210                 #if len(descr) > 0:
3211                 #    raise RuntimeError, "MakeSolidShells : " + descr
3212                 if descr == "WRN_SHAPE_UNCLOSED":
3213                     raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
3214             anObj = self.ShapesOp.MakeSolidShells(theShells)
3215             RaiseIfFailed("MakeSolidShells", self.ShapesOp)
3216             return anObj
3217
3218         ## Create a compound of the given shapes.
3219         #  @param theShapes List of shapes to put in compound.
3220         #  @return New GEOM.GEOM_Object, containing the created compound.
3221         #
3222         #  @ref tui_creation_compound "Example"
3223         def MakeCompound(self,theShapes):
3224             """
3225             Create a compound of the given shapes.
3226
3227             Parameters:
3228                 theShapes List of shapes to put in compound.
3229
3230             Returns:
3231                 New GEOM.GEOM_Object, containing the created compound.
3232             """
3233             # Example: see GEOM_TestAll.py
3234             anObj = self.ShapesOp.MakeCompound(theShapes)
3235             RaiseIfFailed("MakeCompound", self.ShapesOp)
3236             return anObj
3237
3238         # end of l3_advanced
3239         ## @}
3240
3241         ## @addtogroup l2_measure
3242         ## @{
3243
3244         ## Gives quantity of faces in the given shape.
3245         #  @param theShape Shape to count faces of.
3246         #  @return Quantity of faces.
3247         #
3248         #  @ref swig_NumberOf "Example"
3249         def NumberOfFaces(self, theShape):
3250             """
3251             Gives quantity of faces in the given shape.
3252
3253             Parameters:
3254                 theShape Shape to count faces of.
3255
3256             Returns:    
3257                 Quantity of faces.
3258             """
3259             # Example: see GEOM_TestOthers.py
3260             nb_faces = self.ShapesOp.NumberOfFaces(theShape)
3261             RaiseIfFailed("NumberOfFaces", self.ShapesOp)
3262             return nb_faces
3263
3264         ## Gives quantity of edges in the given shape.
3265         #  @param theShape Shape to count edges of.
3266         #  @return Quantity of edges.
3267         #
3268         #  @ref swig_NumberOf "Example"
3269         def NumberOfEdges(self, theShape):
3270             """
3271             Gives quantity of edges in the given shape.
3272
3273             Parameters:
3274                 theShape Shape to count edges of.
3275
3276             Returns:    
3277                 Quantity of edges.
3278             """
3279             # Example: see GEOM_TestOthers.py
3280             nb_edges = self.ShapesOp.NumberOfEdges(theShape)
3281             RaiseIfFailed("NumberOfEdges", self.ShapesOp)
3282             return nb_edges
3283
3284         ## Gives quantity of sub-shapes of type theShapeType in the given shape.
3285         #  @param theShape Shape to count sub-shapes of.
3286         #  @param theShapeType Type of sub-shapes to count (see ShapeType())
3287         #  @return Quantity of sub-shapes of given type.
3288         #
3289         #  @ref swig_NumberOf "Example"
3290         def NumberOfSubShapes(self, theShape, theShapeType):
3291             """
3292             Gives quantity of sub-shapes of type theShapeType in the given shape.
3293
3294             Parameters:
3295                 theShape Shape to count sub-shapes of.
3296                 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
3297
3298             Returns:
3299                 Quantity of sub-shapes of given type.
3300             """
3301             # Example: see GEOM_TestOthers.py
3302             nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
3303             RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
3304             return nb_ss
3305
3306         ## Gives quantity of solids in the given shape.
3307         #  @param theShape Shape to count solids in.
3308         #  @return Quantity of solids.
3309         #
3310         #  @ref swig_NumberOf "Example"
3311         def NumberOfSolids(self, theShape):
3312             """
3313             Gives quantity of solids in the given shape.
3314
3315             Parameters:
3316                 theShape Shape to count solids in.
3317
3318             Returns:
3319                 Quantity of solids.
3320             """
3321             # Example: see GEOM_TestOthers.py
3322             nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
3323             RaiseIfFailed("NumberOfSolids", self.ShapesOp)
3324             return nb_solids
3325
3326         # end of l2_measure
3327         ## @}
3328
3329         ## @addtogroup l3_healing
3330         ## @{
3331
3332         ## Reverses an orientation the given shape.
3333         #  @param theShape Shape to be reversed.
3334         #  @return The reversed copy of theShape.
3335         #
3336         #  @ref swig_ChangeOrientation "Example"
3337         def ChangeOrientation(self,theShape):
3338             """
3339             Reverses an orientation the given shape.
3340
3341             Parameters:
3342                 theShape Shape to be reversed.
3343
3344             Returns:   
3345                 The reversed copy of theShape.
3346             """
3347             # Example: see GEOM_TestAll.py
3348             anObj = self.ShapesOp.ChangeOrientation(theShape)
3349             RaiseIfFailed("ChangeOrientation", self.ShapesOp)
3350             return anObj
3351
3352         ## See ChangeOrientation() method for details.
3353         #
3354         #  @ref swig_OrientationChange "Example"
3355         def OrientationChange(self,theShape):
3356             """
3357             See geompy.ChangeOrientation method for details.
3358             """
3359             # Example: see GEOM_TestOthers.py
3360             anObj = self.ChangeOrientation(theShape)
3361             return anObj
3362
3363         # end of l3_healing
3364         ## @}
3365
3366         ## @addtogroup l4_obtain
3367         ## @{
3368
3369         ## Retrieve all free faces from the given shape.
3370         #  Free face is a face, which is not shared between two shells of the shape.
3371         #  @param theShape Shape to find free faces in.
3372         #  @return List of IDs of all free faces, contained in theShape.
3373         #
3374         #  @ref tui_measurement_tools_page "Example"
3375         def GetFreeFacesIDs(self,theShape):
3376             """
3377             Retrieve all free faces from the given shape.
3378             Free face is a face, which is not shared between two shells of the shape.
3379
3380             Parameters:
3381                 theShape Shape to find free faces in.
3382
3383             Returns:
3384                 List of IDs of all free faces, contained in theShape.
3385             """
3386             # Example: see GEOM_TestOthers.py
3387             anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
3388             RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
3389             return anIDs
3390
3391         ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3392         #  @param theShape1 Shape to find sub-shapes in.
3393         #  @param theShape2 Shape to find shared sub-shapes with.
3394         #  @param theShapeType Type of sub-shapes to be retrieved.
3395         #  @return List of sub-shapes of theShape1, shared with theShape2.
3396         #
3397         #  @ref swig_GetSharedShapes "Example"
3398         def GetSharedShapes(self,theShape1, theShape2, theShapeType):
3399             """
3400             Get all sub-shapes of theShape1 of the given type, shared with theShape2.
3401
3402             Parameters:
3403                 theShape1 Shape to find sub-shapes in.
3404                 theShape2 Shape to find shared sub-shapes with.
3405                 theShapeType Type of sub-shapes to be retrieved.
3406
3407             Returns:
3408                 List of sub-shapes of theShape1, shared with theShape2.
3409             """
3410             # Example: see GEOM_TestOthers.py
3411             aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
3412             RaiseIfFailed("GetSharedShapes", self.ShapesOp)
3413             return aList
3414
3415         ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
3416         #  @param theShapes Shapes to find common sub-shapes of.
3417         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3418         #  @return List of objects, that are sub-shapes of all given shapes.
3419         #
3420         #  @ref swig_GetSharedShapes "Example"
3421         def GetSharedShapesMulti(self, theShapes, theShapeType):
3422             """
3423             Get all sub-shapes, shared by all shapes in the list theShapes.
3424
3425             Parameters:
3426                 theShapes Shapes to find common sub-shapes of.
3427                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3428
3429             Returns:    
3430                 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
3431             """
3432             # Example: see GEOM_TestOthers.py
3433             aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
3434             RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
3435             return aList
3436
3437         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3438         #  situated relatively the specified plane by the certain way,
3439         #  defined through <VAR>theState</VAR> parameter.
3440         #  @param theShape Shape to find sub-shapes of.
3441         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3442         #  @param theAx1 Vector (or line, or linear edge), specifying normal
3443         #                direction and location of the plane to find shapes on.
3444         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3445         #  @return List of all found sub-shapes.
3446         #
3447         #  @ref swig_GetShapesOnPlane "Example"
3448         def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
3449             """
3450             Find in theShape all sub-shapes of type theShapeType,
3451             situated relatively the specified plane by the certain way,
3452             defined through theState parameter.
3453
3454             Parameters:
3455                 theShape Shape to find sub-shapes of.
3456                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3457                 theAx1 Vector (or line, or linear edge), specifying normal
3458                        direction and location of the plane to find shapes on.
3459                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3460
3461             Returns:
3462                 List of all found sub-shapes.
3463             """
3464             # Example: see GEOM_TestOthers.py
3465             aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
3466             RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
3467             return aList
3468
3469         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3470         #  situated relatively the specified plane by the certain way,
3471         #  defined through <VAR>theState</VAR> parameter.
3472         #  @param theShape Shape to find sub-shapes of.
3473         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3474         #  @param theAx1 Vector (or line, or linear edge), specifying normal
3475         #                direction and location of the plane to find shapes on.
3476         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3477         #  @return List of all found sub-shapes indices.
3478         #
3479         #  @ref swig_GetShapesOnPlaneIDs "Example"
3480         def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
3481             """
3482             Find in theShape all sub-shapes of type theShapeType,
3483             situated relatively the specified plane by the certain way,
3484             defined through theState parameter.
3485
3486             Parameters:
3487                 theShape Shape to find sub-shapes of.
3488                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3489                 theAx1 Vector (or line, or linear edge), specifying normal
3490                        direction and location of the plane to find shapes on.
3491                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3492
3493             Returns:
3494                 List of all found sub-shapes indices.
3495             """
3496             # Example: see GEOM_TestOthers.py
3497             aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
3498             RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
3499             return aList
3500
3501         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3502         #  situated relatively the specified plane by the certain way,
3503         #  defined through <VAR>theState</VAR> parameter.
3504         #  @param theShape Shape to find sub-shapes of.
3505         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3506         #  @param theAx1 Vector (or line, or linear edge), specifying normal
3507         #                direction of the plane to find shapes on.
3508         #  @param thePnt Point specifying location of the plane to find shapes on.
3509         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3510         #  @return List of all found sub-shapes.
3511         #
3512         #  @ref swig_GetShapesOnPlaneWithLocation "Example"
3513         def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
3514             """
3515             Find in theShape all sub-shapes of type theShapeType,
3516             situated relatively the specified plane by the certain way,
3517             defined through theState parameter.
3518
3519             Parameters:
3520                 theShape Shape to find sub-shapes of.
3521                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3522                 theAx1 Vector (or line, or linear edge), specifying normal
3523                        direction and location of the plane to find shapes on.
3524                 thePnt Point specifying location of the plane to find shapes on.
3525                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3526
3527             Returns:
3528                 List of all found sub-shapes.
3529             """
3530             # Example: see GEOM_TestOthers.py
3531             aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
3532                                                                theAx1, thePnt, theState)
3533             RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
3534             return aList
3535
3536         ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
3537         #  situated relatively the specified plane by the certain way,
3538         #  defined through <VAR>theState</VAR> parameter.
3539         #  @param theShape Shape to find sub-shapes of.
3540         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3541         #  @param theAx1 Vector (or line, or linear edge), specifying normal
3542         #                direction of the plane to find shapes on.
3543         #  @param thePnt Point specifying location of the plane to find shapes on.
3544         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3545         #  @return List of all found sub-shapes indices.
3546         #
3547         #  @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
3548         def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
3549             """
3550             Find in theShape all sub-shapes of type theShapeType,
3551             situated relatively the specified plane by the certain way,
3552             defined through theState parameter.
3553
3554             Parameters:
3555                 theShape Shape to find sub-shapes of.
3556                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3557                 theAx1 Vector (or line, or linear edge), specifying normal
3558                        direction and location of the plane to find shapes on.
3559                 thePnt Point specifying location of the plane to find shapes on.
3560                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3561
3562             Returns:
3563                 List of all found sub-shapes indices.
3564             """
3565             # Example: see GEOM_TestOthers.py
3566             aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
3567                                                                   theAx1, thePnt, theState)
3568             RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
3569             return aList
3570
3571         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3572         #  the specified cylinder by the certain way, defined through \a theState parameter.
3573         #  @param theShape Shape to find sub-shapes of.
3574         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3575         #  @param theAxis Vector (or line, or linear edge), specifying
3576         #                 axis of the cylinder to find shapes on.
3577         #  @param theRadius Radius of the cylinder to find shapes on.
3578         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3579         #  @return List of all found sub-shapes.
3580         #
3581         #  @ref swig_GetShapesOnCylinder "Example"
3582         def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
3583             """
3584             Find in theShape all sub-shapes of type theShapeType, situated relatively
3585             the specified cylinder by the certain way, defined through theState parameter.
3586
3587             Parameters:
3588                 theShape Shape to find sub-shapes of.
3589                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3590                 theAxis Vector (or line, or linear edge), specifying
3591                         axis of the cylinder to find shapes on.
3592                 theRadius Radius of the cylinder to find shapes on.
3593                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3594
3595             Returns:
3596                 List of all found sub-shapes.
3597             """
3598             # Example: see GEOM_TestOthers.py
3599             aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
3600             RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
3601             return aList
3602
3603         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3604         #  the specified cylinder by the certain way, defined through \a theState parameter.
3605         #  @param theShape Shape to find sub-shapes of.
3606         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3607         #  @param theAxis Vector (or line, or linear edge), specifying
3608         #                 axis of the cylinder to find shapes on.
3609         #  @param theRadius Radius of the cylinder to find shapes on.
3610         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3611         #  @return List of all found sub-shapes indices.
3612         #
3613         #  @ref swig_GetShapesOnCylinderIDs "Example"
3614         def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
3615             """
3616             Find in theShape all sub-shapes of type theShapeType, situated relatively
3617             the specified cylinder by the certain way, defined through theState parameter.
3618
3619             Parameters:
3620                 theShape Shape to find sub-shapes of.
3621                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3622                 theAxis Vector (or line, or linear edge), specifying
3623                         axis of the cylinder to find shapes on.
3624                 theRadius Radius of the cylinder to find shapes on.
3625                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3626
3627             Returns:
3628                 List of all found sub-shapes indices.
3629             """
3630             # Example: see GEOM_TestOthers.py
3631             aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
3632             RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
3633             return aList
3634
3635         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3636         #  the specified cylinder by the certain way, defined through \a theState parameter.
3637         #  @param theShape Shape to find sub-shapes of.
3638         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3639         #  @param theAxis Vector (or line, or linear edge), specifying
3640         #                 axis of the cylinder to find shapes on.
3641         #  @param thePnt Point specifying location of the bottom of the cylinder.
3642         #  @param theRadius Radius of the cylinder to find shapes on.
3643         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3644         #  @return List of all found sub-shapes.
3645         #
3646         #  @ref swig_GetShapesOnCylinderWithLocation "Example"
3647         def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3648             """
3649             Find in theShape all sub-shapes of type theShapeType, situated relatively
3650             the specified cylinder by the certain way, defined through theState parameter.
3651
3652             Parameters:
3653                 theShape Shape to find sub-shapes of.
3654                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3655                 theAxis Vector (or line, or linear edge), specifying
3656                         axis of the cylinder to find shapes on.
3657                 theRadius Radius of the cylinder to find shapes on.
3658                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3659
3660             Returns:
3661                 List of all found sub-shapes.
3662             """
3663             # Example: see GEOM_TestOthers.py
3664             aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3665             RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
3666             return aList
3667
3668         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3669         #  the specified cylinder by the certain way, defined through \a theState parameter.
3670         #  @param theShape Shape to find sub-shapes of.
3671         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3672         #  @param theAxis Vector (or line, or linear edge), specifying
3673         #                 axis of the cylinder to find shapes on.
3674         #  @param thePnt Point specifying location of the bottom of the cylinder.
3675         #  @param theRadius Radius of the cylinder to find shapes on.
3676         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3677         #  @return List of all found sub-shapes indices
3678         #
3679         #  @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
3680         def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
3681             """
3682             Find in theShape all sub-shapes of type theShapeType, situated relatively
3683             the specified cylinder by the certain way, defined through theState parameter.
3684
3685             Parameters:
3686                 theShape Shape to find sub-shapes of.
3687                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3688                 theAxis Vector (or line, or linear edge), specifying
3689                         axis of the cylinder to find shapes on.
3690                 theRadius Radius of the cylinder to find shapes on.
3691                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3692
3693             Returns:
3694                 List of all found sub-shapes indices.            
3695             """
3696             # Example: see GEOM_TestOthers.py
3697             aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
3698             RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
3699             return aList
3700
3701         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3702         #  the specified sphere by the certain way, defined through \a theState parameter.
3703         #  @param theShape Shape to find sub-shapes of.
3704         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3705         #  @param theCenter Point, specifying center of the sphere to find shapes on.
3706         #  @param theRadius Radius of the sphere to find shapes on.
3707         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3708         #  @return List of all found sub-shapes.
3709         #
3710         #  @ref swig_GetShapesOnSphere "Example"
3711         def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
3712             """
3713             Find in theShape all sub-shapes of type theShapeType, situated relatively
3714             the specified sphere by the certain way, defined through theState parameter.
3715
3716             Parameters:
3717                 theShape Shape to find sub-shapes of.
3718                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3719                 theCenter Point, specifying center of the sphere to find shapes on.
3720                 theRadius Radius of the sphere to find shapes on.
3721                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3722
3723             Returns:
3724                 List of all found sub-shapes.
3725             """
3726             # Example: see GEOM_TestOthers.py
3727             aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
3728             RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
3729             return aList
3730
3731         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3732         #  the specified sphere by the certain way, defined through \a theState parameter.
3733         #  @param theShape Shape to find sub-shapes of.
3734         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3735         #  @param theCenter Point, specifying center of the sphere to find shapes on.
3736         #  @param theRadius Radius of the sphere to find shapes on.
3737         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3738         #  @return List of all found sub-shapes indices.
3739         #
3740         #  @ref swig_GetShapesOnSphereIDs "Example"
3741         def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
3742             """
3743             Find in theShape all sub-shapes of type theShapeType, situated relatively
3744             the specified sphere by the certain way, defined through theState parameter.
3745
3746             Parameters:
3747                 theShape Shape to find sub-shapes of.
3748                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3749                 theCenter Point, specifying center of the sphere to find shapes on.
3750                 theRadius Radius of the sphere to find shapes on.
3751                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3752
3753             Returns:
3754                 List of all found sub-shapes indices.
3755             """
3756             # Example: see GEOM_TestOthers.py
3757             aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
3758             RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
3759             return aList
3760
3761         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3762         #  the specified quadrangle by the certain way, defined through \a theState parameter.
3763         #  @param theShape Shape to find sub-shapes of.
3764         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3765         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3766         #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3767         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3768         #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3769         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3770         #  @return List of all found sub-shapes.
3771         #
3772         #  @ref swig_GetShapesOnQuadrangle "Example"
3773         def GetShapesOnQuadrangle(self, theShape, theShapeType,
3774                                   theTopLeftPoint, theTopRigthPoint,
3775                                   theBottomLeftPoint, theBottomRigthPoint, theState):
3776             """
3777             Find in theShape all sub-shapes of type theShapeType, situated relatively
3778             the specified quadrangle by the certain way, defined through theState parameter.
3779
3780             Parameters:
3781                 theShape Shape to find sub-shapes of.
3782                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3783                 theTopLeftPoint Point, specifying top left corner of a quadrangle
3784                 theTopRigthPoint Point, specifying top right corner of a quadrangle
3785                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3786                 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3787                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3788
3789             Returns:
3790                 List of all found sub-shapes.
3791             """
3792             # Example: see GEOM_TestOthers.py
3793             aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
3794                                                         theTopLeftPoint, theTopRigthPoint,
3795                                                         theBottomLeftPoint, theBottomRigthPoint, theState)
3796             RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
3797             return aList
3798
3799         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3800         #  the specified quadrangle by the certain way, defined through \a theState parameter.
3801         #  @param theShape Shape to find sub-shapes of.
3802         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3803         #  @param theTopLeftPoint Point, specifying top left corner of a quadrangle
3804         #  @param theTopRigthPoint Point, specifying top right corner of a quadrangle
3805         #  @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3806         #  @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3807         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3808         #  @return List of all found sub-shapes indices.
3809         #
3810         #  @ref swig_GetShapesOnQuadrangleIDs "Example"
3811         def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
3812                                      theTopLeftPoint, theTopRigthPoint,
3813                                      theBottomLeftPoint, theBottomRigthPoint, theState):
3814             """
3815             Find in theShape all sub-shapes of type theShapeType, situated relatively
3816             the specified quadrangle by the certain way, defined through theState parameter.
3817
3818             Parameters:
3819                 theShape Shape to find sub-shapes of.
3820                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3821                 theTopLeftPoint Point, specifying top left corner of a quadrangle
3822                 theTopRigthPoint Point, specifying top right corner of a quadrangle
3823                 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
3824                 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
3825                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3826
3827             Returns:
3828                 List of all found sub-shapes indices.
3829             """
3830
3831             # Example: see GEOM_TestOthers.py
3832             aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
3833                                                            theTopLeftPoint, theTopRigthPoint,
3834                                                            theBottomLeftPoint, theBottomRigthPoint, theState)
3835             RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
3836             return aList
3837
3838         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3839         #  the specified \a theBox by the certain way, defined through \a theState parameter.
3840         #  @param theBox Shape for relative comparing.
3841         #  @param theShape Shape to find sub-shapes of.
3842         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3843         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3844         #  @return List of all found sub-shapes.
3845         #
3846         #  @ref swig_GetShapesOnBox "Example"
3847         def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
3848             """
3849             Find in theShape all sub-shapes of type theShapeType, situated relatively
3850             the specified theBox by the certain way, defined through theState parameter.
3851
3852             Parameters:
3853                 theBox Shape for relative comparing.
3854                 theShape Shape to find sub-shapes of.
3855                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3856                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3857
3858             Returns:
3859                 List of all found sub-shapes.
3860             """
3861             # Example: see GEOM_TestOthers.py
3862             aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
3863             RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
3864             return aList
3865
3866         ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
3867         #  the specified \a theBox by the certain way, defined through \a theState parameter.
3868         #  @param theBox Shape for relative comparing.
3869         #  @param theShape Shape to find sub-shapes of.
3870         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3871         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3872         #  @return List of all found sub-shapes indices.
3873         #
3874         #  @ref swig_GetShapesOnBoxIDs "Example"
3875         def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
3876             """
3877             Find in theShape all sub-shapes of type theShapeType, situated relatively
3878             the specified theBox by the certain way, defined through theState parameter.
3879
3880             Parameters:
3881                 theBox Shape for relative comparing.
3882                 theShape Shape to find sub-shapes of.
3883                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3884                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3885
3886             Returns:
3887                 List of all found sub-shapes indices.
3888             """
3889             # Example: see GEOM_TestOthers.py
3890             aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
3891             RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
3892             return aList
3893
3894         ## Find in \a theShape all sub-shapes of type \a theShapeType,
3895         #  situated relatively the specified \a theCheckShape by the
3896         #  certain way, defined through \a theState parameter.
3897         #  @param theCheckShape Shape for relative comparing. It must be a solid.
3898         #  @param theShape Shape to find sub-shapes of.
3899         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()) 
3900         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3901         #  @return List of all found sub-shapes.
3902         #
3903         #  @ref swig_GetShapesOnShape "Example"
3904         def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
3905             """
3906             Find in theShape all sub-shapes of type theShapeType,
3907             situated relatively the specified theCheckShape by the
3908             certain way, defined through theState parameter.
3909
3910             Parameters:
3911                 theCheckShape Shape for relative comparing. It must be a solid.
3912                 theShape Shape to find sub-shapes of.
3913                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3914                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3915
3916             Returns:
3917                 List of all found sub-shapes.
3918             """
3919             # Example: see GEOM_TestOthers.py
3920             aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
3921                                                    theShapeType, theState)
3922             RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
3923             return aList
3924
3925         ## Find in \a theShape all sub-shapes of type \a theShapeType,
3926         #  situated relatively the specified \a theCheckShape by the
3927         #  certain way, defined through \a theState parameter.
3928         #  @param theCheckShape Shape for relative comparing. It must be a solid.
3929         #  @param theShape Shape to find sub-shapes of.
3930         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3931         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3932         #  @return All found sub-shapes as compound.
3933         #
3934         #  @ref swig_GetShapesOnShapeAsCompound "Example"
3935         def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
3936             """
3937             Find in theShape all sub-shapes of type theShapeType,
3938             situated relatively the specified theCheckShape by the
3939             certain way, defined through theState parameter.
3940
3941             Parameters:
3942                 theCheckShape Shape for relative comparing. It must be a solid.
3943                 theShape Shape to find sub-shapes of.
3944                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3945                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3946
3947             Returns:
3948                 All found sub-shapes as compound.
3949             """
3950             # Example: see GEOM_TestOthers.py
3951             anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
3952                                                              theShapeType, theState)
3953             RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
3954             return anObj
3955
3956         ## Find in \a theShape all sub-shapes of type \a theShapeType,
3957         #  situated relatively the specified \a theCheckShape by the
3958         #  certain way, defined through \a theState parameter.
3959         #  @param theCheckShape Shape for relative comparing. It must be a solid.
3960         #  @param theShape Shape to find sub-shapes of.
3961         #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
3962         #  @param theState The state of the sub-shapes to find (see GEOM::shape_state)
3963         #  @return List of all found sub-shapes indices.
3964         #
3965         #  @ref swig_GetShapesOnShapeIDs "Example"
3966         def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
3967             """
3968             Find in theShape all sub-shapes of type theShapeType,
3969             situated relatively the specified theCheckShape by the
3970             certain way, defined through theState parameter.
3971
3972             Parameters:
3973                 theCheckShape Shape for relative comparing. It must be a solid.
3974                 theShape Shape to find sub-shapes of.
3975                 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
3976                 theState The state of the sub-shapes to find (see GEOM::shape_state)
3977
3978             Returns:
3979                 List of all found sub-shapes indices.
3980             """
3981             # Example: see GEOM_TestOthers.py
3982             aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
3983                                                       theShapeType, theState)
3984             RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
3985             return aList
3986
3987         ## Get sub-shape(s) of theShapeWhere, which are
3988         #  coincident with \a theShapeWhat or could be a part of it.
3989         #  @param theShapeWhere Shape to find sub-shapes of.
3990         #  @param theShapeWhat Shape, specifying what to find.
3991         #  @param isNewImplementation implementation of GetInPlace functionality
3992         #             (default = False, old alghorithm based on shape properties)
3993         #  @return Group of all found sub-shapes or a single found sub-shape.
3994         #
3995         #  @note This function has a restriction on argument shapes.
3996         #        If \a theShapeWhere has curved parts with significantly
3997         #        outstanding centres (i.e. the mass centre of a part is closer to
3998         #        \a theShapeWhat than to the part), such parts will not be found.
3999         #        @image html get_in_place_lost_part.png
4000         #
4001         #  @ref swig_GetInPlace "Example"
4002         def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False):
4003             """
4004             Get sub-shape(s) of theShapeWhere, which are
4005             coincident with  theShapeWhat or could be a part of it.
4006
4007             Parameters:
4008                 theShapeWhere Shape to find sub-shapes of.
4009                 theShapeWhat Shape, specifying what to find.
4010                 isNewImplementation Implementation of GetInPlace functionality
4011                                     (default = False, old alghorithm based on shape properties)
4012
4013             Returns:
4014                 Group of all found sub-shapes or a single found sub-shape.
4015
4016                 
4017             Note:
4018                 This function has a restriction on argument shapes.
4019                 If theShapeWhere has curved parts with significantly
4020                 outstanding centres (i.e. the mass centre of a part is closer to
4021                 theShapeWhat than to the part), such parts will not be found.
4022             """
4023             # Example: see GEOM_TestOthers.py
4024             anObj = None
4025             if isNewImplementation:
4026                 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
4027             else:
4028                 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
4029                 pass
4030             RaiseIfFailed("GetInPlace", self.ShapesOp)
4031             return anObj
4032
4033         ## Get sub-shape(s) of \a theShapeWhere, which are
4034         #  coincident with \a theShapeWhat or could be a part of it.
4035         #
4036         #  Implementation of this method is based on a saved history of an operation,
4037         #  produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
4038         #  arguments (an argument shape or a sub-shape of an argument shape).
4039         #  The operation could be the Partition or one of boolean operations,
4040         #  performed on simple shapes (not on compounds).
4041         #
4042         #  @param theShapeWhere Shape to find sub-shapes of.
4043         #  @param theShapeWhat Shape, specifying what to find (must be in the
4044         #                      building history of the ShapeWhere).
4045         #  @return Group of all found sub-shapes or a single found sub-shape.
4046         #
4047         #  @ref swig_GetInPlace "Example"
4048         def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
4049             """
4050             Implementation of this method is based on a saved history of an operation,
4051             produced theShapeWhere. The theShapeWhat must be among this operation's
4052             arguments (an argument shape or a sub-shape of an argument shape).
4053             The operation could be the Partition or one of boolean operations,
4054             performed on simple shapes (not on compounds).
4055
4056             Parameters:
4057                 theShapeWhere Shape to find sub-shapes of.
4058                 theShapeWhat Shape, specifying what to find (must be in the
4059                                 building history of the ShapeWhere).
4060
4061             Returns:
4062                 Group of all found sub-shapes or a single found sub-shape.
4063             """
4064             # Example: see GEOM_TestOthers.py
4065             anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
4066             RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
4067             return anObj
4068
4069         ## Get sub-shape of theShapeWhere, which is
4070         #  equal to \a theShapeWhat.
4071         #  @param theShapeWhere Shape to find sub-shape of.
4072         #  @param theShapeWhat Shape, specifying what to find.
4073         #  @return New GEOM.GEOM_Object for found sub-shape.
4074         #
4075         #  @ref swig_GetSame "Example"
4076         def GetSame(self,theShapeWhere, theShapeWhat):
4077             """
4078             Get sub-shape of theShapeWhere, which is
4079             equal to theShapeWhat.
4080
4081             Parameters:
4082                 theShapeWhere Shape to find sub-shape of.
4083                 theShapeWhat Shape, specifying what to find.
4084
4085             Returns:
4086                 New GEOM.GEOM_Object for found sub-shape.
4087             """
4088             anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
4089             RaiseIfFailed("GetSame", self.ShapesOp)
4090             return anObj
4091
4092
4093         ## Get sub-shape indices of theShapeWhere, which is
4094         #  equal to \a theShapeWhat.
4095         #  @param theShapeWhere Shape to find sub-shape of.
4096         #  @param theShapeWhat Shape, specifying what to find.
4097         #  @return List of all found sub-shapes indices. 
4098         #
4099         #  @ref swig_GetSame "Example"
4100         def GetSameIDs(self,theShapeWhere, theShapeWhat):
4101             """
4102             Get sub-shape indices of theShapeWhere, which is
4103             equal to theShapeWhat.
4104
4105             Parameters:
4106                 theShapeWhere Shape to find sub-shape of.
4107                 theShapeWhat Shape, specifying what to find.
4108
4109             Returns:
4110                 List of all found sub-shapes indices.
4111             """
4112             anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
4113             RaiseIfFailed("GetSameIDs", self.ShapesOp)
4114             return anObj
4115
4116
4117         # end of l4_obtain
4118         ## @}
4119
4120         ## @addtogroup l4_access
4121         ## @{
4122
4123         ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
4124         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4125         #  @param aShape Shape to get sub-shape of.
4126         #  @param ListOfID List of sub-shapes indices.
4127         #  @return Found sub-shape.
4128         #
4129         #  @ref swig_all_decompose "Example"
4130         def GetSubShape(self, aShape, ListOfID):
4131             """
4132             Obtain a composite sub-shape of aShape, composed from sub-shapes
4133             of aShape, selected by their unique IDs inside aShape
4134
4135             Parameters:
4136                aShape Shape to get sub-shape of.
4137                ListOfID List of sub-shapes indices.
4138
4139             Returns:
4140                 Found sub-shape.
4141             """
4142             # Example: see GEOM_TestAll.py
4143             anObj = self.AddSubShape(aShape,ListOfID)
4144             return anObj
4145
4146         ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
4147         #  of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
4148         #  @param aShape Shape to get sub-shape of.
4149         #  @param aSubShape Sub-shapes of aShape.
4150         #  @return ID of found sub-shape.
4151         #
4152         #  @ref swig_all_decompose "Example"
4153         def GetSubShapeID(self, aShape, aSubShape):
4154             """
4155             Obtain unique ID of sub-shape aSubShape inside aShape
4156             of aShape, selected by their unique IDs inside aShape
4157
4158             Parameters:
4159                aShape Shape to get sub-shape of.
4160                aSubShape Sub-shapes of aShape.
4161
4162             Returns:
4163                ID of found sub-shape.
4164             """
4165             # Example: see GEOM_TestAll.py
4166             anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
4167             RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
4168             return anID
4169
4170         # end of l4_access
4171         ## @}
4172
4173         ## @addtogroup l4_decompose
4174         ## @{
4175
4176         ## Get all sub-shapes and groups of \a theShape,
4177         #  that were created already by any other methods.
4178         #  @param theShape Any shape.
4179         #  @param theGroupsOnly If this parameter is TRUE, only groups will be
4180         #                       returned, else all found sub-shapes and groups.
4181         #  @return List of existing sub-objects of \a theShape.
4182         #
4183         #  @ref swig_all_decompose "Example"
4184         def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
4185             """
4186             Get all sub-shapes and groups of theShape,
4187             that were created already by any other methods.
4188
4189             Parameters:
4190                 theShape Any shape.
4191                 theGroupsOnly If this parameter is TRUE, only groups will be
4192                                  returned, else all found sub-shapes and groups.
4193
4194             Returns:
4195                 List of existing sub-objects of theShape.
4196             """
4197             # Example: see GEOM_TestAll.py
4198             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
4199             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4200             return ListObj
4201
4202         ## Get all groups of \a theShape,
4203         #  that were created already by any other methods.
4204         #  @param theShape Any shape.
4205         #  @return List of existing groups of \a theShape.
4206         #
4207         #  @ref swig_all_decompose "Example"
4208         def GetGroups(self, theShape):
4209             """
4210             Get all groups of theShape,
4211             that were created already by any other methods.
4212
4213             Parameters:
4214                 theShape Any shape.
4215
4216             Returns:
4217                 List of existing groups of theShape.
4218             """
4219             # Example: see GEOM_TestAll.py
4220             ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
4221             RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
4222             return ListObj
4223
4224         ## Explode a shape on sub-shapes of a given type.
4225         #  If the shape itself matches the type, it is also returned.
4226         #  @param aShape Shape to be exploded.
4227         #  @param aType Type of sub-shapes to be retrieved (see ShapeType()) 
4228         #  @return List of sub-shapes of type theShapeType, contained in theShape.
4229         #
4230         #  @ref swig_all_decompose "Example"
4231         def SubShapeAll(self, aShape, aType):
4232             """
4233             Explode a shape on sub-shapes of a given type.
4234             If the shape itself matches the type, it is also returned.
4235
4236             Parameters:
4237                 aShape Shape to be exploded.
4238                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4239
4240             Returns:
4241                 List of sub-shapes of type theShapeType, contained in theShape.
4242             """
4243             # Example: see GEOM_TestAll.py
4244             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
4245             RaiseIfFailed("SubShapeAll", self.ShapesOp)
4246             return ListObj
4247
4248         ## Explode a shape on sub-shapes of a given type.
4249         #  @param aShape Shape to be exploded.
4250         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
4251         #  @return List of IDs of sub-shapes.
4252         #
4253         #  @ref swig_all_decompose "Example"
4254         def SubShapeAllIDs(self, aShape, aType):
4255             """
4256             Explode a shape on sub-shapes of a given type.
4257
4258             Parameters:
4259                 aShape Shape to be exploded (see geompy.ShapeType)
4260                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4261
4262             Returns:
4263                 List of IDs of sub-shapes.
4264             """
4265             ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
4266             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4267             return ListObj
4268
4269         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4270         #  selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
4271         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4272         #  @param aShape Shape to get sub-shape of.
4273         #  @param ListOfInd List of sub-shapes indices.
4274         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
4275         #  @return A compound of sub-shapes of aShape.
4276         #
4277         #  @ref swig_all_decompose "Example"
4278         def SubShape(self, aShape, aType, ListOfInd):
4279             """
4280             Obtain a compound of sub-shapes of aShape,
4281             selected by they indices in list of all sub-shapes of type aType.
4282             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4283             
4284             Parameters:
4285                 aShape Shape to get sub-shape of.
4286                 ListOfID List of sub-shapes indices.
4287                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4288
4289             Returns:
4290                 A compound of sub-shapes of aShape.
4291             """
4292             # Example: see GEOM_TestAll.py
4293             ListOfIDs = []
4294             AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
4295             for ind in ListOfInd:
4296                 ListOfIDs.append(AllShapeIDsList[ind - 1])
4297             anObj = self.GetSubShape(aShape, ListOfIDs)
4298             return anObj
4299
4300         ## Explode a shape on sub-shapes of a given type.
4301         #  Sub-shapes will be sorted by coordinates of their gravity centers.
4302         #  If the shape itself matches the type, it is also returned.
4303         #  @param aShape Shape to be exploded.
4304         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
4305         #  @return List of sub-shapes of type theShapeType, contained in theShape.
4306         #
4307         #  @ref swig_SubShapeAllSorted "Example"
4308         def SubShapeAllSortedCentres(self, aShape, aType):
4309             """
4310             Explode a shape on sub-shapes of a given type.
4311             Sub-shapes will be sorted by coordinates of their gravity centers.
4312             If the shape itself matches the type, it is also returned.
4313
4314             Parameters: 
4315                 aShape Shape to be exploded.
4316                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4317
4318             Returns: 
4319                 List of sub-shapes of type theShapeType, contained in theShape.
4320             """
4321             # Example: see GEOM_TestAll.py
4322             ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
4323             RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
4324             return ListObj
4325
4326         ## Explode a shape on sub-shapes of a given type.
4327         #  Sub-shapes will be sorted by coordinates of their gravity centers.
4328         #  @param aShape Shape to be exploded.
4329         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
4330         #  @return List of IDs of sub-shapes.
4331         #
4332         #  @ref swig_all_decompose "Example"
4333         def SubShapeAllSortedCentresIDs(self, aShape, aType):
4334             """
4335             Explode a shape on sub-shapes of a given type.
4336             Sub-shapes will be sorted by coordinates of their gravity centers.
4337
4338             Parameters: 
4339                 aShape Shape to be exploded.
4340                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4341
4342             Returns: 
4343                 List of IDs of sub-shapes.
4344             """
4345             ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
4346             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4347             return ListIDs
4348
4349         ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
4350         #  selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
4351         #  Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4352         #  @param aShape Shape to get sub-shape of.
4353         #  @param ListOfInd List of sub-shapes indices.
4354         #  @param aType Type of sub-shapes to be retrieved (see ShapeType())
4355         #  @return A compound of sub-shapes of aShape.
4356         #
4357         #  @ref swig_all_decompose "Example"
4358         def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
4359             """
4360             Obtain a compound of sub-shapes of aShape,
4361             selected by they indices in sorted list of all sub-shapes of type aType.
4362             Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
4363
4364             Parameters:
4365                 aShape Shape to get sub-shape of.
4366                 ListOfID List of sub-shapes indices.
4367                 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4368
4369             Returns:
4370                 A compound of sub-shapes of aShape.
4371             """
4372             # Example: see GEOM_TestAll.py
4373             ListOfIDs = []
4374             AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
4375             for ind in ListOfInd:
4376                 ListOfIDs.append(AllShapeIDsList[ind - 1])
4377             anObj = self.GetSubShape(aShape, ListOfIDs)
4378             return anObj
4379
4380         ## Extract shapes (excluding the main shape) of given type.
4381         #  @param aShape The shape.
4382         #  @param aType  The shape type (see ShapeType())
4383         #  @param isSorted Boolean flag to switch sorting on/off.
4384         #  @return List of sub-shapes of type aType, contained in aShape.
4385         #
4386         #  @ref swig_FilletChamfer "Example"
4387         def ExtractShapes(self, aShape, aType, isSorted = False):
4388             """
4389             Extract shapes (excluding the main shape) of given type.
4390
4391             Parameters:
4392                 aShape The shape.
4393                 aType  The shape type (see geompy.ShapeType)
4394                 isSorted Boolean flag to switch sorting on/off.
4395
4396             Returns:     
4397                 List of sub-shapes of type aType, contained in aShape.
4398             """
4399             # Example: see GEOM_TestAll.py
4400             ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
4401             RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
4402             return ListObj
4403
4404         ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
4405         #  @param aShape Main shape.
4406         #  @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
4407         #  @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4408         #
4409         #  @ref swig_all_decompose "Example"
4410         def SubShapes(self, aShape, anIDs):
4411             """
4412             Get a set of sub-shapes defined by their unique IDs inside theMainShape
4413
4414             Parameters:
4415                 aShape Main shape.
4416                 anIDs List of unique IDs of sub-shapes inside theMainShape.
4417
4418             Returns:      
4419                 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
4420             """
4421             # Example: see GEOM_TestAll.py
4422             ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
4423             RaiseIfFailed("SubShapes", self.ShapesOp)
4424             return ListObj
4425
4426         # end of l4_decompose
4427         ## @}
4428
4429         ## @addtogroup l4_decompose_d
4430         ## @{
4431
4432         ## Deprecated method
4433         #  It works like SubShapeAllSortedCentres(), but wrongly
4434         #  defines centres of faces, shells and solids.
4435         def SubShapeAllSorted(self, aShape, aType):
4436             """
4437             Deprecated method
4438             It works like geompy.SubShapeAllSortedCentres, but wrongly
4439             defines centres of faces, shells and solids.
4440             """
4441             ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
4442             RaiseIfFailed("MakeExplode", self.ShapesOp)
4443             return ListObj
4444
4445         ## Deprecated method
4446         #  It works like SubShapeAllSortedCentresIDs(), but wrongly
4447         #  defines centres of faces, shells and solids.
4448         def SubShapeAllSortedIDs(self, aShape, aType):
4449             """
4450             Deprecated method
4451             It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
4452             defines centres of faces, shells and solids.
4453             """
4454             ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
4455             RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
4456             return ListIDs
4457
4458         ## Deprecated method
4459         #  It works like SubShapeSortedCentres(), but has a bug
4460         #  (wrongly defines centres of faces, shells and solids).
4461         def SubShapeSorted(self, aShape, aType, ListOfInd):
4462             """
4463             Deprecated method
4464             It works like geompy.SubShapeSortedCentres, but has a bug
4465             (wrongly defines centres of faces, shells and solids).
4466             """
4467             ListOfIDs = []
4468             AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
4469             for ind in ListOfInd:
4470                 ListOfIDs.append(AllShapeIDsList[ind - 1])
4471             anObj = self.GetSubShape(aShape, ListOfIDs)
4472             return anObj
4473
4474         # end of l4_decompose_d
4475         ## @}
4476
4477         ## @addtogroup l3_healing
4478         ## @{
4479
4480         ## Apply a sequence of Shape Healing operators to the given object.
4481         #  @param theShape Shape to be processed.
4482         #  @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4483         #  @param theParameters List of names of parameters
4484         #                    ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4485         #  @param theValues List of values of parameters, in the same order
4486         #                    as parameters are listed in <VAR>theParameters</VAR> list.
4487         #
4488         #
4489         #  <b> Operators and Parameters: </b> \n
4490         #
4491         #  * \b FixShape - corrects invalid shapes. \n
4492         #  - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
4493         #  - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
4494         #
4495         #  * \b FixFaceSize - removes small faces, such as spots and strips.\n
4496         #  - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
4497         #  - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
4498         #  - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
4499         #
4500         #  * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
4501         #    surfaces in segments using a certain angle. \n
4502         #  - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4503         #    if Angle=180, four if Angle=90, etc). \n
4504         #  - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
4505         #
4506         #  * \b SplitClosedFaces - splits closed faces in segments.
4507         #    The number of segments depends on the number of splitting points.\n
4508         #  - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
4509         #
4510         #  * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
4511         #  - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
4512         #  - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
4513         #  - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
4514         #   This and the previous parameters can take the following values:\n
4515         #   \b Parametric \b Continuity \n
4516         #   \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
4517         #   are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
4518         #   \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
4519         #    ruling out sharp edges).\n
4520         #   \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces 
4521         #       are of the same magnitude).\n
4522         #   \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
4523         #    or surfaces (d/du C(u)) are the same at junction. \n
4524         #   \b Geometric \b Continuity \n
4525         #   \b G1: first derivatives are proportional at junction.\n
4526         #   The curve tangents thus have the same direction, but not necessarily the same magnitude.
4527         #      i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
4528         #   \b G2: first and second derivatives are proportional at junction.
4529         #   As the names imply, geometric continuity requires the geometry to be continuous, while parametric
4530         #    continuity requires that the underlying parameterization was continuous as well.
4531         #   Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
4532         #
4533         #  * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
4534         #  - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
4535         #  - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
4536         #  - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
4537         #  - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
4538         #       with the specified parameters.\n
4539         #  - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
4540         #       with the specified parameters.\n
4541         #  - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
4542         #  - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
4543         #  - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
4544         #  - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
4545         #
4546         #  * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
4547         #  - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
4548         #  - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
4549         #  - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
4550         #  - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
4551         #
4552         #  * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
4553         #  - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
4554         #
4555         #
4556         #  @return New GEOM.GEOM_Object, containing processed shape.
4557         #
4558         #  \n @ref tui_shape_processing "Example"
4559         def ProcessShape(self, theShape, theOperators, theParameters, theValues):
4560             """
4561             Apply a sequence of Shape Healing operators to the given object.
4562
4563             Parameters:
4564                 theShape Shape to be processed.
4565                 theValues List of values of parameters, in the same order
4566                           as parameters are listed in theParameters list.
4567                 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
4568                 theParameters List of names of parameters
4569                               ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
4570                  Operators and Parameters:
4571
4572                  * FixShape - corrects invalid shapes.
4573                      * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
4574                      * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
4575                  * FixFaceSize - removes small faces, such as spots and strips.
4576                      * FixFaceSize.Tolerance - defines minimum possible face size.
4577                      * DropSmallEdges - removes edges, which merge with neighbouring edges.
4578                      * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
4579                  * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
4580                                 in segments using a certain angle.
4581                      * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
4582                                           if Angle=180, four if Angle=90, etc).
4583                      * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
4584                  * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
4585                                       splitting points.
4586                      * SplitClosedFaces.NbSplitPoints - the number of splitting points.
4587                  * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
4588                      * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
4589                      * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
4590                      * SplitContinuity.CurveContinuity - required continuity for curves.
4591                        This and the previous parameters can take the following values:
4592                        
4593                        Parametric Continuity:
4594                        C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
4595                                                    coincidental. The curves or surfaces may still meet at an angle,
4596                                                    giving rise to a sharp corner or edge).
4597                        C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
4598                                                    are parallel, ruling out sharp edges).
4599                        C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
4600                                                   or surfaces are of the same magnitude).
4601                        CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
4602                           curves or surfaces (d/du C(u)) are the same at junction.
4603                           
4604                        Geometric Continuity:
4605                        G1: first derivatives are proportional at junction.
4606                            The curve tangents thus have the same direction, but not necessarily the same magnitude.
4607                            i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
4608                        G2: first and second derivatives are proportional at junction. As the names imply,
4609                            geometric continuity requires the geometry to be continuous, while parametric continuity requires
4610                            that the underlying parameterization was continuous as well. Parametric continuity of order n implies
4611                            geometric continuity of order n, but not vice-versa.
4612                  * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
4613                      * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
4614                      * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
4615                      * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
4616                      * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
4617                                                         the specified parameters.
4618                      * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
4619                                                         the specified parameters.
4620                      * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
4621                      * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
4622                      * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
4623                      * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
4624                  * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
4625                      * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
4626                      * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
4627                      * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
4628                      * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
4629                  * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
4630                      * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
4631
4632             Returns:
4633                 New GEOM.GEOM_Object, containing processed shape.
4634
4635             Note: For more information look through SALOME Geometry User's Guide->
4636                   -> Introduction to Geometry-> Repairing Operations-> Shape Processing
4637             """
4638             # Example: see GEOM_TestHealing.py
4639             theValues,Parameters = ParseList(theValues)
4640             anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
4641             # To avoid script failure in case of good argument shape
4642             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
4643                 return theShape
4644             RaiseIfFailed("ProcessShape", self.HealOp)
4645             for string in (theOperators + theParameters):
4646                 Parameters = ":" + Parameters
4647                 pass
4648             anObj.SetParameters(Parameters)
4649             return anObj
4650
4651         ## Remove faces from the given object (shape).
4652         #  @param theObject Shape to be processed.
4653         #  @param theFaces Indices of faces to be removed, if EMPTY then the method
4654         #                  removes ALL faces of the given object.
4655         #  @return New GEOM.GEOM_Object, containing processed shape.
4656         #
4657         #  @ref tui_suppress_faces "Example"
4658         def SuppressFaces(self,theObject, theFaces):
4659             """
4660             Remove faces from the given object (shape).
4661
4662             Parameters:
4663                 theObject Shape to be processed.
4664                 theFaces Indices of faces to be removed, if EMPTY then the method
4665                          removes ALL faces of the given object.
4666
4667             Returns:
4668                 New GEOM.GEOM_Object, containing processed shape.
4669             """
4670             # Example: see GEOM_TestHealing.py
4671             anObj = self.HealOp.SuppressFaces(theObject, theFaces)
4672             RaiseIfFailed("SuppressFaces", self.HealOp)
4673             return anObj
4674
4675         ## Sewing of some shapes into single shape.
4676         #  @param ListShape Shapes to be processed.
4677         #  @param theTolerance Required tolerance value.
4678         #  @return New GEOM.GEOM_Object, containing processed shape.
4679         #
4680         #  @ref tui_sewing "Example"
4681         def MakeSewing(self, ListShape, theTolerance):
4682             """
4683             Sewing of some shapes into single shape.
4684
4685             Parameters:
4686                 ListShape Shapes to be processed.
4687                 theTolerance Required tolerance value.
4688
4689             Returns:
4690                 New GEOM.GEOM_Object, containing processed shape.
4691             """
4692             # Example: see GEOM_TestHealing.py
4693             comp = self.MakeCompound(ListShape)
4694             anObj = self.Sew(comp, theTolerance)
4695             return anObj
4696
4697         ## Sewing of the given object.
4698         #  @param theObject Shape to be processed.
4699         #  @param theTolerance Required tolerance value.
4700         #  @return New GEOM.GEOM_Object, containing processed shape.
4701         def Sew(self, theObject, theTolerance):
4702             """
4703             Sewing of the given object.
4704
4705             Parameters:
4706                 theObject Shape to be processed.
4707                 theTolerance Required tolerance value.
4708
4709             Returns:
4710                 New GEOM.GEOM_Object, containing processed shape.
4711             """
4712             # Example: see MakeSewing() above
4713             theTolerance,Parameters = ParseParameters(theTolerance)
4714             anObj = self.HealOp.Sew(theObject, theTolerance)
4715             RaiseIfFailed("Sew", self.HealOp)
4716             anObj.SetParameters(Parameters)
4717             return anObj
4718
4719         ## Remove internal wires and edges from the given object (face).
4720         #  @param theObject Shape to be processed.
4721         #  @param theWires Indices of wires to be removed, if EMPTY then the method
4722         #                  removes ALL internal wires of the given object.
4723         #  @return New GEOM.GEOM_Object, containing processed shape.
4724         #
4725         #  @ref tui_suppress_internal_wires "Example"
4726         def SuppressInternalWires(self,theObject, theWires):
4727             """
4728             Remove internal wires and edges from the given object (face).
4729
4730             Parameters:
4731                 theObject Shape to be processed.
4732                 theWires Indices of wires to be removed, if EMPTY then the method
4733                          removes ALL internal wires of the given object.
4734
4735             Returns:                
4736                 New GEOM.GEOM_Object, containing processed shape.
4737             """
4738             # Example: see GEOM_TestHealing.py
4739             anObj = self.HealOp.RemoveIntWires(theObject, theWires)
4740             RaiseIfFailed("RemoveIntWires", self.HealOp)
4741             return anObj
4742
4743         ## Remove internal closed contours (holes) from the given object.
4744         #  @param theObject Shape to be processed.
4745         #  @param theWires Indices of wires to be removed, if EMPTY then the method
4746         #                  removes ALL internal holes of the given object
4747         #  @return New GEOM.GEOM_Object, containing processed shape.
4748         #
4749         #  @ref tui_suppress_holes "Example"
4750         def SuppressHoles(self,theObject, theWires):
4751             """
4752             Remove internal closed contours (holes) from the given object.
4753
4754             Parameters:
4755                 theObject Shape to be processed.
4756                 theWires Indices of wires to be removed, if EMPTY then the method
4757                          removes ALL internal holes of the given object
4758
4759             Returns:    
4760                 New GEOM.GEOM_Object, containing processed shape.
4761             """
4762             # Example: see GEOM_TestHealing.py
4763             anObj = self.HealOp.FillHoles(theObject, theWires)
4764             RaiseIfFailed("FillHoles", self.HealOp)
4765             return anObj
4766
4767         ## Close an open wire.
4768         #  @param theObject Shape to be processed.
4769         #  @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
4770         #                  if [ ], then <VAR>theObject</VAR> itself is a wire.
4771         #  @param isCommonVertex If True  : closure by creation of a common vertex,
4772         #                        If False : closure by creation of an edge between ends.
4773         #  @return New GEOM.GEOM_Object, containing processed shape.
4774         #
4775         #  @ref tui_close_contour "Example"
4776         def CloseContour(self,theObject, theWires, isCommonVertex):
4777             """
4778             Close an open wire.
4779
4780             Parameters: 
4781                 theObject Shape to be processed.
4782                 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
4783                          if [ ], then theObject itself is a wire.
4784                 isCommonVertex If True  : closure by creation of a common vertex,
4785                                If False : closure by creation of an edge between ends.
4786
4787             Returns:                      
4788                 New GEOM.GEOM_Object, containing processed shape. 
4789             """
4790             # Example: see GEOM_TestHealing.py
4791             anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
4792             RaiseIfFailed("CloseContour", self.HealOp)
4793             return anObj
4794
4795         ## Addition of a point to a given edge object.
4796         #  @param theObject Shape to be processed.
4797         #  @param theEdgeIndex Index of edge to be divided within theObject's shape,
4798         #                      if -1, then theObject itself is the edge.
4799         #  @param theValue Value of parameter on edge or length parameter,
4800         #                  depending on \a isByParameter.
4801         #  @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
4802         #                       if FALSE : \a theValue is treated as a length parameter [0..1]
4803         #  @return New GEOM.GEOM_Object, containing processed shape.
4804         #
4805         #  @ref tui_add_point_on_edge "Example"
4806         def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
4807             """
4808             Addition of a point to a given edge object.
4809
4810             Parameters: 
4811                 theObject Shape to be processed.
4812                 theEdgeIndex Index of edge to be divided within theObject's shape,
4813                              if -1, then theObject itself is the edge.
4814                 theValue Value of parameter on edge or length parameter,
4815                          depending on isByParameter.
4816                 isByParameter If TRUE :  theValue is treated as a curve parameter [0..1],
4817                               if FALSE : theValue is treated as a length parameter [0..1]
4818
4819             Returns:  
4820                 New GEOM.GEOM_Object, containing processed shape.
4821             """
4822             # Example: see GEOM_TestHealing.py
4823             theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
4824             anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
4825             RaiseIfFailed("DivideEdge", self.HealOp)
4826             anObj.SetParameters(Parameters)
4827             return anObj
4828
4829         ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4830         #  @param theWire Wire to minimize the number of C1 continuous edges in.
4831         #  @param theVertices A list of vertices to suppress. If the list
4832         #                     is empty, all vertices in a wire will be assumed.
4833         #  @return New GEOM.GEOM_Object with modified wire.
4834         #
4835         #  @ref tui_fuse_collinear_edges "Example"
4836         def FuseCollinearEdgesWithinWire(self, theWire, theVertices = []):
4837             """
4838             Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
4839
4840             Parameters: 
4841                 theWire Wire to minimize the number of C1 continuous edges in.
4842                 theVertices A list of vertices to suppress. If the list
4843                             is empty, all vertices in a wire will be assumed.
4844
4845             Returns:  
4846                 New GEOM.GEOM_Object with modified wire.
4847             """
4848             anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
4849             RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
4850             return anObj
4851
4852         ## Change orientation of the given object. Updates given shape.
4853         #  @param theObject Shape to be processed.
4854         #  @return Updated <var>theObject</var>
4855         #
4856         #  @ref swig_todo "Example"
4857         def ChangeOrientationShell(self,theObject):
4858             """
4859             Change orientation of the given object. Updates given shape.
4860
4861             Parameters: 
4862                 theObject Shape to be processed.
4863
4864             Returns:  
4865                 Updated theObject
4866             """
4867             theObject = self.HealOp.ChangeOrientation(theObject)
4868             RaiseIfFailed("ChangeOrientation", self.HealOp)
4869             pass
4870
4871         ## Change orientation of the given object.
4872         #  @param theObject Shape to be processed.
4873         #  @return New GEOM.GEOM_Object, containing processed shape.
4874         #
4875         #  @ref swig_todo "Example"
4876         def ChangeOrientationShellCopy(self, theObject):
4877             """
4878             Change orientation of the given object.
4879
4880             Parameters:
4881                 theObject Shape to be processed.
4882
4883             Returns:   
4884                 New GEOM.GEOM_Object, containing processed shape.
4885             """
4886             anObj = self.HealOp.ChangeOrientationCopy(theObject)
4887             RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
4888             return anObj
4889
4890         ## Try to limit tolerance of the given object by value \a theTolerance.
4891         #  @param theObject Shape to be processed.
4892         #  @param theTolerance Required tolerance value.
4893         #  @return New GEOM.GEOM_Object, containing processed shape.
4894         #
4895         #  @ref tui_limit_tolerance "Example"
4896         def LimitTolerance(self, theObject, theTolerance = 1e-07):
4897             """
4898             Try to limit tolerance of the given object by value theTolerance.
4899
4900             Parameters:
4901                 theObject Shape to be processed.
4902                 theTolerance Required tolerance value.
4903
4904             Returns:   
4905                 New GEOM.GEOM_Object, containing processed shape.
4906             """
4907             anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
4908             RaiseIfFailed("LimitTolerance", self.HealOp)
4909             return anObj
4910
4911         ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4912         #  that constitute a free boundary of the given shape.
4913         #  @param theObject Shape to get free boundary of.
4914         #  @return [\a status, \a theClosedWires, \a theOpenWires]
4915         #  \n \a status: FALSE, if an error(s) occured during the method execution.
4916         #  \n \a theClosedWires: Closed wires on the free boundary of the given shape.
4917         #  \n \a theOpenWires: Open wires on the free boundary of the given shape.
4918         #
4919         #  @ref tui_measurement_tools_page "Example"
4920         def GetFreeBoundary(self, theObject):
4921             """
4922             Get a list of wires (wrapped in GEOM.GEOM_Object-s),
4923             that constitute a free boundary of the given shape.
4924
4925             Parameters:
4926                 theObject Shape to get free boundary of.
4927
4928             Returns: 
4929                 [status, theClosedWires, theOpenWires]
4930                  status: FALSE, if an error(s) occured during the method execution.
4931                  theClosedWires: Closed wires on the free boundary of the given shape.
4932                  theOpenWires: Open wires on the free boundary of the given shape.
4933             """
4934             # Example: see GEOM_TestHealing.py
4935             anObj = self.HealOp.GetFreeBoundary(theObject)
4936             RaiseIfFailed("GetFreeBoundary", self.HealOp)
4937             return anObj
4938
4939         ## Replace coincident faces in theShape by one face.
4940         #  @param theShape Initial shape.
4941         #  @param theTolerance Maximum distance between faces, which can be considered as coincident.
4942         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
4943         #                         otherwise all initial shapes.
4944         #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4945         #
4946         #  @ref tui_glue_faces "Example"
4947         def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
4948             """
4949             Replace coincident faces in theShape by one face.
4950
4951             Parameters:
4952                 theShape Initial shape.
4953                 theTolerance Maximum distance between faces, which can be considered as coincident.
4954                 doKeepNonSolids If FALSE, only solids will present in the result,
4955                                 otherwise all initial shapes.
4956
4957             Returns:
4958                 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
4959             """
4960             # Example: see GEOM_Spanner.py
4961             theTolerance,Parameters = ParseParameters(theTolerance)
4962             anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
4963             if anObj is None:
4964                 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
4965             anObj.SetParameters(Parameters)
4966             return anObj
4967
4968         ## Find coincident faces in theShape for possible gluing.
4969         #  @param theShape Initial shape.
4970         #  @param theTolerance Maximum distance between faces,
4971         #                      which can be considered as coincident.
4972         #  @return GEOM.ListOfGO
4973         #
4974         #  @ref tui_glue_faces "Example"
4975         def GetGlueFaces(self, theShape, theTolerance):
4976             """
4977             Find coincident faces in theShape for possible gluing.
4978
4979             Parameters:
4980                 theShape Initial shape.
4981                 theTolerance Maximum distance between faces,
4982                              which can be considered as coincident.
4983
4984             Returns:                    
4985                 GEOM.ListOfGO
4986             """
4987             anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
4988             RaiseIfFailed("GetGlueFaces", self.ShapesOp)
4989             return anObj
4990
4991         ## Replace coincident faces in theShape by one face
4992         #  in compliance with given list of faces
4993         #  @param theShape Initial shape.
4994         #  @param theTolerance Maximum distance between faces,
4995         #                      which can be considered as coincident.
4996         #  @param theFaces List of faces for gluing.
4997         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
4998         #                         otherwise all initial shapes.
4999         #  @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
5000         #                        will be glued, otherwise only the edges,
5001         #                        belonging to <VAR>theFaces</VAR>.
5002         #  @return New GEOM.GEOM_Object, containing a copy of theShape
5003         #          without some faces.
5004         #
5005         #  @ref tui_glue_faces "Example"
5006         def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
5007                                 doKeepNonSolids=True, doGlueAllEdges=True):
5008             """
5009             Replace coincident faces in theShape by one face
5010             in compliance with given list of faces
5011
5012             Parameters:
5013                 theShape Initial shape.
5014                 theTolerance Maximum distance between faces,
5015                              which can be considered as coincident.
5016                 theFaces List of faces for gluing.
5017                 doKeepNonSolids If FALSE, only solids will present in the result,
5018                                 otherwise all initial shapes.
5019                 doGlueAllEdges If TRUE, all coincident edges of theShape
5020                                will be glued, otherwise only the edges,
5021                                belonging to theFaces.
5022
5023             Returns:
5024                 New GEOM.GEOM_Object, containing a copy of theShape
5025                     without some faces.
5026             """
5027             anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
5028                                                       doKeepNonSolids, doGlueAllEdges)
5029             if anObj is None:
5030                 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
5031             return anObj
5032
5033         ## Replace coincident edges in theShape by one edge.
5034         #  @param theShape Initial shape.
5035         #  @param theTolerance Maximum distance between edges, which can be considered as coincident.
5036         #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
5037         #
5038         #  @ref tui_glue_edges "Example"
5039         def MakeGlueEdges(self, theShape, theTolerance):
5040             """
5041             Replace coincident edges in theShape by one edge.
5042
5043             Parameters:
5044                 theShape Initial shape.
5045                 theTolerance Maximum distance between edges, which can be considered as coincident.
5046
5047             Returns:    
5048                 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
5049             """
5050             theTolerance,Parameters = ParseParameters(theTolerance)
5051             anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
5052             if anObj is None:
5053                 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
5054             anObj.SetParameters(Parameters)
5055             return anObj
5056
5057         ## Find coincident edges in theShape for possible gluing.
5058         #  @param theShape Initial shape.
5059         #  @param theTolerance Maximum distance between edges,
5060         #                      which can be considered as coincident.
5061         #  @return GEOM.ListOfGO
5062         #
5063         #  @ref tui_glue_edges "Example"
5064         def GetGlueEdges(self, theShape, theTolerance):
5065             """
5066             Find coincident edges in theShape for possible gluing.
5067
5068             Parameters:
5069                 theShape Initial shape.
5070                 theTolerance Maximum distance between edges,
5071                              which can be considered as coincident.
5072
5073             Returns:                         
5074                 GEOM.ListOfGO
5075             """
5076             anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
5077             RaiseIfFailed("GetGlueEdges", self.ShapesOp)
5078             return anObj
5079
5080         ## Replace coincident edges in theShape by one edge
5081         #  in compliance with given list of edges.
5082         #  @param theShape Initial shape.
5083         #  @param theTolerance Maximum distance between edges,
5084         #                      which can be considered as coincident.
5085         #  @param theEdges List of edges for gluing.
5086         #  @return New GEOM.GEOM_Object, containing a copy of theShape
5087         #          without some edges.
5088         #
5089         #  @ref tui_glue_edges "Example"
5090         def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges):
5091             """
5092             Replace coincident edges in theShape by one edge
5093             in compliance with given list of edges.
5094
5095             Parameters:
5096                 theShape Initial shape.
5097                 theTolerance Maximum distance between edges,
5098                              which can be considered as coincident.
5099                 theEdges List of edges for gluing.
5100
5101             Returns:  
5102                 New GEOM.GEOM_Object, containing a copy of theShape
5103                 without some edges.
5104             """
5105             anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
5106             if anObj is None:
5107                 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
5108             return anObj
5109
5110         # end of l3_healing
5111         ## @}
5112
5113         ## @addtogroup l3_boolean Boolean Operations
5114         ## @{
5115
5116         # -----------------------------------------------------------------------------
5117         # Boolean (Common, Cut, Fuse, Section)
5118         # -----------------------------------------------------------------------------
5119
5120         ## Perform one of boolean operations on two given shapes.
5121         #  @param theShape1 First argument for boolean operation.
5122         #  @param theShape2 Second argument for boolean operation.
5123         #  @param theOperation Indicates the operation to be done:\n
5124         #                      1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5125         #  @return New GEOM.GEOM_Object, containing the result shape.
5126         #
5127         #  @ref tui_fuse "Example"
5128         def MakeBoolean(self,theShape1, theShape2, theOperation):
5129             """
5130             Perform one of boolean operations on two given shapes.
5131
5132             Parameters: 
5133                 theShape1 First argument for boolean operation.
5134                 theShape2 Second argument for boolean operation.
5135                 theOperation Indicates the operation to be done:
5136                              1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
5137
5138             Returns:   
5139                 New GEOM.GEOM_Object, containing the result shape.
5140             """
5141             # Example: see GEOM_TestAll.py
5142             anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
5143             RaiseIfFailed("MakeBoolean", self.BoolOp)
5144             return anObj
5145
5146         ## Perform Common boolean operation on two given shapes.
5147         #  @param theShape1 First argument for boolean operation.
5148         #  @param theShape2 Second argument for boolean operation.
5149         #  @return New GEOM.GEOM_Object, containing the result shape.
5150         #
5151         #  @ref tui_common "Example 1"
5152         #  \n @ref swig_MakeCommon "Example 2"
5153         def MakeCommon(self, theShape1, theShape2):
5154             """
5155             Perform Common boolean operation on two given shapes.
5156
5157             Parameters: 
5158                 theShape1 First argument for boolean operation.
5159                 theShape2 Second argument for boolean operation.
5160  
5161             Returns:   
5162                 New GEOM.GEOM_Object, containing the result shape.
5163             """
5164             # Example: see GEOM_TestOthers.py
5165             return self.MakeBoolean(theShape1, theShape2, 1)
5166
5167         ## Perform Cut boolean operation on two given shapes.
5168         #  @param theShape1 First argument for boolean operation.
5169         #  @param theShape2 Second argument for boolean operation.
5170         #  @return New GEOM.GEOM_Object, containing the result shape.
5171         #
5172         #  @ref tui_cut "Example 1"
5173         #  \n @ref swig_MakeCommon "Example 2"
5174         def MakeCut(self, theShape1, theShape2):
5175             """
5176             Perform Cut boolean operation on two given shapes.
5177
5178             Parameters: 
5179                 theShape1 First argument for boolean operation.
5180                 theShape2 Second argument for boolean operation.
5181  
5182             Returns:   
5183                 New GEOM.GEOM_Object, containing the result shape.
5184             
5185             """
5186             # Example: see GEOM_TestOthers.py
5187             return self.MakeBoolean(theShape1, theShape2, 2)
5188
5189         ## Perform Fuse boolean operation on two given shapes.
5190         #  @param theShape1 First argument for boolean operation.
5191         #  @param theShape2 Second argument for boolean operation.
5192         #  @return New GEOM.GEOM_Object, containing the result shape.
5193         #
5194         #  @ref tui_fuse "Example 1"
5195         #  \n @ref swig_MakeCommon "Example 2"
5196         def MakeFuse(self, theShape1, theShape2):
5197             """
5198             Perform Fuse boolean operation on two given shapes.
5199
5200             Parameters: 
5201                 theShape1 First argument for boolean operation.
5202                 theShape2 Second argument for boolean operation.
5203  
5204             Returns:   
5205                 New GEOM.GEOM_Object, containing the result shape.
5206             
5207             """
5208             # Example: see GEOM_TestOthers.py
5209             return self.MakeBoolean(theShape1, theShape2, 3)
5210
5211         ## Perform Section boolean operation on two given shapes.
5212         #  @param theShape1 First argument for boolean operation.
5213         #  @param theShape2 Second argument for boolean operation.
5214         #  @return New GEOM.GEOM_Object, containing the result shape.
5215         #
5216         #  @ref tui_section "Example 1"
5217         #  \n @ref swig_MakeCommon "Example 2"
5218         def MakeSection(self, theShape1, theShape2):
5219             """
5220             Perform Section boolean operation on two given shapes.
5221
5222             Parameters: 
5223                 theShape1 First argument for boolean operation.
5224                 theShape2 Second argument for boolean operation.
5225  
5226             Returns:   
5227                 New GEOM.GEOM_Object, containing the result shape.
5228             
5229             """
5230             # Example: see GEOM_TestOthers.py
5231             return self.MakeBoolean(theShape1, theShape2, 4)
5232
5233         # end of l3_boolean
5234         ## @}
5235
5236         ## @addtogroup l3_basic_op
5237         ## @{
5238
5239         ## Perform partition operation.
5240         #  @param ListShapes Shapes to be intersected.
5241         #  @param ListTools Shapes to intersect theShapes.
5242         #  @param Limit Type of resulting shapes (see ShapeType()).\n
5243         #         If this parameter is set to -1 ("Auto"), most appropriate shape limit
5244         #         type will be detected automatically.
5245         #  @param KeepNonlimitShapes if this parameter == 0, then only shapes of
5246         #                             target type (equal to Limit) are kept in the result,
5247         #                             else standalone shapes of lower dimension
5248         #                             are kept also (if they exist).
5249         #  @note Each compound from ListShapes and ListTools will be exploded
5250         #        in order to avoid possible intersection between shapes from this compound.
5251         #
5252         #  After implementation new version of PartitionAlgo (October 2006)
5253         #  other parameters are ignored by current functionality. They are kept
5254         #  in this function only for support old versions.
5255         #      @param ListKeepInside Shapes, outside which the results will be deleted.
5256         #         Each shape from theKeepInside must belong to theShapes also.
5257         #      @param ListRemoveInside Shapes, inside which the results will be deleted.
5258         #         Each shape from theRemoveInside must belong to theShapes also.
5259         #      @param RemoveWebs If TRUE, perform Glue 3D algorithm.
5260         #      @param ListMaterials Material indices for each shape. Make sence,
5261         #         only if theRemoveWebs is TRUE.
5262         #
5263         #  @return New GEOM.GEOM_Object, containing the result shapes.
5264         #
5265         #  @ref tui_partition "Example"
5266         def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5267                           Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5268                           KeepNonlimitShapes=0):
5269             """
5270             Perform partition operation.
5271
5272             Parameters: 
5273                 ListShapes Shapes to be intersected.
5274                 ListTools Shapes to intersect theShapes.
5275                 Limit Type of resulting shapes (see geompy.ShapeType)
5276                       If this parameter is set to -1 ("Auto"), most appropriate shape limit
5277                       type will be detected automatically.
5278                 KeepNonlimitShapes if this parameter == 0, then only shapes of
5279                                     target type (equal to Limit) are kept in the result,
5280                                     else standalone shapes of lower dimension
5281                                     are kept also (if they exist).
5282             Note:
5283                     Each compound from ListShapes and ListTools will be exploded
5284                     in order to avoid possible intersection between shapes from
5285                     this compound.
5286                     
5287             After implementation new version of PartitionAlgo (October 2006) other
5288             parameters are ignored by current functionality. They are kept in this
5289             function only for support old versions.
5290             
5291             Ignored parameters:
5292                 ListKeepInside Shapes, outside which the results will be deleted.
5293                                Each shape from theKeepInside must belong to theShapes also.
5294                 ListRemoveInside Shapes, inside which the results will be deleted.
5295                                  Each shape from theRemoveInside must belong to theShapes also.
5296                 RemoveWebs If TRUE, perform Glue 3D algorithm.
5297                 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
5298
5299             Returns:   
5300                 New GEOM.GEOM_Object, containing the result shapes.
5301             """
5302             # Example: see GEOM_TestAll.py
5303             if Limit == ShapeType["AUTO"]:
5304                 # automatic detection of the most appropriate shape limit type
5305                 lim = GEOM.SHAPE
5306                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5307                 Limit = EnumToLong(lim)
5308                 pass
5309             anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
5310                                               ListKeepInside, ListRemoveInside,
5311                                               Limit, RemoveWebs, ListMaterials,
5312                                               KeepNonlimitShapes);
5313             RaiseIfFailed("MakePartition", self.BoolOp)
5314             return anObj
5315
5316         ## Perform partition operation.
5317         #  This method may be useful if it is needed to make a partition for
5318         #  compound contains nonintersected shapes. Performance will be better
5319         #  since intersection between shapes from compound is not performed.
5320         #
5321         #  Description of all parameters as in previous method MakePartition()
5322         #
5323         #  @note Passed compounds (via ListShapes or via ListTools)
5324         #           have to consist of nonintersecting shapes.
5325         #
5326         #  @return New GEOM.GEOM_Object, containing the result shapes.
5327         #
5328         #  @ref swig_todo "Example"
5329         def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
5330                                                  ListKeepInside=[], ListRemoveInside=[],
5331                                                  Limit=ShapeType["AUTO"], RemoveWebs=0,
5332                                                  ListMaterials=[], KeepNonlimitShapes=0):
5333             """
5334             Perform partition operation.
5335             This method may be useful if it is needed to make a partition for
5336             compound contains nonintersected shapes. Performance will be better
5337             since intersection between shapes from compound is not performed.
5338
5339             Parameters: 
5340                 Description of all parameters as in method geompy.MakePartition
5341         
5342             NOTE:
5343                 Passed compounds (via ListShapes or via ListTools)
5344                 have to consist of nonintersecting shapes.
5345
5346             Returns:   
5347                 New GEOM.GEOM_Object, containing the result shapes.
5348             """
5349             if Limit == ShapeType["AUTO"]:
5350                 # automatic detection of the most appropriate shape limit type
5351                 lim = GEOM.SHAPE
5352                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
5353                 Limit = EnumToLong(lim)
5354                 pass
5355             anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
5356                                                                      ListKeepInside, ListRemoveInside,
5357                                                                      Limit, RemoveWebs, ListMaterials,
5358                                                                      KeepNonlimitShapes);
5359             RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
5360             return anObj
5361
5362         ## See method MakePartition() for more information.
5363         #
5364         #  @ref tui_partition "Example 1"
5365         #  \n @ref swig_Partition "Example 2"
5366         def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
5367                       Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
5368                       KeepNonlimitShapes=0):
5369             """
5370             See method geompy.MakePartition for more information.
5371             """
5372             # Example: see GEOM_TestOthers.py
5373             anObj = self.MakePartition(ListShapes, ListTools,
5374                                        ListKeepInside, ListRemoveInside,
5375                                        Limit, RemoveWebs, ListMaterials,
5376                                        KeepNonlimitShapes);
5377             return anObj
5378
5379         ## Perform partition of the Shape with the Plane
5380         #  @param theShape Shape to be intersected.
5381         #  @param thePlane Tool shape, to intersect theShape.
5382         #  @return New GEOM.GEOM_Object, containing the result shape.
5383         #
5384         #  @ref tui_partition "Example"
5385         def MakeHalfPartition(self,theShape, thePlane):
5386             """
5387             Perform partition of the Shape with the Plane
5388
5389             Parameters: 
5390                 theShape Shape to be intersected.
5391                 thePlane Tool shape, to intersect theShape.
5392
5393             Returns:  
5394                 New GEOM.GEOM_Object, containing the result shape.
5395             """
5396             # Example: see GEOM_TestAll.py
5397             anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
5398             RaiseIfFailed("MakeHalfPartition", self.BoolOp)
5399             return anObj
5400
5401         # end of l3_basic_op
5402         ## @}
5403
5404         ## @addtogroup l3_transform
5405         ## @{
5406
5407         ## Translate the given object along the vector, specified
5408         #  by its end points, creating its copy before the translation.
5409         #  @param theObject The object to be translated.
5410         #  @param thePoint1 Start point of translation vector.
5411         #  @param thePoint2 End point of translation vector.
5412         #  @return New GEOM.GEOM_Object, containing the translated object.
5413         #
5414         #  @ref tui_translation "Example 1"
5415         #  \n @ref swig_MakeTranslationTwoPoints "Example 2"
5416         def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
5417             """
5418             Translate the given object along the vector, specified
5419             by its end points, creating its copy before the translation.
5420
5421             Parameters: 
5422                 theObject The object to be translated.
5423                 thePoint1 Start point of translation vector.
5424                 thePoint2 End point of translation vector.
5425
5426             Returns:  
5427                 New GEOM.GEOM_Object, containing the translated object.
5428             """
5429             # Example: see GEOM_TestAll.py
5430             anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
5431             RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
5432             return anObj
5433
5434         ## Translate the given object along the vector, specified by its components.
5435         #  @param theObject The object to be translated.
5436         #  @param theDX,theDY,theDZ Components of translation vector.
5437         #  @return Translated GEOM.GEOM_Object.
5438         #
5439         #  @ref tui_translation "Example"
5440         def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
5441             """
5442             Translate the given object along the vector, specified by its components.
5443
5444             Parameters: 
5445                 theObject The object to be translated.
5446                 theDX,theDY,theDZ Components of translation vector.
5447
5448             Returns: 
5449                 Translated GEOM.GEOM_Object.
5450             """
5451             # Example: see GEOM_TestAll.py
5452             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5453             anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
5454             anObj.SetParameters(Parameters)
5455             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5456             return anObj
5457
5458         ## Translate the given object along the vector, specified
5459         #  by its components, creating its copy before the translation.
5460         #  @param theObject The object to be translated.
5461         #  @param theDX,theDY,theDZ Components of translation vector.
5462         #  @return New GEOM.GEOM_Object, containing the translated object.
5463         #
5464         #  @ref tui_translation "Example"
5465         def MakeTranslation(self,theObject, theDX, theDY, theDZ):
5466             """
5467             Translate the given object along the vector, specified
5468             by its components, creating its copy before the translation.
5469
5470             Parameters: 
5471                 theObject The object to be translated.
5472                 theDX,theDY,theDZ Components of translation vector.
5473
5474             Returns: 
5475                 New GEOM.GEOM_Object, containing the translated object.
5476             """
5477             # Example: see GEOM_TestAll.py
5478             theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
5479             anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
5480             anObj.SetParameters(Parameters)
5481             RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
5482             return anObj
5483
5484         ## Translate the given object along the given vector,
5485         #  creating its copy before the translation.
5486         #  @param theObject The object to be translated.
5487         #  @param theVector The translation vector.
5488         #  @return New GEOM.GEOM_Object, containing the translated object.
5489         #
5490         #  @ref tui_translation "Example"
5491         def MakeTranslationVector(self,theObject, theVector):
5492             """
5493             Translate the given object along the given vector,
5494             creating its copy before the translation.
5495
5496             Parameters: 
5497                 theObject The object to be translated.
5498                 theVector The translation vector.
5499
5500             Returns: 
5501                 New GEOM.GEOM_Object, containing the translated object.
5502             """
5503             # Example: see GEOM_TestAll.py
5504             anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
5505             RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
5506             return anObj
5507
5508         ## Translate the given object along the given vector on given distance.
5509         #  @param theObject The object to be translated.
5510         #  @param theVector The translation vector.
5511         #  @param theDistance The translation distance.
5512         #  @param theCopy Flag used to translate object itself or create a copy.
5513         #  @return New GEOM.GEOM_Object, containing the translated object.
5514         #
5515         #  @ref tui_translation "Example"
5516         def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
5517             """
5518             Translate the given object along the given vector on given distance.
5519
5520             Parameters: 
5521                 theObject The object to be translated.
5522                 theVector The translation vector.
5523                 theDistance The translation distance.
5524                 theCopy Flag used to translate object itself or create a copy.
5525
5526             Returns: 
5527                 New GEOM.GEOM_Object, containing the translated object.
5528             """
5529             # Example: see GEOM_TestAll.py
5530             theDistance,Parameters = ParseParameters(theDistance)
5531             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
5532             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5533             anObj.SetParameters(Parameters)
5534             return anObj
5535
5536         ## Translate the given object along the given vector on given distance,
5537         #  creating its copy before the translation.
5538         #  @param theObject The object to be translated.
5539         #  @param theVector The translation vector.
5540         #  @param theDistance The translation distance.
5541         #  @return New GEOM.GEOM_Object, containing the translated object.
5542         #
5543         #  @ref tui_translation "Example"
5544         def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
5545             """
5546             Translate the given object along the given vector on given distance,
5547             creating its copy before the translation.
5548
5549             Parameters:
5550                 theObject The object to be translated.
5551                 theVector The translation vector.
5552                 theDistance The translation distance.
5553
5554             Returns: 
5555                 New GEOM.GEOM_Object, containing the translated object.
5556             """
5557             # Example: see GEOM_TestAll.py
5558             theDistance,Parameters = ParseParameters(theDistance)
5559             anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
5560             RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
5561             anObj.SetParameters(Parameters)
5562             return anObj
5563
5564         ## Rotate the given object around the given axis on the given angle.
5565         #  @param theObject The object to be rotated.
5566         #  @param theAxis Rotation axis.
5567         #  @param theAngle Rotation angle in radians.
5568         #  @return New GEOM.GEOM_Object, containing the rotated object.
5569         #
5570         #  @ref tui_rotation "Example"
5571         def Rotate(self,theObject, theAxis, theAngle):
5572             """
5573             Rotate the given object around the given axis on the given angle.
5574
5575             Parameters:
5576                 theObject The object to be rotated.
5577                 theAxis Rotation axis.
5578                 theAngle Rotation angle in radians.
5579
5580             Returns: 
5581                 New GEOM.GEOM_Object, containing the rotated object.
5582             """
5583             # Example: see GEOM_TestAll.py
5584             flag = False
5585             if isinstance(theAngle,str):
5586                 flag = True
5587             theAngle, Parameters = ParseParameters(theAngle)
5588             if flag:
5589                 theAngle = theAngle*math.pi/180.0
5590             anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
5591             RaiseIfFailed("RotateCopy", self.TrsfOp)
5592             anObj.SetParameters(Parameters)
5593             return anObj
5594
5595         ## Rotate the given object around the given axis
5596         #  on the given angle, creating its copy before the rotatation.
5597         #  @param theObject The object to be rotated.
5598         #  @param theAxis Rotation axis.
5599         #  @param theAngle Rotation angle in radians.
5600         #  @return New GEOM.GEOM_Object, containing the rotated object.
5601         #
5602         #  @ref tui_rotation "Example"
5603         def MakeRotation(self,theObject, theAxis, theAngle):
5604             """
5605             Rotate the given object around the given axis
5606             on the given angle, creating its copy before the rotatation.
5607
5608             Parameters:
5609                 theObject The object to be rotated.
5610                 theAxis Rotation axis.
5611                 theAngle Rotation angle in radians.
5612
5613             Returns:
5614                 New GEOM.GEOM_Object, containing the rotated object.
5615             """
5616             # Example: see GEOM_TestAll.py
5617             flag = False
5618             if isinstance(theAngle,str):
5619                 flag = True
5620             theAngle, Parameters = ParseParameters(theAngle)
5621             if flag:
5622                 theAngle = theAngle*math.pi/180.0
5623             anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
5624             RaiseIfFailed("RotateCopy", self.TrsfOp)
5625             anObj.SetParameters(Parameters)
5626             return anObj
5627
5628         ## Rotate given object around vector perpendicular to plane
5629         #  containing three points, creating its copy before the rotatation.
5630         #  @param theObject The object to be rotated.
5631         #  @param theCentPoint central point the axis is the vector perpendicular to the plane
5632         #  containing the three points.
5633         #  @param thePoint1,thePoint2 in a perpendicular plane of the axis.
5634         #  @return New GEOM.GEOM_Object, containing the rotated object.
5635         #
5636         #  @ref tui_rotation "Example"
5637         def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
5638             """
5639             Rotate given object around vector perpendicular to plane
5640             containing three points, creating its copy before the rotatation.
5641
5642             Parameters:
5643                 theObject The object to be rotated.
5644                 theCentPoint central point  the axis is the vector perpendicular to the plane
5645                              containing the three points.
5646                 thePoint1,thePoint2  in a perpendicular plane of the axis.
5647
5648             Returns:
5649                 New GEOM.GEOM_Object, containing the rotated object.
5650             """
5651             # Example: see GEOM_TestAll.py
5652             anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
5653             RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
5654             return anObj
5655
5656         ## Scale the given object by the factor, creating its copy before the scaling.
5657         #  @param theObject The object to be scaled.
5658         #  @param thePoint Center point for scaling.
5659         #                  Passing None for it means scaling relatively the origin of global CS.
5660         #  @param theFactor Scaling factor value.
5661         #  @return New GEOM.GEOM_Object, containing the scaled shape.
5662         #
5663         #  @ref tui_scale "Example"
5664         def MakeScaleTransform(self, theObject, thePoint, theFactor):
5665             """
5666             Scale the given object by the factor, creating its copy before the scaling.
5667
5668             Parameters:
5669                 theObject The object to be scaled.
5670                 thePoint Center point for scaling.
5671                          Passing None for it means scaling relatively the origin of global CS.
5672                 theFactor Scaling factor value.
5673
5674             Returns:    
5675                 New GEOM.GEOM_Object, containing the scaled shape.
5676             """
5677             # Example: see GEOM_TestAll.py
5678             theFactor, Parameters = ParseParameters(theFactor)
5679             anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
5680             RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
5681             anObj.SetParameters(Parameters)
5682             return anObj
5683
5684         ## Scale the given object by different factors along coordinate axes,
5685         #  creating its copy before the scaling.
5686         #  @param theObject The object to be scaled.
5687         #  @param thePoint Center point for scaling.
5688         #                  Passing None for it means scaling relatively the origin of global CS.
5689         #  @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5690         #  @return New GEOM.GEOM_Object, containing the scaled shape.
5691         #
5692         #  @ref swig_scale "Example"
5693         def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
5694             """
5695             Scale the given object by different factors along coordinate axes,
5696             creating its copy before the scaling.
5697
5698             Parameters:
5699                 theObject The object to be scaled.
5700                 thePoint Center point for scaling.
5701                             Passing None for it means scaling relatively the origin of global CS.
5702                 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
5703
5704             Returns:
5705                 New GEOM.GEOM_Object, containing the scaled shape.
5706             """
5707             # Example: see GEOM_TestAll.py
5708             theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
5709             anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
5710                                                         theFactorX, theFactorY, theFactorZ)
5711             RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
5712             anObj.SetParameters(Parameters)
5713             return anObj
5714
5715         ## Create an object, symmetrical
5716         #  to the given one relatively the given plane.
5717         #  @param theObject The object to be mirrored.
5718         #  @param thePlane Plane of symmetry.
5719         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
5720         #
5721         #  @ref tui_mirror "Example"
5722         def MakeMirrorByPlane(self,theObject, thePlane):
5723             """
5724             Create an object, symmetrical to the given one relatively the given plane.
5725
5726             Parameters:
5727                 theObject The object to be mirrored.
5728                 thePlane Plane of symmetry.
5729
5730             Returns:
5731                 New GEOM.GEOM_Object, containing the mirrored shape.
5732             """
5733             # Example: see GEOM_TestAll.py
5734             anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
5735             RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
5736             return anObj
5737
5738         ## Create an object, symmetrical
5739         #  to the given one relatively the given axis.
5740         #  @param theObject The object to be mirrored.
5741         #  @param theAxis Axis of symmetry.
5742         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
5743         #
5744         #  @ref tui_mirror "Example"
5745         def MakeMirrorByAxis(self,theObject, theAxis):
5746             """
5747             Create an object, symmetrical to the given one relatively the given axis.
5748
5749             Parameters:
5750                 theObject The object to be mirrored.
5751                 theAxis Axis of symmetry.
5752
5753             Returns: 
5754                 New GEOM.GEOM_Object, containing the mirrored shape.
5755             """
5756             # Example: see GEOM_TestAll.py
5757             anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
5758             RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
5759             return anObj
5760
5761         ## Create an object, symmetrical
5762         #  to the given one relatively the given point.
5763         #  @param theObject The object to be mirrored.
5764         #  @param thePoint Point of symmetry.
5765         #  @return New GEOM.GEOM_Object, containing the mirrored shape.
5766         #
5767         #  @ref tui_mirror "Example"
5768         def MakeMirrorByPoint(self,theObject, thePoint):
5769             """
5770             Create an object, symmetrical
5771             to the given one relatively the given point.
5772
5773             Parameters:
5774                 theObject The object to be mirrored.
5775                 thePoint Point of symmetry.
5776
5777             Returns:  
5778                 New GEOM.GEOM_Object, containing the mirrored shape.
5779             """
5780             # Example: see GEOM_TestAll.py
5781             anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
5782             RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
5783             return anObj
5784
5785         ## Modify the Location of the given object by LCS,
5786         #  creating its copy before the setting.
5787         #  @param theObject The object to be displaced.
5788         #  @param theStartLCS Coordinate system to perform displacement from it.\n
5789         #                     If \a theStartLCS is NULL, displacement
5790         #                     will be performed from global CS.\n
5791         #                     If \a theObject itself is used as \a theStartLCS,
5792         #                     its location will be changed to \a theEndLCS.
5793         #  @param theEndLCS Coordinate system to perform displacement to it.
5794         #  @return New GEOM.GEOM_Object, containing the displaced shape.
5795         #
5796         #  @ref tui_modify_location "Example"
5797         def MakePosition(self,theObject, theStartLCS, theEndLCS):
5798             """
5799             Modify the Location of the given object by LCS, creating its copy before the setting.
5800
5801             Parameters:
5802                 theObject The object to be displaced.
5803                 theStartLCS Coordinate system to perform displacement from it.
5804                             If theStartLCS is NULL, displacement
5805                             will be performed from global CS.
5806                             If theObject itself is used as theStartLCS,
5807                             its location will be changed to theEndLCS.
5808                 theEndLCS Coordinate system to perform displacement to it.
5809
5810             Returns:  
5811                 New GEOM.GEOM_Object, containing the displaced shape.
5812
5813             Example of usage:
5814                 # create local coordinate systems
5815                 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
5816                 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
5817                 # modify the location of the given object
5818                 position = geompy.MakePosition(cylinder, cs1, cs2)
5819             """
5820             # Example: see GEOM_TestAll.py
5821             anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
5822             RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
5823             return anObj
5824
5825         ## Modify the Location of the given object by Path,
5826         #  @param  theObject The object to be displaced.
5827         #  @param  thePath Wire or Edge along that the object will be translated.
5828         #  @param  theDistance progress of Path (0 = start location, 1 = end of path location).
5829         #  @param  theCopy is to create a copy objects if true.
5830         #  @param  theReverse  0 - for usual direction, 1 - to reverse path direction.
5831         #  @return New GEOM.GEOM_Object, containing the displaced shape.
5832         #
5833         #  @ref tui_modify_location "Example"
5834         def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
5835             """
5836             Modify the Location of the given object by Path
5837
5838             Parameters:
5839                  theObject The object to be displaced.
5840                  thePath Wire or Edge along that the object will be translated.
5841                  theDistance progress of Path (0 = start location, 1 = end of path location).
5842                  theCopy is to create a copy objects if true.
5843                  theReverse  0 - for usual direction, 1 - to reverse path direction.
5844
5845             Returns:  
5846                 New GEOM.GEOM_Object, containing the displaced shape.
5847
5848             Example of usage:
5849                 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
5850             """
5851             # Example: see GEOM_TestAll.py
5852             anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
5853             RaiseIfFailed("PositionAlongPath", self.TrsfOp)
5854             return anObj
5855
5856         ## Create new object as offset of the given one.
5857         #  @param theObject The base object for the offset.
5858         #  @param theOffset Offset value.
5859         #  @return New GEOM.GEOM_Object, containing the offset object.
5860         #
5861         #  @ref tui_offset "Example"
5862         def MakeOffset(self,theObject, theOffset):
5863             """
5864             Create new object as offset of the given one.
5865
5866             Parameters:
5867                 theObject The base object for the offset.
5868                 theOffset Offset value.
5869
5870             Returns:  
5871                 New GEOM.GEOM_Object, containing the offset object.
5872
5873             Example of usage:
5874                  box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
5875                  # create a new object as offset of the given object
5876                  offset = geompy.MakeOffset(box, 70.)
5877             """
5878             # Example: see GEOM_TestAll.py
5879             theOffset, Parameters = ParseParameters(theOffset)
5880             anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
5881             RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
5882             anObj.SetParameters(Parameters)
5883             return anObj
5884
5885         ## Create new object as projection of the given one on a 2D surface.
5886         #  @param theSource The source object for the projection. It can be a point, edge or wire.
5887         #  @param theTarget The target object. It can be planar or cylindrical face.
5888         #  @return New GEOM.GEOM_Object, containing the projection.
5889         #
5890         #  @ref tui_projection "Example"
5891         def MakeProjection(self, theSource, theTarget):
5892             """
5893             Create new object as projection of the given one on a 2D surface.
5894
5895             Parameters:
5896                 theSource The source object for the projection. It can be a point, edge or wire.
5897                 theTarget The target object. It can be planar or cylindrical face.
5898
5899             Returns:  
5900                 New GEOM.GEOM_Object, containing the projection.
5901             """
5902             # Example: see GEOM_TestAll.py
5903             anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
5904             RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
5905             return anObj
5906
5907         # -----------------------------------------------------------------------------
5908         # Patterns
5909         # -----------------------------------------------------------------------------
5910
5911         ## Translate the given object along the given vector a given number times
5912         #  @param theObject The object to be translated.
5913         #  @param theVector Direction of the translation.
5914         #  @param theStep Distance to translate on.
5915         #  @param theNbTimes Quantity of translations to be done.
5916         #  @return New GEOM.GEOM_Object, containing compound of all
5917         #          the shapes, obtained after each translation.
5918         #
5919         #  @ref tui_multi_translation "Example"
5920         def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
5921             """
5922             Translate the given object along the given vector a given number times
5923
5924             Parameters:
5925                 theObject The object to be translated.
5926                 theVector Direction of the translation.
5927                 theStep Distance to translate on.
5928                 theNbTimes Quantity of translations to be done.
5929
5930             Returns:     
5931                 New GEOM.GEOM_Object, containing compound of all
5932                 the shapes, obtained after each translation.
5933
5934             Example of usage:
5935                 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
5936             """
5937             # Example: see GEOM_TestAll.py
5938             theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
5939             anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
5940             RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
5941             anObj.SetParameters(Parameters)
5942             return anObj
5943
5944         ## Conseqently apply two specified translations to theObject specified number of times.
5945         #  @param theObject The object to be translated.
5946         #  @param theVector1 Direction of the first translation.
5947         #  @param theStep1 Step of the first translation.
5948         #  @param theNbTimes1 Quantity of translations to be done along theVector1.
5949         #  @param theVector2 Direction of the second translation.
5950         #  @param theStep2 Step of the second translation.
5951         #  @param theNbTimes2 Quantity of translations to be done along theVector2.
5952         #  @return New GEOM.GEOM_Object, containing compound of all
5953         #          the shapes, obtained after each translation.
5954         #
5955         #  @ref tui_multi_translation "Example"
5956         def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
5957                                    theVector2, theStep2, theNbTimes2):
5958             """
5959             Conseqently apply two specified translations to theObject specified number of times.
5960
5961             Parameters:
5962                 theObject The object to be translated.
5963                 theVector1 Direction of the first translation.
5964                 theStep1 Step of the first translation.
5965                 theNbTimes1 Quantity of translations to be done along theVector1.
5966                 theVector2 Direction of the second translation.
5967                 theStep2 Step of the second translation.
5968                 theNbTimes2 Quantity of translations to be done along theVector2.
5969
5970             Returns:
5971                 New GEOM.GEOM_Object, containing compound of all
5972                 the shapes, obtained after each translation.
5973
5974             Example of usage:
5975                 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
5976             """
5977             # Example: see GEOM_TestAll.py
5978             theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
5979             anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
5980                                                  theVector2, theStep2, theNbTimes2)
5981             RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
5982             anObj.SetParameters(Parameters)
5983             return anObj
5984
5985         ## Rotate the given object around the given axis a given number times.
5986         #  Rotation angle will be 2*PI/theNbTimes.
5987         #  @param theObject The object to be rotated.
5988         #  @param theAxis The rotation axis.
5989         #  @param theNbTimes Quantity of rotations to be done.
5990         #  @return New GEOM.GEOM_Object, containing compound of all the
5991         #          shapes, obtained after each rotation.
5992         #
5993         #  @ref tui_multi_rotation "Example"
5994         def MultiRotate1D(self,theObject, theAxis, theNbTimes):
5995             """
5996             Rotate the given object around the given axis a given number times.
5997             Rotation angle will be 2*PI/theNbTimes.
5998
5999             Parameters:
6000                 theObject The object to be rotated.
6001                 theAxis The rotation axis.
6002                 theNbTimes Quantity of rotations to be done.
6003
6004             Returns:     
6005                 New GEOM.GEOM_Object, containing compound of all the
6006                 shapes, obtained after each rotation.
6007
6008             Example of usage:
6009                 rot1d = geompy.MultiRotate1D(prism, vect, 4)
6010             """
6011             # Example: see GEOM_TestAll.py
6012             theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
6013             anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
6014             RaiseIfFailed("MultiRotate1D", self.TrsfOp)
6015             anObj.SetParameters(Parameters)
6016             return anObj
6017
6018         ## Rotate the given object around the
6019         #  given axis on the given angle a given number
6020         #  times and multi-translate each rotation result.
6021         #  Translation direction passes through center of gravity
6022         #  of rotated shape and its projection on the rotation axis.
6023         #  @param theObject The object to be rotated.
6024         #  @param theAxis Rotation axis.
6025         #  @param theAngle Rotation angle in graduces.
6026         #  @param theNbTimes1 Quantity of rotations to be done.
6027         #  @param theStep Translation distance.
6028         #  @param theNbTimes2 Quantity of translations to be done.
6029         #  @return New GEOM.GEOM_Object, containing compound of all the
6030         #          shapes, obtained after each transformation.
6031         #
6032         #  @ref tui_multi_rotation "Example"
6033         def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
6034             """
6035             Rotate the given object around the
6036             given axis on the given angle a given number
6037             times and multi-translate each rotation result.
6038             Translation direction passes through center of gravity
6039             of rotated shape and its projection on the rotation axis.
6040
6041             Parameters:
6042                 theObject The object to be rotated.
6043                 theAxis Rotation axis.
6044                 theAngle Rotation angle in graduces.
6045                 theNbTimes1 Quantity of rotations to be done.
6046                 theStep Translation distance.
6047                 theNbTimes2 Quantity of translations to be done.
6048
6049             Returns:    
6050                 New GEOM.GEOM_Object, containing compound of all the
6051                 shapes, obtained after each transformation.
6052
6053             Example of usage:
6054                 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
6055             """
6056             # Example: see GEOM_TestAll.py
6057             theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
6058             anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
6059             RaiseIfFailed("MultiRotate2D", self.TrsfOp)
6060             anObj.SetParameters(Parameters)
6061             return anObj
6062
6063         ## The same, as MultiRotate1D(), but axis is given by direction and point
6064         #
6065         #  @ref swig_MakeMultiRotation "Example"
6066         def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
6067             """
6068             The same, as geompy.MultiRotate1D, but axis is given by direction and point
6069
6070             Example of usage:
6071                 pz = geompy.MakeVertex(0, 0, 100)
6072                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
6073                 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
6074             """
6075             # Example: see GEOM_TestOthers.py
6076             aVec = self.MakeLine(aPoint,aDir)
6077             anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
6078             return anObj
6079
6080         ## The same, as MultiRotate2D(), but axis is given by direction and point
6081         #
6082         #  @ref swig_MakeMultiRotation "Example"
6083         def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
6084             """
6085             The same, as MultiRotate2D(), but axis is given by direction and point
6086             
6087             Example of usage:
6088                 pz = geompy.MakeVertex(0, 0, 100)
6089                 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
6090                 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
6091             """
6092             # Example: see GEOM_TestOthers.py
6093             aVec = self.MakeLine(aPoint,aDir)
6094             anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
6095             return anObj
6096
6097         # end of l3_transform
6098         ## @}
6099
6100         ## @addtogroup l3_local
6101         ## @{
6102
6103         ## Perform a fillet on all edges of the given shape.
6104         #  @param theShape Shape, to perform fillet on.
6105         #  @param theR Fillet radius.
6106         #  @return New GEOM.GEOM_Object, containing the result shape.
6107         #
6108         #  @ref tui_fillet "Example 1"
6109         #  \n @ref swig_MakeFilletAll "Example 2"
6110         def MakeFilletAll(self,theShape, theR):
6111             """
6112             Perform a fillet on all edges of the given shape.
6113
6114             Parameters:
6115                 theShape Shape, to perform fillet on.
6116                 theR Fillet radius.
6117
6118             Returns: 
6119                 New GEOM.GEOM_Object, containing the result shape.
6120
6121             Example of usage: 
6122                filletall = geompy.MakeFilletAll(prism, 10.)
6123             """
6124             # Example: see GEOM_TestOthers.py
6125             theR,Parameters = ParseParameters(theR)
6126             anObj = self.LocalOp.MakeFilletAll(theShape, theR)
6127             RaiseIfFailed("MakeFilletAll", self.LocalOp)
6128             anObj.SetParameters(Parameters)
6129             return anObj
6130
6131         ## Perform a fillet on the specified edges/faces of the given shape
6132         #  @param theShape Shape, to perform fillet on.
6133         #  @param theR Fillet radius.
6134         #  @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
6135         #  @param theListShapes Global indices of edges/faces to perform fillet on.
6136         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6137         #  @return New GEOM.GEOM_Object, containing the result shape.
6138         #
6139         #  @ref tui_fillet "Example"
6140         def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
6141             """
6142             Perform a fillet on the specified edges/faces of the given shape
6143
6144             Parameters:
6145                 theShape Shape, to perform fillet on.
6146                 theR Fillet radius.
6147                 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
6148                 theListShapes Global indices of edges/faces to perform fillet on.
6149
6150             Note:
6151                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6152
6153             Returns: 
6154                 New GEOM.GEOM_Object, containing the result shape.
6155
6156             Example of usage:
6157                 # get the list of IDs (IDList) for the fillet
6158                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6159                 IDlist_e = []
6160                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6161                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6162                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6163                 # make a fillet on the specified edges of the given shape
6164                 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
6165             """
6166             # Example: see GEOM_TestAll.py
6167             theR,Parameters = ParseParameters(theR)
6168             anObj = None
6169             if theShapeType == ShapeType["EDGE"]:
6170                 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
6171                 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
6172             else:
6173                 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
6174                 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
6175             anObj.SetParameters(Parameters)
6176             return anObj
6177
6178         ## The same that MakeFillet() but with two Fillet Radius R1 and R2
6179         def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
6180             """
6181             The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
6182
6183             Example of usage:
6184                 # get the list of IDs (IDList) for the fillet
6185                 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
6186                 IDlist_e = []
6187                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
6188                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
6189                 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
6190                 # make a fillet on the specified edges of the given shape
6191                 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
6192             """
6193             theR1,theR2,Parameters = ParseParameters(theR1,theR2)
6194             anObj = None
6195             if theShapeType == ShapeType["EDGE"]:
6196                 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
6197                 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
6198             else:
6199                 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
6200                 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
6201             anObj.SetParameters(Parameters)
6202             return anObj
6203
6204         ## Perform a fillet on the specified edges of the given shape
6205         #  @param theShape  Wire Shape to perform fillet on.
6206         #  @param theR  Fillet radius.
6207         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
6208         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID()
6209         #    \note The list of vertices could be empty,
6210         #          in this case fillet will done done at all vertices in wire
6211         #  @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
6212         #         by the length of the edges, nearest to the fillet vertex.
6213         #         But sometimes the next edge is C1 continuous with the one, nearest to
6214         #         the fillet point, and such two (or more) edges can be united to allow
6215         #         bigger radius. Set this flag to TRUE to allow collinear edges union,
6216         #         thus ignoring the secant vertex (vertices).
6217         #  @return New GEOM.GEOM_Object, containing the result shape.
6218         #
6219         #  @ref tui_fillet2d "Example"
6220         def MakeFillet1D(self,theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True):
6221             """
6222             Perform a fillet on the specified edges of the given shape
6223
6224             Parameters:
6225                 theShape  Wire Shape to perform fillet on.
6226                 theR  Fillet radius.
6227                 theListOfVertexes Global indices of vertexes to perform fillet on.
6228                 doIgnoreSecantVertices If FALSE, fillet radius is always limited
6229                     by the length of the edges, nearest to the fillet vertex.
6230                     But sometimes the next edge is C1 continuous with the one, nearest to
6231                     the fillet point, and such two (or more) edges can be united to allow
6232                     bigger radius. Set this flag to TRUE to allow collinear edges union,
6233                     thus ignoring the secant vertex (vertices).
6234             Note:
6235                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6236
6237                 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
6238
6239             Returns: 
6240                 New GEOM.GEOM_Object, containing the result shape.
6241
6242             Example of usage:  
6243                 # create wire
6244                 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
6245                 # make fillet at given wire vertices with giver radius
6246                 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
6247             """
6248             # Example: see GEOM_TestAll.py
6249             theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
6250             anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
6251             RaiseIfFailed("MakeFillet1D", self.LocalOp)
6252             anObj.SetParameters(Parameters)
6253             return anObj
6254
6255         ## Perform a fillet at the specified vertices of the given face/shell.
6256         #  @param theShape Face or Shell shape to perform fillet on.
6257         #  @param theR Fillet radius.
6258         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
6259         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6260         #  @return New GEOM.GEOM_Object, containing the result shape.
6261         #
6262         #  @ref tui_fillet2d "Example"
6263         def MakeFillet2D(self, theShape, theR, theListOfVertexes):
6264             """
6265             Perform a fillet at the specified vertices of the given face/shell.
6266
6267             Parameters:
6268                 theShape  Face or Shell shape to perform fillet on.
6269                 theR  Fillet radius.
6270                 theListOfVertexes Global indices of vertexes to perform fillet on.
6271             Note:
6272                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6273
6274             Returns: 
6275                 New GEOM.GEOM_Object, containing the result shape.
6276
6277             Example of usage:
6278                 face = geompy.MakeFaceHW(100, 100, 1)
6279                 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
6280             """
6281             # Example: see GEOM_TestAll.py
6282             theR,Parameters = ParseParameters(theR)
6283             anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
6284             RaiseIfFailed("MakeFillet2D", self.LocalOp)
6285             anObj.SetParameters(Parameters)
6286             return anObj
6287
6288         ## Perform a symmetric chamfer on all edges of the given shape.
6289         #  @param theShape Shape, to perform chamfer on.
6290         #  @param theD Chamfer size along each face.
6291         #  @return New GEOM.GEOM_Object, containing the result shape.
6292         #
6293         #  @ref tui_chamfer "Example 1"
6294         #  \n @ref swig_MakeChamferAll "Example 2"
6295         def MakeChamferAll(self,theShape, theD):
6296             """
6297             Perform a symmetric chamfer on all edges of the given shape.
6298
6299             Parameters:
6300                 theShape Shape, to perform chamfer on.
6301                 theD Chamfer size along each face.
6302
6303             Returns:     
6304                 New GEOM.GEOM_Object, containing the result shape.
6305
6306             Example of usage:
6307                 chamfer_all = geompy.MakeChamferAll(prism, 10.)
6308             """
6309             # Example: see GEOM_TestOthers.py
6310             theD,Parameters = ParseParameters(theD)
6311             anObj = self.LocalOp.MakeChamferAll(theShape, theD)
6312             RaiseIfFailed("MakeChamferAll", self.LocalOp)
6313             anObj.SetParameters(Parameters)
6314             return anObj
6315
6316         ## Perform a chamfer on edges, common to the specified faces,
6317         #  with distance D1 on the Face1
6318         #  @param theShape Shape, to perform chamfer on.
6319         #  @param theD1 Chamfer size along \a theFace1.
6320         #  @param theD2 Chamfer size along \a theFace2.
6321         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
6322         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6323         #  @return New GEOM.GEOM_Object, containing the result shape.
6324         #
6325         #  @ref tui_chamfer "Example"
6326         def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
6327             """
6328             Perform a chamfer on edges, common to the specified faces,
6329             with distance D1 on the Face1
6330
6331             Parameters:
6332                 theShape Shape, to perform chamfer on.
6333                 theD1 Chamfer size along theFace1.
6334                 theD2 Chamfer size along theFace2.
6335                 theFace1,theFace2 Global indices of two faces of theShape.
6336
6337             Note:
6338                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6339
6340             Returns:      
6341                 New GEOM.GEOM_Object, containing the result shape.
6342
6343             Example of usage:
6344                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6345                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6346                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6347                 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
6348             """
6349             # Example: see GEOM_TestAll.py
6350             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6351             anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
6352             RaiseIfFailed("MakeChamferEdge", self.LocalOp)
6353             anObj.SetParameters(Parameters)
6354             return anObj
6355
6356         ## Perform a chamfer on edges
6357         #  @param theShape Shape, to perform chamfer on.
6358         #  @param theD Chamfer length
6359         #  @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6360         #  @param theFace1,theFace2 Global indices of two faces of \a theShape.
6361         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6362         #  @return New GEOM.GEOM_Object, containing the result shape.
6363         def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
6364             """
6365             Perform a chamfer on edges
6366
6367             Parameters:
6368                 theShape Shape, to perform chamfer on.
6369                 theD1 Chamfer size along theFace1.
6370                 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
6371                 theFace1,theFace2 Global indices of two faces of theShape.
6372
6373             Note:
6374                 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
6375
6376             Returns:      
6377                 New GEOM.GEOM_Object, containing the result shape.
6378
6379             Example of usage:
6380                 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
6381                 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
6382                 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
6383                 ang = 30
6384                 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
6385             """
6386             flag = False
6387             if isinstance(theAngle,str):
6388                 flag = True
6389             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6390             if flag:
6391                 theAngle = theAngle*math.pi/180.0
6392             anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
6393             RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
6394             anObj.SetParameters(Parameters)
6395             return anObj
6396
6397         ## Perform a chamfer on all edges of the specified faces,
6398         #  with distance D1 on the first specified face (if several for one edge)
6399         #  @param theShape Shape, to perform chamfer on.
6400         #  @param theD1 Chamfer size along face from \a theFaces. If both faces,
6401         #               connected to the edge, are in \a theFaces, \a theD1
6402         #               will be get along face, which is nearer to \a theFaces beginning.
6403         #  @param theD2 Chamfer size along another of two faces, connected to the edge.
6404         #  @param theFaces Sequence of global indices of faces of \a theShape.
6405         #    \note Global index of sub-shape can be obtained, using method GetSubShapeID().
6406         #  @return New GEOM.GEOM_Object, containing the result shape.
6407         #
6408         #  @ref tui_chamfer "Example"
6409         def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
6410             """
6411             Perform a chamfer on all edges of the specified faces,
6412             with distance D1 on the first specified face (if several for one edge)
6413
6414             Parameters:
6415                 theShape Shape, to perform chamfer on.
6416                 theD1 Chamfer size along face from  theFaces. If both faces,
6417                       connected to the edge, are in theFaces, theD1
6418                       will be get along face, which is nearer to theFaces beginning.
6419                 theD2 Chamfer size along another of two faces, connected to the edge.
6420                 theFaces Sequence of global indices of faces of theShape.
6421
6422                 
6423             Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
6424
6425             Returns:  
6426                 New GEOM.GEOM_Object, containing the result shape.
6427             """
6428             # Example: see GEOM_TestAll.py
6429             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6430             anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
6431             RaiseIfFailed("MakeChamferFaces", self.LocalOp)
6432             anObj.SetParameters(Parameters)
6433             return anObj
6434
6435         ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
6436         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6437         #
6438         #  @ref swig_FilletChamfer "Example"
6439         def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
6440             """
6441             The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
6442             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6443             """
6444             flag = False
6445             if isinstance(theAngle,str):
6446                 flag = True
6447             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6448             if flag:
6449                 theAngle = theAngle*math.pi/180.0
6450             anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
6451             RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
6452             anObj.SetParameters(Parameters)
6453             return anObj
6454
6455         ## Perform a chamfer on edges,
6456         #  with distance D1 on the first specified face (if several for one edge)
6457         #  @param theShape Shape, to perform chamfer on.
6458         #  @param theD1,theD2 Chamfer size
6459         #  @param theEdges Sequence of edges of \a theShape.
6460         #  @return New GEOM.GEOM_Object, containing the result shape.
6461         #
6462         #  @ref swig_FilletChamfer "Example"
6463         def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
6464             """
6465             Perform a chamfer on edges,
6466             with distance D1 on the first specified face (if several for one edge)
6467             
6468             Parameters:
6469                 theShape Shape, to perform chamfer on.
6470                 theD1,theD2 Chamfer size
6471                 theEdges Sequence of edges of theShape.
6472
6473             Returns:
6474                 New GEOM.GEOM_Object, containing the result shape.
6475             """
6476             theD1,theD2,Parameters = ParseParameters(theD1,theD2)
6477             anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
6478             RaiseIfFailed("MakeChamferEdges", self.LocalOp)
6479             anObj.SetParameters(Parameters)
6480             return anObj
6481
6482         ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
6483         #  theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6484         def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
6485             """
6486             The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
6487             theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
6488             """
6489             flag = False
6490             if isinstance(theAngle,str):
6491                 flag = True
6492             theD,theAngle,Parameters = ParseParameters(theD,theAngle)
6493             if flag:
6494                 theAngle = theAngle*math.pi/180.0
6495             anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
6496             RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
6497             anObj.SetParameters(Parameters)
6498             return anObj
6499
6500         ## /sa MakeChamferEdge() and MakeChamferFaces()
6501         #
6502         #  @ref swig_MakeChamfer "Example"
6503         def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
6504             """
6505             See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
6506             """
6507             # Example: see GEOM_TestOthers.py
6508             anObj = None
6509             if aShapeType == ShapeType["EDGE"]:
6510                 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
6511             else:
6512                 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
6513             return anObj
6514             
6515         ## Remove material from a solid by extrusion of the base shape on the given distance.
6516         #  @param theInit Shape to remove material from. It must be a solid or 
6517         #  a compound made of a single solid.
6518         #  @param theBase Closed edge or wire defining the base shape to be extruded.
6519         #  @param theH Prism dimension along the normal to theBase
6520         #  @param theAngle Draft angle in degrees.
6521         #  @return New GEOM.GEOM_Object, containing the initial shape with removed material 
6522         #
6523         #  @ref tui_creation_prism "Example"
6524         def MakeExtrudedCut(self, theInit, theBase, theH, theAngle):
6525             """
6526             Add material to a solid by extrusion of the base shape on the given distance.
6527
6528             Parameters:
6529                 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
6530                 theBase Closed edge or wire defining the base shape to be extruded.
6531                 theH Prism dimension along the normal  to theBase
6532                 theAngle Draft angle in degrees.
6533
6534             Returns:
6535                 New GEOM.GEOM_Object,  containing the initial shape with removed material.
6536             """
6537             # Example: see GEOM_TestAll.py
6538             #theH,Parameters = ParseParameters(theH)
6539             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
6540             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6541             #anObj.SetParameters(Parameters)
6542             return anObj   
6543             
6544         ## Add material to a solid by extrusion of the base shape on the given distance.
6545         #  @param theInit Shape to add material to. It must be a solid or 
6546         #  a compound made of a single solid.
6547         #  @param theBase Closed edge or wire defining the base shape to be extruded.
6548         #  @param theH Prism dimension along the normal to theBase
6549         #  @param theAngle Draft angle in degrees.
6550         #  @return New GEOM.GEOM_Object, containing the initial shape with added material 
6551         #
6552         #  @ref tui_creation_prism "Example"
6553         def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle):
6554             """
6555             Add material to a solid by extrusion of the base shape on the given distance.
6556
6557             Parameters:
6558                 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
6559                 theBase Closed edge or wire defining the base shape to be extruded.
6560                 theH Prism dimension along the normal  to theBase
6561                 theAngle Draft angle in degrees.
6562
6563             Returns:
6564                 New GEOM.GEOM_Object,  containing the initial shape with added material.
6565             """
6566             # Example: see GEOM_TestAll.py
6567             #theH,Parameters = ParseParameters(theH)
6568             anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
6569             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
6570             #anObj.SetParameters(Parameters)
6571             return anObj   
6572
6573         # end of l3_local
6574         ## @}
6575
6576         ## @addtogroup l3_basic_op
6577         ## @{
6578
6579         ## Perform an Archimde operation on the given shape with given parameters.
6580         #  The object presenting the resulting face is returned.
6581         #  @param theShape Shape to be put in water.
6582         #  @param theWeight Weight og the shape.
6583         #  @param theWaterDensity Density of the water.
6584         #  @param theMeshDeflection Deflection of the mesh, using to compute the section.
6585         #  @return New GEOM.GEOM_Object, containing a section of \a theShape
6586         #          by a plane, corresponding to water level.
6587         #
6588         #  @ref tui_archimede "Example"
6589         def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
6590             """
6591             Perform an Archimde operation on the given shape with given parameters.
6592             The object presenting the resulting face is returned.
6593
6594             Parameters: 
6595                 theShape Shape to be put in water.
6596                 theWeight Weight og the shape.
6597                 theWaterDensity Density of the water.
6598                 theMeshDeflection Deflection of the mesh, using to compute the section.
6599
6600             Returns: 
6601                 New GEOM.GEOM_Object, containing a section of theShape
6602                 by a plane, corresponding to water level.
6603             """
6604             # Example: see GEOM_TestAll.py
6605             theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
6606               theWeight,theWaterDensity,theMeshDeflection)
6607             anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
6608             RaiseIfFailed("MakeArchimede", self.LocalOp)
6609             anObj.SetParameters(Parameters)
6610             return anObj
6611
6612         # end of l3_basic_op
6613         ## @}
6614
6615         ## @addtogroup l2_measure
6616         ## @{
6617
6618         ## Get point coordinates
6619         #  @return [x, y, z]
6620         #
6621         #  @ref tui_measurement_tools_page "Example"
6622         def PointCoordinates(self,Point):
6623             """
6624             Get point coordinates
6625
6626             Returns:
6627                 [x, y, z]
6628             """
6629             # Example: see GEOM_TestMeasures.py
6630             aTuple = self.MeasuOp.PointCoordinates(Point)
6631             RaiseIfFailed("PointCoordinates", self.MeasuOp)
6632             return aTuple
6633
6634         ## Get summarized length of all wires,
6635         #  area of surface and volume of the given shape.
6636         #  @param theShape Shape to define properties of.
6637         #  @return [theLength, theSurfArea, theVolume]\n
6638         #  theLength:   Summarized length of all wires of the given shape.\n
6639         #  theSurfArea: Area of surface of the given shape.\n
6640         #  theVolume:   Volume of the given shape.
6641         #
6642         #  @ref tui_measurement_tools_page "Example"
6643         def BasicProperties(self,theShape):
6644             """
6645             Get summarized length of all wires,
6646             area of surface and volume of the given shape.
6647
6648             Parameters: 
6649                 theShape Shape to define properties of.
6650
6651             Returns:
6652                 [theLength, theSurfArea, theVolume]
6653                  theLength:   Summarized length of all wires of the given shape.
6654                  theSurfArea: Area of surface of the given shape.
6655                  theVolume:   Volume of the given shape.
6656             """
6657             # Example: see GEOM_TestMeasures.py
6658             aTuple = self.MeasuOp.GetBasicProperties(theShape)
6659             RaiseIfFailed("GetBasicProperties", self.MeasuOp)
6660             return aTuple
6661
6662         ## Get parameters of bounding box of the given shape
6663         #  @param theShape Shape to obtain bounding box of.
6664         #  @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6665         #  Xmin,Xmax: Limits of shape along OX axis.
6666         #  Ymin,Ymax: Limits of shape along OY axis.
6667         #  Zmin,Zmax: Limits of shape along OZ axis.
6668         #
6669         #  @ref tui_measurement_tools_page "Example"
6670         def BoundingBox(self,theShape):
6671             """
6672             Get parameters of bounding box of the given shape
6673
6674             Parameters: 
6675                 theShape Shape to obtain bounding box of.
6676
6677             Returns:
6678                 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
6679                  Xmin,Xmax: Limits of shape along OX axis.
6680                  Ymin,Ymax: Limits of shape along OY axis.
6681                  Zmin,Zmax: Limits of shape along OZ axis.
6682             """
6683             # Example: see GEOM_TestMeasures.py
6684             aTuple = self.MeasuOp.GetBoundingBox(theShape)
6685             RaiseIfFailed("GetBoundingBox", self.MeasuOp)
6686             return aTuple
6687
6688         ## Get inertia matrix and moments of inertia of theShape.
6689         #  @param theShape Shape to calculate inertia of.
6690         #  @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6691         #  I(1-3)(1-3): Components of the inertia matrix of the given shape.
6692         #  Ix,Iy,Iz:    Moments of inertia of the given shape.
6693         #
6694         #  @ref tui_measurement_tools_page "Example"
6695         def Inertia(self,theShape):
6696             """
6697             Get inertia matrix and moments of inertia of theShape.
6698
6699             Parameters: 
6700                 theShape Shape to calculate inertia of.
6701
6702             Returns:
6703                 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
6704                  I(1-3)(1-3): Components of the inertia matrix of the given shape.
6705                  Ix,Iy,Iz:    Moments of inertia of the given shape.
6706             """
6707             # Example: see GEOM_TestMeasures.py
6708             aTuple = self.MeasuOp.GetInertia(theShape)
6709             RaiseIfFailed("GetInertia", self.MeasuOp)
6710             return aTuple
6711
6712         ## Get if coords are included in the shape (ST_IN or ST_ON)
6713         #  @param theShape Shape
6714         #  @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6715         #  @param tolerance to be used (default is 1.0e-7)
6716         #  @return list_of_boolean = [res1, res2, ...]
6717         def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
6718             """
6719             Get if coords are included in the shape (ST_IN or ST_ON)
6720             
6721             Parameters: 
6722                 theShape Shape
6723                 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
6724                 tolerance to be used (default is 1.0e-7)
6725
6726             Returns:
6727                 list_of_boolean = [res1, res2, ...]
6728             """
6729             return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
6730
6731         ## Get minimal distance between the given shapes.
6732         #  @param theShape1,theShape2 Shapes to find minimal distance between.
6733         #  @return Value of the minimal distance between the given shapes.
6734         #
6735         #  @ref tui_measurement_tools_page "Example"
6736         def MinDistance(self, theShape1, theShape2):
6737             """
6738             Get minimal distance between the given shapes.
6739             
6740             Parameters: 
6741                 theShape1,theShape2 Shapes to find minimal distance between.
6742
6743             Returns:    
6744                 Value of the minimal distance between the given shapes.
6745             """
6746             # Example: see GEOM_TestMeasures.py
6747             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6748             RaiseIfFailed("GetMinDistance", self.MeasuOp)
6749             return aTuple[0]
6750
6751         ## Get minimal distance between the given shapes.
6752         #  @param theShape1,theShape2 Shapes to find minimal distance between.
6753         #  @return Value of the minimal distance between the given shapes.
6754         #
6755         #  @ref swig_all_measure "Example"
6756         def MinDistanceComponents(self, theShape1, theShape2):
6757             """
6758             Get minimal distance between the given shapes.
6759
6760             Parameters: 
6761                 theShape1,theShape2 Shapes to find minimal distance between.
6762
6763             Returns:  
6764                 Value of the minimal distance between the given shapes.
6765             """
6766             # Example: see GEOM_TestMeasures.py
6767             aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
6768             RaiseIfFailed("GetMinDistance", self.MeasuOp)
6769             aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
6770             return aRes
6771
6772         ## Get angle between the given shapes in degrees.
6773         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
6774         #  @note If both arguments are vectors, the angle is computed in accordance
6775         #        with their orientations, otherwise the minimum angle is computed.
6776         #  @return Value of the angle between the given shapes in degrees.
6777         #
6778         #  @ref tui_measurement_tools_page "Example"
6779         def GetAngle(self, theShape1, theShape2):
6780             """
6781             Get angle between the given shapes in degrees.
6782
6783             Parameters: 
6784                 theShape1,theShape2 Lines or linear edges to find angle between.
6785
6786             Note:
6787                 If both arguments are vectors, the angle is computed in accordance
6788                 with their orientations, otherwise the minimum angle is computed.
6789
6790             Returns:  
6791                 Value of the angle between the given shapes in degrees.
6792             """
6793             # Example: see GEOM_TestMeasures.py
6794             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
6795             RaiseIfFailed("GetAngle", self.MeasuOp)
6796             return anAngle
6797
6798         ## Get angle between the given shapes in radians.
6799         #  @param theShape1,theShape2 Lines or linear edges to find angle between.
6800         #  @note If both arguments are vectors, the angle is computed in accordance
6801         #        with their orientations, otherwise the minimum angle is computed.
6802         #  @return Value of the angle between the given shapes in radians.
6803         #
6804         #  @ref tui_measurement_tools_page "Example"
6805         def GetAngleRadians(self, theShape1, theShape2):
6806             """
6807             Get angle between the given shapes in radians.
6808
6809             Parameters: 
6810                 theShape1,theShape2 Lines or linear edges to find angle between.
6811
6812                 
6813             Note:
6814                 If both arguments are vectors, the angle is computed in accordance
6815                 with their orientations, otherwise the minimum angle is computed.
6816
6817             Returns:  
6818                 Value of the angle between the given shapes in radians.
6819             """
6820             # Example: see GEOM_TestMeasures.py
6821             anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
6822             RaiseIfFailed("GetAngle", self.MeasuOp)
6823             return anAngle
6824
6825         ## Get angle between the given vectors in degrees.
6826         #  @param theShape1,theShape2 Vectors to find angle between.
6827         #  @param theFlag If True, the normal vector is defined by the two vectors cross,
6828         #                 if False, the opposite vector to the normal vector is used.
6829         #  @return Value of the angle between the given vectors in degrees.
6830         #
6831         #  @ref tui_measurement_tools_page "Example"
6832         def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
6833             """
6834             Get angle between the given vectors in degrees.
6835
6836             Parameters: 
6837                 theShape1,theShape2 Vectors to find angle between.
6838                 theFlag If True, the normal vector is defined by the two vectors cross,
6839                         if False, the opposite vector to the normal vector is used.
6840
6841             Returns:  
6842                 Value of the angle between the given vectors in degrees.
6843             """
6844             anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
6845             if not theFlag:
6846                 anAngle = 360. - anAngle
6847             RaiseIfFailed("GetAngleVectors", self.MeasuOp)
6848             return anAngle
6849
6850         ## The same as GetAngleVectors, but the result is in radians.
6851         def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
6852             """
6853             Get angle between the given vectors in radians.
6854
6855             Parameters: 
6856                 theShape1,theShape2 Vectors to find angle between.
6857                 theFlag If True, the normal vector is defined by the two vectors cross,
6858                         if False, the opposite vector to the normal vector is used.
6859
6860             Returns:  
6861                 Value of the angle between the given vectors in radians.
6862             """
6863             anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
6864             return anAngle
6865
6866         ## @name Curve Curvature Measurement
6867         #  Methods for receiving radius of curvature of curves
6868         #  in the given point
6869         ## @{
6870
6871         ## Measure curvature of a curve at a point, set by parameter.
6872         #  @param theCurve a curve.
6873         #  @param theParam parameter.
6874         #  @return radius of curvature of \a theCurve.
6875         #
6876         #  @ref swig_todo "Example"
6877         def CurveCurvatureByParam(self, theCurve, theParam):
6878             """
6879             Measure curvature of a curve at a point, set by parameter.
6880
6881             Parameters: 
6882                 theCurve a curve.
6883                 theParam parameter.
6884
6885             Returns: 
6886                 radius of curvature of theCurve.
6887             """
6888             # Example: see GEOM_TestMeasures.py
6889             aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
6890             RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
6891             return aCurv
6892
6893         ## Measure curvature of a curve at a point.
6894         #  @param theCurve a curve.
6895         #  @param thePoint given point.
6896         #  @return radius of curvature of \a theCurve.
6897         #
6898         #  @ref swig_todo "Example"
6899         def CurveCurvatureByPoint(self, theCurve, thePoint):
6900             """
6901             Measure curvature of a curve at a point.
6902
6903             Parameters: 
6904                 theCurve a curve.
6905                 thePoint given point.
6906
6907             Returns: 
6908                 radius of curvature of theCurve.           
6909             """
6910             aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
6911             RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
6912             return aCurv
6913         ## @}
6914
6915         ## @name Surface Curvature Measurement
6916         #  Methods for receiving max and min radius of curvature of surfaces
6917         #  in the given point
6918         ## @{
6919
6920         ## Measure max radius of curvature of surface.
6921         #  @param theSurf the given surface.
6922         #  @param theUParam Value of U-parameter on the referenced surface.
6923         #  @param theVParam Value of V-parameter on the referenced surface.
6924         #  @return max radius of curvature of theSurf.
6925         #
6926         ## @ref swig_todo "Example"
6927         def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6928             """
6929             Measure max radius of curvature of surface.
6930
6931             Parameters: 
6932                 theSurf the given surface.
6933                 theUParam Value of U-parameter on the referenced surface.
6934                 theVParam Value of V-parameter on the referenced surface.
6935                 
6936             Returns:     
6937                 max radius of curvature of theSurf.
6938             """
6939             # Example: see GEOM_TestMeasures.py
6940             aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6941             RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
6942             return aSurf
6943
6944         ## Measure max radius of curvature of surface in the given point
6945         #  @param theSurf the given surface.
6946         #  @param thePoint given point.
6947         #  @return max radius of curvature of theSurf.
6948         #
6949         ## @ref swig_todo "Example"
6950         def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
6951             """
6952             Measure max radius of curvature of surface in the given point.
6953
6954             Parameters: 
6955                 theSurf the given surface.
6956                 thePoint given point.
6957                 
6958             Returns:     
6959                 max radius of curvature of theSurf.          
6960             """
6961             aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
6962             RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
6963             return aSurf
6964
6965         ## Measure min radius of curvature of surface.
6966         #  @param theSurf the given surface.
6967         #  @param theUParam Value of U-parameter on the referenced surface.
6968         #  @param theVParam Value of V-parameter on the referenced surface.
6969         #  @return min radius of curvature of theSurf.
6970         #   
6971         ## @ref swig_todo "Example"
6972         def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
6973             """
6974             Measure min radius of curvature of surface.
6975
6976             Parameters: 
6977                 theSurf the given surface.
6978                 theUParam Value of U-parameter on the referenced surface.
6979                 theVParam Value of V-parameter on the referenced surface.
6980                 
6981             Returns:     
6982                 Min radius of curvature of theSurf.
6983             """
6984             aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
6985             RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
6986             return aSurf
6987
6988         ## Measure min radius of curvature of surface in the given point
6989         #  @param theSurf the given surface.
6990         #  @param thePoint given point.
6991         #  @return min radius of curvature of theSurf.
6992         #
6993         ## @ref swig_todo "Example"
6994         def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
6995             """
6996             Measure min radius of curvature of surface in the given point.
6997
6998             Parameters: 
6999                 theSurf the given surface.
7000                 thePoint given point.
7001                 
7002             Returns:     
7003                 Min radius of curvature of theSurf.          
7004             """
7005             aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
7006             RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
7007             return aSurf
7008         ## @}
7009
7010         ## Get min and max tolerances of sub-shapes of theShape
7011         #  @param theShape Shape, to get tolerances of.
7012         #  @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
7013         #  FaceMin,FaceMax: Min and max tolerances of the faces.\n
7014         #  EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
7015         #  VertMin,VertMax: Min and max tolerances of the vertices.
7016         #
7017         #  @ref tui_measurement_tools_page "Example"
7018         def Tolerance(self,theShape):
7019             """
7020             Get min and max tolerances of sub-shapes of theShape
7021
7022             Parameters: 
7023                 theShape Shape, to get tolerances of.
7024
7025             Returns:    
7026                 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
7027                  FaceMin,FaceMax: Min and max tolerances of the faces.
7028                  EdgeMin,EdgeMax: Min and max tolerances of the edges.
7029                  VertMin,VertMax: Min and max tolerances of the vertices.
7030             """
7031             # Example: see GEOM_TestMeasures.py
7032             aTuple = self.MeasuOp.GetTolerance(theShape)
7033             RaiseIfFailed("GetTolerance", self.MeasuOp)
7034             return aTuple
7035
7036         ## Obtain description of the given shape (number of sub-shapes of each type)
7037         #  @param theShape Shape to be described.
7038         #  @return Description of the given shape.
7039         #
7040         #  @ref tui_measurement_tools_page "Example"
7041         def WhatIs(self,theShape):
7042             """
7043             Obtain description of the given shape (number of sub-shapes of each type)
7044
7045             Parameters:
7046                 theShape Shape to be described.
7047
7048             Returns:
7049                 Description of the given shape.
7050             """
7051             # Example: see GEOM_TestMeasures.py
7052             aDescr = self.MeasuOp.WhatIs(theShape)
7053             RaiseIfFailed("WhatIs", self.MeasuOp)
7054             return aDescr
7055
7056         ## Obtain quantity of shapes of the given type in \a theShape.
7057         #  If \a theShape is of type \a theType, it is also counted.
7058         #  @param theShape Shape to be described.
7059         #  @param theType the given ShapeType().
7060         #  @return Quantity of shapes of type \a theType in \a theShape.
7061         #
7062         #  @ref tui_measurement_tools_page "Example"
7063         def NbShapes (self, theShape, theType):
7064             """
7065             Obtain quantity of shapes of the given type in theShape.
7066             If theShape is of type theType, it is also counted.
7067
7068             Parameters:
7069                 theShape Shape to be described.
7070                 theType the given geompy.ShapeType
7071
7072             Returns:
7073                 Quantity of shapes of type theType in theShape.
7074             """
7075             # Example: see GEOM_TestMeasures.py
7076             listSh = self.SubShapeAllIDs(theShape, theType)
7077             Nb = len(listSh)
7078             t       = EnumToLong(theShape.GetShapeType())
7079             theType = EnumToLong(theType)
7080             if t == theType:
7081                 Nb = Nb + 1
7082                 pass
7083             return Nb
7084
7085         ## Obtain quantity of shapes of each type in \a theShape.
7086         #  The \a theShape is also counted.
7087         #  @param theShape Shape to be described.
7088         #  @return Dictionary of ShapeType() with bound quantities of shapes.
7089         #
7090         #  @ref tui_measurement_tools_page "Example"
7091         def ShapeInfo (self, theShape):
7092             """
7093             Obtain quantity of shapes of each type in theShape.
7094             The theShape is also counted.
7095
7096             Parameters:
7097                 theShape Shape to be described.
7098
7099             Returns:
7100                 Dictionary of geompy.ShapeType with bound quantities of shapes.
7101             """
7102             # Example: see GEOM_TestMeasures.py
7103             aDict = {}
7104             for typeSh in ShapeType:
7105                 if typeSh in ( "AUTO", "SHAPE" ): continue
7106                 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
7107                 Nb = len(listSh)
7108                 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
7109                     Nb = Nb + 1
7110                     pass
7111                 aDict[typeSh] = Nb
7112                 pass
7113             return aDict
7114
7115         ## Get a point, situated at the centre of mass of theShape.
7116         #  @param theShape Shape to define centre of mass of.
7117         #  @return New GEOM.GEOM_Object, containing the created point.
7118         #
7119         #  @ref tui_measurement_tools_page "Example"
7120         def MakeCDG(self,theShape):
7121             """
7122             Get a point, situated at the centre of mass of theShape.
7123
7124             Parameters:
7125                 theShape Shape to define centre of mass of.
7126
7127             Returns:
7128                 New GEOM.GEOM_Object, containing the created point.
7129             """
7130             # Example: see GEOM_TestMeasures.py
7131             anObj = self.MeasuOp.GetCentreOfMass(theShape)
7132             RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
7133             return anObj
7134
7135         ## Get a vertex sub-shape by index depended with orientation.
7136         #  @param theShape Shape to find sub-shape.
7137         #  @param theIndex Index to find vertex by this index (starting from zero)
7138         #  @return New GEOM.GEOM_Object, containing the created vertex.
7139         #
7140         #  @ref tui_measurement_tools_page "Example"
7141         def GetVertexByIndex(self,theShape, theIndex):
7142             """
7143             Get a vertex sub-shape by index depended with orientation.
7144
7145             Parameters:
7146                 theShape Shape to find sub-shape.
7147                 theIndex Index to find vertex by this index (starting from zero)
7148
7149             Returns:
7150                 New GEOM.GEOM_Object, containing the created vertex.
7151             """
7152             # Example: see GEOM_TestMeasures.py
7153             anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
7154             RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
7155             return anObj
7156
7157         ## Get the first vertex of wire/edge depended orientation.
7158         #  @param theShape Shape to find first vertex.
7159         #  @return New GEOM.GEOM_Object, containing the created vertex.
7160         #
7161         #  @ref tui_measurement_tools_page "Example"
7162         def GetFirstVertex(self,theShape):
7163             """
7164             Get the first vertex of wire/edge depended orientation.
7165
7166             Parameters:
7167                 theShape Shape to find first vertex.
7168
7169             Returns:    
7170                 New GEOM.GEOM_Object, containing the created vertex.
7171             """
7172             # Example: see GEOM_TestMeasures.py
7173             anObj = self.GetVertexByIndex(theShape, 0)
7174             RaiseIfFailed("GetFirstVertex", self.MeasuOp)
7175             return anObj
7176
7177         ## Get the last vertex of wire/edge depended orientation.
7178         #  @param theShape Shape to find last vertex.
7179         #  @return New GEOM.GEOM_Object, containing the created vertex.
7180         #
7181         #  @ref tui_measurement_tools_page "Example"
7182         def GetLastVertex(self,theShape):
7183             """
7184             Get the last vertex of wire/edge depended orientation.
7185
7186             Parameters: 
7187                 theShape Shape to find last vertex.
7188
7189             Returns:   
7190                 New GEOM.GEOM_Object, containing the created vertex.
7191             """
7192             # Example: see GEOM_TestMeasures.py
7193             nb_vert =  self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
7194             anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
7195             RaiseIfFailed("GetLastVertex", self.MeasuOp)
7196             return anObj
7197
7198         ## Get a normale to the given face. If the point is not given,
7199         #  the normale is calculated at the center of mass.
7200         #  @param theFace Face to define normale of.
7201         #  @param theOptionalPoint Point to compute the normale at.
7202         #  @return New GEOM.GEOM_Object, containing the created vector.
7203         #
7204         #  @ref swig_todo "Example"
7205         def GetNormal(self, theFace, theOptionalPoint = None):
7206             """
7207             Get a normale to the given face. If the point is not given,
7208             the normale is calculated at the center of mass.
7209             
7210             Parameters: 
7211                 theFace Face to define normale of.
7212                 theOptionalPoint Point to compute the normale at.
7213
7214             Returns:   
7215                 New GEOM.GEOM_Object, containing the created vector.
7216             """
7217             # Example: see GEOM_TestMeasures.py
7218             anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
7219             RaiseIfFailed("GetNormal", self.MeasuOp)
7220             return anObj
7221
7222         ## Check a topology of the given shape.
7223         #  @param theShape Shape to check validity of.
7224         #  @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
7225         #                        if TRUE, the shape's geometry will be checked also.
7226         #  @param theReturnStatus If FALSE and if theShape is invalid, a description \n
7227         #                        of problem is printed.
7228         #                        if TRUE and if theShape is invalid, the description 
7229         #                        of problem is also returned.
7230         #  @return TRUE, if the shape "seems to be valid".
7231         #
7232         #  @ref tui_measurement_tools_page "Example"
7233         def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
7234             """
7235             Check a topology of the given shape.
7236
7237             Parameters: 
7238                 theShape Shape to check validity of.
7239                 theIsCheckGeom If FALSE, only the shape's topology will be checked,
7240                                if TRUE, the shape's geometry will be checked also.
7241                 theReturnStatus If FALSE and if theShape is invalid, a description
7242                                 of problem is printed.
7243                                 if TRUE and if theShape is invalid, the description 
7244                                 of problem is returned.
7245
7246             Returns:   
7247                 TRUE, if the shape "seems to be valid".
7248                 If theShape is invalid, prints a description of problem.
7249                 This description can also be returned.
7250             """
7251             # Example: see GEOM_TestMeasures.py
7252             if theIsCheckGeom:
7253                 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
7254                 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
7255             else:
7256                 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
7257                 RaiseIfFailed("CheckShape", self.MeasuOp)
7258             if IsValid == 0:
7259                 if theReturnStatus == 0:
7260                     print Status
7261             if theReturnStatus == 1:
7262               return (IsValid, Status)
7263             return IsValid
7264
7265         ## Detect self-intersections in the given shape.
7266         #  @param theShape Shape to check.
7267         #  @return TRUE, if the shape contains no self-intersections.
7268         #
7269         #  @ref tui_measurement_tools_page "Example"
7270         def CheckSelfIntersections(self, theShape):
7271             """
7272             Detect self-intersections in the given shape.
7273
7274             Parameters: 
7275                 theShape Shape to check.
7276
7277             Returns:   
7278                 TRUE, if the shape contains no self-intersections.
7279             """
7280             # Example: see GEOM_TestMeasures.py
7281             (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
7282             RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
7283             return IsValid
7284
7285         ## Get position (LCS) of theShape.
7286         #
7287         #  Origin of the LCS is situated at the shape's center of mass.
7288         #  Axes of the LCS are obtained from shape's location or,
7289         #  if the shape is a planar face, from position of its plane.
7290         #
7291         #  @param theShape Shape to calculate position of.
7292         #  @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7293         #          Ox,Oy,Oz: Coordinates of shape's LCS origin.
7294         #          Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7295         #          Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7296         #
7297         #  @ref swig_todo "Example"
7298         def GetPosition(self,theShape):
7299             """
7300             Get position (LCS) of theShape.
7301             Origin of the LCS is situated at the shape's center of mass.
7302             Axes of the LCS are obtained from shape's location or,
7303             if the shape is a planar face, from position of its plane.
7304
7305             Parameters: 
7306                 theShape Shape to calculate position of.
7307
7308             Returns:  
7309                 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
7310                  Ox,Oy,Oz: Coordinates of shape's LCS origin.
7311                  Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
7312                  Xx,Xy,Xz: Coordinates of shape's LCS X direction.
7313             """
7314             # Example: see GEOM_TestMeasures.py
7315             aTuple = self.MeasuOp.GetPosition(theShape)
7316             RaiseIfFailed("GetPosition", self.MeasuOp)
7317             return aTuple
7318
7319         ## Get kind of theShape.
7320         #
7321         #  @param theShape Shape to get a kind of.
7322         #  @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
7323         #          and a list of parameters, describing the shape.
7324         #  @note  Concrete meaning of each value, returned via \a theIntegers
7325         #         or \a theDoubles list depends on the kind() of the shape.
7326         #
7327         #  @ref swig_todo "Example"
7328         def KindOfShape(self,theShape):
7329             """
7330             Get kind of theShape.
7331          
7332             Parameters: 
7333                 theShape Shape to get a kind of.
7334
7335             Returns:
7336                 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
7337                     and a list of parameters, describing the shape.
7338             Note:
7339                 Concrete meaning of each value, returned via theIntegers
7340                 or theDoubles list depends on the geompy.kind of the shape
7341             """
7342             # Example: see GEOM_TestMeasures.py
7343             aRoughTuple = self.MeasuOp.KindOfShape(theShape)
7344             RaiseIfFailed("KindOfShape", self.MeasuOp)
7345
7346             aKind  = aRoughTuple[0]
7347             anInts = aRoughTuple[1]
7348             aDbls  = aRoughTuple[2]
7349
7350             # Now there is no exception from this rule:
7351             aKindTuple = [aKind] + aDbls + anInts
7352
7353             # If they are we will regroup parameters for such kind of shape.
7354             # For example:
7355             #if aKind == kind.SOME_KIND:
7356             #    #  SOME_KIND     int int double int double double
7357             #    aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
7358
7359             return aKindTuple
7360
7361         # end of l2_measure
7362         ## @}
7363
7364         ## @addtogroup l2_import_export
7365         ## @{
7366
7367         ## Import a shape from the BREP or IGES or STEP file
7368         #  (depends on given format) with given name.
7369         #  @param theFileName The file, containing the shape.
7370         #  @param theFormatName Specify format for the file reading.
7371         #         Available formats can be obtained with InsertOp.ImportTranslators() method.
7372         #         If format 'IGES_SCALE' is used instead of 'IGES' or
7373         #            format 'STEP_SCALE' is used instead of 'STEP',
7374         #            length unit will be set to 'meter' and result model will be scaled.
7375         #  @return New GEOM.GEOM_Object, containing the imported shape.
7376         #
7377         #  @ref swig_Import_Export "Example"
7378         def ImportFile(self, theFileName, theFormatName):
7379             """
7380             Import a shape from the BREP or IGES or STEP file
7381             (depends on given format) with given name.
7382
7383             Parameters: 
7384                 theFileName The file, containing the shape.
7385                 theFormatName Specify format for the file reading.
7386                     Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7387                     If format 'IGES_SCALE' is used instead of 'IGES' or
7388                        format 'STEP_SCALE' is used instead of 'STEP',
7389                        length unit will be set to 'meter' and result model will be scaled.
7390
7391             Returns:
7392                 New GEOM.GEOM_Object, containing the imported shape.
7393             """
7394             # Example: see GEOM_TestOthers.py
7395             anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7396             RaiseIfFailed("Import", self.InsertOp)
7397             return anObj
7398
7399         ## Deprecated analog of ImportFile()
7400         def Import(self, theFileName, theFormatName):
7401             """
7402             Deprecated analog of geompy.ImportFile
7403             """
7404             print "WARNING: Function Import is deprecated, use ImportFile instead"
7405             anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
7406             RaiseIfFailed("Import", self.InsertOp)
7407             return anObj
7408
7409         ## Shortcut to ImportFile() for BREP format.
7410         #  Import a shape from the BREP file with given name.
7411         #  @param theFileName The file, containing the shape.
7412         #  @return New GEOM.GEOM_Object, containing the imported shape.
7413         #
7414         #  @ref swig_Import_Export "Example"
7415         def ImportBREP(self, theFileName):
7416             """
7417             geompy.ImportFile(...) function for BREP format
7418             Import a shape from the BREP file with given name.
7419
7420             Parameters: 
7421                 theFileName The file, containing the shape.
7422
7423             Returns:
7424                 New GEOM.GEOM_Object, containing the imported shape.
7425             """
7426             # Example: see GEOM_TestOthers.py
7427             return self.ImportFile(theFileName, "BREP")
7428
7429         ## Shortcut to ImportFile() for IGES format
7430         #  Import a shape from the IGES file with given name.
7431         #  @param theFileName The file, containing the shape.
7432         #  @param ignoreUnits If True, file length units will be ignored (set to 'meter')
7433         #                     and result model will be scaled, if its units are not meters.
7434         #                     If False (default), file length units will be taken into account.
7435         #  @return New GEOM.GEOM_Object, containing the imported shape.
7436         #
7437         #  @ref swig_Import_Export "Example"
7438         def ImportIGES(self, theFileName, ignoreUnits = False):
7439             """
7440             geompy.ImportFile(...) function for IGES format
7441
7442             Parameters:
7443                 theFileName The file, containing the shape.
7444                 ignoreUnits If True, file length units will be ignored (set to 'meter')
7445                             and result model will be scaled, if its units are not meters.
7446                             If False (default), file length units will be taken into account.
7447
7448             Returns:
7449                 New GEOM.GEOM_Object, containing the imported shape.
7450             """
7451             # Example: see GEOM_TestOthers.py
7452             if ignoreUnits:
7453                 return self.ImportFile(theFileName, "IGES_SCALE")
7454             return self.ImportFile(theFileName, "IGES")
7455
7456         ## Return length unit from given IGES file
7457         #  @param theFileName The file, containing the shape.
7458         #  @return String, containing the units name.
7459         #
7460         #  @ref swig_Import_Export "Example"
7461         def GetIGESUnit(self, theFileName):
7462             """
7463             Return length units from given IGES file
7464
7465             Parameters:
7466                 theFileName The file, containing the shape.
7467
7468             Returns:
7469                 String, containing the units name.
7470             """
7471             # Example: see GEOM_TestOthers.py
7472             aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
7473             return aUnitName
7474
7475         ## Shortcut to ImportFile() for STEP format
7476         #  Import a shape from the STEP file with given name.
7477         #  @param theFileName The file, containing the shape.
7478         #  @param ignoreUnits If True, file length units will be ignored (set to 'meter')
7479         #                     and result model will be scaled, if its units are not meters.
7480         #                     If False (default), file length units will be taken into account.
7481         #  @return New GEOM.GEOM_Object, containing the imported shape.
7482         #
7483         #  @ref swig_Import_Export "Example"
7484         def ImportSTEP(self, theFileName, ignoreUnits = False):
7485             """
7486             geompy.ImportFile(...) function for STEP format
7487
7488             Parameters:
7489                 theFileName The file, containing the shape.
7490                 ignoreUnits If True, file length units will be ignored (set to 'meter')
7491                             and result model will be scaled, if its units are not meters.
7492                             If False (default), file length units will be taken into account.
7493
7494             Returns:
7495                 New GEOM.GEOM_Object, containing the imported shape.
7496             """
7497             # Example: see GEOM_TestOthers.py
7498             if ignoreUnits:
7499                 return self.ImportFile(theFileName, "STEP_SCALE")
7500             return self.ImportFile(theFileName, "STEP")
7501
7502         ## Return length unit from given IGES or STEP file
7503         #  @param theFileName The file, containing the shape.
7504         #  @return String, containing the units name.
7505         #
7506         #  @ref swig_Import_Export "Example"
7507         def GetSTEPUnit(self, theFileName):
7508             """
7509             Return length units from given STEP file
7510
7511             Parameters:
7512                 theFileName The file, containing the shape.
7513
7514             Returns:
7515                 String, containing the units name.
7516             """
7517             # Example: see GEOM_TestOthers.py
7518             aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
7519             return aUnitName
7520
7521         ## Read a shape from the binary stream, containing its bounding representation (BRep).
7522         #  @note This method will not be dumped to the python script by DumpStudy functionality.
7523         #  @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
7524         #  @param theStream The BRep binary stream.
7525         #  @return New GEOM_Object, containing the shape, read from theStream.
7526         #
7527         #  @ref swig_Import_Export "Example"
7528         def RestoreShape (self, theStream):
7529             """
7530             Read a shape from the binary stream, containing its bounding representation (BRep).
7531
7532             Note:
7533                 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
7534
7535             Parameters: 
7536                 theStream The BRep binary stream.
7537
7538             Returns:
7539                 New GEOM_Object, containing the shape, read from theStream.
7540             """
7541             # Example: see GEOM_TestOthers.py
7542             anObj = self.InsertOp.RestoreShape(theStream)
7543             RaiseIfFailed("RestoreShape", self.InsertOp)
7544             return anObj
7545
7546         ## Export the given shape into a file with given name.
7547         #  @param theObject Shape to be stored in the file.
7548         #  @param theFileName Name of the file to store the given shape in.
7549         #  @param theFormatName Specify format for the shape storage.
7550         #         Available formats can be obtained with InsertOp.ImportTranslators() method.
7551         #
7552         #  @ref swig_Import_Export "Example"
7553         def Export(self, theObject, theFileName, theFormatName):
7554             """
7555             Export the given shape into a file with given name.
7556
7557             Parameters: 
7558                 theObject Shape to be stored in the file.
7559                 theFileName Name of the file to store the given shape in.
7560                 theFormatName Specify format for the shape storage.
7561                               Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
7562             """
7563             # Example: see GEOM_TestOthers.py
7564             self.InsertOp.Export(theObject, theFileName, theFormatName)
7565             if self.InsertOp.IsDone() == 0:
7566                 raise RuntimeError,  "Export : " + self.InsertOp.GetErrorCode()
7567                 pass
7568             pass
7569
7570         ## Shortcut to Export() for BREP format
7571         #
7572         #  @ref swig_Import_Export "Example"
7573         def ExportBREP(self,theObject, theFileName):
7574             """
7575             geompy.Export(...) function for BREP format
7576             """
7577             # Example: see GEOM_TestOthers.py
7578             return self.Export(theObject, theFileName, "BREP")
7579
7580         ## Shortcut to Export() for IGES format
7581         #
7582         #  @ref swig_Import_Export "Example"
7583         def ExportIGES(self,theObject, theFileName):
7584             """
7585             geompy.Export(...) function for IGES format
7586             """
7587             # Example: see GEOM_TestOthers.py
7588             return self.Export(theObject, theFileName, "IGES")
7589
7590         ## Shortcut to Export() for STEP format
7591         #
7592         #  @ref swig_Import_Export "Example"
7593         def ExportSTEP(self,theObject, theFileName):
7594             """
7595             geompy.Export(...) function for STEP format
7596             """
7597             # Example: see GEOM_TestOthers.py
7598             return self.Export(theObject, theFileName, "STEP")
7599
7600         # end of l2_import_export
7601         ## @}
7602
7603         ## @addtogroup l3_blocks
7604         ## @{
7605
7606         ## Create a quadrangle face from four edges. Order of Edges is not
7607         #  important. It is  not necessary that edges share the same vertex.
7608         #  @param E1,E2,E3,E4 Edges for the face bound.
7609         #  @return New GEOM.GEOM_Object, containing the created face.
7610         #
7611         #  @ref tui_building_by_blocks_page "Example"
7612         def MakeQuad(self,E1, E2, E3, E4):
7613             """
7614             Create a quadrangle face from four edges. Order of Edges is not
7615             important. It is  not necessary that edges share the same vertex.
7616
7617             Parameters: 
7618                 E1,E2,E3,E4 Edges for the face bound.
7619
7620             Returns: 
7621                 New GEOM.GEOM_Object, containing the created face.
7622
7623             Example of usage:               
7624                 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
7625             """
7626             # Example: see GEOM_Spanner.py
7627             anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
7628             RaiseIfFailed("MakeQuad", self.BlocksOp)
7629             return anObj
7630
7631         ## Create a quadrangle face on two edges.
7632         #  The missing edges will be built by creating the shortest ones.
7633         #  @param E1,E2 Two opposite edges for the face.
7634         #  @return New GEOM.GEOM_Object, containing the created face.
7635         #
7636         #  @ref tui_building_by_blocks_page "Example"
7637         def MakeQuad2Edges(self,E1, E2):
7638             """
7639             Create a quadrangle face on two edges.
7640             The missing edges will be built by creating the shortest ones.
7641
7642             Parameters: 
7643                 E1,E2 Two opposite edges for the face.
7644
7645             Returns: 
7646                 New GEOM.GEOM_Object, containing the created face.
7647             
7648             Example of usage:
7649                 # create vertices
7650                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
7651                 p2 = geompy.MakeVertex(150.,  30.,   0.)
7652                 p3 = geompy.MakeVertex(  0., 120.,  50.)
7653                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
7654                 # create edges
7655                 edge1 = geompy.MakeEdge(p1, p2)
7656                 edge2 = geompy.MakeEdge(p3, p4)
7657                 # create a quadrangle face from two edges
7658                 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
7659             """
7660             # Example: see GEOM_Spanner.py
7661             anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
7662             RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
7663             return anObj
7664
7665         ## Create a quadrangle face with specified corners.
7666         #  The missing edges will be built by creating the shortest ones.
7667         #  @param V1,V2,V3,V4 Corner vertices for the face.
7668         #  @return New GEOM.GEOM_Object, containing the created face.
7669         #
7670         #  @ref tui_building_by_blocks_page "Example 1"
7671         #  \n @ref swig_MakeQuad4Vertices "Example 2"
7672         def MakeQuad4Vertices(self,V1, V2, V3, V4):
7673             """
7674             Create a quadrangle face with specified corners.
7675             The missing edges will be built by creating the shortest ones.
7676
7677             Parameters: 
7678                 V1,V2,V3,V4 Corner vertices for the face.
7679
7680             Returns: 
7681                 New GEOM.GEOM_Object, containing the created face.
7682
7683             Example of usage:
7684                 # create vertices
7685                 p1 = geompy.MakeVertex(  0.,   0.,   0.)
7686                 p2 = geompy.MakeVertex(150.,  30.,   0.)
7687                 p3 = geompy.MakeVertex(  0., 120.,  50.)
7688                 p4 = geompy.MakeVertex(  0.,  40.,  70.)
7689                 # create a quadrangle from four points in its corners
7690                 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
7691             """
7692             # Example: see GEOM_Spanner.py
7693             anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
7694             RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
7695             return anObj
7696
7697         ## Create a hexahedral solid, bounded by the six given faces. Order of
7698         #  faces is not important. It is  not necessary that Faces share the same edge.
7699         #  @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7700         #  @return New GEOM.GEOM_Object, containing the created solid.
7701         #
7702         #  @ref tui_building_by_blocks_page "Example 1"
7703         #  \n @ref swig_MakeHexa "Example 2"
7704         def MakeHexa(self,F1, F2, F3, F4, F5, F6):
7705             """
7706             Create a hexahedral solid, bounded by the six given faces. Order of
7707             faces is not important. It is  not necessary that Faces share the same edge.
7708
7709             Parameters: 
7710                 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
7711
7712             Returns:    
7713                 New GEOM.GEOM_Object, containing the created solid.
7714
7715             Example of usage:
7716                 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
7717             """
7718             # Example: see GEOM_Spanner.py
7719             anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
7720             RaiseIfFailed("MakeHexa", self.BlocksOp)
7721             return anObj
7722
7723         ## Create a hexahedral solid between two given faces.
7724         #  The missing faces will be built by creating the smallest ones.
7725         #  @param F1,F2 Two opposite faces for the hexahedral solid.
7726         #  @return New GEOM.GEOM_Object, containing the created solid.
7727         #
7728         #  @ref tui_building_by_blocks_page "Example 1"
7729         #  \n @ref swig_MakeHexa2Faces "Example 2"
7730         def MakeHexa2Faces(self,F1, F2):
7731             """
7732             Create a hexahedral solid between two given faces.
7733             The missing faces will be built by creating the smallest ones.
7734
7735             Parameters: 
7736                 F1,F2 Two opposite faces for the hexahedral solid.
7737
7738             Returns:
7739                 New GEOM.GEOM_Object, containing the created solid.
7740
7741             Example of usage:
7742                 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
7743             """
7744             # Example: see GEOM_Spanner.py
7745             anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
7746             RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
7747             return anObj
7748
7749         # end of l3_blocks
7750         ## @}
7751
7752         ## @addtogroup l3_blocks_op
7753         ## @{
7754
7755         ## Get a vertex, found in the given shape by its coordinates.
7756         #  @param theShape Block or a compound of blocks.
7757         #  @param theX,theY,theZ Coordinates of the sought vertex.
7758         #  @param theEpsilon Maximum allowed distance between the resulting
7759         #                    vertex and point with the given coordinates.
7760         #  @return New GEOM.GEOM_Object, containing the found vertex.
7761         #
7762         #  @ref swig_GetPoint "Example"
7763         def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
7764             """
7765             Get a vertex, found in the given shape by its coordinates.
7766
7767             Parameters: 
7768                 theShape Block or a compound of blocks.
7769                 theX,theY,theZ Coordinates of the sought vertex.
7770                 theEpsilon Maximum allowed distance between the resulting
7771                            vertex and point with the given coordinates.
7772
7773             Returns:                  
7774                 New GEOM.GEOM_Object, containing the found vertex.
7775
7776             Example of usage:
7777                 pnt = geompy.GetPoint(shape, -50,  50,  50, 0.01)
7778             """
7779             # Example: see GEOM_TestOthers.py
7780             anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
7781             RaiseIfFailed("GetPoint", self.BlocksOp)
7782             return anObj
7783
7784         ## Find a vertex of the given shape, which has minimal distance to the given point.
7785         #  @param theShape Any shape.
7786         #  @param thePoint Point, close to the desired vertex.
7787         #  @return New GEOM.GEOM_Object, containing the found vertex.
7788         #
7789         #  @ref swig_GetVertexNearPoint "Example"
7790         def GetVertexNearPoint(self, theShape, thePoint):
7791             """
7792             Find a vertex of the given shape, which has minimal distance to the given point.
7793
7794             Parameters: 
7795                 theShape Any shape.
7796                 thePoint Point, close to the desired vertex.
7797
7798             Returns:
7799                 New GEOM.GEOM_Object, containing the found vertex.
7800
7801             Example of usage:
7802                 pmidle = geompy.MakeVertex(50, 0, 50)
7803                 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
7804             """
7805             # Example: see GEOM_TestOthers.py
7806             anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
7807             RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
7808             return anObj
7809
7810         ## Get an edge, found in the given shape by two given vertices.
7811         #  @param theShape Block or a compound of blocks.
7812         #  @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
7813         #  @return New GEOM.GEOM_Object, containing the found edge.
7814         #
7815         #  @ref swig_GetEdge "Example"
7816         def GetEdge(self, theShape, thePoint1, thePoint2):
7817             """
7818             Get an edge, found in the given shape by two given vertices.
7819
7820             Parameters: 
7821                 theShape Block or a compound of blocks.
7822                 thePoint1,thePoint2 Points, close to the ends of the desired edge.
7823
7824             Returns:
7825                 New GEOM.GEOM_Object, containing the found edge.
7826             """
7827             # Example: see GEOM_Spanner.py
7828             anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
7829             RaiseIfFailed("GetEdge", self.BlocksOp)
7830             return anObj
7831
7832         ## Find an edge of the given shape, which has minimal distance to the given point.
7833         #  @param theShape Block or a compound of blocks.
7834         #  @param thePoint Point, close to the desired edge.
7835         #  @return New GEOM.GEOM_Object, containing the found edge.
7836         #
7837         #  @ref swig_GetEdgeNearPoint "Example"
7838         def GetEdgeNearPoint(self, theShape, thePoint):
7839             """
7840             Find an edge of the given shape, which has minimal distance to the given point.
7841
7842             Parameters: 
7843                 theShape Block or a compound of blocks.
7844                 thePoint Point, close to the desired edge.
7845
7846             Returns:
7847                 New GEOM.GEOM_Object, containing the found edge.
7848             """
7849             # Example: see GEOM_TestOthers.py
7850             anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
7851             RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
7852             return anObj
7853
7854         ## Returns a face, found in the given shape by four given corner vertices.
7855         #  @param theShape Block or a compound of blocks.
7856         #  @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7857         #  @return New GEOM.GEOM_Object, containing the found face.
7858         #
7859         #  @ref swig_todo "Example"
7860         def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
7861             """
7862             Returns a face, found in the given shape by four given corner vertices.
7863
7864             Parameters:
7865                 theShape Block or a compound of blocks.
7866                 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
7867
7868             Returns:
7869                 New GEOM.GEOM_Object, containing the found face.
7870             """
7871             # Example: see GEOM_Spanner.py
7872             anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
7873             RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
7874             return anObj
7875
7876         ## Get a face of block, found in the given shape by two given edges.
7877         #  @param theShape Block or a compound of blocks.
7878         #  @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
7879         #  @return New GEOM.GEOM_Object, containing the found face.
7880         #
7881         #  @ref swig_todo "Example"
7882         def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
7883             """
7884             Get a face of block, found in the given shape by two given edges.
7885
7886             Parameters:
7887                 theShape Block or a compound of blocks.
7888                 theEdge1,theEdge2 Edges, close to the edges of the desired face.
7889
7890             Returns:
7891                 New GEOM.GEOM_Object, containing the found face.
7892             """
7893             # Example: see GEOM_Spanner.py
7894             anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
7895             RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
7896             return anObj
7897
7898         ## Find a face, opposite to the given one in the given block.
7899         #  @param theBlock Must be a hexahedral solid.
7900         #  @param theFace Face of \a theBlock, opposite to the desired face.
7901         #  @return New GEOM.GEOM_Object, containing the found face.
7902         #
7903         #  @ref swig_GetOppositeFace "Example"
7904         def GetOppositeFace(self,theBlock, theFace):
7905             """
7906             Find a face, opposite to the given one in the given block.
7907
7908             Parameters:
7909                 theBlock Must be a hexahedral solid.
7910                 theFace Face of theBlock, opposite to the desired face.
7911
7912             Returns: 
7913                 New GEOM.GEOM_Object, containing the found face.
7914             """
7915             # Example: see GEOM_Spanner.py
7916             anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
7917             RaiseIfFailed("GetOppositeFace", self.BlocksOp)
7918             return anObj
7919
7920         ## Find a face of the given shape, which has minimal distance to the given point.
7921         #  @param theShape Block or a compound of blocks.
7922         #  @param thePoint Point, close to the desired face.
7923         #  @return New GEOM.GEOM_Object, containing the found face.
7924         #
7925         #  @ref swig_GetFaceNearPoint "Example"
7926         def GetFaceNearPoint(self, theShape, thePoint):
7927             """
7928             Find a face of the given shape, which has minimal distance to the given point.
7929
7930             Parameters:
7931                 theShape Block or a compound of blocks.
7932                 thePoint Point, close to the desired face.
7933
7934             Returns:
7935                 New GEOM.GEOM_Object, containing the found face.
7936             """
7937             # Example: see GEOM_Spanner.py
7938             anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
7939             RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
7940             return anObj
7941
7942         ## Find a face of block, whose outside normale has minimal angle with the given vector.
7943         #  @param theBlock Block or a compound of blocks.
7944         #  @param theVector Vector, close to the normale of the desired face.
7945         #  @return New GEOM.GEOM_Object, containing the found face.
7946         #
7947         #  @ref swig_todo "Example"
7948         def GetFaceByNormale(self, theBlock, theVector):
7949             """
7950             Find a face of block, whose outside normale has minimal angle with the given vector.
7951
7952             Parameters:
7953                 theBlock Block or a compound of blocks.
7954                 theVector Vector, close to the normale of the desired face.
7955
7956             Returns:
7957                 New GEOM.GEOM_Object, containing the found face.
7958             """
7959             # Example: see GEOM_Spanner.py
7960             anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
7961             RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
7962             return anObj
7963
7964         ## Find all sub-shapes of type \a theShapeType of the given shape,
7965         #  which have minimal distance to the given point.
7966         #  @param theShape Any shape.
7967         #  @param thePoint Point, close to the desired shape.
7968         #  @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
7969         #  @param theTolerance The tolerance for distances comparison. All shapes
7970         #                      with distances to the given point in interval
7971         #                      [minimal_distance, minimal_distance + theTolerance] will be gathered.
7972         #  @return New GEOM_Object, containing a group of all found shapes.
7973         #
7974         #  @ref swig_GetShapesNearPoint "Example"
7975         def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
7976             """
7977             Find all sub-shapes of type theShapeType of the given shape,
7978             which have minimal distance to the given point.
7979
7980             Parameters:
7981                 theShape Any shape.
7982                 thePoint Point, close to the desired shape.
7983                 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
7984                 theTolerance The tolerance for distances comparison. All shapes
7985                                 with distances to the given point in interval
7986                                 [minimal_distance, minimal_distance + theTolerance] will be gathered.
7987
7988             Returns:
7989                 New GEOM_Object, containing a group of all found shapes.
7990             """
7991             # Example: see GEOM_TestOthers.py
7992             anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
7993             RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
7994             return anObj
7995
7996         # end of l3_blocks_op
7997         ## @}
7998
7999         ## @addtogroup l4_blocks_measure
8000         ## @{
8001
8002         ## Check, if the compound of blocks is given.
8003         #  To be considered as a compound of blocks, the
8004         #  given shape must satisfy the following conditions:
8005         #  - Each element of the compound should be a Block (6 faces and 12 edges).
8006         #  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
8007         #  - The compound should be connexe.
8008         #  - The glue between two quadrangle faces should be applied.
8009         #  @param theCompound The compound to check.
8010         #  @return TRUE, if the given shape is a compound of blocks.
8011         #  If theCompound is not valid, prints all discovered errors.
8012         #
8013         #  @ref tui_measurement_tools_page "Example 1"
8014         #  \n @ref swig_CheckCompoundOfBlocks "Example 2"
8015         def CheckCompoundOfBlocks(self,theCompound):
8016             """
8017             Check, if the compound of blocks is given.
8018             To be considered as a compound of blocks, the
8019             given shape must satisfy the following conditions:
8020             - Each element of the compound should be a Block (6 faces and 12 edges).
8021             - A connection between two Blocks should be an entire quadrangle face or an entire edge.
8022             - The compound should be connexe.
8023             - The glue between two quadrangle faces should be applied.
8024
8025             Parameters:
8026                 theCompound The compound to check.
8027
8028             Returns:
8029                 TRUE, if the given shape is a compound of blocks.
8030                 If theCompound is not valid, prints all discovered errors.            
8031             """
8032             # Example: see GEOM_Spanner.py
8033             (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
8034             RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
8035             if IsValid == 0:
8036                 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
8037                 print Descr
8038             return IsValid
8039
8040         ## Retrieve all non blocks solids and faces from \a theShape.
8041         #  @param theShape The shape to explore.
8042         #  @return A tuple of two GEOM_Objects. The first object is a group of all
8043         #          non block solids (= not 6 faces, or with 6 faces, but with the
8044         #          presence of non-quadrangular faces). The second object is a
8045         #          group of all non quadrangular faces.
8046         #
8047         #  @ref tui_measurement_tools_page "Example 1"
8048         #  \n @ref swig_GetNonBlocks "Example 2"
8049         def GetNonBlocks (self, theShape):
8050             """
8051             Retrieve all non blocks solids and faces from theShape.
8052
8053             Parameters:
8054                 theShape The shape to explore.
8055
8056             Returns:
8057                 A tuple of two GEOM_Objects. The first object is a group of all
8058                 non block solids (= not 6 faces, or with 6 faces, but with the
8059                 presence of non-quadrangular faces). The second object is a
8060                 group of all non quadrangular faces.
8061
8062             Usage:
8063                 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
8064             """
8065             # Example: see GEOM_Spanner.py
8066             aTuple = self.BlocksOp.GetNonBlocks(theShape)
8067             RaiseIfFailed("GetNonBlocks", self.BlocksOp)
8068             return aTuple
8069
8070         ## Remove all seam and degenerated edges from \a theShape.
8071         #  Unite faces and edges, sharing one surface. It means that
8072         #  this faces must have references to one C++ surface object (handle).
8073         #  @param theShape The compound or single solid to remove irregular edges from.
8074         #  @param doUnionFaces If True, then unite faces. If False (the default value),
8075         #         do not unite faces.
8076         #  @return Improved shape.
8077         #
8078         #  @ref swig_RemoveExtraEdges "Example"
8079         def RemoveExtraEdges(self, theShape, doUnionFaces=False):
8080             """
8081             Remove all seam and degenerated edges from theShape.
8082             Unite faces and edges, sharing one surface. It means that
8083             this faces must have references to one C++ surface object (handle).
8084
8085             Parameters:
8086                 theShape The compound or single solid to remove irregular edges from.
8087                 doUnionFaces If True, then unite faces. If False (the default value),
8088                              do not unite faces.
8089
8090             Returns: 
8091                 Improved shape.
8092             """
8093             # Example: see GEOM_TestOthers.py
8094             nbFacesOptimum = -1 # -1 means do not unite faces
8095             if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
8096             anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
8097             RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
8098             return anObj
8099
8100         ## Check, if the given shape is a blocks compound.
8101         #  Fix all detected errors.
8102         #    \note Single block can be also fixed by this method.
8103         #  @param theShape The compound to check and improve.
8104         #  @return Improved compound.
8105         #
8106         #  @ref swig_CheckAndImprove "Example"
8107         def CheckAndImprove(self,theShape):
8108             """
8109             Check, if the given shape is a blocks compound.
8110             Fix all detected errors.
8111
8112             Note:
8113                 Single block can be also fixed by this method.
8114
8115             Parameters:
8116                 theShape The compound to check and improve.
8117
8118             Returns: 
8119                 Improved compound.
8120             """
8121             # Example: see GEOM_TestOthers.py
8122             anObj = self.BlocksOp.CheckAndImprove(theShape)
8123             RaiseIfFailed("CheckAndImprove", self.BlocksOp)
8124             return anObj
8125
8126         # end of l4_blocks_measure
8127         ## @}
8128
8129         ## @addtogroup l3_blocks_op
8130         ## @{
8131
8132         ## Get all the blocks, contained in the given compound.
8133         #  @param theCompound The compound to explode.
8134         #  @param theMinNbFaces If solid has lower number of faces, it is not a block.
8135         #  @param theMaxNbFaces If solid has higher number of faces, it is not a block.
8136         #    \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
8137         #  @return List of GEOM.GEOM_Object, containing the retrieved blocks.
8138         #
8139         #  @ref tui_explode_on_blocks "Example 1"
8140         #  \n @ref swig_MakeBlockExplode "Example 2"
8141         def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
8142             """
8143             Get all the blocks, contained in the given compound.
8144
8145             Parameters:
8146                 theCompound The compound to explode.
8147                 theMinNbFaces If solid has lower number of faces, it is not a block.
8148                 theMaxNbFaces If solid has higher number of faces, it is not a block.
8149
8150             Note:
8151                 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
8152
8153             Returns:  
8154                 List of GEOM.GEOM_Object, containing the retrieved blocks.
8155             """
8156             # Example: see GEOM_TestOthers.py
8157             theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
8158             aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
8159             RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
8160             for anObj in aList:
8161                 anObj.SetParameters(Parameters)
8162                 pass
8163             return aList
8164
8165         ## Find block, containing the given point inside its volume or on boundary.
8166         #  @param theCompound Compound, to find block in.
8167         #  @param thePoint Point, close to the desired block. If the point lays on
8168         #         boundary between some blocks, we return block with nearest center.
8169         #  @return New GEOM.GEOM_Object, containing the found block.
8170         #
8171         #  @ref swig_todo "Example"
8172         def GetBlockNearPoint(self,theCompound, thePoint):
8173             """
8174             Find block, containing the given point inside its volume or on boundary.
8175
8176             Parameters:
8177                 theCompound Compound, to find block in.
8178                 thePoint Point, close to the desired block. If the point lays on
8179                          boundary between some blocks, we return block with nearest center.
8180
8181             Returns:
8182                 New GEOM.GEOM_Object, containing the found block.
8183             """
8184             # Example: see GEOM_Spanner.py
8185             anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
8186             RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
8187             return anObj
8188
8189         ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8190         #  @param theCompound Compound, to find block in.
8191         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
8192         #  @return New GEOM.GEOM_Object, containing the found block.
8193         #
8194         #  @ref swig_GetBlockByParts "Example"
8195         def GetBlockByParts(self,theCompound, theParts):
8196             """
8197              Find block, containing all the elements, passed as the parts, or maximum quantity of them.
8198
8199              Parameters:
8200                 theCompound Compound, to find block in.
8201                 theParts List of faces and/or edges and/or vertices to be parts of the found block.
8202
8203             Returns: 
8204                 New GEOM_Object, containing the found block.
8205             """
8206             # Example: see GEOM_TestOthers.py
8207             anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
8208             RaiseIfFailed("GetBlockByParts", self.BlocksOp)
8209             return anObj
8210
8211         ## Return all blocks, containing all the elements, passed as the parts.
8212         #  @param theCompound Compound, to find blocks in.
8213         #  @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8214         #  @return List of GEOM.GEOM_Object, containing the found blocks.
8215         #
8216         #  @ref swig_todo "Example"
8217         def GetBlocksByParts(self,theCompound, theParts):
8218             """
8219             Return all blocks, containing all the elements, passed as the parts.
8220
8221             Parameters:
8222                 theCompound Compound, to find blocks in.
8223                 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
8224
8225             Returns:
8226                 List of GEOM.GEOM_Object, containing the found blocks.
8227             """
8228             # Example: see GEOM_Spanner.py
8229             aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
8230             RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
8231             return aList
8232
8233         ## Multi-transformate block and glue the result.
8234         #  Transformation is defined so, as to superpose direction faces.
8235         #  @param Block Hexahedral solid to be multi-transformed.
8236         #  @param DirFace1 ID of First direction face.
8237         #  @param DirFace2 ID of Second direction face.
8238         #  @param NbTimes Quantity of transformations to be done.
8239         #    \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8240         #  @return New GEOM.GEOM_Object, containing the result shape.
8241         #
8242         #  @ref tui_multi_transformation "Example"
8243         def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
8244             """
8245             Multi-transformate block and glue the result.
8246             Transformation is defined so, as to superpose direction faces.
8247
8248             Parameters:
8249                 Block Hexahedral solid to be multi-transformed.
8250                 DirFace1 ID of First direction face.
8251                 DirFace2 ID of Second direction face.
8252                 NbTimes Quantity of transformations to be done.
8253
8254             Note:
8255                 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
8256
8257             Returns:
8258                 New GEOM.GEOM_Object, containing the result shape.
8259             """
8260             # Example: see GEOM_Spanner.py
8261             DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
8262             anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
8263             RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
8264             anObj.SetParameters(Parameters)
8265             return anObj
8266
8267         ## Multi-transformate block and glue the result.
8268         #  @param Block Hexahedral solid to be multi-transformed.
8269         #  @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8270         #  @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8271         #  @param NbTimesU,NbTimesV Quantity of transformations to be done.
8272         #  @return New GEOM.GEOM_Object, containing the result shape.
8273         #
8274         #  @ref tui_multi_transformation "Example"
8275         def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
8276                                       DirFace1V, DirFace2V, NbTimesV):
8277             """
8278             Multi-transformate block and glue the result.
8279
8280             Parameters:
8281                 Block Hexahedral solid to be multi-transformed.
8282                 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
8283                 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
8284                 NbTimesU,NbTimesV Quantity of transformations to be done.
8285
8286             Returns:
8287                 New GEOM.GEOM_Object, containing the result shape.
8288             """
8289             # Example: see GEOM_Spanner.py
8290             DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
8291               DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
8292             anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
8293                                                             DirFace1V, DirFace2V, NbTimesV)
8294             RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
8295             anObj.SetParameters(Parameters)
8296             return anObj
8297
8298         ## Build all possible propagation groups.
8299         #  Propagation group is a set of all edges, opposite to one (main)
8300         #  edge of this group directly or through other opposite edges.
8301         #  Notion of Opposite Edge make sence only on quadrangle face.
8302         #  @param theShape Shape to build propagation groups on.
8303         #  @return List of GEOM.GEOM_Object, each of them is a propagation group.
8304         #
8305         #  @ref swig_Propagate "Example"
8306         def Propagate(self,theShape):
8307             """
8308             Build all possible propagation groups.
8309             Propagation group is a set of all edges, opposite to one (main)
8310             edge of this group directly or through other opposite edges.
8311             Notion of Opposite Edge make sence only on quadrangle face.
8312
8313             Parameters:
8314                 theShape Shape to build propagation groups on.
8315
8316             Returns:
8317                 List of GEOM.GEOM_Object, each of them is a propagation group.
8318             """
8319             # Example: see GEOM_TestOthers.py
8320             listChains = self.BlocksOp.Propagate(theShape)
8321             RaiseIfFailed("Propagate", self.BlocksOp)
8322             return listChains
8323
8324         # end of l3_blocks_op
8325         ## @}
8326
8327         ## @addtogroup l3_groups
8328         ## @{
8329
8330         ## Creates a new group which will store sub-shapes of theMainShape
8331         #  @param theMainShape is a GEOM object on which the group is selected
8332         #  @param theShapeType defines a shape type of the group (see GEOM::shape_type)
8333         #  @return a newly created GEOM group
8334         #
8335         #  @ref tui_working_with_groups_page "Example 1"
8336         #  \n @ref swig_CreateGroup "Example 2"
8337         def CreateGroup(self,theMainShape, theShapeType):
8338             """
8339             Creates a new group which will store sub-shapes of theMainShape
8340
8341             Parameters:
8342                theMainShape is a GEOM object on which the group is selected
8343                theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
8344                             "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
8345
8346             Returns:
8347                a newly created GEOM group
8348
8349             Example of usage:
8350                 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
8351                 
8352             """
8353             # Example: see GEOM_TestOthers.py
8354             anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
8355             RaiseIfFailed("CreateGroup", self.GroupOp)
8356             return anObj
8357
8358         ## Adds a sub-object with ID theSubShapeId to the group
8359         #  @param theGroup is a GEOM group to which the new sub-shape is added
8360         #  @param theSubShapeID is a sub-shape ID in the main object.
8361         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8362         #
8363         #  @ref tui_working_with_groups_page "Example"
8364         def AddObject(self,theGroup, theSubShapeID):
8365             """
8366             Adds a sub-object with ID theSubShapeId to the group
8367
8368             Parameters:
8369                 theGroup       is a GEOM group to which the new sub-shape is added
8370                 theSubShapeID  is a sub-shape ID in the main object.
8371
8372             Note:
8373                 Use method GetSubShapeID() to get an unique ID of the sub-shape 
8374             """
8375             # Example: see GEOM_TestOthers.py
8376             self.GroupOp.AddObject(theGroup, theSubShapeID)
8377             if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
8378                 RaiseIfFailed("AddObject", self.GroupOp)
8379                 pass
8380             pass
8381
8382         ## Removes a sub-object with ID \a theSubShapeId from the group
8383         #  @param theGroup is a GEOM group from which the new sub-shape is removed
8384         #  @param theSubShapeID is a sub-shape ID in the main object.
8385         #  \note Use method GetSubShapeID() to get an unique ID of the sub-shape
8386         #
8387         #  @ref tui_working_with_groups_page "Example"
8388         def RemoveObject(self,theGroup, theSubShapeID):
8389             """
8390             Removes a sub-object with ID theSubShapeId from the group
8391
8392             Parameters:
8393                 theGroup is a GEOM group from which the new sub-shape is removed
8394                 theSubShapeID is a sub-shape ID in the main object.
8395
8396             Note:
8397                 Use method GetSubShapeID() to get an unique ID of the sub-shape
8398             """
8399             # Example: see GEOM_TestOthers.py
8400             self.GroupOp.RemoveObject(theGroup, theSubShapeID)
8401             RaiseIfFailed("RemoveObject", self.GroupOp)
8402             pass
8403
8404         ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8405         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
8406         #  @param theSubShapes is a list of sub-shapes to be added.
8407         #
8408         #  @ref tui_working_with_groups_page "Example"
8409         def UnionList (self,theGroup, theSubShapes):
8410             """
8411             Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8412
8413             Parameters:
8414                 theGroup is a GEOM group to which the new sub-shapes are added.
8415                 theSubShapes is a list of sub-shapes to be added.
8416             """
8417             # Example: see GEOM_TestOthers.py
8418             self.GroupOp.UnionList(theGroup, theSubShapes)
8419             RaiseIfFailed("UnionList", self.GroupOp)
8420             pass
8421
8422         ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8423         #  @param theGroup is a GEOM group to which the new sub-shapes are added.
8424         #  @param theSubShapes is a list of indices of sub-shapes to be added.
8425         #
8426         #  @ref swig_UnionIDs "Example"
8427         def UnionIDs(self,theGroup, theSubShapes):
8428             """
8429             Adds to the group all the given shapes. No errors, if some shapes are alredy included.
8430
8431             Parameters:
8432                 theGroup is a GEOM group to which the new sub-shapes are added.
8433                 theSubShapes is a list of indices of sub-shapes to be added.
8434             """
8435             # Example: see GEOM_TestOthers.py
8436             self.GroupOp.UnionIDs(theGroup, theSubShapes)
8437             RaiseIfFailed("UnionIDs", self.GroupOp)
8438             pass
8439
8440         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8441         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
8442         #  @param theSubShapes is a list of sub-shapes to be removed.
8443         #
8444         #  @ref tui_working_with_groups_page "Example"
8445         def DifferenceList (self,theGroup, theSubShapes):
8446             """
8447             Removes from the group all the given shapes. No errors, if some shapes are not included.
8448
8449             Parameters:
8450                 theGroup is a GEOM group from which the sub-shapes are removed.
8451                 theSubShapes is a list of sub-shapes to be removed.
8452             """
8453             # Example: see GEOM_TestOthers.py
8454             self.GroupOp.DifferenceList(theGroup, theSubShapes)
8455             RaiseIfFailed("DifferenceList", self.GroupOp)
8456             pass
8457
8458         ## Removes from the group all the given shapes. No errors, if some shapes are not included.
8459         #  @param theGroup is a GEOM group from which the sub-shapes are removed.
8460         #  @param theSubShapes is a list of indices of sub-shapes to be removed.
8461         #
8462         #  @ref swig_DifferenceIDs "Example"
8463         def DifferenceIDs(self,theGroup, theSubShapes):
8464             """
8465             Removes from the group all the given shapes. No errors, if some shapes are not included.
8466
8467             Parameters:
8468                 theGroup is a GEOM group from which the sub-shapes are removed.
8469                 theSubShapes is a list of indices of sub-shapes to be removed.
8470             """            
8471             # Example: see GEOM_TestOthers.py
8472             self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
8473             RaiseIfFailed("DifferenceIDs", self.GroupOp)
8474             pass
8475
8476         ## Union of two groups.
8477         #  New group is created. It will contain all entities
8478         #  which are present in groups theGroup1 and theGroup2.
8479         #  @param theGroup1, theGroup2 are the initial GEOM groups
8480         #                              to create the united group from.
8481         #  @return a newly created GEOM group.
8482         #  @ref tui_union_groups_anchor "Example"
8483         def UnionGroups (self, theGroup1, theGroup2):
8484             """
8485             Union of two groups.
8486             New group is created. It will contain all entities
8487             which are present in groups theGroup1 and theGroup2.
8488
8489             Parameters:
8490                 theGroup1, theGroup2 are the initial GEOM groups
8491                                      to create the united group from.
8492
8493             Returns:
8494                 a newly created GEOM group.
8495             """
8496             # Example: see GEOM_TestOthers.py
8497             aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
8498             RaiseIfFailed("UnionGroups", self.GroupOp)
8499             return aGroup
8500
8501         ## Intersection of two groups.
8502         #  New group is created. It will contain only those entities
8503         #  which are present in both groups theGroup1 and theGroup2.
8504         #  @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8505         #  @return a newly created GEOM group.
8506         #  @ref tui_intersect_groups_anchor "Example"
8507         def IntersectGroups (self, theGroup1, theGroup2):
8508             """
8509             Intersection of two groups.
8510             New group is created. It will contain only those entities
8511             which are present in both groups theGroup1 and theGroup2.
8512
8513             Parameters:
8514                 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
8515
8516             Returns:
8517                 a newly created GEOM group.
8518             """
8519             # Example: see GEOM_TestOthers.py
8520             aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
8521             RaiseIfFailed("IntersectGroups", self.GroupOp)
8522             return aGroup
8523
8524         ## Cut of two groups.
8525         #  New group is created. It will contain entities which are
8526         #  present in group theGroup1 but are not present in group theGroup2.
8527         #  @param theGroup1 is a GEOM group to include elements of.
8528         #  @param theGroup2 is a GEOM group to exclude elements of.
8529         #  @return a newly created GEOM group.
8530         #  @ref tui_cut_groups_anchor "Example"
8531         def CutGroups (self, theGroup1, theGroup2):
8532             """
8533             Cut of two groups.
8534             New group is created. It will contain entities which are
8535             present in group theGroup1 but are not present in group theGroup2.
8536
8537             Parameters:
8538                 theGroup1 is a GEOM group to include elements of.
8539                 theGroup2 is a GEOM group to exclude elements of.
8540
8541             Returns:
8542                 a newly created GEOM group.
8543             """
8544             # Example: see GEOM_TestOthers.py
8545             aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
8546             RaiseIfFailed("CutGroups", self.GroupOp)
8547             return aGroup
8548
8549         ## Union of list of groups.
8550         #  New group is created. It will contain all entities that are
8551         #  present in groups listed in theGList.
8552         #  @param theGList is a list of GEOM groups to create the united group from.
8553         #  @return a newly created GEOM group.
8554         #  @ref tui_union_groups_anchor "Example"
8555         def UnionListOfGroups (self, theGList):
8556             """
8557             Union of list of groups.
8558             New group is created. It will contain all entities that are
8559             present in groups listed in theGList.
8560
8561             Parameters:
8562                 theGList is a list of GEOM groups to create the united group from.
8563
8564             Returns:
8565                 a newly created GEOM group.
8566             """
8567             # Example: see GEOM_TestOthers.py
8568             aGroup = self.GroupOp.UnionListOfGroups(theGList)
8569             RaiseIfFailed("UnionListOfGroups", self.GroupOp)
8570             return aGroup
8571
8572         ## Cut of lists of groups.
8573         #  New group is created. It will contain only entities
8574         #  which are present in groups listed in theGList1 but 
8575         #  are not present in groups from theGList2.
8576         #  @param theGList1 is a list of GEOM groups to include elements of.
8577         #  @param theGList2 is a list of GEOM groups to exclude elements of.
8578         #  @return a newly created GEOM group.
8579         #  @ref tui_intersect_groups_anchor "Example"
8580         def IntersectListOfGroups (self, theGList):
8581             """
8582             Cut of lists of groups.
8583             New group is created. It will contain only entities
8584             which are present in groups listed in theGList1 but 
8585             are not present in groups from theGList2.
8586
8587             Parameters:
8588                 theGList1 is a list of GEOM groups to include elements of.
8589                 theGList2 is a list of GEOM groups to exclude elements of.
8590
8591             Returns:
8592                 a newly created GEOM group.
8593             """
8594             # Example: see GEOM_TestOthers.py
8595             aGroup = self.GroupOp.IntersectListOfGroups(theGList)
8596             RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
8597             return aGroup
8598
8599         ## Cut of lists of groups.
8600         #  New group is created. It will contain only entities
8601         #  which are present in groups listed in theGList1 but 
8602         #  are not present in groups from theGList2.
8603         #  @param theGList1 is a list of GEOM groups to include elements of.
8604         #  @param theGList2 is a list of GEOM groups to exclude elements of.
8605         #  @return a newly created GEOM group.
8606         #  @ref tui_cut_groups_anchor "Example"
8607         def CutListOfGroups (self, theGList1, theGList2):
8608             """
8609             Cut of lists of groups.
8610             New group is created. It will contain only entities
8611             which are present in groups listed in theGList1 but 
8612             are not present in groups from theGList2.
8613
8614             Parameters:
8615                 theGList1 is a list of GEOM groups to include elements of.
8616                 theGList2 is a list of GEOM groups to exclude elements of.
8617
8618             Returns:
8619                 a newly created GEOM group.
8620             """
8621             # Example: see GEOM_TestOthers.py
8622             aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
8623             RaiseIfFailed("CutListOfGroups", self.GroupOp)
8624             return aGroup
8625
8626         ## Returns a list of sub-objects ID stored in the group
8627         #  @param theGroup is a GEOM group for which a list of IDs is requested
8628         #
8629         #  @ref swig_GetObjectIDs "Example"
8630         def GetObjectIDs(self,theGroup):
8631             """
8632             Returns a list of sub-objects ID stored in the group
8633
8634             Parameters:
8635                 theGroup is a GEOM group for which a list of IDs is requested
8636             """
8637             # Example: see GEOM_TestOthers.py
8638             ListIDs = self.GroupOp.GetObjects(theGroup)
8639             RaiseIfFailed("GetObjects", self.GroupOp)
8640             return ListIDs
8641
8642         ## Returns a type of sub-objects stored in the group
8643         #  @param theGroup is a GEOM group which type is returned.
8644         #
8645         #  @ref swig_GetType "Example"
8646         def GetType(self,theGroup):
8647             """
8648             Returns a type of sub-objects stored in the group
8649
8650             Parameters:
8651                 theGroup is a GEOM group which type is returned.
8652             """
8653             # Example: see GEOM_TestOthers.py
8654             aType = self.GroupOp.GetType(theGroup)
8655             RaiseIfFailed("GetType", self.GroupOp)
8656             return aType
8657
8658         ## Convert a type of geom object from id to string value
8659         #  @param theId is a GEOM obect type id.
8660         #  @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8661         #  @ref swig_GetType "Example"
8662         def ShapeIdToType(self, theId):
8663             """
8664             Convert a type of geom object from id to string value
8665
8666             Parameters:
8667                 theId is a GEOM obect type id.
8668                 
8669             Returns:
8670                 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
8671             """
8672             if theId == 0:
8673                 return "COPY"
8674             if theId == 1:
8675                 return "IMPORT"
8676             if theId == 2:
8677                 return "POINT"
8678             if theId == 3:
8679                 return "VECTOR"
8680             if theId == 4:
8681                 return "PLANE"
8682             if theId == 5:
8683                 return "LINE"
8684             if theId == 6:
8685                 return "TORUS"
8686             if theId == 7:
8687                 return "BOX"
8688             if theId == 8:
8689                 return "CYLINDER"
8690             if theId == 9:
8691                 return "CONE"
8692             if theId == 10:
8693                 return "SPHERE"
8694             if theId == 11:
8695                 return "PRISM"
8696             if theId == 12:
8697                 return "REVOLUTION"
8698             if theId == 13:
8699                 return "BOOLEAN"
8700             if theId == 14:
8701                 return "PARTITION"
8702             if theId == 15:
8703                 return "POLYLINE"
8704             if theId == 16:
8705                 return "CIRCLE"
8706             if theId == 17:
8707                 return "SPLINE"
8708             if theId == 18:
8709                 return "ELLIPSE"
8710             if theId == 19:
8711                 return "CIRC_ARC"
8712             if theId == 20:
8713                 return "FILLET"
8714             if theId == 21:
8715                 return "CHAMFER"
8716             if theId == 22:
8717                 return "EDGE"
8718             if theId == 23:
8719                 return "WIRE"
8720             if theId == 24:
8721                 return "FACE"
8722             if theId == 25:
8723                 return "SHELL"
8724             if theId == 26:
8725                 return "SOLID"
8726             if theId == 27:
8727                 return "COMPOUND"
8728             if theId == 28:
8729                 return "SUBSHAPE"
8730             if theId == 29:
8731                 return "PIPE"
8732             if theId == 30:
8733                 return "ARCHIMEDE"
8734             if theId == 31:
8735                 return "FILLING"
8736             if theId == 32:
8737                 return "EXPLODE"
8738             if theId == 33:
8739                 return "GLUED"
8740             if theId == 34:
8741                 return "SKETCHER"
8742             if theId == 35:
8743                 return "CDG"
8744             if theId == 36:
8745                 return "FREE_BOUNDS"
8746             if theId == 37:
8747                 return "GROUP"
8748             if theId == 38:
8749                 return "BLOCK"
8750             if theId == 39:
8751                 return "MARKER"
8752             if theId == 40:
8753                 return "THRUSECTIONS"
8754             if theId == 41:
8755                 return "COMPOUNDFILTER"
8756             if theId == 42:
8757                 return "SHAPES_ON_SHAPE"
8758             if theId == 43:
8759                 return "ELLIPSE_ARC"
8760             if theId == 44:
8761                 return "3DSKETCHER"
8762             if theId == 45:
8763                 return "FILLET_2D"
8764             if theId == 46:
8765                 return "FILLET_1D"
8766             if theId == 201:
8767                 return "PIPETSHAPE"
8768             return "Shape Id not exist."
8769
8770         ## Returns a main shape associated with the group
8771         #  @param theGroup is a GEOM group for which a main shape object is requested
8772         #  @return a GEOM object which is a main shape for theGroup
8773         #
8774         #  @ref swig_GetMainShape "Example"
8775         def GetMainShape(self,theGroup):
8776             """
8777             Returns a main shape associated with the group
8778
8779             Parameters:
8780                 theGroup is a GEOM group for which a main shape object is requested
8781
8782             Returns:
8783                 a GEOM object which is a main shape for theGroup
8784
8785             Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
8786             """
8787             # Example: see GEOM_TestOthers.py
8788             anObj = self.GroupOp.GetMainShape(theGroup)
8789             RaiseIfFailed("GetMainShape", self.GroupOp)
8790             return anObj
8791
8792         ## Create group of edges of theShape, whose length is in range [min_length, max_length].
8793         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
8794         #  @param theShape given shape (see GEOM.GEOM_Object)
8795         #  @param min_length minimum length of edges of theShape
8796         #  @param max_length maximum length of edges of theShape
8797         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8798         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8799         #  @return a newly created GEOM group of edges
8800         #  @@ref swig_todo "Example"
8801         def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
8802             """
8803             Create group of edges of theShape, whose length is in range [min_length, max_length].
8804             If include_min/max == 0, edges with length == min/max_length will not be included in result.
8805
8806             Parameters:
8807                 theShape given shape
8808                 min_length minimum length of edges of theShape
8809                 max_length maximum length of edges of theShape
8810                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8811                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8812
8813              Returns:
8814                 a newly created GEOM group of edges.
8815             """
8816             edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
8817             edges_in_range = []
8818             for edge in edges:
8819                 Props = self.BasicProperties(edge)
8820                 if min_length <= Props[0] and Props[0] <= max_length:
8821                     if (not include_min) and (min_length == Props[0]):
8822                         skip = 1
8823                     else:
8824                         if (not include_max) and (Props[0] == max_length):
8825                             skip = 1
8826                         else:
8827                             edges_in_range.append(edge)
8828
8829             if len(edges_in_range) <= 0:
8830                 print "No edges found by given criteria"
8831                 return 0
8832
8833             group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
8834             self.UnionList(group_edges, edges_in_range)
8835
8836             return group_edges
8837
8838         ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
8839         #  If include_min/max == 0, edges with length == min/max_length will not be included in result.
8840         #  @param min_length minimum length of edges of selected shape
8841         #  @param max_length maximum length of edges of selected shape
8842         #  @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8843         #  @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8844         #  @return a newly created GEOM group of edges
8845         #  @ref swig_todo "Example"
8846         def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
8847             """
8848             Create group of edges of selected shape, whose length is in range [min_length, max_length].
8849             If include_min/max == 0, edges with length == min/max_length will not be included in result.
8850
8851             Parameters:
8852                 min_length minimum length of edges of selected shape
8853                 max_length maximum length of edges of selected shape
8854                 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
8855                 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
8856
8857              Returns:
8858                 a newly created GEOM group of edges.
8859             """
8860             nb_selected = sg.SelectedCount()
8861             if nb_selected < 1:
8862                 print "Select a shape before calling this function, please."
8863                 return 0
8864             if nb_selected > 1:
8865                 print "Only one shape must be selected"
8866                 return 0
8867
8868             id_shape = sg.getSelected(0)
8869             shape = IDToObject( id_shape )
8870
8871             group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
8872
8873             left_str  = " < "
8874             right_str = " < "
8875             if include_min: left_str  = " <= "
8876             if include_max: right_str  = " <= "
8877
8878             self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
8879                                     + left_str + "length" + right_str + `max_length`)
8880
8881             sg.updateObjBrowser(1)
8882
8883             return group_edges
8884
8885         # end of l3_groups
8886         ## @}
8887
8888         ## @addtogroup l4_advanced
8889         ## @{
8890
8891         ## Create a T-shape object with specified caracteristics for the main
8892         #  and the incident pipes (radius, width, half-length).
8893         #  The extremities of the main pipe are located on junctions points P1 and P2.
8894         #  The extremity of the incident pipe is located on junction point P3.
8895         #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8896         #  the main plane of the T-shape is XOY.
8897         #  @param theR1 Internal radius of main pipe
8898         #  @param theW1 Width of main pipe
8899         #  @param theL1 Half-length of main pipe
8900         #  @param theR2 Internal radius of incident pipe (R2 < R1)
8901         #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8902         #  @param theL2 Half-length of incident pipe
8903         #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8904         #  @param theP1 1st junction point of main pipe
8905         #  @param theP2 2nd junction point of main pipe
8906         #  @param theP3 Junction point of incident pipe
8907         #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8908         #
8909         #  @ref tui_creation_pipetshape "Example"
8910         def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8911             """
8912             Create a T-shape object with specified caracteristics for the main
8913             and the incident pipes (radius, width, half-length).
8914             The extremities of the main pipe are located on junctions points P1 and P2.
8915             The extremity of the incident pipe is located on junction point P3.
8916             If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8917             the main plane of the T-shape is XOY.
8918
8919             Paremeters:
8920                 theR1 Internal radius of main pipe
8921                 theW1 Width of main pipe
8922                 theL1 Half-length of main pipe
8923                 theR2 Internal radius of incident pipe (R2 < R1)
8924                 theW2 Width of incident pipe (R2+W2 < R1+W1)
8925                 theL2 Half-length of incident pipe
8926                 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8927                 theP1 1st junction point of main pipe
8928                 theP2 2nd junction point of main pipe
8929                 theP3 Junction point of incident pipe
8930
8931             Returns:
8932                 List of GEOM_Object, containing the created shape and propagation groups.
8933
8934             Example of usage:
8935                 # create PipeTShape object
8936                 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
8937                 # create PipeTShape object with position
8938                 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
8939             """
8940             theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)        
8941             if (theP1 and theP2 and theP3):
8942                 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
8943             else:
8944                 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
8945             RaiseIfFailed("MakePipeTShape", self.AdvOp)
8946             if Parameters: anObj[0].SetParameters(Parameters)
8947             return anObj
8948
8949         ## Create a T-shape object with chamfer and with specified caracteristics for the main
8950         #  and the incident pipes (radius, width, half-length). The chamfer is
8951         #  created on the junction of the pipes.
8952         #  The extremities of the main pipe are located on junctions points P1 and P2.
8953         #  The extremity of the incident pipe is located on junction point P3.
8954         #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8955         #  the main plane of the T-shape is XOY.
8956         #  @param theR1 Internal radius of main pipe
8957         #  @param theW1 Width of main pipe
8958         #  @param theL1 Half-length of main pipe
8959         #  @param theR2 Internal radius of incident pipe (R2 < R1)
8960         #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
8961         #  @param theL2 Half-length of incident pipe
8962         #  @param theH Height of the chamfer.
8963         #  @param theW Width of the chamfer.
8964         #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8965         #  @param theP1 1st junction point of main pipe
8966         #  @param theP2 2nd junction point of main pipe
8967         #  @param theP3 Junction point of incident pipe
8968         #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
8969         #
8970         #  @ref tui_creation_pipetshape "Example"
8971         def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
8972             """
8973             Create a T-shape object with chamfer and with specified caracteristics for the main
8974             and the incident pipes (radius, width, half-length). The chamfer is
8975             created on the junction of the pipes.
8976             The extremities of the main pipe are located on junctions points P1 and P2.
8977             The extremity of the incident pipe is located on junction point P3.
8978             If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
8979             the main plane of the T-shape is XOY.
8980
8981             Paremeters:
8982                 theR1 Internal radius of main pipe
8983                 theW1 Width of main pipe
8984                 theL1 Half-length of main pipe
8985                 theR2 Internal radius of incident pipe (R2 < R1)
8986                 theW2 Width of incident pipe (R2+W2 < R1+W1)
8987                 theL2 Half-length of incident pipe
8988                 theH Height of the chamfer.
8989                 theW Width of the chamfer.
8990                 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
8991                 theP1 1st junction point of main pipe
8992                 theP2 2nd junction point of main pipe
8993                 theP3 Junction point of incident pipe
8994
8995             Returns:
8996                 List of GEOM_Object, containing the created shape and propagation groups.
8997
8998             Example of usage:
8999                 # create PipeTShape with chamfer object
9000                 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
9001                 # create PipeTShape with chamfer object with position
9002                 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
9003             """
9004             theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
9005             if (theP1 and theP2 and theP3):
9006               anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
9007             else:
9008               anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
9009             RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
9010             if Parameters: anObj[0].SetParameters(Parameters)
9011             return anObj
9012
9013         ## Create a T-shape object with fillet and with specified caracteristics for the main
9014         #  and the incident pipes (radius, width, half-length). The fillet is
9015         #  created on the junction of the pipes.
9016         #  The extremities of the main pipe are located on junctions points P1 and P2.
9017         #  The extremity of the incident pipe is located on junction point P3.
9018         #  If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
9019         #  the main plane of the T-shape is XOY.
9020         #  @param theR1 Internal radius of main pipe
9021         #  @param theW1 Width of main pipe
9022         #  @param theL1 Half-length of main pipe
9023         #  @param theR2 Internal radius of incident pipe (R2 < R1)
9024         #  @param theW2 Width of incident pipe (R2+W2 < R1+W1)
9025         #  @param theL2 Half-length of incident pipe
9026         #  @param theRF Radius of curvature of fillet.
9027         #  @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
9028         #  @param theP1 1st junction point of main pipe
9029         #  @param theP2 2nd junction point of main pipe
9030         #  @param theP3 Junction point of incident pipe
9031         #  @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
9032         #
9033         #  @ref tui_creation_pipetshape "Example"
9034         def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
9035             """
9036             Create a T-shape object with fillet and with specified caracteristics for the main
9037             and the incident pipes (radius, width, half-length). The fillet is
9038             created on the junction of the pipes.
9039             The extremities of the main pipe are located on junctions points P1 and P2.
9040             The extremity of the incident pipe is located on junction point P3.
9041
9042             Paremeters:
9043                 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
9044                 the main plane of the T-shape is XOY.
9045                 theR1 Internal radius of main pipe
9046                 theW1 Width of main pipe
9047                 heL1 Half-length of main pipe
9048                 theR2 Internal radius of incident pipe (R2 < R1)
9049                 theW2 Width of incident pipe (R2+W2 < R1+W1)
9050                 theL2 Half-length of incident pipe
9051                 theRF Radius of curvature of fillet.
9052                 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
9053                 theP1 1st junction point of main pipe
9054                 theP2 2nd junction point of main pipe
9055                 theP3 Junction point of incident pipe
9056                 
9057             Returns:
9058                 List of GEOM_Object, containing the created shape and propagation groups.
9059                 
9060             Example of usage:
9061                 # create PipeTShape with fillet object
9062                 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
9063                 # create PipeTShape with fillet object with position
9064                 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
9065         
9066             """
9067             theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
9068             if (theP1 and theP2 and theP3):
9069               anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
9070             else:
9071               anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
9072             RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
9073             if Parameters: anObj[0].SetParameters(Parameters)
9074             return anObj
9075
9076         ## This function allows creating a disk already divided into blocks. It
9077         #  can be used to create divided pipes for later meshing in hexaedra.
9078         #  @param theR Radius of the disk
9079         #  @param theOrientation Orientation of the plane on which the disk will be built
9080         #         1 = XOY, 2 = OYZ, 3 = OZX
9081         #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9082         #  @return New GEOM_Object, containing the created shape.
9083         #
9084         #  @ref tui_creation_divideddisk "Example"
9085         def MakeDividedDisk(self, theR, theOrientation, thePattern ):
9086             theR, Parameters = ParseParameters(theR)
9087             anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
9088             RaiseIfFailed("MakeDividedDisk", self.AdvOp)
9089             if Parameters: anObj.SetParameters(Parameters)
9090             return anObj
9091             
9092         ## This function allows creating a disk already divided into blocks. It
9093         #  can be used to create divided pipes for later meshing in hexaedra.
9094         #  @param theCenter Center of the disk
9095         #  @param theVector Normal vector to the plane of the created disk
9096         #  @param theRadius Radius of the disk
9097         #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9098         #  @return New GEOM_Object, containing the created shape.
9099         #
9100         #  @ref tui_creation_divideddisk "Example"
9101         def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern):
9102             theRadius, Parameters = ParseParameters(theRadius)
9103             anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
9104             RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
9105             if Parameters: anObj.SetParameters(Parameters)
9106             return anObj
9107
9108         ## Builds a cylinder prepared for hexa meshes
9109         #  @param theR Radius of the cylinder
9110         #  @param theH Height of the cylinder
9111         #  @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
9112         #  @return New GEOM_Object, containing the created shape.
9113         #
9114         #  @ref tui_creation_dividedcylinder "Example"
9115         def MakeDividedCylinder(self, theR, theH, thePattern):
9116             theR, theH, Parameters = ParseParameters(theR, theH)
9117             anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
9118             RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
9119             if Parameters: anObj.SetParameters(Parameters)
9120             return anObj
9121
9122         #@@ insert new functions before this line @@ do not remove this line @@#
9123
9124         # end of l4_advanced
9125         ## @}
9126
9127         ## Create a copy of the given object
9128         #
9129         #  @param theOriginal geometry object for copy
9130         #  @return unique object identifier
9131         #  @ingroup l1_geompyDC_auxiliary
9132         #  @ref swig_MakeCopy "Example"
9133         def MakeCopy(self,theOriginal):
9134             """
9135             Create a copy of the given object
9136
9137             Paremeters:
9138                 theOriginal geometry object for copy
9139
9140             Returns:
9141                 unique object identifier
9142
9143             Example of usage: Copy = geompy.MakeCopy(Box)
9144             """
9145             # Example: see GEOM_TestAll.py
9146             anObj = self.InsertOp.MakeCopy(theOriginal)
9147             RaiseIfFailed("MakeCopy", self.InsertOp)
9148             return anObj
9149
9150         ## Add Path to load python scripts from
9151         #  @param Path a path to load python scripts from
9152         #  @ingroup l1_geompyDC_auxiliary
9153         def addPath(self,Path):
9154             """
9155             Add Path to load python scripts from
9156
9157             Parameters:
9158                 Path a path to load python scripts from
9159             """
9160             if (sys.path.count(Path) < 1):
9161                 sys.path.append(Path)
9162                 pass
9163             pass
9164
9165         ## Load marker texture from the file
9166         #  @param Path a path to the texture file
9167         #  @return unique texture identifier
9168         #  @ingroup l1_geompyDC_auxiliary
9169         def LoadTexture(self, Path):
9170             """
9171             Load marker texture from the file
9172             
9173             Parameters:
9174                 Path a path to the texture file
9175                 
9176             Returns:
9177                 unique texture identifier
9178             """
9179             # Example: see GEOM_TestAll.py
9180             ID = self.InsertOp.LoadTexture(Path)
9181             RaiseIfFailed("LoadTexture", self.InsertOp)
9182             return ID
9183
9184         ## Get internal name of the object based on its study entry
9185         #  @note This method does not provide an unique identifier of the geometry object.
9186         #  @note This is internal function of GEOM component, though it can be used outside it for 
9187         #  appropriate reason (e.g. for identification of geometry object).
9188         #  @param obj geometry object
9189         #  @return unique object identifier
9190         #  @ingroup l1_geompyDC_auxiliary
9191         def getObjectID(self, obj):
9192             """
9193             Get internal name of the object based on its study entry.
9194             Note: this method does not provide an unique identifier of the geometry object.
9195             It is an internal function of GEOM component, though it can be used outside GEOM for 
9196             appropriate reason (e.g. for identification of geometry object).
9197
9198             Parameters:
9199                 obj geometry object
9200
9201             Returns:
9202                 unique object identifier
9203             """
9204             ID = ""
9205             entry = salome.ObjectToID(obj)
9206             if entry is not None:
9207                 lst = entry.split(":")
9208                 if len(lst) > 0:
9209                     ID = lst[-1] # -1 means last item in the list            
9210                     return "GEOM_" + ID
9211             return ID
9212                 
9213             
9214
9215         ## Add marker texture. @a Width and @a Height parameters
9216         #  specify width and height of the texture in pixels.
9217         #  If @a RowData is @c True, @a Texture parameter should represent texture data
9218         #  packed into the byte array. If @a RowData is @c False (default), @a Texture
9219         #  parameter should be unpacked string, in which '1' symbols represent opaque
9220         #  pixels and '0' represent transparent pixels of the texture bitmap.
9221         #
9222         #  @param Width texture width in pixels
9223         #  @param Height texture height in pixels
9224         #  @param Texture texture data
9225         #  @param RowData if @c True, @a Texture data are packed in the byte stream
9226         #  @return unique texture identifier
9227         #  @ingroup l1_geompyDC_auxiliary
9228         def AddTexture(self, Width, Height, Texture, RowData=False):
9229             """
9230             Add marker texture. Width and Height parameters
9231             specify width and height of the texture in pixels.
9232             If RowData is True, Texture parameter should represent texture data
9233             packed into the byte array. If RowData is False (default), Texture
9234             parameter should be unpacked string, in which '1' symbols represent opaque
9235             pixels and '0' represent transparent pixels of the texture bitmap.
9236
9237             Parameters:
9238                 Width texture width in pixels
9239                 Height texture height in pixels
9240                 Texture texture data
9241                 RowData if True, Texture data are packed in the byte stream
9242
9243             Returns:
9244                 return unique texture identifier
9245             """
9246             if not RowData: Texture = PackData(Texture)
9247             ID = self.InsertOp.AddTexture(Width, Height, Texture)
9248             RaiseIfFailed("AddTexture", self.InsertOp)
9249             return ID
9250
9251 import omniORB
9252 # Register the new proxy for GEOM_Gen
9253 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)
9254
9255 def geomInstance( study, instance=None):
9256     print "geomInstance ", study, instance
9257     global engine
9258     global geom
9259     global doLcc
9260     engine = instance
9261     if engine is None:
9262       doLcc = True
9263     geom = geompyDC()
9264     assert isinstance(geom,geompyDC), "Geom engine class is %s but should be geompyDC.geompyDC. Import geompyDC before creating the instance."%geom.__class__
9265     geom.init_geom(study)
9266     return geom