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 theShape by one face.
6725 # @param theShape Initial shape.
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 a copy of theShape without coincident faces.
6735 # @ref tui_glue_faces "Example"
6736 @ManageTransactions("ShapesOp")
6737 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6739 Replace coincident faces in theShape by one face.
6742 theShape Initial shape.
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 a copy of theShape without coincident faces.
6753 # Example: see GEOM_Spanner.py
6754 theTolerance,Parameters = ParseParameters(theTolerance)
6755 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6757 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6758 anObj.SetParameters(Parameters)
6759 self._autoPublish(anObj, theName, "glueFaces")
6762 ## Find coincident faces in theShape for possible gluing.
6763 # @param theShape Initial shape.
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, theShape, theTolerance, theName=None):
6776 Find coincident faces in theShape for possible gluing.
6779 theShape Initial shape.
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(theShape, theTolerance)
6790 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6791 self._autoPublish(anObj, theName, "facesToGlue")
6794 ## Replace coincident faces in theShape by one face
6795 # in compliance with given list of faces
6796 # @param theShape Initial shape.
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 a copy of theShape
6810 # without some faces.
6812 # @ref tui_glue_faces "Example"
6813 @ManageTransactions("ShapesOp")
6814 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6815 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6817 Replace coincident faces in theShape by one face
6818 in compliance with given list of faces
6821 theShape Initial shape.
6822 theTolerance Maximum distance between faces,
6823 which can be considered as coincident.
6824 theFaces List of faces for gluing.
6825 doKeepNonSolids If FALSE, only solids will present in the result,
6826 otherwise all initial shapes.
6827 doGlueAllEdges If TRUE, all coincident edges of theShape
6828 will be glued, otherwise only the edges,
6829 belonging to theFaces.
6830 theName Object name; when specified, this parameter is used
6831 for result publication in the study. Otherwise, if automatic
6832 publication is switched on, default value is used for result name.
6835 New GEOM.GEOM_Object, containing a copy of theShape
6838 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6839 doKeepNonSolids, doGlueAllEdges)
6841 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6842 self._autoPublish(anObj, theName, "glueFaces")
6845 ## Replace coincident edges in theShape by one edge.
6846 # @param theShape Initial shape.
6847 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6848 # @param theName Object name; when specified, this parameter is used
6849 # for result publication in the study. Otherwise, if automatic
6850 # publication is switched on, default value is used for result name.
6852 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6854 # @ref tui_glue_edges "Example"
6855 @ManageTransactions("ShapesOp")
6856 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6858 Replace coincident edges in theShape by one edge.
6861 theShape Initial shape.
6862 theTolerance Maximum distance between edges, which can be considered as coincident.
6863 theName Object name; when specified, this parameter is used
6864 for result publication in the study. Otherwise, if automatic
6865 publication is switched on, default value is used for result name.
6868 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6870 theTolerance,Parameters = ParseParameters(theTolerance)
6871 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6873 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6874 anObj.SetParameters(Parameters)
6875 self._autoPublish(anObj, theName, "glueEdges")
6878 ## Find coincident edges in theShape for possible gluing.
6879 # @param theShape Initial shape.
6880 # @param theTolerance Maximum distance between edges,
6881 # which can be considered as coincident.
6882 # @param theName Object name; when specified, this parameter is used
6883 # for result publication in the study. Otherwise, if automatic
6884 # publication is switched on, default value is used for result name.
6886 # @return GEOM.ListOfGO
6888 # @ref tui_glue_edges "Example"
6889 @ManageTransactions("ShapesOp")
6890 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6892 Find coincident edges in theShape for possible gluing.
6895 theShape Initial shape.
6896 theTolerance Maximum distance between edges,
6897 which can be considered as coincident.
6898 theName Object name; when specified, this parameter is used
6899 for result publication in the study. Otherwise, if automatic
6900 publication is switched on, default value is used for result name.
6905 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6906 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6907 self._autoPublish(anObj, theName, "edgesToGlue")
6910 ## Replace coincident edges in theShape by one edge
6911 # in compliance with given list of edges.
6912 # @param theShape Initial shape.
6913 # @param theTolerance Maximum distance between edges,
6914 # which can be considered as coincident.
6915 # @param theEdges List of edges for gluing.
6916 # @param theName Object name; when specified, this parameter is used
6917 # for result publication in the study. Otherwise, if automatic
6918 # publication is switched on, default value is used for result name.
6920 # @return New GEOM.GEOM_Object, containing a copy of theShape
6921 # without some edges.
6923 # @ref tui_glue_edges "Example"
6924 @ManageTransactions("ShapesOp")
6925 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6927 Replace coincident edges in theShape by one edge
6928 in compliance with given list of edges.
6931 theShape Initial shape.
6932 theTolerance Maximum distance between edges,
6933 which can be considered as coincident.
6934 theEdges List of edges for gluing.
6935 theName Object name; when specified, this parameter is used
6936 for result publication in the study. Otherwise, if automatic
6937 publication is switched on, default value is used for result name.
6940 New GEOM.GEOM_Object, containing a copy of theShape
6943 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6945 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6946 self._autoPublish(anObj, theName, "glueEdges")
6952 ## @addtogroup l3_boolean Boolean Operations
6955 # -----------------------------------------------------------------------------
6956 # Boolean (Common, Cut, Fuse, Section)
6957 # -----------------------------------------------------------------------------
6959 ## Perform one of boolean operations on two given shapes.
6960 # @param theShape1 First argument for boolean operation.
6961 # @param theShape2 Second argument for boolean operation.
6962 # @param theOperation Indicates the operation to be done:\n
6963 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6964 # @param checkSelfInte The flag that tells if the arguments should
6965 # be checked for self-intersection prior to the operation.
6966 # @param theName Object name; when specified, this parameter is used
6967 # for result publication in the study. Otherwise, if automatic
6968 # publication is switched on, default value is used for result name.
6970 # @note This algorithm doesn't find all types of self-intersections.
6971 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6972 # vertex/face and edge/face intersections. Face/face
6973 # intersections detection is switched off as it is a
6974 # time-consuming operation that gives an impact on performance.
6975 # To find all self-intersections please use
6976 # CheckSelfIntersections() method.
6978 # @return New GEOM.GEOM_Object, containing the result shape.
6980 # @ref tui_fuse "Example"
6981 @ManageTransactions("BoolOp")
6982 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6984 Perform one of boolean operations on two given shapes.
6987 theShape1 First argument for boolean operation.
6988 theShape2 Second argument for boolean operation.
6989 theOperation Indicates the operation to be done:
6990 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6991 checkSelfInte The flag that tells if the arguments should
6992 be checked for self-intersection prior to
6994 theName Object name; when specified, this parameter is used
6995 for result publication in the study. Otherwise, if automatic
6996 publication is switched on, default value is used for result name.
6999 This algorithm doesn't find all types of self-intersections.
7000 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7001 vertex/face and edge/face intersections. Face/face
7002 intersections detection is switched off as it is a
7003 time-consuming operation that gives an impact on performance.
7004 To find all self-intersections please use
7005 CheckSelfIntersections() method.
7008 New GEOM.GEOM_Object, containing the result shape.
7010 # Example: see GEOM_TestAll.py
7011 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7012 RaiseIfFailed("MakeBoolean", self.BoolOp)
7013 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7014 self._autoPublish(anObj, theName, def_names[theOperation])
7017 ## Perform Common boolean operation on two given shapes.
7018 # @param theShape1 First argument for boolean operation.
7019 # @param theShape2 Second argument for boolean operation.
7020 # @param checkSelfInte The flag that tells if the arguments should
7021 # be checked for self-intersection prior to the operation.
7022 # @param theName Object name; when specified, this parameter is used
7023 # for result publication in the study. Otherwise, if automatic
7024 # publication is switched on, default value is used for result name.
7026 # @note This algorithm doesn't find all types of self-intersections.
7027 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7028 # vertex/face and edge/face intersections. Face/face
7029 # intersections detection is switched off as it is a
7030 # time-consuming operation that gives an impact on performance.
7031 # To find all self-intersections please use
7032 # CheckSelfIntersections() method.
7034 # @return New GEOM.GEOM_Object, containing the result shape.
7036 # @ref tui_common "Example 1"
7037 # \n @ref swig_MakeCommon "Example 2"
7038 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7040 Perform Common boolean operation on two given shapes.
7043 theShape1 First argument for boolean operation.
7044 theShape2 Second argument for boolean operation.
7045 checkSelfInte The flag that tells if the arguments should
7046 be checked for self-intersection prior to
7048 theName Object name; when specified, this parameter is used
7049 for result publication in the study. Otherwise, if automatic
7050 publication is switched on, default value is used for result name.
7053 This algorithm doesn't find all types of self-intersections.
7054 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7055 vertex/face and edge/face intersections. Face/face
7056 intersections detection is switched off as it is a
7057 time-consuming operation that gives an impact on performance.
7058 To find all self-intersections please use
7059 CheckSelfIntersections() method.
7062 New GEOM.GEOM_Object, containing the result shape.
7064 # Example: see GEOM_TestOthers.py
7065 # note: auto-publishing is done in self.MakeBoolean()
7066 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7068 ## Perform Cut boolean operation on two given shapes.
7069 # @param theShape1 First argument for boolean operation.
7070 # @param theShape2 Second argument for boolean operation.
7071 # @param checkSelfInte The flag that tells if the arguments should
7072 # be checked for self-intersection prior to the operation.
7073 # @param theName Object name; when specified, this parameter is used
7074 # for result publication in the study. Otherwise, if automatic
7075 # publication is switched on, default value is used for result name.
7077 # @note This algorithm doesn't find all types of self-intersections.
7078 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7079 # vertex/face and edge/face intersections. Face/face
7080 # intersections detection is switched off as it is a
7081 # time-consuming operation that gives an impact on performance.
7082 # To find all self-intersections please use
7083 # CheckSelfIntersections() method.
7085 # @return New GEOM.GEOM_Object, containing the result shape.
7087 # @ref tui_cut "Example 1"
7088 # \n @ref swig_MakeCommon "Example 2"
7089 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7091 Perform Cut boolean operation on two given shapes.
7094 theShape1 First argument for boolean operation.
7095 theShape2 Second argument for boolean operation.
7096 checkSelfInte The flag that tells if the arguments should
7097 be checked for self-intersection prior to
7099 theName Object name; when specified, this parameter is used
7100 for result publication in the study. Otherwise, if automatic
7101 publication is switched on, default value is used for result name.
7104 This algorithm doesn't find all types of self-intersections.
7105 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7106 vertex/face and edge/face intersections. Face/face
7107 intersections detection is switched off as it is a
7108 time-consuming operation that gives an impact on performance.
7109 To find all self-intersections please use
7110 CheckSelfIntersections() method.
7113 New GEOM.GEOM_Object, containing the result shape.
7116 # Example: see GEOM_TestOthers.py
7117 # note: auto-publishing is done in self.MakeBoolean()
7118 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7120 ## Perform Fuse boolean operation on two given shapes.
7121 # @param theShape1 First argument for boolean operation.
7122 # @param theShape2 Second argument for boolean operation.
7123 # @param checkSelfInte The flag that tells if the arguments should
7124 # be checked for self-intersection prior to the operation.
7125 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7126 # operation should be performed during the operation.
7127 # @param theName Object name; when specified, this parameter is used
7128 # for result publication in the study. Otherwise, if automatic
7129 # publication is switched on, default value is used for result name.
7131 # @note This algorithm doesn't find all types of self-intersections.
7132 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7133 # vertex/face and edge/face intersections. Face/face
7134 # intersections detection is switched off as it is a
7135 # time-consuming operation that gives an impact on performance.
7136 # To find all self-intersections please use
7137 # CheckSelfIntersections() method.
7139 # @return New GEOM.GEOM_Object, containing the result shape.
7141 # @ref tui_fuse "Example 1"
7142 # \n @ref swig_MakeCommon "Example 2"
7143 @ManageTransactions("BoolOp")
7144 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7145 rmExtraEdges=False, theName=None):
7147 Perform Fuse boolean operation on two given shapes.
7150 theShape1 First argument for boolean operation.
7151 theShape2 Second argument for boolean operation.
7152 checkSelfInte The flag that tells if the arguments should
7153 be checked for self-intersection prior to
7155 rmExtraEdges The flag that tells if Remove Extra Edges
7156 operation should be performed during the operation.
7157 theName Object name; when specified, this parameter is used
7158 for result publication in the study. Otherwise, if automatic
7159 publication is switched on, default value is used for result name.
7162 This algorithm doesn't find all types of self-intersections.
7163 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7164 vertex/face and edge/face intersections. Face/face
7165 intersections detection is switched off as it is a
7166 time-consuming operation that gives an impact on performance.
7167 To find all self-intersections please use
7168 CheckSelfIntersections() method.
7171 New GEOM.GEOM_Object, containing the result shape.
7174 # Example: see GEOM_TestOthers.py
7175 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7176 checkSelfInte, rmExtraEdges)
7177 RaiseIfFailed("MakeFuse", self.BoolOp)
7178 self._autoPublish(anObj, theName, "fuse")
7181 ## Perform Section boolean operation on two given shapes.
7182 # @param theShape1 First argument for boolean operation.
7183 # @param theShape2 Second argument for boolean operation.
7184 # @param checkSelfInte The flag that tells if the arguments should
7185 # be checked for self-intersection prior to the operation.
7186 # @param theName Object name; when specified, this parameter is used
7187 # for result publication in the study. Otherwise, if automatic
7188 # publication is switched on, default value is used for result name.
7190 # @note This algorithm doesn't find all types of self-intersections.
7191 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7192 # vertex/face and edge/face intersections. Face/face
7193 # intersections detection is switched off as it is a
7194 # time-consuming operation that gives an impact on performance.
7195 # To find all self-intersections please use
7196 # CheckSelfIntersections() method.
7198 # @return New GEOM.GEOM_Object, containing the result shape.
7200 # @ref tui_section "Example 1"
7201 # \n @ref swig_MakeCommon "Example 2"
7202 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7204 Perform Section boolean operation on two given shapes.
7207 theShape1 First argument for boolean operation.
7208 theShape2 Second argument for boolean operation.
7209 checkSelfInte The flag that tells if the arguments should
7210 be checked for self-intersection prior to
7212 theName Object name; when specified, this parameter is used
7213 for result publication in the study. Otherwise, if automatic
7214 publication is switched on, default value is used for result name.
7217 This algorithm doesn't find all types of self-intersections.
7218 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7219 vertex/face and edge/face intersections. Face/face
7220 intersections detection is switched off as it is a
7221 time-consuming operation that gives an impact on performance.
7222 To find all self-intersections please use
7223 CheckSelfIntersections() method.
7226 New GEOM.GEOM_Object, containing the result shape.
7229 # Example: see GEOM_TestOthers.py
7230 # note: auto-publishing is done in self.MakeBoolean()
7231 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7233 ## Perform Fuse boolean operation on the list of shapes.
7234 # @param theShapesList Shapes to be fused.
7235 # @param checkSelfInte The flag that tells if the arguments should
7236 # be checked for self-intersection prior to the operation.
7237 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7238 # operation should be performed during the operation.
7239 # @param theName Object name; when specified, this parameter is used
7240 # for result publication in the study. Otherwise, if automatic
7241 # publication is switched on, default value is used for result name.
7243 # @note This algorithm doesn't find all types of self-intersections.
7244 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7245 # vertex/face and edge/face intersections. Face/face
7246 # intersections detection is switched off as it is a
7247 # time-consuming operation that gives an impact on performance.
7248 # To find all self-intersections please use
7249 # CheckSelfIntersections() method.
7251 # @return New GEOM.GEOM_Object, containing the result shape.
7253 # @ref tui_fuse "Example 1"
7254 # \n @ref swig_MakeCommon "Example 2"
7255 @ManageTransactions("BoolOp")
7256 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7257 rmExtraEdges=False, theName=None):
7259 Perform Fuse boolean operation on the list of shapes.
7262 theShapesList Shapes to be fused.
7263 checkSelfInte The flag that tells if the arguments should
7264 be checked for self-intersection prior to
7266 rmExtraEdges The flag that tells if Remove Extra Edges
7267 operation should be performed during the operation.
7268 theName Object name; when specified, this parameter is used
7269 for result publication in the study. Otherwise, if automatic
7270 publication is switched on, default value is used for result name.
7273 This algorithm doesn't find all types of self-intersections.
7274 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7275 vertex/face and edge/face intersections. Face/face
7276 intersections detection is switched off as it is a
7277 time-consuming operation that gives an impact on performance.
7278 To find all self-intersections please use
7279 CheckSelfIntersections() method.
7282 New GEOM.GEOM_Object, containing the result shape.
7285 # Example: see GEOM_TestOthers.py
7286 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7288 RaiseIfFailed("MakeFuseList", self.BoolOp)
7289 self._autoPublish(anObj, theName, "fuse")
7292 ## Perform Common boolean operation on the list of shapes.
7293 # @param theShapesList Shapes for Common operation.
7294 # @param checkSelfInte The flag that tells if the arguments should
7295 # be checked for self-intersection prior to the operation.
7296 # @param theName Object name; when specified, this parameter is used
7297 # for result publication in the study. Otherwise, if automatic
7298 # publication is switched on, default value is used for result name.
7300 # @note This algorithm doesn't find all types of self-intersections.
7301 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7302 # vertex/face and edge/face intersections. Face/face
7303 # intersections detection is switched off as it is a
7304 # time-consuming operation that gives an impact on performance.
7305 # To find all self-intersections please use
7306 # CheckSelfIntersections() method.
7308 # @return New GEOM.GEOM_Object, containing the result shape.
7310 # @ref tui_common "Example 1"
7311 # \n @ref swig_MakeCommon "Example 2"
7312 @ManageTransactions("BoolOp")
7313 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7315 Perform Common boolean operation on the list of shapes.
7318 theShapesList Shapes for Common operation.
7319 checkSelfInte The flag that tells if the arguments should
7320 be checked for self-intersection prior to
7322 theName Object name; when specified, this parameter is used
7323 for result publication in the study. Otherwise, if automatic
7324 publication is switched on, default value is used for result name.
7327 This algorithm doesn't find all types of self-intersections.
7328 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7329 vertex/face and edge/face intersections. Face/face
7330 intersections detection is switched off as it is a
7331 time-consuming operation that gives an impact on performance.
7332 To find all self-intersections please use
7333 CheckSelfIntersections() method.
7336 New GEOM.GEOM_Object, containing the result shape.
7339 # Example: see GEOM_TestOthers.py
7340 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7341 RaiseIfFailed("MakeCommonList", self.BoolOp)
7342 self._autoPublish(anObj, theName, "common")
7345 ## Perform Cut boolean operation on one object and the list of tools.
7346 # @param theMainShape The object of the operation.
7347 # @param theShapesList The list of tools of the operation.
7348 # @param checkSelfInte The flag that tells if the arguments should
7349 # be checked for self-intersection prior to the operation.
7350 # @param theName Object name; when specified, this parameter is used
7351 # for result publication in the study. Otherwise, if automatic
7352 # publication is switched on, default value is used for result name.
7354 # @note This algorithm doesn't find all types of self-intersections.
7355 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7356 # vertex/face and edge/face intersections. Face/face
7357 # intersections detection is switched off as it is a
7358 # time-consuming operation that gives an impact on performance.
7359 # To find all self-intersections please use
7360 # CheckSelfIntersections() method.
7362 # @return New GEOM.GEOM_Object, containing the result shape.
7364 # @ref tui_cut "Example 1"
7365 # \n @ref swig_MakeCommon "Example 2"
7366 @ManageTransactions("BoolOp")
7367 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7369 Perform Cut boolean operation on one object and the list of tools.
7372 theMainShape The object of the operation.
7373 theShapesList The list of tools of the operation.
7374 checkSelfInte The flag that tells if the arguments should
7375 be checked for self-intersection prior to
7377 theName Object name; when specified, this parameter is used
7378 for result publication in the study. Otherwise, if automatic
7379 publication is switched on, default value is used for result name.
7382 This algorithm doesn't find all types of self-intersections.
7383 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7384 vertex/face and edge/face intersections. Face/face
7385 intersections detection is switched off as it is a
7386 time-consuming operation that gives an impact on performance.
7387 To find all self-intersections please use
7388 CheckSelfIntersections() method.
7391 New GEOM.GEOM_Object, containing the result shape.
7394 # Example: see GEOM_TestOthers.py
7395 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7396 RaiseIfFailed("MakeCutList", self.BoolOp)
7397 self._autoPublish(anObj, theName, "cut")
7403 ## @addtogroup l3_basic_op
7406 ## Perform partition operation.
7407 # @param ListShapes Shapes to be intersected.
7408 # @param ListTools Shapes to intersect theShapes.
7409 # @param Limit Type of resulting shapes (see ShapeType()).\n
7410 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7411 # type will be detected automatically.
7412 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7413 # target type (equal to Limit) are kept in the result,
7414 # else standalone shapes of lower dimension
7415 # are kept also (if they exist).
7417 # @param theName Object name; when specified, this parameter is used
7418 # for result publication in the study. Otherwise, if automatic
7419 # publication is switched on, default value is used for result name.
7421 # @note Each compound from ListShapes and ListTools will be exploded
7422 # in order to avoid possible intersection between shapes from this compound.
7424 # After implementation new version of PartitionAlgo (October 2006)
7425 # other parameters are ignored by current functionality. They are kept
7426 # in this function only for support old versions.
7427 # @param ListKeepInside Shapes, outside which the results will be deleted.
7428 # Each shape from theKeepInside must belong to theShapes also.
7429 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7430 # Each shape from theRemoveInside must belong to theShapes also.
7431 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7432 # @param ListMaterials Material indices for each shape. Make sence,
7433 # only if theRemoveWebs is TRUE.
7435 # @return New GEOM.GEOM_Object, containing the result shapes.
7437 # @ref tui_partition "Example"
7438 @ManageTransactions("BoolOp")
7439 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7440 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7441 KeepNonlimitShapes=0, theName=None):
7443 Perform partition operation.
7446 ListShapes Shapes to be intersected.
7447 ListTools Shapes to intersect theShapes.
7448 Limit Type of resulting shapes (see geompy.ShapeType)
7449 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7450 type will be detected automatically.
7451 KeepNonlimitShapes if this parameter == 0, then only shapes of
7452 target type (equal to Limit) are kept in the result,
7453 else standalone shapes of lower dimension
7454 are kept also (if they exist).
7456 theName Object name; when specified, this parameter is used
7457 for result publication in the study. Otherwise, if automatic
7458 publication is switched on, default value is used for result name.
7460 Each compound from ListShapes and ListTools will be exploded
7461 in order to avoid possible intersection between shapes from
7464 After implementation new version of PartitionAlgo (October 2006) other
7465 parameters are ignored by current functionality. They are kept in this
7466 function only for support old versions.
7469 ListKeepInside Shapes, outside which the results will be deleted.
7470 Each shape from theKeepInside must belong to theShapes also.
7471 ListRemoveInside Shapes, inside which the results will be deleted.
7472 Each shape from theRemoveInside must belong to theShapes also.
7473 RemoveWebs If TRUE, perform Glue 3D algorithm.
7474 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7477 New GEOM.GEOM_Object, containing the result shapes.
7479 # Example: see GEOM_TestAll.py
7480 if Limit == self.ShapeType["AUTO"]:
7481 # automatic detection of the most appropriate shape limit type
7483 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7484 Limit = EnumToLong(lim)
7486 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7487 ListKeepInside, ListRemoveInside,
7488 Limit, RemoveWebs, ListMaterials,
7489 KeepNonlimitShapes);
7490 RaiseIfFailed("MakePartition", self.BoolOp)
7491 self._autoPublish(anObj, theName, "partition")
7494 ## Perform partition operation.
7495 # This method may be useful if it is needed to make a partition for
7496 # compound contains nonintersected shapes. Performance will be better
7497 # since intersection between shapes from compound is not performed.
7499 # Description of all parameters as in previous method MakePartition().
7500 # One additional parameter is provided:
7501 # @param checkSelfInte The flag that tells if the arguments should
7502 # be checked for self-intersection prior to the operation.
7504 # @note This algorithm doesn't find all types of self-intersections.
7505 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7506 # vertex/face and edge/face intersections. Face/face
7507 # intersections detection is switched off as it is a
7508 # time-consuming operation that gives an impact on performance.
7509 # To find all self-intersections please use
7510 # CheckSelfIntersections() method.
7512 # @note Passed compounds (via ListShapes or via ListTools)
7513 # have to consist of nonintersecting shapes.
7515 # @return New GEOM.GEOM_Object, containing the result shapes.
7517 # @ref swig_todo "Example"
7518 @ManageTransactions("BoolOp")
7519 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7520 ListKeepInside=[], ListRemoveInside=[],
7521 Limit=ShapeType["AUTO"], RemoveWebs=0,
7522 ListMaterials=[], KeepNonlimitShapes=0,
7523 checkSelfInte=False, theName=None):
7525 Perform partition operation.
7526 This method may be useful if it is needed to make a partition for
7527 compound contains nonintersected shapes. Performance will be better
7528 since intersection between shapes from compound is not performed.
7531 Description of all parameters as in method geompy.MakePartition.
7532 One additional parameter is provided:
7533 checkSelfInte The flag that tells if the arguments should
7534 be checked for self-intersection prior to
7538 This algorithm doesn't find all types of self-intersections.
7539 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7540 vertex/face and edge/face intersections. Face/face
7541 intersections detection is switched off as it is a
7542 time-consuming operation that gives an impact on performance.
7543 To find all self-intersections please use
7544 CheckSelfIntersections() method.
7547 Passed compounds (via ListShapes or via ListTools)
7548 have to consist of nonintersecting shapes.
7551 New GEOM.GEOM_Object, containing the result shapes.
7553 if Limit == self.ShapeType["AUTO"]:
7554 # automatic detection of the most appropriate shape limit type
7556 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7557 Limit = EnumToLong(lim)
7559 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7560 ListKeepInside, ListRemoveInside,
7561 Limit, RemoveWebs, ListMaterials,
7562 KeepNonlimitShapes, checkSelfInte);
7563 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7564 self._autoPublish(anObj, theName, "partition")
7567 ## See method MakePartition() for more information.
7569 # @ref tui_partition "Example 1"
7570 # \n @ref swig_Partition "Example 2"
7571 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7572 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7573 KeepNonlimitShapes=0, theName=None):
7575 See method geompy.MakePartition for more information.
7577 # Example: see GEOM_TestOthers.py
7578 # note: auto-publishing is done in self.MakePartition()
7579 anObj = self.MakePartition(ListShapes, ListTools,
7580 ListKeepInside, ListRemoveInside,
7581 Limit, RemoveWebs, ListMaterials,
7582 KeepNonlimitShapes, theName);
7585 ## Perform partition of the Shape with the Plane
7586 # @param theShape Shape to be intersected.
7587 # @param thePlane Tool shape, to intersect theShape.
7588 # @param theName Object name; when specified, this parameter is used
7589 # for result publication in the study. Otherwise, if automatic
7590 # publication is switched on, default value is used for result name.
7592 # @return New GEOM.GEOM_Object, containing the result shape.
7594 # @ref tui_partition "Example"
7595 @ManageTransactions("BoolOp")
7596 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7598 Perform partition of the Shape with the Plane
7601 theShape Shape to be intersected.
7602 thePlane Tool shape, to intersect theShape.
7603 theName Object name; when specified, this parameter is used
7604 for result publication in the study. Otherwise, if automatic
7605 publication is switched on, default value is used for result name.
7608 New GEOM.GEOM_Object, containing the result shape.
7610 # Example: see GEOM_TestAll.py
7611 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7612 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7613 self._autoPublish(anObj, theName, "partition")
7616 # end of l3_basic_op
7619 ## @addtogroup l3_transform
7622 ## Translate the given object along the vector, specified
7623 # by its end points.
7624 # @param theObject The object to be translated.
7625 # @param thePoint1 Start point of translation vector.
7626 # @param thePoint2 End point of translation vector.
7627 # @param theCopy Flag used to translate object itself or create a copy.
7628 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7629 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7630 @ManageTransactions("TrsfOp")
7631 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7633 Translate the given object along the vector, specified by its end points.
7636 theObject The object to be translated.
7637 thePoint1 Start point of translation vector.
7638 thePoint2 End point of translation vector.
7639 theCopy Flag used to translate object itself or create a copy.
7642 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7643 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7646 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7648 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7649 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7652 ## Translate the given object along the vector, specified
7653 # by its end points, creating its copy before the translation.
7654 # @param theObject The object to be translated.
7655 # @param thePoint1 Start point of translation vector.
7656 # @param thePoint2 End point of translation vector.
7657 # @param theName Object name; when specified, this parameter is used
7658 # for result publication in the study. Otherwise, if automatic
7659 # publication is switched on, default value is used for result name.
7661 # @return New GEOM.GEOM_Object, containing the translated object.
7663 # @ref tui_translation "Example 1"
7664 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7665 @ManageTransactions("TrsfOp")
7666 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7668 Translate the given object along the vector, specified
7669 by its end points, creating its copy before the translation.
7672 theObject The object to be translated.
7673 thePoint1 Start point of translation vector.
7674 thePoint2 End point of translation vector.
7675 theName Object name; when specified, this parameter is used
7676 for result publication in the study. Otherwise, if automatic
7677 publication is switched on, default value is used for result name.
7680 New GEOM.GEOM_Object, containing the translated object.
7682 # Example: see GEOM_TestAll.py
7683 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7684 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7685 self._autoPublish(anObj, theName, "translated")
7688 ## Translate the given object along the vector, specified by its components.
7689 # @param theObject The object to be translated.
7690 # @param theDX,theDY,theDZ Components of translation vector.
7691 # @param theCopy Flag used to translate object itself or create a copy.
7692 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7693 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7695 # @ref tui_translation "Example"
7696 @ManageTransactions("TrsfOp")
7697 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7699 Translate the given object along the vector, specified by its components.
7702 theObject The object to be translated.
7703 theDX,theDY,theDZ Components of translation vector.
7704 theCopy Flag used to translate object itself or create a copy.
7707 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7708 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7710 # Example: see GEOM_TestAll.py
7711 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7713 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7715 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7716 anObj.SetParameters(Parameters)
7717 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7720 ## Translate the given object along the vector, specified
7721 # by its components, creating its copy before the translation.
7722 # @param theObject The object to be translated.
7723 # @param theDX,theDY,theDZ Components of translation vector.
7724 # @param theName Object name; when specified, this parameter is used
7725 # for result publication in the study. Otherwise, if automatic
7726 # publication is switched on, default value is used for result name.
7728 # @return New GEOM.GEOM_Object, containing the translated object.
7730 # @ref tui_translation "Example"
7731 @ManageTransactions("TrsfOp")
7732 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7734 Translate the given object along the vector, specified
7735 by its components, creating its copy before the translation.
7738 theObject The object to be translated.
7739 theDX,theDY,theDZ Components of translation vector.
7740 theName Object name; when specified, this parameter is used
7741 for result publication in the study. Otherwise, if automatic
7742 publication is switched on, default value is used for result name.
7745 New GEOM.GEOM_Object, containing the translated object.
7747 # Example: see GEOM_TestAll.py
7748 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7749 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7750 anObj.SetParameters(Parameters)
7751 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7752 self._autoPublish(anObj, theName, "translated")
7755 ## Translate the given object along the given vector.
7756 # @param theObject The object to be translated.
7757 # @param theVector The translation vector.
7758 # @param theCopy Flag used to translate object itself or create a copy.
7759 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7760 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7761 @ManageTransactions("TrsfOp")
7762 def TranslateVector(self, theObject, theVector, theCopy=False):
7764 Translate the given object along the given vector.
7767 theObject The object to be translated.
7768 theVector The translation vector.
7769 theCopy Flag used to translate object itself or create a copy.
7772 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7773 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7776 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7778 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7779 RaiseIfFailed("TranslateVector", self.TrsfOp)
7782 ## Translate the given object along the given vector,
7783 # creating its copy before the translation.
7784 # @param theObject The object to be translated.
7785 # @param theVector The translation vector.
7786 # @param theName Object name; when specified, this parameter is used
7787 # for result publication in the study. Otherwise, if automatic
7788 # publication is switched on, default value is used for result name.
7790 # @return New GEOM.GEOM_Object, containing the translated object.
7792 # @ref tui_translation "Example"
7793 @ManageTransactions("TrsfOp")
7794 def MakeTranslationVector(self, theObject, theVector, theName=None):
7796 Translate the given object along the given vector,
7797 creating its copy before the translation.
7800 theObject The object to be translated.
7801 theVector The translation vector.
7802 theName Object name; when specified, this parameter is used
7803 for result publication in the study. Otherwise, if automatic
7804 publication is switched on, default value is used for result name.
7807 New GEOM.GEOM_Object, containing the translated object.
7809 # Example: see GEOM_TestAll.py
7810 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7811 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7812 self._autoPublish(anObj, theName, "translated")
7815 ## Translate the given object along the given vector on given distance.
7816 # @param theObject The object to be translated.
7817 # @param theVector The translation vector.
7818 # @param theDistance The translation distance.
7819 # @param theCopy Flag used to translate object itself or create a copy.
7820 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7821 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7823 # @ref tui_translation "Example"
7824 @ManageTransactions("TrsfOp")
7825 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7827 Translate the given object along the given vector on given distance.
7830 theObject The object to be translated.
7831 theVector The translation vector.
7832 theDistance The translation distance.
7833 theCopy Flag used to translate object itself or create a copy.
7836 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7837 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7839 # Example: see GEOM_TestAll.py
7840 theDistance,Parameters = ParseParameters(theDistance)
7841 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7842 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7843 anObj.SetParameters(Parameters)
7846 ## Translate the given object along the given vector on given distance,
7847 # creating its copy before the translation.
7848 # @param theObject The object to be translated.
7849 # @param theVector The translation vector.
7850 # @param theDistance The translation distance.
7851 # @param theName Object name; when specified, this parameter is used
7852 # for result publication in the study. Otherwise, if automatic
7853 # publication is switched on, default value is used for result name.
7855 # @return New GEOM.GEOM_Object, containing the translated object.
7857 # @ref tui_translation "Example"
7858 @ManageTransactions("TrsfOp")
7859 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7861 Translate the given object along the given vector on given distance,
7862 creating its copy before the translation.
7865 theObject The object to be translated.
7866 theVector The translation vector.
7867 theDistance The translation distance.
7868 theName Object name; when specified, this parameter is used
7869 for result publication in the study. Otherwise, if automatic
7870 publication is switched on, default value is used for result name.
7873 New GEOM.GEOM_Object, containing the translated object.
7875 # Example: see GEOM_TestAll.py
7876 theDistance,Parameters = ParseParameters(theDistance)
7877 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7878 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7879 anObj.SetParameters(Parameters)
7880 self._autoPublish(anObj, theName, "translated")
7883 ## Rotate the given object around the given axis on the given angle.
7884 # @param theObject The object to be rotated.
7885 # @param theAxis Rotation axis.
7886 # @param theAngle Rotation angle in radians.
7887 # @param theCopy Flag used to rotate object itself or create a copy.
7889 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7890 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7892 # @ref tui_rotation "Example"
7893 @ManageTransactions("TrsfOp")
7894 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7896 Rotate the given object around the given axis on the given angle.
7899 theObject The object to be rotated.
7900 theAxis Rotation axis.
7901 theAngle Rotation angle in radians.
7902 theCopy Flag used to rotate object itself or create a copy.
7905 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7906 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7908 # Example: see GEOM_TestAll.py
7910 if isinstance(theAngle,str):
7912 theAngle, Parameters = ParseParameters(theAngle)
7914 theAngle = theAngle*math.pi/180.0
7916 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7918 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7919 RaiseIfFailed("Rotate", self.TrsfOp)
7920 anObj.SetParameters(Parameters)
7923 ## Rotate the given object around the given axis
7924 # on the given angle, creating its copy before the rotation.
7925 # @param theObject The object to be rotated.
7926 # @param theAxis Rotation axis.
7927 # @param theAngle Rotation angle in radians.
7928 # @param theName Object name; when specified, this parameter is used
7929 # for result publication in the study. Otherwise, if automatic
7930 # publication is switched on, default value is used for result name.
7932 # @return New GEOM.GEOM_Object, containing the rotated object.
7934 # @ref tui_rotation "Example"
7935 @ManageTransactions("TrsfOp")
7936 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7938 Rotate the given object around the given axis
7939 on the given angle, creating its copy before the rotatation.
7942 theObject The object to be rotated.
7943 theAxis Rotation axis.
7944 theAngle Rotation angle in radians.
7945 theName Object name; when specified, this parameter is used
7946 for result publication in the study. Otherwise, if automatic
7947 publication is switched on, default value is used for result name.
7950 New GEOM.GEOM_Object, containing the rotated object.
7952 # Example: see GEOM_TestAll.py
7954 if isinstance(theAngle,str):
7956 theAngle, Parameters = ParseParameters(theAngle)
7958 theAngle = theAngle*math.pi/180.0
7959 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7960 RaiseIfFailed("RotateCopy", self.TrsfOp)
7961 anObj.SetParameters(Parameters)
7962 self._autoPublish(anObj, theName, "rotated")
7965 ## Rotate given object around vector perpendicular to plane
7966 # containing three points.
7967 # @param theObject The object to be rotated.
7968 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7969 # containing the three points.
7970 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7971 # @param theCopy Flag used to rotate object itself or create a copy.
7972 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7973 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7974 @ManageTransactions("TrsfOp")
7975 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7977 Rotate given object around vector perpendicular to plane
7978 containing three points.
7981 theObject The object to be rotated.
7982 theCentPoint central point the axis is the vector perpendicular to the plane
7983 containing the three points.
7984 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7985 theCopy Flag used to rotate object itself or create a copy.
7988 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7989 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7992 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7994 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7995 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7998 ## Rotate given object around vector perpendicular to plane
7999 # containing three points, creating its copy before the rotatation.
8000 # @param theObject The object to be rotated.
8001 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8002 # containing the three points.
8003 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8004 # @param theName Object name; when specified, this parameter is used
8005 # for result publication in the study. Otherwise, if automatic
8006 # publication is switched on, default value is used for result name.
8008 # @return New GEOM.GEOM_Object, containing the rotated object.
8010 # @ref tui_rotation "Example"
8011 @ManageTransactions("TrsfOp")
8012 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8014 Rotate given object around vector perpendicular to plane
8015 containing three points, creating its copy before the rotatation.
8018 theObject The object to be rotated.
8019 theCentPoint central point the axis is the vector perpendicular to the plane
8020 containing the three points.
8021 thePoint1,thePoint2 in a perpendicular plane of the axis.
8022 theName Object name; when specified, this parameter is used
8023 for result publication in the study. Otherwise, if automatic
8024 publication is switched on, default value is used for result name.
8027 New GEOM.GEOM_Object, containing the rotated object.
8029 # Example: see GEOM_TestAll.py
8030 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8031 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8032 self._autoPublish(anObj, theName, "rotated")
8035 ## Scale the given object by the specified factor.
8036 # @param theObject The object to be scaled.
8037 # @param thePoint Center point for scaling.
8038 # Passing None for it means scaling relatively the origin of global CS.
8039 # @param theFactor Scaling factor value.
8040 # @param theCopy Flag used to scale object itself or create a copy.
8041 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8042 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8043 @ManageTransactions("TrsfOp")
8044 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8046 Scale the given object by the specified factor.
8049 theObject The object to be scaled.
8050 thePoint Center point for scaling.
8051 Passing None for it means scaling relatively the origin of global CS.
8052 theFactor Scaling factor value.
8053 theCopy Flag used to scale object itself or create a copy.
8056 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8057 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8059 # Example: see GEOM_TestAll.py
8060 theFactor, Parameters = ParseParameters(theFactor)
8062 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8064 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8065 RaiseIfFailed("Scale", self.TrsfOp)
8066 anObj.SetParameters(Parameters)
8069 ## Scale the given object by the factor, creating its copy before the scaling.
8070 # @param theObject The object to be scaled.
8071 # @param thePoint Center point for scaling.
8072 # Passing None for it means scaling relatively the origin of global CS.
8073 # @param theFactor Scaling factor value.
8074 # @param theName Object name; when specified, this parameter is used
8075 # for result publication in the study. Otherwise, if automatic
8076 # publication is switched on, default value is used for result name.
8078 # @return New GEOM.GEOM_Object, containing the scaled shape.
8080 # @ref tui_scale "Example"
8081 @ManageTransactions("TrsfOp")
8082 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8084 Scale the given object by the factor, creating its copy before the scaling.
8087 theObject The object to be scaled.
8088 thePoint Center point for scaling.
8089 Passing None for it means scaling relatively the origin of global CS.
8090 theFactor Scaling factor value.
8091 theName Object name; when specified, this parameter is used
8092 for result publication in the study. Otherwise, if automatic
8093 publication is switched on, default value is used for result name.
8096 New GEOM.GEOM_Object, containing the scaled shape.
8098 # Example: see GEOM_TestAll.py
8099 theFactor, Parameters = ParseParameters(theFactor)
8100 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8101 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8102 anObj.SetParameters(Parameters)
8103 self._autoPublish(anObj, theName, "scaled")
8106 ## Scale the given object by different factors along coordinate axes.
8107 # @param theObject The object to be scaled.
8108 # @param thePoint Center point for scaling.
8109 # Passing None for it means scaling relatively the origin of global CS.
8110 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8111 # @param theCopy Flag used to scale object itself or create a copy.
8112 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8113 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8114 @ManageTransactions("TrsfOp")
8115 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8117 Scale the given object by different factors along coordinate axes.
8120 theObject The object to be scaled.
8121 thePoint Center point for scaling.
8122 Passing None for it means scaling relatively the origin of global CS.
8123 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8124 theCopy Flag used to scale object itself or create a copy.
8127 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8128 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8130 # Example: see GEOM_TestAll.py
8131 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8133 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8134 theFactorX, theFactorY, theFactorZ)
8136 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8137 theFactorX, theFactorY, theFactorZ)
8138 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8139 anObj.SetParameters(Parameters)
8142 ## Scale the given object by different factors along coordinate axes,
8143 # creating its copy before the scaling.
8144 # @param theObject The object to be scaled.
8145 # @param thePoint Center point for scaling.
8146 # Passing None for it means scaling relatively the origin of global CS.
8147 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8148 # @param theName Object name; when specified, this parameter is used
8149 # for result publication in the study. Otherwise, if automatic
8150 # publication is switched on, default value is used for result name.
8152 # @return New GEOM.GEOM_Object, containing the scaled shape.
8154 # @ref swig_scale "Example"
8155 @ManageTransactions("TrsfOp")
8156 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8158 Scale the given object by different factors along coordinate axes,
8159 creating its copy before the scaling.
8162 theObject The object to be scaled.
8163 thePoint Center point for scaling.
8164 Passing None for it means scaling relatively the origin of global CS.
8165 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8166 theName Object name; when specified, this parameter is used
8167 for result publication in the study. Otherwise, if automatic
8168 publication is switched on, default value is used for result name.
8171 New GEOM.GEOM_Object, containing the scaled shape.
8173 # Example: see GEOM_TestAll.py
8174 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8175 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8176 theFactorX, theFactorY, theFactorZ)
8177 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8178 anObj.SetParameters(Parameters)
8179 self._autoPublish(anObj, theName, "scaled")
8182 ## Mirror an object relatively the given plane.
8183 # @param theObject The object to be mirrored.
8184 # @param thePlane Plane of symmetry.
8185 # @param theCopy Flag used to mirror object itself or create a copy.
8186 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8187 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8188 @ManageTransactions("TrsfOp")
8189 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8191 Mirror an object relatively the given plane.
8194 theObject The object to be mirrored.
8195 thePlane Plane of symmetry.
8196 theCopy Flag used to mirror object itself or create a copy.
8199 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8200 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8203 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8205 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8206 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8209 ## Create an object, symmetrical
8210 # to the given one relatively the given plane.
8211 # @param theObject The object to be mirrored.
8212 # @param thePlane Plane of symmetry.
8213 # @param theName Object name; when specified, this parameter is used
8214 # for result publication in the study. Otherwise, if automatic
8215 # publication is switched on, default value is used for result name.
8217 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8219 # @ref tui_mirror "Example"
8220 @ManageTransactions("TrsfOp")
8221 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8223 Create an object, symmetrical to the given one relatively the given plane.
8226 theObject The object to be mirrored.
8227 thePlane Plane of symmetry.
8228 theName Object name; when specified, this parameter is used
8229 for result publication in the study. Otherwise, if automatic
8230 publication is switched on, default value is used for result name.
8233 New GEOM.GEOM_Object, containing the mirrored shape.
8235 # Example: see GEOM_TestAll.py
8236 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8237 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8238 self._autoPublish(anObj, theName, "mirrored")
8241 ## Mirror an object relatively the given axis.
8242 # @param theObject The object to be mirrored.
8243 # @param theAxis Axis of symmetry.
8244 # @param theCopy Flag used to mirror object itself or create a copy.
8245 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8246 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8247 @ManageTransactions("TrsfOp")
8248 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8250 Mirror an object relatively the given axis.
8253 theObject The object to be mirrored.
8254 theAxis Axis of symmetry.
8255 theCopy Flag used to mirror object itself or create a copy.
8258 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8259 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8262 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8264 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8265 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8268 ## Create an object, symmetrical
8269 # to the given one relatively the given axis.
8270 # @param theObject The object to be mirrored.
8271 # @param theAxis Axis of symmetry.
8272 # @param theName Object name; when specified, this parameter is used
8273 # for result publication in the study. Otherwise, if automatic
8274 # publication is switched on, default value is used for result name.
8276 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8278 # @ref tui_mirror "Example"
8279 @ManageTransactions("TrsfOp")
8280 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8282 Create an object, symmetrical to the given one relatively the given axis.
8285 theObject The object to be mirrored.
8286 theAxis Axis of symmetry.
8287 theName Object name; when specified, this parameter is used
8288 for result publication in the study. Otherwise, if automatic
8289 publication is switched on, default value is used for result name.
8292 New GEOM.GEOM_Object, containing the mirrored shape.
8294 # Example: see GEOM_TestAll.py
8295 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8296 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8297 self._autoPublish(anObj, theName, "mirrored")
8300 ## Mirror an object relatively the given point.
8301 # @param theObject The object to be mirrored.
8302 # @param thePoint Point of symmetry.
8303 # @param theCopy Flag used to mirror object itself or create a copy.
8304 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8305 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8306 @ManageTransactions("TrsfOp")
8307 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8309 Mirror an object relatively the given point.
8312 theObject The object to be mirrored.
8313 thePoint Point of symmetry.
8314 theCopy Flag used to mirror object itself or create a copy.
8317 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8318 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8320 # Example: see GEOM_TestAll.py
8322 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8324 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8325 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8328 ## Create an object, symmetrical
8329 # to the given one relatively the given point.
8330 # @param theObject The object to be mirrored.
8331 # @param thePoint Point of symmetry.
8332 # @param theName Object name; when specified, this parameter is used
8333 # for result publication in the study. Otherwise, if automatic
8334 # publication is switched on, default value is used for result name.
8336 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8338 # @ref tui_mirror "Example"
8339 @ManageTransactions("TrsfOp")
8340 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8342 Create an object, symmetrical
8343 to the given one relatively the given point.
8346 theObject The object to be mirrored.
8347 thePoint Point of symmetry.
8348 theName Object name; when specified, this parameter is used
8349 for result publication in the study. Otherwise, if automatic
8350 publication is switched on, default value is used for result name.
8353 New GEOM.GEOM_Object, containing the mirrored shape.
8355 # Example: see GEOM_TestAll.py
8356 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8357 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8358 self._autoPublish(anObj, theName, "mirrored")
8361 ## Modify the location of the given object.
8362 # @param theObject The object to be displaced.
8363 # @param theStartLCS Coordinate system to perform displacement from it.\n
8364 # If \a theStartLCS is NULL, displacement
8365 # will be performed from global CS.\n
8366 # If \a theObject itself is used as \a theStartLCS,
8367 # its location will be changed to \a theEndLCS.
8368 # @param theEndLCS Coordinate system to perform displacement to it.
8369 # @param theCopy Flag used to displace object itself or create a copy.
8370 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8371 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8372 @ManageTransactions("TrsfOp")
8373 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8375 Modify the Location of the given object by LCS, creating its copy before the setting.
8378 theObject The object to be displaced.
8379 theStartLCS Coordinate system to perform displacement from it.
8380 If theStartLCS is NULL, displacement
8381 will be performed from global CS.
8382 If theObject itself is used as theStartLCS,
8383 its location will be changed to theEndLCS.
8384 theEndLCS Coordinate system to perform displacement to it.
8385 theCopy Flag used to displace object itself or create a copy.
8388 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8389 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8391 # Example: see GEOM_TestAll.py
8393 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8395 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8396 RaiseIfFailed("Displace", self.TrsfOp)
8399 ## Modify the Location of the given object by LCS,
8400 # creating its copy before the setting.
8401 # @param theObject The object to be displaced.
8402 # @param theStartLCS Coordinate system to perform displacement from it.\n
8403 # If \a theStartLCS is NULL, displacement
8404 # will be performed from global CS.\n
8405 # If \a theObject itself is used as \a theStartLCS,
8406 # its location will be changed to \a theEndLCS.
8407 # @param theEndLCS Coordinate system to perform displacement to it.
8408 # @param theName Object name; when specified, this parameter is used
8409 # for result publication in the study. Otherwise, if automatic
8410 # publication is switched on, default value is used for result name.
8412 # @return New GEOM.GEOM_Object, containing the displaced shape.
8414 # @ref tui_modify_location "Example"
8415 @ManageTransactions("TrsfOp")
8416 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8418 Modify the Location of the given object by LCS, creating its copy before the setting.
8421 theObject The object to be displaced.
8422 theStartLCS Coordinate system to perform displacement from it.
8423 If theStartLCS is NULL, displacement
8424 will be performed from global CS.
8425 If theObject itself is used as theStartLCS,
8426 its location will be changed to theEndLCS.
8427 theEndLCS Coordinate system to perform displacement to it.
8428 theName Object name; when specified, this parameter is used
8429 for result publication in the study. Otherwise, if automatic
8430 publication is switched on, default value is used for result name.
8433 New GEOM.GEOM_Object, containing the displaced shape.
8436 # create local coordinate systems
8437 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8438 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8439 # modify the location of the given object
8440 position = geompy.MakePosition(cylinder, cs1, cs2)
8442 # Example: see GEOM_TestAll.py
8443 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8444 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8445 self._autoPublish(anObj, theName, "displaced")
8448 ## Modify the Location of the given object by Path.
8449 # @param theObject The object to be displaced.
8450 # @param thePath Wire or Edge along that the object will be translated.
8451 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8452 # @param theCopy is to create a copy objects if true.
8453 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8454 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8455 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8457 # @ref tui_modify_location "Example"
8458 @ManageTransactions("TrsfOp")
8459 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8461 Modify the Location of the given object by Path.
8464 theObject The object to be displaced.
8465 thePath Wire or Edge along that the object will be translated.
8466 theDistance progress of Path (0 = start location, 1 = end of path location).
8467 theCopy is to create a copy objects if true.
8468 theReverse 0 - for usual direction, 1 - to reverse path direction.
8471 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8472 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8475 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8477 # Example: see GEOM_TestAll.py
8478 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8479 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8482 ## Modify the Location of the given object by Path, creating its copy before the operation.
8483 # @param theObject The object to be displaced.
8484 # @param thePath Wire or Edge along that the object will be translated.
8485 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8486 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8487 # @param theName Object name; when specified, this parameter is used
8488 # for result publication in the study. Otherwise, if automatic
8489 # publication is switched on, default value is used for result name.
8491 # @return New GEOM.GEOM_Object, containing the displaced shape.
8492 @ManageTransactions("TrsfOp")
8493 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8495 Modify the Location of the given object by Path, creating its copy before the operation.
8498 theObject The object to be displaced.
8499 thePath Wire or Edge along that the object will be translated.
8500 theDistance progress of Path (0 = start location, 1 = end of path location).
8501 theReverse 0 - for usual direction, 1 - to reverse path direction.
8502 theName Object name; when specified, this parameter is used
8503 for result publication in the study. Otherwise, if automatic
8504 publication is switched on, default value is used for result name.
8507 New GEOM.GEOM_Object, containing the displaced shape.
8509 # Example: see GEOM_TestAll.py
8510 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8511 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8512 self._autoPublish(anObj, theName, "displaced")
8515 ## Offset given shape.
8516 # @param theObject The base object for the offset.
8517 # @param theOffset Offset value.
8518 # @param theCopy Flag used to offset object itself or create a copy.
8519 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8520 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8521 @ManageTransactions("TrsfOp")
8522 def Offset(self, theObject, theOffset, theCopy=False):
8527 theObject The base object for the offset.
8528 theOffset Offset value.
8529 theCopy Flag used to offset object itself or create a copy.
8532 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8533 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8535 theOffset, Parameters = ParseParameters(theOffset)
8537 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8539 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8540 RaiseIfFailed("Offset", self.TrsfOp)
8541 anObj.SetParameters(Parameters)
8544 ## Create new object as offset of the given one.
8545 # @param theObject The base object for the offset.
8546 # @param theOffset Offset value.
8547 # @param theName Object name; when specified, this parameter is used
8548 # for result publication in the study. Otherwise, if automatic
8549 # publication is switched on, default value is used for result name.
8551 # @return New GEOM.GEOM_Object, containing the offset object.
8553 # @ref tui_offset "Example"
8554 @ManageTransactions("TrsfOp")
8555 def MakeOffset(self, theObject, theOffset, theName=None):
8557 Create new object as offset of the given one.
8560 theObject The base object for the offset.
8561 theOffset Offset value.
8562 theName Object name; when specified, this parameter is used
8563 for result publication in the study. Otherwise, if automatic
8564 publication is switched on, default value is used for result name.
8567 New GEOM.GEOM_Object, containing the offset object.
8570 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8571 # create a new object as offset of the given object
8572 offset = geompy.MakeOffset(box, 70.)
8574 # Example: see GEOM_TestAll.py
8575 theOffset, Parameters = ParseParameters(theOffset)
8576 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8577 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8578 anObj.SetParameters(Parameters)
8579 self._autoPublish(anObj, theName, "offset")
8582 ## Create new object as projection of the given one on a 2D surface.
8583 # @param theSource The source object for the projection. It can be a point, edge or wire.
8584 # @param theTarget The target object. It can be planar or cylindrical face.
8585 # @param theName Object name; when specified, this parameter is used
8586 # for result publication in the study. Otherwise, if automatic
8587 # publication is switched on, default value is used for result name.
8589 # @return New GEOM.GEOM_Object, containing the projection.
8591 # @ref tui_projection "Example"
8592 @ManageTransactions("TrsfOp")
8593 def MakeProjection(self, theSource, theTarget, theName=None):
8595 Create new object as projection of the given one on a 2D surface.
8598 theSource The source object for the projection. It can be a point, edge or wire.
8599 theTarget The target object. It can be planar or cylindrical face.
8600 theName Object name; when specified, this parameter is used
8601 for result publication in the study. Otherwise, if automatic
8602 publication is switched on, default value is used for result name.
8605 New GEOM.GEOM_Object, containing the projection.
8607 # Example: see GEOM_TestAll.py
8608 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8609 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8610 self._autoPublish(anObj, theName, "projection")
8613 ## Create a projection projection of the given point on a wire or an edge.
8614 # If there are no solutions or there are 2 or more solutions It throws an
8616 # @param thePoint the point to be projected.
8617 # @param theWire the wire. The edge is accepted as well.
8618 # @param theName Object name; when specified, this parameter is used
8619 # for result publication in the study. Otherwise, if automatic
8620 # publication is switched on, default value is used for result name.
8622 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8623 # \n \a u: The parameter of projection point on edge.
8624 # \n \a PointOnEdge: The projection point.
8625 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8627 # @ref tui_projection "Example"
8628 @ManageTransactions("TrsfOp")
8629 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8631 Create a projection projection of the given point on a wire or an edge.
8632 If there are no solutions or there are 2 or more solutions It throws an
8636 thePoint the point to be projected.
8637 theWire the wire. The edge is accepted as well.
8638 theName Object name; when specified, this parameter is used
8639 for result publication in the study. Otherwise, if automatic
8640 publication is switched on, default value is used for result name.
8643 [u, PointOnEdge, EdgeInWireIndex]
8644 u: The parameter of projection point on edge.
8645 PointOnEdge: The projection point.
8646 EdgeInWireIndex: The index of an edge in a wire.
8648 # Example: see GEOM_TestAll.py
8649 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8650 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8651 self._autoPublish(anObj[1], theName, "projection")
8654 # -----------------------------------------------------------------------------
8656 # -----------------------------------------------------------------------------
8658 ## Translate the given object along the given vector a given number times
8659 # @param theObject The object to be translated.
8660 # @param theVector Direction of the translation. DX if None.
8661 # @param theStep Distance to translate on.
8662 # @param theNbTimes Quantity of translations to be done.
8663 # @param theName Object name; when specified, this parameter is used
8664 # for result publication in the study. Otherwise, if automatic
8665 # publication is switched on, default value is used for result name.
8667 # @return New GEOM.GEOM_Object, containing compound of all
8668 # the shapes, obtained after each translation.
8670 # @ref tui_multi_translation "Example"
8671 @ManageTransactions("TrsfOp")
8672 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8674 Translate the given object along the given vector a given number times
8677 theObject The object to be translated.
8678 theVector Direction of the translation. DX if None.
8679 theStep Distance to translate on.
8680 theNbTimes Quantity of translations to be done.
8681 theName Object name; when specified, this parameter is used
8682 for result publication in the study. Otherwise, if automatic
8683 publication is switched on, default value is used for result name.
8686 New GEOM.GEOM_Object, containing compound of all
8687 the shapes, obtained after each translation.
8690 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8692 # Example: see GEOM_TestAll.py
8693 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8694 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8695 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8696 anObj.SetParameters(Parameters)
8697 self._autoPublish(anObj, theName, "multitranslation")
8700 ## Conseqently apply two specified translations to theObject specified number of times.
8701 # @param theObject The object to be translated.
8702 # @param theVector1 Direction of the first translation. DX if None.
8703 # @param theStep1 Step of the first translation.
8704 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8705 # @param theVector2 Direction of the second translation. DY if None.
8706 # @param theStep2 Step of the second translation.
8707 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8708 # @param theName Object name; when specified, this parameter is used
8709 # for result publication in the study. Otherwise, if automatic
8710 # publication is switched on, default value is used for result name.
8712 # @return New GEOM.GEOM_Object, containing compound of all
8713 # the shapes, obtained after each translation.
8715 # @ref tui_multi_translation "Example"
8716 @ManageTransactions("TrsfOp")
8717 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8718 theVector2, theStep2, theNbTimes2, theName=None):
8720 Conseqently apply two specified translations to theObject specified number of times.
8723 theObject The object to be translated.
8724 theVector1 Direction of the first translation. DX if None.
8725 theStep1 Step of the first translation.
8726 theNbTimes1 Quantity of translations to be done along theVector1.
8727 theVector2 Direction of the second translation. DY if None.
8728 theStep2 Step of the second translation.
8729 theNbTimes2 Quantity of translations to be done along theVector2.
8730 theName Object name; when specified, this parameter is used
8731 for result publication in the study. Otherwise, if automatic
8732 publication is switched on, default value is used for result name.
8735 New GEOM.GEOM_Object, containing compound of all
8736 the shapes, obtained after each translation.
8739 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8741 # Example: see GEOM_TestAll.py
8742 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8743 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8744 theVector2, theStep2, theNbTimes2)
8745 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8746 anObj.SetParameters(Parameters)
8747 self._autoPublish(anObj, theName, "multitranslation")
8750 ## Rotate the given object around the given axis a given number times.
8751 # Rotation angle will be 2*PI/theNbTimes.
8752 # @param theObject The object to be rotated.
8753 # @param theAxis The rotation axis. DZ if None.
8754 # @param theNbTimes Quantity of rotations to be done.
8755 # @param theName Object name; when specified, this parameter is used
8756 # for result publication in the study. Otherwise, if automatic
8757 # publication is switched on, default value is used for result name.
8759 # @return New GEOM.GEOM_Object, containing compound of all the
8760 # shapes, obtained after each rotation.
8762 # @ref tui_multi_rotation "Example"
8763 @ManageTransactions("TrsfOp")
8764 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8766 Rotate the given object around the given axis a given number times.
8767 Rotation angle will be 2*PI/theNbTimes.
8770 theObject The object to be rotated.
8771 theAxis The rotation axis. DZ if None.
8772 theNbTimes Quantity of rotations to be done.
8773 theName Object name; when specified, this parameter is used
8774 for result publication in the study. Otherwise, if automatic
8775 publication is switched on, default value is used for result name.
8778 New GEOM.GEOM_Object, containing compound of all the
8779 shapes, obtained after each rotation.
8782 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8784 # Example: see GEOM_TestAll.py
8785 theNbTimes, Parameters = ParseParameters(theNbTimes)
8786 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8787 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8788 anObj.SetParameters(Parameters)
8789 self._autoPublish(anObj, theName, "multirotation")
8792 ## Rotate the given object around the given axis
8793 # a given number times on the given angle.
8794 # @param theObject The object to be rotated.
8795 # @param theAxis The rotation axis. DZ if None.
8796 # @param theAngleStep Rotation angle in radians.
8797 # @param theNbTimes Quantity of rotations to be done.
8798 # @param theName Object name; when specified, this parameter is used
8799 # for result publication in the study. Otherwise, if automatic
8800 # publication is switched on, default value is used for result name.
8802 # @return New GEOM.GEOM_Object, containing compound of all the
8803 # shapes, obtained after each rotation.
8805 # @ref tui_multi_rotation "Example"
8806 @ManageTransactions("TrsfOp")
8807 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8809 Rotate the given object around the given axis
8810 a given number times on the given angle.
8813 theObject The object to be rotated.
8814 theAxis The rotation axis. DZ if None.
8815 theAngleStep Rotation angle in radians.
8816 theNbTimes Quantity of rotations to be done.
8817 theName Object name; when specified, this parameter is used
8818 for result publication in the study. Otherwise, if automatic
8819 publication is switched on, default value is used for result name.
8822 New GEOM.GEOM_Object, containing compound of all the
8823 shapes, obtained after each rotation.
8826 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8828 # Example: see GEOM_TestAll.py
8829 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8830 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8831 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8832 anObj.SetParameters(Parameters)
8833 self._autoPublish(anObj, theName, "multirotation")
8836 ## Rotate the given object around the given axis a given
8837 # number times and multi-translate each rotation result.
8838 # Rotation angle will be 2*PI/theNbTimes1.
8839 # Translation direction passes through center of gravity
8840 # of rotated shape and its projection on the rotation axis.
8841 # @param theObject The object to be rotated.
8842 # @param theAxis Rotation axis. DZ if None.
8843 # @param theNbTimes1 Quantity of rotations to be done.
8844 # @param theRadialStep Translation distance.
8845 # @param theNbTimes2 Quantity of translations to be done.
8846 # @param theName Object name; when specified, this parameter is used
8847 # for result publication in the study. Otherwise, if automatic
8848 # publication is switched on, default value is used for result name.
8850 # @return New GEOM.GEOM_Object, containing compound of all the
8851 # shapes, obtained after each transformation.
8853 # @ref tui_multi_rotation "Example"
8854 @ManageTransactions("TrsfOp")
8855 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8857 Rotate the given object around the
8858 given axis on the given angle a given number
8859 times and multi-translate each rotation result.
8860 Translation direction passes through center of gravity
8861 of rotated shape and its projection on the rotation axis.
8864 theObject The object to be rotated.
8865 theAxis Rotation axis. DZ if None.
8866 theNbTimes1 Quantity of rotations to be done.
8867 theRadialStep Translation distance.
8868 theNbTimes2 Quantity of translations to be done.
8869 theName Object name; when specified, this parameter is used
8870 for result publication in the study. Otherwise, if automatic
8871 publication is switched on, default value is used for result name.
8874 New GEOM.GEOM_Object, containing compound of all the
8875 shapes, obtained after each transformation.
8878 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8880 # Example: see GEOM_TestAll.py
8881 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8882 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8883 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8884 anObj.SetParameters(Parameters)
8885 self._autoPublish(anObj, theName, "multirotation")
8888 ## Rotate the given object around the
8889 # given axis on the given angle a given number
8890 # times and multi-translate each rotation result.
8891 # Translation direction passes through center of gravity
8892 # of rotated shape and its projection on the rotation axis.
8893 # @param theObject The object to be rotated.
8894 # @param theAxis Rotation axis. DZ if None.
8895 # @param theAngleStep Rotation angle in radians.
8896 # @param theNbTimes1 Quantity of rotations to be done.
8897 # @param theRadialStep Translation distance.
8898 # @param theNbTimes2 Quantity of translations to be done.
8899 # @param theName Object name; when specified, this parameter is used
8900 # for result publication in the study. Otherwise, if automatic
8901 # publication is switched on, default value is used for result name.
8903 # @return New GEOM.GEOM_Object, containing compound of all the
8904 # shapes, obtained after each transformation.
8906 # @ref tui_multi_rotation "Example"
8907 @ManageTransactions("TrsfOp")
8908 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8910 Rotate the given object around the
8911 given axis on the given angle a given number
8912 times and multi-translate each rotation result.
8913 Translation direction passes through center of gravity
8914 of rotated shape and its projection on the rotation axis.
8917 theObject The object to be rotated.
8918 theAxis Rotation axis. DZ if None.
8919 theAngleStep Rotation angle in radians.
8920 theNbTimes1 Quantity of rotations to be done.
8921 theRadialStep Translation distance.
8922 theNbTimes2 Quantity of translations to be done.
8923 theName Object name; when specified, this parameter is used
8924 for result publication in the study. Otherwise, if automatic
8925 publication is switched on, default value is used for result name.
8928 New GEOM.GEOM_Object, containing compound of all the
8929 shapes, obtained after each transformation.
8932 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8934 # Example: see GEOM_TestAll.py
8935 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8936 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8937 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8938 anObj.SetParameters(Parameters)
8939 self._autoPublish(anObj, theName, "multirotation")
8942 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8944 # @ref swig_MakeMultiRotation "Example"
8945 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8947 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8950 pz = geompy.MakeVertex(0, 0, 100)
8951 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8952 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8954 # Example: see GEOM_TestOthers.py
8955 aVec = self.MakeLine(aPoint,aDir)
8956 # note: auto-publishing is done in self.MultiRotate1D()
8957 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8960 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8962 # @ref swig_MakeMultiRotation "Example"
8963 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8965 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8968 pz = geompy.MakeVertex(0, 0, 100)
8969 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8970 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8972 # Example: see GEOM_TestOthers.py
8973 aVec = self.MakeLine(aPoint,aDir)
8974 # note: auto-publishing is done in self.MultiRotate1D()
8975 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8978 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8980 # @ref swig_MakeMultiRotation "Example"
8981 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8983 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8986 pz = geompy.MakeVertex(0, 0, 100)
8987 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8988 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8990 # Example: see GEOM_TestOthers.py
8991 aVec = self.MakeLine(aPoint,aDir)
8992 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8993 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8996 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8998 # @ref swig_MakeMultiRotation "Example"
8999 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9001 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9004 pz = geompy.MakeVertex(0, 0, 100)
9005 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9006 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9008 # Example: see GEOM_TestOthers.py
9009 aVec = self.MakeLine(aPoint,aDir)
9010 # note: auto-publishing is done in self.MultiRotate2D()
9011 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9014 # end of l3_transform
9017 ## @addtogroup l3_transform_d
9020 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9021 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9023 Deprecated method. Use MultiRotate1DNbTimes instead.
9025 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9026 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9028 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9029 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9030 @ManageTransactions("TrsfOp")
9031 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9033 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9034 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9037 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9039 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9040 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9041 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9042 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9043 anObj.SetParameters(Parameters)
9044 self._autoPublish(anObj, theName, "multirotation")
9047 ## The same, as MultiRotate1D(), but axis is given by direction and point
9048 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9049 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9051 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9052 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9055 pz = geompy.MakeVertex(0, 0, 100)
9056 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9057 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9059 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9060 aVec = self.MakeLine(aPoint,aDir)
9061 # note: auto-publishing is done in self.MultiRotate1D()
9062 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9065 ## The same, as MultiRotate2D(), but axis is given by direction and point
9066 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9067 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9069 The same, as MultiRotate2D(), but axis is given by direction and point
9070 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9073 pz = geompy.MakeVertex(0, 0, 100)
9074 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9075 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9077 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9078 aVec = self.MakeLine(aPoint,aDir)
9079 # note: auto-publishing is done in self.MultiRotate2D()
9080 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9083 # end of l3_transform_d
9086 ## @addtogroup l3_local
9089 ## Perform a fillet on all edges of the given shape.
9090 # @param theShape Shape, to perform fillet on.
9091 # @param theR Fillet radius.
9092 # @param theName Object name; when specified, this parameter is used
9093 # for result publication in the study. Otherwise, if automatic
9094 # publication is switched on, default value is used for result name.
9096 # @return New GEOM.GEOM_Object, containing the result shape.
9098 # @ref tui_fillet "Example 1"
9099 # \n @ref swig_MakeFilletAll "Example 2"
9100 @ManageTransactions("LocalOp")
9101 def MakeFilletAll(self, theShape, theR, theName=None):
9103 Perform a fillet on all edges of the given shape.
9106 theShape Shape, to perform fillet on.
9108 theName Object name; when specified, this parameter is used
9109 for result publication in the study. Otherwise, if automatic
9110 publication is switched on, default value is used for result name.
9113 New GEOM.GEOM_Object, containing the result shape.
9116 filletall = geompy.MakeFilletAll(prism, 10.)
9118 # Example: see GEOM_TestOthers.py
9119 theR,Parameters = ParseParameters(theR)
9120 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9121 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9122 anObj.SetParameters(Parameters)
9123 self._autoPublish(anObj, theName, "fillet")
9126 ## Perform a fillet on the specified edges/faces of the given shape
9127 # @param theShape Shape, to perform fillet on.
9128 # @param theR Fillet radius.
9129 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9130 # @param theListShapes Global indices of edges/faces to perform fillet on.
9131 # @param theName Object name; when specified, this parameter is used
9132 # for result publication in the study. Otherwise, if automatic
9133 # publication is switched on, default value is used for result name.
9135 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9137 # @return New GEOM.GEOM_Object, containing the result shape.
9139 # @ref tui_fillet "Example"
9140 @ManageTransactions("LocalOp")
9141 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9143 Perform a fillet on the specified edges/faces of the given shape
9146 theShape Shape, to perform fillet on.
9148 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9149 theListShapes Global indices of edges/faces to perform fillet on.
9150 theName Object name; when specified, this parameter is used
9151 for result publication in the study. Otherwise, if automatic
9152 publication is switched on, default value is used for result name.
9155 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9158 New GEOM.GEOM_Object, containing the result shape.
9161 # get the list of IDs (IDList) for the fillet
9162 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9164 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9165 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9166 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9167 # make a fillet on the specified edges of the given shape
9168 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9170 # Example: see GEOM_TestAll.py
9171 theR,Parameters = ParseParameters(theR)
9173 if theShapeType == self.ShapeType["EDGE"]:
9174 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9175 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9177 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9178 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9179 anObj.SetParameters(Parameters)
9180 self._autoPublish(anObj, theName, "fillet")
9183 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9184 @ManageTransactions("LocalOp")
9185 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9187 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9190 # get the list of IDs (IDList) for the fillet
9191 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9193 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9194 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9195 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9196 # make a fillet on the specified edges of the given shape
9197 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9199 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9201 if theShapeType == self.ShapeType["EDGE"]:
9202 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9203 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9205 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9206 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9207 anObj.SetParameters(Parameters)
9208 self._autoPublish(anObj, theName, "fillet")
9211 ## Perform a fillet on the specified edges of the given shape
9212 # @param theShape Wire Shape to perform fillet on.
9213 # @param theR Fillet radius.
9214 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9215 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9216 # \note The list of vertices could be empty,
9217 # in this case fillet will done done at all vertices in wire
9218 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9219 # by the length of the edges, nearest to the fillet vertex.
9220 # But sometimes the next edge is C1 continuous with the one, nearest to
9221 # the fillet point, and such two (or more) edges can be united to allow
9222 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9223 # thus ignoring the secant vertex (vertices).
9224 # @param theName Object name; when specified, this parameter is used
9225 # for result publication in the study. Otherwise, if automatic
9226 # publication is switched on, default value is used for result name.
9228 # @return New GEOM.GEOM_Object, containing the result shape.
9230 # @ref tui_fillet2d "Example"
9231 @ManageTransactions("LocalOp")
9232 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9234 Perform a fillet on the specified edges of the given shape
9237 theShape Wire Shape to perform fillet on.
9239 theListOfVertexes Global indices of vertexes to perform fillet on.
9240 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9241 by the length of the edges, nearest to the fillet vertex.
9242 But sometimes the next edge is C1 continuous with the one, nearest to
9243 the fillet point, and such two (or more) edges can be united to allow
9244 bigger radius. Set this flag to TRUE to allow collinear edges union,
9245 thus ignoring the secant vertex (vertices).
9246 theName Object name; when specified, this parameter is used
9247 for result publication in the study. Otherwise, if automatic
9248 publication is switched on, default value is used for result name.
9250 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9252 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9255 New GEOM.GEOM_Object, containing the result shape.
9259 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9260 # make fillet at given wire vertices with giver radius
9261 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9263 # Example: see GEOM_TestAll.py
9264 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9265 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9266 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9267 anObj.SetParameters(Parameters)
9268 self._autoPublish(anObj, theName, "fillet")
9271 ## Perform a fillet at the specified vertices of the given face/shell.
9272 # @param theShape Face or Shell shape to perform fillet on.
9273 # @param theR Fillet radius.
9274 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9275 # @param theName Object name; when specified, this parameter is used
9276 # for result publication in the study. Otherwise, if automatic
9277 # publication is switched on, default value is used for result name.
9279 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9281 # @return New GEOM.GEOM_Object, containing the result shape.
9283 # @ref tui_fillet2d "Example"
9284 @ManageTransactions("LocalOp")
9285 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9287 Perform a fillet at the specified vertices of the given face/shell.
9290 theShape Face or Shell shape to perform fillet on.
9292 theListOfVertexes Global indices of vertexes to perform fillet on.
9293 theName Object name; when specified, this parameter is used
9294 for result publication in the study. Otherwise, if automatic
9295 publication is switched on, default value is used for result name.
9297 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9300 New GEOM.GEOM_Object, containing the result shape.
9303 face = geompy.MakeFaceHW(100, 100, 1)
9304 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9306 # Example: see GEOM_TestAll.py
9307 theR,Parameters = ParseParameters(theR)
9308 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9309 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9310 anObj.SetParameters(Parameters)
9311 self._autoPublish(anObj, theName, "fillet")
9314 ## Perform a symmetric chamfer on all edges of the given shape.
9315 # @param theShape Shape, to perform chamfer on.
9316 # @param theD Chamfer size along each face.
9317 # @param theName Object name; when specified, this parameter is used
9318 # for result publication in the study. Otherwise, if automatic
9319 # publication is switched on, default value is used for result name.
9321 # @return New GEOM.GEOM_Object, containing the result shape.
9323 # @ref tui_chamfer "Example 1"
9324 # \n @ref swig_MakeChamferAll "Example 2"
9325 @ManageTransactions("LocalOp")
9326 def MakeChamferAll(self, theShape, theD, theName=None):
9328 Perform a symmetric chamfer on all edges of the given shape.
9331 theShape Shape, to perform chamfer on.
9332 theD Chamfer size along each face.
9333 theName Object name; when specified, this parameter is used
9334 for result publication in the study. Otherwise, if automatic
9335 publication is switched on, default value is used for result name.
9338 New GEOM.GEOM_Object, containing the result shape.
9341 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9343 # Example: see GEOM_TestOthers.py
9344 theD,Parameters = ParseParameters(theD)
9345 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9346 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9347 anObj.SetParameters(Parameters)
9348 self._autoPublish(anObj, theName, "chamfer")
9351 ## Perform a chamfer on edges, common to the specified faces,
9352 # with distance D1 on the Face1
9353 # @param theShape Shape, to perform chamfer on.
9354 # @param theD1 Chamfer size along \a theFace1.
9355 # @param theD2 Chamfer size along \a theFace2.
9356 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9357 # @param theName Object name; when specified, this parameter is used
9358 # for result publication in the study. Otherwise, if automatic
9359 # publication is switched on, default value is used for result name.
9361 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9363 # @return New GEOM.GEOM_Object, containing the result shape.
9365 # @ref tui_chamfer "Example"
9366 @ManageTransactions("LocalOp")
9367 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9369 Perform a chamfer on edges, common to the specified faces,
9370 with distance D1 on the Face1
9373 theShape Shape, to perform chamfer on.
9374 theD1 Chamfer size along theFace1.
9375 theD2 Chamfer size along theFace2.
9376 theFace1,theFace2 Global indices of two faces of theShape.
9377 theName Object name; when specified, this parameter is used
9378 for result publication in the study. Otherwise, if automatic
9379 publication is switched on, default value is used for result name.
9382 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9385 New GEOM.GEOM_Object, containing the result shape.
9388 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9389 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9390 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9391 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9393 # Example: see GEOM_TestAll.py
9394 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9395 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9396 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9397 anObj.SetParameters(Parameters)
9398 self._autoPublish(anObj, theName, "chamfer")
9401 ## Perform a chamfer on edges
9402 # @param theShape Shape, to perform chamfer on.
9403 # @param theD Chamfer length
9404 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9405 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9406 # @param theName Object name; when specified, this parameter is used
9407 # for result publication in the study. Otherwise, if automatic
9408 # publication is switched on, default value is used for result name.
9410 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9412 # @return New GEOM.GEOM_Object, containing the result shape.
9413 @ManageTransactions("LocalOp")
9414 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9416 Perform a chamfer on edges
9419 theShape Shape, to perform chamfer on.
9420 theD1 Chamfer size along theFace1.
9421 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9422 theFace1,theFace2 Global indices of two faces of theShape.
9423 theName Object name; when specified, this parameter is used
9424 for result publication in the study. Otherwise, if automatic
9425 publication is switched on, default value is used for result name.
9428 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9431 New GEOM.GEOM_Object, containing the result shape.
9434 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9435 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9436 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9438 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9441 if isinstance(theAngle,str):
9443 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9445 theAngle = theAngle*math.pi/180.0
9446 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9447 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9448 anObj.SetParameters(Parameters)
9449 self._autoPublish(anObj, theName, "chamfer")
9452 ## Perform a chamfer on all edges of the specified faces,
9453 # with distance D1 on the first specified face (if several for one edge)
9454 # @param theShape Shape, to perform chamfer on.
9455 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9456 # connected to the edge, are in \a theFaces, \a theD1
9457 # will be get along face, which is nearer to \a theFaces beginning.
9458 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9459 # @param theFaces Sequence of global indices of faces of \a theShape.
9460 # @param theName Object name; when specified, this parameter is used
9461 # for result publication in the study. Otherwise, if automatic
9462 # publication is switched on, default value is used for result name.
9464 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9466 # @return New GEOM.GEOM_Object, containing the result shape.
9468 # @ref tui_chamfer "Example"
9469 @ManageTransactions("LocalOp")
9470 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9472 Perform a chamfer on all edges of the specified faces,
9473 with distance D1 on the first specified face (if several for one edge)
9476 theShape Shape, to perform chamfer on.
9477 theD1 Chamfer size along face from theFaces. If both faces,
9478 connected to the edge, are in theFaces, theD1
9479 will be get along face, which is nearer to theFaces beginning.
9480 theD2 Chamfer size along another of two faces, connected to the edge.
9481 theFaces Sequence of global indices of faces of theShape.
9482 theName Object name; when specified, this parameter is used
9483 for result publication in the study. Otherwise, if automatic
9484 publication is switched on, default value is used for result name.
9486 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9489 New GEOM.GEOM_Object, containing the result shape.
9491 # Example: see GEOM_TestAll.py
9492 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9493 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9494 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9495 anObj.SetParameters(Parameters)
9496 self._autoPublish(anObj, theName, "chamfer")
9499 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9500 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9502 # @ref swig_FilletChamfer "Example"
9503 @ManageTransactions("LocalOp")
9504 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9506 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9507 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9510 if isinstance(theAngle,str):
9512 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9514 theAngle = theAngle*math.pi/180.0
9515 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9516 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9517 anObj.SetParameters(Parameters)
9518 self._autoPublish(anObj, theName, "chamfer")
9521 ## Perform a chamfer on edges,
9522 # with distance D1 on the first specified face (if several for one edge)
9523 # @param theShape Shape, to perform chamfer on.
9524 # @param theD1,theD2 Chamfer size
9525 # @param theEdges Sequence of edges of \a theShape.
9526 # @param theName Object name; when specified, this parameter is used
9527 # for result publication in the study. Otherwise, if automatic
9528 # publication is switched on, default value is used for result name.
9530 # @return New GEOM.GEOM_Object, containing the result shape.
9532 # @ref swig_FilletChamfer "Example"
9533 @ManageTransactions("LocalOp")
9534 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9536 Perform a chamfer on edges,
9537 with distance D1 on the first specified face (if several for one edge)
9540 theShape Shape, to perform chamfer on.
9541 theD1,theD2 Chamfer size
9542 theEdges Sequence of edges of theShape.
9543 theName Object name; when specified, this parameter is used
9544 for result publication in the study. Otherwise, if automatic
9545 publication is switched on, default value is used for result name.
9548 New GEOM.GEOM_Object, containing the result shape.
9550 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9551 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9552 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9553 anObj.SetParameters(Parameters)
9554 self._autoPublish(anObj, theName, "chamfer")
9557 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9558 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9559 @ManageTransactions("LocalOp")
9560 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9562 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9563 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9566 if isinstance(theAngle,str):
9568 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9570 theAngle = theAngle*math.pi/180.0
9571 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9572 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9573 anObj.SetParameters(Parameters)
9574 self._autoPublish(anObj, theName, "chamfer")
9577 ## @sa MakeChamferEdge(), MakeChamferFaces()
9579 # @ref swig_MakeChamfer "Example"
9580 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9582 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9584 # Example: see GEOM_TestOthers.py
9586 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9587 if aShapeType == self.ShapeType["EDGE"]:
9588 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9590 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9593 ## Remove material from a solid by extrusion of the base shape on the given distance.
9594 # @param theInit Shape to remove material from. It must be a solid or
9595 # a compound made of a single solid.
9596 # @param theBase Closed edge or wire defining the base shape to be extruded.
9597 # @param theH Prism dimension along the normal to theBase
9598 # @param theAngle Draft angle in degrees.
9599 # @param theName Object name; when specified, this parameter is used
9600 # for result publication in the study. Otherwise, if automatic
9601 # publication is switched on, default value is used for result name.
9603 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9605 # @ref tui_creation_prism "Example"
9606 @ManageTransactions("PrimOp")
9607 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9609 Add material to a solid by extrusion of the base shape on the given distance.
9612 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9613 theBase Closed edge or wire defining the base shape to be extruded.
9614 theH Prism dimension along the normal to theBase
9615 theAngle Draft angle in degrees.
9616 theName Object name; when specified, this parameter is used
9617 for result publication in the study. Otherwise, if automatic
9618 publication is switched on, default value is used for result name.
9621 New GEOM.GEOM_Object, containing the initial shape with removed material.
9623 # Example: see GEOM_TestAll.py
9624 #theH,Parameters = ParseParameters(theH)
9625 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9626 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9627 #anObj.SetParameters(Parameters)
9628 self._autoPublish(anObj, theName, "extrudedCut")
9631 ## Add material to a solid by extrusion of the base shape on the given distance.
9632 # @param theInit Shape to add material to. It must be a solid or
9633 # a compound made of a single solid.
9634 # @param theBase Closed edge or wire defining the base shape to be extruded.
9635 # @param theH Prism dimension along the normal to theBase
9636 # @param theAngle Draft angle in degrees.
9637 # @param theName Object name; when specified, this parameter is used
9638 # for result publication in the study. Otherwise, if automatic
9639 # publication is switched on, default value is used for result name.
9641 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9643 # @ref tui_creation_prism "Example"
9644 @ManageTransactions("PrimOp")
9645 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9647 Add material to a solid by extrusion of the base shape on the given distance.
9650 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9651 theBase Closed edge or wire defining the base shape to be extruded.
9652 theH Prism dimension along the normal to theBase
9653 theAngle Draft angle in degrees.
9654 theName Object name; when specified, this parameter is used
9655 for result publication in the study. Otherwise, if automatic
9656 publication is switched on, default value is used for result name.
9659 New GEOM.GEOM_Object, containing the initial shape with added material.
9661 # Example: see GEOM_TestAll.py
9662 #theH,Parameters = ParseParameters(theH)
9663 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9664 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9665 #anObj.SetParameters(Parameters)
9666 self._autoPublish(anObj, theName, "extrudedBoss")
9672 ## @addtogroup l3_basic_op
9675 ## Perform an Archimde operation on the given shape with given parameters.
9676 # The object presenting the resulting face is returned.
9677 # @param theShape Shape to be put in water.
9678 # @param theWeight Weight og the shape.
9679 # @param theWaterDensity Density of the water.
9680 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9681 # @param theName Object name; when specified, this parameter is used
9682 # for result publication in the study. Otherwise, if automatic
9683 # publication is switched on, default value is used for result name.
9685 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9686 # by a plane, corresponding to water level.
9688 # @ref tui_archimede "Example"
9689 @ManageTransactions("LocalOp")
9690 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9692 Perform an Archimde operation on the given shape with given parameters.
9693 The object presenting the resulting face is returned.
9696 theShape Shape to be put in water.
9697 theWeight Weight og the shape.
9698 theWaterDensity Density of the water.
9699 theMeshDeflection Deflection of the mesh, using to compute the section.
9700 theName Object name; when specified, this parameter is used
9701 for result publication in the study. Otherwise, if automatic
9702 publication is switched on, default value is used for result name.
9705 New GEOM.GEOM_Object, containing a section of theShape
9706 by a plane, corresponding to water level.
9708 # Example: see GEOM_TestAll.py
9709 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9710 theWeight,theWaterDensity,theMeshDeflection)
9711 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9712 RaiseIfFailed("MakeArchimede", self.LocalOp)
9713 anObj.SetParameters(Parameters)
9714 self._autoPublish(anObj, theName, "archimede")
9717 # end of l3_basic_op
9720 ## @addtogroup l2_measure
9723 ## Get point coordinates
9726 # @ref tui_measurement_tools_page "Example"
9727 @ManageTransactions("MeasuOp")
9728 def PointCoordinates(self,Point):
9730 Get point coordinates
9735 # Example: see GEOM_TestMeasures.py
9736 aTuple = self.MeasuOp.PointCoordinates(Point)
9737 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9740 ## Get vector coordinates
9743 # @ref tui_measurement_tools_page "Example"
9744 def VectorCoordinates(self,Vector):
9746 Get vector coordinates
9752 p1=self.GetFirstVertex(Vector)
9753 p2=self.GetLastVertex(Vector)
9755 X1=self.PointCoordinates(p1)
9756 X2=self.PointCoordinates(p2)
9758 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9761 ## Compute cross product
9762 # @return vector w=u^v
9764 # @ref tui_measurement_tools_page "Example"
9765 def CrossProduct(self, Vector1, Vector2):
9767 Compute cross product
9769 Returns: vector w=u^v
9771 u=self.VectorCoordinates(Vector1)
9772 v=self.VectorCoordinates(Vector2)
9773 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])
9777 ## Compute cross product
9778 # @return dot product p=u.v
9780 # @ref tui_measurement_tools_page "Example"
9781 def DotProduct(self, Vector1, Vector2):
9783 Compute cross product
9785 Returns: dot product p=u.v
9787 u=self.VectorCoordinates(Vector1)
9788 v=self.VectorCoordinates(Vector2)
9789 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9794 ## Get summarized length of all wires,
9795 # area of surface and volume of the given shape.
9796 # @param theShape Shape to define properties of.
9797 # @return [theLength, theSurfArea, theVolume]\n
9798 # theLength: Summarized length of all wires of the given shape.\n
9799 # theSurfArea: Area of surface of the given shape.\n
9800 # theVolume: Volume of the given shape.
9802 # @ref tui_measurement_tools_page "Example"
9803 @ManageTransactions("MeasuOp")
9804 def BasicProperties(self,theShape):
9806 Get summarized length of all wires,
9807 area of surface and volume of the given shape.
9810 theShape Shape to define properties of.
9813 [theLength, theSurfArea, theVolume]
9814 theLength: Summarized length of all wires of the given shape.
9815 theSurfArea: Area of surface of the given shape.
9816 theVolume: Volume of the given shape.
9818 # Example: see GEOM_TestMeasures.py
9819 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9820 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9823 ## Get parameters of bounding box of the given shape
9824 # @param theShape Shape to obtain bounding box of.
9825 # @param precise TRUE for precise computation; FALSE for fast one.
9826 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9827 # Xmin,Xmax: Limits of shape along OX axis.
9828 # Ymin,Ymax: Limits of shape along OY axis.
9829 # Zmin,Zmax: Limits of shape along OZ axis.
9831 # @ref tui_measurement_tools_page "Example"
9832 @ManageTransactions("MeasuOp")
9833 def BoundingBox (self, theShape, precise=False):
9835 Get parameters of bounding box of the given shape
9838 theShape Shape to obtain bounding box of.
9839 precise TRUE for precise computation; FALSE for fast one.
9842 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9843 Xmin,Xmax: Limits of shape along OX axis.
9844 Ymin,Ymax: Limits of shape along OY axis.
9845 Zmin,Zmax: Limits of shape along OZ axis.
9847 # Example: see GEOM_TestMeasures.py
9848 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9849 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9852 ## Get bounding box of the given shape
9853 # @param theShape Shape to obtain bounding box of.
9854 # @param precise TRUE for precise computation; FALSE for fast one.
9855 # @param theName Object name; when specified, this parameter is used
9856 # for result publication in the study. Otherwise, if automatic
9857 # publication is switched on, default value is used for result name.
9859 # @return New GEOM.GEOM_Object, containing the created box.
9861 # @ref tui_measurement_tools_page "Example"
9862 @ManageTransactions("MeasuOp")
9863 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9865 Get bounding box of the given shape
9868 theShape Shape to obtain bounding box of.
9869 precise TRUE for precise computation; FALSE for fast one.
9870 theName Object name; when specified, this parameter is used
9871 for result publication in the study. Otherwise, if automatic
9872 publication is switched on, default value is used for result name.
9875 New GEOM.GEOM_Object, containing the created box.
9877 # Example: see GEOM_TestMeasures.py
9878 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9879 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9880 self._autoPublish(anObj, theName, "bndbox")
9883 ## Get inertia matrix and moments of inertia of theShape.
9884 # @param theShape Shape to calculate inertia of.
9885 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9886 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9887 # Ix,Iy,Iz: Moments of inertia of the given shape.
9889 # @ref tui_measurement_tools_page "Example"
9890 @ManageTransactions("MeasuOp")
9891 def Inertia(self,theShape):
9893 Get inertia matrix and moments of inertia of theShape.
9896 theShape Shape to calculate inertia of.
9899 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9900 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9901 Ix,Iy,Iz: Moments of inertia of the given shape.
9903 # Example: see GEOM_TestMeasures.py
9904 aTuple = self.MeasuOp.GetInertia(theShape)
9905 RaiseIfFailed("GetInertia", self.MeasuOp)
9908 ## Get if coords are included in the shape (ST_IN or ST_ON)
9909 # @param theShape Shape
9910 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9911 # @param tolerance to be used (default is 1.0e-7)
9912 # @return list_of_boolean = [res1, res2, ...]
9913 @ManageTransactions("MeasuOp")
9914 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9916 Get if coords are included in the shape (ST_IN or ST_ON)
9920 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9921 tolerance to be used (default is 1.0e-7)
9924 list_of_boolean = [res1, res2, ...]
9926 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9928 ## Get minimal distance between the given shapes.
9929 # @param theShape1,theShape2 Shapes to find minimal distance between.
9930 # @return Value of the minimal distance between the given shapes.
9932 # @ref tui_measurement_tools_page "Example"
9933 @ManageTransactions("MeasuOp")
9934 def MinDistance(self, theShape1, theShape2):
9936 Get minimal distance between the given shapes.
9939 theShape1,theShape2 Shapes to find minimal distance between.
9942 Value of the minimal distance between the given shapes.
9944 # Example: see GEOM_TestMeasures.py
9945 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9946 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9949 ## Get minimal distance between the given shapes.
9950 # @param theShape1,theShape2 Shapes to find minimal distance between.
9951 # @return Value of the minimal distance between the given shapes, in form of list
9952 # [Distance, DX, DY, DZ].
9954 # @ref swig_all_measure "Example"
9955 @ManageTransactions("MeasuOp")
9956 def MinDistanceComponents(self, theShape1, theShape2):
9958 Get minimal distance between the given shapes.
9961 theShape1,theShape2 Shapes to find minimal distance between.
9964 Value of the minimal distance between the given shapes, in form of list
9965 [Distance, DX, DY, DZ]
9967 # Example: see GEOM_TestMeasures.py
9968 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9969 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9970 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9973 ## Get closest points of the given shapes.
9974 # @param theShape1,theShape2 Shapes to find closest points of.
9975 # @return The number of found solutions (-1 in case of infinite number of
9976 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9978 # @ref tui_measurement_tools_page "Example"
9979 @ManageTransactions("MeasuOp")
9980 def ClosestPoints (self, theShape1, theShape2):
9982 Get closest points of the given shapes.
9985 theShape1,theShape2 Shapes to find closest points of.
9988 The number of found solutions (-1 in case of infinite number of
9989 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9991 # Example: see GEOM_TestMeasures.py
9992 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9993 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9996 ## Get angle between the given shapes in degrees.
9997 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9998 # @note If both arguments are vectors, the angle is computed in accordance
9999 # with their orientations, otherwise the minimum angle is computed.
10000 # @return Value of the angle between the given shapes in degrees.
10002 # @ref tui_measurement_tools_page "Example"
10003 @ManageTransactions("MeasuOp")
10004 def GetAngle(self, theShape1, theShape2):
10006 Get angle between the given shapes in degrees.
10009 theShape1,theShape2 Lines or linear edges to find angle between.
10012 If both arguments are vectors, the angle is computed in accordance
10013 with their orientations, otherwise the minimum angle is computed.
10016 Value of the angle between the given shapes in degrees.
10018 # Example: see GEOM_TestMeasures.py
10019 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10020 RaiseIfFailed("GetAngle", self.MeasuOp)
10023 ## Get angle between the given shapes in radians.
10024 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10025 # @note If both arguments are vectors, the angle is computed in accordance
10026 # with their orientations, otherwise the minimum angle is computed.
10027 # @return Value of the angle between the given shapes in radians.
10029 # @ref tui_measurement_tools_page "Example"
10030 @ManageTransactions("MeasuOp")
10031 def GetAngleRadians(self, theShape1, theShape2):
10033 Get angle between the given shapes in radians.
10036 theShape1,theShape2 Lines or linear edges to find angle between.
10040 If both arguments are vectors, the angle is computed in accordance
10041 with their orientations, otherwise the minimum angle is computed.
10044 Value of the angle between the given shapes in radians.
10046 # Example: see GEOM_TestMeasures.py
10047 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10048 RaiseIfFailed("GetAngle", self.MeasuOp)
10051 ## Get angle between the given vectors in degrees.
10052 # @param theShape1,theShape2 Vectors to find angle between.
10053 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10054 # if False, the opposite vector to the normal vector is used.
10055 # @return Value of the angle between the given vectors in degrees.
10057 # @ref tui_measurement_tools_page "Example"
10058 @ManageTransactions("MeasuOp")
10059 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10061 Get angle between the given vectors in degrees.
10064 theShape1,theShape2 Vectors to find angle between.
10065 theFlag If True, the normal vector is defined by the two vectors cross,
10066 if False, the opposite vector to the normal vector is used.
10069 Value of the angle between the given vectors in degrees.
10071 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10073 anAngle = 360. - anAngle
10074 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10077 ## The same as GetAngleVectors, but the result is in radians.
10078 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10080 Get angle between the given vectors in radians.
10083 theShape1,theShape2 Vectors to find angle between.
10084 theFlag If True, the normal vector is defined by the two vectors cross,
10085 if False, the opposite vector to the normal vector is used.
10088 Value of the angle between the given vectors in radians.
10090 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10093 ## @name Curve Curvature Measurement
10094 # Methods for receiving radius of curvature of curves
10095 # in the given point
10098 ## Measure curvature of a curve at a point, set by parameter.
10099 # @param theCurve a curve.
10100 # @param theParam parameter.
10101 # @return radius of curvature of \a theCurve.
10103 # @ref swig_todo "Example"
10104 @ManageTransactions("MeasuOp")
10105 def CurveCurvatureByParam(self, theCurve, theParam):
10107 Measure curvature of a curve at a point, set by parameter.
10111 theParam parameter.
10114 radius of curvature of theCurve.
10116 # Example: see GEOM_TestMeasures.py
10117 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10118 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10121 ## Measure curvature of a curve at a point.
10122 # @param theCurve a curve.
10123 # @param thePoint given point.
10124 # @return radius of curvature of \a theCurve.
10126 # @ref swig_todo "Example"
10127 @ManageTransactions("MeasuOp")
10128 def CurveCurvatureByPoint(self, theCurve, thePoint):
10130 Measure curvature of a curve at a point.
10134 thePoint given point.
10137 radius of curvature of theCurve.
10139 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10140 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10144 ## @name Surface Curvature Measurement
10145 # Methods for receiving max and min radius of curvature of surfaces
10146 # in the given point
10149 ## Measure max radius of curvature of surface.
10150 # @param theSurf the given surface.
10151 # @param theUParam Value of U-parameter on the referenced surface.
10152 # @param theVParam Value of V-parameter on the referenced surface.
10153 # @return max radius of curvature of theSurf.
10155 ## @ref swig_todo "Example"
10156 @ManageTransactions("MeasuOp")
10157 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10159 Measure max radius of curvature of surface.
10162 theSurf the given surface.
10163 theUParam Value of U-parameter on the referenced surface.
10164 theVParam Value of V-parameter on the referenced surface.
10167 max radius of curvature of theSurf.
10169 # Example: see GEOM_TestMeasures.py
10170 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10171 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10174 ## Measure max radius of curvature of surface in the given point
10175 # @param theSurf the given surface.
10176 # @param thePoint given point.
10177 # @return max radius of curvature of theSurf.
10179 ## @ref swig_todo "Example"
10180 @ManageTransactions("MeasuOp")
10181 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10183 Measure max radius of curvature of surface in the given point.
10186 theSurf the given surface.
10187 thePoint given point.
10190 max radius of curvature of theSurf.
10192 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10193 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10196 ## Measure min radius of curvature of surface.
10197 # @param theSurf the given surface.
10198 # @param theUParam Value of U-parameter on the referenced surface.
10199 # @param theVParam Value of V-parameter on the referenced surface.
10200 # @return min radius of curvature of theSurf.
10202 ## @ref swig_todo "Example"
10203 @ManageTransactions("MeasuOp")
10204 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10206 Measure min radius of curvature of surface.
10209 theSurf the given surface.
10210 theUParam Value of U-parameter on the referenced surface.
10211 theVParam Value of V-parameter on the referenced surface.
10214 Min radius of curvature of theSurf.
10216 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10217 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10220 ## Measure min radius of curvature of surface in the given point
10221 # @param theSurf the given surface.
10222 # @param thePoint given point.
10223 # @return min radius of curvature of theSurf.
10225 ## @ref swig_todo "Example"
10226 @ManageTransactions("MeasuOp")
10227 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10229 Measure min radius of curvature of surface in the given point.
10232 theSurf the given surface.
10233 thePoint given point.
10236 Min radius of curvature of theSurf.
10238 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10239 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10243 ## Get min and max tolerances of sub-shapes of theShape
10244 # @param theShape Shape, to get tolerances of.
10245 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10246 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10247 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10248 # VertMin,VertMax: Min and max tolerances of the vertices.
10250 # @ref tui_measurement_tools_page "Example"
10251 @ManageTransactions("MeasuOp")
10252 def Tolerance(self,theShape):
10254 Get min and max tolerances of sub-shapes of theShape
10257 theShape Shape, to get tolerances of.
10260 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10261 FaceMin,FaceMax: Min and max tolerances of the faces.
10262 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10263 VertMin,VertMax: Min and max tolerances of the vertices.
10265 # Example: see GEOM_TestMeasures.py
10266 aTuple = self.MeasuOp.GetTolerance(theShape)
10267 RaiseIfFailed("GetTolerance", self.MeasuOp)
10270 ## Obtain description of the given shape (number of sub-shapes of each type)
10271 # @param theShape Shape to be described.
10272 # @return Description of the given shape.
10274 # @ref tui_measurement_tools_page "Example"
10275 @ManageTransactions("MeasuOp")
10276 def WhatIs(self,theShape):
10278 Obtain description of the given shape (number of sub-shapes of each type)
10281 theShape Shape to be described.
10284 Description of the given shape.
10286 # Example: see GEOM_TestMeasures.py
10287 aDescr = self.MeasuOp.WhatIs(theShape)
10288 RaiseIfFailed("WhatIs", self.MeasuOp)
10291 ## Obtain quantity of shapes of the given type in \a theShape.
10292 # If \a theShape is of type \a theType, it is also counted.
10293 # @param theShape Shape to be described.
10294 # @param theType the given ShapeType().
10295 # @return Quantity of shapes of type \a theType in \a theShape.
10297 # @ref tui_measurement_tools_page "Example"
10298 def NbShapes (self, theShape, theType):
10300 Obtain quantity of shapes of the given type in theShape.
10301 If theShape is of type theType, it is also counted.
10304 theShape Shape to be described.
10305 theType the given geompy.ShapeType
10308 Quantity of shapes of type theType in theShape.
10310 # Example: see GEOM_TestMeasures.py
10311 listSh = self.SubShapeAllIDs(theShape, theType)
10315 ## Obtain quantity of shapes of each type in \a theShape.
10316 # The \a theShape is also counted.
10317 # @param theShape Shape to be described.
10318 # @return Dictionary of ShapeType() with bound quantities of shapes.
10320 # @ref tui_measurement_tools_page "Example"
10321 def ShapeInfo (self, theShape):
10323 Obtain quantity of shapes of each type in theShape.
10324 The theShape is also counted.
10327 theShape Shape to be described.
10330 Dictionary of geompy.ShapeType with bound quantities of shapes.
10332 # Example: see GEOM_TestMeasures.py
10334 for typeSh in self.ShapeType:
10335 if typeSh in ( "AUTO", "SHAPE" ): continue
10336 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10342 def GetCreationInformation(self, theShape):
10343 info = theShape.GetCreationInformation()
10345 opName = info.operationName
10346 if not opName: opName = "no info available"
10347 res = "Operation: " + opName
10349 for parVal in info.params:
10350 res += " \n %s = %s" % ( parVal.name, parVal.value )
10353 ## Get a point, situated at the centre of mass of theShape.
10354 # @param theShape Shape to define centre of mass of.
10355 # @param theName Object name; when specified, this parameter is used
10356 # for result publication in the study. Otherwise, if automatic
10357 # publication is switched on, default value is used for result name.
10359 # @return New GEOM.GEOM_Object, containing the created point.
10361 # @ref tui_measurement_tools_page "Example"
10362 @ManageTransactions("MeasuOp")
10363 def MakeCDG(self, theShape, theName=None):
10365 Get a point, situated at the centre of mass of theShape.
10368 theShape Shape to define centre of mass of.
10369 theName Object name; when specified, this parameter is used
10370 for result publication in the study. Otherwise, if automatic
10371 publication is switched on, default value is used for result name.
10374 New GEOM.GEOM_Object, containing the created point.
10376 # Example: see GEOM_TestMeasures.py
10377 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10378 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10379 self._autoPublish(anObj, theName, "centerOfMass")
10382 ## Get a vertex sub-shape by index depended with orientation.
10383 # @param theShape Shape to find sub-shape.
10384 # @param theIndex Index to find vertex by this index (starting from zero)
10385 # @param theName Object name; when specified, this parameter is used
10386 # for result publication in the study. Otherwise, if automatic
10387 # publication is switched on, default value is used for result name.
10389 # @return New GEOM.GEOM_Object, containing the created vertex.
10391 # @ref tui_measurement_tools_page "Example"
10392 @ManageTransactions("MeasuOp")
10393 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10395 Get a vertex sub-shape by index depended with orientation.
10398 theShape Shape to find sub-shape.
10399 theIndex Index to find vertex by this index (starting from zero)
10400 theName Object name; when specified, this parameter is used
10401 for result publication in the study. Otherwise, if automatic
10402 publication is switched on, default value is used for result name.
10405 New GEOM.GEOM_Object, containing the created vertex.
10407 # Example: see GEOM_TestMeasures.py
10408 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10409 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10410 self._autoPublish(anObj, theName, "vertex")
10413 ## Get the first vertex of wire/edge depended orientation.
10414 # @param theShape Shape to find first vertex.
10415 # @param theName Object name; when specified, this parameter is used
10416 # for result publication in the study. Otherwise, if automatic
10417 # publication is switched on, default value is used for result name.
10419 # @return New GEOM.GEOM_Object, containing the created vertex.
10421 # @ref tui_measurement_tools_page "Example"
10422 def GetFirstVertex(self, theShape, theName=None):
10424 Get the first vertex of wire/edge depended orientation.
10427 theShape Shape to find first vertex.
10428 theName Object name; when specified, this parameter is used
10429 for result publication in the study. Otherwise, if automatic
10430 publication is switched on, default value is used for result name.
10433 New GEOM.GEOM_Object, containing the created vertex.
10435 # Example: see GEOM_TestMeasures.py
10436 # note: auto-publishing is done in self.GetVertexByIndex()
10437 return self.GetVertexByIndex(theShape, 0, theName)
10439 ## Get the last vertex of wire/edge depended orientation.
10440 # @param theShape Shape to find last vertex.
10441 # @param theName Object name; when specified, this parameter is used
10442 # for result publication in the study. Otherwise, if automatic
10443 # publication is switched on, default value is used for result name.
10445 # @return New GEOM.GEOM_Object, containing the created vertex.
10447 # @ref tui_measurement_tools_page "Example"
10448 def GetLastVertex(self, theShape, theName=None):
10450 Get the last vertex of wire/edge depended orientation.
10453 theShape Shape to find last vertex.
10454 theName Object name; when specified, this parameter is used
10455 for result publication in the study. Otherwise, if automatic
10456 publication is switched on, default value is used for result name.
10459 New GEOM.GEOM_Object, containing the created vertex.
10461 # Example: see GEOM_TestMeasures.py
10462 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10463 # note: auto-publishing is done in self.GetVertexByIndex()
10464 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10466 ## Get a normale to the given face. If the point is not given,
10467 # the normale is calculated at the center of mass.
10468 # @param theFace Face to define normale of.
10469 # @param theOptionalPoint Point to compute the normale at.
10470 # @param theName Object name; when specified, this parameter is used
10471 # for result publication in the study. Otherwise, if automatic
10472 # publication is switched on, default value is used for result name.
10474 # @return New GEOM.GEOM_Object, containing the created vector.
10476 # @ref swig_todo "Example"
10477 @ManageTransactions("MeasuOp")
10478 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10480 Get a normale to the given face. If the point is not given,
10481 the normale is calculated at the center of mass.
10484 theFace Face to define normale of.
10485 theOptionalPoint Point to compute the normale at.
10486 theName Object name; when specified, this parameter is used
10487 for result publication in the study. Otherwise, if automatic
10488 publication is switched on, default value is used for result name.
10491 New GEOM.GEOM_Object, containing the created vector.
10493 # Example: see GEOM_TestMeasures.py
10494 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10495 RaiseIfFailed("GetNormal", self.MeasuOp)
10496 self._autoPublish(anObj, theName, "normal")
10499 ## Print shape errors obtained from CheckShape.
10500 # @param theShape Shape that was checked.
10501 # @param theShapeErrors the shape errors obtained by CheckShape.
10502 # @param theReturnStatus If 0 the description of problem is printed.
10503 # If 1 the description of problem is returned.
10504 # @return If theReturnStatus is equal to 1 the description is returned.
10505 # Otherwise doesn't return anything.
10507 # @ref tui_measurement_tools_page "Example"
10508 @ManageTransactions("MeasuOp")
10509 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10511 Print shape errors obtained from CheckShape.
10514 theShape Shape that was checked.
10515 theShapeErrors the shape errors obtained by CheckShape.
10516 theReturnStatus If 0 the description of problem is printed.
10517 If 1 the description of problem is returned.
10520 If theReturnStatus is equal to 1 the description is returned.
10521 Otherwise doesn't return anything.
10523 # Example: see GEOM_TestMeasures.py
10524 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10525 if theReturnStatus == 1:
10530 ## Check a topology of the given shape.
10531 # @param theShape Shape to check validity of.
10532 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10533 # if TRUE, the shape's geometry will be checked also.
10534 # @param theReturnStatus If 0 and if theShape is invalid, a description
10535 # of problem is printed.
10536 # If 1 isValid flag and the description of
10537 # problem is returned.
10538 # If 2 isValid flag and the list of error data
10540 # @return TRUE, if the shape "seems to be valid".
10541 # If theShape is invalid, prints a description of problem.
10542 # If theReturnStatus is equal to 1 the description is returned
10543 # along with IsValid flag.
10544 # If theReturnStatus is equal to 2 the list of error data is
10545 # returned along with IsValid flag.
10547 # @ref tui_measurement_tools_page "Example"
10548 @ManageTransactions("MeasuOp")
10549 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10551 Check a topology of the given shape.
10554 theShape Shape to check validity of.
10555 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10556 if TRUE, the shape's geometry will be checked also.
10557 theReturnStatus If 0 and if theShape is invalid, a description
10558 of problem is printed.
10559 If 1 IsValid flag and the description of
10560 problem is returned.
10561 If 2 IsValid flag and the list of error data
10565 TRUE, if the shape "seems to be valid".
10566 If theShape is invalid, prints a description of problem.
10567 If theReturnStatus is equal to 1 the description is returned
10568 along with IsValid flag.
10569 If theReturnStatus is equal to 2 the list of error data is
10570 returned along with IsValid flag.
10572 # Example: see GEOM_TestMeasures.py
10574 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10575 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10577 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10578 RaiseIfFailed("CheckShape", self.MeasuOp)
10580 if theReturnStatus == 0:
10581 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10583 if theReturnStatus == 1:
10584 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10585 return (IsValid, Descr)
10586 elif theReturnStatus == 2:
10587 return (IsValid, ShapeErrors)
10590 ## Detect self-intersections in the given shape.
10591 # @param theShape Shape to check.
10592 # @return TRUE, if the shape contains no self-intersections.
10594 # @ref tui_measurement_tools_page "Example"
10595 @ManageTransactions("MeasuOp")
10596 def CheckSelfIntersections(self, theShape):
10598 Detect self-intersections in the given shape.
10601 theShape Shape to check.
10604 TRUE, if the shape contains no self-intersections.
10606 # Example: see GEOM_TestMeasures.py
10607 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10608 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10611 ## Get position (LCS) of theShape.
10613 # Origin of the LCS is situated at the shape's center of mass.
10614 # Axes of the LCS are obtained from shape's location or,
10615 # if the shape is a planar face, from position of its plane.
10617 # @param theShape Shape to calculate position of.
10618 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10619 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10620 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10621 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10623 # @ref swig_todo "Example"
10624 @ManageTransactions("MeasuOp")
10625 def GetPosition(self,theShape):
10627 Get position (LCS) of theShape.
10628 Origin of the LCS is situated at the shape's center of mass.
10629 Axes of the LCS are obtained from shape's location or,
10630 if the shape is a planar face, from position of its plane.
10633 theShape Shape to calculate position of.
10636 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10637 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10638 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10639 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10641 # Example: see GEOM_TestMeasures.py
10642 aTuple = self.MeasuOp.GetPosition(theShape)
10643 RaiseIfFailed("GetPosition", self.MeasuOp)
10646 ## Get kind of theShape.
10648 # @param theShape Shape to get a kind of.
10649 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10650 # and a list of parameters, describing the shape.
10651 # @note Concrete meaning of each value, returned via \a theIntegers
10652 # or \a theDoubles list depends on the kind() of the shape.
10654 # @ref swig_todo "Example"
10655 @ManageTransactions("MeasuOp")
10656 def KindOfShape(self,theShape):
10658 Get kind of theShape.
10661 theShape Shape to get a kind of.
10664 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10665 and a list of parameters, describing the shape.
10667 Concrete meaning of each value, returned via theIntegers
10668 or theDoubles list depends on the geompy.kind of the shape
10670 # Example: see GEOM_TestMeasures.py
10671 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10672 RaiseIfFailed("KindOfShape", self.MeasuOp)
10674 aKind = aRoughTuple[0]
10675 anInts = aRoughTuple[1]
10676 aDbls = aRoughTuple[2]
10678 # Now there is no exception from this rule:
10679 aKindTuple = [aKind] + aDbls + anInts
10681 # If they are we will regroup parameters for such kind of shape.
10683 #if aKind == kind.SOME_KIND:
10684 # # SOME_KIND int int double int double double
10685 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10689 ## Returns the string that describes if the shell is good for solid.
10690 # This is a support method for MakeSolid.
10692 # @param theShell the shell to be checked.
10693 # @return Returns a string that describes the shell validity for
10694 # solid construction.
10695 @ManageTransactions("MeasuOp")
10696 def _IsGoodForSolid(self, theShell):
10698 Returns the string that describes if the shell is good for solid.
10699 This is a support method for MakeSolid.
10702 theShell the shell to be checked.
10705 Returns a string that describes the shell validity for
10706 solid construction.
10708 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10711 # end of l2_measure
10714 ## @addtogroup l2_import_export
10717 ## Import a shape from the BREP, IGES, STEP or other file
10718 # (depends on given format) with given name.
10720 # Note: this function is deprecated, it is kept for backward compatibility only
10721 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10723 # @param theFileName The file, containing the shape.
10724 # @param theFormatName Specify format for the file reading.
10725 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10726 # If format 'IGES_SCALE' is used instead of 'IGES' or
10727 # format 'STEP_SCALE' is used instead of 'STEP',
10728 # length unit will be set to 'meter' and result model will be scaled.
10729 # @param theName Object name; when specified, this parameter is used
10730 # for result publication in the study. Otherwise, if automatic
10731 # publication is switched on, default value is used for result name.
10733 # @return New GEOM.GEOM_Object, containing the imported shape.
10734 # If material names are imported it returns the list of
10735 # objects. The first one is the imported object followed by
10737 # @note Auto publishing is allowed for the shape itself. Imported
10738 # material groups are not automatically published.
10740 # @ref swig_Import_Export "Example"
10741 @ManageTransactions("InsertOp")
10742 def ImportFile(self, theFileName, theFormatName, theName=None):
10744 Import a shape from the BREP, IGES, STEP or other file
10745 (depends on given format) with given name.
10747 Note: this function is deprecated, it is kept for backward compatibility only
10748 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10751 theFileName The file, containing the shape.
10752 theFormatName Specify format for the file reading.
10753 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10754 If format 'IGES_SCALE' is used instead of 'IGES' or
10755 format 'STEP_SCALE' is used instead of 'STEP',
10756 length unit will be set to 'meter' and result model will be scaled.
10757 theName Object name; when specified, this parameter is used
10758 for result publication in the study. Otherwise, if automatic
10759 publication is switched on, default value is used for result name.
10762 New GEOM.GEOM_Object, containing the imported shape.
10763 If material names are imported it returns the list of
10764 objects. The first one is the imported object followed by
10767 Auto publishing is allowed for the shape itself. Imported
10768 material groups are not automatically published.
10770 # Example: see GEOM_TestOthers.py
10772 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
10773 where <FormatName> is a name of desirable format for importing.
10775 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10776 RaiseIfFailed("ImportFile", self.InsertOp)
10777 aNbObj = len(aListObj)
10779 self._autoPublish(aListObj[0], theName, "imported")
10784 ## Deprecated analog of ImportFile()
10785 def Import(self, theFileName, theFormatName, theName=None):
10787 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10789 # note: auto-publishing is done in self.ImportFile()
10790 return self.ImportFile(theFileName, theFormatName, theName)
10792 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10793 # @note This method will not be dumped to the python script by DumpStudy functionality.
10794 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10795 # @param theStream The BRep binary stream.
10796 # @param theName Object name; when specified, this parameter is used
10797 # for result publication in the study. Otherwise, if automatic
10798 # publication is switched on, default value is used for result name.
10800 # @return New GEOM_Object, containing the shape, read from theStream.
10802 # @ref swig_Import_Export "Example"
10803 @ManageTransactions("InsertOp")
10804 def RestoreShape (self, theStream, theName=None):
10806 Read a shape from the binary stream, containing its bounding representation (BRep).
10809 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10812 theStream The BRep binary stream.
10813 theName Object name; when specified, this parameter is used
10814 for result publication in the study. Otherwise, if automatic
10815 publication is switched on, default value is used for result name.
10818 New GEOM_Object, containing the shape, read from theStream.
10820 # Example: see GEOM_TestOthers.py
10821 anObj = self.InsertOp.RestoreShape(theStream)
10822 RaiseIfFailed("RestoreShape", self.InsertOp)
10823 self._autoPublish(anObj, theName, "restored")
10826 ## Export the given shape into a file with given name.
10828 # Note: this function is deprecated, it is kept for backward compatibility only
10829 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10831 # @param theObject Shape to be stored in the file.
10832 # @param theFileName Name of the file to store the given shape in.
10833 # @param theFormatName Specify format for the shape storage.
10834 # Available formats can be obtained with
10835 # geompy.InsertOp.ExportTranslators()[0] method.
10837 # @ref swig_Import_Export "Example"
10838 @ManageTransactions("InsertOp")
10839 def Export(self, theObject, theFileName, theFormatName):
10841 Export the given shape into a file with given name.
10843 Note: this function is deprecated, it is kept for backward compatibility only
10844 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10847 theObject Shape to be stored in the file.
10848 theFileName Name of the file to store the given shape in.
10849 theFormatName Specify format for the shape storage.
10850 Available formats can be obtained with
10851 geompy.InsertOp.ExportTranslators()[0] method.
10853 # Example: see GEOM_TestOthers.py
10855 WARNING: Function Export is deprecated, use Export<FormatName> instead,
10856 where <FormatName> is a name of desirable format for exporting.
10858 self.InsertOp.Export(theObject, theFileName, theFormatName)
10859 if self.InsertOp.IsDone() == 0:
10860 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10864 # end of l2_import_export
10867 ## @addtogroup l3_blocks
10870 ## Create a quadrangle face from four edges. Order of Edges is not
10871 # important. It is not necessary that edges share the same vertex.
10872 # @param E1,E2,E3,E4 Edges for the face bound.
10873 # @param theName Object name; when specified, this parameter is used
10874 # for result publication in the study. Otherwise, if automatic
10875 # publication is switched on, default value is used for result name.
10877 # @return New GEOM.GEOM_Object, containing the created face.
10879 # @ref tui_building_by_blocks_page "Example"
10880 @ManageTransactions("BlocksOp")
10881 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10883 Create a quadrangle face from four edges. Order of Edges is not
10884 important. It is not necessary that edges share the same vertex.
10887 E1,E2,E3,E4 Edges for the face bound.
10888 theName Object name; when specified, this parameter is used
10889 for result publication in the study. Otherwise, if automatic
10890 publication is switched on, default value is used for result name.
10893 New GEOM.GEOM_Object, containing the created face.
10896 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10898 # Example: see GEOM_Spanner.py
10899 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10900 RaiseIfFailed("MakeQuad", self.BlocksOp)
10901 self._autoPublish(anObj, theName, "quad")
10904 ## Create a quadrangle face on two edges.
10905 # The missing edges will be built by creating the shortest ones.
10906 # @param E1,E2 Two opposite edges for the face.
10907 # @param theName Object name; when specified, this parameter is used
10908 # for result publication in the study. Otherwise, if automatic
10909 # publication is switched on, default value is used for result name.
10911 # @return New GEOM.GEOM_Object, containing the created face.
10913 # @ref tui_building_by_blocks_page "Example"
10914 @ManageTransactions("BlocksOp")
10915 def MakeQuad2Edges(self, E1, E2, theName=None):
10917 Create a quadrangle face on two edges.
10918 The missing edges will be built by creating the shortest ones.
10921 E1,E2 Two opposite edges for the face.
10922 theName Object name; when specified, this parameter is used
10923 for result publication in the study. Otherwise, if automatic
10924 publication is switched on, default value is used for result name.
10927 New GEOM.GEOM_Object, containing the created face.
10931 p1 = geompy.MakeVertex( 0., 0., 0.)
10932 p2 = geompy.MakeVertex(150., 30., 0.)
10933 p3 = geompy.MakeVertex( 0., 120., 50.)
10934 p4 = geompy.MakeVertex( 0., 40., 70.)
10936 edge1 = geompy.MakeEdge(p1, p2)
10937 edge2 = geompy.MakeEdge(p3, p4)
10938 # create a quadrangle face from two edges
10939 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10941 # Example: see GEOM_Spanner.py
10942 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10943 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10944 self._autoPublish(anObj, theName, "quad")
10947 ## Create a quadrangle face with specified corners.
10948 # The missing edges will be built by creating the shortest ones.
10949 # @param V1,V2,V3,V4 Corner vertices for the face.
10950 # @param theName Object name; when specified, this parameter is used
10951 # for result publication in the study. Otherwise, if automatic
10952 # publication is switched on, default value is used for result name.
10954 # @return New GEOM.GEOM_Object, containing the created face.
10956 # @ref tui_building_by_blocks_page "Example 1"
10957 # \n @ref swig_MakeQuad4Vertices "Example 2"
10958 @ManageTransactions("BlocksOp")
10959 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10961 Create a quadrangle face with specified corners.
10962 The missing edges will be built by creating the shortest ones.
10965 V1,V2,V3,V4 Corner vertices for the face.
10966 theName Object name; when specified, this parameter is used
10967 for result publication in the study. Otherwise, if automatic
10968 publication is switched on, default value is used for result name.
10971 New GEOM.GEOM_Object, containing the created face.
10975 p1 = geompy.MakeVertex( 0., 0., 0.)
10976 p2 = geompy.MakeVertex(150., 30., 0.)
10977 p3 = geompy.MakeVertex( 0., 120., 50.)
10978 p4 = geompy.MakeVertex( 0., 40., 70.)
10979 # create a quadrangle from four points in its corners
10980 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10982 # Example: see GEOM_Spanner.py
10983 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10984 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10985 self._autoPublish(anObj, theName, "quad")
10988 ## Create a hexahedral solid, bounded by the six given faces. Order of
10989 # faces is not important. It is not necessary that Faces share the same edge.
10990 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10991 # @param theName Object name; when specified, this parameter is used
10992 # for result publication in the study. Otherwise, if automatic
10993 # publication is switched on, default value is used for result name.
10995 # @return New GEOM.GEOM_Object, containing the created solid.
10997 # @ref tui_building_by_blocks_page "Example 1"
10998 # \n @ref swig_MakeHexa "Example 2"
10999 @ManageTransactions("BlocksOp")
11000 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11002 Create a hexahedral solid, bounded by the six given faces. Order of
11003 faces is not important. It is not necessary that Faces share the same edge.
11006 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11007 theName Object name; when specified, this parameter is used
11008 for result publication in the study. Otherwise, if automatic
11009 publication is switched on, default value is used for result name.
11012 New GEOM.GEOM_Object, containing the created solid.
11015 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11017 # Example: see GEOM_Spanner.py
11018 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11019 RaiseIfFailed("MakeHexa", self.BlocksOp)
11020 self._autoPublish(anObj, theName, "hexa")
11023 ## Create a hexahedral solid between two given faces.
11024 # The missing faces will be built by creating the smallest ones.
11025 # @param F1,F2 Two opposite faces for the hexahedral solid.
11026 # @param theName Object name; when specified, this parameter is used
11027 # for result publication in the study. Otherwise, if automatic
11028 # publication is switched on, default value is used for result name.
11030 # @return New GEOM.GEOM_Object, containing the created solid.
11032 # @ref tui_building_by_blocks_page "Example 1"
11033 # \n @ref swig_MakeHexa2Faces "Example 2"
11034 @ManageTransactions("BlocksOp")
11035 def MakeHexa2Faces(self, F1, F2, theName=None):
11037 Create a hexahedral solid between two given faces.
11038 The missing faces will be built by creating the smallest ones.
11041 F1,F2 Two opposite faces for the hexahedral solid.
11042 theName Object name; when specified, this parameter is used
11043 for result publication in the study. Otherwise, if automatic
11044 publication is switched on, default value is used for result name.
11047 New GEOM.GEOM_Object, containing the created solid.
11050 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11052 # Example: see GEOM_Spanner.py
11053 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11054 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11055 self._autoPublish(anObj, theName, "hexa")
11061 ## @addtogroup l3_blocks_op
11064 ## Get a vertex, found in the given shape by its coordinates.
11065 # @param theShape Block or a compound of blocks.
11066 # @param theX,theY,theZ Coordinates of the sought vertex.
11067 # @param theEpsilon Maximum allowed distance between the resulting
11068 # vertex and point with the given coordinates.
11069 # @param theName Object name; when specified, this parameter is used
11070 # for result publication in the study. Otherwise, if automatic
11071 # publication is switched on, default value is used for result name.
11073 # @return New GEOM.GEOM_Object, containing the found vertex.
11075 # @ref swig_GetPoint "Example"
11076 @ManageTransactions("BlocksOp")
11077 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11079 Get a vertex, found in the given shape by its coordinates.
11082 theShape Block or a compound of blocks.
11083 theX,theY,theZ Coordinates of the sought vertex.
11084 theEpsilon Maximum allowed distance between the resulting
11085 vertex and point with the given coordinates.
11086 theName Object name; when specified, this parameter is used
11087 for result publication in the study. Otherwise, if automatic
11088 publication is switched on, default value is used for result name.
11091 New GEOM.GEOM_Object, containing the found vertex.
11094 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11096 # Example: see GEOM_TestOthers.py
11097 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11098 RaiseIfFailed("GetPoint", self.BlocksOp)
11099 self._autoPublish(anObj, theName, "vertex")
11102 ## Find a vertex of the given shape, which has minimal distance to the given point.
11103 # @param theShape Any shape.
11104 # @param thePoint Point, close to the desired vertex.
11105 # @param theName Object name; when specified, this parameter is used
11106 # for result publication in the study. Otherwise, if automatic
11107 # publication is switched on, default value is used for result name.
11109 # @return New GEOM.GEOM_Object, containing the found vertex.
11111 # @ref swig_GetVertexNearPoint "Example"
11112 @ManageTransactions("BlocksOp")
11113 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11115 Find a vertex of the given shape, which has minimal distance to the given point.
11118 theShape Any shape.
11119 thePoint Point, close to the desired vertex.
11120 theName Object name; when specified, this parameter is used
11121 for result publication in the study. Otherwise, if automatic
11122 publication is switched on, default value is used for result name.
11125 New GEOM.GEOM_Object, containing the found vertex.
11128 pmidle = geompy.MakeVertex(50, 0, 50)
11129 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11131 # Example: see GEOM_TestOthers.py
11132 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11133 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11134 self._autoPublish(anObj, theName, "vertex")
11137 ## Get an edge, found in the given shape by two given vertices.
11138 # @param theShape Block or a compound of blocks.
11139 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11140 # @param theName Object name; when specified, this parameter is used
11141 # for result publication in the study. Otherwise, if automatic
11142 # publication is switched on, default value is used for result name.
11144 # @return New GEOM.GEOM_Object, containing the found edge.
11146 # @ref swig_GetEdge "Example"
11147 @ManageTransactions("BlocksOp")
11148 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11150 Get an edge, found in the given shape by two given vertices.
11153 theShape Block or a compound of blocks.
11154 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11155 theName Object name; when specified, this parameter is used
11156 for result publication in the study. Otherwise, if automatic
11157 publication is switched on, default value is used for result name.
11160 New GEOM.GEOM_Object, containing the found edge.
11162 # Example: see GEOM_Spanner.py
11163 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11164 RaiseIfFailed("GetEdge", self.BlocksOp)
11165 self._autoPublish(anObj, theName, "edge")
11168 ## Find an edge of the given shape, which has minimal distance to the given point.
11169 # @param theShape Block or a compound of blocks.
11170 # @param thePoint Point, close to the desired edge.
11171 # @param theName Object name; when specified, this parameter is used
11172 # for result publication in the study. Otherwise, if automatic
11173 # publication is switched on, default value is used for result name.
11175 # @return New GEOM.GEOM_Object, containing the found edge.
11177 # @ref swig_GetEdgeNearPoint "Example"
11178 @ManageTransactions("BlocksOp")
11179 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11181 Find an edge of the given shape, which has minimal distance to the given point.
11184 theShape Block or a compound of blocks.
11185 thePoint Point, close to the desired edge.
11186 theName Object name; when specified, this parameter is used
11187 for result publication in the study. Otherwise, if automatic
11188 publication is switched on, default value is used for result name.
11191 New GEOM.GEOM_Object, containing the found edge.
11193 # Example: see GEOM_TestOthers.py
11194 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11195 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11196 self._autoPublish(anObj, theName, "edge")
11199 ## Returns a face, found in the given shape by four given corner vertices.
11200 # @param theShape Block or a compound of blocks.
11201 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11202 # @param theName Object name; when specified, this parameter is used
11203 # for result publication in the study. Otherwise, if automatic
11204 # publication is switched on, default value is used for result name.
11206 # @return New GEOM.GEOM_Object, containing the found face.
11208 # @ref swig_todo "Example"
11209 @ManageTransactions("BlocksOp")
11210 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11212 Returns a face, found in the given shape by four given corner vertices.
11215 theShape Block or a compound of blocks.
11216 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11217 theName Object name; when specified, this parameter is used
11218 for result publication in the study. Otherwise, if automatic
11219 publication is switched on, default value is used for result name.
11222 New GEOM.GEOM_Object, containing the found face.
11224 # Example: see GEOM_Spanner.py
11225 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11226 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11227 self._autoPublish(anObj, theName, "face")
11230 ## Get a face of block, found in the given shape by two given edges.
11231 # @param theShape Block or a compound of blocks.
11232 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11233 # @param theName Object name; when specified, this parameter is used
11234 # for result publication in the study. Otherwise, if automatic
11235 # publication is switched on, default value is used for result name.
11237 # @return New GEOM.GEOM_Object, containing the found face.
11239 # @ref swig_todo "Example"
11240 @ManageTransactions("BlocksOp")
11241 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11243 Get a face of block, found in the given shape by two given edges.
11246 theShape Block or a compound of blocks.
11247 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11248 theName Object name; when specified, this parameter is used
11249 for result publication in the study. Otherwise, if automatic
11250 publication is switched on, default value is used for result name.
11253 New GEOM.GEOM_Object, containing the found face.
11255 # Example: see GEOM_Spanner.py
11256 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11257 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11258 self._autoPublish(anObj, theName, "face")
11261 ## Find a face, opposite to the given one in the given block.
11262 # @param theBlock Must be a hexahedral solid.
11263 # @param theFace Face of \a theBlock, opposite to the desired face.
11264 # @param theName Object name; when specified, this parameter is used
11265 # for result publication in the study. Otherwise, if automatic
11266 # publication is switched on, default value is used for result name.
11268 # @return New GEOM.GEOM_Object, containing the found face.
11270 # @ref swig_GetOppositeFace "Example"
11271 @ManageTransactions("BlocksOp")
11272 def GetOppositeFace(self, theBlock, theFace, theName=None):
11274 Find a face, opposite to the given one in the given block.
11277 theBlock Must be a hexahedral solid.
11278 theFace Face of theBlock, opposite to the desired face.
11279 theName Object name; when specified, this parameter is used
11280 for result publication in the study. Otherwise, if automatic
11281 publication is switched on, default value is used for result name.
11284 New GEOM.GEOM_Object, containing the found face.
11286 # Example: see GEOM_Spanner.py
11287 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11288 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11289 self._autoPublish(anObj, theName, "face")
11292 ## Find a face of the given shape, which has minimal distance to the given point.
11293 # @param theShape Block or a compound of blocks.
11294 # @param thePoint Point, close to the desired face.
11295 # @param theName Object name; when specified, this parameter is used
11296 # for result publication in the study. Otherwise, if automatic
11297 # publication is switched on, default value is used for result name.
11299 # @return New GEOM.GEOM_Object, containing the found face.
11301 # @ref swig_GetFaceNearPoint "Example"
11302 @ManageTransactions("BlocksOp")
11303 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11305 Find a face of the given shape, which has minimal distance to the given point.
11308 theShape Block or a compound of blocks.
11309 thePoint Point, close to the desired face.
11310 theName Object name; when specified, this parameter is used
11311 for result publication in the study. Otherwise, if automatic
11312 publication is switched on, default value is used for result name.
11315 New GEOM.GEOM_Object, containing the found face.
11317 # Example: see GEOM_Spanner.py
11318 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11319 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11320 self._autoPublish(anObj, theName, "face")
11323 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11324 # @param theBlock Block or a compound of blocks.
11325 # @param theVector Vector, close to the normale of the desired face.
11326 # @param theName Object name; when specified, this parameter is used
11327 # for result publication in the study. Otherwise, if automatic
11328 # publication is switched on, default value is used for result name.
11330 # @return New GEOM.GEOM_Object, containing the found face.
11332 # @ref swig_todo "Example"
11333 @ManageTransactions("BlocksOp")
11334 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11336 Find a face of block, whose outside normale has minimal angle with the given vector.
11339 theBlock Block or a compound of blocks.
11340 theVector Vector, close to the normale of the desired face.
11341 theName Object name; when specified, this parameter is used
11342 for result publication in the study. Otherwise, if automatic
11343 publication is switched on, default value is used for result name.
11346 New GEOM.GEOM_Object, containing the found face.
11348 # Example: see GEOM_Spanner.py
11349 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11350 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11351 self._autoPublish(anObj, theName, "face")
11354 ## Find all sub-shapes of type \a theShapeType of the given shape,
11355 # which have minimal distance to the given point.
11356 # @param theShape Any shape.
11357 # @param thePoint Point, close to the desired shape.
11358 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11359 # @param theTolerance The tolerance for distances comparison. All shapes
11360 # with distances to the given point in interval
11361 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11362 # @param theName Object name; when specified, this parameter is used
11363 # for result publication in the study. Otherwise, if automatic
11364 # publication is switched on, default value is used for result name.
11366 # @return New GEOM_Object, containing a group of all found shapes.
11368 # @ref swig_GetShapesNearPoint "Example"
11369 @ManageTransactions("BlocksOp")
11370 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11372 Find all sub-shapes of type theShapeType of the given shape,
11373 which have minimal distance to the given point.
11376 theShape Any shape.
11377 thePoint Point, close to the desired shape.
11378 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11379 theTolerance The tolerance for distances comparison. All shapes
11380 with distances to the given point in interval
11381 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11382 theName Object name; when specified, this parameter is used
11383 for result publication in the study. Otherwise, if automatic
11384 publication is switched on, default value is used for result name.
11387 New GEOM_Object, containing a group of all found shapes.
11389 # Example: see GEOM_TestOthers.py
11390 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11391 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11392 self._autoPublish(anObj, theName, "group")
11395 # end of l3_blocks_op
11398 ## @addtogroup l4_blocks_measure
11401 ## Check, if the compound of blocks is given.
11402 # To be considered as a compound of blocks, the
11403 # given shape must satisfy the following conditions:
11404 # - Each element of the compound should be a Block (6 faces and 12 edges).
11405 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11406 # - The compound should be connexe.
11407 # - The glue between two quadrangle faces should be applied.
11408 # @param theCompound The compound to check.
11409 # @return TRUE, if the given shape is a compound of blocks.
11410 # If theCompound is not valid, prints all discovered errors.
11412 # @ref tui_measurement_tools_page "Example 1"
11413 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11414 @ManageTransactions("BlocksOp")
11415 def CheckCompoundOfBlocks(self,theCompound):
11417 Check, if the compound of blocks is given.
11418 To be considered as a compound of blocks, the
11419 given shape must satisfy the following conditions:
11420 - Each element of the compound should be a Block (6 faces and 12 edges).
11421 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11422 - The compound should be connexe.
11423 - The glue between two quadrangle faces should be applied.
11426 theCompound The compound to check.
11429 TRUE, if the given shape is a compound of blocks.
11430 If theCompound is not valid, prints all discovered errors.
11432 # Example: see GEOM_Spanner.py
11433 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11434 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11436 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11440 ## Retrieve all non blocks solids and faces from \a theShape.
11441 # @param theShape The shape to explore.
11442 # @param theName Object name; when specified, this parameter is used
11443 # for result publication in the study. Otherwise, if automatic
11444 # publication is switched on, default value is used for result name.
11446 # @return A tuple of two GEOM_Objects. The first object is a group of all
11447 # non block solids (= not 6 faces, or with 6 faces, but with the
11448 # presence of non-quadrangular faces). The second object is a
11449 # group of all non quadrangular faces.
11451 # @ref tui_measurement_tools_page "Example 1"
11452 # \n @ref swig_GetNonBlocks "Example 2"
11453 @ManageTransactions("BlocksOp")
11454 def GetNonBlocks (self, theShape, theName=None):
11456 Retrieve all non blocks solids and faces from theShape.
11459 theShape The shape to explore.
11460 theName Object name; when specified, this parameter is used
11461 for result publication in the study. Otherwise, if automatic
11462 publication is switched on, default value is used for result name.
11465 A tuple of two GEOM_Objects. The first object is a group of all
11466 non block solids (= not 6 faces, or with 6 faces, but with the
11467 presence of non-quadrangular faces). The second object is a
11468 group of all non quadrangular faces.
11471 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11473 # Example: see GEOM_Spanner.py
11474 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11475 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11476 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11479 ## Remove all seam and degenerated edges from \a theShape.
11480 # Unite faces and edges, sharing one surface. It means that
11481 # this faces must have references to one C++ surface object (handle).
11482 # @param theShape The compound or single solid to remove irregular edges from.
11483 # @param doUnionFaces If True, then unite faces. If False (the default value),
11484 # do not unite faces.
11485 # @param theName Object name; when specified, this parameter is used
11486 # for result publication in the study. Otherwise, if automatic
11487 # publication is switched on, default value is used for result name.
11489 # @return Improved shape.
11491 # @ref swig_RemoveExtraEdges "Example"
11492 @ManageTransactions("BlocksOp")
11493 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11495 Remove all seam and degenerated edges from theShape.
11496 Unite faces and edges, sharing one surface. It means that
11497 this faces must have references to one C++ surface object (handle).
11500 theShape The compound or single solid to remove irregular edges from.
11501 doUnionFaces If True, then unite faces. If False (the default value),
11502 do not unite faces.
11503 theName Object name; when specified, this parameter is used
11504 for result publication in the study. Otherwise, if automatic
11505 publication is switched on, default value is used for result name.
11510 # Example: see GEOM_TestOthers.py
11511 nbFacesOptimum = -1 # -1 means do not unite faces
11512 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11513 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11514 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11515 self._autoPublish(anObj, theName, "removeExtraEdges")
11518 ## Performs union faces of \a theShape
11519 # Unite faces sharing one surface. It means that
11520 # these faces must have references to one C++ surface object (handle).
11521 # @param theShape The compound or single solid that contains faces
11522 # to perform union.
11523 # @param theName Object name; when specified, this parameter is used
11524 # for result publication in the study. Otherwise, if automatic
11525 # publication is switched on, default value is used for result name.
11527 # @return Improved shape.
11529 # @ref swig_UnionFaces "Example"
11530 @ManageTransactions("BlocksOp")
11531 def UnionFaces(self, theShape, theName=None):
11533 Performs union faces of theShape.
11534 Unite faces sharing one surface. It means that
11535 these faces must have references to one C++ surface object (handle).
11538 theShape The compound or single solid that contains faces
11540 theName Object name; when specified, this parameter is used
11541 for result publication in the study. Otherwise, if automatic
11542 publication is switched on, default value is used for result name.
11547 # Example: see GEOM_TestOthers.py
11548 anObj = self.BlocksOp.UnionFaces(theShape)
11549 RaiseIfFailed("UnionFaces", self.BlocksOp)
11550 self._autoPublish(anObj, theName, "unionFaces")
11553 ## Check, if the given shape is a blocks compound.
11554 # Fix all detected errors.
11555 # \note Single block can be also fixed by this method.
11556 # @param theShape The compound to check and improve.
11557 # @param theName Object name; when specified, this parameter is used
11558 # for result publication in the study. Otherwise, if automatic
11559 # publication is switched on, default value is used for result name.
11561 # @return Improved compound.
11563 # @ref swig_CheckAndImprove "Example"
11564 @ManageTransactions("BlocksOp")
11565 def CheckAndImprove(self, theShape, theName=None):
11567 Check, if the given shape is a blocks compound.
11568 Fix all detected errors.
11571 Single block can be also fixed by this method.
11574 theShape The compound to check and improve.
11575 theName Object name; when specified, this parameter is used
11576 for result publication in the study. Otherwise, if automatic
11577 publication is switched on, default value is used for result name.
11582 # Example: see GEOM_TestOthers.py
11583 anObj = self.BlocksOp.CheckAndImprove(theShape)
11584 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11585 self._autoPublish(anObj, theName, "improved")
11588 # end of l4_blocks_measure
11591 ## @addtogroup l3_blocks_op
11594 ## Get all the blocks, contained in the given compound.
11595 # @param theCompound The compound to explode.
11596 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11597 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11598 # @param theName Object name; when specified, this parameter is used
11599 # for result publication in the study. Otherwise, if automatic
11600 # publication is switched on, default value is used for result name.
11602 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11604 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11606 # @ref tui_explode_on_blocks "Example 1"
11607 # \n @ref swig_MakeBlockExplode "Example 2"
11608 @ManageTransactions("BlocksOp")
11609 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11611 Get all the blocks, contained in the given compound.
11614 theCompound The compound to explode.
11615 theMinNbFaces If solid has lower number of faces, it is not a block.
11616 theMaxNbFaces If solid has higher number of faces, it is not a block.
11617 theName Object name; when specified, this parameter is used
11618 for result publication in the study. Otherwise, if automatic
11619 publication is switched on, default value is used for result name.
11622 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11625 List of GEOM.GEOM_Object, containing the retrieved blocks.
11627 # Example: see GEOM_TestOthers.py
11628 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11629 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11630 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11631 for anObj in aList:
11632 anObj.SetParameters(Parameters)
11634 self._autoPublish(aList, theName, "block")
11637 ## Find block, containing the given point inside its volume or on boundary.
11638 # @param theCompound Compound, to find block in.
11639 # @param thePoint Point, close to the desired block. If the point lays on
11640 # boundary between some blocks, we return block with nearest center.
11641 # @param theName Object name; when specified, this parameter is used
11642 # for result publication in the study. Otherwise, if automatic
11643 # publication is switched on, default value is used for result name.
11645 # @return New GEOM.GEOM_Object, containing the found block.
11647 # @ref swig_todo "Example"
11648 @ManageTransactions("BlocksOp")
11649 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11651 Find block, containing the given point inside its volume or on boundary.
11654 theCompound Compound, to find block in.
11655 thePoint Point, close to the desired block. If the point lays on
11656 boundary between some blocks, we return block with nearest center.
11657 theName Object name; when specified, this parameter is used
11658 for result publication in the study. Otherwise, if automatic
11659 publication is switched on, default value is used for result name.
11662 New GEOM.GEOM_Object, containing the found block.
11664 # Example: see GEOM_Spanner.py
11665 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11666 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11667 self._autoPublish(anObj, theName, "block")
11670 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11671 # @param theCompound Compound, to find block in.
11672 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11673 # @param theName Object name; when specified, this parameter is used
11674 # for result publication in the study. Otherwise, if automatic
11675 # publication is switched on, default value is used for result name.
11677 # @return New GEOM.GEOM_Object, containing the found block.
11679 # @ref swig_GetBlockByParts "Example"
11680 @ManageTransactions("BlocksOp")
11681 def GetBlockByParts(self, theCompound, theParts, theName=None):
11683 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11686 theCompound Compound, to find block in.
11687 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11688 theName Object name; when specified, this parameter is used
11689 for result publication in the study. Otherwise, if automatic
11690 publication is switched on, default value is used for result name.
11693 New GEOM_Object, containing the found block.
11695 # Example: see GEOM_TestOthers.py
11696 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11697 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11698 self._autoPublish(anObj, theName, "block")
11701 ## Return all blocks, containing all the elements, passed as the parts.
11702 # @param theCompound Compound, to find blocks in.
11703 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11704 # @param theName Object name; when specified, this parameter is used
11705 # for result publication in the study. Otherwise, if automatic
11706 # publication is switched on, default value is used for result name.
11708 # @return List of GEOM.GEOM_Object, containing the found blocks.
11710 # @ref swig_todo "Example"
11711 @ManageTransactions("BlocksOp")
11712 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11714 Return all blocks, containing all the elements, passed as the parts.
11717 theCompound Compound, to find blocks in.
11718 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11719 theName Object name; when specified, this parameter is used
11720 for result publication in the study. Otherwise, if automatic
11721 publication is switched on, default value is used for result name.
11724 List of GEOM.GEOM_Object, containing the found blocks.
11726 # Example: see GEOM_Spanner.py
11727 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11728 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11729 self._autoPublish(aList, theName, "block")
11732 ## Multi-transformate block and glue the result.
11733 # Transformation is defined so, as to superpose direction faces.
11734 # @param Block Hexahedral solid to be multi-transformed.
11735 # @param DirFace1 ID of First direction face.
11736 # @param DirFace2 ID of Second direction face.
11737 # @param NbTimes Quantity of transformations to be done.
11738 # @param theName Object name; when specified, this parameter is used
11739 # for result publication in the study. Otherwise, if automatic
11740 # publication is switched on, default value is used for result name.
11742 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11744 # @return New GEOM.GEOM_Object, containing the result shape.
11746 # @ref tui_multi_transformation "Example"
11747 @ManageTransactions("BlocksOp")
11748 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11750 Multi-transformate block and glue the result.
11751 Transformation is defined so, as to superpose direction faces.
11754 Block Hexahedral solid to be multi-transformed.
11755 DirFace1 ID of First direction face.
11756 DirFace2 ID of Second direction face.
11757 NbTimes Quantity of transformations to be done.
11758 theName Object name; when specified, this parameter is used
11759 for result publication in the study. Otherwise, if automatic
11760 publication is switched on, default value is used for result name.
11763 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11766 New GEOM.GEOM_Object, containing the result shape.
11768 # Example: see GEOM_Spanner.py
11769 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11770 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11771 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11772 anObj.SetParameters(Parameters)
11773 self._autoPublish(anObj, theName, "transformed")
11776 ## Multi-transformate block and glue the result.
11777 # @param Block Hexahedral solid to be multi-transformed.
11778 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11779 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11780 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11781 # @param theName Object name; when specified, this parameter is used
11782 # for result publication in the study. Otherwise, if automatic
11783 # publication is switched on, default value is used for result name.
11785 # @return New GEOM.GEOM_Object, containing the result shape.
11787 # @ref tui_multi_transformation "Example"
11788 @ManageTransactions("BlocksOp")
11789 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11790 DirFace1V, DirFace2V, NbTimesV, theName=None):
11792 Multi-transformate block and glue the result.
11795 Block Hexahedral solid to be multi-transformed.
11796 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11797 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11798 NbTimesU,NbTimesV Quantity of transformations to be done.
11799 theName Object name; when specified, this parameter is used
11800 for result publication in the study. Otherwise, if automatic
11801 publication is switched on, default value is used for result name.
11804 New GEOM.GEOM_Object, containing the result shape.
11806 # Example: see GEOM_Spanner.py
11807 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11808 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11809 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11810 DirFace1V, DirFace2V, NbTimesV)
11811 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11812 anObj.SetParameters(Parameters)
11813 self._autoPublish(anObj, theName, "transformed")
11816 ## Build all possible propagation groups.
11817 # Propagation group is a set of all edges, opposite to one (main)
11818 # edge of this group directly or through other opposite edges.
11819 # Notion of Opposite Edge make sence only on quadrangle face.
11820 # @param theShape Shape to build propagation groups on.
11821 # @param theName Object name; when specified, this parameter is used
11822 # for result publication in the study. Otherwise, if automatic
11823 # publication is switched on, default value is used for result name.
11825 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11827 # @ref swig_Propagate "Example"
11828 @ManageTransactions("BlocksOp")
11829 def Propagate(self, theShape, theName=None):
11831 Build all possible propagation groups.
11832 Propagation group is a set of all edges, opposite to one (main)
11833 edge of this group directly or through other opposite edges.
11834 Notion of Opposite Edge make sence only on quadrangle face.
11837 theShape Shape to build propagation groups on.
11838 theName Object name; when specified, this parameter is used
11839 for result publication in the study. Otherwise, if automatic
11840 publication is switched on, default value is used for result name.
11843 List of GEOM.GEOM_Object, each of them is a propagation group.
11845 # Example: see GEOM_TestOthers.py
11846 listChains = self.BlocksOp.Propagate(theShape)
11847 RaiseIfFailed("Propagate", self.BlocksOp)
11848 self._autoPublish(listChains, theName, "propagate")
11851 # end of l3_blocks_op
11854 ## @addtogroup l3_groups
11857 ## Creates a new group which will store sub-shapes of theMainShape
11858 # @param theMainShape is a GEOM object on which the group is selected
11859 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11860 # @param theName Object name; when specified, this parameter is used
11861 # for result publication in the study. Otherwise, if automatic
11862 # publication is switched on, default value is used for result name.
11864 # @return a newly created GEOM group (GEOM.GEOM_Object)
11866 # @ref tui_working_with_groups_page "Example 1"
11867 # \n @ref swig_CreateGroup "Example 2"
11868 @ManageTransactions("GroupOp")
11869 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11871 Creates a new group which will store sub-shapes of theMainShape
11874 theMainShape is a GEOM object on which the group is selected
11875 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11876 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11877 theName Object name; when specified, this parameter is used
11878 for result publication in the study. Otherwise, if automatic
11879 publication is switched on, default value is used for result name.
11882 a newly created GEOM group
11885 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11888 # Example: see GEOM_TestOthers.py
11889 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11890 RaiseIfFailed("CreateGroup", self.GroupOp)
11891 self._autoPublish(anObj, theName, "group")
11894 ## Adds a sub-object with ID theSubShapeId to the group
11895 # @param theGroup is a GEOM group to which the new sub-shape is added
11896 # @param theSubShapeID is a sub-shape ID in the main object.
11897 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11899 # @ref tui_working_with_groups_page "Example"
11900 @ManageTransactions("GroupOp")
11901 def AddObject(self,theGroup, theSubShapeID):
11903 Adds a sub-object with ID theSubShapeId to the group
11906 theGroup is a GEOM group to which the new sub-shape is added
11907 theSubShapeID is a sub-shape ID in the main object.
11910 Use method GetSubShapeID() to get an unique ID of the sub-shape
11912 # Example: see GEOM_TestOthers.py
11913 self.GroupOp.AddObject(theGroup, theSubShapeID)
11914 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11915 RaiseIfFailed("AddObject", self.GroupOp)
11919 ## Removes a sub-object with ID \a theSubShapeId from the group
11920 # @param theGroup is a GEOM group from which the new sub-shape is removed
11921 # @param theSubShapeID is a sub-shape ID in the main object.
11922 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11924 # @ref tui_working_with_groups_page "Example"
11925 @ManageTransactions("GroupOp")
11926 def RemoveObject(self,theGroup, theSubShapeID):
11928 Removes a sub-object with ID theSubShapeId from the group
11931 theGroup is a GEOM group from which the new sub-shape is removed
11932 theSubShapeID is a sub-shape ID in the main object.
11935 Use method GetSubShapeID() to get an unique ID of the sub-shape
11937 # Example: see GEOM_TestOthers.py
11938 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11939 RaiseIfFailed("RemoveObject", self.GroupOp)
11942 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11943 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11944 # @param theSubShapes is a list of sub-shapes to be added.
11946 # @ref tui_working_with_groups_page "Example"
11947 @ManageTransactions("GroupOp")
11948 def UnionList (self,theGroup, theSubShapes):
11950 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11953 theGroup is a GEOM group to which the new sub-shapes are added.
11954 theSubShapes is a list of sub-shapes to be added.
11956 # Example: see GEOM_TestOthers.py
11957 self.GroupOp.UnionList(theGroup, theSubShapes)
11958 RaiseIfFailed("UnionList", self.GroupOp)
11961 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11962 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11963 # @param theSubShapes is a list of indices of sub-shapes to be added.
11965 # @ref swig_UnionIDs "Example"
11966 @ManageTransactions("GroupOp")
11967 def UnionIDs(self,theGroup, theSubShapes):
11969 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11972 theGroup is a GEOM group to which the new sub-shapes are added.
11973 theSubShapes is a list of indices of sub-shapes to be added.
11975 # Example: see GEOM_TestOthers.py
11976 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11977 RaiseIfFailed("UnionIDs", self.GroupOp)
11980 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11981 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11982 # @param theSubShapes is a list of sub-shapes to be removed.
11984 # @ref tui_working_with_groups_page "Example"
11985 @ManageTransactions("GroupOp")
11986 def DifferenceList (self,theGroup, theSubShapes):
11988 Removes from the group all the given shapes. No errors, if some shapes are not included.
11991 theGroup is a GEOM group from which the sub-shapes are removed.
11992 theSubShapes is a list of sub-shapes to be removed.
11994 # Example: see GEOM_TestOthers.py
11995 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11996 RaiseIfFailed("DifferenceList", self.GroupOp)
11999 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12000 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12001 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12003 # @ref swig_DifferenceIDs "Example"
12004 @ManageTransactions("GroupOp")
12005 def DifferenceIDs(self,theGroup, theSubShapes):
12007 Removes from the group all the given shapes. No errors, if some shapes are not included.
12010 theGroup is a GEOM group from which the sub-shapes are removed.
12011 theSubShapes is a list of indices of sub-shapes to be removed.
12013 # Example: see GEOM_TestOthers.py
12014 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12015 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12018 ## Union of two groups.
12019 # New group is created. It will contain all entities
12020 # which are present in groups theGroup1 and theGroup2.
12021 # @param theGroup1, theGroup2 are the initial GEOM groups
12022 # to create the united group from.
12023 # @param theName Object name; when specified, this parameter is used
12024 # for result publication in the study. Otherwise, if automatic
12025 # publication is switched on, default value is used for result name.
12027 # @return a newly created GEOM group.
12029 # @ref tui_union_groups_anchor "Example"
12030 @ManageTransactions("GroupOp")
12031 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12033 Union of two groups.
12034 New group is created. It will contain all entities
12035 which are present in groups theGroup1 and theGroup2.
12038 theGroup1, theGroup2 are the initial GEOM groups
12039 to create the united group from.
12040 theName Object name; when specified, this parameter is used
12041 for result publication in the study. Otherwise, if automatic
12042 publication is switched on, default value is used for result name.
12045 a newly created GEOM group.
12047 # Example: see GEOM_TestOthers.py
12048 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12049 RaiseIfFailed("UnionGroups", self.GroupOp)
12050 self._autoPublish(aGroup, theName, "group")
12053 ## Intersection of two groups.
12054 # New group is created. It will contain only those entities
12055 # which are present in both groups theGroup1 and theGroup2.
12056 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12057 # @param theName Object name; when specified, this parameter is used
12058 # for result publication in the study. Otherwise, if automatic
12059 # publication is switched on, default value is used for result name.
12061 # @return a newly created GEOM group.
12063 # @ref tui_intersect_groups_anchor "Example"
12064 @ManageTransactions("GroupOp")
12065 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12067 Intersection of two groups.
12068 New group is created. It will contain only those entities
12069 which are present in both groups theGroup1 and theGroup2.
12072 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12073 theName Object name; when specified, this parameter is used
12074 for result publication in the study. Otherwise, if automatic
12075 publication is switched on, default value is used for result name.
12078 a newly created GEOM group.
12080 # Example: see GEOM_TestOthers.py
12081 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12082 RaiseIfFailed("IntersectGroups", self.GroupOp)
12083 self._autoPublish(aGroup, theName, "group")
12086 ## Cut of two groups.
12087 # New group is created. It will contain entities which are
12088 # present in group theGroup1 but are not present in group theGroup2.
12089 # @param theGroup1 is a GEOM group to include elements of.
12090 # @param theGroup2 is a GEOM group to exclude elements of.
12091 # @param theName Object name; when specified, this parameter is used
12092 # for result publication in the study. Otherwise, if automatic
12093 # publication is switched on, default value is used for result name.
12095 # @return a newly created GEOM group.
12097 # @ref tui_cut_groups_anchor "Example"
12098 @ManageTransactions("GroupOp")
12099 def CutGroups (self, theGroup1, theGroup2, theName=None):
12102 New group is created. It will contain entities which are
12103 present in group theGroup1 but are not present in group theGroup2.
12106 theGroup1 is a GEOM group to include elements of.
12107 theGroup2 is a GEOM group to exclude elements of.
12108 theName Object name; when specified, this parameter is used
12109 for result publication in the study. Otherwise, if automatic
12110 publication is switched on, default value is used for result name.
12113 a newly created GEOM group.
12115 # Example: see GEOM_TestOthers.py
12116 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12117 RaiseIfFailed("CutGroups", self.GroupOp)
12118 self._autoPublish(aGroup, theName, "group")
12121 ## Union of list of groups.
12122 # New group is created. It will contain all entities that are
12123 # present in groups listed in theGList.
12124 # @param theGList is a list of GEOM groups to create the united group from.
12125 # @param theName Object name; when specified, this parameter is used
12126 # for result publication in the study. Otherwise, if automatic
12127 # publication is switched on, default value is used for result name.
12129 # @return a newly created GEOM group.
12131 # @ref tui_union_groups_anchor "Example"
12132 @ManageTransactions("GroupOp")
12133 def UnionListOfGroups (self, theGList, theName=None):
12135 Union of list of groups.
12136 New group is created. It will contain all entities that are
12137 present in groups listed in theGList.
12140 theGList is a list of GEOM groups to create the united group from.
12141 theName Object name; when specified, this parameter is used
12142 for result publication in the study. Otherwise, if automatic
12143 publication is switched on, default value is used for result name.
12146 a newly created GEOM group.
12148 # Example: see GEOM_TestOthers.py
12149 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12150 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12151 self._autoPublish(aGroup, theName, "group")
12154 ## Cut of lists of groups.
12155 # New group is created. It will contain only entities
12156 # which are present in groups listed in theGList.
12157 # @param theGList is a list of GEOM groups to include elements of.
12158 # @param theName Object name; when specified, this parameter is used
12159 # for result publication in the study. Otherwise, if automatic
12160 # publication is switched on, default value is used for result name.
12162 # @return a newly created GEOM group.
12164 # @ref tui_intersect_groups_anchor "Example"
12165 @ManageTransactions("GroupOp")
12166 def IntersectListOfGroups (self, theGList, theName=None):
12168 Cut of lists of groups.
12169 New group is created. It will contain only entities
12170 which are present in groups listed in theGList.
12173 theGList is a list of GEOM groups to include elements of.
12174 theName Object name; when specified, this parameter is used
12175 for result publication in the study. Otherwise, if automatic
12176 publication is switched on, default value is used for result name.
12179 a newly created GEOM group.
12181 # Example: see GEOM_TestOthers.py
12182 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12183 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12184 self._autoPublish(aGroup, theName, "group")
12187 ## Cut of lists of groups.
12188 # New group is created. It will contain only entities
12189 # which are present in groups listed in theGList1 but
12190 # are not present in groups from theGList2.
12191 # @param theGList1 is a list of GEOM groups to include elements of.
12192 # @param theGList2 is a list of GEOM groups to exclude elements of.
12193 # @param theName Object name; when specified, this parameter is used
12194 # for result publication in the study. Otherwise, if automatic
12195 # publication is switched on, default value is used for result name.
12197 # @return a newly created GEOM group.
12199 # @ref tui_cut_groups_anchor "Example"
12200 @ManageTransactions("GroupOp")
12201 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12203 Cut of lists of groups.
12204 New group is created. It will contain only entities
12205 which are present in groups listed in theGList1 but
12206 are not present in groups from theGList2.
12209 theGList1 is a list of GEOM groups to include elements of.
12210 theGList2 is a list of GEOM groups to exclude elements of.
12211 theName Object name; when specified, this parameter is used
12212 for result publication in the study. Otherwise, if automatic
12213 publication is switched on, default value is used for result name.
12216 a newly created GEOM group.
12218 # Example: see GEOM_TestOthers.py
12219 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12220 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12221 self._autoPublish(aGroup, theName, "group")
12224 ## Returns a list of sub-objects ID stored in the group
12225 # @param theGroup is a GEOM group for which a list of IDs is requested
12227 # @ref swig_GetObjectIDs "Example"
12228 @ManageTransactions("GroupOp")
12229 def GetObjectIDs(self,theGroup):
12231 Returns a list of sub-objects ID stored in the group
12234 theGroup is a GEOM group for which a list of IDs is requested
12236 # Example: see GEOM_TestOthers.py
12237 ListIDs = self.GroupOp.GetObjects(theGroup)
12238 RaiseIfFailed("GetObjects", self.GroupOp)
12241 ## Returns a type of sub-objects stored in the group
12242 # @param theGroup is a GEOM group which type is returned.
12244 # @ref swig_GetType "Example"
12245 @ManageTransactions("GroupOp")
12246 def GetType(self,theGroup):
12248 Returns a type of sub-objects stored in the group
12251 theGroup is a GEOM group which type is returned.
12253 # Example: see GEOM_TestOthers.py
12254 aType = self.GroupOp.GetType(theGroup)
12255 RaiseIfFailed("GetType", self.GroupOp)
12258 ## Convert a type of geom object from id to string value
12259 # @param theId is a GEOM obect type id.
12260 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12261 # @ref swig_GetType "Example"
12262 def ShapeIdToType(self, theId):
12264 Convert a type of geom object from id to string value
12267 theId is a GEOM obect type id.
12270 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12297 return "REVOLUTION"
12345 return "FREE_BOUNDS"
12353 return "THRUSECTIONS"
12355 return "COMPOUNDFILTER"
12357 return "SHAPES_ON_SHAPE"
12359 return "ELLIPSE_ARC"
12361 return "3DSKETCHER"
12367 return "PIPETSHAPE"
12368 return "Shape Id not exist."
12370 ## Returns a main shape associated with the group
12371 # @param theGroup is a GEOM group for which a main shape object is requested
12372 # @return a GEOM object which is a main shape for theGroup
12374 # @ref swig_GetMainShape "Example"
12375 @ManageTransactions("GroupOp")
12376 def GetMainShape(self,theGroup):
12378 Returns a main shape associated with the group
12381 theGroup is a GEOM group for which a main shape object is requested
12384 a GEOM object which is a main shape for theGroup
12386 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12388 # Example: see GEOM_TestOthers.py
12389 anObj = self.GroupOp.GetMainShape(theGroup)
12390 RaiseIfFailed("GetMainShape", self.GroupOp)
12393 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12394 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12395 # @param theShape given shape (see GEOM.GEOM_Object)
12396 # @param min_length minimum length of edges of theShape
12397 # @param max_length maximum length of edges of theShape
12398 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12399 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12400 # @param theName Object name; when specified, this parameter is used
12401 # for result publication in the study. Otherwise, if automatic
12402 # publication is switched on, default value is used for result name.
12404 # @return a newly created GEOM group of edges
12406 # @@ref swig_todo "Example"
12407 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12409 Create group of edges of theShape, whose length is in range [min_length, max_length].
12410 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12413 theShape given shape
12414 min_length minimum length of edges of theShape
12415 max_length maximum length of edges of theShape
12416 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12417 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12418 theName Object name; when specified, this parameter is used
12419 for result publication in the study. Otherwise, if automatic
12420 publication is switched on, default value is used for result name.
12423 a newly created GEOM group of edges.
12425 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12426 edges_in_range = []
12428 Props = self.BasicProperties(edge)
12429 if min_length <= Props[0] and Props[0] <= max_length:
12430 if (not include_min) and (min_length == Props[0]):
12433 if (not include_max) and (Props[0] == max_length):
12436 edges_in_range.append(edge)
12438 if len(edges_in_range) <= 0:
12439 print "No edges found by given criteria"
12442 # note: auto-publishing is done in self.CreateGroup()
12443 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12444 self.UnionList(group_edges, edges_in_range)
12448 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12449 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12450 # @param min_length minimum length of edges of selected shape
12451 # @param max_length maximum length of edges of selected shape
12452 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12453 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12454 # @return a newly created GEOM group of edges
12455 # @ref swig_todo "Example"
12456 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12458 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12459 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12462 min_length minimum length of edges of selected shape
12463 max_length maximum length of edges of selected shape
12464 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12465 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12468 a newly created GEOM group of edges.
12470 nb_selected = sg.SelectedCount()
12471 if nb_selected < 1:
12472 print "Select a shape before calling this function, please."
12474 if nb_selected > 1:
12475 print "Only one shape must be selected"
12478 id_shape = sg.getSelected(0)
12479 shape = IDToObject( id_shape )
12481 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12485 if include_min: left_str = " <= "
12486 if include_max: right_str = " <= "
12488 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12489 + left_str + "length" + right_str + `max_length`)
12491 sg.updateObjBrowser(1)
12498 #@@ insert new functions before this line @@ do not remove this line @@#
12500 ## Create a copy of the given object
12502 # @param theOriginal geometry object for copy
12503 # @param theName Object name; when specified, this parameter is used
12504 # for result publication in the study. Otherwise, if automatic
12505 # publication is switched on, default value is used for result name.
12507 # @return New GEOM_Object, containing the copied shape.
12509 # @ingroup l1_geomBuilder_auxiliary
12510 # @ref swig_MakeCopy "Example"
12511 @ManageTransactions("InsertOp")
12512 def MakeCopy(self, theOriginal, theName=None):
12514 Create a copy of the given object
12517 theOriginal geometry object for copy
12518 theName Object name; when specified, this parameter is used
12519 for result publication in the study. Otherwise, if automatic
12520 publication is switched on, default value is used for result name.
12523 New GEOM_Object, containing the copied shape.
12525 Example of usage: Copy = geompy.MakeCopy(Box)
12527 # Example: see GEOM_TestAll.py
12528 anObj = self.InsertOp.MakeCopy(theOriginal)
12529 RaiseIfFailed("MakeCopy", self.InsertOp)
12530 self._autoPublish(anObj, theName, "copy")
12533 ## Add Path to load python scripts from
12534 # @param Path a path to load python scripts from
12535 # @ingroup l1_geomBuilder_auxiliary
12536 def addPath(self,Path):
12538 Add Path to load python scripts from
12541 Path a path to load python scripts from
12543 if (sys.path.count(Path) < 1):
12544 sys.path.append(Path)
12548 ## Load marker texture from the file
12549 # @param Path a path to the texture file
12550 # @return unique texture identifier
12551 # @ingroup l1_geomBuilder_auxiliary
12552 @ManageTransactions("InsertOp")
12553 def LoadTexture(self, Path):
12555 Load marker texture from the file
12558 Path a path to the texture file
12561 unique texture identifier
12563 # Example: see GEOM_TestAll.py
12564 ID = self.InsertOp.LoadTexture(Path)
12565 RaiseIfFailed("LoadTexture", self.InsertOp)
12568 ## Get internal name of the object based on its study entry
12569 # @note This method does not provide an unique identifier of the geometry object.
12570 # @note This is internal function of GEOM component, though it can be used outside it for
12571 # appropriate reason (e.g. for identification of geometry object).
12572 # @param obj geometry object
12573 # @return unique object identifier
12574 # @ingroup l1_geomBuilder_auxiliary
12575 def getObjectID(self, obj):
12577 Get internal name of the object based on its study entry.
12578 Note: this method does not provide an unique identifier of the geometry object.
12579 It is an internal function of GEOM component, though it can be used outside GEOM for
12580 appropriate reason (e.g. for identification of geometry object).
12583 obj geometry object
12586 unique object identifier
12589 entry = salome.ObjectToID(obj)
12590 if entry is not None:
12591 lst = entry.split(":")
12593 ID = lst[-1] # -1 means last item in the list
12594 return "GEOM_" + ID
12599 ## Add marker texture. @a Width and @a Height parameters
12600 # specify width and height of the texture in pixels.
12601 # If @a RowData is @c True, @a Texture parameter should represent texture data
12602 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12603 # parameter should be unpacked string, in which '1' symbols represent opaque
12604 # pixels and '0' represent transparent pixels of the texture bitmap.
12606 # @param Width texture width in pixels
12607 # @param Height texture height in pixels
12608 # @param Texture texture data
12609 # @param RowData if @c True, @a Texture data are packed in the byte stream
12610 # @return unique texture identifier
12611 # @ingroup l1_geomBuilder_auxiliary
12612 @ManageTransactions("InsertOp")
12613 def AddTexture(self, Width, Height, Texture, RowData=False):
12615 Add marker texture. Width and Height parameters
12616 specify width and height of the texture in pixels.
12617 If RowData is True, Texture parameter should represent texture data
12618 packed into the byte array. If RowData is False (default), Texture
12619 parameter should be unpacked string, in which '1' symbols represent opaque
12620 pixels and '0' represent transparent pixels of the texture bitmap.
12623 Width texture width in pixels
12624 Height texture height in pixels
12625 Texture texture data
12626 RowData if True, Texture data are packed in the byte stream
12629 return unique texture identifier
12631 if not RowData: Texture = PackData(Texture)
12632 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12633 RaiseIfFailed("AddTexture", self.InsertOp)
12636 ## Creates a new folder object. It is a container for any GEOM objects.
12637 # @param Name name of the container
12638 # @param Father parent object. If None,
12639 # folder under 'Geometry' root object will be created.
12640 # @return a new created folder
12641 # @ingroup l1_publish_data
12642 def NewFolder(self, Name, Father=None):
12644 Create a new folder object. It is an auxiliary container for any GEOM objects.
12647 Name name of the container
12648 Father parent object. If None,
12649 folder under 'Geometry' root object will be created.
12652 a new created folder
12654 if not Father: Father = self.father
12655 return self.CreateFolder(Name, Father)
12657 ## Move object to the specified folder
12658 # @param Object object to move
12659 # @param Folder target folder
12660 # @ingroup l1_publish_data
12661 def PutToFolder(self, Object, Folder):
12663 Move object to the specified folder
12666 Object object to move
12667 Folder target folder
12669 self.MoveToFolder(Object, Folder)
12672 ## Move list of objects to the specified folder
12673 # @param ListOfSO list of objects to move
12674 # @param Folder target folder
12675 # @ingroup l1_publish_data
12676 def PutListToFolder(self, ListOfSO, Folder):
12678 Move list of objects to the specified folder
12681 ListOfSO list of objects to move
12682 Folder target folder
12684 self.MoveListToFolder(ListOfSO, Folder)
12687 ## @addtogroup l2_field
12691 # @param shape the shape the field lies on
12692 # @param name the field name
12693 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12694 # @param dimension dimension of the shape the field lies on
12695 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12696 # @param componentNames names of components
12697 # @return a created field
12698 @ManageTransactions("FieldOp")
12699 def CreateField(self, shape, name, type, dimension, componentNames):
12704 shape the shape the field lies on
12705 name the field name
12706 type type of field data
12707 dimension dimension of the shape the field lies on
12708 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12709 componentNames names of components
12714 if isinstance( type, int ):
12715 if type < 0 or type > 3:
12716 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12717 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12719 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12720 RaiseIfFailed("CreateField", self.FieldOp)
12722 geom._autoPublish( f, "", name)
12725 ## Removes a field from the GEOM component
12726 # @param field the field to remove
12727 def RemoveField(self, field):
12728 "Removes a field from the GEOM component"
12730 if isinstance( field, GEOM._objref_GEOM_Field ):
12731 geom.RemoveObject( field )
12732 elif isinstance( field, geomField ):
12733 geom.RemoveObject( field.field )
12735 raise RuntimeError, "RemoveField() : the object is not a field"
12738 ## Returns number of fields on a shape
12739 @ManageTransactions("FieldOp")
12740 def CountFields(self, shape):
12741 "Returns number of fields on a shape"
12742 nb = self.FieldOp.CountFields( shape )
12743 RaiseIfFailed("CountFields", self.FieldOp)
12746 ## Returns all fields on a shape
12747 @ManageTransactions("FieldOp")
12748 def GetFields(self, shape):
12749 "Returns all fields on a shape"
12750 ff = self.FieldOp.GetFields( shape )
12751 RaiseIfFailed("GetFields", self.FieldOp)
12754 ## Returns a field on a shape by its name
12755 @ManageTransactions("FieldOp")
12756 def GetField(self, shape, name):
12757 "Returns a field on a shape by its name"
12758 f = self.FieldOp.GetField( shape, name )
12759 RaiseIfFailed("GetField", self.FieldOp)
12767 # Register the new proxy for GEOM_Gen
12768 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12771 ## Field on Geometry
12772 # @ingroup l2_field
12773 class geomField( GEOM._objref_GEOM_Field ):
12775 def __init__(self):
12776 GEOM._objref_GEOM_Field.__init__(self)
12777 self.field = GEOM._objref_GEOM_Field
12780 ## Returns the shape the field lies on
12781 def getShape(self):
12782 "Returns the shape the field lies on"
12783 return self.field.GetShape(self)
12785 ## Returns the field name
12787 "Returns the field name"
12788 return self.field.GetName(self)
12790 ## Returns type of field data as integer [0-3]
12792 "Returns type of field data"
12793 return self.field.GetDataType(self)._v
12795 ## Returns type of field data:
12796 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12797 def getTypeEnum(self):
12798 "Returns type of field data"
12799 return self.field.GetDataType(self)
12801 ## Returns dimension of the shape the field lies on:
12802 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12803 def getDimension(self):
12804 """Returns dimension of the shape the field lies on:
12805 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12806 return self.field.GetDimension(self)
12808 ## Returns names of components
12809 def getComponents(self):
12810 "Returns names of components"
12811 return self.field.GetComponents(self)
12813 ## Adds a time step to the field
12814 # @param step the time step number further used as the step identifier
12815 # @param stamp the time step time
12816 # @param values the values of the time step
12817 def addStep(self, step, stamp, values):
12818 "Adds a time step to the field"
12819 stp = self.field.AddStep( self, step, stamp )
12821 raise RuntimeError, \
12822 "Field.addStep() : Error: step %s already exists in this field"%step
12824 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12825 self.setValues( step, values )
12828 ## Remove a time step from the field
12829 def removeStep(self,step):
12830 "Remove a time step from the field"
12833 stepObj = self.field.GetStep( self, step )
12835 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
12838 #traceback.print_exc()
12840 self.field.RemoveStep( self, step )
12842 geom.myBuilder.RemoveObjectWithChildren( stepSO )
12845 ## Returns number of time steps in the field
12846 def countSteps(self):
12847 "Returns number of time steps in the field"
12848 return self.field.CountSteps(self)
12850 ## Returns a list of time step IDs in the field
12851 def getSteps(self):
12852 "Returns a list of time step IDs in the field"
12853 return self.field.GetSteps(self)
12855 ## Returns a time step by its ID
12856 def getStep(self,step):
12857 "Returns a time step by its ID"
12858 stp = self.field.GetStep(self, step)
12860 raise RuntimeError, "Step %s is missing from this field"%step
12863 ## Returns the time of the field step
12864 def getStamp(self,step):
12865 "Returns the time of the field step"
12866 return self.getStep(step).GetStamp()
12868 ## Changes the time of the field step
12869 def setStamp(self, step, stamp):
12870 "Changes the time of the field step"
12871 return self.getStep(step).SetStamp(stamp)
12873 ## Returns values of the field step
12874 def getValues(self, step):
12875 "Returns values of the field step"
12876 return self.getStep(step).GetValues()
12878 ## Changes values of the field step
12879 def setValues(self, step, values):
12880 "Changes values of the field step"
12881 stp = self.getStep(step)
12882 errBeg = "Field.setValues(values) : Error: "
12884 ok = stp.SetValues( values )
12885 except Exception, e:
12887 if excStr.find("WrongPythonType") > 0:
12888 raise RuntimeError, errBeg +\
12889 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
12890 raise RuntimeError, errBeg + str(e)
12892 nbOK = self.field.GetArraySize(self)
12895 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
12897 raise RuntimeError, errBeg + "failed"
12900 pass # end of class geomField
12902 # Register the new proxy for GEOM_Field
12903 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
12906 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12907 # interface to GEOM operations.
12912 # salome.salome_init()
12913 # from salome.geom import geomBuilder
12914 # geompy = geomBuilder.New(salome.myStudy)
12916 # @param study SALOME study, generally obtained by salome.myStudy.
12917 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12918 # @return geomBuilder instance
12919 def New( study, instance=None):
12921 Create a new geomBuilder instance.The geomBuilder class provides the Python
12922 interface to GEOM operations.
12926 salome.salome_init()
12927 from salome.geom import geomBuilder
12928 geompy = geomBuilder.New(salome.myStudy)
12931 study SALOME study, generally obtained by salome.myStudy.
12932 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12934 geomBuilder instance
12936 #print "New geomBuilder ", study, instance
12943 geom = geomBuilder()
12944 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12945 geom.init_geom(study)
12949 # Register methods from the plug-ins in the geomBuilder class
12950 plugins_var = os.environ.get( "GEOM_PluginsList" )
12953 if plugins_var is not None:
12954 plugins = plugins_var.split( ":" )
12955 plugins=filter(lambda x: len(x)>0, plugins)
12956 if plugins is not None:
12957 for pluginName in plugins:
12958 pluginBuilderName = pluginName + "Builder"
12960 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
12961 except Exception, e:
12962 from salome_utils import verbose
12963 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
12965 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
12966 plugin = eval( pluginBuilderName )
12968 # add methods from plugin module to the geomBuilder class
12969 for k in dir( plugin ):
12970 if k[0] == '_': continue
12971 method = getattr( plugin, k )
12972 if type( method ).__name__ == 'function':
12973 if not hasattr( geomBuilder, k ):
12974 setattr( geomBuilder, k, method )