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, "FLAT":9}
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 face from a given set of contours.
3729 # @param theContours either a list or a compound of edges/wires.
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
3736 # (see GEOM.filling_oper_method enum).
3737 # @param isApprox if True, BSpline curves are generated in the process
3738 # of surface construction. By default it is False, that means
3739 # the surface is created using given curves. The usage of
3740 # Approximation makes the algorithm work slower, but allows
3741 # building the surface for rather complex cases.
3742 # @param theName Object name; when specified, this parameter is used
3743 # for result publication in the study. Otherwise, if automatic
3744 # publication is switched on, default value is used for result name.
3746 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3748 # @ref tui_creation_filling "Example"
3749 @ManageTransactions("PrimOp")
3750 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3751 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3753 Create a face from a given set of contours.
3756 theContours either a list or a compound of edges/wires.
3757 theMinDeg a minimal degree of BSpline surface to create.
3758 theMaxDeg a maximal degree of BSpline surface to create.
3759 theTol2D a 2d tolerance to be reached.
3760 theTol3D a 3d tolerance to be reached.
3761 theNbIter a number of iteration of approximation algorithm.
3762 theMethod Kind of method to perform filling operation
3763 (see GEOM.filling_oper_method enum).
3764 isApprox if True, BSpline curves are generated in the process
3765 of surface construction. By default it is False, that means
3766 the surface is created using given curves. The usage of
3767 Approximation makes the algorithm work slower, but allows
3768 building the surface for rather complex cases.
3769 theName Object name; when specified, this parameter is used
3770 for result publication in the study. Otherwise, if automatic
3771 publication is switched on, default value is used for result name.
3774 New GEOM.GEOM_Object (face), containing the created filling surface.
3777 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3779 # Example: see GEOM_TestAll.py
3780 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3781 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3782 theTol2D, theTol3D, theNbIter,
3783 theMethod, isApprox)
3784 RaiseIfFailed("MakeFilling", self.PrimOp)
3785 anObj.SetParameters(Parameters)
3786 self._autoPublish(anObj, theName, "filling")
3790 ## Create a face from a given set of contours.
3791 # This method corresponds to MakeFilling() with isApprox=True.
3792 # @param theContours either a list or a compound of edges/wires.
3793 # @param theMinDeg a minimal degree of BSpline surface to create.
3794 # @param theMaxDeg a maximal degree of BSpline surface to create.
3795 # @param theTol3D a 3d tolerance to be reached.
3796 # @param theName Object name; when specified, this parameter is used
3797 # for result publication in the study. Otherwise, if automatic
3798 # publication is switched on, default value is used for result name.
3800 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3802 # @ref tui_creation_filling "Example"
3803 @ManageTransactions("PrimOp")
3804 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3806 Create a filling from the given compound of contours.
3807 This method corresponds to MakeFilling() with isApprox=True.
3810 theContours either a list or a compound of edges/wires.
3811 theMinDeg a minimal degree of BSpline surface to create.
3812 theMaxDeg a maximal degree of BSpline surface to create.
3813 theTol3D a 3d tolerance to be reached.
3814 theName Object name; when specified, this parameter is used
3815 for result publication in the study. Otherwise, if automatic
3816 publication is switched on, default value is used for result name.
3819 New GEOM.GEOM_Object (face), containing the created filling surface.
3822 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3824 # Example: see GEOM_TestAll.py
3825 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3826 anObj = self.PrimOp.MakeFilling(theContours, theMinDeg, theMaxDeg,
3827 0, theTol3D, 0, GEOM.FOM_Default, True)
3828 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3829 anObj.SetParameters(Parameters)
3830 self._autoPublish(anObj, theName, "filling")
3833 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3834 # @param theSeqSections - set of specified sections.
3835 # @param theModeSolid - mode defining building solid or shell
3836 # @param thePreci - precision 3D used for smoothing
3837 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3838 # @param theName Object name; when specified, this parameter is used
3839 # for result publication in the study. Otherwise, if automatic
3840 # publication is switched on, default value is used for result name.
3842 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3844 # @ref swig_todo "Example"
3845 @ManageTransactions("PrimOp")
3846 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3848 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3851 theSeqSections - set of specified sections.
3852 theModeSolid - mode defining building solid or shell
3853 thePreci - precision 3D used for smoothing
3854 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3855 theName Object name; when specified, this parameter is used
3856 for result publication in the study. Otherwise, if automatic
3857 publication is switched on, default value is used for result name.
3860 New GEOM.GEOM_Object, containing the created shell or solid.
3862 # Example: see GEOM_TestAll.py
3863 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3864 RaiseIfFailed("MakeThruSections", self.PrimOp)
3865 self._autoPublish(anObj, theName, "filling")
3868 ## Create a shape by extrusion of the base shape along
3869 # the path shape. The path shape can be a wire or an edge.
3870 # @param theBase Base shape to be extruded.
3871 # @param thePath Path shape to extrude the base shape along it.
3872 # @param theName Object name; when specified, this parameter is used
3873 # for result publication in the study. Otherwise, if automatic
3874 # publication is switched on, default value is used for result name.
3876 # @return New GEOM.GEOM_Object, containing the created pipe.
3878 # @ref tui_creation_pipe "Example"
3879 @ManageTransactions("PrimOp")
3880 def MakePipe(self, theBase, thePath, theName=None):
3882 Create a shape by extrusion of the base shape along
3883 the path shape. The path shape can be a wire or an edge.
3886 theBase Base shape to be extruded.
3887 thePath Path shape to extrude the base shape along it.
3888 theName Object name; when specified, this parameter is used
3889 for result publication in the study. Otherwise, if automatic
3890 publication is switched on, default value is used for result name.
3893 New GEOM.GEOM_Object, containing the created pipe.
3895 # Example: see GEOM_TestAll.py
3896 anObj = self.PrimOp.MakePipe(theBase, thePath)
3897 RaiseIfFailed("MakePipe", self.PrimOp)
3898 self._autoPublish(anObj, theName, "pipe")
3901 ## Create a shape by extrusion of the profile shape along
3902 # the path shape. The path shape can be a wire or an edge.
3903 # the several profiles can be specified in the several locations of path.
3904 # @param theSeqBases - list of Bases shape to be extruded.
3905 # @param theLocations - list of locations on the path corresponding
3906 # specified list of the Bases shapes. Number of locations
3907 # should be equal to number of bases or list of locations can be empty.
3908 # @param thePath - Path shape to extrude the base shape along it.
3909 # @param theWithContact - the mode defining that the section is translated to be in
3910 # contact with the spine.
3911 # @param theWithCorrection - defining that the section is rotated to be
3912 # orthogonal to the spine tangent in the correspondent point
3913 # @param theName Object name; when specified, this parameter is used
3914 # for result publication in the study. Otherwise, if automatic
3915 # publication is switched on, default value is used for result name.
3917 # @return New GEOM.GEOM_Object, containing the created pipe.
3919 # @ref tui_creation_pipe_with_diff_sec "Example"
3920 @ManageTransactions("PrimOp")
3921 def MakePipeWithDifferentSections(self, theSeqBases,
3922 theLocations, thePath,
3923 theWithContact, theWithCorrection, theName=None):
3925 Create a shape by extrusion of the profile shape along
3926 the path shape. The path shape can be a wire or an edge.
3927 the several profiles can be specified in the several locations of path.
3930 theSeqBases - list of Bases shape to be extruded.
3931 theLocations - list of locations on the path corresponding
3932 specified list of the Bases shapes. Number of locations
3933 should be equal to number of bases or list of locations can be empty.
3934 thePath - Path shape to extrude the base shape along it.
3935 theWithContact - the mode defining that the section is translated to be in
3936 contact with the spine(0/1)
3937 theWithCorrection - defining that the section is rotated to be
3938 orthogonal to the spine tangent in the correspondent point (0/1)
3939 theName Object name; when specified, this parameter is used
3940 for result publication in the study. Otherwise, if automatic
3941 publication is switched on, default value is used for result name.
3944 New GEOM.GEOM_Object, containing the created pipe.
3946 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3947 theLocations, thePath,
3948 theWithContact, theWithCorrection)
3949 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3950 self._autoPublish(anObj, theName, "pipe")
3953 ## Create a shape by extrusion of the profile shape along
3954 # the path shape. The path shape can be a wire or a edge.
3955 # the several profiles can be specified in the several locations of path.
3956 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3957 # shell or face. If number of faces in neighbour sections
3958 # aren't coincided result solid between such sections will
3959 # be created using external boundaries of this shells.
3960 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3961 # This list is used for searching correspondences between
3962 # faces in the sections. Size of this list must be equal
3963 # to size of list of base shapes.
3964 # @param theLocations - list of locations on the path corresponding
3965 # specified list of the Bases shapes. Number of locations
3966 # should be equal to number of bases. First and last
3967 # locations must be coincided with first and last vertexes
3968 # of path correspondingly.
3969 # @param thePath - Path shape to extrude the base shape along it.
3970 # @param theWithContact - the mode defining that the section is translated to be in
3971 # contact with the spine.
3972 # @param theWithCorrection - defining that the section is rotated to be
3973 # orthogonal to the spine tangent in the correspondent point
3974 # @param theName Object name; when specified, this parameter is used
3975 # for result publication in the study. Otherwise, if automatic
3976 # publication is switched on, default value is used for result name.
3978 # @return New GEOM.GEOM_Object, containing the created solids.
3980 # @ref tui_creation_pipe_with_shell_sec "Example"
3981 @ManageTransactions("PrimOp")
3982 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3983 theLocations, thePath,
3984 theWithContact, theWithCorrection, theName=None):
3986 Create a shape by extrusion of the profile shape along
3987 the path shape. The path shape can be a wire or a edge.
3988 the several profiles can be specified in the several locations of path.
3991 theSeqBases - list of Bases shape to be extruded. Base shape must be
3992 shell or face. If number of faces in neighbour sections
3993 aren't coincided result solid between such sections will
3994 be created using external boundaries of this shells.
3995 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3996 This list is used for searching correspondences between
3997 faces in the sections. Size of this list must be equal
3998 to size of list of base shapes.
3999 theLocations - list of locations on the path corresponding
4000 specified list of the Bases shapes. Number of locations
4001 should be equal to number of bases. First and last
4002 locations must be coincided with first and last vertexes
4003 of path correspondingly.
4004 thePath - Path shape to extrude the base shape along it.
4005 theWithContact - the mode defining that the section is translated to be in
4006 contact with the spine (0/1)
4007 theWithCorrection - defining that the section is rotated to be
4008 orthogonal to the spine tangent in the correspondent point (0/1)
4009 theName Object name; when specified, this parameter is used
4010 for result publication in the study. Otherwise, if automatic
4011 publication is switched on, default value is used for result name.
4014 New GEOM.GEOM_Object, containing the created solids.
4016 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4017 theLocations, thePath,
4018 theWithContact, theWithCorrection)
4019 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4020 self._autoPublish(anObj, theName, "pipe")
4023 ## Create a shape by extrusion of the profile shape along
4024 # the path shape. This function is used only for debug pipe
4025 # functionality - it is a version of function MakePipeWithShellSections()
4026 # which give a possibility to recieve information about
4027 # creating pipe between each pair of sections step by step.
4028 @ManageTransactions("PrimOp")
4029 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4030 theLocations, thePath,
4031 theWithContact, theWithCorrection, theName=None):
4033 Create a shape by extrusion of the profile shape along
4034 the path shape. This function is used only for debug pipe
4035 functionality - it is a version of previous function
4036 geompy.MakePipeWithShellSections() which give a possibility to
4037 recieve information about creating pipe between each pair of
4038 sections step by step.
4041 nbsect = len(theSeqBases)
4042 nbsubsect = len(theSeqSubBases)
4043 #print "nbsect = ",nbsect
4044 for i in range(1,nbsect):
4046 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4047 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4049 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4050 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4051 tmpLocations, thePath,
4052 theWithContact, theWithCorrection)
4053 if self.PrimOp.IsDone() == 0:
4054 print "Problems with pipe creation between ",i," and ",i+1," sections"
4055 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4058 print "Pipe between ",i," and ",i+1," sections is OK"
4063 resc = self.MakeCompound(res)
4064 #resc = self.MakeSewing(res, 0.001)
4065 #print "resc: ",resc
4066 self._autoPublish(resc, theName, "pipe")
4069 ## Create solids between given sections
4070 # @param theSeqBases - list of sections (shell or face).
4071 # @param theLocations - list of corresponding vertexes
4072 # @param theName Object name; when specified, this parameter is used
4073 # for result publication in the study. Otherwise, if automatic
4074 # publication is switched on, default value is used for result name.
4076 # @return New GEOM.GEOM_Object, containing the created solids.
4078 # @ref tui_creation_pipe_without_path "Example"
4079 @ManageTransactions("PrimOp")
4080 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
4082 Create solids between given sections
4085 theSeqBases - list of sections (shell or face).
4086 theLocations - list of corresponding vertexes
4087 theName Object name; when specified, this parameter is used
4088 for result publication in the study. Otherwise, if automatic
4089 publication is switched on, default value is used for result name.
4092 New GEOM.GEOM_Object, containing the created solids.
4094 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4095 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4096 self._autoPublish(anObj, theName, "pipe")
4099 ## Create a shape by extrusion of the base shape along
4100 # the path shape with constant bi-normal direction along the given vector.
4101 # The path shape can be a wire or an edge.
4102 # @param theBase Base shape to be extruded.
4103 # @param thePath Path shape to extrude the base shape along it.
4104 # @param theVec Vector defines a constant binormal direction to keep the
4105 # same angle beetween the direction and the sections
4106 # along the sweep surface.
4107 # @param theName Object name; when specified, this parameter is used
4108 # for result publication in the study. Otherwise, if automatic
4109 # publication is switched on, default value is used for result name.
4111 # @return New GEOM.GEOM_Object, containing the created pipe.
4113 # @ref tui_creation_pipe "Example"
4114 @ManageTransactions("PrimOp")
4115 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4117 Create a shape by extrusion of the base shape along
4118 the path shape with constant bi-normal direction along the given vector.
4119 The path shape can be a wire or an edge.
4122 theBase Base shape to be extruded.
4123 thePath Path shape to extrude the base shape along it.
4124 theVec Vector defines a constant binormal direction to keep the
4125 same angle beetween the direction and the sections
4126 along the sweep surface.
4127 theName Object name; when specified, this parameter is used
4128 for result publication in the study. Otherwise, if automatic
4129 publication is switched on, default value is used for result name.
4132 New GEOM.GEOM_Object, containing the created pipe.
4134 # Example: see GEOM_TestAll.py
4135 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4136 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4137 self._autoPublish(anObj, theName, "pipe")
4140 ## Makes a thick solid from a face or a shell
4141 # @param theShape Face or Shell to be thicken
4142 # @param theThickness Thickness of the resulting solid
4143 # @param theName Object name; when specified, this parameter is used
4144 # for result publication in the study. Otherwise, if automatic
4145 # publication is switched on, default value is used for result name.
4147 # @return New GEOM.GEOM_Object, containing the created solid
4149 @ManageTransactions("PrimOp")
4150 def MakeThickSolid(self, theShape, theThickness, theName=None):
4152 Make a thick solid from a face or a shell
4155 theShape Face or Shell to be thicken
4156 theThickness Thickness of the resulting solid
4157 theName Object name; when specified, this parameter is used
4158 for result publication in the study. Otherwise, if automatic
4159 publication is switched on, default value is used for result name.
4162 New GEOM.GEOM_Object, containing the created solid
4164 # Example: see GEOM_TestAll.py
4165 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4166 RaiseIfFailed("MakeThickening", self.PrimOp)
4167 self._autoPublish(anObj, theName, "pipe")
4171 ## Modifies a face or a shell to make it a thick solid
4172 # @param theShape Face or Shell to be thicken
4173 # @param theThickness Thickness of the resulting solid
4175 # @return The modified shape
4177 @ManageTransactions("PrimOp")
4178 def Thicken(self, theShape, theThickness):
4180 Modifies a face or a shell to make it a thick solid
4183 theBase Base shape to be extruded.
4184 thePath Path shape to extrude the base shape along it.
4185 theName Object name; when specified, this parameter is used
4186 for result publication in the study. Otherwise, if automatic
4187 publication is switched on, default value is used for result name.
4192 # Example: see GEOM_TestAll.py
4193 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4194 RaiseIfFailed("MakeThickening", self.PrimOp)
4197 ## Build a middle path of a pipe-like shape.
4198 # The path shape can be a wire or an edge.
4199 # @param theShape It can be closed or unclosed pipe-like shell
4200 # or a pipe-like solid.
4201 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4202 # should be wires or faces of theShape.
4203 # @param theName Object name; when specified, this parameter is used
4204 # for result publication in the study. Otherwise, if automatic
4205 # publication is switched on, default value is used for result name.
4207 # @note It is not assumed that exact or approximate copy of theShape
4208 # can be obtained by applying existing Pipe operation on the
4209 # resulting "Path" wire taking theBase1 as the base - it is not
4210 # always possible; though in some particular cases it might work
4211 # it is not guaranteed. Thus, RestorePath function should not be
4212 # considered as an exact reverse operation of the Pipe.
4214 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4215 # source pipe's "path".
4217 # @ref tui_creation_pipe_path "Example"
4218 @ManageTransactions("PrimOp")
4219 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4221 Build a middle path of a pipe-like shape.
4222 The path shape can be a wire or an edge.
4225 theShape It can be closed or unclosed pipe-like shell
4226 or a pipe-like solid.
4227 theBase1, theBase2 Two bases of the supposed pipe. This
4228 should be wires or faces of theShape.
4229 theName Object name; when specified, this parameter is used
4230 for result publication in the study. Otherwise, if automatic
4231 publication is switched on, default value is used for result name.
4234 New GEOM_Object, containing an edge or wire that represent
4237 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4238 RaiseIfFailed("RestorePath", self.PrimOp)
4239 self._autoPublish(anObj, theName, "path")
4242 ## Build a middle path of a pipe-like shape.
4243 # The path shape can be a wire or an edge.
4244 # @param theShape It can be closed or unclosed pipe-like shell
4245 # or a pipe-like solid.
4246 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4247 # should be lists of edges of theShape.
4248 # @param theName Object name; when specified, this parameter is used
4249 # for result publication in the study. Otherwise, if automatic
4250 # publication is switched on, default value is used for result name.
4252 # @note It is not assumed that exact or approximate copy of theShape
4253 # can be obtained by applying existing Pipe operation on the
4254 # resulting "Path" wire taking theBase1 as the base - it is not
4255 # always possible; though in some particular cases it might work
4256 # it is not guaranteed. Thus, RestorePath function should not be
4257 # considered as an exact reverse operation of the Pipe.
4259 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4260 # source pipe's "path".
4262 # @ref tui_creation_pipe_path "Example"
4263 @ManageTransactions("PrimOp")
4264 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4266 Build a middle path of a pipe-like shape.
4267 The path shape can be a wire or an edge.
4270 theShape It can be closed or unclosed pipe-like shell
4271 or a pipe-like solid.
4272 listEdges1, listEdges2 Two bases of the supposed pipe. This
4273 should be lists of edges of theShape.
4274 theName Object name; when specified, this parameter is used
4275 for result publication in the study. Otherwise, if automatic
4276 publication is switched on, default value is used for result name.
4279 New GEOM_Object, containing an edge or wire that represent
4282 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4283 RaiseIfFailed("RestorePath", self.PrimOp)
4284 self._autoPublish(anObj, theName, "path")
4290 ## @addtogroup l3_advanced
4293 ## Create a linear edge with specified ends.
4294 # @param thePnt1 Point for the first end of edge.
4295 # @param thePnt2 Point for the second end of edge.
4296 # @param theName Object name; when specified, this parameter is used
4297 # for result publication in the study. Otherwise, if automatic
4298 # publication is switched on, default value is used for result name.
4300 # @return New GEOM.GEOM_Object, containing the created edge.
4302 # @ref tui_creation_edge "Example"
4303 @ManageTransactions("ShapesOp")
4304 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4306 Create a linear edge with specified ends.
4309 thePnt1 Point for the first end of edge.
4310 thePnt2 Point for the second end of edge.
4311 theName Object name; when specified, this parameter is used
4312 for result publication in the study. Otherwise, if automatic
4313 publication is switched on, default value is used for result name.
4316 New GEOM.GEOM_Object, containing the created edge.
4318 # Example: see GEOM_TestAll.py
4319 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4320 RaiseIfFailed("MakeEdge", self.ShapesOp)
4321 self._autoPublish(anObj, theName, "edge")
4324 ## Create a new edge, corresponding to the given length on the given curve.
4325 # @param theRefCurve The referenced curve (edge).
4326 # @param theLength Length on the referenced curve. It can be negative.
4327 # @param theStartPoint Any point can be selected for it, the new edge will begin
4328 # at the end of \a theRefCurve, close to the selected point.
4329 # If None, start from the first point of \a theRefCurve.
4330 # @param theName Object name; when specified, this parameter is used
4331 # for result publication in the study. Otherwise, if automatic
4332 # publication is switched on, default value is used for result name.
4334 # @return New GEOM.GEOM_Object, containing the created edge.
4336 # @ref tui_creation_edge "Example"
4337 @ManageTransactions("ShapesOp")
4338 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4340 Create a new edge, corresponding to the given length on the given curve.
4343 theRefCurve The referenced curve (edge).
4344 theLength Length on the referenced curve. It can be negative.
4345 theStartPoint Any point can be selected for it, the new edge will begin
4346 at the end of theRefCurve, close to the selected point.
4347 If None, start from the first point of theRefCurve.
4348 theName Object name; when specified, this parameter is used
4349 for result publication in the study. Otherwise, if automatic
4350 publication is switched on, default value is used for result name.
4353 New GEOM.GEOM_Object, containing the created edge.
4355 # Example: see GEOM_TestAll.py
4356 theLength, Parameters = ParseParameters(theLength)
4357 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4358 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4359 anObj.SetParameters(Parameters)
4360 self._autoPublish(anObj, theName, "edge")
4363 ## Create an edge from specified wire.
4364 # @param theWire source Wire
4365 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4366 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4367 # @param theName Object name; when specified, this parameter is used
4368 # for result publication in the study. Otherwise, if automatic
4369 # publication is switched on, default value is used for result name.
4371 # @return New GEOM.GEOM_Object, containing the created edge.
4373 # @ref tui_creation_edge "Example"
4374 @ManageTransactions("ShapesOp")
4375 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4377 Create an edge from specified wire.
4381 theLinearTolerance linear tolerance value (default = 1e-07)
4382 theAngularTolerance angular tolerance value (default = 1e-12)
4383 theName Object name; when specified, this parameter is used
4384 for result publication in the study. Otherwise, if automatic
4385 publication is switched on, default value is used for result name.
4388 New GEOM.GEOM_Object, containing the created edge.
4390 # Example: see GEOM_TestAll.py
4391 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4392 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4393 self._autoPublish(anObj, theName, "edge")
4396 ## Create a wire from the set of edges and wires.
4397 # @param theEdgesAndWires List of edges and/or wires.
4398 # @param theTolerance Maximum distance between vertices, that will be merged.
4399 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4400 # @param theName Object name; when specified, this parameter is used
4401 # for result publication in the study. Otherwise, if automatic
4402 # publication is switched on, default value is used for result name.
4404 # @return New GEOM.GEOM_Object, containing the created wire.
4406 # @ref tui_creation_wire "Example"
4407 @ManageTransactions("ShapesOp")
4408 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4410 Create a wire from the set of edges and wires.
4413 theEdgesAndWires List of edges and/or wires.
4414 theTolerance Maximum distance between vertices, that will be merged.
4415 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4416 theName Object name; when specified, this parameter is used
4417 for result publication in the study. Otherwise, if automatic
4418 publication is switched on, default value is used for result name.
4421 New GEOM.GEOM_Object, containing the created wire.
4423 # Example: see GEOM_TestAll.py
4424 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4425 RaiseIfFailed("MakeWire", self.ShapesOp)
4426 self._autoPublish(anObj, theName, "wire")
4429 ## Create a face on the given wire.
4430 # @param theWire closed Wire or Edge to build the face on.
4431 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4432 # If the tolerance of the obtained planar face is less
4433 # than 1e-06, this face will be returned, otherwise the
4434 # algorithm tries to build any suitable face on the given
4435 # wire and prints a warning message.
4436 # @param theName Object name; when specified, this parameter is used
4437 # for result publication in the study. Otherwise, if automatic
4438 # publication is switched on, default value is used for result name.
4440 # @return New GEOM.GEOM_Object, containing the created face.
4442 # @ref tui_creation_face "Example"
4443 @ManageTransactions("ShapesOp")
4444 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4446 Create a face on the given wire.
4449 theWire closed Wire or Edge to build the face on.
4450 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4451 If the tolerance of the obtained planar face is less
4452 than 1e-06, this face will be returned, otherwise the
4453 algorithm tries to build any suitable face on the given
4454 wire and prints a warning message.
4455 theName Object name; when specified, this parameter is used
4456 for result publication in the study. Otherwise, if automatic
4457 publication is switched on, default value is used for result name.
4460 New GEOM.GEOM_Object, containing the created face.
4462 # Example: see GEOM_TestAll.py
4463 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4464 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4465 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4467 RaiseIfFailed("MakeFace", self.ShapesOp)
4468 self._autoPublish(anObj, theName, "face")
4471 ## Create a face on the given wires set.
4472 # @param theWires List of closed wires or edges to build the face on.
4473 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4474 # If the tolerance of the obtained planar face is less
4475 # than 1e-06, this face will be returned, otherwise the
4476 # algorithm tries to build any suitable face on the given
4477 # wire and prints a warning message.
4478 # @param theName Object name; when specified, this parameter is used
4479 # for result publication in the study. Otherwise, if automatic
4480 # publication is switched on, default value is used for result name.
4482 # @return New GEOM.GEOM_Object, containing the created face.
4484 # @ref tui_creation_face "Example"
4485 @ManageTransactions("ShapesOp")
4486 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4488 Create a face on the given wires set.
4491 theWires List of closed wires or edges to build the face on.
4492 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4493 If the tolerance of the obtained planar face is less
4494 than 1e-06, this face will be returned, otherwise the
4495 algorithm tries to build any suitable face on the given
4496 wire and prints a warning message.
4497 theName Object name; when specified, this parameter is used
4498 for result publication in the study. Otherwise, if automatic
4499 publication is switched on, default value is used for result name.
4502 New GEOM.GEOM_Object, containing the created face.
4504 # Example: see GEOM_TestAll.py
4505 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4506 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4507 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4509 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4510 self._autoPublish(anObj, theName, "face")
4513 ## See MakeFaceWires() method for details.
4515 # @ref tui_creation_face "Example 1"
4516 # \n @ref swig_MakeFaces "Example 2"
4517 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4519 See geompy.MakeFaceWires() method for details.
4521 # Example: see GEOM_TestOthers.py
4522 # note: auto-publishing is done in self.MakeFaceWires()
4523 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4526 ## Create a face based on a surface from given face bounded
4528 # @param theFace the face whose surface is used to create a new face.
4529 # @param theWire the wire that will bound a new face.
4530 # @param theName Object name; when specified, this parameter is used
4531 # for result publication in the study. Otherwise, if automatic
4532 # publication is switched on, default value is used for result name.
4534 # @return New GEOM.GEOM_Object, containing the created face.
4536 # @ref tui_creation_face "Example"
4537 @ManageTransactions("ShapesOp")
4538 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4540 Create a face based on a surface from given face bounded
4544 theFace the face whose surface is used to create a new face.
4545 theWire the wire that will bound a new face.
4546 theName Object name; when specified, this parameter is used
4547 for result publication in the study. Otherwise, if automatic
4548 publication is switched on, default value is used for result name.
4551 New GEOM.GEOM_Object, containing the created face.
4553 # Example: see GEOM_TestAll.py
4554 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4555 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4556 self._autoPublish(anObj, theName, "face")
4559 ## Create a shell from the set of faces and shells.
4560 # @param theFacesAndShells List of faces and/or shells.
4561 # @param theName Object name; when specified, this parameter is used
4562 # for result publication in the study. Otherwise, if automatic
4563 # publication is switched on, default value is used for result name.
4565 # @return New GEOM.GEOM_Object, containing the created shell.
4567 # @ref tui_creation_shell "Example"
4568 @ManageTransactions("ShapesOp")
4569 def MakeShell(self, theFacesAndShells, theName=None):
4571 Create a shell from the set of faces and shells.
4574 theFacesAndShells List of faces and/or shells.
4575 theName Object name; when specified, this parameter is used
4576 for result publication in the study. Otherwise, if automatic
4577 publication is switched on, default value is used for result name.
4580 New GEOM.GEOM_Object, containing the created shell.
4582 # Example: see GEOM_TestAll.py
4583 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4584 RaiseIfFailed("MakeShell", self.ShapesOp)
4585 self._autoPublish(anObj, theName, "shell")
4588 ## Create a solid, bounded by the given shells.
4589 # @param theShells Sequence of bounding shells.
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 solid.
4596 # @ref tui_creation_solid "Example"
4597 @ManageTransactions("ShapesOp")
4598 def MakeSolid(self, theShells, theName=None):
4600 Create a solid, bounded by the given shells.
4603 theShells Sequence of bounding shells.
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 solid.
4611 # Example: see GEOM_TestAll.py
4612 theShells = ToList(theShells)
4613 if len(theShells) == 1:
4614 descr = self._IsGoodForSolid(theShells[0])
4616 # raise RuntimeError, "MakeSolidShells : " + descr
4617 if descr == "WRN_SHAPE_UNCLOSED":
4618 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4619 anObj = self.ShapesOp.MakeSolidShells(theShells)
4620 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4621 self._autoPublish(anObj, theName, "solid")
4624 ## Create a compound of the given shapes.
4625 # @param theShapes List of shapes to put in compound.
4626 # @param theName Object name; when specified, this parameter is used
4627 # for result publication in the study. Otherwise, if automatic
4628 # publication is switched on, default value is used for result name.
4630 # @return New GEOM.GEOM_Object, containing the created compound.
4632 # @ref tui_creation_compound "Example"
4633 @ManageTransactions("ShapesOp")
4634 def MakeCompound(self, theShapes, theName=None):
4636 Create a compound of the given shapes.
4639 theShapes List of shapes to put in compound.
4640 theName Object name; when specified, this parameter is used
4641 for result publication in the study. Otherwise, if automatic
4642 publication is switched on, default value is used for result name.
4645 New GEOM.GEOM_Object, containing the created compound.
4647 # Example: see GEOM_TestAll.py
4648 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
4649 RaiseIfFailed("MakeCompound", self.ShapesOp)
4650 self._autoPublish(anObj, theName, "compound")
4653 # end of l3_advanced
4656 ## @addtogroup l2_measure
4659 ## Gives quantity of faces in the given shape.
4660 # @param theShape Shape to count faces of.
4661 # @return Quantity of faces.
4663 # @ref swig_NumberOf "Example"
4664 @ManageTransactions("ShapesOp")
4665 def NumberOfFaces(self, theShape):
4667 Gives quantity of faces in the given shape.
4670 theShape Shape to count faces of.
4675 # Example: see GEOM_TestOthers.py
4676 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4677 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4680 ## Gives quantity of edges in the given shape.
4681 # @param theShape Shape to count edges of.
4682 # @return Quantity of edges.
4684 # @ref swig_NumberOf "Example"
4685 @ManageTransactions("ShapesOp")
4686 def NumberOfEdges(self, theShape):
4688 Gives quantity of edges in the given shape.
4691 theShape Shape to count edges of.
4696 # Example: see GEOM_TestOthers.py
4697 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4698 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4701 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4702 # @param theShape Shape to count sub-shapes of.
4703 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4704 # @return Quantity of sub-shapes of given type.
4706 # @ref swig_NumberOf "Example"
4707 @ManageTransactions("ShapesOp")
4708 def NumberOfSubShapes(self, theShape, theShapeType):
4710 Gives quantity of sub-shapes of type theShapeType in the given shape.
4713 theShape Shape to count sub-shapes of.
4714 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4717 Quantity of sub-shapes of given type.
4719 # Example: see GEOM_TestOthers.py
4720 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4721 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4724 ## Gives quantity of solids in the given shape.
4725 # @param theShape Shape to count solids in.
4726 # @return Quantity of solids.
4728 # @ref swig_NumberOf "Example"
4729 @ManageTransactions("ShapesOp")
4730 def NumberOfSolids(self, theShape):
4732 Gives quantity of solids in the given shape.
4735 theShape Shape to count solids in.
4740 # Example: see GEOM_TestOthers.py
4741 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4742 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4748 ## @addtogroup l3_healing
4751 ## Reverses an orientation the given shape.
4752 # @param theShape Shape to be reversed.
4753 # @param theName Object name; when specified, this parameter is used
4754 # for result publication in the study. Otherwise, if automatic
4755 # publication is switched on, default value is used for result name.
4757 # @return The reversed copy of theShape.
4759 # @ref swig_ChangeOrientation "Example"
4760 @ManageTransactions("ShapesOp")
4761 def ChangeOrientation(self, theShape, theName=None):
4763 Reverses an orientation the given shape.
4766 theShape Shape to be reversed.
4767 theName Object name; when specified, this parameter is used
4768 for result publication in the study. Otherwise, if automatic
4769 publication is switched on, default value is used for result name.
4772 The reversed copy of theShape.
4774 # Example: see GEOM_TestAll.py
4775 anObj = self.ShapesOp.ChangeOrientation(theShape)
4776 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4777 self._autoPublish(anObj, theName, "reversed")
4780 ## See ChangeOrientation() method for details.
4782 # @ref swig_OrientationChange "Example"
4783 def OrientationChange(self, theShape, theName=None):
4785 See geompy.ChangeOrientation method for details.
4787 # Example: see GEOM_TestOthers.py
4788 # note: auto-publishing is done in self.ChangeOrientation()
4789 anObj = self.ChangeOrientation(theShape, theName)
4795 ## @addtogroup l4_obtain
4798 ## Retrieve all free faces from the given shape.
4799 # Free face is a face, which is not shared between two shells of the shape.
4800 # @param theShape Shape to find free faces in.
4801 # @return List of IDs of all free faces, contained in theShape.
4803 # @ref tui_measurement_tools_page "Example"
4804 @ManageTransactions("ShapesOp")
4805 def GetFreeFacesIDs(self,theShape):
4807 Retrieve all free faces from the given shape.
4808 Free face is a face, which is not shared between two shells of the shape.
4811 theShape Shape to find free faces in.
4814 List of IDs of all free faces, contained in theShape.
4816 # Example: see GEOM_TestOthers.py
4817 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4818 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4821 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4822 # @param theShape1 Shape to find sub-shapes in.
4823 # @param theShape2 Shape to find shared sub-shapes with.
4824 # @param theShapeType Type of sub-shapes to be retrieved.
4825 # @param theName Object name; when specified, this parameter is used
4826 # for result publication in the study. Otherwise, if automatic
4827 # publication is switched on, default value is used for result name.
4829 # @return List of sub-shapes of theShape1, shared with theShape2.
4831 # @ref swig_GetSharedShapes "Example"
4832 @ManageTransactions("ShapesOp")
4833 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4835 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4838 theShape1 Shape to find sub-shapes in.
4839 theShape2 Shape to find shared sub-shapes with.
4840 theShapeType Type of sub-shapes to be retrieved.
4841 theName Object name; when specified, this parameter is used
4842 for result publication in the study. Otherwise, if automatic
4843 publication is switched on, default value is used for result name.
4846 List of sub-shapes of theShape1, shared with theShape2.
4848 # Example: see GEOM_TestOthers.py
4849 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4850 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4851 self._autoPublish(aList, theName, "shared")
4854 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4855 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
4856 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
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 objects, that are sub-shapes of all given shapes.
4863 # @ref swig_GetSharedShapes "Example"
4864 @ManageTransactions("ShapesOp")
4865 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4867 Get all sub-shapes, shared by all shapes in the list theShapes.
4870 theShapes Either a list or compound of shapes to find common sub-shapes of.
4871 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4872 theName Object name; when specified, this parameter is used
4873 for result publication in the study. Otherwise, if automatic
4874 publication is switched on, default value is used for result name.
4877 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4879 # Example: see GEOM_TestOthers.py
4880 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType)
4881 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4882 self._autoPublish(aList, theName, "shared")
4885 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4886 # situated relatively the specified plane by the certain way,
4887 # defined through <VAR>theState</VAR> parameter.
4888 # @param theShape Shape to find sub-shapes of.
4889 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4890 # @param theAx1 Vector (or line, or linear edge), specifying normal
4891 # direction and location of the plane to find shapes on.
4892 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4893 # @param theName Object name; when specified, this parameter is used
4894 # for result publication in the study. Otherwise, if automatic
4895 # publication is switched on, default value is used for result name.
4897 # @return List of all found sub-shapes.
4899 # @ref swig_GetShapesOnPlane "Example"
4900 @ManageTransactions("ShapesOp")
4901 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4903 Find in theShape all sub-shapes of type theShapeType,
4904 situated relatively the specified plane by the certain way,
4905 defined through theState parameter.
4908 theShape Shape to find sub-shapes of.
4909 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4910 theAx1 Vector (or line, or linear edge), specifying normal
4911 direction and location of the plane to find shapes on.
4912 theState The state of the sub-shapes to find (see GEOM::shape_state)
4913 theName Object name; when specified, this parameter is used
4914 for result publication in the study. Otherwise, if automatic
4915 publication is switched on, default value is used for result name.
4918 List of all found sub-shapes.
4920 # Example: see GEOM_TestOthers.py
4921 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4922 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4923 self._autoPublish(aList, theName, "shapeOnPlane")
4926 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4927 # situated relatively the specified plane by the certain way,
4928 # defined through <VAR>theState</VAR> parameter.
4929 # @param theShape Shape to find sub-shapes of.
4930 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4931 # @param theAx1 Vector (or line, or linear edge), specifying normal
4932 # direction and location of the plane to find shapes on.
4933 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4935 # @return List of all found sub-shapes indices.
4937 # @ref swig_GetShapesOnPlaneIDs "Example"
4938 @ManageTransactions("ShapesOp")
4939 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4941 Find in theShape all sub-shapes of type theShapeType,
4942 situated relatively the specified plane by the certain way,
4943 defined through theState parameter.
4946 theShape Shape to find sub-shapes of.
4947 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4948 theAx1 Vector (or line, or linear edge), specifying normal
4949 direction and location of the plane to find shapes on.
4950 theState The state of the sub-shapes to find (see GEOM::shape_state)
4953 List of all found sub-shapes indices.
4955 # Example: see GEOM_TestOthers.py
4956 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4957 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4960 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4961 # situated relatively the specified plane by the certain way,
4962 # defined through <VAR>theState</VAR> parameter.
4963 # @param theShape Shape to find sub-shapes of.
4964 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4965 # @param theAx1 Vector (or line, or linear edge), specifying normal
4966 # direction of the plane to find shapes on.
4967 # @param thePnt Point specifying location of the plane to find shapes on.
4968 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4969 # @param theName Object name; when specified, this parameter is used
4970 # for result publication in the study. Otherwise, if automatic
4971 # publication is switched on, default value is used for result name.
4973 # @return List of all found sub-shapes.
4975 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4976 @ManageTransactions("ShapesOp")
4977 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4979 Find in theShape all sub-shapes of type theShapeType,
4980 situated relatively the specified plane by the certain way,
4981 defined through theState parameter.
4984 theShape Shape to find sub-shapes of.
4985 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4986 theAx1 Vector (or line, or linear edge), specifying normal
4987 direction and location of the plane to find shapes on.
4988 thePnt Point specifying location of the plane to find shapes on.
4989 theState The state of the sub-shapes to find (see GEOM::shape_state)
4990 theName Object name; when specified, this parameter is used
4991 for result publication in the study. Otherwise, if automatic
4992 publication is switched on, default value is used for result name.
4995 List of all found sub-shapes.
4997 # Example: see GEOM_TestOthers.py
4998 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4999 theAx1, thePnt, theState)
5000 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5001 self._autoPublish(aList, theName, "shapeOnPlane")
5004 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5005 # situated relatively the specified plane by the certain way,
5006 # defined through <VAR>theState</VAR> parameter.
5007 # @param theShape Shape to find sub-shapes of.
5008 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5009 # @param theAx1 Vector (or line, or linear edge), specifying normal
5010 # direction of the plane to find shapes on.
5011 # @param thePnt Point specifying location of the plane to find shapes on.
5012 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5014 # @return List of all found sub-shapes indices.
5016 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5017 @ManageTransactions("ShapesOp")
5018 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5020 Find in theShape all sub-shapes of type theShapeType,
5021 situated relatively the specified plane by the certain way,
5022 defined through theState parameter.
5025 theShape Shape to find sub-shapes of.
5026 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5027 theAx1 Vector (or line, or linear edge), specifying normal
5028 direction and location of the plane to find shapes on.
5029 thePnt Point specifying location of the plane to find shapes on.
5030 theState The state of the sub-shapes to find (see GEOM::shape_state)
5033 List of all found sub-shapes indices.
5035 # Example: see GEOM_TestOthers.py
5036 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5037 theAx1, thePnt, theState)
5038 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5041 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5042 # the specified cylinder by the certain way, defined through \a theState parameter.
5043 # @param theShape Shape to find sub-shapes of.
5044 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5045 # @param theAxis Vector (or line, or linear edge), specifying
5046 # axis of the cylinder to find shapes on.
5047 # @param theRadius Radius of the cylinder to find shapes on.
5048 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5049 # @param theName Object name; when specified, this parameter is used
5050 # for result publication in the study. Otherwise, if automatic
5051 # publication is switched on, default value is used for result name.
5053 # @return List of all found sub-shapes.
5055 # @ref swig_GetShapesOnCylinder "Example"
5056 @ManageTransactions("ShapesOp")
5057 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5059 Find in theShape all sub-shapes of type theShapeType, situated relatively
5060 the specified cylinder by the certain way, defined through theState parameter.
5063 theShape Shape to find sub-shapes of.
5064 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5065 theAxis Vector (or line, or linear edge), specifying
5066 axis of the cylinder to find shapes on.
5067 theRadius Radius of the cylinder to find shapes on.
5068 theState The state of the sub-shapes to find (see GEOM::shape_state)
5069 theName Object name; when specified, this parameter is used
5070 for result publication in the study. Otherwise, if automatic
5071 publication is switched on, default value is used for result name.
5074 List of all found sub-shapes.
5076 # Example: see GEOM_TestOthers.py
5077 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5078 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5079 self._autoPublish(aList, theName, "shapeOnCylinder")
5082 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5083 # the specified cylinder by the certain way, defined through \a theState parameter.
5084 # @param theShape Shape to find sub-shapes of.
5085 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5086 # @param theAxis Vector (or line, or linear edge), specifying
5087 # axis of the cylinder to find shapes on.
5088 # @param theRadius Radius of the cylinder to find shapes on.
5089 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5091 # @return List of all found sub-shapes indices.
5093 # @ref swig_GetShapesOnCylinderIDs "Example"
5094 @ManageTransactions("ShapesOp")
5095 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5097 Find in theShape all sub-shapes of type theShapeType, situated relatively
5098 the specified cylinder by the certain way, defined through theState parameter.
5101 theShape Shape to find sub-shapes of.
5102 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5103 theAxis Vector (or line, or linear edge), specifying
5104 axis of the cylinder to find shapes on.
5105 theRadius Radius of the cylinder to find shapes on.
5106 theState The state of the sub-shapes to find (see GEOM::shape_state)
5109 List of all found sub-shapes indices.
5111 # Example: see GEOM_TestOthers.py
5112 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5113 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5116 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5117 # the specified cylinder by the certain way, defined through \a theState parameter.
5118 # @param theShape Shape to find sub-shapes of.
5119 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5120 # @param theAxis Vector (or line, or linear edge), specifying
5121 # axis of the cylinder to find shapes on.
5122 # @param thePnt Point specifying location of the bottom of the cylinder.
5123 # @param theRadius Radius of the cylinder to find shapes on.
5124 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5125 # @param theName Object name; when specified, this parameter is used
5126 # for result publication in the study. Otherwise, if automatic
5127 # publication is switched on, default value is used for result name.
5129 # @return List of all found sub-shapes.
5131 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5132 @ManageTransactions("ShapesOp")
5133 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5135 Find in theShape all sub-shapes of type theShapeType, situated relatively
5136 the specified cylinder by the certain way, defined through theState parameter.
5139 theShape Shape to find sub-shapes of.
5140 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5141 theAxis Vector (or line, or linear edge), specifying
5142 axis of the cylinder to find shapes on.
5143 theRadius Radius of the cylinder to find shapes on.
5144 theState The state of the sub-shapes to find (see GEOM::shape_state)
5145 theName Object name; when specified, this parameter is used
5146 for result publication in the study. Otherwise, if automatic
5147 publication is switched on, default value is used for result name.
5150 List of all found sub-shapes.
5152 # Example: see GEOM_TestOthers.py
5153 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5154 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5155 self._autoPublish(aList, theName, "shapeOnCylinder")
5158 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5159 # the specified cylinder by the certain way, defined through \a theState parameter.
5160 # @param theShape Shape to find sub-shapes of.
5161 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5162 # @param theAxis Vector (or line, or linear edge), specifying
5163 # axis of the cylinder to find shapes on.
5164 # @param thePnt Point specifying location of the bottom of the cylinder.
5165 # @param theRadius Radius of the cylinder to find shapes on.
5166 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5168 # @return List of all found sub-shapes indices
5170 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5171 @ManageTransactions("ShapesOp")
5172 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5174 Find in theShape all sub-shapes of type theShapeType, situated relatively
5175 the specified cylinder 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 theAxis Vector (or line, or linear edge), specifying
5181 axis of the cylinder to find shapes on.
5182 theRadius Radius of the cylinder to find shapes on.
5183 theState The state of the sub-shapes to find (see GEOM::shape_state)
5186 List of all found sub-shapes indices.
5188 # Example: see GEOM_TestOthers.py
5189 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5190 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5193 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5194 # the specified sphere by the certain way, defined through \a theState parameter.
5195 # @param theShape Shape to find sub-shapes of.
5196 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5197 # @param theCenter Point, specifying center of the sphere to find shapes on.
5198 # @param theRadius Radius of the sphere to find shapes on.
5199 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5200 # @param theName Object name; when specified, this parameter is used
5201 # for result publication in the study. Otherwise, if automatic
5202 # publication is switched on, default value is used for result name.
5204 # @return List of all found sub-shapes.
5206 # @ref swig_GetShapesOnSphere "Example"
5207 @ManageTransactions("ShapesOp")
5208 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
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)
5219 theName Object name; when specified, this parameter is used
5220 for result publication in the study. Otherwise, if automatic
5221 publication is switched on, default value is used for result name.
5224 List of all found sub-shapes.
5226 # Example: see GEOM_TestOthers.py
5227 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5228 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5229 self._autoPublish(aList, theName, "shapeOnSphere")
5232 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5233 # the specified sphere by the certain way, defined through \a theState parameter.
5234 # @param theShape Shape to find sub-shapes of.
5235 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5236 # @param theCenter Point, specifying center of the sphere to find shapes on.
5237 # @param theRadius Radius of the sphere to find shapes on.
5238 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5240 # @return List of all found sub-shapes indices.
5242 # @ref swig_GetShapesOnSphereIDs "Example"
5243 @ManageTransactions("ShapesOp")
5244 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5246 Find in theShape all sub-shapes of type theShapeType, situated relatively
5247 the specified sphere by the certain way, defined through theState parameter.
5250 theShape Shape to find sub-shapes of.
5251 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5252 theCenter Point, specifying center of the sphere to find shapes on.
5253 theRadius Radius of the sphere to find shapes on.
5254 theState The state of the sub-shapes to find (see GEOM::shape_state)
5257 List of all found sub-shapes indices.
5259 # Example: see GEOM_TestOthers.py
5260 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5261 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5264 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5265 # the specified quadrangle by the certain way, defined through \a theState parameter.
5266 # @param theShape Shape to find sub-shapes of.
5267 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5268 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5269 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5270 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5271 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5272 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5273 # @param theName Object name; when specified, this parameter is used
5274 # for result publication in the study. Otherwise, if automatic
5275 # publication is switched on, default value is used for result name.
5277 # @return List of all found sub-shapes.
5279 # @ref swig_GetShapesOnQuadrangle "Example"
5280 @ManageTransactions("ShapesOp")
5281 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5282 theTopLeftPoint, theTopRigthPoint,
5283 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5285 Find in theShape all sub-shapes of type theShapeType, situated relatively
5286 the specified quadrangle by the certain way, defined through theState parameter.
5289 theShape Shape to find sub-shapes of.
5290 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5291 theTopLeftPoint Point, specifying top left corner of a quadrangle
5292 theTopRigthPoint Point, specifying top right corner of a quadrangle
5293 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5294 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5295 theState The state of the sub-shapes to find (see GEOM::shape_state)
5296 theName Object name; when specified, this parameter is used
5297 for result publication in the study. Otherwise, if automatic
5298 publication is switched on, default value is used for result name.
5301 List of all found sub-shapes.
5303 # Example: see GEOM_TestOthers.py
5304 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5305 theTopLeftPoint, theTopRigthPoint,
5306 theBottomLeftPoint, theBottomRigthPoint, theState)
5307 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5308 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5311 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5312 # the specified quadrangle by the certain way, defined through \a theState parameter.
5313 # @param theShape Shape to find sub-shapes of.
5314 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5315 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5316 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5317 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5318 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5319 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5321 # @return List of all found sub-shapes indices.
5323 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5324 @ManageTransactions("ShapesOp")
5325 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5326 theTopLeftPoint, theTopRigthPoint,
5327 theBottomLeftPoint, theBottomRigthPoint, theState):
5329 Find in theShape all sub-shapes of type theShapeType, situated relatively
5330 the specified quadrangle by the certain way, defined through theState parameter.
5333 theShape Shape to find sub-shapes of.
5334 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5335 theTopLeftPoint Point, specifying top left corner of a quadrangle
5336 theTopRigthPoint Point, specifying top right corner of a quadrangle
5337 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5338 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5339 theState The state of the sub-shapes to find (see GEOM::shape_state)
5342 List of all found sub-shapes indices.
5345 # Example: see GEOM_TestOthers.py
5346 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5347 theTopLeftPoint, theTopRigthPoint,
5348 theBottomLeftPoint, theBottomRigthPoint, theState)
5349 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5352 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5353 # the specified \a theBox by the certain way, defined through \a theState parameter.
5354 # @param theBox Shape for relative comparing.
5355 # @param theShape Shape to find sub-shapes of.
5356 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5357 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5358 # @param theName Object name; when specified, this parameter is used
5359 # for result publication in the study. Otherwise, if automatic
5360 # publication is switched on, default value is used for result name.
5362 # @return List of all found sub-shapes.
5364 # @ref swig_GetShapesOnBox "Example"
5365 @ManageTransactions("ShapesOp")
5366 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5368 Find in theShape all sub-shapes of type theShapeType, situated relatively
5369 the specified theBox by the certain way, defined through theState parameter.
5372 theBox Shape for relative comparing.
5373 theShape Shape to find sub-shapes of.
5374 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5375 theState The state of the sub-shapes to find (see GEOM::shape_state)
5376 theName Object name; when specified, this parameter is used
5377 for result publication in the study. Otherwise, if automatic
5378 publication is switched on, default value is used for result name.
5381 List of all found sub-shapes.
5383 # Example: see GEOM_TestOthers.py
5384 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5385 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5386 self._autoPublish(aList, theName, "shapeOnBox")
5389 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5390 # the specified \a theBox by the certain way, defined through \a theState parameter.
5391 # @param theBox Shape for relative comparing.
5392 # @param theShape Shape to find sub-shapes of.
5393 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5394 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5396 # @return List of all found sub-shapes indices.
5398 # @ref swig_GetShapesOnBoxIDs "Example"
5399 @ManageTransactions("ShapesOp")
5400 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5402 Find in theShape all sub-shapes of type theShapeType, situated relatively
5403 the specified theBox by the certain way, defined through theState parameter.
5406 theBox Shape for relative comparing.
5407 theShape Shape to find sub-shapes of.
5408 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5409 theState The state of the sub-shapes to find (see GEOM::shape_state)
5412 List of all found sub-shapes indices.
5414 # Example: see GEOM_TestOthers.py
5415 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5416 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5419 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5420 # situated relatively the specified \a theCheckShape by the
5421 # certain way, defined through \a theState parameter.
5422 # @param theCheckShape Shape for relative comparing. It must be a solid.
5423 # @param theShape Shape to find sub-shapes of.
5424 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5425 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5426 # @param theName Object name; when specified, this parameter is used
5427 # for result publication in the study. Otherwise, if automatic
5428 # publication is switched on, default value is used for result name.
5430 # @return List of all found sub-shapes.
5432 # @ref swig_GetShapesOnShape "Example"
5433 @ManageTransactions("ShapesOp")
5434 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5436 Find in theShape all sub-shapes of type theShapeType,
5437 situated relatively the specified theCheckShape by the
5438 certain way, defined through theState parameter.
5441 theCheckShape Shape for relative comparing. It must be a solid.
5442 theShape Shape to find sub-shapes of.
5443 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5444 theState The state of the sub-shapes to find (see GEOM::shape_state)
5445 theName Object name; when specified, this parameter is used
5446 for result publication in the study. Otherwise, if automatic
5447 publication is switched on, default value is used for result name.
5450 List of all found sub-shapes.
5452 # Example: see GEOM_TestOthers.py
5453 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5454 theShapeType, theState)
5455 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5456 self._autoPublish(aList, theName, "shapeOnShape")
5459 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5460 # situated relatively the specified \a theCheckShape by the
5461 # certain way, defined through \a theState parameter.
5462 # @param theCheckShape Shape for relative comparing. It must be a solid.
5463 # @param theShape Shape to find sub-shapes of.
5464 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5465 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5466 # @param theName Object name; when specified, this parameter is used
5467 # for result publication in the study. Otherwise, if automatic
5468 # publication is switched on, default value is used for result name.
5470 # @return All found sub-shapes as compound.
5472 # @ref swig_GetShapesOnShapeAsCompound "Example"
5473 @ManageTransactions("ShapesOp")
5474 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5476 Find in theShape all sub-shapes of type theShapeType,
5477 situated relatively the specified theCheckShape by the
5478 certain way, defined through theState parameter.
5481 theCheckShape Shape for relative comparing. It must be a solid.
5482 theShape Shape to find sub-shapes of.
5483 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5484 theState The state of the sub-shapes to find (see GEOM::shape_state)
5485 theName Object name; when specified, this parameter is used
5486 for result publication in the study. Otherwise, if automatic
5487 publication is switched on, default value is used for result name.
5490 All found sub-shapes as compound.
5492 # Example: see GEOM_TestOthers.py
5493 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5494 theShapeType, theState)
5495 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5496 self._autoPublish(anObj, theName, "shapeOnShape")
5499 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5500 # situated relatively the specified \a theCheckShape by the
5501 # certain way, defined through \a theState parameter.
5502 # @param theCheckShape Shape for relative comparing. It must be a solid.
5503 # @param theShape Shape to find sub-shapes of.
5504 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5505 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5507 # @return List of all found sub-shapes indices.
5509 # @ref swig_GetShapesOnShapeIDs "Example"
5510 @ManageTransactions("ShapesOp")
5511 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5513 Find in theShape all sub-shapes of type theShapeType,
5514 situated relatively the specified theCheckShape by the
5515 certain way, defined through theState parameter.
5518 theCheckShape Shape for relative comparing. It must be a solid.
5519 theShape Shape to find sub-shapes of.
5520 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5521 theState The state of the sub-shapes to find (see GEOM::shape_state)
5524 List of all found sub-shapes indices.
5526 # Example: see GEOM_TestOthers.py
5527 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5528 theShapeType, theState)
5529 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5532 ## Get sub-shape(s) of theShapeWhere, which are
5533 # coincident with \a theShapeWhat or could be a part of it.
5534 # @param theShapeWhere Shape to find sub-shapes of.
5535 # @param theShapeWhat Shape, specifying what to find.
5536 # @param isNewImplementation implementation of GetInPlace functionality
5537 # (default = False, old alghorithm based on shape properties)
5538 # @param theName Object name; when specified, this parameter is used
5539 # for result publication in the study. Otherwise, if automatic
5540 # publication is switched on, default value is used for result name.
5542 # @return Group of all found sub-shapes or a single found sub-shape.
5544 # @note This function has a restriction on argument shapes.
5545 # If \a theShapeWhere has curved parts with significantly
5546 # outstanding centres (i.e. the mass centre of a part is closer to
5547 # \a theShapeWhat than to the part), such parts will not be found.
5548 # @image html get_in_place_lost_part.png
5550 # @ref swig_GetInPlace "Example"
5551 @ManageTransactions("ShapesOp")
5552 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5554 Get sub-shape(s) of theShapeWhere, which are
5555 coincident with theShapeWhat or could be a part of it.
5558 theShapeWhere Shape to find sub-shapes of.
5559 theShapeWhat Shape, specifying what to find.
5560 isNewImplementation Implementation of GetInPlace functionality
5561 (default = False, old alghorithm based on shape properties)
5562 theName Object name; when specified, this parameter is used
5563 for result publication in the study. Otherwise, if automatic
5564 publication is switched on, default value is used for result name.
5567 Group of all found sub-shapes or a single found sub-shape.
5571 This function has a restriction on argument shapes.
5572 If theShapeWhere has curved parts with significantly
5573 outstanding centres (i.e. the mass centre of a part is closer to
5574 theShapeWhat than to the part), such parts will not be found.
5576 # Example: see GEOM_TestOthers.py
5578 if isNewImplementation:
5579 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5581 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5583 RaiseIfFailed("GetInPlace", self.ShapesOp)
5584 self._autoPublish(anObj, theName, "inplace")
5587 ## Get sub-shape(s) of \a theShapeWhere, which are
5588 # coincident with \a theShapeWhat or could be a part of it.
5590 # Implementation of this method is based on a saved history of an operation,
5591 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5592 # arguments (an argument shape or a sub-shape of an argument shape).
5593 # The operation could be the Partition or one of boolean operations,
5594 # performed on simple shapes (not on compounds).
5596 # @param theShapeWhere Shape to find sub-shapes of.
5597 # @param theShapeWhat Shape, specifying what to find (must be in the
5598 # building history of the ShapeWhere).
5599 # @param theName Object name; when specified, this parameter is used
5600 # for result publication in the study. Otherwise, if automatic
5601 # publication is switched on, default value is used for result name.
5603 # @return Group of all found sub-shapes or a single found sub-shape.
5605 # @ref swig_GetInPlace "Example"
5606 @ManageTransactions("ShapesOp")
5607 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5609 Implementation of this method is based on a saved history of an operation,
5610 produced theShapeWhere. The theShapeWhat must be among this operation's
5611 arguments (an argument shape or a sub-shape of an argument shape).
5612 The operation could be the Partition or one of boolean operations,
5613 performed on simple shapes (not on compounds).
5616 theShapeWhere Shape to find sub-shapes of.
5617 theShapeWhat Shape, specifying what to find (must be in the
5618 building history of the ShapeWhere).
5619 theName Object name; when specified, this parameter is used
5620 for result publication in the study. Otherwise, if automatic
5621 publication is switched on, default value is used for result name.
5624 Group of all found sub-shapes or a single found sub-shape.
5626 # Example: see GEOM_TestOthers.py
5627 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5628 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5629 self._autoPublish(anObj, theName, "inplace")
5632 ## Get sub-shape of theShapeWhere, which is
5633 # equal to \a theShapeWhat.
5634 # @param theShapeWhere Shape to find sub-shape of.
5635 # @param theShapeWhat Shape, specifying what to find.
5636 # @param theName Object name; when specified, this parameter is used
5637 # for result publication in the study. Otherwise, if automatic
5638 # publication is switched on, default value is used for result name.
5640 # @return New GEOM.GEOM_Object for found sub-shape.
5642 # @ref swig_GetSame "Example"
5643 @ManageTransactions("ShapesOp")
5644 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5646 Get sub-shape of theShapeWhere, which is
5647 equal to theShapeWhat.
5650 theShapeWhere Shape to find sub-shape of.
5651 theShapeWhat Shape, specifying what to find.
5652 theName Object name; when specified, this parameter is used
5653 for result publication in the study. Otherwise, if automatic
5654 publication is switched on, default value is used for result name.
5657 New GEOM.GEOM_Object for found sub-shape.
5659 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5660 RaiseIfFailed("GetSame", self.ShapesOp)
5661 self._autoPublish(anObj, theName, "sameShape")
5665 ## Get sub-shape indices of theShapeWhere, which is
5666 # equal to \a theShapeWhat.
5667 # @param theShapeWhere Shape to find sub-shape of.
5668 # @param theShapeWhat Shape, specifying what to find.
5669 # @return List of all found sub-shapes indices.
5671 # @ref swig_GetSame "Example"
5672 @ManageTransactions("ShapesOp")
5673 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5675 Get sub-shape indices of theShapeWhere, which is
5676 equal to theShapeWhat.
5679 theShapeWhere Shape to find sub-shape of.
5680 theShapeWhat Shape, specifying what to find.
5683 List of all found sub-shapes indices.
5685 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5686 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5689 ## Resize the input edge with the new Min and Max parameters.
5690 # The input edge parameters range is [0, 1]. If theMin parameter is
5691 # negative, the input edge is extended, otherwise it is shrinked by
5692 # theMin parameter. If theMax is greater than 1, the edge is extended,
5693 # otherwise it is shrinked by theMax parameter.
5694 # @param theEdge the input edge to be resized.
5695 # @param theMin the minimal parameter value.
5696 # @param theMax the maximal parameter value.
5697 # @param theName Object name; when specified, this parameter is used
5698 # for result publication in the study. Otherwise, if automatic
5699 # publication is switched on, default value is used for result name.
5700 # @return New GEOM.GEOM_Object, containing the created edge.
5702 # @ref tui_extend "Example"
5703 @ManageTransactions("ShapesOp")
5704 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
5706 Resize the input edge with the new Min and Max parameters.
5707 The input edge parameters range is [0, 1]. If theMin parameter is
5708 negative, the input edge is extended, otherwise it is shrinked by
5709 theMin parameter. If theMax is greater than 1, the edge is extended,
5710 otherwise it is shrinked by theMax parameter.
5713 theEdge the input edge to be resized.
5714 theMin the minimal parameter value.
5715 theMax the maximal parameter value.
5716 theName Object name; when specified, this parameter is used
5717 for result publication in the study. Otherwise, if automatic
5718 publication is switched on, default value is used for result name.
5721 New GEOM.GEOM_Object, containing the created edge.
5723 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
5724 RaiseIfFailed("ExtendEdge", self.ShapesOp)
5725 self._autoPublish(anObj, theName, "edge")
5728 ## Resize the input face with the new UMin, UMax, VMin and VMax
5729 # parameters. The input face U and V parameters range is [0, 1]. If
5730 # theUMin parameter is negative, the input face is extended, otherwise
5731 # it is shrinked along U direction by theUMin parameter. If theUMax is
5732 # greater than 1, the face is extended, otherwise it is shrinked along
5733 # U direction by theUMax parameter. So as for theVMin, theVMax and
5734 # V direction of the input face.
5735 # @param theFace the input face to be resized.
5736 # @param theUMin the minimal U parameter value.
5737 # @param theUMax the maximal U parameter value.
5738 # @param theVMin the minimal V parameter value.
5739 # @param theVMax the maximal V parameter value.
5740 # @param theName Object name; when specified, this parameter is used
5741 # for result publication in the study. Otherwise, if automatic
5742 # publication is switched on, default value is used for result name.
5743 # @return New GEOM.GEOM_Object, containing the created face.
5745 # @ref tui_extend "Example"
5746 @ManageTransactions("ShapesOp")
5747 def ExtendFace(self, theFace, theUMin, theUMax,
5748 theVMin, theVMax, theName=None):
5750 Resize the input face with the new UMin, UMax, VMin and VMax
5751 parameters. The input face U and V parameters range is [0, 1]. If
5752 theUMin parameter is negative, the input face is extended, otherwise
5753 it is shrinked along U direction by theUMin parameter. If theUMax is
5754 greater than 1, the face is extended, otherwise it is shrinked along
5755 U direction by theUMax parameter. So as for theVMin, theVMax and
5756 V direction of the input face.
5759 theFace the input face to be resized.
5760 theUMin the minimal U parameter value.
5761 theUMax the maximal U parameter value.
5762 theVMin the minimal V parameter value.
5763 theVMax the maximal V parameter value.
5764 theName Object name; when specified, this parameter is used
5765 for result publication in the study. Otherwise, if automatic
5766 publication is switched on, default value is used for result name.
5769 New GEOM.GEOM_Object, containing the created face.
5771 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
5773 RaiseIfFailed("ExtendFace", self.ShapesOp)
5774 self._autoPublish(anObj, theName, "face")
5777 ## This function takes some face as input parameter and creates new
5778 # GEOM_Object, i.e. topological shape by extracting underlying surface
5779 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
5780 # parameters of the source face (in the parametrical space).
5781 # @param theFace the input face.
5782 # @param theName Object name; when specified, this parameter is used
5783 # for result publication in the study. Otherwise, if automatic
5784 # publication is switched on, default value is used for result name.
5785 # @return New GEOM.GEOM_Object, containing the created face.
5787 # @ref tui_creation_surface "Example"
5788 @ManageTransactions("ShapesOp")
5789 def MakeSurfaceFromFace(self, theFace, theName=None):
5791 This function takes some face as input parameter and creates new
5792 GEOM_Object, i.e. topological shape by extracting underlying surface
5793 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
5794 parameters of the source face (in the parametrical space).
5797 theFace the input face.
5798 theName Object name; when specified, this parameter is used
5799 for result publication in the study. Otherwise, if automatic
5800 publication is switched on, default value is used for result name.
5803 New GEOM.GEOM_Object, containing the created face.
5805 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
5806 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
5807 self._autoPublish(anObj, theName, "surface")
5813 ## @addtogroup l4_access
5816 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5817 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5818 # @param aShape Shape to get sub-shape of.
5819 # @param ListOfID List of sub-shapes indices.
5820 # @param theName Object name; when specified, this parameter is used
5821 # for result publication in the study. Otherwise, if automatic
5822 # publication is switched on, default value is used for result name.
5824 # @return Found sub-shape.
5826 # @ref swig_all_decompose "Example"
5827 def GetSubShape(self, aShape, ListOfID, theName=None):
5829 Obtain a composite sub-shape of aShape, composed from sub-shapes
5830 of aShape, selected by their unique IDs inside aShape
5833 aShape Shape to get sub-shape of.
5834 ListOfID List of sub-shapes indices.
5835 theName Object name; when specified, this parameter is used
5836 for result publication in the study. Otherwise, if automatic
5837 publication is switched on, default value is used for result name.
5842 # Example: see GEOM_TestAll.py
5843 anObj = self.AddSubShape(aShape,ListOfID)
5844 self._autoPublish(anObj, theName, "subshape")
5847 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5848 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5849 # @param aShape Shape to get sub-shape of.
5850 # @param aSubShape Sub-shapes of aShape.
5851 # @return ID of found sub-shape.
5853 # @ref swig_all_decompose "Example"
5854 @ManageTransactions("LocalOp")
5855 def GetSubShapeID(self, aShape, aSubShape):
5857 Obtain unique ID of sub-shape aSubShape inside aShape
5858 of aShape, selected by their unique IDs inside aShape
5861 aShape Shape to get sub-shape of.
5862 aSubShape Sub-shapes of aShape.
5865 ID of found sub-shape.
5867 # Example: see GEOM_TestAll.py
5868 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5869 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5872 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5873 # This function is provided for performance purpose. The complexity is O(n) with n
5874 # the number of subobjects of aShape
5875 # @param aShape Shape to get sub-shape of.
5876 # @param aSubShapes Sub-shapes of aShape.
5877 # @return list of IDs of found sub-shapes.
5879 # @ref swig_all_decompose "Example"
5880 @ManageTransactions("ShapesOp")
5881 def GetSubShapesIDs(self, aShape, aSubShapes):
5883 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5884 This function is provided for performance purpose. The complexity is O(n) with n
5885 the number of subobjects of aShape
5888 aShape Shape to get sub-shape of.
5889 aSubShapes Sub-shapes of aShape.
5892 List of IDs of found sub-shape.
5894 # Example: see GEOM_TestAll.py
5895 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5896 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5902 ## @addtogroup l4_decompose
5905 ## Get all sub-shapes and groups of \a theShape,
5906 # that were created already by any other methods.
5907 # @param theShape Any shape.
5908 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5909 # returned, else all found sub-shapes and groups.
5910 # @return List of existing sub-objects of \a theShape.
5912 # @ref swig_all_decompose "Example"
5913 @ManageTransactions("ShapesOp")
5914 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5916 Get all sub-shapes and groups of theShape,
5917 that were created already by any other methods.
5921 theGroupsOnly If this parameter is TRUE, only groups will be
5922 returned, else all found sub-shapes and groups.
5925 List of existing sub-objects of theShape.
5927 # Example: see GEOM_TestAll.py
5928 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5929 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5932 ## Get all groups of \a theShape,
5933 # that were created already by any other methods.
5934 # @param theShape Any shape.
5935 # @return List of existing groups of \a theShape.
5937 # @ref swig_all_decompose "Example"
5938 @ManageTransactions("ShapesOp")
5939 def GetGroups(self, theShape):
5941 Get all groups of theShape,
5942 that were created already by any other methods.
5948 List of existing groups of theShape.
5950 # Example: see GEOM_TestAll.py
5951 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5952 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5955 ## Explode a shape on sub-shapes of a given type.
5956 # If the shape itself matches the type, it is also returned.
5957 # @param aShape Shape to be exploded.
5958 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5959 # @param theName Object name; when specified, this parameter is used
5960 # for result publication in the study. Otherwise, if automatic
5961 # publication is switched on, default value is used for result name.
5963 # @return List of sub-shapes of type theShapeType, contained in theShape.
5965 # @ref swig_all_decompose "Example"
5966 @ManageTransactions("ShapesOp")
5967 def SubShapeAll(self, aShape, aType, theName=None):
5969 Explode a shape on sub-shapes of a given type.
5970 If the shape itself matches the type, it is also returned.
5973 aShape Shape to be exploded.
5974 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5975 theName Object name; when specified, this parameter is used
5976 for result publication in the study. Otherwise, if automatic
5977 publication is switched on, default value is used for result name.
5980 List of sub-shapes of type theShapeType, contained in theShape.
5982 # Example: see GEOM_TestAll.py
5983 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5984 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5985 self._autoPublish(ListObj, theName, "subshape")
5988 ## Explode a shape on sub-shapes of a given type.
5989 # @param aShape Shape to be exploded.
5990 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5991 # @return List of IDs of sub-shapes.
5993 # @ref swig_all_decompose "Example"
5994 @ManageTransactions("ShapesOp")
5995 def SubShapeAllIDs(self, aShape, aType):
5997 Explode a shape on sub-shapes of a given type.
6000 aShape Shape to be exploded (see geompy.ShapeType)
6001 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6004 List of IDs of sub-shapes.
6006 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6007 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6010 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6011 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6012 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6013 # @param aShape Shape to get sub-shape of.
6014 # @param ListOfInd List of sub-shapes indices.
6015 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6016 # @param theName Object name; when specified, this parameter is used
6017 # for result publication in the study. Otherwise, if automatic
6018 # publication is switched on, default value is used for result name.
6020 # @return A compound of sub-shapes of aShape.
6022 # @ref swig_all_decompose "Example"
6023 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6025 Obtain a compound of sub-shapes of aShape,
6026 selected by their indices in list of all sub-shapes of type aType.
6027 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6030 aShape Shape to get sub-shape of.
6031 ListOfID List of sub-shapes indices.
6032 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6033 theName Object name; when specified, this parameter is used
6034 for result publication in the study. Otherwise, if automatic
6035 publication is switched on, default value is used for result name.
6038 A compound of sub-shapes of aShape.
6040 # Example: see GEOM_TestAll.py
6042 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6043 for ind in ListOfInd:
6044 ListOfIDs.append(AllShapeIDsList[ind - 1])
6045 # note: auto-publishing is done in self.GetSubShape()
6046 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6049 ## Explode a shape on sub-shapes of a given type.
6050 # Sub-shapes will be sorted taking into account their gravity centers,
6051 # to provide stable order of sub-shapes.
6052 # If the shape itself matches the type, it is also returned.
6053 # @param aShape Shape to be exploded.
6054 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6055 # @param theName Object name; when specified, this parameter is used
6056 # for result publication in the study. Otherwise, if automatic
6057 # publication is switched on, default value is used for result name.
6059 # @return List of sub-shapes of type theShapeType, contained in theShape.
6061 # @ref swig_SubShapeAllSorted "Example"
6062 @ManageTransactions("ShapesOp")
6063 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6065 Explode a shape on sub-shapes of a given type.
6066 Sub-shapes will be sorted taking into account their gravity centers,
6067 to provide stable order of sub-shapes.
6068 If the shape itself matches the type, it is also returned.
6071 aShape Shape to be exploded.
6072 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6073 theName Object name; when specified, this parameter is used
6074 for result publication in the study. Otherwise, if automatic
6075 publication is switched on, default value is used for result name.
6078 List of sub-shapes of type theShapeType, contained in theShape.
6080 # Example: see GEOM_TestAll.py
6081 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6082 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6083 self._autoPublish(ListObj, theName, "subshape")
6086 ## Explode a shape on sub-shapes of a given type.
6087 # Sub-shapes will be sorted taking into account their gravity centers,
6088 # to provide stable order of sub-shapes.
6089 # @param aShape Shape to be exploded.
6090 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6091 # @return List of IDs of sub-shapes.
6093 # @ref swig_all_decompose "Example"
6094 @ManageTransactions("ShapesOp")
6095 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6097 Explode a shape on sub-shapes of a given type.
6098 Sub-shapes will be sorted taking into account their gravity centers,
6099 to provide stable order of sub-shapes.
6102 aShape Shape to be exploded.
6103 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6106 List of IDs of sub-shapes.
6108 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6109 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6112 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6113 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6114 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6115 # @param aShape Shape to get sub-shape of.
6116 # @param ListOfInd List of sub-shapes indices.
6117 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6118 # @param theName Object name; when specified, this parameter is used
6119 # for result publication in the study. Otherwise, if automatic
6120 # publication is switched on, default value is used for result name.
6122 # @return A compound of sub-shapes of aShape.
6124 # @ref swig_all_decompose "Example"
6125 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6127 Obtain a compound of sub-shapes of aShape,
6128 selected by they indices in sorted list of all sub-shapes of type aType.
6129 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6132 aShape Shape to get sub-shape of.
6133 ListOfID List of sub-shapes indices.
6134 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6135 theName Object name; when specified, this parameter is used
6136 for result publication in the study. Otherwise, if automatic
6137 publication is switched on, default value is used for result name.
6140 A compound of sub-shapes of aShape.
6142 # Example: see GEOM_TestAll.py
6144 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6145 for ind in ListOfInd:
6146 ListOfIDs.append(AllShapeIDsList[ind - 1])
6147 # note: auto-publishing is done in self.GetSubShape()
6148 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6151 ## Extract shapes (excluding the main shape) of given type.
6152 # @param aShape The shape.
6153 # @param aType The shape type (see ShapeType())
6154 # @param isSorted Boolean flag to switch sorting on/off.
6155 # @param theName Object name; when specified, this parameter is used
6156 # for result publication in the study. Otherwise, if automatic
6157 # publication is switched on, default value is used for result name.
6159 # @return List of sub-shapes of type aType, contained in aShape.
6161 # @ref swig_FilletChamfer "Example"
6162 @ManageTransactions("ShapesOp")
6163 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6165 Extract shapes (excluding the main shape) of given type.
6169 aType The shape type (see geompy.ShapeType)
6170 isSorted Boolean flag to switch sorting on/off.
6171 theName Object name; when specified, this parameter is used
6172 for result publication in the study. Otherwise, if automatic
6173 publication is switched on, default value is used for result name.
6176 List of sub-shapes of type aType, contained in aShape.
6178 # Example: see GEOM_TestAll.py
6179 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6180 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6181 self._autoPublish(ListObj, theName, "subshape")
6184 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6185 # @param aShape Main shape.
6186 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6187 # @param theName Object name; when specified, this parameter is used
6188 # for result publication in the study. Otherwise, if automatic
6189 # publication is switched on, default value is used for result name.
6190 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6192 # @ref swig_all_decompose "Example"
6193 @ManageTransactions("ShapesOp")
6194 def SubShapes(self, aShape, anIDs, theName=None):
6196 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6200 anIDs List of unique IDs of sub-shapes inside theMainShape.
6201 theName Object name; when specified, this parameter is used
6202 for result publication in the study. Otherwise, if automatic
6203 publication is switched on, default value is used for result name.
6206 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6208 # Example: see GEOM_TestAll.py
6209 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6210 RaiseIfFailed("SubShapes", self.ShapesOp)
6211 self._autoPublish(ListObj, theName, "subshape")
6214 # end of l4_decompose
6217 ## @addtogroup l4_decompose_d
6220 ## Deprecated method
6221 # It works like SubShapeAllSortedCentres(), but wrongly
6222 # defines centres of faces, shells and solids.
6223 @ManageTransactions("ShapesOp")
6224 def SubShapeAllSorted(self, aShape, aType, theName=None):
6227 It works like geompy.SubShapeAllSortedCentres, but wrongly
6228 defines centres of faces, shells and solids.
6230 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6231 RaiseIfFailed("MakeExplode", self.ShapesOp)
6232 self._autoPublish(ListObj, theName, "subshape")
6235 ## Deprecated method
6236 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6237 # defines centres of faces, shells and solids.
6238 @ManageTransactions("ShapesOp")
6239 def SubShapeAllSortedIDs(self, aShape, aType):
6242 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6243 defines centres of faces, shells and solids.
6245 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6246 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6249 ## Deprecated method
6250 # It works like SubShapeSortedCentres(), but has a bug
6251 # (wrongly defines centres of faces, shells and solids).
6252 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6255 It works like geompy.SubShapeSortedCentres, but has a bug
6256 (wrongly defines centres of faces, shells and solids).
6259 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6260 for ind in ListOfInd:
6261 ListOfIDs.append(AllShapeIDsList[ind - 1])
6262 # note: auto-publishing is done in self.GetSubShape()
6263 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6266 # end of l4_decompose_d
6269 ## @addtogroup l3_healing
6272 ## Apply a sequence of Shape Healing operators to the given object.
6273 # @param theShape Shape to be processed.
6274 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6275 # @param theParameters List of names of parameters
6276 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6277 # @param theValues List of values of parameters, in the same order
6278 # as parameters are listed in <VAR>theParameters</VAR> list.
6279 # @param theName Object name; when specified, this parameter is used
6280 # for result publication in the study. Otherwise, if automatic
6281 # publication is switched on, default value is used for result name.
6283 # <b> Operators and Parameters: </b> \n
6285 # * \b FixShape - corrects invalid shapes. \n
6286 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6287 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6289 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6290 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6291 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6292 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6294 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6295 # surfaces in segments using a certain angle. \n
6296 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6297 # if Angle=180, four if Angle=90, etc). \n
6298 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6300 # * \b SplitClosedFaces - splits closed faces in segments.
6301 # The number of segments depends on the number of splitting points.\n
6302 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6304 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6305 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6306 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6307 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6308 # This and the previous parameters can take the following values:\n
6309 # \b Parametric \b Continuity \n
6310 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6311 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6312 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6313 # ruling out sharp edges).\n
6314 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6315 # are of the same magnitude).\n
6316 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6317 # or surfaces (d/du C(u)) are the same at junction. \n
6318 # \b Geometric \b Continuity \n
6319 # \b G1: first derivatives are proportional at junction.\n
6320 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6321 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6322 # \b G2: first and second derivatives are proportional at junction.
6323 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6324 # continuity requires that the underlying parameterization was continuous as well.
6325 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6327 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6328 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6329 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6330 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6331 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6332 # with the specified parameters.\n
6333 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6334 # with the specified parameters.\n
6335 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6336 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6337 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6338 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6340 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6341 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6342 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6343 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6344 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6346 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6347 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6350 # @return New GEOM.GEOM_Object, containing processed shape.
6352 # \n @ref tui_shape_processing "Example"
6353 @ManageTransactions("HealOp")
6354 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6356 Apply a sequence of Shape Healing operators to the given object.
6359 theShape Shape to be processed.
6360 theValues List of values of parameters, in the same order
6361 as parameters are listed in theParameters list.
6362 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6363 theParameters List of names of parameters
6364 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6365 theName Object name; when specified, this parameter is used
6366 for result publication in the study. Otherwise, if automatic
6367 publication is switched on, default value is used for result name.
6369 Operators and Parameters:
6371 * FixShape - corrects invalid shapes.
6372 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6373 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6374 * FixFaceSize - removes small faces, such as spots and strips.
6375 * FixFaceSize.Tolerance - defines minimum possible face size.
6376 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6377 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6378 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6379 in segments using a certain angle.
6380 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6381 if Angle=180, four if Angle=90, etc).
6382 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6383 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6385 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6386 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6387 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6388 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6389 * SplitContinuity.CurveContinuity - required continuity for curves.
6390 This and the previous parameters can take the following values:
6392 Parametric Continuity:
6393 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6394 coincidental. The curves or surfaces may still meet at an angle,
6395 giving rise to a sharp corner or edge).
6396 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6397 are parallel, ruling out sharp edges).
6398 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6399 or surfaces are of the same magnitude).
6400 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6401 curves or surfaces (d/du C(u)) are the same at junction.
6403 Geometric Continuity:
6404 G1: first derivatives are proportional at junction.
6405 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6406 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6407 G2: first and second derivatives are proportional at junction. As the names imply,
6408 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6409 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6410 geometric continuity of order n, but not vice-versa.
6411 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6412 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6413 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6414 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6415 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6416 the specified parameters.
6417 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6418 the specified parameters.
6419 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6420 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6421 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6422 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6423 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6424 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6425 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6426 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6427 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6428 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6429 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6432 New GEOM.GEOM_Object, containing processed shape.
6434 Note: For more information look through SALOME Geometry User's Guide->
6435 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6437 # Example: see GEOM_TestHealing.py
6438 theValues,Parameters = ParseList(theValues)
6439 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6440 # To avoid script failure in case of good argument shape
6441 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6443 RaiseIfFailed("ProcessShape", self.HealOp)
6444 for string in (theOperators + theParameters):
6445 Parameters = ":" + Parameters
6447 anObj.SetParameters(Parameters)
6448 self._autoPublish(anObj, theName, "healed")
6451 ## Remove faces from the given object (shape).
6452 # @param theObject Shape to be processed.
6453 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6454 # removes ALL faces of the given object.
6455 # @param theName Object name; when specified, this parameter is used
6456 # for result publication in the study. Otherwise, if automatic
6457 # publication is switched on, default value is used for result name.
6459 # @return New GEOM.GEOM_Object, containing processed shape.
6461 # @ref tui_suppress_faces "Example"
6462 @ManageTransactions("HealOp")
6463 def SuppressFaces(self, theObject, theFaces, theName=None):
6465 Remove faces from the given object (shape).
6468 theObject Shape to be processed.
6469 theFaces Indices of faces to be removed, if EMPTY then the method
6470 removes ALL faces of the given object.
6471 theName Object name; when specified, this parameter is used
6472 for result publication in the study. Otherwise, if automatic
6473 publication is switched on, default value is used for result name.
6476 New GEOM.GEOM_Object, containing processed shape.
6478 # Example: see GEOM_TestHealing.py
6479 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6480 RaiseIfFailed("SuppressFaces", self.HealOp)
6481 self._autoPublish(anObj, theName, "suppressFaces")
6484 ## Sewing of faces into a single shell.
6485 # @param ListShape Shapes to be processed.
6486 # @param theTolerance Required tolerance value.
6487 # @param AllowNonManifold Flag that allows non-manifold sewing.
6488 # @param theName Object name; when specified, this parameter is used
6489 # for result publication in the study. Otherwise, if automatic
6490 # publication is switched on, default value is used for result name.
6492 # @return New GEOM.GEOM_Object, containing a result shell.
6494 # @ref tui_sewing "Example"
6495 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6497 Sewing of faces into a single shell.
6500 ListShape Shapes to be processed.
6501 theTolerance Required tolerance value.
6502 AllowNonManifold Flag that allows non-manifold sewing.
6503 theName Object name; when specified, this parameter is used
6504 for result publication in the study. Otherwise, if automatic
6505 publication is switched on, default value is used for result name.
6508 New GEOM.GEOM_Object, containing containing a result shell.
6510 # Example: see GEOM_TestHealing.py
6511 # note: auto-publishing is done in self.Sew()
6512 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
6515 ## Sewing of faces into a single shell.
6516 # @param ListShape Shapes to be processed.
6517 # @param theTolerance Required tolerance value.
6518 # @param AllowNonManifold Flag that allows non-manifold sewing.
6519 # @param theName Object name; when specified, this parameter is used
6520 # for result publication in the study. Otherwise, if automatic
6521 # publication is switched on, default value is used for result name.
6523 # @return New GEOM.GEOM_Object, containing a result shell.
6524 @ManageTransactions("HealOp")
6525 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6527 Sewing of faces into a single shell.
6530 ListShape Shapes to be processed.
6531 theTolerance Required tolerance value.
6532 AllowNonManifold Flag that allows non-manifold sewing.
6533 theName Object name; when specified, this parameter is used
6534 for result publication in the study. Otherwise, if automatic
6535 publication is switched on, default value is used for result name.
6538 New GEOM.GEOM_Object, containing a result shell.
6540 # Example: see MakeSewing() above
6541 theTolerance,Parameters = ParseParameters(theTolerance)
6542 if AllowNonManifold:
6543 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
6545 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
6546 # To avoid script failure in case of good argument shape
6547 # (Fix of test cases geom/bugs11/L7,L8)
6548 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6550 RaiseIfFailed("Sew", self.HealOp)
6551 anObj.SetParameters(Parameters)
6552 self._autoPublish(anObj, theName, "sewed")
6555 ## Rebuild the topology of theSolids by removing
6556 # the faces that are shared by several solids.
6557 # @param theSolids A compound or a list of solids to be processed.
6558 # @param theName Object name; when specified, this parameter is used
6559 # for result publication in the study. Otherwise, if automatic
6560 # publication is switched on, default value is used for result name.
6562 # @return New GEOM.GEOM_Object, containing processed shape.
6564 # @ref tui_remove_webs "Example"
6565 @ManageTransactions("HealOp")
6566 def RemoveInternalFaces (self, theSolids, theName=None):
6568 Rebuild the topology of theSolids by removing
6569 the faces that are shared by several solids.
6572 theSolids A compound or a list of solids to be processed.
6573 theName Object name; when specified, this parameter is used
6574 for result publication in the study. Otherwise, if automatic
6575 publication is switched on, default value is used for result name.
6578 New GEOM.GEOM_Object, containing processed shape.
6580 # Example: see GEOM_TestHealing.py
6581 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
6582 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6583 self._autoPublish(anObj, theName, "removeWebs")
6586 ## Remove internal wires and edges from the given object (face).
6587 # @param theObject Shape to be processed.
6588 # @param theWires Indices of wires to be removed, if EMPTY then the method
6589 # removes ALL internal wires of the given object.
6590 # @param theName Object name; when specified, this parameter is used
6591 # for result publication in the study. Otherwise, if automatic
6592 # publication is switched on, default value is used for result name.
6594 # @return New GEOM.GEOM_Object, containing processed shape.
6596 # @ref tui_suppress_internal_wires "Example"
6597 @ManageTransactions("HealOp")
6598 def SuppressInternalWires(self, theObject, theWires, theName=None):
6600 Remove internal wires and edges from the given object (face).
6603 theObject Shape to be processed.
6604 theWires Indices of wires to be removed, if EMPTY then the method
6605 removes ALL internal wires of the given object.
6606 theName Object name; when specified, this parameter is used
6607 for result publication in the study. Otherwise, if automatic
6608 publication is switched on, default value is used for result name.
6611 New GEOM.GEOM_Object, containing processed shape.
6613 # Example: see GEOM_TestHealing.py
6614 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6615 RaiseIfFailed("RemoveIntWires", self.HealOp)
6616 self._autoPublish(anObj, theName, "suppressWires")
6619 ## Remove internal closed contours (holes) from the given object.
6620 # @param theObject Shape to be processed.
6621 # @param theWires Indices of wires to be removed, if EMPTY then the method
6622 # removes ALL internal holes of the given object
6623 # @param theName Object name; when specified, this parameter is used
6624 # for result publication in the study. Otherwise, if automatic
6625 # publication is switched on, default value is used for result name.
6627 # @return New GEOM.GEOM_Object, containing processed shape.
6629 # @ref tui_suppress_holes "Example"
6630 @ManageTransactions("HealOp")
6631 def SuppressHoles(self, theObject, theWires, theName=None):
6633 Remove internal closed contours (holes) from the given object.
6636 theObject Shape to be processed.
6637 theWires Indices of wires to be removed, if EMPTY then the method
6638 removes ALL internal holes of the given object
6639 theName Object name; when specified, this parameter is used
6640 for result publication in the study. Otherwise, if automatic
6641 publication is switched on, default value is used for result name.
6644 New GEOM.GEOM_Object, containing processed shape.
6646 # Example: see GEOM_TestHealing.py
6647 anObj = self.HealOp.FillHoles(theObject, theWires)
6648 RaiseIfFailed("FillHoles", self.HealOp)
6649 self._autoPublish(anObj, theName, "suppressHoles")
6652 ## Close an open wire.
6653 # @param theObject Shape to be processed.
6654 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6655 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6656 # @param isCommonVertex If True : closure by creation of a common vertex,
6657 # If False : closure by creation of an edge between ends.
6658 # @param theName Object name; when specified, this parameter is used
6659 # for result publication in the study. Otherwise, if automatic
6660 # publication is switched on, default value is used for result name.
6662 # @return New GEOM.GEOM_Object, containing processed shape.
6664 # @ref tui_close_contour "Example"
6665 @ManageTransactions("HealOp")
6666 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6671 theObject Shape to be processed.
6672 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6673 if [ ], then theObject itself is a wire.
6674 isCommonVertex If True : closure by creation of a common vertex,
6675 If False : closure by creation of an edge between ends.
6676 theName Object name; when specified, this parameter is used
6677 for result publication in the study. Otherwise, if automatic
6678 publication is switched on, default value is used for result name.
6681 New GEOM.GEOM_Object, containing processed shape.
6683 # Example: see GEOM_TestHealing.py
6684 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6685 RaiseIfFailed("CloseContour", self.HealOp)
6686 self._autoPublish(anObj, theName, "closeContour")
6689 ## Addition of a point to a given edge object.
6690 # @param theObject Shape to be processed.
6691 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6692 # if -1, then theObject itself is the edge.
6693 # @param theValue Value of parameter on edge or length parameter,
6694 # depending on \a isByParameter.
6695 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6696 # if FALSE : \a theValue is treated as a length parameter [0..1]
6697 # @param theName Object name; when specified, this parameter is used
6698 # for result publication in the study. Otherwise, if automatic
6699 # publication is switched on, default value is used for result name.
6701 # @return New GEOM.GEOM_Object, containing processed shape.
6703 # @ref tui_add_point_on_edge "Example"
6704 @ManageTransactions("HealOp")
6705 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6707 Addition of a point to a given edge object.
6710 theObject Shape to be processed.
6711 theEdgeIndex Index of edge to be divided within theObject's shape,
6712 if -1, then theObject itself is the edge.
6713 theValue Value of parameter on edge or length parameter,
6714 depending on isByParameter.
6715 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6716 if FALSE : theValue is treated as a length parameter [0..1]
6717 theName Object name; when specified, this parameter is used
6718 for result publication in the study. Otherwise, if automatic
6719 publication is switched on, default value is used for result name.
6722 New GEOM.GEOM_Object, containing processed shape.
6724 # Example: see GEOM_TestHealing.py
6725 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6726 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6727 RaiseIfFailed("DivideEdge", self.HealOp)
6728 anObj.SetParameters(Parameters)
6729 self._autoPublish(anObj, theName, "divideEdge")
6732 ## Addition of a point to a given edge of \a theObject by projecting
6733 # another point to the given edge.
6734 # @param theObject Shape to be processed.
6735 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6736 # if -1, then theObject itself is the edge.
6737 # @param thePoint Point to project to theEdgeIndex-th edge.
6738 # @param theName Object name; when specified, this parameter is used
6739 # for result publication in the study. Otherwise, if automatic
6740 # publication is switched on, default value is used for result name.
6742 # @return New GEOM.GEOM_Object, containing processed shape.
6744 # @ref tui_add_point_on_edge "Example"
6745 @ManageTransactions("HealOp")
6746 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoint, theName=None):
6748 Addition of a point to a given edge of \a theObject by projecting
6749 another point to the given edge.
6752 theObject Shape to be processed.
6753 theEdgeIndex The edge or its index to be divided within theObject's shape,
6754 if -1, then theObject itself is the edge.
6755 thePoint Point to project to theEdgeIndex-th edge.
6756 theName Object name; when specified, this parameter is used
6757 for result publication in the study. Otherwise, if automatic
6758 publication is switched on, default value is used for result name.
6761 New GEOM.GEOM_Object, containing processed shape.
6763 # Example: see GEOM_TestHealing.py
6764 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
6765 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
6766 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, thePoint)
6767 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
6768 self._autoPublish(anObj, theName, "divideEdge")
6771 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6772 # @param theWire Wire to minimize the number of C1 continuous edges in.
6773 # @param theVertices A list of vertices to suppress. If the list
6774 # is empty, all vertices in a wire will be assumed.
6775 # @param theName Object name; when specified, this parameter is used
6776 # for result publication in the study. Otherwise, if automatic
6777 # publication is switched on, default value is used for result name.
6779 # @return New GEOM.GEOM_Object with modified wire.
6781 # @ref tui_fuse_collinear_edges "Example"
6782 @ManageTransactions("HealOp")
6783 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6785 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6788 theWire Wire to minimize the number of C1 continuous edges in.
6789 theVertices A list of vertices to suppress. If the list
6790 is empty, all vertices in a wire will be assumed.
6791 theName Object name; when specified, this parameter is used
6792 for result publication in the study. Otherwise, if automatic
6793 publication is switched on, default value is used for result name.
6796 New GEOM.GEOM_Object with modified wire.
6798 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6799 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6800 self._autoPublish(anObj, theName, "fuseEdges")
6803 ## Change orientation of the given object. Updates given shape.
6804 # @param theObject Shape to be processed.
6805 # @return Updated <var>theObject</var>
6807 # @ref swig_todo "Example"
6808 @ManageTransactions("HealOp")
6809 def ChangeOrientationShell(self,theObject):
6811 Change orientation of the given object. Updates given shape.
6814 theObject Shape to be processed.
6819 theObject = self.HealOp.ChangeOrientation(theObject)
6820 RaiseIfFailed("ChangeOrientation", self.HealOp)
6823 ## Change orientation of the given object.
6824 # @param theObject Shape to be processed.
6825 # @param theName Object name; when specified, this parameter is used
6826 # for result publication in the study. Otherwise, if automatic
6827 # publication is switched on, default value is used for result name.
6829 # @return New GEOM.GEOM_Object, containing processed shape.
6831 # @ref swig_todo "Example"
6832 @ManageTransactions("HealOp")
6833 def ChangeOrientationShellCopy(self, theObject, theName=None):
6835 Change orientation of the given object.
6838 theObject Shape to be processed.
6839 theName Object name; when specified, this parameter is used
6840 for result publication in the study. Otherwise, if automatic
6841 publication is switched on, default value is used for result name.
6844 New GEOM.GEOM_Object, containing processed shape.
6846 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6847 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6848 self._autoPublish(anObj, theName, "reversed")
6851 ## Try to limit tolerance of the given object by value \a theTolerance.
6852 # @param theObject Shape to be processed.
6853 # @param theTolerance Required tolerance value.
6854 # @param theName Object name; when specified, this parameter is used
6855 # for result publication in the study. Otherwise, if automatic
6856 # publication is switched on, default value is used for result name.
6858 # @return New GEOM.GEOM_Object, containing processed shape.
6860 # @ref tui_limit_tolerance "Example"
6861 @ManageTransactions("HealOp")
6862 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6864 Try to limit tolerance of the given object by value theTolerance.
6867 theObject Shape to be processed.
6868 theTolerance Required tolerance value.
6869 theName Object name; when specified, this parameter is used
6870 for result publication in the study. Otherwise, if automatic
6871 publication is switched on, default value is used for result name.
6874 New GEOM.GEOM_Object, containing processed shape.
6876 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6877 RaiseIfFailed("LimitTolerance", self.HealOp)
6878 self._autoPublish(anObj, theName, "limitTolerance")
6881 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6882 # that constitute a free boundary of the given shape.
6883 # @param theObject Shape to get free boundary of.
6884 # @param theName Object name; when specified, this parameter is used
6885 # for result publication in the study. Otherwise, if automatic
6886 # publication is switched on, default value is used for result name.
6888 # @return [\a status, \a theClosedWires, \a theOpenWires]
6889 # \n \a status: FALSE, if an error(s) occured during the method execution.
6890 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6891 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6893 # @ref tui_measurement_tools_page "Example"
6894 @ManageTransactions("HealOp")
6895 def GetFreeBoundary(self, theObject, theName=None):
6897 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6898 that constitute a free boundary of the given shape.
6901 theObject Shape to get free boundary of.
6902 theName Object name; when specified, this parameter is used
6903 for result publication in the study. Otherwise, if automatic
6904 publication is switched on, default value is used for result name.
6907 [status, theClosedWires, theOpenWires]
6908 status: FALSE, if an error(s) occured during the method execution.
6909 theClosedWires: Closed wires on the free boundary of the given shape.
6910 theOpenWires: Open wires on the free boundary of the given shape.
6912 # Example: see GEOM_TestHealing.py
6913 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
6914 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6915 self._autoPublish(anObj[1], theName, "closedWire")
6916 self._autoPublish(anObj[2], theName, "openWire")
6919 ## Replace coincident faces in \a theShapes by one face.
6920 # @param theShapes Initial shapes, either a list or compound of shapes.
6921 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6922 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6923 # otherwise all initial shapes.
6924 # @param theName Object name; when specified, this parameter is used
6925 # for result publication in the study. Otherwise, if automatic
6926 # publication is switched on, default value is used for result name.
6928 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
6930 # @ref tui_glue_faces "Example"
6931 @ManageTransactions("ShapesOp")
6932 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
6934 Replace coincident faces in theShapes by one face.
6937 theShapes Initial shapes, either a list or compound of shapes.
6938 theTolerance Maximum distance between faces, which can be considered as coincident.
6939 doKeepNonSolids If FALSE, only solids will present in the result,
6940 otherwise all initial shapes.
6941 theName Object name; when specified, this parameter is used
6942 for result publication in the study. Otherwise, if automatic
6943 publication is switched on, default value is used for result name.
6946 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
6948 # Example: see GEOM_Spanner.py
6949 theTolerance,Parameters = ParseParameters(theTolerance)
6950 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
6952 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6953 anObj.SetParameters(Parameters)
6954 self._autoPublish(anObj, theName, "glueFaces")
6957 ## Find coincident faces in \a theShapes for possible gluing.
6958 # @param theShapes Initial shapes, either a list or compound of shapes.
6959 # @param theTolerance Maximum distance between faces,
6960 # which can be considered as coincident.
6961 # @param theName Object name; when specified, this parameter is used
6962 # for result publication in the study. Otherwise, if automatic
6963 # publication is switched on, default value is used for result name.
6965 # @return GEOM.ListOfGO
6967 # @ref tui_glue_faces "Example"
6968 @ManageTransactions("ShapesOp")
6969 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
6971 Find coincident faces in theShapes for possible gluing.
6974 theShapes Initial shapes, either a list or compound of shapes.
6975 theTolerance Maximum distance between faces,
6976 which can be considered as coincident.
6977 theName Object name; when specified, this parameter is used
6978 for result publication in the study. Otherwise, if automatic
6979 publication is switched on, default value is used for result name.
6984 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
6985 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6986 self._autoPublish(anObj, theName, "facesToGlue")
6989 ## Replace coincident faces in \a theShapes by one face
6990 # in compliance with given list of faces
6991 # @param theShapes Initial shapes, either a list or compound of shapes.
6992 # @param theTolerance Maximum distance between faces,
6993 # which can be considered as coincident.
6994 # @param theFaces List of faces for gluing.
6995 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6996 # otherwise all initial shapes.
6997 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6998 # will be glued, otherwise only the edges,
6999 # belonging to <VAR>theFaces</VAR>.
7000 # @param theName Object name; when specified, this parameter is used
7001 # for result publication in the study. Otherwise, if automatic
7002 # publication is switched on, default value is used for result name.
7004 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7006 # @ref tui_glue_faces "Example"
7007 @ManageTransactions("ShapesOp")
7008 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7009 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7011 Replace coincident faces in theShapes by one face
7012 in compliance with given list of faces
7015 theShapes theShapes Initial shapes, either a list or compound of shapes.
7016 theTolerance Maximum distance between faces,
7017 which can be considered as coincident.
7018 theFaces List of faces for gluing.
7019 doKeepNonSolids If FALSE, only solids will present in the result,
7020 otherwise all initial shapes.
7021 doGlueAllEdges If TRUE, all coincident edges of theShape
7022 will be glued, otherwise only the edges,
7023 belonging to theFaces.
7024 theName Object name; when specified, this parameter is used
7025 for result publication in the study. Otherwise, if automatic
7026 publication is switched on, default value is used for result name.
7029 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7031 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, theFaces,
7032 doKeepNonSolids, doGlueAllEdges)
7034 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
7035 self._autoPublish(anObj, theName, "glueFaces")
7038 ## Replace coincident edges in \a theShapes by one edge.
7039 # @param theShapes Initial shapes, either a list or compound of shapes.
7040 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7041 # @param theName Object name; when specified, this parameter is used
7042 # for result publication in the study. Otherwise, if automatic
7043 # publication is switched on, default value is used for result name.
7045 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7047 # @ref tui_glue_edges "Example"
7048 @ManageTransactions("ShapesOp")
7049 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7051 Replace coincident edges in theShapes by one edge.
7054 theShapes Initial shapes, either a list or compound of shapes.
7055 theTolerance Maximum distance between edges, which can be considered as coincident.
7056 theName Object name; when specified, this parameter is used
7057 for result publication in the study. Otherwise, if automatic
7058 publication is switched on, default value is used for result name.
7061 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7063 theTolerance,Parameters = ParseParameters(theTolerance)
7064 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7066 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
7067 anObj.SetParameters(Parameters)
7068 self._autoPublish(anObj, theName, "glueEdges")
7071 ## Find coincident edges in \a theShapes for possible gluing.
7072 # @param theShapes Initial shapes, either a list or compound of shapes.
7073 # @param theTolerance Maximum distance between edges,
7074 # which can be considered as coincident.
7075 # @param theName Object name; when specified, this parameter is used
7076 # for result publication in the study. Otherwise, if automatic
7077 # publication is switched on, default value is used for result name.
7079 # @return GEOM.ListOfGO
7081 # @ref tui_glue_edges "Example"
7082 @ManageTransactions("ShapesOp")
7083 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7085 Find coincident edges in theShapes for possible gluing.
7088 theShapes Initial shapes, either a list or compound of shapes.
7089 theTolerance Maximum distance between edges,
7090 which can be considered as coincident.
7091 theName Object name; when specified, this parameter is used
7092 for result publication in the study. Otherwise, if automatic
7093 publication is switched on, default value is used for result name.
7098 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7099 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7100 self._autoPublish(anObj, theName, "edgesToGlue")
7103 ## Replace coincident edges in theShapes by one edge
7104 # in compliance with given list of edges.
7105 # @param theShapes Initial shapes, either a list or compound of shapes.
7106 # @param theTolerance Maximum distance between edges,
7107 # which can be considered as coincident.
7108 # @param theEdges List of edges for gluing.
7109 # @param theName Object name; when specified, this parameter is used
7110 # for result publication in the study. Otherwise, if automatic
7111 # publication is switched on, default value is used for result name.
7113 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7115 # @ref tui_glue_edges "Example"
7116 @ManageTransactions("ShapesOp")
7117 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7119 Replace coincident edges in theShapes by one edge
7120 in compliance with given list of edges.
7123 theShapes Initial shapes, either a list or compound of shapes.
7124 theTolerance Maximum distance between edges,
7125 which can be considered as coincident.
7126 theEdges List of edges for gluing.
7127 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.
7132 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7134 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7136 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
7137 self._autoPublish(anObj, theName, "glueEdges")
7143 ## @addtogroup l3_boolean Boolean Operations
7146 # -----------------------------------------------------------------------------
7147 # Boolean (Common, Cut, Fuse, Section)
7148 # -----------------------------------------------------------------------------
7150 ## Perform one of boolean operations on two given shapes.
7151 # @param theShape1 First argument for boolean operation.
7152 # @param theShape2 Second argument for boolean operation.
7153 # @param theOperation Indicates the operation to be done:\n
7154 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7155 # @param checkSelfInte The flag that tells if the arguments should
7156 # be checked for self-intersection prior to the operation.
7157 # @param 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.
7161 # @note This algorithm doesn't find all types of self-intersections.
7162 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7163 # vertex/face and edge/face intersections. Face/face
7164 # intersections detection is switched off as it is a
7165 # time-consuming operation that gives an impact on performance.
7166 # To find all self-intersections please use
7167 # CheckSelfIntersections() method.
7169 # @return New GEOM.GEOM_Object, containing the result shape.
7171 # @ref tui_fuse "Example"
7172 @ManageTransactions("BoolOp")
7173 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7175 Perform one of boolean operations on two given shapes.
7178 theShape1 First argument for boolean operation.
7179 theShape2 Second argument for boolean operation.
7180 theOperation Indicates the operation to be done:
7181 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7182 checkSelfInte The flag that tells if the arguments should
7183 be checked for self-intersection prior to
7185 theName Object name; when specified, this parameter is used
7186 for result publication in the study. Otherwise, if automatic
7187 publication is switched on, default value is used for result name.
7190 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.
7199 New GEOM.GEOM_Object, containing the result shape.
7201 # Example: see GEOM_TestAll.py
7202 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7203 RaiseIfFailed("MakeBoolean", self.BoolOp)
7204 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7205 self._autoPublish(anObj, theName, def_names[theOperation])
7208 ## Perform Common boolean operation on two given shapes.
7209 # @param theShape1 First argument for boolean operation.
7210 # @param theShape2 Second argument for boolean operation.
7211 # @param checkSelfInte The flag that tells if the arguments should
7212 # be checked for self-intersection prior to the operation.
7213 # @param theName Object name; when specified, this parameter is used
7214 # for result publication in the study. Otherwise, if automatic
7215 # publication is switched on, default value is used for result name.
7217 # @note 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.
7225 # @return New GEOM.GEOM_Object, containing the result shape.
7227 # @ref tui_common "Example 1"
7228 # \n @ref swig_MakeCommon "Example 2"
7229 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7231 Perform Common boolean operation on two given shapes.
7234 theShape1 First argument for boolean operation.
7235 theShape2 Second argument for boolean operation.
7236 checkSelfInte The flag that tells if the arguments should
7237 be checked for self-intersection prior to
7239 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.
7244 This algorithm doesn't find all types of self-intersections.
7245 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7246 vertex/face and edge/face intersections. Face/face
7247 intersections detection is switched off as it is a
7248 time-consuming operation that gives an impact on performance.
7249 To find all self-intersections please use
7250 CheckSelfIntersections() method.
7253 New GEOM.GEOM_Object, containing the result shape.
7255 # Example: see GEOM_TestOthers.py
7256 # note: auto-publishing is done in self.MakeBoolean()
7257 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7259 ## Perform Cut boolean operation on two given shapes.
7260 # @param theShape1 First argument for boolean operation.
7261 # @param theShape2 Second argument for boolean operation.
7262 # @param checkSelfInte The flag that tells if the arguments should
7263 # be checked for self-intersection prior to the operation.
7264 # @param theName Object name; when specified, this parameter is used
7265 # for result publication in the study. Otherwise, if automatic
7266 # publication is switched on, default value is used for result name.
7268 # @note This algorithm doesn't find all types of self-intersections.
7269 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7270 # vertex/face and edge/face intersections. Face/face
7271 # intersections detection is switched off as it is a
7272 # time-consuming operation that gives an impact on performance.
7273 # To find all self-intersections please use
7274 # CheckSelfIntersections() method.
7276 # @return New GEOM.GEOM_Object, containing the result shape.
7278 # @ref tui_cut "Example 1"
7279 # \n @ref swig_MakeCommon "Example 2"
7280 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7282 Perform Cut boolean operation on two given shapes.
7285 theShape1 First argument for boolean operation.
7286 theShape2 Second argument for boolean operation.
7287 checkSelfInte The flag that tells if the arguments should
7288 be checked for self-intersection prior to
7290 theName Object name; when specified, this parameter is used
7291 for result publication in the study. Otherwise, if automatic
7292 publication is switched on, default value is used for result name.
7295 This algorithm doesn't find all types of self-intersections.
7296 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7297 vertex/face and edge/face intersections. Face/face
7298 intersections detection is switched off as it is a
7299 time-consuming operation that gives an impact on performance.
7300 To find all self-intersections please use
7301 CheckSelfIntersections() method.
7304 New GEOM.GEOM_Object, containing the result shape.
7307 # Example: see GEOM_TestOthers.py
7308 # note: auto-publishing is done in self.MakeBoolean()
7309 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7311 ## Perform Fuse boolean operation on two given shapes.
7312 # @param theShape1 First argument for boolean operation.
7313 # @param theShape2 Second argument for boolean operation.
7314 # @param checkSelfInte The flag that tells if the arguments should
7315 # be checked for self-intersection prior to the operation.
7316 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7317 # operation should be performed during the operation.
7318 # @param theName Object name; when specified, this parameter is used
7319 # for result publication in the study. Otherwise, if automatic
7320 # publication is switched on, default value is used for result name.
7322 # @note This algorithm doesn't find all types of self-intersections.
7323 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7324 # vertex/face and edge/face intersections. Face/face
7325 # intersections detection is switched off as it is a
7326 # time-consuming operation that gives an impact on performance.
7327 # To find all self-intersections please use
7328 # CheckSelfIntersections() method.
7330 # @return New GEOM.GEOM_Object, containing the result shape.
7332 # @ref tui_fuse "Example 1"
7333 # \n @ref swig_MakeCommon "Example 2"
7334 @ManageTransactions("BoolOp")
7335 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7336 rmExtraEdges=False, theName=None):
7338 Perform Fuse boolean operation on two given shapes.
7341 theShape1 First argument for boolean operation.
7342 theShape2 Second argument for boolean operation.
7343 checkSelfInte The flag that tells if the arguments should
7344 be checked for self-intersection prior to
7346 rmExtraEdges The flag that tells if Remove Extra Edges
7347 operation should be performed during the operation.
7348 theName Object name; when specified, this parameter is used
7349 for result publication in the study. Otherwise, if automatic
7350 publication is switched on, default value is used for result name.
7353 This algorithm doesn't find all types of self-intersections.
7354 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7355 vertex/face and edge/face intersections. Face/face
7356 intersections detection is switched off as it is a
7357 time-consuming operation that gives an impact on performance.
7358 To find all self-intersections please use
7359 CheckSelfIntersections() method.
7362 New GEOM.GEOM_Object, containing the result shape.
7365 # Example: see GEOM_TestOthers.py
7366 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7367 checkSelfInte, rmExtraEdges)
7368 RaiseIfFailed("MakeFuse", self.BoolOp)
7369 self._autoPublish(anObj, theName, "fuse")
7372 ## Perform Section boolean operation on two given shapes.
7373 # @param theShape1 First argument for boolean operation.
7374 # @param theShape2 Second argument for boolean operation.
7375 # @param checkSelfInte The flag that tells if the arguments should
7376 # be checked for self-intersection prior to the operation.
7377 # @param 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.
7381 # @note This algorithm doesn't find all types of self-intersections.
7382 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7383 # vertex/face and edge/face intersections. Face/face
7384 # intersections detection is switched off as it is a
7385 # time-consuming operation that gives an impact on performance.
7386 # To find all self-intersections please use
7387 # CheckSelfIntersections() method.
7389 # @return New GEOM.GEOM_Object, containing the result shape.
7391 # @ref tui_section "Example 1"
7392 # \n @ref swig_MakeCommon "Example 2"
7393 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7395 Perform Section boolean operation on two given shapes.
7398 theShape1 First argument for boolean operation.
7399 theShape2 Second argument for boolean operation.
7400 checkSelfInte The flag that tells if the arguments should
7401 be checked for self-intersection prior to
7403 theName Object name; when specified, this parameter is used
7404 for result publication in the study. Otherwise, if automatic
7405 publication is switched on, default value is used for result name.
7408 This algorithm doesn't find all types of self-intersections.
7409 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7410 vertex/face and edge/face intersections. Face/face
7411 intersections detection is switched off as it is a
7412 time-consuming operation that gives an impact on performance.
7413 To find all self-intersections please use
7414 CheckSelfIntersections() method.
7417 New GEOM.GEOM_Object, containing the result shape.
7420 # Example: see GEOM_TestOthers.py
7421 # note: auto-publishing is done in self.MakeBoolean()
7422 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7424 ## Perform Fuse boolean operation on the list of shapes.
7425 # @param theShapesList Shapes to be fused.
7426 # @param checkSelfInte The flag that tells if the arguments should
7427 # be checked for self-intersection prior to the operation.
7428 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7429 # operation should be performed during the operation.
7430 # @param theName Object name; when specified, this parameter is used
7431 # for result publication in the study. Otherwise, if automatic
7432 # publication is switched on, default value is used for result name.
7434 # @note This algorithm doesn't find all types of self-intersections.
7435 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7436 # vertex/face and edge/face intersections. Face/face
7437 # intersections detection is switched off as it is a
7438 # time-consuming operation that gives an impact on performance.
7439 # To find all self-intersections please use
7440 # CheckSelfIntersections() method.
7442 # @return New GEOM.GEOM_Object, containing the result shape.
7444 # @ref tui_fuse "Example 1"
7445 # \n @ref swig_MakeCommon "Example 2"
7446 @ManageTransactions("BoolOp")
7447 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7448 rmExtraEdges=False, theName=None):
7450 Perform Fuse boolean operation on the list of shapes.
7453 theShapesList Shapes to be fused.
7454 checkSelfInte The flag that tells if the arguments should
7455 be checked for self-intersection prior to
7457 rmExtraEdges The flag that tells if Remove Extra Edges
7458 operation should be performed during the operation.
7459 theName Object name; when specified, this parameter is used
7460 for result publication in the study. Otherwise, if automatic
7461 publication is switched on, default value is used for result name.
7464 This algorithm doesn't find all types of self-intersections.
7465 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7466 vertex/face and edge/face intersections. Face/face
7467 intersections detection is switched off as it is a
7468 time-consuming operation that gives an impact on performance.
7469 To find all self-intersections please use
7470 CheckSelfIntersections() method.
7473 New GEOM.GEOM_Object, containing the result shape.
7476 # Example: see GEOM_TestOthers.py
7477 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7479 RaiseIfFailed("MakeFuseList", self.BoolOp)
7480 self._autoPublish(anObj, theName, "fuse")
7483 ## Perform Common boolean operation on the list of shapes.
7484 # @param theShapesList Shapes for Common operation.
7485 # @param checkSelfInte The flag that tells if the arguments should
7486 # be checked for self-intersection prior to the operation.
7487 # @param theName Object name; when specified, this parameter is used
7488 # for result publication in the study. Otherwise, if automatic
7489 # publication is switched on, default value is used for result name.
7491 # @note This algorithm doesn't find all types of self-intersections.
7492 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7493 # vertex/face and edge/face intersections. Face/face
7494 # intersections detection is switched off as it is a
7495 # time-consuming operation that gives an impact on performance.
7496 # To find all self-intersections please use
7497 # CheckSelfIntersections() method.
7499 # @return New GEOM.GEOM_Object, containing the result shape.
7501 # @ref tui_common "Example 1"
7502 # \n @ref swig_MakeCommon "Example 2"
7503 @ManageTransactions("BoolOp")
7504 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7506 Perform Common boolean operation on the list of shapes.
7509 theShapesList Shapes for Common operation.
7510 checkSelfInte The flag that tells if the arguments should
7511 be checked for self-intersection prior to
7513 theName Object name; when specified, this parameter is used
7514 for result publication in the study. Otherwise, if automatic
7515 publication is switched on, default value is used for result name.
7518 This algorithm doesn't find all types of self-intersections.
7519 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7520 vertex/face and edge/face intersections. Face/face
7521 intersections detection is switched off as it is a
7522 time-consuming operation that gives an impact on performance.
7523 To find all self-intersections please use
7524 CheckSelfIntersections() method.
7527 New GEOM.GEOM_Object, containing the result shape.
7530 # Example: see GEOM_TestOthers.py
7531 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7532 RaiseIfFailed("MakeCommonList", self.BoolOp)
7533 self._autoPublish(anObj, theName, "common")
7536 ## Perform Cut boolean operation on one object and the list of tools.
7537 # @param theMainShape The object of the operation.
7538 # @param theShapesList The list of tools of the operation.
7539 # @param checkSelfInte The flag that tells if the arguments should
7540 # be checked for self-intersection prior to the operation.
7541 # @param theName Object name; when specified, this parameter is used
7542 # for result publication in the study. Otherwise, if automatic
7543 # publication is switched on, default value is used for result name.
7545 # @note This algorithm doesn't find all types of self-intersections.
7546 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7547 # vertex/face and edge/face intersections. Face/face
7548 # intersections detection is switched off as it is a
7549 # time-consuming operation that gives an impact on performance.
7550 # To find all self-intersections please use
7551 # CheckSelfIntersections() method.
7553 # @return New GEOM.GEOM_Object, containing the result shape.
7555 # @ref tui_cut "Example 1"
7556 # \n @ref swig_MakeCommon "Example 2"
7557 @ManageTransactions("BoolOp")
7558 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7560 Perform Cut boolean operation on one object and the list of tools.
7563 theMainShape The object of the operation.
7564 theShapesList The list of tools of the operation.
7565 checkSelfInte The flag that tells if the arguments should
7566 be checked for self-intersection prior to
7568 theName Object name; when specified, this parameter is used
7569 for result publication in the study. Otherwise, if automatic
7570 publication is switched on, default value is used for result name.
7573 This algorithm doesn't find all types of self-intersections.
7574 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7575 vertex/face and edge/face intersections. Face/face
7576 intersections detection is switched off as it is a
7577 time-consuming operation that gives an impact on performance.
7578 To find all self-intersections please use
7579 CheckSelfIntersections() method.
7582 New GEOM.GEOM_Object, containing the result shape.
7585 # Example: see GEOM_TestOthers.py
7586 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7587 RaiseIfFailed("MakeCutList", self.BoolOp)
7588 self._autoPublish(anObj, theName, "cut")
7594 ## @addtogroup l3_basic_op
7597 ## Perform partition operation.
7598 # @param ListShapes Shapes to be intersected.
7599 # @param ListTools Shapes to intersect theShapes.
7600 # @param Limit Type of resulting shapes (see ShapeType()).\n
7601 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7602 # type will be detected automatically.
7603 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7604 # target type (equal to Limit) are kept in the result,
7605 # else standalone shapes of lower dimension
7606 # are kept also (if they exist).
7608 # @param theName Object name; when specified, this parameter is used
7609 # for result publication in the study. Otherwise, if automatic
7610 # publication is switched on, default value is used for result name.
7612 # @note Each compound from ListShapes and ListTools will be exploded
7613 # in order to avoid possible intersection between shapes from this compound.
7615 # After implementation new version of PartitionAlgo (October 2006)
7616 # other parameters are ignored by current functionality. They are kept
7617 # in this function only for support old versions.
7618 # @param ListKeepInside Shapes, outside which the results will be deleted.
7619 # Each shape from theKeepInside must belong to theShapes also.
7620 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7621 # Each shape from theRemoveInside must belong to theShapes also.
7622 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7623 # @param ListMaterials Material indices for each shape. Make sence,
7624 # only if theRemoveWebs is TRUE.
7626 # @return New GEOM.GEOM_Object, containing the result shapes.
7628 # @ref tui_partition "Example"
7629 @ManageTransactions("BoolOp")
7630 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7631 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7632 KeepNonlimitShapes=0, theName=None):
7634 Perform partition operation.
7637 ListShapes Shapes to be intersected.
7638 ListTools Shapes to intersect theShapes.
7639 Limit Type of resulting shapes (see geompy.ShapeType)
7640 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7641 type will be detected automatically.
7642 KeepNonlimitShapes if this parameter == 0, then only shapes of
7643 target type (equal to Limit) are kept in the result,
7644 else standalone shapes of lower dimension
7645 are kept also (if they exist).
7647 theName Object name; when specified, this parameter is used
7648 for result publication in the study. Otherwise, if automatic
7649 publication is switched on, default value is used for result name.
7651 Each compound from ListShapes and ListTools will be exploded
7652 in order to avoid possible intersection between shapes from
7655 After implementation new version of PartitionAlgo (October 2006) other
7656 parameters are ignored by current functionality. They are kept in this
7657 function only for support old versions.
7660 ListKeepInside Shapes, outside which the results will be deleted.
7661 Each shape from theKeepInside must belong to theShapes also.
7662 ListRemoveInside Shapes, inside which the results will be deleted.
7663 Each shape from theRemoveInside must belong to theShapes also.
7664 RemoveWebs If TRUE, perform Glue 3D algorithm.
7665 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7668 New GEOM.GEOM_Object, containing the result shapes.
7670 # Example: see GEOM_TestAll.py
7671 if Limit == self.ShapeType["AUTO"]:
7672 # automatic detection of the most appropriate shape limit type
7674 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7675 Limit = EnumToLong(lim)
7677 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7678 ListKeepInside, ListRemoveInside,
7679 Limit, RemoveWebs, ListMaterials,
7680 KeepNonlimitShapes);
7681 RaiseIfFailed("MakePartition", self.BoolOp)
7682 self._autoPublish(anObj, theName, "partition")
7685 ## Perform partition operation.
7686 # This method may be useful if it is needed to make a partition for
7687 # compound contains nonintersected shapes. Performance will be better
7688 # since intersection between shapes from compound is not performed.
7690 # Description of all parameters as in previous method MakePartition().
7691 # One additional parameter is provided:
7692 # @param checkSelfInte The flag that tells if the arguments should
7693 # be checked for self-intersection prior to the operation.
7695 # @note This algorithm doesn't find all types of self-intersections.
7696 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7697 # vertex/face and edge/face intersections. Face/face
7698 # intersections detection is switched off as it is a
7699 # time-consuming operation that gives an impact on performance.
7700 # To find all self-intersections please use
7701 # CheckSelfIntersections() method.
7703 # @note Passed compounds (via ListShapes or via ListTools)
7704 # have to consist of nonintersecting shapes.
7706 # @return New GEOM.GEOM_Object, containing the result shapes.
7708 # @ref swig_todo "Example"
7709 @ManageTransactions("BoolOp")
7710 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7711 ListKeepInside=[], ListRemoveInside=[],
7712 Limit=ShapeType["AUTO"], RemoveWebs=0,
7713 ListMaterials=[], KeepNonlimitShapes=0,
7714 checkSelfInte=False, theName=None):
7716 Perform partition operation.
7717 This method may be useful if it is needed to make a partition for
7718 compound contains nonintersected shapes. Performance will be better
7719 since intersection between shapes from compound is not performed.
7722 Description of all parameters as in method geompy.MakePartition.
7723 One additional parameter is provided:
7724 checkSelfInte The flag that tells if the arguments should
7725 be checked for self-intersection prior to
7729 This algorithm doesn't find all types of self-intersections.
7730 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7731 vertex/face and edge/face intersections. Face/face
7732 intersections detection is switched off as it is a
7733 time-consuming operation that gives an impact on performance.
7734 To find all self-intersections please use
7735 CheckSelfIntersections() method.
7738 Passed compounds (via ListShapes or via ListTools)
7739 have to consist of nonintersecting shapes.
7742 New GEOM.GEOM_Object, containing the result shapes.
7744 if Limit == self.ShapeType["AUTO"]:
7745 # automatic detection of the most appropriate shape limit type
7747 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7748 Limit = EnumToLong(lim)
7750 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7751 ListKeepInside, ListRemoveInside,
7752 Limit, RemoveWebs, ListMaterials,
7753 KeepNonlimitShapes, checkSelfInte);
7754 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7755 self._autoPublish(anObj, theName, "partition")
7758 ## See method MakePartition() for more information.
7760 # @ref tui_partition "Example 1"
7761 # \n @ref swig_Partition "Example 2"
7762 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7763 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7764 KeepNonlimitShapes=0, theName=None):
7766 See method geompy.MakePartition for more information.
7768 # Example: see GEOM_TestOthers.py
7769 # note: auto-publishing is done in self.MakePartition()
7770 anObj = self.MakePartition(ListShapes, ListTools,
7771 ListKeepInside, ListRemoveInside,
7772 Limit, RemoveWebs, ListMaterials,
7773 KeepNonlimitShapes, theName);
7776 ## Perform partition of the Shape with the Plane
7777 # @param theShape Shape to be intersected.
7778 # @param thePlane Tool shape, to intersect theShape.
7779 # @param theName Object name; when specified, this parameter is used
7780 # for result publication in the study. Otherwise, if automatic
7781 # publication is switched on, default value is used for result name.
7783 # @return New GEOM.GEOM_Object, containing the result shape.
7785 # @ref tui_partition "Example"
7786 @ManageTransactions("BoolOp")
7787 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7789 Perform partition of the Shape with the Plane
7792 theShape Shape to be intersected.
7793 thePlane Tool shape, to intersect theShape.
7794 theName Object name; when specified, this parameter is used
7795 for result publication in the study. Otherwise, if automatic
7796 publication is switched on, default value is used for result name.
7799 New GEOM.GEOM_Object, containing the result shape.
7801 # Example: see GEOM_TestAll.py
7802 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7803 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7804 self._autoPublish(anObj, theName, "partition")
7807 # end of l3_basic_op
7810 ## @addtogroup l3_transform
7813 ## Translate the given object along the vector, specified
7814 # by its end points.
7815 # @param theObject The object to be translated.
7816 # @param thePoint1 Start point of translation vector.
7817 # @param thePoint2 End point of translation vector.
7818 # @param theCopy Flag used to translate object itself or create a copy.
7819 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7820 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7821 @ManageTransactions("TrsfOp")
7822 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7824 Translate the given object along the vector, specified by its end points.
7827 theObject The object to be translated.
7828 thePoint1 Start point of translation vector.
7829 thePoint2 End point of translation vector.
7830 theCopy Flag used to translate object itself or create a copy.
7833 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7834 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7837 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7839 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7840 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7843 ## Translate the given object along the vector, specified
7844 # by its end points, creating its copy before the translation.
7845 # @param theObject The object to be translated.
7846 # @param thePoint1 Start point of translation vector.
7847 # @param thePoint2 End point of translation vector.
7848 # @param theName Object name; when specified, this parameter is used
7849 # for result publication in the study. Otherwise, if automatic
7850 # publication is switched on, default value is used for result name.
7852 # @return New GEOM.GEOM_Object, containing the translated object.
7854 # @ref tui_translation "Example 1"
7855 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7856 @ManageTransactions("TrsfOp")
7857 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7859 Translate the given object along the vector, specified
7860 by its end points, creating its copy before the translation.
7863 theObject The object to be translated.
7864 thePoint1 Start point of translation vector.
7865 thePoint2 End point of translation vector.
7866 theName Object name; when specified, this parameter is used
7867 for result publication in the study. Otherwise, if automatic
7868 publication is switched on, default value is used for result name.
7871 New GEOM.GEOM_Object, containing the translated object.
7873 # Example: see GEOM_TestAll.py
7874 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7875 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7876 self._autoPublish(anObj, theName, "translated")
7879 ## Translate the given object along the vector, specified by its components.
7880 # @param theObject The object to be translated.
7881 # @param theDX,theDY,theDZ Components of translation vector.
7882 # @param theCopy Flag used to translate object itself or create a copy.
7883 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7884 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7886 # @ref tui_translation "Example"
7887 @ManageTransactions("TrsfOp")
7888 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7890 Translate the given object along the vector, specified by its components.
7893 theObject The object to be translated.
7894 theDX,theDY,theDZ Components of translation vector.
7895 theCopy Flag used to translate object itself or create a copy.
7898 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7899 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7901 # Example: see GEOM_TestAll.py
7902 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7904 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7906 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7907 anObj.SetParameters(Parameters)
7908 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7911 ## Translate the given object along the vector, specified
7912 # by its components, creating its copy before the translation.
7913 # @param theObject The object to be translated.
7914 # @param theDX,theDY,theDZ Components of translation vector.
7915 # @param theName Object name; when specified, this parameter is used
7916 # for result publication in the study. Otherwise, if automatic
7917 # publication is switched on, default value is used for result name.
7919 # @return New GEOM.GEOM_Object, containing the translated object.
7921 # @ref tui_translation "Example"
7922 @ManageTransactions("TrsfOp")
7923 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7925 Translate the given object along the vector, specified
7926 by its components, creating its copy before the translation.
7929 theObject The object to be translated.
7930 theDX,theDY,theDZ Components of translation vector.
7931 theName Object name; when specified, this parameter is used
7932 for result publication in the study. Otherwise, if automatic
7933 publication is switched on, default value is used for result name.
7936 New GEOM.GEOM_Object, containing the translated object.
7938 # Example: see GEOM_TestAll.py
7939 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7940 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7941 anObj.SetParameters(Parameters)
7942 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7943 self._autoPublish(anObj, theName, "translated")
7946 ## Translate the given object along the given vector.
7947 # @param theObject The object to be translated.
7948 # @param theVector The translation vector.
7949 # @param theCopy Flag used to translate object itself or create a copy.
7950 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7951 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7952 @ManageTransactions("TrsfOp")
7953 def TranslateVector(self, theObject, theVector, theCopy=False):
7955 Translate the given object along the given vector.
7958 theObject The object to be translated.
7959 theVector The translation vector.
7960 theCopy Flag used to translate object itself or create a copy.
7963 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7964 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7967 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7969 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7970 RaiseIfFailed("TranslateVector", self.TrsfOp)
7973 ## Translate the given object along the given vector,
7974 # creating its copy before the translation.
7975 # @param theObject The object to be translated.
7976 # @param theVector The translation vector.
7977 # @param theName Object name; when specified, this parameter is used
7978 # for result publication in the study. Otherwise, if automatic
7979 # publication is switched on, default value is used for result name.
7981 # @return New GEOM.GEOM_Object, containing the translated object.
7983 # @ref tui_translation "Example"
7984 @ManageTransactions("TrsfOp")
7985 def MakeTranslationVector(self, theObject, theVector, theName=None):
7987 Translate the given object along the given vector,
7988 creating its copy before the translation.
7991 theObject The object to be translated.
7992 theVector The translation vector.
7993 theName Object name; when specified, this parameter is used
7994 for result publication in the study. Otherwise, if automatic
7995 publication is switched on, default value is used for result name.
7998 New GEOM.GEOM_Object, containing the translated object.
8000 # Example: see GEOM_TestAll.py
8001 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8002 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8003 self._autoPublish(anObj, theName, "translated")
8006 ## Translate the given object along the given vector on given distance.
8007 # @param theObject The object to be translated.
8008 # @param theVector The translation vector.
8009 # @param theDistance The translation distance.
8010 # @param theCopy Flag used to translate object itself or create a copy.
8011 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8012 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8014 # @ref tui_translation "Example"
8015 @ManageTransactions("TrsfOp")
8016 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8018 Translate the given object along the given vector on given distance.
8021 theObject The object to be translated.
8022 theVector The translation vector.
8023 theDistance The translation distance.
8024 theCopy Flag used to translate object itself or create a copy.
8027 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8028 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8030 # Example: see GEOM_TestAll.py
8031 theDistance,Parameters = ParseParameters(theDistance)
8032 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8033 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8034 anObj.SetParameters(Parameters)
8037 ## Translate the given object along the given vector on given distance,
8038 # creating its copy before the translation.
8039 # @param theObject The object to be translated.
8040 # @param theVector The translation vector.
8041 # @param theDistance The translation distance.
8042 # @param theName Object name; when specified, this parameter is used
8043 # for result publication in the study. Otherwise, if automatic
8044 # publication is switched on, default value is used for result name.
8046 # @return New GEOM.GEOM_Object, containing the translated object.
8048 # @ref tui_translation "Example"
8049 @ManageTransactions("TrsfOp")
8050 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8052 Translate the given object along the given vector on given distance,
8053 creating its copy before the translation.
8056 theObject The object to be translated.
8057 theVector The translation vector.
8058 theDistance The translation distance.
8059 theName Object name; when specified, this parameter is used
8060 for result publication in the study. Otherwise, if automatic
8061 publication is switched on, default value is used for result name.
8064 New GEOM.GEOM_Object, containing the translated object.
8066 # Example: see GEOM_TestAll.py
8067 theDistance,Parameters = ParseParameters(theDistance)
8068 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8069 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8070 anObj.SetParameters(Parameters)
8071 self._autoPublish(anObj, theName, "translated")
8074 ## Rotate the given object around the given axis on the given angle.
8075 # @param theObject The object to be rotated.
8076 # @param theAxis Rotation axis.
8077 # @param theAngle Rotation angle in radians.
8078 # @param theCopy Flag used to rotate object itself or create a copy.
8080 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8081 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8083 # @ref tui_rotation "Example"
8084 @ManageTransactions("TrsfOp")
8085 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8087 Rotate the given object around the given axis on the given angle.
8090 theObject The object to be rotated.
8091 theAxis Rotation axis.
8092 theAngle Rotation angle in radians.
8093 theCopy Flag used to rotate object itself or create a copy.
8096 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8097 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8099 # Example: see GEOM_TestAll.py
8101 if isinstance(theAngle,str):
8103 theAngle, Parameters = ParseParameters(theAngle)
8105 theAngle = theAngle*math.pi/180.0
8107 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8109 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8110 RaiseIfFailed("Rotate", self.TrsfOp)
8111 anObj.SetParameters(Parameters)
8114 ## Rotate the given object around the given axis
8115 # on the given angle, creating its copy before the rotation.
8116 # @param theObject The object to be rotated.
8117 # @param theAxis Rotation axis.
8118 # @param theAngle Rotation angle in radians.
8119 # @param theName Object name; when specified, this parameter is used
8120 # for result publication in the study. Otherwise, if automatic
8121 # publication is switched on, default value is used for result name.
8123 # @return New GEOM.GEOM_Object, containing the rotated object.
8125 # @ref tui_rotation "Example"
8126 @ManageTransactions("TrsfOp")
8127 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8129 Rotate the given object around the given axis
8130 on the given angle, creating its copy before the rotatation.
8133 theObject The object to be rotated.
8134 theAxis Rotation axis.
8135 theAngle Rotation angle in radians.
8136 theName Object name; when specified, this parameter is used
8137 for result publication in the study. Otherwise, if automatic
8138 publication is switched on, default value is used for result name.
8141 New GEOM.GEOM_Object, containing the rotated object.
8143 # Example: see GEOM_TestAll.py
8145 if isinstance(theAngle,str):
8147 theAngle, Parameters = ParseParameters(theAngle)
8149 theAngle = theAngle*math.pi/180.0
8150 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8151 RaiseIfFailed("RotateCopy", self.TrsfOp)
8152 anObj.SetParameters(Parameters)
8153 self._autoPublish(anObj, theName, "rotated")
8156 ## Rotate given object around vector perpendicular to plane
8157 # containing three points.
8158 # @param theObject The object to be rotated.
8159 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8160 # containing the three points.
8161 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8162 # @param theCopy Flag used to rotate object itself or create a copy.
8163 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8164 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8165 @ManageTransactions("TrsfOp")
8166 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8168 Rotate given object around vector perpendicular to plane
8169 containing three points.
8172 theObject The object to be rotated.
8173 theCentPoint central point the axis is the vector perpendicular to the plane
8174 containing the three points.
8175 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8176 theCopy Flag used to rotate object itself or create a copy.
8179 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8180 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8183 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8185 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8186 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8189 ## Rotate given object around vector perpendicular to plane
8190 # containing three points, creating its copy before the rotatation.
8191 # @param theObject The object to be rotated.
8192 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8193 # containing the three points.
8194 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8195 # @param theName Object name; when specified, this parameter is used
8196 # for result publication in the study. Otherwise, if automatic
8197 # publication is switched on, default value is used for result name.
8199 # @return New GEOM.GEOM_Object, containing the rotated object.
8201 # @ref tui_rotation "Example"
8202 @ManageTransactions("TrsfOp")
8203 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8205 Rotate given object around vector perpendicular to plane
8206 containing three points, creating its copy before the rotatation.
8209 theObject The object to be rotated.
8210 theCentPoint central point the axis is the vector perpendicular to the plane
8211 containing the three points.
8212 thePoint1,thePoint2 in a perpendicular plane of the axis.
8213 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.
8218 New GEOM.GEOM_Object, containing the rotated object.
8220 # Example: see GEOM_TestAll.py
8221 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8222 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8223 self._autoPublish(anObj, theName, "rotated")
8226 ## Scale the given object by the specified factor.
8227 # @param theObject The object to be scaled.
8228 # @param thePoint Center point for scaling.
8229 # Passing None for it means scaling relatively the origin of global CS.
8230 # @param theFactor Scaling factor value.
8231 # @param theCopy Flag used to scale object itself or create a copy.
8232 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8233 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8234 @ManageTransactions("TrsfOp")
8235 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8237 Scale the given object by the specified factor.
8240 theObject The object to be scaled.
8241 thePoint Center point for scaling.
8242 Passing None for it means scaling relatively the origin of global CS.
8243 theFactor Scaling factor value.
8244 theCopy Flag used to scale object itself or create a copy.
8247 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8248 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8250 # Example: see GEOM_TestAll.py
8251 theFactor, Parameters = ParseParameters(theFactor)
8253 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8255 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8256 RaiseIfFailed("Scale", self.TrsfOp)
8257 anObj.SetParameters(Parameters)
8260 ## Scale the given object by the factor, creating its copy before the scaling.
8261 # @param theObject The object to be scaled.
8262 # @param thePoint Center point for scaling.
8263 # Passing None for it means scaling relatively the origin of global CS.
8264 # @param theFactor Scaling factor value.
8265 # @param theName Object name; when specified, this parameter is used
8266 # for result publication in the study. Otherwise, if automatic
8267 # publication is switched on, default value is used for result name.
8269 # @return New GEOM.GEOM_Object, containing the scaled shape.
8271 # @ref tui_scale "Example"
8272 @ManageTransactions("TrsfOp")
8273 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8275 Scale the given object by the factor, creating its copy before the scaling.
8278 theObject The object to be scaled.
8279 thePoint Center point for scaling.
8280 Passing None for it means scaling relatively the origin of global CS.
8281 theFactor Scaling factor value.
8282 theName Object name; when specified, this parameter is used
8283 for result publication in the study. Otherwise, if automatic
8284 publication is switched on, default value is used for result name.
8287 New GEOM.GEOM_Object, containing the scaled shape.
8289 # Example: see GEOM_TestAll.py
8290 theFactor, Parameters = ParseParameters(theFactor)
8291 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8292 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8293 anObj.SetParameters(Parameters)
8294 self._autoPublish(anObj, theName, "scaled")
8297 ## Scale the given object by different factors along coordinate axes.
8298 # @param theObject The object to be scaled.
8299 # @param thePoint Center point for scaling.
8300 # Passing None for it means scaling relatively the origin of global CS.
8301 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8302 # @param theCopy Flag used to scale object itself or create a copy.
8303 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8304 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8305 @ManageTransactions("TrsfOp")
8306 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8308 Scale the given object by different factors along coordinate axes.
8311 theObject The object to be scaled.
8312 thePoint Center point for scaling.
8313 Passing None for it means scaling relatively the origin of global CS.
8314 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8315 theCopy Flag used to scale object itself or create a copy.
8318 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8319 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8321 # Example: see GEOM_TestAll.py
8322 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8324 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8325 theFactorX, theFactorY, theFactorZ)
8327 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8328 theFactorX, theFactorY, theFactorZ)
8329 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8330 anObj.SetParameters(Parameters)
8333 ## Scale the given object by different factors along coordinate axes,
8334 # creating its copy before the scaling.
8335 # @param theObject The object to be scaled.
8336 # @param thePoint Center point for scaling.
8337 # Passing None for it means scaling relatively the origin of global CS.
8338 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8339 # @param theName Object name; when specified, this parameter is used
8340 # for result publication in the study. Otherwise, if automatic
8341 # publication is switched on, default value is used for result name.
8343 # @return New GEOM.GEOM_Object, containing the scaled shape.
8345 # @ref swig_scale "Example"
8346 @ManageTransactions("TrsfOp")
8347 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8349 Scale the given object by different factors along coordinate axes,
8350 creating its copy before the scaling.
8353 theObject The object to be scaled.
8354 thePoint Center point for scaling.
8355 Passing None for it means scaling relatively the origin of global CS.
8356 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8357 theName Object name; when specified, this parameter is used
8358 for result publication in the study. Otherwise, if automatic
8359 publication is switched on, default value is used for result name.
8362 New GEOM.GEOM_Object, containing the scaled shape.
8364 # Example: see GEOM_TestAll.py
8365 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8366 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8367 theFactorX, theFactorY, theFactorZ)
8368 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8369 anObj.SetParameters(Parameters)
8370 self._autoPublish(anObj, theName, "scaled")
8373 ## Mirror an object relatively the given plane.
8374 # @param theObject The object to be mirrored.
8375 # @param thePlane Plane of symmetry.
8376 # @param theCopy Flag used to mirror object itself or create a copy.
8377 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8378 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8379 @ManageTransactions("TrsfOp")
8380 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8382 Mirror an object relatively the given plane.
8385 theObject The object to be mirrored.
8386 thePlane Plane of symmetry.
8387 theCopy Flag used to mirror object itself or create a copy.
8390 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8391 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8394 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8396 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8397 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8400 ## Create an object, symmetrical
8401 # to the given one relatively the given plane.
8402 # @param theObject The object to be mirrored.
8403 # @param thePlane Plane of symmetry.
8404 # @param theName Object name; when specified, this parameter is used
8405 # for result publication in the study. Otherwise, if automatic
8406 # publication is switched on, default value is used for result name.
8408 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8410 # @ref tui_mirror "Example"
8411 @ManageTransactions("TrsfOp")
8412 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8414 Create an object, symmetrical to the given one relatively the given plane.
8417 theObject The object to be mirrored.
8418 thePlane Plane of symmetry.
8419 theName Object name; when specified, this parameter is used
8420 for result publication in the study. Otherwise, if automatic
8421 publication is switched on, default value is used for result name.
8424 New GEOM.GEOM_Object, containing the mirrored shape.
8426 # Example: see GEOM_TestAll.py
8427 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8428 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8429 self._autoPublish(anObj, theName, "mirrored")
8432 ## Mirror an object relatively the given axis.
8433 # @param theObject The object to be mirrored.
8434 # @param theAxis Axis of symmetry.
8435 # @param theCopy Flag used to mirror object itself or create a copy.
8436 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8437 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8438 @ManageTransactions("TrsfOp")
8439 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8441 Mirror an object relatively the given axis.
8444 theObject The object to be mirrored.
8445 theAxis Axis of symmetry.
8446 theCopy Flag used to mirror object itself or create a copy.
8449 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8450 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8453 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8455 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8456 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8459 ## Create an object, symmetrical
8460 # to the given one relatively the given axis.
8461 # @param theObject The object to be mirrored.
8462 # @param theAxis Axis of symmetry.
8463 # @param theName Object name; when specified, this parameter is used
8464 # for result publication in the study. Otherwise, if automatic
8465 # publication is switched on, default value is used for result name.
8467 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8469 # @ref tui_mirror "Example"
8470 @ManageTransactions("TrsfOp")
8471 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8473 Create an object, symmetrical to the given one relatively the given axis.
8476 theObject The object to be mirrored.
8477 theAxis Axis of symmetry.
8478 theName Object name; when specified, this parameter is used
8479 for result publication in the study. Otherwise, if automatic
8480 publication is switched on, default value is used for result name.
8483 New GEOM.GEOM_Object, containing the mirrored shape.
8485 # Example: see GEOM_TestAll.py
8486 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8487 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8488 self._autoPublish(anObj, theName, "mirrored")
8491 ## Mirror an object relatively the given point.
8492 # @param theObject The object to be mirrored.
8493 # @param thePoint Point of symmetry.
8494 # @param theCopy Flag used to mirror object itself or create a copy.
8495 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8496 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8497 @ManageTransactions("TrsfOp")
8498 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8500 Mirror an object relatively the given point.
8503 theObject The object to be mirrored.
8504 thePoint Point of symmetry.
8505 theCopy Flag used to mirror object itself or create a copy.
8508 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8509 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8511 # Example: see GEOM_TestAll.py
8513 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8515 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8516 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8519 ## Create an object, symmetrical
8520 # to the given one relatively the given point.
8521 # @param theObject The object to be mirrored.
8522 # @param thePoint Point of symmetry.
8523 # @param theName Object name; when specified, this parameter is used
8524 # for result publication in the study. Otherwise, if automatic
8525 # publication is switched on, default value is used for result name.
8527 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8529 # @ref tui_mirror "Example"
8530 @ManageTransactions("TrsfOp")
8531 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8533 Create an object, symmetrical
8534 to the given one relatively the given point.
8537 theObject The object to be mirrored.
8538 thePoint Point of symmetry.
8539 theName Object name; when specified, this parameter is used
8540 for result publication in the study. Otherwise, if automatic
8541 publication is switched on, default value is used for result name.
8544 New GEOM.GEOM_Object, containing the mirrored shape.
8546 # Example: see GEOM_TestAll.py
8547 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8548 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8549 self._autoPublish(anObj, theName, "mirrored")
8552 ## Modify the location of the given object.
8553 # @param theObject The object to be displaced.
8554 # @param theStartLCS Coordinate system to perform displacement from it.\n
8555 # If \a theStartLCS is NULL, displacement
8556 # will be performed from global CS.\n
8557 # If \a theObject itself is used as \a theStartLCS,
8558 # its location will be changed to \a theEndLCS.
8559 # @param theEndLCS Coordinate system to perform displacement to it.
8560 # @param theCopy Flag used to displace object itself or create a copy.
8561 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8562 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8563 @ManageTransactions("TrsfOp")
8564 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8566 Modify the Location of the given object by LCS, creating its copy before the setting.
8569 theObject The object to be displaced.
8570 theStartLCS Coordinate system to perform displacement from it.
8571 If theStartLCS is NULL, displacement
8572 will be performed from global CS.
8573 If theObject itself is used as theStartLCS,
8574 its location will be changed to theEndLCS.
8575 theEndLCS Coordinate system to perform displacement to it.
8576 theCopy Flag used to displace object itself or create a copy.
8579 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8580 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8582 # Example: see GEOM_TestAll.py
8584 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8586 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8587 RaiseIfFailed("Displace", self.TrsfOp)
8590 ## Modify the Location of the given object by LCS,
8591 # creating its copy before the setting.
8592 # @param theObject The object to be displaced.
8593 # @param theStartLCS Coordinate system to perform displacement from it.\n
8594 # If \a theStartLCS is NULL, displacement
8595 # will be performed from global CS.\n
8596 # If \a theObject itself is used as \a theStartLCS,
8597 # its location will be changed to \a theEndLCS.
8598 # @param theEndLCS Coordinate system to perform displacement to it.
8599 # @param theName Object name; when specified, this parameter is used
8600 # for result publication in the study. Otherwise, if automatic
8601 # publication is switched on, default value is used for result name.
8603 # @return New GEOM.GEOM_Object, containing the displaced shape.
8605 # @ref tui_modify_location "Example"
8606 @ManageTransactions("TrsfOp")
8607 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8609 Modify the Location of the given object by LCS, creating its copy before the setting.
8612 theObject The object to be displaced.
8613 theStartLCS Coordinate system to perform displacement from it.
8614 If theStartLCS is NULL, displacement
8615 will be performed from global CS.
8616 If theObject itself is used as theStartLCS,
8617 its location will be changed to theEndLCS.
8618 theEndLCS Coordinate system to perform displacement to it.
8619 theName Object name; when specified, this parameter is used
8620 for result publication in the study. Otherwise, if automatic
8621 publication is switched on, default value is used for result name.
8624 New GEOM.GEOM_Object, containing the displaced shape.
8627 # create local coordinate systems
8628 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8629 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8630 # modify the location of the given object
8631 position = geompy.MakePosition(cylinder, cs1, cs2)
8633 # Example: see GEOM_TestAll.py
8634 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8635 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8636 self._autoPublish(anObj, theName, "displaced")
8639 ## Modify the Location of the given object by Path.
8640 # @param theObject The object to be displaced.
8641 # @param thePath Wire or Edge along that the object will be translated.
8642 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8643 # @param theCopy is to create a copy objects if true.
8644 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8645 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8646 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8648 # @ref tui_modify_location "Example"
8649 @ManageTransactions("TrsfOp")
8650 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8652 Modify the Location of the given object by Path.
8655 theObject The object to be displaced.
8656 thePath Wire or Edge along that the object will be translated.
8657 theDistance progress of Path (0 = start location, 1 = end of path location).
8658 theCopy is to create a copy objects if true.
8659 theReverse 0 - for usual direction, 1 - to reverse path direction.
8662 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8663 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8666 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8668 # Example: see GEOM_TestAll.py
8669 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8670 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8673 ## Modify the Location of the given object by Path, creating its copy before the operation.
8674 # @param theObject The object to be displaced.
8675 # @param thePath Wire or Edge along that the object will be translated.
8676 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8677 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8678 # @param theName Object name; when specified, this parameter is used
8679 # for result publication in the study. Otherwise, if automatic
8680 # publication is switched on, default value is used for result name.
8682 # @return New GEOM.GEOM_Object, containing the displaced shape.
8683 @ManageTransactions("TrsfOp")
8684 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8686 Modify the Location of the given object by Path, creating its copy before the operation.
8689 theObject The object to be displaced.
8690 thePath Wire or Edge along that the object will be translated.
8691 theDistance progress of Path (0 = start location, 1 = end of path location).
8692 theReverse 0 - for usual direction, 1 - to reverse path direction.
8693 theName Object name; when specified, this parameter is used
8694 for result publication in the study. Otherwise, if automatic
8695 publication is switched on, default value is used for result name.
8698 New GEOM.GEOM_Object, containing the displaced shape.
8700 # Example: see GEOM_TestAll.py
8701 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8702 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8703 self._autoPublish(anObj, theName, "displaced")
8706 ## Offset given shape.
8707 # @param theObject The base object for the offset.
8708 # @param theOffset Offset value.
8709 # @param theCopy Flag used to offset object itself or create a copy.
8710 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8711 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8712 @ManageTransactions("TrsfOp")
8713 def Offset(self, theObject, theOffset, theCopy=False):
8718 theObject The base object for the offset.
8719 theOffset Offset value.
8720 theCopy Flag used to offset object itself or create a copy.
8723 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8724 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8726 theOffset, Parameters = ParseParameters(theOffset)
8728 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8730 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8731 RaiseIfFailed("Offset", self.TrsfOp)
8732 anObj.SetParameters(Parameters)
8735 ## Create new object as offset of the given one.
8736 # @param theObject The base object for the offset.
8737 # @param theOffset Offset value.
8738 # @param theName Object name; when specified, this parameter is used
8739 # for result publication in the study. Otherwise, if automatic
8740 # publication is switched on, default value is used for result name.
8742 # @return New GEOM.GEOM_Object, containing the offset object.
8744 # @ref tui_offset "Example"
8745 @ManageTransactions("TrsfOp")
8746 def MakeOffset(self, theObject, theOffset, theName=None):
8748 Create new object as offset of the given one.
8751 theObject The base object for the offset.
8752 theOffset Offset value.
8753 theName Object name; when specified, this parameter is used
8754 for result publication in the study. Otherwise, if automatic
8755 publication is switched on, default value is used for result name.
8758 New GEOM.GEOM_Object, containing the offset object.
8761 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8762 # create a new object as offset of the given object
8763 offset = geompy.MakeOffset(box, 70.)
8765 # Example: see GEOM_TestAll.py
8766 theOffset, Parameters = ParseParameters(theOffset)
8767 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8768 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8769 anObj.SetParameters(Parameters)
8770 self._autoPublish(anObj, theName, "offset")
8773 ## Create new object as projection of the given one on a 2D surface.
8774 # @param theSource The source object for the projection. It can be a point, edge or wire.
8775 # @param theTarget The target object. It can be planar or cylindrical face.
8776 # @param theName Object name; when specified, this parameter is used
8777 # for result publication in the study. Otherwise, if automatic
8778 # publication is switched on, default value is used for result name.
8780 # @return New GEOM.GEOM_Object, containing the projection.
8782 # @ref tui_projection "Example"
8783 @ManageTransactions("TrsfOp")
8784 def MakeProjection(self, theSource, theTarget, theName=None):
8786 Create new object as projection of the given one on a 2D surface.
8789 theSource The source object for the projection. It can be a point, edge or wire.
8790 theTarget The target object. It can be planar or cylindrical face.
8791 theName Object name; when specified, this parameter is used
8792 for result publication in the study. Otherwise, if automatic
8793 publication is switched on, default value is used for result name.
8796 New GEOM.GEOM_Object, containing the projection.
8798 # Example: see GEOM_TestAll.py
8799 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8800 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8801 self._autoPublish(anObj, theName, "projection")
8804 ## Create a projection projection of the given point on a wire or an edge.
8805 # If there are no solutions or there are 2 or more solutions It throws an
8807 # @param thePoint the point to be projected.
8808 # @param theWire the wire. The edge is accepted as well.
8809 # @param theName Object name; when specified, this parameter is used
8810 # for result publication in the study. Otherwise, if automatic
8811 # publication is switched on, default value is used for result name.
8813 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8814 # \n \a u: The parameter of projection point on edge.
8815 # \n \a PointOnEdge: The projection point.
8816 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8818 # @ref tui_projection "Example"
8819 @ManageTransactions("TrsfOp")
8820 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8822 Create a projection projection of the given point on a wire or an edge.
8823 If there are no solutions or there are 2 or more solutions It throws an
8827 thePoint the point to be projected.
8828 theWire the wire. The edge is accepted as well.
8829 theName Object name; when specified, this parameter is used
8830 for result publication in the study. Otherwise, if automatic
8831 publication is switched on, default value is used for result name.
8834 [u, PointOnEdge, EdgeInWireIndex]
8835 u: The parameter of projection point on edge.
8836 PointOnEdge: The projection point.
8837 EdgeInWireIndex: The index of an edge in a wire.
8839 # Example: see GEOM_TestAll.py
8840 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8841 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8842 self._autoPublish(anObj[1], theName, "projection")
8845 # -----------------------------------------------------------------------------
8847 # -----------------------------------------------------------------------------
8849 ## Translate the given object along the given vector a given number times
8850 # @param theObject The object to be translated.
8851 # @param theVector Direction of the translation. DX if None.
8852 # @param theStep Distance to translate on.
8853 # @param theNbTimes Quantity of translations to be done.
8854 # @param theName Object name; when specified, this parameter is used
8855 # for result publication in the study. Otherwise, if automatic
8856 # publication is switched on, default value is used for result name.
8858 # @return New GEOM.GEOM_Object, containing compound of all
8859 # the shapes, obtained after each translation.
8861 # @ref tui_multi_translation "Example"
8862 @ManageTransactions("TrsfOp")
8863 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8865 Translate the given object along the given vector a given number times
8868 theObject The object to be translated.
8869 theVector Direction of the translation. DX if None.
8870 theStep Distance to translate on.
8871 theNbTimes Quantity of translations to be done.
8872 theName Object name; when specified, this parameter is used
8873 for result publication in the study. Otherwise, if automatic
8874 publication is switched on, default value is used for result name.
8877 New GEOM.GEOM_Object, containing compound of all
8878 the shapes, obtained after each translation.
8881 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8883 # Example: see GEOM_TestAll.py
8884 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8885 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8886 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8887 anObj.SetParameters(Parameters)
8888 self._autoPublish(anObj, theName, "multitranslation")
8891 ## Conseqently apply two specified translations to theObject specified number of times.
8892 # @param theObject The object to be translated.
8893 # @param theVector1 Direction of the first translation. DX if None.
8894 # @param theStep1 Step of the first translation.
8895 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8896 # @param theVector2 Direction of the second translation. DY if None.
8897 # @param theStep2 Step of the second translation.
8898 # @param theNbTimes2 Quantity of translations to be done along theVector2.
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
8904 # the shapes, obtained after each translation.
8906 # @ref tui_multi_translation "Example"
8907 @ManageTransactions("TrsfOp")
8908 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8909 theVector2, theStep2, theNbTimes2, theName=None):
8911 Conseqently apply two specified translations to theObject specified number of times.
8914 theObject The object to be translated.
8915 theVector1 Direction of the first translation. DX if None.
8916 theStep1 Step of the first translation.
8917 theNbTimes1 Quantity of translations to be done along theVector1.
8918 theVector2 Direction of the second translation. DY if None.
8919 theStep2 Step of the second translation.
8920 theNbTimes2 Quantity of translations to be done along theVector2.
8921 theName Object name; when specified, this parameter is used
8922 for result publication in the study. Otherwise, if automatic
8923 publication is switched on, default value is used for result name.
8926 New GEOM.GEOM_Object, containing compound of all
8927 the shapes, obtained after each translation.
8930 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8932 # Example: see GEOM_TestAll.py
8933 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8934 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8935 theVector2, theStep2, theNbTimes2)
8936 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8937 anObj.SetParameters(Parameters)
8938 self._autoPublish(anObj, theName, "multitranslation")
8941 ## Rotate the given object around the given axis a given number times.
8942 # Rotation angle will be 2*PI/theNbTimes.
8943 # @param theObject The object to be rotated.
8944 # @param theAxis The rotation axis. DZ if None.
8945 # @param theNbTimes Quantity of rotations to be done.
8946 # @param theName Object name; when specified, this parameter is used
8947 # for result publication in the study. Otherwise, if automatic
8948 # publication is switched on, default value is used for result name.
8950 # @return New GEOM.GEOM_Object, containing compound of all the
8951 # shapes, obtained after each rotation.
8953 # @ref tui_multi_rotation "Example"
8954 @ManageTransactions("TrsfOp")
8955 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8957 Rotate the given object around the given axis a given number times.
8958 Rotation angle will be 2*PI/theNbTimes.
8961 theObject The object to be rotated.
8962 theAxis The rotation axis. DZ if None.
8963 theNbTimes Quantity of rotations to be done.
8964 theName Object name; when specified, this parameter is used
8965 for result publication in the study. Otherwise, if automatic
8966 publication is switched on, default value is used for result name.
8969 New GEOM.GEOM_Object, containing compound of all the
8970 shapes, obtained after each rotation.
8973 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8975 # Example: see GEOM_TestAll.py
8976 theNbTimes, Parameters = ParseParameters(theNbTimes)
8977 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8978 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8979 anObj.SetParameters(Parameters)
8980 self._autoPublish(anObj, theName, "multirotation")
8983 ## Rotate the given object around the given axis
8984 # a given number times on the given angle.
8985 # @param theObject The object to be rotated.
8986 # @param theAxis The rotation axis. DZ if None.
8987 # @param theAngleStep Rotation angle in radians.
8988 # @param theNbTimes Quantity of rotations to be done.
8989 # @param theName Object name; when specified, this parameter is used
8990 # for result publication in the study. Otherwise, if automatic
8991 # publication is switched on, default value is used for result name.
8993 # @return New GEOM.GEOM_Object, containing compound of all the
8994 # shapes, obtained after each rotation.
8996 # @ref tui_multi_rotation "Example"
8997 @ManageTransactions("TrsfOp")
8998 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9000 Rotate the given object around the given axis
9001 a given number times on the given angle.
9004 theObject The object to be rotated.
9005 theAxis The rotation axis. DZ if None.
9006 theAngleStep Rotation angle in radians.
9007 theNbTimes Quantity of rotations to be done.
9008 theName Object name; when specified, this parameter is used
9009 for result publication in the study. Otherwise, if automatic
9010 publication is switched on, default value is used for result name.
9013 New GEOM.GEOM_Object, containing compound of all the
9014 shapes, obtained after each rotation.
9017 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9019 # Example: see GEOM_TestAll.py
9020 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9021 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9022 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9023 anObj.SetParameters(Parameters)
9024 self._autoPublish(anObj, theName, "multirotation")
9027 ## Rotate the given object around the given axis a given
9028 # number times and multi-translate each rotation result.
9029 # Rotation angle will be 2*PI/theNbTimes1.
9030 # Translation direction passes through center of gravity
9031 # of rotated shape and its projection on the rotation axis.
9032 # @param theObject The object to be rotated.
9033 # @param theAxis Rotation axis. DZ if None.
9034 # @param theNbTimes1 Quantity of rotations to be done.
9035 # @param theRadialStep Translation distance.
9036 # @param theNbTimes2 Quantity of translations to be done.
9037 # @param theName Object name; when specified, this parameter is used
9038 # for result publication in the study. Otherwise, if automatic
9039 # publication is switched on, default value is used for result name.
9041 # @return New GEOM.GEOM_Object, containing compound of all the
9042 # shapes, obtained after each transformation.
9044 # @ref tui_multi_rotation "Example"
9045 @ManageTransactions("TrsfOp")
9046 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9048 Rotate the given object around the
9049 given axis on the given angle a given number
9050 times and multi-translate each rotation result.
9051 Translation direction passes through center of gravity
9052 of rotated shape and its projection on the rotation axis.
9055 theObject The object to be rotated.
9056 theAxis Rotation axis. DZ if None.
9057 theNbTimes1 Quantity of rotations to be done.
9058 theRadialStep Translation distance.
9059 theNbTimes2 Quantity of translations to be done.
9060 theName Object name; when specified, this parameter is used
9061 for result publication in the study. Otherwise, if automatic
9062 publication is switched on, default value is used for result name.
9065 New GEOM.GEOM_Object, containing compound of all the
9066 shapes, obtained after each transformation.
9069 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9071 # Example: see GEOM_TestAll.py
9072 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9073 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9074 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9075 anObj.SetParameters(Parameters)
9076 self._autoPublish(anObj, theName, "multirotation")
9079 ## Rotate the given object around the
9080 # given axis on the given angle a given number
9081 # times and multi-translate each rotation result.
9082 # Translation direction passes through center of gravity
9083 # of rotated shape and its projection on the rotation axis.
9084 # @param theObject The object to be rotated.
9085 # @param theAxis Rotation axis. DZ if None.
9086 # @param theAngleStep Rotation angle in radians.
9087 # @param theNbTimes1 Quantity of rotations to be done.
9088 # @param theRadialStep Translation distance.
9089 # @param theNbTimes2 Quantity of translations to be done.
9090 # @param theName Object name; when specified, this parameter is used
9091 # for result publication in the study. Otherwise, if automatic
9092 # publication is switched on, default value is used for result name.
9094 # @return New GEOM.GEOM_Object, containing compound of all the
9095 # shapes, obtained after each transformation.
9097 # @ref tui_multi_rotation "Example"
9098 @ManageTransactions("TrsfOp")
9099 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9101 Rotate the given object around the
9102 given axis on the given angle a given number
9103 times and multi-translate each rotation result.
9104 Translation direction passes through center of gravity
9105 of rotated shape and its projection on the rotation axis.
9108 theObject The object to be rotated.
9109 theAxis Rotation axis. DZ if None.
9110 theAngleStep Rotation angle in radians.
9111 theNbTimes1 Quantity of rotations to be done.
9112 theRadialStep Translation distance.
9113 theNbTimes2 Quantity of translations to be done.
9114 theName Object name; when specified, this parameter is used
9115 for result publication in the study. Otherwise, if automatic
9116 publication is switched on, default value is used for result name.
9119 New GEOM.GEOM_Object, containing compound of all the
9120 shapes, obtained after each transformation.
9123 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9125 # Example: see GEOM_TestAll.py
9126 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9127 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9128 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9129 anObj.SetParameters(Parameters)
9130 self._autoPublish(anObj, theName, "multirotation")
9133 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9135 # @ref swig_MakeMultiRotation "Example"
9136 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9138 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9141 pz = geompy.MakeVertex(0, 0, 100)
9142 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9143 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9145 # Example: see GEOM_TestOthers.py
9146 aVec = self.MakeLine(aPoint,aDir)
9147 # note: auto-publishing is done in self.MultiRotate1D()
9148 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9151 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9153 # @ref swig_MakeMultiRotation "Example"
9154 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9156 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9159 pz = geompy.MakeVertex(0, 0, 100)
9160 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9161 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9163 # Example: see GEOM_TestOthers.py
9164 aVec = self.MakeLine(aPoint,aDir)
9165 # note: auto-publishing is done in self.MultiRotate1D()
9166 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9169 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9171 # @ref swig_MakeMultiRotation "Example"
9172 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9174 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9177 pz = geompy.MakeVertex(0, 0, 100)
9178 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9179 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9181 # Example: see GEOM_TestOthers.py
9182 aVec = self.MakeLine(aPoint,aDir)
9183 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9184 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9187 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9189 # @ref swig_MakeMultiRotation "Example"
9190 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9192 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9195 pz = geompy.MakeVertex(0, 0, 100)
9196 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9197 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9199 # Example: see GEOM_TestOthers.py
9200 aVec = self.MakeLine(aPoint,aDir)
9201 # note: auto-publishing is done in self.MultiRotate2D()
9202 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9205 # end of l3_transform
9208 ## @addtogroup l3_transform_d
9211 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9212 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9214 Deprecated method. Use MultiRotate1DNbTimes instead.
9216 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9217 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9219 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9220 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9221 @ManageTransactions("TrsfOp")
9222 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9224 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9225 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9228 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9230 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9231 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9232 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9233 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9234 anObj.SetParameters(Parameters)
9235 self._autoPublish(anObj, theName, "multirotation")
9238 ## The same, as MultiRotate1D(), but axis is given by direction and point
9239 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9240 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9242 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9243 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9246 pz = geompy.MakeVertex(0, 0, 100)
9247 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9248 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9250 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9251 aVec = self.MakeLine(aPoint,aDir)
9252 # note: auto-publishing is done in self.MultiRotate1D()
9253 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9256 ## The same, as MultiRotate2D(), but axis is given by direction and point
9257 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9258 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9260 The same, as MultiRotate2D(), but axis is given by direction and point
9261 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9264 pz = geompy.MakeVertex(0, 0, 100)
9265 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9266 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9268 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9269 aVec = self.MakeLine(aPoint,aDir)
9270 # note: auto-publishing is done in self.MultiRotate2D()
9271 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9274 # end of l3_transform_d
9277 ## @addtogroup l3_local
9280 ## Perform a fillet on all edges of the given shape.
9281 # @param theShape Shape, to perform fillet on.
9282 # @param theR Fillet radius.
9283 # @param theName Object name; when specified, this parameter is used
9284 # for result publication in the study. Otherwise, if automatic
9285 # publication is switched on, default value is used for result name.
9287 # @return New GEOM.GEOM_Object, containing the result shape.
9289 # @ref tui_fillet "Example 1"
9290 # \n @ref swig_MakeFilletAll "Example 2"
9291 @ManageTransactions("LocalOp")
9292 def MakeFilletAll(self, theShape, theR, theName=None):
9294 Perform a fillet on all edges of the given shape.
9297 theShape Shape, to perform fillet on.
9299 theName Object name; when specified, this parameter is used
9300 for result publication in the study. Otherwise, if automatic
9301 publication is switched on, default value is used for result name.
9304 New GEOM.GEOM_Object, containing the result shape.
9307 filletall = geompy.MakeFilletAll(prism, 10.)
9309 # Example: see GEOM_TestOthers.py
9310 theR,Parameters = ParseParameters(theR)
9311 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9312 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9313 anObj.SetParameters(Parameters)
9314 self._autoPublish(anObj, theName, "fillet")
9317 ## Perform a fillet on the specified edges/faces of the given shape
9318 # @param theShape Shape, to perform fillet on.
9319 # @param theR Fillet radius.
9320 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9321 # @param theListShapes Global indices of edges/faces to perform fillet on.
9322 # @param theName Object name; when specified, this parameter is used
9323 # for result publication in the study. Otherwise, if automatic
9324 # publication is switched on, default value is used for result name.
9326 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9328 # @return New GEOM.GEOM_Object, containing the result shape.
9330 # @ref tui_fillet "Example"
9331 @ManageTransactions("LocalOp")
9332 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9334 Perform a fillet on the specified edges/faces of the given shape
9337 theShape Shape, to perform fillet on.
9339 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9340 theListShapes Global indices of edges/faces to perform fillet on.
9341 theName Object name; when specified, this parameter is used
9342 for result publication in the study. Otherwise, if automatic
9343 publication is switched on, default value is used for result name.
9346 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9349 New GEOM.GEOM_Object, containing the result shape.
9352 # get the list of IDs (IDList) for the fillet
9353 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9355 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9356 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9357 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9358 # make a fillet on the specified edges of the given shape
9359 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9361 # Example: see GEOM_TestAll.py
9362 theR,Parameters = ParseParameters(theR)
9364 if theShapeType == self.ShapeType["EDGE"]:
9365 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9366 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9368 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9369 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9370 anObj.SetParameters(Parameters)
9371 self._autoPublish(anObj, theName, "fillet")
9374 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9375 @ManageTransactions("LocalOp")
9376 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9378 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9381 # get the list of IDs (IDList) for the fillet
9382 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9384 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9385 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9386 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9387 # make a fillet on the specified edges of the given shape
9388 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9390 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9392 if theShapeType == self.ShapeType["EDGE"]:
9393 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9394 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9396 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9397 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9398 anObj.SetParameters(Parameters)
9399 self._autoPublish(anObj, theName, "fillet")
9402 ## Perform a fillet on the specified edges of the given shape
9403 # @param theShape Wire Shape to perform fillet on.
9404 # @param theR Fillet radius.
9405 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9406 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9407 # \note The list of vertices could be empty,
9408 # in this case fillet will done done at all vertices in wire
9409 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9410 # by the length of the edges, nearest to the fillet vertex.
9411 # But sometimes the next edge is C1 continuous with the one, nearest to
9412 # the fillet point, and such two (or more) edges can be united to allow
9413 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9414 # thus ignoring the secant vertex (vertices).
9415 # @param theName Object name; when specified, this parameter is used
9416 # for result publication in the study. Otherwise, if automatic
9417 # publication is switched on, default value is used for result name.
9419 # @return New GEOM.GEOM_Object, containing the result shape.
9421 # @ref tui_fillet2d "Example"
9422 @ManageTransactions("LocalOp")
9423 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9425 Perform a fillet on the specified edges of the given shape
9428 theShape Wire Shape to perform fillet on.
9430 theListOfVertexes Global indices of vertexes to perform fillet on.
9431 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9432 by the length of the edges, nearest to the fillet vertex.
9433 But sometimes the next edge is C1 continuous with the one, nearest to
9434 the fillet point, and such two (or more) edges can be united to allow
9435 bigger radius. Set this flag to TRUE to allow collinear edges union,
9436 thus ignoring the secant vertex (vertices).
9437 theName Object name; when specified, this parameter is used
9438 for result publication in the study. Otherwise, if automatic
9439 publication is switched on, default value is used for result name.
9441 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9443 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9446 New GEOM.GEOM_Object, containing the result shape.
9450 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9451 # make fillet at given wire vertices with giver radius
9452 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9454 # Example: see GEOM_TestAll.py
9455 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9456 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9457 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9458 anObj.SetParameters(Parameters)
9459 self._autoPublish(anObj, theName, "fillet")
9462 ## Perform a fillet at the specified vertices of the given face/shell.
9463 # @param theShape Face or Shell shape to perform fillet on.
9464 # @param theR Fillet radius.
9465 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9466 # @param theName Object name; when specified, this parameter is used
9467 # for result publication in the study. Otherwise, if automatic
9468 # publication is switched on, default value is used for result name.
9470 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9472 # @return New GEOM.GEOM_Object, containing the result shape.
9474 # @ref tui_fillet2d "Example"
9475 @ManageTransactions("LocalOp")
9476 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9478 Perform a fillet at the specified vertices of the given face/shell.
9481 theShape Face or Shell shape to perform fillet on.
9483 theListOfVertexes Global indices of vertexes to perform fillet on.
9484 theName Object name; when specified, this parameter is used
9485 for result publication in the study. Otherwise, if automatic
9486 publication is switched on, default value is used for result name.
9488 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9491 New GEOM.GEOM_Object, containing the result shape.
9494 face = geompy.MakeFaceHW(100, 100, 1)
9495 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9497 # Example: see GEOM_TestAll.py
9498 theR,Parameters = ParseParameters(theR)
9499 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9500 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9501 anObj.SetParameters(Parameters)
9502 self._autoPublish(anObj, theName, "fillet")
9505 ## Perform a symmetric chamfer on all edges of the given shape.
9506 # @param theShape Shape, to perform chamfer on.
9507 # @param theD Chamfer size along each face.
9508 # @param theName Object name; when specified, this parameter is used
9509 # for result publication in the study. Otherwise, if automatic
9510 # publication is switched on, default value is used for result name.
9512 # @return New GEOM.GEOM_Object, containing the result shape.
9514 # @ref tui_chamfer "Example 1"
9515 # \n @ref swig_MakeChamferAll "Example 2"
9516 @ManageTransactions("LocalOp")
9517 def MakeChamferAll(self, theShape, theD, theName=None):
9519 Perform a symmetric chamfer on all edges of the given shape.
9522 theShape Shape, to perform chamfer on.
9523 theD Chamfer size along each face.
9524 theName Object name; when specified, this parameter is used
9525 for result publication in the study. Otherwise, if automatic
9526 publication is switched on, default value is used for result name.
9529 New GEOM.GEOM_Object, containing the result shape.
9532 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9534 # Example: see GEOM_TestOthers.py
9535 theD,Parameters = ParseParameters(theD)
9536 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9537 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9538 anObj.SetParameters(Parameters)
9539 self._autoPublish(anObj, theName, "chamfer")
9542 ## Perform a chamfer on edges, common to the specified faces,
9543 # with distance D1 on the Face1
9544 # @param theShape Shape, to perform chamfer on.
9545 # @param theD1 Chamfer size along \a theFace1.
9546 # @param theD2 Chamfer size along \a theFace2.
9547 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9548 # @param theName Object name; when specified, this parameter is used
9549 # for result publication in the study. Otherwise, if automatic
9550 # publication is switched on, default value is used for result name.
9552 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9554 # @return New GEOM.GEOM_Object, containing the result shape.
9556 # @ref tui_chamfer "Example"
9557 @ManageTransactions("LocalOp")
9558 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9560 Perform a chamfer on edges, common to the specified faces,
9561 with distance D1 on the Face1
9564 theShape Shape, to perform chamfer on.
9565 theD1 Chamfer size along theFace1.
9566 theD2 Chamfer size along theFace2.
9567 theFace1,theFace2 Global indices of two faces of theShape.
9568 theName Object name; when specified, this parameter is used
9569 for result publication in the study. Otherwise, if automatic
9570 publication is switched on, default value is used for result name.
9573 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9576 New GEOM.GEOM_Object, containing the result shape.
9579 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9580 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9581 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9582 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9584 # Example: see GEOM_TestAll.py
9585 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9586 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9587 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9588 anObj.SetParameters(Parameters)
9589 self._autoPublish(anObj, theName, "chamfer")
9592 ## Perform a chamfer on edges
9593 # @param theShape Shape, to perform chamfer on.
9594 # @param theD Chamfer length
9595 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9596 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9597 # @param theName Object name; when specified, this parameter is used
9598 # for result publication in the study. Otherwise, if automatic
9599 # publication is switched on, default value is used for result name.
9601 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9603 # @return New GEOM.GEOM_Object, containing the result shape.
9604 @ManageTransactions("LocalOp")
9605 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9607 Perform a chamfer on edges
9610 theShape Shape, to perform chamfer on.
9611 theD1 Chamfer size along theFace1.
9612 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9613 theFace1,theFace2 Global indices of two faces of theShape.
9614 theName Object name; when specified, this parameter is used
9615 for result publication in the study. Otherwise, if automatic
9616 publication is switched on, default value is used for result name.
9619 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9622 New GEOM.GEOM_Object, containing the result shape.
9625 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9626 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9627 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9629 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9632 if isinstance(theAngle,str):
9634 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9636 theAngle = theAngle*math.pi/180.0
9637 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9638 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9639 anObj.SetParameters(Parameters)
9640 self._autoPublish(anObj, theName, "chamfer")
9643 ## Perform a chamfer on all edges of the specified faces,
9644 # with distance D1 on the first specified face (if several for one edge)
9645 # @param theShape Shape, to perform chamfer on.
9646 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9647 # connected to the edge, are in \a theFaces, \a theD1
9648 # will be get along face, which is nearer to \a theFaces beginning.
9649 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9650 # @param theFaces Sequence of global indices of faces of \a theShape.
9651 # @param theName Object name; when specified, this parameter is used
9652 # for result publication in the study. Otherwise, if automatic
9653 # publication is switched on, default value is used for result name.
9655 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9657 # @return New GEOM.GEOM_Object, containing the result shape.
9659 # @ref tui_chamfer "Example"
9660 @ManageTransactions("LocalOp")
9661 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9663 Perform a chamfer on all edges of the specified faces,
9664 with distance D1 on the first specified face (if several for one edge)
9667 theShape Shape, to perform chamfer on.
9668 theD1 Chamfer size along face from theFaces. If both faces,
9669 connected to the edge, are in theFaces, theD1
9670 will be get along face, which is nearer to theFaces beginning.
9671 theD2 Chamfer size along another of two faces, connected to the edge.
9672 theFaces Sequence of global indices of faces of theShape.
9673 theName Object name; when specified, this parameter is used
9674 for result publication in the study. Otherwise, if automatic
9675 publication is switched on, default value is used for result name.
9677 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9680 New GEOM.GEOM_Object, containing the result shape.
9682 # Example: see GEOM_TestAll.py
9683 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9684 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9685 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9686 anObj.SetParameters(Parameters)
9687 self._autoPublish(anObj, theName, "chamfer")
9690 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9691 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9693 # @ref swig_FilletChamfer "Example"
9694 @ManageTransactions("LocalOp")
9695 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9697 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9698 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9701 if isinstance(theAngle,str):
9703 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9705 theAngle = theAngle*math.pi/180.0
9706 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9707 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9708 anObj.SetParameters(Parameters)
9709 self._autoPublish(anObj, theName, "chamfer")
9712 ## Perform a chamfer on edges,
9713 # with distance D1 on the first specified face (if several for one edge)
9714 # @param theShape Shape, to perform chamfer on.
9715 # @param theD1,theD2 Chamfer size
9716 # @param theEdges Sequence of edges of \a theShape.
9717 # @param theName Object name; when specified, this parameter is used
9718 # for result publication in the study. Otherwise, if automatic
9719 # publication is switched on, default value is used for result name.
9721 # @return New GEOM.GEOM_Object, containing the result shape.
9723 # @ref swig_FilletChamfer "Example"
9724 @ManageTransactions("LocalOp")
9725 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9727 Perform a chamfer on edges,
9728 with distance D1 on the first specified face (if several for one edge)
9731 theShape Shape, to perform chamfer on.
9732 theD1,theD2 Chamfer size
9733 theEdges Sequence of edges of theShape.
9734 theName Object name; when specified, this parameter is used
9735 for result publication in the study. Otherwise, if automatic
9736 publication is switched on, default value is used for result name.
9739 New GEOM.GEOM_Object, containing the result shape.
9741 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9742 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9743 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9744 anObj.SetParameters(Parameters)
9745 self._autoPublish(anObj, theName, "chamfer")
9748 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9749 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9750 @ManageTransactions("LocalOp")
9751 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9753 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9754 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9757 if isinstance(theAngle,str):
9759 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9761 theAngle = theAngle*math.pi/180.0
9762 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9763 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9764 anObj.SetParameters(Parameters)
9765 self._autoPublish(anObj, theName, "chamfer")
9768 ## @sa MakeChamferEdge(), MakeChamferFaces()
9770 # @ref swig_MakeChamfer "Example"
9771 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9773 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9775 # Example: see GEOM_TestOthers.py
9777 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9778 if aShapeType == self.ShapeType["EDGE"]:
9779 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9781 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9784 ## Remove material from a solid by extrusion of the base shape on the given distance.
9785 # @param theInit Shape to remove material from. It must be a solid or
9786 # a compound made of a single solid.
9787 # @param theBase Closed edge or wire defining the base shape to be extruded.
9788 # @param theH Prism dimension along the normal to theBase
9789 # @param theAngle Draft angle in degrees.
9790 # @param theName Object name; when specified, this parameter is used
9791 # for result publication in the study. Otherwise, if automatic
9792 # publication is switched on, default value is used for result name.
9794 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9796 # @ref tui_creation_prism "Example"
9797 @ManageTransactions("PrimOp")
9798 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9800 Add material to a solid by extrusion of the base shape on the given distance.
9803 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9804 theBase Closed edge or wire defining the base shape to be extruded.
9805 theH Prism dimension along the normal to theBase
9806 theAngle Draft angle in degrees.
9807 theName Object name; when specified, this parameter is used
9808 for result publication in the study. Otherwise, if automatic
9809 publication is switched on, default value is used for result name.
9812 New GEOM.GEOM_Object, containing the initial shape with removed material.
9814 # Example: see GEOM_TestAll.py
9815 #theH,Parameters = ParseParameters(theH)
9816 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9817 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9818 #anObj.SetParameters(Parameters)
9819 self._autoPublish(anObj, theName, "extrudedCut")
9822 ## Add material to a solid by extrusion of the base shape on the given distance.
9823 # @param theInit Shape to add material to. It must be a solid or
9824 # a compound made of a single solid.
9825 # @param theBase Closed edge or wire defining the base shape to be extruded.
9826 # @param theH Prism dimension along the normal to theBase
9827 # @param theAngle Draft angle in degrees.
9828 # @param theName Object name; when specified, this parameter is used
9829 # for result publication in the study. Otherwise, if automatic
9830 # publication is switched on, default value is used for result name.
9832 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9834 # @ref tui_creation_prism "Example"
9835 @ManageTransactions("PrimOp")
9836 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9838 Add material to a solid by extrusion of the base shape on the given distance.
9841 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9842 theBase Closed edge or wire defining the base shape to be extruded.
9843 theH Prism dimension along the normal to theBase
9844 theAngle Draft angle in degrees.
9845 theName Object name; when specified, this parameter is used
9846 for result publication in the study. Otherwise, if automatic
9847 publication is switched on, default value is used for result name.
9850 New GEOM.GEOM_Object, containing the initial shape with added material.
9852 # Example: see GEOM_TestAll.py
9853 #theH,Parameters = ParseParameters(theH)
9854 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9855 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9856 #anObj.SetParameters(Parameters)
9857 self._autoPublish(anObj, theName, "extrudedBoss")
9863 ## @addtogroup l3_basic_op
9866 ## Perform an Archimde operation on the given shape with given parameters.
9867 # The object presenting the resulting face is returned.
9868 # @param theShape Shape to be put in water.
9869 # @param theWeight Weight of the shape.
9870 # @param theWaterDensity Density of the water.
9871 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9872 # @param theName Object name; when specified, this parameter is used
9873 # for result publication in the study. Otherwise, if automatic
9874 # publication is switched on, default value is used for result name.
9876 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9877 # by a plane, corresponding to water level.
9879 # @ref tui_archimede "Example"
9880 @ManageTransactions("LocalOp")
9881 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9883 Perform an Archimde operation on the given shape with given parameters.
9884 The object presenting the resulting face is returned.
9887 theShape Shape to be put in water.
9888 theWeight Weight of the shape.
9889 theWaterDensity Density of the water.
9890 theMeshDeflection Deflection of the mesh, using to compute the section.
9891 theName Object name; when specified, this parameter is used
9892 for result publication in the study. Otherwise, if automatic
9893 publication is switched on, default value is used for result name.
9896 New GEOM.GEOM_Object, containing a section of theShape
9897 by a plane, corresponding to water level.
9899 # Example: see GEOM_TestAll.py
9900 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9901 theWeight,theWaterDensity,theMeshDeflection)
9902 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9903 RaiseIfFailed("MakeArchimede", self.LocalOp)
9904 anObj.SetParameters(Parameters)
9905 self._autoPublish(anObj, theName, "archimede")
9908 # end of l3_basic_op
9911 ## @addtogroup l2_measure
9914 ## Get point coordinates
9917 # @ref tui_measurement_tools_page "Example"
9918 @ManageTransactions("MeasuOp")
9919 def PointCoordinates(self,Point):
9921 Get point coordinates
9926 # Example: see GEOM_TestMeasures.py
9927 aTuple = self.MeasuOp.PointCoordinates(Point)
9928 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9931 ## Get vector coordinates
9934 # @ref tui_measurement_tools_page "Example"
9935 def VectorCoordinates(self,Vector):
9937 Get vector coordinates
9943 p1=self.GetFirstVertex(Vector)
9944 p2=self.GetLastVertex(Vector)
9946 X1=self.PointCoordinates(p1)
9947 X2=self.PointCoordinates(p2)
9949 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9952 ## Compute cross product
9953 # @return vector w=u^v
9955 # @ref tui_measurement_tools_page "Example"
9956 def CrossProduct(self, Vector1, Vector2):
9958 Compute cross product
9960 Returns: vector w=u^v
9962 u=self.VectorCoordinates(Vector1)
9963 v=self.VectorCoordinates(Vector2)
9964 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])
9968 ## Compute cross product
9969 # @return dot product p=u.v
9971 # @ref tui_measurement_tools_page "Example"
9972 def DotProduct(self, Vector1, Vector2):
9974 Compute cross product
9976 Returns: dot product p=u.v
9978 u=self.VectorCoordinates(Vector1)
9979 v=self.VectorCoordinates(Vector2)
9980 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9985 ## Get summarized length of all wires,
9986 # area of surface and volume of the given shape.
9987 # @param theShape Shape to define properties of.
9988 # @return [theLength, theSurfArea, theVolume]\n
9989 # theLength: Summarized length of all wires of the given shape.\n
9990 # theSurfArea: Area of surface of the given shape.\n
9991 # theVolume: Volume of the given shape.
9993 # @ref tui_measurement_tools_page "Example"
9994 @ManageTransactions("MeasuOp")
9995 def BasicProperties(self,theShape):
9997 Get summarized length of all wires,
9998 area of surface and volume of the given shape.
10001 theShape Shape to define properties of.
10004 [theLength, theSurfArea, theVolume]
10005 theLength: Summarized length of all wires of the given shape.
10006 theSurfArea: Area of surface of the given shape.
10007 theVolume: Volume of the given shape.
10009 # Example: see GEOM_TestMeasures.py
10010 aTuple = self.MeasuOp.GetBasicProperties(theShape)
10011 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10014 ## Get parameters of bounding box of the given shape
10015 # @param theShape Shape to obtain bounding box of.
10016 # @param precise TRUE for precise computation; FALSE for fast one.
10017 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10018 # Xmin,Xmax: Limits of shape along OX axis.
10019 # Ymin,Ymax: Limits of shape along OY axis.
10020 # Zmin,Zmax: Limits of shape along OZ axis.
10022 # @ref tui_measurement_tools_page "Example"
10023 @ManageTransactions("MeasuOp")
10024 def BoundingBox (self, theShape, precise=False):
10026 Get parameters of bounding box of the given shape
10029 theShape Shape to obtain bounding box of.
10030 precise TRUE for precise computation; FALSE for fast one.
10033 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10034 Xmin,Xmax: Limits of shape along OX axis.
10035 Ymin,Ymax: Limits of shape along OY axis.
10036 Zmin,Zmax: Limits of shape along OZ axis.
10038 # Example: see GEOM_TestMeasures.py
10039 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10040 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10043 ## Get bounding box of the given shape
10044 # @param theShape Shape to obtain bounding box of.
10045 # @param precise TRUE for precise computation; FALSE for fast one.
10046 # @param theName Object name; when specified, this parameter is used
10047 # for result publication in the study. Otherwise, if automatic
10048 # publication is switched on, default value is used for result name.
10050 # @return New GEOM.GEOM_Object, containing the created box.
10052 # @ref tui_measurement_tools_page "Example"
10053 @ManageTransactions("MeasuOp")
10054 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10056 Get bounding box of the given shape
10059 theShape Shape to obtain bounding box of.
10060 precise TRUE for precise computation; FALSE for fast one.
10061 theName Object name; when specified, this parameter is used
10062 for result publication in the study. Otherwise, if automatic
10063 publication is switched on, default value is used for result name.
10066 New GEOM.GEOM_Object, containing the created box.
10068 # Example: see GEOM_TestMeasures.py
10069 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10070 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10071 self._autoPublish(anObj, theName, "bndbox")
10074 ## Get inertia matrix and moments of inertia of theShape.
10075 # @param theShape Shape to calculate inertia of.
10076 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10077 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10078 # Ix,Iy,Iz: Moments of inertia of the given shape.
10080 # @ref tui_measurement_tools_page "Example"
10081 @ManageTransactions("MeasuOp")
10082 def Inertia(self,theShape):
10084 Get inertia matrix and moments of inertia of theShape.
10087 theShape Shape to calculate inertia of.
10090 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10091 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10092 Ix,Iy,Iz: Moments of inertia of the given shape.
10094 # Example: see GEOM_TestMeasures.py
10095 aTuple = self.MeasuOp.GetInertia(theShape)
10096 RaiseIfFailed("GetInertia", self.MeasuOp)
10099 ## Get if coords are included in the shape (ST_IN or ST_ON)
10100 # @param theShape Shape
10101 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10102 # @param tolerance to be used (default is 1.0e-7)
10103 # @return list_of_boolean = [res1, res2, ...]
10104 @ManageTransactions("MeasuOp")
10105 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10107 Get if coords are included in the shape (ST_IN or ST_ON)
10111 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10112 tolerance to be used (default is 1.0e-7)
10115 list_of_boolean = [res1, res2, ...]
10117 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10119 ## Get minimal distance between the given shapes.
10120 # @param theShape1,theShape2 Shapes to find minimal distance between.
10121 # @return Value of the minimal distance between the given shapes.
10123 # @ref tui_measurement_tools_page "Example"
10124 @ManageTransactions("MeasuOp")
10125 def MinDistance(self, theShape1, theShape2):
10127 Get minimal distance between the given shapes.
10130 theShape1,theShape2 Shapes to find minimal distance between.
10133 Value of the minimal distance between the given shapes.
10135 # Example: see GEOM_TestMeasures.py
10136 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10137 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10140 ## Get minimal distance between the given shapes.
10141 # @param theShape1,theShape2 Shapes to find minimal distance between.
10142 # @return Value of the minimal distance between the given shapes, in form of list
10143 # [Distance, DX, DY, DZ].
10145 # @ref swig_all_measure "Example"
10146 @ManageTransactions("MeasuOp")
10147 def MinDistanceComponents(self, theShape1, theShape2):
10149 Get minimal distance between the given shapes.
10152 theShape1,theShape2 Shapes to find minimal distance between.
10155 Value of the minimal distance between the given shapes, in form of list
10156 [Distance, DX, DY, DZ]
10158 # Example: see GEOM_TestMeasures.py
10159 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10160 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10161 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10164 ## Get closest points of the given shapes.
10165 # @param theShape1,theShape2 Shapes to find closest points of.
10166 # @return The number of found solutions (-1 in case of infinite number of
10167 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10169 # @ref tui_measurement_tools_page "Example"
10170 @ManageTransactions("MeasuOp")
10171 def ClosestPoints (self, theShape1, theShape2):
10173 Get closest points of the given shapes.
10176 theShape1,theShape2 Shapes to find closest points of.
10179 The number of found solutions (-1 in case of infinite number of
10180 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10182 # Example: see GEOM_TestMeasures.py
10183 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10184 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10187 ## Get angle between the given shapes in degrees.
10188 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10189 # @note If both arguments are vectors, the angle is computed in accordance
10190 # with their orientations, otherwise the minimum angle is computed.
10191 # @return Value of the angle between the given shapes in degrees.
10193 # @ref tui_measurement_tools_page "Example"
10194 @ManageTransactions("MeasuOp")
10195 def GetAngle(self, theShape1, theShape2):
10197 Get angle between the given shapes in degrees.
10200 theShape1,theShape2 Lines or linear edges to find angle between.
10203 If both arguments are vectors, the angle is computed in accordance
10204 with their orientations, otherwise the minimum angle is computed.
10207 Value of the angle between the given shapes in degrees.
10209 # Example: see GEOM_TestMeasures.py
10210 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10211 RaiseIfFailed("GetAngle", self.MeasuOp)
10214 ## Get angle between the given shapes in radians.
10215 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10216 # @note If both arguments are vectors, the angle is computed in accordance
10217 # with their orientations, otherwise the minimum angle is computed.
10218 # @return Value of the angle between the given shapes in radians.
10220 # @ref tui_measurement_tools_page "Example"
10221 @ManageTransactions("MeasuOp")
10222 def GetAngleRadians(self, theShape1, theShape2):
10224 Get angle between the given shapes in radians.
10227 theShape1,theShape2 Lines or linear edges to find angle between.
10231 If both arguments are vectors, the angle is computed in accordance
10232 with their orientations, otherwise the minimum angle is computed.
10235 Value of the angle between the given shapes in radians.
10237 # Example: see GEOM_TestMeasures.py
10238 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10239 RaiseIfFailed("GetAngle", self.MeasuOp)
10242 ## Get angle between the given vectors in degrees.
10243 # @param theShape1,theShape2 Vectors to find angle between.
10244 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10245 # if False, the opposite vector to the normal vector is used.
10246 # @return Value of the angle between the given vectors in degrees.
10248 # @ref tui_measurement_tools_page "Example"
10249 @ManageTransactions("MeasuOp")
10250 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10252 Get angle between the given vectors in degrees.
10255 theShape1,theShape2 Vectors to find angle between.
10256 theFlag If True, the normal vector is defined by the two vectors cross,
10257 if False, the opposite vector to the normal vector is used.
10260 Value of the angle between the given vectors in degrees.
10262 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10264 anAngle = 360. - anAngle
10265 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10268 ## The same as GetAngleVectors, but the result is in radians.
10269 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10271 Get angle between the given vectors in radians.
10274 theShape1,theShape2 Vectors to find angle between.
10275 theFlag If True, the normal vector is defined by the two vectors cross,
10276 if False, the opposite vector to the normal vector is used.
10279 Value of the angle between the given vectors in radians.
10281 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10284 ## @name Curve Curvature Measurement
10285 # Methods for receiving radius of curvature of curves
10286 # in the given point
10289 ## Measure curvature of a curve at a point, set by parameter.
10290 # @param theCurve a curve.
10291 # @param theParam parameter.
10292 # @return radius of curvature of \a theCurve.
10294 # @ref swig_todo "Example"
10295 @ManageTransactions("MeasuOp")
10296 def CurveCurvatureByParam(self, theCurve, theParam):
10298 Measure curvature of a curve at a point, set by parameter.
10302 theParam parameter.
10305 radius of curvature of theCurve.
10307 # Example: see GEOM_TestMeasures.py
10308 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10309 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10312 ## Measure curvature of a curve at a point.
10313 # @param theCurve a curve.
10314 # @param thePoint given point.
10315 # @return radius of curvature of \a theCurve.
10317 # @ref swig_todo "Example"
10318 @ManageTransactions("MeasuOp")
10319 def CurveCurvatureByPoint(self, theCurve, thePoint):
10321 Measure curvature of a curve at a point.
10325 thePoint given point.
10328 radius of curvature of theCurve.
10330 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10331 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10335 ## @name Surface Curvature Measurement
10336 # Methods for receiving max and min radius of curvature of surfaces
10337 # in the given point
10340 ## Measure max radius of curvature of surface.
10341 # @param theSurf the given surface.
10342 # @param theUParam Value of U-parameter on the referenced surface.
10343 # @param theVParam Value of V-parameter on the referenced surface.
10344 # @return max radius of curvature of theSurf.
10346 ## @ref swig_todo "Example"
10347 @ManageTransactions("MeasuOp")
10348 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10350 Measure max radius of curvature of surface.
10353 theSurf the given surface.
10354 theUParam Value of U-parameter on the referenced surface.
10355 theVParam Value of V-parameter on the referenced surface.
10358 max radius of curvature of theSurf.
10360 # Example: see GEOM_TestMeasures.py
10361 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10362 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10365 ## Measure max radius of curvature of surface in the given point
10366 # @param theSurf the given surface.
10367 # @param thePoint given point.
10368 # @return max radius of curvature of theSurf.
10370 ## @ref swig_todo "Example"
10371 @ManageTransactions("MeasuOp")
10372 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10374 Measure max radius of curvature of surface in the given point.
10377 theSurf the given surface.
10378 thePoint given point.
10381 max radius of curvature of theSurf.
10383 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10384 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10387 ## Measure min radius of curvature of surface.
10388 # @param theSurf the given surface.
10389 # @param theUParam Value of U-parameter on the referenced surface.
10390 # @param theVParam Value of V-parameter on the referenced surface.
10391 # @return min radius of curvature of theSurf.
10393 ## @ref swig_todo "Example"
10394 @ManageTransactions("MeasuOp")
10395 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10397 Measure min radius of curvature of surface.
10400 theSurf the given surface.
10401 theUParam Value of U-parameter on the referenced surface.
10402 theVParam Value of V-parameter on the referenced surface.
10405 Min radius of curvature of theSurf.
10407 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10408 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10411 ## Measure min radius of curvature of surface in the given point
10412 # @param theSurf the given surface.
10413 # @param thePoint given point.
10414 # @return min radius of curvature of theSurf.
10416 ## @ref swig_todo "Example"
10417 @ManageTransactions("MeasuOp")
10418 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10420 Measure min radius of curvature of surface in the given point.
10423 theSurf the given surface.
10424 thePoint given point.
10427 Min radius of curvature of theSurf.
10429 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10430 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10434 ## Get min and max tolerances of sub-shapes of theShape
10435 # @param theShape Shape, to get tolerances of.
10436 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10437 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10438 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10439 # VertMin,VertMax: Min and max tolerances of the vertices.
10441 # @ref tui_measurement_tools_page "Example"
10442 @ManageTransactions("MeasuOp")
10443 def Tolerance(self,theShape):
10445 Get min and max tolerances of sub-shapes of theShape
10448 theShape Shape, to get tolerances of.
10451 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10452 FaceMin,FaceMax: Min and max tolerances of the faces.
10453 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10454 VertMin,VertMax: Min and max tolerances of the vertices.
10456 # Example: see GEOM_TestMeasures.py
10457 aTuple = self.MeasuOp.GetTolerance(theShape)
10458 RaiseIfFailed("GetTolerance", self.MeasuOp)
10461 ## Obtain description of the given shape (number of sub-shapes of each type)
10462 # @param theShape Shape to be described.
10463 # @return Description of the given shape.
10465 # @ref tui_measurement_tools_page "Example"
10466 @ManageTransactions("MeasuOp")
10467 def WhatIs(self,theShape):
10469 Obtain description of the given shape (number of sub-shapes of each type)
10472 theShape Shape to be described.
10475 Description of the given shape.
10477 # Example: see GEOM_TestMeasures.py
10478 aDescr = self.MeasuOp.WhatIs(theShape)
10479 RaiseIfFailed("WhatIs", self.MeasuOp)
10482 ## Obtain quantity of shapes of the given type in \a theShape.
10483 # If \a theShape is of type \a theType, it is also counted.
10484 # @param theShape Shape to be described.
10485 # @param theType the given ShapeType().
10486 # @return Quantity of shapes of type \a theType in \a theShape.
10488 # @ref tui_measurement_tools_page "Example"
10489 def NbShapes (self, theShape, theType):
10491 Obtain quantity of shapes of the given type in theShape.
10492 If theShape is of type theType, it is also counted.
10495 theShape Shape to be described.
10496 theType the given geompy.ShapeType
10499 Quantity of shapes of type theType in theShape.
10501 # Example: see GEOM_TestMeasures.py
10502 listSh = self.SubShapeAllIDs(theShape, theType)
10506 ## Obtain quantity of shapes of each type in \a theShape.
10507 # The \a theShape is also counted.
10508 # @param theShape Shape to be described.
10509 # @return Dictionary of ShapeType() with bound quantities of shapes.
10511 # @ref tui_measurement_tools_page "Example"
10512 def ShapeInfo (self, theShape):
10514 Obtain quantity of shapes of each type in theShape.
10515 The theShape is also counted.
10518 theShape Shape to be described.
10521 Dictionary of geompy.ShapeType with bound quantities of shapes.
10523 # Example: see GEOM_TestMeasures.py
10525 for typeSh in self.ShapeType:
10526 if typeSh in ( "AUTO", "SHAPE" ): continue
10527 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10533 def GetCreationInformation(self, theShape):
10534 info = theShape.GetCreationInformation()
10536 opName = info.operationName
10537 if not opName: opName = "no info available"
10538 res = "Operation: " + opName
10540 for parVal in info.params:
10541 res += " \n %s = %s" % ( parVal.name, parVal.value )
10544 ## Get a point, situated at the centre of mass of theShape.
10545 # @param theShape Shape to define centre of mass of.
10546 # @param theName Object name; when specified, this parameter is used
10547 # for result publication in the study. Otherwise, if automatic
10548 # publication is switched on, default value is used for result name.
10550 # @return New GEOM.GEOM_Object, containing the created point.
10552 # @ref tui_measurement_tools_page "Example"
10553 @ManageTransactions("MeasuOp")
10554 def MakeCDG(self, theShape, theName=None):
10556 Get a point, situated at the centre of mass of theShape.
10559 theShape Shape to define centre of mass of.
10560 theName Object name; when specified, this parameter is used
10561 for result publication in the study. Otherwise, if automatic
10562 publication is switched on, default value is used for result name.
10565 New GEOM.GEOM_Object, containing the created point.
10567 # Example: see GEOM_TestMeasures.py
10568 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10569 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10570 self._autoPublish(anObj, theName, "centerOfMass")
10573 ## Get a vertex sub-shape by index depended with orientation.
10574 # @param theShape Shape to find sub-shape.
10575 # @param theIndex Index to find vertex by this index (starting from zero)
10576 # @param theName Object name; when specified, this parameter is used
10577 # for result publication in the study. Otherwise, if automatic
10578 # publication is switched on, default value is used for result name.
10580 # @return New GEOM.GEOM_Object, containing the created vertex.
10582 # @ref tui_measurement_tools_page "Example"
10583 @ManageTransactions("MeasuOp")
10584 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10586 Get a vertex sub-shape by index depended with orientation.
10589 theShape Shape to find sub-shape.
10590 theIndex Index to find vertex by this index (starting from zero)
10591 theName Object name; when specified, this parameter is used
10592 for result publication in the study. Otherwise, if automatic
10593 publication is switched on, default value is used for result name.
10596 New GEOM.GEOM_Object, containing the created vertex.
10598 # Example: see GEOM_TestMeasures.py
10599 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10600 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10601 self._autoPublish(anObj, theName, "vertex")
10604 ## Get the first vertex of wire/edge depended orientation.
10605 # @param theShape Shape to find first vertex.
10606 # @param theName Object name; when specified, this parameter is used
10607 # for result publication in the study. Otherwise, if automatic
10608 # publication is switched on, default value is used for result name.
10610 # @return New GEOM.GEOM_Object, containing the created vertex.
10612 # @ref tui_measurement_tools_page "Example"
10613 def GetFirstVertex(self, theShape, theName=None):
10615 Get the first vertex of wire/edge depended orientation.
10618 theShape Shape to find first vertex.
10619 theName Object name; when specified, this parameter is used
10620 for result publication in the study. Otherwise, if automatic
10621 publication is switched on, default value is used for result name.
10624 New GEOM.GEOM_Object, containing the created vertex.
10626 # Example: see GEOM_TestMeasures.py
10627 # note: auto-publishing is done in self.GetVertexByIndex()
10628 return self.GetVertexByIndex(theShape, 0, theName)
10630 ## Get the last vertex of wire/edge depended orientation.
10631 # @param theShape Shape to find last vertex.
10632 # @param theName Object name; when specified, this parameter is used
10633 # for result publication in the study. Otherwise, if automatic
10634 # publication is switched on, default value is used for result name.
10636 # @return New GEOM.GEOM_Object, containing the created vertex.
10638 # @ref tui_measurement_tools_page "Example"
10639 def GetLastVertex(self, theShape, theName=None):
10641 Get the last vertex of wire/edge depended orientation.
10644 theShape Shape to find last vertex.
10645 theName Object name; when specified, this parameter is used
10646 for result publication in the study. Otherwise, if automatic
10647 publication is switched on, default value is used for result name.
10650 New GEOM.GEOM_Object, containing the created vertex.
10652 # Example: see GEOM_TestMeasures.py
10653 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10654 # note: auto-publishing is done in self.GetVertexByIndex()
10655 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10657 ## Get a normale to the given face. If the point is not given,
10658 # the normale is calculated at the center of mass.
10659 # @param theFace Face to define normale of.
10660 # @param theOptionalPoint Point to compute the normale at.
10661 # @param theName Object name; when specified, this parameter is used
10662 # for result publication in the study. Otherwise, if automatic
10663 # publication is switched on, default value is used for result name.
10665 # @return New GEOM.GEOM_Object, containing the created vector.
10667 # @ref swig_todo "Example"
10668 @ManageTransactions("MeasuOp")
10669 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10671 Get a normale to the given face. If the point is not given,
10672 the normale is calculated at the center of mass.
10675 theFace Face to define normale of.
10676 theOptionalPoint Point to compute the normale at.
10677 theName Object name; when specified, this parameter is used
10678 for result publication in the study. Otherwise, if automatic
10679 publication is switched on, default value is used for result name.
10682 New GEOM.GEOM_Object, containing the created vector.
10684 # Example: see GEOM_TestMeasures.py
10685 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10686 RaiseIfFailed("GetNormal", self.MeasuOp)
10687 self._autoPublish(anObj, theName, "normal")
10690 ## Print shape errors obtained from CheckShape.
10691 # @param theShape Shape that was checked.
10692 # @param theShapeErrors the shape errors obtained by CheckShape.
10693 # @param theReturnStatus If 0 the description of problem is printed.
10694 # If 1 the description of problem is returned.
10695 # @return If theReturnStatus is equal to 1 the description is returned.
10696 # Otherwise doesn't return anything.
10698 # @ref tui_measurement_tools_page "Example"
10699 @ManageTransactions("MeasuOp")
10700 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10702 Print shape errors obtained from CheckShape.
10705 theShape Shape that was checked.
10706 theShapeErrors the shape errors obtained by CheckShape.
10707 theReturnStatus If 0 the description of problem is printed.
10708 If 1 the description of problem is returned.
10711 If theReturnStatus is equal to 1 the description is returned.
10712 Otherwise doesn't return anything.
10714 # Example: see GEOM_TestMeasures.py
10715 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10716 if theReturnStatus == 1:
10721 ## Check a topology of the given shape.
10722 # @param theShape Shape to check validity of.
10723 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10724 # if TRUE, the shape's geometry will be checked also.
10725 # @param theReturnStatus If 0 and if theShape is invalid, a description
10726 # of problem is printed.
10727 # If 1 isValid flag and the description of
10728 # problem is returned.
10729 # If 2 isValid flag and the list of error data
10731 # @return TRUE, if the shape "seems to be valid".
10732 # If theShape is invalid, prints a description of problem.
10733 # If theReturnStatus is equal to 1 the description is returned
10734 # along with IsValid flag.
10735 # If theReturnStatus is equal to 2 the list of error data is
10736 # returned along with IsValid flag.
10738 # @ref tui_measurement_tools_page "Example"
10739 @ManageTransactions("MeasuOp")
10740 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10742 Check a topology of the given shape.
10745 theShape Shape to check validity of.
10746 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10747 if TRUE, the shape's geometry will be checked also.
10748 theReturnStatus If 0 and if theShape is invalid, a description
10749 of problem is printed.
10750 If 1 IsValid flag and the description of
10751 problem is returned.
10752 If 2 IsValid flag and the list of error data
10756 TRUE, if the shape "seems to be valid".
10757 If theShape is invalid, prints a description of problem.
10758 If theReturnStatus is equal to 1 the description is returned
10759 along with IsValid flag.
10760 If theReturnStatus is equal to 2 the list of error data is
10761 returned along with IsValid flag.
10763 # Example: see GEOM_TestMeasures.py
10765 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10766 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10768 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10769 RaiseIfFailed("CheckShape", self.MeasuOp)
10771 if theReturnStatus == 0:
10772 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10774 if theReturnStatus == 1:
10775 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10776 return (IsValid, Descr)
10777 elif theReturnStatus == 2:
10778 return (IsValid, ShapeErrors)
10781 ## Detect self-intersections in the given shape.
10782 # @param theShape Shape to check.
10783 # @param theCheckLevel is the level of self-intersection check.
10784 # Possible input values are:
10785 # - GEOM.SI_V_V(0) - only V/V interferences
10786 # - GEOM.SI_V_E(1) - V/V and V/E interferences
10787 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
10788 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
10789 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
10790 # - GEOM.SI_ALL(5) - all interferences.
10791 # @return TRUE, if the shape contains no self-intersections.
10793 # @ref tui_measurement_tools_page "Example"
10794 @ManageTransactions("MeasuOp")
10795 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
10797 Detect self-intersections in the given shape.
10800 theShape Shape to check.
10801 theCheckLevel is the level of self-intersection check.
10802 Possible input values are:
10803 - GEOM.SI_V_V(0) - only V/V interferences
10804 - GEOM.SI_V_E(1) - V/V and V/E interferences
10805 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
10806 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
10807 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
10808 - GEOM.SI_ALL(5) - all interferences.
10811 TRUE, if the shape contains no self-intersections.
10813 # Example: see GEOM_TestMeasures.py
10814 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
10815 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10818 ## Get position (LCS) of theShape.
10820 # Origin of the LCS is situated at the shape's center of mass.
10821 # Axes of the LCS are obtained from shape's location or,
10822 # if the shape is a planar face, from position of its plane.
10824 # @param theShape Shape to calculate position of.
10825 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10826 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10827 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10828 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10830 # @ref swig_todo "Example"
10831 @ManageTransactions("MeasuOp")
10832 def GetPosition(self,theShape):
10834 Get position (LCS) of theShape.
10835 Origin of the LCS is situated at the shape's center of mass.
10836 Axes of the LCS are obtained from shape's location or,
10837 if the shape is a planar face, from position of its plane.
10840 theShape Shape to calculate position of.
10843 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10844 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10845 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10846 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10848 # Example: see GEOM_TestMeasures.py
10849 aTuple = self.MeasuOp.GetPosition(theShape)
10850 RaiseIfFailed("GetPosition", self.MeasuOp)
10853 ## Get kind of theShape.
10855 # @param theShape Shape to get a kind of.
10856 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10857 # and a list of parameters, describing the shape.
10858 # @note Concrete meaning of each value, returned via \a theIntegers
10859 # or \a theDoubles list depends on the kind() of the shape.
10861 # @ref swig_todo "Example"
10862 @ManageTransactions("MeasuOp")
10863 def KindOfShape(self,theShape):
10865 Get kind of theShape.
10868 theShape Shape to get a kind of.
10871 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10872 and a list of parameters, describing the shape.
10874 Concrete meaning of each value, returned via theIntegers
10875 or theDoubles list depends on the geompy.kind of the shape
10877 # Example: see GEOM_TestMeasures.py
10878 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10879 RaiseIfFailed("KindOfShape", self.MeasuOp)
10881 aKind = aRoughTuple[0]
10882 anInts = aRoughTuple[1]
10883 aDbls = aRoughTuple[2]
10885 # Now there is no exception from this rule:
10886 aKindTuple = [aKind] + aDbls + anInts
10888 # If they are we will regroup parameters for such kind of shape.
10890 #if aKind == kind.SOME_KIND:
10891 # # SOME_KIND int int double int double double
10892 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10896 ## Returns the string that describes if the shell is good for solid.
10897 # This is a support method for MakeSolid.
10899 # @param theShell the shell to be checked.
10900 # @return Returns a string that describes the shell validity for
10901 # solid construction.
10902 @ManageTransactions("MeasuOp")
10903 def _IsGoodForSolid(self, theShell):
10905 Returns the string that describes if the shell is good for solid.
10906 This is a support method for MakeSolid.
10909 theShell the shell to be checked.
10912 Returns a string that describes the shell validity for
10913 solid construction.
10915 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10918 # end of l2_measure
10921 ## @addtogroup l2_import_export
10924 ## Import a shape from the BREP, IGES, STEP or other file
10925 # (depends on given format) with given name.
10927 # Note: this function is deprecated, it is kept for backward compatibility only
10928 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10930 # @param theFileName The file, containing the shape.
10931 # @param theFormatName Specify format for the file reading.
10932 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10933 # If format 'IGES_SCALE' is used instead of 'IGES' or
10934 # format 'STEP_SCALE' is used instead of 'STEP',
10935 # length unit will be set to 'meter' and result model will be scaled.
10936 # @param theName Object name; when specified, this parameter is used
10937 # for result publication in the study. Otherwise, if automatic
10938 # publication is switched on, default value is used for result name.
10940 # @return New GEOM.GEOM_Object, containing the imported shape.
10941 # If material names are imported it returns the list of
10942 # objects. The first one is the imported object followed by
10944 # @note Auto publishing is allowed for the shape itself. Imported
10945 # material groups are not automatically published.
10947 # @ref swig_Import_Export "Example"
10948 @ManageTransactions("InsertOp")
10949 def ImportFile(self, theFileName, theFormatName, theName=None):
10951 Import a shape from the BREP, IGES, STEP or other file
10952 (depends on given format) with given name.
10954 Note: this function is deprecated, it is kept for backward compatibility only
10955 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10958 theFileName The file, containing the shape.
10959 theFormatName Specify format for the file reading.
10960 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10961 If format 'IGES_SCALE' is used instead of 'IGES' or
10962 format 'STEP_SCALE' is used instead of 'STEP',
10963 length unit will be set to 'meter' and result model will be scaled.
10964 theName Object name; when specified, this parameter is used
10965 for result publication in the study. Otherwise, if automatic
10966 publication is switched on, default value is used for result name.
10969 New GEOM.GEOM_Object, containing the imported shape.
10970 If material names are imported it returns the list of
10971 objects. The first one is the imported object followed by
10974 Auto publishing is allowed for the shape itself. Imported
10975 material groups are not automatically published.
10977 # Example: see GEOM_TestOthers.py
10979 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
10980 where <FormatName> is a name of desirable format for importing.
10982 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10983 RaiseIfFailed("ImportFile", self.InsertOp)
10984 aNbObj = len(aListObj)
10986 self._autoPublish(aListObj[0], theName, "imported")
10991 ## Deprecated analog of ImportFile()
10992 def Import(self, theFileName, theFormatName, theName=None):
10994 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10996 # note: auto-publishing is done in self.ImportFile()
10997 return self.ImportFile(theFileName, theFormatName, theName)
10999 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11000 # @note This method will not be dumped to the python script by DumpStudy functionality.
11001 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
11002 # @param theStream The BRep binary stream.
11003 # @param theName Object name; when specified, this parameter is used
11004 # for result publication in the study. Otherwise, if automatic
11005 # publication is switched on, default value is used for result name.
11007 # @return New GEOM_Object, containing the shape, read from theStream.
11009 # @ref swig_Import_Export "Example"
11010 @ManageTransactions("InsertOp")
11011 def RestoreShape (self, theStream, theName=None):
11013 Read a shape from the binary stream, containing its bounding representation (BRep).
11016 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11019 theStream The BRep binary stream.
11020 theName Object name; when specified, this parameter is used
11021 for result publication in the study. Otherwise, if automatic
11022 publication is switched on, default value is used for result name.
11025 New GEOM_Object, containing the shape, read from theStream.
11027 # Example: see GEOM_TestOthers.py
11028 anObj = self.InsertOp.RestoreShape(theStream)
11029 RaiseIfFailed("RestoreShape", self.InsertOp)
11030 self._autoPublish(anObj, theName, "restored")
11033 ## Export the given shape into a file with given name.
11035 # Note: this function is deprecated, it is kept for backward compatibility only
11036 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11038 # @param theObject Shape to be stored in the file.
11039 # @param theFileName Name of the file to store the given shape in.
11040 # @param theFormatName Specify format for the shape storage.
11041 # Available formats can be obtained with
11042 # geompy.InsertOp.ExportTranslators()[0] method.
11044 # @ref swig_Import_Export "Example"
11045 @ManageTransactions("InsertOp")
11046 def Export(self, theObject, theFileName, theFormatName):
11048 Export the given shape into a file with given name.
11050 Note: this function is deprecated, it is kept for backward compatibility only
11051 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11054 theObject Shape to be stored in the file.
11055 theFileName Name of the file to store the given shape in.
11056 theFormatName Specify format for the shape storage.
11057 Available formats can be obtained with
11058 geompy.InsertOp.ExportTranslators()[0] method.
11060 # Example: see GEOM_TestOthers.py
11062 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11063 where <FormatName> is a name of desirable format for exporting.
11065 self.InsertOp.Export(theObject, theFileName, theFormatName)
11066 if self.InsertOp.IsDone() == 0:
11067 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
11071 # end of l2_import_export
11074 ## @addtogroup l3_blocks
11077 ## Create a quadrangle face from four edges. Order of Edges is not
11078 # important. It is not necessary that edges share the same vertex.
11079 # @param E1,E2,E3,E4 Edges for the face bound.
11080 # @param theName Object name; when specified, this parameter is used
11081 # for result publication in the study. Otherwise, if automatic
11082 # publication is switched on, default value is used for result name.
11084 # @return New GEOM.GEOM_Object, containing the created face.
11086 # @ref tui_building_by_blocks_page "Example"
11087 @ManageTransactions("BlocksOp")
11088 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11090 Create a quadrangle face from four edges. Order of Edges is not
11091 important. It is not necessary that edges share the same vertex.
11094 E1,E2,E3,E4 Edges for the face bound.
11095 theName Object name; when specified, this parameter is used
11096 for result publication in the study. Otherwise, if automatic
11097 publication is switched on, default value is used for result name.
11100 New GEOM.GEOM_Object, containing the created face.
11103 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11105 # Example: see GEOM_Spanner.py
11106 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11107 RaiseIfFailed("MakeQuad", self.BlocksOp)
11108 self._autoPublish(anObj, theName, "quad")
11111 ## Create a quadrangle face on two edges.
11112 # The missing edges will be built by creating the shortest ones.
11113 # @param E1,E2 Two opposite edges for the face.
11114 # @param theName Object name; when specified, this parameter is used
11115 # for result publication in the study. Otherwise, if automatic
11116 # publication is switched on, default value is used for result name.
11118 # @return New GEOM.GEOM_Object, containing the created face.
11120 # @ref tui_building_by_blocks_page "Example"
11121 @ManageTransactions("BlocksOp")
11122 def MakeQuad2Edges(self, E1, E2, theName=None):
11124 Create a quadrangle face on two edges.
11125 The missing edges will be built by creating the shortest ones.
11128 E1,E2 Two opposite edges for the face.
11129 theName Object name; when specified, this parameter is used
11130 for result publication in the study. Otherwise, if automatic
11131 publication is switched on, default value is used for result name.
11134 New GEOM.GEOM_Object, containing the created face.
11138 p1 = geompy.MakeVertex( 0., 0., 0.)
11139 p2 = geompy.MakeVertex(150., 30., 0.)
11140 p3 = geompy.MakeVertex( 0., 120., 50.)
11141 p4 = geompy.MakeVertex( 0., 40., 70.)
11143 edge1 = geompy.MakeEdge(p1, p2)
11144 edge2 = geompy.MakeEdge(p3, p4)
11145 # create a quadrangle face from two edges
11146 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11148 # Example: see GEOM_Spanner.py
11149 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11150 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11151 self._autoPublish(anObj, theName, "quad")
11154 ## Create a quadrangle face with specified corners.
11155 # The missing edges will be built by creating the shortest ones.
11156 # @param V1,V2,V3,V4 Corner vertices for the face.
11157 # @param theName Object name; when specified, this parameter is used
11158 # for result publication in the study. Otherwise, if automatic
11159 # publication is switched on, default value is used for result name.
11161 # @return New GEOM.GEOM_Object, containing the created face.
11163 # @ref tui_building_by_blocks_page "Example 1"
11164 # \n @ref swig_MakeQuad4Vertices "Example 2"
11165 @ManageTransactions("BlocksOp")
11166 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11168 Create a quadrangle face with specified corners.
11169 The missing edges will be built by creating the shortest ones.
11172 V1,V2,V3,V4 Corner vertices for the face.
11173 theName Object name; when specified, this parameter is used
11174 for result publication in the study. Otherwise, if automatic
11175 publication is switched on, default value is used for result name.
11178 New GEOM.GEOM_Object, containing the created face.
11182 p1 = geompy.MakeVertex( 0., 0., 0.)
11183 p2 = geompy.MakeVertex(150., 30., 0.)
11184 p3 = geompy.MakeVertex( 0., 120., 50.)
11185 p4 = geompy.MakeVertex( 0., 40., 70.)
11186 # create a quadrangle from four points in its corners
11187 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11189 # Example: see GEOM_Spanner.py
11190 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11191 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11192 self._autoPublish(anObj, theName, "quad")
11195 ## Create a hexahedral solid, bounded by the six given faces. Order of
11196 # faces is not important. It is not necessary that Faces share the same edge.
11197 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11198 # @param theName Object name; when specified, this parameter is used
11199 # for result publication in the study. Otherwise, if automatic
11200 # publication is switched on, default value is used for result name.
11202 # @return New GEOM.GEOM_Object, containing the created solid.
11204 # @ref tui_building_by_blocks_page "Example 1"
11205 # \n @ref swig_MakeHexa "Example 2"
11206 @ManageTransactions("BlocksOp")
11207 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11209 Create a hexahedral solid, bounded by the six given faces. Order of
11210 faces is not important. It is not necessary that Faces share the same edge.
11213 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11214 theName Object name; when specified, this parameter is used
11215 for result publication in the study. Otherwise, if automatic
11216 publication is switched on, default value is used for result name.
11219 New GEOM.GEOM_Object, containing the created solid.
11222 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11224 # Example: see GEOM_Spanner.py
11225 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11226 RaiseIfFailed("MakeHexa", self.BlocksOp)
11227 self._autoPublish(anObj, theName, "hexa")
11230 ## Create a hexahedral solid between two given faces.
11231 # The missing faces will be built by creating the smallest ones.
11232 # @param F1,F2 Two opposite faces for the hexahedral solid.
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 created solid.
11239 # @ref tui_building_by_blocks_page "Example 1"
11240 # \n @ref swig_MakeHexa2Faces "Example 2"
11241 @ManageTransactions("BlocksOp")
11242 def MakeHexa2Faces(self, F1, F2, theName=None):
11244 Create a hexahedral solid between two given faces.
11245 The missing faces will be built by creating the smallest ones.
11248 F1,F2 Two opposite faces for the hexahedral solid.
11249 theName Object name; when specified, this parameter is used
11250 for result publication in the study. Otherwise, if automatic
11251 publication is switched on, default value is used for result name.
11254 New GEOM.GEOM_Object, containing the created solid.
11257 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11259 # Example: see GEOM_Spanner.py
11260 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11261 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11262 self._autoPublish(anObj, theName, "hexa")
11268 ## @addtogroup l3_blocks_op
11271 ## Get a vertex, found in the given shape by its coordinates.
11272 # @param theShape Block or a compound of blocks.
11273 # @param theX,theY,theZ Coordinates of the sought vertex.
11274 # @param theEpsilon Maximum allowed distance between the resulting
11275 # vertex and point with the given coordinates.
11276 # @param theName Object name; when specified, this parameter is used
11277 # for result publication in the study. Otherwise, if automatic
11278 # publication is switched on, default value is used for result name.
11280 # @return New GEOM.GEOM_Object, containing the found vertex.
11282 # @ref swig_GetPoint "Example"
11283 @ManageTransactions("BlocksOp")
11284 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11286 Get a vertex, found in the given shape by its coordinates.
11289 theShape Block or a compound of blocks.
11290 theX,theY,theZ Coordinates of the sought vertex.
11291 theEpsilon Maximum allowed distance between the resulting
11292 vertex and point with the given coordinates.
11293 theName Object name; when specified, this parameter is used
11294 for result publication in the study. Otherwise, if automatic
11295 publication is switched on, default value is used for result name.
11298 New GEOM.GEOM_Object, containing the found vertex.
11301 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11303 # Example: see GEOM_TestOthers.py
11304 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11305 RaiseIfFailed("GetPoint", self.BlocksOp)
11306 self._autoPublish(anObj, theName, "vertex")
11309 ## Find a vertex of the given shape, which has minimal distance to the given point.
11310 # @param theShape Any shape.
11311 # @param thePoint Point, close to the desired vertex.
11312 # @param theName Object name; when specified, this parameter is used
11313 # for result publication in the study. Otherwise, if automatic
11314 # publication is switched on, default value is used for result name.
11316 # @return New GEOM.GEOM_Object, containing the found vertex.
11318 # @ref swig_GetVertexNearPoint "Example"
11319 @ManageTransactions("BlocksOp")
11320 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11322 Find a vertex of the given shape, which has minimal distance to the given point.
11325 theShape Any shape.
11326 thePoint Point, close to the desired vertex.
11327 theName Object name; when specified, this parameter is used
11328 for result publication in the study. Otherwise, if automatic
11329 publication is switched on, default value is used for result name.
11332 New GEOM.GEOM_Object, containing the found vertex.
11335 pmidle = geompy.MakeVertex(50, 0, 50)
11336 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11338 # Example: see GEOM_TestOthers.py
11339 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11340 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11341 self._autoPublish(anObj, theName, "vertex")
11344 ## Get an edge, found in the given shape by two given vertices.
11345 # @param theShape Block or a compound of blocks.
11346 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11347 # @param theName Object name; when specified, this parameter is used
11348 # for result publication in the study. Otherwise, if automatic
11349 # publication is switched on, default value is used for result name.
11351 # @return New GEOM.GEOM_Object, containing the found edge.
11353 # @ref swig_GetEdge "Example"
11354 @ManageTransactions("BlocksOp")
11355 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11357 Get an edge, found in the given shape by two given vertices.
11360 theShape Block or a compound of blocks.
11361 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11362 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.
11367 New GEOM.GEOM_Object, containing the found edge.
11369 # Example: see GEOM_Spanner.py
11370 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11371 RaiseIfFailed("GetEdge", self.BlocksOp)
11372 self._autoPublish(anObj, theName, "edge")
11375 ## Find an edge of the given shape, which has minimal distance to the given point.
11376 # @param theShape Block or a compound of blocks.
11377 # @param thePoint Point, close to the desired edge.
11378 # @param theName Object name; when specified, this parameter is used
11379 # for result publication in the study. Otherwise, if automatic
11380 # publication is switched on, default value is used for result name.
11382 # @return New GEOM.GEOM_Object, containing the found edge.
11384 # @ref swig_GetEdgeNearPoint "Example"
11385 @ManageTransactions("BlocksOp")
11386 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11388 Find an edge of the given shape, which has minimal distance to the given point.
11391 theShape Block or a compound of blocks.
11392 thePoint Point, close to the desired edge.
11393 theName Object name; when specified, this parameter is used
11394 for result publication in the study. Otherwise, if automatic
11395 publication is switched on, default value is used for result name.
11398 New GEOM.GEOM_Object, containing the found edge.
11400 # Example: see GEOM_TestOthers.py
11401 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11402 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11403 self._autoPublish(anObj, theName, "edge")
11406 ## Returns a face, found in the given shape by four given corner vertices.
11407 # @param theShape Block or a compound of blocks.
11408 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11409 # @param theName Object name; when specified, this parameter is used
11410 # for result publication in the study. Otherwise, if automatic
11411 # publication is switched on, default value is used for result name.
11413 # @return New GEOM.GEOM_Object, containing the found face.
11415 # @ref swig_todo "Example"
11416 @ManageTransactions("BlocksOp")
11417 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11419 Returns a face, found in the given shape by four given corner vertices.
11422 theShape Block or a compound of blocks.
11423 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11424 theName Object name; when specified, this parameter is used
11425 for result publication in the study. Otherwise, if automatic
11426 publication is switched on, default value is used for result name.
11429 New GEOM.GEOM_Object, containing the found face.
11431 # Example: see GEOM_Spanner.py
11432 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11433 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11434 self._autoPublish(anObj, theName, "face")
11437 ## Get a face of block, found in the given shape by two given edges.
11438 # @param theShape Block or a compound of blocks.
11439 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11440 # @param theName Object name; when specified, this parameter is used
11441 # for result publication in the study. Otherwise, if automatic
11442 # publication is switched on, default value is used for result name.
11444 # @return New GEOM.GEOM_Object, containing the found face.
11446 # @ref swig_todo "Example"
11447 @ManageTransactions("BlocksOp")
11448 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11450 Get a face of block, found in the given shape by two given edges.
11453 theShape Block or a compound of blocks.
11454 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11455 theName Object name; when specified, this parameter is used
11456 for result publication in the study. Otherwise, if automatic
11457 publication is switched on, default value is used for result name.
11460 New GEOM.GEOM_Object, containing the found face.
11462 # Example: see GEOM_Spanner.py
11463 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11464 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11465 self._autoPublish(anObj, theName, "face")
11468 ## Find a face, opposite to the given one in the given block.
11469 # @param theBlock Must be a hexahedral solid.
11470 # @param theFace Face of \a theBlock, opposite to the desired face.
11471 # @param theName Object name; when specified, this parameter is used
11472 # for result publication in the study. Otherwise, if automatic
11473 # publication is switched on, default value is used for result name.
11475 # @return New GEOM.GEOM_Object, containing the found face.
11477 # @ref swig_GetOppositeFace "Example"
11478 @ManageTransactions("BlocksOp")
11479 def GetOppositeFace(self, theBlock, theFace, theName=None):
11481 Find a face, opposite to the given one in the given block.
11484 theBlock Must be a hexahedral solid.
11485 theFace Face of theBlock, opposite to the desired face.
11486 theName Object name; when specified, this parameter is used
11487 for result publication in the study. Otherwise, if automatic
11488 publication is switched on, default value is used for result name.
11491 New GEOM.GEOM_Object, containing the found face.
11493 # Example: see GEOM_Spanner.py
11494 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11495 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11496 self._autoPublish(anObj, theName, "face")
11499 ## Find a face of the given shape, which has minimal distance to the given point.
11500 # @param theShape Block or a compound of blocks.
11501 # @param thePoint Point, close to the desired face.
11502 # @param theName Object name; when specified, this parameter is used
11503 # for result publication in the study. Otherwise, if automatic
11504 # publication is switched on, default value is used for result name.
11506 # @return New GEOM.GEOM_Object, containing the found face.
11508 # @ref swig_GetFaceNearPoint "Example"
11509 @ManageTransactions("BlocksOp")
11510 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11512 Find a face of the given shape, which has minimal distance to the given point.
11515 theShape Block or a compound of blocks.
11516 thePoint Point, close to the desired face.
11517 theName Object name; when specified, this parameter is used
11518 for result publication in the study. Otherwise, if automatic
11519 publication is switched on, default value is used for result name.
11522 New GEOM.GEOM_Object, containing the found face.
11524 # Example: see GEOM_Spanner.py
11525 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11526 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11527 self._autoPublish(anObj, theName, "face")
11530 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11531 # @param theBlock Block or a compound of blocks.
11532 # @param theVector Vector, close to the normale of the desired face.
11533 # @param theName Object name; when specified, this parameter is used
11534 # for result publication in the study. Otherwise, if automatic
11535 # publication is switched on, default value is used for result name.
11537 # @return New GEOM.GEOM_Object, containing the found face.
11539 # @ref swig_todo "Example"
11540 @ManageTransactions("BlocksOp")
11541 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11543 Find a face of block, whose outside normale has minimal angle with the given vector.
11546 theBlock Block or a compound of blocks.
11547 theVector Vector, close to the normale of the desired face.
11548 theName Object name; when specified, this parameter is used
11549 for result publication in the study. Otherwise, if automatic
11550 publication is switched on, default value is used for result name.
11553 New GEOM.GEOM_Object, containing the found face.
11555 # Example: see GEOM_Spanner.py
11556 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11557 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11558 self._autoPublish(anObj, theName, "face")
11561 ## Find all sub-shapes of type \a theShapeType of the given shape,
11562 # which have minimal distance to the given point.
11563 # @param theShape Any shape.
11564 # @param thePoint Point, close to the desired shape.
11565 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11566 # @param theTolerance The tolerance for distances comparison. All shapes
11567 # with distances to the given point in interval
11568 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11569 # @param theName Object name; when specified, this parameter is used
11570 # for result publication in the study. Otherwise, if automatic
11571 # publication is switched on, default value is used for result name.
11573 # @return New GEOM_Object, containing a group of all found shapes.
11575 # @ref swig_GetShapesNearPoint "Example"
11576 @ManageTransactions("BlocksOp")
11577 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11579 Find all sub-shapes of type theShapeType of the given shape,
11580 which have minimal distance to the given point.
11583 theShape Any shape.
11584 thePoint Point, close to the desired shape.
11585 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11586 theTolerance The tolerance for distances comparison. All shapes
11587 with distances to the given point in interval
11588 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11589 theName Object name; when specified, this parameter is used
11590 for result publication in the study. Otherwise, if automatic
11591 publication is switched on, default value is used for result name.
11594 New GEOM_Object, containing a group of all found shapes.
11596 # Example: see GEOM_TestOthers.py
11597 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11598 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11599 self._autoPublish(anObj, theName, "group")
11602 # end of l3_blocks_op
11605 ## @addtogroup l4_blocks_measure
11608 ## Check, if the compound of blocks is given.
11609 # To be considered as a compound of blocks, the
11610 # given shape must satisfy the following conditions:
11611 # - Each element of the compound should be a Block (6 faces and 12 edges).
11612 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11613 # - The compound should be connexe.
11614 # - The glue between two quadrangle faces should be applied.
11615 # @param theCompound The compound to check.
11616 # @return TRUE, if the given shape is a compound of blocks.
11617 # If theCompound is not valid, prints all discovered errors.
11619 # @ref tui_measurement_tools_page "Example 1"
11620 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11621 @ManageTransactions("BlocksOp")
11622 def CheckCompoundOfBlocks(self,theCompound):
11624 Check, if the compound of blocks is given.
11625 To be considered as a compound of blocks, the
11626 given shape must satisfy the following conditions:
11627 - Each element of the compound should be a Block (6 faces and 12 edges).
11628 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11629 - The compound should be connexe.
11630 - The glue between two quadrangle faces should be applied.
11633 theCompound The compound to check.
11636 TRUE, if the given shape is a compound of blocks.
11637 If theCompound is not valid, prints all discovered errors.
11639 # Example: see GEOM_Spanner.py
11640 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11641 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11643 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11647 ## Retrieve all non blocks solids and faces from \a theShape.
11648 # @param theShape The shape to explore.
11649 # @param theName Object name; when specified, this parameter is used
11650 # for result publication in the study. Otherwise, if automatic
11651 # publication is switched on, default value is used for result name.
11653 # @return A tuple of two GEOM_Objects. The first object is a group of all
11654 # non block solids (= not 6 faces, or with 6 faces, but with the
11655 # presence of non-quadrangular faces). The second object is a
11656 # group of all non quadrangular faces.
11658 # @ref tui_measurement_tools_page "Example 1"
11659 # \n @ref swig_GetNonBlocks "Example 2"
11660 @ManageTransactions("BlocksOp")
11661 def GetNonBlocks (self, theShape, theName=None):
11663 Retrieve all non blocks solids and faces from theShape.
11666 theShape The shape to explore.
11667 theName Object name; when specified, this parameter is used
11668 for result publication in the study. Otherwise, if automatic
11669 publication is switched on, default value is used for result name.
11672 A tuple of two GEOM_Objects. The first object is a group of all
11673 non block solids (= not 6 faces, or with 6 faces, but with the
11674 presence of non-quadrangular faces). The second object is a
11675 group of all non quadrangular faces.
11678 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11680 # Example: see GEOM_Spanner.py
11681 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11682 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11683 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11686 ## Remove all seam and degenerated edges from \a theShape.
11687 # Unite faces and edges, sharing one surface. It means that
11688 # this faces must have references to one C++ surface object (handle).
11689 # @param theShape The compound or single solid to remove irregular edges from.
11690 # @param doUnionFaces If True, then unite faces. If False (the default value),
11691 # do not unite faces.
11692 # @param theName Object name; when specified, this parameter is used
11693 # for result publication in the study. Otherwise, if automatic
11694 # publication is switched on, default value is used for result name.
11696 # @return Improved shape.
11698 # @ref swig_RemoveExtraEdges "Example"
11699 @ManageTransactions("BlocksOp")
11700 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11702 Remove all seam and degenerated edges from theShape.
11703 Unite faces and edges, sharing one surface. It means that
11704 this faces must have references to one C++ surface object (handle).
11707 theShape The compound or single solid to remove irregular edges from.
11708 doUnionFaces If True, then unite faces. If False (the default value),
11709 do not unite faces.
11710 theName Object name; when specified, this parameter is used
11711 for result publication in the study. Otherwise, if automatic
11712 publication is switched on, default value is used for result name.
11717 # Example: see GEOM_TestOthers.py
11718 nbFacesOptimum = -1 # -1 means do not unite faces
11719 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11720 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11721 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11722 self._autoPublish(anObj, theName, "removeExtraEdges")
11725 ## Performs union faces of \a theShape
11726 # Unite faces sharing one surface. It means that
11727 # these faces must have references to one C++ surface object (handle).
11728 # @param theShape The compound or single solid that contains faces
11729 # to perform union.
11730 # @param theName Object name; when specified, this parameter is used
11731 # for result publication in the study. Otherwise, if automatic
11732 # publication is switched on, default value is used for result name.
11734 # @return Improved shape.
11736 # @ref swig_UnionFaces "Example"
11737 @ManageTransactions("BlocksOp")
11738 def UnionFaces(self, theShape, theName=None):
11740 Performs union faces of theShape.
11741 Unite faces sharing one surface. It means that
11742 these faces must have references to one C++ surface object (handle).
11745 theShape The compound or single solid that contains faces
11747 theName Object name; when specified, this parameter is used
11748 for result publication in the study. Otherwise, if automatic
11749 publication is switched on, default value is used for result name.
11754 # Example: see GEOM_TestOthers.py
11755 anObj = self.BlocksOp.UnionFaces(theShape)
11756 RaiseIfFailed("UnionFaces", self.BlocksOp)
11757 self._autoPublish(anObj, theName, "unionFaces")
11760 ## Check, if the given shape is a blocks compound.
11761 # Fix all detected errors.
11762 # \note Single block can be also fixed by this method.
11763 # @param theShape The compound to check and improve.
11764 # @param theName Object name; when specified, this parameter is used
11765 # for result publication in the study. Otherwise, if automatic
11766 # publication is switched on, default value is used for result name.
11768 # @return Improved compound.
11770 # @ref swig_CheckAndImprove "Example"
11771 @ManageTransactions("BlocksOp")
11772 def CheckAndImprove(self, theShape, theName=None):
11774 Check, if the given shape is a blocks compound.
11775 Fix all detected errors.
11778 Single block can be also fixed by this method.
11781 theShape The compound to check and improve.
11782 theName Object name; when specified, this parameter is used
11783 for result publication in the study. Otherwise, if automatic
11784 publication is switched on, default value is used for result name.
11789 # Example: see GEOM_TestOthers.py
11790 anObj = self.BlocksOp.CheckAndImprove(theShape)
11791 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11792 self._autoPublish(anObj, theName, "improved")
11795 # end of l4_blocks_measure
11798 ## @addtogroup l3_blocks_op
11801 ## Get all the blocks, contained in the given compound.
11802 # @param theCompound The compound to explode.
11803 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11804 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11805 # @param theName Object name; when specified, this parameter is used
11806 # for result publication in the study. Otherwise, if automatic
11807 # publication is switched on, default value is used for result name.
11809 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11811 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11813 # @ref tui_explode_on_blocks "Example 1"
11814 # \n @ref swig_MakeBlockExplode "Example 2"
11815 @ManageTransactions("BlocksOp")
11816 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11818 Get all the blocks, contained in the given compound.
11821 theCompound The compound to explode.
11822 theMinNbFaces If solid has lower number of faces, it is not a block.
11823 theMaxNbFaces If solid has higher number of faces, it is not a block.
11824 theName Object name; when specified, this parameter is used
11825 for result publication in the study. Otherwise, if automatic
11826 publication is switched on, default value is used for result name.
11829 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11832 List of GEOM.GEOM_Object, containing the retrieved blocks.
11834 # Example: see GEOM_TestOthers.py
11835 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11836 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11837 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11838 for anObj in aList:
11839 anObj.SetParameters(Parameters)
11841 self._autoPublish(aList, theName, "block")
11844 ## Find block, containing the given point inside its volume or on boundary.
11845 # @param theCompound Compound, to find block in.
11846 # @param thePoint Point, close to the desired block. If the point lays on
11847 # boundary between some blocks, we return block with nearest center.
11848 # @param theName Object name; when specified, this parameter is used
11849 # for result publication in the study. Otherwise, if automatic
11850 # publication is switched on, default value is used for result name.
11852 # @return New GEOM.GEOM_Object, containing the found block.
11854 # @ref swig_todo "Example"
11855 @ManageTransactions("BlocksOp")
11856 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11858 Find block, containing the given point inside its volume or on boundary.
11861 theCompound Compound, to find block in.
11862 thePoint Point, close to the desired block. If the point lays on
11863 boundary between some blocks, we return block with nearest center.
11864 theName Object name; when specified, this parameter is used
11865 for result publication in the study. Otherwise, if automatic
11866 publication is switched on, default value is used for result name.
11869 New GEOM.GEOM_Object, containing the found block.
11871 # Example: see GEOM_Spanner.py
11872 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11873 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11874 self._autoPublish(anObj, theName, "block")
11877 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11878 # @param theCompound Compound, to find block in.
11879 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11880 # @param theName Object name; when specified, this parameter is used
11881 # for result publication in the study. Otherwise, if automatic
11882 # publication is switched on, default value is used for result name.
11884 # @return New GEOM.GEOM_Object, containing the found block.
11886 # @ref swig_GetBlockByParts "Example"
11887 @ManageTransactions("BlocksOp")
11888 def GetBlockByParts(self, theCompound, theParts, theName=None):
11890 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11893 theCompound Compound, to find block in.
11894 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11895 theName Object name; when specified, this parameter is used
11896 for result publication in the study. Otherwise, if automatic
11897 publication is switched on, default value is used for result name.
11900 New GEOM_Object, containing the found block.
11902 # Example: see GEOM_TestOthers.py
11903 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11904 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11905 self._autoPublish(anObj, theName, "block")
11908 ## Return all blocks, containing all the elements, passed as the parts.
11909 # @param theCompound Compound, to find blocks in.
11910 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11911 # @param theName Object name; when specified, this parameter is used
11912 # for result publication in the study. Otherwise, if automatic
11913 # publication is switched on, default value is used for result name.
11915 # @return List of GEOM.GEOM_Object, containing the found blocks.
11917 # @ref swig_todo "Example"
11918 @ManageTransactions("BlocksOp")
11919 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11921 Return all blocks, containing all the elements, passed as the parts.
11924 theCompound Compound, to find blocks in.
11925 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11926 theName Object name; when specified, this parameter is used
11927 for result publication in the study. Otherwise, if automatic
11928 publication is switched on, default value is used for result name.
11931 List of GEOM.GEOM_Object, containing the found blocks.
11933 # Example: see GEOM_Spanner.py
11934 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11935 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11936 self._autoPublish(aList, theName, "block")
11939 ## Multi-transformate block and glue the result.
11940 # Transformation is defined so, as to superpose direction faces.
11941 # @param Block Hexahedral solid to be multi-transformed.
11942 # @param DirFace1 ID of First direction face.
11943 # @param DirFace2 ID of Second direction face.
11944 # @param NbTimes Quantity of transformations to be done.
11945 # @param theName Object name; when specified, this parameter is used
11946 # for result publication in the study. Otherwise, if automatic
11947 # publication is switched on, default value is used for result name.
11949 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11951 # @return New GEOM.GEOM_Object, containing the result shape.
11953 # @ref tui_multi_transformation "Example"
11954 @ManageTransactions("BlocksOp")
11955 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11957 Multi-transformate block and glue the result.
11958 Transformation is defined so, as to superpose direction faces.
11961 Block Hexahedral solid to be multi-transformed.
11962 DirFace1 ID of First direction face.
11963 DirFace2 ID of Second direction face.
11964 NbTimes Quantity of transformations to be done.
11965 theName Object name; when specified, this parameter is used
11966 for result publication in the study. Otherwise, if automatic
11967 publication is switched on, default value is used for result name.
11970 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11973 New GEOM.GEOM_Object, containing the result shape.
11975 # Example: see GEOM_Spanner.py
11976 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11977 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11978 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11979 anObj.SetParameters(Parameters)
11980 self._autoPublish(anObj, theName, "transformed")
11983 ## Multi-transformate block and glue the result.
11984 # @param Block Hexahedral solid to be multi-transformed.
11985 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11986 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11987 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11988 # @param theName Object name; when specified, this parameter is used
11989 # for result publication in the study. Otherwise, if automatic
11990 # publication is switched on, default value is used for result name.
11992 # @return New GEOM.GEOM_Object, containing the result shape.
11994 # @ref tui_multi_transformation "Example"
11995 @ManageTransactions("BlocksOp")
11996 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11997 DirFace1V, DirFace2V, NbTimesV, theName=None):
11999 Multi-transformate block and glue the result.
12002 Block Hexahedral solid to be multi-transformed.
12003 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12004 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12005 NbTimesU,NbTimesV Quantity of transformations to be done.
12006 theName Object name; when specified, this parameter is used
12007 for result publication in the study. Otherwise, if automatic
12008 publication is switched on, default value is used for result name.
12011 New GEOM.GEOM_Object, containing the result shape.
12013 # Example: see GEOM_Spanner.py
12014 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12015 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12016 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12017 DirFace1V, DirFace2V, NbTimesV)
12018 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12019 anObj.SetParameters(Parameters)
12020 self._autoPublish(anObj, theName, "transformed")
12023 ## Build all possible propagation groups.
12024 # Propagation group is a set of all edges, opposite to one (main)
12025 # edge of this group directly or through other opposite edges.
12026 # Notion of Opposite Edge make sence only on quadrangle face.
12027 # @param theShape Shape to build propagation groups on.
12028 # @param theName Object name; when specified, this parameter is used
12029 # for result publication in the study. Otherwise, if automatic
12030 # publication is switched on, default value is used for result name.
12032 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12034 # @ref swig_Propagate "Example"
12035 @ManageTransactions("BlocksOp")
12036 def Propagate(self, theShape, theName=None):
12038 Build all possible propagation groups.
12039 Propagation group is a set of all edges, opposite to one (main)
12040 edge of this group directly or through other opposite edges.
12041 Notion of Opposite Edge make sence only on quadrangle face.
12044 theShape Shape to build propagation groups on.
12045 theName Object name; when specified, this parameter is used
12046 for result publication in the study. Otherwise, if automatic
12047 publication is switched on, default value is used for result name.
12050 List of GEOM.GEOM_Object, each of them is a propagation group.
12052 # Example: see GEOM_TestOthers.py
12053 listChains = self.BlocksOp.Propagate(theShape)
12054 RaiseIfFailed("Propagate", self.BlocksOp)
12055 self._autoPublish(listChains, theName, "propagate")
12058 # end of l3_blocks_op
12061 ## @addtogroup l3_groups
12064 ## Creates a new group which will store sub-shapes of theMainShape
12065 # @param theMainShape is a GEOM object on which the group is selected
12066 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12067 # @param theName Object name; when specified, this parameter is used
12068 # for result publication in the study. Otherwise, if automatic
12069 # publication is switched on, default value is used for result name.
12071 # @return a newly created GEOM group (GEOM.GEOM_Object)
12073 # @ref tui_working_with_groups_page "Example 1"
12074 # \n @ref swig_CreateGroup "Example 2"
12075 @ManageTransactions("GroupOp")
12076 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12078 Creates a new group which will store sub-shapes of theMainShape
12081 theMainShape is a GEOM object on which the group is selected
12082 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12083 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12084 theName Object name; when specified, this parameter is used
12085 for result publication in the study. Otherwise, if automatic
12086 publication is switched on, default value is used for result name.
12089 a newly created GEOM group
12092 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12095 # Example: see GEOM_TestOthers.py
12096 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12097 RaiseIfFailed("CreateGroup", self.GroupOp)
12098 self._autoPublish(anObj, theName, "group")
12101 ## Adds a sub-object with ID theSubShapeId to the group
12102 # @param theGroup is a GEOM group to which the new sub-shape is added
12103 # @param theSubShapeID is a sub-shape ID in the main object.
12104 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12106 # @ref tui_working_with_groups_page "Example"
12107 @ManageTransactions("GroupOp")
12108 def AddObject(self,theGroup, theSubShapeID):
12110 Adds a sub-object with ID theSubShapeId to the group
12113 theGroup is a GEOM group to which the new sub-shape is added
12114 theSubShapeID is a sub-shape ID in the main object.
12117 Use method GetSubShapeID() to get an unique ID of the sub-shape
12119 # Example: see GEOM_TestOthers.py
12120 self.GroupOp.AddObject(theGroup, theSubShapeID)
12121 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
12122 RaiseIfFailed("AddObject", self.GroupOp)
12126 ## Removes a sub-object with ID \a theSubShapeId from the group
12127 # @param theGroup is a GEOM group from which the new sub-shape is removed
12128 # @param theSubShapeID is a sub-shape ID in the main object.
12129 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12131 # @ref tui_working_with_groups_page "Example"
12132 @ManageTransactions("GroupOp")
12133 def RemoveObject(self,theGroup, theSubShapeID):
12135 Removes a sub-object with ID theSubShapeId from the group
12138 theGroup is a GEOM group from which the new sub-shape is removed
12139 theSubShapeID is a sub-shape ID in the main object.
12142 Use method GetSubShapeID() to get an unique ID of the sub-shape
12144 # Example: see GEOM_TestOthers.py
12145 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
12146 RaiseIfFailed("RemoveObject", self.GroupOp)
12149 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12150 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12151 # @param theSubShapes is a list of sub-shapes to be added.
12153 # @ref tui_working_with_groups_page "Example"
12154 @ManageTransactions("GroupOp")
12155 def UnionList (self,theGroup, theSubShapes):
12157 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12160 theGroup is a GEOM group to which the new sub-shapes are added.
12161 theSubShapes is a list of sub-shapes to be added.
12163 # Example: see GEOM_TestOthers.py
12164 self.GroupOp.UnionList(theGroup, theSubShapes)
12165 RaiseIfFailed("UnionList", self.GroupOp)
12168 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12169 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12170 # @param theSubShapes is a list of indices of sub-shapes to be added.
12172 # @ref swig_UnionIDs "Example"
12173 @ManageTransactions("GroupOp")
12174 def UnionIDs(self,theGroup, theSubShapes):
12176 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12179 theGroup is a GEOM group to which the new sub-shapes are added.
12180 theSubShapes is a list of indices of sub-shapes to be added.
12182 # Example: see GEOM_TestOthers.py
12183 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12184 RaiseIfFailed("UnionIDs", self.GroupOp)
12187 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12188 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12189 # @param theSubShapes is a list of sub-shapes to be removed.
12191 # @ref tui_working_with_groups_page "Example"
12192 @ManageTransactions("GroupOp")
12193 def DifferenceList (self,theGroup, theSubShapes):
12195 Removes from the group all the given shapes. No errors, if some shapes are not included.
12198 theGroup is a GEOM group from which the sub-shapes are removed.
12199 theSubShapes is a list of sub-shapes to be removed.
12201 # Example: see GEOM_TestOthers.py
12202 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12203 RaiseIfFailed("DifferenceList", self.GroupOp)
12206 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12207 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12208 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12210 # @ref swig_DifferenceIDs "Example"
12211 @ManageTransactions("GroupOp")
12212 def DifferenceIDs(self,theGroup, theSubShapes):
12214 Removes from the group all the given shapes. No errors, if some shapes are not included.
12217 theGroup is a GEOM group from which the sub-shapes are removed.
12218 theSubShapes is a list of indices of sub-shapes to be removed.
12220 # Example: see GEOM_TestOthers.py
12221 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12222 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12225 ## Union of two groups.
12226 # New group is created. It will contain all entities
12227 # which are present in groups theGroup1 and theGroup2.
12228 # @param theGroup1, theGroup2 are the initial GEOM groups
12229 # to create the united group from.
12230 # @param theName Object name; when specified, this parameter is used
12231 # for result publication in the study. Otherwise, if automatic
12232 # publication is switched on, default value is used for result name.
12234 # @return a newly created GEOM group.
12236 # @ref tui_union_groups_anchor "Example"
12237 @ManageTransactions("GroupOp")
12238 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12240 Union of two groups.
12241 New group is created. It will contain all entities
12242 which are present in groups theGroup1 and theGroup2.
12245 theGroup1, theGroup2 are the initial GEOM groups
12246 to create the united group from.
12247 theName Object name; when specified, this parameter is used
12248 for result publication in the study. Otherwise, if automatic
12249 publication is switched on, default value is used for result name.
12252 a newly created GEOM group.
12254 # Example: see GEOM_TestOthers.py
12255 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12256 RaiseIfFailed("UnionGroups", self.GroupOp)
12257 self._autoPublish(aGroup, theName, "group")
12260 ## Intersection of two groups.
12261 # New group is created. It will contain only those entities
12262 # which are present in both groups theGroup1 and theGroup2.
12263 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12264 # @param theName Object name; when specified, this parameter is used
12265 # for result publication in the study. Otherwise, if automatic
12266 # publication is switched on, default value is used for result name.
12268 # @return a newly created GEOM group.
12270 # @ref tui_intersect_groups_anchor "Example"
12271 @ManageTransactions("GroupOp")
12272 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12274 Intersection of two groups.
12275 New group is created. It will contain only those entities
12276 which are present in both groups theGroup1 and theGroup2.
12279 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12280 theName Object name; when specified, this parameter is used
12281 for result publication in the study. Otherwise, if automatic
12282 publication is switched on, default value is used for result name.
12285 a newly created GEOM group.
12287 # Example: see GEOM_TestOthers.py
12288 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12289 RaiseIfFailed("IntersectGroups", self.GroupOp)
12290 self._autoPublish(aGroup, theName, "group")
12293 ## Cut of two groups.
12294 # New group is created. It will contain entities which are
12295 # present in group theGroup1 but are not present in group theGroup2.
12296 # @param theGroup1 is a GEOM group to include elements of.
12297 # @param theGroup2 is a GEOM group to exclude elements of.
12298 # @param theName Object name; when specified, this parameter is used
12299 # for result publication in the study. Otherwise, if automatic
12300 # publication is switched on, default value is used for result name.
12302 # @return a newly created GEOM group.
12304 # @ref tui_cut_groups_anchor "Example"
12305 @ManageTransactions("GroupOp")
12306 def CutGroups (self, theGroup1, theGroup2, theName=None):
12309 New group is created. It will contain entities which are
12310 present in group theGroup1 but are not present in group theGroup2.
12313 theGroup1 is a GEOM group to include elements of.
12314 theGroup2 is a GEOM group to exclude elements of.
12315 theName Object name; when specified, this parameter is used
12316 for result publication in the study. Otherwise, if automatic
12317 publication is switched on, default value is used for result name.
12320 a newly created GEOM group.
12322 # Example: see GEOM_TestOthers.py
12323 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12324 RaiseIfFailed("CutGroups", self.GroupOp)
12325 self._autoPublish(aGroup, theName, "group")
12328 ## Union of list of groups.
12329 # New group is created. It will contain all entities that are
12330 # present in groups listed in theGList.
12331 # @param theGList is a list of GEOM groups to create the united group from.
12332 # @param theName Object name; when specified, this parameter is used
12333 # for result publication in the study. Otherwise, if automatic
12334 # publication is switched on, default value is used for result name.
12336 # @return a newly created GEOM group.
12338 # @ref tui_union_groups_anchor "Example"
12339 @ManageTransactions("GroupOp")
12340 def UnionListOfGroups (self, theGList, theName=None):
12342 Union of list of groups.
12343 New group is created. It will contain all entities that are
12344 present in groups listed in theGList.
12347 theGList is a list of GEOM groups to create the united group from.
12348 theName Object name; when specified, this parameter is used
12349 for result publication in the study. Otherwise, if automatic
12350 publication is switched on, default value is used for result name.
12353 a newly created GEOM group.
12355 # Example: see GEOM_TestOthers.py
12356 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12357 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12358 self._autoPublish(aGroup, theName, "group")
12361 ## Cut of lists of groups.
12362 # New group is created. It will contain only entities
12363 # which are present in groups listed in theGList.
12364 # @param theGList is a list of GEOM groups to include elements of.
12365 # @param theName Object name; when specified, this parameter is used
12366 # for result publication in the study. Otherwise, if automatic
12367 # publication is switched on, default value is used for result name.
12369 # @return a newly created GEOM group.
12371 # @ref tui_intersect_groups_anchor "Example"
12372 @ManageTransactions("GroupOp")
12373 def IntersectListOfGroups (self, theGList, theName=None):
12375 Cut of lists of groups.
12376 New group is created. It will contain only entities
12377 which are present in groups listed in theGList.
12380 theGList is a list of GEOM groups to include elements of.
12381 theName Object name; when specified, this parameter is used
12382 for result publication in the study. Otherwise, if automatic
12383 publication is switched on, default value is used for result name.
12386 a newly created GEOM group.
12388 # Example: see GEOM_TestOthers.py
12389 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12390 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12391 self._autoPublish(aGroup, theName, "group")
12394 ## Cut of lists of groups.
12395 # New group is created. It will contain only entities
12396 # which are present in groups listed in theGList1 but
12397 # are not present in groups from theGList2.
12398 # @param theGList1 is a list of GEOM groups to include elements of.
12399 # @param theGList2 is a list of GEOM groups to exclude elements of.
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.
12406 # @ref tui_cut_groups_anchor "Example"
12407 @ManageTransactions("GroupOp")
12408 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12410 Cut of lists of groups.
12411 New group is created. It will contain only entities
12412 which are present in groups listed in theGList1 but
12413 are not present in groups from theGList2.
12416 theGList1 is a list of GEOM groups to include elements of.
12417 theGList2 is a list of GEOM groups to exclude elements of.
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.
12425 # Example: see GEOM_TestOthers.py
12426 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12427 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12428 self._autoPublish(aGroup, theName, "group")
12431 ## Returns a list of sub-objects ID stored in the group
12432 # @param theGroup is a GEOM group for which a list of IDs is requested
12434 # @ref swig_GetObjectIDs "Example"
12435 @ManageTransactions("GroupOp")
12436 def GetObjectIDs(self,theGroup):
12438 Returns a list of sub-objects ID stored in the group
12441 theGroup is a GEOM group for which a list of IDs is requested
12443 # Example: see GEOM_TestOthers.py
12444 ListIDs = self.GroupOp.GetObjects(theGroup)
12445 RaiseIfFailed("GetObjects", self.GroupOp)
12448 ## Returns a type of sub-objects stored in the group
12449 # @param theGroup is a GEOM group which type is returned.
12451 # @ref swig_GetType "Example"
12452 @ManageTransactions("GroupOp")
12453 def GetType(self,theGroup):
12455 Returns a type of sub-objects stored in the group
12458 theGroup is a GEOM group which type is returned.
12460 # Example: see GEOM_TestOthers.py
12461 aType = self.GroupOp.GetType(theGroup)
12462 RaiseIfFailed("GetType", self.GroupOp)
12465 ## Convert a type of geom object from id to string value
12466 # @param theId is a GEOM obect type id.
12467 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12468 # @ref swig_GetType "Example"
12469 def ShapeIdToType(self, theId):
12471 Convert a type of geom object from id to string value
12474 theId is a GEOM obect type id.
12477 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12504 return "REVOLUTION"
12552 return "FREE_BOUNDS"
12560 return "THRUSECTIONS"
12562 return "COMPOUNDFILTER"
12564 return "SHAPES_ON_SHAPE"
12566 return "ELLIPSE_ARC"
12568 return "3DSKETCHER"
12574 return "PIPETSHAPE"
12575 return "Shape Id not exist."
12577 ## Returns a main shape associated with the group
12578 # @param theGroup is a GEOM group for which a main shape object is requested
12579 # @return a GEOM object which is a main shape for theGroup
12581 # @ref swig_GetMainShape "Example"
12582 @ManageTransactions("GroupOp")
12583 def GetMainShape(self,theGroup):
12585 Returns a main shape associated with the group
12588 theGroup is a GEOM group for which a main shape object is requested
12591 a GEOM object which is a main shape for theGroup
12593 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12595 # Example: see GEOM_TestOthers.py
12596 anObj = self.GroupOp.GetMainShape(theGroup)
12597 RaiseIfFailed("GetMainShape", self.GroupOp)
12600 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12601 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12602 # @param theShape given shape (see GEOM.GEOM_Object)
12603 # @param min_length minimum length of edges of theShape
12604 # @param max_length maximum length of edges of theShape
12605 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12606 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12607 # @param theName Object name; when specified, this parameter is used
12608 # for result publication in the study. Otherwise, if automatic
12609 # publication is switched on, default value is used for result name.
12611 # @return a newly created GEOM group of edges
12613 # @@ref swig_todo "Example"
12614 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12616 Create group of edges of theShape, whose length is in range [min_length, max_length].
12617 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12620 theShape given shape
12621 min_length minimum length of edges of theShape
12622 max_length maximum length of edges of theShape
12623 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12624 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12625 theName Object name; when specified, this parameter is used
12626 for result publication in the study. Otherwise, if automatic
12627 publication is switched on, default value is used for result name.
12630 a newly created GEOM group of edges.
12632 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12633 edges_in_range = []
12635 Props = self.BasicProperties(edge)
12636 if min_length <= Props[0] and Props[0] <= max_length:
12637 if (not include_min) and (min_length == Props[0]):
12640 if (not include_max) and (Props[0] == max_length):
12643 edges_in_range.append(edge)
12645 if len(edges_in_range) <= 0:
12646 print "No edges found by given criteria"
12649 # note: auto-publishing is done in self.CreateGroup()
12650 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12651 self.UnionList(group_edges, edges_in_range)
12655 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12656 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12657 # @param min_length minimum length of edges of selected shape
12658 # @param max_length maximum length of edges of selected shape
12659 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12660 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12661 # @return a newly created GEOM group of edges
12662 # @ref swig_todo "Example"
12663 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12665 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12666 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12669 min_length minimum length of edges of selected shape
12670 max_length maximum length of edges of selected shape
12671 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12672 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12675 a newly created GEOM group of edges.
12677 nb_selected = sg.SelectedCount()
12678 if nb_selected < 1:
12679 print "Select a shape before calling this function, please."
12681 if nb_selected > 1:
12682 print "Only one shape must be selected"
12685 id_shape = sg.getSelected(0)
12686 shape = IDToObject( id_shape )
12688 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12692 if include_min: left_str = " <= "
12693 if include_max: right_str = " <= "
12695 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12696 + left_str + "length" + right_str + `max_length`)
12698 sg.updateObjBrowser(1)
12705 #@@ insert new functions before this line @@ do not remove this line @@#
12707 ## Create a copy of the given object
12709 # @param theOriginal geometry object for copy
12710 # @param theName Object name; when specified, this parameter is used
12711 # for result publication in the study. Otherwise, if automatic
12712 # publication is switched on, default value is used for result name.
12714 # @return New GEOM_Object, containing the copied shape.
12716 # @ingroup l1_geomBuilder_auxiliary
12717 # @ref swig_MakeCopy "Example"
12718 @ManageTransactions("InsertOp")
12719 def MakeCopy(self, theOriginal, theName=None):
12721 Create a copy of the given object
12724 theOriginal geometry object for copy
12725 theName Object name; when specified, this parameter is used
12726 for result publication in the study. Otherwise, if automatic
12727 publication is switched on, default value is used for result name.
12730 New GEOM_Object, containing the copied shape.
12732 Example of usage: Copy = geompy.MakeCopy(Box)
12734 # Example: see GEOM_TestAll.py
12735 anObj = self.InsertOp.MakeCopy(theOriginal)
12736 RaiseIfFailed("MakeCopy", self.InsertOp)
12737 self._autoPublish(anObj, theName, "copy")
12740 ## Add Path to load python scripts from
12741 # @param Path a path to load python scripts from
12742 # @ingroup l1_geomBuilder_auxiliary
12743 def addPath(self,Path):
12745 Add Path to load python scripts from
12748 Path a path to load python scripts from
12750 if (sys.path.count(Path) < 1):
12751 sys.path.append(Path)
12755 ## Load marker texture from the file
12756 # @param Path a path to the texture file
12757 # @return unique texture identifier
12758 # @ingroup l1_geomBuilder_auxiliary
12759 @ManageTransactions("InsertOp")
12760 def LoadTexture(self, Path):
12762 Load marker texture from the file
12765 Path a path to the texture file
12768 unique texture identifier
12770 # Example: see GEOM_TestAll.py
12771 ID = self.InsertOp.LoadTexture(Path)
12772 RaiseIfFailed("LoadTexture", self.InsertOp)
12775 ## Get internal name of the object based on its study entry
12776 # @note This method does not provide an unique identifier of the geometry object.
12777 # @note This is internal function of GEOM component, though it can be used outside it for
12778 # appropriate reason (e.g. for identification of geometry object).
12779 # @param obj geometry object
12780 # @return unique object identifier
12781 # @ingroup l1_geomBuilder_auxiliary
12782 def getObjectID(self, obj):
12784 Get internal name of the object based on its study entry.
12785 Note: this method does not provide an unique identifier of the geometry object.
12786 It is an internal function of GEOM component, though it can be used outside GEOM for
12787 appropriate reason (e.g. for identification of geometry object).
12790 obj geometry object
12793 unique object identifier
12796 entry = salome.ObjectToID(obj)
12797 if entry is not None:
12798 lst = entry.split(":")
12800 ID = lst[-1] # -1 means last item in the list
12801 return "GEOM_" + ID
12806 ## Add marker texture. @a Width and @a Height parameters
12807 # specify width and height of the texture in pixels.
12808 # If @a RowData is @c True, @a Texture parameter should represent texture data
12809 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12810 # parameter should be unpacked string, in which '1' symbols represent opaque
12811 # pixels and '0' represent transparent pixels of the texture bitmap.
12813 # @param Width texture width in pixels
12814 # @param Height texture height in pixels
12815 # @param Texture texture data
12816 # @param RowData if @c True, @a Texture data are packed in the byte stream
12817 # @return unique texture identifier
12818 # @ingroup l1_geomBuilder_auxiliary
12819 @ManageTransactions("InsertOp")
12820 def AddTexture(self, Width, Height, Texture, RowData=False):
12822 Add marker texture. Width and Height parameters
12823 specify width and height of the texture in pixels.
12824 If RowData is True, Texture parameter should represent texture data
12825 packed into the byte array. If RowData is False (default), Texture
12826 parameter should be unpacked string, in which '1' symbols represent opaque
12827 pixels and '0' represent transparent pixels of the texture bitmap.
12830 Width texture width in pixels
12831 Height texture height in pixels
12832 Texture texture data
12833 RowData if True, Texture data are packed in the byte stream
12836 return unique texture identifier
12838 if not RowData: Texture = PackData(Texture)
12839 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12840 RaiseIfFailed("AddTexture", self.InsertOp)
12843 ## Creates a new folder object. It is a container for any GEOM objects.
12844 # @param Name name of the container
12845 # @param Father parent object. If None,
12846 # folder under 'Geometry' root object will be created.
12847 # @return a new created folder
12848 # @ingroup l1_publish_data
12849 def NewFolder(self, Name, Father=None):
12851 Create a new folder object. It is an auxiliary container for any GEOM objects.
12854 Name name of the container
12855 Father parent object. If None,
12856 folder under 'Geometry' root object will be created.
12859 a new created folder
12861 if not Father: Father = self.father
12862 return self.CreateFolder(Name, Father)
12864 ## Move object to the specified folder
12865 # @param Object object to move
12866 # @param Folder target folder
12867 # @ingroup l1_publish_data
12868 def PutToFolder(self, Object, Folder):
12870 Move object to the specified folder
12873 Object object to move
12874 Folder target folder
12876 self.MoveToFolder(Object, Folder)
12879 ## Move list of objects to the specified folder
12880 # @param ListOfSO list of objects to move
12881 # @param Folder target folder
12882 # @ingroup l1_publish_data
12883 def PutListToFolder(self, ListOfSO, Folder):
12885 Move list of objects to the specified folder
12888 ListOfSO list of objects to move
12889 Folder target folder
12891 self.MoveListToFolder(ListOfSO, Folder)
12894 ## @addtogroup l2_field
12898 # @param shape the shape the field lies on
12899 # @param name the field name
12900 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12901 # @param dimension dimension of the shape the field lies on
12902 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12903 # @param componentNames names of components
12904 # @return a created field
12905 @ManageTransactions("FieldOp")
12906 def CreateField(self, shape, name, type, dimension, componentNames):
12911 shape the shape the field lies on
12912 name the field name
12913 type type of field data
12914 dimension dimension of the shape the field lies on
12915 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12916 componentNames names of components
12921 if isinstance( type, int ):
12922 if type < 0 or type > 3:
12923 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12924 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12926 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12927 RaiseIfFailed("CreateField", self.FieldOp)
12929 geom._autoPublish( f, "", name)
12932 ## Removes a field from the GEOM component
12933 # @param field the field to remove
12934 def RemoveField(self, field):
12935 "Removes a field from the GEOM component"
12937 if isinstance( field, GEOM._objref_GEOM_Field ):
12938 geom.RemoveObject( field )
12939 elif isinstance( field, geomField ):
12940 geom.RemoveObject( field.field )
12942 raise RuntimeError, "RemoveField() : the object is not a field"
12945 ## Returns number of fields on a shape
12946 @ManageTransactions("FieldOp")
12947 def CountFields(self, shape):
12948 "Returns number of fields on a shape"
12949 nb = self.FieldOp.CountFields( shape )
12950 RaiseIfFailed("CountFields", self.FieldOp)
12953 ## Returns all fields on a shape
12954 @ManageTransactions("FieldOp")
12955 def GetFields(self, shape):
12956 "Returns all fields on a shape"
12957 ff = self.FieldOp.GetFields( shape )
12958 RaiseIfFailed("GetFields", self.FieldOp)
12961 ## Returns a field on a shape by its name
12962 @ManageTransactions("FieldOp")
12963 def GetField(self, shape, name):
12964 "Returns a field on a shape by its name"
12965 f = self.FieldOp.GetField( shape, name )
12966 RaiseIfFailed("GetField", self.FieldOp)
12974 # Register the new proxy for GEOM_Gen
12975 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12978 ## Field on Geometry
12979 # @ingroup l2_field
12980 class geomField( GEOM._objref_GEOM_Field ):
12982 def __init__(self):
12983 GEOM._objref_GEOM_Field.__init__(self)
12984 self.field = GEOM._objref_GEOM_Field
12987 ## Returns the shape the field lies on
12988 def getShape(self):
12989 "Returns the shape the field lies on"
12990 return self.field.GetShape(self)
12992 ## Returns the field name
12994 "Returns the field name"
12995 return self.field.GetName(self)
12997 ## Returns type of field data as integer [0-3]
12999 "Returns type of field data"
13000 return self.field.GetDataType(self)._v
13002 ## Returns type of field data:
13003 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13004 def getTypeEnum(self):
13005 "Returns type of field data"
13006 return self.field.GetDataType(self)
13008 ## Returns dimension of the shape the field lies on:
13009 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13010 def getDimension(self):
13011 """Returns dimension of the shape the field lies on:
13012 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13013 return self.field.GetDimension(self)
13015 ## Returns names of components
13016 def getComponents(self):
13017 "Returns names of components"
13018 return self.field.GetComponents(self)
13020 ## Adds a time step to the field
13021 # @param step the time step number further used as the step identifier
13022 # @param stamp the time step time
13023 # @param values the values of the time step
13024 def addStep(self, step, stamp, values):
13025 "Adds a time step to the field"
13026 stp = self.field.AddStep( self, step, stamp )
13028 raise RuntimeError, \
13029 "Field.addStep() : Error: step %s already exists in this field"%step
13031 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13032 self.setValues( step, values )
13035 ## Remove a time step from the field
13036 def removeStep(self,step):
13037 "Remove a time step from the field"
13040 stepObj = self.field.GetStep( self, step )
13042 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13045 #traceback.print_exc()
13047 self.field.RemoveStep( self, step )
13049 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13052 ## Returns number of time steps in the field
13053 def countSteps(self):
13054 "Returns number of time steps in the field"
13055 return self.field.CountSteps(self)
13057 ## Returns a list of time step IDs in the field
13058 def getSteps(self):
13059 "Returns a list of time step IDs in the field"
13060 return self.field.GetSteps(self)
13062 ## Returns a time step by its ID
13063 def getStep(self,step):
13064 "Returns a time step by its ID"
13065 stp = self.field.GetStep(self, step)
13067 raise RuntimeError, "Step %s is missing from this field"%step
13070 ## Returns the time of the field step
13071 def getStamp(self,step):
13072 "Returns the time of the field step"
13073 return self.getStep(step).GetStamp()
13075 ## Changes the time of the field step
13076 def setStamp(self, step, stamp):
13077 "Changes the time of the field step"
13078 return self.getStep(step).SetStamp(stamp)
13080 ## Returns values of the field step
13081 def getValues(self, step):
13082 "Returns values of the field step"
13083 return self.getStep(step).GetValues()
13085 ## Changes values of the field step
13086 def setValues(self, step, values):
13087 "Changes values of the field step"
13088 stp = self.getStep(step)
13089 errBeg = "Field.setValues(values) : Error: "
13091 ok = stp.SetValues( values )
13092 except Exception, e:
13094 if excStr.find("WrongPythonType") > 0:
13095 raise RuntimeError, errBeg +\
13096 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13097 raise RuntimeError, errBeg + str(e)
13099 nbOK = self.field.GetArraySize(self)
13102 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13104 raise RuntimeError, errBeg + "failed"
13107 pass # end of class geomField
13109 # Register the new proxy for GEOM_Field
13110 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13113 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13114 # interface to GEOM operations.
13119 # salome.salome_init()
13120 # from salome.geom import geomBuilder
13121 # geompy = geomBuilder.New(salome.myStudy)
13123 # @param study SALOME study, generally obtained by salome.myStudy.
13124 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13125 # @return geomBuilder instance
13126 def New( study, instance=None):
13128 Create a new geomBuilder instance.The geomBuilder class provides the Python
13129 interface to GEOM operations.
13133 salome.salome_init()
13134 from salome.geom import geomBuilder
13135 geompy = geomBuilder.New(salome.myStudy)
13138 study SALOME study, generally obtained by salome.myStudy.
13139 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13141 geomBuilder instance
13143 #print "New geomBuilder ", study, instance
13150 geom = geomBuilder()
13151 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13152 geom.init_geom(study)
13156 # Register methods from the plug-ins in the geomBuilder class
13157 plugins_var = os.environ.get( "GEOM_PluginsList" )
13160 if plugins_var is not None:
13161 plugins = plugins_var.split( ":" )
13162 plugins=filter(lambda x: len(x)>0, plugins)
13163 if plugins is not None:
13164 for pluginName in plugins:
13165 pluginBuilderName = pluginName + "Builder"
13167 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
13168 except Exception, e:
13169 from salome_utils import verbose
13170 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
13172 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
13173 plugin = eval( pluginBuilderName )
13175 # add methods from plugin module to the geomBuilder class
13176 for k in dir( plugin ):
13177 if k[0] == '_': continue
13178 method = getattr( plugin, k )
13179 if type( method ).__name__ == 'function':
13180 if not hasattr( geomBuilder, k ):
13181 setattr( geomBuilder, k, method )