1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
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.
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
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup geomBuilder geomBuilder Python module
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New(salome.myStudy)
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New(salome.myStudy)
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New(salome.myStudy)
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
243 # initialize SALOME session in try/except block
244 # to avoid problems in some cases, e.g. when generating documentation
252 from salome_notebook import *
259 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
262 def _toListOfNames(_names, _size=-1):
265 if type(_names) in [types.ListType, types.TupleType]:
266 for i in _names: l.append(i)
269 if l and len(l) < _size:
270 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
273 # Decorator function to manage transactions for all geometric operations.
274 def ManageTransactions(theOpeName):
275 def MTDecorator(theFunction):
276 # To keep the original function name an documentation.
277 @functools.wraps(theFunction)
278 def OpenCallClose(self, *args, **kwargs):
280 anOperation = getattr(self, theOpeName)
281 anOperation.StartOperation()
284 res = theFunction(self, *args, **kwargs)
286 anOperation.FinishOperation()
290 anOperation.AbortOperation()
295 ## Raise an Error, containing the Method_name, if Operation is Failed
296 ## @ingroup l1_geomBuilder_auxiliary
297 def RaiseIfFailed (Method_name, Operation):
298 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
299 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
301 ## Return list of variables value from salome notebook
302 ## @ingroup l1_geomBuilder_auxiliary
303 def ParseParameters(*parameters):
306 for parameter in parameters:
307 if isinstance(parameter, list):
308 lResults = ParseParameters(*parameter)
309 if len(lResults) > 0:
310 Result.append(lResults[:-1])
311 StringResult += lResults[-1].split(":")
315 if isinstance(parameter,str):
316 if notebook.isVariable(parameter):
317 Result.append(notebook.get(parameter))
319 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
322 Result.append(parameter)
324 StringResult.append(str(parameter))
328 Result.append(":".join(StringResult))
330 Result = ":".join(StringResult)
333 ## Return list of variables value from salome notebook
334 ## @ingroup l1_geomBuilder_auxiliary
338 for parameter in list:
339 if isinstance(parameter,str) and notebook.isVariable(parameter):
340 Result.append(str(notebook.get(parameter)))
343 Result.append(str(parameter))
346 StringResult = StringResult + str(parameter)
347 StringResult = StringResult + ":"
349 StringResult = StringResult[:len(StringResult)-1]
350 return Result, StringResult
352 ## Return list of variables value from salome notebook
353 ## @ingroup l1_geomBuilder_auxiliary
354 def ParseSketcherCommand(command):
357 sections = command.split(":")
358 for section in sections:
359 parameters = section.split(" ")
361 for parameter in parameters:
362 if paramIndex > 1 and parameter.find("'") != -1:
363 parameter = parameter.replace("'","")
364 if notebook.isVariable(parameter):
365 Result = Result + str(notebook.get(parameter)) + " "
368 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
372 Result = Result + str(parameter) + " "
375 StringResult = StringResult + parameter
376 StringResult = StringResult + ":"
378 paramIndex = paramIndex + 1
380 Result = Result[:len(Result)-1] + ":"
382 Result = Result[:len(Result)-1]
383 return Result, StringResult
385 ## Helper function which can be used to pack the passed string to the byte data.
386 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
387 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
390 ## val = PackData("10001110") # val = 0xAE
391 ## val = PackData("1") # val = 0x80
393 ## @param data unpacked data - a string containing '1' and '0' symbols
394 ## @return data packed to the byte stream
395 ## @ingroup l1_geomBuilder_auxiliary
398 Helper function which can be used to pack the passed string to the byte data.
399 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
400 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
403 data unpacked data - a string containing '1' and '0' symbols
406 data packed to the byte stream
409 val = PackData("10001110") # val = 0xAE
410 val = PackData("1") # val = 0x80
413 if len(data)%8: bytes += 1
415 for b in range(bytes):
416 d = data[b*8:(b+1)*8]
421 if d[i] == "1": val += 1
423 raise "Invalid symbol %s" % d[i]
430 ## Read bitmap texture from the text file.
431 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
432 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
433 ## The function returns width and height of the pixmap in pixels and byte stream representing
434 ## texture bitmap itself.
436 ## This function can be used to read the texture to the byte stream in order to pass it to
437 ## the AddTexture() function of geomBuilder class.
440 ## from salome.geom import geomBuilder
441 ## geompy = geomBuilder.New(salome.myStudy)
442 ## texture = geompy.readtexture('mytexture.dat')
443 ## texture = geompy.AddTexture(*texture)
444 ## obj.SetMarkerTexture(texture)
446 ## @param fname texture file name
447 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
448 ## @ingroup l1_geomBuilder_auxiliary
449 def ReadTexture(fname):
451 Read bitmap texture from the text file.
452 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
453 A zero symbol ('0') represents transparent pixel of the texture bitmap.
454 The function returns width and height of the pixmap in pixels and byte stream representing
455 texture bitmap itself.
456 This function can be used to read the texture to the byte stream in order to pass it to
457 the AddTexture() function of geomBuilder class.
460 fname texture file name
463 sequence of tree values: texture's width, height in pixels and its byte stream
466 from salome.geom import geomBuilder
467 geompy = geomBuilder.New(salome.myStudy)
468 texture = geompy.readtexture('mytexture.dat')
469 texture = geompy.AddTexture(*texture)
470 obj.SetMarkerTexture(texture)
474 lines = [ l.strip() for l in f.readlines()]
477 if lines: maxlen = max([len(x) for x in lines])
479 if maxlen%8: lenbytes += 1
483 lenline = (len(line)/8+1)*8
486 lenline = (len(line)/8)*8
488 for i in range(lenline/8):
491 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
494 bytedata += PackData(byte)
496 for i in range(lenline/8, lenbytes):
497 bytedata += PackData("0")
499 return lenbytes*8, len(lines), bytedata
504 ## Returns a long value from enumeration type
505 # Can be used for CORBA enumerator types like GEOM.shape_type
506 # @param theItem enumeration type
507 # @ingroup l1_geomBuilder_auxiliary
508 def EnumToLong(theItem):
510 Returns a long value from enumeration type
511 Can be used for CORBA enumerator types like geomBuilder.ShapeType
514 theItem enumeration type
517 if hasattr(theItem, "_v"): ret = theItem._v
520 ## Information about closed/unclosed state of shell or wire
521 # @ingroup l1_geomBuilder_auxiliary
524 Information about closed/unclosed state of shell or wire
530 ## Private class used to bind calls of plugin operations to geomBuilder
531 class PluginOperation:
532 def __init__(self, operation, function):
533 self.operation = operation
534 self.function = function
537 @ManageTransactions("operation")
538 def __call__(self, *args):
539 res = self.function(self.operation, *args)
540 RaiseIfFailed(self.function.__name__, self.operation)
543 # Warning: geom is a singleton
549 class geomBuilder(object, GEOM._objref_GEOM_Gen):
551 ## Enumeration ShapeType as a dictionary. \n
552 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
553 # @ingroup l1_geomBuilder_auxiliary
554 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
556 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
557 # and a list of parameters, describing the shape.
558 # List of parameters, describing the shape:
559 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
560 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
562 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
564 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
566 # - SPHERE: [xc yc zc R]
567 # - CYLINDER: [xb yb zb dx dy dz R H]
568 # - BOX: [xc yc zc ax ay az]
569 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
570 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
571 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
572 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
573 # - SOLID: [nb_faces nb_edges nb_vertices]
575 # - SPHERE2D: [xc yc zc R]
576 # - CYLINDER2D: [xb yb zb dx dy dz R H]
577 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
578 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
579 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
580 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
581 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
582 # - PLANE: [xo yo zo dx dy dz]
583 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
584 # - FACE: [nb_edges nb_vertices]
586 # - CIRCLE: [xc yc zc dx dy dz R]
587 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
588 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
589 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
590 # - LINE: [xo yo zo dx dy dz]
591 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
592 # - EDGE: [nb_vertices]
595 # @ingroup l1_geomBuilder_auxiliary
596 kind = GEOM.GEOM_IKindOfShape
603 #print "==== __new__ ", engine, geom, doLcc, created
605 # geom engine is either retrieved from engine, or created
607 # Following test avoids a recursive loop
610 # geom engine not created: existing engine found
612 if doLcc and not created:
614 # FindOrLoadComponent called:
615 # 1. CORBA resolution of server
616 # 2. the __new__ method is called again
617 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
618 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
621 # FindOrLoadComponent not called
623 # geomBuilder instance is created from lcc.FindOrLoadComponent
624 #print "==== super ", engine, geom, doLcc, created
625 geom = super(geomBuilder,cls).__new__(cls)
628 # geom engine not created: existing engine found
629 #print "==== existing ", engine, geom, doLcc, created
631 #print "return geom 1 ", geom
634 #print "return geom 2 ", geom
639 #print "-------- geomBuilder __init__ --- ", created, self
642 GEOM._objref_GEOM_Gen.__init__(self)
643 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
644 self.myBuilder = None
663 ## Process object publication in the study, as follows:
664 # - if @a theName is specified (not None), the object is published in the study
665 # with this name, not taking into account "auto-publishing" option;
666 # - if @a theName is NOT specified, the object is published in the study
667 # (using default name, which can be customized using @a theDefaultName parameter)
668 # only if auto-publishing is switched on.
670 # @param theObj object, a subject for publishing
671 # @param theName object name for study
672 # @param theDefaultName default name for the auto-publishing
674 # @sa addToStudyAuto()
675 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
677 def _item_name(_names, _defname, _idx=-1):
678 if not _names: _names = _defname
679 if type(_names) in [types.ListType, types.TupleType]:
681 if _idx >= len(_names) or not _names[_idx]:
682 if type(_defname) not in [types.ListType, types.TupleType]:
683 _name = "%s_%d"%(_defname, _idx+1)
684 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
685 _name = _defname[_idx]
687 _name = "%noname_%d"%(dn, _idx+1)
693 # must be wrong usage
698 _name = "%s_%d"%(_names, _idx+1)
704 def _publish( _name, _obj ):
706 if isinstance( _obj, GEOM._objref_GEOM_Field ):
707 fatherObj = _obj.GetShape()
708 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
709 fatherObj = _obj.GetField()
710 elif not _obj.IsMainShape():
711 fatherObj = _obj.GetMainShape()
713 if fatherObj and fatherObj.GetStudyEntry():
714 self.addToStudyInFather(fatherObj, _obj, _name)
716 self.addToStudy(_obj, _name)
722 if not theName and not self.myMaxNbSubShapesAllowed:
723 return # nothing to do: auto-publishing is disabled
724 if not theName and not theDefaultName:
725 return # neither theName nor theDefaultName is given
727 if type(theObj) in [types.ListType, types.TupleType]:
728 # list of objects is being published
731 if not obj: continue # bad object
732 name = _item_name(theName, theDefaultName, idx)
733 _publish( name, obj )
735 if not theName and idx == self.myMaxNbSubShapesAllowed: break
739 # single object is published
740 name = _item_name(theName, theDefaultName)
741 _publish( name, theObj )
744 ## @addtogroup l1_geomBuilder_auxiliary
746 def init_geom(self,theStudy):
747 self.myStudy = theStudy
748 self.myStudyId = self.myStudy._get_StudyId()
749 self.myBuilder = self.myStudy.NewBuilder()
750 self.father = self.myStudy.FindComponent("GEOM")
751 notebook.myStudy = theStudy
752 if self.father is None:
753 self.father = self.myBuilder.NewComponent("GEOM")
754 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
755 FName = A1._narrow(SALOMEDS.AttributeName)
756 FName.SetValue("Geometry")
757 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
758 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
759 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
760 self.myBuilder.DefineComponentInstance(self.father,self)
762 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
763 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
764 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
765 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
766 self.HealOp = self.GetIHealingOperations (self.myStudyId)
767 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
768 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
769 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
770 self.LocalOp = self.GetILocalOperations (self.myStudyId)
771 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
772 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
773 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
774 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
776 # set GEOM as root in the use case tree
777 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
778 self.myUseCaseBuilder.SetRootCurrent()
779 self.myUseCaseBuilder.Append(self.father)
782 def GetPluginOperations(self, studyID, libraryName):
783 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
786 ## Enable / disable results auto-publishing
788 # The automatic publishing is managed in the following way:
789 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
790 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
791 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
792 # value passed as parameter has the same effect.
793 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
794 # maximum number of sub-shapes allowed for publishing is set to specified value.
796 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
797 # @ingroup l1_publish_data
798 def addToStudyAuto(self, maxNbSubShapes=-1):
800 Enable / disable results auto-publishing
802 The automatic publishing is managed in the following way:
803 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
804 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
805 maximum number of sub-shapes allowed for publishing is unlimited; any negative
806 value passed as parameter has the same effect.
807 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
808 maximum number of sub-shapes allowed for publishing is set to this value.
811 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
814 geompy.addToStudyAuto() # enable auto-publishing
815 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
816 geompy.addToStudyAuto(0) # disable auto-publishing
818 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
821 ## Dump component to the Python script
822 # This method overrides IDL function to allow default values for the parameters.
823 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
825 Dump component to the Python script
826 This method overrides IDL function to allow default values for the parameters.
828 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
830 ## Get name for sub-shape aSubObj of shape aMainObj
832 # @ref swig_SubShapeName "Example"
833 @ManageTransactions("ShapesOp")
834 def SubShapeName(self,aSubObj, aMainObj):
836 Get name for sub-shape aSubObj of shape aMainObj
838 # Example: see GEOM_TestAll.py
840 #aSubId = orb.object_to_string(aSubObj)
841 #aMainId = orb.object_to_string(aMainObj)
842 #index = gg.getIndexTopology(aSubId, aMainId)
843 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
844 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
845 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
848 ## Publish in study aShape with name aName
850 # \param aShape the shape to be published
851 # \param aName the name for the shape
852 # \param doRestoreSubShapes if True, finds and publishes also
853 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
854 # and published sub-shapes of arguments
855 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
856 # these arguments description
857 # \return study entry of the published shape in form of string
859 # @ingroup l1_publish_data
860 # @ref swig_all_addtostudy "Example"
861 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
862 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
864 Publish in study aShape with name aName
867 aShape the shape to be published
868 aName the name for the shape
869 doRestoreSubShapes if True, finds and publishes also
870 sub-shapes of aShape, corresponding to its arguments
871 and published sub-shapes of arguments
872 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
873 these arguments description
876 study entry of the published shape in form of string
879 id_block1 = geompy.addToStudy(Block1, "Block 1")
881 # Example: see GEOM_TestAll.py
883 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
884 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
885 if doRestoreSubShapes:
886 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
887 theFindMethod, theInheritFirstArg, True )
889 print "addToStudy() failed"
891 return aShape.GetStudyEntry()
893 ## Publish in study aShape with name aName as sub-object of previously published aFather
894 # \param aFather previously published object
895 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
896 # \param aName the name for the shape
898 # \return study entry of the published shape in form of string
900 # @ingroup l1_publish_data
901 # @ref swig_all_addtostudyInFather "Example"
902 def addToStudyInFather(self, aFather, aShape, aName):
904 Publish in study aShape with name aName as sub-object of previously published aFather
907 aFather previously published object
908 aShape the shape to be published as sub-object of aFather
909 aName the name for the shape
912 study entry of the published shape in form of string
914 # Example: see GEOM_TestAll.py
916 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
917 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
919 print "addToStudyInFather() failed"
921 return aShape.GetStudyEntry()
923 ## Unpublish object in study
925 # \param obj the object to be unpublished
926 def hideInStudy(self, obj):
928 Unpublish object in study
931 obj the object to be unpublished
933 ior = salome.orb.object_to_string(obj)
934 aSObject = self.myStudy.FindObjectIOR(ior)
935 if aSObject is not None:
936 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
937 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
938 drwAttribute.SetDrawable(False)
939 # hide references if any
940 vso = self.myStudy.FindDependances(aSObject);
942 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
943 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
944 drwAttribute.SetDrawable(False)
948 # end of l1_geomBuilder_auxiliary
951 ## @addtogroup l3_restore_ss
954 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
955 # To be used from python scripts out of addToStudy() (non-default usage)
956 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
957 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
958 # If this list is empty, all operation arguments will be published
959 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
960 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
961 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
962 # Do not publish sub-shapes in place of arguments, but only
963 # in place of sub-shapes of the first argument,
964 # because the whole shape corresponds to the first argument.
965 # Mainly to be used after transformations, but it also can be
966 # usefull after partition with one object shape, and some other
967 # operations, where only the first argument has to be considered.
968 # If theObject has only one argument shape, this flag is automatically
969 # considered as True, not regarding really passed value.
970 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
971 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
972 # \return list of published sub-shapes
974 # @ref tui_restore_prs_params "Example"
975 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
976 theInheritFirstArg=False, theAddPrefix=True):
978 Publish sub-shapes, standing for arguments and sub-shapes of arguments
979 To be used from python scripts out of geompy.addToStudy (non-default usage)
982 theObject published GEOM.GEOM_Object, arguments of which will be published
983 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
984 If this list is empty, all operation arguments will be published
985 theFindMethod method to search sub-shapes, corresponding to arguments and
986 their sub-shapes. Value from enumeration GEOM.find_shape_method.
987 theInheritFirstArg set properties of the first argument for theObject.
988 Do not publish sub-shapes in place of arguments, but only
989 in place of sub-shapes of the first argument,
990 because the whole shape corresponds to the first argument.
991 Mainly to be used after transformations, but it also can be
992 usefull after partition with one object shape, and some other
993 operations, where only the first argument has to be considered.
994 If theObject has only one argument shape, this flag is automatically
995 considered as True, not regarding really passed value.
996 theAddPrefix add prefix "from_" to names of restored sub-shapes,
997 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
999 list of published sub-shapes
1001 # Example: see GEOM_TestAll.py
1002 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1003 theFindMethod, theInheritFirstArg, theAddPrefix)
1005 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1006 # To be used from python scripts out of addToStudy() (non-default usage)
1007 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1008 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1009 # If this list is empty, all operation arguments will be published
1010 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1011 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1012 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1013 # Do not publish sub-shapes in place of arguments, but only
1014 # in place of sub-shapes of the first argument,
1015 # because the whole shape corresponds to the first argument.
1016 # Mainly to be used after transformations, but it also can be
1017 # usefull after partition with one object shape, and some other
1018 # operations, where only the first argument has to be considered.
1019 # If theObject has only one argument shape, this flag is automatically
1020 # considered as True, not regarding really passed value.
1021 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1022 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1023 # \return list of published sub-shapes
1025 # @ref tui_restore_prs_params "Example"
1026 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1027 theInheritFirstArg=False, theAddPrefix=True):
1029 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1030 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1033 theObject published GEOM.GEOM_Object, arguments of which will be published
1034 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1035 If this list is empty, all operation arguments will be published
1036 theFindMethod method to search sub-shapes, corresponding to arguments and
1037 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1038 theInheritFirstArg set properties of the first argument for theObject.
1039 Do not publish sub-shapes in place of arguments, but only
1040 in place of sub-shapes of the first argument,
1041 because the whole shape corresponds to the first argument.
1042 Mainly to be used after transformations, but it also can be
1043 usefull after partition with one object shape, and some other
1044 operations, where only the first argument has to be considered.
1045 If theObject has only one argument shape, this flag is automatically
1046 considered as True, not regarding really passed value.
1047 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1048 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1051 list of published sub-shapes
1053 # Example: see GEOM_TestAll.py
1054 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1055 theFindMethod, theInheritFirstArg, theAddPrefix)
1057 # end of l3_restore_ss
1060 ## @addtogroup l3_basic_go
1063 ## Create point by three coordinates.
1064 # @param theX The X coordinate of the point.
1065 # @param theY The Y coordinate of the point.
1066 # @param theZ The Z coordinate of the point.
1067 # @param theName Object name; when specified, this parameter is used
1068 # for result publication in the study. Otherwise, if automatic
1069 # publication is switched on, default value is used for result name.
1071 # @return New GEOM.GEOM_Object, containing the created point.
1073 # @ref tui_creation_point "Example"
1074 @ManageTransactions("BasicOp")
1075 def MakeVertex(self, theX, theY, theZ, theName=None):
1077 Create point by three coordinates.
1080 theX The X coordinate of the point.
1081 theY The Y coordinate of the point.
1082 theZ The Z coordinate of the point.
1083 theName Object name; when specified, this parameter is used
1084 for result publication in the study. Otherwise, if automatic
1085 publication is switched on, default value is used for result name.
1088 New GEOM.GEOM_Object, containing the created point.
1090 # Example: see GEOM_TestAll.py
1091 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1092 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1093 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1094 anObj.SetParameters(Parameters)
1095 self._autoPublish(anObj, theName, "vertex")
1098 ## Create a point, distant from the referenced point
1099 # on the given distances along the coordinate axes.
1100 # @param theReference The referenced point.
1101 # @param theX Displacement from the referenced point along OX axis.
1102 # @param theY Displacement from the referenced point along OY axis.
1103 # @param theZ Displacement from the referenced point along OZ axis.
1104 # @param theName Object name; when specified, this parameter is used
1105 # for result publication in the study. Otherwise, if automatic
1106 # publication is switched on, default value is used for result name.
1108 # @return New GEOM.GEOM_Object, containing the created point.
1110 # @ref tui_creation_point "Example"
1111 @ManageTransactions("BasicOp")
1112 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1114 Create a point, distant from the referenced point
1115 on the given distances along the coordinate axes.
1118 theReference The referenced point.
1119 theX Displacement from the referenced point along OX axis.
1120 theY Displacement from the referenced point along OY axis.
1121 theZ Displacement from the referenced point along OZ axis.
1122 theName Object name; when specified, this parameter is used
1123 for result publication in the study. Otherwise, if automatic
1124 publication is switched on, default value is used for result name.
1127 New GEOM.GEOM_Object, containing the created point.
1129 # Example: see GEOM_TestAll.py
1130 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1131 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1132 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1133 anObj.SetParameters(Parameters)
1134 self._autoPublish(anObj, theName, "vertex")
1137 ## Create a point, corresponding to the given parameter on the given curve.
1138 # @param theRefCurve The referenced curve.
1139 # @param theParameter Value of parameter on the referenced curve.
1140 # @param theName Object name; when specified, this parameter is used
1141 # for result publication in the study. Otherwise, if automatic
1142 # publication is switched on, default value is used for result name.
1144 # @return New GEOM.GEOM_Object, containing the created point.
1146 # @ref tui_creation_point "Example"
1147 @ManageTransactions("BasicOp")
1148 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1150 Create a point, corresponding to the given parameter on the given curve.
1153 theRefCurve The referenced curve.
1154 theParameter Value of parameter on the referenced curve.
1155 theName Object name; when specified, this parameter is used
1156 for result publication in the study. Otherwise, if automatic
1157 publication is switched on, default value is used for result name.
1160 New GEOM.GEOM_Object, containing the created point.
1163 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1165 # Example: see GEOM_TestAll.py
1166 theParameter, Parameters = ParseParameters(theParameter)
1167 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1168 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1169 anObj.SetParameters(Parameters)
1170 self._autoPublish(anObj, theName, "vertex")
1173 ## Create a point by projection give coordinates on the given curve
1174 # @param theRefCurve The referenced curve.
1175 # @param theX X-coordinate in 3D space
1176 # @param theY Y-coordinate in 3D space
1177 # @param theZ Z-coordinate in 3D space
1178 # @param theName Object name; when specified, this parameter is used
1179 # for result publication in the study. Otherwise, if automatic
1180 # publication is switched on, default value is used for result name.
1182 # @return New GEOM.GEOM_Object, containing the created point.
1184 # @ref tui_creation_point "Example"
1185 @ManageTransactions("BasicOp")
1186 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1188 Create a point by projection give coordinates on the given curve
1191 theRefCurve The referenced curve.
1192 theX X-coordinate in 3D space
1193 theY Y-coordinate in 3D space
1194 theZ Z-coordinate in 3D space
1195 theName Object name; when specified, this parameter is used
1196 for result publication in the study. Otherwise, if automatic
1197 publication is switched on, default value is used for result name.
1200 New GEOM.GEOM_Object, containing the created point.
1203 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1205 # Example: see GEOM_TestAll.py
1206 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1207 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1208 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1209 anObj.SetParameters(Parameters)
1210 self._autoPublish(anObj, theName, "vertex")
1213 ## Create a point, corresponding to the given length on the given curve.
1214 # @param theRefCurve The referenced curve.
1215 # @param theLength Length on the referenced curve. It can be negative.
1216 # @param theStartPoint Point allowing to choose the direction for the calculation
1217 # of the length. If None, start from the first point of theRefCurve.
1218 # @param theName Object name; when specified, this parameter is used
1219 # for result publication in the study. Otherwise, if automatic
1220 # publication is switched on, default value is used for result name.
1222 # @return New GEOM.GEOM_Object, containing the created point.
1224 # @ref tui_creation_point "Example"
1225 @ManageTransactions("BasicOp")
1226 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1228 Create a point, corresponding to the given length on the given curve.
1231 theRefCurve The referenced curve.
1232 theLength Length on the referenced curve. It can be negative.
1233 theStartPoint Point allowing to choose the direction for the calculation
1234 of the length. If None, start from the first point of theRefCurve.
1235 theName Object name; when specified, this parameter is used
1236 for result publication in the study. Otherwise, if automatic
1237 publication is switched on, default value is used for result name.
1240 New GEOM.GEOM_Object, containing the created point.
1242 # Example: see GEOM_TestAll.py
1243 theLength, Parameters = ParseParameters(theLength)
1244 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1245 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1246 anObj.SetParameters(Parameters)
1247 self._autoPublish(anObj, theName, "vertex")
1250 ## Create a point, corresponding to the given parameters on the
1252 # @param theRefSurf The referenced surface.
1253 # @param theUParameter Value of U-parameter on the referenced surface.
1254 # @param theVParameter Value of V-parameter on the referenced surface.
1255 # @param theName Object name; when specified, this parameter is used
1256 # for result publication in the study. Otherwise, if automatic
1257 # publication is switched on, default value is used for result name.
1259 # @return New GEOM.GEOM_Object, containing the created point.
1261 # @ref swig_MakeVertexOnSurface "Example"
1262 @ManageTransactions("BasicOp")
1263 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1265 Create a point, corresponding to the given parameters on the
1269 theRefSurf The referenced surface.
1270 theUParameter Value of U-parameter on the referenced surface.
1271 theVParameter Value of V-parameter on the referenced surface.
1272 theName Object name; when specified, this parameter is used
1273 for result publication in the study. Otherwise, if automatic
1274 publication is switched on, default value is used for result name.
1277 New GEOM.GEOM_Object, containing the created point.
1280 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1282 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1283 # Example: see GEOM_TestAll.py
1284 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1285 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1286 anObj.SetParameters(Parameters);
1287 self._autoPublish(anObj, theName, "vertex")
1290 ## Create a point by projection give coordinates on the given surface
1291 # @param theRefSurf The referenced surface.
1292 # @param theX X-coordinate in 3D space
1293 # @param theY Y-coordinate in 3D space
1294 # @param theZ Z-coordinate in 3D space
1295 # @param theName Object name; when specified, this parameter is used
1296 # for result publication in the study. Otherwise, if automatic
1297 # publication is switched on, default value is used for result name.
1299 # @return New GEOM.GEOM_Object, containing the created point.
1301 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1302 @ManageTransactions("BasicOp")
1303 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1305 Create a point by projection give coordinates on the given surface
1308 theRefSurf The referenced surface.
1309 theX X-coordinate in 3D space
1310 theY Y-coordinate in 3D space
1311 theZ Z-coordinate in 3D space
1312 theName Object name; when specified, this parameter is used
1313 for result publication in the study. Otherwise, if automatic
1314 publication is switched on, default value is used for result name.
1317 New GEOM.GEOM_Object, containing the created point.
1320 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1322 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1323 # Example: see GEOM_TestAll.py
1324 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1325 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1326 anObj.SetParameters(Parameters);
1327 self._autoPublish(anObj, theName, "vertex")
1330 ## Create a point, which lays on the given face.
1331 # The point will lay in arbitrary place of the face.
1332 # The only condition on it is a non-zero distance to the face boundary.
1333 # Such point can be used to uniquely identify the face inside any
1334 # shape in case, when the shape does not contain overlapped faces.
1335 # @param theFace The referenced face.
1336 # @param theName Object name; when specified, this parameter is used
1337 # for result publication in the study. Otherwise, if automatic
1338 # publication is switched on, default value is used for result name.
1340 # @return New GEOM.GEOM_Object, containing the created point.
1342 # @ref swig_MakeVertexInsideFace "Example"
1343 @ManageTransactions("BasicOp")
1344 def MakeVertexInsideFace (self, theFace, theName=None):
1346 Create a point, which lays on the given face.
1347 The point will lay in arbitrary place of the face.
1348 The only condition on it is a non-zero distance to the face boundary.
1349 Such point can be used to uniquely identify the face inside any
1350 shape in case, when the shape does not contain overlapped faces.
1353 theFace The referenced face.
1354 theName Object name; when specified, this parameter is used
1355 for result publication in the study. Otherwise, if automatic
1356 publication is switched on, default value is used for result name.
1359 New GEOM.GEOM_Object, containing the created point.
1362 p_on_face = geompy.MakeVertexInsideFace(Face)
1364 # Example: see GEOM_TestAll.py
1365 anObj = self.BasicOp.MakePointOnFace(theFace)
1366 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1367 self._autoPublish(anObj, theName, "vertex")
1370 ## Create a point on intersection of two lines.
1371 # @param theRefLine1, theRefLine2 The referenced lines.
1372 # @param theName Object name; when specified, this parameter is used
1373 # for result publication in the study. Otherwise, if automatic
1374 # publication is switched on, default value is used for result name.
1376 # @return New GEOM.GEOM_Object, containing the created point.
1378 # @ref swig_MakeVertexOnLinesIntersection "Example"
1379 @ManageTransactions("BasicOp")
1380 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1382 Create a point on intersection of two lines.
1385 theRefLine1, theRefLine2 The referenced lines.
1386 theName Object name; when specified, this parameter is used
1387 for result publication in the study. Otherwise, if automatic
1388 publication is switched on, default value is used for result name.
1391 New GEOM.GEOM_Object, containing the created point.
1393 # Example: see GEOM_TestAll.py
1394 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1395 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1396 self._autoPublish(anObj, theName, "vertex")
1399 ## Create a tangent, corresponding to the given parameter on the given curve.
1400 # @param theRefCurve The referenced curve.
1401 # @param theParameter Value of parameter on the referenced curve.
1402 # @param theName Object name; when specified, this parameter is used
1403 # for result publication in the study. Otherwise, if automatic
1404 # publication is switched on, default value is used for result name.
1406 # @return New GEOM.GEOM_Object, containing the created tangent.
1408 # @ref swig_MakeTangentOnCurve "Example"
1409 @ManageTransactions("BasicOp")
1410 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1412 Create a tangent, corresponding to the given parameter on the given curve.
1415 theRefCurve The referenced curve.
1416 theParameter Value of parameter on the referenced curve.
1417 theName Object name; when specified, this parameter is used
1418 for result publication in the study. Otherwise, if automatic
1419 publication is switched on, default value is used for result name.
1422 New GEOM.GEOM_Object, containing the created tangent.
1425 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1427 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1428 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1429 self._autoPublish(anObj, theName, "tangent")
1432 ## Create a tangent plane, corresponding to the given parameter on the given face.
1433 # @param theFace The face for which tangent plane should be built.
1434 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1435 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1436 # @param theTrimSize the size of plane.
1437 # @param theName Object name; when specified, this parameter is used
1438 # for result publication in the study. Otherwise, if automatic
1439 # publication is switched on, default value is used for result name.
1441 # @return New GEOM.GEOM_Object, containing the created tangent.
1443 # @ref swig_MakeTangentPlaneOnFace "Example"
1444 @ManageTransactions("BasicOp")
1445 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1447 Create a tangent plane, corresponding to the given parameter on the given face.
1450 theFace The face for which tangent plane should be built.
1451 theParameterV vertical value of the center point (0.0 - 1.0).
1452 theParameterU horisontal value of the center point (0.0 - 1.0).
1453 theTrimSize the size of plane.
1454 theName Object name; when specified, this parameter is used
1455 for result publication in the study. Otherwise, if automatic
1456 publication is switched on, default value is used for result name.
1459 New GEOM.GEOM_Object, containing the created tangent.
1462 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1464 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1465 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1466 self._autoPublish(anObj, theName, "tangent")
1469 ## Create a vector with the given components.
1470 # @param theDX X component of the vector.
1471 # @param theDY Y component of the vector.
1472 # @param theDZ Z component of the vector.
1473 # @param theName Object name; when specified, this parameter is used
1474 # for result publication in the study. Otherwise, if automatic
1475 # publication is switched on, default value is used for result name.
1477 # @return New GEOM.GEOM_Object, containing the created vector.
1479 # @ref tui_creation_vector "Example"
1480 @ManageTransactions("BasicOp")
1481 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1483 Create a vector with the given components.
1486 theDX X component of the vector.
1487 theDY Y component of the vector.
1488 theDZ Z component of the vector.
1489 theName Object name; when specified, this parameter is used
1490 for result publication in the study. Otherwise, if automatic
1491 publication is switched on, default value is used for result name.
1494 New GEOM.GEOM_Object, containing the created vector.
1496 # Example: see GEOM_TestAll.py
1497 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1498 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1499 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1500 anObj.SetParameters(Parameters)
1501 self._autoPublish(anObj, theName, "vector")
1504 ## Create a vector between two points.
1505 # @param thePnt1 Start point for the vector.
1506 # @param thePnt2 End point for the vector.
1507 # @param theName Object name; when specified, this parameter is used
1508 # for result publication in the study. Otherwise, if automatic
1509 # publication is switched on, default value is used for result name.
1511 # @return New GEOM.GEOM_Object, containing the created vector.
1513 # @ref tui_creation_vector "Example"
1514 @ManageTransactions("BasicOp")
1515 def MakeVector(self, thePnt1, thePnt2, theName=None):
1517 Create a vector between two points.
1520 thePnt1 Start point for the vector.
1521 thePnt2 End point for the vector.
1522 theName Object name; when specified, this parameter is used
1523 for result publication in the study. Otherwise, if automatic
1524 publication is switched on, default value is used for result name.
1527 New GEOM.GEOM_Object, containing the created vector.
1529 # Example: see GEOM_TestAll.py
1530 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1531 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1532 self._autoPublish(anObj, theName, "vector")
1535 ## Create a line, passing through the given point
1536 # and parrallel to the given direction
1537 # @param thePnt Point. The resulting line will pass through it.
1538 # @param theDir Direction. The resulting line will be parallel to it.
1539 # @param theName Object name; when specified, this parameter is used
1540 # for result publication in the study. Otherwise, if automatic
1541 # publication is switched on, default value is used for result name.
1543 # @return New GEOM.GEOM_Object, containing the created line.
1545 # @ref tui_creation_line "Example"
1546 @ManageTransactions("BasicOp")
1547 def MakeLine(self, thePnt, theDir, theName=None):
1549 Create a line, passing through the given point
1550 and parrallel to the given direction
1553 thePnt Point. The resulting line will pass through it.
1554 theDir Direction. The resulting line will be parallel to it.
1555 theName Object name; when specified, this parameter is used
1556 for result publication in the study. Otherwise, if automatic
1557 publication is switched on, default value is used for result name.
1560 New GEOM.GEOM_Object, containing the created line.
1562 # Example: see GEOM_TestAll.py
1563 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1564 RaiseIfFailed("MakeLine", self.BasicOp)
1565 self._autoPublish(anObj, theName, "line")
1568 ## Create a line, passing through the given points
1569 # @param thePnt1 First of two points, defining the line.
1570 # @param thePnt2 Second of two points, defining the line.
1571 # @param theName Object name; when specified, this parameter is used
1572 # for result publication in the study. Otherwise, if automatic
1573 # publication is switched on, default value is used for result name.
1575 # @return New GEOM.GEOM_Object, containing the created line.
1577 # @ref tui_creation_line "Example"
1578 @ManageTransactions("BasicOp")
1579 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1581 Create a line, passing through the given points
1584 thePnt1 First of two points, defining the line.
1585 thePnt2 Second of two points, defining the line.
1586 theName Object name; when specified, this parameter is used
1587 for result publication in the study. Otherwise, if automatic
1588 publication is switched on, default value is used for result name.
1591 New GEOM.GEOM_Object, containing the created line.
1593 # Example: see GEOM_TestAll.py
1594 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1595 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1596 self._autoPublish(anObj, theName, "line")
1599 ## Create a line on two faces intersection.
1600 # @param theFace1 First of two faces, defining the line.
1601 # @param theFace2 Second of two faces, defining the line.
1602 # @param theName Object name; when specified, this parameter is used
1603 # for result publication in the study. Otherwise, if automatic
1604 # publication is switched on, default value is used for result name.
1606 # @return New GEOM.GEOM_Object, containing the created line.
1608 # @ref swig_MakeLineTwoFaces "Example"
1609 @ManageTransactions("BasicOp")
1610 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1612 Create a line on two faces intersection.
1615 theFace1 First of two faces, defining the line.
1616 theFace2 Second of two faces, defining the line.
1617 theName Object name; when specified, this parameter is used
1618 for result publication in the study. Otherwise, if automatic
1619 publication is switched on, default value is used for result name.
1622 New GEOM.GEOM_Object, containing the created line.
1624 # Example: see GEOM_TestAll.py
1625 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1626 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1627 self._autoPublish(anObj, theName, "line")
1630 ## Create a plane, passing through the given point
1631 # and normal to the given vector.
1632 # @param thePnt Point, the plane has to pass through.
1633 # @param theVec Vector, defining the plane normal direction.
1634 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1635 # @param theName Object name; when specified, this parameter is used
1636 # for result publication in the study. Otherwise, if automatic
1637 # publication is switched on, default value is used for result name.
1639 # @return New GEOM.GEOM_Object, containing the created plane.
1641 # @ref tui_creation_plane "Example"
1642 @ManageTransactions("BasicOp")
1643 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1645 Create a plane, passing through the given point
1646 and normal to the given vector.
1649 thePnt Point, the plane has to pass through.
1650 theVec Vector, defining the plane normal direction.
1651 theTrimSize Half size of a side of quadrangle face, representing the plane.
1652 theName Object name; when specified, this parameter is used
1653 for result publication in the study. Otherwise, if automatic
1654 publication is switched on, default value is used for result name.
1657 New GEOM.GEOM_Object, containing the created plane.
1659 # Example: see GEOM_TestAll.py
1660 theTrimSize, Parameters = ParseParameters(theTrimSize);
1661 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1662 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1663 anObj.SetParameters(Parameters)
1664 self._autoPublish(anObj, theName, "plane")
1667 ## Create a plane, passing through the three given points
1668 # @param thePnt1 First of three points, defining the plane.
1669 # @param thePnt2 Second of three points, defining the plane.
1670 # @param thePnt3 Fird of three points, defining the plane.
1671 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1672 # @param theName Object name; when specified, this parameter is used
1673 # for result publication in the study. Otherwise, if automatic
1674 # publication is switched on, default value is used for result name.
1676 # @return New GEOM.GEOM_Object, containing the created plane.
1678 # @ref tui_creation_plane "Example"
1679 @ManageTransactions("BasicOp")
1680 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1682 Create a plane, passing through the three given points
1685 thePnt1 First of three points, defining the plane.
1686 thePnt2 Second of three points, defining the plane.
1687 thePnt3 Fird of three points, defining the plane.
1688 theTrimSize Half size of a side of quadrangle face, representing the plane.
1689 theName Object name; when specified, this parameter is used
1690 for result publication in the study. Otherwise, if automatic
1691 publication is switched on, default value is used for result name.
1694 New GEOM.GEOM_Object, containing the created plane.
1696 # Example: see GEOM_TestAll.py
1697 theTrimSize, Parameters = ParseParameters(theTrimSize);
1698 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1699 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1700 anObj.SetParameters(Parameters)
1701 self._autoPublish(anObj, theName, "plane")
1704 ## Create a plane, similar to the existing one, but with another size of representing face.
1705 # @param theFace Referenced plane or LCS(Marker).
1706 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1707 # @param theName Object name; when specified, this parameter is used
1708 # for result publication in the study. Otherwise, if automatic
1709 # publication is switched on, default value is used for result name.
1711 # @return New GEOM.GEOM_Object, containing the created plane.
1713 # @ref tui_creation_plane "Example"
1714 @ManageTransactions("BasicOp")
1715 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1717 Create a plane, similar to the existing one, but with another size of representing face.
1720 theFace Referenced plane or LCS(Marker).
1721 theTrimSize New half size of a side of quadrangle face, representing the plane.
1722 theName Object name; when specified, this parameter is used
1723 for result publication in the study. Otherwise, if automatic
1724 publication is switched on, default value is used for result name.
1727 New GEOM.GEOM_Object, containing the created plane.
1729 # Example: see GEOM_TestAll.py
1730 theTrimSize, Parameters = ParseParameters(theTrimSize);
1731 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1732 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1733 anObj.SetParameters(Parameters)
1734 self._autoPublish(anObj, theName, "plane")
1737 ## Create a plane, passing through the 2 vectors
1738 # with center in a start point of the first vector.
1739 # @param theVec1 Vector, defining center point and plane direction.
1740 # @param theVec2 Vector, defining the plane normal direction.
1741 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1742 # @param theName Object name; when specified, this parameter is used
1743 # for result publication in the study. Otherwise, if automatic
1744 # publication is switched on, default value is used for result name.
1746 # @return New GEOM.GEOM_Object, containing the created plane.
1748 # @ref tui_creation_plane "Example"
1749 @ManageTransactions("BasicOp")
1750 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1752 Create a plane, passing through the 2 vectors
1753 with center in a start point of the first vector.
1756 theVec1 Vector, defining center point and plane direction.
1757 theVec2 Vector, defining the plane normal direction.
1758 theTrimSize Half size of a side of quadrangle face, representing the plane.
1759 theName Object name; when specified, this parameter is used
1760 for result publication in the study. Otherwise, if automatic
1761 publication is switched on, default value is used for result name.
1764 New GEOM.GEOM_Object, containing the created plane.
1766 # Example: see GEOM_TestAll.py
1767 theTrimSize, Parameters = ParseParameters(theTrimSize);
1768 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1769 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1770 anObj.SetParameters(Parameters)
1771 self._autoPublish(anObj, theName, "plane")
1774 ## Create a plane, based on a Local coordinate system.
1775 # @param theLCS coordinate system, defining plane.
1776 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1777 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1778 # @param theName Object name; when specified, this parameter is used
1779 # for result publication in the study. Otherwise, if automatic
1780 # publication is switched on, default value is used for result name.
1782 # @return New GEOM.GEOM_Object, containing the created plane.
1784 # @ref tui_creation_plane "Example"
1785 @ManageTransactions("BasicOp")
1786 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1788 Create a plane, based on a Local coordinate system.
1791 theLCS coordinate system, defining plane.
1792 theTrimSize Half size of a side of quadrangle face, representing the plane.
1793 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1794 theName Object name; when specified, this parameter is used
1795 for result publication in the study. Otherwise, if automatic
1796 publication is switched on, default value is used for result name.
1799 New GEOM.GEOM_Object, containing the created plane.
1801 # Example: see GEOM_TestAll.py
1802 theTrimSize, Parameters = ParseParameters(theTrimSize);
1803 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1804 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1805 anObj.SetParameters(Parameters)
1806 self._autoPublish(anObj, theName, "plane")
1809 ## Create a local coordinate system.
1810 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1811 # @param XDX,XDY,XDZ Three components of OX direction
1812 # @param YDX,YDY,YDZ Three components of OY direction
1813 # @param theName Object name; when specified, this parameter is used
1814 # for result publication in the study. Otherwise, if automatic
1815 # publication is switched on, default value is used for result name.
1817 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1819 # @ref swig_MakeMarker "Example"
1820 @ManageTransactions("BasicOp")
1821 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1823 Create a local coordinate system.
1826 OX,OY,OZ Three coordinates of coordinate system origin.
1827 XDX,XDY,XDZ Three components of OX direction
1828 YDX,YDY,YDZ Three components of OY direction
1829 theName Object name; when specified, this parameter is used
1830 for result publication in the study. Otherwise, if automatic
1831 publication is switched on, default value is used for result name.
1834 New GEOM.GEOM_Object, containing the created coordinate system.
1836 # Example: see GEOM_TestAll.py
1837 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1838 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1839 RaiseIfFailed("MakeMarker", self.BasicOp)
1840 anObj.SetParameters(Parameters)
1841 self._autoPublish(anObj, theName, "lcs")
1844 ## Create a local coordinate system from shape.
1845 # @param theShape The initial shape to detect the coordinate system.
1846 # @param theName Object name; when specified, this parameter is used
1847 # for result publication in the study. Otherwise, if automatic
1848 # publication is switched on, default value is used for result name.
1850 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1852 # @ref tui_creation_lcs "Example"
1853 @ManageTransactions("BasicOp")
1854 def MakeMarkerFromShape(self, theShape, theName=None):
1856 Create a local coordinate system from shape.
1859 theShape The initial shape to detect the coordinate system.
1860 theName Object name; when specified, this parameter is used
1861 for result publication in the study. Otherwise, if automatic
1862 publication is switched on, default value is used for result name.
1865 New GEOM.GEOM_Object, containing the created coordinate system.
1867 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1868 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1869 self._autoPublish(anObj, theName, "lcs")
1872 ## Create a local coordinate system from point and two vectors.
1873 # @param theOrigin Point of coordinate system origin.
1874 # @param theXVec Vector of X direction
1875 # @param theYVec Vector of Y direction
1876 # @param theName Object name; when specified, this parameter is used
1877 # for result publication in the study. Otherwise, if automatic
1878 # publication is switched on, default value is used for result name.
1880 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1882 # @ref tui_creation_lcs "Example"
1883 @ManageTransactions("BasicOp")
1884 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1886 Create a local coordinate system from point and two vectors.
1889 theOrigin Point of coordinate system origin.
1890 theXVec Vector of X direction
1891 theYVec Vector of Y direction
1892 theName Object name; when specified, this parameter is used
1893 for result publication in the study. Otherwise, if automatic
1894 publication is switched on, default value is used for result name.
1897 New GEOM.GEOM_Object, containing the created coordinate system.
1900 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1901 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1902 self._autoPublish(anObj, theName, "lcs")
1905 # end of l3_basic_go
1908 ## @addtogroup l4_curves
1911 ## Create an arc of circle, passing through three given points.
1912 # @param thePnt1 Start point of the arc.
1913 # @param thePnt2 Middle point of the arc.
1914 # @param thePnt3 End point of the arc.
1915 # @param theName Object name; when specified, this parameter is used
1916 # for result publication in the study. Otherwise, if automatic
1917 # publication is switched on, default value is used for result name.
1919 # @return New GEOM.GEOM_Object, containing the created arc.
1921 # @ref swig_MakeArc "Example"
1922 @ManageTransactions("CurvesOp")
1923 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1925 Create an arc of circle, passing through three given points.
1928 thePnt1 Start point of the arc.
1929 thePnt2 Middle point of the arc.
1930 thePnt3 End point of the arc.
1931 theName Object name; when specified, this parameter is used
1932 for result publication in the study. Otherwise, if automatic
1933 publication is switched on, default value is used for result name.
1936 New GEOM.GEOM_Object, containing the created arc.
1938 # Example: see GEOM_TestAll.py
1939 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1940 RaiseIfFailed("MakeArc", self.CurvesOp)
1941 self._autoPublish(anObj, theName, "arc")
1944 ## Create an arc of circle from a center and 2 points.
1945 # @param thePnt1 Center of the arc
1946 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1947 # @param thePnt3 End point of the arc (Gives also a direction)
1948 # @param theSense Orientation of the arc
1949 # @param theName Object name; when specified, this parameter is used
1950 # for result publication in the study. Otherwise, if automatic
1951 # publication is switched on, default value is used for result name.
1953 # @return New GEOM.GEOM_Object, containing the created arc.
1955 # @ref swig_MakeArc "Example"
1956 @ManageTransactions("CurvesOp")
1957 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1959 Create an arc of circle from a center and 2 points.
1962 thePnt1 Center of the arc
1963 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1964 thePnt3 End point of the arc (Gives also a direction)
1965 theSense Orientation of the arc
1966 theName Object name; when specified, this parameter is used
1967 for result publication in the study. Otherwise, if automatic
1968 publication is switched on, default value is used for result name.
1971 New GEOM.GEOM_Object, containing the created arc.
1973 # Example: see GEOM_TestAll.py
1974 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1975 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1976 self._autoPublish(anObj, theName, "arc")
1979 ## Create an arc of ellipse, of center and two points.
1980 # @param theCenter Center of the arc.
1981 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1982 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1983 # @param theName Object name; when specified, this parameter is used
1984 # for result publication in the study. Otherwise, if automatic
1985 # publication is switched on, default value is used for result name.
1987 # @return New GEOM.GEOM_Object, containing the created arc.
1989 # @ref swig_MakeArc "Example"
1990 @ManageTransactions("CurvesOp")
1991 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1993 Create an arc of ellipse, of center and two points.
1996 theCenter Center of the arc.
1997 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1998 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1999 theName Object name; when specified, this parameter is used
2000 for result publication in the study. Otherwise, if automatic
2001 publication is switched on, default value is used for result name.
2004 New GEOM.GEOM_Object, containing the created arc.
2006 # Example: see GEOM_TestAll.py
2007 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2008 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2009 self._autoPublish(anObj, theName, "arc")
2012 ## Create a circle with given center, normal vector and radius.
2013 # @param thePnt Circle center.
2014 # @param theVec Vector, normal to the plane of the circle.
2015 # @param theR Circle radius.
2016 # @param theName Object name; when specified, this parameter is used
2017 # for result publication in the study. Otherwise, if automatic
2018 # publication is switched on, default value is used for result name.
2020 # @return New GEOM.GEOM_Object, containing the created circle.
2022 # @ref tui_creation_circle "Example"
2023 @ManageTransactions("CurvesOp")
2024 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2026 Create a circle with given center, normal vector and radius.
2029 thePnt Circle center.
2030 theVec Vector, normal to the plane of the circle.
2032 theName Object name; when specified, this parameter is used
2033 for result publication in the study. Otherwise, if automatic
2034 publication is switched on, default value is used for result name.
2037 New GEOM.GEOM_Object, containing the created circle.
2039 # Example: see GEOM_TestAll.py
2040 theR, Parameters = ParseParameters(theR)
2041 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2042 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2043 anObj.SetParameters(Parameters)
2044 self._autoPublish(anObj, theName, "circle")
2047 ## Create a circle with given radius.
2048 # Center of the circle will be in the origin of global
2049 # coordinate system and normal vector will be codirected with Z axis
2050 # @param theR Circle radius.
2051 # @param theName Object name; when specified, this parameter is used
2052 # for result publication in the study. Otherwise, if automatic
2053 # publication is switched on, default value is used for result name.
2055 # @return New GEOM.GEOM_Object, containing the created circle.
2056 @ManageTransactions("CurvesOp")
2057 def MakeCircleR(self, theR, theName=None):
2059 Create a circle with given radius.
2060 Center of the circle will be in the origin of global
2061 coordinate system and normal vector will be codirected with Z axis
2065 theName Object name; when specified, this parameter is used
2066 for result publication in the study. Otherwise, if automatic
2067 publication is switched on, default value is used for result name.
2070 New GEOM.GEOM_Object, containing the created circle.
2072 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2073 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2074 self._autoPublish(anObj, theName, "circle")
2077 ## Create a circle, passing through three given points
2078 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2079 # @param theName Object name; when specified, this parameter is used
2080 # for result publication in the study. Otherwise, if automatic
2081 # publication is switched on, default value is used for result name.
2083 # @return New GEOM.GEOM_Object, containing the created circle.
2085 # @ref tui_creation_circle "Example"
2086 @ManageTransactions("CurvesOp")
2087 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2089 Create a circle, passing through three given points
2092 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2093 theName Object name; when specified, this parameter is used
2094 for result publication in the study. Otherwise, if automatic
2095 publication is switched on, default value is used for result name.
2098 New GEOM.GEOM_Object, containing the created circle.
2100 # Example: see GEOM_TestAll.py
2101 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2102 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2103 self._autoPublish(anObj, theName, "circle")
2106 ## Create a circle, with given point1 as center,
2107 # passing through the point2 as radius and laying in the plane,
2108 # defined by all three given points.
2109 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2110 # @param theName Object name; when specified, this parameter is used
2111 # for result publication in the study. Otherwise, if automatic
2112 # publication is switched on, default value is used for result name.
2114 # @return New GEOM.GEOM_Object, containing the created circle.
2116 # @ref swig_MakeCircle "Example"
2117 @ManageTransactions("CurvesOp")
2118 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2120 Create a circle, with given point1 as center,
2121 passing through the point2 as radius and laying in the plane,
2122 defined by all three given points.
2125 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2126 theName Object name; when specified, this parameter is used
2127 for result publication in the study. Otherwise, if automatic
2128 publication is switched on, default value is used for result name.
2131 New GEOM.GEOM_Object, containing the created circle.
2133 # Example: see GEOM_example6.py
2134 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2135 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2136 self._autoPublish(anObj, theName, "circle")
2139 ## Create an ellipse with given center, normal vector and radiuses.
2140 # @param thePnt Ellipse center.
2141 # @param theVec Vector, normal to the plane of the ellipse.
2142 # @param theRMajor Major ellipse radius.
2143 # @param theRMinor Minor ellipse radius.
2144 # @param theVecMaj Vector, direction of the ellipse's main axis.
2145 # @param theName Object name; when specified, this parameter is used
2146 # for result publication in the study. Otherwise, if automatic
2147 # publication is switched on, default value is used for result name.
2149 # @return New GEOM.GEOM_Object, containing the created ellipse.
2151 # @ref tui_creation_ellipse "Example"
2152 @ManageTransactions("CurvesOp")
2153 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2155 Create an ellipse with given center, normal vector and radiuses.
2158 thePnt Ellipse center.
2159 theVec Vector, normal to the plane of the ellipse.
2160 theRMajor Major ellipse radius.
2161 theRMinor Minor ellipse radius.
2162 theVecMaj Vector, direction of the ellipse's main axis.
2163 theName Object name; when specified, this parameter is used
2164 for result publication in the study. Otherwise, if automatic
2165 publication is switched on, default value is used for result name.
2168 New GEOM.GEOM_Object, containing the created ellipse.
2170 # Example: see GEOM_TestAll.py
2171 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2172 if theVecMaj is not None:
2173 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2175 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2177 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2178 anObj.SetParameters(Parameters)
2179 self._autoPublish(anObj, theName, "ellipse")
2182 ## Create an ellipse with given radiuses.
2183 # Center of the ellipse will be in the origin of global
2184 # coordinate system and normal vector will be codirected with Z axis
2185 # @param theRMajor Major ellipse radius.
2186 # @param theRMinor Minor ellipse radius.
2187 # @param theName Object name; when specified, this parameter is used
2188 # for result publication in the study. Otherwise, if automatic
2189 # publication is switched on, default value is used for result name.
2191 # @return New GEOM.GEOM_Object, containing the created ellipse.
2192 @ManageTransactions("CurvesOp")
2193 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2195 Create an ellipse with given radiuses.
2196 Center of the ellipse will be in the origin of global
2197 coordinate system and normal vector will be codirected with Z axis
2200 theRMajor Major ellipse radius.
2201 theRMinor Minor ellipse radius.
2202 theName Object name; when specified, this parameter is used
2203 for result publication in the study. Otherwise, if automatic
2204 publication is switched on, default value is used for result name.
2207 New GEOM.GEOM_Object, containing the created ellipse.
2209 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2210 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2211 self._autoPublish(anObj, theName, "ellipse")
2214 ## Create a polyline on the set of points.
2215 # @param thePoints Sequence of points for the polyline.
2216 # @param theIsClosed If True, build a closed wire.
2217 # @param theName Object name; when specified, this parameter is used
2218 # for result publication in the study. Otherwise, if automatic
2219 # publication is switched on, default value is used for result name.
2221 # @return New GEOM.GEOM_Object, containing the created polyline.
2223 # @ref tui_creation_curve "Example"
2224 @ManageTransactions("CurvesOp")
2225 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2227 Create a polyline on the set of points.
2230 thePoints Sequence of points for the polyline.
2231 theIsClosed If True, build a closed wire.
2232 theName Object name; when specified, this parameter is used
2233 for result publication in the study. Otherwise, if automatic
2234 publication is switched on, default value is used for result name.
2237 New GEOM.GEOM_Object, containing the created polyline.
2239 # Example: see GEOM_TestAll.py
2240 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2241 RaiseIfFailed("MakePolyline", self.CurvesOp)
2242 self._autoPublish(anObj, theName, "polyline")
2245 ## Create bezier curve on the set of points.
2246 # @param thePoints Sequence of points for the bezier curve.
2247 # @param theIsClosed If True, build a closed curve.
2248 # @param theName Object name; when specified, this parameter is used
2249 # for result publication in the study. Otherwise, if automatic
2250 # publication is switched on, default value is used for result name.
2252 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2254 # @ref tui_creation_curve "Example"
2255 @ManageTransactions("CurvesOp")
2256 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2258 Create bezier curve on the set of points.
2261 thePoints Sequence of points for the bezier curve.
2262 theIsClosed If True, build a closed curve.
2263 theName Object name; when specified, this parameter is used
2264 for result publication in the study. Otherwise, if automatic
2265 publication is switched on, default value is used for result name.
2268 New GEOM.GEOM_Object, containing the created bezier curve.
2270 # Example: see GEOM_TestAll.py
2271 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2272 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2273 self._autoPublish(anObj, theName, "bezier")
2276 ## Create B-Spline curve on the set of points.
2277 # @param thePoints Sequence of points for the B-Spline curve.
2278 # @param theIsClosed If True, build a closed curve.
2279 # @param theDoReordering If TRUE, the algo does not follow the order of
2280 # \a thePoints but searches for the closest vertex.
2281 # @param theName Object name; when specified, this parameter is used
2282 # for result publication in the study. Otherwise, if automatic
2283 # publication is switched on, default value is used for result name.
2285 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2287 # @ref tui_creation_curve "Example"
2288 @ManageTransactions("CurvesOp")
2289 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2291 Create B-Spline curve on the set of points.
2294 thePoints Sequence of points for the B-Spline curve.
2295 theIsClosed If True, build a closed curve.
2296 theDoReordering If True, the algo does not follow the order of
2297 thePoints but searches for the closest vertex.
2298 theName Object name; when specified, this parameter is used
2299 for result publication in the study. Otherwise, if automatic
2300 publication is switched on, default value is used for result name.
2303 New GEOM.GEOM_Object, containing the created B-Spline curve.
2305 # Example: see GEOM_TestAll.py
2306 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2307 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2308 self._autoPublish(anObj, theName, "bspline")
2311 ## Create B-Spline curve on the set of points.
2312 # @param thePoints Sequence of points for the B-Spline curve.
2313 # @param theFirstVec Vector object, defining the curve direction at its first point.
2314 # @param theLastVec Vector object, defining the curve direction at its last point.
2315 # @param theName Object name; when specified, this parameter is used
2316 # for result publication in the study. Otherwise, if automatic
2317 # publication is switched on, default value is used for result name.
2319 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2321 # @ref tui_creation_curve "Example"
2322 @ManageTransactions("CurvesOp")
2323 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2325 Create B-Spline curve on the set of points.
2328 thePoints Sequence of points for the B-Spline curve.
2329 theFirstVec Vector object, defining the curve direction at its first point.
2330 theLastVec Vector object, defining the curve direction at its last point.
2331 theName Object name; when specified, this parameter is used
2332 for result publication in the study. Otherwise, if automatic
2333 publication is switched on, default value is used for result name.
2336 New GEOM.GEOM_Object, containing the created B-Spline curve.
2338 # Example: see GEOM_TestAll.py
2339 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2340 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2341 self._autoPublish(anObj, theName, "bspline")
2344 ## Creates a curve using the parametric definition of the basic points.
2345 # @param thexExpr parametric equation of the coordinates X.
2346 # @param theyExpr parametric equation of the coordinates Y.
2347 # @param thezExpr parametric equation of the coordinates Z.
2348 # @param theParamMin the minimal value of the parameter.
2349 # @param theParamMax the maximum value of the parameter.
2350 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2351 # @param theCurveType the type of the curve,
2352 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2353 # @param theNewMethod flag for switching to the new method if the flag is set to false a deprecated method is used which can lead to a bug.
2354 # @param theName Object name; when specified, this parameter is used
2355 # for result publication in the study. Otherwise, if automatic
2356 # publication is switched on, default value is used for result name.
2358 # @return New GEOM.GEOM_Object, containing the created curve.
2360 # @ref tui_creation_curve "Example"
2361 @ManageTransactions("CurvesOp")
2362 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2363 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2365 Creates a curve using the parametric definition of the basic points.
2368 thexExpr parametric equation of the coordinates X.
2369 theyExpr parametric equation of the coordinates Y.
2370 thezExpr parametric equation of the coordinates Z.
2371 theParamMin the minimal value of the parameter.
2372 theParamMax the maximum value of the parameter.
2373 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2374 theCurveType the type of the curve,
2375 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2376 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2377 method is used which can lead to a bug.
2378 theName Object name; when specified, this parameter is used
2379 for result publication in the study. Otherwise, if automatic
2380 publication is switched on, default value is used for result name.
2383 New GEOM.GEOM_Object, containing the created curve.
2385 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2387 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2389 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2390 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2391 anObj.SetParameters(Parameters)
2392 self._autoPublish(anObj, theName, "curve")
2395 ## Create an isoline curve on a face.
2396 # @param theFace the face for which an isoline is created.
2397 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2399 # @param theParameter the U parameter for U-isoline or V parameter
2401 # @param theName Object name; when specified, this parameter is used
2402 # for result publication in the study. Otherwise, if automatic
2403 # publication is switched on, default value is used for result name.
2405 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2406 # a compound of edges.
2408 # @ref tui_creation_curve "Example"
2409 @ManageTransactions("CurvesOp")
2410 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2412 Create an isoline curve on a face.
2415 theFace the face for which an isoline is created.
2416 IsUIsoline True for U-isoline creation; False for V-isoline
2418 theParameter the U parameter for U-isoline or V parameter
2420 theName Object name; when specified, this parameter is used
2421 for result publication in the study. Otherwise, if automatic
2422 publication is switched on, default value is used for result name.
2425 New GEOM.GEOM_Object, containing the created isoline edge or a
2428 # Example: see GEOM_TestAll.py
2429 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2430 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2432 self._autoPublish(anObj, theName, "U-Isoline")
2434 self._autoPublish(anObj, theName, "V-Isoline")
2440 ## @addtogroup l3_sketcher
2443 ## Create a sketcher (wire or face), following the textual description,
2444 # passed through <VAR>theCommand</VAR> argument. \n
2445 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2446 # Format of the description string have to be the following:
2448 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2451 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2453 # - "R angle" : Set the direction by angle
2454 # - "D dx dy" : Set the direction by DX & DY
2457 # - "TT x y" : Create segment by point at X & Y
2458 # - "T dx dy" : Create segment by point with DX & DY
2459 # - "L length" : Create segment by direction & Length
2460 # - "IX x" : Create segment by direction & Intersect. X
2461 # - "IY y" : Create segment by direction & Intersect. Y
2464 # - "C radius length" : Create arc by direction, radius and length(in degree)
2465 # - "AA x y": Create arc by point at X & Y
2466 # - "A dx dy" : Create arc by point with DX & DY
2467 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2468 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2469 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2470 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2473 # - "WW" : Close Wire (to finish)
2474 # - "WF" : Close Wire and build face (to finish)
2477 # - Flag1 (= reverse) is 0 or 2 ...
2478 # - if 0 the drawn arc is the one of lower angle (< Pi)
2479 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2482 # - Flag2 (= control tolerance) is 0 or 1 ...
2483 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2484 # - if 1 the wire is built only if the end point is on the arc
2485 # with a tolerance of 10^-7 on the distance else the creation fails
2487 # @param theCommand String, defining the sketcher in local
2488 # coordinates of the working plane.
2489 # @param theWorkingPlane Nine double values, defining origin,
2490 # OZ and OX directions of the working plane.
2491 # @param theName Object name; when specified, this parameter is used
2492 # for result publication in the study. Otherwise, if automatic
2493 # publication is switched on, default value is used for result name.
2495 # @return New GEOM.GEOM_Object, containing the created wire.
2497 # @ref tui_sketcher_page "Example"
2498 @ManageTransactions("CurvesOp")
2499 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2501 Create a sketcher (wire or face), following the textual description, passed
2502 through theCommand argument.
2503 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2504 Format of the description string have to be the following:
2505 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2507 - x1, y1 are coordinates of the first sketcher point (zero by default),
2509 - "R angle" : Set the direction by angle
2510 - "D dx dy" : Set the direction by DX & DY
2512 - "TT x y" : Create segment by point at X & Y
2513 - "T dx dy" : Create segment by point with DX & DY
2514 - "L length" : Create segment by direction & Length
2515 - "IX x" : Create segment by direction & Intersect. X
2516 - "IY y" : Create segment by direction & Intersect. Y
2518 - "C radius length" : Create arc by direction, radius and length(in degree)
2519 - "AA x y": Create arc by point at X & Y
2520 - "A dx dy" : Create arc by point with DX & DY
2521 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2522 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2523 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2524 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2526 - "WW" : Close Wire (to finish)
2527 - "WF" : Close Wire and build face (to finish)
2529 - Flag1 (= reverse) is 0 or 2 ...
2530 - if 0 the drawn arc is the one of lower angle (< Pi)
2531 - if 2 the drawn arc ius the one of greater angle (> Pi)
2533 - Flag2 (= control tolerance) is 0 or 1 ...
2534 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2535 - if 1 the wire is built only if the end point is on the arc
2536 with a tolerance of 10^-7 on the distance else the creation fails
2539 theCommand String, defining the sketcher in local
2540 coordinates of the working plane.
2541 theWorkingPlane Nine double values, defining origin,
2542 OZ and OX directions of the working plane.
2543 theName Object name; when specified, this parameter is used
2544 for result publication in the study. Otherwise, if automatic
2545 publication is switched on, default value is used for result name.
2548 New GEOM.GEOM_Object, containing the created wire.
2550 # Example: see GEOM_TestAll.py
2551 theCommand,Parameters = ParseSketcherCommand(theCommand)
2552 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2553 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2554 anObj.SetParameters(Parameters)
2555 self._autoPublish(anObj, theName, "wire")
2558 ## Create a sketcher (wire or face), following the textual description,
2559 # passed through <VAR>theCommand</VAR> argument. \n
2560 # For format of the description string see MakeSketcher() method.\n
2561 # @param theCommand String, defining the sketcher in local
2562 # coordinates of the working plane.
2563 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2564 # @param theName Object name; when specified, this parameter is used
2565 # for result publication in the study. Otherwise, if automatic
2566 # publication is switched on, default value is used for result name.
2568 # @return New GEOM.GEOM_Object, containing the created wire.
2570 # @ref tui_sketcher_page "Example"
2571 @ManageTransactions("CurvesOp")
2572 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2574 Create a sketcher (wire or face), following the textual description,
2575 passed through theCommand argument.
2576 For format of the description string see geompy.MakeSketcher() method.
2579 theCommand String, defining the sketcher in local
2580 coordinates of the working plane.
2581 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2582 theName Object name; when specified, this parameter is used
2583 for result publication in the study. Otherwise, if automatic
2584 publication is switched on, default value is used for result name.
2587 New GEOM.GEOM_Object, containing the created wire.
2589 theCommand,Parameters = ParseSketcherCommand(theCommand)
2590 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2591 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2592 anObj.SetParameters(Parameters)
2593 self._autoPublish(anObj, theName, "wire")
2596 ## Obtain a 2D sketcher interface
2597 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2598 def Sketcher2D (self):
2600 Obtain a 2D sketcher interface.
2603 sk = geompy.Sketcher2D()
2605 sk.addSegmentRelative(15, 70)
2606 sk.addSegmentPerpY(50)
2607 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2608 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2609 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2611 Sketch_1 = sk.wire(geomObj_1)
2613 sk = Sketcher2D (self)
2616 ## Create a sketcher wire, following the numerical description,
2617 # passed through <VAR>theCoordinates</VAR> argument. \n
2618 # @param theCoordinates double values, defining points to create a wire,
2620 # @param theName Object name; when specified, this parameter is used
2621 # for result publication in the study. Otherwise, if automatic
2622 # publication is switched on, default value is used for result name.
2624 # @return New GEOM.GEOM_Object, containing the created wire.
2626 # @ref tui_3dsketcher_page "Example"
2627 @ManageTransactions("CurvesOp")
2628 def Make3DSketcher(self, theCoordinates, theName=None):
2630 Create a sketcher wire, following the numerical description,
2631 passed through theCoordinates argument.
2634 theCoordinates double values, defining points to create a wire,
2636 theName Object name; when specified, this parameter is used
2637 for result publication in the study. Otherwise, if automatic
2638 publication is switched on, default value is used for result name.
2641 New GEOM_Object, containing the created wire.
2643 theCoordinates,Parameters = ParseParameters(theCoordinates)
2644 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2645 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2646 anObj.SetParameters(Parameters)
2647 self._autoPublish(anObj, theName, "wire")
2650 ## Obtain a 3D sketcher interface
2651 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2653 # @ref tui_3dsketcher_page "Example"
2654 def Sketcher3D (self):
2656 Obtain a 3D sketcher interface.
2659 sk = geompy.Sketcher3D()
2660 sk.addPointsAbsolute(0,0,0, 70,0,0)
2661 sk.addPointsRelative(0, 0, 130)
2662 sk.addPointAnglesLength("OXY", 50, 0, 100)
2663 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2665 a3D_Sketcher_1 = sk.wire()
2667 sk = Sketcher3D (self)
2670 ## Obtain a 2D polyline creation interface
2671 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2673 # @ref tui_3dsketcher_page "Example"
2674 def Polyline2D (self):
2676 Obtain a 2D polyline creation interface.
2679 pl = geompy.Polyline2D()
2680 pl.addSection("section 1", GEOM.Polyline, True)
2681 pl.addPoints(0, 0, 10, 0, 10, 10)
2682 pl.addSection("section 2", GEOM.Interpolation, False)
2683 pl.addPoints(20, 0, 30, 0, 30, 10)
2684 resultObj = pl.result(WorkingPlane)
2686 pl = Polyline2D (self)
2689 # end of l3_sketcher
2692 ## @addtogroup l3_3d_primitives
2695 ## Create a box by coordinates of two opposite vertices.
2697 # @param x1,y1,z1 double values, defining first point it.
2698 # @param x2,y2,z2 double values, defining first point it.
2699 # @param theName Object name; when specified, this parameter is used
2700 # for result publication in the study. Otherwise, if automatic
2701 # publication is switched on, default value is used for result name.
2703 # @return New GEOM.GEOM_Object, containing the created box.
2705 # @ref tui_creation_box "Example"
2706 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2708 Create a box by coordinates of two opposite vertices.
2711 x1,y1,z1 double values, defining first point.
2712 x2,y2,z2 double values, defining second point.
2713 theName Object name; when specified, this parameter is used
2714 for result publication in the study. Otherwise, if automatic
2715 publication is switched on, default value is used for result name.
2718 New GEOM.GEOM_Object, containing the created box.
2720 # Example: see GEOM_TestAll.py
2721 pnt1 = self.MakeVertex(x1,y1,z1)
2722 pnt2 = self.MakeVertex(x2,y2,z2)
2723 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2724 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2726 ## Create a box with specified dimensions along the coordinate axes
2727 # and with edges, parallel to the coordinate axes.
2728 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2729 # @param theDX Length of Box edges, parallel to OX axis.
2730 # @param theDY Length of Box edges, parallel to OY axis.
2731 # @param theDZ Length of Box edges, parallel to OZ axis.
2732 # @param theName Object name; when specified, this parameter is used
2733 # for result publication in the study. Otherwise, if automatic
2734 # publication is switched on, default value is used for result name.
2736 # @return New GEOM.GEOM_Object, containing the created box.
2738 # @ref tui_creation_box "Example"
2739 @ManageTransactions("PrimOp")
2740 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2742 Create a box with specified dimensions along the coordinate axes
2743 and with edges, parallel to the coordinate axes.
2744 Center of the box will be at point (DX/2, DY/2, DZ/2).
2747 theDX Length of Box edges, parallel to OX axis.
2748 theDY Length of Box edges, parallel to OY axis.
2749 theDZ Length of Box edges, parallel to OZ axis.
2750 theName Object name; when specified, this parameter is used
2751 for result publication in the study. Otherwise, if automatic
2752 publication is switched on, default value is used for result name.
2755 New GEOM.GEOM_Object, containing the created box.
2757 # Example: see GEOM_TestAll.py
2758 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2759 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2760 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2761 anObj.SetParameters(Parameters)
2762 self._autoPublish(anObj, theName, "box")
2765 ## Create a box with two specified opposite vertices,
2766 # and with edges, parallel to the coordinate axes
2767 # @param thePnt1 First of two opposite vertices.
2768 # @param thePnt2 Second of two opposite vertices.
2769 # @param theName Object name; when specified, this parameter is used
2770 # for result publication in the study. Otherwise, if automatic
2771 # publication is switched on, default value is used for result name.
2773 # @return New GEOM.GEOM_Object, containing the created box.
2775 # @ref tui_creation_box "Example"
2776 @ManageTransactions("PrimOp")
2777 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2779 Create a box with two specified opposite vertices,
2780 and with edges, parallel to the coordinate axes
2783 thePnt1 First of two opposite vertices.
2784 thePnt2 Second of two opposite vertices.
2785 theName Object name; when specified, this parameter is used
2786 for result publication in the study. Otherwise, if automatic
2787 publication is switched on, default value is used for result name.
2790 New GEOM.GEOM_Object, containing the created box.
2792 # Example: see GEOM_TestAll.py
2793 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2794 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2795 self._autoPublish(anObj, theName, "box")
2798 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2799 # @param theH height of Face.
2800 # @param theW width of Face.
2801 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2802 # @param theName Object name; when specified, this parameter is used
2803 # for result publication in the study. Otherwise, if automatic
2804 # publication is switched on, default value is used for result name.
2806 # @return New GEOM.GEOM_Object, containing the created face.
2808 # @ref tui_creation_face "Example"
2809 @ManageTransactions("PrimOp")
2810 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2812 Create a face with specified dimensions with edges parallel to coordinate axes.
2815 theH height of Face.
2817 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2818 theName Object name; when specified, this parameter is used
2819 for result publication in the study. Otherwise, if automatic
2820 publication is switched on, default value is used for result name.
2823 New GEOM.GEOM_Object, containing the created face.
2825 # Example: see GEOM_TestAll.py
2826 theH,theW,Parameters = ParseParameters(theH, theW)
2827 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2828 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2829 anObj.SetParameters(Parameters)
2830 self._autoPublish(anObj, theName, "rectangle")
2833 ## Create a face from another plane and two sizes,
2834 # vertical size and horisontal size.
2835 # @param theObj Normale vector to the creating face or
2837 # @param theH Height (vertical size).
2838 # @param theW Width (horisontal size).
2839 # @param theName Object name; when specified, this parameter is used
2840 # for result publication in the study. Otherwise, if automatic
2841 # publication is switched on, default value is used for result name.
2843 # @return New GEOM.GEOM_Object, containing the created face.
2845 # @ref tui_creation_face "Example"
2846 @ManageTransactions("PrimOp")
2847 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2849 Create a face from another plane and two sizes,
2850 vertical size and horisontal size.
2853 theObj Normale vector to the creating face or
2855 theH Height (vertical size).
2856 theW Width (horisontal size).
2857 theName Object name; when specified, this parameter is used
2858 for result publication in the study. Otherwise, if automatic
2859 publication is switched on, default value is used for result name.
2862 New GEOM_Object, containing the created face.
2864 # Example: see GEOM_TestAll.py
2865 theH,theW,Parameters = ParseParameters(theH, theW)
2866 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2867 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2868 anObj.SetParameters(Parameters)
2869 self._autoPublish(anObj, theName, "rectangle")
2872 ## Create a disk with given center, normal vector and radius.
2873 # @param thePnt Disk center.
2874 # @param theVec Vector, normal to the plane of the disk.
2875 # @param theR Disk radius.
2876 # @param theName Object name; when specified, this parameter is used
2877 # for result publication in the study. Otherwise, if automatic
2878 # publication is switched on, default value is used for result name.
2880 # @return New GEOM.GEOM_Object, containing the created disk.
2882 # @ref tui_creation_disk "Example"
2883 @ManageTransactions("PrimOp")
2884 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2886 Create a disk with given center, normal vector and radius.
2890 theVec Vector, normal to the plane of the disk.
2892 theName Object name; when specified, this parameter is used
2893 for result publication in the study. Otherwise, if automatic
2894 publication is switched on, default value is used for result name.
2897 New GEOM.GEOM_Object, containing the created disk.
2899 # Example: see GEOM_TestAll.py
2900 theR,Parameters = ParseParameters(theR)
2901 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2902 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2903 anObj.SetParameters(Parameters)
2904 self._autoPublish(anObj, theName, "disk")
2907 ## Create a disk, passing through three given points
2908 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2909 # @param theName Object name; when specified, this parameter is used
2910 # for result publication in the study. Otherwise, if automatic
2911 # publication is switched on, default value is used for result name.
2913 # @return New GEOM.GEOM_Object, containing the created disk.
2915 # @ref tui_creation_disk "Example"
2916 @ManageTransactions("PrimOp")
2917 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2919 Create a disk, passing through three given points
2922 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2923 theName Object name; when specified, this parameter is used
2924 for result publication in the study. Otherwise, if automatic
2925 publication is switched on, default value is used for result name.
2928 New GEOM.GEOM_Object, containing the created disk.
2930 # Example: see GEOM_TestAll.py
2931 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2932 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2933 self._autoPublish(anObj, theName, "disk")
2936 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2937 # @param theR Radius of Face.
2938 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2939 # @param theName Object name; when specified, this parameter is used
2940 # for result publication in the study. Otherwise, if automatic
2941 # publication is switched on, default value is used for result name.
2943 # @return New GEOM.GEOM_Object, containing the created disk.
2945 # @ref tui_creation_face "Example"
2946 @ManageTransactions("PrimOp")
2947 def MakeDiskR(self, theR, theOrientation, theName=None):
2949 Create a disk with specified dimensions along OX-OY coordinate axes.
2952 theR Radius of Face.
2953 theOrientation set the orientation belong axis OXY or OYZ or OZX
2954 theName Object name; when specified, this parameter is used
2955 for result publication in the study. Otherwise, if automatic
2956 publication is switched on, default value is used for result name.
2959 New GEOM.GEOM_Object, containing the created disk.
2962 Disk3 = geompy.MakeDiskR(100., 1)
2964 # Example: see GEOM_TestAll.py
2965 theR,Parameters = ParseParameters(theR)
2966 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2967 RaiseIfFailed("MakeDiskR", self.PrimOp)
2968 anObj.SetParameters(Parameters)
2969 self._autoPublish(anObj, theName, "disk")
2972 ## Create a cylinder with given base point, axis, radius and height.
2973 # @param thePnt Central point of cylinder base.
2974 # @param theAxis Cylinder axis.
2975 # @param theR Cylinder radius.
2976 # @param theH Cylinder height.
2977 # @param theName Object name; when specified, this parameter is used
2978 # for result publication in the study. Otherwise, if automatic
2979 # publication is switched on, default value is used for result name.
2981 # @return New GEOM.GEOM_Object, containing the created cylinder.
2983 # @ref tui_creation_cylinder "Example"
2984 @ManageTransactions("PrimOp")
2985 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2987 Create a cylinder with given base point, axis, radius and height.
2990 thePnt Central point of cylinder base.
2991 theAxis Cylinder axis.
2992 theR Cylinder radius.
2993 theH Cylinder height.
2994 theName Object name; when specified, this parameter is used
2995 for result publication in the study. Otherwise, if automatic
2996 publication is switched on, default value is used for result name.
2999 New GEOM.GEOM_Object, containing the created cylinder.
3001 # Example: see GEOM_TestAll.py
3002 theR,theH,Parameters = ParseParameters(theR, theH)
3003 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3004 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3005 anObj.SetParameters(Parameters)
3006 self._autoPublish(anObj, theName, "cylinder")
3009 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3010 # @param thePnt Central point of cylinder base.
3011 # @param theAxis Cylinder axis.
3012 # @param theR Cylinder radius.
3013 # @param theH Cylinder height.
3014 # @param theA Cylinder angle in radians.
3015 # @param theName Object name; when specified, this parameter is used
3016 # for result publication in the study. Otherwise, if automatic
3017 # publication is switched on, default value is used for result name.
3019 # @return New GEOM.GEOM_Object, containing the created cylinder.
3021 # @ref tui_creation_cylinder "Example"
3022 @ManageTransactions("PrimOp")
3023 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3025 Create a portion of cylinder with given base point, axis, radius, height and angle.
3028 thePnt Central point of cylinder base.
3029 theAxis Cylinder axis.
3030 theR Cylinder radius.
3031 theH Cylinder height.
3032 theA Cylinder angle in radians.
3033 theName Object name; when specified, this parameter is used
3034 for result publication in the study. Otherwise, if automatic
3035 publication is switched on, default value is used for result name.
3038 New GEOM.GEOM_Object, containing the created cylinder.
3040 # Example: see GEOM_TestAll.py
3042 if isinstance(theA,str):
3044 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3046 theA = theA*math.pi/180.
3047 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3048 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3049 anObj.SetParameters(Parameters)
3050 self._autoPublish(anObj, theName, "cylinder")
3053 ## Create a cylinder with given radius and height at
3054 # the origin of coordinate system. Axis of the cylinder
3055 # will be collinear to the OZ axis of the coordinate system.
3056 # @param theR Cylinder radius.
3057 # @param theH Cylinder height.
3058 # @param theName Object name; when specified, this parameter is used
3059 # for result publication in the study. Otherwise, if automatic
3060 # publication is switched on, default value is used for result name.
3062 # @return New GEOM.GEOM_Object, containing the created cylinder.
3064 # @ref tui_creation_cylinder "Example"
3065 @ManageTransactions("PrimOp")
3066 def MakeCylinderRH(self, theR, theH, theName=None):
3068 Create a cylinder with given radius and height at
3069 the origin of coordinate system. Axis of the cylinder
3070 will be collinear to the OZ axis of the coordinate system.
3073 theR Cylinder radius.
3074 theH Cylinder height.
3075 theName Object name; when specified, this parameter is used
3076 for result publication in the study. Otherwise, if automatic
3077 publication is switched on, default value is used for result name.
3080 New GEOM.GEOM_Object, containing the created cylinder.
3082 # Example: see GEOM_TestAll.py
3083 theR,theH,Parameters = ParseParameters(theR, theH)
3084 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3085 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3086 anObj.SetParameters(Parameters)
3087 self._autoPublish(anObj, theName, "cylinder")
3090 ## Create a portion of cylinder with given radius, height and angle at
3091 # the origin of coordinate system. Axis of the cylinder
3092 # will be collinear to the OZ axis of the coordinate system.
3093 # @param theR Cylinder radius.
3094 # @param theH Cylinder height.
3095 # @param theA Cylinder angle in radians.
3096 # @param theName Object name; when specified, this parameter is used
3097 # for result publication in the study. Otherwise, if automatic
3098 # publication is switched on, default value is used for result name.
3100 # @return New GEOM.GEOM_Object, containing the created cylinder.
3102 # @ref tui_creation_cylinder "Example"
3103 @ManageTransactions("PrimOp")
3104 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3106 Create a portion of cylinder with given radius, height and angle at
3107 the origin of coordinate system. Axis of the cylinder
3108 will be collinear to the OZ axis of the coordinate system.
3111 theR Cylinder radius.
3112 theH Cylinder height.
3113 theA Cylinder angle in radians.
3114 theName Object name; when specified, this parameter is used
3115 for result publication in the study. Otherwise, if automatic
3116 publication is switched on, default value is used for result name.
3119 New GEOM.GEOM_Object, containing the created cylinder.
3121 # Example: see GEOM_TestAll.py
3123 if isinstance(theA,str):
3125 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3127 theA = theA*math.pi/180.
3128 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3129 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3130 anObj.SetParameters(Parameters)
3131 self._autoPublish(anObj, theName, "cylinder")
3134 ## Create a sphere with given center and radius.
3135 # @param thePnt Sphere center.
3136 # @param theR Sphere radius.
3137 # @param theName Object name; when specified, this parameter is used
3138 # for result publication in the study. Otherwise, if automatic
3139 # publication is switched on, default value is used for result name.
3141 # @return New GEOM.GEOM_Object, containing the created sphere.
3143 # @ref tui_creation_sphere "Example"
3144 @ManageTransactions("PrimOp")
3145 def MakeSpherePntR(self, thePnt, theR, theName=None):
3147 Create a sphere with given center and radius.
3150 thePnt Sphere center.
3152 theName Object name; when specified, this parameter is used
3153 for result publication in the study. Otherwise, if automatic
3154 publication is switched on, default value is used for result name.
3157 New GEOM.GEOM_Object, containing the created sphere.
3159 # Example: see GEOM_TestAll.py
3160 theR,Parameters = ParseParameters(theR)
3161 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3162 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3163 anObj.SetParameters(Parameters)
3164 self._autoPublish(anObj, theName, "sphere")
3167 ## Create a sphere with given center and radius.
3168 # @param x,y,z Coordinates of sphere center.
3169 # @param theR Sphere radius.
3170 # @param theName Object name; when specified, this parameter is used
3171 # for result publication in the study. Otherwise, if automatic
3172 # publication is switched on, default value is used for result name.
3174 # @return New GEOM.GEOM_Object, containing the created sphere.
3176 # @ref tui_creation_sphere "Example"
3177 def MakeSphere(self, x, y, z, theR, theName=None):
3179 Create a sphere with given center and radius.
3182 x,y,z Coordinates of sphere center.
3184 theName Object name; when specified, this parameter is used
3185 for result publication in the study. Otherwise, if automatic
3186 publication is switched on, default value is used for result name.
3189 New GEOM.GEOM_Object, containing the created sphere.
3191 # Example: see GEOM_TestAll.py
3192 point = self.MakeVertex(x, y, z)
3193 # note: auto-publishing is done in self.MakeSpherePntR()
3194 anObj = self.MakeSpherePntR(point, theR, theName)
3197 ## Create a sphere with given radius at the origin of coordinate system.
3198 # @param theR Sphere radius.
3199 # @param theName Object name; when specified, this parameter is used
3200 # for result publication in the study. Otherwise, if automatic
3201 # publication is switched on, default value is used for result name.
3203 # @return New GEOM.GEOM_Object, containing the created sphere.
3205 # @ref tui_creation_sphere "Example"
3206 @ManageTransactions("PrimOp")
3207 def MakeSphereR(self, theR, theName=None):
3209 Create a sphere with given radius at the origin of coordinate system.
3213 theName Object name; when specified, this parameter is used
3214 for result publication in the study. Otherwise, if automatic
3215 publication is switched on, default value is used for result name.
3218 New GEOM.GEOM_Object, containing the created sphere.
3220 # Example: see GEOM_TestAll.py
3221 theR,Parameters = ParseParameters(theR)
3222 anObj = self.PrimOp.MakeSphereR(theR)
3223 RaiseIfFailed("MakeSphereR", self.PrimOp)
3224 anObj.SetParameters(Parameters)
3225 self._autoPublish(anObj, theName, "sphere")
3228 ## Create a cone with given base point, axis, height and radiuses.
3229 # @param thePnt Central point of the first cone base.
3230 # @param theAxis Cone axis.
3231 # @param theR1 Radius of the first cone base.
3232 # @param theR2 Radius of the second cone base.
3233 # \note If both radiuses are non-zero, the cone will be truncated.
3234 # \note If the radiuses are equal, a cylinder will be created instead.
3235 # @param theH Cone height.
3236 # @param theName Object name; when specified, this parameter is used
3237 # for result publication in the study. Otherwise, if automatic
3238 # publication is switched on, default value is used for result name.
3240 # @return New GEOM.GEOM_Object, containing the created cone.
3242 # @ref tui_creation_cone "Example"
3243 @ManageTransactions("PrimOp")
3244 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3246 Create a cone with given base point, axis, height and radiuses.
3249 thePnt Central point of the first cone base.
3251 theR1 Radius of the first cone base.
3252 theR2 Radius of the second cone base.
3254 theName Object name; when specified, this parameter is used
3255 for result publication in the study. Otherwise, if automatic
3256 publication is switched on, default value is used for result name.
3259 If both radiuses are non-zero, the cone will be truncated.
3260 If the radiuses are equal, a cylinder will be created instead.
3263 New GEOM.GEOM_Object, containing the created cone.
3265 # Example: see GEOM_TestAll.py
3266 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3267 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3268 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3269 anObj.SetParameters(Parameters)
3270 self._autoPublish(anObj, theName, "cone")
3273 ## Create a cone with given height and radiuses at
3274 # the origin of coordinate system. Axis of the cone will
3275 # be collinear to the OZ axis of the coordinate system.
3276 # @param theR1 Radius of the first cone base.
3277 # @param theR2 Radius of the second cone base.
3278 # \note If both radiuses are non-zero, the cone will be truncated.
3279 # \note If the radiuses are equal, a cylinder will be created instead.
3280 # @param theH Cone height.
3281 # @param theName Object name; when specified, this parameter is used
3282 # for result publication in the study. Otherwise, if automatic
3283 # publication is switched on, default value is used for result name.
3285 # @return New GEOM.GEOM_Object, containing the created cone.
3287 # @ref tui_creation_cone "Example"
3288 @ManageTransactions("PrimOp")
3289 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3291 Create a cone with given height and radiuses at
3292 the origin of coordinate system. Axis of the cone will
3293 be collinear to the OZ axis of the coordinate system.
3296 theR1 Radius of the first cone base.
3297 theR2 Radius of the second cone base.
3299 theName Object name; when specified, this parameter is used
3300 for result publication in the study. Otherwise, if automatic
3301 publication is switched on, default value is used for result name.
3304 If both radiuses are non-zero, the cone will be truncated.
3305 If the radiuses are equal, a cylinder will be created instead.
3308 New GEOM.GEOM_Object, containing the created cone.
3310 # Example: see GEOM_TestAll.py
3311 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3312 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3313 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3314 anObj.SetParameters(Parameters)
3315 self._autoPublish(anObj, theName, "cone")
3318 ## Create a torus with given center, normal vector and radiuses.
3319 # @param thePnt Torus central point.
3320 # @param theVec Torus axis of symmetry.
3321 # @param theRMajor Torus major radius.
3322 # @param theRMinor Torus minor radius.
3323 # @param theName Object name; when specified, this parameter is used
3324 # for result publication in the study. Otherwise, if automatic
3325 # publication is switched on, default value is used for result name.
3327 # @return New GEOM.GEOM_Object, containing the created torus.
3329 # @ref tui_creation_torus "Example"
3330 @ManageTransactions("PrimOp")
3331 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3333 Create a torus with given center, normal vector and radiuses.
3336 thePnt Torus central point.
3337 theVec Torus axis of symmetry.
3338 theRMajor Torus major radius.
3339 theRMinor Torus minor radius.
3340 theName Object name; when specified, this parameter is used
3341 for result publication in the study. Otherwise, if automatic
3342 publication is switched on, default value is used for result name.
3345 New GEOM.GEOM_Object, containing the created torus.
3347 # Example: see GEOM_TestAll.py
3348 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3349 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3350 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3351 anObj.SetParameters(Parameters)
3352 self._autoPublish(anObj, theName, "torus")
3355 ## Create a torus with given radiuses at the origin of coordinate system.
3356 # @param theRMajor Torus major radius.
3357 # @param theRMinor Torus minor radius.
3358 # @param theName Object name; when specified, this parameter is used
3359 # for result publication in the study. Otherwise, if automatic
3360 # publication is switched on, default value is used for result name.
3362 # @return New GEOM.GEOM_Object, containing the created torus.
3364 # @ref tui_creation_torus "Example"
3365 @ManageTransactions("PrimOp")
3366 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3368 Create a torus with given radiuses at the origin of coordinate system.
3371 theRMajor Torus major radius.
3372 theRMinor Torus minor radius.
3373 theName Object name; when specified, this parameter is used
3374 for result publication in the study. Otherwise, if automatic
3375 publication is switched on, default value is used for result name.
3378 New GEOM.GEOM_Object, containing the created torus.
3380 # Example: see GEOM_TestAll.py
3381 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3382 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3383 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3384 anObj.SetParameters(Parameters)
3385 self._autoPublish(anObj, theName, "torus")
3388 # end of l3_3d_primitives
3391 ## @addtogroup l3_complex
3394 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3395 # @param theBase Base shape to be extruded.
3396 # @param thePoint1 First end of extrusion vector.
3397 # @param thePoint2 Second end of extrusion vector.
3398 # @param theScaleFactor Use it to make prism with scaled second base.
3399 # Nagative value means not scaled second base.
3400 # @param theName Object name; when specified, this parameter is used
3401 # for result publication in the study. Otherwise, if automatic
3402 # publication is switched on, default value is used for result name.
3404 # @return New GEOM.GEOM_Object, containing the created prism.
3406 # @ref tui_creation_prism "Example"
3407 @ManageTransactions("PrimOp")
3408 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3410 Create a shape by extrusion of the base shape along a vector, defined by two points.
3413 theBase Base shape to be extruded.
3414 thePoint1 First end of extrusion vector.
3415 thePoint2 Second end of extrusion vector.
3416 theScaleFactor Use it to make prism with scaled second base.
3417 Nagative value means not scaled second base.
3418 theName Object name; when specified, this parameter is used
3419 for result publication in the study. Otherwise, if automatic
3420 publication is switched on, default value is used for result name.
3423 New GEOM.GEOM_Object, containing the created prism.
3425 # Example: see GEOM_TestAll.py
3428 if theScaleFactor > 0:
3429 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3430 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3432 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3433 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3434 anObj.SetParameters(Parameters)
3435 self._autoPublish(anObj, theName, "prism")
3438 ## Create a shape by extrusion of the base shape along a
3439 # vector, defined by two points, in 2 Ways (forward/backward).
3440 # @param theBase Base shape to be extruded.
3441 # @param thePoint1 First end of extrusion vector.
3442 # @param thePoint2 Second end of extrusion vector.
3443 # @param theName Object name; when specified, this parameter is used
3444 # for result publication in the study. Otherwise, if automatic
3445 # publication is switched on, default value is used for result name.
3447 # @return New GEOM.GEOM_Object, containing the created prism.
3449 # @ref tui_creation_prism "Example"
3450 @ManageTransactions("PrimOp")
3451 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3453 Create a shape by extrusion of the base shape along a
3454 vector, defined by two points, in 2 Ways (forward/backward).
3457 theBase Base shape to be extruded.
3458 thePoint1 First end of extrusion vector.
3459 thePoint2 Second end of extrusion vector.
3460 theName Object name; when specified, this parameter is used
3461 for result publication in the study. Otherwise, if automatic
3462 publication is switched on, default value is used for result name.
3465 New GEOM.GEOM_Object, containing the created prism.
3467 # Example: see GEOM_TestAll.py
3468 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3469 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3470 self._autoPublish(anObj, theName, "prism")
3473 ## Create a shape by extrusion of the base shape along the vector,
3474 # i.e. all the space, transfixed by the base shape during its translation
3475 # along the vector on the given distance.
3476 # @param theBase Base shape to be extruded.
3477 # @param theVec Direction of extrusion.
3478 # @param theH Prism dimension along theVec.
3479 # @param theScaleFactor Use it to make prism with scaled second base.
3480 # Negative value means not scaled second base.
3481 # @param theName Object name; when specified, this parameter is used
3482 # for result publication in the study. Otherwise, if automatic
3483 # publication is switched on, default value is used for result name.
3485 # @return New GEOM.GEOM_Object, containing the created prism.
3487 # @ref tui_creation_prism "Example"
3488 @ManageTransactions("PrimOp")
3489 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3491 Create a shape by extrusion of the base shape along the vector,
3492 i.e. all the space, transfixed by the base shape during its translation
3493 along the vector on the given distance.
3496 theBase Base shape to be extruded.
3497 theVec Direction of extrusion.
3498 theH Prism dimension along theVec.
3499 theScaleFactor Use it to make prism with scaled second base.
3500 Negative value means not scaled second base.
3501 theName Object name; when specified, this parameter is used
3502 for result publication in the study. Otherwise, if automatic
3503 publication is switched on, default value is used for result name.
3506 New GEOM.GEOM_Object, containing the created prism.
3508 # Example: see GEOM_TestAll.py
3511 if theScaleFactor > 0:
3512 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3513 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3515 theH,Parameters = ParseParameters(theH)
3516 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3517 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3518 anObj.SetParameters(Parameters)
3519 self._autoPublish(anObj, theName, "prism")
3522 ## Create a shape by extrusion of the base shape along the vector,
3523 # i.e. all the space, transfixed by the base shape during its translation
3524 # along the vector on the given distance in 2 Ways (forward/backward).
3525 # @param theBase Base shape to be extruded.
3526 # @param theVec Direction of extrusion.
3527 # @param theH Prism dimension along theVec in forward direction.
3528 # @param theName Object name; when specified, this parameter is used
3529 # for result publication in the study. Otherwise, if automatic
3530 # publication is switched on, default value is used for result name.
3532 # @return New GEOM.GEOM_Object, containing the created prism.
3534 # @ref tui_creation_prism "Example"
3535 @ManageTransactions("PrimOp")
3536 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3538 Create a shape by extrusion of the base shape along the vector,
3539 i.e. all the space, transfixed by the base shape during its translation
3540 along the vector on the given distance in 2 Ways (forward/backward).
3543 theBase Base shape to be extruded.
3544 theVec Direction of extrusion.
3545 theH Prism dimension along theVec in forward direction.
3546 theName Object name; when specified, this parameter is used
3547 for result publication in the study. Otherwise, if automatic
3548 publication is switched on, default value is used for result name.
3551 New GEOM.GEOM_Object, containing the created prism.
3553 # Example: see GEOM_TestAll.py
3554 theH,Parameters = ParseParameters(theH)
3555 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3556 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3557 anObj.SetParameters(Parameters)
3558 self._autoPublish(anObj, theName, "prism")
3561 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3562 # @param theBase Base shape to be extruded.
3563 # @param theDX, theDY, theDZ Directions of extrusion.
3564 # @param theScaleFactor Use it to make prism with scaled second base.
3565 # Nagative value means not scaled second base.
3566 # @param theName Object name; when specified, this parameter is used
3567 # for result publication in the study. Otherwise, if automatic
3568 # publication is switched on, default value is used for result name.
3570 # @return New GEOM.GEOM_Object, containing the created prism.
3572 # @ref tui_creation_prism "Example"
3573 @ManageTransactions("PrimOp")
3574 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3576 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3579 theBase Base shape to be extruded.
3580 theDX, theDY, theDZ Directions of extrusion.
3581 theScaleFactor Use it to make prism with scaled second base.
3582 Nagative value means not scaled second base.
3583 theName Object name; when specified, this parameter is used
3584 for result publication in the study. Otherwise, if automatic
3585 publication is switched on, default value is used for result name.
3588 New GEOM.GEOM_Object, containing the created prism.
3590 # Example: see GEOM_TestAll.py
3593 if theScaleFactor > 0:
3594 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3595 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3597 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3598 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3599 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3600 anObj.SetParameters(Parameters)
3601 self._autoPublish(anObj, theName, "prism")
3604 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3605 # i.e. all the space, transfixed by the base shape during its translation
3606 # along the vector on the given distance in 2 Ways (forward/backward).
3607 # @param theBase Base shape to be extruded.
3608 # @param theDX, theDY, theDZ Directions of extrusion.
3609 # @param theName Object name; when specified, this parameter is used
3610 # for result publication in the study. Otherwise, if automatic
3611 # publication is switched on, default value is used for result name.
3613 # @return New GEOM.GEOM_Object, containing the created prism.
3615 # @ref tui_creation_prism "Example"
3616 @ManageTransactions("PrimOp")
3617 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3619 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3620 i.e. all the space, transfixed by the base shape during its translation
3621 along the vector on the given distance in 2 Ways (forward/backward).
3624 theBase Base shape to be extruded.
3625 theDX, theDY, theDZ Directions of extrusion.
3626 theName Object name; when specified, this parameter is used
3627 for result publication in the study. Otherwise, if automatic
3628 publication is switched on, default value is used for result name.
3631 New GEOM.GEOM_Object, containing the created prism.
3633 # Example: see GEOM_TestAll.py
3634 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3635 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3636 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3637 anObj.SetParameters(Parameters)
3638 self._autoPublish(anObj, theName, "prism")
3641 ## Create a shape by revolution of the base shape around the axis
3642 # on the given angle, i.e. all the space, transfixed by the base
3643 # shape during its rotation around the axis on the given angle.
3644 # @param theBase Base shape to be rotated.
3645 # @param theAxis Rotation axis.
3646 # @param theAngle Rotation angle in radians.
3647 # @param theName Object name; when specified, this parameter is used
3648 # for result publication in the study. Otherwise, if automatic
3649 # publication is switched on, default value is used for result name.
3651 # @return New GEOM.GEOM_Object, containing the created revolution.
3653 # @ref tui_creation_revolution "Example"
3654 @ManageTransactions("PrimOp")
3655 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3657 Create a shape by revolution of the base shape around the axis
3658 on the given angle, i.e. all the space, transfixed by the base
3659 shape during its rotation around the axis on the given angle.
3662 theBase Base shape to be rotated.
3663 theAxis Rotation axis.
3664 theAngle Rotation angle in radians.
3665 theName Object name; when specified, this parameter is used
3666 for result publication in the study. Otherwise, if automatic
3667 publication is switched on, default value is used for result name.
3670 New GEOM.GEOM_Object, containing the created revolution.
3672 # Example: see GEOM_TestAll.py
3673 theAngle,Parameters = ParseParameters(theAngle)
3674 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3675 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3676 anObj.SetParameters(Parameters)
3677 self._autoPublish(anObj, theName, "revolution")
3680 ## Create a shape by revolution of the base shape around the axis
3681 # on the given angle, i.e. all the space, transfixed by the base
3682 # shape during its rotation around the axis on the given angle in
3683 # both directions (forward/backward)
3684 # @param theBase Base shape to be rotated.
3685 # @param theAxis Rotation axis.
3686 # @param theAngle Rotation angle in radians.
3687 # @param theName Object name; when specified, this parameter is used
3688 # for result publication in the study. Otherwise, if automatic
3689 # publication is switched on, default value is used for result name.
3691 # @return New GEOM.GEOM_Object, containing the created revolution.
3693 # @ref tui_creation_revolution "Example"
3694 @ManageTransactions("PrimOp")
3695 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3697 Create a shape by revolution of the base shape around the axis
3698 on the given angle, i.e. all the space, transfixed by the base
3699 shape during its rotation around the axis on the given angle in
3700 both directions (forward/backward).
3703 theBase Base shape to be rotated.
3704 theAxis Rotation axis.
3705 theAngle Rotation angle in radians.
3706 theName Object name; when specified, this parameter is used
3707 for result publication in the study. Otherwise, if automatic
3708 publication is switched on, default value is used for result name.
3711 New GEOM.GEOM_Object, containing the created revolution.
3713 theAngle,Parameters = ParseParameters(theAngle)
3714 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3715 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3716 anObj.SetParameters(Parameters)
3717 self._autoPublish(anObj, theName, "revolution")
3720 ## Create a filling from the given compound of contours.
3721 # @param theShape the compound of contours
3722 # @param theMinDeg a minimal degree of BSpline surface to create
3723 # @param theMaxDeg a maximal degree of BSpline surface to create
3724 # @param theTol2D a 2d tolerance to be reached
3725 # @param theTol3D a 3d tolerance to be reached
3726 # @param theNbIter a number of iteration of approximation algorithm
3727 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3728 # @param isApprox if True, BSpline curves are generated in the process
3729 # of surface construction. By default it is False, that means
3730 # the surface is created using given curves. The usage of
3731 # Approximation makes the algorithm work slower, but allows
3732 # building the surface for rather complex cases.
3733 # @param theName Object name; when specified, this parameter is used
3734 # for result publication in the study. Otherwise, if automatic
3735 # publication is switched on, default value is used for result name.
3737 # @return New GEOM.GEOM_Object, containing the created filling surface.
3739 # @ref tui_creation_filling "Example"
3740 @ManageTransactions("PrimOp")
3741 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3742 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3744 Create a filling from the given compound of contours.
3747 theShape the compound of contours
3748 theMinDeg a minimal degree of BSpline surface to create
3749 theMaxDeg a maximal degree of BSpline surface to create
3750 theTol2D a 2d tolerance to be reached
3751 theTol3D a 3d tolerance to be reached
3752 theNbIter a number of iteration of approximation algorithm
3753 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3754 isApprox if True, BSpline curves are generated in the process
3755 of surface construction. By default it is False, that means
3756 the surface is created using given curves. The usage of
3757 Approximation makes the algorithm work slower, but allows
3758 building the surface for rather complex cases
3759 theName Object name; when specified, this parameter is used
3760 for result publication in the study. Otherwise, if automatic
3761 publication is switched on, default value is used for result name.
3764 New GEOM.GEOM_Object, containing the created filling surface.
3767 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3769 # Example: see GEOM_TestAll.py
3770 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3771 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3772 theTol2D, theTol3D, theNbIter,
3773 theMethod, isApprox)
3774 RaiseIfFailed("MakeFilling", self.PrimOp)
3775 anObj.SetParameters(Parameters)
3776 self._autoPublish(anObj, theName, "filling")
3780 ## Create a filling from the given compound of contours.
3781 # This method corresponds to MakeFilling with isApprox=True
3782 # @param theShape the compound of contours
3783 # @param theMinDeg a minimal degree of BSpline surface to create
3784 # @param theMaxDeg a maximal degree of BSpline surface to create
3785 # @param theTol3D a 3d tolerance to be reached
3786 # @param theName Object name; when specified, this parameter is used
3787 # for result publication in the study. Otherwise, if automatic
3788 # publication is switched on, default value is used for result name.
3790 # @return New GEOM.GEOM_Object, containing the created filling surface.
3792 # @ref tui_creation_filling "Example"
3793 @ManageTransactions("PrimOp")
3794 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3796 Create a filling from the given compound of contours.
3797 This method corresponds to MakeFilling with isApprox=True
3800 theShape the compound of contours
3801 theMinDeg a minimal degree of BSpline surface to create
3802 theMaxDeg a maximal degree of BSpline surface to create
3803 theTol3D a 3d tolerance to be reached
3804 theName Object name; when specified, this parameter is used
3805 for result publication in the study. Otherwise, if automatic
3806 publication is switched on, default value is used for result name.
3809 New GEOM.GEOM_Object, containing the created filling surface.
3812 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3814 # Example: see GEOM_TestAll.py
3815 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3816 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3817 0, theTol3D, 0, GEOM.FOM_Default, True)
3818 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3819 anObj.SetParameters(Parameters)
3820 self._autoPublish(anObj, theName, "filling")
3823 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3824 # @param theSeqSections - set of specified sections.
3825 # @param theModeSolid - mode defining building solid or shell
3826 # @param thePreci - precision 3D used for smoothing
3827 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3828 # @param theName Object name; when specified, this parameter is used
3829 # for result publication in the study. Otherwise, if automatic
3830 # publication is switched on, default value is used for result name.
3832 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3834 # @ref swig_todo "Example"
3835 @ManageTransactions("PrimOp")
3836 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3838 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3841 theSeqSections - set of specified sections.
3842 theModeSolid - mode defining building solid or shell
3843 thePreci - precision 3D used for smoothing
3844 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3845 theName Object name; when specified, this parameter is used
3846 for result publication in the study. Otherwise, if automatic
3847 publication is switched on, default value is used for result name.
3850 New GEOM.GEOM_Object, containing the created shell or solid.
3852 # Example: see GEOM_TestAll.py
3853 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3854 RaiseIfFailed("MakeThruSections", self.PrimOp)
3855 self._autoPublish(anObj, theName, "filling")
3858 ## Create a shape by extrusion of the base shape along
3859 # the path shape. The path shape can be a wire or an edge.
3860 # @param theBase Base shape to be extruded.
3861 # @param thePath Path shape to extrude the base shape along it.
3862 # @param theName Object name; when specified, this parameter is used
3863 # for result publication in the study. Otherwise, if automatic
3864 # publication is switched on, default value is used for result name.
3866 # @return New GEOM.GEOM_Object, containing the created pipe.
3868 # @ref tui_creation_pipe "Example"
3869 @ManageTransactions("PrimOp")
3870 def MakePipe(self, theBase, thePath, theName=None):
3872 Create a shape by extrusion of the base shape along
3873 the path shape. The path shape can be a wire or an edge.
3876 theBase Base shape to be extruded.
3877 thePath Path shape to extrude the base shape along it.
3878 theName Object name; when specified, this parameter is used
3879 for result publication in the study. Otherwise, if automatic
3880 publication is switched on, default value is used for result name.
3883 New GEOM.GEOM_Object, containing the created pipe.
3885 # Example: see GEOM_TestAll.py
3886 anObj = self.PrimOp.MakePipe(theBase, thePath)
3887 RaiseIfFailed("MakePipe", self.PrimOp)
3888 self._autoPublish(anObj, theName, "pipe")
3891 ## Create a shape by extrusion of the profile shape along
3892 # the path shape. The path shape can be a wire or an edge.
3893 # the several profiles can be specified in the several locations of path.
3894 # @param theSeqBases - list of Bases shape to be extruded.
3895 # @param theLocations - list of locations on the path corresponding
3896 # specified list of the Bases shapes. Number of locations
3897 # should be equal to number of bases or list of locations can be empty.
3898 # @param thePath - Path shape to extrude the base shape along it.
3899 # @param theWithContact - the mode defining that the section is translated to be in
3900 # contact with the spine.
3901 # @param theWithCorrection - defining that the section is rotated to be
3902 # orthogonal to the spine tangent in the correspondent point
3903 # @param theName Object name; when specified, this parameter is used
3904 # for result publication in the study. Otherwise, if automatic
3905 # publication is switched on, default value is used for result name.
3907 # @return New GEOM.GEOM_Object, containing the created pipe.
3909 # @ref tui_creation_pipe_with_diff_sec "Example"
3910 @ManageTransactions("PrimOp")
3911 def MakePipeWithDifferentSections(self, theSeqBases,
3912 theLocations, thePath,
3913 theWithContact, theWithCorrection, theName=None):
3915 Create a shape by extrusion of the profile shape along
3916 the path shape. The path shape can be a wire or an edge.
3917 the several profiles can be specified in the several locations of path.
3920 theSeqBases - list of Bases shape to be extruded.
3921 theLocations - list of locations on the path corresponding
3922 specified list of the Bases shapes. Number of locations
3923 should be equal to number of bases or list of locations can be empty.
3924 thePath - Path shape to extrude the base shape along it.
3925 theWithContact - the mode defining that the section is translated to be in
3926 contact with the spine(0/1)
3927 theWithCorrection - defining that the section is rotated to be
3928 orthogonal to the spine tangent in the correspondent point (0/1)
3929 theName Object name; when specified, this parameter is used
3930 for result publication in the study. Otherwise, if automatic
3931 publication is switched on, default value is used for result name.
3934 New GEOM.GEOM_Object, containing the created pipe.
3936 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3937 theLocations, thePath,
3938 theWithContact, theWithCorrection)
3939 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3940 self._autoPublish(anObj, theName, "pipe")
3943 ## Create a shape by extrusion of the profile shape along
3944 # the path shape. The path shape can be a wire or a edge.
3945 # the several profiles can be specified in the several locations of path.
3946 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3947 # shell or face. If number of faces in neighbour sections
3948 # aren't coincided result solid between such sections will
3949 # be created using external boundaries of this shells.
3950 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3951 # This list is used for searching correspondences between
3952 # faces in the sections. Size of this list must be equal
3953 # to size of list of base shapes.
3954 # @param theLocations - list of locations on the path corresponding
3955 # specified list of the Bases shapes. Number of locations
3956 # should be equal to number of bases. First and last
3957 # locations must be coincided with first and last vertexes
3958 # of path correspondingly.
3959 # @param thePath - Path shape to extrude the base shape along it.
3960 # @param theWithContact - the mode defining that the section is translated to be in
3961 # contact with the spine.
3962 # @param theWithCorrection - defining that the section is rotated to be
3963 # orthogonal to the spine tangent in the correspondent point
3964 # @param theName Object name; when specified, this parameter is used
3965 # for result publication in the study. Otherwise, if automatic
3966 # publication is switched on, default value is used for result name.
3968 # @return New GEOM.GEOM_Object, containing the created solids.
3970 # @ref tui_creation_pipe_with_shell_sec "Example"
3971 @ManageTransactions("PrimOp")
3972 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3973 theLocations, thePath,
3974 theWithContact, theWithCorrection, theName=None):
3976 Create a shape by extrusion of the profile shape along
3977 the path shape. The path shape can be a wire or a edge.
3978 the several profiles can be specified in the several locations of path.
3981 theSeqBases - list of Bases shape to be extruded. Base shape must be
3982 shell or face. If number of faces in neighbour sections
3983 aren't coincided result solid between such sections will
3984 be created using external boundaries of this shells.
3985 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3986 This list is used for searching correspondences between
3987 faces in the sections. Size of this list must be equal
3988 to size of list of base shapes.
3989 theLocations - list of locations on the path corresponding
3990 specified list of the Bases shapes. Number of locations
3991 should be equal to number of bases. First and last
3992 locations must be coincided with first and last vertexes
3993 of path correspondingly.
3994 thePath - Path shape to extrude the base shape along it.
3995 theWithContact - the mode defining that the section is translated to be in
3996 contact with the spine (0/1)
3997 theWithCorrection - defining that the section is rotated to be
3998 orthogonal to the spine tangent in the correspondent point (0/1)
3999 theName Object name; when specified, this parameter is used
4000 for result publication in the study. Otherwise, if automatic
4001 publication is switched on, default value is used for result name.
4004 New GEOM.GEOM_Object, containing the created solids.
4006 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4007 theLocations, thePath,
4008 theWithContact, theWithCorrection)
4009 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4010 self._autoPublish(anObj, theName, "pipe")
4013 ## Create a shape by extrusion of the profile shape along
4014 # the path shape. This function is used only for debug pipe
4015 # functionality - it is a version of function MakePipeWithShellSections()
4016 # which give a possibility to recieve information about
4017 # creating pipe between each pair of sections step by step.
4018 @ManageTransactions("PrimOp")
4019 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4020 theLocations, thePath,
4021 theWithContact, theWithCorrection, theName=None):
4023 Create a shape by extrusion of the profile shape along
4024 the path shape. This function is used only for debug pipe
4025 functionality - it is a version of previous function
4026 geompy.MakePipeWithShellSections() which give a possibility to
4027 recieve information about creating pipe between each pair of
4028 sections step by step.
4031 nbsect = len(theSeqBases)
4032 nbsubsect = len(theSeqSubBases)
4033 #print "nbsect = ",nbsect
4034 for i in range(1,nbsect):
4036 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4037 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4039 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4040 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4041 tmpLocations, thePath,
4042 theWithContact, theWithCorrection)
4043 if self.PrimOp.IsDone() == 0:
4044 print "Problems with pipe creation between ",i," and ",i+1," sections"
4045 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4048 print "Pipe between ",i," and ",i+1," sections is OK"
4053 resc = self.MakeCompound(res)
4054 #resc = self.MakeSewing(res, 0.001)
4055 #print "resc: ",resc
4056 self._autoPublish(resc, theName, "pipe")
4059 ## Create solids between given sections
4060 # @param theSeqBases - list of sections (shell or face).
4061 # @param theLocations - list of corresponding vertexes
4062 # @param theName Object name; when specified, this parameter is used
4063 # for result publication in the study. Otherwise, if automatic
4064 # publication is switched on, default value is used for result name.
4066 # @return New GEOM.GEOM_Object, containing the created solids.
4068 # @ref tui_creation_pipe_without_path "Example"
4069 @ManageTransactions("PrimOp")
4070 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
4072 Create solids between given sections
4075 theSeqBases - list of sections (shell or face).
4076 theLocations - list of corresponding vertexes
4077 theName Object name; when specified, this parameter is used
4078 for result publication in the study. Otherwise, if automatic
4079 publication is switched on, default value is used for result name.
4082 New GEOM.GEOM_Object, containing the created solids.
4084 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4085 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4086 self._autoPublish(anObj, theName, "pipe")
4089 ## Create a shape by extrusion of the base shape along
4090 # the path shape with constant bi-normal direction along the given vector.
4091 # The path shape can be a wire or an edge.
4092 # @param theBase Base shape to be extruded.
4093 # @param thePath Path shape to extrude the base shape along it.
4094 # @param theVec Vector defines a constant binormal direction to keep the
4095 # same angle beetween the direction and the sections
4096 # along the sweep surface.
4097 # @param theName Object name; when specified, this parameter is used
4098 # for result publication in the study. Otherwise, if automatic
4099 # publication is switched on, default value is used for result name.
4101 # @return New GEOM.GEOM_Object, containing the created pipe.
4103 # @ref tui_creation_pipe "Example"
4104 @ManageTransactions("PrimOp")
4105 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4107 Create a shape by extrusion of the base shape along
4108 the path shape with constant bi-normal direction along the given vector.
4109 The path shape can be a wire or an edge.
4112 theBase Base shape to be extruded.
4113 thePath Path shape to extrude the base shape along it.
4114 theVec Vector defines a constant binormal direction to keep the
4115 same angle beetween the direction and the sections
4116 along the sweep surface.
4117 theName Object name; when specified, this parameter is used
4118 for result publication in the study. Otherwise, if automatic
4119 publication is switched on, default value is used for result name.
4122 New GEOM.GEOM_Object, containing the created pipe.
4124 # Example: see GEOM_TestAll.py
4125 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4126 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4127 self._autoPublish(anObj, theName, "pipe")
4130 ## Makes a thick solid from a face or a shell
4131 # @param theShape Face or Shell to be thicken
4132 # @param theThickness Thickness of the resulting solid
4133 # @param theName Object name; when specified, this parameter is used
4134 # for result publication in the study. Otherwise, if automatic
4135 # publication is switched on, default value is used for result name.
4137 # @return New GEOM.GEOM_Object, containing the created solid
4139 @ManageTransactions("PrimOp")
4140 def MakeThickSolid(self, theShape, theThickness, theName=None):
4142 Make a thick solid from a face or a shell
4145 theShape Face or Shell to be thicken
4146 theThickness Thickness of the resulting solid
4147 theName Object name; when specified, this parameter is used
4148 for result publication in the study. Otherwise, if automatic
4149 publication is switched on, default value is used for result name.
4152 New GEOM.GEOM_Object, containing the created solid
4154 # Example: see GEOM_TestAll.py
4155 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4156 RaiseIfFailed("MakeThickening", self.PrimOp)
4157 self._autoPublish(anObj, theName, "pipe")
4161 ## Modifies a face or a shell to make it a thick solid
4162 # @param theShape Face or Shell to be thicken
4163 # @param theThickness Thickness of the resulting solid
4165 # @return The modified shape
4167 @ManageTransactions("PrimOp")
4168 def Thicken(self, theShape, theThickness):
4170 Modifies a face or a shell to make it a thick solid
4173 theBase Base shape to be extruded.
4174 thePath Path shape to extrude the base shape along it.
4175 theName Object name; when specified, this parameter is used
4176 for result publication in the study. Otherwise, if automatic
4177 publication is switched on, default value is used for result name.
4182 # Example: see GEOM_TestAll.py
4183 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4184 RaiseIfFailed("MakeThickening", self.PrimOp)
4187 ## Build a middle path of a pipe-like shape.
4188 # The path shape can be a wire or an edge.
4189 # @param theShape It can be closed or unclosed pipe-like shell
4190 # or a pipe-like solid.
4191 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4192 # should be wires or faces of theShape.
4193 # @param theName Object name; when specified, this parameter is used
4194 # for result publication in the study. Otherwise, if automatic
4195 # publication is switched on, default value is used for result name.
4197 # @note It is not assumed that exact or approximate copy of theShape
4198 # can be obtained by applying existing Pipe operation on the
4199 # resulting "Path" wire taking theBase1 as the base - it is not
4200 # always possible; though in some particular cases it might work
4201 # it is not guaranteed. Thus, RestorePath function should not be
4202 # considered as an exact reverse operation of the Pipe.
4204 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4205 # source pipe's "path".
4207 # @ref tui_creation_pipe_path "Example"
4208 @ManageTransactions("PrimOp")
4209 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4211 Build a middle path of a pipe-like shape.
4212 The path shape can be a wire or an edge.
4215 theShape It can be closed or unclosed pipe-like shell
4216 or a pipe-like solid.
4217 theBase1, theBase2 Two bases of the supposed pipe. This
4218 should be wires or faces of theShape.
4219 theName Object name; when specified, this parameter is used
4220 for result publication in the study. Otherwise, if automatic
4221 publication is switched on, default value is used for result name.
4224 New GEOM_Object, containing an edge or wire that represent
4227 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4228 RaiseIfFailed("RestorePath", self.PrimOp)
4229 self._autoPublish(anObj, theName, "path")
4232 ## Build a middle path of a pipe-like shape.
4233 # The path shape can be a wire or an edge.
4234 # @param theShape It can be closed or unclosed pipe-like shell
4235 # or a pipe-like solid.
4236 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4237 # should be lists of edges of theShape.
4238 # @param theName Object name; when specified, this parameter is used
4239 # for result publication in the study. Otherwise, if automatic
4240 # publication is switched on, default value is used for result name.
4242 # @note It is not assumed that exact or approximate copy of theShape
4243 # can be obtained by applying existing Pipe operation on the
4244 # resulting "Path" wire taking theBase1 as the base - it is not
4245 # always possible; though in some particular cases it might work
4246 # it is not guaranteed. Thus, RestorePath function should not be
4247 # considered as an exact reverse operation of the Pipe.
4249 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4250 # source pipe's "path".
4252 # @ref tui_creation_pipe_path "Example"
4253 @ManageTransactions("PrimOp")
4254 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4256 Build a middle path of a pipe-like shape.
4257 The path shape can be a wire or an edge.
4260 theShape It can be closed or unclosed pipe-like shell
4261 or a pipe-like solid.
4262 listEdges1, listEdges2 Two bases of the supposed pipe. This
4263 should be lists of edges of theShape.
4264 theName Object name; when specified, this parameter is used
4265 for result publication in the study. Otherwise, if automatic
4266 publication is switched on, default value is used for result name.
4269 New GEOM_Object, containing an edge or wire that represent
4272 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4273 RaiseIfFailed("RestorePath", self.PrimOp)
4274 self._autoPublish(anObj, theName, "path")
4280 ## @addtogroup l3_advanced
4283 ## Create a linear edge with specified ends.
4284 # @param thePnt1 Point for the first end of edge.
4285 # @param thePnt2 Point for the second end of edge.
4286 # @param theName Object name; when specified, this parameter is used
4287 # for result publication in the study. Otherwise, if automatic
4288 # publication is switched on, default value is used for result name.
4290 # @return New GEOM.GEOM_Object, containing the created edge.
4292 # @ref tui_creation_edge "Example"
4293 @ManageTransactions("ShapesOp")
4294 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4296 Create a linear edge with specified ends.
4299 thePnt1 Point for the first end of edge.
4300 thePnt2 Point for the second end of edge.
4301 theName Object name; when specified, this parameter is used
4302 for result publication in the study. Otherwise, if automatic
4303 publication is switched on, default value is used for result name.
4306 New GEOM.GEOM_Object, containing the created edge.
4308 # Example: see GEOM_TestAll.py
4309 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4310 RaiseIfFailed("MakeEdge", self.ShapesOp)
4311 self._autoPublish(anObj, theName, "edge")
4314 ## Create a new edge, corresponding to the given length on the given curve.
4315 # @param theRefCurve The referenced curve (edge).
4316 # @param theLength Length on the referenced curve. It can be negative.
4317 # @param theStartPoint Any point can be selected for it, the new edge will begin
4318 # at the end of \a theRefCurve, close to the selected point.
4319 # If None, start from the first point of \a theRefCurve.
4320 # @param theName Object name; when specified, this parameter is used
4321 # for result publication in the study. Otherwise, if automatic
4322 # publication is switched on, default value is used for result name.
4324 # @return New GEOM.GEOM_Object, containing the created edge.
4326 # @ref tui_creation_edge "Example"
4327 @ManageTransactions("ShapesOp")
4328 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4330 Create a new edge, corresponding to the given length on the given curve.
4333 theRefCurve The referenced curve (edge).
4334 theLength Length on the referenced curve. It can be negative.
4335 theStartPoint Any point can be selected for it, the new edge will begin
4336 at the end of theRefCurve, close to the selected point.
4337 If None, start from the first point of theRefCurve.
4338 theName Object name; when specified, this parameter is used
4339 for result publication in the study. Otherwise, if automatic
4340 publication is switched on, default value is used for result name.
4343 New GEOM.GEOM_Object, containing the created edge.
4345 # Example: see GEOM_TestAll.py
4346 theLength, Parameters = ParseParameters(theLength)
4347 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4348 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4349 anObj.SetParameters(Parameters)
4350 self._autoPublish(anObj, theName, "edge")
4353 ## Create an edge from specified wire.
4354 # @param theWire source Wire
4355 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4356 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4357 # @param theName Object name; when specified, this parameter is used
4358 # for result publication in the study. Otherwise, if automatic
4359 # publication is switched on, default value is used for result name.
4361 # @return New GEOM.GEOM_Object, containing the created edge.
4363 # @ref tui_creation_edge "Example"
4364 @ManageTransactions("ShapesOp")
4365 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4367 Create an edge from specified wire.
4371 theLinearTolerance linear tolerance value (default = 1e-07)
4372 theAngularTolerance angular tolerance value (default = 1e-12)
4373 theName Object name; when specified, this parameter is used
4374 for result publication in the study. Otherwise, if automatic
4375 publication is switched on, default value is used for result name.
4378 New GEOM.GEOM_Object, containing the created edge.
4380 # Example: see GEOM_TestAll.py
4381 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4382 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4383 self._autoPublish(anObj, theName, "edge")
4386 ## Create a wire from the set of edges and wires.
4387 # @param theEdgesAndWires List of edges and/or wires.
4388 # @param theTolerance Maximum distance between vertices, that will be merged.
4389 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4390 # @param theName Object name; when specified, this parameter is used
4391 # for result publication in the study. Otherwise, if automatic
4392 # publication is switched on, default value is used for result name.
4394 # @return New GEOM.GEOM_Object, containing the created wire.
4396 # @ref tui_creation_wire "Example"
4397 @ManageTransactions("ShapesOp")
4398 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4400 Create a wire from the set of edges and wires.
4403 theEdgesAndWires List of edges and/or wires.
4404 theTolerance Maximum distance between vertices, that will be merged.
4405 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4406 theName Object name; when specified, this parameter is used
4407 for result publication in the study. Otherwise, if automatic
4408 publication is switched on, default value is used for result name.
4411 New GEOM.GEOM_Object, containing the created wire.
4413 # Example: see GEOM_TestAll.py
4414 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4415 RaiseIfFailed("MakeWire", self.ShapesOp)
4416 self._autoPublish(anObj, theName, "wire")
4419 ## Create a face on the given wire.
4420 # @param theWire closed Wire or Edge to build the face on.
4421 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4422 # If the tolerance of the obtained planar face is less
4423 # than 1e-06, this face will be returned, otherwise the
4424 # algorithm tries to build any suitable face on the given
4425 # wire and prints a warning message.
4426 # @param theName Object name; when specified, this parameter is used
4427 # for result publication in the study. Otherwise, if automatic
4428 # publication is switched on, default value is used for result name.
4430 # @return New GEOM.GEOM_Object, containing the created face.
4432 # @ref tui_creation_face "Example"
4433 @ManageTransactions("ShapesOp")
4434 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4436 Create a face on the given wire.
4439 theWire closed Wire or Edge to build the face on.
4440 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4441 If the tolerance of the obtained planar face is less
4442 than 1e-06, this face will be returned, otherwise the
4443 algorithm tries to build any suitable face on the given
4444 wire and prints a warning message.
4445 theName Object name; when specified, this parameter is used
4446 for result publication in the study. Otherwise, if automatic
4447 publication is switched on, default value is used for result name.
4450 New GEOM.GEOM_Object, containing the created face.
4452 # Example: see GEOM_TestAll.py
4453 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4454 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4455 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4457 RaiseIfFailed("MakeFace", self.ShapesOp)
4458 self._autoPublish(anObj, theName, "face")
4461 ## Create a face on the given wires set.
4462 # @param theWires List of closed wires or edges to build the face on.
4463 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4464 # If the tolerance of the obtained planar face is less
4465 # than 1e-06, this face will be returned, otherwise the
4466 # algorithm tries to build any suitable face on the given
4467 # wire and prints a warning message.
4468 # @param theName Object name; when specified, this parameter is used
4469 # for result publication in the study. Otherwise, if automatic
4470 # publication is switched on, default value is used for result name.
4472 # @return New GEOM.GEOM_Object, containing the created face.
4474 # @ref tui_creation_face "Example"
4475 @ManageTransactions("ShapesOp")
4476 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4478 Create a face on the given wires set.
4481 theWires List of closed wires or edges to build the face on.
4482 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4483 If the tolerance of the obtained planar face is less
4484 than 1e-06, this face will be returned, otherwise the
4485 algorithm tries to build any suitable face on the given
4486 wire and prints a warning message.
4487 theName Object name; when specified, this parameter is used
4488 for result publication in the study. Otherwise, if automatic
4489 publication is switched on, default value is used for result name.
4492 New GEOM.GEOM_Object, containing the created face.
4494 # Example: see GEOM_TestAll.py
4495 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4496 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4497 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4499 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4500 self._autoPublish(anObj, theName, "face")
4503 ## See MakeFaceWires() method for details.
4505 # @ref tui_creation_face "Example 1"
4506 # \n @ref swig_MakeFaces "Example 2"
4507 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4509 See geompy.MakeFaceWires() method for details.
4511 # Example: see GEOM_TestOthers.py
4512 # note: auto-publishing is done in self.MakeFaceWires()
4513 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4516 ## Create a shell from the set of faces and shells.
4517 # @param theFacesAndShells List of faces and/or shells.
4518 # @param theName Object name; when specified, this parameter is used
4519 # for result publication in the study. Otherwise, if automatic
4520 # publication is switched on, default value is used for result name.
4522 # @return New GEOM.GEOM_Object, containing the created shell.
4524 # @ref tui_creation_shell "Example"
4525 @ManageTransactions("ShapesOp")
4526 def MakeShell(self, theFacesAndShells, theName=None):
4528 Create a shell from the set of faces and shells.
4531 theFacesAndShells List of faces and/or shells.
4532 theName Object name; when specified, this parameter is used
4533 for result publication in the study. Otherwise, if automatic
4534 publication is switched on, default value is used for result name.
4537 New GEOM.GEOM_Object, containing the created shell.
4539 # Example: see GEOM_TestAll.py
4540 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4541 RaiseIfFailed("MakeShell", self.ShapesOp)
4542 self._autoPublish(anObj, theName, "shell")
4545 ## Create a solid, bounded by the given shells.
4546 # @param theShells Sequence of bounding shells.
4547 # @param theName Object name; when specified, this parameter is used
4548 # for result publication in the study. Otherwise, if automatic
4549 # publication is switched on, default value is used for result name.
4551 # @return New GEOM.GEOM_Object, containing the created solid.
4553 # @ref tui_creation_solid "Example"
4554 @ManageTransactions("ShapesOp")
4555 def MakeSolid(self, theShells, theName=None):
4557 Create a solid, bounded by the given shells.
4560 theShells Sequence of bounding shells.
4561 theName Object name; when specified, this parameter is used
4562 for result publication in the study. Otherwise, if automatic
4563 publication is switched on, default value is used for result name.
4566 New GEOM.GEOM_Object, containing the created solid.
4568 # Example: see GEOM_TestAll.py
4569 if len(theShells) == 1:
4570 descr = self._IsGoodForSolid(theShells[0])
4572 # raise RuntimeError, "MakeSolidShells : " + descr
4573 if descr == "WRN_SHAPE_UNCLOSED":
4574 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4575 anObj = self.ShapesOp.MakeSolidShells(theShells)
4576 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4577 self._autoPublish(anObj, theName, "solid")
4580 ## Create a compound of the given shapes.
4581 # @param theShapes List of shapes to put in compound.
4582 # @param theName Object name; when specified, this parameter is used
4583 # for result publication in the study. Otherwise, if automatic
4584 # publication is switched on, default value is used for result name.
4586 # @return New GEOM.GEOM_Object, containing the created compound.
4588 # @ref tui_creation_compound "Example"
4589 @ManageTransactions("ShapesOp")
4590 def MakeCompound(self, theShapes, theName=None):
4592 Create a compound of the given shapes.
4595 theShapes List of shapes to put in compound.
4596 theName Object name; when specified, this parameter is used
4597 for result publication in the study. Otherwise, if automatic
4598 publication is switched on, default value is used for result name.
4601 New GEOM.GEOM_Object, containing the created compound.
4603 # Example: see GEOM_TestAll.py
4604 anObj = self.ShapesOp.MakeCompound(theShapes)
4605 RaiseIfFailed("MakeCompound", self.ShapesOp)
4606 self._autoPublish(anObj, theName, "compound")
4609 # end of l3_advanced
4612 ## @addtogroup l2_measure
4615 ## Gives quantity of faces in the given shape.
4616 # @param theShape Shape to count faces of.
4617 # @return Quantity of faces.
4619 # @ref swig_NumberOf "Example"
4620 @ManageTransactions("ShapesOp")
4621 def NumberOfFaces(self, theShape):
4623 Gives quantity of faces in the given shape.
4626 theShape Shape to count faces of.
4631 # Example: see GEOM_TestOthers.py
4632 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4633 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4636 ## Gives quantity of edges in the given shape.
4637 # @param theShape Shape to count edges of.
4638 # @return Quantity of edges.
4640 # @ref swig_NumberOf "Example"
4641 @ManageTransactions("ShapesOp")
4642 def NumberOfEdges(self, theShape):
4644 Gives quantity of edges in the given shape.
4647 theShape Shape to count edges of.
4652 # Example: see GEOM_TestOthers.py
4653 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4654 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4657 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4658 # @param theShape Shape to count sub-shapes of.
4659 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4660 # @return Quantity of sub-shapes of given type.
4662 # @ref swig_NumberOf "Example"
4663 @ManageTransactions("ShapesOp")
4664 def NumberOfSubShapes(self, theShape, theShapeType):
4666 Gives quantity of sub-shapes of type theShapeType in the given shape.
4669 theShape Shape to count sub-shapes of.
4670 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4673 Quantity of sub-shapes of given type.
4675 # Example: see GEOM_TestOthers.py
4676 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4677 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4680 ## Gives quantity of solids in the given shape.
4681 # @param theShape Shape to count solids in.
4682 # @return Quantity of solids.
4684 # @ref swig_NumberOf "Example"
4685 @ManageTransactions("ShapesOp")
4686 def NumberOfSolids(self, theShape):
4688 Gives quantity of solids in the given shape.
4691 theShape Shape to count solids in.
4696 # Example: see GEOM_TestOthers.py
4697 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4698 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4704 ## @addtogroup l3_healing
4707 ## Reverses an orientation the given shape.
4708 # @param theShape Shape to be reversed.
4709 # @param theName Object name; when specified, this parameter is used
4710 # for result publication in the study. Otherwise, if automatic
4711 # publication is switched on, default value is used for result name.
4713 # @return The reversed copy of theShape.
4715 # @ref swig_ChangeOrientation "Example"
4716 @ManageTransactions("ShapesOp")
4717 def ChangeOrientation(self, theShape, theName=None):
4719 Reverses an orientation the given shape.
4722 theShape Shape to be reversed.
4723 theName Object name; when specified, this parameter is used
4724 for result publication in the study. Otherwise, if automatic
4725 publication is switched on, default value is used for result name.
4728 The reversed copy of theShape.
4730 # Example: see GEOM_TestAll.py
4731 anObj = self.ShapesOp.ChangeOrientation(theShape)
4732 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4733 self._autoPublish(anObj, theName, "reversed")
4736 ## See ChangeOrientation() method for details.
4738 # @ref swig_OrientationChange "Example"
4739 def OrientationChange(self, theShape, theName=None):
4741 See geompy.ChangeOrientation method for details.
4743 # Example: see GEOM_TestOthers.py
4744 # note: auto-publishing is done in self.ChangeOrientation()
4745 anObj = self.ChangeOrientation(theShape, theName)
4751 ## @addtogroup l4_obtain
4754 ## Retrieve all free faces from the given shape.
4755 # Free face is a face, which is not shared between two shells of the shape.
4756 # @param theShape Shape to find free faces in.
4757 # @return List of IDs of all free faces, contained in theShape.
4759 # @ref tui_measurement_tools_page "Example"
4760 @ManageTransactions("ShapesOp")
4761 def GetFreeFacesIDs(self,theShape):
4763 Retrieve all free faces from the given shape.
4764 Free face is a face, which is not shared between two shells of the shape.
4767 theShape Shape to find free faces in.
4770 List of IDs of all free faces, contained in theShape.
4772 # Example: see GEOM_TestOthers.py
4773 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4774 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4777 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4778 # @param theShape1 Shape to find sub-shapes in.
4779 # @param theShape2 Shape to find shared sub-shapes with.
4780 # @param theShapeType Type of sub-shapes to be retrieved.
4781 # @param theName Object name; when specified, this parameter is used
4782 # for result publication in the study. Otherwise, if automatic
4783 # publication is switched on, default value is used for result name.
4785 # @return List of sub-shapes of theShape1, shared with theShape2.
4787 # @ref swig_GetSharedShapes "Example"
4788 @ManageTransactions("ShapesOp")
4789 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4791 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4794 theShape1 Shape to find sub-shapes in.
4795 theShape2 Shape to find shared sub-shapes with.
4796 theShapeType Type of sub-shapes to be retrieved.
4797 theName Object name; when specified, this parameter is used
4798 for result publication in the study. Otherwise, if automatic
4799 publication is switched on, default value is used for result name.
4802 List of sub-shapes of theShape1, shared with theShape2.
4804 # Example: see GEOM_TestOthers.py
4805 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4806 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4807 self._autoPublish(aList, theName, "shared")
4810 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4811 # @param theShapes Shapes to find common sub-shapes of.
4812 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4813 # @param theName Object name; when specified, this parameter is used
4814 # for result publication in the study. Otherwise, if automatic
4815 # publication is switched on, default value is used for result name.
4817 # @return List of objects, that are sub-shapes of all given shapes.
4819 # @ref swig_GetSharedShapes "Example"
4820 @ManageTransactions("ShapesOp")
4821 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4823 Get all sub-shapes, shared by all shapes in the list theShapes.
4826 theShapes Shapes to find common sub-shapes of.
4827 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4828 theName Object name; when specified, this parameter is used
4829 for result publication in the study. Otherwise, if automatic
4830 publication is switched on, default value is used for result name.
4833 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4835 # Example: see GEOM_TestOthers.py
4836 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4837 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4838 self._autoPublish(aList, theName, "shared")
4841 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4842 # situated relatively the specified plane by the certain way,
4843 # defined through <VAR>theState</VAR> parameter.
4844 # @param theShape Shape to find sub-shapes of.
4845 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4846 # @param theAx1 Vector (or line, or linear edge), specifying normal
4847 # direction and location of the plane to find shapes on.
4848 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4849 # @param theName Object name; when specified, this parameter is used
4850 # for result publication in the study. Otherwise, if automatic
4851 # publication is switched on, default value is used for result name.
4853 # @return List of all found sub-shapes.
4855 # @ref swig_GetShapesOnPlane "Example"
4856 @ManageTransactions("ShapesOp")
4857 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4859 Find in theShape all sub-shapes of type theShapeType,
4860 situated relatively the specified plane by the certain way,
4861 defined through theState parameter.
4864 theShape Shape to find sub-shapes of.
4865 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4866 theAx1 Vector (or line, or linear edge), specifying normal
4867 direction and location of the plane to find shapes on.
4868 theState The state of the sub-shapes to find (see GEOM::shape_state)
4869 theName Object name; when specified, this parameter is used
4870 for result publication in the study. Otherwise, if automatic
4871 publication is switched on, default value is used for result name.
4874 List of all found sub-shapes.
4876 # Example: see GEOM_TestOthers.py
4877 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4878 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4879 self._autoPublish(aList, theName, "shapeOnPlane")
4882 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4883 # situated relatively the specified plane by the certain way,
4884 # defined through <VAR>theState</VAR> parameter.
4885 # @param theShape Shape to find sub-shapes of.
4886 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4887 # @param theAx1 Vector (or line, or linear edge), specifying normal
4888 # direction and location of the plane to find shapes on.
4889 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4891 # @return List of all found sub-shapes indices.
4893 # @ref swig_GetShapesOnPlaneIDs "Example"
4894 @ManageTransactions("ShapesOp")
4895 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4897 Find in theShape all sub-shapes of type theShapeType,
4898 situated relatively the specified plane by the certain way,
4899 defined through theState parameter.
4902 theShape Shape to find sub-shapes of.
4903 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4904 theAx1 Vector (or line, or linear edge), specifying normal
4905 direction and location of the plane to find shapes on.
4906 theState The state of the sub-shapes to find (see GEOM::shape_state)
4909 List of all found sub-shapes indices.
4911 # Example: see GEOM_TestOthers.py
4912 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4913 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4916 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4917 # situated relatively the specified plane by the certain way,
4918 # defined through <VAR>theState</VAR> parameter.
4919 # @param theShape Shape to find sub-shapes of.
4920 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4921 # @param theAx1 Vector (or line, or linear edge), specifying normal
4922 # direction of the plane to find shapes on.
4923 # @param thePnt Point specifying location of the plane to find shapes on.
4924 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4925 # @param theName Object name; when specified, this parameter is used
4926 # for result publication in the study. Otherwise, if automatic
4927 # publication is switched on, default value is used for result name.
4929 # @return List of all found sub-shapes.
4931 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4932 @ManageTransactions("ShapesOp")
4933 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4935 Find in theShape all sub-shapes of type theShapeType,
4936 situated relatively the specified plane by the certain way,
4937 defined through theState parameter.
4940 theShape Shape to find sub-shapes of.
4941 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4942 theAx1 Vector (or line, or linear edge), specifying normal
4943 direction and location of the plane to find shapes on.
4944 thePnt Point specifying location of the plane to find shapes on.
4945 theState The state of the sub-shapes to find (see GEOM::shape_state)
4946 theName Object name; when specified, this parameter is used
4947 for result publication in the study. Otherwise, if automatic
4948 publication is switched on, default value is used for result name.
4951 List of all found sub-shapes.
4953 # Example: see GEOM_TestOthers.py
4954 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4955 theAx1, thePnt, theState)
4956 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4957 self._autoPublish(aList, theName, "shapeOnPlane")
4960 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4961 # situated relatively the specified plane by the certain way,
4962 # defined through <VAR>theState</VAR> parameter.
4963 # @param theShape Shape to find sub-shapes of.
4964 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4965 # @param theAx1 Vector (or line, or linear edge), specifying normal
4966 # direction of the plane to find shapes on.
4967 # @param thePnt Point specifying location of the plane to find shapes on.
4968 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4970 # @return List of all found sub-shapes indices.
4972 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4973 @ManageTransactions("ShapesOp")
4974 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4976 Find in theShape all sub-shapes of type theShapeType,
4977 situated relatively the specified plane by the certain way,
4978 defined through theState parameter.
4981 theShape Shape to find sub-shapes of.
4982 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4983 theAx1 Vector (or line, or linear edge), specifying normal
4984 direction and location of the plane to find shapes on.
4985 thePnt Point specifying location of the plane to find shapes on.
4986 theState The state of the sub-shapes to find (see GEOM::shape_state)
4989 List of all found sub-shapes indices.
4991 # Example: see GEOM_TestOthers.py
4992 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4993 theAx1, thePnt, theState)
4994 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4997 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4998 # the specified cylinder by the certain way, defined through \a theState parameter.
4999 # @param theShape Shape to find sub-shapes of.
5000 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5001 # @param theAxis Vector (or line, or linear edge), specifying
5002 # axis of the cylinder to find shapes on.
5003 # @param theRadius Radius of the cylinder to find shapes on.
5004 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5005 # @param theName Object name; when specified, this parameter is used
5006 # for result publication in the study. Otherwise, if automatic
5007 # publication is switched on, default value is used for result name.
5009 # @return List of all found sub-shapes.
5011 # @ref swig_GetShapesOnCylinder "Example"
5012 @ManageTransactions("ShapesOp")
5013 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5015 Find in theShape all sub-shapes of type theShapeType, situated relatively
5016 the specified cylinder by the certain way, defined through theState parameter.
5019 theShape Shape to find sub-shapes of.
5020 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5021 theAxis Vector (or line, or linear edge), specifying
5022 axis of the cylinder to find shapes on.
5023 theRadius Radius of the cylinder to find shapes on.
5024 theState The state of the sub-shapes to find (see GEOM::shape_state)
5025 theName Object name; when specified, this parameter is used
5026 for result publication in the study. Otherwise, if automatic
5027 publication is switched on, default value is used for result name.
5030 List of all found sub-shapes.
5032 # Example: see GEOM_TestOthers.py
5033 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5034 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5035 self._autoPublish(aList, theName, "shapeOnCylinder")
5038 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5039 # the specified cylinder by the certain way, defined through \a theState parameter.
5040 # @param theShape Shape to find sub-shapes of.
5041 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5042 # @param theAxis Vector (or line, or linear edge), specifying
5043 # axis of the cylinder to find shapes on.
5044 # @param theRadius Radius of the cylinder to find shapes on.
5045 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5047 # @return List of all found sub-shapes indices.
5049 # @ref swig_GetShapesOnCylinderIDs "Example"
5050 @ManageTransactions("ShapesOp")
5051 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5053 Find in theShape all sub-shapes of type theShapeType, situated relatively
5054 the specified cylinder by the certain way, defined through theState parameter.
5057 theShape Shape to find sub-shapes of.
5058 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5059 theAxis Vector (or line, or linear edge), specifying
5060 axis of the cylinder to find shapes on.
5061 theRadius Radius of the cylinder to find shapes on.
5062 theState The state of the sub-shapes to find (see GEOM::shape_state)
5065 List of all found sub-shapes indices.
5067 # Example: see GEOM_TestOthers.py
5068 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5069 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5072 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5073 # the specified cylinder by the certain way, defined through \a theState parameter.
5074 # @param theShape Shape to find sub-shapes of.
5075 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5076 # @param theAxis Vector (or line, or linear edge), specifying
5077 # axis of the cylinder to find shapes on.
5078 # @param thePnt Point specifying location of the bottom of the cylinder.
5079 # @param theRadius Radius of the cylinder to find shapes on.
5080 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5081 # @param theName Object name; when specified, this parameter is used
5082 # for result publication in the study. Otherwise, if automatic
5083 # publication is switched on, default value is used for result name.
5085 # @return List of all found sub-shapes.
5087 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5088 @ManageTransactions("ShapesOp")
5089 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5091 Find in theShape all sub-shapes of type theShapeType, situated relatively
5092 the specified cylinder by the certain way, defined through theState parameter.
5095 theShape Shape to find sub-shapes of.
5096 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5097 theAxis Vector (or line, or linear edge), specifying
5098 axis of the cylinder to find shapes on.
5099 theRadius Radius of the cylinder to find shapes on.
5100 theState The state of the sub-shapes to find (see GEOM::shape_state)
5101 theName Object name; when specified, this parameter is used
5102 for result publication in the study. Otherwise, if automatic
5103 publication is switched on, default value is used for result name.
5106 List of all found sub-shapes.
5108 # Example: see GEOM_TestOthers.py
5109 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5110 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5111 self._autoPublish(aList, theName, "shapeOnCylinder")
5114 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5115 # the specified cylinder by the certain way, defined through \a theState parameter.
5116 # @param theShape Shape to find sub-shapes of.
5117 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5118 # @param theAxis Vector (or line, or linear edge), specifying
5119 # axis of the cylinder to find shapes on.
5120 # @param thePnt Point specifying location of the bottom of the cylinder.
5121 # @param theRadius Radius of the cylinder to find shapes on.
5122 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5124 # @return List of all found sub-shapes indices
5126 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5127 @ManageTransactions("ShapesOp")
5128 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5130 Find in theShape all sub-shapes of type theShapeType, situated relatively
5131 the specified cylinder by the certain way, defined through theState parameter.
5134 theShape Shape to find sub-shapes of.
5135 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5136 theAxis Vector (or line, or linear edge), specifying
5137 axis of the cylinder to find shapes on.
5138 theRadius Radius of the cylinder to find shapes on.
5139 theState The state of the sub-shapes to find (see GEOM::shape_state)
5142 List of all found sub-shapes indices.
5144 # Example: see GEOM_TestOthers.py
5145 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5146 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5149 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5150 # the specified sphere by the certain way, defined through \a theState parameter.
5151 # @param theShape Shape to find sub-shapes of.
5152 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5153 # @param theCenter Point, specifying center of the sphere to find shapes on.
5154 # @param theRadius Radius of the sphere to find shapes on.
5155 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5156 # @param theName Object name; when specified, this parameter is used
5157 # for result publication in the study. Otherwise, if automatic
5158 # publication is switched on, default value is used for result name.
5160 # @return List of all found sub-shapes.
5162 # @ref swig_GetShapesOnSphere "Example"
5163 @ManageTransactions("ShapesOp")
5164 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5166 Find in theShape all sub-shapes of type theShapeType, situated relatively
5167 the specified sphere by the certain way, defined through theState parameter.
5170 theShape Shape to find sub-shapes of.
5171 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5172 theCenter Point, specifying center of the sphere to find shapes on.
5173 theRadius Radius of the sphere to find shapes on.
5174 theState The state of the sub-shapes to find (see GEOM::shape_state)
5175 theName Object name; when specified, this parameter is used
5176 for result publication in the study. Otherwise, if automatic
5177 publication is switched on, default value is used for result name.
5180 List of all found sub-shapes.
5182 # Example: see GEOM_TestOthers.py
5183 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5184 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5185 self._autoPublish(aList, theName, "shapeOnSphere")
5188 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5189 # the specified sphere by the certain way, defined through \a theState parameter.
5190 # @param theShape Shape to find sub-shapes of.
5191 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5192 # @param theCenter Point, specifying center of the sphere to find shapes on.
5193 # @param theRadius Radius of the sphere to find shapes on.
5194 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5196 # @return List of all found sub-shapes indices.
5198 # @ref swig_GetShapesOnSphereIDs "Example"
5199 @ManageTransactions("ShapesOp")
5200 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5202 Find in theShape all sub-shapes of type theShapeType, situated relatively
5203 the specified sphere by the certain way, defined through theState parameter.
5206 theShape Shape to find sub-shapes of.
5207 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5208 theCenter Point, specifying center of the sphere to find shapes on.
5209 theRadius Radius of the sphere to find shapes on.
5210 theState The state of the sub-shapes to find (see GEOM::shape_state)
5213 List of all found sub-shapes indices.
5215 # Example: see GEOM_TestOthers.py
5216 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5217 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5220 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5221 # the specified quadrangle by the certain way, defined through \a theState parameter.
5222 # @param theShape Shape to find sub-shapes of.
5223 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5224 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5225 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5226 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5227 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5228 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5229 # @param theName Object name; when specified, this parameter is used
5230 # for result publication in the study. Otherwise, if automatic
5231 # publication is switched on, default value is used for result name.
5233 # @return List of all found sub-shapes.
5235 # @ref swig_GetShapesOnQuadrangle "Example"
5236 @ManageTransactions("ShapesOp")
5237 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5238 theTopLeftPoint, theTopRigthPoint,
5239 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5241 Find in theShape all sub-shapes of type theShapeType, situated relatively
5242 the specified quadrangle by the certain way, defined through theState parameter.
5245 theShape Shape to find sub-shapes of.
5246 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5247 theTopLeftPoint Point, specifying top left corner of a quadrangle
5248 theTopRigthPoint Point, specifying top right corner of a quadrangle
5249 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5250 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5251 theState The state of the sub-shapes to find (see GEOM::shape_state)
5252 theName Object name; when specified, this parameter is used
5253 for result publication in the study. Otherwise, if automatic
5254 publication is switched on, default value is used for result name.
5257 List of all found sub-shapes.
5259 # Example: see GEOM_TestOthers.py
5260 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5261 theTopLeftPoint, theTopRigthPoint,
5262 theBottomLeftPoint, theBottomRigthPoint, theState)
5263 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5264 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5267 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5268 # the specified quadrangle by the certain way, defined through \a theState parameter.
5269 # @param theShape Shape to find sub-shapes of.
5270 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5271 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5272 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5273 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5274 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5275 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5277 # @return List of all found sub-shapes indices.
5279 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5280 @ManageTransactions("ShapesOp")
5281 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5282 theTopLeftPoint, theTopRigthPoint,
5283 theBottomLeftPoint, theBottomRigthPoint, theState):
5285 Find in theShape all sub-shapes of type theShapeType, situated relatively
5286 the specified quadrangle by the certain way, defined through theState parameter.
5289 theShape Shape to find sub-shapes of.
5290 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5291 theTopLeftPoint Point, specifying top left corner of a quadrangle
5292 theTopRigthPoint Point, specifying top right corner of a quadrangle
5293 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5294 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5295 theState The state of the sub-shapes to find (see GEOM::shape_state)
5298 List of all found sub-shapes indices.
5301 # Example: see GEOM_TestOthers.py
5302 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5303 theTopLeftPoint, theTopRigthPoint,
5304 theBottomLeftPoint, theBottomRigthPoint, theState)
5305 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5308 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5309 # the specified \a theBox by the certain way, defined through \a theState parameter.
5310 # @param theBox Shape for relative comparing.
5311 # @param theShape Shape to find sub-shapes of.
5312 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5313 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5314 # @param theName Object name; when specified, this parameter is used
5315 # for result publication in the study. Otherwise, if automatic
5316 # publication is switched on, default value is used for result name.
5318 # @return List of all found sub-shapes.
5320 # @ref swig_GetShapesOnBox "Example"
5321 @ManageTransactions("ShapesOp")
5322 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5324 Find in theShape all sub-shapes of type theShapeType, situated relatively
5325 the specified theBox by the certain way, defined through theState parameter.
5328 theBox Shape for relative comparing.
5329 theShape Shape to find sub-shapes of.
5330 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5331 theState The state of the sub-shapes to find (see GEOM::shape_state)
5332 theName Object name; when specified, this parameter is used
5333 for result publication in the study. Otherwise, if automatic
5334 publication is switched on, default value is used for result name.
5337 List of all found sub-shapes.
5339 # Example: see GEOM_TestOthers.py
5340 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5341 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5342 self._autoPublish(aList, theName, "shapeOnBox")
5345 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5346 # the specified \a theBox by the certain way, defined through \a theState parameter.
5347 # @param theBox Shape for relative comparing.
5348 # @param theShape Shape to find sub-shapes of.
5349 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5350 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5352 # @return List of all found sub-shapes indices.
5354 # @ref swig_GetShapesOnBoxIDs "Example"
5355 @ManageTransactions("ShapesOp")
5356 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5358 Find in theShape all sub-shapes of type theShapeType, situated relatively
5359 the specified theBox by the certain way, defined through theState parameter.
5362 theBox Shape for relative comparing.
5363 theShape Shape to find sub-shapes of.
5364 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5365 theState The state of the sub-shapes to find (see GEOM::shape_state)
5368 List of all found sub-shapes indices.
5370 # Example: see GEOM_TestOthers.py
5371 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5372 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5375 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5376 # situated relatively the specified \a theCheckShape by the
5377 # certain way, defined through \a theState parameter.
5378 # @param theCheckShape Shape for relative comparing. It must be a solid.
5379 # @param theShape Shape to find sub-shapes of.
5380 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5381 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5382 # @param theName Object name; when specified, this parameter is used
5383 # for result publication in the study. Otherwise, if automatic
5384 # publication is switched on, default value is used for result name.
5386 # @return List of all found sub-shapes.
5388 # @ref swig_GetShapesOnShape "Example"
5389 @ManageTransactions("ShapesOp")
5390 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5392 Find in theShape all sub-shapes of type theShapeType,
5393 situated relatively the specified theCheckShape by the
5394 certain way, defined through theState parameter.
5397 theCheckShape Shape for relative comparing. It must be a solid.
5398 theShape Shape to find sub-shapes of.
5399 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5400 theState The state of the sub-shapes to find (see GEOM::shape_state)
5401 theName Object name; when specified, this parameter is used
5402 for result publication in the study. Otherwise, if automatic
5403 publication is switched on, default value is used for result name.
5406 List of all found sub-shapes.
5408 # Example: see GEOM_TestOthers.py
5409 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5410 theShapeType, theState)
5411 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5412 self._autoPublish(aList, theName, "shapeOnShape")
5415 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5416 # situated relatively the specified \a theCheckShape by the
5417 # certain way, defined through \a theState parameter.
5418 # @param theCheckShape Shape for relative comparing. It must be a solid.
5419 # @param theShape Shape to find sub-shapes of.
5420 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5421 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5422 # @param theName Object name; when specified, this parameter is used
5423 # for result publication in the study. Otherwise, if automatic
5424 # publication is switched on, default value is used for result name.
5426 # @return All found sub-shapes as compound.
5428 # @ref swig_GetShapesOnShapeAsCompound "Example"
5429 @ManageTransactions("ShapesOp")
5430 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5432 Find in theShape all sub-shapes of type theShapeType,
5433 situated relatively the specified theCheckShape by the
5434 certain way, defined through theState parameter.
5437 theCheckShape Shape for relative comparing. It must be a solid.
5438 theShape Shape to find sub-shapes of.
5439 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5440 theState The state of the sub-shapes to find (see GEOM::shape_state)
5441 theName Object name; when specified, this parameter is used
5442 for result publication in the study. Otherwise, if automatic
5443 publication is switched on, default value is used for result name.
5446 All found sub-shapes as compound.
5448 # Example: see GEOM_TestOthers.py
5449 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5450 theShapeType, theState)
5451 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5452 self._autoPublish(anObj, theName, "shapeOnShape")
5455 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5456 # situated relatively the specified \a theCheckShape by the
5457 # certain way, defined through \a theState parameter.
5458 # @param theCheckShape Shape for relative comparing. It must be a solid.
5459 # @param theShape Shape to find sub-shapes of.
5460 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5461 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5463 # @return List of all found sub-shapes indices.
5465 # @ref swig_GetShapesOnShapeIDs "Example"
5466 @ManageTransactions("ShapesOp")
5467 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5469 Find in theShape all sub-shapes of type theShapeType,
5470 situated relatively the specified theCheckShape by the
5471 certain way, defined through theState parameter.
5474 theCheckShape Shape for relative comparing. It must be a solid.
5475 theShape Shape to find sub-shapes of.
5476 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5477 theState The state of the sub-shapes to find (see GEOM::shape_state)
5480 List of all found sub-shapes indices.
5482 # Example: see GEOM_TestOthers.py
5483 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5484 theShapeType, theState)
5485 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5488 ## Get sub-shape(s) of theShapeWhere, which are
5489 # coincident with \a theShapeWhat or could be a part of it.
5490 # @param theShapeWhere Shape to find sub-shapes of.
5491 # @param theShapeWhat Shape, specifying what to find.
5492 # @param isNewImplementation implementation of GetInPlace functionality
5493 # (default = False, old alghorithm based on shape properties)
5494 # @param theName Object name; when specified, this parameter is used
5495 # for result publication in the study. Otherwise, if automatic
5496 # publication is switched on, default value is used for result name.
5498 # @return Group of all found sub-shapes or a single found sub-shape.
5500 # @note This function has a restriction on argument shapes.
5501 # If \a theShapeWhere has curved parts with significantly
5502 # outstanding centres (i.e. the mass centre of a part is closer to
5503 # \a theShapeWhat than to the part), such parts will not be found.
5504 # @image html get_in_place_lost_part.png
5506 # @ref swig_GetInPlace "Example"
5507 @ManageTransactions("ShapesOp")
5508 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5510 Get sub-shape(s) of theShapeWhere, which are
5511 coincident with theShapeWhat or could be a part of it.
5514 theShapeWhere Shape to find sub-shapes of.
5515 theShapeWhat Shape, specifying what to find.
5516 isNewImplementation Implementation of GetInPlace functionality
5517 (default = False, old alghorithm based on shape properties)
5518 theName Object name; when specified, this parameter is used
5519 for result publication in the study. Otherwise, if automatic
5520 publication is switched on, default value is used for result name.
5523 Group of all found sub-shapes or a single found sub-shape.
5527 This function has a restriction on argument shapes.
5528 If theShapeWhere has curved parts with significantly
5529 outstanding centres (i.e. the mass centre of a part is closer to
5530 theShapeWhat than to the part), such parts will not be found.
5532 # Example: see GEOM_TestOthers.py
5534 if isNewImplementation:
5535 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5537 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5539 RaiseIfFailed("GetInPlace", self.ShapesOp)
5540 self._autoPublish(anObj, theName, "inplace")
5543 ## Get sub-shape(s) of \a theShapeWhere, which are
5544 # coincident with \a theShapeWhat or could be a part of it.
5546 # Implementation of this method is based on a saved history of an operation,
5547 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5548 # arguments (an argument shape or a sub-shape of an argument shape).
5549 # The operation could be the Partition or one of boolean operations,
5550 # performed on simple shapes (not on compounds).
5552 # @param theShapeWhere Shape to find sub-shapes of.
5553 # @param theShapeWhat Shape, specifying what to find (must be in the
5554 # building history of the ShapeWhere).
5555 # @param theName Object name; when specified, this parameter is used
5556 # for result publication in the study. Otherwise, if automatic
5557 # publication is switched on, default value is used for result name.
5559 # @return Group of all found sub-shapes or a single found sub-shape.
5561 # @ref swig_GetInPlace "Example"
5562 @ManageTransactions("ShapesOp")
5563 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5565 Implementation of this method is based on a saved history of an operation,
5566 produced theShapeWhere. The theShapeWhat must be among this operation's
5567 arguments (an argument shape or a sub-shape of an argument shape).
5568 The operation could be the Partition or one of boolean operations,
5569 performed on simple shapes (not on compounds).
5572 theShapeWhere Shape to find sub-shapes of.
5573 theShapeWhat Shape, specifying what to find (must be in the
5574 building history of the ShapeWhere).
5575 theName Object name; when specified, this parameter is used
5576 for result publication in the study. Otherwise, if automatic
5577 publication is switched on, default value is used for result name.
5580 Group of all found sub-shapes or a single found sub-shape.
5582 # Example: see GEOM_TestOthers.py
5583 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5584 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5585 self._autoPublish(anObj, theName, "inplace")
5588 ## Get sub-shape of theShapeWhere, which is
5589 # equal to \a theShapeWhat.
5590 # @param theShapeWhere Shape to find sub-shape of.
5591 # @param theShapeWhat Shape, specifying what to find.
5592 # @param theName Object name; when specified, this parameter is used
5593 # for result publication in the study. Otherwise, if automatic
5594 # publication is switched on, default value is used for result name.
5596 # @return New GEOM.GEOM_Object for found sub-shape.
5598 # @ref swig_GetSame "Example"
5599 @ManageTransactions("ShapesOp")
5600 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5602 Get sub-shape of theShapeWhere, which is
5603 equal to theShapeWhat.
5606 theShapeWhere Shape to find sub-shape of.
5607 theShapeWhat Shape, specifying what to find.
5608 theName Object name; when specified, this parameter is used
5609 for result publication in the study. Otherwise, if automatic
5610 publication is switched on, default value is used for result name.
5613 New GEOM.GEOM_Object for found sub-shape.
5615 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5616 RaiseIfFailed("GetSame", self.ShapesOp)
5617 self._autoPublish(anObj, theName, "sameShape")
5621 ## Get sub-shape indices of theShapeWhere, which is
5622 # equal to \a theShapeWhat.
5623 # @param theShapeWhere Shape to find sub-shape of.
5624 # @param theShapeWhat Shape, specifying what to find.
5625 # @return List of all found sub-shapes indices.
5627 # @ref swig_GetSame "Example"
5628 @ManageTransactions("ShapesOp")
5629 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5631 Get sub-shape indices of theShapeWhere, which is
5632 equal to theShapeWhat.
5635 theShapeWhere Shape to find sub-shape of.
5636 theShapeWhat Shape, specifying what to find.
5639 List of all found sub-shapes indices.
5641 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5642 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5649 ## @addtogroup l4_access
5652 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5653 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5654 # @param aShape Shape to get sub-shape of.
5655 # @param ListOfID List of sub-shapes indices.
5656 # @param theName Object name; when specified, this parameter is used
5657 # for result publication in the study. Otherwise, if automatic
5658 # publication is switched on, default value is used for result name.
5660 # @return Found sub-shape.
5662 # @ref swig_all_decompose "Example"
5663 def GetSubShape(self, aShape, ListOfID, theName=None):
5665 Obtain a composite sub-shape of aShape, composed from sub-shapes
5666 of aShape, selected by their unique IDs inside aShape
5669 aShape Shape to get sub-shape of.
5670 ListOfID List of sub-shapes indices.
5671 theName Object name; when specified, this parameter is used
5672 for result publication in the study. Otherwise, if automatic
5673 publication is switched on, default value is used for result name.
5678 # Example: see GEOM_TestAll.py
5679 anObj = self.AddSubShape(aShape,ListOfID)
5680 self._autoPublish(anObj, theName, "subshape")
5683 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5684 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5685 # @param aShape Shape to get sub-shape of.
5686 # @param aSubShape Sub-shapes of aShape.
5687 # @return ID of found sub-shape.
5689 # @ref swig_all_decompose "Example"
5690 @ManageTransactions("LocalOp")
5691 def GetSubShapeID(self, aShape, aSubShape):
5693 Obtain unique ID of sub-shape aSubShape inside aShape
5694 of aShape, selected by their unique IDs inside aShape
5697 aShape Shape to get sub-shape of.
5698 aSubShape Sub-shapes of aShape.
5701 ID of found sub-shape.
5703 # Example: see GEOM_TestAll.py
5704 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5705 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5708 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5709 # This function is provided for performance purpose. The complexity is O(n) with n
5710 # the number of subobjects of aShape
5711 # @param aShape Shape to get sub-shape of.
5712 # @param aSubShapes Sub-shapes of aShape.
5713 # @return list of IDs of found sub-shapes.
5715 # @ref swig_all_decompose "Example"
5716 @ManageTransactions("ShapesOp")
5717 def GetSubShapesIDs(self, aShape, aSubShapes):
5719 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5720 This function is provided for performance purpose. The complexity is O(n) with n
5721 the number of subobjects of aShape
5724 aShape Shape to get sub-shape of.
5725 aSubShapes Sub-shapes of aShape.
5728 List of IDs of found sub-shape.
5730 # Example: see GEOM_TestAll.py
5731 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5732 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5738 ## @addtogroup l4_decompose
5741 ## Get all sub-shapes and groups of \a theShape,
5742 # that were created already by any other methods.
5743 # @param theShape Any shape.
5744 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5745 # returned, else all found sub-shapes and groups.
5746 # @return List of existing sub-objects of \a theShape.
5748 # @ref swig_all_decompose "Example"
5749 @ManageTransactions("ShapesOp")
5750 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5752 Get all sub-shapes and groups of theShape,
5753 that were created already by any other methods.
5757 theGroupsOnly If this parameter is TRUE, only groups will be
5758 returned, else all found sub-shapes and groups.
5761 List of existing sub-objects of theShape.
5763 # Example: see GEOM_TestAll.py
5764 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5765 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5768 ## Get all groups of \a theShape,
5769 # that were created already by any other methods.
5770 # @param theShape Any shape.
5771 # @return List of existing groups of \a theShape.
5773 # @ref swig_all_decompose "Example"
5774 @ManageTransactions("ShapesOp")
5775 def GetGroups(self, theShape):
5777 Get all groups of theShape,
5778 that were created already by any other methods.
5784 List of existing groups of theShape.
5786 # Example: see GEOM_TestAll.py
5787 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5788 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5791 ## Explode a shape on sub-shapes of a given type.
5792 # If the shape itself matches the type, it is also returned.
5793 # @param aShape Shape to be exploded.
5794 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5795 # @param theName Object name; when specified, this parameter is used
5796 # for result publication in the study. Otherwise, if automatic
5797 # publication is switched on, default value is used for result name.
5799 # @return List of sub-shapes of type theShapeType, contained in theShape.
5801 # @ref swig_all_decompose "Example"
5802 @ManageTransactions("ShapesOp")
5803 def SubShapeAll(self, aShape, aType, theName=None):
5805 Explode a shape on sub-shapes of a given type.
5806 If the shape itself matches the type, it is also returned.
5809 aShape Shape to be exploded.
5810 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5811 theName Object name; when specified, this parameter is used
5812 for result publication in the study. Otherwise, if automatic
5813 publication is switched on, default value is used for result name.
5816 List of sub-shapes of type theShapeType, contained in theShape.
5818 # Example: see GEOM_TestAll.py
5819 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5820 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5821 self._autoPublish(ListObj, theName, "subshape")
5824 ## Explode a shape on sub-shapes of a given type.
5825 # @param aShape Shape to be exploded.
5826 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5827 # @return List of IDs of sub-shapes.
5829 # @ref swig_all_decompose "Example"
5830 @ManageTransactions("ShapesOp")
5831 def SubShapeAllIDs(self, aShape, aType):
5833 Explode a shape on sub-shapes of a given type.
5836 aShape Shape to be exploded (see geompy.ShapeType)
5837 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5840 List of IDs of sub-shapes.
5842 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5843 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5846 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5847 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5848 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5849 # @param aShape Shape to get sub-shape of.
5850 # @param ListOfInd List of sub-shapes indices.
5851 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5852 # @param theName Object name; when specified, this parameter is used
5853 # for result publication in the study. Otherwise, if automatic
5854 # publication is switched on, default value is used for result name.
5856 # @return A compound of sub-shapes of aShape.
5858 # @ref swig_all_decompose "Example"
5859 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5861 Obtain a compound of sub-shapes of aShape,
5862 selected by their indices in list of all sub-shapes of type aType.
5863 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5866 aShape Shape to get sub-shape of.
5867 ListOfID List of sub-shapes indices.
5868 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5869 theName Object name; when specified, this parameter is used
5870 for result publication in the study. Otherwise, if automatic
5871 publication is switched on, default value is used for result name.
5874 A compound of sub-shapes of aShape.
5876 # Example: see GEOM_TestAll.py
5878 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5879 for ind in ListOfInd:
5880 ListOfIDs.append(AllShapeIDsList[ind - 1])
5881 # note: auto-publishing is done in self.GetSubShape()
5882 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5885 ## Explode a shape on sub-shapes of a given type.
5886 # Sub-shapes will be sorted taking into account their gravity centers,
5887 # to provide stable order of sub-shapes.
5888 # If the shape itself matches the type, it is also returned.
5889 # @param aShape Shape to be exploded.
5890 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5891 # @param theName Object name; when specified, this parameter is used
5892 # for result publication in the study. Otherwise, if automatic
5893 # publication is switched on, default value is used for result name.
5895 # @return List of sub-shapes of type theShapeType, contained in theShape.
5897 # @ref swig_SubShapeAllSorted "Example"
5898 @ManageTransactions("ShapesOp")
5899 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5901 Explode a shape on sub-shapes of a given type.
5902 Sub-shapes will be sorted taking into account their gravity centers,
5903 to provide stable order of sub-shapes.
5904 If the shape itself matches the type, it is also returned.
5907 aShape Shape to be exploded.
5908 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5909 theName Object name; when specified, this parameter is used
5910 for result publication in the study. Otherwise, if automatic
5911 publication is switched on, default value is used for result name.
5914 List of sub-shapes of type theShapeType, contained in theShape.
5916 # Example: see GEOM_TestAll.py
5917 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5918 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5919 self._autoPublish(ListObj, theName, "subshape")
5922 ## Explode a shape on sub-shapes of a given type.
5923 # Sub-shapes will be sorted taking into account their gravity centers,
5924 # to provide stable order of sub-shapes.
5925 # @param aShape Shape to be exploded.
5926 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5927 # @return List of IDs of sub-shapes.
5929 # @ref swig_all_decompose "Example"
5930 @ManageTransactions("ShapesOp")
5931 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5933 Explode a shape on sub-shapes of a given type.
5934 Sub-shapes will be sorted taking into account their gravity centers,
5935 to provide stable order of sub-shapes.
5938 aShape Shape to be exploded.
5939 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5942 List of IDs of sub-shapes.
5944 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5945 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5948 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5949 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5950 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5951 # @param aShape Shape to get sub-shape of.
5952 # @param ListOfInd List of sub-shapes indices.
5953 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5954 # @param theName Object name; when specified, this parameter is used
5955 # for result publication in the study. Otherwise, if automatic
5956 # publication is switched on, default value is used for result name.
5958 # @return A compound of sub-shapes of aShape.
5960 # @ref swig_all_decompose "Example"
5961 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5963 Obtain a compound of sub-shapes of aShape,
5964 selected by they indices in sorted list of all sub-shapes of type aType.
5965 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5968 aShape Shape to get sub-shape of.
5969 ListOfID List of sub-shapes indices.
5970 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5971 theName Object name; when specified, this parameter is used
5972 for result publication in the study. Otherwise, if automatic
5973 publication is switched on, default value is used for result name.
5976 A compound of sub-shapes of aShape.
5978 # Example: see GEOM_TestAll.py
5980 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5981 for ind in ListOfInd:
5982 ListOfIDs.append(AllShapeIDsList[ind - 1])
5983 # note: auto-publishing is done in self.GetSubShape()
5984 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5987 ## Extract shapes (excluding the main shape) of given type.
5988 # @param aShape The shape.
5989 # @param aType The shape type (see ShapeType())
5990 # @param isSorted Boolean flag to switch sorting on/off.
5991 # @param theName Object name; when specified, this parameter is used
5992 # for result publication in the study. Otherwise, if automatic
5993 # publication is switched on, default value is used for result name.
5995 # @return List of sub-shapes of type aType, contained in aShape.
5997 # @ref swig_FilletChamfer "Example"
5998 @ManageTransactions("ShapesOp")
5999 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6001 Extract shapes (excluding the main shape) of given type.
6005 aType The shape type (see geompy.ShapeType)
6006 isSorted Boolean flag to switch sorting on/off.
6007 theName Object name; when specified, this parameter is used
6008 for result publication in the study. Otherwise, if automatic
6009 publication is switched on, default value is used for result name.
6012 List of sub-shapes of type aType, contained in aShape.
6014 # Example: see GEOM_TestAll.py
6015 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6016 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6017 self._autoPublish(ListObj, theName, "subshape")
6020 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6021 # @param aShape Main shape.
6022 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6023 # @param theName Object name; when specified, this parameter is used
6024 # for result publication in the study. Otherwise, if automatic
6025 # publication is switched on, default value is used for result name.
6026 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6028 # @ref swig_all_decompose "Example"
6029 @ManageTransactions("ShapesOp")
6030 def SubShapes(self, aShape, anIDs, theName=None):
6032 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6036 anIDs List of unique IDs of sub-shapes inside theMainShape.
6037 theName Object name; when specified, this parameter is used
6038 for result publication in the study. Otherwise, if automatic
6039 publication is switched on, default value is used for result name.
6042 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6044 # Example: see GEOM_TestAll.py
6045 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6046 RaiseIfFailed("SubShapes", self.ShapesOp)
6047 self._autoPublish(ListObj, theName, "subshape")
6050 ## Explode a shape into edges sorted in a row from a starting point.
6051 # @param theShape the shape to be exploded on edges.
6052 # @param theStartPoint the starting point.
6053 # @param theName Object name; when specified, this parameter is used
6054 # for result publication in the study. Otherwise, if automatic
6055 # publication is switched on, default value is used for result name.
6056 # @return List of GEOM.GEOM_Object that is actually an ordered list
6057 # of edges sorted in a row from a starting point.
6059 # @ref swig_GetSubShapeEdgeSorted "Example"
6060 @ManageTransactions("ShapesOp")
6061 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6063 Explode a shape into edges sorted in a row from a starting point.
6066 theShape the shape to be exploded on edges.
6067 theStartPoint the starting point.
6068 theName Object name; when specified, this parameter is used
6069 for result publication in the study. Otherwise, if automatic
6070 publication is switched on, default value is used for result name.
6073 List of GEOM.GEOM_Object that is actually an ordered list
6074 of edges sorted in a row from a starting point.
6076 # Example: see GEOM_TestAll.py
6077 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6078 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6079 self._autoPublish(ListObj, theName, "SortedEdges")
6082 # end of l4_decompose
6085 ## @addtogroup l4_decompose_d
6088 ## Deprecated method
6089 # It works like SubShapeAllSortedCentres(), but wrongly
6090 # defines centres of faces, shells and solids.
6091 @ManageTransactions("ShapesOp")
6092 def SubShapeAllSorted(self, aShape, aType, theName=None):
6095 It works like geompy.SubShapeAllSortedCentres, but wrongly
6096 defines centres of faces, shells and solids.
6098 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6099 RaiseIfFailed("MakeExplode", self.ShapesOp)
6100 self._autoPublish(ListObj, theName, "subshape")
6103 ## Deprecated method
6104 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6105 # defines centres of faces, shells and solids.
6106 @ManageTransactions("ShapesOp")
6107 def SubShapeAllSortedIDs(self, aShape, aType):
6110 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6111 defines centres of faces, shells and solids.
6113 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6114 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6117 ## Deprecated method
6118 # It works like SubShapeSortedCentres(), but has a bug
6119 # (wrongly defines centres of faces, shells and solids).
6120 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6123 It works like geompy.SubShapeSortedCentres, but has a bug
6124 (wrongly defines centres of faces, shells and solids).
6127 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6128 for ind in ListOfInd:
6129 ListOfIDs.append(AllShapeIDsList[ind - 1])
6130 # note: auto-publishing is done in self.GetSubShape()
6131 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6134 # end of l4_decompose_d
6137 ## @addtogroup l3_healing
6140 ## Apply a sequence of Shape Healing operators to the given object.
6141 # @param theShape Shape to be processed.
6142 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6143 # @param theParameters List of names of parameters
6144 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6145 # @param theValues List of values of parameters, in the same order
6146 # as parameters are listed in <VAR>theParameters</VAR> list.
6147 # @param theName Object name; when specified, this parameter is used
6148 # for result publication in the study. Otherwise, if automatic
6149 # publication is switched on, default value is used for result name.
6151 # <b> Operators and Parameters: </b> \n
6153 # * \b FixShape - corrects invalid shapes. \n
6154 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6155 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6157 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6158 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6159 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6160 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6162 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6163 # surfaces in segments using a certain angle. \n
6164 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6165 # if Angle=180, four if Angle=90, etc). \n
6166 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6168 # * \b SplitClosedFaces - splits closed faces in segments.
6169 # The number of segments depends on the number of splitting points.\n
6170 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6172 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6173 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6174 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6175 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6176 # This and the previous parameters can take the following values:\n
6177 # \b Parametric \b Continuity \n
6178 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6179 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6180 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6181 # ruling out sharp edges).\n
6182 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6183 # are of the same magnitude).\n
6184 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6185 # or surfaces (d/du C(u)) are the same at junction. \n
6186 # \b Geometric \b Continuity \n
6187 # \b G1: first derivatives are proportional at junction.\n
6188 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6189 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6190 # \b G2: first and second derivatives are proportional at junction.
6191 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6192 # continuity requires that the underlying parameterization was continuous as well.
6193 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6195 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6196 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6197 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6198 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6199 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6200 # with the specified parameters.\n
6201 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6202 # with the specified parameters.\n
6203 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6204 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6205 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6206 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6208 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6209 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6210 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6211 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6212 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6214 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6215 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6218 # @return New GEOM.GEOM_Object, containing processed shape.
6220 # \n @ref tui_shape_processing "Example"
6221 @ManageTransactions("HealOp")
6222 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6224 Apply a sequence of Shape Healing operators to the given object.
6227 theShape Shape to be processed.
6228 theValues List of values of parameters, in the same order
6229 as parameters are listed in theParameters list.
6230 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6231 theParameters List of names of parameters
6232 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6233 theName Object name; when specified, this parameter is used
6234 for result publication in the study. Otherwise, if automatic
6235 publication is switched on, default value is used for result name.
6237 Operators and Parameters:
6239 * FixShape - corrects invalid shapes.
6240 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6241 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6242 * FixFaceSize - removes small faces, such as spots and strips.
6243 * FixFaceSize.Tolerance - defines minimum possible face size.
6244 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6245 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6246 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6247 in segments using a certain angle.
6248 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6249 if Angle=180, four if Angle=90, etc).
6250 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6251 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6253 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6254 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6255 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6256 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6257 * SplitContinuity.CurveContinuity - required continuity for curves.
6258 This and the previous parameters can take the following values:
6260 Parametric Continuity:
6261 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6262 coincidental. The curves or surfaces may still meet at an angle,
6263 giving rise to a sharp corner or edge).
6264 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6265 are parallel, ruling out sharp edges).
6266 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6267 or surfaces are of the same magnitude).
6268 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6269 curves or surfaces (d/du C(u)) are the same at junction.
6271 Geometric Continuity:
6272 G1: first derivatives are proportional at junction.
6273 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6274 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6275 G2: first and second derivatives are proportional at junction. As the names imply,
6276 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6277 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6278 geometric continuity of order n, but not vice-versa.
6279 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6280 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6281 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6282 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6283 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6284 the specified parameters.
6285 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6286 the specified parameters.
6287 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6288 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6289 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6290 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6291 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6292 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6293 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6294 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6295 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6296 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6297 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6300 New GEOM.GEOM_Object, containing processed shape.
6302 Note: For more information look through SALOME Geometry User's Guide->
6303 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6305 # Example: see GEOM_TestHealing.py
6306 theValues,Parameters = ParseList(theValues)
6307 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6308 # To avoid script failure in case of good argument shape
6309 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6311 RaiseIfFailed("ProcessShape", self.HealOp)
6312 for string in (theOperators + theParameters):
6313 Parameters = ":" + Parameters
6315 anObj.SetParameters(Parameters)
6316 self._autoPublish(anObj, theName, "healed")
6319 ## Remove faces from the given object (shape).
6320 # @param theObject Shape to be processed.
6321 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6322 # removes ALL faces of the given object.
6323 # @param theName Object name; when specified, this parameter is used
6324 # for result publication in the study. Otherwise, if automatic
6325 # publication is switched on, default value is used for result name.
6327 # @return New GEOM.GEOM_Object, containing processed shape.
6329 # @ref tui_suppress_faces "Example"
6330 @ManageTransactions("HealOp")
6331 def SuppressFaces(self, theObject, theFaces, theName=None):
6333 Remove faces from the given object (shape).
6336 theObject Shape to be processed.
6337 theFaces Indices of faces to be removed, if EMPTY then the method
6338 removes ALL faces of the given object.
6339 theName Object name; when specified, this parameter is used
6340 for result publication in the study. Otherwise, if automatic
6341 publication is switched on, default value is used for result name.
6344 New GEOM.GEOM_Object, containing processed shape.
6346 # Example: see GEOM_TestHealing.py
6347 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6348 RaiseIfFailed("SuppressFaces", self.HealOp)
6349 self._autoPublish(anObj, theName, "suppressFaces")
6352 ## Sewing of some shapes into single shape.
6353 # @param ListShape Shapes to be processed.
6354 # @param theTolerance Required tolerance value.
6355 # @param AllowNonManifold Flag that allows non-manifold sewing.
6356 # @param theName Object name; when specified, this parameter is used
6357 # for result publication in the study. Otherwise, if automatic
6358 # publication is switched on, default value is used for result name.
6360 # @return New GEOM.GEOM_Object, containing processed shape.
6362 # @ref tui_sewing "Example"
6363 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6365 Sewing of some shapes into single shape.
6368 ListShape Shapes to be processed.
6369 theTolerance Required tolerance value.
6370 AllowNonManifold Flag that allows non-manifold sewing.
6371 theName Object name; when specified, this parameter is used
6372 for result publication in the study. Otherwise, if automatic
6373 publication is switched on, default value is used for result name.
6376 New GEOM.GEOM_Object, containing processed shape.
6378 # Example: see GEOM_TestHealing.py
6379 comp = self.MakeCompound(ListShape)
6380 # note: auto-publishing is done in self.Sew()
6381 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6384 ## Sewing of the given object.
6385 # @param theObject Shape to be processed.
6386 # @param theTolerance Required tolerance value.
6387 # @param AllowNonManifold Flag that allows non-manifold sewing.
6388 # @param theName Object name; when specified, this parameter is used
6389 # for result publication in the study. Otherwise, if automatic
6390 # publication is switched on, default value is used for result name.
6392 # @return New GEOM.GEOM_Object, containing processed shape.
6393 @ManageTransactions("HealOp")
6394 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6396 Sewing of the given object.
6399 theObject Shape to be processed.
6400 theTolerance Required tolerance value.
6401 AllowNonManifold Flag that allows non-manifold sewing.
6402 theName Object name; when specified, this parameter is used
6403 for result publication in the study. Otherwise, if automatic
6404 publication is switched on, default value is used for result name.
6407 New GEOM.GEOM_Object, containing processed shape.
6409 # Example: see MakeSewing() above
6410 theTolerance,Parameters = ParseParameters(theTolerance)
6411 if AllowNonManifold:
6412 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6414 anObj = self.HealOp.Sew(theObject, theTolerance)
6415 # To avoid script failure in case of good argument shape
6416 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6418 RaiseIfFailed("Sew", self.HealOp)
6419 anObj.SetParameters(Parameters)
6420 self._autoPublish(anObj, theName, "sewed")
6423 ## Rebuild the topology of theCompound of solids by removing
6424 # of the faces that are shared by several solids.
6425 # @param theCompound Shape to be processed.
6426 # @param theName Object name; when specified, this parameter is used
6427 # for result publication in the study. Otherwise, if automatic
6428 # publication is switched on, default value is used for result name.
6430 # @return New GEOM.GEOM_Object, containing processed shape.
6432 # @ref tui_remove_webs "Example"
6433 @ManageTransactions("HealOp")
6434 def RemoveInternalFaces (self, theCompound, theName=None):
6436 Rebuild the topology of theCompound of solids by removing
6437 of the faces that are shared by several solids.
6440 theCompound Shape to be processed.
6441 theName Object name; when specified, this parameter is used
6442 for result publication in the study. Otherwise, if automatic
6443 publication is switched on, default value is used for result name.
6446 New GEOM.GEOM_Object, containing processed shape.
6448 # Example: see GEOM_TestHealing.py
6449 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6450 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6451 self._autoPublish(anObj, theName, "removeWebs")
6454 ## Remove internal wires and edges from the given object (face).
6455 # @param theObject Shape to be processed.
6456 # @param theWires Indices of wires to be removed, if EMPTY then the method
6457 # removes ALL internal wires of the given object.
6458 # @param theName Object name; when specified, this parameter is used
6459 # for result publication in the study. Otherwise, if automatic
6460 # publication is switched on, default value is used for result name.
6462 # @return New GEOM.GEOM_Object, containing processed shape.
6464 # @ref tui_suppress_internal_wires "Example"
6465 @ManageTransactions("HealOp")
6466 def SuppressInternalWires(self, theObject, theWires, theName=None):
6468 Remove internal wires and edges from the given object (face).
6471 theObject Shape to be processed.
6472 theWires Indices of wires to be removed, if EMPTY then the method
6473 removes ALL internal wires of the given object.
6474 theName Object name; when specified, this parameter is used
6475 for result publication in the study. Otherwise, if automatic
6476 publication is switched on, default value is used for result name.
6479 New GEOM.GEOM_Object, containing processed shape.
6481 # Example: see GEOM_TestHealing.py
6482 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6483 RaiseIfFailed("RemoveIntWires", self.HealOp)
6484 self._autoPublish(anObj, theName, "suppressWires")
6487 ## Remove internal closed contours (holes) from the given object.
6488 # @param theObject Shape to be processed.
6489 # @param theWires Indices of wires to be removed, if EMPTY then the method
6490 # removes ALL internal holes of the given object
6491 # @param theName Object name; when specified, this parameter is used
6492 # for result publication in the study. Otherwise, if automatic
6493 # publication is switched on, default value is used for result name.
6495 # @return New GEOM.GEOM_Object, containing processed shape.
6497 # @ref tui_suppress_holes "Example"
6498 @ManageTransactions("HealOp")
6499 def SuppressHoles(self, theObject, theWires, theName=None):
6501 Remove internal closed contours (holes) from the given object.
6504 theObject Shape to be processed.
6505 theWires Indices of wires to be removed, if EMPTY then the method
6506 removes ALL internal holes of the given object
6507 theName Object name; when specified, this parameter is used
6508 for result publication in the study. Otherwise, if automatic
6509 publication is switched on, default value is used for result name.
6512 New GEOM.GEOM_Object, containing processed shape.
6514 # Example: see GEOM_TestHealing.py
6515 anObj = self.HealOp.FillHoles(theObject, theWires)
6516 RaiseIfFailed("FillHoles", self.HealOp)
6517 self._autoPublish(anObj, theName, "suppressHoles")
6520 ## Close an open wire.
6521 # @param theObject Shape to be processed.
6522 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6523 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6524 # @param isCommonVertex If True : closure by creation of a common vertex,
6525 # If False : closure by creation of an edge between ends.
6526 # @param theName Object name; when specified, this parameter is used
6527 # for result publication in the study. Otherwise, if automatic
6528 # publication is switched on, default value is used for result name.
6530 # @return New GEOM.GEOM_Object, containing processed shape.
6532 # @ref tui_close_contour "Example"
6533 @ManageTransactions("HealOp")
6534 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6539 theObject Shape to be processed.
6540 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6541 if [ ], then theObject itself is a wire.
6542 isCommonVertex If True : closure by creation of a common vertex,
6543 If False : closure by creation of an edge between ends.
6544 theName Object name; when specified, this parameter is used
6545 for result publication in the study. Otherwise, if automatic
6546 publication is switched on, default value is used for result name.
6549 New GEOM.GEOM_Object, containing processed shape.
6551 # Example: see GEOM_TestHealing.py
6552 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6553 RaiseIfFailed("CloseContour", self.HealOp)
6554 self._autoPublish(anObj, theName, "closeContour")
6557 ## Addition of a point to a given edge object.
6558 # @param theObject Shape to be processed.
6559 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6560 # if -1, then theObject itself is the edge.
6561 # @param theValue Value of parameter on edge or length parameter,
6562 # depending on \a isByParameter.
6563 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6564 # if FALSE : \a theValue is treated as a length parameter [0..1]
6565 # @param theName Object name; when specified, this parameter is used
6566 # for result publication in the study. Otherwise, if automatic
6567 # publication is switched on, default value is used for result name.
6569 # @return New GEOM.GEOM_Object, containing processed shape.
6571 # @ref tui_add_point_on_edge "Example"
6572 @ManageTransactions("HealOp")
6573 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6575 Addition of a point to a given edge object.
6578 theObject Shape to be processed.
6579 theEdgeIndex Index of edge to be divided within theObject's shape,
6580 if -1, then theObject itself is the edge.
6581 theValue Value of parameter on edge or length parameter,
6582 depending on isByParameter.
6583 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6584 if FALSE : theValue is treated as a length parameter [0..1]
6585 theName Object name; when specified, this parameter is used
6586 for result publication in the study. Otherwise, if automatic
6587 publication is switched on, default value is used for result name.
6590 New GEOM.GEOM_Object, containing processed shape.
6592 # Example: see GEOM_TestHealing.py
6593 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6594 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6595 RaiseIfFailed("DivideEdge", self.HealOp)
6596 anObj.SetParameters(Parameters)
6597 self._autoPublish(anObj, theName, "divideEdge")
6600 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6601 # @param theWire Wire to minimize the number of C1 continuous edges in.
6602 # @param theVertices A list of vertices to suppress. If the list
6603 # is empty, all vertices in a wire will be assumed.
6604 # @param theName Object name; when specified, this parameter is used
6605 # for result publication in the study. Otherwise, if automatic
6606 # publication is switched on, default value is used for result name.
6608 # @return New GEOM.GEOM_Object with modified wire.
6610 # @ref tui_fuse_collinear_edges "Example"
6611 @ManageTransactions("HealOp")
6612 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6614 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6617 theWire Wire to minimize the number of C1 continuous edges in.
6618 theVertices A list of vertices to suppress. If the list
6619 is empty, all vertices in a wire will be assumed.
6620 theName Object name; when specified, this parameter is used
6621 for result publication in the study. Otherwise, if automatic
6622 publication is switched on, default value is used for result name.
6625 New GEOM.GEOM_Object with modified wire.
6627 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6628 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6629 self._autoPublish(anObj, theName, "fuseEdges")
6632 ## Change orientation of the given object. Updates given shape.
6633 # @param theObject Shape to be processed.
6634 # @return Updated <var>theObject</var>
6636 # @ref swig_todo "Example"
6637 @ManageTransactions("HealOp")
6638 def ChangeOrientationShell(self,theObject):
6640 Change orientation of the given object. Updates given shape.
6643 theObject Shape to be processed.
6648 theObject = self.HealOp.ChangeOrientation(theObject)
6649 RaiseIfFailed("ChangeOrientation", self.HealOp)
6652 ## Change orientation of the given object.
6653 # @param theObject Shape to be processed.
6654 # @param theName Object name; when specified, this parameter is used
6655 # for result publication in the study. Otherwise, if automatic
6656 # publication is switched on, default value is used for result name.
6658 # @return New GEOM.GEOM_Object, containing processed shape.
6660 # @ref swig_todo "Example"
6661 @ManageTransactions("HealOp")
6662 def ChangeOrientationShellCopy(self, theObject, theName=None):
6664 Change orientation of the given object.
6667 theObject Shape to be processed.
6668 theName Object name; when specified, this parameter is used
6669 for result publication in the study. Otherwise, if automatic
6670 publication is switched on, default value is used for result name.
6673 New GEOM.GEOM_Object, containing processed shape.
6675 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6676 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6677 self._autoPublish(anObj, theName, "reversed")
6680 ## Try to limit tolerance of the given object by value \a theTolerance.
6681 # @param theObject Shape to be processed.
6682 # @param theTolerance Required tolerance value.
6683 # @param theName Object name; when specified, this parameter is used
6684 # for result publication in the study. Otherwise, if automatic
6685 # publication is switched on, default value is used for result name.
6687 # @return New GEOM.GEOM_Object, containing processed shape.
6689 # @ref tui_limit_tolerance "Example"
6690 @ManageTransactions("HealOp")
6691 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6693 Try to limit tolerance of the given object by value theTolerance.
6696 theObject Shape to be processed.
6697 theTolerance Required tolerance value.
6698 theName Object name; when specified, this parameter is used
6699 for result publication in the study. Otherwise, if automatic
6700 publication is switched on, default value is used for result name.
6703 New GEOM.GEOM_Object, containing processed shape.
6705 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6706 RaiseIfFailed("LimitTolerance", self.HealOp)
6707 self._autoPublish(anObj, theName, "limitTolerance")
6710 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6711 # that constitute a free boundary of the given shape.
6712 # @param theObject Shape to get free boundary of.
6713 # @param theName Object name; when specified, this parameter is used
6714 # for result publication in the study. Otherwise, if automatic
6715 # publication is switched on, default value is used for result name.
6717 # @return [\a status, \a theClosedWires, \a theOpenWires]
6718 # \n \a status: FALSE, if an error(s) occured during the method execution.
6719 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6720 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6722 # @ref tui_measurement_tools_page "Example"
6723 @ManageTransactions("HealOp")
6724 def GetFreeBoundary(self, theObject, theName=None):
6726 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6727 that constitute a free boundary of the given shape.
6730 theObject Shape to get free boundary of.
6731 theName Object name; when specified, this parameter is used
6732 for result publication in the study. Otherwise, if automatic
6733 publication is switched on, default value is used for result name.
6736 [status, theClosedWires, theOpenWires]
6737 status: FALSE, if an error(s) occured during the method execution.
6738 theClosedWires: Closed wires on the free boundary of the given shape.
6739 theOpenWires: Open wires on the free boundary of the given shape.
6741 # Example: see GEOM_TestHealing.py
6742 anObj = self.HealOp.GetFreeBoundary(theObject)
6743 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6744 self._autoPublish(anObj[1], theName, "closedWire")
6745 self._autoPublish(anObj[2], theName, "openWire")
6748 ## Replace coincident faces in theShape by one face.
6749 # @param theShape Initial shape.
6750 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6751 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6752 # otherwise all initial shapes.
6753 # @param theName Object name; when specified, this parameter is used
6754 # for result publication in the study. Otherwise, if automatic
6755 # publication is switched on, default value is used for result name.
6757 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6759 # @ref tui_glue_faces "Example"
6760 @ManageTransactions("ShapesOp")
6761 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6763 Replace coincident faces in theShape by one face.
6766 theShape Initial shape.
6767 theTolerance Maximum distance between faces, which can be considered as coincident.
6768 doKeepNonSolids If FALSE, only solids will present in the result,
6769 otherwise all initial shapes.
6770 theName Object name; when specified, this parameter is used
6771 for result publication in the study. Otherwise, if automatic
6772 publication is switched on, default value is used for result name.
6775 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6777 # Example: see GEOM_Spanner.py
6778 theTolerance,Parameters = ParseParameters(theTolerance)
6779 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6781 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6782 anObj.SetParameters(Parameters)
6783 self._autoPublish(anObj, theName, "glueFaces")
6786 ## Find coincident faces in theShape for possible gluing.
6787 # @param theShape Initial shape.
6788 # @param theTolerance Maximum distance between faces,
6789 # which can be considered as coincident.
6790 # @param theName Object name; when specified, this parameter is used
6791 # for result publication in the study. Otherwise, if automatic
6792 # publication is switched on, default value is used for result name.
6794 # @return GEOM.ListOfGO
6796 # @ref tui_glue_faces "Example"
6797 @ManageTransactions("ShapesOp")
6798 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6800 Find coincident faces in theShape for possible gluing.
6803 theShape Initial shape.
6804 theTolerance Maximum distance between faces,
6805 which can be considered as coincident.
6806 theName Object name; when specified, this parameter is used
6807 for result publication in the study. Otherwise, if automatic
6808 publication is switched on, default value is used for result name.
6813 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6814 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6815 self._autoPublish(anObj, theName, "facesToGlue")
6818 ## Replace coincident faces in theShape by one face
6819 # in compliance with given list of faces
6820 # @param theShape Initial shape.
6821 # @param theTolerance Maximum distance between faces,
6822 # which can be considered as coincident.
6823 # @param theFaces List of faces for gluing.
6824 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6825 # otherwise all initial shapes.
6826 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6827 # will be glued, otherwise only the edges,
6828 # belonging to <VAR>theFaces</VAR>.
6829 # @param theName Object name; when specified, this parameter is used
6830 # for result publication in the study. Otherwise, if automatic
6831 # publication is switched on, default value is used for result name.
6833 # @return New GEOM.GEOM_Object, containing a copy of theShape
6834 # without some faces.
6836 # @ref tui_glue_faces "Example"
6837 @ManageTransactions("ShapesOp")
6838 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6839 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6841 Replace coincident faces in theShape by one face
6842 in compliance with given list of faces
6845 theShape Initial shape.
6846 theTolerance Maximum distance between faces,
6847 which can be considered as coincident.
6848 theFaces List of faces for gluing.
6849 doKeepNonSolids If FALSE, only solids will present in the result,
6850 otherwise all initial shapes.
6851 doGlueAllEdges If TRUE, all coincident edges of theShape
6852 will be glued, otherwise only the edges,
6853 belonging to theFaces.
6854 theName Object name; when specified, this parameter is used
6855 for result publication in the study. Otherwise, if automatic
6856 publication is switched on, default value is used for result name.
6859 New GEOM.GEOM_Object, containing a copy of theShape
6862 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6863 doKeepNonSolids, doGlueAllEdges)
6865 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6866 self._autoPublish(anObj, theName, "glueFaces")
6869 ## Replace coincident edges in theShape by one edge.
6870 # @param theShape Initial shape.
6871 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6872 # @param theName Object name; when specified, this parameter is used
6873 # for result publication in the study. Otherwise, if automatic
6874 # publication is switched on, default value is used for result name.
6876 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6878 # @ref tui_glue_edges "Example"
6879 @ManageTransactions("ShapesOp")
6880 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6882 Replace coincident edges in theShape by one edge.
6885 theShape Initial shape.
6886 theTolerance Maximum distance between edges, which can be considered as coincident.
6887 theName Object name; when specified, this parameter is used
6888 for result publication in the study. Otherwise, if automatic
6889 publication is switched on, default value is used for result name.
6892 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6894 theTolerance,Parameters = ParseParameters(theTolerance)
6895 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6897 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6898 anObj.SetParameters(Parameters)
6899 self._autoPublish(anObj, theName, "glueEdges")
6902 ## Find coincident edges in theShape for possible gluing.
6903 # @param theShape Initial shape.
6904 # @param theTolerance Maximum distance between edges,
6905 # which can be considered as coincident.
6906 # @param theName Object name; when specified, this parameter is used
6907 # for result publication in the study. Otherwise, if automatic
6908 # publication is switched on, default value is used for result name.
6910 # @return GEOM.ListOfGO
6912 # @ref tui_glue_edges "Example"
6913 @ManageTransactions("ShapesOp")
6914 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6916 Find coincident edges in theShape for possible gluing.
6919 theShape Initial shape.
6920 theTolerance Maximum distance between edges,
6921 which can be considered as coincident.
6922 theName Object name; when specified, this parameter is used
6923 for result publication in the study. Otherwise, if automatic
6924 publication is switched on, default value is used for result name.
6929 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6930 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6931 self._autoPublish(anObj, theName, "edgesToGlue")
6934 ## Replace coincident edges in theShape by one edge
6935 # in compliance with given list of edges.
6936 # @param theShape Initial shape.
6937 # @param theTolerance Maximum distance between edges,
6938 # which can be considered as coincident.
6939 # @param theEdges List of edges for gluing.
6940 # @param theName Object name; when specified, this parameter is used
6941 # for result publication in the study. Otherwise, if automatic
6942 # publication is switched on, default value is used for result name.
6944 # @return New GEOM.GEOM_Object, containing a copy of theShape
6945 # without some edges.
6947 # @ref tui_glue_edges "Example"
6948 @ManageTransactions("ShapesOp")
6949 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6951 Replace coincident edges in theShape by one edge
6952 in compliance with given list of edges.
6955 theShape Initial shape.
6956 theTolerance Maximum distance between edges,
6957 which can be considered as coincident.
6958 theEdges List of edges for gluing.
6959 theName Object name; when specified, this parameter is used
6960 for result publication in the study. Otherwise, if automatic
6961 publication is switched on, default value is used for result name.
6964 New GEOM.GEOM_Object, containing a copy of theShape
6967 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6969 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6970 self._autoPublish(anObj, theName, "glueEdges")
6976 ## @addtogroup l3_boolean Boolean Operations
6979 # -----------------------------------------------------------------------------
6980 # Boolean (Common, Cut, Fuse, Section)
6981 # -----------------------------------------------------------------------------
6983 ## Perform one of boolean operations on two given shapes.
6984 # @param theShape1 First argument for boolean operation.
6985 # @param theShape2 Second argument for boolean operation.
6986 # @param theOperation Indicates the operation to be done:\n
6987 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6988 # @param checkSelfInte The flag that tells if the arguments should
6989 # be checked for self-intersection prior to the operation.
6990 # @param theName Object name; when specified, this parameter is used
6991 # for result publication in the study. Otherwise, if automatic
6992 # publication is switched on, default value is used for result name.
6994 # @note This algorithm doesn't find all types of self-intersections.
6995 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6996 # vertex/face and edge/face intersections. Face/face
6997 # intersections detection is switched off as it is a
6998 # time-consuming operation that gives an impact on performance.
6999 # To find all self-intersections please use
7000 # CheckSelfIntersections() method.
7002 # @return New GEOM.GEOM_Object, containing the result shape.
7004 # @ref tui_fuse "Example"
7005 @ManageTransactions("BoolOp")
7006 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7008 Perform one of boolean operations on two given shapes.
7011 theShape1 First argument for boolean operation.
7012 theShape2 Second argument for boolean operation.
7013 theOperation Indicates the operation to be done:
7014 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7015 checkSelfInte The flag that tells if the arguments should
7016 be checked for self-intersection prior to
7018 theName Object name; when specified, this parameter is used
7019 for result publication in the study. Otherwise, if automatic
7020 publication is switched on, default value is used for result name.
7023 This algorithm doesn't find all types of self-intersections.
7024 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7025 vertex/face and edge/face intersections. Face/face
7026 intersections detection is switched off as it is a
7027 time-consuming operation that gives an impact on performance.
7028 To find all self-intersections please use
7029 CheckSelfIntersections() method.
7032 New GEOM.GEOM_Object, containing the result shape.
7034 # Example: see GEOM_TestAll.py
7035 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7036 RaiseIfFailed("MakeBoolean", self.BoolOp)
7037 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7038 self._autoPublish(anObj, theName, def_names[theOperation])
7041 ## Perform Common boolean operation on two given shapes.
7042 # @param theShape1 First argument for boolean operation.
7043 # @param theShape2 Second argument for boolean operation.
7044 # @param checkSelfInte The flag that tells if the arguments should
7045 # be checked for self-intersection prior to the operation.
7046 # @param theName Object name; when specified, this parameter is used
7047 # for result publication in the study. Otherwise, if automatic
7048 # publication is switched on, default value is used for result name.
7050 # @note This algorithm doesn't find all types of self-intersections.
7051 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7052 # vertex/face and edge/face intersections. Face/face
7053 # intersections detection is switched off as it is a
7054 # time-consuming operation that gives an impact on performance.
7055 # To find all self-intersections please use
7056 # CheckSelfIntersections() method.
7058 # @return New GEOM.GEOM_Object, containing the result shape.
7060 # @ref tui_common "Example 1"
7061 # \n @ref swig_MakeCommon "Example 2"
7062 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7064 Perform Common boolean operation on two given shapes.
7067 theShape1 First argument for boolean operation.
7068 theShape2 Second argument for boolean operation.
7069 checkSelfInte The flag that tells if the arguments should
7070 be checked for self-intersection prior to
7072 theName Object name; when specified, this parameter is used
7073 for result publication in the study. Otherwise, if automatic
7074 publication is switched on, default value is used for result name.
7077 This algorithm doesn't find all types of self-intersections.
7078 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7079 vertex/face and edge/face intersections. Face/face
7080 intersections detection is switched off as it is a
7081 time-consuming operation that gives an impact on performance.
7082 To find all self-intersections please use
7083 CheckSelfIntersections() method.
7086 New GEOM.GEOM_Object, containing the result shape.
7088 # Example: see GEOM_TestOthers.py
7089 # note: auto-publishing is done in self.MakeBoolean()
7090 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7092 ## Perform Cut boolean operation on two given shapes.
7093 # @param theShape1 First argument for boolean operation.
7094 # @param theShape2 Second argument for boolean operation.
7095 # @param checkSelfInte The flag that tells if the arguments should
7096 # be checked for self-intersection prior to the operation.
7097 # @param theName Object name; when specified, this parameter is used
7098 # for result publication in the study. Otherwise, if automatic
7099 # publication is switched on, default value is used for result name.
7101 # @note This algorithm doesn't find all types of self-intersections.
7102 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7103 # vertex/face and edge/face intersections. Face/face
7104 # intersections detection is switched off as it is a
7105 # time-consuming operation that gives an impact on performance.
7106 # To find all self-intersections please use
7107 # CheckSelfIntersections() method.
7109 # @return New GEOM.GEOM_Object, containing the result shape.
7111 # @ref tui_cut "Example 1"
7112 # \n @ref swig_MakeCommon "Example 2"
7113 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7115 Perform Cut boolean operation on two given shapes.
7118 theShape1 First argument for boolean operation.
7119 theShape2 Second argument for boolean operation.
7120 checkSelfInte The flag that tells if the arguments should
7121 be checked for self-intersection prior to
7123 theName Object name; when specified, this parameter is used
7124 for result publication in the study. Otherwise, if automatic
7125 publication is switched on, default value is used for result name.
7128 This algorithm doesn't find all types of self-intersections.
7129 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7130 vertex/face and edge/face intersections. Face/face
7131 intersections detection is switched off as it is a
7132 time-consuming operation that gives an impact on performance.
7133 To find all self-intersections please use
7134 CheckSelfIntersections() method.
7137 New GEOM.GEOM_Object, containing the result shape.
7140 # Example: see GEOM_TestOthers.py
7141 # note: auto-publishing is done in self.MakeBoolean()
7142 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7144 ## Perform Fuse boolean operation on two given shapes.
7145 # @param theShape1 First argument for boolean operation.
7146 # @param theShape2 Second argument for boolean operation.
7147 # @param checkSelfInte The flag that tells if the arguments should
7148 # be checked for self-intersection prior to the operation.
7149 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7150 # operation should be performed during the operation.
7151 # @param theName Object name; when specified, this parameter is used
7152 # for result publication in the study. Otherwise, if automatic
7153 # publication is switched on, default value is used for result name.
7155 # @note This algorithm doesn't find all types of self-intersections.
7156 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7157 # vertex/face and edge/face intersections. Face/face
7158 # intersections detection is switched off as it is a
7159 # time-consuming operation that gives an impact on performance.
7160 # To find all self-intersections please use
7161 # CheckSelfIntersections() method.
7163 # @return New GEOM.GEOM_Object, containing the result shape.
7165 # @ref tui_fuse "Example 1"
7166 # \n @ref swig_MakeCommon "Example 2"
7167 @ManageTransactions("BoolOp")
7168 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7169 rmExtraEdges=False, theName=None):
7171 Perform Fuse boolean operation on two given shapes.
7174 theShape1 First argument for boolean operation.
7175 theShape2 Second argument for boolean operation.
7176 checkSelfInte The flag that tells if the arguments should
7177 be checked for self-intersection prior to
7179 rmExtraEdges The flag that tells if Remove Extra Edges
7180 operation should be performed during the operation.
7181 theName Object name; when specified, this parameter is used
7182 for result publication in the study. Otherwise, if automatic
7183 publication is switched on, default value is used for result name.
7186 This algorithm doesn't find all types of self-intersections.
7187 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7188 vertex/face and edge/face intersections. Face/face
7189 intersections detection is switched off as it is a
7190 time-consuming operation that gives an impact on performance.
7191 To find all self-intersections please use
7192 CheckSelfIntersections() method.
7195 New GEOM.GEOM_Object, containing the result shape.
7198 # Example: see GEOM_TestOthers.py
7199 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7200 checkSelfInte, rmExtraEdges)
7201 RaiseIfFailed("MakeFuse", self.BoolOp)
7202 self._autoPublish(anObj, theName, "fuse")
7205 ## Perform Section boolean operation on two given shapes.
7206 # @param theShape1 First argument for boolean operation.
7207 # @param theShape2 Second argument for boolean operation.
7208 # @param checkSelfInte The flag that tells if the arguments should
7209 # be checked for self-intersection prior to the operation.
7210 # @param theName Object name; when specified, this parameter is used
7211 # for result publication in the study. Otherwise, if automatic
7212 # publication is switched on, default value is used for result name.
7214 # @note This algorithm doesn't find all types of self-intersections.
7215 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7216 # vertex/face and edge/face intersections. Face/face
7217 # intersections detection is switched off as it is a
7218 # time-consuming operation that gives an impact on performance.
7219 # To find all self-intersections please use
7220 # CheckSelfIntersections() method.
7222 # @return New GEOM.GEOM_Object, containing the result shape.
7224 # @ref tui_section "Example 1"
7225 # \n @ref swig_MakeCommon "Example 2"
7226 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7228 Perform Section boolean operation on two given shapes.
7231 theShape1 First argument for boolean operation.
7232 theShape2 Second argument for boolean operation.
7233 checkSelfInte The flag that tells if the arguments should
7234 be checked for self-intersection prior to
7236 theName Object name; when specified, this parameter is used
7237 for result publication in the study. Otherwise, if automatic
7238 publication is switched on, default value is used for result name.
7241 This algorithm doesn't find all types of self-intersections.
7242 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7243 vertex/face and edge/face intersections. Face/face
7244 intersections detection is switched off as it is a
7245 time-consuming operation that gives an impact on performance.
7246 To find all self-intersections please use
7247 CheckSelfIntersections() method.
7250 New GEOM.GEOM_Object, containing the result shape.
7253 # Example: see GEOM_TestOthers.py
7254 # note: auto-publishing is done in self.MakeBoolean()
7255 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7257 ## Perform Fuse boolean operation on the list of shapes.
7258 # @param theShapesList Shapes to be fused.
7259 # @param checkSelfInte The flag that tells if the arguments should
7260 # be checked for self-intersection prior to the operation.
7261 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7262 # operation should be performed during the operation.
7263 # @param theName Object name; when specified, this parameter is used
7264 # for result publication in the study. Otherwise, if automatic
7265 # publication is switched on, default value is used for result name.
7267 # @note This algorithm doesn't find all types of self-intersections.
7268 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7269 # vertex/face and edge/face intersections. Face/face
7270 # intersections detection is switched off as it is a
7271 # time-consuming operation that gives an impact on performance.
7272 # To find all self-intersections please use
7273 # CheckSelfIntersections() method.
7275 # @return New GEOM.GEOM_Object, containing the result shape.
7277 # @ref tui_fuse "Example 1"
7278 # \n @ref swig_MakeCommon "Example 2"
7279 @ManageTransactions("BoolOp")
7280 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7281 rmExtraEdges=False, theName=None):
7283 Perform Fuse boolean operation on the list of shapes.
7286 theShapesList Shapes to be fused.
7287 checkSelfInte The flag that tells if the arguments should
7288 be checked for self-intersection prior to
7290 rmExtraEdges The flag that tells if Remove Extra Edges
7291 operation should be performed during the operation.
7292 theName Object name; when specified, this parameter is used
7293 for result publication in the study. Otherwise, if automatic
7294 publication is switched on, default value is used for result name.
7297 This algorithm doesn't find all types of self-intersections.
7298 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7299 vertex/face and edge/face intersections. Face/face
7300 intersections detection is switched off as it is a
7301 time-consuming operation that gives an impact on performance.
7302 To find all self-intersections please use
7303 CheckSelfIntersections() method.
7306 New GEOM.GEOM_Object, containing the result shape.
7309 # Example: see GEOM_TestOthers.py
7310 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7312 RaiseIfFailed("MakeFuseList", self.BoolOp)
7313 self._autoPublish(anObj, theName, "fuse")
7316 ## Perform Common boolean operation on the list of shapes.
7317 # @param theShapesList Shapes for Common operation.
7318 # @param checkSelfInte The flag that tells if the arguments should
7319 # be checked for self-intersection prior to the operation.
7320 # @param theName Object name; when specified, this parameter is used
7321 # for result publication in the study. Otherwise, if automatic
7322 # publication is switched on, default value is used for result name.
7324 # @note This algorithm doesn't find all types of self-intersections.
7325 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7326 # vertex/face and edge/face intersections. Face/face
7327 # intersections detection is switched off as it is a
7328 # time-consuming operation that gives an impact on performance.
7329 # To find all self-intersections please use
7330 # CheckSelfIntersections() method.
7332 # @return New GEOM.GEOM_Object, containing the result shape.
7334 # @ref tui_common "Example 1"
7335 # \n @ref swig_MakeCommon "Example 2"
7336 @ManageTransactions("BoolOp")
7337 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7339 Perform Common boolean operation on the list of shapes.
7342 theShapesList Shapes for Common operation.
7343 checkSelfInte The flag that tells if the arguments should
7344 be checked for self-intersection prior to
7346 theName Object name; when specified, this parameter is used
7347 for result publication in the study. Otherwise, if automatic
7348 publication is switched on, default value is used for result name.
7351 This algorithm doesn't find all types of self-intersections.
7352 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7353 vertex/face and edge/face intersections. Face/face
7354 intersections detection is switched off as it is a
7355 time-consuming operation that gives an impact on performance.
7356 To find all self-intersections please use
7357 CheckSelfIntersections() method.
7360 New GEOM.GEOM_Object, containing the result shape.
7363 # Example: see GEOM_TestOthers.py
7364 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7365 RaiseIfFailed("MakeCommonList", self.BoolOp)
7366 self._autoPublish(anObj, theName, "common")
7369 ## Perform Cut boolean operation on one object and the list of tools.
7370 # @param theMainShape The object of the operation.
7371 # @param theShapesList The list of tools of the operation.
7372 # @param checkSelfInte The flag that tells if the arguments should
7373 # be checked for self-intersection prior to the operation.
7374 # @param theName Object name; when specified, this parameter is used
7375 # for result publication in the study. Otherwise, if automatic
7376 # publication is switched on, default value is used for result name.
7378 # @note This algorithm doesn't find all types of self-intersections.
7379 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7380 # vertex/face and edge/face intersections. Face/face
7381 # intersections detection is switched off as it is a
7382 # time-consuming operation that gives an impact on performance.
7383 # To find all self-intersections please use
7384 # CheckSelfIntersections() method.
7386 # @return New GEOM.GEOM_Object, containing the result shape.
7388 # @ref tui_cut "Example 1"
7389 # \n @ref swig_MakeCommon "Example 2"
7390 @ManageTransactions("BoolOp")
7391 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7393 Perform Cut boolean operation on one object and the list of tools.
7396 theMainShape The object of the operation.
7397 theShapesList The list of tools of the operation.
7398 checkSelfInte The flag that tells if the arguments should
7399 be checked for self-intersection prior to
7401 theName Object name; when specified, this parameter is used
7402 for result publication in the study. Otherwise, if automatic
7403 publication is switched on, default value is used for result name.
7406 This algorithm doesn't find all types of self-intersections.
7407 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7408 vertex/face and edge/face intersections. Face/face
7409 intersections detection is switched off as it is a
7410 time-consuming operation that gives an impact on performance.
7411 To find all self-intersections please use
7412 CheckSelfIntersections() method.
7415 New GEOM.GEOM_Object, containing the result shape.
7418 # Example: see GEOM_TestOthers.py
7419 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7420 RaiseIfFailed("MakeCutList", self.BoolOp)
7421 self._autoPublish(anObj, theName, "cut")
7427 ## @addtogroup l3_basic_op
7430 ## Perform partition operation.
7431 # @param ListShapes Shapes to be intersected.
7432 # @param ListTools Shapes to intersect theShapes.
7433 # @param Limit Type of resulting shapes (see ShapeType()).\n
7434 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7435 # type will be detected automatically.
7436 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7437 # target type (equal to Limit) are kept in the result,
7438 # else standalone shapes of lower dimension
7439 # are kept also (if they exist).
7441 # @param theName Object name; when specified, this parameter is used
7442 # for result publication in the study. Otherwise, if automatic
7443 # publication is switched on, default value is used for result name.
7445 # @note Each compound from ListShapes and ListTools will be exploded
7446 # in order to avoid possible intersection between shapes from this compound.
7448 # After implementation new version of PartitionAlgo (October 2006)
7449 # other parameters are ignored by current functionality. They are kept
7450 # in this function only for support old versions.
7451 # @param ListKeepInside Shapes, outside which the results will be deleted.
7452 # Each shape from theKeepInside must belong to theShapes also.
7453 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7454 # Each shape from theRemoveInside must belong to theShapes also.
7455 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7456 # @param ListMaterials Material indices for each shape. Make sence,
7457 # only if theRemoveWebs is TRUE.
7459 # @return New GEOM.GEOM_Object, containing the result shapes.
7461 # @ref tui_partition "Example"
7462 @ManageTransactions("BoolOp")
7463 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7464 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7465 KeepNonlimitShapes=0, theName=None):
7467 Perform partition operation.
7470 ListShapes Shapes to be intersected.
7471 ListTools Shapes to intersect theShapes.
7472 Limit Type of resulting shapes (see geompy.ShapeType)
7473 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7474 type will be detected automatically.
7475 KeepNonlimitShapes if this parameter == 0, then only shapes of
7476 target type (equal to Limit) are kept in the result,
7477 else standalone shapes of lower dimension
7478 are kept also (if they exist).
7480 theName Object name; when specified, this parameter is used
7481 for result publication in the study. Otherwise, if automatic
7482 publication is switched on, default value is used for result name.
7484 Each compound from ListShapes and ListTools will be exploded
7485 in order to avoid possible intersection between shapes from
7488 After implementation new version of PartitionAlgo (October 2006) other
7489 parameters are ignored by current functionality. They are kept in this
7490 function only for support old versions.
7493 ListKeepInside Shapes, outside which the results will be deleted.
7494 Each shape from theKeepInside must belong to theShapes also.
7495 ListRemoveInside Shapes, inside which the results will be deleted.
7496 Each shape from theRemoveInside must belong to theShapes also.
7497 RemoveWebs If TRUE, perform Glue 3D algorithm.
7498 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7501 New GEOM.GEOM_Object, containing the result shapes.
7503 # Example: see GEOM_TestAll.py
7504 if Limit == self.ShapeType["AUTO"]:
7505 # automatic detection of the most appropriate shape limit type
7507 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7508 Limit = EnumToLong(lim)
7510 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7511 ListKeepInside, ListRemoveInside,
7512 Limit, RemoveWebs, ListMaterials,
7513 KeepNonlimitShapes);
7514 RaiseIfFailed("MakePartition", self.BoolOp)
7515 self._autoPublish(anObj, theName, "partition")
7518 ## Perform partition operation.
7519 # This method may be useful if it is needed to make a partition for
7520 # compound contains nonintersected shapes. Performance will be better
7521 # since intersection between shapes from compound is not performed.
7523 # Description of all parameters as in previous method MakePartition().
7524 # One additional parameter is provided:
7525 # @param checkSelfInte The flag that tells if the arguments should
7526 # be checked for self-intersection prior to the operation.
7528 # @note This algorithm doesn't find all types of self-intersections.
7529 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7530 # vertex/face and edge/face intersections. Face/face
7531 # intersections detection is switched off as it is a
7532 # time-consuming operation that gives an impact on performance.
7533 # To find all self-intersections please use
7534 # CheckSelfIntersections() method.
7536 # @note Passed compounds (via ListShapes or via ListTools)
7537 # have to consist of nonintersecting shapes.
7539 # @return New GEOM.GEOM_Object, containing the result shapes.
7541 # @ref swig_todo "Example"
7542 @ManageTransactions("BoolOp")
7543 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7544 ListKeepInside=[], ListRemoveInside=[],
7545 Limit=ShapeType["AUTO"], RemoveWebs=0,
7546 ListMaterials=[], KeepNonlimitShapes=0,
7547 checkSelfInte=False, theName=None):
7549 Perform partition operation.
7550 This method may be useful if it is needed to make a partition for
7551 compound contains nonintersected shapes. Performance will be better
7552 since intersection between shapes from compound is not performed.
7555 Description of all parameters as in method geompy.MakePartition.
7556 One additional parameter is provided:
7557 checkSelfInte The flag that tells if the arguments should
7558 be checked for self-intersection prior to
7562 This algorithm doesn't find all types of self-intersections.
7563 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7564 vertex/face and edge/face intersections. Face/face
7565 intersections detection is switched off as it is a
7566 time-consuming operation that gives an impact on performance.
7567 To find all self-intersections please use
7568 CheckSelfIntersections() method.
7571 Passed compounds (via ListShapes or via ListTools)
7572 have to consist of nonintersecting shapes.
7575 New GEOM.GEOM_Object, containing the result shapes.
7577 if Limit == self.ShapeType["AUTO"]:
7578 # automatic detection of the most appropriate shape limit type
7580 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7581 Limit = EnumToLong(lim)
7583 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7584 ListKeepInside, ListRemoveInside,
7585 Limit, RemoveWebs, ListMaterials,
7586 KeepNonlimitShapes, checkSelfInte);
7587 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7588 self._autoPublish(anObj, theName, "partition")
7591 ## See method MakePartition() for more information.
7593 # @ref tui_partition "Example 1"
7594 # \n @ref swig_Partition "Example 2"
7595 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7596 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7597 KeepNonlimitShapes=0, theName=None):
7599 See method geompy.MakePartition for more information.
7601 # Example: see GEOM_TestOthers.py
7602 # note: auto-publishing is done in self.MakePartition()
7603 anObj = self.MakePartition(ListShapes, ListTools,
7604 ListKeepInside, ListRemoveInside,
7605 Limit, RemoveWebs, ListMaterials,
7606 KeepNonlimitShapes, theName);
7609 ## Perform partition of the Shape with the Plane
7610 # @param theShape Shape to be intersected.
7611 # @param thePlane Tool shape, to intersect theShape.
7612 # @param theName Object name; when specified, this parameter is used
7613 # for result publication in the study. Otherwise, if automatic
7614 # publication is switched on, default value is used for result name.
7616 # @return New GEOM.GEOM_Object, containing the result shape.
7618 # @ref tui_partition "Example"
7619 @ManageTransactions("BoolOp")
7620 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7622 Perform partition of the Shape with the Plane
7625 theShape Shape to be intersected.
7626 thePlane Tool shape, to intersect theShape.
7627 theName Object name; when specified, this parameter is used
7628 for result publication in the study. Otherwise, if automatic
7629 publication is switched on, default value is used for result name.
7632 New GEOM.GEOM_Object, containing the result shape.
7634 # Example: see GEOM_TestAll.py
7635 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7636 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7637 self._autoPublish(anObj, theName, "partition")
7640 # end of l3_basic_op
7643 ## @addtogroup l3_transform
7646 ## Translate the given object along the vector, specified
7647 # by its end points.
7648 # @param theObject The object to be translated.
7649 # @param thePoint1 Start point of translation vector.
7650 # @param thePoint2 End point of translation vector.
7651 # @param theCopy Flag used to translate object itself or create a copy.
7652 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7653 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7654 @ManageTransactions("TrsfOp")
7655 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7657 Translate the given object along the vector, specified by its end points.
7660 theObject The object to be translated.
7661 thePoint1 Start point of translation vector.
7662 thePoint2 End point of translation vector.
7663 theCopy Flag used to translate object itself or create a copy.
7666 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7667 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7670 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7672 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7673 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7676 ## Translate the given object along the vector, specified
7677 # by its end points, creating its copy before the translation.
7678 # @param theObject The object to be translated.
7679 # @param thePoint1 Start point of translation vector.
7680 # @param thePoint2 End point of translation vector.
7681 # @param theName Object name; when specified, this parameter is used
7682 # for result publication in the study. Otherwise, if automatic
7683 # publication is switched on, default value is used for result name.
7685 # @return New GEOM.GEOM_Object, containing the translated object.
7687 # @ref tui_translation "Example 1"
7688 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7689 @ManageTransactions("TrsfOp")
7690 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7692 Translate the given object along the vector, specified
7693 by its end points, creating its copy before the translation.
7696 theObject The object to be translated.
7697 thePoint1 Start point of translation vector.
7698 thePoint2 End point of translation vector.
7699 theName Object name; when specified, this parameter is used
7700 for result publication in the study. Otherwise, if automatic
7701 publication is switched on, default value is used for result name.
7704 New GEOM.GEOM_Object, containing the translated object.
7706 # Example: see GEOM_TestAll.py
7707 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7708 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7709 self._autoPublish(anObj, theName, "translated")
7712 ## Translate the given object along the vector, specified by its components.
7713 # @param theObject The object to be translated.
7714 # @param theDX,theDY,theDZ Components of translation vector.
7715 # @param theCopy Flag used to translate object itself or create a copy.
7716 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7717 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7719 # @ref tui_translation "Example"
7720 @ManageTransactions("TrsfOp")
7721 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7723 Translate the given object along the vector, specified by its components.
7726 theObject The object to be translated.
7727 theDX,theDY,theDZ Components of translation vector.
7728 theCopy Flag used to translate object itself or create a copy.
7731 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7732 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7734 # Example: see GEOM_TestAll.py
7735 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7737 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7739 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7740 anObj.SetParameters(Parameters)
7741 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7744 ## Translate the given object along the vector, specified
7745 # by its components, creating its copy before the translation.
7746 # @param theObject The object to be translated.
7747 # @param theDX,theDY,theDZ Components of translation vector.
7748 # @param theName Object name; when specified, this parameter is used
7749 # for result publication in the study. Otherwise, if automatic
7750 # publication is switched on, default value is used for result name.
7752 # @return New GEOM.GEOM_Object, containing the translated object.
7754 # @ref tui_translation "Example"
7755 @ManageTransactions("TrsfOp")
7756 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7758 Translate the given object along the vector, specified
7759 by its components, creating its copy before the translation.
7762 theObject The object to be translated.
7763 theDX,theDY,theDZ Components of translation vector.
7764 theName Object name; when specified, this parameter is used
7765 for result publication in the study. Otherwise, if automatic
7766 publication is switched on, default value is used for result name.
7769 New GEOM.GEOM_Object, containing the translated object.
7771 # Example: see GEOM_TestAll.py
7772 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7773 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7774 anObj.SetParameters(Parameters)
7775 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7776 self._autoPublish(anObj, theName, "translated")
7779 ## Translate the given object along the given vector.
7780 # @param theObject The object to be translated.
7781 # @param theVector The translation vector.
7782 # @param theCopy Flag used to translate object itself or create a copy.
7783 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7784 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7785 @ManageTransactions("TrsfOp")
7786 def TranslateVector(self, theObject, theVector, theCopy=False):
7788 Translate the given object along the given vector.
7791 theObject The object to be translated.
7792 theVector The translation vector.
7793 theCopy Flag used to translate object itself or create a copy.
7796 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7797 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7800 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7802 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7803 RaiseIfFailed("TranslateVector", self.TrsfOp)
7806 ## Translate the given object along the given vector,
7807 # creating its copy before the translation.
7808 # @param theObject The object to be translated.
7809 # @param theVector The translation vector.
7810 # @param theName Object name; when specified, this parameter is used
7811 # for result publication in the study. Otherwise, if automatic
7812 # publication is switched on, default value is used for result name.
7814 # @return New GEOM.GEOM_Object, containing the translated object.
7816 # @ref tui_translation "Example"
7817 @ManageTransactions("TrsfOp")
7818 def MakeTranslationVector(self, theObject, theVector, theName=None):
7820 Translate the given object along the given vector,
7821 creating its copy before the translation.
7824 theObject The object to be translated.
7825 theVector The translation vector.
7826 theName Object name; when specified, this parameter is used
7827 for result publication in the study. Otherwise, if automatic
7828 publication is switched on, default value is used for result name.
7831 New GEOM.GEOM_Object, containing the translated object.
7833 # Example: see GEOM_TestAll.py
7834 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7835 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7836 self._autoPublish(anObj, theName, "translated")
7839 ## Translate the given object along the given vector on given distance.
7840 # @param theObject The object to be translated.
7841 # @param theVector The translation vector.
7842 # @param theDistance The translation distance.
7843 # @param theCopy Flag used to translate object itself or create a copy.
7844 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7845 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7847 # @ref tui_translation "Example"
7848 @ManageTransactions("TrsfOp")
7849 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7851 Translate the given object along the given vector on given distance.
7854 theObject The object to be translated.
7855 theVector The translation vector.
7856 theDistance The translation distance.
7857 theCopy Flag used to translate object itself or create a copy.
7860 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7861 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7863 # Example: see GEOM_TestAll.py
7864 theDistance,Parameters = ParseParameters(theDistance)
7865 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7866 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7867 anObj.SetParameters(Parameters)
7870 ## Translate the given object along the given vector on given distance,
7871 # creating its copy before the translation.
7872 # @param theObject The object to be translated.
7873 # @param theVector The translation vector.
7874 # @param theDistance The translation distance.
7875 # @param theName Object name; when specified, this parameter is used
7876 # for result publication in the study. Otherwise, if automatic
7877 # publication is switched on, default value is used for result name.
7879 # @return New GEOM.GEOM_Object, containing the translated object.
7881 # @ref tui_translation "Example"
7882 @ManageTransactions("TrsfOp")
7883 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7885 Translate the given object along the given vector on given distance,
7886 creating its copy before the translation.
7889 theObject The object to be translated.
7890 theVector The translation vector.
7891 theDistance The translation distance.
7892 theName Object name; when specified, this parameter is used
7893 for result publication in the study. Otherwise, if automatic
7894 publication is switched on, default value is used for result name.
7897 New GEOM.GEOM_Object, containing the translated object.
7899 # Example: see GEOM_TestAll.py
7900 theDistance,Parameters = ParseParameters(theDistance)
7901 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7902 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7903 anObj.SetParameters(Parameters)
7904 self._autoPublish(anObj, theName, "translated")
7907 ## Rotate the given object around the given axis on the given angle.
7908 # @param theObject The object to be rotated.
7909 # @param theAxis Rotation axis.
7910 # @param theAngle Rotation angle in radians.
7911 # @param theCopy Flag used to rotate object itself or create a copy.
7913 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7914 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7916 # @ref tui_rotation "Example"
7917 @ManageTransactions("TrsfOp")
7918 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7920 Rotate the given object around the given axis on the given angle.
7923 theObject The object to be rotated.
7924 theAxis Rotation axis.
7925 theAngle Rotation angle in radians.
7926 theCopy Flag used to rotate object itself or create a copy.
7929 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7930 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7932 # Example: see GEOM_TestAll.py
7934 if isinstance(theAngle,str):
7936 theAngle, Parameters = ParseParameters(theAngle)
7938 theAngle = theAngle*math.pi/180.0
7940 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7942 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7943 RaiseIfFailed("Rotate", self.TrsfOp)
7944 anObj.SetParameters(Parameters)
7947 ## Rotate the given object around the given axis
7948 # on the given angle, creating its copy before the rotation.
7949 # @param theObject The object to be rotated.
7950 # @param theAxis Rotation axis.
7951 # @param theAngle Rotation angle in radians.
7952 # @param theName Object name; when specified, this parameter is used
7953 # for result publication in the study. Otherwise, if automatic
7954 # publication is switched on, default value is used for result name.
7956 # @return New GEOM.GEOM_Object, containing the rotated object.
7958 # @ref tui_rotation "Example"
7959 @ManageTransactions("TrsfOp")
7960 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7962 Rotate the given object around the given axis
7963 on the given angle, creating its copy before the rotatation.
7966 theObject The object to be rotated.
7967 theAxis Rotation axis.
7968 theAngle Rotation angle in radians.
7969 theName Object name; when specified, this parameter is used
7970 for result publication in the study. Otherwise, if automatic
7971 publication is switched on, default value is used for result name.
7974 New GEOM.GEOM_Object, containing the rotated object.
7976 # Example: see GEOM_TestAll.py
7978 if isinstance(theAngle,str):
7980 theAngle, Parameters = ParseParameters(theAngle)
7982 theAngle = theAngle*math.pi/180.0
7983 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7984 RaiseIfFailed("RotateCopy", self.TrsfOp)
7985 anObj.SetParameters(Parameters)
7986 self._autoPublish(anObj, theName, "rotated")
7989 ## Rotate given object around vector perpendicular to plane
7990 # containing three points.
7991 # @param theObject The object to be rotated.
7992 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7993 # containing the three points.
7994 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7995 # @param theCopy Flag used to rotate object itself or create a copy.
7996 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7997 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7998 @ManageTransactions("TrsfOp")
7999 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8001 Rotate given object around vector perpendicular to plane
8002 containing three points.
8005 theObject The object to be rotated.
8006 theCentPoint central point the axis is the vector perpendicular to the plane
8007 containing the three points.
8008 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8009 theCopy Flag used to rotate object itself or create a copy.
8012 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8013 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8016 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8018 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8019 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8022 ## Rotate given object around vector perpendicular to plane
8023 # containing three points, creating its copy before the rotatation.
8024 # @param theObject The object to be rotated.
8025 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8026 # containing the three points.
8027 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8028 # @param theName Object name; when specified, this parameter is used
8029 # for result publication in the study. Otherwise, if automatic
8030 # publication is switched on, default value is used for result name.
8032 # @return New GEOM.GEOM_Object, containing the rotated object.
8034 # @ref tui_rotation "Example"
8035 @ManageTransactions("TrsfOp")
8036 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8038 Rotate given object around vector perpendicular to plane
8039 containing three points, creating its copy before the rotatation.
8042 theObject The object to be rotated.
8043 theCentPoint central point the axis is the vector perpendicular to the plane
8044 containing the three points.
8045 thePoint1,thePoint2 in a perpendicular plane of the axis.
8046 theName Object name; when specified, this parameter is used
8047 for result publication in the study. Otherwise, if automatic
8048 publication is switched on, default value is used for result name.
8051 New GEOM.GEOM_Object, containing the rotated object.
8053 # Example: see GEOM_TestAll.py
8054 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8055 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8056 self._autoPublish(anObj, theName, "rotated")
8059 ## Scale the given object by the specified factor.
8060 # @param theObject The object to be scaled.
8061 # @param thePoint Center point for scaling.
8062 # Passing None for it means scaling relatively the origin of global CS.
8063 # @param theFactor Scaling factor value.
8064 # @param theCopy Flag used to scale object itself or create a copy.
8065 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8066 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8067 @ManageTransactions("TrsfOp")
8068 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8070 Scale the given object by the specified factor.
8073 theObject The object to be scaled.
8074 thePoint Center point for scaling.
8075 Passing None for it means scaling relatively the origin of global CS.
8076 theFactor Scaling factor value.
8077 theCopy Flag used to scale object itself or create a copy.
8080 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8081 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8083 # Example: see GEOM_TestAll.py
8084 theFactor, Parameters = ParseParameters(theFactor)
8086 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8088 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8089 RaiseIfFailed("Scale", self.TrsfOp)
8090 anObj.SetParameters(Parameters)
8093 ## Scale the given object by the factor, creating its copy before the scaling.
8094 # @param theObject The object to be scaled.
8095 # @param thePoint Center point for scaling.
8096 # Passing None for it means scaling relatively the origin of global CS.
8097 # @param theFactor Scaling factor value.
8098 # @param theName Object name; when specified, this parameter is used
8099 # for result publication in the study. Otherwise, if automatic
8100 # publication is switched on, default value is used for result name.
8102 # @return New GEOM.GEOM_Object, containing the scaled shape.
8104 # @ref tui_scale "Example"
8105 @ManageTransactions("TrsfOp")
8106 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8108 Scale the given object by the factor, creating its copy before the scaling.
8111 theObject The object to be scaled.
8112 thePoint Center point for scaling.
8113 Passing None for it means scaling relatively the origin of global CS.
8114 theFactor Scaling factor value.
8115 theName Object name; when specified, this parameter is used
8116 for result publication in the study. Otherwise, if automatic
8117 publication is switched on, default value is used for result name.
8120 New GEOM.GEOM_Object, containing the scaled shape.
8122 # Example: see GEOM_TestAll.py
8123 theFactor, Parameters = ParseParameters(theFactor)
8124 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8125 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8126 anObj.SetParameters(Parameters)
8127 self._autoPublish(anObj, theName, "scaled")
8130 ## Scale the given object by different factors along coordinate axes.
8131 # @param theObject The object to be scaled.
8132 # @param thePoint Center point for scaling.
8133 # Passing None for it means scaling relatively the origin of global CS.
8134 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8135 # @param theCopy Flag used to scale object itself or create a copy.
8136 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8137 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8138 @ManageTransactions("TrsfOp")
8139 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8141 Scale the given object by different factors along coordinate axes.
8144 theObject The object to be scaled.
8145 thePoint Center point for scaling.
8146 Passing None for it means scaling relatively the origin of global CS.
8147 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8148 theCopy Flag used to scale object itself or create a copy.
8151 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8152 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8154 # Example: see GEOM_TestAll.py
8155 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8157 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8158 theFactorX, theFactorY, theFactorZ)
8160 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8161 theFactorX, theFactorY, theFactorZ)
8162 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8163 anObj.SetParameters(Parameters)
8166 ## Scale the given object by different factors along coordinate axes,
8167 # creating its copy before the scaling.
8168 # @param theObject The object to be scaled.
8169 # @param thePoint Center point for scaling.
8170 # Passing None for it means scaling relatively the origin of global CS.
8171 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8172 # @param theName Object name; when specified, this parameter is used
8173 # for result publication in the study. Otherwise, if automatic
8174 # publication is switched on, default value is used for result name.
8176 # @return New GEOM.GEOM_Object, containing the scaled shape.
8178 # @ref swig_scale "Example"
8179 @ManageTransactions("TrsfOp")
8180 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8182 Scale the given object by different factors along coordinate axes,
8183 creating its copy before the scaling.
8186 theObject The object to be scaled.
8187 thePoint Center point for scaling.
8188 Passing None for it means scaling relatively the origin of global CS.
8189 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8190 theName Object name; when specified, this parameter is used
8191 for result publication in the study. Otherwise, if automatic
8192 publication is switched on, default value is used for result name.
8195 New GEOM.GEOM_Object, containing the scaled shape.
8197 # Example: see GEOM_TestAll.py
8198 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8199 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8200 theFactorX, theFactorY, theFactorZ)
8201 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8202 anObj.SetParameters(Parameters)
8203 self._autoPublish(anObj, theName, "scaled")
8206 ## Mirror an object relatively the given plane.
8207 # @param theObject The object to be mirrored.
8208 # @param thePlane Plane of symmetry.
8209 # @param theCopy Flag used to mirror object itself or create a copy.
8210 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8211 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8212 @ManageTransactions("TrsfOp")
8213 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8215 Mirror an object relatively the given plane.
8218 theObject The object to be mirrored.
8219 thePlane Plane of symmetry.
8220 theCopy Flag used to mirror object itself or create a copy.
8223 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8224 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8227 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8229 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8230 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8233 ## Create an object, symmetrical
8234 # to the given one relatively the given plane.
8235 # @param theObject The object to be mirrored.
8236 # @param thePlane Plane of symmetry.
8237 # @param theName Object name; when specified, this parameter is used
8238 # for result publication in the study. Otherwise, if automatic
8239 # publication is switched on, default value is used for result name.
8241 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8243 # @ref tui_mirror "Example"
8244 @ManageTransactions("TrsfOp")
8245 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8247 Create an object, symmetrical to the given one relatively the given plane.
8250 theObject The object to be mirrored.
8251 thePlane Plane of symmetry.
8252 theName Object name; when specified, this parameter is used
8253 for result publication in the study. Otherwise, if automatic
8254 publication is switched on, default value is used for result name.
8257 New GEOM.GEOM_Object, containing the mirrored shape.
8259 # Example: see GEOM_TestAll.py
8260 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8261 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8262 self._autoPublish(anObj, theName, "mirrored")
8265 ## Mirror an object relatively the given axis.
8266 # @param theObject The object to be mirrored.
8267 # @param theAxis Axis of symmetry.
8268 # @param theCopy Flag used to mirror object itself or create a copy.
8269 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8270 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8271 @ManageTransactions("TrsfOp")
8272 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8274 Mirror an object relatively the given axis.
8277 theObject The object to be mirrored.
8278 theAxis Axis of symmetry.
8279 theCopy Flag used to mirror object itself or create a copy.
8282 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8283 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8286 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8288 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8289 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8292 ## Create an object, symmetrical
8293 # to the given one relatively the given axis.
8294 # @param theObject The object to be mirrored.
8295 # @param theAxis Axis of symmetry.
8296 # @param theName Object name; when specified, this parameter is used
8297 # for result publication in the study. Otherwise, if automatic
8298 # publication is switched on, default value is used for result name.
8300 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8302 # @ref tui_mirror "Example"
8303 @ManageTransactions("TrsfOp")
8304 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8306 Create an object, symmetrical to the given one relatively the given axis.
8309 theObject The object to be mirrored.
8310 theAxis Axis of symmetry.
8311 theName Object name; when specified, this parameter is used
8312 for result publication in the study. Otherwise, if automatic
8313 publication is switched on, default value is used for result name.
8316 New GEOM.GEOM_Object, containing the mirrored shape.
8318 # Example: see GEOM_TestAll.py
8319 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8320 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8321 self._autoPublish(anObj, theName, "mirrored")
8324 ## Mirror an object relatively the given point.
8325 # @param theObject The object to be mirrored.
8326 # @param thePoint Point of symmetry.
8327 # @param theCopy Flag used to mirror object itself or create a copy.
8328 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8329 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8330 @ManageTransactions("TrsfOp")
8331 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8333 Mirror an object relatively the given point.
8336 theObject The object to be mirrored.
8337 thePoint Point of symmetry.
8338 theCopy Flag used to mirror object itself or create a copy.
8341 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8342 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8344 # Example: see GEOM_TestAll.py
8346 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8348 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8349 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8352 ## Create an object, symmetrical
8353 # to the given one relatively the given point.
8354 # @param theObject The object to be mirrored.
8355 # @param thePoint Point of symmetry.
8356 # @param theName Object name; when specified, this parameter is used
8357 # for result publication in the study. Otherwise, if automatic
8358 # publication is switched on, default value is used for result name.
8360 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8362 # @ref tui_mirror "Example"
8363 @ManageTransactions("TrsfOp")
8364 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8366 Create an object, symmetrical
8367 to the given one relatively the given point.
8370 theObject The object to be mirrored.
8371 thePoint Point of symmetry.
8372 theName Object name; when specified, this parameter is used
8373 for result publication in the study. Otherwise, if automatic
8374 publication is switched on, default value is used for result name.
8377 New GEOM.GEOM_Object, containing the mirrored shape.
8379 # Example: see GEOM_TestAll.py
8380 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8381 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8382 self._autoPublish(anObj, theName, "mirrored")
8385 ## Modify the location of the given object.
8386 # @param theObject The object to be displaced.
8387 # @param theStartLCS Coordinate system to perform displacement from it.\n
8388 # If \a theStartLCS is NULL, displacement
8389 # will be performed from global CS.\n
8390 # If \a theObject itself is used as \a theStartLCS,
8391 # its location will be changed to \a theEndLCS.
8392 # @param theEndLCS Coordinate system to perform displacement to it.
8393 # @param theCopy Flag used to displace object itself or create a copy.
8394 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8395 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8396 @ManageTransactions("TrsfOp")
8397 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8399 Modify the Location of the given object by LCS, creating its copy before the setting.
8402 theObject The object to be displaced.
8403 theStartLCS Coordinate system to perform displacement from it.
8404 If theStartLCS is NULL, displacement
8405 will be performed from global CS.
8406 If theObject itself is used as theStartLCS,
8407 its location will be changed to theEndLCS.
8408 theEndLCS Coordinate system to perform displacement to it.
8409 theCopy Flag used to displace object itself or create a copy.
8412 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8413 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8415 # Example: see GEOM_TestAll.py
8417 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8419 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8420 RaiseIfFailed("Displace", self.TrsfOp)
8423 ## Modify the Location of the given object by LCS,
8424 # creating its copy before the setting.
8425 # @param theObject The object to be displaced.
8426 # @param theStartLCS Coordinate system to perform displacement from it.\n
8427 # If \a theStartLCS is NULL, displacement
8428 # will be performed from global CS.\n
8429 # If \a theObject itself is used as \a theStartLCS,
8430 # its location will be changed to \a theEndLCS.
8431 # @param theEndLCS Coordinate system to perform displacement to it.
8432 # @param theName Object name; when specified, this parameter is used
8433 # for result publication in the study. Otherwise, if automatic
8434 # publication is switched on, default value is used for result name.
8436 # @return New GEOM.GEOM_Object, containing the displaced shape.
8438 # @ref tui_modify_location "Example"
8439 @ManageTransactions("TrsfOp")
8440 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8442 Modify the Location of the given object by LCS, creating its copy before the setting.
8445 theObject The object to be displaced.
8446 theStartLCS Coordinate system to perform displacement from it.
8447 If theStartLCS is NULL, displacement
8448 will be performed from global CS.
8449 If theObject itself is used as theStartLCS,
8450 its location will be changed to theEndLCS.
8451 theEndLCS Coordinate system to perform displacement to it.
8452 theName Object name; when specified, this parameter is used
8453 for result publication in the study. Otherwise, if automatic
8454 publication is switched on, default value is used for result name.
8457 New GEOM.GEOM_Object, containing the displaced shape.
8460 # create local coordinate systems
8461 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8462 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8463 # modify the location of the given object
8464 position = geompy.MakePosition(cylinder, cs1, cs2)
8466 # Example: see GEOM_TestAll.py
8467 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8468 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8469 self._autoPublish(anObj, theName, "displaced")
8472 ## Modify the Location of the given object by Path.
8473 # @param theObject The object to be displaced.
8474 # @param thePath Wire or Edge along that the object will be translated.
8475 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8476 # @param theCopy is to create a copy objects if true.
8477 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8478 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8479 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8481 # @ref tui_modify_location "Example"
8482 @ManageTransactions("TrsfOp")
8483 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8485 Modify the Location of the given object by Path.
8488 theObject The object to be displaced.
8489 thePath Wire or Edge along that the object will be translated.
8490 theDistance progress of Path (0 = start location, 1 = end of path location).
8491 theCopy is to create a copy objects if true.
8492 theReverse 0 - for usual direction, 1 - to reverse path direction.
8495 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8496 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8499 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8501 # Example: see GEOM_TestAll.py
8502 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8503 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8506 ## Modify the Location of the given object by Path, creating its copy before the operation.
8507 # @param theObject The object to be displaced.
8508 # @param thePath Wire or Edge along that the object will be translated.
8509 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8510 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8511 # @param theName Object name; when specified, this parameter is used
8512 # for result publication in the study. Otherwise, if automatic
8513 # publication is switched on, default value is used for result name.
8515 # @return New GEOM.GEOM_Object, containing the displaced shape.
8516 @ManageTransactions("TrsfOp")
8517 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8519 Modify the Location of the given object by Path, creating its copy before the operation.
8522 theObject The object to be displaced.
8523 thePath Wire or Edge along that the object will be translated.
8524 theDistance progress of Path (0 = start location, 1 = end of path location).
8525 theReverse 0 - for usual direction, 1 - to reverse path direction.
8526 theName Object name; when specified, this parameter is used
8527 for result publication in the study. Otherwise, if automatic
8528 publication is switched on, default value is used for result name.
8531 New GEOM.GEOM_Object, containing the displaced shape.
8533 # Example: see GEOM_TestAll.py
8534 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8535 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8536 self._autoPublish(anObj, theName, "displaced")
8539 ## Offset given shape.
8540 # @param theObject The base object for the offset.
8541 # @param theOffset Offset value.
8542 # @param theCopy Flag used to offset object itself or create a copy.
8543 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8544 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8545 @ManageTransactions("TrsfOp")
8546 def Offset(self, theObject, theOffset, theCopy=False):
8551 theObject The base object for the offset.
8552 theOffset Offset value.
8553 theCopy Flag used to offset object itself or create a copy.
8556 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8557 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8559 theOffset, Parameters = ParseParameters(theOffset)
8561 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8563 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8564 RaiseIfFailed("Offset", self.TrsfOp)
8565 anObj.SetParameters(Parameters)
8568 ## Create new object as offset of the given one.
8569 # @param theObject The base object for the offset.
8570 # @param theOffset Offset value.
8571 # @param theName Object name; when specified, this parameter is used
8572 # for result publication in the study. Otherwise, if automatic
8573 # publication is switched on, default value is used for result name.
8575 # @return New GEOM.GEOM_Object, containing the offset object.
8577 # @ref tui_offset "Example"
8578 @ManageTransactions("TrsfOp")
8579 def MakeOffset(self, theObject, theOffset, theName=None):
8581 Create new object as offset of the given one.
8584 theObject The base object for the offset.
8585 theOffset Offset value.
8586 theName Object name; when specified, this parameter is used
8587 for result publication in the study. Otherwise, if automatic
8588 publication is switched on, default value is used for result name.
8591 New GEOM.GEOM_Object, containing the offset object.
8594 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8595 # create a new object as offset of the given object
8596 offset = geompy.MakeOffset(box, 70.)
8598 # Example: see GEOM_TestAll.py
8599 theOffset, Parameters = ParseParameters(theOffset)
8600 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8601 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8602 anObj.SetParameters(Parameters)
8603 self._autoPublish(anObj, theName, "offset")
8606 ## Create new object as projection of the given one on a 2D surface.
8607 # @param theSource The source object for the projection. It can be a point, edge or wire.
8608 # @param theTarget The target object. It can be planar or cylindrical face.
8609 # @param theName Object name; when specified, this parameter is used
8610 # for result publication in the study. Otherwise, if automatic
8611 # publication is switched on, default value is used for result name.
8613 # @return New GEOM.GEOM_Object, containing the projection.
8615 # @ref tui_projection "Example"
8616 @ManageTransactions("TrsfOp")
8617 def MakeProjection(self, theSource, theTarget, theName=None):
8619 Create new object as projection of the given one on a 2D surface.
8622 theSource The source object for the projection. It can be a point, edge or wire.
8623 theTarget The target object. It can be planar or cylindrical face.
8624 theName Object name; when specified, this parameter is used
8625 for result publication in the study. Otherwise, if automatic
8626 publication is switched on, default value is used for result name.
8629 New GEOM.GEOM_Object, containing the projection.
8631 # Example: see GEOM_TestAll.py
8632 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8633 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8634 self._autoPublish(anObj, theName, "projection")
8637 ## Create a projection projection of the given point on a wire or an edge.
8638 # If there are no solutions or there are 2 or more solutions It throws an
8640 # @param thePoint the point to be projected.
8641 # @param theWire the wire. The edge is accepted as well.
8642 # @param theName Object name; when specified, this parameter is used
8643 # for result publication in the study. Otherwise, if automatic
8644 # publication is switched on, default value is used for result name.
8646 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8647 # \n \a u: The parameter of projection point on edge.
8648 # \n \a PointOnEdge: The projection point.
8649 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8651 # @ref tui_projection "Example"
8652 @ManageTransactions("TrsfOp")
8653 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8655 Create a projection projection of the given point on a wire or an edge.
8656 If there are no solutions or there are 2 or more solutions It throws an
8660 thePoint the point to be projected.
8661 theWire the wire. The edge is accepted as well.
8662 theName Object name; when specified, this parameter is used
8663 for result publication in the study. Otherwise, if automatic
8664 publication is switched on, default value is used for result name.
8667 [u, PointOnEdge, EdgeInWireIndex]
8668 u: The parameter of projection point on edge.
8669 PointOnEdge: The projection point.
8670 EdgeInWireIndex: The index of an edge in a wire.
8672 # Example: see GEOM_TestAll.py
8673 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8674 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8675 self._autoPublish(anObj[1], theName, "projection")
8678 # -----------------------------------------------------------------------------
8680 # -----------------------------------------------------------------------------
8682 ## Translate the given object along the given vector a given number times
8683 # @param theObject The object to be translated.
8684 # @param theVector Direction of the translation. DX if None.
8685 # @param theStep Distance to translate on.
8686 # @param theNbTimes Quantity of translations to be done.
8687 # @param theName Object name; when specified, this parameter is used
8688 # for result publication in the study. Otherwise, if automatic
8689 # publication is switched on, default value is used for result name.
8691 # @return New GEOM.GEOM_Object, containing compound of all
8692 # the shapes, obtained after each translation.
8694 # @ref tui_multi_translation "Example"
8695 @ManageTransactions("TrsfOp")
8696 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8698 Translate the given object along the given vector a given number times
8701 theObject The object to be translated.
8702 theVector Direction of the translation. DX if None.
8703 theStep Distance to translate on.
8704 theNbTimes Quantity of translations to be done.
8705 theName Object name; when specified, this parameter is used
8706 for result publication in the study. Otherwise, if automatic
8707 publication is switched on, default value is used for result name.
8710 New GEOM.GEOM_Object, containing compound of all
8711 the shapes, obtained after each translation.
8714 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8716 # Example: see GEOM_TestAll.py
8717 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8718 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8719 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8720 anObj.SetParameters(Parameters)
8721 self._autoPublish(anObj, theName, "multitranslation")
8724 ## Conseqently apply two specified translations to theObject specified number of times.
8725 # @param theObject The object to be translated.
8726 # @param theVector1 Direction of the first translation. DX if None.
8727 # @param theStep1 Step of the first translation.
8728 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8729 # @param theVector2 Direction of the second translation. DY if None.
8730 # @param theStep2 Step of the second translation.
8731 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8732 # @param theName Object name; when specified, this parameter is used
8733 # for result publication in the study. Otherwise, if automatic
8734 # publication is switched on, default value is used for result name.
8736 # @return New GEOM.GEOM_Object, containing compound of all
8737 # the shapes, obtained after each translation.
8739 # @ref tui_multi_translation "Example"
8740 @ManageTransactions("TrsfOp")
8741 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8742 theVector2, theStep2, theNbTimes2, theName=None):
8744 Conseqently apply two specified translations to theObject specified number of times.
8747 theObject The object to be translated.
8748 theVector1 Direction of the first translation. DX if None.
8749 theStep1 Step of the first translation.
8750 theNbTimes1 Quantity of translations to be done along theVector1.
8751 theVector2 Direction of the second translation. DY if None.
8752 theStep2 Step of the second translation.
8753 theNbTimes2 Quantity of translations to be done along theVector2.
8754 theName Object name; when specified, this parameter is used
8755 for result publication in the study. Otherwise, if automatic
8756 publication is switched on, default value is used for result name.
8759 New GEOM.GEOM_Object, containing compound of all
8760 the shapes, obtained after each translation.
8763 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8765 # Example: see GEOM_TestAll.py
8766 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8767 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8768 theVector2, theStep2, theNbTimes2)
8769 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8770 anObj.SetParameters(Parameters)
8771 self._autoPublish(anObj, theName, "multitranslation")
8774 ## Rotate the given object around the given axis a given number times.
8775 # Rotation angle will be 2*PI/theNbTimes.
8776 # @param theObject The object to be rotated.
8777 # @param theAxis The rotation axis. DZ if None.
8778 # @param theNbTimes Quantity of rotations to be done.
8779 # @param theName Object name; when specified, this parameter is used
8780 # for result publication in the study. Otherwise, if automatic
8781 # publication is switched on, default value is used for result name.
8783 # @return New GEOM.GEOM_Object, containing compound of all the
8784 # shapes, obtained after each rotation.
8786 # @ref tui_multi_rotation "Example"
8787 @ManageTransactions("TrsfOp")
8788 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8790 Rotate the given object around the given axis a given number times.
8791 Rotation angle will be 2*PI/theNbTimes.
8794 theObject The object to be rotated.
8795 theAxis The rotation axis. DZ if None.
8796 theNbTimes Quantity of rotations to be done.
8797 theName Object name; when specified, this parameter is used
8798 for result publication in the study. Otherwise, if automatic
8799 publication is switched on, default value is used for result name.
8802 New GEOM.GEOM_Object, containing compound of all the
8803 shapes, obtained after each rotation.
8806 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8808 # Example: see GEOM_TestAll.py
8809 theNbTimes, Parameters = ParseParameters(theNbTimes)
8810 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8811 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8812 anObj.SetParameters(Parameters)
8813 self._autoPublish(anObj, theName, "multirotation")
8816 ## Rotate the given object around the given axis
8817 # a given number times on the given angle.
8818 # @param theObject The object to be rotated.
8819 # @param theAxis The rotation axis. DZ if None.
8820 # @param theAngleStep Rotation angle in radians.
8821 # @param theNbTimes Quantity of rotations to be done.
8822 # @param theName Object name; when specified, this parameter is used
8823 # for result publication in the study. Otherwise, if automatic
8824 # publication is switched on, default value is used for result name.
8826 # @return New GEOM.GEOM_Object, containing compound of all the
8827 # shapes, obtained after each rotation.
8829 # @ref tui_multi_rotation "Example"
8830 @ManageTransactions("TrsfOp")
8831 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8833 Rotate the given object around the given axis
8834 a given number times on the given angle.
8837 theObject The object to be rotated.
8838 theAxis The rotation axis. DZ if None.
8839 theAngleStep Rotation angle in radians.
8840 theNbTimes Quantity of rotations to be done.
8841 theName Object name; when specified, this parameter is used
8842 for result publication in the study. Otherwise, if automatic
8843 publication is switched on, default value is used for result name.
8846 New GEOM.GEOM_Object, containing compound of all the
8847 shapes, obtained after each rotation.
8850 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8852 # Example: see GEOM_TestAll.py
8853 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8854 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8855 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8856 anObj.SetParameters(Parameters)
8857 self._autoPublish(anObj, theName, "multirotation")
8860 ## Rotate the given object around the given axis a given
8861 # number times and multi-translate each rotation result.
8862 # Rotation angle will be 2*PI/theNbTimes1.
8863 # Translation direction passes through center of gravity
8864 # of rotated shape and its projection on the rotation axis.
8865 # @param theObject The object to be rotated.
8866 # @param theAxis Rotation axis. DZ if None.
8867 # @param theNbTimes1 Quantity of rotations to be done.
8868 # @param theRadialStep Translation distance.
8869 # @param theNbTimes2 Quantity of translations to be done.
8870 # @param theName Object name; when specified, this parameter is used
8871 # for result publication in the study. Otherwise, if automatic
8872 # publication is switched on, default value is used for result name.
8874 # @return New GEOM.GEOM_Object, containing compound of all the
8875 # shapes, obtained after each transformation.
8877 # @ref tui_multi_rotation "Example"
8878 @ManageTransactions("TrsfOp")
8879 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8881 Rotate the given object around the
8882 given axis on the given angle a given number
8883 times and multi-translate each rotation result.
8884 Translation direction passes through center of gravity
8885 of rotated shape and its projection on the rotation axis.
8888 theObject The object to be rotated.
8889 theAxis Rotation axis. DZ if None.
8890 theNbTimes1 Quantity of rotations to be done.
8891 theRadialStep Translation distance.
8892 theNbTimes2 Quantity of translations to be done.
8893 theName Object name; when specified, this parameter is used
8894 for result publication in the study. Otherwise, if automatic
8895 publication is switched on, default value is used for result name.
8898 New GEOM.GEOM_Object, containing compound of all the
8899 shapes, obtained after each transformation.
8902 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8904 # Example: see GEOM_TestAll.py
8905 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8906 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8907 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8908 anObj.SetParameters(Parameters)
8909 self._autoPublish(anObj, theName, "multirotation")
8912 ## Rotate the given object around the
8913 # given axis on the given angle a given number
8914 # times and multi-translate each rotation result.
8915 # Translation direction passes through center of gravity
8916 # of rotated shape and its projection on the rotation axis.
8917 # @param theObject The object to be rotated.
8918 # @param theAxis Rotation axis. DZ if None.
8919 # @param theAngleStep Rotation angle in radians.
8920 # @param theNbTimes1 Quantity of rotations to be done.
8921 # @param theRadialStep Translation distance.
8922 # @param theNbTimes2 Quantity of translations to be done.
8923 # @param theName Object name; when specified, this parameter is used
8924 # for result publication in the study. Otherwise, if automatic
8925 # publication is switched on, default value is used for result name.
8927 # @return New GEOM.GEOM_Object, containing compound of all the
8928 # shapes, obtained after each transformation.
8930 # @ref tui_multi_rotation "Example"
8931 @ManageTransactions("TrsfOp")
8932 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8934 Rotate the given object around the
8935 given axis on the given angle a given number
8936 times and multi-translate each rotation result.
8937 Translation direction passes through center of gravity
8938 of rotated shape and its projection on the rotation axis.
8941 theObject The object to be rotated.
8942 theAxis Rotation axis. DZ if None.
8943 theAngleStep Rotation angle in radians.
8944 theNbTimes1 Quantity of rotations to be done.
8945 theRadialStep Translation distance.
8946 theNbTimes2 Quantity of translations to be done.
8947 theName Object name; when specified, this parameter is used
8948 for result publication in the study. Otherwise, if automatic
8949 publication is switched on, default value is used for result name.
8952 New GEOM.GEOM_Object, containing compound of all the
8953 shapes, obtained after each transformation.
8956 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8958 # Example: see GEOM_TestAll.py
8959 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8960 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8961 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8962 anObj.SetParameters(Parameters)
8963 self._autoPublish(anObj, theName, "multirotation")
8966 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8968 # @ref swig_MakeMultiRotation "Example"
8969 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8971 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8974 pz = geompy.MakeVertex(0, 0, 100)
8975 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8976 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8978 # Example: see GEOM_TestOthers.py
8979 aVec = self.MakeLine(aPoint,aDir)
8980 # note: auto-publishing is done in self.MultiRotate1D()
8981 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8984 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8986 # @ref swig_MakeMultiRotation "Example"
8987 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8989 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8992 pz = geompy.MakeVertex(0, 0, 100)
8993 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8994 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8996 # Example: see GEOM_TestOthers.py
8997 aVec = self.MakeLine(aPoint,aDir)
8998 # note: auto-publishing is done in self.MultiRotate1D()
8999 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9002 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9004 # @ref swig_MakeMultiRotation "Example"
9005 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9007 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9010 pz = geompy.MakeVertex(0, 0, 100)
9011 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9012 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9014 # Example: see GEOM_TestOthers.py
9015 aVec = self.MakeLine(aPoint,aDir)
9016 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9017 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9020 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9022 # @ref swig_MakeMultiRotation "Example"
9023 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9025 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9028 pz = geompy.MakeVertex(0, 0, 100)
9029 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9030 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9032 # Example: see GEOM_TestOthers.py
9033 aVec = self.MakeLine(aPoint,aDir)
9034 # note: auto-publishing is done in self.MultiRotate2D()
9035 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9038 # end of l3_transform
9041 ## @addtogroup l3_transform_d
9044 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9045 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9047 Deprecated method. Use MultiRotate1DNbTimes instead.
9049 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9050 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9052 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9053 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9054 @ManageTransactions("TrsfOp")
9055 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9057 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9058 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9061 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9063 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9064 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9065 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9066 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9067 anObj.SetParameters(Parameters)
9068 self._autoPublish(anObj, theName, "multirotation")
9071 ## The same, as MultiRotate1D(), but axis is given by direction and point
9072 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9073 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9075 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9076 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9079 pz = geompy.MakeVertex(0, 0, 100)
9080 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9081 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9083 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9084 aVec = self.MakeLine(aPoint,aDir)
9085 # note: auto-publishing is done in self.MultiRotate1D()
9086 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9089 ## The same, as MultiRotate2D(), but axis is given by direction and point
9090 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9091 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9093 The same, as MultiRotate2D(), but axis is given by direction and point
9094 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9097 pz = geompy.MakeVertex(0, 0, 100)
9098 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9099 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9101 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9102 aVec = self.MakeLine(aPoint,aDir)
9103 # note: auto-publishing is done in self.MultiRotate2D()
9104 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9107 # end of l3_transform_d
9110 ## @addtogroup l3_local
9113 ## Perform a fillet on all edges of the given shape.
9114 # @param theShape Shape, to perform fillet on.
9115 # @param theR Fillet radius.
9116 # @param theName Object name; when specified, this parameter is used
9117 # for result publication in the study. Otherwise, if automatic
9118 # publication is switched on, default value is used for result name.
9120 # @return New GEOM.GEOM_Object, containing the result shape.
9122 # @ref tui_fillet "Example 1"
9123 # \n @ref swig_MakeFilletAll "Example 2"
9124 @ManageTransactions("LocalOp")
9125 def MakeFilletAll(self, theShape, theR, theName=None):
9127 Perform a fillet on all edges of the given shape.
9130 theShape Shape, to perform fillet on.
9132 theName Object name; when specified, this parameter is used
9133 for result publication in the study. Otherwise, if automatic
9134 publication is switched on, default value is used for result name.
9137 New GEOM.GEOM_Object, containing the result shape.
9140 filletall = geompy.MakeFilletAll(prism, 10.)
9142 # Example: see GEOM_TestOthers.py
9143 theR,Parameters = ParseParameters(theR)
9144 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9145 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9146 anObj.SetParameters(Parameters)
9147 self._autoPublish(anObj, theName, "fillet")
9150 ## Perform a fillet on the specified edges/faces of the given shape
9151 # @param theShape Shape, to perform fillet on.
9152 # @param theR Fillet radius.
9153 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9154 # @param theListShapes Global indices of edges/faces to perform fillet on.
9155 # @param theName Object name; when specified, this parameter is used
9156 # for result publication in the study. Otherwise, if automatic
9157 # publication is switched on, default value is used for result name.
9159 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9161 # @return New GEOM.GEOM_Object, containing the result shape.
9163 # @ref tui_fillet "Example"
9164 @ManageTransactions("LocalOp")
9165 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9167 Perform a fillet on the specified edges/faces of the given shape
9170 theShape Shape, to perform fillet on.
9172 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9173 theListShapes Global indices of edges/faces to perform fillet on.
9174 theName Object name; when specified, this parameter is used
9175 for result publication in the study. Otherwise, if automatic
9176 publication is switched on, default value is used for result name.
9179 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9182 New GEOM.GEOM_Object, containing the result shape.
9185 # get the list of IDs (IDList) for the fillet
9186 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9188 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9189 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9190 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9191 # make a fillet on the specified edges of the given shape
9192 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9194 # Example: see GEOM_TestAll.py
9195 theR,Parameters = ParseParameters(theR)
9197 if theShapeType == self.ShapeType["EDGE"]:
9198 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9199 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9201 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9202 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9203 anObj.SetParameters(Parameters)
9204 self._autoPublish(anObj, theName, "fillet")
9207 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9208 @ManageTransactions("LocalOp")
9209 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9211 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9214 # get the list of IDs (IDList) for the fillet
9215 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9217 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9218 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9219 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9220 # make a fillet on the specified edges of the given shape
9221 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9223 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9225 if theShapeType == self.ShapeType["EDGE"]:
9226 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9227 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9229 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9230 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9231 anObj.SetParameters(Parameters)
9232 self._autoPublish(anObj, theName, "fillet")
9235 ## Perform a fillet on the specified edges of the given shape
9236 # @param theShape Wire Shape to perform fillet on.
9237 # @param theR Fillet radius.
9238 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9239 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9240 # \note The list of vertices could be empty,
9241 # in this case fillet will done done at all vertices in wire
9242 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9243 # by the length of the edges, nearest to the fillet vertex.
9244 # But sometimes the next edge is C1 continuous with the one, nearest to
9245 # the fillet point, and such two (or more) edges can be united to allow
9246 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9247 # thus ignoring the secant vertex (vertices).
9248 # @param theName Object name; when specified, this parameter is used
9249 # for result publication in the study. Otherwise, if automatic
9250 # publication is switched on, default value is used for result name.
9252 # @return New GEOM.GEOM_Object, containing the result shape.
9254 # @ref tui_fillet2d "Example"
9255 @ManageTransactions("LocalOp")
9256 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9258 Perform a fillet on the specified edges of the given shape
9261 theShape Wire Shape to perform fillet on.
9263 theListOfVertexes Global indices of vertexes to perform fillet on.
9264 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9265 by the length of the edges, nearest to the fillet vertex.
9266 But sometimes the next edge is C1 continuous with the one, nearest to
9267 the fillet point, and such two (or more) edges can be united to allow
9268 bigger radius. Set this flag to TRUE to allow collinear edges union,
9269 thus ignoring the secant vertex (vertices).
9270 theName Object name; when specified, this parameter is used
9271 for result publication in the study. Otherwise, if automatic
9272 publication is switched on, default value is used for result name.
9274 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9276 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9279 New GEOM.GEOM_Object, containing the result shape.
9283 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9284 # make fillet at given wire vertices with giver radius
9285 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9287 # Example: see GEOM_TestAll.py
9288 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9289 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9290 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9291 anObj.SetParameters(Parameters)
9292 self._autoPublish(anObj, theName, "fillet")
9295 ## Perform a fillet at the specified vertices of the given face/shell.
9296 # @param theShape Face or Shell shape to perform fillet on.
9297 # @param theR Fillet radius.
9298 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9299 # @param theName Object name; when specified, this parameter is used
9300 # for result publication in the study. Otherwise, if automatic
9301 # publication is switched on, default value is used for result name.
9303 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9305 # @return New GEOM.GEOM_Object, containing the result shape.
9307 # @ref tui_fillet2d "Example"
9308 @ManageTransactions("LocalOp")
9309 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9311 Perform a fillet at the specified vertices of the given face/shell.
9314 theShape Face or Shell shape to perform fillet on.
9316 theListOfVertexes Global indices of vertexes to perform fillet on.
9317 theName Object name; when specified, this parameter is used
9318 for result publication in the study. Otherwise, if automatic
9319 publication is switched on, default value is used for result name.
9321 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9324 New GEOM.GEOM_Object, containing the result shape.
9327 face = geompy.MakeFaceHW(100, 100, 1)
9328 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9330 # Example: see GEOM_TestAll.py
9331 theR,Parameters = ParseParameters(theR)
9332 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9333 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9334 anObj.SetParameters(Parameters)
9335 self._autoPublish(anObj, theName, "fillet")
9338 ## Perform a symmetric chamfer on all edges of the given shape.
9339 # @param theShape Shape, to perform chamfer on.
9340 # @param theD Chamfer size along each face.
9341 # @param theName Object name; when specified, this parameter is used
9342 # for result publication in the study. Otherwise, if automatic
9343 # publication is switched on, default value is used for result name.
9345 # @return New GEOM.GEOM_Object, containing the result shape.
9347 # @ref tui_chamfer "Example 1"
9348 # \n @ref swig_MakeChamferAll "Example 2"
9349 @ManageTransactions("LocalOp")
9350 def MakeChamferAll(self, theShape, theD, theName=None):
9352 Perform a symmetric chamfer on all edges of the given shape.
9355 theShape Shape, to perform chamfer on.
9356 theD Chamfer size along each face.
9357 theName Object name; when specified, this parameter is used
9358 for result publication in the study. Otherwise, if automatic
9359 publication is switched on, default value is used for result name.
9362 New GEOM.GEOM_Object, containing the result shape.
9365 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9367 # Example: see GEOM_TestOthers.py
9368 theD,Parameters = ParseParameters(theD)
9369 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9370 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9371 anObj.SetParameters(Parameters)
9372 self._autoPublish(anObj, theName, "chamfer")
9375 ## Perform a chamfer on edges, common to the specified faces,
9376 # with distance D1 on the Face1
9377 # @param theShape Shape, to perform chamfer on.
9378 # @param theD1 Chamfer size along \a theFace1.
9379 # @param theD2 Chamfer size along \a theFace2.
9380 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9381 # @param theName Object name; when specified, this parameter is used
9382 # for result publication in the study. Otherwise, if automatic
9383 # publication is switched on, default value is used for result name.
9385 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9387 # @return New GEOM.GEOM_Object, containing the result shape.
9389 # @ref tui_chamfer "Example"
9390 @ManageTransactions("LocalOp")
9391 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9393 Perform a chamfer on edges, common to the specified faces,
9394 with distance D1 on the Face1
9397 theShape Shape, to perform chamfer on.
9398 theD1 Chamfer size along theFace1.
9399 theD2 Chamfer size along theFace2.
9400 theFace1,theFace2 Global indices of two faces of theShape.
9401 theName Object name; when specified, this parameter is used
9402 for result publication in the study. Otherwise, if automatic
9403 publication is switched on, default value is used for result name.
9406 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9409 New GEOM.GEOM_Object, containing the result shape.
9412 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9413 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9414 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9415 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9417 # Example: see GEOM_TestAll.py
9418 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9419 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9420 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9421 anObj.SetParameters(Parameters)
9422 self._autoPublish(anObj, theName, "chamfer")
9425 ## Perform a chamfer on edges
9426 # @param theShape Shape, to perform chamfer on.
9427 # @param theD Chamfer length
9428 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9429 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9430 # @param theName Object name; when specified, this parameter is used
9431 # for result publication in the study. Otherwise, if automatic
9432 # publication is switched on, default value is used for result name.
9434 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9436 # @return New GEOM.GEOM_Object, containing the result shape.
9437 @ManageTransactions("LocalOp")
9438 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9440 Perform a chamfer on edges
9443 theShape Shape, to perform chamfer on.
9444 theD1 Chamfer size along theFace1.
9445 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9446 theFace1,theFace2 Global indices of two faces of theShape.
9447 theName Object name; when specified, this parameter is used
9448 for result publication in the study. Otherwise, if automatic
9449 publication is switched on, default value is used for result name.
9452 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9455 New GEOM.GEOM_Object, containing the result shape.
9458 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9459 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9460 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9462 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9465 if isinstance(theAngle,str):
9467 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9469 theAngle = theAngle*math.pi/180.0
9470 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9471 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9472 anObj.SetParameters(Parameters)
9473 self._autoPublish(anObj, theName, "chamfer")
9476 ## Perform a chamfer on all edges of the specified faces,
9477 # with distance D1 on the first specified face (if several for one edge)
9478 # @param theShape Shape, to perform chamfer on.
9479 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9480 # connected to the edge, are in \a theFaces, \a theD1
9481 # will be get along face, which is nearer to \a theFaces beginning.
9482 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9483 # @param theFaces Sequence of global indices of faces of \a theShape.
9484 # @param theName Object name; when specified, this parameter is used
9485 # for result publication in the study. Otherwise, if automatic
9486 # publication is switched on, default value is used for result name.
9488 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9490 # @return New GEOM.GEOM_Object, containing the result shape.
9492 # @ref tui_chamfer "Example"
9493 @ManageTransactions("LocalOp")
9494 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9496 Perform a chamfer on all edges of the specified faces,
9497 with distance D1 on the first specified face (if several for one edge)
9500 theShape Shape, to perform chamfer on.
9501 theD1 Chamfer size along face from theFaces. If both faces,
9502 connected to the edge, are in theFaces, theD1
9503 will be get along face, which is nearer to theFaces beginning.
9504 theD2 Chamfer size along another of two faces, connected to the edge.
9505 theFaces Sequence of global indices of faces of theShape.
9506 theName Object name; when specified, this parameter is used
9507 for result publication in the study. Otherwise, if automatic
9508 publication is switched on, default value is used for result name.
9510 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9513 New GEOM.GEOM_Object, containing the result shape.
9515 # Example: see GEOM_TestAll.py
9516 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9517 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9518 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9519 anObj.SetParameters(Parameters)
9520 self._autoPublish(anObj, theName, "chamfer")
9523 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9524 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9526 # @ref swig_FilletChamfer "Example"
9527 @ManageTransactions("LocalOp")
9528 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9530 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9531 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9534 if isinstance(theAngle,str):
9536 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9538 theAngle = theAngle*math.pi/180.0
9539 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9540 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9541 anObj.SetParameters(Parameters)
9542 self._autoPublish(anObj, theName, "chamfer")
9545 ## Perform a chamfer on edges,
9546 # with distance D1 on the first specified face (if several for one edge)
9547 # @param theShape Shape, to perform chamfer on.
9548 # @param theD1,theD2 Chamfer size
9549 # @param theEdges Sequence of edges of \a theShape.
9550 # @param theName Object name; when specified, this parameter is used
9551 # for result publication in the study. Otherwise, if automatic
9552 # publication is switched on, default value is used for result name.
9554 # @return New GEOM.GEOM_Object, containing the result shape.
9556 # @ref swig_FilletChamfer "Example"
9557 @ManageTransactions("LocalOp")
9558 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9560 Perform a chamfer on edges,
9561 with distance D1 on the first specified face (if several for one edge)
9564 theShape Shape, to perform chamfer on.
9565 theD1,theD2 Chamfer size
9566 theEdges Sequence of edges of theShape.
9567 theName Object name; when specified, this parameter is used
9568 for result publication in the study. Otherwise, if automatic
9569 publication is switched on, default value is used for result name.
9572 New GEOM.GEOM_Object, containing the result shape.
9574 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9575 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9576 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9577 anObj.SetParameters(Parameters)
9578 self._autoPublish(anObj, theName, "chamfer")
9581 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9582 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9583 @ManageTransactions("LocalOp")
9584 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9586 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9587 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9590 if isinstance(theAngle,str):
9592 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9594 theAngle = theAngle*math.pi/180.0
9595 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9596 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9597 anObj.SetParameters(Parameters)
9598 self._autoPublish(anObj, theName, "chamfer")
9601 ## @sa MakeChamferEdge(), MakeChamferFaces()
9603 # @ref swig_MakeChamfer "Example"
9604 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9606 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9608 # Example: see GEOM_TestOthers.py
9610 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9611 if aShapeType == self.ShapeType["EDGE"]:
9612 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9614 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9617 ## Remove material from a solid by extrusion of the base shape on the given distance.
9618 # @param theInit Shape to remove material from. It must be a solid or
9619 # a compound made of a single solid.
9620 # @param theBase Closed edge or wire defining the base shape to be extruded.
9621 # @param theH Prism dimension along the normal to theBase
9622 # @param theAngle Draft angle in degrees.
9623 # @param theName Object name; when specified, this parameter is used
9624 # for result publication in the study. Otherwise, if automatic
9625 # publication is switched on, default value is used for result name.
9627 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9629 # @ref tui_creation_prism "Example"
9630 @ManageTransactions("PrimOp")
9631 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9633 Add material to a solid by extrusion of the base shape on the given distance.
9636 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9637 theBase Closed edge or wire defining the base shape to be extruded.
9638 theH Prism dimension along the normal to theBase
9639 theAngle Draft angle in degrees.
9640 theName Object name; when specified, this parameter is used
9641 for result publication in the study. Otherwise, if automatic
9642 publication is switched on, default value is used for result name.
9645 New GEOM.GEOM_Object, containing the initial shape with removed material.
9647 # Example: see GEOM_TestAll.py
9648 #theH,Parameters = ParseParameters(theH)
9649 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9650 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9651 #anObj.SetParameters(Parameters)
9652 self._autoPublish(anObj, theName, "extrudedCut")
9655 ## Add material to a solid by extrusion of the base shape on the given distance.
9656 # @param theInit Shape to add material to. It must be a solid or
9657 # a compound made of a single solid.
9658 # @param theBase Closed edge or wire defining the base shape to be extruded.
9659 # @param theH Prism dimension along the normal to theBase
9660 # @param theAngle Draft angle in degrees.
9661 # @param theName Object name; when specified, this parameter is used
9662 # for result publication in the study. Otherwise, if automatic
9663 # publication is switched on, default value is used for result name.
9665 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9667 # @ref tui_creation_prism "Example"
9668 @ManageTransactions("PrimOp")
9669 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9671 Add material to a solid by extrusion of the base shape on the given distance.
9674 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9675 theBase Closed edge or wire defining the base shape to be extruded.
9676 theH Prism dimension along the normal to theBase
9677 theAngle Draft angle in degrees.
9678 theName Object name; when specified, this parameter is used
9679 for result publication in the study. Otherwise, if automatic
9680 publication is switched on, default value is used for result name.
9683 New GEOM.GEOM_Object, containing the initial shape with added material.
9685 # Example: see GEOM_TestAll.py
9686 #theH,Parameters = ParseParameters(theH)
9687 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9688 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9689 #anObj.SetParameters(Parameters)
9690 self._autoPublish(anObj, theName, "extrudedBoss")
9696 ## @addtogroup l3_basic_op
9699 ## Perform an Archimde operation on the given shape with given parameters.
9700 # The object presenting the resulting face is returned.
9701 # @param theShape Shape to be put in water.
9702 # @param theWeight Weight og the shape.
9703 # @param theWaterDensity Density of the water.
9704 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9705 # @param theName Object name; when specified, this parameter is used
9706 # for result publication in the study. Otherwise, if automatic
9707 # publication is switched on, default value is used for result name.
9709 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9710 # by a plane, corresponding to water level.
9712 # @ref tui_archimede "Example"
9713 @ManageTransactions("LocalOp")
9714 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9716 Perform an Archimde operation on the given shape with given parameters.
9717 The object presenting the resulting face is returned.
9720 theShape Shape to be put in water.
9721 theWeight Weight og the shape.
9722 theWaterDensity Density of the water.
9723 theMeshDeflection Deflection of the mesh, using to compute the section.
9724 theName Object name; when specified, this parameter is used
9725 for result publication in the study. Otherwise, if automatic
9726 publication is switched on, default value is used for result name.
9729 New GEOM.GEOM_Object, containing a section of theShape
9730 by a plane, corresponding to water level.
9732 # Example: see GEOM_TestAll.py
9733 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9734 theWeight,theWaterDensity,theMeshDeflection)
9735 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9736 RaiseIfFailed("MakeArchimede", self.LocalOp)
9737 anObj.SetParameters(Parameters)
9738 self._autoPublish(anObj, theName, "archimede")
9741 # end of l3_basic_op
9744 ## @addtogroup l2_measure
9747 ## Get point coordinates
9750 # @ref tui_measurement_tools_page "Example"
9751 @ManageTransactions("MeasuOp")
9752 def PointCoordinates(self,Point):
9754 Get point coordinates
9759 # Example: see GEOM_TestMeasures.py
9760 aTuple = self.MeasuOp.PointCoordinates(Point)
9761 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9764 ## Get vector coordinates
9767 # @ref tui_measurement_tools_page "Example"
9768 def VectorCoordinates(self,Vector):
9770 Get vector coordinates
9776 p1=self.GetFirstVertex(Vector)
9777 p2=self.GetLastVertex(Vector)
9779 X1=self.PointCoordinates(p1)
9780 X2=self.PointCoordinates(p2)
9782 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9785 ## Compute cross product
9786 # @return vector w=u^v
9788 # @ref tui_measurement_tools_page "Example"
9789 def CrossProduct(self, Vector1, Vector2):
9791 Compute cross product
9793 Returns: vector w=u^v
9795 u=self.VectorCoordinates(Vector1)
9796 v=self.VectorCoordinates(Vector2)
9797 w=self.MakeVectorDXDYDZ(u[1]*v[2]-u[2]*v[1], u[2]*v[0]-u[0]*v[2], u[0]*v[1]-u[1]*v[0])
9801 ## Compute cross product
9802 # @return dot product p=u.v
9804 # @ref tui_measurement_tools_page "Example"
9805 def DotProduct(self, Vector1, Vector2):
9807 Compute cross product
9809 Returns: dot product p=u.v
9811 u=self.VectorCoordinates(Vector1)
9812 v=self.VectorCoordinates(Vector2)
9813 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9818 ## Get summarized length of all wires,
9819 # area of surface and volume of the given shape.
9820 # @param theShape Shape to define properties of.
9821 # @return [theLength, theSurfArea, theVolume]\n
9822 # theLength: Summarized length of all wires of the given shape.\n
9823 # theSurfArea: Area of surface of the given shape.\n
9824 # theVolume: Volume of the given shape.
9826 # @ref tui_measurement_tools_page "Example"
9827 @ManageTransactions("MeasuOp")
9828 def BasicProperties(self,theShape):
9830 Get summarized length of all wires,
9831 area of surface and volume of the given shape.
9834 theShape Shape to define properties of.
9837 [theLength, theSurfArea, theVolume]
9838 theLength: Summarized length of all wires of the given shape.
9839 theSurfArea: Area of surface of the given shape.
9840 theVolume: Volume of the given shape.
9842 # Example: see GEOM_TestMeasures.py
9843 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9844 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9847 ## Get parameters of bounding box of the given shape
9848 # @param theShape Shape to obtain bounding box of.
9849 # @param precise TRUE for precise computation; FALSE for fast one.
9850 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9851 # Xmin,Xmax: Limits of shape along OX axis.
9852 # Ymin,Ymax: Limits of shape along OY axis.
9853 # Zmin,Zmax: Limits of shape along OZ axis.
9855 # @ref tui_measurement_tools_page "Example"
9856 @ManageTransactions("MeasuOp")
9857 def BoundingBox (self, theShape, precise=False):
9859 Get parameters of bounding box of the given shape
9862 theShape Shape to obtain bounding box of.
9863 precise TRUE for precise computation; FALSE for fast one.
9866 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9867 Xmin,Xmax: Limits of shape along OX axis.
9868 Ymin,Ymax: Limits of shape along OY axis.
9869 Zmin,Zmax: Limits of shape along OZ axis.
9871 # Example: see GEOM_TestMeasures.py
9872 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9873 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9876 ## Get bounding box of the given shape
9877 # @param theShape Shape to obtain bounding box of.
9878 # @param precise TRUE for precise computation; FALSE for fast one.
9879 # @param theName Object name; when specified, this parameter is used
9880 # for result publication in the study. Otherwise, if automatic
9881 # publication is switched on, default value is used for result name.
9883 # @return New GEOM.GEOM_Object, containing the created box.
9885 # @ref tui_measurement_tools_page "Example"
9886 @ManageTransactions("MeasuOp")
9887 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9889 Get bounding box of the given shape
9892 theShape Shape to obtain bounding box of.
9893 precise TRUE for precise computation; FALSE for fast one.
9894 theName Object name; when specified, this parameter is used
9895 for result publication in the study. Otherwise, if automatic
9896 publication is switched on, default value is used for result name.
9899 New GEOM.GEOM_Object, containing the created box.
9901 # Example: see GEOM_TestMeasures.py
9902 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9903 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9904 self._autoPublish(anObj, theName, "bndbox")
9907 ## Get inertia matrix and moments of inertia of theShape.
9908 # @param theShape Shape to calculate inertia of.
9909 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9910 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9911 # Ix,Iy,Iz: Moments of inertia of the given shape.
9913 # @ref tui_measurement_tools_page "Example"
9914 @ManageTransactions("MeasuOp")
9915 def Inertia(self,theShape):
9917 Get inertia matrix and moments of inertia of theShape.
9920 theShape Shape to calculate inertia of.
9923 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9924 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9925 Ix,Iy,Iz: Moments of inertia of the given shape.
9927 # Example: see GEOM_TestMeasures.py
9928 aTuple = self.MeasuOp.GetInertia(theShape)
9929 RaiseIfFailed("GetInertia", self.MeasuOp)
9932 ## Get if coords are included in the shape (ST_IN or ST_ON)
9933 # @param theShape Shape
9934 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9935 # @param tolerance to be used (default is 1.0e-7)
9936 # @return list_of_boolean = [res1, res2, ...]
9937 @ManageTransactions("MeasuOp")
9938 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9940 Get if coords are included in the shape (ST_IN or ST_ON)
9944 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9945 tolerance to be used (default is 1.0e-7)
9948 list_of_boolean = [res1, res2, ...]
9950 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9952 ## Get minimal distance between the given shapes.
9953 # @param theShape1,theShape2 Shapes to find minimal distance between.
9954 # @return Value of the minimal distance between the given shapes.
9956 # @ref tui_measurement_tools_page "Example"
9957 @ManageTransactions("MeasuOp")
9958 def MinDistance(self, theShape1, theShape2):
9960 Get minimal distance between the given shapes.
9963 theShape1,theShape2 Shapes to find minimal distance between.
9966 Value of the minimal distance between the given shapes.
9968 # Example: see GEOM_TestMeasures.py
9969 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9970 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9973 ## Get minimal distance between the given shapes.
9974 # @param theShape1,theShape2 Shapes to find minimal distance between.
9975 # @return Value of the minimal distance between the given shapes, in form of list
9976 # [Distance, DX, DY, DZ].
9978 # @ref swig_all_measure "Example"
9979 @ManageTransactions("MeasuOp")
9980 def MinDistanceComponents(self, theShape1, theShape2):
9982 Get minimal distance between the given shapes.
9985 theShape1,theShape2 Shapes to find minimal distance between.
9988 Value of the minimal distance between the given shapes, in form of list
9989 [Distance, DX, DY, DZ]
9991 # Example: see GEOM_TestMeasures.py
9992 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9993 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9994 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9997 ## Get closest points of the given shapes.
9998 # @param theShape1,theShape2 Shapes to find closest points of.
9999 # @return The number of found solutions (-1 in case of infinite number of
10000 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10002 # @ref tui_measurement_tools_page "Example"
10003 @ManageTransactions("MeasuOp")
10004 def ClosestPoints (self, theShape1, theShape2):
10006 Get closest points of the given shapes.
10009 theShape1,theShape2 Shapes to find closest points of.
10012 The number of found solutions (-1 in case of infinite number of
10013 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10015 # Example: see GEOM_TestMeasures.py
10016 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10017 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10020 ## Get angle between the given shapes in degrees.
10021 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10022 # @note If both arguments are vectors, the angle is computed in accordance
10023 # with their orientations, otherwise the minimum angle is computed.
10024 # @return Value of the angle between the given shapes in degrees.
10026 # @ref tui_measurement_tools_page "Example"
10027 @ManageTransactions("MeasuOp")
10028 def GetAngle(self, theShape1, theShape2):
10030 Get angle between the given shapes in degrees.
10033 theShape1,theShape2 Lines or linear edges to find angle between.
10036 If both arguments are vectors, the angle is computed in accordance
10037 with their orientations, otherwise the minimum angle is computed.
10040 Value of the angle between the given shapes in degrees.
10042 # Example: see GEOM_TestMeasures.py
10043 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10044 RaiseIfFailed("GetAngle", self.MeasuOp)
10047 ## Get angle between the given shapes in radians.
10048 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10049 # @note If both arguments are vectors, the angle is computed in accordance
10050 # with their orientations, otherwise the minimum angle is computed.
10051 # @return Value of the angle between the given shapes in radians.
10053 # @ref tui_measurement_tools_page "Example"
10054 @ManageTransactions("MeasuOp")
10055 def GetAngleRadians(self, theShape1, theShape2):
10057 Get angle between the given shapes in radians.
10060 theShape1,theShape2 Lines or linear edges to find angle between.
10064 If both arguments are vectors, the angle is computed in accordance
10065 with their orientations, otherwise the minimum angle is computed.
10068 Value of the angle between the given shapes in radians.
10070 # Example: see GEOM_TestMeasures.py
10071 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10072 RaiseIfFailed("GetAngle", self.MeasuOp)
10075 ## Get angle between the given vectors in degrees.
10076 # @param theShape1,theShape2 Vectors to find angle between.
10077 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10078 # if False, the opposite vector to the normal vector is used.
10079 # @return Value of the angle between the given vectors in degrees.
10081 # @ref tui_measurement_tools_page "Example"
10082 @ManageTransactions("MeasuOp")
10083 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10085 Get angle between the given vectors in degrees.
10088 theShape1,theShape2 Vectors to find angle between.
10089 theFlag If True, the normal vector is defined by the two vectors cross,
10090 if False, the opposite vector to the normal vector is used.
10093 Value of the angle between the given vectors in degrees.
10095 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10097 anAngle = 360. - anAngle
10098 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10101 ## The same as GetAngleVectors, but the result is in radians.
10102 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10104 Get angle between the given vectors in radians.
10107 theShape1,theShape2 Vectors to find angle between.
10108 theFlag If True, the normal vector is defined by the two vectors cross,
10109 if False, the opposite vector to the normal vector is used.
10112 Value of the angle between the given vectors in radians.
10114 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10117 ## @name Curve Curvature Measurement
10118 # Methods for receiving radius of curvature of curves
10119 # in the given point
10122 ## Measure curvature of a curve at a point, set by parameter.
10123 # @param theCurve a curve.
10124 # @param theParam parameter.
10125 # @return radius of curvature of \a theCurve.
10127 # @ref swig_todo "Example"
10128 @ManageTransactions("MeasuOp")
10129 def CurveCurvatureByParam(self, theCurve, theParam):
10131 Measure curvature of a curve at a point, set by parameter.
10135 theParam parameter.
10138 radius of curvature of theCurve.
10140 # Example: see GEOM_TestMeasures.py
10141 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10142 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10145 ## Measure curvature of a curve at a point.
10146 # @param theCurve a curve.
10147 # @param thePoint given point.
10148 # @return radius of curvature of \a theCurve.
10150 # @ref swig_todo "Example"
10151 @ManageTransactions("MeasuOp")
10152 def CurveCurvatureByPoint(self, theCurve, thePoint):
10154 Measure curvature of a curve at a point.
10158 thePoint given point.
10161 radius of curvature of theCurve.
10163 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10164 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10168 ## @name Surface Curvature Measurement
10169 # Methods for receiving max and min radius of curvature of surfaces
10170 # in the given point
10173 ## Measure max radius of curvature of surface.
10174 # @param theSurf the given surface.
10175 # @param theUParam Value of U-parameter on the referenced surface.
10176 # @param theVParam Value of V-parameter on the referenced surface.
10177 # @return max radius of curvature of theSurf.
10179 ## @ref swig_todo "Example"
10180 @ManageTransactions("MeasuOp")
10181 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10183 Measure max radius of curvature of surface.
10186 theSurf the given surface.
10187 theUParam Value of U-parameter on the referenced surface.
10188 theVParam Value of V-parameter on the referenced surface.
10191 max radius of curvature of theSurf.
10193 # Example: see GEOM_TestMeasures.py
10194 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10195 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10198 ## Measure max radius of curvature of surface in the given point
10199 # @param theSurf the given surface.
10200 # @param thePoint given point.
10201 # @return max radius of curvature of theSurf.
10203 ## @ref swig_todo "Example"
10204 @ManageTransactions("MeasuOp")
10205 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10207 Measure max radius of curvature of surface in the given point.
10210 theSurf the given surface.
10211 thePoint given point.
10214 max radius of curvature of theSurf.
10216 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10217 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10220 ## Measure min radius of curvature of surface.
10221 # @param theSurf the given surface.
10222 # @param theUParam Value of U-parameter on the referenced surface.
10223 # @param theVParam Value of V-parameter on the referenced surface.
10224 # @return min radius of curvature of theSurf.
10226 ## @ref swig_todo "Example"
10227 @ManageTransactions("MeasuOp")
10228 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10230 Measure min radius of curvature of surface.
10233 theSurf the given surface.
10234 theUParam Value of U-parameter on the referenced surface.
10235 theVParam Value of V-parameter on the referenced surface.
10238 Min radius of curvature of theSurf.
10240 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10241 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10244 ## Measure min radius of curvature of surface in the given point
10245 # @param theSurf the given surface.
10246 # @param thePoint given point.
10247 # @return min radius of curvature of theSurf.
10249 ## @ref swig_todo "Example"
10250 @ManageTransactions("MeasuOp")
10251 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10253 Measure min radius of curvature of surface in the given point.
10256 theSurf the given surface.
10257 thePoint given point.
10260 Min radius of curvature of theSurf.
10262 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10263 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10267 ## Get min and max tolerances of sub-shapes of theShape
10268 # @param theShape Shape, to get tolerances of.
10269 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10270 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10271 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10272 # VertMin,VertMax: Min and max tolerances of the vertices.
10274 # @ref tui_measurement_tools_page "Example"
10275 @ManageTransactions("MeasuOp")
10276 def Tolerance(self,theShape):
10278 Get min and max tolerances of sub-shapes of theShape
10281 theShape Shape, to get tolerances of.
10284 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10285 FaceMin,FaceMax: Min and max tolerances of the faces.
10286 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10287 VertMin,VertMax: Min and max tolerances of the vertices.
10289 # Example: see GEOM_TestMeasures.py
10290 aTuple = self.MeasuOp.GetTolerance(theShape)
10291 RaiseIfFailed("GetTolerance", self.MeasuOp)
10294 ## Obtain description of the given shape (number of sub-shapes of each type)
10295 # @param theShape Shape to be described.
10296 # @return Description of the given shape.
10298 # @ref tui_measurement_tools_page "Example"
10299 @ManageTransactions("MeasuOp")
10300 def WhatIs(self,theShape):
10302 Obtain description of the given shape (number of sub-shapes of each type)
10305 theShape Shape to be described.
10308 Description of the given shape.
10310 # Example: see GEOM_TestMeasures.py
10311 aDescr = self.MeasuOp.WhatIs(theShape)
10312 RaiseIfFailed("WhatIs", self.MeasuOp)
10315 ## Obtain quantity of shapes of the given type in \a theShape.
10316 # If \a theShape is of type \a theType, it is also counted.
10317 # @param theShape Shape to be described.
10318 # @param theType the given ShapeType().
10319 # @return Quantity of shapes of type \a theType in \a theShape.
10321 # @ref tui_measurement_tools_page "Example"
10322 def NbShapes (self, theShape, theType):
10324 Obtain quantity of shapes of the given type in theShape.
10325 If theShape is of type theType, it is also counted.
10328 theShape Shape to be described.
10329 theType the given geompy.ShapeType
10332 Quantity of shapes of type theType in theShape.
10334 # Example: see GEOM_TestMeasures.py
10335 listSh = self.SubShapeAllIDs(theShape, theType)
10339 ## Obtain quantity of shapes of each type in \a theShape.
10340 # The \a theShape is also counted.
10341 # @param theShape Shape to be described.
10342 # @return Dictionary of ShapeType() with bound quantities of shapes.
10344 # @ref tui_measurement_tools_page "Example"
10345 def ShapeInfo (self, theShape):
10347 Obtain quantity of shapes of each type in theShape.
10348 The theShape is also counted.
10351 theShape Shape to be described.
10354 Dictionary of geompy.ShapeType with bound quantities of shapes.
10356 # Example: see GEOM_TestMeasures.py
10358 for typeSh in self.ShapeType:
10359 if typeSh in ( "AUTO", "SHAPE" ): continue
10360 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10366 def GetCreationInformation(self, theShape):
10367 info = theShape.GetCreationInformation()
10369 opName = info.operationName
10370 if not opName: opName = "no info available"
10371 res = "Operation: " + opName
10373 for parVal in info.params:
10374 res += " \n %s = %s" % ( parVal.name, parVal.value )
10377 ## Get a point, situated at the centre of mass of theShape.
10378 # @param theShape Shape to define centre of mass of.
10379 # @param theName Object name; when specified, this parameter is used
10380 # for result publication in the study. Otherwise, if automatic
10381 # publication is switched on, default value is used for result name.
10383 # @return New GEOM.GEOM_Object, containing the created point.
10385 # @ref tui_measurement_tools_page "Example"
10386 @ManageTransactions("MeasuOp")
10387 def MakeCDG(self, theShape, theName=None):
10389 Get a point, situated at the centre of mass of theShape.
10392 theShape Shape to define centre of mass of.
10393 theName Object name; when specified, this parameter is used
10394 for result publication in the study. Otherwise, if automatic
10395 publication is switched on, default value is used for result name.
10398 New GEOM.GEOM_Object, containing the created point.
10400 # Example: see GEOM_TestMeasures.py
10401 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10402 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10403 self._autoPublish(anObj, theName, "centerOfMass")
10406 ## Get a vertex sub-shape by index depended with orientation.
10407 # @param theShape Shape to find sub-shape.
10408 # @param theIndex Index to find vertex by this index (starting from zero)
10409 # @param theName Object name; when specified, this parameter is used
10410 # for result publication in the study. Otherwise, if automatic
10411 # publication is switched on, default value is used for result name.
10413 # @return New GEOM.GEOM_Object, containing the created vertex.
10415 # @ref tui_measurement_tools_page "Example"
10416 @ManageTransactions("MeasuOp")
10417 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10419 Get a vertex sub-shape by index depended with orientation.
10422 theShape Shape to find sub-shape.
10423 theIndex Index to find vertex by this index (starting from zero)
10424 theName Object name; when specified, this parameter is used
10425 for result publication in the study. Otherwise, if automatic
10426 publication is switched on, default value is used for result name.
10429 New GEOM.GEOM_Object, containing the created vertex.
10431 # Example: see GEOM_TestMeasures.py
10432 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10433 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10434 self._autoPublish(anObj, theName, "vertex")
10437 ## Get the first vertex of wire/edge depended orientation.
10438 # @param theShape Shape to find first vertex.
10439 # @param theName Object name; when specified, this parameter is used
10440 # for result publication in the study. Otherwise, if automatic
10441 # publication is switched on, default value is used for result name.
10443 # @return New GEOM.GEOM_Object, containing the created vertex.
10445 # @ref tui_measurement_tools_page "Example"
10446 def GetFirstVertex(self, theShape, theName=None):
10448 Get the first vertex of wire/edge depended orientation.
10451 theShape Shape to find first vertex.
10452 theName Object name; when specified, this parameter is used
10453 for result publication in the study. Otherwise, if automatic
10454 publication is switched on, default value is used for result name.
10457 New GEOM.GEOM_Object, containing the created vertex.
10459 # Example: see GEOM_TestMeasures.py
10460 # note: auto-publishing is done in self.GetVertexByIndex()
10461 return self.GetVertexByIndex(theShape, 0, theName)
10463 ## Get the last vertex of wire/edge depended orientation.
10464 # @param theShape Shape to find last vertex.
10465 # @param theName Object name; when specified, this parameter is used
10466 # for result publication in the study. Otherwise, if automatic
10467 # publication is switched on, default value is used for result name.
10469 # @return New GEOM.GEOM_Object, containing the created vertex.
10471 # @ref tui_measurement_tools_page "Example"
10472 def GetLastVertex(self, theShape, theName=None):
10474 Get the last vertex of wire/edge depended orientation.
10477 theShape Shape to find last vertex.
10478 theName Object name; when specified, this parameter is used
10479 for result publication in the study. Otherwise, if automatic
10480 publication is switched on, default value is used for result name.
10483 New GEOM.GEOM_Object, containing the created vertex.
10485 # Example: see GEOM_TestMeasures.py
10486 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10487 # note: auto-publishing is done in self.GetVertexByIndex()
10488 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10490 ## Get a normale to the given face. If the point is not given,
10491 # the normale is calculated at the center of mass.
10492 # @param theFace Face to define normale of.
10493 # @param theOptionalPoint Point to compute the normale at.
10494 # @param theName Object name; when specified, this parameter is used
10495 # for result publication in the study. Otherwise, if automatic
10496 # publication is switched on, default value is used for result name.
10498 # @return New GEOM.GEOM_Object, containing the created vector.
10500 # @ref swig_todo "Example"
10501 @ManageTransactions("MeasuOp")
10502 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10504 Get a normale to the given face. If the point is not given,
10505 the normale is calculated at the center of mass.
10508 theFace Face to define normale of.
10509 theOptionalPoint Point to compute the normale at.
10510 theName Object name; when specified, this parameter is used
10511 for result publication in the study. Otherwise, if automatic
10512 publication is switched on, default value is used for result name.
10515 New GEOM.GEOM_Object, containing the created vector.
10517 # Example: see GEOM_TestMeasures.py
10518 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10519 RaiseIfFailed("GetNormal", self.MeasuOp)
10520 self._autoPublish(anObj, theName, "normal")
10523 ## Print shape errors obtained from CheckShape.
10524 # @param theShape Shape that was checked.
10525 # @param theShapeErrors the shape errors obtained by CheckShape.
10526 # @param theReturnStatus If 0 the description of problem is printed.
10527 # If 1 the description of problem is returned.
10528 # @return If theReturnStatus is equal to 1 the description is returned.
10529 # Otherwise doesn't return anything.
10531 # @ref tui_measurement_tools_page "Example"
10532 @ManageTransactions("MeasuOp")
10533 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10535 Print shape errors obtained from CheckShape.
10538 theShape Shape that was checked.
10539 theShapeErrors the shape errors obtained by CheckShape.
10540 theReturnStatus If 0 the description of problem is printed.
10541 If 1 the description of problem is returned.
10544 If theReturnStatus is equal to 1 the description is returned.
10545 Otherwise doesn't return anything.
10547 # Example: see GEOM_TestMeasures.py
10548 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10549 if theReturnStatus == 1:
10554 ## Check a topology of the given shape.
10555 # @param theShape Shape to check validity of.
10556 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10557 # if TRUE, the shape's geometry will be checked also.
10558 # @param theReturnStatus If 0 and if theShape is invalid, a description
10559 # of problem is printed.
10560 # If 1 isValid flag and the description of
10561 # problem is returned.
10562 # If 2 isValid flag and the list of error data
10564 # @return TRUE, if the shape "seems to be valid".
10565 # If theShape is invalid, prints a description of problem.
10566 # If theReturnStatus is equal to 1 the description is returned
10567 # along with IsValid flag.
10568 # If theReturnStatus is equal to 2 the list of error data is
10569 # returned along with IsValid flag.
10571 # @ref tui_measurement_tools_page "Example"
10572 @ManageTransactions("MeasuOp")
10573 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10575 Check a topology of the given shape.
10578 theShape Shape to check validity of.
10579 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10580 if TRUE, the shape's geometry will be checked also.
10581 theReturnStatus If 0 and if theShape is invalid, a description
10582 of problem is printed.
10583 If 1 IsValid flag and the description of
10584 problem is returned.
10585 If 2 IsValid flag and the list of error data
10589 TRUE, if the shape "seems to be valid".
10590 If theShape is invalid, prints a description of problem.
10591 If theReturnStatus is equal to 1 the description is returned
10592 along with IsValid flag.
10593 If theReturnStatus is equal to 2 the list of error data is
10594 returned along with IsValid flag.
10596 # Example: see GEOM_TestMeasures.py
10598 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10599 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10601 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10602 RaiseIfFailed("CheckShape", self.MeasuOp)
10604 if theReturnStatus == 0:
10605 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10607 if theReturnStatus == 1:
10608 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10609 return (IsValid, Descr)
10610 elif theReturnStatus == 2:
10611 return (IsValid, ShapeErrors)
10614 ## Detect self-intersections in the given shape.
10615 # @param theShape Shape to check.
10616 # @return TRUE, if the shape contains no self-intersections.
10618 # @ref tui_measurement_tools_page "Example"
10619 @ManageTransactions("MeasuOp")
10620 def CheckSelfIntersections(self, theShape):
10622 Detect self-intersections in the given shape.
10625 theShape Shape to check.
10628 TRUE, if the shape contains no self-intersections.
10630 # Example: see GEOM_TestMeasures.py
10631 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10632 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10635 ## Get position (LCS) of theShape.
10637 # Origin of the LCS is situated at the shape's center of mass.
10638 # Axes of the LCS are obtained from shape's location or,
10639 # if the shape is a planar face, from position of its plane.
10641 # @param theShape Shape to calculate position of.
10642 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10643 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10644 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10645 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10647 # @ref swig_todo "Example"
10648 @ManageTransactions("MeasuOp")
10649 def GetPosition(self,theShape):
10651 Get position (LCS) of theShape.
10652 Origin of the LCS is situated at the shape's center of mass.
10653 Axes of the LCS are obtained from shape's location or,
10654 if the shape is a planar face, from position of its plane.
10657 theShape Shape to calculate position of.
10660 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10661 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10662 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10663 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10665 # Example: see GEOM_TestMeasures.py
10666 aTuple = self.MeasuOp.GetPosition(theShape)
10667 RaiseIfFailed("GetPosition", self.MeasuOp)
10670 ## Get kind of theShape.
10672 # @param theShape Shape to get a kind of.
10673 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10674 # and a list of parameters, describing the shape.
10675 # @note Concrete meaning of each value, returned via \a theIntegers
10676 # or \a theDoubles list depends on the kind() of the shape.
10678 # @ref swig_todo "Example"
10679 @ManageTransactions("MeasuOp")
10680 def KindOfShape(self,theShape):
10682 Get kind of theShape.
10685 theShape Shape to get a kind of.
10688 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10689 and a list of parameters, describing the shape.
10691 Concrete meaning of each value, returned via theIntegers
10692 or theDoubles list depends on the geompy.kind of the shape
10694 # Example: see GEOM_TestMeasures.py
10695 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10696 RaiseIfFailed("KindOfShape", self.MeasuOp)
10698 aKind = aRoughTuple[0]
10699 anInts = aRoughTuple[1]
10700 aDbls = aRoughTuple[2]
10702 # Now there is no exception from this rule:
10703 aKindTuple = [aKind] + aDbls + anInts
10705 # If they are we will regroup parameters for such kind of shape.
10707 #if aKind == kind.SOME_KIND:
10708 # # SOME_KIND int int double int double double
10709 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10713 ## Returns the string that describes if the shell is good for solid.
10714 # This is a support method for MakeSolid.
10716 # @param theShell the shell to be checked.
10717 # @return Returns a string that describes the shell validity for
10718 # solid construction.
10719 @ManageTransactions("MeasuOp")
10720 def _IsGoodForSolid(self, theShell):
10722 Returns the string that describes if the shell is good for solid.
10723 This is a support method for MakeSolid.
10726 theShell the shell to be checked.
10729 Returns a string that describes the shell validity for
10730 solid construction.
10732 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10735 # end of l2_measure
10738 ## @addtogroup l2_import_export
10741 ## Import a shape from the BREP, IGES, STEP or other file
10742 # (depends on given format) with given name.
10744 # Note: this function is deprecated, it is kept for backward compatibility only
10745 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10747 # @param theFileName The file, containing the shape.
10748 # @param theFormatName Specify format for the file reading.
10749 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10750 # If format 'IGES_SCALE' is used instead of 'IGES' or
10751 # format 'STEP_SCALE' is used instead of 'STEP',
10752 # length unit will be set to 'meter' and result model will be scaled.
10753 # @param theName Object name; when specified, this parameter is used
10754 # for result publication in the study. Otherwise, if automatic
10755 # publication is switched on, default value is used for result name.
10757 # @return New GEOM.GEOM_Object, containing the imported shape.
10758 # If material names are imported it returns the list of
10759 # objects. The first one is the imported object followed by
10761 # @note Auto publishing is allowed for the shape itself. Imported
10762 # material groups are not automatically published.
10764 # @ref swig_Import_Export "Example"
10765 @ManageTransactions("InsertOp")
10766 def ImportFile(self, theFileName, theFormatName, theName=None):
10768 Import a shape from the BREP, IGES, STEP or other file
10769 (depends on given format) with given name.
10771 Note: this function is deprecated, it is kept for backward compatibility only
10772 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10775 theFileName The file, containing the shape.
10776 theFormatName Specify format for the file reading.
10777 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10778 If format 'IGES_SCALE' is used instead of 'IGES' or
10779 format 'STEP_SCALE' is used instead of 'STEP',
10780 length unit will be set to 'meter' and result model will be scaled.
10781 theName Object name; when specified, this parameter is used
10782 for result publication in the study. Otherwise, if automatic
10783 publication is switched on, default value is used for result name.
10786 New GEOM.GEOM_Object, containing the imported shape.
10787 If material names are imported it returns the list of
10788 objects. The first one is the imported object followed by
10791 Auto publishing is allowed for the shape itself. Imported
10792 material groups are not automatically published.
10794 # Example: see GEOM_TestOthers.py
10796 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
10797 where <FormatName> is a name of desirable format for importing.
10799 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10800 RaiseIfFailed("ImportFile", self.InsertOp)
10801 aNbObj = len(aListObj)
10803 self._autoPublish(aListObj[0], theName, "imported")
10808 ## Deprecated analog of ImportFile()
10809 def Import(self, theFileName, theFormatName, theName=None):
10811 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10813 # note: auto-publishing is done in self.ImportFile()
10814 return self.ImportFile(theFileName, theFormatName, theName)
10816 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10817 # @note This method will not be dumped to the python script by DumpStudy functionality.
10818 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10819 # @param theStream The BRep binary stream.
10820 # @param theName Object name; when specified, this parameter is used
10821 # for result publication in the study. Otherwise, if automatic
10822 # publication is switched on, default value is used for result name.
10824 # @return New GEOM_Object, containing the shape, read from theStream.
10826 # @ref swig_Import_Export "Example"
10827 @ManageTransactions("InsertOp")
10828 def RestoreShape (self, theStream, theName=None):
10830 Read a shape from the binary stream, containing its bounding representation (BRep).
10833 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10836 theStream The BRep binary stream.
10837 theName Object name; when specified, this parameter is used
10838 for result publication in the study. Otherwise, if automatic
10839 publication is switched on, default value is used for result name.
10842 New GEOM_Object, containing the shape, read from theStream.
10844 # Example: see GEOM_TestOthers.py
10845 anObj = self.InsertOp.RestoreShape(theStream)
10846 RaiseIfFailed("RestoreShape", self.InsertOp)
10847 self._autoPublish(anObj, theName, "restored")
10850 ## Export the given shape into a file with given name.
10852 # Note: this function is deprecated, it is kept for backward compatibility only
10853 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10855 # @param theObject Shape to be stored in the file.
10856 # @param theFileName Name of the file to store the given shape in.
10857 # @param theFormatName Specify format for the shape storage.
10858 # Available formats can be obtained with
10859 # geompy.InsertOp.ExportTranslators()[0] method.
10861 # @ref swig_Import_Export "Example"
10862 @ManageTransactions("InsertOp")
10863 def Export(self, theObject, theFileName, theFormatName):
10865 Export the given shape into a file with given name.
10867 Note: this function is deprecated, it is kept for backward compatibility only
10868 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10871 theObject Shape to be stored in the file.
10872 theFileName Name of the file to store the given shape in.
10873 theFormatName Specify format for the shape storage.
10874 Available formats can be obtained with
10875 geompy.InsertOp.ExportTranslators()[0] method.
10877 # Example: see GEOM_TestOthers.py
10879 WARNING: Function Export is deprecated, use Export<FormatName> instead,
10880 where <FormatName> is a name of desirable format for exporting.
10882 self.InsertOp.Export(theObject, theFileName, theFormatName)
10883 if self.InsertOp.IsDone() == 0:
10884 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10888 # end of l2_import_export
10891 ## @addtogroup l3_blocks
10894 ## Create a quadrangle face from four edges. Order of Edges is not
10895 # important. It is not necessary that edges share the same vertex.
10896 # @param E1,E2,E3,E4 Edges for the face bound.
10897 # @param theName Object name; when specified, this parameter is used
10898 # for result publication in the study. Otherwise, if automatic
10899 # publication is switched on, default value is used for result name.
10901 # @return New GEOM.GEOM_Object, containing the created face.
10903 # @ref tui_building_by_blocks_page "Example"
10904 @ManageTransactions("BlocksOp")
10905 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10907 Create a quadrangle face from four edges. Order of Edges is not
10908 important. It is not necessary that edges share the same vertex.
10911 E1,E2,E3,E4 Edges for the face bound.
10912 theName Object name; when specified, this parameter is used
10913 for result publication in the study. Otherwise, if automatic
10914 publication is switched on, default value is used for result name.
10917 New GEOM.GEOM_Object, containing the created face.
10920 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10922 # Example: see GEOM_Spanner.py
10923 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10924 RaiseIfFailed("MakeQuad", self.BlocksOp)
10925 self._autoPublish(anObj, theName, "quad")
10928 ## Create a quadrangle face on two edges.
10929 # The missing edges will be built by creating the shortest ones.
10930 # @param E1,E2 Two opposite edges for the face.
10931 # @param theName Object name; when specified, this parameter is used
10932 # for result publication in the study. Otherwise, if automatic
10933 # publication is switched on, default value is used for result name.
10935 # @return New GEOM.GEOM_Object, containing the created face.
10937 # @ref tui_building_by_blocks_page "Example"
10938 @ManageTransactions("BlocksOp")
10939 def MakeQuad2Edges(self, E1, E2, theName=None):
10941 Create a quadrangle face on two edges.
10942 The missing edges will be built by creating the shortest ones.
10945 E1,E2 Two opposite edges for the face.
10946 theName Object name; when specified, this parameter is used
10947 for result publication in the study. Otherwise, if automatic
10948 publication is switched on, default value is used for result name.
10951 New GEOM.GEOM_Object, containing the created face.
10955 p1 = geompy.MakeVertex( 0., 0., 0.)
10956 p2 = geompy.MakeVertex(150., 30., 0.)
10957 p3 = geompy.MakeVertex( 0., 120., 50.)
10958 p4 = geompy.MakeVertex( 0., 40., 70.)
10960 edge1 = geompy.MakeEdge(p1, p2)
10961 edge2 = geompy.MakeEdge(p3, p4)
10962 # create a quadrangle face from two edges
10963 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10965 # Example: see GEOM_Spanner.py
10966 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10967 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10968 self._autoPublish(anObj, theName, "quad")
10971 ## Create a quadrangle face with specified corners.
10972 # The missing edges will be built by creating the shortest ones.
10973 # @param V1,V2,V3,V4 Corner vertices for the face.
10974 # @param theName Object name; when specified, this parameter is used
10975 # for result publication in the study. Otherwise, if automatic
10976 # publication is switched on, default value is used for result name.
10978 # @return New GEOM.GEOM_Object, containing the created face.
10980 # @ref tui_building_by_blocks_page "Example 1"
10981 # \n @ref swig_MakeQuad4Vertices "Example 2"
10982 @ManageTransactions("BlocksOp")
10983 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10985 Create a quadrangle face with specified corners.
10986 The missing edges will be built by creating the shortest ones.
10989 V1,V2,V3,V4 Corner vertices for the face.
10990 theName Object name; when specified, this parameter is used
10991 for result publication in the study. Otherwise, if automatic
10992 publication is switched on, default value is used for result name.
10995 New GEOM.GEOM_Object, containing the created face.
10999 p1 = geompy.MakeVertex( 0., 0., 0.)
11000 p2 = geompy.MakeVertex(150., 30., 0.)
11001 p3 = geompy.MakeVertex( 0., 120., 50.)
11002 p4 = geompy.MakeVertex( 0., 40., 70.)
11003 # create a quadrangle from four points in its corners
11004 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11006 # Example: see GEOM_Spanner.py
11007 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11008 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11009 self._autoPublish(anObj, theName, "quad")
11012 ## Create a hexahedral solid, bounded by the six given faces. Order of
11013 # faces is not important. It is not necessary that Faces share the same edge.
11014 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11015 # @param theName Object name; when specified, this parameter is used
11016 # for result publication in the study. Otherwise, if automatic
11017 # publication is switched on, default value is used for result name.
11019 # @return New GEOM.GEOM_Object, containing the created solid.
11021 # @ref tui_building_by_blocks_page "Example 1"
11022 # \n @ref swig_MakeHexa "Example 2"
11023 @ManageTransactions("BlocksOp")
11024 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11026 Create a hexahedral solid, bounded by the six given faces. Order of
11027 faces is not important. It is not necessary that Faces share the same edge.
11030 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11031 theName Object name; when specified, this parameter is used
11032 for result publication in the study. Otherwise, if automatic
11033 publication is switched on, default value is used for result name.
11036 New GEOM.GEOM_Object, containing the created solid.
11039 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11041 # Example: see GEOM_Spanner.py
11042 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11043 RaiseIfFailed("MakeHexa", self.BlocksOp)
11044 self._autoPublish(anObj, theName, "hexa")
11047 ## Create a hexahedral solid between two given faces.
11048 # The missing faces will be built by creating the smallest ones.
11049 # @param F1,F2 Two opposite faces for the hexahedral solid.
11050 # @param theName Object name; when specified, this parameter is used
11051 # for result publication in the study. Otherwise, if automatic
11052 # publication is switched on, default value is used for result name.
11054 # @return New GEOM.GEOM_Object, containing the created solid.
11056 # @ref tui_building_by_blocks_page "Example 1"
11057 # \n @ref swig_MakeHexa2Faces "Example 2"
11058 @ManageTransactions("BlocksOp")
11059 def MakeHexa2Faces(self, F1, F2, theName=None):
11061 Create a hexahedral solid between two given faces.
11062 The missing faces will be built by creating the smallest ones.
11065 F1,F2 Two opposite faces for the hexahedral solid.
11066 theName Object name; when specified, this parameter is used
11067 for result publication in the study. Otherwise, if automatic
11068 publication is switched on, default value is used for result name.
11071 New GEOM.GEOM_Object, containing the created solid.
11074 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11076 # Example: see GEOM_Spanner.py
11077 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11078 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11079 self._autoPublish(anObj, theName, "hexa")
11085 ## @addtogroup l3_blocks_op
11088 ## Get a vertex, found in the given shape by its coordinates.
11089 # @param theShape Block or a compound of blocks.
11090 # @param theX,theY,theZ Coordinates of the sought vertex.
11091 # @param theEpsilon Maximum allowed distance between the resulting
11092 # vertex and point with the given coordinates.
11093 # @param theName Object name; when specified, this parameter is used
11094 # for result publication in the study. Otherwise, if automatic
11095 # publication is switched on, default value is used for result name.
11097 # @return New GEOM.GEOM_Object, containing the found vertex.
11099 # @ref swig_GetPoint "Example"
11100 @ManageTransactions("BlocksOp")
11101 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11103 Get a vertex, found in the given shape by its coordinates.
11106 theShape Block or a compound of blocks.
11107 theX,theY,theZ Coordinates of the sought vertex.
11108 theEpsilon Maximum allowed distance between the resulting
11109 vertex and point with the given coordinates.
11110 theName Object name; when specified, this parameter is used
11111 for result publication in the study. Otherwise, if automatic
11112 publication is switched on, default value is used for result name.
11115 New GEOM.GEOM_Object, containing the found vertex.
11118 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11120 # Example: see GEOM_TestOthers.py
11121 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11122 RaiseIfFailed("GetPoint", self.BlocksOp)
11123 self._autoPublish(anObj, theName, "vertex")
11126 ## Find a vertex of the given shape, which has minimal distance to the given point.
11127 # @param theShape Any shape.
11128 # @param thePoint Point, close to the desired vertex.
11129 # @param theName Object name; when specified, this parameter is used
11130 # for result publication in the study. Otherwise, if automatic
11131 # publication is switched on, default value is used for result name.
11133 # @return New GEOM.GEOM_Object, containing the found vertex.
11135 # @ref swig_GetVertexNearPoint "Example"
11136 @ManageTransactions("BlocksOp")
11137 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11139 Find a vertex of the given shape, which has minimal distance to the given point.
11142 theShape Any shape.
11143 thePoint Point, close to the desired vertex.
11144 theName Object name; when specified, this parameter is used
11145 for result publication in the study. Otherwise, if automatic
11146 publication is switched on, default value is used for result name.
11149 New GEOM.GEOM_Object, containing the found vertex.
11152 pmidle = geompy.MakeVertex(50, 0, 50)
11153 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11155 # Example: see GEOM_TestOthers.py
11156 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11157 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11158 self._autoPublish(anObj, theName, "vertex")
11161 ## Get an edge, found in the given shape by two given vertices.
11162 # @param theShape Block or a compound of blocks.
11163 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11164 # @param theName Object name; when specified, this parameter is used
11165 # for result publication in the study. Otherwise, if automatic
11166 # publication is switched on, default value is used for result name.
11168 # @return New GEOM.GEOM_Object, containing the found edge.
11170 # @ref swig_GetEdge "Example"
11171 @ManageTransactions("BlocksOp")
11172 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11174 Get an edge, found in the given shape by two given vertices.
11177 theShape Block or a compound of blocks.
11178 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11179 theName Object name; when specified, this parameter is used
11180 for result publication in the study. Otherwise, if automatic
11181 publication is switched on, default value is used for result name.
11184 New GEOM.GEOM_Object, containing the found edge.
11186 # Example: see GEOM_Spanner.py
11187 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11188 RaiseIfFailed("GetEdge", self.BlocksOp)
11189 self._autoPublish(anObj, theName, "edge")
11192 ## Find an edge of the given shape, which has minimal distance to the given point.
11193 # @param theShape Block or a compound of blocks.
11194 # @param thePoint Point, close to the desired edge.
11195 # @param theName Object name; when specified, this parameter is used
11196 # for result publication in the study. Otherwise, if automatic
11197 # publication is switched on, default value is used for result name.
11199 # @return New GEOM.GEOM_Object, containing the found edge.
11201 # @ref swig_GetEdgeNearPoint "Example"
11202 @ManageTransactions("BlocksOp")
11203 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11205 Find an edge of the given shape, which has minimal distance to the given point.
11208 theShape Block or a compound of blocks.
11209 thePoint Point, close to the desired edge.
11210 theName Object name; when specified, this parameter is used
11211 for result publication in the study. Otherwise, if automatic
11212 publication is switched on, default value is used for result name.
11215 New GEOM.GEOM_Object, containing the found edge.
11217 # Example: see GEOM_TestOthers.py
11218 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11219 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11220 self._autoPublish(anObj, theName, "edge")
11223 ## Returns a face, found in the given shape by four given corner vertices.
11224 # @param theShape Block or a compound of blocks.
11225 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11226 # @param theName Object name; when specified, this parameter is used
11227 # for result publication in the study. Otherwise, if automatic
11228 # publication is switched on, default value is used for result name.
11230 # @return New GEOM.GEOM_Object, containing the found face.
11232 # @ref swig_todo "Example"
11233 @ManageTransactions("BlocksOp")
11234 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11236 Returns a face, found in the given shape by four given corner vertices.
11239 theShape Block or a compound of blocks.
11240 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11241 theName Object name; when specified, this parameter is used
11242 for result publication in the study. Otherwise, if automatic
11243 publication is switched on, default value is used for result name.
11246 New GEOM.GEOM_Object, containing the found face.
11248 # Example: see GEOM_Spanner.py
11249 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11250 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11251 self._autoPublish(anObj, theName, "face")
11254 ## Get a face of block, found in the given shape by two given edges.
11255 # @param theShape Block or a compound of blocks.
11256 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11257 # @param theName Object name; when specified, this parameter is used
11258 # for result publication in the study. Otherwise, if automatic
11259 # publication is switched on, default value is used for result name.
11261 # @return New GEOM.GEOM_Object, containing the found face.
11263 # @ref swig_todo "Example"
11264 @ManageTransactions("BlocksOp")
11265 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11267 Get a face of block, found in the given shape by two given edges.
11270 theShape Block or a compound of blocks.
11271 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11272 theName Object name; when specified, this parameter is used
11273 for result publication in the study. Otherwise, if automatic
11274 publication is switched on, default value is used for result name.
11277 New GEOM.GEOM_Object, containing the found face.
11279 # Example: see GEOM_Spanner.py
11280 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11281 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11282 self._autoPublish(anObj, theName, "face")
11285 ## Find a face, opposite to the given one in the given block.
11286 # @param theBlock Must be a hexahedral solid.
11287 # @param theFace Face of \a theBlock, opposite to the desired face.
11288 # @param theName Object name; when specified, this parameter is used
11289 # for result publication in the study. Otherwise, if automatic
11290 # publication is switched on, default value is used for result name.
11292 # @return New GEOM.GEOM_Object, containing the found face.
11294 # @ref swig_GetOppositeFace "Example"
11295 @ManageTransactions("BlocksOp")
11296 def GetOppositeFace(self, theBlock, theFace, theName=None):
11298 Find a face, opposite to the given one in the given block.
11301 theBlock Must be a hexahedral solid.
11302 theFace Face of theBlock, opposite to the desired face.
11303 theName Object name; when specified, this parameter is used
11304 for result publication in the study. Otherwise, if automatic
11305 publication is switched on, default value is used for result name.
11308 New GEOM.GEOM_Object, containing the found face.
11310 # Example: see GEOM_Spanner.py
11311 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11312 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11313 self._autoPublish(anObj, theName, "face")
11316 ## Find a face of the given shape, which has minimal distance to the given point.
11317 # @param theShape Block or a compound of blocks.
11318 # @param thePoint Point, close to the desired face.
11319 # @param theName Object name; when specified, this parameter is used
11320 # for result publication in the study. Otherwise, if automatic
11321 # publication is switched on, default value is used for result name.
11323 # @return New GEOM.GEOM_Object, containing the found face.
11325 # @ref swig_GetFaceNearPoint "Example"
11326 @ManageTransactions("BlocksOp")
11327 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11329 Find a face of the given shape, which has minimal distance to the given point.
11332 theShape Block or a compound of blocks.
11333 thePoint Point, close to the desired face.
11334 theName Object name; when specified, this parameter is used
11335 for result publication in the study. Otherwise, if automatic
11336 publication is switched on, default value is used for result name.
11339 New GEOM.GEOM_Object, containing the found face.
11341 # Example: see GEOM_Spanner.py
11342 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11343 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11344 self._autoPublish(anObj, theName, "face")
11347 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11348 # @param theBlock Block or a compound of blocks.
11349 # @param theVector Vector, close to the normale of the desired face.
11350 # @param theName Object name; when specified, this parameter is used
11351 # for result publication in the study. Otherwise, if automatic
11352 # publication is switched on, default value is used for result name.
11354 # @return New GEOM.GEOM_Object, containing the found face.
11356 # @ref swig_todo "Example"
11357 @ManageTransactions("BlocksOp")
11358 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11360 Find a face of block, whose outside normale has minimal angle with the given vector.
11363 theBlock Block or a compound of blocks.
11364 theVector Vector, close to the normale of the desired face.
11365 theName Object name; when specified, this parameter is used
11366 for result publication in the study. Otherwise, if automatic
11367 publication is switched on, default value is used for result name.
11370 New GEOM.GEOM_Object, containing the found face.
11372 # Example: see GEOM_Spanner.py
11373 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11374 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11375 self._autoPublish(anObj, theName, "face")
11378 ## Find all sub-shapes of type \a theShapeType of the given shape,
11379 # which have minimal distance to the given point.
11380 # @param theShape Any shape.
11381 # @param thePoint Point, close to the desired shape.
11382 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11383 # @param theTolerance The tolerance for distances comparison. All shapes
11384 # with distances to the given point in interval
11385 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11386 # @param theName Object name; when specified, this parameter is used
11387 # for result publication in the study. Otherwise, if automatic
11388 # publication is switched on, default value is used for result name.
11390 # @return New GEOM_Object, containing a group of all found shapes.
11392 # @ref swig_GetShapesNearPoint "Example"
11393 @ManageTransactions("BlocksOp")
11394 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11396 Find all sub-shapes of type theShapeType of the given shape,
11397 which have minimal distance to the given point.
11400 theShape Any shape.
11401 thePoint Point, close to the desired shape.
11402 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11403 theTolerance The tolerance for distances comparison. All shapes
11404 with distances to the given point in interval
11405 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11406 theName Object name; when specified, this parameter is used
11407 for result publication in the study. Otherwise, if automatic
11408 publication is switched on, default value is used for result name.
11411 New GEOM_Object, containing a group of all found shapes.
11413 # Example: see GEOM_TestOthers.py
11414 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11415 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11416 self._autoPublish(anObj, theName, "group")
11419 # end of l3_blocks_op
11422 ## @addtogroup l4_blocks_measure
11425 ## Check, if the compound of blocks is given.
11426 # To be considered as a compound of blocks, the
11427 # given shape must satisfy the following conditions:
11428 # - Each element of the compound should be a Block (6 faces and 12 edges).
11429 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11430 # - The compound should be connexe.
11431 # - The glue between two quadrangle faces should be applied.
11432 # @param theCompound The compound to check.
11433 # @return TRUE, if the given shape is a compound of blocks.
11434 # If theCompound is not valid, prints all discovered errors.
11436 # @ref tui_measurement_tools_page "Example 1"
11437 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11438 @ManageTransactions("BlocksOp")
11439 def CheckCompoundOfBlocks(self,theCompound):
11441 Check, if the compound of blocks is given.
11442 To be considered as a compound of blocks, the
11443 given shape must satisfy the following conditions:
11444 - Each element of the compound should be a Block (6 faces and 12 edges).
11445 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11446 - The compound should be connexe.
11447 - The glue between two quadrangle faces should be applied.
11450 theCompound The compound to check.
11453 TRUE, if the given shape is a compound of blocks.
11454 If theCompound is not valid, prints all discovered errors.
11456 # Example: see GEOM_Spanner.py
11457 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11458 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11460 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11464 ## Retrieve all non blocks solids and faces from \a theShape.
11465 # @param theShape The shape to explore.
11466 # @param theName Object name; when specified, this parameter is used
11467 # for result publication in the study. Otherwise, if automatic
11468 # publication is switched on, default value is used for result name.
11470 # @return A tuple of two GEOM_Objects. The first object is a group of all
11471 # non block solids (= not 6 faces, or with 6 faces, but with the
11472 # presence of non-quadrangular faces). The second object is a
11473 # group of all non quadrangular faces.
11475 # @ref tui_measurement_tools_page "Example 1"
11476 # \n @ref swig_GetNonBlocks "Example 2"
11477 @ManageTransactions("BlocksOp")
11478 def GetNonBlocks (self, theShape, theName=None):
11480 Retrieve all non blocks solids and faces from theShape.
11483 theShape The shape to explore.
11484 theName Object name; when specified, this parameter is used
11485 for result publication in the study. Otherwise, if automatic
11486 publication is switched on, default value is used for result name.
11489 A tuple of two GEOM_Objects. The first object is a group of all
11490 non block solids (= not 6 faces, or with 6 faces, but with the
11491 presence of non-quadrangular faces). The second object is a
11492 group of all non quadrangular faces.
11495 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11497 # Example: see GEOM_Spanner.py
11498 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11499 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11500 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11503 ## Remove all seam and degenerated edges from \a theShape.
11504 # Unite faces and edges, sharing one surface. It means that
11505 # this faces must have references to one C++ surface object (handle).
11506 # @param theShape The compound or single solid to remove irregular edges from.
11507 # @param doUnionFaces If True, then unite faces. If False (the default value),
11508 # do not unite faces.
11509 # @param theName Object name; when specified, this parameter is used
11510 # for result publication in the study. Otherwise, if automatic
11511 # publication is switched on, default value is used for result name.
11513 # @return Improved shape.
11515 # @ref swig_RemoveExtraEdges "Example"
11516 @ManageTransactions("BlocksOp")
11517 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11519 Remove all seam and degenerated edges from theShape.
11520 Unite faces and edges, sharing one surface. It means that
11521 this faces must have references to one C++ surface object (handle).
11524 theShape The compound or single solid to remove irregular edges from.
11525 doUnionFaces If True, then unite faces. If False (the default value),
11526 do not unite faces.
11527 theName Object name; when specified, this parameter is used
11528 for result publication in the study. Otherwise, if automatic
11529 publication is switched on, default value is used for result name.
11534 # Example: see GEOM_TestOthers.py
11535 nbFacesOptimum = -1 # -1 means do not unite faces
11536 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11537 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11538 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11539 self._autoPublish(anObj, theName, "removeExtraEdges")
11542 ## Performs union faces of \a theShape
11543 # Unite faces sharing one surface. It means that
11544 # these faces must have references to one C++ surface object (handle).
11545 # @param theShape The compound or single solid that contains faces
11546 # to perform union.
11547 # @param theName Object name; when specified, this parameter is used
11548 # for result publication in the study. Otherwise, if automatic
11549 # publication is switched on, default value is used for result name.
11551 # @return Improved shape.
11553 # @ref swig_UnionFaces "Example"
11554 @ManageTransactions("BlocksOp")
11555 def UnionFaces(self, theShape, theName=None):
11557 Performs union faces of theShape.
11558 Unite faces sharing one surface. It means that
11559 these faces must have references to one C++ surface object (handle).
11562 theShape The compound or single solid that contains faces
11564 theName Object name; when specified, this parameter is used
11565 for result publication in the study. Otherwise, if automatic
11566 publication is switched on, default value is used for result name.
11571 # Example: see GEOM_TestOthers.py
11572 anObj = self.BlocksOp.UnionFaces(theShape)
11573 RaiseIfFailed("UnionFaces", self.BlocksOp)
11574 self._autoPublish(anObj, theName, "unionFaces")
11577 ## Check, if the given shape is a blocks compound.
11578 # Fix all detected errors.
11579 # \note Single block can be also fixed by this method.
11580 # @param theShape The compound to check and improve.
11581 # @param theName Object name; when specified, this parameter is used
11582 # for result publication in the study. Otherwise, if automatic
11583 # publication is switched on, default value is used for result name.
11585 # @return Improved compound.
11587 # @ref swig_CheckAndImprove "Example"
11588 @ManageTransactions("BlocksOp")
11589 def CheckAndImprove(self, theShape, theName=None):
11591 Check, if the given shape is a blocks compound.
11592 Fix all detected errors.
11595 Single block can be also fixed by this method.
11598 theShape The compound to check and improve.
11599 theName Object name; when specified, this parameter is used
11600 for result publication in the study. Otherwise, if automatic
11601 publication is switched on, default value is used for result name.
11606 # Example: see GEOM_TestOthers.py
11607 anObj = self.BlocksOp.CheckAndImprove(theShape)
11608 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11609 self._autoPublish(anObj, theName, "improved")
11612 # end of l4_blocks_measure
11615 ## @addtogroup l3_blocks_op
11618 ## Get all the blocks, contained in the given compound.
11619 # @param theCompound The compound to explode.
11620 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11621 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11622 # @param theName Object name; when specified, this parameter is used
11623 # for result publication in the study. Otherwise, if automatic
11624 # publication is switched on, default value is used for result name.
11626 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11628 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11630 # @ref tui_explode_on_blocks "Example 1"
11631 # \n @ref swig_MakeBlockExplode "Example 2"
11632 @ManageTransactions("BlocksOp")
11633 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11635 Get all the blocks, contained in the given compound.
11638 theCompound The compound to explode.
11639 theMinNbFaces If solid has lower number of faces, it is not a block.
11640 theMaxNbFaces If solid has higher number of faces, it is not a block.
11641 theName Object name; when specified, this parameter is used
11642 for result publication in the study. Otherwise, if automatic
11643 publication is switched on, default value is used for result name.
11646 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11649 List of GEOM.GEOM_Object, containing the retrieved blocks.
11651 # Example: see GEOM_TestOthers.py
11652 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11653 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11654 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11655 for anObj in aList:
11656 anObj.SetParameters(Parameters)
11658 self._autoPublish(aList, theName, "block")
11661 ## Find block, containing the given point inside its volume or on boundary.
11662 # @param theCompound Compound, to find block in.
11663 # @param thePoint Point, close to the desired block. If the point lays on
11664 # boundary between some blocks, we return block with nearest center.
11665 # @param theName Object name; when specified, this parameter is used
11666 # for result publication in the study. Otherwise, if automatic
11667 # publication is switched on, default value is used for result name.
11669 # @return New GEOM.GEOM_Object, containing the found block.
11671 # @ref swig_todo "Example"
11672 @ManageTransactions("BlocksOp")
11673 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11675 Find block, containing the given point inside its volume or on boundary.
11678 theCompound Compound, to find block in.
11679 thePoint Point, close to the desired block. If the point lays on
11680 boundary between some blocks, we return block with nearest center.
11681 theName Object name; when specified, this parameter is used
11682 for result publication in the study. Otherwise, if automatic
11683 publication is switched on, default value is used for result name.
11686 New GEOM.GEOM_Object, containing the found block.
11688 # Example: see GEOM_Spanner.py
11689 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11690 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11691 self._autoPublish(anObj, theName, "block")
11694 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11695 # @param theCompound Compound, to find block in.
11696 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11697 # @param theName Object name; when specified, this parameter is used
11698 # for result publication in the study. Otherwise, if automatic
11699 # publication is switched on, default value is used for result name.
11701 # @return New GEOM.GEOM_Object, containing the found block.
11703 # @ref swig_GetBlockByParts "Example"
11704 @ManageTransactions("BlocksOp")
11705 def GetBlockByParts(self, theCompound, theParts, theName=None):
11707 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11710 theCompound Compound, to find block in.
11711 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11712 theName Object name; when specified, this parameter is used
11713 for result publication in the study. Otherwise, if automatic
11714 publication is switched on, default value is used for result name.
11717 New GEOM_Object, containing the found block.
11719 # Example: see GEOM_TestOthers.py
11720 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11721 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11722 self._autoPublish(anObj, theName, "block")
11725 ## Return all blocks, containing all the elements, passed as the parts.
11726 # @param theCompound Compound, to find blocks in.
11727 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11728 # @param theName Object name; when specified, this parameter is used
11729 # for result publication in the study. Otherwise, if automatic
11730 # publication is switched on, default value is used for result name.
11732 # @return List of GEOM.GEOM_Object, containing the found blocks.
11734 # @ref swig_todo "Example"
11735 @ManageTransactions("BlocksOp")
11736 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11738 Return all blocks, containing all the elements, passed as the parts.
11741 theCompound Compound, to find blocks in.
11742 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11743 theName Object name; when specified, this parameter is used
11744 for result publication in the study. Otherwise, if automatic
11745 publication is switched on, default value is used for result name.
11748 List of GEOM.GEOM_Object, containing the found blocks.
11750 # Example: see GEOM_Spanner.py
11751 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11752 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11753 self._autoPublish(aList, theName, "block")
11756 ## Multi-transformate block and glue the result.
11757 # Transformation is defined so, as to superpose direction faces.
11758 # @param Block Hexahedral solid to be multi-transformed.
11759 # @param DirFace1 ID of First direction face.
11760 # @param DirFace2 ID of Second direction face.
11761 # @param NbTimes Quantity of transformations to be done.
11762 # @param theName Object name; when specified, this parameter is used
11763 # for result publication in the study. Otherwise, if automatic
11764 # publication is switched on, default value is used for result name.
11766 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11768 # @return New GEOM.GEOM_Object, containing the result shape.
11770 # @ref tui_multi_transformation "Example"
11771 @ManageTransactions("BlocksOp")
11772 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11774 Multi-transformate block and glue the result.
11775 Transformation is defined so, as to superpose direction faces.
11778 Block Hexahedral solid to be multi-transformed.
11779 DirFace1 ID of First direction face.
11780 DirFace2 ID of Second direction face.
11781 NbTimes Quantity of transformations to be done.
11782 theName Object name; when specified, this parameter is used
11783 for result publication in the study. Otherwise, if automatic
11784 publication is switched on, default value is used for result name.
11787 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11790 New GEOM.GEOM_Object, containing the result shape.
11792 # Example: see GEOM_Spanner.py
11793 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11794 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11795 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11796 anObj.SetParameters(Parameters)
11797 self._autoPublish(anObj, theName, "transformed")
11800 ## Multi-transformate block and glue the result.
11801 # @param Block Hexahedral solid to be multi-transformed.
11802 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11803 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11804 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11805 # @param theName Object name; when specified, this parameter is used
11806 # for result publication in the study. Otherwise, if automatic
11807 # publication is switched on, default value is used for result name.
11809 # @return New GEOM.GEOM_Object, containing the result shape.
11811 # @ref tui_multi_transformation "Example"
11812 @ManageTransactions("BlocksOp")
11813 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11814 DirFace1V, DirFace2V, NbTimesV, theName=None):
11816 Multi-transformate block and glue the result.
11819 Block Hexahedral solid to be multi-transformed.
11820 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11821 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11822 NbTimesU,NbTimesV Quantity of transformations to be done.
11823 theName Object name; when specified, this parameter is used
11824 for result publication in the study. Otherwise, if automatic
11825 publication is switched on, default value is used for result name.
11828 New GEOM.GEOM_Object, containing the result shape.
11830 # Example: see GEOM_Spanner.py
11831 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11832 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11833 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11834 DirFace1V, DirFace2V, NbTimesV)
11835 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11836 anObj.SetParameters(Parameters)
11837 self._autoPublish(anObj, theName, "transformed")
11840 ## Build all possible propagation groups.
11841 # Propagation group is a set of all edges, opposite to one (main)
11842 # edge of this group directly or through other opposite edges.
11843 # Notion of Opposite Edge make sence only on quadrangle face.
11844 # @param theShape Shape to build propagation groups on.
11845 # @param theName Object name; when specified, this parameter is used
11846 # for result publication in the study. Otherwise, if automatic
11847 # publication is switched on, default value is used for result name.
11849 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11851 # @ref swig_Propagate "Example"
11852 @ManageTransactions("BlocksOp")
11853 def Propagate(self, theShape, theName=None):
11855 Build all possible propagation groups.
11856 Propagation group is a set of all edges, opposite to one (main)
11857 edge of this group directly or through other opposite edges.
11858 Notion of Opposite Edge make sence only on quadrangle face.
11861 theShape Shape to build propagation groups on.
11862 theName Object name; when specified, this parameter is used
11863 for result publication in the study. Otherwise, if automatic
11864 publication is switched on, default value is used for result name.
11867 List of GEOM.GEOM_Object, each of them is a propagation group.
11869 # Example: see GEOM_TestOthers.py
11870 listChains = self.BlocksOp.Propagate(theShape)
11871 RaiseIfFailed("Propagate", self.BlocksOp)
11872 self._autoPublish(listChains, theName, "propagate")
11875 # end of l3_blocks_op
11878 ## @addtogroup l3_groups
11881 ## Creates a new group which will store sub-shapes of theMainShape
11882 # @param theMainShape is a GEOM object on which the group is selected
11883 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11884 # @param theName Object name; when specified, this parameter is used
11885 # for result publication in the study. Otherwise, if automatic
11886 # publication is switched on, default value is used for result name.
11888 # @return a newly created GEOM group (GEOM.GEOM_Object)
11890 # @ref tui_working_with_groups_page "Example 1"
11891 # \n @ref swig_CreateGroup "Example 2"
11892 @ManageTransactions("GroupOp")
11893 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11895 Creates a new group which will store sub-shapes of theMainShape
11898 theMainShape is a GEOM object on which the group is selected
11899 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11900 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11901 theName Object name; when specified, this parameter is used
11902 for result publication in the study. Otherwise, if automatic
11903 publication is switched on, default value is used for result name.
11906 a newly created GEOM group
11909 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11912 # Example: see GEOM_TestOthers.py
11913 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11914 RaiseIfFailed("CreateGroup", self.GroupOp)
11915 self._autoPublish(anObj, theName, "group")
11918 ## Adds a sub-object with ID theSubShapeId to the group
11919 # @param theGroup is a GEOM group to which the new sub-shape is added
11920 # @param theSubShapeID is a sub-shape ID in the main object.
11921 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11923 # @ref tui_working_with_groups_page "Example"
11924 @ManageTransactions("GroupOp")
11925 def AddObject(self,theGroup, theSubShapeID):
11927 Adds a sub-object with ID theSubShapeId to the group
11930 theGroup is a GEOM group to which the new sub-shape is added
11931 theSubShapeID is a sub-shape ID in the main object.
11934 Use method GetSubShapeID() to get an unique ID of the sub-shape
11936 # Example: see GEOM_TestOthers.py
11937 self.GroupOp.AddObject(theGroup, theSubShapeID)
11938 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11939 RaiseIfFailed("AddObject", self.GroupOp)
11943 ## Removes a sub-object with ID \a theSubShapeId from the group
11944 # @param theGroup is a GEOM group from which the new sub-shape is removed
11945 # @param theSubShapeID is a sub-shape ID in the main object.
11946 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11948 # @ref tui_working_with_groups_page "Example"
11949 @ManageTransactions("GroupOp")
11950 def RemoveObject(self,theGroup, theSubShapeID):
11952 Removes a sub-object with ID theSubShapeId from the group
11955 theGroup is a GEOM group from which the new sub-shape is removed
11956 theSubShapeID is a sub-shape ID in the main object.
11959 Use method GetSubShapeID() to get an unique ID of the sub-shape
11961 # Example: see GEOM_TestOthers.py
11962 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11963 RaiseIfFailed("RemoveObject", self.GroupOp)
11966 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11967 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11968 # @param theSubShapes is a list of sub-shapes to be added.
11970 # @ref tui_working_with_groups_page "Example"
11971 @ManageTransactions("GroupOp")
11972 def UnionList (self,theGroup, theSubShapes):
11974 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11977 theGroup is a GEOM group to which the new sub-shapes are added.
11978 theSubShapes is a list of sub-shapes to be added.
11980 # Example: see GEOM_TestOthers.py
11981 self.GroupOp.UnionList(theGroup, theSubShapes)
11982 RaiseIfFailed("UnionList", self.GroupOp)
11985 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11986 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11987 # @param theSubShapes is a list of indices of sub-shapes to be added.
11989 # @ref swig_UnionIDs "Example"
11990 @ManageTransactions("GroupOp")
11991 def UnionIDs(self,theGroup, theSubShapes):
11993 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11996 theGroup is a GEOM group to which the new sub-shapes are added.
11997 theSubShapes is a list of indices of sub-shapes to be added.
11999 # Example: see GEOM_TestOthers.py
12000 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12001 RaiseIfFailed("UnionIDs", self.GroupOp)
12004 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12005 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12006 # @param theSubShapes is a list of sub-shapes to be removed.
12008 # @ref tui_working_with_groups_page "Example"
12009 @ManageTransactions("GroupOp")
12010 def DifferenceList (self,theGroup, theSubShapes):
12012 Removes from the group all the given shapes. No errors, if some shapes are not included.
12015 theGroup is a GEOM group from which the sub-shapes are removed.
12016 theSubShapes is a list of sub-shapes to be removed.
12018 # Example: see GEOM_TestOthers.py
12019 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12020 RaiseIfFailed("DifferenceList", self.GroupOp)
12023 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12024 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12025 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12027 # @ref swig_DifferenceIDs "Example"
12028 @ManageTransactions("GroupOp")
12029 def DifferenceIDs(self,theGroup, theSubShapes):
12031 Removes from the group all the given shapes. No errors, if some shapes are not included.
12034 theGroup is a GEOM group from which the sub-shapes are removed.
12035 theSubShapes is a list of indices of sub-shapes to be removed.
12037 # Example: see GEOM_TestOthers.py
12038 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12039 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12042 ## Union of two groups.
12043 # New group is created. It will contain all entities
12044 # which are present in groups theGroup1 and theGroup2.
12045 # @param theGroup1, theGroup2 are the initial GEOM groups
12046 # to create the united group from.
12047 # @param theName Object name; when specified, this parameter is used
12048 # for result publication in the study. Otherwise, if automatic
12049 # publication is switched on, default value is used for result name.
12051 # @return a newly created GEOM group.
12053 # @ref tui_union_groups_anchor "Example"
12054 @ManageTransactions("GroupOp")
12055 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12057 Union of two groups.
12058 New group is created. It will contain all entities
12059 which are present in groups theGroup1 and theGroup2.
12062 theGroup1, theGroup2 are the initial GEOM groups
12063 to create the united group from.
12064 theName Object name; when specified, this parameter is used
12065 for result publication in the study. Otherwise, if automatic
12066 publication is switched on, default value is used for result name.
12069 a newly created GEOM group.
12071 # Example: see GEOM_TestOthers.py
12072 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12073 RaiseIfFailed("UnionGroups", self.GroupOp)
12074 self._autoPublish(aGroup, theName, "group")
12077 ## Intersection of two groups.
12078 # New group is created. It will contain only those entities
12079 # which are present in both groups theGroup1 and theGroup2.
12080 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12081 # @param theName Object name; when specified, this parameter is used
12082 # for result publication in the study. Otherwise, if automatic
12083 # publication is switched on, default value is used for result name.
12085 # @return a newly created GEOM group.
12087 # @ref tui_intersect_groups_anchor "Example"
12088 @ManageTransactions("GroupOp")
12089 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12091 Intersection of two groups.
12092 New group is created. It will contain only those entities
12093 which are present in both groups theGroup1 and theGroup2.
12096 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12097 theName Object name; when specified, this parameter is used
12098 for result publication in the study. Otherwise, if automatic
12099 publication is switched on, default value is used for result name.
12102 a newly created GEOM group.
12104 # Example: see GEOM_TestOthers.py
12105 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12106 RaiseIfFailed("IntersectGroups", self.GroupOp)
12107 self._autoPublish(aGroup, theName, "group")
12110 ## Cut of two groups.
12111 # New group is created. It will contain entities which are
12112 # present in group theGroup1 but are not present in group theGroup2.
12113 # @param theGroup1 is a GEOM group to include elements of.
12114 # @param theGroup2 is a GEOM group to exclude elements of.
12115 # @param theName Object name; when specified, this parameter is used
12116 # for result publication in the study. Otherwise, if automatic
12117 # publication is switched on, default value is used for result name.
12119 # @return a newly created GEOM group.
12121 # @ref tui_cut_groups_anchor "Example"
12122 @ManageTransactions("GroupOp")
12123 def CutGroups (self, theGroup1, theGroup2, theName=None):
12126 New group is created. It will contain entities which are
12127 present in group theGroup1 but are not present in group theGroup2.
12130 theGroup1 is a GEOM group to include elements of.
12131 theGroup2 is a GEOM group to exclude elements of.
12132 theName Object name; when specified, this parameter is used
12133 for result publication in the study. Otherwise, if automatic
12134 publication is switched on, default value is used for result name.
12137 a newly created GEOM group.
12139 # Example: see GEOM_TestOthers.py
12140 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12141 RaiseIfFailed("CutGroups", self.GroupOp)
12142 self._autoPublish(aGroup, theName, "group")
12145 ## Union of list of groups.
12146 # New group is created. It will contain all entities that are
12147 # present in groups listed in theGList.
12148 # @param theGList is a list of GEOM groups to create the united group from.
12149 # @param theName Object name; when specified, this parameter is used
12150 # for result publication in the study. Otherwise, if automatic
12151 # publication is switched on, default value is used for result name.
12153 # @return a newly created GEOM group.
12155 # @ref tui_union_groups_anchor "Example"
12156 @ManageTransactions("GroupOp")
12157 def UnionListOfGroups (self, theGList, theName=None):
12159 Union of list of groups.
12160 New group is created. It will contain all entities that are
12161 present in groups listed in theGList.
12164 theGList is a list of GEOM groups to create the united group from.
12165 theName Object name; when specified, this parameter is used
12166 for result publication in the study. Otherwise, if automatic
12167 publication is switched on, default value is used for result name.
12170 a newly created GEOM group.
12172 # Example: see GEOM_TestOthers.py
12173 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12174 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12175 self._autoPublish(aGroup, theName, "group")
12178 ## Cut of lists of groups.
12179 # New group is created. It will contain only entities
12180 # which are present in groups listed in theGList.
12181 # @param theGList is a list of GEOM groups to include elements of.
12182 # @param theName Object name; when specified, this parameter is used
12183 # for result publication in the study. Otherwise, if automatic
12184 # publication is switched on, default value is used for result name.
12186 # @return a newly created GEOM group.
12188 # @ref tui_intersect_groups_anchor "Example"
12189 @ManageTransactions("GroupOp")
12190 def IntersectListOfGroups (self, theGList, theName=None):
12192 Cut of lists of groups.
12193 New group is created. It will contain only entities
12194 which are present in groups listed in theGList.
12197 theGList is a list of GEOM groups to include elements of.
12198 theName Object name; when specified, this parameter is used
12199 for result publication in the study. Otherwise, if automatic
12200 publication is switched on, default value is used for result name.
12203 a newly created GEOM group.
12205 # Example: see GEOM_TestOthers.py
12206 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12207 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12208 self._autoPublish(aGroup, theName, "group")
12211 ## Cut of lists of groups.
12212 # New group is created. It will contain only entities
12213 # which are present in groups listed in theGList1 but
12214 # are not present in groups from theGList2.
12215 # @param theGList1 is a list of GEOM groups to include elements of.
12216 # @param theGList2 is a list of GEOM groups to exclude elements of.
12217 # @param theName Object name; when specified, this parameter is used
12218 # for result publication in the study. Otherwise, if automatic
12219 # publication is switched on, default value is used for result name.
12221 # @return a newly created GEOM group.
12223 # @ref tui_cut_groups_anchor "Example"
12224 @ManageTransactions("GroupOp")
12225 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12227 Cut of lists of groups.
12228 New group is created. It will contain only entities
12229 which are present in groups listed in theGList1 but
12230 are not present in groups from theGList2.
12233 theGList1 is a list of GEOM groups to include elements of.
12234 theGList2 is a list of GEOM groups to exclude elements of.
12235 theName Object name; when specified, this parameter is used
12236 for result publication in the study. Otherwise, if automatic
12237 publication is switched on, default value is used for result name.
12240 a newly created GEOM group.
12242 # Example: see GEOM_TestOthers.py
12243 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12244 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12245 self._autoPublish(aGroup, theName, "group")
12248 ## Returns a list of sub-objects ID stored in the group
12249 # @param theGroup is a GEOM group for which a list of IDs is requested
12251 # @ref swig_GetObjectIDs "Example"
12252 @ManageTransactions("GroupOp")
12253 def GetObjectIDs(self,theGroup):
12255 Returns a list of sub-objects ID stored in the group
12258 theGroup is a GEOM group for which a list of IDs is requested
12260 # Example: see GEOM_TestOthers.py
12261 ListIDs = self.GroupOp.GetObjects(theGroup)
12262 RaiseIfFailed("GetObjects", self.GroupOp)
12265 ## Returns a type of sub-objects stored in the group
12266 # @param theGroup is a GEOM group which type is returned.
12268 # @ref swig_GetType "Example"
12269 @ManageTransactions("GroupOp")
12270 def GetType(self,theGroup):
12272 Returns a type of sub-objects stored in the group
12275 theGroup is a GEOM group which type is returned.
12277 # Example: see GEOM_TestOthers.py
12278 aType = self.GroupOp.GetType(theGroup)
12279 RaiseIfFailed("GetType", self.GroupOp)
12282 ## Convert a type of geom object from id to string value
12283 # @param theId is a GEOM obect type id.
12284 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12285 # @ref swig_GetType "Example"
12286 def ShapeIdToType(self, theId):
12288 Convert a type of geom object from id to string value
12291 theId is a GEOM obect type id.
12294 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12321 return "REVOLUTION"
12369 return "FREE_BOUNDS"
12377 return "THRUSECTIONS"
12379 return "COMPOUNDFILTER"
12381 return "SHAPES_ON_SHAPE"
12383 return "ELLIPSE_ARC"
12385 return "3DSKETCHER"
12391 return "PIPETSHAPE"
12392 return "Shape Id not exist."
12394 ## Returns a main shape associated with the group
12395 # @param theGroup is a GEOM group for which a main shape object is requested
12396 # @return a GEOM object which is a main shape for theGroup
12398 # @ref swig_GetMainShape "Example"
12399 @ManageTransactions("GroupOp")
12400 def GetMainShape(self,theGroup):
12402 Returns a main shape associated with the group
12405 theGroup is a GEOM group for which a main shape object is requested
12408 a GEOM object which is a main shape for theGroup
12410 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12412 # Example: see GEOM_TestOthers.py
12413 anObj = self.GroupOp.GetMainShape(theGroup)
12414 RaiseIfFailed("GetMainShape", self.GroupOp)
12417 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12418 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12419 # @param theShape given shape (see GEOM.GEOM_Object)
12420 # @param min_length minimum length of edges of theShape
12421 # @param max_length maximum length of edges of theShape
12422 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12423 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12424 # @param theName Object name; when specified, this parameter is used
12425 # for result publication in the study. Otherwise, if automatic
12426 # publication is switched on, default value is used for result name.
12428 # @return a newly created GEOM group of edges
12430 # @@ref swig_todo "Example"
12431 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12433 Create group of edges of theShape, whose length is in range [min_length, max_length].
12434 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12437 theShape given shape
12438 min_length minimum length of edges of theShape
12439 max_length maximum length of edges of theShape
12440 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12441 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12442 theName Object name; when specified, this parameter is used
12443 for result publication in the study. Otherwise, if automatic
12444 publication is switched on, default value is used for result name.
12447 a newly created GEOM group of edges.
12449 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12450 edges_in_range = []
12452 Props = self.BasicProperties(edge)
12453 if min_length <= Props[0] and Props[0] <= max_length:
12454 if (not include_min) and (min_length == Props[0]):
12457 if (not include_max) and (Props[0] == max_length):
12460 edges_in_range.append(edge)
12462 if len(edges_in_range) <= 0:
12463 print "No edges found by given criteria"
12466 # note: auto-publishing is done in self.CreateGroup()
12467 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12468 self.UnionList(group_edges, edges_in_range)
12472 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12473 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12474 # @param min_length minimum length of edges of selected shape
12475 # @param max_length maximum length of edges of selected shape
12476 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12477 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12478 # @return a newly created GEOM group of edges
12479 # @ref swig_todo "Example"
12480 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12482 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12483 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12486 min_length minimum length of edges of selected shape
12487 max_length maximum length of edges of selected shape
12488 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12489 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12492 a newly created GEOM group of edges.
12494 nb_selected = sg.SelectedCount()
12495 if nb_selected < 1:
12496 print "Select a shape before calling this function, please."
12498 if nb_selected > 1:
12499 print "Only one shape must be selected"
12502 id_shape = sg.getSelected(0)
12503 shape = IDToObject( id_shape )
12505 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12509 if include_min: left_str = " <= "
12510 if include_max: right_str = " <= "
12512 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12513 + left_str + "length" + right_str + `max_length`)
12515 sg.updateObjBrowser(1)
12522 #@@ insert new functions before this line @@ do not remove this line @@#
12524 ## Create a copy of the given object
12526 # @param theOriginal geometry object for copy
12527 # @param theName Object name; when specified, this parameter is used
12528 # for result publication in the study. Otherwise, if automatic
12529 # publication is switched on, default value is used for result name.
12531 # @return New GEOM_Object, containing the copied shape.
12533 # @ingroup l1_geomBuilder_auxiliary
12534 # @ref swig_MakeCopy "Example"
12535 @ManageTransactions("InsertOp")
12536 def MakeCopy(self, theOriginal, theName=None):
12538 Create a copy of the given object
12541 theOriginal geometry object for copy
12542 theName Object name; when specified, this parameter is used
12543 for result publication in the study. Otherwise, if automatic
12544 publication is switched on, default value is used for result name.
12547 New GEOM_Object, containing the copied shape.
12549 Example of usage: Copy = geompy.MakeCopy(Box)
12551 # Example: see GEOM_TestAll.py
12552 anObj = self.InsertOp.MakeCopy(theOriginal)
12553 RaiseIfFailed("MakeCopy", self.InsertOp)
12554 self._autoPublish(anObj, theName, "copy")
12557 ## Add Path to load python scripts from
12558 # @param Path a path to load python scripts from
12559 # @ingroup l1_geomBuilder_auxiliary
12560 def addPath(self,Path):
12562 Add Path to load python scripts from
12565 Path a path to load python scripts from
12567 if (sys.path.count(Path) < 1):
12568 sys.path.append(Path)
12572 ## Load marker texture from the file
12573 # @param Path a path to the texture file
12574 # @return unique texture identifier
12575 # @ingroup l1_geomBuilder_auxiliary
12576 @ManageTransactions("InsertOp")
12577 def LoadTexture(self, Path):
12579 Load marker texture from the file
12582 Path a path to the texture file
12585 unique texture identifier
12587 # Example: see GEOM_TestAll.py
12588 ID = self.InsertOp.LoadTexture(Path)
12589 RaiseIfFailed("LoadTexture", self.InsertOp)
12592 ## Get internal name of the object based on its study entry
12593 # @note This method does not provide an unique identifier of the geometry object.
12594 # @note This is internal function of GEOM component, though it can be used outside it for
12595 # appropriate reason (e.g. for identification of geometry object).
12596 # @param obj geometry object
12597 # @return unique object identifier
12598 # @ingroup l1_geomBuilder_auxiliary
12599 def getObjectID(self, obj):
12601 Get internal name of the object based on its study entry.
12602 Note: this method does not provide an unique identifier of the geometry object.
12603 It is an internal function of GEOM component, though it can be used outside GEOM for
12604 appropriate reason (e.g. for identification of geometry object).
12607 obj geometry object
12610 unique object identifier
12613 entry = salome.ObjectToID(obj)
12614 if entry is not None:
12615 lst = entry.split(":")
12617 ID = lst[-1] # -1 means last item in the list
12618 return "GEOM_" + ID
12623 ## Add marker texture. @a Width and @a Height parameters
12624 # specify width and height of the texture in pixels.
12625 # If @a RowData is @c True, @a Texture parameter should represent texture data
12626 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12627 # parameter should be unpacked string, in which '1' symbols represent opaque
12628 # pixels and '0' represent transparent pixels of the texture bitmap.
12630 # @param Width texture width in pixels
12631 # @param Height texture height in pixels
12632 # @param Texture texture data
12633 # @param RowData if @c True, @a Texture data are packed in the byte stream
12634 # @return unique texture identifier
12635 # @ingroup l1_geomBuilder_auxiliary
12636 @ManageTransactions("InsertOp")
12637 def AddTexture(self, Width, Height, Texture, RowData=False):
12639 Add marker texture. Width and Height parameters
12640 specify width and height of the texture in pixels.
12641 If RowData is True, Texture parameter should represent texture data
12642 packed into the byte array. If RowData is False (default), Texture
12643 parameter should be unpacked string, in which '1' symbols represent opaque
12644 pixels and '0' represent transparent pixels of the texture bitmap.
12647 Width texture width in pixels
12648 Height texture height in pixels
12649 Texture texture data
12650 RowData if True, Texture data are packed in the byte stream
12653 return unique texture identifier
12655 if not RowData: Texture = PackData(Texture)
12656 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12657 RaiseIfFailed("AddTexture", self.InsertOp)
12660 ## Creates a new folder object. It is a container for any GEOM objects.
12661 # @param Name name of the container
12662 # @param Father parent object. If None,
12663 # folder under 'Geometry' root object will be created.
12664 # @return a new created folder
12665 # @ingroup l1_publish_data
12666 def NewFolder(self, Name, Father=None):
12668 Create a new folder object. It is an auxiliary container for any GEOM objects.
12671 Name name of the container
12672 Father parent object. If None,
12673 folder under 'Geometry' root object will be created.
12676 a new created folder
12678 if not Father: Father = self.father
12679 return self.CreateFolder(Name, Father)
12681 ## Move object to the specified folder
12682 # @param Object object to move
12683 # @param Folder target folder
12684 # @ingroup l1_publish_data
12685 def PutToFolder(self, Object, Folder):
12687 Move object to the specified folder
12690 Object object to move
12691 Folder target folder
12693 self.MoveToFolder(Object, Folder)
12696 ## Move list of objects to the specified folder
12697 # @param ListOfSO list of objects to move
12698 # @param Folder target folder
12699 # @ingroup l1_publish_data
12700 def PutListToFolder(self, ListOfSO, Folder):
12702 Move list of objects to the specified folder
12705 ListOfSO list of objects to move
12706 Folder target folder
12708 self.MoveListToFolder(ListOfSO, Folder)
12711 ## @addtogroup l2_field
12715 # @param shape the shape the field lies on
12716 # @param name the field name
12717 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12718 # @param dimension dimension of the shape the field lies on
12719 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12720 # @param componentNames names of components
12721 # @return a created field
12722 @ManageTransactions("FieldOp")
12723 def CreateField(self, shape, name, type, dimension, componentNames):
12728 shape the shape the field lies on
12729 name the field name
12730 type type of field data
12731 dimension dimension of the shape the field lies on
12732 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12733 componentNames names of components
12738 if isinstance( type, int ):
12739 if type < 0 or type > 3:
12740 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12741 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12743 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12744 RaiseIfFailed("CreateField", self.FieldOp)
12746 geom._autoPublish( f, "", name)
12749 ## Removes a field from the GEOM component
12750 # @param field the field to remove
12751 def RemoveField(self, field):
12752 "Removes a field from the GEOM component"
12754 if isinstance( field, GEOM._objref_GEOM_Field ):
12755 geom.RemoveObject( field )
12756 elif isinstance( field, geomField ):
12757 geom.RemoveObject( field.field )
12759 raise RuntimeError, "RemoveField() : the object is not a field"
12762 ## Returns number of fields on a shape
12763 @ManageTransactions("FieldOp")
12764 def CountFields(self, shape):
12765 "Returns number of fields on a shape"
12766 nb = self.FieldOp.CountFields( shape )
12767 RaiseIfFailed("CountFields", self.FieldOp)
12770 ## Returns all fields on a shape
12771 @ManageTransactions("FieldOp")
12772 def GetFields(self, shape):
12773 "Returns all fields on a shape"
12774 ff = self.FieldOp.GetFields( shape )
12775 RaiseIfFailed("GetFields", self.FieldOp)
12778 ## Returns a field on a shape by its name
12779 @ManageTransactions("FieldOp")
12780 def GetField(self, shape, name):
12781 "Returns a field on a shape by its name"
12782 f = self.FieldOp.GetField( shape, name )
12783 RaiseIfFailed("GetField", self.FieldOp)
12791 # Register the new proxy for GEOM_Gen
12792 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12795 ## Field on Geometry
12796 # @ingroup l2_field
12797 class geomField( GEOM._objref_GEOM_Field ):
12799 def __init__(self):
12800 GEOM._objref_GEOM_Field.__init__(self)
12801 self.field = GEOM._objref_GEOM_Field
12804 ## Returns the shape the field lies on
12805 def getShape(self):
12806 "Returns the shape the field lies on"
12807 return self.field.GetShape(self)
12809 ## Returns the field name
12811 "Returns the field name"
12812 return self.field.GetName(self)
12814 ## Returns type of field data as integer [0-3]
12816 "Returns type of field data"
12817 return self.field.GetDataType(self)._v
12819 ## Returns type of field data:
12820 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12821 def getTypeEnum(self):
12822 "Returns type of field data"
12823 return self.field.GetDataType(self)
12825 ## Returns dimension of the shape the field lies on:
12826 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12827 def getDimension(self):
12828 """Returns dimension of the shape the field lies on:
12829 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12830 return self.field.GetDimension(self)
12832 ## Returns names of components
12833 def getComponents(self):
12834 "Returns names of components"
12835 return self.field.GetComponents(self)
12837 ## Adds a time step to the field
12838 # @param step the time step number further used as the step identifier
12839 # @param stamp the time step time
12840 # @param values the values of the time step
12841 def addStep(self, step, stamp, values):
12842 "Adds a time step to the field"
12843 stp = self.field.AddStep( self, step, stamp )
12845 raise RuntimeError, \
12846 "Field.addStep() : Error: step %s already exists in this field"%step
12848 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12849 self.setValues( step, values )
12852 ## Remove a time step from the field
12853 def removeStep(self,step):
12854 "Remove a time step from the field"
12857 stepObj = self.field.GetStep( self, step )
12859 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
12862 #traceback.print_exc()
12864 self.field.RemoveStep( self, step )
12866 geom.myBuilder.RemoveObjectWithChildren( stepSO )
12869 ## Returns number of time steps in the field
12870 def countSteps(self):
12871 "Returns number of time steps in the field"
12872 return self.field.CountSteps(self)
12874 ## Returns a list of time step IDs in the field
12875 def getSteps(self):
12876 "Returns a list of time step IDs in the field"
12877 return self.field.GetSteps(self)
12879 ## Returns a time step by its ID
12880 def getStep(self,step):
12881 "Returns a time step by its ID"
12882 stp = self.field.GetStep(self, step)
12884 raise RuntimeError, "Step %s is missing from this field"%step
12887 ## Returns the time of the field step
12888 def getStamp(self,step):
12889 "Returns the time of the field step"
12890 return self.getStep(step).GetStamp()
12892 ## Changes the time of the field step
12893 def setStamp(self, step, stamp):
12894 "Changes the time of the field step"
12895 return self.getStep(step).SetStamp(stamp)
12897 ## Returns values of the field step
12898 def getValues(self, step):
12899 "Returns values of the field step"
12900 return self.getStep(step).GetValues()
12902 ## Changes values of the field step
12903 def setValues(self, step, values):
12904 "Changes values of the field step"
12905 stp = self.getStep(step)
12906 errBeg = "Field.setValues(values) : Error: "
12908 ok = stp.SetValues( values )
12909 except Exception, e:
12911 if excStr.find("WrongPythonType") > 0:
12912 raise RuntimeError, errBeg +\
12913 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
12914 raise RuntimeError, errBeg + str(e)
12916 nbOK = self.field.GetArraySize(self)
12919 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
12921 raise RuntimeError, errBeg + "failed"
12924 pass # end of class geomField
12926 # Register the new proxy for GEOM_Field
12927 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
12930 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12931 # interface to GEOM operations.
12936 # salome.salome_init()
12937 # from salome.geom import geomBuilder
12938 # geompy = geomBuilder.New(salome.myStudy)
12940 # @param study SALOME study, generally obtained by salome.myStudy.
12941 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12942 # @return geomBuilder instance
12943 def New( study, instance=None):
12945 Create a new geomBuilder instance.The geomBuilder class provides the Python
12946 interface to GEOM operations.
12950 salome.salome_init()
12951 from salome.geom import geomBuilder
12952 geompy = geomBuilder.New(salome.myStudy)
12955 study SALOME study, generally obtained by salome.myStudy.
12956 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12958 geomBuilder instance
12960 #print "New geomBuilder ", study, instance
12967 geom = geomBuilder()
12968 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12969 geom.init_geom(study)
12973 # Register methods from the plug-ins in the geomBuilder class
12974 plugins_var = os.environ.get( "GEOM_PluginsList" )
12977 if plugins_var is not None:
12978 plugins = plugins_var.split( ":" )
12979 plugins=filter(lambda x: len(x)>0, plugins)
12980 if plugins is not None:
12981 for pluginName in plugins:
12982 pluginBuilderName = pluginName + "Builder"
12984 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
12985 except Exception, e:
12986 from salome_utils import verbose
12987 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
12989 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
12990 plugin = eval( pluginBuilderName )
12992 # add methods from plugin module to the geomBuilder class
12993 for k in dir( plugin ):
12994 if k[0] == '_': continue
12995 method = getattr( plugin, k )
12996 if type( method ).__name__ == 'function':
12997 if not hasattr( geomBuilder, k ):
12998 setattr( geomBuilder, k, method )