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 ## Pack an argument into a list
522 if isinstance( arg, list ):
524 if hasattr( arg, "__getitem__" ):
528 ## Information about closed/unclosed state of shell or wire
529 # @ingroup l1_geomBuilder_auxiliary
532 Information about closed/unclosed state of shell or wire
538 ## Private class used to bind calls of plugin operations to geomBuilder
539 class PluginOperation:
540 def __init__(self, operation, function):
541 self.operation = operation
542 self.function = function
545 @ManageTransactions("operation")
546 def __call__(self, *args):
547 res = self.function(self.operation, *args)
548 RaiseIfFailed(self.function.__name__, self.operation)
551 # Warning: geom is a singleton
557 class geomBuilder(object, GEOM._objref_GEOM_Gen):
559 ## Enumeration ShapeType as a dictionary. \n
560 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
561 # @ingroup l1_geomBuilder_auxiliary
562 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
564 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
565 # and a list of parameters, describing the shape.
566 # List of parameters, describing the shape:
567 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
568 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
570 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
572 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
574 # - SPHERE: [xc yc zc R]
575 # - CYLINDER: [xb yb zb dx dy dz R H]
576 # - BOX: [xc yc zc ax ay az]
577 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
578 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
579 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
580 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
581 # - SOLID: [nb_faces nb_edges nb_vertices]
583 # - SPHERE2D: [xc yc zc R]
584 # - CYLINDER2D: [xb yb zb dx dy dz R H]
585 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
586 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
587 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
588 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
589 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
590 # - PLANE: [xo yo zo dx dy dz]
591 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
592 # - FACE: [nb_edges nb_vertices]
594 # - CIRCLE: [xc yc zc dx dy dz R]
595 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
596 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
597 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
598 # - LINE: [xo yo zo dx dy dz]
599 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
600 # - EDGE: [nb_vertices]
603 # @ingroup l1_geomBuilder_auxiliary
604 kind = GEOM.GEOM_IKindOfShape
611 #print "==== __new__ ", engine, geom, doLcc, created
613 # geom engine is either retrieved from engine, or created
615 # Following test avoids a recursive loop
618 # geom engine not created: existing engine found
620 if doLcc and not created:
622 # FindOrLoadComponent called:
623 # 1. CORBA resolution of server
624 # 2. the __new__ method is called again
625 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
626 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
629 # FindOrLoadComponent not called
631 # geomBuilder instance is created from lcc.FindOrLoadComponent
632 #print "==== super ", engine, geom, doLcc, created
633 geom = super(geomBuilder,cls).__new__(cls)
636 # geom engine not created: existing engine found
637 #print "==== existing ", engine, geom, doLcc, created
639 #print "return geom 1 ", geom
642 #print "return geom 2 ", geom
647 #print "-------- geomBuilder __init__ --- ", created, self
650 GEOM._objref_GEOM_Gen.__init__(self)
651 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
652 self.myBuilder = None
671 ## Process object publication in the study, as follows:
672 # - if @a theName is specified (not None), the object is published in the study
673 # with this name, not taking into account "auto-publishing" option;
674 # - if @a theName is NOT specified, the object is published in the study
675 # (using default name, which can be customized using @a theDefaultName parameter)
676 # only if auto-publishing is switched on.
678 # @param theObj object, a subject for publishing
679 # @param theName object name for study
680 # @param theDefaultName default name for the auto-publishing
682 # @sa addToStudyAuto()
683 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
685 def _item_name(_names, _defname, _idx=-1):
686 if not _names: _names = _defname
687 if type(_names) in [types.ListType, types.TupleType]:
689 if _idx >= len(_names) or not _names[_idx]:
690 if type(_defname) not in [types.ListType, types.TupleType]:
691 _name = "%s_%d"%(_defname, _idx+1)
692 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
693 _name = _defname[_idx]
695 _name = "%noname_%d"%(dn, _idx+1)
701 # must be wrong usage
706 _name = "%s_%d"%(_names, _idx+1)
712 def _publish( _name, _obj ):
714 if isinstance( _obj, GEOM._objref_GEOM_Field ):
715 fatherObj = _obj.GetShape()
716 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
717 fatherObj = _obj.GetField()
718 elif not _obj.IsMainShape():
719 fatherObj = _obj.GetMainShape()
721 if fatherObj and fatherObj.GetStudyEntry():
722 self.addToStudyInFather(fatherObj, _obj, _name)
724 self.addToStudy(_obj, _name)
730 if not theName and not self.myMaxNbSubShapesAllowed:
731 return # nothing to do: auto-publishing is disabled
732 if not theName and not theDefaultName:
733 return # neither theName nor theDefaultName is given
735 if type(theObj) in [types.ListType, types.TupleType]:
736 # list of objects is being published
739 if not obj: continue # bad object
740 name = _item_name(theName, theDefaultName, idx)
741 _publish( name, obj )
743 if not theName and idx == self.myMaxNbSubShapesAllowed: break
747 # single object is published
748 name = _item_name(theName, theDefaultName)
749 _publish( name, theObj )
752 ## @addtogroup l1_geomBuilder_auxiliary
754 def init_geom(self,theStudy):
755 self.myStudy = theStudy
756 self.myStudyId = self.myStudy._get_StudyId()
757 self.myBuilder = self.myStudy.NewBuilder()
758 self.father = self.myStudy.FindComponent("GEOM")
759 notebook.myStudy = theStudy
760 if self.father is None:
761 self.father = self.myBuilder.NewComponent("GEOM")
762 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
763 FName = A1._narrow(SALOMEDS.AttributeName)
764 FName.SetValue("Geometry")
765 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
766 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
767 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
768 self.myBuilder.DefineComponentInstance(self.father,self)
770 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
771 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
772 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
773 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
774 self.HealOp = self.GetIHealingOperations (self.myStudyId)
775 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
776 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
777 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
778 self.LocalOp = self.GetILocalOperations (self.myStudyId)
779 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
780 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
781 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
782 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
784 # set GEOM as root in the use case tree
785 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
786 self.myUseCaseBuilder.SetRootCurrent()
787 self.myUseCaseBuilder.Append(self.father)
790 def GetPluginOperations(self, studyID, libraryName):
791 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
794 ## Enable / disable results auto-publishing
796 # The automatic publishing is managed in the following way:
797 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
798 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
799 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
800 # value passed as parameter has the same effect.
801 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
802 # maximum number of sub-shapes allowed for publishing is set to specified value.
804 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
805 # @ingroup l1_publish_data
806 def addToStudyAuto(self, maxNbSubShapes=-1):
808 Enable / disable results auto-publishing
810 The automatic publishing is managed in the following way:
811 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
812 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
813 maximum number of sub-shapes allowed for publishing is unlimited; any negative
814 value passed as parameter has the same effect.
815 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
816 maximum number of sub-shapes allowed for publishing is set to this value.
819 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
822 geompy.addToStudyAuto() # enable auto-publishing
823 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
824 geompy.addToStudyAuto(0) # disable auto-publishing
826 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
829 ## Dump component to the Python script
830 # This method overrides IDL function to allow default values for the parameters.
831 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
833 Dump component to the Python script
834 This method overrides IDL function to allow default values for the parameters.
836 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
838 ## Get name for sub-shape aSubObj of shape aMainObj
840 # @ref swig_SubShapeName "Example"
841 @ManageTransactions("ShapesOp")
842 def SubShapeName(self,aSubObj, aMainObj):
844 Get name for sub-shape aSubObj of shape aMainObj
846 # Example: see GEOM_TestAll.py
848 #aSubId = orb.object_to_string(aSubObj)
849 #aMainId = orb.object_to_string(aMainObj)
850 #index = gg.getIndexTopology(aSubId, aMainId)
851 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
852 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
853 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
856 ## Publish in study aShape with name aName
858 # \param aShape the shape to be published
859 # \param aName the name for the shape
860 # \param doRestoreSubShapes if True, finds and publishes also
861 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
862 # and published sub-shapes of arguments
863 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
864 # these arguments description
865 # \return study entry of the published shape in form of string
867 # @ingroup l1_publish_data
868 # @ref swig_all_addtostudy "Example"
869 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
870 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
872 Publish in study aShape with name aName
875 aShape the shape to be published
876 aName the name for the shape
877 doRestoreSubShapes if True, finds and publishes also
878 sub-shapes of aShape, corresponding to its arguments
879 and published sub-shapes of arguments
880 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
881 these arguments description
884 study entry of the published shape in form of string
887 id_block1 = geompy.addToStudy(Block1, "Block 1")
889 # Example: see GEOM_TestAll.py
891 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
892 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
893 if doRestoreSubShapes:
894 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
895 theFindMethod, theInheritFirstArg, True )
897 print "addToStudy() failed"
899 return aShape.GetStudyEntry()
901 ## Publish in study aShape with name aName as sub-object of previously published aFather
902 # \param aFather previously published object
903 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
904 # \param aName the name for the shape
906 # \return study entry of the published shape in form of string
908 # @ingroup l1_publish_data
909 # @ref swig_all_addtostudyInFather "Example"
910 def addToStudyInFather(self, aFather, aShape, aName):
912 Publish in study aShape with name aName as sub-object of previously published aFather
915 aFather previously published object
916 aShape the shape to be published as sub-object of aFather
917 aName the name for the shape
920 study entry of the published shape in form of string
922 # Example: see GEOM_TestAll.py
924 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
925 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
927 print "addToStudyInFather() failed"
929 return aShape.GetStudyEntry()
931 ## Unpublish object in study
933 # \param obj the object to be unpublished
934 def hideInStudy(self, obj):
936 Unpublish object in study
939 obj the object to be unpublished
941 ior = salome.orb.object_to_string(obj)
942 aSObject = self.myStudy.FindObjectIOR(ior)
943 if aSObject is not None:
944 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
945 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
946 drwAttribute.SetDrawable(False)
947 # hide references if any
948 vso = self.myStudy.FindDependances(aSObject);
950 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
951 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
952 drwAttribute.SetDrawable(False)
956 # end of l1_geomBuilder_auxiliary
959 ## @addtogroup l3_restore_ss
962 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
963 # To be used from python scripts out of addToStudy() (non-default usage)
964 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
965 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
966 # If this list is empty, all operation arguments will be published
967 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
968 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
969 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
970 # Do not publish sub-shapes in place of arguments, but only
971 # in place of sub-shapes of the first argument,
972 # because the whole shape corresponds to the first argument.
973 # Mainly to be used after transformations, but it also can be
974 # usefull after partition with one object shape, and some other
975 # operations, where only the first argument has to be considered.
976 # If theObject has only one argument shape, this flag is automatically
977 # considered as True, not regarding really passed value.
978 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
979 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
980 # \return list of published sub-shapes
982 # @ref tui_restore_prs_params "Example"
983 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
984 theInheritFirstArg=False, theAddPrefix=True):
986 Publish sub-shapes, standing for arguments and sub-shapes of arguments
987 To be used from python scripts out of geompy.addToStudy (non-default usage)
990 theObject published GEOM.GEOM_Object, arguments of which will be published
991 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
992 If this list is empty, all operation arguments will be published
993 theFindMethod method to search sub-shapes, corresponding to arguments and
994 their sub-shapes. Value from enumeration GEOM.find_shape_method.
995 theInheritFirstArg set properties of the first argument for theObject.
996 Do not publish sub-shapes in place of arguments, but only
997 in place of sub-shapes of the first argument,
998 because the whole shape corresponds to the first argument.
999 Mainly to be used after transformations, but it also can be
1000 usefull after partition with one object shape, and some other
1001 operations, where only the first argument has to be considered.
1002 If theObject has only one argument shape, this flag is automatically
1003 considered as True, not regarding really passed value.
1004 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1005 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1007 list of published sub-shapes
1009 # Example: see GEOM_TestAll.py
1010 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1011 theFindMethod, theInheritFirstArg, theAddPrefix)
1013 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1014 # To be used from python scripts out of addToStudy() (non-default usage)
1015 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1016 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1017 # If this list is empty, all operation arguments will be published
1018 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1019 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1020 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1021 # Do not publish sub-shapes in place of arguments, but only
1022 # in place of sub-shapes of the first argument,
1023 # because the whole shape corresponds to the first argument.
1024 # Mainly to be used after transformations, but it also can be
1025 # usefull after partition with one object shape, and some other
1026 # operations, where only the first argument has to be considered.
1027 # If theObject has only one argument shape, this flag is automatically
1028 # considered as True, not regarding really passed value.
1029 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1030 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1031 # \return list of published sub-shapes
1033 # @ref tui_restore_prs_params "Example"
1034 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1035 theInheritFirstArg=False, theAddPrefix=True):
1037 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1038 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1041 theObject published GEOM.GEOM_Object, arguments of which will be published
1042 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1043 If this list is empty, all operation arguments will be published
1044 theFindMethod method to search sub-shapes, corresponding to arguments and
1045 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1046 theInheritFirstArg set properties of the first argument for theObject.
1047 Do not publish sub-shapes in place of arguments, but only
1048 in place of sub-shapes of the first argument,
1049 because the whole shape corresponds to the first argument.
1050 Mainly to be used after transformations, but it also can be
1051 usefull after partition with one object shape, and some other
1052 operations, where only the first argument has to be considered.
1053 If theObject has only one argument shape, this flag is automatically
1054 considered as True, not regarding really passed value.
1055 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1056 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1059 list of published sub-shapes
1061 # Example: see GEOM_TestAll.py
1062 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1063 theFindMethod, theInheritFirstArg, theAddPrefix)
1065 # end of l3_restore_ss
1068 ## @addtogroup l3_basic_go
1071 ## Create point by three coordinates.
1072 # @param theX The X coordinate of the point.
1073 # @param theY The Y coordinate of the point.
1074 # @param theZ The Z coordinate of the point.
1075 # @param theName Object name; when specified, this parameter is used
1076 # for result publication in the study. Otherwise, if automatic
1077 # publication is switched on, default value is used for result name.
1079 # @return New GEOM.GEOM_Object, containing the created point.
1081 # @ref tui_creation_point "Example"
1082 @ManageTransactions("BasicOp")
1083 def MakeVertex(self, theX, theY, theZ, theName=None):
1085 Create point by three coordinates.
1088 theX The X coordinate of the point.
1089 theY The Y coordinate of the point.
1090 theZ The Z coordinate of the point.
1091 theName Object name; when specified, this parameter is used
1092 for result publication in the study. Otherwise, if automatic
1093 publication is switched on, default value is used for result name.
1096 New GEOM.GEOM_Object, containing the created point.
1098 # Example: see GEOM_TestAll.py
1099 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1100 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1101 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1102 anObj.SetParameters(Parameters)
1103 self._autoPublish(anObj, theName, "vertex")
1106 ## Create a point, distant from the referenced point
1107 # on the given distances along the coordinate axes.
1108 # @param theReference The referenced point.
1109 # @param theX Displacement from the referenced point along OX axis.
1110 # @param theY Displacement from the referenced point along OY axis.
1111 # @param theZ Displacement from the referenced point along OZ axis.
1112 # @param theName Object name; when specified, this parameter is used
1113 # for result publication in the study. Otherwise, if automatic
1114 # publication is switched on, default value is used for result name.
1116 # @return New GEOM.GEOM_Object, containing the created point.
1118 # @ref tui_creation_point "Example"
1119 @ManageTransactions("BasicOp")
1120 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1122 Create a point, distant from the referenced point
1123 on the given distances along the coordinate axes.
1126 theReference The referenced point.
1127 theX Displacement from the referenced point along OX axis.
1128 theY Displacement from the referenced point along OY axis.
1129 theZ Displacement from the referenced point along OZ axis.
1130 theName Object name; when specified, this parameter is used
1131 for result publication in the study. Otherwise, if automatic
1132 publication is switched on, default value is used for result name.
1135 New GEOM.GEOM_Object, containing the created point.
1137 # Example: see GEOM_TestAll.py
1138 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1139 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1140 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1141 anObj.SetParameters(Parameters)
1142 self._autoPublish(anObj, theName, "vertex")
1145 ## Create a point, corresponding to the given parameter on the given curve.
1146 # @param theRefCurve The referenced curve.
1147 # @param theParameter Value of parameter on the referenced curve.
1148 # @param theName Object name; when specified, this parameter is used
1149 # for result publication in the study. Otherwise, if automatic
1150 # publication is switched on, default value is used for result name.
1152 # @return New GEOM.GEOM_Object, containing the created point.
1154 # @ref tui_creation_point "Example"
1155 @ManageTransactions("BasicOp")
1156 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1158 Create a point, corresponding to the given parameter on the given curve.
1161 theRefCurve The referenced curve.
1162 theParameter Value of parameter on the referenced curve.
1163 theName Object name; when specified, this parameter is used
1164 for result publication in the study. Otherwise, if automatic
1165 publication is switched on, default value is used for result name.
1168 New GEOM.GEOM_Object, containing the created point.
1171 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1173 # Example: see GEOM_TestAll.py
1174 theParameter, Parameters = ParseParameters(theParameter)
1175 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1176 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1177 anObj.SetParameters(Parameters)
1178 self._autoPublish(anObj, theName, "vertex")
1181 ## Create a point by projection give coordinates on the given curve
1182 # @param theRefCurve The referenced curve.
1183 # @param theX X-coordinate in 3D space
1184 # @param theY Y-coordinate in 3D space
1185 # @param theZ Z-coordinate in 3D space
1186 # @param theName Object name; when specified, this parameter is used
1187 # for result publication in the study. Otherwise, if automatic
1188 # publication is switched on, default value is used for result name.
1190 # @return New GEOM.GEOM_Object, containing the created point.
1192 # @ref tui_creation_point "Example"
1193 @ManageTransactions("BasicOp")
1194 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1196 Create a point by projection give coordinates on the given curve
1199 theRefCurve The referenced curve.
1200 theX X-coordinate in 3D space
1201 theY Y-coordinate in 3D space
1202 theZ Z-coordinate in 3D space
1203 theName Object name; when specified, this parameter is used
1204 for result publication in the study. Otherwise, if automatic
1205 publication is switched on, default value is used for result name.
1208 New GEOM.GEOM_Object, containing the created point.
1211 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1213 # Example: see GEOM_TestAll.py
1214 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1215 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1216 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1217 anObj.SetParameters(Parameters)
1218 self._autoPublish(anObj, theName, "vertex")
1221 ## Create a point, corresponding to the given length on the given curve.
1222 # @param theRefCurve The referenced curve.
1223 # @param theLength Length on the referenced curve. It can be negative.
1224 # @param theStartPoint Point allowing to choose the direction for the calculation
1225 # of the length. If None, start from the first point of theRefCurve.
1226 # @param theName Object name; when specified, this parameter is used
1227 # for result publication in the study. Otherwise, if automatic
1228 # publication is switched on, default value is used for result name.
1230 # @return New GEOM.GEOM_Object, containing the created point.
1232 # @ref tui_creation_point "Example"
1233 @ManageTransactions("BasicOp")
1234 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1236 Create a point, corresponding to the given length on the given curve.
1239 theRefCurve The referenced curve.
1240 theLength Length on the referenced curve. It can be negative.
1241 theStartPoint Point allowing to choose the direction for the calculation
1242 of the length. If None, start from the first point of theRefCurve.
1243 theName Object name; when specified, this parameter is used
1244 for result publication in the study. Otherwise, if automatic
1245 publication is switched on, default value is used for result name.
1248 New GEOM.GEOM_Object, containing the created point.
1250 # Example: see GEOM_TestAll.py
1251 theLength, Parameters = ParseParameters(theLength)
1252 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1253 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1254 anObj.SetParameters(Parameters)
1255 self._autoPublish(anObj, theName, "vertex")
1258 ## Create a point, corresponding to the given parameters on the
1260 # @param theRefSurf The referenced surface.
1261 # @param theUParameter Value of U-parameter on the referenced surface.
1262 # @param theVParameter Value of V-parameter on the referenced surface.
1263 # @param theName Object name; when specified, this parameter is used
1264 # for result publication in the study. Otherwise, if automatic
1265 # publication is switched on, default value is used for result name.
1267 # @return New GEOM.GEOM_Object, containing the created point.
1269 # @ref swig_MakeVertexOnSurface "Example"
1270 @ManageTransactions("BasicOp")
1271 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1273 Create a point, corresponding to the given parameters on the
1277 theRefSurf The referenced surface.
1278 theUParameter Value of U-parameter on the referenced surface.
1279 theVParameter Value of V-parameter on the referenced surface.
1280 theName Object name; when specified, this parameter is used
1281 for result publication in the study. Otherwise, if automatic
1282 publication is switched on, default value is used for result name.
1285 New GEOM.GEOM_Object, containing the created point.
1288 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1290 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1291 # Example: see GEOM_TestAll.py
1292 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1293 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1294 anObj.SetParameters(Parameters);
1295 self._autoPublish(anObj, theName, "vertex")
1298 ## Create a point by projection give coordinates on the given surface
1299 # @param theRefSurf The referenced surface.
1300 # @param theX X-coordinate in 3D space
1301 # @param theY Y-coordinate in 3D space
1302 # @param theZ Z-coordinate in 3D space
1303 # @param theName Object name; when specified, this parameter is used
1304 # for result publication in the study. Otherwise, if automatic
1305 # publication is switched on, default value is used for result name.
1307 # @return New GEOM.GEOM_Object, containing the created point.
1309 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1310 @ManageTransactions("BasicOp")
1311 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1313 Create a point by projection give coordinates on the given surface
1316 theRefSurf The referenced surface.
1317 theX X-coordinate in 3D space
1318 theY Y-coordinate in 3D space
1319 theZ Z-coordinate in 3D space
1320 theName Object name; when specified, this parameter is used
1321 for result publication in the study. Otherwise, if automatic
1322 publication is switched on, default value is used for result name.
1325 New GEOM.GEOM_Object, containing the created point.
1328 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1330 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1331 # Example: see GEOM_TestAll.py
1332 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1333 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1334 anObj.SetParameters(Parameters);
1335 self._autoPublish(anObj, theName, "vertex")
1338 ## Create a point, which lays on the given face.
1339 # The point will lay in arbitrary place of the face.
1340 # The only condition on it is a non-zero distance to the face boundary.
1341 # Such point can be used to uniquely identify the face inside any
1342 # shape in case, when the shape does not contain overlapped faces.
1343 # @param theFace The referenced face.
1344 # @param theName Object name; when specified, this parameter is used
1345 # for result publication in the study. Otherwise, if automatic
1346 # publication is switched on, default value is used for result name.
1348 # @return New GEOM.GEOM_Object, containing the created point.
1350 # @ref swig_MakeVertexInsideFace "Example"
1351 @ManageTransactions("BasicOp")
1352 def MakeVertexInsideFace (self, theFace, theName=None):
1354 Create a point, which lays on the given face.
1355 The point will lay in arbitrary place of the face.
1356 The only condition on it is a non-zero distance to the face boundary.
1357 Such point can be used to uniquely identify the face inside any
1358 shape in case, when the shape does not contain overlapped faces.
1361 theFace The referenced face.
1362 theName Object name; when specified, this parameter is used
1363 for result publication in the study. Otherwise, if automatic
1364 publication is switched on, default value is used for result name.
1367 New GEOM.GEOM_Object, containing the created point.
1370 p_on_face = geompy.MakeVertexInsideFace(Face)
1372 # Example: see GEOM_TestAll.py
1373 anObj = self.BasicOp.MakePointOnFace(theFace)
1374 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1375 self._autoPublish(anObj, theName, "vertex")
1378 ## Create a point on intersection of two lines.
1379 # @param theRefLine1, theRefLine2 The referenced lines.
1380 # @param theName Object name; when specified, this parameter is used
1381 # for result publication in the study. Otherwise, if automatic
1382 # publication is switched on, default value is used for result name.
1384 # @return New GEOM.GEOM_Object, containing the created point.
1386 # @ref swig_MakeVertexOnLinesIntersection "Example"
1387 @ManageTransactions("BasicOp")
1388 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1390 Create a point on intersection of two lines.
1393 theRefLine1, theRefLine2 The referenced lines.
1394 theName Object name; when specified, this parameter is used
1395 for result publication in the study. Otherwise, if automatic
1396 publication is switched on, default value is used for result name.
1399 New GEOM.GEOM_Object, containing the created point.
1401 # Example: see GEOM_TestAll.py
1402 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1403 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1404 self._autoPublish(anObj, theName, "vertex")
1407 ## Create a tangent, corresponding to the given parameter on the given curve.
1408 # @param theRefCurve The referenced curve.
1409 # @param theParameter Value of parameter on the referenced curve.
1410 # @param theName Object name; when specified, this parameter is used
1411 # for result publication in the study. Otherwise, if automatic
1412 # publication is switched on, default value is used for result name.
1414 # @return New GEOM.GEOM_Object, containing the created tangent.
1416 # @ref swig_MakeTangentOnCurve "Example"
1417 @ManageTransactions("BasicOp")
1418 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1420 Create a tangent, corresponding to the given parameter on the given curve.
1423 theRefCurve The referenced curve.
1424 theParameter Value of parameter on the referenced curve.
1425 theName Object name; when specified, this parameter is used
1426 for result publication in the study. Otherwise, if automatic
1427 publication is switched on, default value is used for result name.
1430 New GEOM.GEOM_Object, containing the created tangent.
1433 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1435 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1436 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1437 self._autoPublish(anObj, theName, "tangent")
1440 ## Create a tangent plane, corresponding to the given parameter on the given face.
1441 # @param theFace The face for which tangent plane should be built.
1442 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1443 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1444 # @param theTrimSize the size of plane.
1445 # @param theName Object name; when specified, this parameter is used
1446 # for result publication in the study. Otherwise, if automatic
1447 # publication is switched on, default value is used for result name.
1449 # @return New GEOM.GEOM_Object, containing the created tangent.
1451 # @ref swig_MakeTangentPlaneOnFace "Example"
1452 @ManageTransactions("BasicOp")
1453 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1455 Create a tangent plane, corresponding to the given parameter on the given face.
1458 theFace The face for which tangent plane should be built.
1459 theParameterV vertical value of the center point (0.0 - 1.0).
1460 theParameterU horisontal value of the center point (0.0 - 1.0).
1461 theTrimSize the size of plane.
1462 theName Object name; when specified, this parameter is used
1463 for result publication in the study. Otherwise, if automatic
1464 publication is switched on, default value is used for result name.
1467 New GEOM.GEOM_Object, containing the created tangent.
1470 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1472 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1473 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1474 self._autoPublish(anObj, theName, "tangent")
1477 ## Create a vector with the given components.
1478 # @param theDX X component of the vector.
1479 # @param theDY Y component of the vector.
1480 # @param theDZ Z component of the vector.
1481 # @param theName Object name; when specified, this parameter is used
1482 # for result publication in the study. Otherwise, if automatic
1483 # publication is switched on, default value is used for result name.
1485 # @return New GEOM.GEOM_Object, containing the created vector.
1487 # @ref tui_creation_vector "Example"
1488 @ManageTransactions("BasicOp")
1489 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1491 Create a vector with the given components.
1494 theDX X component of the vector.
1495 theDY Y component of the vector.
1496 theDZ Z component of the vector.
1497 theName Object name; when specified, this parameter is used
1498 for result publication in the study. Otherwise, if automatic
1499 publication is switched on, default value is used for result name.
1502 New GEOM.GEOM_Object, containing the created vector.
1504 # Example: see GEOM_TestAll.py
1505 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1506 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1507 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1508 anObj.SetParameters(Parameters)
1509 self._autoPublish(anObj, theName, "vector")
1512 ## Create a vector between two points.
1513 # @param thePnt1 Start point for the vector.
1514 # @param thePnt2 End point for the vector.
1515 # @param theName Object name; when specified, this parameter is used
1516 # for result publication in the study. Otherwise, if automatic
1517 # publication is switched on, default value is used for result name.
1519 # @return New GEOM.GEOM_Object, containing the created vector.
1521 # @ref tui_creation_vector "Example"
1522 @ManageTransactions("BasicOp")
1523 def MakeVector(self, thePnt1, thePnt2, theName=None):
1525 Create a vector between two points.
1528 thePnt1 Start point for the vector.
1529 thePnt2 End point for the vector.
1530 theName Object name; when specified, this parameter is used
1531 for result publication in the study. Otherwise, if automatic
1532 publication is switched on, default value is used for result name.
1535 New GEOM.GEOM_Object, containing the created vector.
1537 # Example: see GEOM_TestAll.py
1538 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1539 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1540 self._autoPublish(anObj, theName, "vector")
1543 ## Create a line, passing through the given point
1544 # and parrallel to the given direction
1545 # @param thePnt Point. The resulting line will pass through it.
1546 # @param theDir Direction. The resulting line will be parallel to it.
1547 # @param theName Object name; when specified, this parameter is used
1548 # for result publication in the study. Otherwise, if automatic
1549 # publication is switched on, default value is used for result name.
1551 # @return New GEOM.GEOM_Object, containing the created line.
1553 # @ref tui_creation_line "Example"
1554 @ManageTransactions("BasicOp")
1555 def MakeLine(self, thePnt, theDir, theName=None):
1557 Create a line, passing through the given point
1558 and parrallel to the given direction
1561 thePnt Point. The resulting line will pass through it.
1562 theDir Direction. The resulting line will be parallel to it.
1563 theName Object name; when specified, this parameter is used
1564 for result publication in the study. Otherwise, if automatic
1565 publication is switched on, default value is used for result name.
1568 New GEOM.GEOM_Object, containing the created line.
1570 # Example: see GEOM_TestAll.py
1571 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1572 RaiseIfFailed("MakeLine", self.BasicOp)
1573 self._autoPublish(anObj, theName, "line")
1576 ## Create a line, passing through the given points
1577 # @param thePnt1 First of two points, defining the line.
1578 # @param thePnt2 Second of two points, defining the line.
1579 # @param theName Object name; when specified, this parameter is used
1580 # for result publication in the study. Otherwise, if automatic
1581 # publication is switched on, default value is used for result name.
1583 # @return New GEOM.GEOM_Object, containing the created line.
1585 # @ref tui_creation_line "Example"
1586 @ManageTransactions("BasicOp")
1587 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1589 Create a line, passing through the given points
1592 thePnt1 First of two points, defining the line.
1593 thePnt2 Second of two points, defining the line.
1594 theName Object name; when specified, this parameter is used
1595 for result publication in the study. Otherwise, if automatic
1596 publication is switched on, default value is used for result name.
1599 New GEOM.GEOM_Object, containing the created line.
1601 # Example: see GEOM_TestAll.py
1602 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1603 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1604 self._autoPublish(anObj, theName, "line")
1607 ## Create a line on two faces intersection.
1608 # @param theFace1 First of two faces, defining the line.
1609 # @param theFace2 Second of two faces, defining the line.
1610 # @param theName Object name; when specified, this parameter is used
1611 # for result publication in the study. Otherwise, if automatic
1612 # publication is switched on, default value is used for result name.
1614 # @return New GEOM.GEOM_Object, containing the created line.
1616 # @ref swig_MakeLineTwoFaces "Example"
1617 @ManageTransactions("BasicOp")
1618 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1620 Create a line on two faces intersection.
1623 theFace1 First of two faces, defining the line.
1624 theFace2 Second of two faces, defining the line.
1625 theName Object name; when specified, this parameter is used
1626 for result publication in the study. Otherwise, if automatic
1627 publication is switched on, default value is used for result name.
1630 New GEOM.GEOM_Object, containing the created line.
1632 # Example: see GEOM_TestAll.py
1633 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1634 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1635 self._autoPublish(anObj, theName, "line")
1638 ## Create a plane, passing through the given point
1639 # and normal to the given vector.
1640 # @param thePnt Point, the plane has to pass through.
1641 # @param theVec Vector, defining the plane normal direction.
1642 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1643 # @param theName Object name; when specified, this parameter is used
1644 # for result publication in the study. Otherwise, if automatic
1645 # publication is switched on, default value is used for result name.
1647 # @return New GEOM.GEOM_Object, containing the created plane.
1649 # @ref tui_creation_plane "Example"
1650 @ManageTransactions("BasicOp")
1651 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1653 Create a plane, passing through the given point
1654 and normal to the given vector.
1657 thePnt Point, the plane has to pass through.
1658 theVec Vector, defining the plane normal direction.
1659 theTrimSize Half size of a side of quadrangle face, representing the plane.
1660 theName Object name; when specified, this parameter is used
1661 for result publication in the study. Otherwise, if automatic
1662 publication is switched on, default value is used for result name.
1665 New GEOM.GEOM_Object, containing the created plane.
1667 # Example: see GEOM_TestAll.py
1668 theTrimSize, Parameters = ParseParameters(theTrimSize);
1669 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1670 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1671 anObj.SetParameters(Parameters)
1672 self._autoPublish(anObj, theName, "plane")
1675 ## Create a plane, passing through the three given points
1676 # @param thePnt1 First of three points, defining the plane.
1677 # @param thePnt2 Second of three points, defining the plane.
1678 # @param thePnt3 Fird of three points, defining the plane.
1679 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1680 # @param theName Object name; when specified, this parameter is used
1681 # for result publication in the study. Otherwise, if automatic
1682 # publication is switched on, default value is used for result name.
1684 # @return New GEOM.GEOM_Object, containing the created plane.
1686 # @ref tui_creation_plane "Example"
1687 @ManageTransactions("BasicOp")
1688 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1690 Create a plane, passing through the three given points
1693 thePnt1 First of three points, defining the plane.
1694 thePnt2 Second of three points, defining the plane.
1695 thePnt3 Fird of three points, defining the plane.
1696 theTrimSize Half size of a side of quadrangle face, representing the plane.
1697 theName Object name; when specified, this parameter is used
1698 for result publication in the study. Otherwise, if automatic
1699 publication is switched on, default value is used for result name.
1702 New GEOM.GEOM_Object, containing the created plane.
1704 # Example: see GEOM_TestAll.py
1705 theTrimSize, Parameters = ParseParameters(theTrimSize);
1706 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1707 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1708 anObj.SetParameters(Parameters)
1709 self._autoPublish(anObj, theName, "plane")
1712 ## Create a plane, similar to the existing one, but with another size of representing face.
1713 # @param theFace Referenced plane or LCS(Marker).
1714 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1715 # @param theName Object name; when specified, this parameter is used
1716 # for result publication in the study. Otherwise, if automatic
1717 # publication is switched on, default value is used for result name.
1719 # @return New GEOM.GEOM_Object, containing the created plane.
1721 # @ref tui_creation_plane "Example"
1722 @ManageTransactions("BasicOp")
1723 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1725 Create a plane, similar to the existing one, but with another size of representing face.
1728 theFace Referenced plane or LCS(Marker).
1729 theTrimSize New half size of a side of quadrangle face, representing the plane.
1730 theName Object name; when specified, this parameter is used
1731 for result publication in the study. Otherwise, if automatic
1732 publication is switched on, default value is used for result name.
1735 New GEOM.GEOM_Object, containing the created plane.
1737 # Example: see GEOM_TestAll.py
1738 theTrimSize, Parameters = ParseParameters(theTrimSize);
1739 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1740 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1741 anObj.SetParameters(Parameters)
1742 self._autoPublish(anObj, theName, "plane")
1745 ## Create a plane, passing through the 2 vectors
1746 # with center in a start point of the first vector.
1747 # @param theVec1 Vector, defining center point and plane direction.
1748 # @param theVec2 Vector, defining the plane normal direction.
1749 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1750 # @param theName Object name; when specified, this parameter is used
1751 # for result publication in the study. Otherwise, if automatic
1752 # publication is switched on, default value is used for result name.
1754 # @return New GEOM.GEOM_Object, containing the created plane.
1756 # @ref tui_creation_plane "Example"
1757 @ManageTransactions("BasicOp")
1758 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1760 Create a plane, passing through the 2 vectors
1761 with center in a start point of the first vector.
1764 theVec1 Vector, defining center point and plane direction.
1765 theVec2 Vector, defining the plane normal direction.
1766 theTrimSize Half size of a side of quadrangle face, representing the plane.
1767 theName Object name; when specified, this parameter is used
1768 for result publication in the study. Otherwise, if automatic
1769 publication is switched on, default value is used for result name.
1772 New GEOM.GEOM_Object, containing the created plane.
1774 # Example: see GEOM_TestAll.py
1775 theTrimSize, Parameters = ParseParameters(theTrimSize);
1776 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1777 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1778 anObj.SetParameters(Parameters)
1779 self._autoPublish(anObj, theName, "plane")
1782 ## Create a plane, based on a Local coordinate system.
1783 # @param theLCS coordinate system, defining plane.
1784 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1785 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1786 # @param theName Object name; when specified, this parameter is used
1787 # for result publication in the study. Otherwise, if automatic
1788 # publication is switched on, default value is used for result name.
1790 # @return New GEOM.GEOM_Object, containing the created plane.
1792 # @ref tui_creation_plane "Example"
1793 @ManageTransactions("BasicOp")
1794 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1796 Create a plane, based on a Local coordinate system.
1799 theLCS coordinate system, defining plane.
1800 theTrimSize Half size of a side of quadrangle face, representing the plane.
1801 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1802 theName Object name; when specified, this parameter is used
1803 for result publication in the study. Otherwise, if automatic
1804 publication is switched on, default value is used for result name.
1807 New GEOM.GEOM_Object, containing the created plane.
1809 # Example: see GEOM_TestAll.py
1810 theTrimSize, Parameters = ParseParameters(theTrimSize);
1811 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1812 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1813 anObj.SetParameters(Parameters)
1814 self._autoPublish(anObj, theName, "plane")
1817 ## Create a local coordinate system.
1818 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1819 # @param XDX,XDY,XDZ Three components of OX direction
1820 # @param YDX,YDY,YDZ Three components of OY direction
1821 # @param theName Object name; when specified, this parameter is used
1822 # for result publication in the study. Otherwise, if automatic
1823 # publication is switched on, default value is used for result name.
1825 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1827 # @ref swig_MakeMarker "Example"
1828 @ManageTransactions("BasicOp")
1829 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1831 Create a local coordinate system.
1834 OX,OY,OZ Three coordinates of coordinate system origin.
1835 XDX,XDY,XDZ Three components of OX direction
1836 YDX,YDY,YDZ Three components of OY direction
1837 theName Object name; when specified, this parameter is used
1838 for result publication in the study. Otherwise, if automatic
1839 publication is switched on, default value is used for result name.
1842 New GEOM.GEOM_Object, containing the created coordinate system.
1844 # Example: see GEOM_TestAll.py
1845 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1846 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1847 RaiseIfFailed("MakeMarker", self.BasicOp)
1848 anObj.SetParameters(Parameters)
1849 self._autoPublish(anObj, theName, "lcs")
1852 ## Create a local coordinate system from shape.
1853 # @param theShape The initial shape to detect the coordinate system.
1854 # @param theName Object name; when specified, this parameter is used
1855 # for result publication in the study. Otherwise, if automatic
1856 # publication is switched on, default value is used for result name.
1858 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1860 # @ref tui_creation_lcs "Example"
1861 @ManageTransactions("BasicOp")
1862 def MakeMarkerFromShape(self, theShape, theName=None):
1864 Create a local coordinate system from shape.
1867 theShape The initial shape to detect the coordinate system.
1868 theName Object name; when specified, this parameter is used
1869 for result publication in the study. Otherwise, if automatic
1870 publication is switched on, default value is used for result name.
1873 New GEOM.GEOM_Object, containing the created coordinate system.
1875 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1876 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1877 self._autoPublish(anObj, theName, "lcs")
1880 ## Create a local coordinate system from point and two vectors.
1881 # @param theOrigin Point of coordinate system origin.
1882 # @param theXVec Vector of X direction
1883 # @param theYVec Vector of Y direction
1884 # @param theName Object name; when specified, this parameter is used
1885 # for result publication in the study. Otherwise, if automatic
1886 # publication is switched on, default value is used for result name.
1888 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1890 # @ref tui_creation_lcs "Example"
1891 @ManageTransactions("BasicOp")
1892 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1894 Create a local coordinate system from point and two vectors.
1897 theOrigin Point of coordinate system origin.
1898 theXVec Vector of X direction
1899 theYVec Vector of Y direction
1900 theName Object name; when specified, this parameter is used
1901 for result publication in the study. Otherwise, if automatic
1902 publication is switched on, default value is used for result name.
1905 New GEOM.GEOM_Object, containing the created coordinate system.
1908 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1909 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1910 self._autoPublish(anObj, theName, "lcs")
1913 # end of l3_basic_go
1916 ## @addtogroup l4_curves
1919 ## Create an arc of circle, passing through three given points.
1920 # @param thePnt1 Start point of the arc.
1921 # @param thePnt2 Middle point of the arc.
1922 # @param thePnt3 End point of the arc.
1923 # @param theName Object name; when specified, this parameter is used
1924 # for result publication in the study. Otherwise, if automatic
1925 # publication is switched on, default value is used for result name.
1927 # @return New GEOM.GEOM_Object, containing the created arc.
1929 # @ref swig_MakeArc "Example"
1930 @ManageTransactions("CurvesOp")
1931 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1933 Create an arc of circle, passing through three given points.
1936 thePnt1 Start point of the arc.
1937 thePnt2 Middle point of the arc.
1938 thePnt3 End point of the arc.
1939 theName Object name; when specified, this parameter is used
1940 for result publication in the study. Otherwise, if automatic
1941 publication is switched on, default value is used for result name.
1944 New GEOM.GEOM_Object, containing the created arc.
1946 # Example: see GEOM_TestAll.py
1947 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1948 RaiseIfFailed("MakeArc", self.CurvesOp)
1949 self._autoPublish(anObj, theName, "arc")
1952 ## Create an arc of circle from a center and 2 points.
1953 # @param thePnt1 Center of the arc
1954 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1955 # @param thePnt3 End point of the arc (Gives also a direction)
1956 # @param theSense Orientation of the arc
1957 # @param theName Object name; when specified, this parameter is used
1958 # for result publication in the study. Otherwise, if automatic
1959 # publication is switched on, default value is used for result name.
1961 # @return New GEOM.GEOM_Object, containing the created arc.
1963 # @ref swig_MakeArc "Example"
1964 @ManageTransactions("CurvesOp")
1965 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1967 Create an arc of circle from a center and 2 points.
1970 thePnt1 Center of the arc
1971 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1972 thePnt3 End point of the arc (Gives also a direction)
1973 theSense Orientation of the arc
1974 theName Object name; when specified, this parameter is used
1975 for result publication in the study. Otherwise, if automatic
1976 publication is switched on, default value is used for result name.
1979 New GEOM.GEOM_Object, containing the created arc.
1981 # Example: see GEOM_TestAll.py
1982 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1983 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1984 self._autoPublish(anObj, theName, "arc")
1987 ## Create an arc of ellipse, of center and two points.
1988 # @param theCenter Center of the arc.
1989 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1990 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1991 # @param theName Object name; when specified, this parameter is used
1992 # for result publication in the study. Otherwise, if automatic
1993 # publication is switched on, default value is used for result name.
1995 # @return New GEOM.GEOM_Object, containing the created arc.
1997 # @ref swig_MakeArc "Example"
1998 @ManageTransactions("CurvesOp")
1999 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2001 Create an arc of ellipse, of center and two points.
2004 theCenter Center of the arc.
2005 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2006 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2007 theName Object name; when specified, this parameter is used
2008 for result publication in the study. Otherwise, if automatic
2009 publication is switched on, default value is used for result name.
2012 New GEOM.GEOM_Object, containing the created arc.
2014 # Example: see GEOM_TestAll.py
2015 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2016 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2017 self._autoPublish(anObj, theName, "arc")
2020 ## Create a circle with given center, normal vector and radius.
2021 # @param thePnt Circle center.
2022 # @param theVec Vector, normal to the plane of the circle.
2023 # @param theR Circle radius.
2024 # @param theName Object name; when specified, this parameter is used
2025 # for result publication in the study. Otherwise, if automatic
2026 # publication is switched on, default value is used for result name.
2028 # @return New GEOM.GEOM_Object, containing the created circle.
2030 # @ref tui_creation_circle "Example"
2031 @ManageTransactions("CurvesOp")
2032 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2034 Create a circle with given center, normal vector and radius.
2037 thePnt Circle center.
2038 theVec Vector, normal to the plane of the circle.
2040 theName Object name; when specified, this parameter is used
2041 for result publication in the study. Otherwise, if automatic
2042 publication is switched on, default value is used for result name.
2045 New GEOM.GEOM_Object, containing the created circle.
2047 # Example: see GEOM_TestAll.py
2048 theR, Parameters = ParseParameters(theR)
2049 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2050 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2051 anObj.SetParameters(Parameters)
2052 self._autoPublish(anObj, theName, "circle")
2055 ## Create a circle with given radius.
2056 # Center of the circle will be in the origin of global
2057 # coordinate system and normal vector will be codirected with Z axis
2058 # @param theR Circle radius.
2059 # @param theName Object name; when specified, this parameter is used
2060 # for result publication in the study. Otherwise, if automatic
2061 # publication is switched on, default value is used for result name.
2063 # @return New GEOM.GEOM_Object, containing the created circle.
2064 @ManageTransactions("CurvesOp")
2065 def MakeCircleR(self, theR, theName=None):
2067 Create a circle with given radius.
2068 Center of the circle will be in the origin of global
2069 coordinate system and normal vector will be codirected with Z axis
2073 theName Object name; when specified, this parameter is used
2074 for result publication in the study. Otherwise, if automatic
2075 publication is switched on, default value is used for result name.
2078 New GEOM.GEOM_Object, containing the created circle.
2080 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2081 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2082 self._autoPublish(anObj, theName, "circle")
2085 ## Create a circle, passing through three given points
2086 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2087 # @param theName Object name; when specified, this parameter is used
2088 # for result publication in the study. Otherwise, if automatic
2089 # publication is switched on, default value is used for result name.
2091 # @return New GEOM.GEOM_Object, containing the created circle.
2093 # @ref tui_creation_circle "Example"
2094 @ManageTransactions("CurvesOp")
2095 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2097 Create a circle, passing through three given points
2100 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2101 theName Object name; when specified, this parameter is used
2102 for result publication in the study. Otherwise, if automatic
2103 publication is switched on, default value is used for result name.
2106 New GEOM.GEOM_Object, containing the created circle.
2108 # Example: see GEOM_TestAll.py
2109 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2110 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2111 self._autoPublish(anObj, theName, "circle")
2114 ## Create a circle, with given point1 as center,
2115 # passing through the point2 as radius and laying in the plane,
2116 # defined by all three given points.
2117 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2118 # @param theName Object name; when specified, this parameter is used
2119 # for result publication in the study. Otherwise, if automatic
2120 # publication is switched on, default value is used for result name.
2122 # @return New GEOM.GEOM_Object, containing the created circle.
2124 # @ref swig_MakeCircle "Example"
2125 @ManageTransactions("CurvesOp")
2126 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2128 Create a circle, with given point1 as center,
2129 passing through the point2 as radius and laying in the plane,
2130 defined by all three given points.
2133 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2134 theName Object name; when specified, this parameter is used
2135 for result publication in the study. Otherwise, if automatic
2136 publication is switched on, default value is used for result name.
2139 New GEOM.GEOM_Object, containing the created circle.
2141 # Example: see GEOM_example6.py
2142 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2143 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2144 self._autoPublish(anObj, theName, "circle")
2147 ## Create an ellipse with given center, normal vector and radiuses.
2148 # @param thePnt Ellipse center.
2149 # @param theVec Vector, normal to the plane of the ellipse.
2150 # @param theRMajor Major ellipse radius.
2151 # @param theRMinor Minor ellipse radius.
2152 # @param theVecMaj Vector, direction of the ellipse's main axis.
2153 # @param theName Object name; when specified, this parameter is used
2154 # for result publication in the study. Otherwise, if automatic
2155 # publication is switched on, default value is used for result name.
2157 # @return New GEOM.GEOM_Object, containing the created ellipse.
2159 # @ref tui_creation_ellipse "Example"
2160 @ManageTransactions("CurvesOp")
2161 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2163 Create an ellipse with given center, normal vector and radiuses.
2166 thePnt Ellipse center.
2167 theVec Vector, normal to the plane of the ellipse.
2168 theRMajor Major ellipse radius.
2169 theRMinor Minor ellipse radius.
2170 theVecMaj Vector, direction of the ellipse's main axis.
2171 theName Object name; when specified, this parameter is used
2172 for result publication in the study. Otherwise, if automatic
2173 publication is switched on, default value is used for result name.
2176 New GEOM.GEOM_Object, containing the created ellipse.
2178 # Example: see GEOM_TestAll.py
2179 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2180 if theVecMaj is not None:
2181 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2183 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2185 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2186 anObj.SetParameters(Parameters)
2187 self._autoPublish(anObj, theName, "ellipse")
2190 ## Create an ellipse with given radiuses.
2191 # Center of the ellipse will be in the origin of global
2192 # coordinate system and normal vector will be codirected with Z axis
2193 # @param theRMajor Major ellipse radius.
2194 # @param theRMinor Minor ellipse radius.
2195 # @param theName Object name; when specified, this parameter is used
2196 # for result publication in the study. Otherwise, if automatic
2197 # publication is switched on, default value is used for result name.
2199 # @return New GEOM.GEOM_Object, containing the created ellipse.
2200 @ManageTransactions("CurvesOp")
2201 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2203 Create an ellipse with given radiuses.
2204 Center of the ellipse will be in the origin of global
2205 coordinate system and normal vector will be codirected with Z axis
2208 theRMajor Major ellipse radius.
2209 theRMinor Minor ellipse radius.
2210 theName Object name; when specified, this parameter is used
2211 for result publication in the study. Otherwise, if automatic
2212 publication is switched on, default value is used for result name.
2215 New GEOM.GEOM_Object, containing the created ellipse.
2217 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2218 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2219 self._autoPublish(anObj, theName, "ellipse")
2222 ## Create a polyline on the set of points.
2223 # @param thePoints Sequence of points for the polyline.
2224 # @param theIsClosed If True, build a closed wire.
2225 # @param theName Object name; when specified, this parameter is used
2226 # for result publication in the study. Otherwise, if automatic
2227 # publication is switched on, default value is used for result name.
2229 # @return New GEOM.GEOM_Object, containing the created polyline.
2231 # @ref tui_creation_curve "Example"
2232 @ManageTransactions("CurvesOp")
2233 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2235 Create a polyline on the set of points.
2238 thePoints Sequence of points for the polyline.
2239 theIsClosed If True, build a closed wire.
2240 theName Object name; when specified, this parameter is used
2241 for result publication in the study. Otherwise, if automatic
2242 publication is switched on, default value is used for result name.
2245 New GEOM.GEOM_Object, containing the created polyline.
2247 # Example: see GEOM_TestAll.py
2248 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2249 RaiseIfFailed("MakePolyline", self.CurvesOp)
2250 self._autoPublish(anObj, theName, "polyline")
2253 ## Create bezier curve on the set of points.
2254 # @param thePoints Sequence of points for the bezier curve.
2255 # @param theIsClosed If True, build a closed curve.
2256 # @param theName Object name; when specified, this parameter is used
2257 # for result publication in the study. Otherwise, if automatic
2258 # publication is switched on, default value is used for result name.
2260 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2262 # @ref tui_creation_curve "Example"
2263 @ManageTransactions("CurvesOp")
2264 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2266 Create bezier curve on the set of points.
2269 thePoints Sequence of points for the bezier curve.
2270 theIsClosed If True, build a closed curve.
2271 theName Object name; when specified, this parameter is used
2272 for result publication in the study. Otherwise, if automatic
2273 publication is switched on, default value is used for result name.
2276 New GEOM.GEOM_Object, containing the created bezier curve.
2278 # Example: see GEOM_TestAll.py
2279 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2280 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2281 self._autoPublish(anObj, theName, "bezier")
2284 ## Create B-Spline curve on the set of points.
2285 # @param thePoints Sequence of points for the B-Spline curve.
2286 # @param theIsClosed If True, build a closed curve.
2287 # @param theDoReordering If TRUE, the algo does not follow the order of
2288 # \a thePoints but searches for the closest vertex.
2289 # @param theName Object name; when specified, this parameter is used
2290 # for result publication in the study. Otherwise, if automatic
2291 # publication is switched on, default value is used for result name.
2293 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2295 # @ref tui_creation_curve "Example"
2296 @ManageTransactions("CurvesOp")
2297 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2299 Create B-Spline curve on the set of points.
2302 thePoints Sequence of points for the B-Spline curve.
2303 theIsClosed If True, build a closed curve.
2304 theDoReordering If True, the algo does not follow the order of
2305 thePoints but searches for the closest vertex.
2306 theName Object name; when specified, this parameter is used
2307 for result publication in the study. Otherwise, if automatic
2308 publication is switched on, default value is used for result name.
2311 New GEOM.GEOM_Object, containing the created B-Spline curve.
2313 # Example: see GEOM_TestAll.py
2314 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2315 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2316 self._autoPublish(anObj, theName, "bspline")
2319 ## Create B-Spline curve on the set of points.
2320 # @param thePoints Sequence of points for the B-Spline curve.
2321 # @param theFirstVec Vector object, defining the curve direction at its first point.
2322 # @param theLastVec Vector object, defining the curve direction at its last point.
2323 # @param theName Object name; when specified, this parameter is used
2324 # for result publication in the study. Otherwise, if automatic
2325 # publication is switched on, default value is used for result name.
2327 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2329 # @ref tui_creation_curve "Example"
2330 @ManageTransactions("CurvesOp")
2331 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2333 Create B-Spline curve on the set of points.
2336 thePoints Sequence of points for the B-Spline curve.
2337 theFirstVec Vector object, defining the curve direction at its first point.
2338 theLastVec Vector object, defining the curve direction at its last point.
2339 theName Object name; when specified, this parameter is used
2340 for result publication in the study. Otherwise, if automatic
2341 publication is switched on, default value is used for result name.
2344 New GEOM.GEOM_Object, containing the created B-Spline curve.
2346 # Example: see GEOM_TestAll.py
2347 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2348 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2349 self._autoPublish(anObj, theName, "bspline")
2352 ## Creates a curve using the parametric definition of the basic points.
2353 # @param thexExpr parametric equation of the coordinates X.
2354 # @param theyExpr parametric equation of the coordinates Y.
2355 # @param thezExpr parametric equation of the coordinates Z.
2356 # @param theParamMin the minimal value of the parameter.
2357 # @param theParamMax the maximum value of the parameter.
2358 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2359 # @param theCurveType the type of the curve,
2360 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2361 # @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.
2362 # @param theName Object name; when specified, this parameter is used
2363 # for result publication in the study. Otherwise, if automatic
2364 # publication is switched on, default value is used for result name.
2366 # @return New GEOM.GEOM_Object, containing the created curve.
2368 # @ref tui_creation_curve "Example"
2369 @ManageTransactions("CurvesOp")
2370 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2371 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2373 Creates a curve using the parametric definition of the basic points.
2376 thexExpr parametric equation of the coordinates X.
2377 theyExpr parametric equation of the coordinates Y.
2378 thezExpr parametric equation of the coordinates Z.
2379 theParamMin the minimal value of the parameter.
2380 theParamMax the maximum value of the parameter.
2381 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2382 theCurveType the type of the curve,
2383 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2384 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2385 method is used which can lead to a bug.
2386 theName Object name; when specified, this parameter is used
2387 for result publication in the study. Otherwise, if automatic
2388 publication is switched on, default value is used for result name.
2391 New GEOM.GEOM_Object, containing the created curve.
2393 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2395 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2397 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2398 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2399 anObj.SetParameters(Parameters)
2400 self._autoPublish(anObj, theName, "curve")
2403 ## Create an isoline curve on a face.
2404 # @param theFace the face for which an isoline is created.
2405 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2407 # @param theParameter the U parameter for U-isoline or V parameter
2409 # @param theName Object name; when specified, this parameter is used
2410 # for result publication in the study. Otherwise, if automatic
2411 # publication is switched on, default value is used for result name.
2413 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2414 # a compound of edges.
2416 # @ref tui_creation_curve "Example"
2417 @ManageTransactions("CurvesOp")
2418 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2420 Create an isoline curve on a face.
2423 theFace the face for which an isoline is created.
2424 IsUIsoline True for U-isoline creation; False for V-isoline
2426 theParameter the U parameter for U-isoline or V parameter
2428 theName Object name; when specified, this parameter is used
2429 for result publication in the study. Otherwise, if automatic
2430 publication is switched on, default value is used for result name.
2433 New GEOM.GEOM_Object, containing the created isoline edge or a
2436 # Example: see GEOM_TestAll.py
2437 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2438 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2440 self._autoPublish(anObj, theName, "U-Isoline")
2442 self._autoPublish(anObj, theName, "V-Isoline")
2448 ## @addtogroup l3_sketcher
2451 ## Create a sketcher (wire or face), following the textual description,
2452 # passed through <VAR>theCommand</VAR> argument. \n
2453 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2454 # Format of the description string have to be the following:
2456 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2459 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2461 # - "R angle" : Set the direction by angle
2462 # - "D dx dy" : Set the direction by DX & DY
2465 # - "TT x y" : Create segment by point at X & Y
2466 # - "T dx dy" : Create segment by point with DX & DY
2467 # - "L length" : Create segment by direction & Length
2468 # - "IX x" : Create segment by direction & Intersect. X
2469 # - "IY y" : Create segment by direction & Intersect. Y
2472 # - "C radius length" : Create arc by direction, radius and length(in degree)
2473 # - "AA x y": Create arc by point at X & Y
2474 # - "A dx dy" : Create arc by point with DX & DY
2475 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2476 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2477 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2478 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2481 # - "WW" : Close Wire (to finish)
2482 # - "WF" : Close Wire and build face (to finish)
2485 # - Flag1 (= reverse) is 0 or 2 ...
2486 # - if 0 the drawn arc is the one of lower angle (< Pi)
2487 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2490 # - Flag2 (= control tolerance) is 0 or 1 ...
2491 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2492 # - if 1 the wire is built only if the end point is on the arc
2493 # with a tolerance of 10^-7 on the distance else the creation fails
2495 # @param theCommand String, defining the sketcher in local
2496 # coordinates of the working plane.
2497 # @param theWorkingPlane Nine double values, defining origin,
2498 # OZ and OX directions of the working plane.
2499 # @param theName Object name; when specified, this parameter is used
2500 # for result publication in the study. Otherwise, if automatic
2501 # publication is switched on, default value is used for result name.
2503 # @return New GEOM.GEOM_Object, containing the created wire.
2505 # @ref tui_sketcher_page "Example"
2506 @ManageTransactions("CurvesOp")
2507 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2509 Create a sketcher (wire or face), following the textual description, passed
2510 through theCommand argument.
2511 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2512 Format of the description string have to be the following:
2513 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2515 - x1, y1 are coordinates of the first sketcher point (zero by default),
2517 - "R angle" : Set the direction by angle
2518 - "D dx dy" : Set the direction by DX & DY
2520 - "TT x y" : Create segment by point at X & Y
2521 - "T dx dy" : Create segment by point with DX & DY
2522 - "L length" : Create segment by direction & Length
2523 - "IX x" : Create segment by direction & Intersect. X
2524 - "IY y" : Create segment by direction & Intersect. Y
2526 - "C radius length" : Create arc by direction, radius and length(in degree)
2527 - "AA x y": Create arc by point at X & Y
2528 - "A dx dy" : Create arc by point with DX & DY
2529 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2530 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2531 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2532 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2534 - "WW" : Close Wire (to finish)
2535 - "WF" : Close Wire and build face (to finish)
2537 - Flag1 (= reverse) is 0 or 2 ...
2538 - if 0 the drawn arc is the one of lower angle (< Pi)
2539 - if 2 the drawn arc ius the one of greater angle (> Pi)
2541 - Flag2 (= control tolerance) is 0 or 1 ...
2542 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2543 - if 1 the wire is built only if the end point is on the arc
2544 with a tolerance of 10^-7 on the distance else the creation fails
2547 theCommand String, defining the sketcher in local
2548 coordinates of the working plane.
2549 theWorkingPlane Nine double values, defining origin,
2550 OZ and OX directions of the working plane.
2551 theName Object name; when specified, this parameter is used
2552 for result publication in the study. Otherwise, if automatic
2553 publication is switched on, default value is used for result name.
2556 New GEOM.GEOM_Object, containing the created wire.
2558 # Example: see GEOM_TestAll.py
2559 theCommand,Parameters = ParseSketcherCommand(theCommand)
2560 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2561 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2562 anObj.SetParameters(Parameters)
2563 self._autoPublish(anObj, theName, "wire")
2566 ## Create a sketcher (wire or face), following the textual description,
2567 # passed through <VAR>theCommand</VAR> argument. \n
2568 # For format of the description string see MakeSketcher() method.\n
2569 # @param theCommand String, defining the sketcher in local
2570 # coordinates of the working plane.
2571 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2572 # @param theName Object name; when specified, this parameter is used
2573 # for result publication in the study. Otherwise, if automatic
2574 # publication is switched on, default value is used for result name.
2576 # @return New GEOM.GEOM_Object, containing the created wire.
2578 # @ref tui_sketcher_page "Example"
2579 @ManageTransactions("CurvesOp")
2580 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2582 Create a sketcher (wire or face), following the textual description,
2583 passed through theCommand argument.
2584 For format of the description string see geompy.MakeSketcher() method.
2587 theCommand String, defining the sketcher in local
2588 coordinates of the working plane.
2589 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2590 theName Object name; when specified, this parameter is used
2591 for result publication in the study. Otherwise, if automatic
2592 publication is switched on, default value is used for result name.
2595 New GEOM.GEOM_Object, containing the created wire.
2597 theCommand,Parameters = ParseSketcherCommand(theCommand)
2598 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2599 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2600 anObj.SetParameters(Parameters)
2601 self._autoPublish(anObj, theName, "wire")
2604 ## Obtain a 2D sketcher interface
2605 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2606 def Sketcher2D (self):
2608 Obtain a 2D sketcher interface.
2611 sk = geompy.Sketcher2D()
2613 sk.addSegmentRelative(15, 70)
2614 sk.addSegmentPerpY(50)
2615 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2616 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2617 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2619 Sketch_1 = sk.wire(geomObj_1)
2621 sk = Sketcher2D (self)
2624 ## Create a sketcher wire, following the numerical description,
2625 # passed through <VAR>theCoordinates</VAR> argument. \n
2626 # @param theCoordinates double values, defining points to create a wire,
2628 # @param theName Object name; when specified, this parameter is used
2629 # for result publication in the study. Otherwise, if automatic
2630 # publication is switched on, default value is used for result name.
2632 # @return New GEOM.GEOM_Object, containing the created wire.
2634 # @ref tui_3dsketcher_page "Example"
2635 @ManageTransactions("CurvesOp")
2636 def Make3DSketcher(self, theCoordinates, theName=None):
2638 Create a sketcher wire, following the numerical description,
2639 passed through theCoordinates argument.
2642 theCoordinates double values, defining points to create a wire,
2644 theName Object name; when specified, this parameter is used
2645 for result publication in the study. Otherwise, if automatic
2646 publication is switched on, default value is used for result name.
2649 New GEOM_Object, containing the created wire.
2651 theCoordinates,Parameters = ParseParameters(theCoordinates)
2652 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2653 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2654 anObj.SetParameters(Parameters)
2655 self._autoPublish(anObj, theName, "wire")
2658 ## Obtain a 3D sketcher interface
2659 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2661 # @ref tui_3dsketcher_page "Example"
2662 def Sketcher3D (self):
2664 Obtain a 3D sketcher interface.
2667 sk = geompy.Sketcher3D()
2668 sk.addPointsAbsolute(0,0,0, 70,0,0)
2669 sk.addPointsRelative(0, 0, 130)
2670 sk.addPointAnglesLength("OXY", 50, 0, 100)
2671 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2673 a3D_Sketcher_1 = sk.wire()
2675 sk = Sketcher3D (self)
2678 ## Obtain a 2D polyline creation interface
2679 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2681 # @ref tui_3dsketcher_page "Example"
2682 def Polyline2D (self):
2684 Obtain a 2D polyline creation interface.
2687 pl = geompy.Polyline2D()
2688 pl.addSection("section 1", GEOM.Polyline, True)
2689 pl.addPoints(0, 0, 10, 0, 10, 10)
2690 pl.addSection("section 2", GEOM.Interpolation, False)
2691 pl.addPoints(20, 0, 30, 0, 30, 10)
2692 resultObj = pl.result(WorkingPlane)
2694 pl = Polyline2D (self)
2697 # end of l3_sketcher
2700 ## @addtogroup l3_3d_primitives
2703 ## Create a box by coordinates of two opposite vertices.
2705 # @param x1,y1,z1 double values, defining first point it.
2706 # @param x2,y2,z2 double values, defining first point it.
2707 # @param theName Object name; when specified, this parameter is used
2708 # for result publication in the study. Otherwise, if automatic
2709 # publication is switched on, default value is used for result name.
2711 # @return New GEOM.GEOM_Object, containing the created box.
2713 # @ref tui_creation_box "Example"
2714 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2716 Create a box by coordinates of two opposite vertices.
2719 x1,y1,z1 double values, defining first point.
2720 x2,y2,z2 double values, defining second point.
2721 theName Object name; when specified, this parameter is used
2722 for result publication in the study. Otherwise, if automatic
2723 publication is switched on, default value is used for result name.
2726 New GEOM.GEOM_Object, containing the created box.
2728 # Example: see GEOM_TestAll.py
2729 pnt1 = self.MakeVertex(x1,y1,z1)
2730 pnt2 = self.MakeVertex(x2,y2,z2)
2731 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2732 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2734 ## Create a box with specified dimensions along the coordinate axes
2735 # and with edges, parallel to the coordinate axes.
2736 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2737 # @param theDX Length of Box edges, parallel to OX axis.
2738 # @param theDY Length of Box edges, parallel to OY axis.
2739 # @param theDZ Length of Box edges, parallel to OZ axis.
2740 # @param theName Object name; when specified, this parameter is used
2741 # for result publication in the study. Otherwise, if automatic
2742 # publication is switched on, default value is used for result name.
2744 # @return New GEOM.GEOM_Object, containing the created box.
2746 # @ref tui_creation_box "Example"
2747 @ManageTransactions("PrimOp")
2748 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2750 Create a box with specified dimensions along the coordinate axes
2751 and with edges, parallel to the coordinate axes.
2752 Center of the box will be at point (DX/2, DY/2, DZ/2).
2755 theDX Length of Box edges, parallel to OX axis.
2756 theDY Length of Box edges, parallel to OY axis.
2757 theDZ Length of Box edges, parallel to OZ axis.
2758 theName Object name; when specified, this parameter is used
2759 for result publication in the study. Otherwise, if automatic
2760 publication is switched on, default value is used for result name.
2763 New GEOM.GEOM_Object, containing the created box.
2765 # Example: see GEOM_TestAll.py
2766 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2767 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2768 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2769 anObj.SetParameters(Parameters)
2770 self._autoPublish(anObj, theName, "box")
2773 ## Create a box with two specified opposite vertices,
2774 # and with edges, parallel to the coordinate axes
2775 # @param thePnt1 First of two opposite vertices.
2776 # @param thePnt2 Second of two opposite vertices.
2777 # @param theName Object name; when specified, this parameter is used
2778 # for result publication in the study. Otherwise, if automatic
2779 # publication is switched on, default value is used for result name.
2781 # @return New GEOM.GEOM_Object, containing the created box.
2783 # @ref tui_creation_box "Example"
2784 @ManageTransactions("PrimOp")
2785 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2787 Create a box with two specified opposite vertices,
2788 and with edges, parallel to the coordinate axes
2791 thePnt1 First of two opposite vertices.
2792 thePnt2 Second of two opposite vertices.
2793 theName Object name; when specified, this parameter is used
2794 for result publication in the study. Otherwise, if automatic
2795 publication is switched on, default value is used for result name.
2798 New GEOM.GEOM_Object, containing the created box.
2800 # Example: see GEOM_TestAll.py
2801 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2802 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2803 self._autoPublish(anObj, theName, "box")
2806 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2807 # @param theH height of Face.
2808 # @param theW width of Face.
2809 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2810 # @param theName Object name; when specified, this parameter is used
2811 # for result publication in the study. Otherwise, if automatic
2812 # publication is switched on, default value is used for result name.
2814 # @return New GEOM.GEOM_Object, containing the created face.
2816 # @ref tui_creation_face "Example"
2817 @ManageTransactions("PrimOp")
2818 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2820 Create a face with specified dimensions with edges parallel to coordinate axes.
2823 theH height of Face.
2825 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2826 theName Object name; when specified, this parameter is used
2827 for result publication in the study. Otherwise, if automatic
2828 publication is switched on, default value is used for result name.
2831 New GEOM.GEOM_Object, containing the created face.
2833 # Example: see GEOM_TestAll.py
2834 theH,theW,Parameters = ParseParameters(theH, theW)
2835 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2836 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2837 anObj.SetParameters(Parameters)
2838 self._autoPublish(anObj, theName, "rectangle")
2841 ## Create a face from another plane and two sizes,
2842 # vertical size and horisontal size.
2843 # @param theObj Normale vector to the creating face or
2845 # @param theH Height (vertical size).
2846 # @param theW Width (horisontal size).
2847 # @param theName Object name; when specified, this parameter is used
2848 # for result publication in the study. Otherwise, if automatic
2849 # publication is switched on, default value is used for result name.
2851 # @return New GEOM.GEOM_Object, containing the created face.
2853 # @ref tui_creation_face "Example"
2854 @ManageTransactions("PrimOp")
2855 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2857 Create a face from another plane and two sizes,
2858 vertical size and horisontal size.
2861 theObj Normale vector to the creating face or
2863 theH Height (vertical size).
2864 theW Width (horisontal size).
2865 theName Object name; when specified, this parameter is used
2866 for result publication in the study. Otherwise, if automatic
2867 publication is switched on, default value is used for result name.
2870 New GEOM_Object, containing the created face.
2872 # Example: see GEOM_TestAll.py
2873 theH,theW,Parameters = ParseParameters(theH, theW)
2874 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2875 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2876 anObj.SetParameters(Parameters)
2877 self._autoPublish(anObj, theName, "rectangle")
2880 ## Create a disk with given center, normal vector and radius.
2881 # @param thePnt Disk center.
2882 # @param theVec Vector, normal to the plane of the disk.
2883 # @param theR Disk radius.
2884 # @param theName Object name; when specified, this parameter is used
2885 # for result publication in the study. Otherwise, if automatic
2886 # publication is switched on, default value is used for result name.
2888 # @return New GEOM.GEOM_Object, containing the created disk.
2890 # @ref tui_creation_disk "Example"
2891 @ManageTransactions("PrimOp")
2892 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2894 Create a disk with given center, normal vector and radius.
2898 theVec Vector, normal to the plane of the disk.
2900 theName Object name; when specified, this parameter is used
2901 for result publication in the study. Otherwise, if automatic
2902 publication is switched on, default value is used for result name.
2905 New GEOM.GEOM_Object, containing the created disk.
2907 # Example: see GEOM_TestAll.py
2908 theR,Parameters = ParseParameters(theR)
2909 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2910 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2911 anObj.SetParameters(Parameters)
2912 self._autoPublish(anObj, theName, "disk")
2915 ## Create a disk, passing through three given points
2916 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2917 # @param theName Object name; when specified, this parameter is used
2918 # for result publication in the study. Otherwise, if automatic
2919 # publication is switched on, default value is used for result name.
2921 # @return New GEOM.GEOM_Object, containing the created disk.
2923 # @ref tui_creation_disk "Example"
2924 @ManageTransactions("PrimOp")
2925 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2927 Create a disk, passing through three given points
2930 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2931 theName Object name; when specified, this parameter is used
2932 for result publication in the study. Otherwise, if automatic
2933 publication is switched on, default value is used for result name.
2936 New GEOM.GEOM_Object, containing the created disk.
2938 # Example: see GEOM_TestAll.py
2939 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2940 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2941 self._autoPublish(anObj, theName, "disk")
2944 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2945 # @param theR Radius of Face.
2946 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2947 # @param theName Object name; when specified, this parameter is used
2948 # for result publication in the study. Otherwise, if automatic
2949 # publication is switched on, default value is used for result name.
2951 # @return New GEOM.GEOM_Object, containing the created disk.
2953 # @ref tui_creation_face "Example"
2954 @ManageTransactions("PrimOp")
2955 def MakeDiskR(self, theR, theOrientation, theName=None):
2957 Create a disk with specified dimensions along OX-OY coordinate axes.
2960 theR Radius of Face.
2961 theOrientation set the orientation belong axis OXY or OYZ or OZX
2962 theName Object name; when specified, this parameter is used
2963 for result publication in the study. Otherwise, if automatic
2964 publication is switched on, default value is used for result name.
2967 New GEOM.GEOM_Object, containing the created disk.
2970 Disk3 = geompy.MakeDiskR(100., 1)
2972 # Example: see GEOM_TestAll.py
2973 theR,Parameters = ParseParameters(theR)
2974 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2975 RaiseIfFailed("MakeDiskR", self.PrimOp)
2976 anObj.SetParameters(Parameters)
2977 self._autoPublish(anObj, theName, "disk")
2980 ## Create a cylinder with given base point, axis, radius and height.
2981 # @param thePnt Central point of cylinder base.
2982 # @param theAxis Cylinder axis.
2983 # @param theR Cylinder radius.
2984 # @param theH Cylinder height.
2985 # @param theName Object name; when specified, this parameter is used
2986 # for result publication in the study. Otherwise, if automatic
2987 # publication is switched on, default value is used for result name.
2989 # @return New GEOM.GEOM_Object, containing the created cylinder.
2991 # @ref tui_creation_cylinder "Example"
2992 @ManageTransactions("PrimOp")
2993 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2995 Create a cylinder with given base point, axis, radius and height.
2998 thePnt Central point of cylinder base.
2999 theAxis Cylinder axis.
3000 theR Cylinder radius.
3001 theH Cylinder height.
3002 theName Object name; when specified, this parameter is used
3003 for result publication in the study. Otherwise, if automatic
3004 publication is switched on, default value is used for result name.
3007 New GEOM.GEOM_Object, containing the created cylinder.
3009 # Example: see GEOM_TestAll.py
3010 theR,theH,Parameters = ParseParameters(theR, theH)
3011 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3012 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3013 anObj.SetParameters(Parameters)
3014 self._autoPublish(anObj, theName, "cylinder")
3017 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3018 # @param thePnt Central point of cylinder base.
3019 # @param theAxis Cylinder axis.
3020 # @param theR Cylinder radius.
3021 # @param theH Cylinder height.
3022 # @param theA Cylinder angle in radians.
3023 # @param theName Object name; when specified, this parameter is used
3024 # for result publication in the study. Otherwise, if automatic
3025 # publication is switched on, default value is used for result name.
3027 # @return New GEOM.GEOM_Object, containing the created cylinder.
3029 # @ref tui_creation_cylinder "Example"
3030 @ManageTransactions("PrimOp")
3031 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3033 Create a portion of cylinder with given base point, axis, radius, height and angle.
3036 thePnt Central point of cylinder base.
3037 theAxis Cylinder axis.
3038 theR Cylinder radius.
3039 theH Cylinder height.
3040 theA Cylinder angle in radians.
3041 theName Object name; when specified, this parameter is used
3042 for result publication in the study. Otherwise, if automatic
3043 publication is switched on, default value is used for result name.
3046 New GEOM.GEOM_Object, containing the created cylinder.
3048 # Example: see GEOM_TestAll.py
3050 if isinstance(theA,str):
3052 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3054 theA = theA*math.pi/180.
3055 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3056 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3057 anObj.SetParameters(Parameters)
3058 self._autoPublish(anObj, theName, "cylinder")
3061 ## Create a cylinder with given radius and height at
3062 # the origin of coordinate system. Axis of the cylinder
3063 # will be collinear to the OZ axis of the coordinate system.
3064 # @param theR Cylinder radius.
3065 # @param theH Cylinder height.
3066 # @param theName Object name; when specified, this parameter is used
3067 # for result publication in the study. Otherwise, if automatic
3068 # publication is switched on, default value is used for result name.
3070 # @return New GEOM.GEOM_Object, containing the created cylinder.
3072 # @ref tui_creation_cylinder "Example"
3073 @ManageTransactions("PrimOp")
3074 def MakeCylinderRH(self, theR, theH, theName=None):
3076 Create a cylinder with given radius and height at
3077 the origin of coordinate system. Axis of the cylinder
3078 will be collinear to the OZ axis of the coordinate system.
3081 theR Cylinder radius.
3082 theH Cylinder height.
3083 theName Object name; when specified, this parameter is used
3084 for result publication in the study. Otherwise, if automatic
3085 publication is switched on, default value is used for result name.
3088 New GEOM.GEOM_Object, containing the created cylinder.
3090 # Example: see GEOM_TestAll.py
3091 theR,theH,Parameters = ParseParameters(theR, theH)
3092 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3093 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3094 anObj.SetParameters(Parameters)
3095 self._autoPublish(anObj, theName, "cylinder")
3098 ## Create a portion of cylinder with given radius, height and angle at
3099 # the origin of coordinate system. Axis of the cylinder
3100 # will be collinear to the OZ axis of the coordinate system.
3101 # @param theR Cylinder radius.
3102 # @param theH Cylinder height.
3103 # @param theA Cylinder angle in radians.
3104 # @param theName Object name; when specified, this parameter is used
3105 # for result publication in the study. Otherwise, if automatic
3106 # publication is switched on, default value is used for result name.
3108 # @return New GEOM.GEOM_Object, containing the created cylinder.
3110 # @ref tui_creation_cylinder "Example"
3111 @ManageTransactions("PrimOp")
3112 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3114 Create a portion of cylinder with given radius, height and angle at
3115 the origin of coordinate system. Axis of the cylinder
3116 will be collinear to the OZ axis of the coordinate system.
3119 theR Cylinder radius.
3120 theH Cylinder height.
3121 theA Cylinder angle in radians.
3122 theName Object name; when specified, this parameter is used
3123 for result publication in the study. Otherwise, if automatic
3124 publication is switched on, default value is used for result name.
3127 New GEOM.GEOM_Object, containing the created cylinder.
3129 # Example: see GEOM_TestAll.py
3131 if isinstance(theA,str):
3133 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3135 theA = theA*math.pi/180.
3136 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3137 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3138 anObj.SetParameters(Parameters)
3139 self._autoPublish(anObj, theName, "cylinder")
3142 ## Create a sphere with given center and radius.
3143 # @param thePnt Sphere center.
3144 # @param theR Sphere radius.
3145 # @param theName Object name; when specified, this parameter is used
3146 # for result publication in the study. Otherwise, if automatic
3147 # publication is switched on, default value is used for result name.
3149 # @return New GEOM.GEOM_Object, containing the created sphere.
3151 # @ref tui_creation_sphere "Example"
3152 @ManageTransactions("PrimOp")
3153 def MakeSpherePntR(self, thePnt, theR, theName=None):
3155 Create a sphere with given center and radius.
3158 thePnt Sphere center.
3160 theName Object name; when specified, this parameter is used
3161 for result publication in the study. Otherwise, if automatic
3162 publication is switched on, default value is used for result name.
3165 New GEOM.GEOM_Object, containing the created sphere.
3167 # Example: see GEOM_TestAll.py
3168 theR,Parameters = ParseParameters(theR)
3169 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3170 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3171 anObj.SetParameters(Parameters)
3172 self._autoPublish(anObj, theName, "sphere")
3175 ## Create a sphere with given center and radius.
3176 # @param x,y,z Coordinates of sphere center.
3177 # @param theR Sphere radius.
3178 # @param theName Object name; when specified, this parameter is used
3179 # for result publication in the study. Otherwise, if automatic
3180 # publication is switched on, default value is used for result name.
3182 # @return New GEOM.GEOM_Object, containing the created sphere.
3184 # @ref tui_creation_sphere "Example"
3185 def MakeSphere(self, x, y, z, theR, theName=None):
3187 Create a sphere with given center and radius.
3190 x,y,z Coordinates of sphere center.
3192 theName Object name; when specified, this parameter is used
3193 for result publication in the study. Otherwise, if automatic
3194 publication is switched on, default value is used for result name.
3197 New GEOM.GEOM_Object, containing the created sphere.
3199 # Example: see GEOM_TestAll.py
3200 point = self.MakeVertex(x, y, z)
3201 # note: auto-publishing is done in self.MakeSpherePntR()
3202 anObj = self.MakeSpherePntR(point, theR, theName)
3205 ## Create a sphere with given radius at the origin of coordinate system.
3206 # @param theR Sphere radius.
3207 # @param theName Object name; when specified, this parameter is used
3208 # for result publication in the study. Otherwise, if automatic
3209 # publication is switched on, default value is used for result name.
3211 # @return New GEOM.GEOM_Object, containing the created sphere.
3213 # @ref tui_creation_sphere "Example"
3214 @ManageTransactions("PrimOp")
3215 def MakeSphereR(self, theR, theName=None):
3217 Create a sphere with given radius at the origin of coordinate system.
3221 theName Object name; when specified, this parameter is used
3222 for result publication in the study. Otherwise, if automatic
3223 publication is switched on, default value is used for result name.
3226 New GEOM.GEOM_Object, containing the created sphere.
3228 # Example: see GEOM_TestAll.py
3229 theR,Parameters = ParseParameters(theR)
3230 anObj = self.PrimOp.MakeSphereR(theR)
3231 RaiseIfFailed("MakeSphereR", self.PrimOp)
3232 anObj.SetParameters(Parameters)
3233 self._autoPublish(anObj, theName, "sphere")
3236 ## Create a cone with given base point, axis, height and radiuses.
3237 # @param thePnt Central point of the first cone base.
3238 # @param theAxis Cone axis.
3239 # @param theR1 Radius of the first cone base.
3240 # @param theR2 Radius of the second cone base.
3241 # \note If both radiuses are non-zero, the cone will be truncated.
3242 # \note If the radiuses are equal, a cylinder will be created instead.
3243 # @param theH Cone height.
3244 # @param theName Object name; when specified, this parameter is used
3245 # for result publication in the study. Otherwise, if automatic
3246 # publication is switched on, default value is used for result name.
3248 # @return New GEOM.GEOM_Object, containing the created cone.
3250 # @ref tui_creation_cone "Example"
3251 @ManageTransactions("PrimOp")
3252 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3254 Create a cone with given base point, axis, height and radiuses.
3257 thePnt Central point of the first cone base.
3259 theR1 Radius of the first cone base.
3260 theR2 Radius of the second cone base.
3262 theName Object name; when specified, this parameter is used
3263 for result publication in the study. Otherwise, if automatic
3264 publication is switched on, default value is used for result name.
3267 If both radiuses are non-zero, the cone will be truncated.
3268 If the radiuses are equal, a cylinder will be created instead.
3271 New GEOM.GEOM_Object, containing the created cone.
3273 # Example: see GEOM_TestAll.py
3274 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3275 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3276 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3277 anObj.SetParameters(Parameters)
3278 self._autoPublish(anObj, theName, "cone")
3281 ## Create a cone with given height and radiuses at
3282 # the origin of coordinate system. Axis of the cone will
3283 # be collinear to the OZ axis of the coordinate system.
3284 # @param theR1 Radius of the first cone base.
3285 # @param theR2 Radius of the second cone base.
3286 # \note If both radiuses are non-zero, the cone will be truncated.
3287 # \note If the radiuses are equal, a cylinder will be created instead.
3288 # @param theH Cone height.
3289 # @param theName Object name; when specified, this parameter is used
3290 # for result publication in the study. Otherwise, if automatic
3291 # publication is switched on, default value is used for result name.
3293 # @return New GEOM.GEOM_Object, containing the created cone.
3295 # @ref tui_creation_cone "Example"
3296 @ManageTransactions("PrimOp")
3297 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3299 Create a cone with given height and radiuses at
3300 the origin of coordinate system. Axis of the cone will
3301 be collinear to the OZ axis of the coordinate system.
3304 theR1 Radius of the first cone base.
3305 theR2 Radius of the second cone base.
3307 theName Object name; when specified, this parameter is used
3308 for result publication in the study. Otherwise, if automatic
3309 publication is switched on, default value is used for result name.
3312 If both radiuses are non-zero, the cone will be truncated.
3313 If the radiuses are equal, a cylinder will be created instead.
3316 New GEOM.GEOM_Object, containing the created cone.
3318 # Example: see GEOM_TestAll.py
3319 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3320 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3321 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3322 anObj.SetParameters(Parameters)
3323 self._autoPublish(anObj, theName, "cone")
3326 ## Create a torus with given center, normal vector and radiuses.
3327 # @param thePnt Torus central point.
3328 # @param theVec Torus axis of symmetry.
3329 # @param theRMajor Torus major radius.
3330 # @param theRMinor Torus minor radius.
3331 # @param theName Object name; when specified, this parameter is used
3332 # for result publication in the study. Otherwise, if automatic
3333 # publication is switched on, default value is used for result name.
3335 # @return New GEOM.GEOM_Object, containing the created torus.
3337 # @ref tui_creation_torus "Example"
3338 @ManageTransactions("PrimOp")
3339 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3341 Create a torus with given center, normal vector and radiuses.
3344 thePnt Torus central point.
3345 theVec Torus axis of symmetry.
3346 theRMajor Torus major radius.
3347 theRMinor Torus minor radius.
3348 theName Object name; when specified, this parameter is used
3349 for result publication in the study. Otherwise, if automatic
3350 publication is switched on, default value is used for result name.
3353 New GEOM.GEOM_Object, containing the created torus.
3355 # Example: see GEOM_TestAll.py
3356 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3357 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3358 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3359 anObj.SetParameters(Parameters)
3360 self._autoPublish(anObj, theName, "torus")
3363 ## Create a torus with given radiuses at the origin of coordinate system.
3364 # @param theRMajor Torus major radius.
3365 # @param theRMinor Torus minor radius.
3366 # @param theName Object name; when specified, this parameter is used
3367 # for result publication in the study. Otherwise, if automatic
3368 # publication is switched on, default value is used for result name.
3370 # @return New GEOM.GEOM_Object, containing the created torus.
3372 # @ref tui_creation_torus "Example"
3373 @ManageTransactions("PrimOp")
3374 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3376 Create a torus with given radiuses at the origin of coordinate system.
3379 theRMajor Torus major radius.
3380 theRMinor Torus minor radius.
3381 theName Object name; when specified, this parameter is used
3382 for result publication in the study. Otherwise, if automatic
3383 publication is switched on, default value is used for result name.
3386 New GEOM.GEOM_Object, containing the created torus.
3388 # Example: see GEOM_TestAll.py
3389 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3390 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3391 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3392 anObj.SetParameters(Parameters)
3393 self._autoPublish(anObj, theName, "torus")
3396 # end of l3_3d_primitives
3399 ## @addtogroup l3_complex
3402 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3403 # @param theBase Base shape to be extruded.
3404 # @param thePoint1 First end of extrusion vector.
3405 # @param thePoint2 Second end of extrusion vector.
3406 # @param theScaleFactor Use it to make prism with scaled second base.
3407 # Nagative value means not scaled second base.
3408 # @param theName Object name; when specified, this parameter is used
3409 # for result publication in the study. Otherwise, if automatic
3410 # publication is switched on, default value is used for result name.
3412 # @return New GEOM.GEOM_Object, containing the created prism.
3414 # @ref tui_creation_prism "Example"
3415 @ManageTransactions("PrimOp")
3416 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3418 Create a shape by extrusion of the base shape along a vector, defined by two points.
3421 theBase Base shape to be extruded.
3422 thePoint1 First end of extrusion vector.
3423 thePoint2 Second end of extrusion vector.
3424 theScaleFactor Use it to make prism with scaled second base.
3425 Nagative value means not scaled second base.
3426 theName Object name; when specified, this parameter is used
3427 for result publication in the study. Otherwise, if automatic
3428 publication is switched on, default value is used for result name.
3431 New GEOM.GEOM_Object, containing the created prism.
3433 # Example: see GEOM_TestAll.py
3436 if theScaleFactor > 0:
3437 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3438 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3440 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3441 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3442 anObj.SetParameters(Parameters)
3443 self._autoPublish(anObj, theName, "prism")
3446 ## Create a shape by extrusion of the base shape along a
3447 # vector, defined by two points, in 2 Ways (forward/backward).
3448 # @param theBase Base shape to be extruded.
3449 # @param thePoint1 First end of extrusion vector.
3450 # @param thePoint2 Second end of extrusion vector.
3451 # @param theName Object name; when specified, this parameter is used
3452 # for result publication in the study. Otherwise, if automatic
3453 # publication is switched on, default value is used for result name.
3455 # @return New GEOM.GEOM_Object, containing the created prism.
3457 # @ref tui_creation_prism "Example"
3458 @ManageTransactions("PrimOp")
3459 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3461 Create a shape by extrusion of the base shape along a
3462 vector, defined by two points, in 2 Ways (forward/backward).
3465 theBase Base shape to be extruded.
3466 thePoint1 First end of extrusion vector.
3467 thePoint2 Second end of extrusion vector.
3468 theName Object name; when specified, this parameter is used
3469 for result publication in the study. Otherwise, if automatic
3470 publication is switched on, default value is used for result name.
3473 New GEOM.GEOM_Object, containing the created prism.
3475 # Example: see GEOM_TestAll.py
3476 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3477 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3478 self._autoPublish(anObj, theName, "prism")
3481 ## Create a shape by extrusion of the base shape along the vector,
3482 # i.e. all the space, transfixed by the base shape during its translation
3483 # along the vector on the given distance.
3484 # @param theBase Base shape to be extruded.
3485 # @param theVec Direction of extrusion.
3486 # @param theH Prism dimension along theVec.
3487 # @param theScaleFactor Use it to make prism with scaled second base.
3488 # Negative value means not scaled second base.
3489 # @param theName Object name; when specified, this parameter is used
3490 # for result publication in the study. Otherwise, if automatic
3491 # publication is switched on, default value is used for result name.
3493 # @return New GEOM.GEOM_Object, containing the created prism.
3495 # @ref tui_creation_prism "Example"
3496 @ManageTransactions("PrimOp")
3497 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3499 Create a shape by extrusion of the base shape along the vector,
3500 i.e. all the space, transfixed by the base shape during its translation
3501 along the vector on the given distance.
3504 theBase Base shape to be extruded.
3505 theVec Direction of extrusion.
3506 theH Prism dimension along theVec.
3507 theScaleFactor Use it to make prism with scaled second base.
3508 Negative value means not scaled second base.
3509 theName Object name; when specified, this parameter is used
3510 for result publication in the study. Otherwise, if automatic
3511 publication is switched on, default value is used for result name.
3514 New GEOM.GEOM_Object, containing the created prism.
3516 # Example: see GEOM_TestAll.py
3519 if theScaleFactor > 0:
3520 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3521 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3523 theH,Parameters = ParseParameters(theH)
3524 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3525 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3526 anObj.SetParameters(Parameters)
3527 self._autoPublish(anObj, theName, "prism")
3530 ## Create a shape by extrusion of the base shape along the vector,
3531 # i.e. all the space, transfixed by the base shape during its translation
3532 # along the vector on the given distance in 2 Ways (forward/backward).
3533 # @param theBase Base shape to be extruded.
3534 # @param theVec Direction of extrusion.
3535 # @param theH Prism dimension along theVec in forward direction.
3536 # @param theName Object name; when specified, this parameter is used
3537 # for result publication in the study. Otherwise, if automatic
3538 # publication is switched on, default value is used for result name.
3540 # @return New GEOM.GEOM_Object, containing the created prism.
3542 # @ref tui_creation_prism "Example"
3543 @ManageTransactions("PrimOp")
3544 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3546 Create a shape by extrusion of the base shape along the vector,
3547 i.e. all the space, transfixed by the base shape during its translation
3548 along the vector on the given distance in 2 Ways (forward/backward).
3551 theBase Base shape to be extruded.
3552 theVec Direction of extrusion.
3553 theH Prism dimension along theVec in forward direction.
3554 theName Object name; when specified, this parameter is used
3555 for result publication in the study. Otherwise, if automatic
3556 publication is switched on, default value is used for result name.
3559 New GEOM.GEOM_Object, containing the created prism.
3561 # Example: see GEOM_TestAll.py
3562 theH,Parameters = ParseParameters(theH)
3563 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3564 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3565 anObj.SetParameters(Parameters)
3566 self._autoPublish(anObj, theName, "prism")
3569 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3570 # @param theBase Base shape to be extruded.
3571 # @param theDX, theDY, theDZ Directions of extrusion.
3572 # @param theScaleFactor Use it to make prism with scaled second base.
3573 # Nagative value means not scaled second base.
3574 # @param theName Object name; when specified, this parameter is used
3575 # for result publication in the study. Otherwise, if automatic
3576 # publication is switched on, default value is used for result name.
3578 # @return New GEOM.GEOM_Object, containing the created prism.
3580 # @ref tui_creation_prism "Example"
3581 @ManageTransactions("PrimOp")
3582 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3584 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3587 theBase Base shape to be extruded.
3588 theDX, theDY, theDZ Directions of extrusion.
3589 theScaleFactor Use it to make prism with scaled second base.
3590 Nagative value means not scaled second base.
3591 theName Object name; when specified, this parameter is used
3592 for result publication in the study. Otherwise, if automatic
3593 publication is switched on, default value is used for result name.
3596 New GEOM.GEOM_Object, containing the created prism.
3598 # Example: see GEOM_TestAll.py
3601 if theScaleFactor > 0:
3602 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3603 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3605 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3606 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3607 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3608 anObj.SetParameters(Parameters)
3609 self._autoPublish(anObj, theName, "prism")
3612 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3613 # i.e. all the space, transfixed by the base shape during its translation
3614 # along the vector on the given distance in 2 Ways (forward/backward).
3615 # @param theBase Base shape to be extruded.
3616 # @param theDX, theDY, theDZ Directions of extrusion.
3617 # @param theName Object name; when specified, this parameter is used
3618 # for result publication in the study. Otherwise, if automatic
3619 # publication is switched on, default value is used for result name.
3621 # @return New GEOM.GEOM_Object, containing the created prism.
3623 # @ref tui_creation_prism "Example"
3624 @ManageTransactions("PrimOp")
3625 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3627 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3628 i.e. all the space, transfixed by the base shape during its translation
3629 along the vector on the given distance in 2 Ways (forward/backward).
3632 theBase Base shape to be extruded.
3633 theDX, theDY, theDZ Directions of extrusion.
3634 theName Object name; when specified, this parameter is used
3635 for result publication in the study. Otherwise, if automatic
3636 publication is switched on, default value is used for result name.
3639 New GEOM.GEOM_Object, containing the created prism.
3641 # Example: see GEOM_TestAll.py
3642 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3643 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3644 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3645 anObj.SetParameters(Parameters)
3646 self._autoPublish(anObj, theName, "prism")
3649 ## Create a shape by revolution of the base shape around the axis
3650 # on the given angle, i.e. all the space, transfixed by the base
3651 # shape during its rotation around the axis on the given angle.
3652 # @param theBase Base shape to be rotated.
3653 # @param theAxis Rotation axis.
3654 # @param theAngle Rotation angle in radians.
3655 # @param theName Object name; when specified, this parameter is used
3656 # for result publication in the study. Otherwise, if automatic
3657 # publication is switched on, default value is used for result name.
3659 # @return New GEOM.GEOM_Object, containing the created revolution.
3661 # @ref tui_creation_revolution "Example"
3662 @ManageTransactions("PrimOp")
3663 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3665 Create a shape by revolution of the base shape around the axis
3666 on the given angle, i.e. all the space, transfixed by the base
3667 shape during its rotation around the axis on the given angle.
3670 theBase Base shape to be rotated.
3671 theAxis Rotation axis.
3672 theAngle Rotation angle in radians.
3673 theName Object name; when specified, this parameter is used
3674 for result publication in the study. Otherwise, if automatic
3675 publication is switched on, default value is used for result name.
3678 New GEOM.GEOM_Object, containing the created revolution.
3680 # Example: see GEOM_TestAll.py
3681 theAngle,Parameters = ParseParameters(theAngle)
3682 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3683 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3684 anObj.SetParameters(Parameters)
3685 self._autoPublish(anObj, theName, "revolution")
3688 ## Create a shape by revolution of the base shape around the axis
3689 # on the given angle, i.e. all the space, transfixed by the base
3690 # shape during its rotation around the axis on the given angle in
3691 # both directions (forward/backward)
3692 # @param theBase Base shape to be rotated.
3693 # @param theAxis Rotation axis.
3694 # @param theAngle Rotation angle in radians.
3695 # @param theName Object name; when specified, this parameter is used
3696 # for result publication in the study. Otherwise, if automatic
3697 # publication is switched on, default value is used for result name.
3699 # @return New GEOM.GEOM_Object, containing the created revolution.
3701 # @ref tui_creation_revolution "Example"
3702 @ManageTransactions("PrimOp")
3703 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3705 Create a shape by revolution of the base shape around the axis
3706 on the given angle, i.e. all the space, transfixed by the base
3707 shape during its rotation around the axis on the given angle in
3708 both directions (forward/backward).
3711 theBase Base shape to be rotated.
3712 theAxis Rotation axis.
3713 theAngle Rotation angle in radians.
3714 theName Object name; when specified, this parameter is used
3715 for result publication in the study. Otherwise, if automatic
3716 publication is switched on, default value is used for result name.
3719 New GEOM.GEOM_Object, containing the created revolution.
3721 theAngle,Parameters = ParseParameters(theAngle)
3722 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3723 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3724 anObj.SetParameters(Parameters)
3725 self._autoPublish(anObj, theName, "revolution")
3728 ## Create a filling from the given compound of contours.
3729 # @param theShape the compound of contours
3730 # @param theMinDeg a minimal degree of BSpline surface to create
3731 # @param theMaxDeg a maximal degree of BSpline surface to create
3732 # @param theTol2D a 2d tolerance to be reached
3733 # @param theTol3D a 3d tolerance to be reached
3734 # @param theNbIter a number of iteration of approximation algorithm
3735 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3736 # @param isApprox if True, BSpline curves are generated in the process
3737 # of surface construction. By default it is False, that means
3738 # the surface is created using given curves. The usage of
3739 # Approximation makes the algorithm work slower, but allows
3740 # building the surface for rather complex cases.
3741 # @param theName Object name; when specified, this parameter is used
3742 # for result publication in the study. Otherwise, if automatic
3743 # publication is switched on, default value is used for result name.
3745 # @return New GEOM.GEOM_Object, containing the created filling surface.
3747 # @ref tui_creation_filling "Example"
3748 @ManageTransactions("PrimOp")
3749 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3750 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3752 Create a filling from the given compound of contours.
3755 theShape the compound of contours
3756 theMinDeg a minimal degree of BSpline surface to create
3757 theMaxDeg a maximal degree of BSpline surface to create
3758 theTol2D a 2d tolerance to be reached
3759 theTol3D a 3d tolerance to be reached
3760 theNbIter a number of iteration of approximation algorithm
3761 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3762 isApprox if True, BSpline curves are generated in the process
3763 of surface construction. By default it is False, that means
3764 the surface is created using given curves. The usage of
3765 Approximation makes the algorithm work slower, but allows
3766 building the surface for rather complex cases
3767 theName Object name; when specified, this parameter is used
3768 for result publication in the study. Otherwise, if automatic
3769 publication is switched on, default value is used for result name.
3772 New GEOM.GEOM_Object, containing the created filling surface.
3775 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3777 # Example: see GEOM_TestAll.py
3778 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3779 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3780 theTol2D, theTol3D, theNbIter,
3781 theMethod, isApprox)
3782 RaiseIfFailed("MakeFilling", self.PrimOp)
3783 anObj.SetParameters(Parameters)
3784 self._autoPublish(anObj, theName, "filling")
3788 ## Create a filling from the given compound of contours.
3789 # This method corresponds to MakeFilling with isApprox=True
3790 # @param theShape the compound of contours
3791 # @param theMinDeg a minimal degree of BSpline surface to create
3792 # @param theMaxDeg a maximal degree of BSpline surface to create
3793 # @param theTol3D a 3d tolerance to be reached
3794 # @param theName Object name; when specified, this parameter is used
3795 # for result publication in the study. Otherwise, if automatic
3796 # publication is switched on, default value is used for result name.
3798 # @return New GEOM.GEOM_Object, containing the created filling surface.
3800 # @ref tui_creation_filling "Example"
3801 @ManageTransactions("PrimOp")
3802 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3804 Create a filling from the given compound of contours.
3805 This method corresponds to MakeFilling with isApprox=True
3808 theShape the compound of contours
3809 theMinDeg a minimal degree of BSpline surface to create
3810 theMaxDeg a maximal degree of BSpline surface to create
3811 theTol3D a 3d tolerance to be reached
3812 theName Object name; when specified, this parameter is used
3813 for result publication in the study. Otherwise, if automatic
3814 publication is switched on, default value is used for result name.
3817 New GEOM.GEOM_Object, containing the created filling surface.
3820 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3822 # Example: see GEOM_TestAll.py
3823 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3824 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3825 0, theTol3D, 0, GEOM.FOM_Default, True)
3826 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3827 anObj.SetParameters(Parameters)
3828 self._autoPublish(anObj, theName, "filling")
3831 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3832 # @param theSeqSections - set of specified sections.
3833 # @param theModeSolid - mode defining building solid or shell
3834 # @param thePreci - precision 3D used for smoothing
3835 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3836 # @param theName Object name; when specified, this parameter is used
3837 # for result publication in the study. Otherwise, if automatic
3838 # publication is switched on, default value is used for result name.
3840 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3842 # @ref swig_todo "Example"
3843 @ManageTransactions("PrimOp")
3844 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3846 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3849 theSeqSections - set of specified sections.
3850 theModeSolid - mode defining building solid or shell
3851 thePreci - precision 3D used for smoothing
3852 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3853 theName Object name; when specified, this parameter is used
3854 for result publication in the study. Otherwise, if automatic
3855 publication is switched on, default value is used for result name.
3858 New GEOM.GEOM_Object, containing the created shell or solid.
3860 # Example: see GEOM_TestAll.py
3861 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3862 RaiseIfFailed("MakeThruSections", self.PrimOp)
3863 self._autoPublish(anObj, theName, "filling")
3866 ## Create a shape by extrusion of the base shape along
3867 # the path shape. The path shape can be a wire or an edge.
3868 # @param theBase Base shape to be extruded.
3869 # @param thePath Path shape to extrude the base shape along it.
3870 # @param theName Object name; when specified, this parameter is used
3871 # for result publication in the study. Otherwise, if automatic
3872 # publication is switched on, default value is used for result name.
3874 # @return New GEOM.GEOM_Object, containing the created pipe.
3876 # @ref tui_creation_pipe "Example"
3877 @ManageTransactions("PrimOp")
3878 def MakePipe(self, theBase, thePath, theName=None):
3880 Create a shape by extrusion of the base shape along
3881 the path shape. The path shape can be a wire or an edge.
3884 theBase Base shape to be extruded.
3885 thePath Path shape to extrude the base shape along it.
3886 theName Object name; when specified, this parameter is used
3887 for result publication in the study. Otherwise, if automatic
3888 publication is switched on, default value is used for result name.
3891 New GEOM.GEOM_Object, containing the created pipe.
3893 # Example: see GEOM_TestAll.py
3894 anObj = self.PrimOp.MakePipe(theBase, thePath)
3895 RaiseIfFailed("MakePipe", self.PrimOp)
3896 self._autoPublish(anObj, theName, "pipe")
3899 ## Create a shape by extrusion of the profile shape along
3900 # the path shape. The path shape can be a wire or an edge.
3901 # the several profiles can be specified in the several locations of path.
3902 # @param theSeqBases - list of Bases shape to be extruded.
3903 # @param theLocations - list of locations on the path corresponding
3904 # specified list of the Bases shapes. Number of locations
3905 # should be equal to number of bases or list of locations can be empty.
3906 # @param thePath - Path shape to extrude the base shape along it.
3907 # @param theWithContact - the mode defining that the section is translated to be in
3908 # contact with the spine.
3909 # @param theWithCorrection - defining that the section is rotated to be
3910 # orthogonal to the spine tangent in the correspondent point
3911 # @param theName Object name; when specified, this parameter is used
3912 # for result publication in the study. Otherwise, if automatic
3913 # publication is switched on, default value is used for result name.
3915 # @return New GEOM.GEOM_Object, containing the created pipe.
3917 # @ref tui_creation_pipe_with_diff_sec "Example"
3918 @ManageTransactions("PrimOp")
3919 def MakePipeWithDifferentSections(self, theSeqBases,
3920 theLocations, thePath,
3921 theWithContact, theWithCorrection, theName=None):
3923 Create a shape by extrusion of the profile shape along
3924 the path shape. The path shape can be a wire or an edge.
3925 the several profiles can be specified in the several locations of path.
3928 theSeqBases - list of Bases shape to be extruded.
3929 theLocations - list of locations on the path corresponding
3930 specified list of the Bases shapes. Number of locations
3931 should be equal to number of bases or list of locations can be empty.
3932 thePath - Path shape to extrude the base shape along it.
3933 theWithContact - the mode defining that the section is translated to be in
3934 contact with the spine(0/1)
3935 theWithCorrection - defining that the section is rotated to be
3936 orthogonal to the spine tangent in the correspondent point (0/1)
3937 theName Object name; when specified, this parameter is used
3938 for result publication in the study. Otherwise, if automatic
3939 publication is switched on, default value is used for result name.
3942 New GEOM.GEOM_Object, containing the created pipe.
3944 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3945 theLocations, thePath,
3946 theWithContact, theWithCorrection)
3947 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3948 self._autoPublish(anObj, theName, "pipe")
3951 ## Create a shape by extrusion of the profile shape along
3952 # the path shape. The path shape can be a wire or a edge.
3953 # the several profiles can be specified in the several locations of path.
3954 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3955 # shell or face. If number of faces in neighbour sections
3956 # aren't coincided result solid between such sections will
3957 # be created using external boundaries of this shells.
3958 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3959 # This list is used for searching correspondences between
3960 # faces in the sections. Size of this list must be equal
3961 # to size of list of base shapes.
3962 # @param theLocations - list of locations on the path corresponding
3963 # specified list of the Bases shapes. Number of locations
3964 # should be equal to number of bases. First and last
3965 # locations must be coincided with first and last vertexes
3966 # of path correspondingly.
3967 # @param thePath - Path shape to extrude the base shape along it.
3968 # @param theWithContact - the mode defining that the section is translated to be in
3969 # contact with the spine.
3970 # @param theWithCorrection - defining that the section is rotated to be
3971 # orthogonal to the spine tangent in the correspondent point
3972 # @param theName Object name; when specified, this parameter is used
3973 # for result publication in the study. Otherwise, if automatic
3974 # publication is switched on, default value is used for result name.
3976 # @return New GEOM.GEOM_Object, containing the created solids.
3978 # @ref tui_creation_pipe_with_shell_sec "Example"
3979 @ManageTransactions("PrimOp")
3980 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3981 theLocations, thePath,
3982 theWithContact, theWithCorrection, theName=None):
3984 Create a shape by extrusion of the profile shape along
3985 the path shape. The path shape can be a wire or a edge.
3986 the several profiles can be specified in the several locations of path.
3989 theSeqBases - list of Bases shape to be extruded. Base shape must be
3990 shell or face. If number of faces in neighbour sections
3991 aren't coincided result solid between such sections will
3992 be created using external boundaries of this shells.
3993 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3994 This list is used for searching correspondences between
3995 faces in the sections. Size of this list must be equal
3996 to size of list of base shapes.
3997 theLocations - list of locations on the path corresponding
3998 specified list of the Bases shapes. Number of locations
3999 should be equal to number of bases. First and last
4000 locations must be coincided with first and last vertexes
4001 of path correspondingly.
4002 thePath - Path shape to extrude the base shape along it.
4003 theWithContact - the mode defining that the section is translated to be in
4004 contact with the spine (0/1)
4005 theWithCorrection - defining that the section is rotated to be
4006 orthogonal to the spine tangent in the correspondent point (0/1)
4007 theName Object name; when specified, this parameter is used
4008 for result publication in the study. Otherwise, if automatic
4009 publication is switched on, default value is used for result name.
4012 New GEOM.GEOM_Object, containing the created solids.
4014 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4015 theLocations, thePath,
4016 theWithContact, theWithCorrection)
4017 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4018 self._autoPublish(anObj, theName, "pipe")
4021 ## Create a shape by extrusion of the profile shape along
4022 # the path shape. This function is used only for debug pipe
4023 # functionality - it is a version of function MakePipeWithShellSections()
4024 # which give a possibility to recieve information about
4025 # creating pipe between each pair of sections step by step.
4026 @ManageTransactions("PrimOp")
4027 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4028 theLocations, thePath,
4029 theWithContact, theWithCorrection, theName=None):
4031 Create a shape by extrusion of the profile shape along
4032 the path shape. This function is used only for debug pipe
4033 functionality - it is a version of previous function
4034 geompy.MakePipeWithShellSections() which give a possibility to
4035 recieve information about creating pipe between each pair of
4036 sections step by step.
4039 nbsect = len(theSeqBases)
4040 nbsubsect = len(theSeqSubBases)
4041 #print "nbsect = ",nbsect
4042 for i in range(1,nbsect):
4044 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4045 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4047 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4048 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4049 tmpLocations, thePath,
4050 theWithContact, theWithCorrection)
4051 if self.PrimOp.IsDone() == 0:
4052 print "Problems with pipe creation between ",i," and ",i+1," sections"
4053 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4056 print "Pipe between ",i," and ",i+1," sections is OK"
4061 resc = self.MakeCompound(res)
4062 #resc = self.MakeSewing(res, 0.001)
4063 #print "resc: ",resc
4064 self._autoPublish(resc, theName, "pipe")
4067 ## Create solids between given sections
4068 # @param theSeqBases - list of sections (shell or face).
4069 # @param theLocations - list of corresponding vertexes
4070 # @param theName Object name; when specified, this parameter is used
4071 # for result publication in the study. Otherwise, if automatic
4072 # publication is switched on, default value is used for result name.
4074 # @return New GEOM.GEOM_Object, containing the created solids.
4076 # @ref tui_creation_pipe_without_path "Example"
4077 @ManageTransactions("PrimOp")
4078 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
4080 Create solids between given sections
4083 theSeqBases - list of sections (shell or face).
4084 theLocations - list of corresponding vertexes
4085 theName Object name; when specified, this parameter is used
4086 for result publication in the study. Otherwise, if automatic
4087 publication is switched on, default value is used for result name.
4090 New GEOM.GEOM_Object, containing the created solids.
4092 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4093 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4094 self._autoPublish(anObj, theName, "pipe")
4097 ## Create a shape by extrusion of the base shape along
4098 # the path shape with constant bi-normal direction along the given vector.
4099 # The path shape can be a wire or an edge.
4100 # @param theBase Base shape to be extruded.
4101 # @param thePath Path shape to extrude the base shape along it.
4102 # @param theVec Vector defines a constant binormal direction to keep the
4103 # same angle beetween the direction and the sections
4104 # along the sweep surface.
4105 # @param theName Object name; when specified, this parameter is used
4106 # for result publication in the study. Otherwise, if automatic
4107 # publication is switched on, default value is used for result name.
4109 # @return New GEOM.GEOM_Object, containing the created pipe.
4111 # @ref tui_creation_pipe "Example"
4112 @ManageTransactions("PrimOp")
4113 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4115 Create a shape by extrusion of the base shape along
4116 the path shape with constant bi-normal direction along the given vector.
4117 The path shape can be a wire or an edge.
4120 theBase Base shape to be extruded.
4121 thePath Path shape to extrude the base shape along it.
4122 theVec Vector defines a constant binormal direction to keep the
4123 same angle beetween the direction and the sections
4124 along the sweep surface.
4125 theName Object name; when specified, this parameter is used
4126 for result publication in the study. Otherwise, if automatic
4127 publication is switched on, default value is used for result name.
4130 New GEOM.GEOM_Object, containing the created pipe.
4132 # Example: see GEOM_TestAll.py
4133 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4134 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4135 self._autoPublish(anObj, theName, "pipe")
4138 ## Makes a thick solid from a face or a shell
4139 # @param theShape Face or Shell to be thicken
4140 # @param theThickness Thickness of the resulting solid
4141 # @param theName Object name; when specified, this parameter is used
4142 # for result publication in the study. Otherwise, if automatic
4143 # publication is switched on, default value is used for result name.
4145 # @return New GEOM.GEOM_Object, containing the created solid
4147 @ManageTransactions("PrimOp")
4148 def MakeThickSolid(self, theShape, theThickness, theName=None):
4150 Make a thick solid from a face or a shell
4153 theShape Face or Shell to be thicken
4154 theThickness Thickness of the resulting solid
4155 theName Object name; when specified, this parameter is used
4156 for result publication in the study. Otherwise, if automatic
4157 publication is switched on, default value is used for result name.
4160 New GEOM.GEOM_Object, containing the created solid
4162 # Example: see GEOM_TestAll.py
4163 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4164 RaiseIfFailed("MakeThickening", self.PrimOp)
4165 self._autoPublish(anObj, theName, "pipe")
4169 ## Modifies a face or a shell to make it a thick solid
4170 # @param theShape Face or Shell to be thicken
4171 # @param theThickness Thickness of the resulting solid
4173 # @return The modified shape
4175 @ManageTransactions("PrimOp")
4176 def Thicken(self, theShape, theThickness):
4178 Modifies a face or a shell to make it a thick solid
4181 theBase Base shape to be extruded.
4182 thePath Path shape to extrude the base shape along it.
4183 theName Object name; when specified, this parameter is used
4184 for result publication in the study. Otherwise, if automatic
4185 publication is switched on, default value is used for result name.
4190 # Example: see GEOM_TestAll.py
4191 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4192 RaiseIfFailed("MakeThickening", self.PrimOp)
4195 ## Build a middle path of a pipe-like shape.
4196 # The path shape can be a wire or an edge.
4197 # @param theShape It can be closed or unclosed pipe-like shell
4198 # or a pipe-like solid.
4199 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4200 # should be wires or faces of theShape.
4201 # @param theName Object name; when specified, this parameter is used
4202 # for result publication in the study. Otherwise, if automatic
4203 # publication is switched on, default value is used for result name.
4205 # @note It is not assumed that exact or approximate copy of theShape
4206 # can be obtained by applying existing Pipe operation on the
4207 # resulting "Path" wire taking theBase1 as the base - it is not
4208 # always possible; though in some particular cases it might work
4209 # it is not guaranteed. Thus, RestorePath function should not be
4210 # considered as an exact reverse operation of the Pipe.
4212 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4213 # source pipe's "path".
4215 # @ref tui_creation_pipe_path "Example"
4216 @ManageTransactions("PrimOp")
4217 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4219 Build a middle path of a pipe-like shape.
4220 The path shape can be a wire or an edge.
4223 theShape It can be closed or unclosed pipe-like shell
4224 or a pipe-like solid.
4225 theBase1, theBase2 Two bases of the supposed pipe. This
4226 should be wires or faces of theShape.
4227 theName Object name; when specified, this parameter is used
4228 for result publication in the study. Otherwise, if automatic
4229 publication is switched on, default value is used for result name.
4232 New GEOM_Object, containing an edge or wire that represent
4235 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4236 RaiseIfFailed("RestorePath", self.PrimOp)
4237 self._autoPublish(anObj, theName, "path")
4240 ## Build a middle path of a pipe-like shape.
4241 # The path shape can be a wire or an edge.
4242 # @param theShape It can be closed or unclosed pipe-like shell
4243 # or a pipe-like solid.
4244 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4245 # should be lists of edges of theShape.
4246 # @param theName Object name; when specified, this parameter is used
4247 # for result publication in the study. Otherwise, if automatic
4248 # publication is switched on, default value is used for result name.
4250 # @note It is not assumed that exact or approximate copy of theShape
4251 # can be obtained by applying existing Pipe operation on the
4252 # resulting "Path" wire taking theBase1 as the base - it is not
4253 # always possible; though in some particular cases it might work
4254 # it is not guaranteed. Thus, RestorePath function should not be
4255 # considered as an exact reverse operation of the Pipe.
4257 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4258 # source pipe's "path".
4260 # @ref tui_creation_pipe_path "Example"
4261 @ManageTransactions("PrimOp")
4262 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4264 Build a middle path of a pipe-like shape.
4265 The path shape can be a wire or an edge.
4268 theShape It can be closed or unclosed pipe-like shell
4269 or a pipe-like solid.
4270 listEdges1, listEdges2 Two bases of the supposed pipe. This
4271 should be lists of edges of theShape.
4272 theName Object name; when specified, this parameter is used
4273 for result publication in the study. Otherwise, if automatic
4274 publication is switched on, default value is used for result name.
4277 New GEOM_Object, containing an edge or wire that represent
4280 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4281 RaiseIfFailed("RestorePath", self.PrimOp)
4282 self._autoPublish(anObj, theName, "path")
4288 ## @addtogroup l3_advanced
4291 ## Create a linear edge with specified ends.
4292 # @param thePnt1 Point for the first end of edge.
4293 # @param thePnt2 Point for the second end of edge.
4294 # @param theName Object name; when specified, this parameter is used
4295 # for result publication in the study. Otherwise, if automatic
4296 # publication is switched on, default value is used for result name.
4298 # @return New GEOM.GEOM_Object, containing the created edge.
4300 # @ref tui_creation_edge "Example"
4301 @ManageTransactions("ShapesOp")
4302 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4304 Create a linear edge with specified ends.
4307 thePnt1 Point for the first end of edge.
4308 thePnt2 Point for the second end of edge.
4309 theName Object name; when specified, this parameter is used
4310 for result publication in the study. Otherwise, if automatic
4311 publication is switched on, default value is used for result name.
4314 New GEOM.GEOM_Object, containing the created edge.
4316 # Example: see GEOM_TestAll.py
4317 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4318 RaiseIfFailed("MakeEdge", self.ShapesOp)
4319 self._autoPublish(anObj, theName, "edge")
4322 ## Create a new edge, corresponding to the given length on the given curve.
4323 # @param theRefCurve The referenced curve (edge).
4324 # @param theLength Length on the referenced curve. It can be negative.
4325 # @param theStartPoint Any point can be selected for it, the new edge will begin
4326 # at the end of \a theRefCurve, close to the selected point.
4327 # If None, start from the first point of \a theRefCurve.
4328 # @param theName Object name; when specified, this parameter is used
4329 # for result publication in the study. Otherwise, if automatic
4330 # publication is switched on, default value is used for result name.
4332 # @return New GEOM.GEOM_Object, containing the created edge.
4334 # @ref tui_creation_edge "Example"
4335 @ManageTransactions("ShapesOp")
4336 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4338 Create a new edge, corresponding to the given length on the given curve.
4341 theRefCurve The referenced curve (edge).
4342 theLength Length on the referenced curve. It can be negative.
4343 theStartPoint Any point can be selected for it, the new edge will begin
4344 at the end of theRefCurve, close to the selected point.
4345 If None, start from the first point of theRefCurve.
4346 theName Object name; when specified, this parameter is used
4347 for result publication in the study. Otherwise, if automatic
4348 publication is switched on, default value is used for result name.
4351 New GEOM.GEOM_Object, containing the created edge.
4353 # Example: see GEOM_TestAll.py
4354 theLength, Parameters = ParseParameters(theLength)
4355 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4356 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4357 anObj.SetParameters(Parameters)
4358 self._autoPublish(anObj, theName, "edge")
4361 ## Create an edge from specified wire.
4362 # @param theWire source Wire
4363 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4364 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4365 # @param theName Object name; when specified, this parameter is used
4366 # for result publication in the study. Otherwise, if automatic
4367 # publication is switched on, default value is used for result name.
4369 # @return New GEOM.GEOM_Object, containing the created edge.
4371 # @ref tui_creation_edge "Example"
4372 @ManageTransactions("ShapesOp")
4373 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4375 Create an edge from specified wire.
4379 theLinearTolerance linear tolerance value (default = 1e-07)
4380 theAngularTolerance angular tolerance value (default = 1e-12)
4381 theName Object name; when specified, this parameter is used
4382 for result publication in the study. Otherwise, if automatic
4383 publication is switched on, default value is used for result name.
4386 New GEOM.GEOM_Object, containing the created edge.
4388 # Example: see GEOM_TestAll.py
4389 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4390 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4391 self._autoPublish(anObj, theName, "edge")
4394 ## Create a wire from the set of edges and wires.
4395 # @param theEdgesAndWires List of edges and/or wires.
4396 # @param theTolerance Maximum distance between vertices, that will be merged.
4397 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4398 # @param theName Object name; when specified, this parameter is used
4399 # for result publication in the study. Otherwise, if automatic
4400 # publication is switched on, default value is used for result name.
4402 # @return New GEOM.GEOM_Object, containing the created wire.
4404 # @ref tui_creation_wire "Example"
4405 @ManageTransactions("ShapesOp")
4406 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4408 Create a wire from the set of edges and wires.
4411 theEdgesAndWires List of edges and/or wires.
4412 theTolerance Maximum distance between vertices, that will be merged.
4413 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4414 theName Object name; when specified, this parameter is used
4415 for result publication in the study. Otherwise, if automatic
4416 publication is switched on, default value is used for result name.
4419 New GEOM.GEOM_Object, containing the created wire.
4421 # Example: see GEOM_TestAll.py
4422 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4423 RaiseIfFailed("MakeWire", self.ShapesOp)
4424 self._autoPublish(anObj, theName, "wire")
4427 ## Create a face on the given wire.
4428 # @param theWire closed Wire or Edge to build the face on.
4429 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4430 # If the tolerance of the obtained planar face is less
4431 # than 1e-06, this face will be returned, otherwise the
4432 # algorithm tries to build any suitable face on the given
4433 # wire and prints a warning message.
4434 # @param theName Object name; when specified, this parameter is used
4435 # for result publication in the study. Otherwise, if automatic
4436 # publication is switched on, default value is used for result name.
4438 # @return New GEOM.GEOM_Object, containing the created face.
4440 # @ref tui_creation_face "Example"
4441 @ManageTransactions("ShapesOp")
4442 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4444 Create a face on the given wire.
4447 theWire closed Wire or Edge to build the face on.
4448 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4449 If the tolerance of the obtained planar face is less
4450 than 1e-06, this face will be returned, otherwise the
4451 algorithm tries to build any suitable face on the given
4452 wire and prints a warning message.
4453 theName Object name; when specified, this parameter is used
4454 for result publication in the study. Otherwise, if automatic
4455 publication is switched on, default value is used for result name.
4458 New GEOM.GEOM_Object, containing the created face.
4460 # Example: see GEOM_TestAll.py
4461 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4462 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4463 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4465 RaiseIfFailed("MakeFace", self.ShapesOp)
4466 self._autoPublish(anObj, theName, "face")
4469 ## Create a face on the given wires set.
4470 # @param theWires List of closed wires or edges to build the face on.
4471 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4472 # If the tolerance of the obtained planar face is less
4473 # than 1e-06, this face will be returned, otherwise the
4474 # algorithm tries to build any suitable face on the given
4475 # wire and prints a warning message.
4476 # @param theName Object name; when specified, this parameter is used
4477 # for result publication in the study. Otherwise, if automatic
4478 # publication is switched on, default value is used for result name.
4480 # @return New GEOM.GEOM_Object, containing the created face.
4482 # @ref tui_creation_face "Example"
4483 @ManageTransactions("ShapesOp")
4484 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4486 Create a face on the given wires set.
4489 theWires List of closed wires or edges to build the face on.
4490 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4491 If the tolerance of the obtained planar face is less
4492 than 1e-06, this face will be returned, otherwise the
4493 algorithm tries to build any suitable face on the given
4494 wire and prints a warning message.
4495 theName Object name; when specified, this parameter is used
4496 for result publication in the study. Otherwise, if automatic
4497 publication is switched on, default value is used for result name.
4500 New GEOM.GEOM_Object, containing the created face.
4502 # Example: see GEOM_TestAll.py
4503 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4504 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4505 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4507 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4508 self._autoPublish(anObj, theName, "face")
4511 ## See MakeFaceWires() method for details.
4513 # @ref tui_creation_face "Example 1"
4514 # \n @ref swig_MakeFaces "Example 2"
4515 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4517 See geompy.MakeFaceWires() method for details.
4519 # Example: see GEOM_TestOthers.py
4520 # note: auto-publishing is done in self.MakeFaceWires()
4521 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4524 ## Create a shell from the set of faces and shells.
4525 # @param theFacesAndShells List of faces and/or shells.
4526 # @param theName Object name; when specified, this parameter is used
4527 # for result publication in the study. Otherwise, if automatic
4528 # publication is switched on, default value is used for result name.
4530 # @return New GEOM.GEOM_Object, containing the created shell.
4532 # @ref tui_creation_shell "Example"
4533 @ManageTransactions("ShapesOp")
4534 def MakeShell(self, theFacesAndShells, theName=None):
4536 Create a shell from the set of faces and shells.
4539 theFacesAndShells List of faces and/or shells.
4540 theName Object name; when specified, this parameter is used
4541 for result publication in the study. Otherwise, if automatic
4542 publication is switched on, default value is used for result name.
4545 New GEOM.GEOM_Object, containing the created shell.
4547 # Example: see GEOM_TestAll.py
4548 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4549 RaiseIfFailed("MakeShell", self.ShapesOp)
4550 self._autoPublish(anObj, theName, "shell")
4553 ## Create a solid, bounded by the given shells.
4554 # @param theShells Sequence of bounding shells.
4555 # @param theName Object name; when specified, this parameter is used
4556 # for result publication in the study. Otherwise, if automatic
4557 # publication is switched on, default value is used for result name.
4559 # @return New GEOM.GEOM_Object, containing the created solid.
4561 # @ref tui_creation_solid "Example"
4562 @ManageTransactions("ShapesOp")
4563 def MakeSolid(self, theShells, theName=None):
4565 Create a solid, bounded by the given shells.
4568 theShells Sequence of bounding shells.
4569 theName Object name; when specified, this parameter is used
4570 for result publication in the study. Otherwise, if automatic
4571 publication is switched on, default value is used for result name.
4574 New GEOM.GEOM_Object, containing the created solid.
4576 # Example: see GEOM_TestAll.py
4577 if len(theShells) == 1:
4578 descr = self._IsGoodForSolid(theShells[0])
4580 # raise RuntimeError, "MakeSolidShells : " + descr
4581 if descr == "WRN_SHAPE_UNCLOSED":
4582 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4583 anObj = self.ShapesOp.MakeSolidShells(theShells)
4584 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4585 self._autoPublish(anObj, theName, "solid")
4588 ## Create a compound of the given shapes.
4589 # @param theShapes List of shapes to put in compound.
4590 # @param theName Object name; when specified, this parameter is used
4591 # for result publication in the study. Otherwise, if automatic
4592 # publication is switched on, default value is used for result name.
4594 # @return New GEOM.GEOM_Object, containing the created compound.
4596 # @ref tui_creation_compound "Example"
4597 @ManageTransactions("ShapesOp")
4598 def MakeCompound(self, theShapes, theName=None):
4600 Create a compound of the given shapes.
4603 theShapes List of shapes to put in compound.
4604 theName Object name; when specified, this parameter is used
4605 for result publication in the study. Otherwise, if automatic
4606 publication is switched on, default value is used for result name.
4609 New GEOM.GEOM_Object, containing the created compound.
4611 # Example: see GEOM_TestAll.py
4612 anObj = self.ShapesOp.MakeCompound(theShapes)
4613 RaiseIfFailed("MakeCompound", self.ShapesOp)
4614 self._autoPublish(anObj, theName, "compound")
4617 # end of l3_advanced
4620 ## @addtogroup l2_measure
4623 ## Gives quantity of faces in the given shape.
4624 # @param theShape Shape to count faces of.
4625 # @return Quantity of faces.
4627 # @ref swig_NumberOf "Example"
4628 @ManageTransactions("ShapesOp")
4629 def NumberOfFaces(self, theShape):
4631 Gives quantity of faces in the given shape.
4634 theShape Shape to count faces of.
4639 # Example: see GEOM_TestOthers.py
4640 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4641 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4644 ## Gives quantity of edges in the given shape.
4645 # @param theShape Shape to count edges of.
4646 # @return Quantity of edges.
4648 # @ref swig_NumberOf "Example"
4649 @ManageTransactions("ShapesOp")
4650 def NumberOfEdges(self, theShape):
4652 Gives quantity of edges in the given shape.
4655 theShape Shape to count edges of.
4660 # Example: see GEOM_TestOthers.py
4661 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4662 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4665 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4666 # @param theShape Shape to count sub-shapes of.
4667 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4668 # @return Quantity of sub-shapes of given type.
4670 # @ref swig_NumberOf "Example"
4671 @ManageTransactions("ShapesOp")
4672 def NumberOfSubShapes(self, theShape, theShapeType):
4674 Gives quantity of sub-shapes of type theShapeType in the given shape.
4677 theShape Shape to count sub-shapes of.
4678 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4681 Quantity of sub-shapes of given type.
4683 # Example: see GEOM_TestOthers.py
4684 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4685 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4688 ## Gives quantity of solids in the given shape.
4689 # @param theShape Shape to count solids in.
4690 # @return Quantity of solids.
4692 # @ref swig_NumberOf "Example"
4693 @ManageTransactions("ShapesOp")
4694 def NumberOfSolids(self, theShape):
4696 Gives quantity of solids in the given shape.
4699 theShape Shape to count solids in.
4704 # Example: see GEOM_TestOthers.py
4705 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4706 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4712 ## @addtogroup l3_healing
4715 ## Reverses an orientation the given shape.
4716 # @param theShape Shape to be reversed.
4717 # @param theName Object name; when specified, this parameter is used
4718 # for result publication in the study. Otherwise, if automatic
4719 # publication is switched on, default value is used for result name.
4721 # @return The reversed copy of theShape.
4723 # @ref swig_ChangeOrientation "Example"
4724 @ManageTransactions("ShapesOp")
4725 def ChangeOrientation(self, theShape, theName=None):
4727 Reverses an orientation the given shape.
4730 theShape Shape to be reversed.
4731 theName Object name; when specified, this parameter is used
4732 for result publication in the study. Otherwise, if automatic
4733 publication is switched on, default value is used for result name.
4736 The reversed copy of theShape.
4738 # Example: see GEOM_TestAll.py
4739 anObj = self.ShapesOp.ChangeOrientation(theShape)
4740 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4741 self._autoPublish(anObj, theName, "reversed")
4744 ## See ChangeOrientation() method for details.
4746 # @ref swig_OrientationChange "Example"
4747 def OrientationChange(self, theShape, theName=None):
4749 See geompy.ChangeOrientation method for details.
4751 # Example: see GEOM_TestOthers.py
4752 # note: auto-publishing is done in self.ChangeOrientation()
4753 anObj = self.ChangeOrientation(theShape, theName)
4759 ## @addtogroup l4_obtain
4762 ## Retrieve all free faces from the given shape.
4763 # Free face is a face, which is not shared between two shells of the shape.
4764 # @param theShape Shape to find free faces in.
4765 # @return List of IDs of all free faces, contained in theShape.
4767 # @ref tui_measurement_tools_page "Example"
4768 @ManageTransactions("ShapesOp")
4769 def GetFreeFacesIDs(self,theShape):
4771 Retrieve all free faces from the given shape.
4772 Free face is a face, which is not shared between two shells of the shape.
4775 theShape Shape to find free faces in.
4778 List of IDs of all free faces, contained in theShape.
4780 # Example: see GEOM_TestOthers.py
4781 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4782 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4785 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4786 # @param theShape1 Shape to find sub-shapes in.
4787 # @param theShape2 Shape to find shared sub-shapes with.
4788 # @param theShapeType Type of sub-shapes to be retrieved.
4789 # @param theName Object name; when specified, this parameter is used
4790 # for result publication in the study. Otherwise, if automatic
4791 # publication is switched on, default value is used for result name.
4793 # @return List of sub-shapes of theShape1, shared with theShape2.
4795 # @ref swig_GetSharedShapes "Example"
4796 @ManageTransactions("ShapesOp")
4797 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4799 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4802 theShape1 Shape to find sub-shapes in.
4803 theShape2 Shape to find shared sub-shapes with.
4804 theShapeType Type of sub-shapes to be retrieved.
4805 theName Object name; when specified, this parameter is used
4806 for result publication in the study. Otherwise, if automatic
4807 publication is switched on, default value is used for result name.
4810 List of sub-shapes of theShape1, shared with theShape2.
4812 # Example: see GEOM_TestOthers.py
4813 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4814 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4815 self._autoPublish(aList, theName, "shared")
4818 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4819 # @param theShapes Shapes to find common sub-shapes of.
4820 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4821 # @param theName Object name; when specified, this parameter is used
4822 # for result publication in the study. Otherwise, if automatic
4823 # publication is switched on, default value is used for result name.
4825 # @return List of objects, that are sub-shapes of all given shapes.
4827 # @ref swig_GetSharedShapes "Example"
4828 @ManageTransactions("ShapesOp")
4829 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4831 Get all sub-shapes, shared by all shapes in the list theShapes.
4834 theShapes Shapes to find common sub-shapes of.
4835 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4836 theName Object name; when specified, this parameter is used
4837 for result publication in the study. Otherwise, if automatic
4838 publication is switched on, default value is used for result name.
4841 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4843 # Example: see GEOM_TestOthers.py
4844 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4845 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4846 self._autoPublish(aList, theName, "shared")
4849 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4850 # situated relatively the specified plane by the certain way,
4851 # defined through <VAR>theState</VAR> parameter.
4852 # @param theShape Shape to find sub-shapes of.
4853 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4854 # @param theAx1 Vector (or line, or linear edge), specifying normal
4855 # direction and location of the plane to find shapes on.
4856 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4857 # @param theName Object name; when specified, this parameter is used
4858 # for result publication in the study. Otherwise, if automatic
4859 # publication is switched on, default value is used for result name.
4861 # @return List of all found sub-shapes.
4863 # @ref swig_GetShapesOnPlane "Example"
4864 @ManageTransactions("ShapesOp")
4865 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4867 Find in theShape all sub-shapes of type theShapeType,
4868 situated relatively the specified plane by the certain way,
4869 defined through theState parameter.
4872 theShape Shape to find sub-shapes of.
4873 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4874 theAx1 Vector (or line, or linear edge), specifying normal
4875 direction and location of the plane to find shapes on.
4876 theState The state of the sub-shapes to find (see GEOM::shape_state)
4877 theName Object name; when specified, this parameter is used
4878 for result publication in the study. Otherwise, if automatic
4879 publication is switched on, default value is used for result name.
4882 List of all found sub-shapes.
4884 # Example: see GEOM_TestOthers.py
4885 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4886 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4887 self._autoPublish(aList, theName, "shapeOnPlane")
4890 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4891 # situated relatively the specified plane by the certain way,
4892 # defined through <VAR>theState</VAR> parameter.
4893 # @param theShape Shape to find sub-shapes of.
4894 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4895 # @param theAx1 Vector (or line, or linear edge), specifying normal
4896 # direction and location of the plane to find shapes on.
4897 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4899 # @return List of all found sub-shapes indices.
4901 # @ref swig_GetShapesOnPlaneIDs "Example"
4902 @ManageTransactions("ShapesOp")
4903 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4905 Find in theShape all sub-shapes of type theShapeType,
4906 situated relatively the specified plane by the certain way,
4907 defined through theState parameter.
4910 theShape Shape to find sub-shapes of.
4911 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4912 theAx1 Vector (or line, or linear edge), specifying normal
4913 direction and location of the plane to find shapes on.
4914 theState The state of the sub-shapes to find (see GEOM::shape_state)
4917 List of all found sub-shapes indices.
4919 # Example: see GEOM_TestOthers.py
4920 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4921 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4924 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4925 # situated relatively the specified plane by the certain way,
4926 # defined through <VAR>theState</VAR> parameter.
4927 # @param theShape Shape to find sub-shapes of.
4928 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4929 # @param theAx1 Vector (or line, or linear edge), specifying normal
4930 # direction of the plane to find shapes on.
4931 # @param thePnt Point specifying location of the plane to find shapes on.
4932 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4933 # @param theName Object name; when specified, this parameter is used
4934 # for result publication in the study. Otherwise, if automatic
4935 # publication is switched on, default value is used for result name.
4937 # @return List of all found sub-shapes.
4939 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4940 @ManageTransactions("ShapesOp")
4941 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4943 Find in theShape all sub-shapes of type theShapeType,
4944 situated relatively the specified plane by the certain way,
4945 defined through theState parameter.
4948 theShape Shape to find sub-shapes of.
4949 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4950 theAx1 Vector (or line, or linear edge), specifying normal
4951 direction and location of the plane to find shapes on.
4952 thePnt Point specifying location of the plane to find shapes on.
4953 theState The state of the sub-shapes to find (see GEOM::shape_state)
4954 theName Object name; when specified, this parameter is used
4955 for result publication in the study. Otherwise, if automatic
4956 publication is switched on, default value is used for result name.
4959 List of all found sub-shapes.
4961 # Example: see GEOM_TestOthers.py
4962 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4963 theAx1, thePnt, theState)
4964 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4965 self._autoPublish(aList, theName, "shapeOnPlane")
4968 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4969 # situated relatively the specified plane by the certain way,
4970 # defined through <VAR>theState</VAR> parameter.
4971 # @param theShape Shape to find sub-shapes of.
4972 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4973 # @param theAx1 Vector (or line, or linear edge), specifying normal
4974 # direction of the plane to find shapes on.
4975 # @param thePnt Point specifying location of the plane to find shapes on.
4976 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4978 # @return List of all found sub-shapes indices.
4980 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4981 @ManageTransactions("ShapesOp")
4982 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4984 Find in theShape all sub-shapes of type theShapeType,
4985 situated relatively the specified plane by the certain way,
4986 defined through theState parameter.
4989 theShape Shape to find sub-shapes of.
4990 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4991 theAx1 Vector (or line, or linear edge), specifying normal
4992 direction and location of the plane to find shapes on.
4993 thePnt Point specifying location of the plane to find shapes on.
4994 theState The state of the sub-shapes to find (see GEOM::shape_state)
4997 List of all found sub-shapes indices.
4999 # Example: see GEOM_TestOthers.py
5000 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5001 theAx1, thePnt, theState)
5002 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5005 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5006 # the specified cylinder by the certain way, defined through \a theState parameter.
5007 # @param theShape Shape to find sub-shapes of.
5008 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5009 # @param theAxis Vector (or line, or linear edge), specifying
5010 # axis of the cylinder to find shapes on.
5011 # @param theRadius Radius of the cylinder to find shapes on.
5012 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5013 # @param theName Object name; when specified, this parameter is used
5014 # for result publication in the study. Otherwise, if automatic
5015 # publication is switched on, default value is used for result name.
5017 # @return List of all found sub-shapes.
5019 # @ref swig_GetShapesOnCylinder "Example"
5020 @ManageTransactions("ShapesOp")
5021 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5023 Find in theShape all sub-shapes of type theShapeType, situated relatively
5024 the specified cylinder by the certain way, defined through theState parameter.
5027 theShape Shape to find sub-shapes of.
5028 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5029 theAxis Vector (or line, or linear edge), specifying
5030 axis of the cylinder to find shapes on.
5031 theRadius Radius of the cylinder to find shapes on.
5032 theState The state of the sub-shapes to find (see GEOM::shape_state)
5033 theName Object name; when specified, this parameter is used
5034 for result publication in the study. Otherwise, if automatic
5035 publication is switched on, default value is used for result name.
5038 List of all found sub-shapes.
5040 # Example: see GEOM_TestOthers.py
5041 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5042 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5043 self._autoPublish(aList, theName, "shapeOnCylinder")
5046 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5047 # the specified cylinder by the certain way, defined through \a theState parameter.
5048 # @param theShape Shape to find sub-shapes of.
5049 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5050 # @param theAxis Vector (or line, or linear edge), specifying
5051 # axis of the cylinder to find shapes on.
5052 # @param theRadius Radius of the cylinder to find shapes on.
5053 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5055 # @return List of all found sub-shapes indices.
5057 # @ref swig_GetShapesOnCylinderIDs "Example"
5058 @ManageTransactions("ShapesOp")
5059 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5061 Find in theShape all sub-shapes of type theShapeType, situated relatively
5062 the specified cylinder by the certain way, defined through theState parameter.
5065 theShape Shape to find sub-shapes of.
5066 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5067 theAxis Vector (or line, or linear edge), specifying
5068 axis of the cylinder to find shapes on.
5069 theRadius Radius of the cylinder to find shapes on.
5070 theState The state of the sub-shapes to find (see GEOM::shape_state)
5073 List of all found sub-shapes indices.
5075 # Example: see GEOM_TestOthers.py
5076 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5077 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5080 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5081 # the specified cylinder by the certain way, defined through \a theState parameter.
5082 # @param theShape Shape to find sub-shapes of.
5083 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5084 # @param theAxis Vector (or line, or linear edge), specifying
5085 # axis of the cylinder to find shapes on.
5086 # @param thePnt Point specifying location of the bottom of the cylinder.
5087 # @param theRadius Radius of the cylinder to find shapes on.
5088 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5089 # @param theName Object name; when specified, this parameter is used
5090 # for result publication in the study. Otherwise, if automatic
5091 # publication is switched on, default value is used for result name.
5093 # @return List of all found sub-shapes.
5095 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5096 @ManageTransactions("ShapesOp")
5097 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5099 Find in theShape all sub-shapes of type theShapeType, situated relatively
5100 the specified cylinder by the certain way, defined through theState parameter.
5103 theShape Shape to find sub-shapes of.
5104 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5105 theAxis Vector (or line, or linear edge), specifying
5106 axis of the cylinder to find shapes on.
5107 theRadius Radius of the cylinder to find shapes on.
5108 theState The state of the sub-shapes to find (see GEOM::shape_state)
5109 theName Object name; when specified, this parameter is used
5110 for result publication in the study. Otherwise, if automatic
5111 publication is switched on, default value is used for result name.
5114 List of all found sub-shapes.
5116 # Example: see GEOM_TestOthers.py
5117 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5118 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5119 self._autoPublish(aList, theName, "shapeOnCylinder")
5122 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5123 # the specified cylinder by the certain way, defined through \a theState parameter.
5124 # @param theShape Shape to find sub-shapes of.
5125 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5126 # @param theAxis Vector (or line, or linear edge), specifying
5127 # axis of the cylinder to find shapes on.
5128 # @param thePnt Point specifying location of the bottom of the cylinder.
5129 # @param theRadius Radius of the cylinder to find shapes on.
5130 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5132 # @return List of all found sub-shapes indices
5134 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5135 @ManageTransactions("ShapesOp")
5136 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5138 Find in theShape all sub-shapes of type theShapeType, situated relatively
5139 the specified cylinder by the certain way, defined through theState parameter.
5142 theShape Shape to find sub-shapes of.
5143 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5144 theAxis Vector (or line, or linear edge), specifying
5145 axis of the cylinder to find shapes on.
5146 theRadius Radius of the cylinder to find shapes on.
5147 theState The state of the sub-shapes to find (see GEOM::shape_state)
5150 List of all found sub-shapes indices.
5152 # Example: see GEOM_TestOthers.py
5153 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5154 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5157 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5158 # the specified sphere by the certain way, defined through \a theState parameter.
5159 # @param theShape Shape to find sub-shapes of.
5160 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5161 # @param theCenter Point, specifying center of the sphere to find shapes on.
5162 # @param theRadius Radius of the sphere to find shapes on.
5163 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5164 # @param theName Object name; when specified, this parameter is used
5165 # for result publication in the study. Otherwise, if automatic
5166 # publication is switched on, default value is used for result name.
5168 # @return List of all found sub-shapes.
5170 # @ref swig_GetShapesOnSphere "Example"
5171 @ManageTransactions("ShapesOp")
5172 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5174 Find in theShape all sub-shapes of type theShapeType, situated relatively
5175 the specified sphere by the certain way, defined through theState parameter.
5178 theShape Shape to find sub-shapes of.
5179 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5180 theCenter Point, specifying center of the sphere to find shapes on.
5181 theRadius Radius of the sphere to find shapes on.
5182 theState The state of the sub-shapes to find (see GEOM::shape_state)
5183 theName Object name; when specified, this parameter is used
5184 for result publication in the study. Otherwise, if automatic
5185 publication is switched on, default value is used for result name.
5188 List of all found sub-shapes.
5190 # Example: see GEOM_TestOthers.py
5191 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5192 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5193 self._autoPublish(aList, theName, "shapeOnSphere")
5196 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5197 # the specified sphere by the certain way, defined through \a theState parameter.
5198 # @param theShape Shape to find sub-shapes of.
5199 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5200 # @param theCenter Point, specifying center of the sphere to find shapes on.
5201 # @param theRadius Radius of the sphere to find shapes on.
5202 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5204 # @return List of all found sub-shapes indices.
5206 # @ref swig_GetShapesOnSphereIDs "Example"
5207 @ManageTransactions("ShapesOp")
5208 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5210 Find in theShape all sub-shapes of type theShapeType, situated relatively
5211 the specified sphere by the certain way, defined through theState parameter.
5214 theShape Shape to find sub-shapes of.
5215 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5216 theCenter Point, specifying center of the sphere to find shapes on.
5217 theRadius Radius of the sphere to find shapes on.
5218 theState The state of the sub-shapes to find (see GEOM::shape_state)
5221 List of all found sub-shapes indices.
5223 # Example: see GEOM_TestOthers.py
5224 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5225 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5228 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5229 # the specified quadrangle by the certain way, defined through \a theState parameter.
5230 # @param theShape Shape to find sub-shapes of.
5231 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5232 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5233 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5234 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5235 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5236 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5237 # @param theName Object name; when specified, this parameter is used
5238 # for result publication in the study. Otherwise, if automatic
5239 # publication is switched on, default value is used for result name.
5241 # @return List of all found sub-shapes.
5243 # @ref swig_GetShapesOnQuadrangle "Example"
5244 @ManageTransactions("ShapesOp")
5245 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5246 theTopLeftPoint, theTopRigthPoint,
5247 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5249 Find in theShape all sub-shapes of type theShapeType, situated relatively
5250 the specified quadrangle by the certain way, defined through theState parameter.
5253 theShape Shape to find sub-shapes of.
5254 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5255 theTopLeftPoint Point, specifying top left corner of a quadrangle
5256 theTopRigthPoint Point, specifying top right corner of a quadrangle
5257 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5258 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5259 theState The state of the sub-shapes to find (see GEOM::shape_state)
5260 theName Object name; when specified, this parameter is used
5261 for result publication in the study. Otherwise, if automatic
5262 publication is switched on, default value is used for result name.
5265 List of all found sub-shapes.
5267 # Example: see GEOM_TestOthers.py
5268 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5269 theTopLeftPoint, theTopRigthPoint,
5270 theBottomLeftPoint, theBottomRigthPoint, theState)
5271 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5272 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5275 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5276 # the specified quadrangle by the certain way, defined through \a theState parameter.
5277 # @param theShape Shape to find sub-shapes of.
5278 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5279 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5280 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5281 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5282 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5283 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5285 # @return List of all found sub-shapes indices.
5287 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5288 @ManageTransactions("ShapesOp")
5289 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5290 theTopLeftPoint, theTopRigthPoint,
5291 theBottomLeftPoint, theBottomRigthPoint, theState):
5293 Find in theShape all sub-shapes of type theShapeType, situated relatively
5294 the specified quadrangle by the certain way, defined through theState parameter.
5297 theShape Shape to find sub-shapes of.
5298 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5299 theTopLeftPoint Point, specifying top left corner of a quadrangle
5300 theTopRigthPoint Point, specifying top right corner of a quadrangle
5301 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5302 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5303 theState The state of the sub-shapes to find (see GEOM::shape_state)
5306 List of all found sub-shapes indices.
5309 # Example: see GEOM_TestOthers.py
5310 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5311 theTopLeftPoint, theTopRigthPoint,
5312 theBottomLeftPoint, theBottomRigthPoint, theState)
5313 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5316 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5317 # the specified \a theBox by the certain way, defined through \a theState parameter.
5318 # @param theBox Shape for relative comparing.
5319 # @param theShape Shape to find sub-shapes of.
5320 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5321 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5322 # @param theName Object name; when specified, this parameter is used
5323 # for result publication in the study. Otherwise, if automatic
5324 # publication is switched on, default value is used for result name.
5326 # @return List of all found sub-shapes.
5328 # @ref swig_GetShapesOnBox "Example"
5329 @ManageTransactions("ShapesOp")
5330 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5332 Find in theShape all sub-shapes of type theShapeType, situated relatively
5333 the specified theBox by the certain way, defined through theState parameter.
5336 theBox Shape for relative comparing.
5337 theShape Shape to find sub-shapes of.
5338 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5339 theState The state of the sub-shapes to find (see GEOM::shape_state)
5340 theName Object name; when specified, this parameter is used
5341 for result publication in the study. Otherwise, if automatic
5342 publication is switched on, default value is used for result name.
5345 List of all found sub-shapes.
5347 # Example: see GEOM_TestOthers.py
5348 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5349 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5350 self._autoPublish(aList, theName, "shapeOnBox")
5353 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5354 # the specified \a theBox by the certain way, defined through \a theState parameter.
5355 # @param theBox Shape for relative comparing.
5356 # @param theShape Shape to find sub-shapes of.
5357 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5358 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5360 # @return List of all found sub-shapes indices.
5362 # @ref swig_GetShapesOnBoxIDs "Example"
5363 @ManageTransactions("ShapesOp")
5364 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5366 Find in theShape all sub-shapes of type theShapeType, situated relatively
5367 the specified theBox by the certain way, defined through theState parameter.
5370 theBox Shape for relative comparing.
5371 theShape Shape to find sub-shapes of.
5372 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5373 theState The state of the sub-shapes to find (see GEOM::shape_state)
5376 List of all found sub-shapes indices.
5378 # Example: see GEOM_TestOthers.py
5379 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5380 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5383 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5384 # situated relatively the specified \a theCheckShape by the
5385 # certain way, defined through \a theState parameter.
5386 # @param theCheckShape Shape for relative comparing. It must be a solid.
5387 # @param theShape Shape to find sub-shapes of.
5388 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5389 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5390 # @param theName Object name; when specified, this parameter is used
5391 # for result publication in the study. Otherwise, if automatic
5392 # publication is switched on, default value is used for result name.
5394 # @return List of all found sub-shapes.
5396 # @ref swig_GetShapesOnShape "Example"
5397 @ManageTransactions("ShapesOp")
5398 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5400 Find in theShape all sub-shapes of type theShapeType,
5401 situated relatively the specified theCheckShape by the
5402 certain way, defined through theState parameter.
5405 theCheckShape Shape for relative comparing. It must be a solid.
5406 theShape Shape to find sub-shapes of.
5407 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5408 theState The state of the sub-shapes to find (see GEOM::shape_state)
5409 theName Object name; when specified, this parameter is used
5410 for result publication in the study. Otherwise, if automatic
5411 publication is switched on, default value is used for result name.
5414 List of all found sub-shapes.
5416 # Example: see GEOM_TestOthers.py
5417 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5418 theShapeType, theState)
5419 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5420 self._autoPublish(aList, theName, "shapeOnShape")
5423 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5424 # situated relatively the specified \a theCheckShape by the
5425 # certain way, defined through \a theState parameter.
5426 # @param theCheckShape Shape for relative comparing. It must be a solid.
5427 # @param theShape Shape to find sub-shapes of.
5428 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5429 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5430 # @param theName Object name; when specified, this parameter is used
5431 # for result publication in the study. Otherwise, if automatic
5432 # publication is switched on, default value is used for result name.
5434 # @return All found sub-shapes as compound.
5436 # @ref swig_GetShapesOnShapeAsCompound "Example"
5437 @ManageTransactions("ShapesOp")
5438 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5440 Find in theShape all sub-shapes of type theShapeType,
5441 situated relatively the specified theCheckShape by the
5442 certain way, defined through theState parameter.
5445 theCheckShape Shape for relative comparing. It must be a solid.
5446 theShape Shape to find sub-shapes of.
5447 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5448 theState The state of the sub-shapes to find (see GEOM::shape_state)
5449 theName Object name; when specified, this parameter is used
5450 for result publication in the study. Otherwise, if automatic
5451 publication is switched on, default value is used for result name.
5454 All found sub-shapes as compound.
5456 # Example: see GEOM_TestOthers.py
5457 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5458 theShapeType, theState)
5459 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5460 self._autoPublish(anObj, theName, "shapeOnShape")
5463 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5464 # situated relatively the specified \a theCheckShape by the
5465 # certain way, defined through \a theState parameter.
5466 # @param theCheckShape Shape for relative comparing. It must be a solid.
5467 # @param theShape Shape to find sub-shapes of.
5468 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5469 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5471 # @return List of all found sub-shapes indices.
5473 # @ref swig_GetShapesOnShapeIDs "Example"
5474 @ManageTransactions("ShapesOp")
5475 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5477 Find in theShape all sub-shapes of type theShapeType,
5478 situated relatively the specified theCheckShape by the
5479 certain way, defined through theState parameter.
5482 theCheckShape Shape for relative comparing. It must be a solid.
5483 theShape Shape to find sub-shapes of.
5484 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5485 theState The state of the sub-shapes to find (see GEOM::shape_state)
5488 List of all found sub-shapes indices.
5490 # Example: see GEOM_TestOthers.py
5491 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5492 theShapeType, theState)
5493 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5496 ## Get sub-shape(s) of theShapeWhere, which are
5497 # coincident with \a theShapeWhat or could be a part of it.
5498 # @param theShapeWhere Shape to find sub-shapes of.
5499 # @param theShapeWhat Shape, specifying what to find.
5500 # @param isNewImplementation implementation of GetInPlace functionality
5501 # (default = False, old alghorithm based on shape properties)
5502 # @param theName Object name; when specified, this parameter is used
5503 # for result publication in the study. Otherwise, if automatic
5504 # publication is switched on, default value is used for result name.
5506 # @return Group of all found sub-shapes or a single found sub-shape.
5508 # @note This function has a restriction on argument shapes.
5509 # If \a theShapeWhere has curved parts with significantly
5510 # outstanding centres (i.e. the mass centre of a part is closer to
5511 # \a theShapeWhat than to the part), such parts will not be found.
5512 # @image html get_in_place_lost_part.png
5514 # @ref swig_GetInPlace "Example"
5515 @ManageTransactions("ShapesOp")
5516 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5518 Get sub-shape(s) of theShapeWhere, which are
5519 coincident with theShapeWhat or could be a part of it.
5522 theShapeWhere Shape to find sub-shapes of.
5523 theShapeWhat Shape, specifying what to find.
5524 isNewImplementation Implementation of GetInPlace functionality
5525 (default = False, old alghorithm based on shape properties)
5526 theName Object name; when specified, this parameter is used
5527 for result publication in the study. Otherwise, if automatic
5528 publication is switched on, default value is used for result name.
5531 Group of all found sub-shapes or a single found sub-shape.
5535 This function has a restriction on argument shapes.
5536 If theShapeWhere has curved parts with significantly
5537 outstanding centres (i.e. the mass centre of a part is closer to
5538 theShapeWhat than to the part), such parts will not be found.
5540 # Example: see GEOM_TestOthers.py
5542 if isNewImplementation:
5543 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5545 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5547 RaiseIfFailed("GetInPlace", self.ShapesOp)
5548 self._autoPublish(anObj, theName, "inplace")
5551 ## Get sub-shape(s) of \a theShapeWhere, which are
5552 # coincident with \a theShapeWhat or could be a part of it.
5554 # Implementation of this method is based on a saved history of an operation,
5555 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5556 # arguments (an argument shape or a sub-shape of an argument shape).
5557 # The operation could be the Partition or one of boolean operations,
5558 # performed on simple shapes (not on compounds).
5560 # @param theShapeWhere Shape to find sub-shapes of.
5561 # @param theShapeWhat Shape, specifying what to find (must be in the
5562 # building history of the ShapeWhere).
5563 # @param theName Object name; when specified, this parameter is used
5564 # for result publication in the study. Otherwise, if automatic
5565 # publication is switched on, default value is used for result name.
5567 # @return Group of all found sub-shapes or a single found sub-shape.
5569 # @ref swig_GetInPlace "Example"
5570 @ManageTransactions("ShapesOp")
5571 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5573 Implementation of this method is based on a saved history of an operation,
5574 produced theShapeWhere. The theShapeWhat must be among this operation's
5575 arguments (an argument shape or a sub-shape of an argument shape).
5576 The operation could be the Partition or one of boolean operations,
5577 performed on simple shapes (not on compounds).
5580 theShapeWhere Shape to find sub-shapes of.
5581 theShapeWhat Shape, specifying what to find (must be in the
5582 building history of the ShapeWhere).
5583 theName Object name; when specified, this parameter is used
5584 for result publication in the study. Otherwise, if automatic
5585 publication is switched on, default value is used for result name.
5588 Group of all found sub-shapes or a single found sub-shape.
5590 # Example: see GEOM_TestOthers.py
5591 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5592 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5593 self._autoPublish(anObj, theName, "inplace")
5596 ## Get sub-shape of theShapeWhere, which is
5597 # equal to \a theShapeWhat.
5598 # @param theShapeWhere Shape to find sub-shape of.
5599 # @param theShapeWhat Shape, specifying what to find.
5600 # @param theName Object name; when specified, this parameter is used
5601 # for result publication in the study. Otherwise, if automatic
5602 # publication is switched on, default value is used for result name.
5604 # @return New GEOM.GEOM_Object for found sub-shape.
5606 # @ref swig_GetSame "Example"
5607 @ManageTransactions("ShapesOp")
5608 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5610 Get sub-shape of theShapeWhere, which is
5611 equal to theShapeWhat.
5614 theShapeWhere Shape to find sub-shape of.
5615 theShapeWhat Shape, specifying what to find.
5616 theName Object name; when specified, this parameter is used
5617 for result publication in the study. Otherwise, if automatic
5618 publication is switched on, default value is used for result name.
5621 New GEOM.GEOM_Object for found sub-shape.
5623 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5624 RaiseIfFailed("GetSame", self.ShapesOp)
5625 self._autoPublish(anObj, theName, "sameShape")
5629 ## Get sub-shape indices of theShapeWhere, which is
5630 # equal to \a theShapeWhat.
5631 # @param theShapeWhere Shape to find sub-shape of.
5632 # @param theShapeWhat Shape, specifying what to find.
5633 # @return List of all found sub-shapes indices.
5635 # @ref swig_GetSame "Example"
5636 @ManageTransactions("ShapesOp")
5637 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5639 Get sub-shape indices of theShapeWhere, which is
5640 equal to theShapeWhat.
5643 theShapeWhere Shape to find sub-shape of.
5644 theShapeWhat Shape, specifying what to find.
5647 List of all found sub-shapes indices.
5649 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5650 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5657 ## @addtogroup l4_access
5660 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5661 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5662 # @param aShape Shape to get sub-shape of.
5663 # @param ListOfID List of sub-shapes indices.
5664 # @param theName Object name; when specified, this parameter is used
5665 # for result publication in the study. Otherwise, if automatic
5666 # publication is switched on, default value is used for result name.
5668 # @return Found sub-shape.
5670 # @ref swig_all_decompose "Example"
5671 def GetSubShape(self, aShape, ListOfID, theName=None):
5673 Obtain a composite sub-shape of aShape, composed from sub-shapes
5674 of aShape, selected by their unique IDs inside aShape
5677 aShape Shape to get sub-shape of.
5678 ListOfID List of sub-shapes indices.
5679 theName Object name; when specified, this parameter is used
5680 for result publication in the study. Otherwise, if automatic
5681 publication is switched on, default value is used for result name.
5686 # Example: see GEOM_TestAll.py
5687 anObj = self.AddSubShape(aShape,ListOfID)
5688 self._autoPublish(anObj, theName, "subshape")
5691 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5692 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5693 # @param aShape Shape to get sub-shape of.
5694 # @param aSubShape Sub-shapes of aShape.
5695 # @return ID of found sub-shape.
5697 # @ref swig_all_decompose "Example"
5698 @ManageTransactions("LocalOp")
5699 def GetSubShapeID(self, aShape, aSubShape):
5701 Obtain unique ID of sub-shape aSubShape inside aShape
5702 of aShape, selected by their unique IDs inside aShape
5705 aShape Shape to get sub-shape of.
5706 aSubShape Sub-shapes of aShape.
5709 ID of found sub-shape.
5711 # Example: see GEOM_TestAll.py
5712 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5713 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5716 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5717 # This function is provided for performance purpose. The complexity is O(n) with n
5718 # the number of subobjects of aShape
5719 # @param aShape Shape to get sub-shape of.
5720 # @param aSubShapes Sub-shapes of aShape.
5721 # @return list of IDs of found sub-shapes.
5723 # @ref swig_all_decompose "Example"
5724 @ManageTransactions("ShapesOp")
5725 def GetSubShapesIDs(self, aShape, aSubShapes):
5727 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5728 This function is provided for performance purpose. The complexity is O(n) with n
5729 the number of subobjects of aShape
5732 aShape Shape to get sub-shape of.
5733 aSubShapes Sub-shapes of aShape.
5736 List of IDs of found sub-shape.
5738 # Example: see GEOM_TestAll.py
5739 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5740 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5746 ## @addtogroup l4_decompose
5749 ## Get all sub-shapes and groups of \a theShape,
5750 # that were created already by any other methods.
5751 # @param theShape Any shape.
5752 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5753 # returned, else all found sub-shapes and groups.
5754 # @return List of existing sub-objects of \a theShape.
5756 # @ref swig_all_decompose "Example"
5757 @ManageTransactions("ShapesOp")
5758 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5760 Get all sub-shapes and groups of theShape,
5761 that were created already by any other methods.
5765 theGroupsOnly If this parameter is TRUE, only groups will be
5766 returned, else all found sub-shapes and groups.
5769 List of existing sub-objects of theShape.
5771 # Example: see GEOM_TestAll.py
5772 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5773 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5776 ## Get all groups of \a theShape,
5777 # that were created already by any other methods.
5778 # @param theShape Any shape.
5779 # @return List of existing groups of \a theShape.
5781 # @ref swig_all_decompose "Example"
5782 @ManageTransactions("ShapesOp")
5783 def GetGroups(self, theShape):
5785 Get all groups of theShape,
5786 that were created already by any other methods.
5792 List of existing groups of theShape.
5794 # Example: see GEOM_TestAll.py
5795 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5796 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5799 ## Explode a shape on sub-shapes of a given type.
5800 # If the shape itself matches the type, it is also returned.
5801 # @param aShape Shape to be exploded.
5802 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5803 # @param theName Object name; when specified, this parameter is used
5804 # for result publication in the study. Otherwise, if automatic
5805 # publication is switched on, default value is used for result name.
5807 # @return List of sub-shapes of type theShapeType, contained in theShape.
5809 # @ref swig_all_decompose "Example"
5810 @ManageTransactions("ShapesOp")
5811 def SubShapeAll(self, aShape, aType, theName=None):
5813 Explode a shape on sub-shapes of a given type.
5814 If the shape itself matches the type, it is also returned.
5817 aShape Shape to be exploded.
5818 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5819 theName Object name; when specified, this parameter is used
5820 for result publication in the study. Otherwise, if automatic
5821 publication is switched on, default value is used for result name.
5824 List of sub-shapes of type theShapeType, contained in theShape.
5826 # Example: see GEOM_TestAll.py
5827 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5828 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5829 self._autoPublish(ListObj, theName, "subshape")
5832 ## Explode a shape on sub-shapes of a given type.
5833 # @param aShape Shape to be exploded.
5834 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5835 # @return List of IDs of sub-shapes.
5837 # @ref swig_all_decompose "Example"
5838 @ManageTransactions("ShapesOp")
5839 def SubShapeAllIDs(self, aShape, aType):
5841 Explode a shape on sub-shapes of a given type.
5844 aShape Shape to be exploded (see geompy.ShapeType)
5845 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5848 List of IDs of sub-shapes.
5850 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5851 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5854 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5855 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5856 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5857 # @param aShape Shape to get sub-shape of.
5858 # @param ListOfInd List of sub-shapes indices.
5859 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5860 # @param theName Object name; when specified, this parameter is used
5861 # for result publication in the study. Otherwise, if automatic
5862 # publication is switched on, default value is used for result name.
5864 # @return A compound of sub-shapes of aShape.
5866 # @ref swig_all_decompose "Example"
5867 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5869 Obtain a compound of sub-shapes of aShape,
5870 selected by their indices in list of all sub-shapes of type aType.
5871 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5874 aShape Shape to get sub-shape of.
5875 ListOfID List of sub-shapes indices.
5876 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5877 theName Object name; when specified, this parameter is used
5878 for result publication in the study. Otherwise, if automatic
5879 publication is switched on, default value is used for result name.
5882 A compound of sub-shapes of aShape.
5884 # Example: see GEOM_TestAll.py
5886 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5887 for ind in ListOfInd:
5888 ListOfIDs.append(AllShapeIDsList[ind - 1])
5889 # note: auto-publishing is done in self.GetSubShape()
5890 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5893 ## Explode a shape on sub-shapes of a given type.
5894 # Sub-shapes will be sorted taking into account their gravity centers,
5895 # to provide stable order of sub-shapes.
5896 # If the shape itself matches the type, it is also returned.
5897 # @param aShape Shape to be exploded.
5898 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5899 # @param theName Object name; when specified, this parameter is used
5900 # for result publication in the study. Otherwise, if automatic
5901 # publication is switched on, default value is used for result name.
5903 # @return List of sub-shapes of type theShapeType, contained in theShape.
5905 # @ref swig_SubShapeAllSorted "Example"
5906 @ManageTransactions("ShapesOp")
5907 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5909 Explode a shape on sub-shapes of a given type.
5910 Sub-shapes will be sorted taking into account their gravity centers,
5911 to provide stable order of sub-shapes.
5912 If the shape itself matches the type, it is also returned.
5915 aShape Shape to be exploded.
5916 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5917 theName Object name; when specified, this parameter is used
5918 for result publication in the study. Otherwise, if automatic
5919 publication is switched on, default value is used for result name.
5922 List of sub-shapes of type theShapeType, contained in theShape.
5924 # Example: see GEOM_TestAll.py
5925 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5926 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5927 self._autoPublish(ListObj, theName, "subshape")
5930 ## Explode a shape on sub-shapes of a given type.
5931 # Sub-shapes will be sorted taking into account their gravity centers,
5932 # to provide stable order of sub-shapes.
5933 # @param aShape Shape to be exploded.
5934 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5935 # @return List of IDs of sub-shapes.
5937 # @ref swig_all_decompose "Example"
5938 @ManageTransactions("ShapesOp")
5939 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5941 Explode a shape on sub-shapes of a given type.
5942 Sub-shapes will be sorted taking into account their gravity centers,
5943 to provide stable order of sub-shapes.
5946 aShape Shape to be exploded.
5947 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5950 List of IDs of sub-shapes.
5952 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5953 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5956 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5957 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5958 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5959 # @param aShape Shape to get sub-shape of.
5960 # @param ListOfInd List of sub-shapes indices.
5961 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5962 # @param theName Object name; when specified, this parameter is used
5963 # for result publication in the study. Otherwise, if automatic
5964 # publication is switched on, default value is used for result name.
5966 # @return A compound of sub-shapes of aShape.
5968 # @ref swig_all_decompose "Example"
5969 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5971 Obtain a compound of sub-shapes of aShape,
5972 selected by they indices in sorted list of all sub-shapes of type aType.
5973 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5976 aShape Shape to get sub-shape of.
5977 ListOfID List of sub-shapes indices.
5978 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5979 theName Object name; when specified, this parameter is used
5980 for result publication in the study. Otherwise, if automatic
5981 publication is switched on, default value is used for result name.
5984 A compound of sub-shapes of aShape.
5986 # Example: see GEOM_TestAll.py
5988 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5989 for ind in ListOfInd:
5990 ListOfIDs.append(AllShapeIDsList[ind - 1])
5991 # note: auto-publishing is done in self.GetSubShape()
5992 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5995 ## Extract shapes (excluding the main shape) of given type.
5996 # @param aShape The shape.
5997 # @param aType The shape type (see ShapeType())
5998 # @param isSorted Boolean flag to switch sorting on/off.
5999 # @param theName Object name; when specified, this parameter is used
6000 # for result publication in the study. Otherwise, if automatic
6001 # publication is switched on, default value is used for result name.
6003 # @return List of sub-shapes of type aType, contained in aShape.
6005 # @ref swig_FilletChamfer "Example"
6006 @ManageTransactions("ShapesOp")
6007 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6009 Extract shapes (excluding the main shape) of given type.
6013 aType The shape type (see geompy.ShapeType)
6014 isSorted Boolean flag to switch sorting on/off.
6015 theName Object name; when specified, this parameter is used
6016 for result publication in the study. Otherwise, if automatic
6017 publication is switched on, default value is used for result name.
6020 List of sub-shapes of type aType, contained in aShape.
6022 # Example: see GEOM_TestAll.py
6023 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6024 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6025 self._autoPublish(ListObj, theName, "subshape")
6028 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6029 # @param aShape Main shape.
6030 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6031 # @param theName Object name; when specified, this parameter is used
6032 # for result publication in the study. Otherwise, if automatic
6033 # publication is switched on, default value is used for result name.
6034 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6036 # @ref swig_all_decompose "Example"
6037 @ManageTransactions("ShapesOp")
6038 def SubShapes(self, aShape, anIDs, theName=None):
6040 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6044 anIDs List of unique IDs of sub-shapes inside theMainShape.
6045 theName Object name; when specified, this parameter is used
6046 for result publication in the study. Otherwise, if automatic
6047 publication is switched on, default value is used for result name.
6050 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6052 # Example: see GEOM_TestAll.py
6053 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6054 RaiseIfFailed("SubShapes", self.ShapesOp)
6055 self._autoPublish(ListObj, theName, "subshape")
6058 # end of l4_decompose
6061 ## @addtogroup l4_decompose_d
6064 ## Deprecated method
6065 # It works like SubShapeAllSortedCentres(), but wrongly
6066 # defines centres of faces, shells and solids.
6067 @ManageTransactions("ShapesOp")
6068 def SubShapeAllSorted(self, aShape, aType, theName=None):
6071 It works like geompy.SubShapeAllSortedCentres, but wrongly
6072 defines centres of faces, shells and solids.
6074 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6075 RaiseIfFailed("MakeExplode", self.ShapesOp)
6076 self._autoPublish(ListObj, theName, "subshape")
6079 ## Deprecated method
6080 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6081 # defines centres of faces, shells and solids.
6082 @ManageTransactions("ShapesOp")
6083 def SubShapeAllSortedIDs(self, aShape, aType):
6086 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6087 defines centres of faces, shells and solids.
6089 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6090 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6093 ## Deprecated method
6094 # It works like SubShapeSortedCentres(), but has a bug
6095 # (wrongly defines centres of faces, shells and solids).
6096 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6099 It works like geompy.SubShapeSortedCentres, but has a bug
6100 (wrongly defines centres of faces, shells and solids).
6103 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6104 for ind in ListOfInd:
6105 ListOfIDs.append(AllShapeIDsList[ind - 1])
6106 # note: auto-publishing is done in self.GetSubShape()
6107 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6110 # end of l4_decompose_d
6113 ## @addtogroup l3_healing
6116 ## Apply a sequence of Shape Healing operators to the given object.
6117 # @param theShape Shape to be processed.
6118 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6119 # @param theParameters List of names of parameters
6120 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6121 # @param theValues List of values of parameters, in the same order
6122 # as parameters are listed in <VAR>theParameters</VAR> list.
6123 # @param theName Object name; when specified, this parameter is used
6124 # for result publication in the study. Otherwise, if automatic
6125 # publication is switched on, default value is used for result name.
6127 # <b> Operators and Parameters: </b> \n
6129 # * \b FixShape - corrects invalid shapes. \n
6130 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6131 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6133 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6134 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6135 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6136 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6138 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6139 # surfaces in segments using a certain angle. \n
6140 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6141 # if Angle=180, four if Angle=90, etc). \n
6142 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6144 # * \b SplitClosedFaces - splits closed faces in segments.
6145 # The number of segments depends on the number of splitting points.\n
6146 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6148 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6149 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6150 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6151 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6152 # This and the previous parameters can take the following values:\n
6153 # \b Parametric \b Continuity \n
6154 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6155 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6156 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6157 # ruling out sharp edges).\n
6158 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6159 # are of the same magnitude).\n
6160 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6161 # or surfaces (d/du C(u)) are the same at junction. \n
6162 # \b Geometric \b Continuity \n
6163 # \b G1: first derivatives are proportional at junction.\n
6164 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6165 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6166 # \b G2: first and second derivatives are proportional at junction.
6167 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6168 # continuity requires that the underlying parameterization was continuous as well.
6169 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6171 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6172 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6173 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6174 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6175 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6176 # with the specified parameters.\n
6177 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6178 # with the specified parameters.\n
6179 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6180 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6181 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6182 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6184 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6185 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6186 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6187 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6188 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6190 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6191 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6194 # @return New GEOM.GEOM_Object, containing processed shape.
6196 # \n @ref tui_shape_processing "Example"
6197 @ManageTransactions("HealOp")
6198 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6200 Apply a sequence of Shape Healing operators to the given object.
6203 theShape Shape to be processed.
6204 theValues List of values of parameters, in the same order
6205 as parameters are listed in theParameters list.
6206 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6207 theParameters List of names of parameters
6208 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6209 theName Object name; when specified, this parameter is used
6210 for result publication in the study. Otherwise, if automatic
6211 publication is switched on, default value is used for result name.
6213 Operators and Parameters:
6215 * FixShape - corrects invalid shapes.
6216 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6217 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6218 * FixFaceSize - removes small faces, such as spots and strips.
6219 * FixFaceSize.Tolerance - defines minimum possible face size.
6220 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6221 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6222 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6223 in segments using a certain angle.
6224 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6225 if Angle=180, four if Angle=90, etc).
6226 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6227 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6229 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6230 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6231 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6232 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6233 * SplitContinuity.CurveContinuity - required continuity for curves.
6234 This and the previous parameters can take the following values:
6236 Parametric Continuity:
6237 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6238 coincidental. The curves or surfaces may still meet at an angle,
6239 giving rise to a sharp corner or edge).
6240 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6241 are parallel, ruling out sharp edges).
6242 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6243 or surfaces are of the same magnitude).
6244 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6245 curves or surfaces (d/du C(u)) are the same at junction.
6247 Geometric Continuity:
6248 G1: first derivatives are proportional at junction.
6249 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6250 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6251 G2: first and second derivatives are proportional at junction. As the names imply,
6252 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6253 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6254 geometric continuity of order n, but not vice-versa.
6255 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6256 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6257 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6258 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6259 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6260 the specified parameters.
6261 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6262 the specified parameters.
6263 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6264 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6265 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6266 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6267 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6268 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6269 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6270 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6271 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6272 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6273 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6276 New GEOM.GEOM_Object, containing processed shape.
6278 Note: For more information look through SALOME Geometry User's Guide->
6279 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6281 # Example: see GEOM_TestHealing.py
6282 theValues,Parameters = ParseList(theValues)
6283 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6284 # To avoid script failure in case of good argument shape
6285 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6287 RaiseIfFailed("ProcessShape", self.HealOp)
6288 for string in (theOperators + theParameters):
6289 Parameters = ":" + Parameters
6291 anObj.SetParameters(Parameters)
6292 self._autoPublish(anObj, theName, "healed")
6295 ## Remove faces from the given object (shape).
6296 # @param theObject Shape to be processed.
6297 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6298 # removes ALL faces of the given object.
6299 # @param theName Object name; when specified, this parameter is used
6300 # for result publication in the study. Otherwise, if automatic
6301 # publication is switched on, default value is used for result name.
6303 # @return New GEOM.GEOM_Object, containing processed shape.
6305 # @ref tui_suppress_faces "Example"
6306 @ManageTransactions("HealOp")
6307 def SuppressFaces(self, theObject, theFaces, theName=None):
6309 Remove faces from the given object (shape).
6312 theObject Shape to be processed.
6313 theFaces Indices of faces to be removed, if EMPTY then the method
6314 removes ALL faces of the given object.
6315 theName Object name; when specified, this parameter is used
6316 for result publication in the study. Otherwise, if automatic
6317 publication is switched on, default value is used for result name.
6320 New GEOM.GEOM_Object, containing processed shape.
6322 # Example: see GEOM_TestHealing.py
6323 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6324 RaiseIfFailed("SuppressFaces", self.HealOp)
6325 self._autoPublish(anObj, theName, "suppressFaces")
6328 ## Sewing of faces into a single shell.
6329 # @param ListShape Shapes to be processed.
6330 # @param theTolerance Required tolerance value.
6331 # @param AllowNonManifold Flag that allows non-manifold sewing.
6332 # @param theName Object name; when specified, this parameter is used
6333 # for result publication in the study. Otherwise, if automatic
6334 # publication is switched on, default value is used for result name.
6336 # @return New GEOM.GEOM_Object, containing a result shell.
6338 # @ref tui_sewing "Example"
6339 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6341 Sewing of faces into a single shell.
6344 ListShape Shapes to be processed.
6345 theTolerance Required tolerance value.
6346 AllowNonManifold Flag that allows non-manifold sewing.
6347 theName Object name; when specified, this parameter is used
6348 for result publication in the study. Otherwise, if automatic
6349 publication is switched on, default value is used for result name.
6352 New GEOM.GEOM_Object, containing containing a result shell.
6354 # Example: see GEOM_TestHealing.py
6355 # note: auto-publishing is done in self.Sew()
6356 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
6359 ## Sewing of faces into a single shell.
6360 # @param ListShape Shapes to be processed.
6361 # @param theTolerance Required tolerance value.
6362 # @param AllowNonManifold Flag that allows non-manifold sewing.
6363 # @param theName Object name; when specified, this parameter is used
6364 # for result publication in the study. Otherwise, if automatic
6365 # publication is switched on, default value is used for result name.
6367 # @return New GEOM.GEOM_Object, containing a result shell.
6368 @ManageTransactions("HealOp")
6369 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6371 Sewing of faces into a single shell.
6374 ListShape Shapes to be processed.
6375 theTolerance Required tolerance value.
6376 AllowNonManifold Flag that allows non-manifold sewing.
6377 theName Object name; when specified, this parameter is used
6378 for result publication in the study. Otherwise, if automatic
6379 publication is switched on, default value is used for result name.
6382 New GEOM.GEOM_Object, containing a result shell.
6384 # Example: see MakeSewing() above
6385 theTolerance,Parameters = ParseParameters(theTolerance)
6386 if AllowNonManifold:
6387 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
6389 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
6390 # To avoid script failure in case of good argument shape
6391 # (Fix of test cases geom/bugs11/L7,L8)
6392 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6394 RaiseIfFailed("Sew", self.HealOp)
6395 anObj.SetParameters(Parameters)
6396 self._autoPublish(anObj, theName, "sewed")
6399 ## Rebuild the topology of theCompound of solids by removing
6400 # of the faces that are shared by several solids.
6401 # @param theCompound Shape to be processed.
6402 # @param 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.
6406 # @return New GEOM.GEOM_Object, containing processed shape.
6408 # @ref tui_remove_webs "Example"
6409 @ManageTransactions("HealOp")
6410 def RemoveInternalFaces (self, theCompound, theName=None):
6412 Rebuild the topology of theCompound of solids by removing
6413 of the faces that are shared by several solids.
6416 theCompound Shape to be processed.
6417 theName Object name; when specified, this parameter is used
6418 for result publication in the study. Otherwise, if automatic
6419 publication is switched on, default value is used for result name.
6422 New GEOM.GEOM_Object, containing processed shape.
6424 # Example: see GEOM_TestHealing.py
6425 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6426 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6427 self._autoPublish(anObj, theName, "removeWebs")
6430 ## Remove internal wires and edges from the given object (face).
6431 # @param theObject Shape to be processed.
6432 # @param theWires Indices of wires to be removed, if EMPTY then the method
6433 # removes ALL internal wires of the given object.
6434 # @param theName Object name; when specified, this parameter is used
6435 # for result publication in the study. Otherwise, if automatic
6436 # publication is switched on, default value is used for result name.
6438 # @return New GEOM.GEOM_Object, containing processed shape.
6440 # @ref tui_suppress_internal_wires "Example"
6441 @ManageTransactions("HealOp")
6442 def SuppressInternalWires(self, theObject, theWires, theName=None):
6444 Remove internal wires and edges from the given object (face).
6447 theObject Shape to be processed.
6448 theWires Indices of wires to be removed, if EMPTY then the method
6449 removes ALL internal wires of the given object.
6450 theName Object name; when specified, this parameter is used
6451 for result publication in the study. Otherwise, if automatic
6452 publication is switched on, default value is used for result name.
6455 New GEOM.GEOM_Object, containing processed shape.
6457 # Example: see GEOM_TestHealing.py
6458 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6459 RaiseIfFailed("RemoveIntWires", self.HealOp)
6460 self._autoPublish(anObj, theName, "suppressWires")
6463 ## Remove internal closed contours (holes) from the given object.
6464 # @param theObject Shape to be processed.
6465 # @param theWires Indices of wires to be removed, if EMPTY then the method
6466 # removes ALL internal holes of the given object
6467 # @param theName Object name; when specified, this parameter is used
6468 # for result publication in the study. Otherwise, if automatic
6469 # publication is switched on, default value is used for result name.
6471 # @return New GEOM.GEOM_Object, containing processed shape.
6473 # @ref tui_suppress_holes "Example"
6474 @ManageTransactions("HealOp")
6475 def SuppressHoles(self, theObject, theWires, theName=None):
6477 Remove internal closed contours (holes) from the given object.
6480 theObject Shape to be processed.
6481 theWires Indices of wires to be removed, if EMPTY then the method
6482 removes ALL internal holes of the given object
6483 theName Object name; when specified, this parameter is used
6484 for result publication in the study. Otherwise, if automatic
6485 publication is switched on, default value is used for result name.
6488 New GEOM.GEOM_Object, containing processed shape.
6490 # Example: see GEOM_TestHealing.py
6491 anObj = self.HealOp.FillHoles(theObject, theWires)
6492 RaiseIfFailed("FillHoles", self.HealOp)
6493 self._autoPublish(anObj, theName, "suppressHoles")
6496 ## Close an open wire.
6497 # @param theObject Shape to be processed.
6498 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6499 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6500 # @param isCommonVertex If True : closure by creation of a common vertex,
6501 # If False : closure by creation of an edge between ends.
6502 # @param theName Object name; when specified, this parameter is used
6503 # for result publication in the study. Otherwise, if automatic
6504 # publication is switched on, default value is used for result name.
6506 # @return New GEOM.GEOM_Object, containing processed shape.
6508 # @ref tui_close_contour "Example"
6509 @ManageTransactions("HealOp")
6510 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6515 theObject Shape to be processed.
6516 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6517 if [ ], then theObject itself is a wire.
6518 isCommonVertex If True : closure by creation of a common vertex,
6519 If False : closure by creation of an edge between ends.
6520 theName Object name; when specified, this parameter is used
6521 for result publication in the study. Otherwise, if automatic
6522 publication is switched on, default value is used for result name.
6525 New GEOM.GEOM_Object, containing processed shape.
6527 # Example: see GEOM_TestHealing.py
6528 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6529 RaiseIfFailed("CloseContour", self.HealOp)
6530 self._autoPublish(anObj, theName, "closeContour")
6533 ## Addition of a point to a given edge object.
6534 # @param theObject Shape to be processed.
6535 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6536 # if -1, then theObject itself is the edge.
6537 # @param theValue Value of parameter on edge or length parameter,
6538 # depending on \a isByParameter.
6539 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6540 # if FALSE : \a theValue is treated as a length parameter [0..1]
6541 # @param theName Object name; when specified, this parameter is used
6542 # for result publication in the study. Otherwise, if automatic
6543 # publication is switched on, default value is used for result name.
6545 # @return New GEOM.GEOM_Object, containing processed shape.
6547 # @ref tui_add_point_on_edge "Example"
6548 @ManageTransactions("HealOp")
6549 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6551 Addition of a point to a given edge object.
6554 theObject Shape to be processed.
6555 theEdgeIndex Index of edge to be divided within theObject's shape,
6556 if -1, then theObject itself is the edge.
6557 theValue Value of parameter on edge or length parameter,
6558 depending on isByParameter.
6559 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6560 if FALSE : theValue is treated as a length parameter [0..1]
6561 theName Object name; when specified, this parameter is used
6562 for result publication in the study. Otherwise, if automatic
6563 publication is switched on, default value is used for result name.
6566 New GEOM.GEOM_Object, containing processed shape.
6568 # Example: see GEOM_TestHealing.py
6569 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6570 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6571 RaiseIfFailed("DivideEdge", self.HealOp)
6572 anObj.SetParameters(Parameters)
6573 self._autoPublish(anObj, theName, "divideEdge")
6576 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6577 # @param theWire Wire to minimize the number of C1 continuous edges in.
6578 # @param theVertices A list of vertices to suppress. If the list
6579 # is empty, all vertices in a wire will be assumed.
6580 # @param theName Object name; when specified, this parameter is used
6581 # for result publication in the study. Otherwise, if automatic
6582 # publication is switched on, default value is used for result name.
6584 # @return New GEOM.GEOM_Object with modified wire.
6586 # @ref tui_fuse_collinear_edges "Example"
6587 @ManageTransactions("HealOp")
6588 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6590 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6593 theWire Wire to minimize the number of C1 continuous edges in.
6594 theVertices A list of vertices to suppress. If the list
6595 is empty, all vertices in a wire will be assumed.
6596 theName Object name; when specified, this parameter is used
6597 for result publication in the study. Otherwise, if automatic
6598 publication is switched on, default value is used for result name.
6601 New GEOM.GEOM_Object with modified wire.
6603 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6604 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6605 self._autoPublish(anObj, theName, "fuseEdges")
6608 ## Change orientation of the given object. Updates given shape.
6609 # @param theObject Shape to be processed.
6610 # @return Updated <var>theObject</var>
6612 # @ref swig_todo "Example"
6613 @ManageTransactions("HealOp")
6614 def ChangeOrientationShell(self,theObject):
6616 Change orientation of the given object. Updates given shape.
6619 theObject Shape to be processed.
6624 theObject = self.HealOp.ChangeOrientation(theObject)
6625 RaiseIfFailed("ChangeOrientation", self.HealOp)
6628 ## Change orientation of the given object.
6629 # @param theObject Shape to be processed.
6630 # @param theName Object name; when specified, this parameter is used
6631 # for result publication in the study. Otherwise, if automatic
6632 # publication is switched on, default value is used for result name.
6634 # @return New GEOM.GEOM_Object, containing processed shape.
6636 # @ref swig_todo "Example"
6637 @ManageTransactions("HealOp")
6638 def ChangeOrientationShellCopy(self, theObject, theName=None):
6640 Change orientation of the given object.
6643 theObject Shape to be processed.
6644 theName Object name; when specified, this parameter is used
6645 for result publication in the study. Otherwise, if automatic
6646 publication is switched on, default value is used for result name.
6649 New GEOM.GEOM_Object, containing processed shape.
6651 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6652 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6653 self._autoPublish(anObj, theName, "reversed")
6656 ## Try to limit tolerance of the given object by value \a theTolerance.
6657 # @param theObject Shape to be processed.
6658 # @param theTolerance Required tolerance value.
6659 # @param theName Object name; when specified, this parameter is used
6660 # for result publication in the study. Otherwise, if automatic
6661 # publication is switched on, default value is used for result name.
6663 # @return New GEOM.GEOM_Object, containing processed shape.
6665 # @ref tui_limit_tolerance "Example"
6666 @ManageTransactions("HealOp")
6667 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6669 Try to limit tolerance of the given object by value theTolerance.
6672 theObject Shape to be processed.
6673 theTolerance Required tolerance value.
6674 theName Object name; when specified, this parameter is used
6675 for result publication in the study. Otherwise, if automatic
6676 publication is switched on, default value is used for result name.
6679 New GEOM.GEOM_Object, containing processed shape.
6681 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6682 RaiseIfFailed("LimitTolerance", self.HealOp)
6683 self._autoPublish(anObj, theName, "limitTolerance")
6686 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6687 # that constitute a free boundary of the given shape.
6688 # @param theObject Shape to get free boundary of.
6689 # @param theName Object name; when specified, this parameter is used
6690 # for result publication in the study. Otherwise, if automatic
6691 # publication is switched on, default value is used for result name.
6693 # @return [\a status, \a theClosedWires, \a theOpenWires]
6694 # \n \a status: FALSE, if an error(s) occured during the method execution.
6695 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6696 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6698 # @ref tui_measurement_tools_page "Example"
6699 @ManageTransactions("HealOp")
6700 def GetFreeBoundary(self, theObject, theName=None):
6702 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6703 that constitute a free boundary of the given shape.
6706 theObject Shape to get free boundary of.
6707 theName Object name; when specified, this parameter is used
6708 for result publication in the study. Otherwise, if automatic
6709 publication is switched on, default value is used for result name.
6712 [status, theClosedWires, theOpenWires]
6713 status: FALSE, if an error(s) occured during the method execution.
6714 theClosedWires: Closed wires on the free boundary of the given shape.
6715 theOpenWires: Open wires on the free boundary of the given shape.
6717 # Example: see GEOM_TestHealing.py
6718 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
6719 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6720 self._autoPublish(anObj[1], theName, "closedWire")
6721 self._autoPublish(anObj[2], theName, "openWire")
6724 ## Replace coincident faces in \a theShapes by one face.
6725 # @param theShapes Initial shapes, either a list or compound of shapes.
6726 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6727 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6728 # otherwise all initial shapes.
6729 # @param theName Object name; when specified, this parameter is used
6730 # for result publication in the study. Otherwise, if automatic
6731 # publication is switched on, default value is used for result name.
6733 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
6735 # @ref tui_glue_faces "Example"
6736 @ManageTransactions("ShapesOp")
6737 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
6739 Replace coincident faces in theShapes by one face.
6742 theShapes Initial shapes, either a list or compound of shapes.
6743 theTolerance Maximum distance between faces, which can be considered as coincident.
6744 doKeepNonSolids If FALSE, only solids will present in the result,
6745 otherwise all initial shapes.
6746 theName Object name; when specified, this parameter is used
6747 for result publication in the study. Otherwise, if automatic
6748 publication is switched on, default value is used for result name.
6751 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
6753 # Example: see GEOM_Spanner.py
6754 theTolerance,Parameters = ParseParameters(theTolerance)
6755 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
6757 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6758 anObj.SetParameters(Parameters)
6759 self._autoPublish(anObj, theName, "glueFaces")
6762 ## Find coincident faces in \a theShapes for possible gluing.
6763 # @param theShapes Initial shapes, either a list or compound of shapes.
6764 # @param theTolerance Maximum distance between faces,
6765 # which can be considered as coincident.
6766 # @param theName Object name; when specified, this parameter is used
6767 # for result publication in the study. Otherwise, if automatic
6768 # publication is switched on, default value is used for result name.
6770 # @return GEOM.ListOfGO
6772 # @ref tui_glue_faces "Example"
6773 @ManageTransactions("ShapesOp")
6774 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
6776 Find coincident faces in theShapes for possible gluing.
6779 theShapes Initial shapes, either a list or compound of shapes.
6780 theTolerance Maximum distance between faces,
6781 which can be considered as coincident.
6782 theName Object name; when specified, this parameter is used
6783 for result publication in the study. Otherwise, if automatic
6784 publication is switched on, default value is used for result name.
6789 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
6790 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6791 self._autoPublish(anObj, theName, "facesToGlue")
6794 ## Replace coincident faces in \a theShapes by one face
6795 # in compliance with given list of faces
6796 # @param theShapes Initial shapes, either a list or compound of shapes.
6797 # @param theTolerance Maximum distance between faces,
6798 # which can be considered as coincident.
6799 # @param theFaces List of faces for gluing.
6800 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6801 # otherwise all initial shapes.
6802 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6803 # will be glued, otherwise only the edges,
6804 # belonging to <VAR>theFaces</VAR>.
6805 # @param theName Object name; when specified, this parameter is used
6806 # for result publication in the study. Otherwise, if automatic
6807 # publication is switched on, default value is used for result name.
6809 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
6811 # @ref tui_glue_faces "Example"
6812 @ManageTransactions("ShapesOp")
6813 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
6814 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6816 Replace coincident faces in theShapes by one face
6817 in compliance with given list of faces
6820 theShapes theShapes Initial shapes, either a list or compound of shapes.
6821 theTolerance Maximum distance between faces,
6822 which can be considered as coincident.
6823 theFaces List of faces for gluing.
6824 doKeepNonSolids If FALSE, only solids will present in the result,
6825 otherwise all initial shapes.
6826 doGlueAllEdges If TRUE, all coincident edges of theShape
6827 will be glued, otherwise only the edges,
6828 belonging to theFaces.
6829 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.
6834 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
6836 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, theFaces,
6837 doKeepNonSolids, doGlueAllEdges)
6839 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6840 self._autoPublish(anObj, theName, "glueFaces")
6843 ## Replace coincident edges in \a theShapes by one edge.
6844 # @param theShapes Initial shapes, either a list or compound of shapes.
6845 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6846 # @param theName Object name; when specified, this parameter is used
6847 # for result publication in the study. Otherwise, if automatic
6848 # publication is switched on, default value is used for result name.
6850 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
6852 # @ref tui_glue_edges "Example"
6853 @ManageTransactions("ShapesOp")
6854 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
6856 Replace coincident edges in theShapes by one edge.
6859 theShapes Initial shapes, either a list or compound of shapes.
6860 theTolerance Maximum distance between edges, which can be considered as coincident.
6861 theName Object name; when specified, this parameter is used
6862 for result publication in the study. Otherwise, if automatic
6863 publication is switched on, default value is used for result name.
6866 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
6868 theTolerance,Parameters = ParseParameters(theTolerance)
6869 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
6871 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6872 anObj.SetParameters(Parameters)
6873 self._autoPublish(anObj, theName, "glueEdges")
6876 ## Find coincident edges in \a theShapes for possible gluing.
6877 # @param theShapes Initial shapes, either a list or compound of shapes.
6878 # @param theTolerance Maximum distance between edges,
6879 # which can be considered as coincident.
6880 # @param theName Object name; when specified, this parameter is used
6881 # for result publication in the study. Otherwise, if automatic
6882 # publication is switched on, default value is used for result name.
6884 # @return GEOM.ListOfGO
6886 # @ref tui_glue_edges "Example"
6887 @ManageTransactions("ShapesOp")
6888 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
6890 Find coincident edges in theShapes for possible gluing.
6893 theShapes Initial shapes, either a list or compound of shapes.
6894 theTolerance Maximum distance between edges,
6895 which can be considered as coincident.
6896 theName Object name; when specified, this parameter is used
6897 for result publication in the study. Otherwise, if automatic
6898 publication is switched on, default value is used for result name.
6903 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
6904 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6905 self._autoPublish(anObj, theName, "edgesToGlue")
6908 ## Replace coincident edges in theShapes by one edge
6909 # in compliance with given list of edges.
6910 # @param theShapes Initial shapes, either a list or compound of shapes.
6911 # @param theTolerance Maximum distance between edges,
6912 # which can be considered as coincident.
6913 # @param theEdges List of edges for gluing.
6914 # @param theName Object name; when specified, this parameter is used
6915 # for result publication in the study. Otherwise, if automatic
6916 # publication is switched on, default value is used for result name.
6918 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
6920 # @ref tui_glue_edges "Example"
6921 @ManageTransactions("ShapesOp")
6922 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
6924 Replace coincident edges in theShapes by one edge
6925 in compliance with given list of edges.
6928 theShapes Initial shapes, either a list or compound of shapes.
6929 theTolerance Maximum distance between edges,
6930 which can be considered as coincident.
6931 theEdges List of edges for gluing.
6932 theName Object name; when specified, this parameter is used
6933 for result publication in the study. Otherwise, if automatic
6934 publication is switched on, default value is used for result name.
6937 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
6939 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
6941 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6942 self._autoPublish(anObj, theName, "glueEdges")
6948 ## @addtogroup l3_boolean Boolean Operations
6951 # -----------------------------------------------------------------------------
6952 # Boolean (Common, Cut, Fuse, Section)
6953 # -----------------------------------------------------------------------------
6955 ## Perform one of boolean operations on two given shapes.
6956 # @param theShape1 First argument for boolean operation.
6957 # @param theShape2 Second argument for boolean operation.
6958 # @param theOperation Indicates the operation to be done:\n
6959 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6960 # @param checkSelfInte The flag that tells if the arguments should
6961 # be checked for self-intersection prior to the operation.
6962 # @param theName Object name; when specified, this parameter is used
6963 # for result publication in the study. Otherwise, if automatic
6964 # publication is switched on, default value is used for result name.
6966 # @note This algorithm doesn't find all types of self-intersections.
6967 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6968 # vertex/face and edge/face intersections. Face/face
6969 # intersections detection is switched off as it is a
6970 # time-consuming operation that gives an impact on performance.
6971 # To find all self-intersections please use
6972 # CheckSelfIntersections() method.
6974 # @return New GEOM.GEOM_Object, containing the result shape.
6976 # @ref tui_fuse "Example"
6977 @ManageTransactions("BoolOp")
6978 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6980 Perform one of boolean operations on two given shapes.
6983 theShape1 First argument for boolean operation.
6984 theShape2 Second argument for boolean operation.
6985 theOperation Indicates the operation to be done:
6986 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6987 checkSelfInte The flag that tells if the arguments should
6988 be checked for self-intersection prior to
6990 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.
6995 This algorithm doesn't find all types of self-intersections.
6996 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6997 vertex/face and edge/face intersections. Face/face
6998 intersections detection is switched off as it is a
6999 time-consuming operation that gives an impact on performance.
7000 To find all self-intersections please use
7001 CheckSelfIntersections() method.
7004 New GEOM.GEOM_Object, containing the result shape.
7006 # Example: see GEOM_TestAll.py
7007 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7008 RaiseIfFailed("MakeBoolean", self.BoolOp)
7009 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7010 self._autoPublish(anObj, theName, def_names[theOperation])
7013 ## Perform Common boolean operation on two given shapes.
7014 # @param theShape1 First argument for boolean operation.
7015 # @param theShape2 Second argument for boolean operation.
7016 # @param checkSelfInte The flag that tells if the arguments should
7017 # be checked for self-intersection prior to the operation.
7018 # @param 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.
7022 # @note This algorithm doesn't find all types of self-intersections.
7023 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7024 # vertex/face and edge/face intersections. Face/face
7025 # intersections detection is switched off as it is a
7026 # time-consuming operation that gives an impact on performance.
7027 # To find all self-intersections please use
7028 # CheckSelfIntersections() method.
7030 # @return New GEOM.GEOM_Object, containing the result shape.
7032 # @ref tui_common "Example 1"
7033 # \n @ref swig_MakeCommon "Example 2"
7034 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7036 Perform Common boolean operation on two given shapes.
7039 theShape1 First argument for boolean operation.
7040 theShape2 Second argument for boolean operation.
7041 checkSelfInte The flag that tells if the arguments should
7042 be checked for self-intersection prior to
7044 theName Object name; when specified, this parameter is used
7045 for result publication in the study. Otherwise, if automatic
7046 publication is switched on, default value is used for result name.
7049 This algorithm doesn't find all types of self-intersections.
7050 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7051 vertex/face and edge/face intersections. Face/face
7052 intersections detection is switched off as it is a
7053 time-consuming operation that gives an impact on performance.
7054 To find all self-intersections please use
7055 CheckSelfIntersections() method.
7058 New GEOM.GEOM_Object, containing the result shape.
7060 # Example: see GEOM_TestOthers.py
7061 # note: auto-publishing is done in self.MakeBoolean()
7062 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7064 ## Perform Cut boolean operation on two given shapes.
7065 # @param theShape1 First argument for boolean operation.
7066 # @param theShape2 Second argument for boolean operation.
7067 # @param checkSelfInte The flag that tells if the arguments should
7068 # be checked for self-intersection prior to the operation.
7069 # @param theName Object name; when specified, this parameter is used
7070 # for result publication in the study. Otherwise, if automatic
7071 # publication is switched on, default value is used for result name.
7073 # @note This algorithm doesn't find all types of self-intersections.
7074 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7075 # vertex/face and edge/face intersections. Face/face
7076 # intersections detection is switched off as it is a
7077 # time-consuming operation that gives an impact on performance.
7078 # To find all self-intersections please use
7079 # CheckSelfIntersections() method.
7081 # @return New GEOM.GEOM_Object, containing the result shape.
7083 # @ref tui_cut "Example 1"
7084 # \n @ref swig_MakeCommon "Example 2"
7085 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7087 Perform Cut boolean operation on two given shapes.
7090 theShape1 First argument for boolean operation.
7091 theShape2 Second argument for boolean operation.
7092 checkSelfInte The flag that tells if the arguments should
7093 be checked for self-intersection prior to
7095 theName Object name; when specified, this parameter is used
7096 for result publication in the study. Otherwise, if automatic
7097 publication is switched on, default value is used for result name.
7100 This algorithm doesn't find all types of self-intersections.
7101 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7102 vertex/face and edge/face intersections. Face/face
7103 intersections detection is switched off as it is a
7104 time-consuming operation that gives an impact on performance.
7105 To find all self-intersections please use
7106 CheckSelfIntersections() method.
7109 New GEOM.GEOM_Object, containing the result shape.
7112 # Example: see GEOM_TestOthers.py
7113 # note: auto-publishing is done in self.MakeBoolean()
7114 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7116 ## Perform Fuse boolean operation on two given shapes.
7117 # @param theShape1 First argument for boolean operation.
7118 # @param theShape2 Second argument for boolean operation.
7119 # @param checkSelfInte The flag that tells if the arguments should
7120 # be checked for self-intersection prior to the operation.
7121 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7122 # operation should be performed during the operation.
7123 # @param 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.
7127 # @note This algorithm doesn't find all types of self-intersections.
7128 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7129 # vertex/face and edge/face intersections. Face/face
7130 # intersections detection is switched off as it is a
7131 # time-consuming operation that gives an impact on performance.
7132 # To find all self-intersections please use
7133 # CheckSelfIntersections() method.
7135 # @return New GEOM.GEOM_Object, containing the result shape.
7137 # @ref tui_fuse "Example 1"
7138 # \n @ref swig_MakeCommon "Example 2"
7139 @ManageTransactions("BoolOp")
7140 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7141 rmExtraEdges=False, theName=None):
7143 Perform Fuse boolean operation on two given shapes.
7146 theShape1 First argument for boolean operation.
7147 theShape2 Second argument for boolean operation.
7148 checkSelfInte The flag that tells if the arguments should
7149 be checked for self-intersection prior to
7151 rmExtraEdges The flag that tells if Remove Extra Edges
7152 operation should be performed during the operation.
7153 theName Object name; when specified, this parameter is used
7154 for result publication in the study. Otherwise, if automatic
7155 publication is switched on, default value is used for result name.
7158 This algorithm doesn't find all types of self-intersections.
7159 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7160 vertex/face and edge/face intersections. Face/face
7161 intersections detection is switched off as it is a
7162 time-consuming operation that gives an impact on performance.
7163 To find all self-intersections please use
7164 CheckSelfIntersections() method.
7167 New GEOM.GEOM_Object, containing the result shape.
7170 # Example: see GEOM_TestOthers.py
7171 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7172 checkSelfInte, rmExtraEdges)
7173 RaiseIfFailed("MakeFuse", self.BoolOp)
7174 self._autoPublish(anObj, theName, "fuse")
7177 ## Perform Section boolean operation on two given shapes.
7178 # @param theShape1 First argument for boolean operation.
7179 # @param theShape2 Second argument for boolean operation.
7180 # @param checkSelfInte The flag that tells if the arguments should
7181 # be checked for self-intersection prior to the operation.
7182 # @param theName Object name; when specified, this parameter is used
7183 # for result publication in the study. Otherwise, if automatic
7184 # publication is switched on, default value is used for result name.
7186 # @note 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.
7194 # @return New GEOM.GEOM_Object, containing the result shape.
7196 # @ref tui_section "Example 1"
7197 # \n @ref swig_MakeCommon "Example 2"
7198 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7200 Perform Section boolean operation on two given shapes.
7203 theShape1 First argument for boolean operation.
7204 theShape2 Second argument for boolean operation.
7205 checkSelfInte The flag that tells if the arguments should
7206 be checked for self-intersection prior to
7208 theName Object name; when specified, this parameter is used
7209 for result publication in the study. Otherwise, if automatic
7210 publication is switched on, default value is used for result name.
7213 This algorithm doesn't find all types of self-intersections.
7214 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7215 vertex/face and edge/face intersections. Face/face
7216 intersections detection is switched off as it is a
7217 time-consuming operation that gives an impact on performance.
7218 To find all self-intersections please use
7219 CheckSelfIntersections() method.
7222 New GEOM.GEOM_Object, containing the result shape.
7225 # Example: see GEOM_TestOthers.py
7226 # note: auto-publishing is done in self.MakeBoolean()
7227 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7229 ## Perform Fuse boolean operation on the list of shapes.
7230 # @param theShapesList Shapes to be fused.
7231 # @param checkSelfInte The flag that tells if the arguments should
7232 # be checked for self-intersection prior to the operation.
7233 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7234 # operation should be performed during the operation.
7235 # @param theName Object name; when specified, this parameter is used
7236 # for result publication in the study. Otherwise, if automatic
7237 # publication is switched on, default value is used for result name.
7239 # @note This algorithm doesn't find all types of self-intersections.
7240 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7241 # vertex/face and edge/face intersections. Face/face
7242 # intersections detection is switched off as it is a
7243 # time-consuming operation that gives an impact on performance.
7244 # To find all self-intersections please use
7245 # CheckSelfIntersections() method.
7247 # @return New GEOM.GEOM_Object, containing the result shape.
7249 # @ref tui_fuse "Example 1"
7250 # \n @ref swig_MakeCommon "Example 2"
7251 @ManageTransactions("BoolOp")
7252 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7253 rmExtraEdges=False, theName=None):
7255 Perform Fuse boolean operation on the list of shapes.
7258 theShapesList Shapes to be fused.
7259 checkSelfInte The flag that tells if the arguments should
7260 be checked for self-intersection prior to
7262 rmExtraEdges The flag that tells if Remove Extra Edges
7263 operation should be performed during the operation.
7264 theName Object name; when specified, this parameter is used
7265 for result publication in the study. Otherwise, if automatic
7266 publication is switched on, default value is used for result name.
7269 This algorithm doesn't find all types of self-intersections.
7270 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7271 vertex/face and edge/face intersections. Face/face
7272 intersections detection is switched off as it is a
7273 time-consuming operation that gives an impact on performance.
7274 To find all self-intersections please use
7275 CheckSelfIntersections() method.
7278 New GEOM.GEOM_Object, containing the result shape.
7281 # Example: see GEOM_TestOthers.py
7282 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7284 RaiseIfFailed("MakeFuseList", self.BoolOp)
7285 self._autoPublish(anObj, theName, "fuse")
7288 ## Perform Common boolean operation on the list of shapes.
7289 # @param theShapesList Shapes for Common operation.
7290 # @param checkSelfInte The flag that tells if the arguments should
7291 # be checked for self-intersection prior to the operation.
7292 # @param 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.
7296 # @note This algorithm doesn't find all types of self-intersections.
7297 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7298 # vertex/face and edge/face intersections. Face/face
7299 # intersections detection is switched off as it is a
7300 # time-consuming operation that gives an impact on performance.
7301 # To find all self-intersections please use
7302 # CheckSelfIntersections() method.
7304 # @return New GEOM.GEOM_Object, containing the result shape.
7306 # @ref tui_common "Example 1"
7307 # \n @ref swig_MakeCommon "Example 2"
7308 @ManageTransactions("BoolOp")
7309 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7311 Perform Common boolean operation on the list of shapes.
7314 theShapesList Shapes for Common operation.
7315 checkSelfInte The flag that tells if the arguments should
7316 be checked for self-intersection prior to
7318 theName Object name; when specified, this parameter is used
7319 for result publication in the study. Otherwise, if automatic
7320 publication is switched on, default value is used for result name.
7323 This algorithm doesn't find all types of self-intersections.
7324 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7325 vertex/face and edge/face intersections. Face/face
7326 intersections detection is switched off as it is a
7327 time-consuming operation that gives an impact on performance.
7328 To find all self-intersections please use
7329 CheckSelfIntersections() method.
7332 New GEOM.GEOM_Object, containing the result shape.
7335 # Example: see GEOM_TestOthers.py
7336 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7337 RaiseIfFailed("MakeCommonList", self.BoolOp)
7338 self._autoPublish(anObj, theName, "common")
7341 ## Perform Cut boolean operation on one object and the list of tools.
7342 # @param theMainShape The object of the operation.
7343 # @param theShapesList The list of tools of the operation.
7344 # @param checkSelfInte The flag that tells if the arguments should
7345 # be checked for self-intersection prior to the operation.
7346 # @param 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.
7350 # @note This algorithm doesn't find all types of self-intersections.
7351 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7352 # vertex/face and edge/face intersections. Face/face
7353 # intersections detection is switched off as it is a
7354 # time-consuming operation that gives an impact on performance.
7355 # To find all self-intersections please use
7356 # CheckSelfIntersections() method.
7358 # @return New GEOM.GEOM_Object, containing the result shape.
7360 # @ref tui_cut "Example 1"
7361 # \n @ref swig_MakeCommon "Example 2"
7362 @ManageTransactions("BoolOp")
7363 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7365 Perform Cut boolean operation on one object and the list of tools.
7368 theMainShape The object of the operation.
7369 theShapesList The list of tools of the operation.
7370 checkSelfInte The flag that tells if the arguments should
7371 be checked for self-intersection prior to
7373 theName Object name; when specified, this parameter is used
7374 for result publication in the study. Otherwise, if automatic
7375 publication is switched on, default value is used for result name.
7378 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.
7387 New GEOM.GEOM_Object, containing the result shape.
7390 # Example: see GEOM_TestOthers.py
7391 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7392 RaiseIfFailed("MakeCutList", self.BoolOp)
7393 self._autoPublish(anObj, theName, "cut")
7399 ## @addtogroup l3_basic_op
7402 ## Perform partition operation.
7403 # @param ListShapes Shapes to be intersected.
7404 # @param ListTools Shapes to intersect theShapes.
7405 # @param Limit Type of resulting shapes (see ShapeType()).\n
7406 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7407 # type will be detected automatically.
7408 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7409 # target type (equal to Limit) are kept in the result,
7410 # else standalone shapes of lower dimension
7411 # are kept also (if they exist).
7413 # @param theName Object name; when specified, this parameter is used
7414 # for result publication in the study. Otherwise, if automatic
7415 # publication is switched on, default value is used for result name.
7417 # @note Each compound from ListShapes and ListTools will be exploded
7418 # in order to avoid possible intersection between shapes from this compound.
7420 # After implementation new version of PartitionAlgo (October 2006)
7421 # other parameters are ignored by current functionality. They are kept
7422 # in this function only for support old versions.
7423 # @param ListKeepInside Shapes, outside which the results will be deleted.
7424 # Each shape from theKeepInside must belong to theShapes also.
7425 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7426 # Each shape from theRemoveInside must belong to theShapes also.
7427 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7428 # @param ListMaterials Material indices for each shape. Make sence,
7429 # only if theRemoveWebs is TRUE.
7431 # @return New GEOM.GEOM_Object, containing the result shapes.
7433 # @ref tui_partition "Example"
7434 @ManageTransactions("BoolOp")
7435 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7436 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7437 KeepNonlimitShapes=0, theName=None):
7439 Perform partition operation.
7442 ListShapes Shapes to be intersected.
7443 ListTools Shapes to intersect theShapes.
7444 Limit Type of resulting shapes (see geompy.ShapeType)
7445 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7446 type will be detected automatically.
7447 KeepNonlimitShapes if this parameter == 0, then only shapes of
7448 target type (equal to Limit) are kept in the result,
7449 else standalone shapes of lower dimension
7450 are kept also (if they exist).
7452 theName Object name; when specified, this parameter is used
7453 for result publication in the study. Otherwise, if automatic
7454 publication is switched on, default value is used for result name.
7456 Each compound from ListShapes and ListTools will be exploded
7457 in order to avoid possible intersection between shapes from
7460 After implementation new version of PartitionAlgo (October 2006) other
7461 parameters are ignored by current functionality. They are kept in this
7462 function only for support old versions.
7465 ListKeepInside Shapes, outside which the results will be deleted.
7466 Each shape from theKeepInside must belong to theShapes also.
7467 ListRemoveInside Shapes, inside which the results will be deleted.
7468 Each shape from theRemoveInside must belong to theShapes also.
7469 RemoveWebs If TRUE, perform Glue 3D algorithm.
7470 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7473 New GEOM.GEOM_Object, containing the result shapes.
7475 # Example: see GEOM_TestAll.py
7476 if Limit == self.ShapeType["AUTO"]:
7477 # automatic detection of the most appropriate shape limit type
7479 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7480 Limit = EnumToLong(lim)
7482 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7483 ListKeepInside, ListRemoveInside,
7484 Limit, RemoveWebs, ListMaterials,
7485 KeepNonlimitShapes);
7486 RaiseIfFailed("MakePartition", self.BoolOp)
7487 self._autoPublish(anObj, theName, "partition")
7490 ## Perform partition operation.
7491 # This method may be useful if it is needed to make a partition for
7492 # compound contains nonintersected shapes. Performance will be better
7493 # since intersection between shapes from compound is not performed.
7495 # Description of all parameters as in previous method MakePartition().
7496 # One additional parameter is provided:
7497 # @param checkSelfInte The flag that tells if the arguments should
7498 # be checked for self-intersection prior to the operation.
7500 # @note This algorithm doesn't find all types of self-intersections.
7501 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7502 # vertex/face and edge/face intersections. Face/face
7503 # intersections detection is switched off as it is a
7504 # time-consuming operation that gives an impact on performance.
7505 # To find all self-intersections please use
7506 # CheckSelfIntersections() method.
7508 # @note Passed compounds (via ListShapes or via ListTools)
7509 # have to consist of nonintersecting shapes.
7511 # @return New GEOM.GEOM_Object, containing the result shapes.
7513 # @ref swig_todo "Example"
7514 @ManageTransactions("BoolOp")
7515 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7516 ListKeepInside=[], ListRemoveInside=[],
7517 Limit=ShapeType["AUTO"], RemoveWebs=0,
7518 ListMaterials=[], KeepNonlimitShapes=0,
7519 checkSelfInte=False, theName=None):
7521 Perform partition operation.
7522 This method may be useful if it is needed to make a partition for
7523 compound contains nonintersected shapes. Performance will be better
7524 since intersection between shapes from compound is not performed.
7527 Description of all parameters as in method geompy.MakePartition.
7528 One additional parameter is provided:
7529 checkSelfInte The flag that tells if the arguments should
7530 be checked for self-intersection prior to
7534 This algorithm doesn't find all types of self-intersections.
7535 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7536 vertex/face and edge/face intersections. Face/face
7537 intersections detection is switched off as it is a
7538 time-consuming operation that gives an impact on performance.
7539 To find all self-intersections please use
7540 CheckSelfIntersections() method.
7543 Passed compounds (via ListShapes or via ListTools)
7544 have to consist of nonintersecting shapes.
7547 New GEOM.GEOM_Object, containing the result shapes.
7549 if Limit == self.ShapeType["AUTO"]:
7550 # automatic detection of the most appropriate shape limit type
7552 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7553 Limit = EnumToLong(lim)
7555 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7556 ListKeepInside, ListRemoveInside,
7557 Limit, RemoveWebs, ListMaterials,
7558 KeepNonlimitShapes, checkSelfInte);
7559 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7560 self._autoPublish(anObj, theName, "partition")
7563 ## See method MakePartition() for more information.
7565 # @ref tui_partition "Example 1"
7566 # \n @ref swig_Partition "Example 2"
7567 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7568 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7569 KeepNonlimitShapes=0, theName=None):
7571 See method geompy.MakePartition for more information.
7573 # Example: see GEOM_TestOthers.py
7574 # note: auto-publishing is done in self.MakePartition()
7575 anObj = self.MakePartition(ListShapes, ListTools,
7576 ListKeepInside, ListRemoveInside,
7577 Limit, RemoveWebs, ListMaterials,
7578 KeepNonlimitShapes, theName);
7581 ## Perform partition of the Shape with the Plane
7582 # @param theShape Shape to be intersected.
7583 # @param thePlane Tool shape, to intersect theShape.
7584 # @param theName Object name; when specified, this parameter is used
7585 # for result publication in the study. Otherwise, if automatic
7586 # publication is switched on, default value is used for result name.
7588 # @return New GEOM.GEOM_Object, containing the result shape.
7590 # @ref tui_partition "Example"
7591 @ManageTransactions("BoolOp")
7592 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7594 Perform partition of the Shape with the Plane
7597 theShape Shape to be intersected.
7598 thePlane Tool shape, to intersect theShape.
7599 theName Object name; when specified, this parameter is used
7600 for result publication in the study. Otherwise, if automatic
7601 publication is switched on, default value is used for result name.
7604 New GEOM.GEOM_Object, containing the result shape.
7606 # Example: see GEOM_TestAll.py
7607 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7608 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7609 self._autoPublish(anObj, theName, "partition")
7612 # end of l3_basic_op
7615 ## @addtogroup l3_transform
7618 ## Translate the given object along the vector, specified
7619 # by its end points.
7620 # @param theObject The object to be translated.
7621 # @param thePoint1 Start point of translation vector.
7622 # @param thePoint2 End point of translation vector.
7623 # @param theCopy Flag used to translate object itself or create a copy.
7624 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7625 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7626 @ManageTransactions("TrsfOp")
7627 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7629 Translate the given object along the vector, specified by its end points.
7632 theObject The object to be translated.
7633 thePoint1 Start point of translation vector.
7634 thePoint2 End point of translation vector.
7635 theCopy Flag used to translate object itself or create a copy.
7638 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7639 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7642 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7644 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7645 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7648 ## Translate the given object along the vector, specified
7649 # by its end points, creating its copy before the translation.
7650 # @param theObject The object to be translated.
7651 # @param thePoint1 Start point of translation vector.
7652 # @param thePoint2 End point of translation vector.
7653 # @param theName Object name; when specified, this parameter is used
7654 # for result publication in the study. Otherwise, if automatic
7655 # publication is switched on, default value is used for result name.
7657 # @return New GEOM.GEOM_Object, containing the translated object.
7659 # @ref tui_translation "Example 1"
7660 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7661 @ManageTransactions("TrsfOp")
7662 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7664 Translate the given object along the vector, specified
7665 by its end points, creating its copy before the translation.
7668 theObject The object to be translated.
7669 thePoint1 Start point of translation vector.
7670 thePoint2 End point of translation vector.
7671 theName Object name; when specified, this parameter is used
7672 for result publication in the study. Otherwise, if automatic
7673 publication is switched on, default value is used for result name.
7676 New GEOM.GEOM_Object, containing the translated object.
7678 # Example: see GEOM_TestAll.py
7679 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7680 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7681 self._autoPublish(anObj, theName, "translated")
7684 ## Translate the given object along the vector, specified by its components.
7685 # @param theObject The object to be translated.
7686 # @param theDX,theDY,theDZ Components of translation vector.
7687 # @param theCopy Flag used to translate object itself or create a copy.
7688 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7689 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7691 # @ref tui_translation "Example"
7692 @ManageTransactions("TrsfOp")
7693 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7695 Translate the given object along the vector, specified by its components.
7698 theObject The object to be translated.
7699 theDX,theDY,theDZ Components of translation vector.
7700 theCopy Flag used to translate object itself or create a copy.
7703 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7704 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7706 # Example: see GEOM_TestAll.py
7707 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7709 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7711 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7712 anObj.SetParameters(Parameters)
7713 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7716 ## Translate the given object along the vector, specified
7717 # by its components, creating its copy before the translation.
7718 # @param theObject The object to be translated.
7719 # @param theDX,theDY,theDZ Components of translation vector.
7720 # @param theName Object name; when specified, this parameter is used
7721 # for result publication in the study. Otherwise, if automatic
7722 # publication is switched on, default value is used for result name.
7724 # @return New GEOM.GEOM_Object, containing the translated object.
7726 # @ref tui_translation "Example"
7727 @ManageTransactions("TrsfOp")
7728 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7730 Translate the given object along the vector, specified
7731 by its components, creating its copy before the translation.
7734 theObject The object to be translated.
7735 theDX,theDY,theDZ Components of translation vector.
7736 theName Object name; when specified, this parameter is used
7737 for result publication in the study. Otherwise, if automatic
7738 publication is switched on, default value is used for result name.
7741 New GEOM.GEOM_Object, containing the translated object.
7743 # Example: see GEOM_TestAll.py
7744 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7745 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7746 anObj.SetParameters(Parameters)
7747 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7748 self._autoPublish(anObj, theName, "translated")
7751 ## Translate the given object along the given vector.
7752 # @param theObject The object to be translated.
7753 # @param theVector The translation vector.
7754 # @param theCopy Flag used to translate object itself or create a copy.
7755 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7756 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7757 @ManageTransactions("TrsfOp")
7758 def TranslateVector(self, theObject, theVector, theCopy=False):
7760 Translate the given object along the given vector.
7763 theObject The object to be translated.
7764 theVector The translation vector.
7765 theCopy Flag used to translate object itself or create a copy.
7768 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7769 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7772 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7774 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7775 RaiseIfFailed("TranslateVector", self.TrsfOp)
7778 ## Translate the given object along the given vector,
7779 # creating its copy before the translation.
7780 # @param theObject The object to be translated.
7781 # @param theVector The translation vector.
7782 # @param theName Object name; when specified, this parameter is used
7783 # for result publication in the study. Otherwise, if automatic
7784 # publication is switched on, default value is used for result name.
7786 # @return New GEOM.GEOM_Object, containing the translated object.
7788 # @ref tui_translation "Example"
7789 @ManageTransactions("TrsfOp")
7790 def MakeTranslationVector(self, theObject, theVector, theName=None):
7792 Translate the given object along the given vector,
7793 creating its copy before the translation.
7796 theObject The object to be translated.
7797 theVector The translation vector.
7798 theName Object name; when specified, this parameter is used
7799 for result publication in the study. Otherwise, if automatic
7800 publication is switched on, default value is used for result name.
7803 New GEOM.GEOM_Object, containing the translated object.
7805 # Example: see GEOM_TestAll.py
7806 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7807 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7808 self._autoPublish(anObj, theName, "translated")
7811 ## Translate the given object along the given vector on given distance.
7812 # @param theObject The object to be translated.
7813 # @param theVector The translation vector.
7814 # @param theDistance The translation distance.
7815 # @param theCopy Flag used to translate object itself or create a copy.
7816 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7817 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7819 # @ref tui_translation "Example"
7820 @ManageTransactions("TrsfOp")
7821 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7823 Translate the given object along the given vector on given distance.
7826 theObject The object to be translated.
7827 theVector The translation vector.
7828 theDistance The translation distance.
7829 theCopy Flag used to translate object itself or create a copy.
7832 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7833 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7835 # Example: see GEOM_TestAll.py
7836 theDistance,Parameters = ParseParameters(theDistance)
7837 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7838 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7839 anObj.SetParameters(Parameters)
7842 ## Translate the given object along the given vector on given distance,
7843 # creating its copy before the translation.
7844 # @param theObject The object to be translated.
7845 # @param theVector The translation vector.
7846 # @param theDistance The translation distance.
7847 # @param theName Object name; when specified, this parameter is used
7848 # for result publication in the study. Otherwise, if automatic
7849 # publication is switched on, default value is used for result name.
7851 # @return New GEOM.GEOM_Object, containing the translated object.
7853 # @ref tui_translation "Example"
7854 @ManageTransactions("TrsfOp")
7855 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7857 Translate the given object along the given vector on given distance,
7858 creating its copy before the translation.
7861 theObject The object to be translated.
7862 theVector The translation vector.
7863 theDistance The translation distance.
7864 theName Object name; when specified, this parameter is used
7865 for result publication in the study. Otherwise, if automatic
7866 publication is switched on, default value is used for result name.
7869 New GEOM.GEOM_Object, containing the translated object.
7871 # Example: see GEOM_TestAll.py
7872 theDistance,Parameters = ParseParameters(theDistance)
7873 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7874 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7875 anObj.SetParameters(Parameters)
7876 self._autoPublish(anObj, theName, "translated")
7879 ## Rotate the given object around the given axis on the given angle.
7880 # @param theObject The object to be rotated.
7881 # @param theAxis Rotation axis.
7882 # @param theAngle Rotation angle in radians.
7883 # @param theCopy Flag used to rotate object itself or create a copy.
7885 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7886 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7888 # @ref tui_rotation "Example"
7889 @ManageTransactions("TrsfOp")
7890 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7892 Rotate the given object around the given axis on the given angle.
7895 theObject The object to be rotated.
7896 theAxis Rotation axis.
7897 theAngle Rotation angle in radians.
7898 theCopy Flag used to rotate object itself or create a copy.
7901 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7902 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7904 # Example: see GEOM_TestAll.py
7906 if isinstance(theAngle,str):
7908 theAngle, Parameters = ParseParameters(theAngle)
7910 theAngle = theAngle*math.pi/180.0
7912 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7914 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7915 RaiseIfFailed("Rotate", self.TrsfOp)
7916 anObj.SetParameters(Parameters)
7919 ## Rotate the given object around the given axis
7920 # on the given angle, creating its copy before the rotation.
7921 # @param theObject The object to be rotated.
7922 # @param theAxis Rotation axis.
7923 # @param theAngle Rotation angle in radians.
7924 # @param theName Object name; when specified, this parameter is used
7925 # for result publication in the study. Otherwise, if automatic
7926 # publication is switched on, default value is used for result name.
7928 # @return New GEOM.GEOM_Object, containing the rotated object.
7930 # @ref tui_rotation "Example"
7931 @ManageTransactions("TrsfOp")
7932 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7934 Rotate the given object around the given axis
7935 on the given angle, creating its copy before the rotatation.
7938 theObject The object to be rotated.
7939 theAxis Rotation axis.
7940 theAngle Rotation angle in radians.
7941 theName Object name; when specified, this parameter is used
7942 for result publication in the study. Otherwise, if automatic
7943 publication is switched on, default value is used for result name.
7946 New GEOM.GEOM_Object, containing the rotated object.
7948 # Example: see GEOM_TestAll.py
7950 if isinstance(theAngle,str):
7952 theAngle, Parameters = ParseParameters(theAngle)
7954 theAngle = theAngle*math.pi/180.0
7955 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7956 RaiseIfFailed("RotateCopy", self.TrsfOp)
7957 anObj.SetParameters(Parameters)
7958 self._autoPublish(anObj, theName, "rotated")
7961 ## Rotate given object around vector perpendicular to plane
7962 # containing three points.
7963 # @param theObject The object to be rotated.
7964 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7965 # containing the three points.
7966 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7967 # @param theCopy Flag used to rotate object itself or create a copy.
7968 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7969 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7970 @ManageTransactions("TrsfOp")
7971 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7973 Rotate given object around vector perpendicular to plane
7974 containing three points.
7977 theObject The object to be rotated.
7978 theCentPoint central point the axis is the vector perpendicular to the plane
7979 containing the three points.
7980 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7981 theCopy Flag used to rotate object itself or create a copy.
7984 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7985 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7988 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7990 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7991 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7994 ## Rotate given object around vector perpendicular to plane
7995 # containing three points, creating its copy before the rotatation.
7996 # @param theObject The object to be rotated.
7997 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7998 # containing the three points.
7999 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8000 # @param theName Object name; when specified, this parameter is used
8001 # for result publication in the study. Otherwise, if automatic
8002 # publication is switched on, default value is used for result name.
8004 # @return New GEOM.GEOM_Object, containing the rotated object.
8006 # @ref tui_rotation "Example"
8007 @ManageTransactions("TrsfOp")
8008 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8010 Rotate given object around vector perpendicular to plane
8011 containing three points, creating its copy before the rotatation.
8014 theObject The object to be rotated.
8015 theCentPoint central point the axis is the vector perpendicular to the plane
8016 containing the three points.
8017 thePoint1,thePoint2 in a perpendicular plane of the axis.
8018 theName Object name; when specified, this parameter is used
8019 for result publication in the study. Otherwise, if automatic
8020 publication is switched on, default value is used for result name.
8023 New GEOM.GEOM_Object, containing the rotated object.
8025 # Example: see GEOM_TestAll.py
8026 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8027 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8028 self._autoPublish(anObj, theName, "rotated")
8031 ## Scale the given object by the specified factor.
8032 # @param theObject The object to be scaled.
8033 # @param thePoint Center point for scaling.
8034 # Passing None for it means scaling relatively the origin of global CS.
8035 # @param theFactor Scaling factor value.
8036 # @param theCopy Flag used to scale object itself or create a copy.
8037 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8038 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8039 @ManageTransactions("TrsfOp")
8040 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8042 Scale the given object by the specified factor.
8045 theObject The object to be scaled.
8046 thePoint Center point for scaling.
8047 Passing None for it means scaling relatively the origin of global CS.
8048 theFactor Scaling factor value.
8049 theCopy Flag used to scale object itself or create a copy.
8052 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8053 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8055 # Example: see GEOM_TestAll.py
8056 theFactor, Parameters = ParseParameters(theFactor)
8058 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8060 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8061 RaiseIfFailed("Scale", self.TrsfOp)
8062 anObj.SetParameters(Parameters)
8065 ## Scale the given object by the factor, creating its copy before the scaling.
8066 # @param theObject The object to be scaled.
8067 # @param thePoint Center point for scaling.
8068 # Passing None for it means scaling relatively the origin of global CS.
8069 # @param theFactor Scaling factor value.
8070 # @param theName Object name; when specified, this parameter is used
8071 # for result publication in the study. Otherwise, if automatic
8072 # publication is switched on, default value is used for result name.
8074 # @return New GEOM.GEOM_Object, containing the scaled shape.
8076 # @ref tui_scale "Example"
8077 @ManageTransactions("TrsfOp")
8078 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8080 Scale the given object by the factor, creating its copy before the scaling.
8083 theObject The object to be scaled.
8084 thePoint Center point for scaling.
8085 Passing None for it means scaling relatively the origin of global CS.
8086 theFactor Scaling factor value.
8087 theName Object name; when specified, this parameter is used
8088 for result publication in the study. Otherwise, if automatic
8089 publication is switched on, default value is used for result name.
8092 New GEOM.GEOM_Object, containing the scaled shape.
8094 # Example: see GEOM_TestAll.py
8095 theFactor, Parameters = ParseParameters(theFactor)
8096 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8097 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8098 anObj.SetParameters(Parameters)
8099 self._autoPublish(anObj, theName, "scaled")
8102 ## Scale the given object by different factors along coordinate axes.
8103 # @param theObject The object to be scaled.
8104 # @param thePoint Center point for scaling.
8105 # Passing None for it means scaling relatively the origin of global CS.
8106 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8107 # @param theCopy Flag used to scale object itself or create a copy.
8108 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8109 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8110 @ManageTransactions("TrsfOp")
8111 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8113 Scale the given object by different factors along coordinate axes.
8116 theObject The object to be scaled.
8117 thePoint Center point for scaling.
8118 Passing None for it means scaling relatively the origin of global CS.
8119 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8120 theCopy Flag used to scale object itself or create a copy.
8123 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8124 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8126 # Example: see GEOM_TestAll.py
8127 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8129 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8130 theFactorX, theFactorY, theFactorZ)
8132 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8133 theFactorX, theFactorY, theFactorZ)
8134 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8135 anObj.SetParameters(Parameters)
8138 ## Scale the given object by different factors along coordinate axes,
8139 # creating its copy before the scaling.
8140 # @param theObject The object to be scaled.
8141 # @param thePoint Center point for scaling.
8142 # Passing None for it means scaling relatively the origin of global CS.
8143 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8144 # @param theName Object name; when specified, this parameter is used
8145 # for result publication in the study. Otherwise, if automatic
8146 # publication is switched on, default value is used for result name.
8148 # @return New GEOM.GEOM_Object, containing the scaled shape.
8150 # @ref swig_scale "Example"
8151 @ManageTransactions("TrsfOp")
8152 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8154 Scale the given object by different factors along coordinate axes,
8155 creating its copy before the scaling.
8158 theObject The object to be scaled.
8159 thePoint Center point for scaling.
8160 Passing None for it means scaling relatively the origin of global CS.
8161 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8162 theName Object name; when specified, this parameter is used
8163 for result publication in the study. Otherwise, if automatic
8164 publication is switched on, default value is used for result name.
8167 New GEOM.GEOM_Object, containing the scaled shape.
8169 # Example: see GEOM_TestAll.py
8170 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8171 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8172 theFactorX, theFactorY, theFactorZ)
8173 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8174 anObj.SetParameters(Parameters)
8175 self._autoPublish(anObj, theName, "scaled")
8178 ## Mirror an object relatively the given plane.
8179 # @param theObject The object to be mirrored.
8180 # @param thePlane Plane of symmetry.
8181 # @param theCopy Flag used to mirror object itself or create a copy.
8182 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8183 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8184 @ManageTransactions("TrsfOp")
8185 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8187 Mirror an object relatively the given plane.
8190 theObject The object to be mirrored.
8191 thePlane Plane of symmetry.
8192 theCopy Flag used to mirror object itself or create a copy.
8195 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8196 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8199 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8201 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8202 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8205 ## Create an object, symmetrical
8206 # to the given one relatively the given plane.
8207 # @param theObject The object to be mirrored.
8208 # @param thePlane Plane of symmetry.
8209 # @param theName Object name; when specified, this parameter is used
8210 # for result publication in the study. Otherwise, if automatic
8211 # publication is switched on, default value is used for result name.
8213 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8215 # @ref tui_mirror "Example"
8216 @ManageTransactions("TrsfOp")
8217 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8219 Create an object, symmetrical to the given one relatively the given plane.
8222 theObject The object to be mirrored.
8223 thePlane Plane of symmetry.
8224 theName Object name; when specified, this parameter is used
8225 for result publication in the study. Otherwise, if automatic
8226 publication is switched on, default value is used for result name.
8229 New GEOM.GEOM_Object, containing the mirrored shape.
8231 # Example: see GEOM_TestAll.py
8232 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8233 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8234 self._autoPublish(anObj, theName, "mirrored")
8237 ## Mirror an object relatively the given axis.
8238 # @param theObject The object to be mirrored.
8239 # @param theAxis Axis of symmetry.
8240 # @param theCopy Flag used to mirror object itself or create a copy.
8241 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8242 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8243 @ManageTransactions("TrsfOp")
8244 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8246 Mirror an object relatively the given axis.
8249 theObject The object to be mirrored.
8250 theAxis Axis of symmetry.
8251 theCopy Flag used to mirror object itself or create a copy.
8254 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8255 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8258 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8260 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8261 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8264 ## Create an object, symmetrical
8265 # to the given one relatively the given axis.
8266 # @param theObject The object to be mirrored.
8267 # @param theAxis Axis of symmetry.
8268 # @param theName Object name; when specified, this parameter is used
8269 # for result publication in the study. Otherwise, if automatic
8270 # publication is switched on, default value is used for result name.
8272 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8274 # @ref tui_mirror "Example"
8275 @ManageTransactions("TrsfOp")
8276 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8278 Create an object, symmetrical to the given one relatively the given axis.
8281 theObject The object to be mirrored.
8282 theAxis Axis of symmetry.
8283 theName Object name; when specified, this parameter is used
8284 for result publication in the study. Otherwise, if automatic
8285 publication is switched on, default value is used for result name.
8288 New GEOM.GEOM_Object, containing the mirrored shape.
8290 # Example: see GEOM_TestAll.py
8291 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8292 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8293 self._autoPublish(anObj, theName, "mirrored")
8296 ## Mirror an object relatively the given point.
8297 # @param theObject The object to be mirrored.
8298 # @param thePoint Point of symmetry.
8299 # @param theCopy Flag used to mirror object itself or create a copy.
8300 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8301 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8302 @ManageTransactions("TrsfOp")
8303 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8305 Mirror an object relatively the given point.
8308 theObject The object to be mirrored.
8309 thePoint Point of symmetry.
8310 theCopy Flag used to mirror object itself or create a copy.
8313 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8314 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8316 # Example: see GEOM_TestAll.py
8318 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8320 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8321 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8324 ## Create an object, symmetrical
8325 # to the given one relatively the given point.
8326 # @param theObject The object to be mirrored.
8327 # @param thePoint Point of symmetry.
8328 # @param theName Object name; when specified, this parameter is used
8329 # for result publication in the study. Otherwise, if automatic
8330 # publication is switched on, default value is used for result name.
8332 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8334 # @ref tui_mirror "Example"
8335 @ManageTransactions("TrsfOp")
8336 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8338 Create an object, symmetrical
8339 to the given one relatively the given point.
8342 theObject The object to be mirrored.
8343 thePoint Point of symmetry.
8344 theName Object name; when specified, this parameter is used
8345 for result publication in the study. Otherwise, if automatic
8346 publication is switched on, default value is used for result name.
8349 New GEOM.GEOM_Object, containing the mirrored shape.
8351 # Example: see GEOM_TestAll.py
8352 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8353 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8354 self._autoPublish(anObj, theName, "mirrored")
8357 ## Modify the location of the given object.
8358 # @param theObject The object to be displaced.
8359 # @param theStartLCS Coordinate system to perform displacement from it.\n
8360 # If \a theStartLCS is NULL, displacement
8361 # will be performed from global CS.\n
8362 # If \a theObject itself is used as \a theStartLCS,
8363 # its location will be changed to \a theEndLCS.
8364 # @param theEndLCS Coordinate system to perform displacement to it.
8365 # @param theCopy Flag used to displace object itself or create a copy.
8366 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8367 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8368 @ManageTransactions("TrsfOp")
8369 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8371 Modify the Location of the given object by LCS, creating its copy before the setting.
8374 theObject The object to be displaced.
8375 theStartLCS Coordinate system to perform displacement from it.
8376 If theStartLCS is NULL, displacement
8377 will be performed from global CS.
8378 If theObject itself is used as theStartLCS,
8379 its location will be changed to theEndLCS.
8380 theEndLCS Coordinate system to perform displacement to it.
8381 theCopy Flag used to displace object itself or create a copy.
8384 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8385 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8387 # Example: see GEOM_TestAll.py
8389 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8391 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8392 RaiseIfFailed("Displace", self.TrsfOp)
8395 ## Modify the Location of the given object by LCS,
8396 # creating its copy before the setting.
8397 # @param theObject The object to be displaced.
8398 # @param theStartLCS Coordinate system to perform displacement from it.\n
8399 # If \a theStartLCS is NULL, displacement
8400 # will be performed from global CS.\n
8401 # If \a theObject itself is used as \a theStartLCS,
8402 # its location will be changed to \a theEndLCS.
8403 # @param theEndLCS Coordinate system to perform displacement to it.
8404 # @param theName Object name; when specified, this parameter is used
8405 # for result publication in the study. Otherwise, if automatic
8406 # publication is switched on, default value is used for result name.
8408 # @return New GEOM.GEOM_Object, containing the displaced shape.
8410 # @ref tui_modify_location "Example"
8411 @ManageTransactions("TrsfOp")
8412 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8414 Modify the Location of the given object by LCS, creating its copy before the setting.
8417 theObject The object to be displaced.
8418 theStartLCS Coordinate system to perform displacement from it.
8419 If theStartLCS is NULL, displacement
8420 will be performed from global CS.
8421 If theObject itself is used as theStartLCS,
8422 its location will be changed to theEndLCS.
8423 theEndLCS Coordinate system to perform displacement to it.
8424 theName Object name; when specified, this parameter is used
8425 for result publication in the study. Otherwise, if automatic
8426 publication is switched on, default value is used for result name.
8429 New GEOM.GEOM_Object, containing the displaced shape.
8432 # create local coordinate systems
8433 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8434 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8435 # modify the location of the given object
8436 position = geompy.MakePosition(cylinder, cs1, cs2)
8438 # Example: see GEOM_TestAll.py
8439 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8440 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8441 self._autoPublish(anObj, theName, "displaced")
8444 ## Modify the Location of the given object by Path.
8445 # @param theObject The object to be displaced.
8446 # @param thePath Wire or Edge along that the object will be translated.
8447 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8448 # @param theCopy is to create a copy objects if true.
8449 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8450 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8451 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8453 # @ref tui_modify_location "Example"
8454 @ManageTransactions("TrsfOp")
8455 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8457 Modify the Location of the given object by Path.
8460 theObject The object to be displaced.
8461 thePath Wire or Edge along that the object will be translated.
8462 theDistance progress of Path (0 = start location, 1 = end of path location).
8463 theCopy is to create a copy objects if true.
8464 theReverse 0 - for usual direction, 1 - to reverse path direction.
8467 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8468 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8471 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8473 # Example: see GEOM_TestAll.py
8474 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8475 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8478 ## Modify the Location of the given object by Path, creating its copy before the operation.
8479 # @param theObject The object to be displaced.
8480 # @param thePath Wire or Edge along that the object will be translated.
8481 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8482 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8483 # @param theName Object name; when specified, this parameter is used
8484 # for result publication in the study. Otherwise, if automatic
8485 # publication is switched on, default value is used for result name.
8487 # @return New GEOM.GEOM_Object, containing the displaced shape.
8488 @ManageTransactions("TrsfOp")
8489 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8491 Modify the Location of the given object by Path, creating its copy before the operation.
8494 theObject The object to be displaced.
8495 thePath Wire or Edge along that the object will be translated.
8496 theDistance progress of Path (0 = start location, 1 = end of path location).
8497 theReverse 0 - for usual direction, 1 - to reverse path direction.
8498 theName Object name; when specified, this parameter is used
8499 for result publication in the study. Otherwise, if automatic
8500 publication is switched on, default value is used for result name.
8503 New GEOM.GEOM_Object, containing the displaced shape.
8505 # Example: see GEOM_TestAll.py
8506 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8507 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8508 self._autoPublish(anObj, theName, "displaced")
8511 ## Offset given shape.
8512 # @param theObject The base object for the offset.
8513 # @param theOffset Offset value.
8514 # @param theCopy Flag used to offset object itself or create a copy.
8515 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8516 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8517 @ManageTransactions("TrsfOp")
8518 def Offset(self, theObject, theOffset, theCopy=False):
8523 theObject The base object for the offset.
8524 theOffset Offset value.
8525 theCopy Flag used to offset object itself or create a copy.
8528 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8529 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8531 theOffset, Parameters = ParseParameters(theOffset)
8533 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8535 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8536 RaiseIfFailed("Offset", self.TrsfOp)
8537 anObj.SetParameters(Parameters)
8540 ## Create new object as offset of the given one.
8541 # @param theObject The base object for the offset.
8542 # @param theOffset Offset value.
8543 # @param theName Object name; when specified, this parameter is used
8544 # for result publication in the study. Otherwise, if automatic
8545 # publication is switched on, default value is used for result name.
8547 # @return New GEOM.GEOM_Object, containing the offset object.
8549 # @ref tui_offset "Example"
8550 @ManageTransactions("TrsfOp")
8551 def MakeOffset(self, theObject, theOffset, theName=None):
8553 Create new object as offset of the given one.
8556 theObject The base object for the offset.
8557 theOffset Offset value.
8558 theName Object name; when specified, this parameter is used
8559 for result publication in the study. Otherwise, if automatic
8560 publication is switched on, default value is used for result name.
8563 New GEOM.GEOM_Object, containing the offset object.
8566 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8567 # create a new object as offset of the given object
8568 offset = geompy.MakeOffset(box, 70.)
8570 # Example: see GEOM_TestAll.py
8571 theOffset, Parameters = ParseParameters(theOffset)
8572 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8573 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8574 anObj.SetParameters(Parameters)
8575 self._autoPublish(anObj, theName, "offset")
8578 ## Create new object as projection of the given one on a 2D surface.
8579 # @param theSource The source object for the projection. It can be a point, edge or wire.
8580 # @param theTarget The target object. It can be planar or cylindrical face.
8581 # @param theName Object name; when specified, this parameter is used
8582 # for result publication in the study. Otherwise, if automatic
8583 # publication is switched on, default value is used for result name.
8585 # @return New GEOM.GEOM_Object, containing the projection.
8587 # @ref tui_projection "Example"
8588 @ManageTransactions("TrsfOp")
8589 def MakeProjection(self, theSource, theTarget, theName=None):
8591 Create new object as projection of the given one on a 2D surface.
8594 theSource The source object for the projection. It can be a point, edge or wire.
8595 theTarget The target object. It can be planar or cylindrical face.
8596 theName Object name; when specified, this parameter is used
8597 for result publication in the study. Otherwise, if automatic
8598 publication is switched on, default value is used for result name.
8601 New GEOM.GEOM_Object, containing the projection.
8603 # Example: see GEOM_TestAll.py
8604 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8605 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8606 self._autoPublish(anObj, theName, "projection")
8609 ## Create a projection projection of the given point on a wire or an edge.
8610 # If there are no solutions or there are 2 or more solutions It throws an
8612 # @param thePoint the point to be projected.
8613 # @param theWire the wire. The edge is accepted as well.
8614 # @param theName Object name; when specified, this parameter is used
8615 # for result publication in the study. Otherwise, if automatic
8616 # publication is switched on, default value is used for result name.
8618 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8619 # \n \a u: The parameter of projection point on edge.
8620 # \n \a PointOnEdge: The projection point.
8621 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8623 # @ref tui_projection "Example"
8624 @ManageTransactions("TrsfOp")
8625 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8627 Create a projection projection of the given point on a wire or an edge.
8628 If there are no solutions or there are 2 or more solutions It throws an
8632 thePoint the point to be projected.
8633 theWire the wire. The edge is accepted as well.
8634 theName Object name; when specified, this parameter is used
8635 for result publication in the study. Otherwise, if automatic
8636 publication is switched on, default value is used for result name.
8639 [u, PointOnEdge, EdgeInWireIndex]
8640 u: The parameter of projection point on edge.
8641 PointOnEdge: The projection point.
8642 EdgeInWireIndex: The index of an edge in a wire.
8644 # Example: see GEOM_TestAll.py
8645 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8646 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8647 self._autoPublish(anObj[1], theName, "projection")
8650 # -----------------------------------------------------------------------------
8652 # -----------------------------------------------------------------------------
8654 ## Translate the given object along the given vector a given number times
8655 # @param theObject The object to be translated.
8656 # @param theVector Direction of the translation. DX if None.
8657 # @param theStep Distance to translate on.
8658 # @param theNbTimes Quantity of translations to be done.
8659 # @param theName Object name; when specified, this parameter is used
8660 # for result publication in the study. Otherwise, if automatic
8661 # publication is switched on, default value is used for result name.
8663 # @return New GEOM.GEOM_Object, containing compound of all
8664 # the shapes, obtained after each translation.
8666 # @ref tui_multi_translation "Example"
8667 @ManageTransactions("TrsfOp")
8668 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8670 Translate the given object along the given vector a given number times
8673 theObject The object to be translated.
8674 theVector Direction of the translation. DX if None.
8675 theStep Distance to translate on.
8676 theNbTimes Quantity of translations to be done.
8677 theName Object name; when specified, this parameter is used
8678 for result publication in the study. Otherwise, if automatic
8679 publication is switched on, default value is used for result name.
8682 New GEOM.GEOM_Object, containing compound of all
8683 the shapes, obtained after each translation.
8686 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8688 # Example: see GEOM_TestAll.py
8689 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8690 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8691 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8692 anObj.SetParameters(Parameters)
8693 self._autoPublish(anObj, theName, "multitranslation")
8696 ## Conseqently apply two specified translations to theObject specified number of times.
8697 # @param theObject The object to be translated.
8698 # @param theVector1 Direction of the first translation. DX if None.
8699 # @param theStep1 Step of the first translation.
8700 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8701 # @param theVector2 Direction of the second translation. DY if None.
8702 # @param theStep2 Step of the second translation.
8703 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8704 # @param theName Object name; when specified, this parameter is used
8705 # for result publication in the study. Otherwise, if automatic
8706 # publication is switched on, default value is used for result name.
8708 # @return New GEOM.GEOM_Object, containing compound of all
8709 # the shapes, obtained after each translation.
8711 # @ref tui_multi_translation "Example"
8712 @ManageTransactions("TrsfOp")
8713 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8714 theVector2, theStep2, theNbTimes2, theName=None):
8716 Conseqently apply two specified translations to theObject specified number of times.
8719 theObject The object to be translated.
8720 theVector1 Direction of the first translation. DX if None.
8721 theStep1 Step of the first translation.
8722 theNbTimes1 Quantity of translations to be done along theVector1.
8723 theVector2 Direction of the second translation. DY if None.
8724 theStep2 Step of the second translation.
8725 theNbTimes2 Quantity of translations to be done along theVector2.
8726 theName Object name; when specified, this parameter is used
8727 for result publication in the study. Otherwise, if automatic
8728 publication is switched on, default value is used for result name.
8731 New GEOM.GEOM_Object, containing compound of all
8732 the shapes, obtained after each translation.
8735 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8737 # Example: see GEOM_TestAll.py
8738 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8739 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8740 theVector2, theStep2, theNbTimes2)
8741 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8742 anObj.SetParameters(Parameters)
8743 self._autoPublish(anObj, theName, "multitranslation")
8746 ## Rotate the given object around the given axis a given number times.
8747 # Rotation angle will be 2*PI/theNbTimes.
8748 # @param theObject The object to be rotated.
8749 # @param theAxis The rotation axis. DZ if None.
8750 # @param theNbTimes Quantity of rotations to be done.
8751 # @param theName Object name; when specified, this parameter is used
8752 # for result publication in the study. Otherwise, if automatic
8753 # publication is switched on, default value is used for result name.
8755 # @return New GEOM.GEOM_Object, containing compound of all the
8756 # shapes, obtained after each rotation.
8758 # @ref tui_multi_rotation "Example"
8759 @ManageTransactions("TrsfOp")
8760 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8762 Rotate the given object around the given axis a given number times.
8763 Rotation angle will be 2*PI/theNbTimes.
8766 theObject The object to be rotated.
8767 theAxis The rotation axis. DZ if None.
8768 theNbTimes Quantity of rotations to be done.
8769 theName Object name; when specified, this parameter is used
8770 for result publication in the study. Otherwise, if automatic
8771 publication is switched on, default value is used for result name.
8774 New GEOM.GEOM_Object, containing compound of all the
8775 shapes, obtained after each rotation.
8778 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8780 # Example: see GEOM_TestAll.py
8781 theNbTimes, Parameters = ParseParameters(theNbTimes)
8782 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8783 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8784 anObj.SetParameters(Parameters)
8785 self._autoPublish(anObj, theName, "multirotation")
8788 ## Rotate the given object around the given axis
8789 # a given number times on the given angle.
8790 # @param theObject The object to be rotated.
8791 # @param theAxis The rotation axis. DZ if None.
8792 # @param theAngleStep Rotation angle in radians.
8793 # @param theNbTimes Quantity of rotations to be done.
8794 # @param theName Object name; when specified, this parameter is used
8795 # for result publication in the study. Otherwise, if automatic
8796 # publication is switched on, default value is used for result name.
8798 # @return New GEOM.GEOM_Object, containing compound of all the
8799 # shapes, obtained after each rotation.
8801 # @ref tui_multi_rotation "Example"
8802 @ManageTransactions("TrsfOp")
8803 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8805 Rotate the given object around the given axis
8806 a given number times on the given angle.
8809 theObject The object to be rotated.
8810 theAxis The rotation axis. DZ if None.
8811 theAngleStep Rotation angle in radians.
8812 theNbTimes Quantity of rotations to be done.
8813 theName Object name; when specified, this parameter is used
8814 for result publication in the study. Otherwise, if automatic
8815 publication is switched on, default value is used for result name.
8818 New GEOM.GEOM_Object, containing compound of all the
8819 shapes, obtained after each rotation.
8822 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8824 # Example: see GEOM_TestAll.py
8825 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8826 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8827 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8828 anObj.SetParameters(Parameters)
8829 self._autoPublish(anObj, theName, "multirotation")
8832 ## Rotate the given object around the given axis a given
8833 # number times and multi-translate each rotation result.
8834 # Rotation angle will be 2*PI/theNbTimes1.
8835 # Translation direction passes through center of gravity
8836 # of rotated shape and its projection on the rotation axis.
8837 # @param theObject The object to be rotated.
8838 # @param theAxis Rotation axis. DZ if None.
8839 # @param theNbTimes1 Quantity of rotations to be done.
8840 # @param theRadialStep Translation distance.
8841 # @param theNbTimes2 Quantity of translations to be done.
8842 # @param theName Object name; when specified, this parameter is used
8843 # for result publication in the study. Otherwise, if automatic
8844 # publication is switched on, default value is used for result name.
8846 # @return New GEOM.GEOM_Object, containing compound of all the
8847 # shapes, obtained after each transformation.
8849 # @ref tui_multi_rotation "Example"
8850 @ManageTransactions("TrsfOp")
8851 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8853 Rotate the given object around the
8854 given axis on the given angle a given number
8855 times and multi-translate each rotation result.
8856 Translation direction passes through center of gravity
8857 of rotated shape and its projection on the rotation axis.
8860 theObject The object to be rotated.
8861 theAxis Rotation axis. DZ if None.
8862 theNbTimes1 Quantity of rotations to be done.
8863 theRadialStep Translation distance.
8864 theNbTimes2 Quantity of translations to be done.
8865 theName Object name; when specified, this parameter is used
8866 for result publication in the study. Otherwise, if automatic
8867 publication is switched on, default value is used for result name.
8870 New GEOM.GEOM_Object, containing compound of all the
8871 shapes, obtained after each transformation.
8874 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8876 # Example: see GEOM_TestAll.py
8877 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8878 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8879 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8880 anObj.SetParameters(Parameters)
8881 self._autoPublish(anObj, theName, "multirotation")
8884 ## Rotate the given object around the
8885 # given axis on the given angle a given number
8886 # times and multi-translate each rotation result.
8887 # Translation direction passes through center of gravity
8888 # of rotated shape and its projection on the rotation axis.
8889 # @param theObject The object to be rotated.
8890 # @param theAxis Rotation axis. DZ if None.
8891 # @param theAngleStep Rotation angle in radians.
8892 # @param theNbTimes1 Quantity of rotations to be done.
8893 # @param theRadialStep Translation distance.
8894 # @param theNbTimes2 Quantity of translations to be done.
8895 # @param theName Object name; when specified, this parameter is used
8896 # for result publication in the study. Otherwise, if automatic
8897 # publication is switched on, default value is used for result name.
8899 # @return New GEOM.GEOM_Object, containing compound of all the
8900 # shapes, obtained after each transformation.
8902 # @ref tui_multi_rotation "Example"
8903 @ManageTransactions("TrsfOp")
8904 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8906 Rotate the given object around the
8907 given axis on the given angle a given number
8908 times and multi-translate each rotation result.
8909 Translation direction passes through center of gravity
8910 of rotated shape and its projection on the rotation axis.
8913 theObject The object to be rotated.
8914 theAxis Rotation axis. DZ if None.
8915 theAngleStep Rotation angle in radians.
8916 theNbTimes1 Quantity of rotations to be done.
8917 theRadialStep Translation distance.
8918 theNbTimes2 Quantity of translations to be done.
8919 theName Object name; when specified, this parameter is used
8920 for result publication in the study. Otherwise, if automatic
8921 publication is switched on, default value is used for result name.
8924 New GEOM.GEOM_Object, containing compound of all the
8925 shapes, obtained after each transformation.
8928 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8930 # Example: see GEOM_TestAll.py
8931 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8932 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8933 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8934 anObj.SetParameters(Parameters)
8935 self._autoPublish(anObj, theName, "multirotation")
8938 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8940 # @ref swig_MakeMultiRotation "Example"
8941 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8943 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8946 pz = geompy.MakeVertex(0, 0, 100)
8947 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8948 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8950 # Example: see GEOM_TestOthers.py
8951 aVec = self.MakeLine(aPoint,aDir)
8952 # note: auto-publishing is done in self.MultiRotate1D()
8953 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8956 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8958 # @ref swig_MakeMultiRotation "Example"
8959 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8961 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8964 pz = geompy.MakeVertex(0, 0, 100)
8965 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8966 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8968 # Example: see GEOM_TestOthers.py
8969 aVec = self.MakeLine(aPoint,aDir)
8970 # note: auto-publishing is done in self.MultiRotate1D()
8971 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8974 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8976 # @ref swig_MakeMultiRotation "Example"
8977 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8979 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8982 pz = geompy.MakeVertex(0, 0, 100)
8983 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8984 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8986 # Example: see GEOM_TestOthers.py
8987 aVec = self.MakeLine(aPoint,aDir)
8988 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8989 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8992 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8994 # @ref swig_MakeMultiRotation "Example"
8995 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8997 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9000 pz = geompy.MakeVertex(0, 0, 100)
9001 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9002 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9004 # Example: see GEOM_TestOthers.py
9005 aVec = self.MakeLine(aPoint,aDir)
9006 # note: auto-publishing is done in self.MultiRotate2D()
9007 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9010 # end of l3_transform
9013 ## @addtogroup l3_transform_d
9016 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9017 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9019 Deprecated method. Use MultiRotate1DNbTimes instead.
9021 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9022 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9024 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9025 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9026 @ManageTransactions("TrsfOp")
9027 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9029 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9030 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9033 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9035 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9036 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9037 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9038 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9039 anObj.SetParameters(Parameters)
9040 self._autoPublish(anObj, theName, "multirotation")
9043 ## The same, as MultiRotate1D(), but axis is given by direction and point
9044 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9045 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9047 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9048 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9051 pz = geompy.MakeVertex(0, 0, 100)
9052 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9053 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9055 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9056 aVec = self.MakeLine(aPoint,aDir)
9057 # note: auto-publishing is done in self.MultiRotate1D()
9058 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9061 ## The same, as MultiRotate2D(), but axis is given by direction and point
9062 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9063 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9065 The same, as MultiRotate2D(), but axis is given by direction and point
9066 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9069 pz = geompy.MakeVertex(0, 0, 100)
9070 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9071 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9073 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9074 aVec = self.MakeLine(aPoint,aDir)
9075 # note: auto-publishing is done in self.MultiRotate2D()
9076 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9079 # end of l3_transform_d
9082 ## @addtogroup l3_local
9085 ## Perform a fillet on all edges of the given shape.
9086 # @param theShape Shape, to perform fillet on.
9087 # @param theR Fillet radius.
9088 # @param theName Object name; when specified, this parameter is used
9089 # for result publication in the study. Otherwise, if automatic
9090 # publication is switched on, default value is used for result name.
9092 # @return New GEOM.GEOM_Object, containing the result shape.
9094 # @ref tui_fillet "Example 1"
9095 # \n @ref swig_MakeFilletAll "Example 2"
9096 @ManageTransactions("LocalOp")
9097 def MakeFilletAll(self, theShape, theR, theName=None):
9099 Perform a fillet on all edges of the given shape.
9102 theShape Shape, to perform fillet on.
9104 theName Object name; when specified, this parameter is used
9105 for result publication in the study. Otherwise, if automatic
9106 publication is switched on, default value is used for result name.
9109 New GEOM.GEOM_Object, containing the result shape.
9112 filletall = geompy.MakeFilletAll(prism, 10.)
9114 # Example: see GEOM_TestOthers.py
9115 theR,Parameters = ParseParameters(theR)
9116 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9117 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9118 anObj.SetParameters(Parameters)
9119 self._autoPublish(anObj, theName, "fillet")
9122 ## Perform a fillet on the specified edges/faces of the given shape
9123 # @param theShape Shape, to perform fillet on.
9124 # @param theR Fillet radius.
9125 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9126 # @param theListShapes Global indices of edges/faces to perform fillet on.
9127 # @param theName Object name; when specified, this parameter is used
9128 # for result publication in the study. Otherwise, if automatic
9129 # publication is switched on, default value is used for result name.
9131 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9133 # @return New GEOM.GEOM_Object, containing the result shape.
9135 # @ref tui_fillet "Example"
9136 @ManageTransactions("LocalOp")
9137 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9139 Perform a fillet on the specified edges/faces of the given shape
9142 theShape Shape, to perform fillet on.
9144 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9145 theListShapes Global indices of edges/faces to perform fillet on.
9146 theName Object name; when specified, this parameter is used
9147 for result publication in the study. Otherwise, if automatic
9148 publication is switched on, default value is used for result name.
9151 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9154 New GEOM.GEOM_Object, containing the result shape.
9157 # get the list of IDs (IDList) for the fillet
9158 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9160 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9161 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9162 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9163 # make a fillet on the specified edges of the given shape
9164 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9166 # Example: see GEOM_TestAll.py
9167 theR,Parameters = ParseParameters(theR)
9169 if theShapeType == self.ShapeType["EDGE"]:
9170 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9171 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9173 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9174 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9175 anObj.SetParameters(Parameters)
9176 self._autoPublish(anObj, theName, "fillet")
9179 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9180 @ManageTransactions("LocalOp")
9181 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9183 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9186 # get the list of IDs (IDList) for the fillet
9187 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9189 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9190 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9191 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9192 # make a fillet on the specified edges of the given shape
9193 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9195 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9197 if theShapeType == self.ShapeType["EDGE"]:
9198 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9199 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9201 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9202 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9203 anObj.SetParameters(Parameters)
9204 self._autoPublish(anObj, theName, "fillet")
9207 ## Perform a fillet on the specified edges of the given shape
9208 # @param theShape Wire Shape to perform fillet on.
9209 # @param theR Fillet radius.
9210 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9211 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9212 # \note The list of vertices could be empty,
9213 # in this case fillet will done done at all vertices in wire
9214 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9215 # by the length of the edges, nearest to the fillet vertex.
9216 # But sometimes the next edge is C1 continuous with the one, nearest to
9217 # the fillet point, and such two (or more) edges can be united to allow
9218 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9219 # thus ignoring the secant vertex (vertices).
9220 # @param theName Object name; when specified, this parameter is used
9221 # for result publication in the study. Otherwise, if automatic
9222 # publication is switched on, default value is used for result name.
9224 # @return New GEOM.GEOM_Object, containing the result shape.
9226 # @ref tui_fillet2d "Example"
9227 @ManageTransactions("LocalOp")
9228 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9230 Perform a fillet on the specified edges of the given shape
9233 theShape Wire Shape to perform fillet on.
9235 theListOfVertexes Global indices of vertexes to perform fillet on.
9236 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9237 by the length of the edges, nearest to the fillet vertex.
9238 But sometimes the next edge is C1 continuous with the one, nearest to
9239 the fillet point, and such two (or more) edges can be united to allow
9240 bigger radius. Set this flag to TRUE to allow collinear edges union,
9241 thus ignoring the secant vertex (vertices).
9242 theName Object name; when specified, this parameter is used
9243 for result publication in the study. Otherwise, if automatic
9244 publication is switched on, default value is used for result name.
9246 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9248 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9251 New GEOM.GEOM_Object, containing the result shape.
9255 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9256 # make fillet at given wire vertices with giver radius
9257 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9259 # Example: see GEOM_TestAll.py
9260 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9261 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9262 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9263 anObj.SetParameters(Parameters)
9264 self._autoPublish(anObj, theName, "fillet")
9267 ## Perform a fillet at the specified vertices of the given face/shell.
9268 # @param theShape Face or Shell shape to perform fillet on.
9269 # @param theR Fillet radius.
9270 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9271 # @param theName Object name; when specified, this parameter is used
9272 # for result publication in the study. Otherwise, if automatic
9273 # publication is switched on, default value is used for result name.
9275 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9277 # @return New GEOM.GEOM_Object, containing the result shape.
9279 # @ref tui_fillet2d "Example"
9280 @ManageTransactions("LocalOp")
9281 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9283 Perform a fillet at the specified vertices of the given face/shell.
9286 theShape Face or Shell shape to perform fillet on.
9288 theListOfVertexes Global indices of vertexes to perform fillet on.
9289 theName Object name; when specified, this parameter is used
9290 for result publication in the study. Otherwise, if automatic
9291 publication is switched on, default value is used for result name.
9293 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9296 New GEOM.GEOM_Object, containing the result shape.
9299 face = geompy.MakeFaceHW(100, 100, 1)
9300 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9302 # Example: see GEOM_TestAll.py
9303 theR,Parameters = ParseParameters(theR)
9304 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9305 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9306 anObj.SetParameters(Parameters)
9307 self._autoPublish(anObj, theName, "fillet")
9310 ## Perform a symmetric chamfer on all edges of the given shape.
9311 # @param theShape Shape, to perform chamfer on.
9312 # @param theD Chamfer size along each face.
9313 # @param theName Object name; when specified, this parameter is used
9314 # for result publication in the study. Otherwise, if automatic
9315 # publication is switched on, default value is used for result name.
9317 # @return New GEOM.GEOM_Object, containing the result shape.
9319 # @ref tui_chamfer "Example 1"
9320 # \n @ref swig_MakeChamferAll "Example 2"
9321 @ManageTransactions("LocalOp")
9322 def MakeChamferAll(self, theShape, theD, theName=None):
9324 Perform a symmetric chamfer on all edges of the given shape.
9327 theShape Shape, to perform chamfer on.
9328 theD Chamfer size along each face.
9329 theName Object name; when specified, this parameter is used
9330 for result publication in the study. Otherwise, if automatic
9331 publication is switched on, default value is used for result name.
9334 New GEOM.GEOM_Object, containing the result shape.
9337 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9339 # Example: see GEOM_TestOthers.py
9340 theD,Parameters = ParseParameters(theD)
9341 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9342 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9343 anObj.SetParameters(Parameters)
9344 self._autoPublish(anObj, theName, "chamfer")
9347 ## Perform a chamfer on edges, common to the specified faces,
9348 # with distance D1 on the Face1
9349 # @param theShape Shape, to perform chamfer on.
9350 # @param theD1 Chamfer size along \a theFace1.
9351 # @param theD2 Chamfer size along \a theFace2.
9352 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9353 # @param theName Object name; when specified, this parameter is used
9354 # for result publication in the study. Otherwise, if automatic
9355 # publication is switched on, default value is used for result name.
9357 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9359 # @return New GEOM.GEOM_Object, containing the result shape.
9361 # @ref tui_chamfer "Example"
9362 @ManageTransactions("LocalOp")
9363 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9365 Perform a chamfer on edges, common to the specified faces,
9366 with distance D1 on the Face1
9369 theShape Shape, to perform chamfer on.
9370 theD1 Chamfer size along theFace1.
9371 theD2 Chamfer size along theFace2.
9372 theFace1,theFace2 Global indices of two faces of theShape.
9373 theName Object name; when specified, this parameter is used
9374 for result publication in the study. Otherwise, if automatic
9375 publication is switched on, default value is used for result name.
9378 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9381 New GEOM.GEOM_Object, containing the result shape.
9384 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9385 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9386 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9387 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9389 # Example: see GEOM_TestAll.py
9390 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9391 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9392 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9393 anObj.SetParameters(Parameters)
9394 self._autoPublish(anObj, theName, "chamfer")
9397 ## Perform a chamfer on edges
9398 # @param theShape Shape, to perform chamfer on.
9399 # @param theD Chamfer length
9400 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9401 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9402 # @param theName Object name; when specified, this parameter is used
9403 # for result publication in the study. Otherwise, if automatic
9404 # publication is switched on, default value is used for result name.
9406 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9408 # @return New GEOM.GEOM_Object, containing the result shape.
9409 @ManageTransactions("LocalOp")
9410 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9412 Perform a chamfer on edges
9415 theShape Shape, to perform chamfer on.
9416 theD1 Chamfer size along theFace1.
9417 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9418 theFace1,theFace2 Global indices of two faces of theShape.
9419 theName Object name; when specified, this parameter is used
9420 for result publication in the study. Otherwise, if automatic
9421 publication is switched on, default value is used for result name.
9424 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9427 New GEOM.GEOM_Object, containing the result shape.
9430 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9431 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9432 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9434 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9437 if isinstance(theAngle,str):
9439 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9441 theAngle = theAngle*math.pi/180.0
9442 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9443 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9444 anObj.SetParameters(Parameters)
9445 self._autoPublish(anObj, theName, "chamfer")
9448 ## Perform a chamfer on all edges of the specified faces,
9449 # with distance D1 on the first specified face (if several for one edge)
9450 # @param theShape Shape, to perform chamfer on.
9451 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9452 # connected to the edge, are in \a theFaces, \a theD1
9453 # will be get along face, which is nearer to \a theFaces beginning.
9454 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9455 # @param theFaces Sequence of global indices of faces of \a theShape.
9456 # @param theName Object name; when specified, this parameter is used
9457 # for result publication in the study. Otherwise, if automatic
9458 # publication is switched on, default value is used for result name.
9460 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9462 # @return New GEOM.GEOM_Object, containing the result shape.
9464 # @ref tui_chamfer "Example"
9465 @ManageTransactions("LocalOp")
9466 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9468 Perform a chamfer on all edges of the specified faces,
9469 with distance D1 on the first specified face (if several for one edge)
9472 theShape Shape, to perform chamfer on.
9473 theD1 Chamfer size along face from theFaces. If both faces,
9474 connected to the edge, are in theFaces, theD1
9475 will be get along face, which is nearer to theFaces beginning.
9476 theD2 Chamfer size along another of two faces, connected to the edge.
9477 theFaces Sequence of global indices of faces of theShape.
9478 theName Object name; when specified, this parameter is used
9479 for result publication in the study. Otherwise, if automatic
9480 publication is switched on, default value is used for result name.
9482 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9485 New GEOM.GEOM_Object, containing the result shape.
9487 # Example: see GEOM_TestAll.py
9488 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9489 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9490 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9491 anObj.SetParameters(Parameters)
9492 self._autoPublish(anObj, theName, "chamfer")
9495 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9496 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9498 # @ref swig_FilletChamfer "Example"
9499 @ManageTransactions("LocalOp")
9500 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9502 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9503 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9506 if isinstance(theAngle,str):
9508 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9510 theAngle = theAngle*math.pi/180.0
9511 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9512 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9513 anObj.SetParameters(Parameters)
9514 self._autoPublish(anObj, theName, "chamfer")
9517 ## Perform a chamfer on edges,
9518 # with distance D1 on the first specified face (if several for one edge)
9519 # @param theShape Shape, to perform chamfer on.
9520 # @param theD1,theD2 Chamfer size
9521 # @param theEdges Sequence of edges of \a theShape.
9522 # @param theName Object name; when specified, this parameter is used
9523 # for result publication in the study. Otherwise, if automatic
9524 # publication is switched on, default value is used for result name.
9526 # @return New GEOM.GEOM_Object, containing the result shape.
9528 # @ref swig_FilletChamfer "Example"
9529 @ManageTransactions("LocalOp")
9530 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9532 Perform a chamfer on edges,
9533 with distance D1 on the first specified face (if several for one edge)
9536 theShape Shape, to perform chamfer on.
9537 theD1,theD2 Chamfer size
9538 theEdges Sequence of edges of theShape.
9539 theName Object name; when specified, this parameter is used
9540 for result publication in the study. Otherwise, if automatic
9541 publication is switched on, default value is used for result name.
9544 New GEOM.GEOM_Object, containing the result shape.
9546 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9547 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9548 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9549 anObj.SetParameters(Parameters)
9550 self._autoPublish(anObj, theName, "chamfer")
9553 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9554 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9555 @ManageTransactions("LocalOp")
9556 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9558 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9559 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9562 if isinstance(theAngle,str):
9564 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9566 theAngle = theAngle*math.pi/180.0
9567 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9568 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9569 anObj.SetParameters(Parameters)
9570 self._autoPublish(anObj, theName, "chamfer")
9573 ## @sa MakeChamferEdge(), MakeChamferFaces()
9575 # @ref swig_MakeChamfer "Example"
9576 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9578 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9580 # Example: see GEOM_TestOthers.py
9582 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9583 if aShapeType == self.ShapeType["EDGE"]:
9584 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9586 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9589 ## Remove material from a solid by extrusion of the base shape on the given distance.
9590 # @param theInit Shape to remove material from. It must be a solid or
9591 # a compound made of a single solid.
9592 # @param theBase Closed edge or wire defining the base shape to be extruded.
9593 # @param theH Prism dimension along the normal to theBase
9594 # @param theAngle Draft angle in degrees.
9595 # @param theName Object name; when specified, this parameter is used
9596 # for result publication in the study. Otherwise, if automatic
9597 # publication is switched on, default value is used for result name.
9599 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9601 # @ref tui_creation_prism "Example"
9602 @ManageTransactions("PrimOp")
9603 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9605 Add material to a solid by extrusion of the base shape on the given distance.
9608 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9609 theBase Closed edge or wire defining the base shape to be extruded.
9610 theH Prism dimension along the normal to theBase
9611 theAngle Draft angle in degrees.
9612 theName Object name; when specified, this parameter is used
9613 for result publication in the study. Otherwise, if automatic
9614 publication is switched on, default value is used for result name.
9617 New GEOM.GEOM_Object, containing the initial shape with removed material.
9619 # Example: see GEOM_TestAll.py
9620 #theH,Parameters = ParseParameters(theH)
9621 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9622 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9623 #anObj.SetParameters(Parameters)
9624 self._autoPublish(anObj, theName, "extrudedCut")
9627 ## Add material to a solid by extrusion of the base shape on the given distance.
9628 # @param theInit Shape to add material to. It must be a solid or
9629 # a compound made of a single solid.
9630 # @param theBase Closed edge or wire defining the base shape to be extruded.
9631 # @param theH Prism dimension along the normal to theBase
9632 # @param theAngle Draft angle in degrees.
9633 # @param theName Object name; when specified, this parameter is used
9634 # for result publication in the study. Otherwise, if automatic
9635 # publication is switched on, default value is used for result name.
9637 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9639 # @ref tui_creation_prism "Example"
9640 @ManageTransactions("PrimOp")
9641 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9643 Add material to a solid by extrusion of the base shape on the given distance.
9646 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9647 theBase Closed edge or wire defining the base shape to be extruded.
9648 theH Prism dimension along the normal to theBase
9649 theAngle Draft angle in degrees.
9650 theName Object name; when specified, this parameter is used
9651 for result publication in the study. Otherwise, if automatic
9652 publication is switched on, default value is used for result name.
9655 New GEOM.GEOM_Object, containing the initial shape with added material.
9657 # Example: see GEOM_TestAll.py
9658 #theH,Parameters = ParseParameters(theH)
9659 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9660 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9661 #anObj.SetParameters(Parameters)
9662 self._autoPublish(anObj, theName, "extrudedBoss")
9668 ## @addtogroup l3_basic_op
9671 ## Perform an Archimde operation on the given shape with given parameters.
9672 # The object presenting the resulting face is returned.
9673 # @param theShape Shape to be put in water.
9674 # @param theWeight Weight og the shape.
9675 # @param theWaterDensity Density of the water.
9676 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9677 # @param theName Object name; when specified, this parameter is used
9678 # for result publication in the study. Otherwise, if automatic
9679 # publication is switched on, default value is used for result name.
9681 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9682 # by a plane, corresponding to water level.
9684 # @ref tui_archimede "Example"
9685 @ManageTransactions("LocalOp")
9686 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9688 Perform an Archimde operation on the given shape with given parameters.
9689 The object presenting the resulting face is returned.
9692 theShape Shape to be put in water.
9693 theWeight Weight og the shape.
9694 theWaterDensity Density of the water.
9695 theMeshDeflection Deflection of the mesh, using to compute the section.
9696 theName Object name; when specified, this parameter is used
9697 for result publication in the study. Otherwise, if automatic
9698 publication is switched on, default value is used for result name.
9701 New GEOM.GEOM_Object, containing a section of theShape
9702 by a plane, corresponding to water level.
9704 # Example: see GEOM_TestAll.py
9705 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9706 theWeight,theWaterDensity,theMeshDeflection)
9707 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9708 RaiseIfFailed("MakeArchimede", self.LocalOp)
9709 anObj.SetParameters(Parameters)
9710 self._autoPublish(anObj, theName, "archimede")
9713 # end of l3_basic_op
9716 ## @addtogroup l2_measure
9719 ## Get point coordinates
9722 # @ref tui_measurement_tools_page "Example"
9723 @ManageTransactions("MeasuOp")
9724 def PointCoordinates(self,Point):
9726 Get point coordinates
9731 # Example: see GEOM_TestMeasures.py
9732 aTuple = self.MeasuOp.PointCoordinates(Point)
9733 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9736 ## Get vector coordinates
9739 # @ref tui_measurement_tools_page "Example"
9740 def VectorCoordinates(self,Vector):
9742 Get vector coordinates
9748 p1=self.GetFirstVertex(Vector)
9749 p2=self.GetLastVertex(Vector)
9751 X1=self.PointCoordinates(p1)
9752 X2=self.PointCoordinates(p2)
9754 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9757 ## Compute cross product
9758 # @return vector w=u^v
9760 # @ref tui_measurement_tools_page "Example"
9761 def CrossProduct(self, Vector1, Vector2):
9763 Compute cross product
9765 Returns: vector w=u^v
9767 u=self.VectorCoordinates(Vector1)
9768 v=self.VectorCoordinates(Vector2)
9769 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])
9773 ## Compute cross product
9774 # @return dot product p=u.v
9776 # @ref tui_measurement_tools_page "Example"
9777 def DotProduct(self, Vector1, Vector2):
9779 Compute cross product
9781 Returns: dot product p=u.v
9783 u=self.VectorCoordinates(Vector1)
9784 v=self.VectorCoordinates(Vector2)
9785 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9790 ## Get summarized length of all wires,
9791 # area of surface and volume of the given shape.
9792 # @param theShape Shape to define properties of.
9793 # @return [theLength, theSurfArea, theVolume]\n
9794 # theLength: Summarized length of all wires of the given shape.\n
9795 # theSurfArea: Area of surface of the given shape.\n
9796 # theVolume: Volume of the given shape.
9798 # @ref tui_measurement_tools_page "Example"
9799 @ManageTransactions("MeasuOp")
9800 def BasicProperties(self,theShape):
9802 Get summarized length of all wires,
9803 area of surface and volume of the given shape.
9806 theShape Shape to define properties of.
9809 [theLength, theSurfArea, theVolume]
9810 theLength: Summarized length of all wires of the given shape.
9811 theSurfArea: Area of surface of the given shape.
9812 theVolume: Volume of the given shape.
9814 # Example: see GEOM_TestMeasures.py
9815 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9816 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9819 ## Get parameters of bounding box of the given shape
9820 # @param theShape Shape to obtain bounding box of.
9821 # @param precise TRUE for precise computation; FALSE for fast one.
9822 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9823 # Xmin,Xmax: Limits of shape along OX axis.
9824 # Ymin,Ymax: Limits of shape along OY axis.
9825 # Zmin,Zmax: Limits of shape along OZ axis.
9827 # @ref tui_measurement_tools_page "Example"
9828 @ManageTransactions("MeasuOp")
9829 def BoundingBox (self, theShape, precise=False):
9831 Get parameters of bounding box of the given shape
9834 theShape Shape to obtain bounding box of.
9835 precise TRUE for precise computation; FALSE for fast one.
9838 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9839 Xmin,Xmax: Limits of shape along OX axis.
9840 Ymin,Ymax: Limits of shape along OY axis.
9841 Zmin,Zmax: Limits of shape along OZ axis.
9843 # Example: see GEOM_TestMeasures.py
9844 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9845 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9848 ## Get bounding box of the given shape
9849 # @param theShape Shape to obtain bounding box of.
9850 # @param precise TRUE for precise computation; FALSE for fast one.
9851 # @param theName Object name; when specified, this parameter is used
9852 # for result publication in the study. Otherwise, if automatic
9853 # publication is switched on, default value is used for result name.
9855 # @return New GEOM.GEOM_Object, containing the created box.
9857 # @ref tui_measurement_tools_page "Example"
9858 @ManageTransactions("MeasuOp")
9859 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9861 Get bounding box of the given shape
9864 theShape Shape to obtain bounding box of.
9865 precise TRUE for precise computation; FALSE for fast one.
9866 theName Object name; when specified, this parameter is used
9867 for result publication in the study. Otherwise, if automatic
9868 publication is switched on, default value is used for result name.
9871 New GEOM.GEOM_Object, containing the created box.
9873 # Example: see GEOM_TestMeasures.py
9874 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9875 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9876 self._autoPublish(anObj, theName, "bndbox")
9879 ## Get inertia matrix and moments of inertia of theShape.
9880 # @param theShape Shape to calculate inertia of.
9881 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9882 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9883 # Ix,Iy,Iz: Moments of inertia of the given shape.
9885 # @ref tui_measurement_tools_page "Example"
9886 @ManageTransactions("MeasuOp")
9887 def Inertia(self,theShape):
9889 Get inertia matrix and moments of inertia of theShape.
9892 theShape Shape to calculate inertia of.
9895 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9896 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9897 Ix,Iy,Iz: Moments of inertia of the given shape.
9899 # Example: see GEOM_TestMeasures.py
9900 aTuple = self.MeasuOp.GetInertia(theShape)
9901 RaiseIfFailed("GetInertia", self.MeasuOp)
9904 ## Get if coords are included in the shape (ST_IN or ST_ON)
9905 # @param theShape Shape
9906 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9907 # @param tolerance to be used (default is 1.0e-7)
9908 # @return list_of_boolean = [res1, res2, ...]
9909 @ManageTransactions("MeasuOp")
9910 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9912 Get if coords are included in the shape (ST_IN or ST_ON)
9916 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9917 tolerance to be used (default is 1.0e-7)
9920 list_of_boolean = [res1, res2, ...]
9922 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9924 ## Get minimal distance between the given shapes.
9925 # @param theShape1,theShape2 Shapes to find minimal distance between.
9926 # @return Value of the minimal distance between the given shapes.
9928 # @ref tui_measurement_tools_page "Example"
9929 @ManageTransactions("MeasuOp")
9930 def MinDistance(self, theShape1, theShape2):
9932 Get minimal distance between the given shapes.
9935 theShape1,theShape2 Shapes to find minimal distance between.
9938 Value of the minimal distance between the given shapes.
9940 # Example: see GEOM_TestMeasures.py
9941 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9942 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9945 ## Get minimal distance between the given shapes.
9946 # @param theShape1,theShape2 Shapes to find minimal distance between.
9947 # @return Value of the minimal distance between the given shapes, in form of list
9948 # [Distance, DX, DY, DZ].
9950 # @ref swig_all_measure "Example"
9951 @ManageTransactions("MeasuOp")
9952 def MinDistanceComponents(self, theShape1, theShape2):
9954 Get minimal distance between the given shapes.
9957 theShape1,theShape2 Shapes to find minimal distance between.
9960 Value of the minimal distance between the given shapes, in form of list
9961 [Distance, DX, DY, DZ]
9963 # Example: see GEOM_TestMeasures.py
9964 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9965 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9966 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9969 ## Get closest points of the given shapes.
9970 # @param theShape1,theShape2 Shapes to find closest points of.
9971 # @return The number of found solutions (-1 in case of infinite number of
9972 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9974 # @ref tui_measurement_tools_page "Example"
9975 @ManageTransactions("MeasuOp")
9976 def ClosestPoints (self, theShape1, theShape2):
9978 Get closest points of the given shapes.
9981 theShape1,theShape2 Shapes to find closest points of.
9984 The number of found solutions (-1 in case of infinite number of
9985 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9987 # Example: see GEOM_TestMeasures.py
9988 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9989 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9992 ## Get angle between the given shapes in degrees.
9993 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9994 # @note If both arguments are vectors, the angle is computed in accordance
9995 # with their orientations, otherwise the minimum angle is computed.
9996 # @return Value of the angle between the given shapes in degrees.
9998 # @ref tui_measurement_tools_page "Example"
9999 @ManageTransactions("MeasuOp")
10000 def GetAngle(self, theShape1, theShape2):
10002 Get angle between the given shapes in degrees.
10005 theShape1,theShape2 Lines or linear edges to find angle between.
10008 If both arguments are vectors, the angle is computed in accordance
10009 with their orientations, otherwise the minimum angle is computed.
10012 Value of the angle between the given shapes in degrees.
10014 # Example: see GEOM_TestMeasures.py
10015 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10016 RaiseIfFailed("GetAngle", self.MeasuOp)
10019 ## Get angle between the given shapes in radians.
10020 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10021 # @note If both arguments are vectors, the angle is computed in accordance
10022 # with their orientations, otherwise the minimum angle is computed.
10023 # @return Value of the angle between the given shapes in radians.
10025 # @ref tui_measurement_tools_page "Example"
10026 @ManageTransactions("MeasuOp")
10027 def GetAngleRadians(self, theShape1, theShape2):
10029 Get angle between the given shapes in radians.
10032 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 radians.
10042 # Example: see GEOM_TestMeasures.py
10043 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10044 RaiseIfFailed("GetAngle", self.MeasuOp)
10047 ## Get angle between the given vectors in degrees.
10048 # @param theShape1,theShape2 Vectors to find angle between.
10049 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10050 # if False, the opposite vector to the normal vector is used.
10051 # @return Value of the angle between the given vectors in degrees.
10053 # @ref tui_measurement_tools_page "Example"
10054 @ManageTransactions("MeasuOp")
10055 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10057 Get angle between the given vectors in degrees.
10060 theShape1,theShape2 Vectors to find angle between.
10061 theFlag If True, the normal vector is defined by the two vectors cross,
10062 if False, the opposite vector to the normal vector is used.
10065 Value of the angle between the given vectors in degrees.
10067 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10069 anAngle = 360. - anAngle
10070 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10073 ## The same as GetAngleVectors, but the result is in radians.
10074 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10076 Get angle between the given vectors in radians.
10079 theShape1,theShape2 Vectors to find angle between.
10080 theFlag If True, the normal vector is defined by the two vectors cross,
10081 if False, the opposite vector to the normal vector is used.
10084 Value of the angle between the given vectors in radians.
10086 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10089 ## @name Curve Curvature Measurement
10090 # Methods for receiving radius of curvature of curves
10091 # in the given point
10094 ## Measure curvature of a curve at a point, set by parameter.
10095 # @param theCurve a curve.
10096 # @param theParam parameter.
10097 # @return radius of curvature of \a theCurve.
10099 # @ref swig_todo "Example"
10100 @ManageTransactions("MeasuOp")
10101 def CurveCurvatureByParam(self, theCurve, theParam):
10103 Measure curvature of a curve at a point, set by parameter.
10107 theParam parameter.
10110 radius of curvature of theCurve.
10112 # Example: see GEOM_TestMeasures.py
10113 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10114 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10117 ## Measure curvature of a curve at a point.
10118 # @param theCurve a curve.
10119 # @param thePoint given point.
10120 # @return radius of curvature of \a theCurve.
10122 # @ref swig_todo "Example"
10123 @ManageTransactions("MeasuOp")
10124 def CurveCurvatureByPoint(self, theCurve, thePoint):
10126 Measure curvature of a curve at a point.
10130 thePoint given point.
10133 radius of curvature of theCurve.
10135 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10136 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10140 ## @name Surface Curvature Measurement
10141 # Methods for receiving max and min radius of curvature of surfaces
10142 # in the given point
10145 ## Measure max radius of curvature of surface.
10146 # @param theSurf the given surface.
10147 # @param theUParam Value of U-parameter on the referenced surface.
10148 # @param theVParam Value of V-parameter on the referenced surface.
10149 # @return max radius of curvature of theSurf.
10151 ## @ref swig_todo "Example"
10152 @ManageTransactions("MeasuOp")
10153 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10155 Measure max radius of curvature of surface.
10158 theSurf the given surface.
10159 theUParam Value of U-parameter on the referenced surface.
10160 theVParam Value of V-parameter on the referenced surface.
10163 max radius of curvature of theSurf.
10165 # Example: see GEOM_TestMeasures.py
10166 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10167 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10170 ## Measure max radius of curvature of surface in the given point
10171 # @param theSurf the given surface.
10172 # @param thePoint given point.
10173 # @return max radius of curvature of theSurf.
10175 ## @ref swig_todo "Example"
10176 @ManageTransactions("MeasuOp")
10177 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10179 Measure max radius of curvature of surface in the given point.
10182 theSurf the given surface.
10183 thePoint given point.
10186 max radius of curvature of theSurf.
10188 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10189 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10192 ## Measure min radius of curvature of surface.
10193 # @param theSurf the given surface.
10194 # @param theUParam Value of U-parameter on the referenced surface.
10195 # @param theVParam Value of V-parameter on the referenced surface.
10196 # @return min radius of curvature of theSurf.
10198 ## @ref swig_todo "Example"
10199 @ManageTransactions("MeasuOp")
10200 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10202 Measure min radius of curvature of surface.
10205 theSurf the given surface.
10206 theUParam Value of U-parameter on the referenced surface.
10207 theVParam Value of V-parameter on the referenced surface.
10210 Min radius of curvature of theSurf.
10212 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10213 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10216 ## Measure min radius of curvature of surface in the given point
10217 # @param theSurf the given surface.
10218 # @param thePoint given point.
10219 # @return min radius of curvature of theSurf.
10221 ## @ref swig_todo "Example"
10222 @ManageTransactions("MeasuOp")
10223 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10225 Measure min radius of curvature of surface in the given point.
10228 theSurf the given surface.
10229 thePoint given point.
10232 Min radius of curvature of theSurf.
10234 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10235 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10239 ## Get min and max tolerances of sub-shapes of theShape
10240 # @param theShape Shape, to get tolerances of.
10241 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10242 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10243 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10244 # VertMin,VertMax: Min and max tolerances of the vertices.
10246 # @ref tui_measurement_tools_page "Example"
10247 @ManageTransactions("MeasuOp")
10248 def Tolerance(self,theShape):
10250 Get min and max tolerances of sub-shapes of theShape
10253 theShape Shape, to get tolerances of.
10256 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10257 FaceMin,FaceMax: Min and max tolerances of the faces.
10258 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10259 VertMin,VertMax: Min and max tolerances of the vertices.
10261 # Example: see GEOM_TestMeasures.py
10262 aTuple = self.MeasuOp.GetTolerance(theShape)
10263 RaiseIfFailed("GetTolerance", self.MeasuOp)
10266 ## Obtain description of the given shape (number of sub-shapes of each type)
10267 # @param theShape Shape to be described.
10268 # @return Description of the given shape.
10270 # @ref tui_measurement_tools_page "Example"
10271 @ManageTransactions("MeasuOp")
10272 def WhatIs(self,theShape):
10274 Obtain description of the given shape (number of sub-shapes of each type)
10277 theShape Shape to be described.
10280 Description of the given shape.
10282 # Example: see GEOM_TestMeasures.py
10283 aDescr = self.MeasuOp.WhatIs(theShape)
10284 RaiseIfFailed("WhatIs", self.MeasuOp)
10287 ## Obtain quantity of shapes of the given type in \a theShape.
10288 # If \a theShape is of type \a theType, it is also counted.
10289 # @param theShape Shape to be described.
10290 # @param theType the given ShapeType().
10291 # @return Quantity of shapes of type \a theType in \a theShape.
10293 # @ref tui_measurement_tools_page "Example"
10294 def NbShapes (self, theShape, theType):
10296 Obtain quantity of shapes of the given type in theShape.
10297 If theShape is of type theType, it is also counted.
10300 theShape Shape to be described.
10301 theType the given geompy.ShapeType
10304 Quantity of shapes of type theType in theShape.
10306 # Example: see GEOM_TestMeasures.py
10307 listSh = self.SubShapeAllIDs(theShape, theType)
10311 ## Obtain quantity of shapes of each type in \a theShape.
10312 # The \a theShape is also counted.
10313 # @param theShape Shape to be described.
10314 # @return Dictionary of ShapeType() with bound quantities of shapes.
10316 # @ref tui_measurement_tools_page "Example"
10317 def ShapeInfo (self, theShape):
10319 Obtain quantity of shapes of each type in theShape.
10320 The theShape is also counted.
10323 theShape Shape to be described.
10326 Dictionary of geompy.ShapeType with bound quantities of shapes.
10328 # Example: see GEOM_TestMeasures.py
10330 for typeSh in self.ShapeType:
10331 if typeSh in ( "AUTO", "SHAPE" ): continue
10332 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10338 def GetCreationInformation(self, theShape):
10339 info = theShape.GetCreationInformation()
10341 opName = info.operationName
10342 if not opName: opName = "no info available"
10343 res = "Operation: " + opName
10345 for parVal in info.params:
10346 res += " \n %s = %s" % ( parVal.name, parVal.value )
10349 ## Get a point, situated at the centre of mass of theShape.
10350 # @param theShape Shape to define centre of mass of.
10351 # @param theName Object name; when specified, this parameter is used
10352 # for result publication in the study. Otherwise, if automatic
10353 # publication is switched on, default value is used for result name.
10355 # @return New GEOM.GEOM_Object, containing the created point.
10357 # @ref tui_measurement_tools_page "Example"
10358 @ManageTransactions("MeasuOp")
10359 def MakeCDG(self, theShape, theName=None):
10361 Get a point, situated at the centre of mass of theShape.
10364 theShape Shape to define centre of mass of.
10365 theName Object name; when specified, this parameter is used
10366 for result publication in the study. Otherwise, if automatic
10367 publication is switched on, default value is used for result name.
10370 New GEOM.GEOM_Object, containing the created point.
10372 # Example: see GEOM_TestMeasures.py
10373 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10374 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10375 self._autoPublish(anObj, theName, "centerOfMass")
10378 ## Get a vertex sub-shape by index depended with orientation.
10379 # @param theShape Shape to find sub-shape.
10380 # @param theIndex Index to find vertex by this index (starting from zero)
10381 # @param theName Object name; when specified, this parameter is used
10382 # for result publication in the study. Otherwise, if automatic
10383 # publication is switched on, default value is used for result name.
10385 # @return New GEOM.GEOM_Object, containing the created vertex.
10387 # @ref tui_measurement_tools_page "Example"
10388 @ManageTransactions("MeasuOp")
10389 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10391 Get a vertex sub-shape by index depended with orientation.
10394 theShape Shape to find sub-shape.
10395 theIndex Index to find vertex by this index (starting from zero)
10396 theName Object name; when specified, this parameter is used
10397 for result publication in the study. Otherwise, if automatic
10398 publication is switched on, default value is used for result name.
10401 New GEOM.GEOM_Object, containing the created vertex.
10403 # Example: see GEOM_TestMeasures.py
10404 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10405 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10406 self._autoPublish(anObj, theName, "vertex")
10409 ## Get the first vertex of wire/edge depended orientation.
10410 # @param theShape Shape to find first vertex.
10411 # @param theName Object name; when specified, this parameter is used
10412 # for result publication in the study. Otherwise, if automatic
10413 # publication is switched on, default value is used for result name.
10415 # @return New GEOM.GEOM_Object, containing the created vertex.
10417 # @ref tui_measurement_tools_page "Example"
10418 def GetFirstVertex(self, theShape, theName=None):
10420 Get the first vertex of wire/edge depended orientation.
10423 theShape Shape to find first vertex.
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 # note: auto-publishing is done in self.GetVertexByIndex()
10433 return self.GetVertexByIndex(theShape, 0, theName)
10435 ## Get the last vertex of wire/edge depended orientation.
10436 # @param theShape Shape to find last vertex.
10437 # @param theName Object name; when specified, this parameter is used
10438 # for result publication in the study. Otherwise, if automatic
10439 # publication is switched on, default value is used for result name.
10441 # @return New GEOM.GEOM_Object, containing the created vertex.
10443 # @ref tui_measurement_tools_page "Example"
10444 def GetLastVertex(self, theShape, theName=None):
10446 Get the last vertex of wire/edge depended orientation.
10449 theShape Shape to find last vertex.
10450 theName Object name; when specified, this parameter is used
10451 for result publication in the study. Otherwise, if automatic
10452 publication is switched on, default value is used for result name.
10455 New GEOM.GEOM_Object, containing the created vertex.
10457 # Example: see GEOM_TestMeasures.py
10458 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10459 # note: auto-publishing is done in self.GetVertexByIndex()
10460 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10462 ## Get a normale to the given face. If the point is not given,
10463 # the normale is calculated at the center of mass.
10464 # @param theFace Face to define normale of.
10465 # @param theOptionalPoint Point to compute the normale at.
10466 # @param theName Object name; when specified, this parameter is used
10467 # for result publication in the study. Otherwise, if automatic
10468 # publication is switched on, default value is used for result name.
10470 # @return New GEOM.GEOM_Object, containing the created vector.
10472 # @ref swig_todo "Example"
10473 @ManageTransactions("MeasuOp")
10474 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10476 Get a normale to the given face. If the point is not given,
10477 the normale is calculated at the center of mass.
10480 theFace Face to define normale of.
10481 theOptionalPoint Point to compute the normale at.
10482 theName Object name; when specified, this parameter is used
10483 for result publication in the study. Otherwise, if automatic
10484 publication is switched on, default value is used for result name.
10487 New GEOM.GEOM_Object, containing the created vector.
10489 # Example: see GEOM_TestMeasures.py
10490 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10491 RaiseIfFailed("GetNormal", self.MeasuOp)
10492 self._autoPublish(anObj, theName, "normal")
10495 ## Print shape errors obtained from CheckShape.
10496 # @param theShape Shape that was checked.
10497 # @param theShapeErrors the shape errors obtained by CheckShape.
10498 # @param theReturnStatus If 0 the description of problem is printed.
10499 # If 1 the description of problem is returned.
10500 # @return If theReturnStatus is equal to 1 the description is returned.
10501 # Otherwise doesn't return anything.
10503 # @ref tui_measurement_tools_page "Example"
10504 @ManageTransactions("MeasuOp")
10505 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10507 Print shape errors obtained from CheckShape.
10510 theShape Shape that was checked.
10511 theShapeErrors the shape errors obtained by CheckShape.
10512 theReturnStatus If 0 the description of problem is printed.
10513 If 1 the description of problem is returned.
10516 If theReturnStatus is equal to 1 the description is returned.
10517 Otherwise doesn't return anything.
10519 # Example: see GEOM_TestMeasures.py
10520 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10521 if theReturnStatus == 1:
10526 ## Check a topology of the given shape.
10527 # @param theShape Shape to check validity of.
10528 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10529 # if TRUE, the shape's geometry will be checked also.
10530 # @param theReturnStatus If 0 and if theShape is invalid, a description
10531 # of problem is printed.
10532 # If 1 isValid flag and the description of
10533 # problem is returned.
10534 # If 2 isValid flag and the list of error data
10536 # @return TRUE, if the shape "seems to be valid".
10537 # If theShape is invalid, prints a description of problem.
10538 # If theReturnStatus is equal to 1 the description is returned
10539 # along with IsValid flag.
10540 # If theReturnStatus is equal to 2 the list of error data is
10541 # returned along with IsValid flag.
10543 # @ref tui_measurement_tools_page "Example"
10544 @ManageTransactions("MeasuOp")
10545 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10547 Check a topology of the given shape.
10550 theShape Shape to check validity of.
10551 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10552 if TRUE, the shape's geometry will be checked also.
10553 theReturnStatus If 0 and if theShape is invalid, a description
10554 of problem is printed.
10555 If 1 IsValid flag and the description of
10556 problem is returned.
10557 If 2 IsValid flag and the list of error data
10561 TRUE, if the shape "seems to be valid".
10562 If theShape is invalid, prints a description of problem.
10563 If theReturnStatus is equal to 1 the description is returned
10564 along with IsValid flag.
10565 If theReturnStatus is equal to 2 the list of error data is
10566 returned along with IsValid flag.
10568 # Example: see GEOM_TestMeasures.py
10570 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10571 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10573 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10574 RaiseIfFailed("CheckShape", self.MeasuOp)
10576 if theReturnStatus == 0:
10577 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10579 if theReturnStatus == 1:
10580 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10581 return (IsValid, Descr)
10582 elif theReturnStatus == 2:
10583 return (IsValid, ShapeErrors)
10586 ## Detect self-intersections in the given shape.
10587 # @param theShape Shape to check.
10588 # @return TRUE, if the shape contains no self-intersections.
10590 # @ref tui_measurement_tools_page "Example"
10591 @ManageTransactions("MeasuOp")
10592 def CheckSelfIntersections(self, theShape):
10594 Detect self-intersections in the given shape.
10597 theShape Shape to check.
10600 TRUE, if the shape contains no self-intersections.
10602 # Example: see GEOM_TestMeasures.py
10603 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10604 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10607 ## Get position (LCS) of theShape.
10609 # Origin of the LCS is situated at the shape's center of mass.
10610 # Axes of the LCS are obtained from shape's location or,
10611 # if the shape is a planar face, from position of its plane.
10613 # @param theShape Shape to calculate position of.
10614 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10615 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10616 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10617 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10619 # @ref swig_todo "Example"
10620 @ManageTransactions("MeasuOp")
10621 def GetPosition(self,theShape):
10623 Get position (LCS) of theShape.
10624 Origin of the LCS is situated at the shape's center of mass.
10625 Axes of the LCS are obtained from shape's location or,
10626 if the shape is a planar face, from position of its plane.
10629 theShape Shape to calculate position of.
10632 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10633 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10634 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10635 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10637 # Example: see GEOM_TestMeasures.py
10638 aTuple = self.MeasuOp.GetPosition(theShape)
10639 RaiseIfFailed("GetPosition", self.MeasuOp)
10642 ## Get kind of theShape.
10644 # @param theShape Shape to get a kind of.
10645 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10646 # and a list of parameters, describing the shape.
10647 # @note Concrete meaning of each value, returned via \a theIntegers
10648 # or \a theDoubles list depends on the kind() of the shape.
10650 # @ref swig_todo "Example"
10651 @ManageTransactions("MeasuOp")
10652 def KindOfShape(self,theShape):
10654 Get kind of theShape.
10657 theShape Shape to get a kind of.
10660 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10661 and a list of parameters, describing the shape.
10663 Concrete meaning of each value, returned via theIntegers
10664 or theDoubles list depends on the geompy.kind of the shape
10666 # Example: see GEOM_TestMeasures.py
10667 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10668 RaiseIfFailed("KindOfShape", self.MeasuOp)
10670 aKind = aRoughTuple[0]
10671 anInts = aRoughTuple[1]
10672 aDbls = aRoughTuple[2]
10674 # Now there is no exception from this rule:
10675 aKindTuple = [aKind] + aDbls + anInts
10677 # If they are we will regroup parameters for such kind of shape.
10679 #if aKind == kind.SOME_KIND:
10680 # # SOME_KIND int int double int double double
10681 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10685 ## Returns the string that describes if the shell is good for solid.
10686 # This is a support method for MakeSolid.
10688 # @param theShell the shell to be checked.
10689 # @return Returns a string that describes the shell validity for
10690 # solid construction.
10691 @ManageTransactions("MeasuOp")
10692 def _IsGoodForSolid(self, theShell):
10694 Returns the string that describes if the shell is good for solid.
10695 This is a support method for MakeSolid.
10698 theShell the shell to be checked.
10701 Returns a string that describes the shell validity for
10702 solid construction.
10704 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10707 # end of l2_measure
10710 ## @addtogroup l2_import_export
10713 ## Import a shape from the BREP, IGES, STEP or other file
10714 # (depends on given format) with given name.
10716 # Note: this function is deprecated, it is kept for backward compatibility only
10717 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10719 # @param theFileName The file, containing the shape.
10720 # @param theFormatName Specify format for the file reading.
10721 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10722 # If format 'IGES_SCALE' is used instead of 'IGES' or
10723 # format 'STEP_SCALE' is used instead of 'STEP',
10724 # length unit will be set to 'meter' and result model will be scaled.
10725 # @param theName Object name; when specified, this parameter is used
10726 # for result publication in the study. Otherwise, if automatic
10727 # publication is switched on, default value is used for result name.
10729 # @return New GEOM.GEOM_Object, containing the imported shape.
10730 # If material names are imported it returns the list of
10731 # objects. The first one is the imported object followed by
10733 # @note Auto publishing is allowed for the shape itself. Imported
10734 # material groups are not automatically published.
10736 # @ref swig_Import_Export "Example"
10737 @ManageTransactions("InsertOp")
10738 def ImportFile(self, theFileName, theFormatName, theName=None):
10740 Import a shape from the BREP, IGES, STEP or other file
10741 (depends on given format) with given name.
10743 Note: this function is deprecated, it is kept for backward compatibility only
10744 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10747 theFileName The file, containing the shape.
10748 theFormatName Specify format for the file reading.
10749 Available formats can be obtained with geompy.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 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.
10758 New GEOM.GEOM_Object, containing the imported shape.
10759 If material names are imported it returns the list of
10760 objects. The first one is the imported object followed by
10763 Auto publishing is allowed for the shape itself. Imported
10764 material groups are not automatically published.
10766 # Example: see GEOM_TestOthers.py
10768 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
10769 where <FormatName> is a name of desirable format for importing.
10771 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10772 RaiseIfFailed("ImportFile", self.InsertOp)
10773 aNbObj = len(aListObj)
10775 self._autoPublish(aListObj[0], theName, "imported")
10780 ## Deprecated analog of ImportFile()
10781 def Import(self, theFileName, theFormatName, theName=None):
10783 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10785 # note: auto-publishing is done in self.ImportFile()
10786 return self.ImportFile(theFileName, theFormatName, theName)
10788 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10789 # @note This method will not be dumped to the python script by DumpStudy functionality.
10790 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10791 # @param theStream The BRep binary stream.
10792 # @param theName Object name; when specified, this parameter is used
10793 # for result publication in the study. Otherwise, if automatic
10794 # publication is switched on, default value is used for result name.
10796 # @return New GEOM_Object, containing the shape, read from theStream.
10798 # @ref swig_Import_Export "Example"
10799 @ManageTransactions("InsertOp")
10800 def RestoreShape (self, theStream, theName=None):
10802 Read a shape from the binary stream, containing its bounding representation (BRep).
10805 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10808 theStream The BRep binary stream.
10809 theName Object name; when specified, this parameter is used
10810 for result publication in the study. Otherwise, if automatic
10811 publication is switched on, default value is used for result name.
10814 New GEOM_Object, containing the shape, read from theStream.
10816 # Example: see GEOM_TestOthers.py
10817 anObj = self.InsertOp.RestoreShape(theStream)
10818 RaiseIfFailed("RestoreShape", self.InsertOp)
10819 self._autoPublish(anObj, theName, "restored")
10822 ## Export the given shape into a file with given name.
10824 # Note: this function is deprecated, it is kept for backward compatibility only
10825 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10827 # @param theObject Shape to be stored in the file.
10828 # @param theFileName Name of the file to store the given shape in.
10829 # @param theFormatName Specify format for the shape storage.
10830 # Available formats can be obtained with
10831 # geompy.InsertOp.ExportTranslators()[0] method.
10833 # @ref swig_Import_Export "Example"
10834 @ManageTransactions("InsertOp")
10835 def Export(self, theObject, theFileName, theFormatName):
10837 Export the given shape into a file with given name.
10839 Note: this function is deprecated, it is kept for backward compatibility only
10840 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10843 theObject Shape to be stored in the file.
10844 theFileName Name of the file to store the given shape in.
10845 theFormatName Specify format for the shape storage.
10846 Available formats can be obtained with
10847 geompy.InsertOp.ExportTranslators()[0] method.
10849 # Example: see GEOM_TestOthers.py
10851 WARNING: Function Export is deprecated, use Export<FormatName> instead,
10852 where <FormatName> is a name of desirable format for exporting.
10854 self.InsertOp.Export(theObject, theFileName, theFormatName)
10855 if self.InsertOp.IsDone() == 0:
10856 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10860 # end of l2_import_export
10863 ## @addtogroup l3_blocks
10866 ## Create a quadrangle face from four edges. Order of Edges is not
10867 # important. It is not necessary that edges share the same vertex.
10868 # @param E1,E2,E3,E4 Edges for the face bound.
10869 # @param theName Object name; when specified, this parameter is used
10870 # for result publication in the study. Otherwise, if automatic
10871 # publication is switched on, default value is used for result name.
10873 # @return New GEOM.GEOM_Object, containing the created face.
10875 # @ref tui_building_by_blocks_page "Example"
10876 @ManageTransactions("BlocksOp")
10877 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10879 Create a quadrangle face from four edges. Order of Edges is not
10880 important. It is not necessary that edges share the same vertex.
10883 E1,E2,E3,E4 Edges for the face bound.
10884 theName Object name; when specified, this parameter is used
10885 for result publication in the study. Otherwise, if automatic
10886 publication is switched on, default value is used for result name.
10889 New GEOM.GEOM_Object, containing the created face.
10892 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10894 # Example: see GEOM_Spanner.py
10895 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10896 RaiseIfFailed("MakeQuad", self.BlocksOp)
10897 self._autoPublish(anObj, theName, "quad")
10900 ## Create a quadrangle face on two edges.
10901 # The missing edges will be built by creating the shortest ones.
10902 # @param E1,E2 Two opposite edges for the face.
10903 # @param theName Object name; when specified, this parameter is used
10904 # for result publication in the study. Otherwise, if automatic
10905 # publication is switched on, default value is used for result name.
10907 # @return New GEOM.GEOM_Object, containing the created face.
10909 # @ref tui_building_by_blocks_page "Example"
10910 @ManageTransactions("BlocksOp")
10911 def MakeQuad2Edges(self, E1, E2, theName=None):
10913 Create a quadrangle face on two edges.
10914 The missing edges will be built by creating the shortest ones.
10917 E1,E2 Two opposite edges for the face.
10918 theName Object name; when specified, this parameter is used
10919 for result publication in the study. Otherwise, if automatic
10920 publication is switched on, default value is used for result name.
10923 New GEOM.GEOM_Object, containing the created face.
10927 p1 = geompy.MakeVertex( 0., 0., 0.)
10928 p2 = geompy.MakeVertex(150., 30., 0.)
10929 p3 = geompy.MakeVertex( 0., 120., 50.)
10930 p4 = geompy.MakeVertex( 0., 40., 70.)
10932 edge1 = geompy.MakeEdge(p1, p2)
10933 edge2 = geompy.MakeEdge(p3, p4)
10934 # create a quadrangle face from two edges
10935 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10937 # Example: see GEOM_Spanner.py
10938 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10939 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10940 self._autoPublish(anObj, theName, "quad")
10943 ## Create a quadrangle face with specified corners.
10944 # The missing edges will be built by creating the shortest ones.
10945 # @param V1,V2,V3,V4 Corner vertices for the face.
10946 # @param 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.
10950 # @return New GEOM.GEOM_Object, containing the created face.
10952 # @ref tui_building_by_blocks_page "Example 1"
10953 # \n @ref swig_MakeQuad4Vertices "Example 2"
10954 @ManageTransactions("BlocksOp")
10955 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10957 Create a quadrangle face with specified corners.
10958 The missing edges will be built by creating the shortest ones.
10961 V1,V2,V3,V4 Corner vertices for the face.
10962 theName Object name; when specified, this parameter is used
10963 for result publication in the study. Otherwise, if automatic
10964 publication is switched on, default value is used for result name.
10967 New GEOM.GEOM_Object, containing the created face.
10971 p1 = geompy.MakeVertex( 0., 0., 0.)
10972 p2 = geompy.MakeVertex(150., 30., 0.)
10973 p3 = geompy.MakeVertex( 0., 120., 50.)
10974 p4 = geompy.MakeVertex( 0., 40., 70.)
10975 # create a quadrangle from four points in its corners
10976 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10978 # Example: see GEOM_Spanner.py
10979 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10980 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10981 self._autoPublish(anObj, theName, "quad")
10984 ## Create a hexahedral solid, bounded by the six given faces. Order of
10985 # faces is not important. It is not necessary that Faces share the same edge.
10986 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10987 # @param theName Object name; when specified, this parameter is used
10988 # for result publication in the study. Otherwise, if automatic
10989 # publication is switched on, default value is used for result name.
10991 # @return New GEOM.GEOM_Object, containing the created solid.
10993 # @ref tui_building_by_blocks_page "Example 1"
10994 # \n @ref swig_MakeHexa "Example 2"
10995 @ManageTransactions("BlocksOp")
10996 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10998 Create a hexahedral solid, bounded by the six given faces. Order of
10999 faces is not important. It is not necessary that Faces share the same edge.
11002 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11003 theName Object name; when specified, this parameter is used
11004 for result publication in the study. Otherwise, if automatic
11005 publication is switched on, default value is used for result name.
11008 New GEOM.GEOM_Object, containing the created solid.
11011 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11013 # Example: see GEOM_Spanner.py
11014 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11015 RaiseIfFailed("MakeHexa", self.BlocksOp)
11016 self._autoPublish(anObj, theName, "hexa")
11019 ## Create a hexahedral solid between two given faces.
11020 # The missing faces will be built by creating the smallest ones.
11021 # @param F1,F2 Two opposite faces for the hexahedral solid.
11022 # @param theName Object name; when specified, this parameter is used
11023 # for result publication in the study. Otherwise, if automatic
11024 # publication is switched on, default value is used for result name.
11026 # @return New GEOM.GEOM_Object, containing the created solid.
11028 # @ref tui_building_by_blocks_page "Example 1"
11029 # \n @ref swig_MakeHexa2Faces "Example 2"
11030 @ManageTransactions("BlocksOp")
11031 def MakeHexa2Faces(self, F1, F2, theName=None):
11033 Create a hexahedral solid between two given faces.
11034 The missing faces will be built by creating the smallest ones.
11037 F1,F2 Two opposite faces for the hexahedral solid.
11038 theName Object name; when specified, this parameter is used
11039 for result publication in the study. Otherwise, if automatic
11040 publication is switched on, default value is used for result name.
11043 New GEOM.GEOM_Object, containing the created solid.
11046 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11048 # Example: see GEOM_Spanner.py
11049 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11050 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11051 self._autoPublish(anObj, theName, "hexa")
11057 ## @addtogroup l3_blocks_op
11060 ## Get a vertex, found in the given shape by its coordinates.
11061 # @param theShape Block or a compound of blocks.
11062 # @param theX,theY,theZ Coordinates of the sought vertex.
11063 # @param theEpsilon Maximum allowed distance between the resulting
11064 # vertex and point with the given coordinates.
11065 # @param theName Object name; when specified, this parameter is used
11066 # for result publication in the study. Otherwise, if automatic
11067 # publication is switched on, default value is used for result name.
11069 # @return New GEOM.GEOM_Object, containing the found vertex.
11071 # @ref swig_GetPoint "Example"
11072 @ManageTransactions("BlocksOp")
11073 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11075 Get a vertex, found in the given shape by its coordinates.
11078 theShape Block or a compound of blocks.
11079 theX,theY,theZ Coordinates of the sought vertex.
11080 theEpsilon Maximum allowed distance between the resulting
11081 vertex and point with the given coordinates.
11082 theName Object name; when specified, this parameter is used
11083 for result publication in the study. Otherwise, if automatic
11084 publication is switched on, default value is used for result name.
11087 New GEOM.GEOM_Object, containing the found vertex.
11090 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11092 # Example: see GEOM_TestOthers.py
11093 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11094 RaiseIfFailed("GetPoint", self.BlocksOp)
11095 self._autoPublish(anObj, theName, "vertex")
11098 ## Find a vertex of the given shape, which has minimal distance to the given point.
11099 # @param theShape Any shape.
11100 # @param thePoint Point, close to the desired vertex.
11101 # @param theName Object name; when specified, this parameter is used
11102 # for result publication in the study. Otherwise, if automatic
11103 # publication is switched on, default value is used for result name.
11105 # @return New GEOM.GEOM_Object, containing the found vertex.
11107 # @ref swig_GetVertexNearPoint "Example"
11108 @ManageTransactions("BlocksOp")
11109 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11111 Find a vertex of the given shape, which has minimal distance to the given point.
11114 theShape Any shape.
11115 thePoint Point, close to the desired vertex.
11116 theName Object name; when specified, this parameter is used
11117 for result publication in the study. Otherwise, if automatic
11118 publication is switched on, default value is used for result name.
11121 New GEOM.GEOM_Object, containing the found vertex.
11124 pmidle = geompy.MakeVertex(50, 0, 50)
11125 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11127 # Example: see GEOM_TestOthers.py
11128 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11129 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11130 self._autoPublish(anObj, theName, "vertex")
11133 ## Get an edge, found in the given shape by two given vertices.
11134 # @param theShape Block or a compound of blocks.
11135 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11136 # @param theName Object name; when specified, this parameter is used
11137 # for result publication in the study. Otherwise, if automatic
11138 # publication is switched on, default value is used for result name.
11140 # @return New GEOM.GEOM_Object, containing the found edge.
11142 # @ref swig_GetEdge "Example"
11143 @ManageTransactions("BlocksOp")
11144 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11146 Get an edge, found in the given shape by two given vertices.
11149 theShape Block or a compound of blocks.
11150 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11151 theName Object name; when specified, this parameter is used
11152 for result publication in the study. Otherwise, if automatic
11153 publication is switched on, default value is used for result name.
11156 New GEOM.GEOM_Object, containing the found edge.
11158 # Example: see GEOM_Spanner.py
11159 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11160 RaiseIfFailed("GetEdge", self.BlocksOp)
11161 self._autoPublish(anObj, theName, "edge")
11164 ## Find an edge of the given shape, which has minimal distance to the given point.
11165 # @param theShape Block or a compound of blocks.
11166 # @param thePoint Point, close to the desired edge.
11167 # @param theName Object name; when specified, this parameter is used
11168 # for result publication in the study. Otherwise, if automatic
11169 # publication is switched on, default value is used for result name.
11171 # @return New GEOM.GEOM_Object, containing the found edge.
11173 # @ref swig_GetEdgeNearPoint "Example"
11174 @ManageTransactions("BlocksOp")
11175 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11177 Find an edge of the given shape, which has minimal distance to the given point.
11180 theShape Block or a compound of blocks.
11181 thePoint Point, close to the desired edge.
11182 theName Object name; when specified, this parameter is used
11183 for result publication in the study. Otherwise, if automatic
11184 publication is switched on, default value is used for result name.
11187 New GEOM.GEOM_Object, containing the found edge.
11189 # Example: see GEOM_TestOthers.py
11190 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11191 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11192 self._autoPublish(anObj, theName, "edge")
11195 ## Returns a face, found in the given shape by four given corner vertices.
11196 # @param theShape Block or a compound of blocks.
11197 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11198 # @param theName Object name; when specified, this parameter is used
11199 # for result publication in the study. Otherwise, if automatic
11200 # publication is switched on, default value is used for result name.
11202 # @return New GEOM.GEOM_Object, containing the found face.
11204 # @ref swig_todo "Example"
11205 @ManageTransactions("BlocksOp")
11206 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11208 Returns a face, found in the given shape by four given corner vertices.
11211 theShape Block or a compound of blocks.
11212 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11213 theName Object name; when specified, this parameter is used
11214 for result publication in the study. Otherwise, if automatic
11215 publication is switched on, default value is used for result name.
11218 New GEOM.GEOM_Object, containing the found face.
11220 # Example: see GEOM_Spanner.py
11221 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11222 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11223 self._autoPublish(anObj, theName, "face")
11226 ## Get a face of block, found in the given shape by two given edges.
11227 # @param theShape Block or a compound of blocks.
11228 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11229 # @param theName Object name; when specified, this parameter is used
11230 # for result publication in the study. Otherwise, if automatic
11231 # publication is switched on, default value is used for result name.
11233 # @return New GEOM.GEOM_Object, containing the found face.
11235 # @ref swig_todo "Example"
11236 @ManageTransactions("BlocksOp")
11237 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11239 Get a face of block, found in the given shape by two given edges.
11242 theShape Block or a compound of blocks.
11243 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11244 theName Object name; when specified, this parameter is used
11245 for result publication in the study. Otherwise, if automatic
11246 publication is switched on, default value is used for result name.
11249 New GEOM.GEOM_Object, containing the found face.
11251 # Example: see GEOM_Spanner.py
11252 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11253 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11254 self._autoPublish(anObj, theName, "face")
11257 ## Find a face, opposite to the given one in the given block.
11258 # @param theBlock Must be a hexahedral solid.
11259 # @param theFace Face of \a theBlock, opposite to the desired face.
11260 # @param theName Object name; when specified, this parameter is used
11261 # for result publication in the study. Otherwise, if automatic
11262 # publication is switched on, default value is used for result name.
11264 # @return New GEOM.GEOM_Object, containing the found face.
11266 # @ref swig_GetOppositeFace "Example"
11267 @ManageTransactions("BlocksOp")
11268 def GetOppositeFace(self, theBlock, theFace, theName=None):
11270 Find a face, opposite to the given one in the given block.
11273 theBlock Must be a hexahedral solid.
11274 theFace Face of theBlock, opposite to the desired face.
11275 theName Object name; when specified, this parameter is used
11276 for result publication in the study. Otherwise, if automatic
11277 publication is switched on, default value is used for result name.
11280 New GEOM.GEOM_Object, containing the found face.
11282 # Example: see GEOM_Spanner.py
11283 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11284 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11285 self._autoPublish(anObj, theName, "face")
11288 ## Find a face of the given shape, which has minimal distance to the given point.
11289 # @param theShape Block or a compound of blocks.
11290 # @param thePoint Point, close to the desired face.
11291 # @param theName Object name; when specified, this parameter is used
11292 # for result publication in the study. Otherwise, if automatic
11293 # publication is switched on, default value is used for result name.
11295 # @return New GEOM.GEOM_Object, containing the found face.
11297 # @ref swig_GetFaceNearPoint "Example"
11298 @ManageTransactions("BlocksOp")
11299 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11301 Find a face of the given shape, which has minimal distance to the given point.
11304 theShape Block or a compound of blocks.
11305 thePoint Point, close to the desired face.
11306 theName Object name; when specified, this parameter is used
11307 for result publication in the study. Otherwise, if automatic
11308 publication is switched on, default value is used for result name.
11311 New GEOM.GEOM_Object, containing the found face.
11313 # Example: see GEOM_Spanner.py
11314 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11315 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11316 self._autoPublish(anObj, theName, "face")
11319 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11320 # @param theBlock Block or a compound of blocks.
11321 # @param theVector Vector, close to the normale of the desired face.
11322 # @param theName Object name; when specified, this parameter is used
11323 # for result publication in the study. Otherwise, if automatic
11324 # publication is switched on, default value is used for result name.
11326 # @return New GEOM.GEOM_Object, containing the found face.
11328 # @ref swig_todo "Example"
11329 @ManageTransactions("BlocksOp")
11330 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11332 Find a face of block, whose outside normale has minimal angle with the given vector.
11335 theBlock Block or a compound of blocks.
11336 theVector Vector, close to the normale of the desired face.
11337 theName Object name; when specified, this parameter is used
11338 for result publication in the study. Otherwise, if automatic
11339 publication is switched on, default value is used for result name.
11342 New GEOM.GEOM_Object, containing the found face.
11344 # Example: see GEOM_Spanner.py
11345 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11346 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11347 self._autoPublish(anObj, theName, "face")
11350 ## Find all sub-shapes of type \a theShapeType of the given shape,
11351 # which have minimal distance to the given point.
11352 # @param theShape Any shape.
11353 # @param thePoint Point, close to the desired shape.
11354 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11355 # @param theTolerance The tolerance for distances comparison. All shapes
11356 # with distances to the given point in interval
11357 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11358 # @param theName Object name; when specified, this parameter is used
11359 # for result publication in the study. Otherwise, if automatic
11360 # publication is switched on, default value is used for result name.
11362 # @return New GEOM_Object, containing a group of all found shapes.
11364 # @ref swig_GetShapesNearPoint "Example"
11365 @ManageTransactions("BlocksOp")
11366 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11368 Find all sub-shapes of type theShapeType of the given shape,
11369 which have minimal distance to the given point.
11372 theShape Any shape.
11373 thePoint Point, close to the desired shape.
11374 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11375 theTolerance The tolerance for distances comparison. All shapes
11376 with distances to the given point in interval
11377 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11378 theName Object name; when specified, this parameter is used
11379 for result publication in the study. Otherwise, if automatic
11380 publication is switched on, default value is used for result name.
11383 New GEOM_Object, containing a group of all found shapes.
11385 # Example: see GEOM_TestOthers.py
11386 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11387 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11388 self._autoPublish(anObj, theName, "group")
11391 # end of l3_blocks_op
11394 ## @addtogroup l4_blocks_measure
11397 ## Check, if the compound of blocks is given.
11398 # To be considered as a compound of blocks, the
11399 # given shape must satisfy the following conditions:
11400 # - Each element of the compound should be a Block (6 faces and 12 edges).
11401 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11402 # - The compound should be connexe.
11403 # - The glue between two quadrangle faces should be applied.
11404 # @param theCompound The compound to check.
11405 # @return TRUE, if the given shape is a compound of blocks.
11406 # If theCompound is not valid, prints all discovered errors.
11408 # @ref tui_measurement_tools_page "Example 1"
11409 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11410 @ManageTransactions("BlocksOp")
11411 def CheckCompoundOfBlocks(self,theCompound):
11413 Check, if the compound of blocks is given.
11414 To be considered as a compound of blocks, the
11415 given shape must satisfy the following conditions:
11416 - Each element of the compound should be a Block (6 faces and 12 edges).
11417 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11418 - The compound should be connexe.
11419 - The glue between two quadrangle faces should be applied.
11422 theCompound The compound to check.
11425 TRUE, if the given shape is a compound of blocks.
11426 If theCompound is not valid, prints all discovered errors.
11428 # Example: see GEOM_Spanner.py
11429 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11430 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11432 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11436 ## Retrieve all non blocks solids and faces from \a theShape.
11437 # @param theShape The shape to explore.
11438 # @param theName Object name; when specified, this parameter is used
11439 # for result publication in the study. Otherwise, if automatic
11440 # publication is switched on, default value is used for result name.
11442 # @return A tuple of two GEOM_Objects. The first object is a group of all
11443 # non block solids (= not 6 faces, or with 6 faces, but with the
11444 # presence of non-quadrangular faces). The second object is a
11445 # group of all non quadrangular faces.
11447 # @ref tui_measurement_tools_page "Example 1"
11448 # \n @ref swig_GetNonBlocks "Example 2"
11449 @ManageTransactions("BlocksOp")
11450 def GetNonBlocks (self, theShape, theName=None):
11452 Retrieve all non blocks solids and faces from theShape.
11455 theShape The shape to explore.
11456 theName Object name; when specified, this parameter is used
11457 for result publication in the study. Otherwise, if automatic
11458 publication is switched on, default value is used for result name.
11461 A tuple of two GEOM_Objects. The first object is a group of all
11462 non block solids (= not 6 faces, or with 6 faces, but with the
11463 presence of non-quadrangular faces). The second object is a
11464 group of all non quadrangular faces.
11467 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11469 # Example: see GEOM_Spanner.py
11470 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11471 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11472 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11475 ## Remove all seam and degenerated edges from \a theShape.
11476 # Unite faces and edges, sharing one surface. It means that
11477 # this faces must have references to one C++ surface object (handle).
11478 # @param theShape The compound or single solid to remove irregular edges from.
11479 # @param doUnionFaces If True, then unite faces. If False (the default value),
11480 # do not unite faces.
11481 # @param theName Object name; when specified, this parameter is used
11482 # for result publication in the study. Otherwise, if automatic
11483 # publication is switched on, default value is used for result name.
11485 # @return Improved shape.
11487 # @ref swig_RemoveExtraEdges "Example"
11488 @ManageTransactions("BlocksOp")
11489 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11491 Remove all seam and degenerated edges from theShape.
11492 Unite faces and edges, sharing one surface. It means that
11493 this faces must have references to one C++ surface object (handle).
11496 theShape The compound or single solid to remove irregular edges from.
11497 doUnionFaces If True, then unite faces. If False (the default value),
11498 do not unite faces.
11499 theName Object name; when specified, this parameter is used
11500 for result publication in the study. Otherwise, if automatic
11501 publication is switched on, default value is used for result name.
11506 # Example: see GEOM_TestOthers.py
11507 nbFacesOptimum = -1 # -1 means do not unite faces
11508 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11509 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11510 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11511 self._autoPublish(anObj, theName, "removeExtraEdges")
11514 ## Performs union faces of \a theShape
11515 # Unite faces sharing one surface. It means that
11516 # these faces must have references to one C++ surface object (handle).
11517 # @param theShape The compound or single solid that contains faces
11518 # to perform union.
11519 # @param theName Object name; when specified, this parameter is used
11520 # for result publication in the study. Otherwise, if automatic
11521 # publication is switched on, default value is used for result name.
11523 # @return Improved shape.
11525 # @ref swig_UnionFaces "Example"
11526 @ManageTransactions("BlocksOp")
11527 def UnionFaces(self, theShape, theName=None):
11529 Performs union faces of theShape.
11530 Unite faces sharing one surface. It means that
11531 these faces must have references to one C++ surface object (handle).
11534 theShape The compound or single solid that contains faces
11536 theName Object name; when specified, this parameter is used
11537 for result publication in the study. Otherwise, if automatic
11538 publication is switched on, default value is used for result name.
11543 # Example: see GEOM_TestOthers.py
11544 anObj = self.BlocksOp.UnionFaces(theShape)
11545 RaiseIfFailed("UnionFaces", self.BlocksOp)
11546 self._autoPublish(anObj, theName, "unionFaces")
11549 ## Check, if the given shape is a blocks compound.
11550 # Fix all detected errors.
11551 # \note Single block can be also fixed by this method.
11552 # @param theShape The compound to check and improve.
11553 # @param theName Object name; when specified, this parameter is used
11554 # for result publication in the study. Otherwise, if automatic
11555 # publication is switched on, default value is used for result name.
11557 # @return Improved compound.
11559 # @ref swig_CheckAndImprove "Example"
11560 @ManageTransactions("BlocksOp")
11561 def CheckAndImprove(self, theShape, theName=None):
11563 Check, if the given shape is a blocks compound.
11564 Fix all detected errors.
11567 Single block can be also fixed by this method.
11570 theShape The compound to check and improve.
11571 theName Object name; when specified, this parameter is used
11572 for result publication in the study. Otherwise, if automatic
11573 publication is switched on, default value is used for result name.
11578 # Example: see GEOM_TestOthers.py
11579 anObj = self.BlocksOp.CheckAndImprove(theShape)
11580 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11581 self._autoPublish(anObj, theName, "improved")
11584 # end of l4_blocks_measure
11587 ## @addtogroup l3_blocks_op
11590 ## Get all the blocks, contained in the given compound.
11591 # @param theCompound The compound to explode.
11592 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11593 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11594 # @param theName Object name; when specified, this parameter is used
11595 # for result publication in the study. Otherwise, if automatic
11596 # publication is switched on, default value is used for result name.
11598 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11600 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11602 # @ref tui_explode_on_blocks "Example 1"
11603 # \n @ref swig_MakeBlockExplode "Example 2"
11604 @ManageTransactions("BlocksOp")
11605 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11607 Get all the blocks, contained in the given compound.
11610 theCompound The compound to explode.
11611 theMinNbFaces If solid has lower number of faces, it is not a block.
11612 theMaxNbFaces If solid has higher number of faces, it is not a block.
11613 theName Object name; when specified, this parameter is used
11614 for result publication in the study. Otherwise, if automatic
11615 publication is switched on, default value is used for result name.
11618 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11621 List of GEOM.GEOM_Object, containing the retrieved blocks.
11623 # Example: see GEOM_TestOthers.py
11624 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11625 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11626 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11627 for anObj in aList:
11628 anObj.SetParameters(Parameters)
11630 self._autoPublish(aList, theName, "block")
11633 ## Find block, containing the given point inside its volume or on boundary.
11634 # @param theCompound Compound, to find block in.
11635 # @param thePoint Point, close to the desired block. If the point lays on
11636 # boundary between some blocks, we return block with nearest center.
11637 # @param theName Object name; when specified, this parameter is used
11638 # for result publication in the study. Otherwise, if automatic
11639 # publication is switched on, default value is used for result name.
11641 # @return New GEOM.GEOM_Object, containing the found block.
11643 # @ref swig_todo "Example"
11644 @ManageTransactions("BlocksOp")
11645 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11647 Find block, containing the given point inside its volume or on boundary.
11650 theCompound Compound, to find block in.
11651 thePoint Point, close to the desired block. If the point lays on
11652 boundary between some blocks, we return block with nearest center.
11653 theName Object name; when specified, this parameter is used
11654 for result publication in the study. Otherwise, if automatic
11655 publication is switched on, default value is used for result name.
11658 New GEOM.GEOM_Object, containing the found block.
11660 # Example: see GEOM_Spanner.py
11661 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11662 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11663 self._autoPublish(anObj, theName, "block")
11666 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11667 # @param theCompound Compound, to find block in.
11668 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11669 # @param theName Object name; when specified, this parameter is used
11670 # for result publication in the study. Otherwise, if automatic
11671 # publication is switched on, default value is used for result name.
11673 # @return New GEOM.GEOM_Object, containing the found block.
11675 # @ref swig_GetBlockByParts "Example"
11676 @ManageTransactions("BlocksOp")
11677 def GetBlockByParts(self, theCompound, theParts, theName=None):
11679 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11682 theCompound Compound, to find block in.
11683 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11684 theName Object name; when specified, this parameter is used
11685 for result publication in the study. Otherwise, if automatic
11686 publication is switched on, default value is used for result name.
11689 New GEOM_Object, containing the found block.
11691 # Example: see GEOM_TestOthers.py
11692 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11693 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11694 self._autoPublish(anObj, theName, "block")
11697 ## Return all blocks, containing all the elements, passed as the parts.
11698 # @param theCompound Compound, to find blocks in.
11699 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11700 # @param theName Object name; when specified, this parameter is used
11701 # for result publication in the study. Otherwise, if automatic
11702 # publication is switched on, default value is used for result name.
11704 # @return List of GEOM.GEOM_Object, containing the found blocks.
11706 # @ref swig_todo "Example"
11707 @ManageTransactions("BlocksOp")
11708 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11710 Return all blocks, containing all the elements, passed as the parts.
11713 theCompound Compound, to find blocks in.
11714 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11715 theName Object name; when specified, this parameter is used
11716 for result publication in the study. Otherwise, if automatic
11717 publication is switched on, default value is used for result name.
11720 List of GEOM.GEOM_Object, containing the found blocks.
11722 # Example: see GEOM_Spanner.py
11723 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11724 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11725 self._autoPublish(aList, theName, "block")
11728 ## Multi-transformate block and glue the result.
11729 # Transformation is defined so, as to superpose direction faces.
11730 # @param Block Hexahedral solid to be multi-transformed.
11731 # @param DirFace1 ID of First direction face.
11732 # @param DirFace2 ID of Second direction face.
11733 # @param NbTimes Quantity of transformations to be done.
11734 # @param theName Object name; when specified, this parameter is used
11735 # for result publication in the study. Otherwise, if automatic
11736 # publication is switched on, default value is used for result name.
11738 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11740 # @return New GEOM.GEOM_Object, containing the result shape.
11742 # @ref tui_multi_transformation "Example"
11743 @ManageTransactions("BlocksOp")
11744 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11746 Multi-transformate block and glue the result.
11747 Transformation is defined so, as to superpose direction faces.
11750 Block Hexahedral solid to be multi-transformed.
11751 DirFace1 ID of First direction face.
11752 DirFace2 ID of Second direction face.
11753 NbTimes Quantity of transformations to be done.
11754 theName Object name; when specified, this parameter is used
11755 for result publication in the study. Otherwise, if automatic
11756 publication is switched on, default value is used for result name.
11759 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11762 New GEOM.GEOM_Object, containing the result shape.
11764 # Example: see GEOM_Spanner.py
11765 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11766 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11767 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11768 anObj.SetParameters(Parameters)
11769 self._autoPublish(anObj, theName, "transformed")
11772 ## Multi-transformate block and glue the result.
11773 # @param Block Hexahedral solid to be multi-transformed.
11774 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11775 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11776 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11777 # @param theName Object name; when specified, this parameter is used
11778 # for result publication in the study. Otherwise, if automatic
11779 # publication is switched on, default value is used for result name.
11781 # @return New GEOM.GEOM_Object, containing the result shape.
11783 # @ref tui_multi_transformation "Example"
11784 @ManageTransactions("BlocksOp")
11785 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11786 DirFace1V, DirFace2V, NbTimesV, theName=None):
11788 Multi-transformate block and glue the result.
11791 Block Hexahedral solid to be multi-transformed.
11792 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11793 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11794 NbTimesU,NbTimesV Quantity of transformations to be done.
11795 theName Object name; when specified, this parameter is used
11796 for result publication in the study. Otherwise, if automatic
11797 publication is switched on, default value is used for result name.
11800 New GEOM.GEOM_Object, containing the result shape.
11802 # Example: see GEOM_Spanner.py
11803 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11804 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11805 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11806 DirFace1V, DirFace2V, NbTimesV)
11807 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11808 anObj.SetParameters(Parameters)
11809 self._autoPublish(anObj, theName, "transformed")
11812 ## Build all possible propagation groups.
11813 # Propagation group is a set of all edges, opposite to one (main)
11814 # edge of this group directly or through other opposite edges.
11815 # Notion of Opposite Edge make sence only on quadrangle face.
11816 # @param theShape Shape to build propagation groups on.
11817 # @param theName Object name; when specified, this parameter is used
11818 # for result publication in the study. Otherwise, if automatic
11819 # publication is switched on, default value is used for result name.
11821 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11823 # @ref swig_Propagate "Example"
11824 @ManageTransactions("BlocksOp")
11825 def Propagate(self, theShape, theName=None):
11827 Build all possible propagation groups.
11828 Propagation group is a set of all edges, opposite to one (main)
11829 edge of this group directly or through other opposite edges.
11830 Notion of Opposite Edge make sence only on quadrangle face.
11833 theShape Shape to build propagation groups on.
11834 theName Object name; when specified, this parameter is used
11835 for result publication in the study. Otherwise, if automatic
11836 publication is switched on, default value is used for result name.
11839 List of GEOM.GEOM_Object, each of them is a propagation group.
11841 # Example: see GEOM_TestOthers.py
11842 listChains = self.BlocksOp.Propagate(theShape)
11843 RaiseIfFailed("Propagate", self.BlocksOp)
11844 self._autoPublish(listChains, theName, "propagate")
11847 # end of l3_blocks_op
11850 ## @addtogroup l3_groups
11853 ## Creates a new group which will store sub-shapes of theMainShape
11854 # @param theMainShape is a GEOM object on which the group is selected
11855 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11856 # @param theName Object name; when specified, this parameter is used
11857 # for result publication in the study. Otherwise, if automatic
11858 # publication is switched on, default value is used for result name.
11860 # @return a newly created GEOM group (GEOM.GEOM_Object)
11862 # @ref tui_working_with_groups_page "Example 1"
11863 # \n @ref swig_CreateGroup "Example 2"
11864 @ManageTransactions("GroupOp")
11865 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11867 Creates a new group which will store sub-shapes of theMainShape
11870 theMainShape is a GEOM object on which the group is selected
11871 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11872 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11873 theName Object name; when specified, this parameter is used
11874 for result publication in the study. Otherwise, if automatic
11875 publication is switched on, default value is used for result name.
11878 a newly created GEOM group
11881 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11884 # Example: see GEOM_TestOthers.py
11885 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11886 RaiseIfFailed("CreateGroup", self.GroupOp)
11887 self._autoPublish(anObj, theName, "group")
11890 ## Adds a sub-object with ID theSubShapeId to the group
11891 # @param theGroup is a GEOM group to which the new sub-shape is added
11892 # @param theSubShapeID is a sub-shape ID in the main object.
11893 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11895 # @ref tui_working_with_groups_page "Example"
11896 @ManageTransactions("GroupOp")
11897 def AddObject(self,theGroup, theSubShapeID):
11899 Adds a sub-object with ID theSubShapeId to the group
11902 theGroup is a GEOM group to which the new sub-shape is added
11903 theSubShapeID is a sub-shape ID in the main object.
11906 Use method GetSubShapeID() to get an unique ID of the sub-shape
11908 # Example: see GEOM_TestOthers.py
11909 self.GroupOp.AddObject(theGroup, theSubShapeID)
11910 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11911 RaiseIfFailed("AddObject", self.GroupOp)
11915 ## Removes a sub-object with ID \a theSubShapeId from the group
11916 # @param theGroup is a GEOM group from which the new sub-shape is removed
11917 # @param theSubShapeID is a sub-shape ID in the main object.
11918 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11920 # @ref tui_working_with_groups_page "Example"
11921 @ManageTransactions("GroupOp")
11922 def RemoveObject(self,theGroup, theSubShapeID):
11924 Removes a sub-object with ID theSubShapeId from the group
11927 theGroup is a GEOM group from which the new sub-shape is removed
11928 theSubShapeID is a sub-shape ID in the main object.
11931 Use method GetSubShapeID() to get an unique ID of the sub-shape
11933 # Example: see GEOM_TestOthers.py
11934 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11935 RaiseIfFailed("RemoveObject", self.GroupOp)
11938 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11939 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11940 # @param theSubShapes is a list of sub-shapes to be added.
11942 # @ref tui_working_with_groups_page "Example"
11943 @ManageTransactions("GroupOp")
11944 def UnionList (self,theGroup, theSubShapes):
11946 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11949 theGroup is a GEOM group to which the new sub-shapes are added.
11950 theSubShapes is a list of sub-shapes to be added.
11952 # Example: see GEOM_TestOthers.py
11953 self.GroupOp.UnionList(theGroup, theSubShapes)
11954 RaiseIfFailed("UnionList", self.GroupOp)
11957 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11958 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11959 # @param theSubShapes is a list of indices of sub-shapes to be added.
11961 # @ref swig_UnionIDs "Example"
11962 @ManageTransactions("GroupOp")
11963 def UnionIDs(self,theGroup, theSubShapes):
11965 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11968 theGroup is a GEOM group to which the new sub-shapes are added.
11969 theSubShapes is a list of indices of sub-shapes to be added.
11971 # Example: see GEOM_TestOthers.py
11972 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11973 RaiseIfFailed("UnionIDs", self.GroupOp)
11976 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11977 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11978 # @param theSubShapes is a list of sub-shapes to be removed.
11980 # @ref tui_working_with_groups_page "Example"
11981 @ManageTransactions("GroupOp")
11982 def DifferenceList (self,theGroup, theSubShapes):
11984 Removes from the group all the given shapes. No errors, if some shapes are not included.
11987 theGroup is a GEOM group from which the sub-shapes are removed.
11988 theSubShapes is a list of sub-shapes to be removed.
11990 # Example: see GEOM_TestOthers.py
11991 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11992 RaiseIfFailed("DifferenceList", self.GroupOp)
11995 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11996 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11997 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11999 # @ref swig_DifferenceIDs "Example"
12000 @ManageTransactions("GroupOp")
12001 def DifferenceIDs(self,theGroup, theSubShapes):
12003 Removes from the group all the given shapes. No errors, if some shapes are not included.
12006 theGroup is a GEOM group from which the sub-shapes are removed.
12007 theSubShapes is a list of indices of sub-shapes to be removed.
12009 # Example: see GEOM_TestOthers.py
12010 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12011 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12014 ## Union of two groups.
12015 # New group is created. It will contain all entities
12016 # which are present in groups theGroup1 and theGroup2.
12017 # @param theGroup1, theGroup2 are the initial GEOM groups
12018 # to create the united group from.
12019 # @param theName Object name; when specified, this parameter is used
12020 # for result publication in the study. Otherwise, if automatic
12021 # publication is switched on, default value is used for result name.
12023 # @return a newly created GEOM group.
12025 # @ref tui_union_groups_anchor "Example"
12026 @ManageTransactions("GroupOp")
12027 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12029 Union of two groups.
12030 New group is created. It will contain all entities
12031 which are present in groups theGroup1 and theGroup2.
12034 theGroup1, theGroup2 are the initial GEOM groups
12035 to create the united group from.
12036 theName Object name; when specified, this parameter is used
12037 for result publication in the study. Otherwise, if automatic
12038 publication is switched on, default value is used for result name.
12041 a newly created GEOM group.
12043 # Example: see GEOM_TestOthers.py
12044 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12045 RaiseIfFailed("UnionGroups", self.GroupOp)
12046 self._autoPublish(aGroup, theName, "group")
12049 ## Intersection of two groups.
12050 # New group is created. It will contain only those entities
12051 # which are present in both groups theGroup1 and theGroup2.
12052 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12053 # @param theName Object name; when specified, this parameter is used
12054 # for result publication in the study. Otherwise, if automatic
12055 # publication is switched on, default value is used for result name.
12057 # @return a newly created GEOM group.
12059 # @ref tui_intersect_groups_anchor "Example"
12060 @ManageTransactions("GroupOp")
12061 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12063 Intersection of two groups.
12064 New group is created. It will contain only those entities
12065 which are present in both groups theGroup1 and theGroup2.
12068 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12069 theName Object name; when specified, this parameter is used
12070 for result publication in the study. Otherwise, if automatic
12071 publication is switched on, default value is used for result name.
12074 a newly created GEOM group.
12076 # Example: see GEOM_TestOthers.py
12077 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12078 RaiseIfFailed("IntersectGroups", self.GroupOp)
12079 self._autoPublish(aGroup, theName, "group")
12082 ## Cut of two groups.
12083 # New group is created. It will contain entities which are
12084 # present in group theGroup1 but are not present in group theGroup2.
12085 # @param theGroup1 is a GEOM group to include elements of.
12086 # @param theGroup2 is a GEOM group to exclude elements of.
12087 # @param theName Object name; when specified, this parameter is used
12088 # for result publication in the study. Otherwise, if automatic
12089 # publication is switched on, default value is used for result name.
12091 # @return a newly created GEOM group.
12093 # @ref tui_cut_groups_anchor "Example"
12094 @ManageTransactions("GroupOp")
12095 def CutGroups (self, theGroup1, theGroup2, theName=None):
12098 New group is created. It will contain entities which are
12099 present in group theGroup1 but are not present in group theGroup2.
12102 theGroup1 is a GEOM group to include elements of.
12103 theGroup2 is a GEOM group to exclude elements of.
12104 theName Object name; when specified, this parameter is used
12105 for result publication in the study. Otherwise, if automatic
12106 publication is switched on, default value is used for result name.
12109 a newly created GEOM group.
12111 # Example: see GEOM_TestOthers.py
12112 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12113 RaiseIfFailed("CutGroups", self.GroupOp)
12114 self._autoPublish(aGroup, theName, "group")
12117 ## Union of list of groups.
12118 # New group is created. It will contain all entities that are
12119 # present in groups listed in theGList.
12120 # @param theGList is a list of GEOM groups to create the united group from.
12121 # @param theName Object name; when specified, this parameter is used
12122 # for result publication in the study. Otherwise, if automatic
12123 # publication is switched on, default value is used for result name.
12125 # @return a newly created GEOM group.
12127 # @ref tui_union_groups_anchor "Example"
12128 @ManageTransactions("GroupOp")
12129 def UnionListOfGroups (self, theGList, theName=None):
12131 Union of list of groups.
12132 New group is created. It will contain all entities that are
12133 present in groups listed in theGList.
12136 theGList is a list of GEOM groups to create the united group from.
12137 theName Object name; when specified, this parameter is used
12138 for result publication in the study. Otherwise, if automatic
12139 publication is switched on, default value is used for result name.
12142 a newly created GEOM group.
12144 # Example: see GEOM_TestOthers.py
12145 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12146 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12147 self._autoPublish(aGroup, theName, "group")
12150 ## Cut of lists of groups.
12151 # New group is created. It will contain only entities
12152 # which are present in groups listed in theGList.
12153 # @param theGList is a list of GEOM groups to include elements of.
12154 # @param theName Object name; when specified, this parameter is used
12155 # for result publication in the study. Otherwise, if automatic
12156 # publication is switched on, default value is used for result name.
12158 # @return a newly created GEOM group.
12160 # @ref tui_intersect_groups_anchor "Example"
12161 @ManageTransactions("GroupOp")
12162 def IntersectListOfGroups (self, theGList, theName=None):
12164 Cut of lists of groups.
12165 New group is created. It will contain only entities
12166 which are present in groups listed in theGList.
12169 theGList is a list of GEOM groups to include elements of.
12170 theName Object name; when specified, this parameter is used
12171 for result publication in the study. Otherwise, if automatic
12172 publication is switched on, default value is used for result name.
12175 a newly created GEOM group.
12177 # Example: see GEOM_TestOthers.py
12178 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12179 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12180 self._autoPublish(aGroup, theName, "group")
12183 ## Cut of lists of groups.
12184 # New group is created. It will contain only entities
12185 # which are present in groups listed in theGList1 but
12186 # are not present in groups from theGList2.
12187 # @param theGList1 is a list of GEOM groups to include elements of.
12188 # @param theGList2 is a list of GEOM groups to exclude elements of.
12189 # @param theName Object name; when specified, this parameter is used
12190 # for result publication in the study. Otherwise, if automatic
12191 # publication is switched on, default value is used for result name.
12193 # @return a newly created GEOM group.
12195 # @ref tui_cut_groups_anchor "Example"
12196 @ManageTransactions("GroupOp")
12197 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12199 Cut of lists of groups.
12200 New group is created. It will contain only entities
12201 which are present in groups listed in theGList1 but
12202 are not present in groups from theGList2.
12205 theGList1 is a list of GEOM groups to include elements of.
12206 theGList2 is a list of GEOM groups to exclude elements of.
12207 theName Object name; when specified, this parameter is used
12208 for result publication in the study. Otherwise, if automatic
12209 publication is switched on, default value is used for result name.
12212 a newly created GEOM group.
12214 # Example: see GEOM_TestOthers.py
12215 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12216 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12217 self._autoPublish(aGroup, theName, "group")
12220 ## Returns a list of sub-objects ID stored in the group
12221 # @param theGroup is a GEOM group for which a list of IDs is requested
12223 # @ref swig_GetObjectIDs "Example"
12224 @ManageTransactions("GroupOp")
12225 def GetObjectIDs(self,theGroup):
12227 Returns a list of sub-objects ID stored in the group
12230 theGroup is a GEOM group for which a list of IDs is requested
12232 # Example: see GEOM_TestOthers.py
12233 ListIDs = self.GroupOp.GetObjects(theGroup)
12234 RaiseIfFailed("GetObjects", self.GroupOp)
12237 ## Returns a type of sub-objects stored in the group
12238 # @param theGroup is a GEOM group which type is returned.
12240 # @ref swig_GetType "Example"
12241 @ManageTransactions("GroupOp")
12242 def GetType(self,theGroup):
12244 Returns a type of sub-objects stored in the group
12247 theGroup is a GEOM group which type is returned.
12249 # Example: see GEOM_TestOthers.py
12250 aType = self.GroupOp.GetType(theGroup)
12251 RaiseIfFailed("GetType", self.GroupOp)
12254 ## Convert a type of geom object from id to string value
12255 # @param theId is a GEOM obect type id.
12256 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12257 # @ref swig_GetType "Example"
12258 def ShapeIdToType(self, theId):
12260 Convert a type of geom object from id to string value
12263 theId is a GEOM obect type id.
12266 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12293 return "REVOLUTION"
12341 return "FREE_BOUNDS"
12349 return "THRUSECTIONS"
12351 return "COMPOUNDFILTER"
12353 return "SHAPES_ON_SHAPE"
12355 return "ELLIPSE_ARC"
12357 return "3DSKETCHER"
12363 return "PIPETSHAPE"
12364 return "Shape Id not exist."
12366 ## Returns a main shape associated with the group
12367 # @param theGroup is a GEOM group for which a main shape object is requested
12368 # @return a GEOM object which is a main shape for theGroup
12370 # @ref swig_GetMainShape "Example"
12371 @ManageTransactions("GroupOp")
12372 def GetMainShape(self,theGroup):
12374 Returns a main shape associated with the group
12377 theGroup is a GEOM group for which a main shape object is requested
12380 a GEOM object which is a main shape for theGroup
12382 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12384 # Example: see GEOM_TestOthers.py
12385 anObj = self.GroupOp.GetMainShape(theGroup)
12386 RaiseIfFailed("GetMainShape", self.GroupOp)
12389 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12390 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12391 # @param theShape given shape (see GEOM.GEOM_Object)
12392 # @param min_length minimum length of edges of theShape
12393 # @param max_length maximum length of edges of theShape
12394 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12395 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12396 # @param theName Object name; when specified, this parameter is used
12397 # for result publication in the study. Otherwise, if automatic
12398 # publication is switched on, default value is used for result name.
12400 # @return a newly created GEOM group of edges
12402 # @@ref swig_todo "Example"
12403 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12405 Create group of edges of theShape, whose length is in range [min_length, max_length].
12406 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12409 theShape given shape
12410 min_length minimum length of edges of theShape
12411 max_length maximum length of edges of theShape
12412 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12413 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12414 theName Object name; when specified, this parameter is used
12415 for result publication in the study. Otherwise, if automatic
12416 publication is switched on, default value is used for result name.
12419 a newly created GEOM group of edges.
12421 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12422 edges_in_range = []
12424 Props = self.BasicProperties(edge)
12425 if min_length <= Props[0] and Props[0] <= max_length:
12426 if (not include_min) and (min_length == Props[0]):
12429 if (not include_max) and (Props[0] == max_length):
12432 edges_in_range.append(edge)
12434 if len(edges_in_range) <= 0:
12435 print "No edges found by given criteria"
12438 # note: auto-publishing is done in self.CreateGroup()
12439 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12440 self.UnionList(group_edges, edges_in_range)
12444 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12445 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12446 # @param min_length minimum length of edges of selected shape
12447 # @param max_length maximum length of edges of selected shape
12448 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12449 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12450 # @return a newly created GEOM group of edges
12451 # @ref swig_todo "Example"
12452 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12454 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12455 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12458 min_length minimum length of edges of selected shape
12459 max_length maximum length of edges of selected shape
12460 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12461 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12464 a newly created GEOM group of edges.
12466 nb_selected = sg.SelectedCount()
12467 if nb_selected < 1:
12468 print "Select a shape before calling this function, please."
12470 if nb_selected > 1:
12471 print "Only one shape must be selected"
12474 id_shape = sg.getSelected(0)
12475 shape = IDToObject( id_shape )
12477 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12481 if include_min: left_str = " <= "
12482 if include_max: right_str = " <= "
12484 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12485 + left_str + "length" + right_str + `max_length`)
12487 sg.updateObjBrowser(1)
12494 #@@ insert new functions before this line @@ do not remove this line @@#
12496 ## Create a copy of the given object
12498 # @param theOriginal geometry object for copy
12499 # @param theName Object name; when specified, this parameter is used
12500 # for result publication in the study. Otherwise, if automatic
12501 # publication is switched on, default value is used for result name.
12503 # @return New GEOM_Object, containing the copied shape.
12505 # @ingroup l1_geomBuilder_auxiliary
12506 # @ref swig_MakeCopy "Example"
12507 @ManageTransactions("InsertOp")
12508 def MakeCopy(self, theOriginal, theName=None):
12510 Create a copy of the given object
12513 theOriginal geometry object for copy
12514 theName Object name; when specified, this parameter is used
12515 for result publication in the study. Otherwise, if automatic
12516 publication is switched on, default value is used for result name.
12519 New GEOM_Object, containing the copied shape.
12521 Example of usage: Copy = geompy.MakeCopy(Box)
12523 # Example: see GEOM_TestAll.py
12524 anObj = self.InsertOp.MakeCopy(theOriginal)
12525 RaiseIfFailed("MakeCopy", self.InsertOp)
12526 self._autoPublish(anObj, theName, "copy")
12529 ## Add Path to load python scripts from
12530 # @param Path a path to load python scripts from
12531 # @ingroup l1_geomBuilder_auxiliary
12532 def addPath(self,Path):
12534 Add Path to load python scripts from
12537 Path a path to load python scripts from
12539 if (sys.path.count(Path) < 1):
12540 sys.path.append(Path)
12544 ## Load marker texture from the file
12545 # @param Path a path to the texture file
12546 # @return unique texture identifier
12547 # @ingroup l1_geomBuilder_auxiliary
12548 @ManageTransactions("InsertOp")
12549 def LoadTexture(self, Path):
12551 Load marker texture from the file
12554 Path a path to the texture file
12557 unique texture identifier
12559 # Example: see GEOM_TestAll.py
12560 ID = self.InsertOp.LoadTexture(Path)
12561 RaiseIfFailed("LoadTexture", self.InsertOp)
12564 ## Get internal name of the object based on its study entry
12565 # @note This method does not provide an unique identifier of the geometry object.
12566 # @note This is internal function of GEOM component, though it can be used outside it for
12567 # appropriate reason (e.g. for identification of geometry object).
12568 # @param obj geometry object
12569 # @return unique object identifier
12570 # @ingroup l1_geomBuilder_auxiliary
12571 def getObjectID(self, obj):
12573 Get internal name of the object based on its study entry.
12574 Note: this method does not provide an unique identifier of the geometry object.
12575 It is an internal function of GEOM component, though it can be used outside GEOM for
12576 appropriate reason (e.g. for identification of geometry object).
12579 obj geometry object
12582 unique object identifier
12585 entry = salome.ObjectToID(obj)
12586 if entry is not None:
12587 lst = entry.split(":")
12589 ID = lst[-1] # -1 means last item in the list
12590 return "GEOM_" + ID
12595 ## Add marker texture. @a Width and @a Height parameters
12596 # specify width and height of the texture in pixels.
12597 # If @a RowData is @c True, @a Texture parameter should represent texture data
12598 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12599 # parameter should be unpacked string, in which '1' symbols represent opaque
12600 # pixels and '0' represent transparent pixels of the texture bitmap.
12602 # @param Width texture width in pixels
12603 # @param Height texture height in pixels
12604 # @param Texture texture data
12605 # @param RowData if @c True, @a Texture data are packed in the byte stream
12606 # @return unique texture identifier
12607 # @ingroup l1_geomBuilder_auxiliary
12608 @ManageTransactions("InsertOp")
12609 def AddTexture(self, Width, Height, Texture, RowData=False):
12611 Add marker texture. Width and Height parameters
12612 specify width and height of the texture in pixels.
12613 If RowData is True, Texture parameter should represent texture data
12614 packed into the byte array. If RowData is False (default), Texture
12615 parameter should be unpacked string, in which '1' symbols represent opaque
12616 pixels and '0' represent transparent pixels of the texture bitmap.
12619 Width texture width in pixels
12620 Height texture height in pixels
12621 Texture texture data
12622 RowData if True, Texture data are packed in the byte stream
12625 return unique texture identifier
12627 if not RowData: Texture = PackData(Texture)
12628 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12629 RaiseIfFailed("AddTexture", self.InsertOp)
12632 ## Creates a new folder object. It is a container for any GEOM objects.
12633 # @param Name name of the container
12634 # @param Father parent object. If None,
12635 # folder under 'Geometry' root object will be created.
12636 # @return a new created folder
12637 # @ingroup l1_publish_data
12638 def NewFolder(self, Name, Father=None):
12640 Create a new folder object. It is an auxiliary container for any GEOM objects.
12643 Name name of the container
12644 Father parent object. If None,
12645 folder under 'Geometry' root object will be created.
12648 a new created folder
12650 if not Father: Father = self.father
12651 return self.CreateFolder(Name, Father)
12653 ## Move object to the specified folder
12654 # @param Object object to move
12655 # @param Folder target folder
12656 # @ingroup l1_publish_data
12657 def PutToFolder(self, Object, Folder):
12659 Move object to the specified folder
12662 Object object to move
12663 Folder target folder
12665 self.MoveToFolder(Object, Folder)
12668 ## Move list of objects to the specified folder
12669 # @param ListOfSO list of objects to move
12670 # @param Folder target folder
12671 # @ingroup l1_publish_data
12672 def PutListToFolder(self, ListOfSO, Folder):
12674 Move list of objects to the specified folder
12677 ListOfSO list of objects to move
12678 Folder target folder
12680 self.MoveListToFolder(ListOfSO, Folder)
12683 ## @addtogroup l2_field
12687 # @param shape the shape the field lies on
12688 # @param name the field name
12689 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12690 # @param dimension dimension of the shape the field lies on
12691 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12692 # @param componentNames names of components
12693 # @return a created field
12694 @ManageTransactions("FieldOp")
12695 def CreateField(self, shape, name, type, dimension, componentNames):
12700 shape the shape the field lies on
12701 name the field name
12702 type type of field data
12703 dimension dimension of the shape the field lies on
12704 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12705 componentNames names of components
12710 if isinstance( type, int ):
12711 if type < 0 or type > 3:
12712 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12713 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12715 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12716 RaiseIfFailed("CreateField", self.FieldOp)
12718 geom._autoPublish( f, "", name)
12721 ## Removes a field from the GEOM component
12722 # @param field the field to remove
12723 def RemoveField(self, field):
12724 "Removes a field from the GEOM component"
12726 if isinstance( field, GEOM._objref_GEOM_Field ):
12727 geom.RemoveObject( field )
12728 elif isinstance( field, geomField ):
12729 geom.RemoveObject( field.field )
12731 raise RuntimeError, "RemoveField() : the object is not a field"
12734 ## Returns number of fields on a shape
12735 @ManageTransactions("FieldOp")
12736 def CountFields(self, shape):
12737 "Returns number of fields on a shape"
12738 nb = self.FieldOp.CountFields( shape )
12739 RaiseIfFailed("CountFields", self.FieldOp)
12742 ## Returns all fields on a shape
12743 @ManageTransactions("FieldOp")
12744 def GetFields(self, shape):
12745 "Returns all fields on a shape"
12746 ff = self.FieldOp.GetFields( shape )
12747 RaiseIfFailed("GetFields", self.FieldOp)
12750 ## Returns a field on a shape by its name
12751 @ManageTransactions("FieldOp")
12752 def GetField(self, shape, name):
12753 "Returns a field on a shape by its name"
12754 f = self.FieldOp.GetField( shape, name )
12755 RaiseIfFailed("GetField", self.FieldOp)
12763 # Register the new proxy for GEOM_Gen
12764 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12767 ## Field on Geometry
12768 # @ingroup l2_field
12769 class geomField( GEOM._objref_GEOM_Field ):
12771 def __init__(self):
12772 GEOM._objref_GEOM_Field.__init__(self)
12773 self.field = GEOM._objref_GEOM_Field
12776 ## Returns the shape the field lies on
12777 def getShape(self):
12778 "Returns the shape the field lies on"
12779 return self.field.GetShape(self)
12781 ## Returns the field name
12783 "Returns the field name"
12784 return self.field.GetName(self)
12786 ## Returns type of field data as integer [0-3]
12788 "Returns type of field data"
12789 return self.field.GetDataType(self)._v
12791 ## Returns type of field data:
12792 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12793 def getTypeEnum(self):
12794 "Returns type of field data"
12795 return self.field.GetDataType(self)
12797 ## Returns dimension of the shape the field lies on:
12798 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12799 def getDimension(self):
12800 """Returns dimension of the shape the field lies on:
12801 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12802 return self.field.GetDimension(self)
12804 ## Returns names of components
12805 def getComponents(self):
12806 "Returns names of components"
12807 return self.field.GetComponents(self)
12809 ## Adds a time step to the field
12810 # @param step the time step number further used as the step identifier
12811 # @param stamp the time step time
12812 # @param values the values of the time step
12813 def addStep(self, step, stamp, values):
12814 "Adds a time step to the field"
12815 stp = self.field.AddStep( self, step, stamp )
12817 raise RuntimeError, \
12818 "Field.addStep() : Error: step %s already exists in this field"%step
12820 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12821 self.setValues( step, values )
12824 ## Remove a time step from the field
12825 def removeStep(self,step):
12826 "Remove a time step from the field"
12829 stepObj = self.field.GetStep( self, step )
12831 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
12834 #traceback.print_exc()
12836 self.field.RemoveStep( self, step )
12838 geom.myBuilder.RemoveObjectWithChildren( stepSO )
12841 ## Returns number of time steps in the field
12842 def countSteps(self):
12843 "Returns number of time steps in the field"
12844 return self.field.CountSteps(self)
12846 ## Returns a list of time step IDs in the field
12847 def getSteps(self):
12848 "Returns a list of time step IDs in the field"
12849 return self.field.GetSteps(self)
12851 ## Returns a time step by its ID
12852 def getStep(self,step):
12853 "Returns a time step by its ID"
12854 stp = self.field.GetStep(self, step)
12856 raise RuntimeError, "Step %s is missing from this field"%step
12859 ## Returns the time of the field step
12860 def getStamp(self,step):
12861 "Returns the time of the field step"
12862 return self.getStep(step).GetStamp()
12864 ## Changes the time of the field step
12865 def setStamp(self, step, stamp):
12866 "Changes the time of the field step"
12867 return self.getStep(step).SetStamp(stamp)
12869 ## Returns values of the field step
12870 def getValues(self, step):
12871 "Returns values of the field step"
12872 return self.getStep(step).GetValues()
12874 ## Changes values of the field step
12875 def setValues(self, step, values):
12876 "Changes values of the field step"
12877 stp = self.getStep(step)
12878 errBeg = "Field.setValues(values) : Error: "
12880 ok = stp.SetValues( values )
12881 except Exception, e:
12883 if excStr.find("WrongPythonType") > 0:
12884 raise RuntimeError, errBeg +\
12885 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
12886 raise RuntimeError, errBeg + str(e)
12888 nbOK = self.field.GetArraySize(self)
12891 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
12893 raise RuntimeError, errBeg + "failed"
12896 pass # end of class geomField
12898 # Register the new proxy for GEOM_Field
12899 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
12902 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12903 # interface to GEOM operations.
12908 # salome.salome_init()
12909 # from salome.geom import geomBuilder
12910 # geompy = geomBuilder.New(salome.myStudy)
12912 # @param study SALOME study, generally obtained by salome.myStudy.
12913 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12914 # @return geomBuilder instance
12915 def New( study, instance=None):
12917 Create a new geomBuilder instance.The geomBuilder class provides the Python
12918 interface to GEOM operations.
12922 salome.salome_init()
12923 from salome.geom import geomBuilder
12924 geompy = geomBuilder.New(salome.myStudy)
12927 study SALOME study, generally obtained by salome.myStudy.
12928 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12930 geomBuilder instance
12932 #print "New geomBuilder ", study, instance
12939 geom = geomBuilder()
12940 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12941 geom.init_geom(study)
12945 # Register methods from the plug-ins in the geomBuilder class
12946 plugins_var = os.environ.get( "GEOM_PluginsList" )
12949 if plugins_var is not None:
12950 plugins = plugins_var.split( ":" )
12951 plugins=filter(lambda x: len(x)>0, plugins)
12952 if plugins is not None:
12953 for pluginName in plugins:
12954 pluginBuilderName = pluginName + "Builder"
12956 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
12957 except Exception, e:
12958 from salome_utils import verbose
12959 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
12961 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
12962 plugin = eval( pluginBuilderName )
12964 # add methods from plugin module to the geomBuilder class
12965 for k in dir( plugin ):
12966 if k[0] == '_': continue
12967 method = getattr( plugin, k )
12968 if type( method ).__name__ == 'function':
12969 if not hasattr( geomBuilder, k ):
12970 setattr( geomBuilder, k, method )