1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2015 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, theName="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, theName=("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)
789 # load data from the study file, if necessary
790 self.myBuilder.LoadWith(self.father, self)
793 def GetPluginOperations(self, studyID, libraryName):
794 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
797 ## Enable / disable results auto-publishing
799 # The automatic publishing is managed in the following way:
800 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
801 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
802 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
803 # value passed as parameter has the same effect.
804 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
805 # maximum number of sub-shapes allowed for publishing is set to specified value.
807 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
808 # @ingroup l1_publish_data
809 def addToStudyAuto(self, maxNbSubShapes=-1):
811 Enable / disable results auto-publishing
813 The automatic publishing is managed in the following way:
814 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
815 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
816 maximum number of sub-shapes allowed for publishing is unlimited; any negative
817 value passed as parameter has the same effect.
818 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
819 maximum number of sub-shapes allowed for publishing is set to this value.
822 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
825 geompy.addToStudyAuto() # enable auto-publishing
826 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
827 geompy.addToStudyAuto(0) # disable auto-publishing
829 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
832 ## Dump component to the Python script
833 # This method overrides IDL function to allow default values for the parameters.
834 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
836 Dump component to the Python script
837 This method overrides IDL function to allow default values for the parameters.
839 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
841 ## Get name for sub-shape aSubObj of shape aMainObj
843 # @ref swig_SubShapeName "Example"
844 @ManageTransactions("ShapesOp")
845 def SubShapeName(self,aSubObj, aMainObj):
847 Get name for sub-shape aSubObj of shape aMainObj
849 # Example: see GEOM_TestAll.py
851 #aSubId = orb.object_to_string(aSubObj)
852 #aMainId = orb.object_to_string(aMainObj)
853 #index = gg.getIndexTopology(aSubId, aMainId)
854 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
855 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
856 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
859 ## Publish in study aShape with name aName
861 # \param aShape the shape to be published
862 # \param aName the name for the shape
863 # \param doRestoreSubShapes if True, finds and publishes also
864 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
865 # and published sub-shapes of arguments
866 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
867 # these arguments description
868 # \return study entry of the published shape in form of string
870 # @ingroup l1_publish_data
871 # @ref swig_all_addtostudy "Example"
872 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
873 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
875 Publish in study aShape with name aName
878 aShape the shape to be published
879 aName the name for the shape
880 doRestoreSubShapes if True, finds and publishes also
881 sub-shapes of aShape, corresponding to its arguments
882 and published sub-shapes of arguments
883 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
884 these arguments description
887 study entry of the published shape in form of string
890 id_block1 = geompy.addToStudy(Block1, "Block 1")
892 # Example: see GEOM_TestAll.py
894 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
895 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
896 if doRestoreSubShapes:
897 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
898 theFindMethod, theInheritFirstArg, True )
900 print "addToStudy() failed"
902 return aShape.GetStudyEntry()
904 ## Publish in study aShape with name aName as sub-object of previously published aFather
905 # \param aFather previously published object
906 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
907 # \param aName the name for the shape
909 # \return study entry of the published shape in form of string
911 # @ingroup l1_publish_data
912 # @ref swig_all_addtostudyInFather "Example"
913 def addToStudyInFather(self, aFather, aShape, aName):
915 Publish in study aShape with name aName as sub-object of previously published aFather
918 aFather previously published object
919 aShape the shape to be published as sub-object of aFather
920 aName the name for the shape
923 study entry of the published shape in form of string
925 # Example: see GEOM_TestAll.py
927 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
928 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
930 print "addToStudyInFather() failed"
932 return aShape.GetStudyEntry()
934 ## Unpublish object in study
936 # \param obj the object to be unpublished
937 def hideInStudy(self, obj):
939 Unpublish object in study
942 obj the object to be unpublished
944 ior = salome.orb.object_to_string(obj)
945 aSObject = self.myStudy.FindObjectIOR(ior)
946 if aSObject is not None:
947 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
948 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
949 drwAttribute.SetDrawable(False)
950 # hide references if any
951 vso = self.myStudy.FindDependances(aSObject);
953 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
954 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
955 drwAttribute.SetDrawable(False)
959 # end of l1_geomBuilder_auxiliary
962 ## @addtogroup l3_restore_ss
965 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
966 # To be used from python scripts out of addToStudy() (non-default usage)
967 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
968 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
969 # If this list is empty, all operation arguments will be published
970 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
971 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
972 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
973 # Do not publish sub-shapes in place of arguments, but only
974 # in place of sub-shapes of the first argument,
975 # because the whole shape corresponds to the first argument.
976 # Mainly to be used after transformations, but it also can be
977 # usefull after partition with one object shape, and some other
978 # operations, where only the first argument has to be considered.
979 # If theObject has only one argument shape, this flag is automatically
980 # considered as True, not regarding really passed value.
981 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
982 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
983 # \return list of published sub-shapes
985 # @ref tui_restore_prs_params "Example"
986 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
987 theInheritFirstArg=False, theAddPrefix=True):
989 Publish sub-shapes, standing for arguments and sub-shapes of arguments
990 To be used from python scripts out of geompy.addToStudy (non-default usage)
993 theObject published GEOM.GEOM_Object, arguments of which will be published
994 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
995 If this list is empty, all operation arguments will be published
996 theFindMethod method to search sub-shapes, corresponding to arguments and
997 their sub-shapes. Value from enumeration GEOM.find_shape_method.
998 theInheritFirstArg set properties of the first argument for theObject.
999 Do not publish sub-shapes in place of arguments, but only
1000 in place of sub-shapes of the first argument,
1001 because the whole shape corresponds to the first argument.
1002 Mainly to be used after transformations, but it also can be
1003 usefull after partition with one object shape, and some other
1004 operations, where only the first argument has to be considered.
1005 If theObject has only one argument shape, this flag is automatically
1006 considered as True, not regarding really passed value.
1007 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1008 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1010 list of published sub-shapes
1012 # Example: see GEOM_TestAll.py
1013 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1014 theFindMethod, theInheritFirstArg, theAddPrefix)
1016 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1017 # To be used from python scripts out of addToStudy() (non-default usage)
1018 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1019 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1020 # If this list is empty, all operation arguments will be published
1021 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1022 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1023 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1024 # Do not publish sub-shapes in place of arguments, but only
1025 # in place of sub-shapes of the first argument,
1026 # because the whole shape corresponds to the first argument.
1027 # Mainly to be used after transformations, but it also can be
1028 # usefull after partition with one object shape, and some other
1029 # operations, where only the first argument has to be considered.
1030 # If theObject has only one argument shape, this flag is automatically
1031 # considered as True, not regarding really passed value.
1032 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1033 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1034 # \return list of published sub-shapes
1036 # @ref tui_restore_prs_params "Example"
1037 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1038 theInheritFirstArg=False, theAddPrefix=True):
1040 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1041 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1044 theObject published GEOM.GEOM_Object, arguments of which will be published
1045 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1046 If this list is empty, all operation arguments will be published
1047 theFindMethod method to search sub-shapes, corresponding to arguments and
1048 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1049 theInheritFirstArg set properties of the first argument for theObject.
1050 Do not publish sub-shapes in place of arguments, but only
1051 in place of sub-shapes of the first argument,
1052 because the whole shape corresponds to the first argument.
1053 Mainly to be used after transformations, but it also can be
1054 usefull after partition with one object shape, and some other
1055 operations, where only the first argument has to be considered.
1056 If theObject has only one argument shape, this flag is automatically
1057 considered as True, not regarding really passed value.
1058 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1059 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1062 list of published sub-shapes
1064 # Example: see GEOM_TestAll.py
1065 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1066 theFindMethod, theInheritFirstArg, theAddPrefix)
1068 # end of l3_restore_ss
1071 ## @addtogroup l3_basic_go
1074 ## Create point by three coordinates.
1075 # @param theX The X coordinate of the point.
1076 # @param theY The Y coordinate of the point.
1077 # @param theZ The Z coordinate of the point.
1078 # @param theName Object name; when specified, this parameter is used
1079 # for result publication in the study. Otherwise, if automatic
1080 # publication is switched on, default value is used for result name.
1082 # @return New GEOM.GEOM_Object, containing the created point.
1084 # @ref tui_creation_point "Example"
1085 @ManageTransactions("BasicOp")
1086 def MakeVertex(self, theX, theY, theZ, theName=None):
1088 Create point by three coordinates.
1091 theX The X coordinate of the point.
1092 theY The Y coordinate of the point.
1093 theZ The Z coordinate of the point.
1094 theName Object name; when specified, this parameter is used
1095 for result publication in the study. Otherwise, if automatic
1096 publication is switched on, default value is used for result name.
1099 New GEOM.GEOM_Object, containing the created point.
1101 # Example: see GEOM_TestAll.py
1102 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1103 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1104 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1105 anObj.SetParameters(Parameters)
1106 self._autoPublish(anObj, theName, "vertex")
1109 ## Create a point, distant from the referenced point
1110 # on the given distances along the coordinate axes.
1111 # @param theReference The referenced point.
1112 # @param theX Displacement from the referenced point along OX axis.
1113 # @param theY Displacement from the referenced point along OY axis.
1114 # @param theZ Displacement from the referenced point along OZ axis.
1115 # @param theName Object name; when specified, this parameter is used
1116 # for result publication in the study. Otherwise, if automatic
1117 # publication is switched on, default value is used for result name.
1119 # @return New GEOM.GEOM_Object, containing the created point.
1121 # @ref tui_creation_point "Example"
1122 @ManageTransactions("BasicOp")
1123 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1125 Create a point, distant from the referenced point
1126 on the given distances along the coordinate axes.
1129 theReference The referenced point.
1130 theX Displacement from the referenced point along OX axis.
1131 theY Displacement from the referenced point along OY axis.
1132 theZ Displacement from the referenced point along OZ axis.
1133 theName Object name; when specified, this parameter is used
1134 for result publication in the study. Otherwise, if automatic
1135 publication is switched on, default value is used for result name.
1138 New GEOM.GEOM_Object, containing the created point.
1140 # Example: see GEOM_TestAll.py
1141 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1142 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1143 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1144 anObj.SetParameters(Parameters)
1145 self._autoPublish(anObj, theName, "vertex")
1148 ## Create a point, corresponding to the given parameter on the given curve.
1149 # @param theRefCurve The referenced curve.
1150 # @param theParameter Value of parameter on the referenced curve.
1151 # @param theName Object name; when specified, this parameter is used
1152 # for result publication in the study. Otherwise, if automatic
1153 # publication is switched on, default value is used for result name.
1155 # @return New GEOM.GEOM_Object, containing the created point.
1157 # @ref tui_creation_point "Example"
1158 @ManageTransactions("BasicOp")
1159 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1161 Create a point, corresponding to the given parameter on the given curve.
1164 theRefCurve The referenced curve.
1165 theParameter Value of parameter on the referenced curve.
1166 theName Object name; when specified, this parameter is used
1167 for result publication in the study. Otherwise, if automatic
1168 publication is switched on, default value is used for result name.
1171 New GEOM.GEOM_Object, containing the created point.
1174 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1176 # Example: see GEOM_TestAll.py
1177 theParameter, Parameters = ParseParameters(theParameter)
1178 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1179 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1180 anObj.SetParameters(Parameters)
1181 self._autoPublish(anObj, theName, "vertex")
1184 ## Create a point by projection give coordinates on the given curve
1185 # @param theRefCurve The referenced curve.
1186 # @param theX X-coordinate in 3D space
1187 # @param theY Y-coordinate in 3D space
1188 # @param theZ Z-coordinate in 3D space
1189 # @param theName Object name; when specified, this parameter is used
1190 # for result publication in the study. Otherwise, if automatic
1191 # publication is switched on, default value is used for result name.
1193 # @return New GEOM.GEOM_Object, containing the created point.
1195 # @ref tui_creation_point "Example"
1196 @ManageTransactions("BasicOp")
1197 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1199 Create a point by projection give coordinates on the given curve
1202 theRefCurve The referenced curve.
1203 theX X-coordinate in 3D space
1204 theY Y-coordinate in 3D space
1205 theZ Z-coordinate in 3D space
1206 theName Object name; when specified, this parameter is used
1207 for result publication in the study. Otherwise, if automatic
1208 publication is switched on, default value is used for result name.
1211 New GEOM.GEOM_Object, containing the created point.
1214 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1216 # Example: see GEOM_TestAll.py
1217 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1218 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1219 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1220 anObj.SetParameters(Parameters)
1221 self._autoPublish(anObj, theName, "vertex")
1224 ## Create a point, corresponding to the given length on the given curve.
1225 # @param theRefCurve The referenced curve.
1226 # @param theLength Length on the referenced curve. It can be negative.
1227 # @param theStartPoint Point allowing to choose the direction for the calculation
1228 # of the length. If None, start from the first point of theRefCurve.
1229 # @param theName Object name; when specified, this parameter is used
1230 # for result publication in the study. Otherwise, if automatic
1231 # publication is switched on, default value is used for result name.
1233 # @return New GEOM.GEOM_Object, containing the created point.
1235 # @ref tui_creation_point "Example"
1236 @ManageTransactions("BasicOp")
1237 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1239 Create a point, corresponding to the given length on the given curve.
1242 theRefCurve The referenced curve.
1243 theLength Length on the referenced curve. It can be negative.
1244 theStartPoint Point allowing to choose the direction for the calculation
1245 of the length. If None, start from the first point of theRefCurve.
1246 theName Object name; when specified, this parameter is used
1247 for result publication in the study. Otherwise, if automatic
1248 publication is switched on, default value is used for result name.
1251 New GEOM.GEOM_Object, containing the created point.
1253 # Example: see GEOM_TestAll.py
1254 theLength, Parameters = ParseParameters(theLength)
1255 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1256 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1257 anObj.SetParameters(Parameters)
1258 self._autoPublish(anObj, theName, "vertex")
1261 ## Create a point, corresponding to the given parameters on the
1263 # @param theRefSurf The referenced surface.
1264 # @param theUParameter Value of U-parameter on the referenced surface.
1265 # @param theVParameter Value of V-parameter on the referenced surface.
1266 # @param theName Object name; when specified, this parameter is used
1267 # for result publication in the study. Otherwise, if automatic
1268 # publication is switched on, default value is used for result name.
1270 # @return New GEOM.GEOM_Object, containing the created point.
1272 # @ref swig_MakeVertexOnSurface "Example"
1273 @ManageTransactions("BasicOp")
1274 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1276 Create a point, corresponding to the given parameters on the
1280 theRefSurf The referenced surface.
1281 theUParameter Value of U-parameter on the referenced surface.
1282 theVParameter Value of V-parameter on the referenced surface.
1283 theName Object name; when specified, this parameter is used
1284 for result publication in the study. Otherwise, if automatic
1285 publication is switched on, default value is used for result name.
1288 New GEOM.GEOM_Object, containing the created point.
1291 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1293 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1294 # Example: see GEOM_TestAll.py
1295 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1296 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1297 anObj.SetParameters(Parameters);
1298 self._autoPublish(anObj, theName, "vertex")
1301 ## Create a point by projection give coordinates on the given surface
1302 # @param theRefSurf The referenced surface.
1303 # @param theX X-coordinate in 3D space
1304 # @param theY Y-coordinate in 3D space
1305 # @param theZ Z-coordinate in 3D space
1306 # @param theName Object name; when specified, this parameter is used
1307 # for result publication in the study. Otherwise, if automatic
1308 # publication is switched on, default value is used for result name.
1310 # @return New GEOM.GEOM_Object, containing the created point.
1312 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1313 @ManageTransactions("BasicOp")
1314 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1316 Create a point by projection give coordinates on the given surface
1319 theRefSurf The referenced surface.
1320 theX X-coordinate in 3D space
1321 theY Y-coordinate in 3D space
1322 theZ Z-coordinate in 3D space
1323 theName Object name; when specified, this parameter is used
1324 for result publication in the study. Otherwise, if automatic
1325 publication is switched on, default value is used for result name.
1328 New GEOM.GEOM_Object, containing the created point.
1331 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1333 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1334 # Example: see GEOM_TestAll.py
1335 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1336 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1337 anObj.SetParameters(Parameters);
1338 self._autoPublish(anObj, theName, "vertex")
1341 ## Create a point, which lays on the given face.
1342 # The point will lay in arbitrary place of the face.
1343 # The only condition on it is a non-zero distance to the face boundary.
1344 # Such point can be used to uniquely identify the face inside any
1345 # shape in case, when the shape does not contain overlapped faces.
1346 # @param theFace The referenced face.
1347 # @param theName Object name; when specified, this parameter is used
1348 # for result publication in the study. Otherwise, if automatic
1349 # publication is switched on, default value is used for result name.
1351 # @return New GEOM.GEOM_Object, containing the created point.
1353 # @ref swig_MakeVertexInsideFace "Example"
1354 @ManageTransactions("BasicOp")
1355 def MakeVertexInsideFace (self, theFace, theName=None):
1357 Create a point, which lays on the given face.
1358 The point will lay in arbitrary place of the face.
1359 The only condition on it is a non-zero distance to the face boundary.
1360 Such point can be used to uniquely identify the face inside any
1361 shape in case, when the shape does not contain overlapped faces.
1364 theFace The referenced face.
1365 theName Object name; when specified, this parameter is used
1366 for result publication in the study. Otherwise, if automatic
1367 publication is switched on, default value is used for result name.
1370 New GEOM.GEOM_Object, containing the created point.
1373 p_on_face = geompy.MakeVertexInsideFace(Face)
1375 # Example: see GEOM_TestAll.py
1376 anObj = self.BasicOp.MakePointOnFace(theFace)
1377 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1378 self._autoPublish(anObj, theName, "vertex")
1381 ## Create a point on intersection of two lines.
1382 # @param theRefLine1, theRefLine2 The referenced lines.
1383 # @param theName Object name; when specified, this parameter is used
1384 # for result publication in the study. Otherwise, if automatic
1385 # publication is switched on, default value is used for result name.
1387 # @return New GEOM.GEOM_Object, containing the created point.
1389 # @ref swig_MakeVertexOnLinesIntersection "Example"
1390 @ManageTransactions("BasicOp")
1391 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1393 Create a point on intersection of two lines.
1396 theRefLine1, theRefLine2 The referenced lines.
1397 theName Object name; when specified, this parameter is used
1398 for result publication in the study. Otherwise, if automatic
1399 publication is switched on, default value is used for result name.
1402 New GEOM.GEOM_Object, containing the created point.
1404 # Example: see GEOM_TestAll.py
1405 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1406 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1407 self._autoPublish(anObj, theName, "vertex")
1410 ## Create a tangent, corresponding to the given parameter on the given curve.
1411 # @param theRefCurve The referenced curve.
1412 # @param theParameter Value of parameter on the referenced curve.
1413 # @param theName Object name; when specified, this parameter is used
1414 # for result publication in the study. Otherwise, if automatic
1415 # publication is switched on, default value is used for result name.
1417 # @return New GEOM.GEOM_Object, containing the created tangent.
1419 # @ref swig_MakeTangentOnCurve "Example"
1420 @ManageTransactions("BasicOp")
1421 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1423 Create a tangent, corresponding to the given parameter on the given curve.
1426 theRefCurve The referenced curve.
1427 theParameter Value of parameter on the referenced curve.
1428 theName Object name; when specified, this parameter is used
1429 for result publication in the study. Otherwise, if automatic
1430 publication is switched on, default value is used for result name.
1433 New GEOM.GEOM_Object, containing the created tangent.
1436 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1438 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1439 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1440 self._autoPublish(anObj, theName, "tangent")
1443 ## Create a tangent plane, corresponding to the given parameter on the given face.
1444 # @param theFace The face for which tangent plane should be built.
1445 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1446 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1447 # @param theTrimSize the size of plane.
1448 # @param theName Object name; when specified, this parameter is used
1449 # for result publication in the study. Otherwise, if automatic
1450 # publication is switched on, default value is used for result name.
1452 # @return New GEOM.GEOM_Object, containing the created tangent.
1454 # @ref swig_MakeTangentPlaneOnFace "Example"
1455 @ManageTransactions("BasicOp")
1456 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1458 Create a tangent plane, corresponding to the given parameter on the given face.
1461 theFace The face for which tangent plane should be built.
1462 theParameterV vertical value of the center point (0.0 - 1.0).
1463 theParameterU horisontal value of the center point (0.0 - 1.0).
1464 theTrimSize the size of plane.
1465 theName Object name; when specified, this parameter is used
1466 for result publication in the study. Otherwise, if automatic
1467 publication is switched on, default value is used for result name.
1470 New GEOM.GEOM_Object, containing the created tangent.
1473 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1475 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1476 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1477 self._autoPublish(anObj, theName, "tangent")
1480 ## Create a vector with the given components.
1481 # @param theDX X component of the vector.
1482 # @param theDY Y component of the vector.
1483 # @param theDZ Z component of the vector.
1484 # @param theName Object name; when specified, this parameter is used
1485 # for result publication in the study. Otherwise, if automatic
1486 # publication is switched on, default value is used for result name.
1488 # @return New GEOM.GEOM_Object, containing the created vector.
1490 # @ref tui_creation_vector "Example"
1491 @ManageTransactions("BasicOp")
1492 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1494 Create a vector with the given components.
1497 theDX X component of the vector.
1498 theDY Y component of the vector.
1499 theDZ Z component of the vector.
1500 theName Object name; when specified, this parameter is used
1501 for result publication in the study. Otherwise, if automatic
1502 publication is switched on, default value is used for result name.
1505 New GEOM.GEOM_Object, containing the created vector.
1507 # Example: see GEOM_TestAll.py
1508 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1509 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1510 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1511 anObj.SetParameters(Parameters)
1512 self._autoPublish(anObj, theName, "vector")
1515 ## Create a vector between two points.
1516 # @param thePnt1 Start point for the vector.
1517 # @param thePnt2 End point for the vector.
1518 # @param theName Object name; when specified, this parameter is used
1519 # for result publication in the study. Otherwise, if automatic
1520 # publication is switched on, default value is used for result name.
1522 # @return New GEOM.GEOM_Object, containing the created vector.
1524 # @ref tui_creation_vector "Example"
1525 @ManageTransactions("BasicOp")
1526 def MakeVector(self, thePnt1, thePnt2, theName=None):
1528 Create a vector between two points.
1531 thePnt1 Start point for the vector.
1532 thePnt2 End point for the vector.
1533 theName Object name; when specified, this parameter is used
1534 for result publication in the study. Otherwise, if automatic
1535 publication is switched on, default value is used for result name.
1538 New GEOM.GEOM_Object, containing the created vector.
1540 # Example: see GEOM_TestAll.py
1541 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1542 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1543 self._autoPublish(anObj, theName, "vector")
1546 ## Create a line, passing through the given point
1547 # and parrallel to the given direction
1548 # @param thePnt Point. The resulting line will pass through it.
1549 # @param theDir Direction. The resulting line will be parallel to it.
1550 # @param theName Object name; when specified, this parameter is used
1551 # for result publication in the study. Otherwise, if automatic
1552 # publication is switched on, default value is used for result name.
1554 # @return New GEOM.GEOM_Object, containing the created line.
1556 # @ref tui_creation_line "Example"
1557 @ManageTransactions("BasicOp")
1558 def MakeLine(self, thePnt, theDir, theName=None):
1560 Create a line, passing through the given point
1561 and parrallel to the given direction
1564 thePnt Point. The resulting line will pass through it.
1565 theDir Direction. The resulting line will be parallel to it.
1566 theName Object name; when specified, this parameter is used
1567 for result publication in the study. Otherwise, if automatic
1568 publication is switched on, default value is used for result name.
1571 New GEOM.GEOM_Object, containing the created line.
1573 # Example: see GEOM_TestAll.py
1574 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1575 RaiseIfFailed("MakeLine", self.BasicOp)
1576 self._autoPublish(anObj, theName, "line")
1579 ## Create a line, passing through the given points
1580 # @param thePnt1 First of two points, defining the line.
1581 # @param thePnt2 Second of two points, defining the line.
1582 # @param theName Object name; when specified, this parameter is used
1583 # for result publication in the study. Otherwise, if automatic
1584 # publication is switched on, default value is used for result name.
1586 # @return New GEOM.GEOM_Object, containing the created line.
1588 # @ref tui_creation_line "Example"
1589 @ManageTransactions("BasicOp")
1590 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1592 Create a line, passing through the given points
1595 thePnt1 First of two points, defining the line.
1596 thePnt2 Second of two points, defining the line.
1597 theName Object name; when specified, this parameter is used
1598 for result publication in the study. Otherwise, if automatic
1599 publication is switched on, default value is used for result name.
1602 New GEOM.GEOM_Object, containing the created line.
1604 # Example: see GEOM_TestAll.py
1605 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1606 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1607 self._autoPublish(anObj, theName, "line")
1610 ## Create a line on two faces intersection.
1611 # @param theFace1 First of two faces, defining the line.
1612 # @param theFace2 Second of two faces, defining the line.
1613 # @param theName Object name; when specified, this parameter is used
1614 # for result publication in the study. Otherwise, if automatic
1615 # publication is switched on, default value is used for result name.
1617 # @return New GEOM.GEOM_Object, containing the created line.
1619 # @ref swig_MakeLineTwoFaces "Example"
1620 @ManageTransactions("BasicOp")
1621 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1623 Create a line on two faces intersection.
1626 theFace1 First of two faces, defining the line.
1627 theFace2 Second of two faces, defining the line.
1628 theName Object name; when specified, this parameter is used
1629 for result publication in the study. Otherwise, if automatic
1630 publication is switched on, default value is used for result name.
1633 New GEOM.GEOM_Object, containing the created line.
1635 # Example: see GEOM_TestAll.py
1636 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1637 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1638 self._autoPublish(anObj, theName, "line")
1641 ## Create a plane, passing through the given point
1642 # and normal to the given vector.
1643 # @param thePnt Point, the plane has to pass through.
1644 # @param theVec Vector, defining the plane normal direction.
1645 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1646 # @param theName Object name; when specified, this parameter is used
1647 # for result publication in the study. Otherwise, if automatic
1648 # publication is switched on, default value is used for result name.
1650 # @return New GEOM.GEOM_Object, containing the created plane.
1652 # @ref tui_creation_plane "Example"
1653 @ManageTransactions("BasicOp")
1654 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1656 Create a plane, passing through the given point
1657 and normal to the given vector.
1660 thePnt Point, the plane has to pass through.
1661 theVec Vector, defining the plane normal direction.
1662 theTrimSize Half size of a side of quadrangle face, representing the plane.
1663 theName Object name; when specified, this parameter is used
1664 for result publication in the study. Otherwise, if automatic
1665 publication is switched on, default value is used for result name.
1668 New GEOM.GEOM_Object, containing the created plane.
1670 # Example: see GEOM_TestAll.py
1671 theTrimSize, Parameters = ParseParameters(theTrimSize);
1672 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1673 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1674 anObj.SetParameters(Parameters)
1675 self._autoPublish(anObj, theName, "plane")
1678 ## Create a plane, passing through the three given points
1679 # @param thePnt1 First of three points, defining the plane.
1680 # @param thePnt2 Second of three points, defining the plane.
1681 # @param thePnt3 Fird of three points, defining the plane.
1682 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1683 # @param theName Object name; when specified, this parameter is used
1684 # for result publication in the study. Otherwise, if automatic
1685 # publication is switched on, default value is used for result name.
1687 # @return New GEOM.GEOM_Object, containing the created plane.
1689 # @ref tui_creation_plane "Example"
1690 @ManageTransactions("BasicOp")
1691 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1693 Create a plane, passing through the three given points
1696 thePnt1 First of three points, defining the plane.
1697 thePnt2 Second of three points, defining the plane.
1698 thePnt3 Fird of three points, defining the plane.
1699 theTrimSize Half size of a side of quadrangle face, representing the plane.
1700 theName Object name; when specified, this parameter is used
1701 for result publication in the study. Otherwise, if automatic
1702 publication is switched on, default value is used for result name.
1705 New GEOM.GEOM_Object, containing the created plane.
1707 # Example: see GEOM_TestAll.py
1708 theTrimSize, Parameters = ParseParameters(theTrimSize);
1709 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1710 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1711 anObj.SetParameters(Parameters)
1712 self._autoPublish(anObj, theName, "plane")
1715 ## Create a plane, similar to the existing one, but with another size of representing face.
1716 # @param theFace Referenced plane or LCS(Marker).
1717 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1718 # @param theName Object name; when specified, this parameter is used
1719 # for result publication in the study. Otherwise, if automatic
1720 # publication is switched on, default value is used for result name.
1722 # @return New GEOM.GEOM_Object, containing the created plane.
1724 # @ref tui_creation_plane "Example"
1725 @ManageTransactions("BasicOp")
1726 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1728 Create a plane, similar to the existing one, but with another size of representing face.
1731 theFace Referenced plane or LCS(Marker).
1732 theTrimSize New half size of a side of quadrangle face, representing the plane.
1733 theName Object name; when specified, this parameter is used
1734 for result publication in the study. Otherwise, if automatic
1735 publication is switched on, default value is used for result name.
1738 New GEOM.GEOM_Object, containing the created plane.
1740 # Example: see GEOM_TestAll.py
1741 theTrimSize, Parameters = ParseParameters(theTrimSize);
1742 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1743 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1744 anObj.SetParameters(Parameters)
1745 self._autoPublish(anObj, theName, "plane")
1748 ## Create a plane, passing through the 2 vectors
1749 # with center in a start point of the first vector.
1750 # @param theVec1 Vector, defining center point and plane direction.
1751 # @param theVec2 Vector, defining the plane normal direction.
1752 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1753 # @param theName Object name; when specified, this parameter is used
1754 # for result publication in the study. Otherwise, if automatic
1755 # publication is switched on, default value is used for result name.
1757 # @return New GEOM.GEOM_Object, containing the created plane.
1759 # @ref tui_creation_plane "Example"
1760 @ManageTransactions("BasicOp")
1761 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1763 Create a plane, passing through the 2 vectors
1764 with center in a start point of the first vector.
1767 theVec1 Vector, defining center point and plane direction.
1768 theVec2 Vector, defining the plane normal direction.
1769 theTrimSize Half size of a side of quadrangle face, representing the plane.
1770 theName Object name; when specified, this parameter is used
1771 for result publication in the study. Otherwise, if automatic
1772 publication is switched on, default value is used for result name.
1775 New GEOM.GEOM_Object, containing the created plane.
1777 # Example: see GEOM_TestAll.py
1778 theTrimSize, Parameters = ParseParameters(theTrimSize);
1779 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1780 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1781 anObj.SetParameters(Parameters)
1782 self._autoPublish(anObj, theName, "plane")
1785 ## Create a plane, based on a Local coordinate system.
1786 # @param theLCS coordinate system, defining plane.
1787 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1788 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1789 # @param theName Object name; when specified, this parameter is used
1790 # for result publication in the study. Otherwise, if automatic
1791 # publication is switched on, default value is used for result name.
1793 # @return New GEOM.GEOM_Object, containing the created plane.
1795 # @ref tui_creation_plane "Example"
1796 @ManageTransactions("BasicOp")
1797 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1799 Create a plane, based on a Local coordinate system.
1802 theLCS coordinate system, defining plane.
1803 theTrimSize Half size of a side of quadrangle face, representing the plane.
1804 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1805 theName Object name; when specified, this parameter is used
1806 for result publication in the study. Otherwise, if automatic
1807 publication is switched on, default value is used for result name.
1810 New GEOM.GEOM_Object, containing the created plane.
1812 # Example: see GEOM_TestAll.py
1813 theTrimSize, Parameters = ParseParameters(theTrimSize);
1814 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1815 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1816 anObj.SetParameters(Parameters)
1817 self._autoPublish(anObj, theName, "plane")
1820 ## Create a local coordinate system.
1821 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1822 # @param XDX,XDY,XDZ Three components of OX direction
1823 # @param YDX,YDY,YDZ Three components of OY direction
1824 # @param theName Object name; when specified, this parameter is used
1825 # for result publication in the study. Otherwise, if automatic
1826 # publication is switched on, default value is used for result name.
1828 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1830 # @ref swig_MakeMarker "Example"
1831 @ManageTransactions("BasicOp")
1832 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1834 Create a local coordinate system.
1837 OX,OY,OZ Three coordinates of coordinate system origin.
1838 XDX,XDY,XDZ Three components of OX direction
1839 YDX,YDY,YDZ Three components of OY direction
1840 theName Object name; when specified, this parameter is used
1841 for result publication in the study. Otherwise, if automatic
1842 publication is switched on, default value is used for result name.
1845 New GEOM.GEOM_Object, containing the created coordinate system.
1847 # Example: see GEOM_TestAll.py
1848 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1849 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1850 RaiseIfFailed("MakeMarker", self.BasicOp)
1851 anObj.SetParameters(Parameters)
1852 self._autoPublish(anObj, theName, "lcs")
1855 ## Create a local coordinate system from shape.
1856 # @param theShape The initial shape to detect the coordinate system.
1857 # @param theName Object name; when specified, this parameter is used
1858 # for result publication in the study. Otherwise, if automatic
1859 # publication is switched on, default value is used for result name.
1861 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1863 # @ref tui_creation_lcs "Example"
1864 @ManageTransactions("BasicOp")
1865 def MakeMarkerFromShape(self, theShape, theName=None):
1867 Create a local coordinate system from shape.
1870 theShape The initial shape to detect the coordinate system.
1871 theName Object name; when specified, this parameter is used
1872 for result publication in the study. Otherwise, if automatic
1873 publication is switched on, default value is used for result name.
1876 New GEOM.GEOM_Object, containing the created coordinate system.
1878 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1879 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1880 self._autoPublish(anObj, theName, "lcs")
1883 ## Create a local coordinate system from point and two vectors.
1884 # @param theOrigin Point of coordinate system origin.
1885 # @param theXVec Vector of X direction
1886 # @param theYVec Vector of Y direction
1887 # @param theName Object name; when specified, this parameter is used
1888 # for result publication in the study. Otherwise, if automatic
1889 # publication is switched on, default value is used for result name.
1891 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1893 # @ref tui_creation_lcs "Example"
1894 @ManageTransactions("BasicOp")
1895 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1897 Create a local coordinate system from point and two vectors.
1900 theOrigin Point of coordinate system origin.
1901 theXVec Vector of X direction
1902 theYVec Vector of Y direction
1903 theName Object name; when specified, this parameter is used
1904 for result publication in the study. Otherwise, if automatic
1905 publication is switched on, default value is used for result name.
1908 New GEOM.GEOM_Object, containing the created coordinate system.
1911 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1912 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1913 self._autoPublish(anObj, theName, "lcs")
1916 # end of l3_basic_go
1919 ## @addtogroup l4_curves
1922 ## Create an arc of circle, passing through three given points.
1923 # @param thePnt1 Start point of the arc.
1924 # @param thePnt2 Middle point of the arc.
1925 # @param thePnt3 End point of the arc.
1926 # @param theName Object name; when specified, this parameter is used
1927 # for result publication in the study. Otherwise, if automatic
1928 # publication is switched on, default value is used for result name.
1930 # @return New GEOM.GEOM_Object, containing the created arc.
1932 # @ref swig_MakeArc "Example"
1933 @ManageTransactions("CurvesOp")
1934 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1936 Create an arc of circle, passing through three given points.
1939 thePnt1 Start point of the arc.
1940 thePnt2 Middle point of the arc.
1941 thePnt3 End point of the arc.
1942 theName Object name; when specified, this parameter is used
1943 for result publication in the study. Otherwise, if automatic
1944 publication is switched on, default value is used for result name.
1947 New GEOM.GEOM_Object, containing the created arc.
1949 # Example: see GEOM_TestAll.py
1950 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1951 RaiseIfFailed("MakeArc", self.CurvesOp)
1952 self._autoPublish(anObj, theName, "arc")
1955 ## Create an arc of circle from a center and 2 points.
1956 # @param thePnt1 Center of the arc
1957 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1958 # @param thePnt3 End point of the arc (Gives also a direction)
1959 # @param theSense Orientation of the arc
1960 # @param theName Object name; when specified, this parameter is used
1961 # for result publication in the study. Otherwise, if automatic
1962 # publication is switched on, default value is used for result name.
1964 # @return New GEOM.GEOM_Object, containing the created arc.
1966 # @ref swig_MakeArc "Example"
1967 @ManageTransactions("CurvesOp")
1968 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1970 Create an arc of circle from a center and 2 points.
1973 thePnt1 Center of the arc
1974 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1975 thePnt3 End point of the arc (Gives also a direction)
1976 theSense Orientation of the arc
1977 theName Object name; when specified, this parameter is used
1978 for result publication in the study. Otherwise, if automatic
1979 publication is switched on, default value is used for result name.
1982 New GEOM.GEOM_Object, containing the created arc.
1984 # Example: see GEOM_TestAll.py
1985 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1986 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1987 self._autoPublish(anObj, theName, "arc")
1990 ## Create an arc of ellipse, of center and two points.
1991 # @param theCenter Center of the arc.
1992 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1993 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1994 # @param theName Object name; when specified, this parameter is used
1995 # for result publication in the study. Otherwise, if automatic
1996 # publication is switched on, default value is used for result name.
1998 # @return New GEOM.GEOM_Object, containing the created arc.
2000 # @ref swig_MakeArc "Example"
2001 @ManageTransactions("CurvesOp")
2002 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2004 Create an arc of ellipse, of center and two points.
2007 theCenter Center of the arc.
2008 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2009 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2010 theName Object name; when specified, this parameter is used
2011 for result publication in the study. Otherwise, if automatic
2012 publication is switched on, default value is used for result name.
2015 New GEOM.GEOM_Object, containing the created arc.
2017 # Example: see GEOM_TestAll.py
2018 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2019 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2020 self._autoPublish(anObj, theName, "arc")
2023 ## Create a circle with given center, normal vector and radius.
2024 # @param thePnt Circle center.
2025 # @param theVec Vector, normal to the plane of the circle.
2026 # @param theR Circle radius.
2027 # @param theName Object name; when specified, this parameter is used
2028 # for result publication in the study. Otherwise, if automatic
2029 # publication is switched on, default value is used for result name.
2031 # @return New GEOM.GEOM_Object, containing the created circle.
2033 # @ref tui_creation_circle "Example"
2034 @ManageTransactions("CurvesOp")
2035 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2037 Create a circle with given center, normal vector and radius.
2040 thePnt Circle center.
2041 theVec Vector, normal to the plane of the circle.
2043 theName Object name; when specified, this parameter is used
2044 for result publication in the study. Otherwise, if automatic
2045 publication is switched on, default value is used for result name.
2048 New GEOM.GEOM_Object, containing the created circle.
2050 # Example: see GEOM_TestAll.py
2051 theR, Parameters = ParseParameters(theR)
2052 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2053 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2054 anObj.SetParameters(Parameters)
2055 self._autoPublish(anObj, theName, "circle")
2058 ## Create a circle with given radius.
2059 # Center of the circle will be in the origin of global
2060 # coordinate system and normal vector will be codirected with Z axis
2061 # @param theR Circle radius.
2062 # @param theName Object name; when specified, this parameter is used
2063 # for result publication in the study. Otherwise, if automatic
2064 # publication is switched on, default value is used for result name.
2066 # @return New GEOM.GEOM_Object, containing the created circle.
2067 @ManageTransactions("CurvesOp")
2068 def MakeCircleR(self, theR, theName=None):
2070 Create a circle with given radius.
2071 Center of the circle will be in the origin of global
2072 coordinate system and normal vector will be codirected with Z axis
2076 theName Object name; when specified, this parameter is used
2077 for result publication in the study. Otherwise, if automatic
2078 publication is switched on, default value is used for result name.
2081 New GEOM.GEOM_Object, containing the created circle.
2083 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2084 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2085 self._autoPublish(anObj, theName, "circle")
2088 ## Create a circle, passing through three given points
2089 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2090 # @param theName Object name; when specified, this parameter is used
2091 # for result publication in the study. Otherwise, if automatic
2092 # publication is switched on, default value is used for result name.
2094 # @return New GEOM.GEOM_Object, containing the created circle.
2096 # @ref tui_creation_circle "Example"
2097 @ManageTransactions("CurvesOp")
2098 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2100 Create a circle, passing through three given points
2103 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2104 theName Object name; when specified, this parameter is used
2105 for result publication in the study. Otherwise, if automatic
2106 publication is switched on, default value is used for result name.
2109 New GEOM.GEOM_Object, containing the created circle.
2111 # Example: see GEOM_TestAll.py
2112 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2113 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2114 self._autoPublish(anObj, theName, "circle")
2117 ## Create a circle, with given point1 as center,
2118 # passing through the point2 as radius and laying in the plane,
2119 # defined by all three given points.
2120 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2121 # @param theName Object name; when specified, this parameter is used
2122 # for result publication in the study. Otherwise, if automatic
2123 # publication is switched on, default value is used for result name.
2125 # @return New GEOM.GEOM_Object, containing the created circle.
2127 # @ref swig_MakeCircle "Example"
2128 @ManageTransactions("CurvesOp")
2129 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2131 Create a circle, with given point1 as center,
2132 passing through the point2 as radius and laying in the plane,
2133 defined by all three given points.
2136 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2137 theName Object name; when specified, this parameter is used
2138 for result publication in the study. Otherwise, if automatic
2139 publication is switched on, default value is used for result name.
2142 New GEOM.GEOM_Object, containing the created circle.
2144 # Example: see GEOM_example6.py
2145 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2146 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2147 self._autoPublish(anObj, theName, "circle")
2150 ## Create an ellipse with given center, normal vector and radiuses.
2151 # @param thePnt Ellipse center.
2152 # @param theVec Vector, normal to the plane of the ellipse.
2153 # @param theRMajor Major ellipse radius.
2154 # @param theRMinor Minor ellipse radius.
2155 # @param theVecMaj Vector, direction of the ellipse's main axis.
2156 # @param theName Object name; when specified, this parameter is used
2157 # for result publication in the study. Otherwise, if automatic
2158 # publication is switched on, default value is used for result name.
2160 # @return New GEOM.GEOM_Object, containing the created ellipse.
2162 # @ref tui_creation_ellipse "Example"
2163 @ManageTransactions("CurvesOp")
2164 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2166 Create an ellipse with given center, normal vector and radiuses.
2169 thePnt Ellipse center.
2170 theVec Vector, normal to the plane of the ellipse.
2171 theRMajor Major ellipse radius.
2172 theRMinor Minor ellipse radius.
2173 theVecMaj Vector, direction of the ellipse's main axis.
2174 theName Object name; when specified, this parameter is used
2175 for result publication in the study. Otherwise, if automatic
2176 publication is switched on, default value is used for result name.
2179 New GEOM.GEOM_Object, containing the created ellipse.
2181 # Example: see GEOM_TestAll.py
2182 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2183 if theVecMaj is not None:
2184 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2186 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2188 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2189 anObj.SetParameters(Parameters)
2190 self._autoPublish(anObj, theName, "ellipse")
2193 ## Create an ellipse with given radiuses.
2194 # Center of the ellipse will be in the origin of global
2195 # coordinate system and normal vector will be codirected with Z axis
2196 # @param theRMajor Major ellipse radius.
2197 # @param theRMinor Minor ellipse radius.
2198 # @param theName Object name; when specified, this parameter is used
2199 # for result publication in the study. Otherwise, if automatic
2200 # publication is switched on, default value is used for result name.
2202 # @return New GEOM.GEOM_Object, containing the created ellipse.
2203 @ManageTransactions("CurvesOp")
2204 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2206 Create an ellipse with given radiuses.
2207 Center of the ellipse will be in the origin of global
2208 coordinate system and normal vector will be codirected with Z axis
2211 theRMajor Major ellipse radius.
2212 theRMinor Minor ellipse radius.
2213 theName Object name; when specified, this parameter is used
2214 for result publication in the study. Otherwise, if automatic
2215 publication is switched on, default value is used for result name.
2218 New GEOM.GEOM_Object, containing the created ellipse.
2220 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2221 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2222 self._autoPublish(anObj, theName, "ellipse")
2225 ## Create a polyline on the set of points.
2226 # @param thePoints Sequence of points for the polyline.
2227 # @param theIsClosed If True, build a closed wire.
2228 # @param theName Object name; when specified, this parameter is used
2229 # for result publication in the study. Otherwise, if automatic
2230 # publication is switched on, default value is used for result name.
2232 # @return New GEOM.GEOM_Object, containing the created polyline.
2234 # @ref tui_creation_curve "Example"
2235 @ManageTransactions("CurvesOp")
2236 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2238 Create a polyline on the set of points.
2241 thePoints Sequence of points for the polyline.
2242 theIsClosed If True, build a closed wire.
2243 theName Object name; when specified, this parameter is used
2244 for result publication in the study. Otherwise, if automatic
2245 publication is switched on, default value is used for result name.
2248 New GEOM.GEOM_Object, containing the created polyline.
2250 # Example: see GEOM_TestAll.py
2251 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2252 RaiseIfFailed("MakePolyline", self.CurvesOp)
2253 self._autoPublish(anObj, theName, "polyline")
2256 ## Create bezier curve on the set of points.
2257 # @param thePoints Sequence of points for the bezier curve.
2258 # @param theIsClosed If True, build a closed curve.
2259 # @param theName Object name; when specified, this parameter is used
2260 # for result publication in the study. Otherwise, if automatic
2261 # publication is switched on, default value is used for result name.
2263 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2265 # @ref tui_creation_curve "Example"
2266 @ManageTransactions("CurvesOp")
2267 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2269 Create bezier curve on the set of points.
2272 thePoints Sequence of points for the bezier curve.
2273 theIsClosed If True, build a closed curve.
2274 theName Object name; when specified, this parameter is used
2275 for result publication in the study. Otherwise, if automatic
2276 publication is switched on, default value is used for result name.
2279 New GEOM.GEOM_Object, containing the created bezier curve.
2281 # Example: see GEOM_TestAll.py
2282 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2283 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2284 self._autoPublish(anObj, theName, "bezier")
2287 ## Create B-Spline curve on the set of points.
2288 # @param thePoints Sequence of points for the B-Spline curve.
2289 # @param theIsClosed If True, build a closed curve.
2290 # @param theDoReordering If TRUE, the algo does not follow the order of
2291 # \a thePoints but searches for the closest vertex.
2292 # @param theName Object name; when specified, this parameter is used
2293 # for result publication in the study. Otherwise, if automatic
2294 # publication is switched on, default value is used for result name.
2296 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2298 # @ref tui_creation_curve "Example"
2299 @ManageTransactions("CurvesOp")
2300 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2302 Create B-Spline curve on the set of points.
2305 thePoints Sequence of points for the B-Spline curve.
2306 theIsClosed If True, build a closed curve.
2307 theDoReordering If True, the algo does not follow the order of
2308 thePoints but searches for the closest vertex.
2309 theName Object name; when specified, this parameter is used
2310 for result publication in the study. Otherwise, if automatic
2311 publication is switched on, default value is used for result name.
2314 New GEOM.GEOM_Object, containing the created B-Spline curve.
2316 # Example: see GEOM_TestAll.py
2317 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2318 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2319 self._autoPublish(anObj, theName, "bspline")
2322 ## Create B-Spline curve on the set of points.
2323 # @param thePoints Sequence of points for the B-Spline curve.
2324 # @param theFirstVec Vector object, defining the curve direction at its first point.
2325 # @param theLastVec Vector object, defining the curve direction at its last point.
2326 # @param theName Object name; when specified, this parameter is used
2327 # for result publication in the study. Otherwise, if automatic
2328 # publication is switched on, default value is used for result name.
2330 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2332 # @ref tui_creation_curve "Example"
2333 @ManageTransactions("CurvesOp")
2334 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2336 Create B-Spline curve on the set of points.
2339 thePoints Sequence of points for the B-Spline curve.
2340 theFirstVec Vector object, defining the curve direction at its first point.
2341 theLastVec Vector object, defining the curve direction at its last point.
2342 theName Object name; when specified, this parameter is used
2343 for result publication in the study. Otherwise, if automatic
2344 publication is switched on, default value is used for result name.
2347 New GEOM.GEOM_Object, containing the created B-Spline curve.
2349 # Example: see GEOM_TestAll.py
2350 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2351 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2352 self._autoPublish(anObj, theName, "bspline")
2355 ## Creates a curve using the parametric definition of the basic points.
2356 # @param thexExpr parametric equation of the coordinates X.
2357 # @param theyExpr parametric equation of the coordinates Y.
2358 # @param thezExpr parametric equation of the coordinates Z.
2359 # @param theParamMin the minimal value of the parameter.
2360 # @param theParamMax the maximum value of the parameter.
2361 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2362 # @param theCurveType the type of the curve,
2363 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2364 # @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.
2365 # @param theName Object name; when specified, this parameter is used
2366 # for result publication in the study. Otherwise, if automatic
2367 # publication is switched on, default value is used for result name.
2369 # @return New GEOM.GEOM_Object, containing the created curve.
2371 # @ref tui_creation_curve "Example"
2372 @ManageTransactions("CurvesOp")
2373 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2374 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2376 Creates a curve using the parametric definition of the basic points.
2379 thexExpr parametric equation of the coordinates X.
2380 theyExpr parametric equation of the coordinates Y.
2381 thezExpr parametric equation of the coordinates Z.
2382 theParamMin the minimal value of the parameter.
2383 theParamMax the maximum value of the parameter.
2384 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2385 theCurveType the type of the curve,
2386 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2387 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2388 method is used which can lead to a bug.
2389 theName Object name; when specified, this parameter is used
2390 for result publication in the study. Otherwise, if automatic
2391 publication is switched on, default value is used for result name.
2394 New GEOM.GEOM_Object, containing the created curve.
2396 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2398 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2400 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2401 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2402 anObj.SetParameters(Parameters)
2403 self._autoPublish(anObj, theName, "curve")
2406 ## Create an isoline curve on a face.
2407 # @param theFace the face for which an isoline is created.
2408 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2410 # @param theParameter the U parameter for U-isoline or V parameter
2412 # @param theName Object name; when specified, this parameter is used
2413 # for result publication in the study. Otherwise, if automatic
2414 # publication is switched on, default value is used for result name.
2416 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2417 # a compound of edges.
2419 # @ref tui_creation_curve "Example"
2420 @ManageTransactions("CurvesOp")
2421 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2423 Create an isoline curve on a face.
2426 theFace the face for which an isoline is created.
2427 IsUIsoline True for U-isoline creation; False for V-isoline
2429 theParameter the U parameter for U-isoline or V parameter
2431 theName Object name; when specified, this parameter is used
2432 for result publication in the study. Otherwise, if automatic
2433 publication is switched on, default value is used for result name.
2436 New GEOM.GEOM_Object, containing the created isoline edge or a
2439 # Example: see GEOM_TestAll.py
2440 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2441 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2443 self._autoPublish(anObj, theName, "U-Isoline")
2445 self._autoPublish(anObj, theName, "V-Isoline")
2451 ## @addtogroup l3_sketcher
2454 ## Create a sketcher (wire or face), following the textual description,
2455 # passed through <VAR>theCommand</VAR> argument. \n
2456 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2457 # Format of the description string have to be the following:
2459 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2462 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2464 # - "R angle" : Set the direction by angle
2465 # - "D dx dy" : Set the direction by DX & DY
2468 # - "TT x y" : Create segment by point at X & Y
2469 # - "T dx dy" : Create segment by point with DX & DY
2470 # - "L length" : Create segment by direction & Length
2471 # - "IX x" : Create segment by direction & Intersect. X
2472 # - "IY y" : Create segment by direction & Intersect. Y
2475 # - "C radius length" : Create arc by direction, radius and length(in degree)
2476 # - "AA x y": Create arc by point at X & Y
2477 # - "A dx dy" : Create arc by point with DX & DY
2478 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2479 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2480 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2481 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2484 # - "WW" : Close Wire (to finish)
2485 # - "WF" : Close Wire and build face (to finish)
2488 # - Flag1 (= reverse) is 0 or 2 ...
2489 # - if 0 the drawn arc is the one of lower angle (< Pi)
2490 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2493 # - Flag2 (= control tolerance) is 0 or 1 ...
2494 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2495 # - if 1 the wire is built only if the end point is on the arc
2496 # with a tolerance of 10^-7 on the distance else the creation fails
2498 # @param theCommand String, defining the sketcher in local
2499 # coordinates of the working plane.
2500 # @param theWorkingPlane Nine double values, defining origin,
2501 # OZ and OX directions of the working plane.
2502 # @param theName Object name; when specified, this parameter is used
2503 # for result publication in the study. Otherwise, if automatic
2504 # publication is switched on, default value is used for result name.
2506 # @return New GEOM.GEOM_Object, containing the created wire.
2508 # @ref tui_sketcher_page "Example"
2509 @ManageTransactions("CurvesOp")
2510 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2512 Create a sketcher (wire or face), following the textual description, passed
2513 through theCommand argument.
2514 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2515 Format of the description string have to be the following:
2516 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2518 - x1, y1 are coordinates of the first sketcher point (zero by default),
2520 - "R angle" : Set the direction by angle
2521 - "D dx dy" : Set the direction by DX & DY
2523 - "TT x y" : Create segment by point at X & Y
2524 - "T dx dy" : Create segment by point with DX & DY
2525 - "L length" : Create segment by direction & Length
2526 - "IX x" : Create segment by direction & Intersect. X
2527 - "IY y" : Create segment by direction & Intersect. Y
2529 - "C radius length" : Create arc by direction, radius and length(in degree)
2530 - "AA x y": Create arc by point at X & Y
2531 - "A dx dy" : Create arc by point with DX & DY
2532 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2533 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2534 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2535 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2537 - "WW" : Close Wire (to finish)
2538 - "WF" : Close Wire and build face (to finish)
2540 - Flag1 (= reverse) is 0 or 2 ...
2541 - if 0 the drawn arc is the one of lower angle (< Pi)
2542 - if 2 the drawn arc ius the one of greater angle (> Pi)
2544 - Flag2 (= control tolerance) is 0 or 1 ...
2545 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2546 - if 1 the wire is built only if the end point is on the arc
2547 with a tolerance of 10^-7 on the distance else the creation fails
2550 theCommand String, defining the sketcher in local
2551 coordinates of the working plane.
2552 theWorkingPlane Nine double values, defining origin,
2553 OZ and OX directions of the working plane.
2554 theName Object name; when specified, this parameter is used
2555 for result publication in the study. Otherwise, if automatic
2556 publication is switched on, default value is used for result name.
2559 New GEOM.GEOM_Object, containing the created wire.
2561 # Example: see GEOM_TestAll.py
2562 theCommand,Parameters = ParseSketcherCommand(theCommand)
2563 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2564 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2565 anObj.SetParameters(Parameters)
2566 self._autoPublish(anObj, theName, "wire")
2569 ## Create a sketcher (wire or face), following the textual description,
2570 # passed through <VAR>theCommand</VAR> argument. \n
2571 # For format of the description string see MakeSketcher() method.\n
2572 # @param theCommand String, defining the sketcher in local
2573 # coordinates of the working plane.
2574 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2575 # @param theName Object name; when specified, this parameter is used
2576 # for result publication in the study. Otherwise, if automatic
2577 # publication is switched on, default value is used for result name.
2579 # @return New GEOM.GEOM_Object, containing the created wire.
2581 # @ref tui_sketcher_page "Example"
2582 @ManageTransactions("CurvesOp")
2583 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2585 Create a sketcher (wire or face), following the textual description,
2586 passed through theCommand argument.
2587 For format of the description string see geompy.MakeSketcher() method.
2590 theCommand String, defining the sketcher in local
2591 coordinates of the working plane.
2592 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2593 theName Object name; when specified, this parameter is used
2594 for result publication in the study. Otherwise, if automatic
2595 publication is switched on, default value is used for result name.
2598 New GEOM.GEOM_Object, containing the created wire.
2600 theCommand,Parameters = ParseSketcherCommand(theCommand)
2601 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2602 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2603 anObj.SetParameters(Parameters)
2604 self._autoPublish(anObj, theName, "wire")
2607 ## Obtain a 2D sketcher interface
2608 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2609 def Sketcher2D (self):
2611 Obtain a 2D sketcher interface.
2614 sk = geompy.Sketcher2D()
2616 sk.addSegmentRelative(15, 70)
2617 sk.addSegmentPerpY(50)
2618 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2619 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2620 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2622 Sketch_1 = sk.wire(geomObj_1)
2624 sk = Sketcher2D (self)
2627 ## Create a sketcher wire, following the numerical description,
2628 # passed through <VAR>theCoordinates</VAR> argument. \n
2629 # @param theCoordinates double values, defining points to create a wire,
2631 # @param theName Object name; when specified, this parameter is used
2632 # for result publication in the study. Otherwise, if automatic
2633 # publication is switched on, default value is used for result name.
2635 # @return New GEOM.GEOM_Object, containing the created wire.
2637 # @ref tui_3dsketcher_page "Example"
2638 @ManageTransactions("CurvesOp")
2639 def Make3DSketcher(self, theCoordinates, theName=None):
2641 Create a sketcher wire, following the numerical description,
2642 passed through theCoordinates argument.
2645 theCoordinates double values, defining points to create a wire,
2647 theName Object name; when specified, this parameter is used
2648 for result publication in the study. Otherwise, if automatic
2649 publication is switched on, default value is used for result name.
2652 New GEOM_Object, containing the created wire.
2654 theCoordinates,Parameters = ParseParameters(theCoordinates)
2655 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2656 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2657 anObj.SetParameters(Parameters)
2658 self._autoPublish(anObj, theName, "wire")
2661 ## Obtain a 3D sketcher interface
2662 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2664 # @ref tui_3dsketcher_page "Example"
2665 def Sketcher3D (self):
2667 Obtain a 3D sketcher interface.
2670 sk = geompy.Sketcher3D()
2671 sk.addPointsAbsolute(0,0,0, 70,0,0)
2672 sk.addPointsRelative(0, 0, 130)
2673 sk.addPointAnglesLength("OXY", 50, 0, 100)
2674 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2676 a3D_Sketcher_1 = sk.wire()
2678 sk = Sketcher3D (self)
2681 ## Obtain a 2D polyline creation interface
2682 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2684 # @ref tui_3dsketcher_page "Example"
2685 def Polyline2D (self):
2687 Obtain a 2D polyline creation interface.
2690 pl = geompy.Polyline2D()
2691 pl.addSection("section 1", GEOM.Polyline, True)
2692 pl.addPoints(0, 0, 10, 0, 10, 10)
2693 pl.addSection("section 2", GEOM.Interpolation, False)
2694 pl.addPoints(20, 0, 30, 0, 30, 10)
2695 resultObj = pl.result(WorkingPlane)
2697 pl = Polyline2D (self)
2700 # end of l3_sketcher
2703 ## @addtogroup l3_3d_primitives
2706 ## Create a box by coordinates of two opposite vertices.
2708 # @param x1,y1,z1 double values, defining first point it.
2709 # @param x2,y2,z2 double values, defining first point it.
2710 # @param theName Object name; when specified, this parameter is used
2711 # for result publication in the study. Otherwise, if automatic
2712 # publication is switched on, default value is used for result name.
2714 # @return New GEOM.GEOM_Object, containing the created box.
2716 # @ref tui_creation_box "Example"
2717 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2719 Create a box by coordinates of two opposite vertices.
2722 x1,y1,z1 double values, defining first point.
2723 x2,y2,z2 double values, defining second point.
2724 theName Object name; when specified, this parameter is used
2725 for result publication in the study. Otherwise, if automatic
2726 publication is switched on, default value is used for result name.
2729 New GEOM.GEOM_Object, containing the created box.
2731 # Example: see GEOM_TestAll.py
2732 pnt1 = self.MakeVertex(x1,y1,z1)
2733 pnt2 = self.MakeVertex(x2,y2,z2)
2734 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2735 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2737 ## Create a box with specified dimensions along the coordinate axes
2738 # and with edges, parallel to the coordinate axes.
2739 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2740 # @param theDX Length of Box edges, parallel to OX axis.
2741 # @param theDY Length of Box edges, parallel to OY axis.
2742 # @param theDZ Length of Box edges, parallel to OZ axis.
2743 # @param theName Object name; when specified, this parameter is used
2744 # for result publication in the study. Otherwise, if automatic
2745 # publication is switched on, default value is used for result name.
2747 # @return New GEOM.GEOM_Object, containing the created box.
2749 # @ref tui_creation_box "Example"
2750 @ManageTransactions("PrimOp")
2751 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2753 Create a box with specified dimensions along the coordinate axes
2754 and with edges, parallel to the coordinate axes.
2755 Center of the box will be at point (DX/2, DY/2, DZ/2).
2758 theDX Length of Box edges, parallel to OX axis.
2759 theDY Length of Box edges, parallel to OY axis.
2760 theDZ Length of Box edges, parallel to OZ axis.
2761 theName Object name; when specified, this parameter is used
2762 for result publication in the study. Otherwise, if automatic
2763 publication is switched on, default value is used for result name.
2766 New GEOM.GEOM_Object, containing the created box.
2768 # Example: see GEOM_TestAll.py
2769 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2770 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2771 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2772 anObj.SetParameters(Parameters)
2773 self._autoPublish(anObj, theName, "box")
2776 ## Create a box with two specified opposite vertices,
2777 # and with edges, parallel to the coordinate axes
2778 # @param thePnt1 First of two opposite vertices.
2779 # @param thePnt2 Second of two opposite vertices.
2780 # @param theName Object name; when specified, this parameter is used
2781 # for result publication in the study. Otherwise, if automatic
2782 # publication is switched on, default value is used for result name.
2784 # @return New GEOM.GEOM_Object, containing the created box.
2786 # @ref tui_creation_box "Example"
2787 @ManageTransactions("PrimOp")
2788 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2790 Create a box with two specified opposite vertices,
2791 and with edges, parallel to the coordinate axes
2794 thePnt1 First of two opposite vertices.
2795 thePnt2 Second of two opposite vertices.
2796 theName Object name; when specified, this parameter is used
2797 for result publication in the study. Otherwise, if automatic
2798 publication is switched on, default value is used for result name.
2801 New GEOM.GEOM_Object, containing the created box.
2803 # Example: see GEOM_TestAll.py
2804 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2805 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2806 self._autoPublish(anObj, theName, "box")
2809 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2810 # @param theH height of Face.
2811 # @param theW width of Face.
2812 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2813 # @param theName Object name; when specified, this parameter is used
2814 # for result publication in the study. Otherwise, if automatic
2815 # publication is switched on, default value is used for result name.
2817 # @return New GEOM.GEOM_Object, containing the created face.
2819 # @ref tui_creation_face "Example"
2820 @ManageTransactions("PrimOp")
2821 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2823 Create a face with specified dimensions with edges parallel to coordinate axes.
2826 theH height of Face.
2828 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2829 theName Object name; when specified, this parameter is used
2830 for result publication in the study. Otherwise, if automatic
2831 publication is switched on, default value is used for result name.
2834 New GEOM.GEOM_Object, containing the created face.
2836 # Example: see GEOM_TestAll.py
2837 theH,theW,Parameters = ParseParameters(theH, theW)
2838 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2839 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2840 anObj.SetParameters(Parameters)
2841 self._autoPublish(anObj, theName, "rectangle")
2844 ## Create a face from another plane and two sizes,
2845 # vertical size and horisontal size.
2846 # @param theObj Normale vector to the creating face or
2848 # @param theH Height (vertical size).
2849 # @param theW Width (horisontal size).
2850 # @param theName Object name; when specified, this parameter is used
2851 # for result publication in the study. Otherwise, if automatic
2852 # publication is switched on, default value is used for result name.
2854 # @return New GEOM.GEOM_Object, containing the created face.
2856 # @ref tui_creation_face "Example"
2857 @ManageTransactions("PrimOp")
2858 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2860 Create a face from another plane and two sizes,
2861 vertical size and horisontal size.
2864 theObj Normale vector to the creating face or
2866 theH Height (vertical size).
2867 theW Width (horisontal size).
2868 theName Object name; when specified, this parameter is used
2869 for result publication in the study. Otherwise, if automatic
2870 publication is switched on, default value is used for result name.
2873 New GEOM_Object, containing the created face.
2875 # Example: see GEOM_TestAll.py
2876 theH,theW,Parameters = ParseParameters(theH, theW)
2877 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2878 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2879 anObj.SetParameters(Parameters)
2880 self._autoPublish(anObj, theName, "rectangle")
2883 ## Create a disk with given center, normal vector and radius.
2884 # @param thePnt Disk center.
2885 # @param theVec Vector, normal to the plane of the disk.
2886 # @param theR Disk radius.
2887 # @param theName Object name; when specified, this parameter is used
2888 # for result publication in the study. Otherwise, if automatic
2889 # publication is switched on, default value is used for result name.
2891 # @return New GEOM.GEOM_Object, containing the created disk.
2893 # @ref tui_creation_disk "Example"
2894 @ManageTransactions("PrimOp")
2895 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2897 Create a disk with given center, normal vector and radius.
2901 theVec Vector, normal to the plane of the disk.
2903 theName Object name; when specified, this parameter is used
2904 for result publication in the study. Otherwise, if automatic
2905 publication is switched on, default value is used for result name.
2908 New GEOM.GEOM_Object, containing the created disk.
2910 # Example: see GEOM_TestAll.py
2911 theR,Parameters = ParseParameters(theR)
2912 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2913 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2914 anObj.SetParameters(Parameters)
2915 self._autoPublish(anObj, theName, "disk")
2918 ## Create a disk, passing through three given points
2919 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2920 # @param theName Object name; when specified, this parameter is used
2921 # for result publication in the study. Otherwise, if automatic
2922 # publication is switched on, default value is used for result name.
2924 # @return New GEOM.GEOM_Object, containing the created disk.
2926 # @ref tui_creation_disk "Example"
2927 @ManageTransactions("PrimOp")
2928 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2930 Create a disk, passing through three given points
2933 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2934 theName Object name; when specified, this parameter is used
2935 for result publication in the study. Otherwise, if automatic
2936 publication is switched on, default value is used for result name.
2939 New GEOM.GEOM_Object, containing the created disk.
2941 # Example: see GEOM_TestAll.py
2942 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2943 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2944 self._autoPublish(anObj, theName, "disk")
2947 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2948 # @param theR Radius of Face.
2949 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2950 # @param theName Object name; when specified, this parameter is used
2951 # for result publication in the study. Otherwise, if automatic
2952 # publication is switched on, default value is used for result name.
2954 # @return New GEOM.GEOM_Object, containing the created disk.
2956 # @ref tui_creation_face "Example"
2957 @ManageTransactions("PrimOp")
2958 def MakeDiskR(self, theR, theOrientation, theName=None):
2960 Create a disk with specified dimensions along OX-OY coordinate axes.
2963 theR Radius of Face.
2964 theOrientation set the orientation belong axis OXY or OYZ or OZX
2965 theName Object name; when specified, this parameter is used
2966 for result publication in the study. Otherwise, if automatic
2967 publication is switched on, default value is used for result name.
2970 New GEOM.GEOM_Object, containing the created disk.
2973 Disk3 = geompy.MakeDiskR(100., 1)
2975 # Example: see GEOM_TestAll.py
2976 theR,Parameters = ParseParameters(theR)
2977 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2978 RaiseIfFailed("MakeDiskR", self.PrimOp)
2979 anObj.SetParameters(Parameters)
2980 self._autoPublish(anObj, theName, "disk")
2983 ## Create a cylinder with given base point, axis, radius and height.
2984 # @param thePnt Central point of cylinder base.
2985 # @param theAxis Cylinder axis.
2986 # @param theR Cylinder radius.
2987 # @param theH Cylinder height.
2988 # @param theName Object name; when specified, this parameter is used
2989 # for result publication in the study. Otherwise, if automatic
2990 # publication is switched on, default value is used for result name.
2992 # @return New GEOM.GEOM_Object, containing the created cylinder.
2994 # @ref tui_creation_cylinder "Example"
2995 @ManageTransactions("PrimOp")
2996 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2998 Create a cylinder with given base point, axis, radius and height.
3001 thePnt Central point of cylinder base.
3002 theAxis Cylinder axis.
3003 theR Cylinder radius.
3004 theH Cylinder height.
3005 theName Object name; when specified, this parameter is used
3006 for result publication in the study. Otherwise, if automatic
3007 publication is switched on, default value is used for result name.
3010 New GEOM.GEOM_Object, containing the created cylinder.
3012 # Example: see GEOM_TestAll.py
3013 theR,theH,Parameters = ParseParameters(theR, theH)
3014 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3015 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3016 anObj.SetParameters(Parameters)
3017 self._autoPublish(anObj, theName, "cylinder")
3020 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3021 # @param thePnt Central point of cylinder base.
3022 # @param theAxis Cylinder axis.
3023 # @param theR Cylinder radius.
3024 # @param theH Cylinder height.
3025 # @param theA Cylinder angle in radians.
3026 # @param theName Object name; when specified, this parameter is used
3027 # for result publication in the study. Otherwise, if automatic
3028 # publication is switched on, default value is used for result name.
3030 # @return New GEOM.GEOM_Object, containing the created cylinder.
3032 # @ref tui_creation_cylinder "Example"
3033 @ManageTransactions("PrimOp")
3034 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3036 Create a portion of cylinder with given base point, axis, radius, height and angle.
3039 thePnt Central point of cylinder base.
3040 theAxis Cylinder axis.
3041 theR Cylinder radius.
3042 theH Cylinder height.
3043 theA Cylinder angle in radians.
3044 theName Object name; when specified, this parameter is used
3045 for result publication in the study. Otherwise, if automatic
3046 publication is switched on, default value is used for result name.
3049 New GEOM.GEOM_Object, containing the created cylinder.
3051 # Example: see GEOM_TestAll.py
3053 if isinstance(theA,str):
3055 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3057 theA = theA*math.pi/180.
3058 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3059 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3060 anObj.SetParameters(Parameters)
3061 self._autoPublish(anObj, theName, "cylinder")
3064 ## Create a cylinder with given radius and height at
3065 # the origin of coordinate system. Axis of the cylinder
3066 # will be collinear to the OZ axis of the coordinate system.
3067 # @param theR Cylinder radius.
3068 # @param theH Cylinder height.
3069 # @param theName Object name; when specified, this parameter is used
3070 # for result publication in the study. Otherwise, if automatic
3071 # publication is switched on, default value is used for result name.
3073 # @return New GEOM.GEOM_Object, containing the created cylinder.
3075 # @ref tui_creation_cylinder "Example"
3076 @ManageTransactions("PrimOp")
3077 def MakeCylinderRH(self, theR, theH, theName=None):
3079 Create a cylinder with given radius and height at
3080 the origin of coordinate system. Axis of the cylinder
3081 will be collinear to the OZ axis of the coordinate system.
3084 theR Cylinder radius.
3085 theH Cylinder height.
3086 theName Object name; when specified, this parameter is used
3087 for result publication in the study. Otherwise, if automatic
3088 publication is switched on, default value is used for result name.
3091 New GEOM.GEOM_Object, containing the created cylinder.
3093 # Example: see GEOM_TestAll.py
3094 theR,theH,Parameters = ParseParameters(theR, theH)
3095 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3096 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3097 anObj.SetParameters(Parameters)
3098 self._autoPublish(anObj, theName, "cylinder")
3101 ## Create a portion of cylinder with given radius, height and angle at
3102 # the origin of coordinate system. Axis of the cylinder
3103 # will be collinear to the OZ axis of the coordinate system.
3104 # @param theR Cylinder radius.
3105 # @param theH Cylinder height.
3106 # @param theA Cylinder angle in radians.
3107 # @param theName Object name; when specified, this parameter is used
3108 # for result publication in the study. Otherwise, if automatic
3109 # publication is switched on, default value is used for result name.
3111 # @return New GEOM.GEOM_Object, containing the created cylinder.
3113 # @ref tui_creation_cylinder "Example"
3114 @ManageTransactions("PrimOp")
3115 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3117 Create a portion of cylinder with given radius, height and angle at
3118 the origin of coordinate system. Axis of the cylinder
3119 will be collinear to the OZ axis of the coordinate system.
3122 theR Cylinder radius.
3123 theH Cylinder height.
3124 theA Cylinder angle in radians.
3125 theName Object name; when specified, this parameter is used
3126 for result publication in the study. Otherwise, if automatic
3127 publication is switched on, default value is used for result name.
3130 New GEOM.GEOM_Object, containing the created cylinder.
3132 # Example: see GEOM_TestAll.py
3134 if isinstance(theA,str):
3136 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3138 theA = theA*math.pi/180.
3139 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3140 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3141 anObj.SetParameters(Parameters)
3142 self._autoPublish(anObj, theName, "cylinder")
3145 ## Create a sphere with given center and radius.
3146 # @param thePnt Sphere center.
3147 # @param theR Sphere radius.
3148 # @param theName Object name; when specified, this parameter is used
3149 # for result publication in the study. Otherwise, if automatic
3150 # publication is switched on, default value is used for result name.
3152 # @return New GEOM.GEOM_Object, containing the created sphere.
3154 # @ref tui_creation_sphere "Example"
3155 @ManageTransactions("PrimOp")
3156 def MakeSpherePntR(self, thePnt, theR, theName=None):
3158 Create a sphere with given center and radius.
3161 thePnt Sphere center.
3163 theName Object name; when specified, this parameter is used
3164 for result publication in the study. Otherwise, if automatic
3165 publication is switched on, default value is used for result name.
3168 New GEOM.GEOM_Object, containing the created sphere.
3170 # Example: see GEOM_TestAll.py
3171 theR,Parameters = ParseParameters(theR)
3172 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3173 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3174 anObj.SetParameters(Parameters)
3175 self._autoPublish(anObj, theName, "sphere")
3178 ## Create a sphere with given center and radius.
3179 # @param x,y,z Coordinates of sphere center.
3180 # @param theR Sphere radius.
3181 # @param theName Object name; when specified, this parameter is used
3182 # for result publication in the study. Otherwise, if automatic
3183 # publication is switched on, default value is used for result name.
3185 # @return New GEOM.GEOM_Object, containing the created sphere.
3187 # @ref tui_creation_sphere "Example"
3188 def MakeSphere(self, x, y, z, theR, theName=None):
3190 Create a sphere with given center and radius.
3193 x,y,z Coordinates of sphere center.
3195 theName Object name; when specified, this parameter is used
3196 for result publication in the study. Otherwise, if automatic
3197 publication is switched on, default value is used for result name.
3200 New GEOM.GEOM_Object, containing the created sphere.
3202 # Example: see GEOM_TestAll.py
3203 point = self.MakeVertex(x, y, z)
3204 # note: auto-publishing is done in self.MakeSpherePntR()
3205 anObj = self.MakeSpherePntR(point, theR, theName)
3208 ## Create a sphere with given radius at the origin of coordinate system.
3209 # @param theR Sphere radius.
3210 # @param theName Object name; when specified, this parameter is used
3211 # for result publication in the study. Otherwise, if automatic
3212 # publication is switched on, default value is used for result name.
3214 # @return New GEOM.GEOM_Object, containing the created sphere.
3216 # @ref tui_creation_sphere "Example"
3217 @ManageTransactions("PrimOp")
3218 def MakeSphereR(self, theR, theName=None):
3220 Create a sphere with given radius at the origin of coordinate system.
3224 theName Object name; when specified, this parameter is used
3225 for result publication in the study. Otherwise, if automatic
3226 publication is switched on, default value is used for result name.
3229 New GEOM.GEOM_Object, containing the created sphere.
3231 # Example: see GEOM_TestAll.py
3232 theR,Parameters = ParseParameters(theR)
3233 anObj = self.PrimOp.MakeSphereR(theR)
3234 RaiseIfFailed("MakeSphereR", self.PrimOp)
3235 anObj.SetParameters(Parameters)
3236 self._autoPublish(anObj, theName, "sphere")
3239 ## Create a cone with given base point, axis, height and radiuses.
3240 # @param thePnt Central point of the first cone base.
3241 # @param theAxis Cone axis.
3242 # @param theR1 Radius of the first cone base.
3243 # @param theR2 Radius of the second cone base.
3244 # \note If both radiuses are non-zero, the cone will be truncated.
3245 # \note If the radiuses are equal, a cylinder will be created instead.
3246 # @param theH Cone height.
3247 # @param theName Object name; when specified, this parameter is used
3248 # for result publication in the study. Otherwise, if automatic
3249 # publication is switched on, default value is used for result name.
3251 # @return New GEOM.GEOM_Object, containing the created cone.
3253 # @ref tui_creation_cone "Example"
3254 @ManageTransactions("PrimOp")
3255 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3257 Create a cone with given base point, axis, height and radiuses.
3260 thePnt Central point of the first cone base.
3262 theR1 Radius of the first cone base.
3263 theR2 Radius of the second cone base.
3265 theName Object name; when specified, this parameter is used
3266 for result publication in the study. Otherwise, if automatic
3267 publication is switched on, default value is used for result name.
3270 If both radiuses are non-zero, the cone will be truncated.
3271 If the radiuses are equal, a cylinder will be created instead.
3274 New GEOM.GEOM_Object, containing the created cone.
3276 # Example: see GEOM_TestAll.py
3277 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3278 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3279 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3280 anObj.SetParameters(Parameters)
3281 self._autoPublish(anObj, theName, "cone")
3284 ## Create a cone with given height and radiuses at
3285 # the origin of coordinate system. Axis of the cone will
3286 # be collinear to the OZ axis of the coordinate system.
3287 # @param theR1 Radius of the first cone base.
3288 # @param theR2 Radius of the second cone base.
3289 # \note If both radiuses are non-zero, the cone will be truncated.
3290 # \note If the radiuses are equal, a cylinder will be created instead.
3291 # @param theH Cone height.
3292 # @param theName Object name; when specified, this parameter is used
3293 # for result publication in the study. Otherwise, if automatic
3294 # publication is switched on, default value is used for result name.
3296 # @return New GEOM.GEOM_Object, containing the created cone.
3298 # @ref tui_creation_cone "Example"
3299 @ManageTransactions("PrimOp")
3300 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3302 Create a cone with given height and radiuses at
3303 the origin of coordinate system. Axis of the cone will
3304 be collinear to the OZ axis of the coordinate system.
3307 theR1 Radius of the first cone base.
3308 theR2 Radius of the second cone base.
3310 theName Object name; when specified, this parameter is used
3311 for result publication in the study. Otherwise, if automatic
3312 publication is switched on, default value is used for result name.
3315 If both radiuses are non-zero, the cone will be truncated.
3316 If the radiuses are equal, a cylinder will be created instead.
3319 New GEOM.GEOM_Object, containing the created cone.
3321 # Example: see GEOM_TestAll.py
3322 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3323 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3324 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3325 anObj.SetParameters(Parameters)
3326 self._autoPublish(anObj, theName, "cone")
3329 ## Create a torus with given center, normal vector and radiuses.
3330 # @param thePnt Torus central point.
3331 # @param theVec Torus axis of symmetry.
3332 # @param theRMajor Torus major radius.
3333 # @param theRMinor Torus minor radius.
3334 # @param theName Object name; when specified, this parameter is used
3335 # for result publication in the study. Otherwise, if automatic
3336 # publication is switched on, default value is used for result name.
3338 # @return New GEOM.GEOM_Object, containing the created torus.
3340 # @ref tui_creation_torus "Example"
3341 @ManageTransactions("PrimOp")
3342 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3344 Create a torus with given center, normal vector and radiuses.
3347 thePnt Torus central point.
3348 theVec Torus axis of symmetry.
3349 theRMajor Torus major radius.
3350 theRMinor Torus minor radius.
3351 theName Object name; when specified, this parameter is used
3352 for result publication in the study. Otherwise, if automatic
3353 publication is switched on, default value is used for result name.
3356 New GEOM.GEOM_Object, containing the created torus.
3358 # Example: see GEOM_TestAll.py
3359 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3360 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3361 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3362 anObj.SetParameters(Parameters)
3363 self._autoPublish(anObj, theName, "torus")
3366 ## Create a torus with given radiuses at the origin of coordinate system.
3367 # @param theRMajor Torus major radius.
3368 # @param theRMinor Torus minor radius.
3369 # @param theName Object name; when specified, this parameter is used
3370 # for result publication in the study. Otherwise, if automatic
3371 # publication is switched on, default value is used for result name.
3373 # @return New GEOM.GEOM_Object, containing the created torus.
3375 # @ref tui_creation_torus "Example"
3376 @ManageTransactions("PrimOp")
3377 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3379 Create a torus with given radiuses at the origin of coordinate system.
3382 theRMajor Torus major radius.
3383 theRMinor Torus minor radius.
3384 theName Object name; when specified, this parameter is used
3385 for result publication in the study. Otherwise, if automatic
3386 publication is switched on, default value is used for result name.
3389 New GEOM.GEOM_Object, containing the created torus.
3391 # Example: see GEOM_TestAll.py
3392 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3393 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3394 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3395 anObj.SetParameters(Parameters)
3396 self._autoPublish(anObj, theName, "torus")
3399 # end of l3_3d_primitives
3402 ## @addtogroup l3_complex
3405 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3406 # @param theBase Base shape to be extruded.
3407 # @param thePoint1 First end of extrusion vector.
3408 # @param thePoint2 Second end of extrusion vector.
3409 # @param theScaleFactor Use it to make prism with scaled second base.
3410 # Nagative value means not scaled second base.
3411 # @param theName Object name; when specified, this parameter is used
3412 # for result publication in the study. Otherwise, if automatic
3413 # publication is switched on, default value is used for result name.
3415 # @return New GEOM.GEOM_Object, containing the created prism.
3417 # @ref tui_creation_prism "Example"
3418 @ManageTransactions("PrimOp")
3419 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3421 Create a shape by extrusion of the base shape along a vector, defined by two points.
3424 theBase Base shape to be extruded.
3425 thePoint1 First end of extrusion vector.
3426 thePoint2 Second end of extrusion vector.
3427 theScaleFactor Use it to make prism with scaled second base.
3428 Nagative value means not scaled second base.
3429 theName Object name; when specified, this parameter is used
3430 for result publication in the study. Otherwise, if automatic
3431 publication is switched on, default value is used for result name.
3434 New GEOM.GEOM_Object, containing the created prism.
3436 # Example: see GEOM_TestAll.py
3439 if theScaleFactor > 0:
3440 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3441 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3443 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3444 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3445 anObj.SetParameters(Parameters)
3446 self._autoPublish(anObj, theName, "prism")
3449 ## Create a shape by extrusion of the base shape along a
3450 # vector, defined by two points, in 2 Ways (forward/backward).
3451 # @param theBase Base shape to be extruded.
3452 # @param thePoint1 First end of extrusion vector.
3453 # @param thePoint2 Second end of extrusion vector.
3454 # @param theName Object name; when specified, this parameter is used
3455 # for result publication in the study. Otherwise, if automatic
3456 # publication is switched on, default value is used for result name.
3458 # @return New GEOM.GEOM_Object, containing the created prism.
3460 # @ref tui_creation_prism "Example"
3461 @ManageTransactions("PrimOp")
3462 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3464 Create a shape by extrusion of the base shape along a
3465 vector, defined by two points, in 2 Ways (forward/backward).
3468 theBase Base shape to be extruded.
3469 thePoint1 First end of extrusion vector.
3470 thePoint2 Second end of extrusion vector.
3471 theName Object name; when specified, this parameter is used
3472 for result publication in the study. Otherwise, if automatic
3473 publication is switched on, default value is used for result name.
3476 New GEOM.GEOM_Object, containing the created prism.
3478 # Example: see GEOM_TestAll.py
3479 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3480 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3481 self._autoPublish(anObj, theName, "prism")
3484 ## Create a shape by extrusion of the base shape along the vector,
3485 # i.e. all the space, transfixed by the base shape during its translation
3486 # along the vector on the given distance.
3487 # @param theBase Base shape to be extruded.
3488 # @param theVec Direction of extrusion.
3489 # @param theH Prism dimension along theVec.
3490 # @param theScaleFactor Use it to make prism with scaled second base.
3491 # Negative value means not scaled second base.
3492 # @param theName Object name; when specified, this parameter is used
3493 # for result publication in the study. Otherwise, if automatic
3494 # publication is switched on, default value is used for result name.
3496 # @return New GEOM.GEOM_Object, containing the created prism.
3498 # @ref tui_creation_prism "Example"
3499 @ManageTransactions("PrimOp")
3500 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3502 Create a shape by extrusion of the base shape along the vector,
3503 i.e. all the space, transfixed by the base shape during its translation
3504 along the vector on the given distance.
3507 theBase Base shape to be extruded.
3508 theVec Direction of extrusion.
3509 theH Prism dimension along theVec.
3510 theScaleFactor Use it to make prism with scaled second base.
3511 Negative value means not scaled second base.
3512 theName Object name; when specified, this parameter is used
3513 for result publication in the study. Otherwise, if automatic
3514 publication is switched on, default value is used for result name.
3517 New GEOM.GEOM_Object, containing the created prism.
3519 # Example: see GEOM_TestAll.py
3522 if theScaleFactor > 0:
3523 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3524 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3526 theH,Parameters = ParseParameters(theH)
3527 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3528 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3529 anObj.SetParameters(Parameters)
3530 self._autoPublish(anObj, theName, "prism")
3533 ## Create a shape by extrusion of the base shape along the vector,
3534 # i.e. all the space, transfixed by the base shape during its translation
3535 # along the vector on the given distance in 2 Ways (forward/backward).
3536 # @param theBase Base shape to be extruded.
3537 # @param theVec Direction of extrusion.
3538 # @param theH Prism dimension along theVec in forward direction.
3539 # @param theName Object name; when specified, this parameter is used
3540 # for result publication in the study. Otherwise, if automatic
3541 # publication is switched on, default value is used for result name.
3543 # @return New GEOM.GEOM_Object, containing the created prism.
3545 # @ref tui_creation_prism "Example"
3546 @ManageTransactions("PrimOp")
3547 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3549 Create a shape by extrusion of the base shape along the vector,
3550 i.e. all the space, transfixed by the base shape during its translation
3551 along the vector on the given distance in 2 Ways (forward/backward).
3554 theBase Base shape to be extruded.
3555 theVec Direction of extrusion.
3556 theH Prism dimension along theVec in forward direction.
3557 theName Object name; when specified, this parameter is used
3558 for result publication in the study. Otherwise, if automatic
3559 publication is switched on, default value is used for result name.
3562 New GEOM.GEOM_Object, containing the created prism.
3564 # Example: see GEOM_TestAll.py
3565 theH,Parameters = ParseParameters(theH)
3566 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3567 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3568 anObj.SetParameters(Parameters)
3569 self._autoPublish(anObj, theName, "prism")
3572 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3573 # @param theBase Base shape to be extruded.
3574 # @param theDX, theDY, theDZ Directions of extrusion.
3575 # @param theScaleFactor Use it to make prism with scaled second base.
3576 # Nagative value means not scaled second base.
3577 # @param theName Object name; when specified, this parameter is used
3578 # for result publication in the study. Otherwise, if automatic
3579 # publication is switched on, default value is used for result name.
3581 # @return New GEOM.GEOM_Object, containing the created prism.
3583 # @ref tui_creation_prism "Example"
3584 @ManageTransactions("PrimOp")
3585 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3587 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3590 theBase Base shape to be extruded.
3591 theDX, theDY, theDZ Directions of extrusion.
3592 theScaleFactor Use it to make prism with scaled second base.
3593 Nagative value means not scaled second base.
3594 theName Object name; when specified, this parameter is used
3595 for result publication in the study. Otherwise, if automatic
3596 publication is switched on, default value is used for result name.
3599 New GEOM.GEOM_Object, containing the created prism.
3601 # Example: see GEOM_TestAll.py
3604 if theScaleFactor > 0:
3605 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3606 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3608 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3609 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3610 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3611 anObj.SetParameters(Parameters)
3612 self._autoPublish(anObj, theName, "prism")
3615 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3616 # i.e. all the space, transfixed by the base shape during its translation
3617 # along the vector on the given distance in 2 Ways (forward/backward).
3618 # @param theBase Base shape to be extruded.
3619 # @param theDX, theDY, theDZ Directions of extrusion.
3620 # @param theName Object name; when specified, this parameter is used
3621 # for result publication in the study. Otherwise, if automatic
3622 # publication is switched on, default value is used for result name.
3624 # @return New GEOM.GEOM_Object, containing the created prism.
3626 # @ref tui_creation_prism "Example"
3627 @ManageTransactions("PrimOp")
3628 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3630 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3631 i.e. all the space, transfixed by the base shape during its translation
3632 along the vector on the given distance in 2 Ways (forward/backward).
3635 theBase Base shape to be extruded.
3636 theDX, theDY, theDZ Directions of extrusion.
3637 theName Object name; when specified, this parameter is used
3638 for result publication in the study. Otherwise, if automatic
3639 publication is switched on, default value is used for result name.
3642 New GEOM.GEOM_Object, containing the created prism.
3644 # Example: see GEOM_TestAll.py
3645 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3646 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3647 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3648 anObj.SetParameters(Parameters)
3649 self._autoPublish(anObj, theName, "prism")
3652 ## Create a shape by revolution of the base shape around the axis
3653 # on the given angle, i.e. all the space, transfixed by the base
3654 # shape during its rotation around the axis on the given angle.
3655 # @param theBase Base shape to be rotated.
3656 # @param theAxis Rotation axis.
3657 # @param theAngle Rotation angle in radians.
3658 # @param theName Object name; when specified, this parameter is used
3659 # for result publication in the study. Otherwise, if automatic
3660 # publication is switched on, default value is used for result name.
3662 # @return New GEOM.GEOM_Object, containing the created revolution.
3664 # @ref tui_creation_revolution "Example"
3665 @ManageTransactions("PrimOp")
3666 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3668 Create a shape by revolution of the base shape around the axis
3669 on the given angle, i.e. all the space, transfixed by the base
3670 shape during its rotation around the axis on the given angle.
3673 theBase Base shape to be rotated.
3674 theAxis Rotation axis.
3675 theAngle Rotation angle in radians.
3676 theName Object name; when specified, this parameter is used
3677 for result publication in the study. Otherwise, if automatic
3678 publication is switched on, default value is used for result name.
3681 New GEOM.GEOM_Object, containing the created revolution.
3683 # Example: see GEOM_TestAll.py
3684 theAngle,Parameters = ParseParameters(theAngle)
3685 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3686 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3687 anObj.SetParameters(Parameters)
3688 self._autoPublish(anObj, theName, "revolution")
3691 ## Create a shape by revolution of the base shape around the axis
3692 # on the given angle, i.e. all the space, transfixed by the base
3693 # shape during its rotation around the axis on the given angle in
3694 # both directions (forward/backward)
3695 # @param theBase Base shape to be rotated.
3696 # @param theAxis Rotation axis.
3697 # @param theAngle Rotation angle in radians.
3698 # @param theName Object name; when specified, this parameter is used
3699 # for result publication in the study. Otherwise, if automatic
3700 # publication is switched on, default value is used for result name.
3702 # @return New GEOM.GEOM_Object, containing the created revolution.
3704 # @ref tui_creation_revolution "Example"
3705 @ManageTransactions("PrimOp")
3706 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3708 Create a shape by revolution of the base shape around the axis
3709 on the given angle, i.e. all the space, transfixed by the base
3710 shape during its rotation around the axis on the given angle in
3711 both directions (forward/backward).
3714 theBase Base shape to be rotated.
3715 theAxis Rotation axis.
3716 theAngle Rotation angle in radians.
3717 theName Object name; when specified, this parameter is used
3718 for result publication in the study. Otherwise, if automatic
3719 publication is switched on, default value is used for result name.
3722 New GEOM.GEOM_Object, containing the created revolution.
3724 theAngle,Parameters = ParseParameters(theAngle)
3725 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3726 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3727 anObj.SetParameters(Parameters)
3728 self._autoPublish(anObj, theName, "revolution")
3731 ## Create a face from a given set of contours.
3732 # @param theContours either a list or a compound of edges/wires.
3733 # @param theMinDeg a minimal degree of BSpline surface to create.
3734 # @param theMaxDeg a maximal degree of BSpline surface to create.
3735 # @param theTol2D a 2d tolerance to be reached.
3736 # @param theTol3D a 3d tolerance to be reached.
3737 # @param theNbIter a number of iteration of approximation algorithm.
3738 # @param theMethod Kind of method to perform filling operation
3739 # (see GEOM.filling_oper_method enum).
3740 # @param isApprox if True, BSpline curves are generated in the process
3741 # of surface construction. By default it is False, that means
3742 # the surface is created using given curves. The usage of
3743 # Approximation makes the algorithm work slower, but allows
3744 # building the surface for rather complex cases.
3745 # @param theName Object name; when specified, this parameter is used
3746 # for result publication in the study. Otherwise, if automatic
3747 # publication is switched on, default value is used for result name.
3749 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3751 # @ref tui_creation_filling "Example"
3752 @ManageTransactions("PrimOp")
3753 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3754 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3756 Create a face from a given set of contours.
3759 theContours either a list or a compound of edges/wires.
3760 theMinDeg a minimal degree of BSpline surface to create.
3761 theMaxDeg a maximal degree of BSpline surface to create.
3762 theTol2D a 2d tolerance to be reached.
3763 theTol3D a 3d tolerance to be reached.
3764 theNbIter a number of iteration of approximation algorithm.
3765 theMethod Kind of method to perform filling operation
3766 (see GEOM.filling_oper_method enum).
3767 isApprox if True, BSpline curves are generated in the process
3768 of surface construction. By default it is False, that means
3769 the surface is created using given curves. The usage of
3770 Approximation makes the algorithm work slower, but allows
3771 building the surface for rather complex cases.
3772 theName Object name; when specified, this parameter is used
3773 for result publication in the study. Otherwise, if automatic
3774 publication is switched on, default value is used for result name.
3777 New GEOM.GEOM_Object (face), containing the created filling surface.
3780 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3782 # Example: see GEOM_TestAll.py
3783 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3784 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3785 theTol2D, theTol3D, theNbIter,
3786 theMethod, isApprox)
3787 RaiseIfFailed("MakeFilling", self.PrimOp)
3788 anObj.SetParameters(Parameters)
3789 self._autoPublish(anObj, theName, "filling")
3793 ## Create a face from a given set of contours.
3794 # This method corresponds to MakeFilling() with isApprox=True.
3795 # @param theContours either a list or a compound of edges/wires.
3796 # @param theMinDeg a minimal degree of BSpline surface to create.
3797 # @param theMaxDeg a maximal degree of BSpline surface to create.
3798 # @param theTol3D a 3d tolerance to be reached.
3799 # @param theName Object name; when specified, this parameter is used
3800 # for result publication in the study. Otherwise, if automatic
3801 # publication is switched on, default value is used for result name.
3803 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3805 # @ref tui_creation_filling "Example"
3806 @ManageTransactions("PrimOp")
3807 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3809 Create a filling from the given compound of contours.
3810 This method corresponds to MakeFilling() with isApprox=True.
3813 theContours either a list or a compound of edges/wires.
3814 theMinDeg a minimal degree of BSpline surface to create.
3815 theMaxDeg a maximal degree of BSpline surface to create.
3816 theTol3D a 3d tolerance to be reached.
3817 theName Object name; when specified, this parameter is used
3818 for result publication in the study. Otherwise, if automatic
3819 publication is switched on, default value is used for result name.
3822 New GEOM.GEOM_Object (face), containing the created filling surface.
3825 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3827 # Example: see GEOM_TestAll.py
3828 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3829 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3830 0, theTol3D, 0, GEOM.FOM_Default, True)
3831 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3832 anObj.SetParameters(Parameters)
3833 self._autoPublish(anObj, theName, "filling")
3836 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3837 # @param theSeqSections - set of specified sections.
3838 # @param theModeSolid - mode defining building solid or shell
3839 # @param thePreci - precision 3D used for smoothing
3840 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3841 # @param theName Object name; when specified, this parameter is used
3842 # for result publication in the study. Otherwise, if automatic
3843 # publication is switched on, default value is used for result name.
3845 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3847 # @ref swig_todo "Example"
3848 @ManageTransactions("PrimOp")
3849 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3851 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3854 theSeqSections - set of specified sections.
3855 theModeSolid - mode defining building solid or shell
3856 thePreci - precision 3D used for smoothing
3857 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3858 theName Object name; when specified, this parameter is used
3859 for result publication in the study. Otherwise, if automatic
3860 publication is switched on, default value is used for result name.
3863 New GEOM.GEOM_Object, containing the created shell or solid.
3865 # Example: see GEOM_TestAll.py
3866 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3867 RaiseIfFailed("MakeThruSections", self.PrimOp)
3868 self._autoPublish(anObj, theName, "filling")
3871 ## Create a shape by extrusion of the base shape along
3872 # the path shape. The path shape can be a wire or an edge.
3873 # @param theBase Base shape to be extruded.
3874 # @param thePath Path shape to extrude the base shape along it.
3875 # @param theName Object name; when specified, this parameter is used
3876 # for result publication in the study. Otherwise, if automatic
3877 # publication is switched on, default value is used for result name.
3879 # @return New GEOM.GEOM_Object, containing the created pipe.
3881 # @ref tui_creation_pipe "Example"
3882 @ManageTransactions("PrimOp")
3883 def MakePipe(self, theBase, thePath, theName=None):
3885 Create a shape by extrusion of the base shape along
3886 the path shape. The path shape can be a wire or an edge.
3889 theBase Base shape to be extruded.
3890 thePath Path shape to extrude the base shape along it.
3891 theName Object name; when specified, this parameter is used
3892 for result publication in the study. Otherwise, if automatic
3893 publication is switched on, default value is used for result name.
3896 New GEOM.GEOM_Object, containing the created pipe.
3898 # Example: see GEOM_TestAll.py
3899 anObj = self.PrimOp.MakePipe(theBase, thePath)
3900 RaiseIfFailed("MakePipe", self.PrimOp)
3901 self._autoPublish(anObj, theName, "pipe")
3904 ## Create a shape by extrusion of the profile shape along
3905 # the path shape. The path shape can be a wire or an edge.
3906 # the several profiles can be specified in the several locations of path.
3907 # @param theSeqBases - list of Bases shape to be extruded.
3908 # @param theLocations - list of locations on the path corresponding
3909 # specified list of the Bases shapes. Number of locations
3910 # should be equal to number of bases or list of locations can be empty.
3911 # @param thePath - Path shape to extrude the base shape along it.
3912 # @param theWithContact - the mode defining that the section is translated to be in
3913 # contact with the spine.
3914 # @param theWithCorrection - defining that the section is rotated to be
3915 # orthogonal to the spine tangent in the correspondent point
3916 # @param theName Object name; when specified, this parameter is used
3917 # for result publication in the study. Otherwise, if automatic
3918 # publication is switched on, default value is used for result name.
3920 # @return New GEOM.GEOM_Object, containing the created pipe.
3922 # @ref tui_creation_pipe_with_diff_sec "Example"
3923 @ManageTransactions("PrimOp")
3924 def MakePipeWithDifferentSections(self, theSeqBases,
3925 theLocations, thePath,
3926 theWithContact, theWithCorrection, theName=None):
3928 Create a shape by extrusion of the profile shape along
3929 the path shape. The path shape can be a wire or an edge.
3930 the several profiles can be specified in the several locations of path.
3933 theSeqBases - list of Bases shape to be extruded.
3934 theLocations - list of locations on the path corresponding
3935 specified list of the Bases shapes. Number of locations
3936 should be equal to number of bases or list of locations can be empty.
3937 thePath - Path shape to extrude the base shape along it.
3938 theWithContact - the mode defining that the section is translated to be in
3939 contact with the spine(0/1)
3940 theWithCorrection - defining that the section is rotated to be
3941 orthogonal to the spine tangent in the correspondent point (0/1)
3942 theName Object name; when specified, this parameter is used
3943 for result publication in the study. Otherwise, if automatic
3944 publication is switched on, default value is used for result name.
3947 New GEOM.GEOM_Object, containing the created pipe.
3949 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3950 theLocations, thePath,
3951 theWithContact, theWithCorrection)
3952 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3953 self._autoPublish(anObj, theName, "pipe")
3956 ## Create a shape by extrusion of the profile shape along
3957 # the path shape. The path shape can be a wire or a edge.
3958 # the several profiles can be specified in the several locations of path.
3959 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3960 # shell or face. If number of faces in neighbour sections
3961 # aren't coincided result solid between such sections will
3962 # be created using external boundaries of this shells.
3963 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3964 # This list is used for searching correspondences between
3965 # faces in the sections. Size of this list must be equal
3966 # to size of list of base shapes.
3967 # @param theLocations - list of locations on the path corresponding
3968 # specified list of the Bases shapes. Number of locations
3969 # should be equal to number of bases. First and last
3970 # locations must be coincided with first and last vertexes
3971 # of path correspondingly.
3972 # @param thePath - Path shape to extrude the base shape along it.
3973 # @param theWithContact - the mode defining that the section is translated to be in
3974 # contact with the spine.
3975 # @param theWithCorrection - defining that the section is rotated to be
3976 # orthogonal to the spine tangent in the correspondent point
3977 # @param theName Object name; when specified, this parameter is used
3978 # for result publication in the study. Otherwise, if automatic
3979 # publication is switched on, default value is used for result name.
3981 # @return New GEOM.GEOM_Object, containing the created solids.
3983 # @ref tui_creation_pipe_with_shell_sec "Example"
3984 @ManageTransactions("PrimOp")
3985 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3986 theLocations, thePath,
3987 theWithContact, theWithCorrection, theName=None):
3989 Create a shape by extrusion of the profile shape along
3990 the path shape. The path shape can be a wire or a edge.
3991 the several profiles can be specified in the several locations of path.
3994 theSeqBases - list of Bases shape to be extruded. Base shape must be
3995 shell or face. If number of faces in neighbour sections
3996 aren't coincided result solid between such sections will
3997 be created using external boundaries of this shells.
3998 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3999 This list is used for searching correspondences between
4000 faces in the sections. Size of this list must be equal
4001 to size of list of base shapes.
4002 theLocations - list of locations on the path corresponding
4003 specified list of the Bases shapes. Number of locations
4004 should be equal to number of bases. First and last
4005 locations must be coincided with first and last vertexes
4006 of path correspondingly.
4007 thePath - Path shape to extrude the base shape along it.
4008 theWithContact - the mode defining that the section is translated to be in
4009 contact with the spine (0/1)
4010 theWithCorrection - defining that the section is rotated to be
4011 orthogonal to the spine tangent in the correspondent point (0/1)
4012 theName Object name; when specified, this parameter is used
4013 for result publication in the study. Otherwise, if automatic
4014 publication is switched on, default value is used for result name.
4017 New GEOM.GEOM_Object, containing the created solids.
4019 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4020 theLocations, thePath,
4021 theWithContact, theWithCorrection)
4022 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4023 self._autoPublish(anObj, theName, "pipe")
4026 ## Create a shape by extrusion of the profile shape along
4027 # the path shape. This function is used only for debug pipe
4028 # functionality - it is a version of function MakePipeWithShellSections()
4029 # which give a possibility to recieve information about
4030 # creating pipe between each pair of sections step by step.
4031 @ManageTransactions("PrimOp")
4032 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4033 theLocations, thePath,
4034 theWithContact, theWithCorrection, theName=None):
4036 Create a shape by extrusion of the profile shape along
4037 the path shape. This function is used only for debug pipe
4038 functionality - it is a version of previous function
4039 geompy.MakePipeWithShellSections() which give a possibility to
4040 recieve information about creating pipe between each pair of
4041 sections step by step.
4044 nbsect = len(theSeqBases)
4045 nbsubsect = len(theSeqSubBases)
4046 #print "nbsect = ",nbsect
4047 for i in range(1,nbsect):
4049 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4050 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4052 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4053 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4054 tmpLocations, thePath,
4055 theWithContact, theWithCorrection)
4056 if self.PrimOp.IsDone() == 0:
4057 print "Problems with pipe creation between ",i," and ",i+1," sections"
4058 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4061 print "Pipe between ",i," and ",i+1," sections is OK"
4066 resc = self.MakeCompound(res)
4067 #resc = self.MakeSewing(res, 0.001)
4068 #print "resc: ",resc
4069 self._autoPublish(resc, theName, "pipe")
4072 ## Create solids between given sections
4073 # @param theSeqBases - list of sections (shell or face).
4074 # @param theLocations - list of corresponding vertexes
4075 # @param theName Object name; when specified, this parameter is used
4076 # for result publication in the study. Otherwise, if automatic
4077 # publication is switched on, default value is used for result name.
4079 # @return New GEOM.GEOM_Object, containing the created solids.
4081 # @ref tui_creation_pipe_without_path "Example"
4082 @ManageTransactions("PrimOp")
4083 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
4085 Create solids between given sections
4088 theSeqBases - list of sections (shell or face).
4089 theLocations - list of corresponding vertexes
4090 theName Object name; when specified, this parameter is used
4091 for result publication in the study. Otherwise, if automatic
4092 publication is switched on, default value is used for result name.
4095 New GEOM.GEOM_Object, containing the created solids.
4097 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4098 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4099 self._autoPublish(anObj, theName, "pipe")
4102 ## Create a shape by extrusion of the base shape along
4103 # the path shape with constant bi-normal direction along the given vector.
4104 # The path shape can be a wire or an edge.
4105 # @param theBase Base shape to be extruded.
4106 # @param thePath Path shape to extrude the base shape along it.
4107 # @param theVec Vector defines a constant binormal direction to keep the
4108 # same angle beetween the direction and the sections
4109 # along the sweep surface.
4110 # @param theName Object name; when specified, this parameter is used
4111 # for result publication in the study. Otherwise, if automatic
4112 # publication is switched on, default value is used for result name.
4114 # @return New GEOM.GEOM_Object, containing the created pipe.
4116 # @ref tui_creation_pipe "Example"
4117 @ManageTransactions("PrimOp")
4118 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4120 Create a shape by extrusion of the base shape along
4121 the path shape with constant bi-normal direction along the given vector.
4122 The path shape can be a wire or an edge.
4125 theBase Base shape to be extruded.
4126 thePath Path shape to extrude the base shape along it.
4127 theVec Vector defines a constant binormal direction to keep the
4128 same angle beetween the direction and the sections
4129 along the sweep surface.
4130 theName Object name; when specified, this parameter is used
4131 for result publication in the study. Otherwise, if automatic
4132 publication is switched on, default value is used for result name.
4135 New GEOM.GEOM_Object, containing the created pipe.
4137 # Example: see GEOM_TestAll.py
4138 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4139 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4140 self._autoPublish(anObj, theName, "pipe")
4143 ## Makes a thick solid from a face or a shell
4144 # @param theShape Face or Shell to be thicken
4145 # @param theThickness Thickness of the resulting solid
4146 # @param theName Object name; when specified, this parameter is used
4147 # for result publication in the study. Otherwise, if automatic
4148 # publication is switched on, default value is used for result name.
4150 # @return New GEOM.GEOM_Object, containing the created solid
4152 @ManageTransactions("PrimOp")
4153 def MakeThickSolid(self, theShape, theThickness, theName=None):
4155 Make a thick solid from a face or a shell
4158 theShape Face or Shell to be thicken
4159 theThickness Thickness of the resulting solid
4160 theName Object name; when specified, this parameter is used
4161 for result publication in the study. Otherwise, if automatic
4162 publication is switched on, default value is used for result name.
4165 New GEOM.GEOM_Object, containing the created solid
4167 # Example: see GEOM_TestAll.py
4168 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4169 RaiseIfFailed("MakeThickening", self.PrimOp)
4170 self._autoPublish(anObj, theName, "pipe")
4174 ## Modifies a face or a shell to make it a thick solid
4175 # @param theShape Face or Shell to be thicken
4176 # @param theThickness Thickness of the resulting solid
4178 # @return The modified shape
4180 @ManageTransactions("PrimOp")
4181 def Thicken(self, theShape, theThickness):
4183 Modifies a face or a shell to make it a thick solid
4186 theBase Base shape to be extruded.
4187 thePath Path shape to extrude the base shape along it.
4188 theName Object name; when specified, this parameter is used
4189 for result publication in the study. Otherwise, if automatic
4190 publication is switched on, default value is used for result name.
4195 # Example: see GEOM_TestAll.py
4196 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4197 RaiseIfFailed("MakeThickening", self.PrimOp)
4200 ## Build a middle path of a pipe-like shape.
4201 # The path shape can be a wire or an edge.
4202 # @param theShape It can be closed or unclosed pipe-like shell
4203 # or a pipe-like solid.
4204 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4205 # should be wires or faces of theShape.
4206 # @param theName Object name; when specified, this parameter is used
4207 # for result publication in the study. Otherwise, if automatic
4208 # publication is switched on, default value is used for result name.
4210 # @note It is not assumed that exact or approximate copy of theShape
4211 # can be obtained by applying existing Pipe operation on the
4212 # resulting "Path" wire taking theBase1 as the base - it is not
4213 # always possible; though in some particular cases it might work
4214 # it is not guaranteed. Thus, RestorePath function should not be
4215 # considered as an exact reverse operation of the Pipe.
4217 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4218 # source pipe's "path".
4220 # @ref tui_creation_pipe_path "Example"
4221 @ManageTransactions("PrimOp")
4222 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4224 Build a middle path of a pipe-like shape.
4225 The path shape can be a wire or an edge.
4228 theShape It can be closed or unclosed pipe-like shell
4229 or a pipe-like solid.
4230 theBase1, theBase2 Two bases of the supposed pipe. This
4231 should be wires or faces of theShape.
4232 theName Object name; when specified, this parameter is used
4233 for result publication in the study. Otherwise, if automatic
4234 publication is switched on, default value is used for result name.
4237 New GEOM_Object, containing an edge or wire that represent
4240 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4241 RaiseIfFailed("RestorePath", self.PrimOp)
4242 self._autoPublish(anObj, theName, "path")
4245 ## Build a middle path of a pipe-like shape.
4246 # The path shape can be a wire or an edge.
4247 # @param theShape It can be closed or unclosed pipe-like shell
4248 # or a pipe-like solid.
4249 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4250 # should be lists of edges of theShape.
4251 # @param theName Object name; when specified, this parameter is used
4252 # for result publication in the study. Otherwise, if automatic
4253 # publication is switched on, default value is used for result name.
4255 # @note It is not assumed that exact or approximate copy of theShape
4256 # can be obtained by applying existing Pipe operation on the
4257 # resulting "Path" wire taking theBase1 as the base - it is not
4258 # always possible; though in some particular cases it might work
4259 # it is not guaranteed. Thus, RestorePath function should not be
4260 # considered as an exact reverse operation of the Pipe.
4262 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4263 # source pipe's "path".
4265 # @ref tui_creation_pipe_path "Example"
4266 @ManageTransactions("PrimOp")
4267 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4269 Build a middle path of a pipe-like shape.
4270 The path shape can be a wire or an edge.
4273 theShape It can be closed or unclosed pipe-like shell
4274 or a pipe-like solid.
4275 listEdges1, listEdges2 Two bases of the supposed pipe. This
4276 should be lists of edges of theShape.
4277 theName Object name; when specified, this parameter is used
4278 for result publication in the study. Otherwise, if automatic
4279 publication is switched on, default value is used for result name.
4282 New GEOM_Object, containing an edge or wire that represent
4285 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4286 RaiseIfFailed("RestorePath", self.PrimOp)
4287 self._autoPublish(anObj, theName, "path")
4293 ## @addtogroup l3_advanced
4296 ## Create a linear edge with specified ends.
4297 # @param thePnt1 Point for the first end of edge.
4298 # @param thePnt2 Point for the second end of edge.
4299 # @param theName Object name; when specified, this parameter is used
4300 # for result publication in the study. Otherwise, if automatic
4301 # publication is switched on, default value is used for result name.
4303 # @return New GEOM.GEOM_Object, containing the created edge.
4305 # @ref tui_creation_edge "Example"
4306 @ManageTransactions("ShapesOp")
4307 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4309 Create a linear edge with specified ends.
4312 thePnt1 Point for the first end of edge.
4313 thePnt2 Point for the second end of edge.
4314 theName Object name; when specified, this parameter is used
4315 for result publication in the study. Otherwise, if automatic
4316 publication is switched on, default value is used for result name.
4319 New GEOM.GEOM_Object, containing the created edge.
4321 # Example: see GEOM_TestAll.py
4322 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4323 RaiseIfFailed("MakeEdge", self.ShapesOp)
4324 self._autoPublish(anObj, theName, "edge")
4327 ## Create a new edge, corresponding to the given length on the given curve.
4328 # @param theRefCurve The referenced curve (edge).
4329 # @param theLength Length on the referenced curve. It can be negative.
4330 # @param theStartPoint Any point can be selected for it, the new edge will begin
4331 # at the end of \a theRefCurve, close to the selected point.
4332 # If None, start from the first point of \a theRefCurve.
4333 # @param theName Object name; when specified, this parameter is used
4334 # for result publication in the study. Otherwise, if automatic
4335 # publication is switched on, default value is used for result name.
4337 # @return New GEOM.GEOM_Object, containing the created edge.
4339 # @ref tui_creation_edge "Example"
4340 @ManageTransactions("ShapesOp")
4341 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4343 Create a new edge, corresponding to the given length on the given curve.
4346 theRefCurve The referenced curve (edge).
4347 theLength Length on the referenced curve. It can be negative.
4348 theStartPoint Any point can be selected for it, the new edge will begin
4349 at the end of theRefCurve, close to the selected point.
4350 If None, start from the first point of theRefCurve.
4351 theName Object name; when specified, this parameter is used
4352 for result publication in the study. Otherwise, if automatic
4353 publication is switched on, default value is used for result name.
4356 New GEOM.GEOM_Object, containing the created edge.
4358 # Example: see GEOM_TestAll.py
4359 theLength, Parameters = ParseParameters(theLength)
4360 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4361 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4362 anObj.SetParameters(Parameters)
4363 self._autoPublish(anObj, theName, "edge")
4366 ## Create an edge from specified wire.
4367 # @param theWire source Wire
4368 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4369 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4370 # @param theName Object name; when specified, this parameter is used
4371 # for result publication in the study. Otherwise, if automatic
4372 # publication is switched on, default value is used for result name.
4374 # @return New GEOM.GEOM_Object, containing the created edge.
4376 # @ref tui_creation_edge "Example"
4377 @ManageTransactions("ShapesOp")
4378 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4380 Create an edge from specified wire.
4384 theLinearTolerance linear tolerance value (default = 1e-07)
4385 theAngularTolerance angular tolerance value (default = 1e-12)
4386 theName Object name; when specified, this parameter is used
4387 for result publication in the study. Otherwise, if automatic
4388 publication is switched on, default value is used for result name.
4391 New GEOM.GEOM_Object, containing the created edge.
4393 # Example: see GEOM_TestAll.py
4394 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4395 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4396 self._autoPublish(anObj, theName, "edge")
4399 ## Create a wire from the set of edges and wires.
4400 # @param theEdgesAndWires List of edges and/or wires.
4401 # @param theTolerance Maximum distance between vertices, that will be merged.
4402 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4403 # @param theName Object name; when specified, this parameter is used
4404 # for result publication in the study. Otherwise, if automatic
4405 # publication is switched on, default value is used for result name.
4407 # @return New GEOM.GEOM_Object, containing the created wire.
4409 # @ref tui_creation_wire "Example"
4410 @ManageTransactions("ShapesOp")
4411 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4413 Create a wire from the set of edges and wires.
4416 theEdgesAndWires List of edges and/or wires.
4417 theTolerance Maximum distance between vertices, that will be merged.
4418 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4419 theName Object name; when specified, this parameter is used
4420 for result publication in the study. Otherwise, if automatic
4421 publication is switched on, default value is used for result name.
4424 New GEOM.GEOM_Object, containing the created wire.
4426 # Example: see GEOM_TestAll.py
4427 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4428 RaiseIfFailed("MakeWire", self.ShapesOp)
4429 self._autoPublish(anObj, theName, "wire")
4432 ## Create a face on the given wire.
4433 # @param theWire closed Wire or Edge to build the face on.
4434 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4435 # If the tolerance of the obtained planar face is less
4436 # than 1e-06, this face will be returned, otherwise the
4437 # algorithm tries to build any suitable face on the given
4438 # wire and prints a warning message.
4439 # @param theName Object name; when specified, this parameter is used
4440 # for result publication in the study. Otherwise, if automatic
4441 # publication is switched on, default value is used for result name.
4443 # @return New GEOM.GEOM_Object, containing the created face.
4445 # @ref tui_creation_face "Example"
4446 @ManageTransactions("ShapesOp")
4447 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4449 Create a face on the given wire.
4452 theWire closed Wire or Edge to build the face on.
4453 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4454 If the tolerance of the obtained planar face is less
4455 than 1e-06, this face will be returned, otherwise the
4456 algorithm tries to build any suitable face on the given
4457 wire and prints a warning message.
4458 theName Object name; when specified, this parameter is used
4459 for result publication in the study. Otherwise, if automatic
4460 publication is switched on, default value is used for result name.
4463 New GEOM.GEOM_Object, containing the created face.
4465 # Example: see GEOM_TestAll.py
4466 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4467 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4468 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4470 RaiseIfFailed("MakeFace", self.ShapesOp)
4471 self._autoPublish(anObj, theName, "face")
4474 ## Create a face on the given wires set.
4475 # @param theWires List of closed wires or edges to build the face on.
4476 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4477 # If the tolerance of the obtained planar face is less
4478 # than 1e-06, this face will be returned, otherwise the
4479 # algorithm tries to build any suitable face on the given
4480 # wire and prints a warning message.
4481 # @param theName Object name; when specified, this parameter is used
4482 # for result publication in the study. Otherwise, if automatic
4483 # publication is switched on, default value is used for result name.
4485 # @return New GEOM.GEOM_Object, containing the created face.
4487 # @ref tui_creation_face "Example"
4488 @ManageTransactions("ShapesOp")
4489 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4491 Create a face on the given wires set.
4494 theWires List of closed wires or edges to build the face on.
4495 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4496 If the tolerance of the obtained planar face is less
4497 than 1e-06, this face will be returned, otherwise the
4498 algorithm tries to build any suitable face on the given
4499 wire and prints a warning message.
4500 theName Object name; when specified, this parameter is used
4501 for result publication in the study. Otherwise, if automatic
4502 publication is switched on, default value is used for result name.
4505 New GEOM.GEOM_Object, containing the created face.
4507 # Example: see GEOM_TestAll.py
4508 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4509 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4510 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4512 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4513 self._autoPublish(anObj, theName, "face")
4516 ## See MakeFaceWires() method for details.
4518 # @ref tui_creation_face "Example 1"
4519 # \n @ref swig_MakeFaces "Example 2"
4520 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4522 See geompy.MakeFaceWires() method for details.
4524 # Example: see GEOM_TestOthers.py
4525 # note: auto-publishing is done in self.MakeFaceWires()
4526 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4529 ## Create a face based on a surface from given face bounded
4531 # @param theFace the face whose surface is used to create a new face.
4532 # @param theWire the wire that will bound a new face.
4533 # @param theName Object name; when specified, this parameter is used
4534 # for result publication in the study. Otherwise, if automatic
4535 # publication is switched on, default value is used for result name.
4537 # @return New GEOM.GEOM_Object, containing the created face.
4539 # @ref tui_creation_face "Example"
4540 @ManageTransactions("ShapesOp")
4541 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4543 Create a face based on a surface from given face bounded
4547 theFace the face whose surface is used to create a new face.
4548 theWire the wire that will bound a new face.
4549 theName Object name; when specified, this parameter is used
4550 for result publication in the study. Otherwise, if automatic
4551 publication is switched on, default value is used for result name.
4554 New GEOM.GEOM_Object, containing the created face.
4556 # Example: see GEOM_TestAll.py
4557 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4558 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4559 self._autoPublish(anObj, theName, "face")
4562 ## Create a face from a set of edges with the given constraints.
4563 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4564 # - edges should form a closed wire;
4565 # - for each edge, constraint face is optional: if a constraint face is missing
4566 # for some edge, this means that there no constraint associated with this edge.
4567 # @param theName Object name; when specified, this parameter is used
4568 # for result publication in the study. Otherwise, if automatic
4569 # publication is switched on, default value is used for result name.
4571 # @return New GEOM.GEOM_Object, containing the created face.
4573 # @ref tui_creation_face "Example"
4574 @ManageTransactions("ShapesOp")
4575 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4577 Create a face from a set of edges with the given constraints.
4580 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4581 - edges should form a closed wire;
4582 - for each edge, constraint face is optional: if a constraint face is missing
4583 for some edge, this means that there no constraint associated with this edge.
4584 theName Object name; when specified, this parameter is used
4585 for result publication in the study. Otherwise, if automatic
4586 publication is switched on, default value is used for result name.
4589 New GEOM.GEOM_Object, containing the created face.
4591 # Example: see GEOM_TestAll.py
4592 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4594 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4595 self._autoPublish(anObj, theName, "face")
4598 ## Create a shell from the set of faces and shells.
4599 # @param theFacesAndShells List of faces and/or shells.
4600 # @param theName Object name; when specified, this parameter is used
4601 # for result publication in the study. Otherwise, if automatic
4602 # publication is switched on, default value is used for result name.
4604 # @return New GEOM.GEOM_Object, containing the created shell.
4606 # @ref tui_creation_shell "Example"
4607 @ManageTransactions("ShapesOp")
4608 def MakeShell(self, theFacesAndShells, theName=None):
4610 Create a shell from the set of faces and shells.
4613 theFacesAndShells List of faces and/or shells.
4614 theName Object name; when specified, this parameter is used
4615 for result publication in the study. Otherwise, if automatic
4616 publication is switched on, default value is used for result name.
4619 New GEOM.GEOM_Object, containing the created shell.
4621 # Example: see GEOM_TestAll.py
4622 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4623 RaiseIfFailed("MakeShell", self.ShapesOp)
4624 self._autoPublish(anObj, theName, "shell")
4627 ## Create a solid, bounded by the given shells.
4628 # @param theShells Sequence of bounding shells.
4629 # @param theName Object name; when specified, this parameter is used
4630 # for result publication in the study. Otherwise, if automatic
4631 # publication is switched on, default value is used for result name.
4633 # @return New GEOM.GEOM_Object, containing the created solid.
4635 # @ref tui_creation_solid "Example"
4636 @ManageTransactions("ShapesOp")
4637 def MakeSolid(self, theShells, theName=None):
4639 Create a solid, bounded by the given shells.
4642 theShells Sequence of bounding shells.
4643 theName Object name; when specified, this parameter is used
4644 for result publication in the study. Otherwise, if automatic
4645 publication is switched on, default value is used for result name.
4648 New GEOM.GEOM_Object, containing the created solid.
4650 # Example: see GEOM_TestAll.py
4651 theShells = ToList(theShells)
4652 if len(theShells) == 1:
4653 descr = self._IsGoodForSolid(theShells[0])
4655 # raise RuntimeError, "MakeSolidShells : " + descr
4656 if descr == "WRN_SHAPE_UNCLOSED":
4657 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4658 anObj = self.ShapesOp.MakeSolidShells(theShells)
4659 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4660 self._autoPublish(anObj, theName, "solid")
4663 ## Create a compound of the given shapes.
4664 # @param theShapes List of shapes to put in compound.
4665 # @param theName Object name; when specified, this parameter is used
4666 # for result publication in the study. Otherwise, if automatic
4667 # publication is switched on, default value is used for result name.
4669 # @return New GEOM.GEOM_Object, containing the created compound.
4671 # @ref tui_creation_compound "Example"
4672 @ManageTransactions("ShapesOp")
4673 def MakeCompound(self, theShapes, theName=None):
4675 Create a compound of the given shapes.
4678 theShapes List of shapes to put in compound.
4679 theName Object name; when specified, this parameter is used
4680 for result publication in the study. Otherwise, if automatic
4681 publication is switched on, default value is used for result name.
4684 New GEOM.GEOM_Object, containing the created compound.
4686 # Example: see GEOM_TestAll.py
4687 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
4688 RaiseIfFailed("MakeCompound", self.ShapesOp)
4689 self._autoPublish(anObj, theName, "compound")
4692 ## Create a solid (or solids) from the set of faces and/or shells.
4693 # @param theFacesOrShells List of faces and/or shells.
4694 # @param isIntersect If TRUE, forces performing intersections
4695 # between arguments; otherwise (default) intersection is not performed.
4696 # @param theName Object name; when specified, this parameter is used
4697 # for result publication in the study. Otherwise, if automatic
4698 # publication is switched on, default value is used for result name.
4700 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4702 # @ref tui_creation_solid_from_faces "Example"
4703 @ManageTransactions("ShapesOp")
4704 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
4706 Create a solid (or solids) from the set of connected faces and/or shells.
4709 theFacesOrShells List of faces and/or shells.
4710 isIntersect If TRUE, forces performing intersections
4711 between arguments; otherwise (default) intersection is not performed
4712 theName Object name; when specified, this parameter is used.
4713 for result publication in the study. Otherwise, if automatic
4714 publication is switched on, default value is used for result name.
4717 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4719 # Example: see GEOM_TestAll.py
4720 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
4721 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
4722 self._autoPublish(anObj, theName, "solid")
4725 # end of l3_advanced
4728 ## @addtogroup l2_measure
4731 ## Gives quantity of faces in the given shape.
4732 # @param theShape Shape to count faces of.
4733 # @return Quantity of faces.
4735 # @ref swig_NumberOf "Example"
4736 @ManageTransactions("ShapesOp")
4737 def NumberOfFaces(self, theShape):
4739 Gives quantity of faces in the given shape.
4742 theShape Shape to count faces of.
4747 # Example: see GEOM_TestOthers.py
4748 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4749 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4752 ## Gives quantity of edges in the given shape.
4753 # @param theShape Shape to count edges of.
4754 # @return Quantity of edges.
4756 # @ref swig_NumberOf "Example"
4757 @ManageTransactions("ShapesOp")
4758 def NumberOfEdges(self, theShape):
4760 Gives quantity of edges in the given shape.
4763 theShape Shape to count edges of.
4768 # Example: see GEOM_TestOthers.py
4769 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4770 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4773 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4774 # @param theShape Shape to count sub-shapes of.
4775 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4776 # @return Quantity of sub-shapes of given type.
4778 # @ref swig_NumberOf "Example"
4779 @ManageTransactions("ShapesOp")
4780 def NumberOfSubShapes(self, theShape, theShapeType):
4782 Gives quantity of sub-shapes of type theShapeType in the given shape.
4785 theShape Shape to count sub-shapes of.
4786 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4789 Quantity of sub-shapes of given type.
4791 # Example: see GEOM_TestOthers.py
4792 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4793 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4796 ## Gives quantity of solids in the given shape.
4797 # @param theShape Shape to count solids in.
4798 # @return Quantity of solids.
4800 # @ref swig_NumberOf "Example"
4801 @ManageTransactions("ShapesOp")
4802 def NumberOfSolids(self, theShape):
4804 Gives quantity of solids in the given shape.
4807 theShape Shape to count solids in.
4812 # Example: see GEOM_TestOthers.py
4813 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4814 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4820 ## @addtogroup l3_healing
4823 ## Reverses an orientation the given shape.
4824 # @param theShape Shape to be reversed.
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 The reversed copy of theShape.
4831 # @ref swig_ChangeOrientation "Example"
4832 @ManageTransactions("ShapesOp")
4833 def ChangeOrientation(self, theShape, theName=None):
4835 Reverses an orientation the given shape.
4838 theShape Shape to be reversed.
4839 theName Object name; when specified, this parameter is used
4840 for result publication in the study. Otherwise, if automatic
4841 publication is switched on, default value is used for result name.
4844 The reversed copy of theShape.
4846 # Example: see GEOM_TestAll.py
4847 anObj = self.ShapesOp.ChangeOrientation(theShape)
4848 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4849 self._autoPublish(anObj, theName, "reversed")
4852 ## See ChangeOrientation() method for details.
4854 # @ref swig_OrientationChange "Example"
4855 def OrientationChange(self, theShape, theName=None):
4857 See geompy.ChangeOrientation method for details.
4859 # Example: see GEOM_TestOthers.py
4860 # note: auto-publishing is done in self.ChangeOrientation()
4861 anObj = self.ChangeOrientation(theShape, theName)
4867 ## @addtogroup l4_obtain
4870 ## Retrieve all free faces from the given shape.
4871 # Free face is a face, which is not shared between two shells of the shape.
4872 # @param theShape Shape to find free faces in.
4873 # @return List of IDs of all free faces, contained in theShape.
4875 # @ref tui_free_faces_page "Example"
4876 @ManageTransactions("ShapesOp")
4877 def GetFreeFacesIDs(self,theShape):
4879 Retrieve all free faces from the given shape.
4880 Free face is a face, which is not shared between two shells of the shape.
4883 theShape Shape to find free faces in.
4886 List of IDs of all free faces, contained in theShape.
4888 # Example: see GEOM_TestOthers.py
4889 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4890 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4893 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4894 # @param theShape1 Shape to find sub-shapes in.
4895 # @param theShape2 Shape to find shared sub-shapes with.
4896 # @param theShapeType Type of sub-shapes to be retrieved.
4897 # @param theName Object name; when specified, this parameter is used
4898 # for result publication in the study. Otherwise, if automatic
4899 # publication is switched on, default value is used for result name.
4901 # @return List of sub-shapes of theShape1, shared with theShape2.
4903 # @ref swig_GetSharedShapes "Example"
4904 @ManageTransactions("ShapesOp")
4905 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4907 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4910 theShape1 Shape to find sub-shapes in.
4911 theShape2 Shape to find shared sub-shapes with.
4912 theShapeType Type of sub-shapes to be retrieved.
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 sub-shapes of theShape1, shared with theShape2.
4920 # Example: see GEOM_TestOthers.py
4921 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4922 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4923 self._autoPublish(aList, theName, "shared")
4926 ## Get sub-shapes, shared by input shapes.
4927 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
4928 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
4929 # @param theMultiShare Specifies what type of shares should be checked:
4930 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
4931 # - @c False: causes to search sub-shapes shared between couples of input shapes.
4932 # @param theName Object name; when specified, this parameter is used
4933 # for result publication in the study. Otherwise, if automatic
4934 # publication is switched on, default value is used for result name.
4936 # @note If @a theShapes contains single compound, the shares between all possible couples of
4937 # its top-level shapes are returned; otherwise, only shares between 1st input shape
4938 # and all rest input shapes are returned.
4940 # @return List of all found sub-shapes.
4943 # - @ref tui_shared_shapes "Example 1"
4944 # - @ref swig_GetSharedShapes "Example 2"
4945 @ManageTransactions("ShapesOp")
4946 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
4948 Get sub-shapes, shared by input shapes.
4951 theShapes Either a list or compound of shapes to find common sub-shapes of.
4952 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
4953 theMultiShare Specifies what type of shares should be checked:
4954 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
4955 - False: causes to search sub-shapes shared between couples of input shapes.
4956 theName Object name; when specified, this parameter is used
4957 for result publication in the study. Otherwise, if automatic
4958 publication is switched on, default value is used for result name.
4960 Note: if theShapes contains single compound, the shares between all possible couples of
4961 its top-level shapes are returned; otherwise, only shares between 1st input shape
4962 and all rest input shapes are returned.
4965 List of all found sub-shapes.
4967 # Example: see GEOM_TestOthers.py
4968 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
4969 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4970 self._autoPublish(aList, theName, "shared")
4973 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4974 # situated relatively the specified plane by the certain way,
4975 # defined through <VAR>theState</VAR> parameter.
4976 # @param theShape Shape to find sub-shapes of.
4977 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4978 # @param theAx1 Vector (or line, or linear edge), specifying normal
4979 # direction and location of the plane to find shapes on.
4980 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4981 # @param theName Object name; when specified, this parameter is used
4982 # for result publication in the study. Otherwise, if automatic
4983 # publication is switched on, default value is used for result name.
4985 # @return List of all found sub-shapes.
4987 # @ref swig_GetShapesOnPlane "Example"
4988 @ManageTransactions("ShapesOp")
4989 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4991 Find in theShape all sub-shapes of type theShapeType,
4992 situated relatively the specified plane by the certain way,
4993 defined through theState parameter.
4996 theShape Shape to find sub-shapes of.
4997 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4998 theAx1 Vector (or line, or linear edge), specifying normal
4999 direction and location of the plane to find shapes on.
5000 theState The state of the sub-shapes to find (see GEOM::shape_state)
5001 theName Object name; when specified, this parameter is used
5002 for result publication in the study. Otherwise, if automatic
5003 publication is switched on, default value is used for result name.
5006 List of all found sub-shapes.
5008 # Example: see GEOM_TestOthers.py
5009 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5010 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5011 self._autoPublish(aList, theName, "shapeOnPlane")
5014 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5015 # situated relatively the specified plane by the certain way,
5016 # defined through <VAR>theState</VAR> parameter.
5017 # @param theShape Shape to find sub-shapes of.
5018 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5019 # @param theAx1 Vector (or line, or linear edge), specifying normal
5020 # direction and location of the plane to find shapes on.
5021 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5023 # @return List of all found sub-shapes indices.
5025 # @ref swig_GetShapesOnPlaneIDs "Example"
5026 @ManageTransactions("ShapesOp")
5027 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5029 Find in theShape all sub-shapes of type theShapeType,
5030 situated relatively the specified plane by the certain way,
5031 defined through theState parameter.
5034 theShape Shape to find sub-shapes of.
5035 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5036 theAx1 Vector (or line, or linear edge), specifying normal
5037 direction and location of the plane to find shapes on.
5038 theState The state of the sub-shapes to find (see GEOM::shape_state)
5041 List of all found sub-shapes indices.
5043 # Example: see GEOM_TestOthers.py
5044 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5045 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5048 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5049 # situated relatively the specified plane by the certain way,
5050 # defined through <VAR>theState</VAR> parameter.
5051 # @param theShape Shape to find sub-shapes of.
5052 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5053 # @param theAx1 Vector (or line, or linear edge), specifying normal
5054 # direction of the plane to find shapes on.
5055 # @param thePnt Point specifying location of the plane to find shapes on.
5056 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5057 # @param theName Object name; when specified, this parameter is used
5058 # for result publication in the study. Otherwise, if automatic
5059 # publication is switched on, default value is used for result name.
5061 # @return List of all found sub-shapes.
5063 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5064 @ManageTransactions("ShapesOp")
5065 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5067 Find in theShape all sub-shapes of type theShapeType,
5068 situated relatively the specified plane by the certain way,
5069 defined through theState parameter.
5072 theShape Shape to find sub-shapes of.
5073 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5074 theAx1 Vector (or line, or linear edge), specifying normal
5075 direction and location of the plane to find shapes on.
5076 thePnt Point specifying location of the plane to find shapes on.
5077 theState The state of the sub-shapes to find (see GEOM::shape_state)
5078 theName Object name; when specified, this parameter is used
5079 for result publication in the study. Otherwise, if automatic
5080 publication is switched on, default value is used for result name.
5083 List of all found sub-shapes.
5085 # Example: see GEOM_TestOthers.py
5086 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5087 theAx1, thePnt, theState)
5088 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5089 self._autoPublish(aList, theName, "shapeOnPlane")
5092 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5093 # situated relatively the specified plane by the certain way,
5094 # defined through <VAR>theState</VAR> parameter.
5095 # @param theShape Shape to find sub-shapes of.
5096 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5097 # @param theAx1 Vector (or line, or linear edge), specifying normal
5098 # direction of the plane to find shapes on.
5099 # @param thePnt Point specifying location of the plane to find shapes on.
5100 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5102 # @return List of all found sub-shapes indices.
5104 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5105 @ManageTransactions("ShapesOp")
5106 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5108 Find in theShape all sub-shapes of type theShapeType,
5109 situated relatively the specified plane by the certain way,
5110 defined through theState parameter.
5113 theShape Shape to find sub-shapes of.
5114 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5115 theAx1 Vector (or line, or linear edge), specifying normal
5116 direction and location of the plane to find shapes on.
5117 thePnt Point specifying location of the plane to find shapes on.
5118 theState The state of the sub-shapes to find (see GEOM::shape_state)
5121 List of all found sub-shapes indices.
5123 # Example: see GEOM_TestOthers.py
5124 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5125 theAx1, thePnt, theState)
5126 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5129 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5130 # the specified cylinder by the certain way, defined through \a theState parameter.
5131 # @param theShape Shape to find sub-shapes of.
5132 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5133 # @param theAxis Vector (or line, or linear edge), specifying
5134 # axis of the cylinder to find shapes on.
5135 # @param theRadius Radius of the cylinder to find shapes on.
5136 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5137 # @param theName Object name; when specified, this parameter is used
5138 # for result publication in the study. Otherwise, if automatic
5139 # publication is switched on, default value is used for result name.
5141 # @return List of all found sub-shapes.
5143 # @ref swig_GetShapesOnCylinder "Example"
5144 @ManageTransactions("ShapesOp")
5145 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5147 Find in theShape all sub-shapes of type theShapeType, situated relatively
5148 the specified cylinder by the certain way, defined through theState parameter.
5151 theShape Shape to find sub-shapes of.
5152 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5153 theAxis Vector (or line, or linear edge), specifying
5154 axis of the cylinder to find shapes on.
5155 theRadius Radius of the cylinder to find shapes on.
5156 theState The state of the sub-shapes to find (see GEOM::shape_state)
5157 theName Object name; when specified, this parameter is used
5158 for result publication in the study. Otherwise, if automatic
5159 publication is switched on, default value is used for result name.
5162 List of all found sub-shapes.
5164 # Example: see GEOM_TestOthers.py
5165 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5166 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5167 self._autoPublish(aList, theName, "shapeOnCylinder")
5170 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5171 # the specified cylinder by the certain way, defined through \a theState parameter.
5172 # @param theShape Shape to find sub-shapes of.
5173 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5174 # @param theAxis Vector (or line, or linear edge), specifying
5175 # axis of the cylinder to find shapes on.
5176 # @param theRadius Radius of the cylinder to find shapes on.
5177 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5179 # @return List of all found sub-shapes indices.
5181 # @ref swig_GetShapesOnCylinderIDs "Example"
5182 @ManageTransactions("ShapesOp")
5183 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5185 Find in theShape all sub-shapes of type theShapeType, situated relatively
5186 the specified cylinder by the certain way, defined through theState parameter.
5189 theShape Shape to find sub-shapes of.
5190 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5191 theAxis Vector (or line, or linear edge), specifying
5192 axis of the cylinder to find shapes on.
5193 theRadius Radius of the cylinder to find shapes on.
5194 theState The state of the sub-shapes to find (see GEOM::shape_state)
5197 List of all found sub-shapes indices.
5199 # Example: see GEOM_TestOthers.py
5200 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5201 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5204 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5205 # the specified cylinder by the certain way, defined through \a theState parameter.
5206 # @param theShape Shape to find sub-shapes of.
5207 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5208 # @param theAxis Vector (or line, or linear edge), specifying
5209 # axis of the cylinder to find shapes on.
5210 # @param thePnt Point specifying location of the bottom of the cylinder.
5211 # @param theRadius Radius of the cylinder to find shapes on.
5212 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5213 # @param theName Object name; when specified, this parameter is used
5214 # for result publication in the study. Otherwise, if automatic
5215 # publication is switched on, default value is used for result name.
5217 # @return List of all found sub-shapes.
5219 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5220 @ManageTransactions("ShapesOp")
5221 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5223 Find in theShape all sub-shapes of type theShapeType, situated relatively
5224 the specified cylinder by the certain way, defined through theState parameter.
5227 theShape Shape to find sub-shapes of.
5228 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5229 theAxis Vector (or line, or linear edge), specifying
5230 axis of the cylinder to find shapes on.
5231 theRadius Radius of the cylinder to find shapes on.
5232 theState The state of the sub-shapes to find (see GEOM::shape_state)
5233 theName Object name; when specified, this parameter is used
5234 for result publication in the study. Otherwise, if automatic
5235 publication is switched on, default value is used for result name.
5238 List of all found sub-shapes.
5240 # Example: see GEOM_TestOthers.py
5241 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5242 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5243 self._autoPublish(aList, theName, "shapeOnCylinder")
5246 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5247 # the specified cylinder by the certain way, defined through \a theState parameter.
5248 # @param theShape Shape to find sub-shapes of.
5249 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5250 # @param theAxis Vector (or line, or linear edge), specifying
5251 # axis of the cylinder to find shapes on.
5252 # @param thePnt Point specifying location of the bottom of the cylinder.
5253 # @param theRadius Radius of the cylinder to find shapes on.
5254 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5256 # @return List of all found sub-shapes indices
5258 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5259 @ManageTransactions("ShapesOp")
5260 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5262 Find in theShape all sub-shapes of type theShapeType, situated relatively
5263 the specified cylinder by the certain way, defined through theState parameter.
5266 theShape Shape to find sub-shapes of.
5267 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5268 theAxis Vector (or line, or linear edge), specifying
5269 axis of the cylinder to find shapes on.
5270 theRadius Radius of the cylinder to find shapes on.
5271 theState The state of the sub-shapes to find (see GEOM::shape_state)
5274 List of all found sub-shapes indices.
5276 # Example: see GEOM_TestOthers.py
5277 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5278 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5281 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5282 # the specified sphere by the certain way, defined through \a theState parameter.
5283 # @param theShape Shape to find sub-shapes of.
5284 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5285 # @param theCenter Point, specifying center of the sphere to find shapes on.
5286 # @param theRadius Radius of the sphere to find shapes on.
5287 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5288 # @param theName Object name; when specified, this parameter is used
5289 # for result publication in the study. Otherwise, if automatic
5290 # publication is switched on, default value is used for result name.
5292 # @return List of all found sub-shapes.
5294 # @ref swig_GetShapesOnSphere "Example"
5295 @ManageTransactions("ShapesOp")
5296 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5298 Find in theShape all sub-shapes of type theShapeType, situated relatively
5299 the specified sphere by the certain way, defined through theState parameter.
5302 theShape Shape to find sub-shapes of.
5303 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5304 theCenter Point, specifying center of the sphere to find shapes on.
5305 theRadius Radius of the sphere to find shapes on.
5306 theState The state of the sub-shapes to find (see GEOM::shape_state)
5307 theName Object name; when specified, this parameter is used
5308 for result publication in the study. Otherwise, if automatic
5309 publication is switched on, default value is used for result name.
5312 List of all found sub-shapes.
5314 # Example: see GEOM_TestOthers.py
5315 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5316 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5317 self._autoPublish(aList, theName, "shapeOnSphere")
5320 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5321 # the specified sphere by the certain way, defined through \a theState parameter.
5322 # @param theShape Shape to find sub-shapes of.
5323 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5324 # @param theCenter Point, specifying center of the sphere to find shapes on.
5325 # @param theRadius Radius of the sphere to find shapes on.
5326 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5328 # @return List of all found sub-shapes indices.
5330 # @ref swig_GetShapesOnSphereIDs "Example"
5331 @ManageTransactions("ShapesOp")
5332 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5334 Find in theShape all sub-shapes of type theShapeType, situated relatively
5335 the specified sphere by the certain way, defined through theState parameter.
5338 theShape Shape to find sub-shapes of.
5339 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5340 theCenter Point, specifying center of the sphere to find shapes on.
5341 theRadius Radius of the sphere to find shapes on.
5342 theState The state of the sub-shapes to find (see GEOM::shape_state)
5345 List of all found sub-shapes indices.
5347 # Example: see GEOM_TestOthers.py
5348 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5349 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5352 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5353 # the specified quadrangle by the certain way, defined through \a theState parameter.
5354 # @param theShape Shape to find sub-shapes of.
5355 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5356 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5357 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5358 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5359 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5360 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5361 # @param theName Object name; when specified, this parameter is used
5362 # for result publication in the study. Otherwise, if automatic
5363 # publication is switched on, default value is used for result name.
5365 # @return List of all found sub-shapes.
5367 # @ref swig_GetShapesOnQuadrangle "Example"
5368 @ManageTransactions("ShapesOp")
5369 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5370 theTopLeftPoint, theTopRigthPoint,
5371 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5373 Find in theShape all sub-shapes of type theShapeType, situated relatively
5374 the specified quadrangle by the certain way, defined through theState parameter.
5377 theShape Shape to find sub-shapes of.
5378 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5379 theTopLeftPoint Point, specifying top left corner of a quadrangle
5380 theTopRigthPoint Point, specifying top right corner of a quadrangle
5381 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5382 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5383 theState The state of the sub-shapes to find (see GEOM::shape_state)
5384 theName Object name; when specified, this parameter is used
5385 for result publication in the study. Otherwise, if automatic
5386 publication is switched on, default value is used for result name.
5389 List of all found sub-shapes.
5391 # Example: see GEOM_TestOthers.py
5392 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5393 theTopLeftPoint, theTopRigthPoint,
5394 theBottomLeftPoint, theBottomRigthPoint, theState)
5395 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5396 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5399 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5400 # the specified quadrangle by the certain way, defined through \a theState parameter.
5401 # @param theShape Shape to find sub-shapes of.
5402 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5403 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5404 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5405 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5406 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5407 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5409 # @return List of all found sub-shapes indices.
5411 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5412 @ManageTransactions("ShapesOp")
5413 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5414 theTopLeftPoint, theTopRigthPoint,
5415 theBottomLeftPoint, theBottomRigthPoint, theState):
5417 Find in theShape all sub-shapes of type theShapeType, situated relatively
5418 the specified quadrangle by the certain way, defined through theState parameter.
5421 theShape Shape to find sub-shapes of.
5422 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5423 theTopLeftPoint Point, specifying top left corner of a quadrangle
5424 theTopRigthPoint Point, specifying top right corner of a quadrangle
5425 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5426 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5427 theState The state of the sub-shapes to find (see GEOM::shape_state)
5430 List of all found sub-shapes indices.
5433 # Example: see GEOM_TestOthers.py
5434 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5435 theTopLeftPoint, theTopRigthPoint,
5436 theBottomLeftPoint, theBottomRigthPoint, theState)
5437 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5440 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5441 # the specified \a theBox by the certain way, defined through \a theState parameter.
5442 # @param theBox Shape for relative comparing.
5443 # @param theShape Shape to find sub-shapes of.
5444 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5445 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5446 # @param theName Object name; when specified, this parameter is used
5447 # for result publication in the study. Otherwise, if automatic
5448 # publication is switched on, default value is used for result name.
5450 # @return List of all found sub-shapes.
5452 # @ref swig_GetShapesOnBox "Example"
5453 @ManageTransactions("ShapesOp")
5454 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5456 Find in theShape all sub-shapes of type theShapeType, situated relatively
5457 the specified theBox by the certain way, defined through theState parameter.
5460 theBox Shape for relative comparing.
5461 theShape Shape to find sub-shapes of.
5462 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5463 theState The state of the sub-shapes to find (see GEOM::shape_state)
5464 theName Object name; when specified, this parameter is used
5465 for result publication in the study. Otherwise, if automatic
5466 publication is switched on, default value is used for result name.
5469 List of all found sub-shapes.
5471 # Example: see GEOM_TestOthers.py
5472 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5473 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5474 self._autoPublish(aList, theName, "shapeOnBox")
5477 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5478 # the specified \a theBox by the certain way, defined through \a theState parameter.
5479 # @param theBox Shape for relative comparing.
5480 # @param theShape Shape to find sub-shapes of.
5481 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5482 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5484 # @return List of all found sub-shapes indices.
5486 # @ref swig_GetShapesOnBoxIDs "Example"
5487 @ManageTransactions("ShapesOp")
5488 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5490 Find in theShape all sub-shapes of type theShapeType, situated relatively
5491 the specified theBox by the certain way, defined through theState parameter.
5494 theBox Shape for relative comparing.
5495 theShape Shape to find sub-shapes of.
5496 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5497 theState The state of the sub-shapes to find (see GEOM::shape_state)
5500 List of all found sub-shapes indices.
5502 # Example: see GEOM_TestOthers.py
5503 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5504 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5507 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5508 # situated relatively the specified \a theCheckShape by the
5509 # certain way, defined through \a theState parameter.
5510 # @param theCheckShape Shape for relative comparing. It must be a solid.
5511 # @param theShape Shape to find sub-shapes of.
5512 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5513 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5514 # @param theName Object name; when specified, this parameter is used
5515 # for result publication in the study. Otherwise, if automatic
5516 # publication is switched on, default value is used for result name.
5518 # @return List of all found sub-shapes.
5520 # @ref swig_GetShapesOnShape "Example"
5521 @ManageTransactions("ShapesOp")
5522 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5524 Find in theShape all sub-shapes of type theShapeType,
5525 situated relatively the specified theCheckShape by the
5526 certain way, defined through theState parameter.
5529 theCheckShape Shape for relative comparing. It must be a solid.
5530 theShape Shape to find sub-shapes of.
5531 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5532 theState The state of the sub-shapes to find (see GEOM::shape_state)
5533 theName Object name; when specified, this parameter is used
5534 for result publication in the study. Otherwise, if automatic
5535 publication is switched on, default value is used for result name.
5538 List of all found sub-shapes.
5540 # Example: see GEOM_TestOthers.py
5541 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5542 theShapeType, theState)
5543 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5544 self._autoPublish(aList, theName, "shapeOnShape")
5547 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5548 # situated relatively the specified \a theCheckShape by the
5549 # certain way, defined through \a theState parameter.
5550 # @param theCheckShape Shape for relative comparing. It must be a solid.
5551 # @param theShape Shape to find sub-shapes of.
5552 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5553 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5554 # @param theName Object name; when specified, this parameter is used
5555 # for result publication in the study. Otherwise, if automatic
5556 # publication is switched on, default value is used for result name.
5558 # @return All found sub-shapes as compound.
5560 # @ref swig_GetShapesOnShapeAsCompound "Example"
5561 @ManageTransactions("ShapesOp")
5562 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5564 Find in theShape all sub-shapes of type theShapeType,
5565 situated relatively the specified theCheckShape by the
5566 certain way, defined through theState parameter.
5569 theCheckShape Shape for relative comparing. It must be a solid.
5570 theShape Shape to find sub-shapes of.
5571 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5572 theState The state of the sub-shapes to find (see GEOM::shape_state)
5573 theName Object name; when specified, this parameter is used
5574 for result publication in the study. Otherwise, if automatic
5575 publication is switched on, default value is used for result name.
5578 All found sub-shapes as compound.
5580 # Example: see GEOM_TestOthers.py
5581 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5582 theShapeType, theState)
5583 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5584 self._autoPublish(anObj, theName, "shapeOnShape")
5587 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5588 # situated relatively the specified \a theCheckShape by the
5589 # certain way, defined through \a theState parameter.
5590 # @param theCheckShape Shape for relative comparing. It must be a solid.
5591 # @param theShape Shape to find sub-shapes of.
5592 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5593 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5595 # @return List of all found sub-shapes indices.
5597 # @ref swig_GetShapesOnShapeIDs "Example"
5598 @ManageTransactions("ShapesOp")
5599 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5601 Find in theShape all sub-shapes of type theShapeType,
5602 situated relatively the specified theCheckShape by the
5603 certain way, defined through theState parameter.
5606 theCheckShape Shape for relative comparing. It must be a solid.
5607 theShape Shape to find sub-shapes of.
5608 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5609 theState The state of the sub-shapes to find (see GEOM::shape_state)
5612 List of all found sub-shapes indices.
5614 # Example: see GEOM_TestOthers.py
5615 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5616 theShapeType, theState)
5617 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5620 ## Get sub-shape(s) of theShapeWhere, which are
5621 # coincident with \a theShapeWhat or could be a part of it.
5622 # @param theShapeWhere Shape to find sub-shapes of.
5623 # @param theShapeWhat Shape, specifying what to find.
5624 # @param isNewImplementation implementation of GetInPlace functionality
5625 # (default = False, old alghorithm based on shape properties)
5626 # @param theName Object name; when specified, this parameter is used
5627 # for result publication in the study. Otherwise, if automatic
5628 # publication is switched on, default value is used for result name.
5630 # @return Group of all found sub-shapes or a single found sub-shape.
5632 # @note This function has a restriction on argument shapes.
5633 # If \a theShapeWhere has curved parts with significantly
5634 # outstanding centres (i.e. the mass centre of a part is closer to
5635 # \a theShapeWhat than to the part), such parts will not be found.
5636 # @image html get_in_place_lost_part.png
5638 # @ref swig_GetInPlace "Example"
5639 @ManageTransactions("ShapesOp")
5640 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5642 Get sub-shape(s) of theShapeWhere, which are
5643 coincident with theShapeWhat or could be a part of it.
5646 theShapeWhere Shape to find sub-shapes of.
5647 theShapeWhat Shape, specifying what to find.
5648 isNewImplementation Implementation of GetInPlace functionality
5649 (default = False, old alghorithm based on shape properties)
5650 theName Object name; when specified, this parameter is used
5651 for result publication in the study. Otherwise, if automatic
5652 publication is switched on, default value is used for result name.
5655 Group of all found sub-shapes or a single found sub-shape.
5659 This function has a restriction on argument shapes.
5660 If theShapeWhere has curved parts with significantly
5661 outstanding centres (i.e. the mass centre of a part is closer to
5662 theShapeWhat than to the part), such parts will not be found.
5664 # Example: see GEOM_TestOthers.py
5666 if isNewImplementation:
5667 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5669 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5671 RaiseIfFailed("GetInPlace", self.ShapesOp)
5672 self._autoPublish(anObj, theName, "inplace")
5675 ## Get sub-shape(s) of \a theShapeWhere, which are
5676 # coincident with \a theShapeWhat or could be a part of it.
5678 # Implementation of this method is based on a saved history of an operation,
5679 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5680 # arguments (an argument shape or a sub-shape of an argument shape).
5681 # The operation could be the Partition or one of boolean operations,
5682 # performed on simple shapes (not on compounds).
5684 # @param theShapeWhere Shape to find sub-shapes of.
5685 # @param theShapeWhat Shape, specifying what to find (must be in the
5686 # building history of the ShapeWhere).
5687 # @param theName Object name; when specified, this parameter is used
5688 # for result publication in the study. Otherwise, if automatic
5689 # publication is switched on, default value is used for result name.
5691 # @return Group of all found sub-shapes or a single found sub-shape.
5693 # @ref swig_GetInPlace "Example"
5694 @ManageTransactions("ShapesOp")
5695 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5697 Implementation of this method is based on a saved history of an operation,
5698 produced theShapeWhere. The theShapeWhat must be among this operation's
5699 arguments (an argument shape or a sub-shape of an argument shape).
5700 The operation could be the Partition or one of boolean operations,
5701 performed on simple shapes (not on compounds).
5704 theShapeWhere Shape to find sub-shapes of.
5705 theShapeWhat Shape, specifying what to find (must be in the
5706 building history of the ShapeWhere).
5707 theName Object name; when specified, this parameter is used
5708 for result publication in the study. Otherwise, if automatic
5709 publication is switched on, default value is used for result name.
5712 Group of all found sub-shapes or a single found sub-shape.
5714 # Example: see GEOM_TestOthers.py
5715 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5716 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5717 self._autoPublish(anObj, theName, "inplace")
5720 ## Get sub-shape of theShapeWhere, which is
5721 # equal to \a theShapeWhat.
5722 # @param theShapeWhere Shape to find sub-shape of.
5723 # @param theShapeWhat Shape, specifying what to find.
5724 # @param theName Object name; when specified, this parameter is used
5725 # for result publication in the study. Otherwise, if automatic
5726 # publication is switched on, default value is used for result name.
5728 # @return New GEOM.GEOM_Object for found sub-shape.
5730 # @ref swig_GetSame "Example"
5731 @ManageTransactions("ShapesOp")
5732 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5734 Get sub-shape of theShapeWhere, which is
5735 equal to theShapeWhat.
5738 theShapeWhere Shape to find sub-shape of.
5739 theShapeWhat Shape, specifying what to find.
5740 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.
5745 New GEOM.GEOM_Object for found sub-shape.
5747 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5748 RaiseIfFailed("GetSame", self.ShapesOp)
5749 self._autoPublish(anObj, theName, "sameShape")
5753 ## Get sub-shape indices of theShapeWhere, which is
5754 # equal to \a theShapeWhat.
5755 # @param theShapeWhere Shape to find sub-shape of.
5756 # @param theShapeWhat Shape, specifying what to find.
5757 # @return List of all found sub-shapes indices.
5759 # @ref swig_GetSame "Example"
5760 @ManageTransactions("ShapesOp")
5761 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5763 Get sub-shape indices of theShapeWhere, which is
5764 equal to theShapeWhat.
5767 theShapeWhere Shape to find sub-shape of.
5768 theShapeWhat Shape, specifying what to find.
5771 List of all found sub-shapes indices.
5773 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5774 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5777 ## Resize the input edge with the new Min and Max parameters.
5778 # The input edge parameters range is [0, 1]. If theMin parameter is
5779 # negative, the input edge is extended, otherwise it is shrinked by
5780 # theMin parameter. If theMax is greater than 1, the edge is extended,
5781 # otherwise it is shrinked by theMax parameter.
5782 # @param theEdge the input edge to be resized.
5783 # @param theMin the minimal parameter value.
5784 # @param theMax the maximal parameter value.
5785 # @param theName Object name; when specified, this parameter is used
5786 # for result publication in the study. Otherwise, if automatic
5787 # publication is switched on, default value is used for result name.
5788 # @return New GEOM.GEOM_Object, containing the created edge.
5790 # @ref tui_extend "Example"
5791 @ManageTransactions("ShapesOp")
5792 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
5794 Resize the input edge with the new Min and Max parameters.
5795 The input edge parameters range is [0, 1]. If theMin parameter is
5796 negative, the input edge is extended, otherwise it is shrinked by
5797 theMin parameter. If theMax is greater than 1, the edge is extended,
5798 otherwise it is shrinked by theMax parameter.
5801 theEdge the input edge to be resized.
5802 theMin the minimal parameter value.
5803 theMax the maximal parameter value.
5804 theName Object name; when specified, this parameter is used
5805 for result publication in the study. Otherwise, if automatic
5806 publication is switched on, default value is used for result name.
5809 New GEOM.GEOM_Object, containing the created edge.
5811 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
5812 RaiseIfFailed("ExtendEdge", self.ShapesOp)
5813 self._autoPublish(anObj, theName, "edge")
5816 ## Resize the input face with the new UMin, UMax, VMin and VMax
5817 # parameters. The input face U and V parameters range is [0, 1]. If
5818 # theUMin parameter is negative, the input face is extended, otherwise
5819 # it is shrinked along U direction by theUMin parameter. If theUMax is
5820 # greater than 1, the face is extended, otherwise it is shrinked along
5821 # U direction by theUMax parameter. So as for theVMin, theVMax and
5822 # V direction of the input face.
5823 # @param theFace the input face to be resized.
5824 # @param theUMin the minimal U parameter value.
5825 # @param theUMax the maximal U parameter value.
5826 # @param theVMin the minimal V parameter value.
5827 # @param theVMax the maximal V parameter value.
5828 # @param theName Object name; when specified, this parameter is used
5829 # for result publication in the study. Otherwise, if automatic
5830 # publication is switched on, default value is used for result name.
5831 # @return New GEOM.GEOM_Object, containing the created face.
5833 # @ref tui_extend "Example"
5834 @ManageTransactions("ShapesOp")
5835 def ExtendFace(self, theFace, theUMin, theUMax,
5836 theVMin, theVMax, theName=None):
5838 Resize the input face with the new UMin, UMax, VMin and VMax
5839 parameters. The input face U and V parameters range is [0, 1]. If
5840 theUMin parameter is negative, the input face is extended, otherwise
5841 it is shrinked along U direction by theUMin parameter. If theUMax is
5842 greater than 1, the face is extended, otherwise it is shrinked along
5843 U direction by theUMax parameter. So as for theVMin, theVMax and
5844 V direction of the input face.
5847 theFace the input face to be resized.
5848 theUMin the minimal U parameter value.
5849 theUMax the maximal U parameter value.
5850 theVMin the minimal V parameter value.
5851 theVMax the maximal V parameter value.
5852 theName Object name; when specified, this parameter is used
5853 for result publication in the study. Otherwise, if automatic
5854 publication is switched on, default value is used for result name.
5857 New GEOM.GEOM_Object, containing the created face.
5859 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
5861 RaiseIfFailed("ExtendFace", self.ShapesOp)
5862 self._autoPublish(anObj, theName, "face")
5865 ## This function takes some face as input parameter and creates new
5866 # GEOM_Object, i.e. topological shape by extracting underlying surface
5867 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
5868 # parameters of the source face (in the parametrical space).
5869 # @param theFace the input face.
5870 # @param theName Object name; when specified, this parameter is used
5871 # for result publication in the study. Otherwise, if automatic
5872 # publication is switched on, default value is used for result name.
5873 # @return New GEOM.GEOM_Object, containing the created face.
5875 # @ref tui_creation_surface "Example"
5876 @ManageTransactions("ShapesOp")
5877 def MakeSurfaceFromFace(self, theFace, theName=None):
5879 This function takes some face as input parameter and creates new
5880 GEOM_Object, i.e. topological shape by extracting underlying surface
5881 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
5882 parameters of the source face (in the parametrical space).
5885 theFace the input face.
5886 theName Object name; when specified, this parameter is used
5887 for result publication in the study. Otherwise, if automatic
5888 publication is switched on, default value is used for result name.
5891 New GEOM.GEOM_Object, containing the created face.
5893 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
5894 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
5895 self._autoPublish(anObj, theName, "surface")
5901 ## @addtogroup l4_access
5904 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5905 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5906 # @param aShape Shape to get sub-shape of.
5907 # @param ListOfID List of sub-shapes indices.
5908 # @param theName Object name; when specified, this parameter is used
5909 # for result publication in the study. Otherwise, if automatic
5910 # publication is switched on, default value is used for result name.
5912 # @return Found sub-shape.
5914 # @ref swig_all_decompose "Example"
5915 def GetSubShape(self, aShape, ListOfID, theName=None):
5917 Obtain a composite sub-shape of aShape, composed from sub-shapes
5918 of aShape, selected by their unique IDs inside aShape
5921 aShape Shape to get sub-shape of.
5922 ListOfID List of sub-shapes indices.
5923 theName Object name; when specified, this parameter is used
5924 for result publication in the study. Otherwise, if automatic
5925 publication is switched on, default value is used for result name.
5930 # Example: see GEOM_TestAll.py
5931 anObj = self.AddSubShape(aShape,ListOfID)
5932 self._autoPublish(anObj, theName, "subshape")
5935 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5936 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5937 # @param aShape Shape to get sub-shape of.
5938 # @param aSubShape Sub-shapes of aShape.
5939 # @return ID of found sub-shape.
5941 # @ref swig_all_decompose "Example"
5942 @ManageTransactions("LocalOp")
5943 def GetSubShapeID(self, aShape, aSubShape):
5945 Obtain unique ID of sub-shape aSubShape inside aShape
5946 of aShape, selected by their unique IDs inside aShape
5949 aShape Shape to get sub-shape of.
5950 aSubShape Sub-shapes of aShape.
5953 ID of found sub-shape.
5955 # Example: see GEOM_TestAll.py
5956 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5957 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5960 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5961 # This function is provided for performance purpose. The complexity is O(n) with n
5962 # the number of subobjects of aShape
5963 # @param aShape Shape to get sub-shape of.
5964 # @param aSubShapes Sub-shapes of aShape.
5965 # @return list of IDs of found sub-shapes.
5967 # @ref swig_all_decompose "Example"
5968 @ManageTransactions("ShapesOp")
5969 def GetSubShapesIDs(self, aShape, aSubShapes):
5971 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5972 This function is provided for performance purpose. The complexity is O(n) with n
5973 the number of subobjects of aShape
5976 aShape Shape to get sub-shape of.
5977 aSubShapes Sub-shapes of aShape.
5980 List of IDs of found sub-shape.
5982 # Example: see GEOM_TestAll.py
5983 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5984 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5990 ## @addtogroup l4_decompose
5993 ## Get all sub-shapes and groups of \a theShape,
5994 # that were created already by any other methods.
5995 # @param theShape Any shape.
5996 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5997 # returned, else all found sub-shapes and groups.
5998 # @return List of existing sub-objects of \a theShape.
6000 # @ref swig_all_decompose "Example"
6001 @ManageTransactions("ShapesOp")
6002 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6004 Get all sub-shapes and groups of theShape,
6005 that were created already by any other methods.
6009 theGroupsOnly If this parameter is TRUE, only groups will be
6010 returned, else all found sub-shapes and groups.
6013 List of existing sub-objects of theShape.
6015 # Example: see GEOM_TestAll.py
6016 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6017 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6020 ## Get all groups of \a theShape,
6021 # that were created already by any other methods.
6022 # @param theShape Any shape.
6023 # @return List of existing groups of \a theShape.
6025 # @ref swig_all_decompose "Example"
6026 @ManageTransactions("ShapesOp")
6027 def GetGroups(self, theShape):
6029 Get all groups of theShape,
6030 that were created already by any other methods.
6036 List of existing groups of theShape.
6038 # Example: see GEOM_TestAll.py
6039 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6040 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6043 ## Explode a shape on sub-shapes of a given type.
6044 # If the shape itself matches the type, it is also returned.
6045 # @param aShape Shape to be exploded.
6046 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6047 # @param theName Object name; when specified, this parameter is used
6048 # for result publication in the study. Otherwise, if automatic
6049 # publication is switched on, default value is used for result name.
6051 # @return List of sub-shapes of type theShapeType, contained in theShape.
6053 # @ref swig_all_decompose "Example"
6054 @ManageTransactions("ShapesOp")
6055 def SubShapeAll(self, aShape, aType, theName=None):
6057 Explode a shape on sub-shapes of a given type.
6058 If the shape itself matches the type, it is also returned.
6061 aShape Shape to be exploded.
6062 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6063 theName Object name; when specified, this parameter is used
6064 for result publication in the study. Otherwise, if automatic
6065 publication is switched on, default value is used for result name.
6068 List of sub-shapes of type theShapeType, contained in theShape.
6070 # Example: see GEOM_TestAll.py
6071 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6072 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6073 self._autoPublish(ListObj, theName, "subshape")
6076 ## Explode a shape on sub-shapes of a given type.
6077 # @param aShape Shape to be exploded.
6078 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6079 # @return List of IDs of sub-shapes.
6081 # @ref swig_all_decompose "Example"
6082 @ManageTransactions("ShapesOp")
6083 def SubShapeAllIDs(self, aShape, aType):
6085 Explode a shape on sub-shapes of a given type.
6088 aShape Shape to be exploded (see geompy.ShapeType)
6089 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6092 List of IDs of sub-shapes.
6094 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6095 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6098 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6099 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6100 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6101 # @param aShape Shape to get sub-shape of.
6102 # @param ListOfInd List of sub-shapes indices.
6103 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6104 # @param theName Object name; when specified, this parameter is used
6105 # for result publication in the study. Otherwise, if automatic
6106 # publication is switched on, default value is used for result name.
6108 # @return A compound of sub-shapes of aShape.
6110 # @ref swig_all_decompose "Example"
6111 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6113 Obtain a compound of sub-shapes of aShape,
6114 selected by their indices in list of all sub-shapes of type aType.
6115 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6118 aShape Shape to get sub-shape of.
6119 ListOfID List of sub-shapes indices.
6120 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6121 theName Object name; when specified, this parameter is used
6122 for result publication in the study. Otherwise, if automatic
6123 publication is switched on, default value is used for result name.
6126 A compound of sub-shapes of aShape.
6128 # Example: see GEOM_TestAll.py
6130 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6131 for ind in ListOfInd:
6132 ListOfIDs.append(AllShapeIDsList[ind - 1])
6133 # note: auto-publishing is done in self.GetSubShape()
6134 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6137 ## Explode a shape on sub-shapes of a given type.
6138 # Sub-shapes will be sorted taking into account their gravity centers,
6139 # to provide stable order of sub-shapes.
6140 # If the shape itself matches the type, it is also returned.
6141 # @param aShape Shape to be exploded.
6142 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6143 # @param theName Object name; when specified, this parameter is used
6144 # for result publication in the study. Otherwise, if automatic
6145 # publication is switched on, default value is used for result name.
6147 # @return List of sub-shapes of type theShapeType, contained in theShape.
6149 # @ref swig_SubShapeAllSorted "Example"
6150 @ManageTransactions("ShapesOp")
6151 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6153 Explode a shape on sub-shapes of a given type.
6154 Sub-shapes will be sorted taking into account their gravity centers,
6155 to provide stable order of sub-shapes.
6156 If the shape itself matches the type, it is also returned.
6159 aShape Shape to be exploded.
6160 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6161 theName Object name; when specified, this parameter is used
6162 for result publication in the study. Otherwise, if automatic
6163 publication is switched on, default value is used for result name.
6166 List of sub-shapes of type theShapeType, contained in theShape.
6168 # Example: see GEOM_TestAll.py
6169 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6170 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6171 self._autoPublish(ListObj, theName, "subshape")
6174 ## Explode a shape on sub-shapes of a given type.
6175 # Sub-shapes will be sorted taking into account their gravity centers,
6176 # to provide stable order of sub-shapes.
6177 # @param aShape Shape to be exploded.
6178 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6179 # @return List of IDs of sub-shapes.
6181 # @ref swig_all_decompose "Example"
6182 @ManageTransactions("ShapesOp")
6183 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6185 Explode a shape on sub-shapes of a given type.
6186 Sub-shapes will be sorted taking into account their gravity centers,
6187 to provide stable order of sub-shapes.
6190 aShape Shape to be exploded.
6191 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6194 List of IDs of sub-shapes.
6196 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6197 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6200 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6201 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6202 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6203 # @param aShape Shape to get sub-shape of.
6204 # @param ListOfInd List of sub-shapes indices.
6205 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6206 # @param theName Object name; when specified, this parameter is used
6207 # for result publication in the study. Otherwise, if automatic
6208 # publication is switched on, default value is used for result name.
6210 # @return A compound of sub-shapes of aShape.
6212 # @ref swig_all_decompose "Example"
6213 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6215 Obtain a compound of sub-shapes of aShape,
6216 selected by they indices in sorted list of all sub-shapes of type aType.
6217 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6220 aShape Shape to get sub-shape of.
6221 ListOfID List of sub-shapes indices.
6222 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6223 theName Object name; when specified, this parameter is used
6224 for result publication in the study. Otherwise, if automatic
6225 publication is switched on, default value is used for result name.
6228 A compound of sub-shapes of aShape.
6230 # Example: see GEOM_TestAll.py
6232 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6233 for ind in ListOfInd:
6234 ListOfIDs.append(AllShapeIDsList[ind - 1])
6235 # note: auto-publishing is done in self.GetSubShape()
6236 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6239 ## Extract shapes (excluding the main shape) of given type.
6240 # @param aShape The shape.
6241 # @param aType The shape type (see ShapeType())
6242 # @param isSorted Boolean flag to switch sorting on/off.
6243 # @param theName Object name; when specified, this parameter is used
6244 # for result publication in the study. Otherwise, if automatic
6245 # publication is switched on, default value is used for result name.
6247 # @return List of sub-shapes of type aType, contained in aShape.
6249 # @ref swig_FilletChamfer "Example"
6250 @ManageTransactions("ShapesOp")
6251 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6253 Extract shapes (excluding the main shape) of given type.
6257 aType The shape type (see geompy.ShapeType)
6258 isSorted Boolean flag to switch sorting on/off.
6259 theName Object name; when specified, this parameter is used
6260 for result publication in the study. Otherwise, if automatic
6261 publication is switched on, default value is used for result name.
6264 List of sub-shapes of type aType, contained in aShape.
6266 # Example: see GEOM_TestAll.py
6267 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6268 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6269 self._autoPublish(ListObj, theName, "subshape")
6272 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6273 # @param aShape Main shape.
6274 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6275 # @param theName Object name; when specified, this parameter is used
6276 # for result publication in the study. Otherwise, if automatic
6277 # publication is switched on, default value is used for result name.
6278 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6280 # @ref swig_all_decompose "Example"
6281 @ManageTransactions("ShapesOp")
6282 def SubShapes(self, aShape, anIDs, theName=None):
6284 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6288 anIDs List of unique IDs of sub-shapes inside theMainShape.
6289 theName Object name; when specified, this parameter is used
6290 for result publication in the study. Otherwise, if automatic
6291 publication is switched on, default value is used for result name.
6294 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6296 # Example: see GEOM_TestAll.py
6297 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6298 RaiseIfFailed("SubShapes", self.ShapesOp)
6299 self._autoPublish(ListObj, theName, "subshape")
6302 ## Explode a shape into edges sorted in a row from a starting point.
6303 # @param theShape the shape to be exploded on edges.
6304 # @param theStartPoint the starting point.
6305 # @param theName Object name; when specified, this parameter is used
6306 # for result publication in the study. Otherwise, if automatic
6307 # publication is switched on, default value is used for result name.
6308 # @return List of GEOM.GEOM_Object that is actually an ordered list
6309 # of edges sorted in a row from a starting point.
6311 # @ref swig_GetSubShapeEdgeSorted "Example"
6312 @ManageTransactions("ShapesOp")
6313 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6315 Explode a shape into edges sorted in a row from a starting point.
6318 theShape the shape to be exploded on edges.
6319 theStartPoint the starting point.
6320 theName Object name; when specified, this parameter is used
6321 for result publication in the study. Otherwise, if automatic
6322 publication is switched on, default value is used for result name.
6325 List of GEOM.GEOM_Object that is actually an ordered list
6326 of edges sorted in a row from a starting point.
6328 # Example: see GEOM_TestAll.py
6329 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6330 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6331 self._autoPublish(ListObj, theName, "SortedEdges")
6334 ## Check if the object is a sub-object of another GEOM object.
6335 # @param aSubObject Checked sub-object (or its parent object, in case if
6336 # \a theSubObjectIndex is non-zero).
6337 # @param anObject An object that is checked for ownership (or its parent object,
6338 # in case if \a theObjectIndex is non-zero).
6339 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6340 # identifies a sub-object within its parent specified via \a theSubObject.
6341 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6342 # identifies an object within its parent specified via \a theObject.
6343 # @return TRUE, if the given object contains sub-object.
6344 @ManageTransactions("ShapesOp")
6345 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6347 Check if the object is a sub-object of another GEOM object.
6350 aSubObject Checked sub-object (or its parent object, in case if
6351 \a theSubObjectIndex is non-zero).
6352 anObject An object that is checked for ownership (or its parent object,
6353 in case if \a theObjectIndex is non-zero).
6354 aSubObjectIndex When non-zero, specifies a sub-shape index that
6355 identifies a sub-object within its parent specified via \a theSubObject.
6356 anObjectIndex When non-zero, specifies a sub-shape index that
6357 identifies an object within its parent specified via \a theObject.
6360 TRUE, if the given object contains sub-object.
6362 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6363 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6366 # end of l4_decompose
6369 ## @addtogroup l4_decompose_d
6372 ## Deprecated method
6373 # It works like SubShapeAllSortedCentres(), but wrongly
6374 # defines centres of faces, shells and solids.
6375 @ManageTransactions("ShapesOp")
6376 def SubShapeAllSorted(self, aShape, aType, theName=None):
6379 It works like geompy.SubShapeAllSortedCentres, but wrongly
6380 defines centres of faces, shells and solids.
6382 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6383 RaiseIfFailed("MakeExplode", self.ShapesOp)
6384 self._autoPublish(ListObj, theName, "subshape")
6387 ## Deprecated method
6388 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6389 # defines centres of faces, shells and solids.
6390 @ManageTransactions("ShapesOp")
6391 def SubShapeAllSortedIDs(self, aShape, aType):
6394 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6395 defines centres of faces, shells and solids.
6397 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6398 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6401 ## Deprecated method
6402 # It works like SubShapeSortedCentres(), but has a bug
6403 # (wrongly defines centres of faces, shells and solids).
6404 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6407 It works like geompy.SubShapeSortedCentres, but has a bug
6408 (wrongly defines centres of faces, shells and solids).
6411 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6412 for ind in ListOfInd:
6413 ListOfIDs.append(AllShapeIDsList[ind - 1])
6414 # note: auto-publishing is done in self.GetSubShape()
6415 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6418 # end of l4_decompose_d
6421 ## @addtogroup l3_healing
6424 ## Apply a sequence of Shape Healing operators to the given object.
6425 # @param theShape Shape to be processed.
6426 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6427 # @param theParameters List of names of parameters
6428 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6429 # @param theValues List of values of parameters, in the same order
6430 # as parameters are listed in <VAR>theParameters</VAR> list.
6431 # @param theName Object name; when specified, this parameter is used
6432 # for result publication in the study. Otherwise, if automatic
6433 # publication is switched on, default value is used for result name.
6435 # <b> Operators and Parameters: </b> \n
6437 # * \b FixShape - corrects invalid shapes. \n
6438 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6439 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6441 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6442 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6443 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6444 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6445 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6446 # - \b DropSmallSolids.WidthFactorThreshold - defines maximum value of <em>2V/S</em> of a solid which is considered small, where \a V is volume and \a S is surface area of the solid. \n
6447 # - \b DropSmallSolids.VolumeThreshold - defines maximum volume of a solid which is considered small. If the both tolerances are privided a solid is considered small if it meets the both criteria. \n
6448 # - \b DropSmallSolids.MergeSolids - if "1", small solids are removed; if "0" small solids are merged to adjacent non-small solids or left untouched if cannot be merged. \n
6450 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6451 # surfaces in segments using a certain angle. \n
6452 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6453 # if Angle=180, four if Angle=90, etc). \n
6454 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6456 # * \b SplitClosedFaces - splits closed faces in segments.
6457 # The number of segments depends on the number of splitting points.\n
6458 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6460 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6461 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6462 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6463 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6464 # This and the previous parameters can take the following values:\n
6465 # \b Parametric \b Continuity \n
6466 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6467 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6468 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6469 # ruling out sharp edges).\n
6470 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6471 # are of the same magnitude).\n
6472 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6473 # or surfaces (d/du C(u)) are the same at junction. \n
6474 # \b Geometric \b Continuity \n
6475 # \b G1: first derivatives are proportional at junction.\n
6476 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6477 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6478 # \b G2: first and second derivatives are proportional at junction.
6479 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6480 # continuity requires that the underlying parameterization was continuous as well.
6481 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6483 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6484 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6485 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6486 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6487 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6488 # with the specified parameters.\n
6489 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6490 # with the specified parameters.\n
6491 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6492 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6493 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6494 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6496 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6497 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6498 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6499 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6500 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6502 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6503 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6506 # @return New GEOM.GEOM_Object, containing processed shape.
6508 # \n @ref tui_shape_processing "Example"
6509 @ManageTransactions("HealOp")
6510 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6512 Apply a sequence of Shape Healing operators to the given object.
6515 theShape Shape to be processed.
6516 theValues List of values of parameters, in the same order
6517 as parameters are listed in theParameters list.
6518 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6519 theParameters List of names of parameters
6520 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6521 theName Object name; when specified, this parameter is used
6522 for result publication in the study. Otherwise, if automatic
6523 publication is switched on, default value is used for result name.
6525 Operators and Parameters:
6527 * FixShape - corrects invalid shapes.
6528 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6529 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6530 * FixFaceSize - removes small faces, such as spots and strips.
6531 * FixFaceSize.Tolerance - defines minimum possible face size.
6532 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6533 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6534 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6535 * DropSmallSolids.WidthFactorThreshold - defines maximum value of 2V/S of a solid which is considered small, where V is volume and S is surface area of the solid.
6536 * DropSmallSolids.VolumeThreshold - defines maximum volume of a solid which is considered small. If the both tolerances are privided a solid is considered small if it meets the both criteria.
6537 * DropSmallSolids.MergeSolids - if '1', small solids are removed; if '0' small solids are merged to adjacent non-small solids or left untouched if cannot be merged.
6539 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6540 in segments using a certain angle.
6541 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6542 if Angle=180, four if Angle=90, etc).
6543 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6544 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6546 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6547 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6548 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6549 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6550 * SplitContinuity.CurveContinuity - required continuity for curves.
6551 This and the previous parameters can take the following values:
6553 Parametric Continuity:
6554 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6555 coincidental. The curves or surfaces may still meet at an angle,
6556 giving rise to a sharp corner or edge).
6557 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6558 are parallel, ruling out sharp edges).
6559 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6560 or surfaces are of the same magnitude).
6561 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6562 curves or surfaces (d/du C(u)) are the same at junction.
6564 Geometric Continuity:
6565 G1: first derivatives are proportional at junction.
6566 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6567 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6568 G2: first and second derivatives are proportional at junction. As the names imply,
6569 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6570 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6571 geometric continuity of order n, but not vice-versa.
6572 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6573 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6574 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6575 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6576 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6577 the specified parameters.
6578 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6579 the specified parameters.
6580 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6581 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6582 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6583 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6584 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6585 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6586 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6587 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6588 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6589 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6590 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6593 New GEOM.GEOM_Object, containing processed shape.
6595 Note: For more information look through SALOME Geometry User's Guide->
6596 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6598 # Example: see GEOM_TestHealing.py
6599 theValues,Parameters = ParseList(theValues)
6600 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6601 # To avoid script failure in case of good argument shape
6602 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6604 RaiseIfFailed("ProcessShape", self.HealOp)
6605 for string in (theOperators + theParameters):
6606 Parameters = ":" + Parameters
6608 anObj.SetParameters(Parameters)
6609 self._autoPublish(anObj, theName, "healed")
6612 ## Remove faces from the given object (shape).
6613 # @param theObject Shape to be processed.
6614 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6615 # removes ALL faces of the given object.
6616 # @param theName Object name; when specified, this parameter is used
6617 # for result publication in the study. Otherwise, if automatic
6618 # publication is switched on, default value is used for result name.
6620 # @return New GEOM.GEOM_Object, containing processed shape.
6622 # @ref tui_suppress_faces "Example"
6623 @ManageTransactions("HealOp")
6624 def SuppressFaces(self, theObject, theFaces, theName=None):
6626 Remove faces from the given object (shape).
6629 theObject Shape to be processed.
6630 theFaces Indices of faces to be removed, if EMPTY then the method
6631 removes ALL faces of the given object.
6632 theName Object name; when specified, this parameter is used
6633 for result publication in the study. Otherwise, if automatic
6634 publication is switched on, default value is used for result name.
6637 New GEOM.GEOM_Object, containing processed shape.
6639 # Example: see GEOM_TestHealing.py
6640 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6641 RaiseIfFailed("SuppressFaces", self.HealOp)
6642 self._autoPublish(anObj, theName, "suppressFaces")
6645 ## Sewing of faces into a single shell.
6646 # @param ListShape Shapes to be processed.
6647 # @param theTolerance Required tolerance value.
6648 # @param AllowNonManifold Flag that allows non-manifold sewing.
6649 # @param theName Object name; when specified, this parameter is used
6650 # for result publication in the study. Otherwise, if automatic
6651 # publication is switched on, default value is used for result name.
6653 # @return New GEOM.GEOM_Object, containing a result shell.
6655 # @ref tui_sewing "Example"
6656 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6658 Sewing of faces into a single shell.
6661 ListShape Shapes to be processed.
6662 theTolerance Required tolerance value.
6663 AllowNonManifold Flag that allows non-manifold sewing.
6664 theName Object name; when specified, this parameter is used
6665 for result publication in the study. Otherwise, if automatic
6666 publication is switched on, default value is used for result name.
6669 New GEOM.GEOM_Object, containing containing a result shell.
6671 # Example: see GEOM_TestHealing.py
6672 # note: auto-publishing is done in self.Sew()
6673 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
6676 ## Sewing of faces into a single shell.
6677 # @param ListShape Shapes to be processed.
6678 # @param theTolerance Required tolerance value.
6679 # @param AllowNonManifold Flag that allows non-manifold sewing.
6680 # @param theName Object name; when specified, this parameter is used
6681 # for result publication in the study. Otherwise, if automatic
6682 # publication is switched on, default value is used for result name.
6684 # @return New GEOM.GEOM_Object, containing a result shell.
6685 @ManageTransactions("HealOp")
6686 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6688 Sewing of faces into a single shell.
6691 ListShape Shapes to be processed.
6692 theTolerance Required tolerance value.
6693 AllowNonManifold Flag that allows non-manifold sewing.
6694 theName Object name; when specified, this parameter is used
6695 for result publication in the study. Otherwise, if automatic
6696 publication is switched on, default value is used for result name.
6699 New GEOM.GEOM_Object, containing a result shell.
6701 # Example: see MakeSewing() above
6702 theTolerance,Parameters = ParseParameters(theTolerance)
6703 if AllowNonManifold:
6704 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
6706 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
6707 # To avoid script failure in case of good argument shape
6708 # (Fix of test cases geom/bugs11/L7,L8)
6709 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6711 RaiseIfFailed("Sew", self.HealOp)
6712 anObj.SetParameters(Parameters)
6713 self._autoPublish(anObj, theName, "sewed")
6716 ## Rebuild the topology of theSolids by removing
6717 # the faces that are shared by several solids.
6718 # @param theSolids A compound or a list of solids to be processed.
6719 # @param theName Object name; when specified, this parameter is used
6720 # for result publication in the study. Otherwise, if automatic
6721 # publication is switched on, default value is used for result name.
6723 # @return New GEOM.GEOM_Object, containing processed shape.
6725 # @ref tui_remove_webs "Example"
6726 @ManageTransactions("HealOp")
6727 def RemoveInternalFaces (self, theSolids, theName=None):
6729 Rebuild the topology of theSolids by removing
6730 the faces that are shared by several solids.
6733 theSolids A compound or a list of solids to be processed.
6734 theName Object name; when specified, this parameter is used
6735 for result publication in the study. Otherwise, if automatic
6736 publication is switched on, default value is used for result name.
6739 New GEOM.GEOM_Object, containing processed shape.
6741 # Example: see GEOM_TestHealing.py
6742 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
6743 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6744 self._autoPublish(anObj, theName, "removeWebs")
6747 ## Remove internal wires and edges from the given object (face).
6748 # @param theObject Shape to be processed.
6749 # @param theWires Indices of wires to be removed, if EMPTY then the method
6750 # removes ALL internal wires of the given object.
6751 # @param theName Object name; when specified, this parameter is used
6752 # for result publication in the study. Otherwise, if automatic
6753 # publication is switched on, default value is used for result name.
6755 # @return New GEOM.GEOM_Object, containing processed shape.
6757 # @ref tui_suppress_internal_wires "Example"
6758 @ManageTransactions("HealOp")
6759 def SuppressInternalWires(self, theObject, theWires, theName=None):
6761 Remove internal wires and edges from the given object (face).
6764 theObject Shape to be processed.
6765 theWires Indices of wires to be removed, if EMPTY then the method
6766 removes ALL internal wires of the given object.
6767 theName Object name; when specified, this parameter is used
6768 for result publication in the study. Otherwise, if automatic
6769 publication is switched on, default value is used for result name.
6772 New GEOM.GEOM_Object, containing processed shape.
6774 # Example: see GEOM_TestHealing.py
6775 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6776 RaiseIfFailed("RemoveIntWires", self.HealOp)
6777 self._autoPublish(anObj, theName, "suppressWires")
6780 ## Remove internal closed contours (holes) from the given object.
6781 # @param theObject Shape to be processed.
6782 # @param theWires Indices of wires to be removed, if EMPTY then the method
6783 # removes ALL internal holes of the given object
6784 # @param theName Object name; when specified, this parameter is used
6785 # for result publication in the study. Otherwise, if automatic
6786 # publication is switched on, default value is used for result name.
6788 # @return New GEOM.GEOM_Object, containing processed shape.
6790 # @ref tui_suppress_holes "Example"
6791 @ManageTransactions("HealOp")
6792 def SuppressHoles(self, theObject, theWires, theName=None):
6794 Remove internal closed contours (holes) from the given object.
6797 theObject Shape to be processed.
6798 theWires Indices of wires to be removed, if EMPTY then the method
6799 removes ALL internal holes of the given object
6800 theName Object name; when specified, this parameter is used
6801 for result publication in the study. Otherwise, if automatic
6802 publication is switched on, default value is used for result name.
6805 New GEOM.GEOM_Object, containing processed shape.
6807 # Example: see GEOM_TestHealing.py
6808 anObj = self.HealOp.FillHoles(theObject, theWires)
6809 RaiseIfFailed("FillHoles", self.HealOp)
6810 self._autoPublish(anObj, theName, "suppressHoles")
6813 ## Close an open wire.
6814 # @param theObject Shape to be processed.
6815 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6816 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6817 # @param isCommonVertex If True : closure by creation of a common vertex,
6818 # If False : closure by creation of an edge between ends.
6819 # @param theName Object name; when specified, this parameter is used
6820 # for result publication in the study. Otherwise, if automatic
6821 # publication is switched on, default value is used for result name.
6823 # @return New GEOM.GEOM_Object, containing processed shape.
6825 # @ref tui_close_contour "Example"
6826 @ManageTransactions("HealOp")
6827 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6832 theObject Shape to be processed.
6833 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6834 if [ ], then theObject itself is a wire.
6835 isCommonVertex If True : closure by creation of a common vertex,
6836 If False : closure by creation of an edge between ends.
6837 theName Object name; when specified, this parameter is used
6838 for result publication in the study. Otherwise, if automatic
6839 publication is switched on, default value is used for result name.
6842 New GEOM.GEOM_Object, containing processed shape.
6844 # Example: see GEOM_TestHealing.py
6845 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6846 RaiseIfFailed("CloseContour", self.HealOp)
6847 self._autoPublish(anObj, theName, "closeContour")
6850 ## Addition of a point to a given edge object.
6851 # @param theObject Shape to be processed.
6852 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6853 # if -1, then theObject itself is the edge.
6854 # @param theValue Value of parameter on edge or length parameter,
6855 # depending on \a isByParameter.
6856 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6857 # if FALSE : \a theValue is treated as a length parameter [0..1]
6858 # @param theName Object name; when specified, this parameter is used
6859 # for result publication in the study. Otherwise, if automatic
6860 # publication is switched on, default value is used for result name.
6862 # @return New GEOM.GEOM_Object, containing processed shape.
6864 # @ref tui_add_point_on_edge "Example"
6865 @ManageTransactions("HealOp")
6866 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6868 Addition of a point to a given edge object.
6871 theObject Shape to be processed.
6872 theEdgeIndex Index of edge to be divided within theObject's shape,
6873 if -1, then theObject itself is the edge.
6874 theValue Value of parameter on edge or length parameter,
6875 depending on isByParameter.
6876 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6877 if FALSE : theValue is treated as a length parameter [0..1]
6878 theName Object name; when specified, this parameter is used
6879 for result publication in the study. Otherwise, if automatic
6880 publication is switched on, default value is used for result name.
6883 New GEOM.GEOM_Object, containing processed shape.
6885 # Example: see GEOM_TestHealing.py
6886 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6887 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6888 RaiseIfFailed("DivideEdge", self.HealOp)
6889 anObj.SetParameters(Parameters)
6890 self._autoPublish(anObj, theName, "divideEdge")
6893 ## Addition of points to a given edge of \a theObject by projecting
6894 # other points to the given edge.
6895 # @param theObject Shape to be processed.
6896 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6897 # if -1, then theObject itself is the edge.
6898 # @param thePoints List of points to project to theEdgeIndex-th edge.
6899 # @param theName Object name; when specified, this parameter is used
6900 # for result publication in the study. Otherwise, if automatic
6901 # publication is switched on, default value is used for result name.
6903 # @return New GEOM.GEOM_Object, containing processed shape.
6905 # @ref tui_add_point_on_edge "Example"
6906 @ManageTransactions("HealOp")
6907 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
6909 Addition of points to a given edge of \a theObject by projecting
6910 other points to the given edge.
6913 theObject Shape to be processed.
6914 theEdgeIndex The edge or its index to be divided within theObject's shape,
6915 if -1, then theObject itself is the edge.
6916 thePoints List of points to project to theEdgeIndex-th edge.
6917 theName Object name; when specified, this parameter is used
6918 for result publication in the study. Otherwise, if automatic
6919 publication is switched on, default value is used for result name.
6922 New GEOM.GEOM_Object, containing processed shape.
6924 # Example: see GEOM_TestHealing.py
6925 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
6926 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
6927 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
6928 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
6929 self._autoPublish(anObj, theName, "divideEdge")
6932 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6933 # @param theWire Wire to minimize the number of C1 continuous edges in.
6934 # @param theVertices A list of vertices to suppress. If the list
6935 # is empty, all vertices in a wire will be assumed.
6936 # @param theName Object name; when specified, this parameter is used
6937 # for result publication in the study. Otherwise, if automatic
6938 # publication is switched on, default value is used for result name.
6940 # @return New GEOM.GEOM_Object with modified wire.
6942 # @ref tui_fuse_collinear_edges "Example"
6943 @ManageTransactions("HealOp")
6944 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6946 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6949 theWire Wire to minimize the number of C1 continuous edges in.
6950 theVertices A list of vertices to suppress. If the list
6951 is empty, all vertices in a wire will be assumed.
6952 theName Object name; when specified, this parameter is used
6953 for result publication in the study. Otherwise, if automatic
6954 publication is switched on, default value is used for result name.
6957 New GEOM.GEOM_Object with modified wire.
6959 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6960 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6961 self._autoPublish(anObj, theName, "fuseEdges")
6964 ## Change orientation of the given object. Updates given shape.
6965 # @param theObject Shape to be processed.
6966 # @return Updated <var>theObject</var>
6968 # @ref swig_todo "Example"
6969 @ManageTransactions("HealOp")
6970 def ChangeOrientationShell(self,theObject):
6972 Change orientation of the given object. Updates given shape.
6975 theObject Shape to be processed.
6980 theObject = self.HealOp.ChangeOrientation(theObject)
6981 RaiseIfFailed("ChangeOrientation", self.HealOp)
6984 ## Change orientation of the given object.
6985 # @param theObject Shape to be processed.
6986 # @param theName Object name; when specified, this parameter is used
6987 # for result publication in the study. Otherwise, if automatic
6988 # publication is switched on, default value is used for result name.
6990 # @return New GEOM.GEOM_Object, containing processed shape.
6992 # @ref swig_todo "Example"
6993 @ManageTransactions("HealOp")
6994 def ChangeOrientationShellCopy(self, theObject, theName=None):
6996 Change orientation of the given object.
6999 theObject Shape to be processed.
7000 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.
7005 New GEOM.GEOM_Object, containing processed shape.
7007 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7008 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7009 self._autoPublish(anObj, theName, "reversed")
7012 ## Try to limit tolerance of the given object by value \a theTolerance.
7013 # @param theObject Shape to be processed.
7014 # @param theTolerance Required tolerance value.
7015 # @param theName Object name; when specified, this parameter is used
7016 # for result publication in the study. Otherwise, if automatic
7017 # publication is switched on, default value is used for result name.
7019 # @return New GEOM.GEOM_Object, containing processed shape.
7021 # @ref tui_limit_tolerance "Example"
7022 @ManageTransactions("HealOp")
7023 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7025 Try to limit tolerance of the given object by value theTolerance.
7028 theObject Shape to be processed.
7029 theTolerance Required tolerance value.
7030 theName Object name; when specified, this parameter is used
7031 for result publication in the study. Otherwise, if automatic
7032 publication is switched on, default value is used for result name.
7035 New GEOM.GEOM_Object, containing processed shape.
7037 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7038 RaiseIfFailed("LimitTolerance", self.HealOp)
7039 self._autoPublish(anObj, theName, "limitTolerance")
7042 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7043 # that constitute a free boundary of the given shape.
7044 # @param theObject Shape to get free boundary of.
7045 # @param theName Object name; when specified, this parameter is used
7046 # for result publication in the study. Otherwise, if automatic
7047 # publication is switched on, default value is used for result name.
7049 # @return [\a status, \a theClosedWires, \a theOpenWires]
7050 # \n \a status: FALSE, if an error(s) occured during the method execution.
7051 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7052 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7054 # @ref tui_free_boundaries_page "Example"
7055 @ManageTransactions("HealOp")
7056 def GetFreeBoundary(self, theObject, theName=None):
7058 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7059 that constitute a free boundary of the given shape.
7062 theObject Shape to get free boundary of.
7063 theName Object name; when specified, this parameter is used
7064 for result publication in the study. Otherwise, if automatic
7065 publication is switched on, default value is used for result name.
7068 [status, theClosedWires, theOpenWires]
7069 status: FALSE, if an error(s) occured during the method execution.
7070 theClosedWires: Closed wires on the free boundary of the given shape.
7071 theOpenWires: Open wires on the free boundary of the given shape.
7073 # Example: see GEOM_TestHealing.py
7074 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7075 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7076 self._autoPublish(anObj[1], theName, "closedWire")
7077 self._autoPublish(anObj[2], theName, "openWire")
7080 ## Replace coincident faces in \a theShapes by one face.
7081 # @param theShapes Initial shapes, either a list or compound of shapes.
7082 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7083 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7084 # otherwise all initial shapes.
7085 # @param theName Object name; when specified, this parameter is used
7086 # for result publication in the study. Otherwise, if automatic
7087 # publication is switched on, default value is used for result name.
7089 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7091 # @ref tui_glue_faces "Example"
7092 @ManageTransactions("ShapesOp")
7093 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7095 Replace coincident faces in theShapes by one face.
7098 theShapes Initial shapes, either a list or compound of shapes.
7099 theTolerance Maximum distance between faces, which can be considered as coincident.
7100 doKeepNonSolids If FALSE, only solids will present in the result,
7101 otherwise all initial shapes.
7102 theName Object name; when specified, this parameter is used
7103 for result publication in the study. Otherwise, if automatic
7104 publication is switched on, default value is used for result name.
7107 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7109 # Example: see GEOM_Spanner.py
7110 theTolerance,Parameters = ParseParameters(theTolerance)
7111 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7113 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
7114 anObj.SetParameters(Parameters)
7115 self._autoPublish(anObj, theName, "glueFaces")
7118 ## Find coincident faces in \a theShapes for possible gluing.
7119 # @param theShapes Initial shapes, either a list or compound of shapes.
7120 # @param theTolerance Maximum distance between faces,
7121 # which can be considered as coincident.
7122 # @param theName Object name; when specified, this parameter is used
7123 # for result publication in the study. Otherwise, if automatic
7124 # publication is switched on, default value is used for result name.
7126 # @return GEOM.ListOfGO
7128 # @ref tui_glue_faces "Example"
7129 @ManageTransactions("ShapesOp")
7130 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7132 Find coincident faces in theShapes for possible gluing.
7135 theShapes Initial shapes, either a list or compound of shapes.
7136 theTolerance Maximum distance between faces,
7137 which can be considered as coincident.
7138 theName Object name; when specified, this parameter is used
7139 for result publication in the study. Otherwise, if automatic
7140 publication is switched on, default value is used for result name.
7145 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7146 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7147 self._autoPublish(anObj, theName, "facesToGlue")
7150 ## Replace coincident faces in \a theShapes by one face
7151 # in compliance with given list of faces
7152 # @param theShapes Initial shapes, either a list or compound of shapes.
7153 # @param theTolerance Maximum distance between faces,
7154 # which can be considered as coincident.
7155 # @param theFaces List of faces for gluing.
7156 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7157 # otherwise all initial shapes.
7158 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7159 # will be glued, otherwise only the edges,
7160 # belonging to <VAR>theFaces</VAR>.
7161 # @param theName Object name; when specified, this parameter is used
7162 # for result publication in the study. Otherwise, if automatic
7163 # publication is switched on, default value is used for result name.
7165 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7167 # @ref tui_glue_faces "Example"
7168 @ManageTransactions("ShapesOp")
7169 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7170 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7172 Replace coincident faces in theShapes by one face
7173 in compliance with given list of faces
7176 theShapes theShapes Initial shapes, either a list or compound of shapes.
7177 theTolerance Maximum distance between faces,
7178 which can be considered as coincident.
7179 theFaces List of faces for gluing.
7180 doKeepNonSolids If FALSE, only solids will present in the result,
7181 otherwise all initial shapes.
7182 doGlueAllEdges If TRUE, all coincident edges of theShape
7183 will be glued, otherwise only the edges,
7184 belonging to theFaces.
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 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7192 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, theFaces,
7193 doKeepNonSolids, doGlueAllEdges)
7195 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
7196 self._autoPublish(anObj, theName, "glueFaces")
7199 ## Replace coincident edges in \a theShapes by one edge.
7200 # @param theShapes Initial shapes, either a list or compound of shapes.
7201 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7202 # @param theName Object name; when specified, this parameter is used
7203 # for result publication in the study. Otherwise, if automatic
7204 # publication is switched on, default value is used for result name.
7206 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7208 # @ref tui_glue_edges "Example"
7209 @ManageTransactions("ShapesOp")
7210 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7212 Replace coincident edges in theShapes by one edge.
7215 theShapes Initial shapes, either a list or compound of shapes.
7216 theTolerance Maximum distance between edges, which can be considered as coincident.
7217 theName Object name; when specified, this parameter is used
7218 for result publication in the study. Otherwise, if automatic
7219 publication is switched on, default value is used for result name.
7222 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7224 theTolerance,Parameters = ParseParameters(theTolerance)
7225 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7227 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
7228 anObj.SetParameters(Parameters)
7229 self._autoPublish(anObj, theName, "glueEdges")
7232 ## Find coincident edges in \a theShapes for possible gluing.
7233 # @param theShapes Initial shapes, either a list or compound of shapes.
7234 # @param theTolerance Maximum distance between edges,
7235 # which can be considered as coincident.
7236 # @param theName Object name; when specified, this parameter is used
7237 # for result publication in the study. Otherwise, if automatic
7238 # publication is switched on, default value is used for result name.
7240 # @return GEOM.ListOfGO
7242 # @ref tui_glue_edges "Example"
7243 @ManageTransactions("ShapesOp")
7244 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7246 Find coincident edges in theShapes for possible gluing.
7249 theShapes Initial shapes, either a list or compound of shapes.
7250 theTolerance Maximum distance between edges,
7251 which can be considered as coincident.
7252 theName Object name; when specified, this parameter is used
7253 for result publication in the study. Otherwise, if automatic
7254 publication is switched on, default value is used for result name.
7259 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7260 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7261 self._autoPublish(anObj, theName, "edgesToGlue")
7264 ## Replace coincident edges in theShapes by one edge
7265 # in compliance with given list of edges.
7266 # @param theShapes Initial shapes, either a list or compound of shapes.
7267 # @param theTolerance Maximum distance between edges,
7268 # which can be considered as coincident.
7269 # @param theEdges List of edges for gluing.
7270 # @param theName Object name; when specified, this parameter is used
7271 # for result publication in the study. Otherwise, if automatic
7272 # publication is switched on, default value is used for result name.
7274 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7276 # @ref tui_glue_edges "Example"
7277 @ManageTransactions("ShapesOp")
7278 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7280 Replace coincident edges in theShapes by one edge
7281 in compliance with given list of edges.
7284 theShapes Initial shapes, either a list or compound of shapes.
7285 theTolerance Maximum distance between edges,
7286 which can be considered as coincident.
7287 theEdges List of edges for gluing.
7288 theName Object name; when specified, this parameter is used
7289 for result publication in the study. Otherwise, if automatic
7290 publication is switched on, default value is used for result name.
7293 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7295 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7297 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
7298 self._autoPublish(anObj, theName, "glueEdges")
7304 ## @addtogroup l3_boolean Boolean Operations
7307 # -----------------------------------------------------------------------------
7308 # Boolean (Common, Cut, Fuse, Section)
7309 # -----------------------------------------------------------------------------
7311 ## Perform one of boolean operations on two given shapes.
7312 # @param theShape1 First argument for boolean operation.
7313 # @param theShape2 Second argument for boolean operation.
7314 # @param theOperation Indicates the operation to be done:\n
7315 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7316 # @param checkSelfInte The flag that tells if the arguments should
7317 # be checked for self-intersection prior to 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"
7333 @ManageTransactions("BoolOp")
7334 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7336 Perform one of boolean operations on two given shapes.
7339 theShape1 First argument for boolean operation.
7340 theShape2 Second argument for boolean operation.
7341 theOperation Indicates the operation to be done:
7342 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7343 checkSelfInte The flag that tells if the arguments should
7344 be checked for self-intersection prior to
7346 theName Object name; when specified, this parameter is used
7347 for result publication in the study. Otherwise, if automatic
7348 publication is switched on, default value is used for result name.
7351 This algorithm doesn't find all types of self-intersections.
7352 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7353 vertex/face and edge/face intersections. Face/face
7354 intersections detection is switched off as it is a
7355 time-consuming operation that gives an impact on performance.
7356 To find all self-intersections please use
7357 CheckSelfIntersections() method.
7360 New GEOM.GEOM_Object, containing the result shape.
7362 # Example: see GEOM_TestAll.py
7363 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7364 RaiseIfFailed("MakeBoolean", self.BoolOp)
7365 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7366 self._autoPublish(anObj, theName, def_names[theOperation])
7369 ## Perform Common boolean operation on two given shapes.
7370 # @param theShape1 First argument for boolean operation.
7371 # @param theShape2 Second argument for boolean operation.
7372 # @param checkSelfInte The flag that tells if the arguments should
7373 # be checked for self-intersection prior to the operation.
7374 # @param theName Object name; when specified, this parameter is used
7375 # for result publication in the study. Otherwise, if automatic
7376 # publication is switched on, default value is used for result name.
7378 # @note This algorithm doesn't find all types of self-intersections.
7379 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7380 # vertex/face and edge/face intersections. Face/face
7381 # intersections detection is switched off as it is a
7382 # time-consuming operation that gives an impact on performance.
7383 # To find all self-intersections please use
7384 # CheckSelfIntersections() method.
7386 # @return New GEOM.GEOM_Object, containing the result shape.
7388 # @ref tui_common "Example 1"
7389 # \n @ref swig_MakeCommon "Example 2"
7390 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7392 Perform Common boolean operation on two given shapes.
7395 theShape1 First argument for boolean operation.
7396 theShape2 Second argument for boolean operation.
7397 checkSelfInte The flag that tells if the arguments should
7398 be checked for self-intersection prior to
7400 theName Object name; when specified, this parameter is used
7401 for result publication in the study. Otherwise, if automatic
7402 publication is switched on, default value is used for result name.
7405 This algorithm doesn't find all types of self-intersections.
7406 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7407 vertex/face and edge/face intersections. Face/face
7408 intersections detection is switched off as it is a
7409 time-consuming operation that gives an impact on performance.
7410 To find all self-intersections please use
7411 CheckSelfIntersections() method.
7414 New GEOM.GEOM_Object, containing the result shape.
7416 # Example: see GEOM_TestOthers.py
7417 # note: auto-publishing is done in self.MakeBoolean()
7418 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7420 ## Perform Cut boolean operation on two given shapes.
7421 # @param theShape1 First argument for boolean operation.
7422 # @param theShape2 Second argument for boolean operation.
7423 # @param checkSelfInte The flag that tells if the arguments should
7424 # be checked for self-intersection prior to the operation.
7425 # @param theName Object name; when specified, this parameter is used
7426 # for result publication in the study. Otherwise, if automatic
7427 # publication is switched on, default value is used for result name.
7429 # @note This algorithm doesn't find all types of self-intersections.
7430 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7431 # vertex/face and edge/face intersections. Face/face
7432 # intersections detection is switched off as it is a
7433 # time-consuming operation that gives an impact on performance.
7434 # To find all self-intersections please use
7435 # CheckSelfIntersections() method.
7437 # @return New GEOM.GEOM_Object, containing the result shape.
7439 # @ref tui_cut "Example 1"
7440 # \n @ref swig_MakeCommon "Example 2"
7441 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7443 Perform Cut boolean operation on two given shapes.
7446 theShape1 First argument for boolean operation.
7447 theShape2 Second argument for boolean operation.
7448 checkSelfInte The flag that tells if the arguments should
7449 be checked for self-intersection prior to
7451 theName Object name; when specified, this parameter is used
7452 for result publication in the study. Otherwise, if automatic
7453 publication is switched on, default value is used for result name.
7456 This algorithm doesn't find all types of self-intersections.
7457 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7458 vertex/face and edge/face intersections. Face/face
7459 intersections detection is switched off as it is a
7460 time-consuming operation that gives an impact on performance.
7461 To find all self-intersections please use
7462 CheckSelfIntersections() method.
7465 New GEOM.GEOM_Object, containing the result shape.
7468 # Example: see GEOM_TestOthers.py
7469 # note: auto-publishing is done in self.MakeBoolean()
7470 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7472 ## Perform Fuse boolean operation on two given shapes.
7473 # @param theShape1 First argument for boolean operation.
7474 # @param theShape2 Second argument for boolean operation.
7475 # @param checkSelfInte The flag that tells if the arguments should
7476 # be checked for self-intersection prior to the operation.
7477 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7478 # operation should be performed during the operation.
7479 # @param theName Object name; when specified, this parameter is used
7480 # for result publication in the study. Otherwise, if automatic
7481 # publication is switched on, default value is used for result name.
7483 # @note This algorithm doesn't find all types of self-intersections.
7484 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7485 # vertex/face and edge/face intersections. Face/face
7486 # intersections detection is switched off as it is a
7487 # time-consuming operation that gives an impact on performance.
7488 # To find all self-intersections please use
7489 # CheckSelfIntersections() method.
7491 # @return New GEOM.GEOM_Object, containing the result shape.
7493 # @ref tui_fuse "Example 1"
7494 # \n @ref swig_MakeCommon "Example 2"
7495 @ManageTransactions("BoolOp")
7496 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7497 rmExtraEdges=False, theName=None):
7499 Perform Fuse boolean operation on two given shapes.
7502 theShape1 First argument for boolean operation.
7503 theShape2 Second argument for boolean operation.
7504 checkSelfInte The flag that tells if the arguments should
7505 be checked for self-intersection prior to
7507 rmExtraEdges The flag that tells if Remove Extra Edges
7508 operation should be performed during the operation.
7509 theName Object name; when specified, this parameter is used
7510 for result publication in the study. Otherwise, if automatic
7511 publication is switched on, default value is used for result name.
7514 This algorithm doesn't find all types of self-intersections.
7515 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7516 vertex/face and edge/face intersections. Face/face
7517 intersections detection is switched off as it is a
7518 time-consuming operation that gives an impact on performance.
7519 To find all self-intersections please use
7520 CheckSelfIntersections() method.
7523 New GEOM.GEOM_Object, containing the result shape.
7526 # Example: see GEOM_TestOthers.py
7527 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7528 checkSelfInte, rmExtraEdges)
7529 RaiseIfFailed("MakeFuse", self.BoolOp)
7530 self._autoPublish(anObj, theName, "fuse")
7533 ## Perform Section boolean operation on two given shapes.
7534 # @param theShape1 First argument for boolean operation.
7535 # @param theShape2 Second argument for boolean operation.
7536 # @param checkSelfInte The flag that tells if the arguments should
7537 # be checked for self-intersection prior to the operation.
7538 # If a self-intersection detected the operation fails.
7539 # @param theName Object name; when specified, this parameter is used
7540 # for result publication in the study. Otherwise, if automatic
7541 # publication is switched on, default value is used for result name.
7542 # @return New GEOM.GEOM_Object, containing the result shape.
7544 # @ref tui_section "Example 1"
7545 # \n @ref swig_MakeCommon "Example 2"
7546 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7548 Perform Section boolean operation on two given shapes.
7551 theShape1 First argument for boolean operation.
7552 theShape2 Second argument for boolean operation.
7553 checkSelfInte The flag that tells if the arguments should
7554 be checked for self-intersection prior to the operation.
7555 If a self-intersection detected the operation fails.
7556 theName Object name; when specified, this parameter is used
7557 for result publication in the study. Otherwise, if automatic
7558 publication is switched on, default value is used for result name.
7560 New GEOM.GEOM_Object, containing the result shape.
7563 # Example: see GEOM_TestOthers.py
7564 # note: auto-publishing is done in self.MakeBoolean()
7565 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7567 ## Perform Fuse boolean operation on the list of shapes.
7568 # @param theShapesList Shapes to be fused.
7569 # @param checkSelfInte The flag that tells if the arguments should
7570 # be checked for self-intersection prior to the operation.
7571 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7572 # operation should be performed during the operation.
7573 # @param theName Object name; when specified, this parameter is used
7574 # for result publication in the study. Otherwise, if automatic
7575 # publication is switched on, default value is used for result name.
7577 # @note This algorithm doesn't find all types of self-intersections.
7578 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7579 # vertex/face and edge/face intersections. Face/face
7580 # intersections detection is switched off as it is a
7581 # time-consuming operation that gives an impact on performance.
7582 # To find all self-intersections please use
7583 # CheckSelfIntersections() method.
7585 # @return New GEOM.GEOM_Object, containing the result shape.
7587 # @ref tui_fuse "Example 1"
7588 # \n @ref swig_MakeCommon "Example 2"
7589 @ManageTransactions("BoolOp")
7590 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7591 rmExtraEdges=False, theName=None):
7593 Perform Fuse boolean operation on the list of shapes.
7596 theShapesList Shapes to be fused.
7597 checkSelfInte The flag that tells if the arguments should
7598 be checked for self-intersection prior to
7600 rmExtraEdges The flag that tells if Remove Extra Edges
7601 operation should be performed during the operation.
7602 theName Object name; when specified, this parameter is used
7603 for result publication in the study. Otherwise, if automatic
7604 publication is switched on, default value is used for result name.
7607 This algorithm doesn't find all types of self-intersections.
7608 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7609 vertex/face and edge/face intersections. Face/face
7610 intersections detection is switched off as it is a
7611 time-consuming operation that gives an impact on performance.
7612 To find all self-intersections please use
7613 CheckSelfIntersections() method.
7616 New GEOM.GEOM_Object, containing the result shape.
7619 # Example: see GEOM_TestOthers.py
7620 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7622 RaiseIfFailed("MakeFuseList", self.BoolOp)
7623 self._autoPublish(anObj, theName, "fuse")
7626 ## Perform Common boolean operation on the list of shapes.
7627 # @param theShapesList Shapes for Common operation.
7628 # @param checkSelfInte The flag that tells if the arguments should
7629 # be checked for self-intersection prior to the operation.
7630 # @param theName Object name; when specified, this parameter is used
7631 # for result publication in the study. Otherwise, if automatic
7632 # publication is switched on, default value is used for result name.
7634 # @note This algorithm doesn't find all types of self-intersections.
7635 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7636 # vertex/face and edge/face intersections. Face/face
7637 # intersections detection is switched off as it is a
7638 # time-consuming operation that gives an impact on performance.
7639 # To find all self-intersections please use
7640 # CheckSelfIntersections() method.
7642 # @return New GEOM.GEOM_Object, containing the result shape.
7644 # @ref tui_common "Example 1"
7645 # \n @ref swig_MakeCommon "Example 2"
7646 @ManageTransactions("BoolOp")
7647 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7649 Perform Common boolean operation on the list of shapes.
7652 theShapesList Shapes for Common operation.
7653 checkSelfInte The flag that tells if the arguments should
7654 be checked for self-intersection prior to
7656 theName Object name; when specified, this parameter is used
7657 for result publication in the study. Otherwise, if automatic
7658 publication is switched on, default value is used for result name.
7661 This algorithm doesn't find all types of self-intersections.
7662 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7663 vertex/face and edge/face intersections. Face/face
7664 intersections detection is switched off as it is a
7665 time-consuming operation that gives an impact on performance.
7666 To find all self-intersections please use
7667 CheckSelfIntersections() method.
7670 New GEOM.GEOM_Object, containing the result shape.
7673 # Example: see GEOM_TestOthers.py
7674 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7675 RaiseIfFailed("MakeCommonList", self.BoolOp)
7676 self._autoPublish(anObj, theName, "common")
7679 ## Perform Cut boolean operation on one object and the list of tools.
7680 # @param theMainShape The object of the operation.
7681 # @param theShapesList The list of tools of the operation.
7682 # @param checkSelfInte The flag that tells if the arguments should
7683 # be checked for self-intersection prior to the operation.
7684 # @param theName Object name; when specified, this parameter is used
7685 # for result publication in the study. Otherwise, if automatic
7686 # publication is switched on, default value is used for result name.
7688 # @note This algorithm doesn't find all types of self-intersections.
7689 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7690 # vertex/face and edge/face intersections. Face/face
7691 # intersections detection is switched off as it is a
7692 # time-consuming operation that gives an impact on performance.
7693 # To find all self-intersections please use
7694 # CheckSelfIntersections() method.
7696 # @return New GEOM.GEOM_Object, containing the result shape.
7698 # @ref tui_cut "Example 1"
7699 # \n @ref swig_MakeCommon "Example 2"
7700 @ManageTransactions("BoolOp")
7701 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7703 Perform Cut boolean operation on one object and the list of tools.
7706 theMainShape The object of the operation.
7707 theShapesList The list of tools of the operation.
7708 checkSelfInte The flag that tells if the arguments should
7709 be checked for self-intersection prior to
7711 theName Object name; when specified, this parameter is used
7712 for result publication in the study. Otherwise, if automatic
7713 publication is switched on, default value is used for result name.
7716 This algorithm doesn't find all types of self-intersections.
7717 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7718 vertex/face and edge/face intersections. Face/face
7719 intersections detection is switched off as it is a
7720 time-consuming operation that gives an impact on performance.
7721 To find all self-intersections please use
7722 CheckSelfIntersections() method.
7725 New GEOM.GEOM_Object, containing the result shape.
7728 # Example: see GEOM_TestOthers.py
7729 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7730 RaiseIfFailed("MakeCutList", self.BoolOp)
7731 self._autoPublish(anObj, theName, "cut")
7737 ## @addtogroup l3_basic_op
7740 ## Perform partition operation.
7741 # @param ListShapes Shapes to be intersected.
7742 # @param ListTools Shapes to intersect theShapes.
7743 # @param Limit Type of resulting shapes (see ShapeType()).\n
7744 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7745 # type will be detected automatically.
7746 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7747 # target type (equal to Limit) are kept in the result,
7748 # else standalone shapes of lower dimension
7749 # are kept also (if they exist).
7751 # @param theName Object name; when specified, this parameter is used
7752 # for result publication in the study. Otherwise, if automatic
7753 # publication is switched on, default value is used for result name.
7755 # @note Each compound from ListShapes and ListTools will be exploded
7756 # in order to avoid possible intersection between shapes from this compound.
7758 # After implementation new version of PartitionAlgo (October 2006)
7759 # other parameters are ignored by current functionality. They are kept
7760 # in this function only for support old versions.
7761 # @param ListKeepInside Shapes, outside which the results will be deleted.
7762 # Each shape from theKeepInside must belong to theShapes also.
7763 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7764 # Each shape from theRemoveInside must belong to theShapes also.
7765 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7766 # @param ListMaterials Material indices for each shape. Make sence,
7767 # only if theRemoveWebs is TRUE.
7769 # @return New GEOM.GEOM_Object, containing the result shapes.
7771 # @ref tui_partition "Example"
7772 @ManageTransactions("BoolOp")
7773 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7774 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7775 KeepNonlimitShapes=0, theName=None):
7777 Perform partition operation.
7780 ListShapes Shapes to be intersected.
7781 ListTools Shapes to intersect theShapes.
7782 Limit Type of resulting shapes (see geompy.ShapeType)
7783 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7784 type will be detected automatically.
7785 KeepNonlimitShapes if this parameter == 0, then only shapes of
7786 target type (equal to Limit) are kept in the result,
7787 else standalone shapes of lower dimension
7788 are kept also (if they exist).
7790 theName Object name; when specified, this parameter is used
7791 for result publication in the study. Otherwise, if automatic
7792 publication is switched on, default value is used for result name.
7794 Each compound from ListShapes and ListTools will be exploded
7795 in order to avoid possible intersection between shapes from
7798 After implementation new version of PartitionAlgo (October 2006) other
7799 parameters are ignored by current functionality. They are kept in this
7800 function only for support old versions.
7803 ListKeepInside Shapes, outside which the results will be deleted.
7804 Each shape from theKeepInside must belong to theShapes also.
7805 ListRemoveInside Shapes, inside which the results will be deleted.
7806 Each shape from theRemoveInside must belong to theShapes also.
7807 RemoveWebs If TRUE, perform Glue 3D algorithm.
7808 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7811 New GEOM.GEOM_Object, containing the result shapes.
7813 # Example: see GEOM_TestAll.py
7814 if Limit == self.ShapeType["AUTO"]:
7815 # automatic detection of the most appropriate shape limit type
7817 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7818 Limit = EnumToLong(lim)
7820 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7821 ListKeepInside, ListRemoveInside,
7822 Limit, RemoveWebs, ListMaterials,
7823 KeepNonlimitShapes);
7824 RaiseIfFailed("MakePartition", self.BoolOp)
7825 self._autoPublish(anObj, theName, "partition")
7828 ## Perform partition operation.
7829 # This method may be useful if it is needed to make a partition for
7830 # compound contains nonintersected shapes. Performance will be better
7831 # since intersection between shapes from compound is not performed.
7833 # Description of all parameters as in previous method MakePartition().
7834 # One additional parameter is provided:
7835 # @param checkSelfInte The flag that tells if the arguments should
7836 # be checked for self-intersection prior to the operation.
7838 # @note This algorithm doesn't find all types of self-intersections.
7839 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7840 # vertex/face and edge/face intersections. Face/face
7841 # intersections detection is switched off as it is a
7842 # time-consuming operation that gives an impact on performance.
7843 # To find all self-intersections please use
7844 # CheckSelfIntersections() method.
7846 # @note Passed compounds (via ListShapes or via ListTools)
7847 # have to consist of nonintersecting shapes.
7849 # @return New GEOM.GEOM_Object, containing the result shapes.
7851 # @ref swig_todo "Example"
7852 @ManageTransactions("BoolOp")
7853 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7854 ListKeepInside=[], ListRemoveInside=[],
7855 Limit=ShapeType["AUTO"], RemoveWebs=0,
7856 ListMaterials=[], KeepNonlimitShapes=0,
7857 checkSelfInte=False, theName=None):
7859 Perform partition operation.
7860 This method may be useful if it is needed to make a partition for
7861 compound contains nonintersected shapes. Performance will be better
7862 since intersection between shapes from compound is not performed.
7865 Description of all parameters as in method geompy.MakePartition.
7866 One additional parameter is provided:
7867 checkSelfInte The flag that tells if the arguments should
7868 be checked for self-intersection prior to
7872 This algorithm doesn't find all types of self-intersections.
7873 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7874 vertex/face and edge/face intersections. Face/face
7875 intersections detection is switched off as it is a
7876 time-consuming operation that gives an impact on performance.
7877 To find all self-intersections please use
7878 CheckSelfIntersections() method.
7881 Passed compounds (via ListShapes or via ListTools)
7882 have to consist of nonintersecting shapes.
7885 New GEOM.GEOM_Object, containing the result shapes.
7887 if Limit == self.ShapeType["AUTO"]:
7888 # automatic detection of the most appropriate shape limit type
7890 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7891 Limit = EnumToLong(lim)
7893 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7894 ListKeepInside, ListRemoveInside,
7895 Limit, RemoveWebs, ListMaterials,
7896 KeepNonlimitShapes, checkSelfInte);
7897 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7898 self._autoPublish(anObj, theName, "partition")
7901 ## See method MakePartition() for more information.
7903 # @ref tui_partition "Example 1"
7904 # \n @ref swig_Partition "Example 2"
7905 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7906 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7907 KeepNonlimitShapes=0, theName=None):
7909 See method geompy.MakePartition for more information.
7911 # Example: see GEOM_TestOthers.py
7912 # note: auto-publishing is done in self.MakePartition()
7913 anObj = self.MakePartition(ListShapes, ListTools,
7914 ListKeepInside, ListRemoveInside,
7915 Limit, RemoveWebs, ListMaterials,
7916 KeepNonlimitShapes, theName);
7919 ## Perform partition of the Shape with the Plane
7920 # @param theShape Shape to be intersected.
7921 # @param thePlane Tool shape, to intersect theShape.
7922 # @param theName Object name; when specified, this parameter is used
7923 # for result publication in the study. Otherwise, if automatic
7924 # publication is switched on, default value is used for result name.
7926 # @return New GEOM.GEOM_Object, containing the result shape.
7928 # @note This operation is a shortcut to the more general @ref MakePartition
7929 # operation, where @a theShape specifies single "object" (shape being partitioned)
7930 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
7931 # @ref MakePartition operation have default values:
7932 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
7933 # - @a KeepNonlimitShapes: 0
7934 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
7935 # @a Materials (obsolete parameters): empty
7937 # @note I.e. the following two operations are equivalent:
7939 # Result = geompy.MakeHalfPartition(Object, Plane)
7940 # Result = geompy.MakePartition([Object], [Plane])
7943 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
7945 # @ref tui_partition "Example"
7946 @ManageTransactions("BoolOp")
7947 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7949 Perform partition of the Shape with the Plane
7952 theShape Shape to be intersected.
7953 thePlane Tool shape, to intersect theShape.
7954 theName Object name; when specified, this parameter is used
7955 for result publication in the study. Otherwise, if automatic
7956 publication is switched on, default value is used for result name.
7959 New GEOM.GEOM_Object, containing the result shape.
7961 Note: This operation is a shortcut to the more general MakePartition
7962 operation, where theShape specifies single "object" (shape being partitioned)
7963 and thePlane specifies single "tool" (intersector shape). Other parameters of
7964 MakePartition operation have default values:
7965 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
7966 - KeepNonlimitShapes: 0
7967 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
7969 I.e. the following two operations are equivalent:
7970 Result = geompy.MakeHalfPartition(Object, Plane)
7971 Result = geompy.MakePartition([Object], [Plane])
7973 # Example: see GEOM_TestAll.py
7974 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7975 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7976 self._autoPublish(anObj, theName, "partition")
7979 # end of l3_basic_op
7982 ## @addtogroup l3_transform
7985 ## Translate the given object along the vector, specified
7986 # by its end points.
7987 # @param theObject The object to be translated.
7988 # @param thePoint1 Start point of translation vector.
7989 # @param thePoint2 End point of translation vector.
7990 # @param theCopy Flag used to translate object itself or create a copy.
7991 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7992 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7993 @ManageTransactions("TrsfOp")
7994 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7996 Translate the given object along the vector, specified by its end points.
7999 theObject The object to be translated.
8000 thePoint1 Start point of translation vector.
8001 thePoint2 End point of translation vector.
8002 theCopy Flag used to translate object itself or create a copy.
8005 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8006 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8009 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8011 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8012 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8015 ## Translate the given object along the vector, specified
8016 # by its end points, creating its copy before the translation.
8017 # @param theObject The object to be translated.
8018 # @param thePoint1 Start point of translation vector.
8019 # @param thePoint2 End point of translation vector.
8020 # @param theName Object name; when specified, this parameter is used
8021 # for result publication in the study. Otherwise, if automatic
8022 # publication is switched on, default value is used for result name.
8024 # @return New GEOM.GEOM_Object, containing the translated object.
8026 # @ref tui_translation "Example 1"
8027 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8028 @ManageTransactions("TrsfOp")
8029 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8031 Translate the given object along the vector, specified
8032 by its end points, creating its copy before the translation.
8035 theObject The object to be translated.
8036 thePoint1 Start point of translation vector.
8037 thePoint2 End point of translation vector.
8038 theName Object name; when specified, this parameter is used
8039 for result publication in the study. Otherwise, if automatic
8040 publication is switched on, default value is used for result name.
8043 New GEOM.GEOM_Object, containing the translated object.
8045 # Example: see GEOM_TestAll.py
8046 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8047 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8048 self._autoPublish(anObj, theName, "translated")
8051 ## Translate the given object along the vector, specified by its components.
8052 # @param theObject The object to be translated.
8053 # @param theDX,theDY,theDZ Components of translation vector.
8054 # @param theCopy Flag used to translate object itself or create a copy.
8055 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8056 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8058 # @ref tui_translation "Example"
8059 @ManageTransactions("TrsfOp")
8060 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8062 Translate the given object along the vector, specified by its components.
8065 theObject The object to be translated.
8066 theDX,theDY,theDZ Components of translation vector.
8067 theCopy Flag used to translate object itself or create a copy.
8070 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8071 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8073 # Example: see GEOM_TestAll.py
8074 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8076 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8078 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8079 anObj.SetParameters(Parameters)
8080 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8083 ## Translate the given object along the vector, specified
8084 # by its components, creating its copy before the translation.
8085 # @param theObject The object to be translated.
8086 # @param theDX,theDY,theDZ Components of translation vector.
8087 # @param theName Object name; when specified, this parameter is used
8088 # for result publication in the study. Otherwise, if automatic
8089 # publication is switched on, default value is used for result name.
8091 # @return New GEOM.GEOM_Object, containing the translated object.
8093 # @ref tui_translation "Example"
8094 @ManageTransactions("TrsfOp")
8095 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8097 Translate the given object along the vector, specified
8098 by its components, creating its copy before the translation.
8101 theObject The object to be translated.
8102 theDX,theDY,theDZ Components of translation vector.
8103 theName Object name; when specified, this parameter is used
8104 for result publication in the study. Otherwise, if automatic
8105 publication is switched on, default value is used for result name.
8108 New GEOM.GEOM_Object, containing the translated object.
8110 # Example: see GEOM_TestAll.py
8111 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8112 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8113 anObj.SetParameters(Parameters)
8114 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8115 self._autoPublish(anObj, theName, "translated")
8118 ## Translate the given object along the given vector.
8119 # @param theObject The object to be translated.
8120 # @param theVector The translation vector.
8121 # @param theCopy Flag used to translate object itself or create a copy.
8122 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8123 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8124 @ManageTransactions("TrsfOp")
8125 def TranslateVector(self, theObject, theVector, theCopy=False):
8127 Translate the given object along the given vector.
8130 theObject The object to be translated.
8131 theVector The translation vector.
8132 theCopy Flag used to translate object itself or create a copy.
8135 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8136 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8139 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8141 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8142 RaiseIfFailed("TranslateVector", self.TrsfOp)
8145 ## Translate the given object along the given vector,
8146 # creating its copy before the translation.
8147 # @param theObject The object to be translated.
8148 # @param theVector The translation vector.
8149 # @param theName Object name; when specified, this parameter is used
8150 # for result publication in the study. Otherwise, if automatic
8151 # publication is switched on, default value is used for result name.
8153 # @return New GEOM.GEOM_Object, containing the translated object.
8155 # @ref tui_translation "Example"
8156 @ManageTransactions("TrsfOp")
8157 def MakeTranslationVector(self, theObject, theVector, theName=None):
8159 Translate the given object along the given vector,
8160 creating its copy before the translation.
8163 theObject The object to be translated.
8164 theVector The translation vector.
8165 theName Object name; when specified, this parameter is used
8166 for result publication in the study. Otherwise, if automatic
8167 publication is switched on, default value is used for result name.
8170 New GEOM.GEOM_Object, containing the translated object.
8172 # Example: see GEOM_TestAll.py
8173 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8174 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8175 self._autoPublish(anObj, theName, "translated")
8178 ## Translate the given object along the given vector on given distance.
8179 # @param theObject The object to be translated.
8180 # @param theVector The translation vector.
8181 # @param theDistance The translation distance.
8182 # @param theCopy Flag used to translate object itself or create a copy.
8183 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8184 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8186 # @ref tui_translation "Example"
8187 @ManageTransactions("TrsfOp")
8188 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8190 Translate the given object along the given vector on given distance.
8193 theObject The object to be translated.
8194 theVector The translation vector.
8195 theDistance The translation distance.
8196 theCopy Flag used to translate object itself or create a copy.
8199 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8200 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8202 # Example: see GEOM_TestAll.py
8203 theDistance,Parameters = ParseParameters(theDistance)
8204 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8205 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8206 anObj.SetParameters(Parameters)
8209 ## Translate the given object along the given vector on given distance,
8210 # creating its copy before the translation.
8211 # @param theObject The object to be translated.
8212 # @param theVector The translation vector.
8213 # @param theDistance The translation distance.
8214 # @param theName Object name; when specified, this parameter is used
8215 # for result publication in the study. Otherwise, if automatic
8216 # publication is switched on, default value is used for result name.
8218 # @return New GEOM.GEOM_Object, containing the translated object.
8220 # @ref tui_translation "Example"
8221 @ManageTransactions("TrsfOp")
8222 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8224 Translate the given object along the given vector on given distance,
8225 creating its copy before the translation.
8228 theObject The object to be translated.
8229 theVector The translation vector.
8230 theDistance The translation distance.
8231 theName Object name; when specified, this parameter is used
8232 for result publication in the study. Otherwise, if automatic
8233 publication is switched on, default value is used for result name.
8236 New GEOM.GEOM_Object, containing the translated object.
8238 # Example: see GEOM_TestAll.py
8239 theDistance,Parameters = ParseParameters(theDistance)
8240 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8241 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8242 anObj.SetParameters(Parameters)
8243 self._autoPublish(anObj, theName, "translated")
8246 ## Rotate the given object around the given axis on the given angle.
8247 # @param theObject The object to be rotated.
8248 # @param theAxis Rotation axis.
8249 # @param theAngle Rotation angle in radians.
8250 # @param theCopy Flag used to rotate object itself or create a copy.
8252 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8253 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8255 # @ref tui_rotation "Example"
8256 @ManageTransactions("TrsfOp")
8257 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8259 Rotate the given object around the given axis on the given angle.
8262 theObject The object to be rotated.
8263 theAxis Rotation axis.
8264 theAngle Rotation angle in radians.
8265 theCopy Flag used to rotate object itself or create a copy.
8268 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8269 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8271 # Example: see GEOM_TestAll.py
8273 if isinstance(theAngle,str):
8275 theAngle, Parameters = ParseParameters(theAngle)
8277 theAngle = theAngle*math.pi/180.0
8279 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8281 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8282 RaiseIfFailed("Rotate", self.TrsfOp)
8283 anObj.SetParameters(Parameters)
8286 ## Rotate the given object around the given axis
8287 # on the given angle, creating its copy before the rotation.
8288 # @param theObject The object to be rotated.
8289 # @param theAxis Rotation axis.
8290 # @param theAngle Rotation angle in radians.
8291 # @param theName Object name; when specified, this parameter is used
8292 # for result publication in the study. Otherwise, if automatic
8293 # publication is switched on, default value is used for result name.
8295 # @return New GEOM.GEOM_Object, containing the rotated object.
8297 # @ref tui_rotation "Example"
8298 @ManageTransactions("TrsfOp")
8299 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8301 Rotate the given object around the given axis
8302 on the given angle, creating its copy before the rotatation.
8305 theObject The object to be rotated.
8306 theAxis Rotation axis.
8307 theAngle Rotation angle in radians.
8308 theName Object name; when specified, this parameter is used
8309 for result publication in the study. Otherwise, if automatic
8310 publication is switched on, default value is used for result name.
8313 New GEOM.GEOM_Object, containing the rotated object.
8315 # Example: see GEOM_TestAll.py
8317 if isinstance(theAngle,str):
8319 theAngle, Parameters = ParseParameters(theAngle)
8321 theAngle = theAngle*math.pi/180.0
8322 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8323 RaiseIfFailed("RotateCopy", self.TrsfOp)
8324 anObj.SetParameters(Parameters)
8325 self._autoPublish(anObj, theName, "rotated")
8328 ## Rotate given object around vector perpendicular to plane
8329 # containing three points.
8330 # @param theObject The object to be rotated.
8331 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8332 # containing the three points.
8333 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8334 # @param theCopy Flag used to rotate object itself or create a copy.
8335 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8336 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8337 @ManageTransactions("TrsfOp")
8338 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8340 Rotate given object around vector perpendicular to plane
8341 containing three points.
8344 theObject The object to be rotated.
8345 theCentPoint central point the axis is the vector perpendicular to the plane
8346 containing the three points.
8347 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8348 theCopy Flag used to rotate object itself or create a copy.
8351 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8352 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8355 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8357 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8358 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8361 ## Rotate given object around vector perpendicular to plane
8362 # containing three points, creating its copy before the rotatation.
8363 # @param theObject The object to be rotated.
8364 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8365 # containing the three points.
8366 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8367 # @param theName Object name; when specified, this parameter is used
8368 # for result publication in the study. Otherwise, if automatic
8369 # publication is switched on, default value is used for result name.
8371 # @return New GEOM.GEOM_Object, containing the rotated object.
8373 # @ref tui_rotation "Example"
8374 @ManageTransactions("TrsfOp")
8375 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8377 Rotate given object around vector perpendicular to plane
8378 containing three points, creating its copy before the rotatation.
8381 theObject The object to be rotated.
8382 theCentPoint central point the axis is the vector perpendicular to the plane
8383 containing the three points.
8384 thePoint1,thePoint2 in a perpendicular plane of the axis.
8385 theName Object name; when specified, this parameter is used
8386 for result publication in the study. Otherwise, if automatic
8387 publication is switched on, default value is used for result name.
8390 New GEOM.GEOM_Object, containing the rotated object.
8392 # Example: see GEOM_TestAll.py
8393 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8394 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8395 self._autoPublish(anObj, theName, "rotated")
8398 ## Scale the given object by the specified factor.
8399 # @param theObject The object to be scaled.
8400 # @param thePoint Center point for scaling.
8401 # Passing None for it means scaling relatively the origin of global CS.
8402 # @param theFactor Scaling factor value.
8403 # @param theCopy Flag used to scale object itself or create a copy.
8404 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8405 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8406 @ManageTransactions("TrsfOp")
8407 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8409 Scale the given object by the specified factor.
8412 theObject The object to be scaled.
8413 thePoint Center point for scaling.
8414 Passing None for it means scaling relatively the origin of global CS.
8415 theFactor Scaling factor value.
8416 theCopy Flag used to scale object itself or create a copy.
8419 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8420 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8422 # Example: see GEOM_TestAll.py
8423 theFactor, Parameters = ParseParameters(theFactor)
8425 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8427 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8428 RaiseIfFailed("Scale", self.TrsfOp)
8429 anObj.SetParameters(Parameters)
8432 ## Scale the given object by the factor, creating its copy before the scaling.
8433 # @param theObject The object to be scaled.
8434 # @param thePoint Center point for scaling.
8435 # Passing None for it means scaling relatively the origin of global CS.
8436 # @param theFactor Scaling factor value.
8437 # @param theName Object name; when specified, this parameter is used
8438 # for result publication in the study. Otherwise, if automatic
8439 # publication is switched on, default value is used for result name.
8441 # @return New GEOM.GEOM_Object, containing the scaled shape.
8443 # @ref tui_scale "Example"
8444 @ManageTransactions("TrsfOp")
8445 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8447 Scale the given object by the factor, creating its copy before the scaling.
8450 theObject The object to be scaled.
8451 thePoint Center point for scaling.
8452 Passing None for it means scaling relatively the origin of global CS.
8453 theFactor Scaling factor value.
8454 theName Object name; when specified, this parameter is used
8455 for result publication in the study. Otherwise, if automatic
8456 publication is switched on, default value is used for result name.
8459 New GEOM.GEOM_Object, containing the scaled shape.
8461 # Example: see GEOM_TestAll.py
8462 theFactor, Parameters = ParseParameters(theFactor)
8463 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8464 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8465 anObj.SetParameters(Parameters)
8466 self._autoPublish(anObj, theName, "scaled")
8469 ## Scale the given object by different factors along coordinate axes.
8470 # @param theObject The object to be scaled.
8471 # @param thePoint Center point for scaling.
8472 # Passing None for it means scaling relatively the origin of global CS.
8473 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8474 # @param theCopy Flag used to scale object itself or create a copy.
8475 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8476 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8477 @ManageTransactions("TrsfOp")
8478 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8480 Scale the given object by different factors along coordinate axes.
8483 theObject The object to be scaled.
8484 thePoint Center point for scaling.
8485 Passing None for it means scaling relatively the origin of global CS.
8486 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8487 theCopy Flag used to scale object itself or create a copy.
8490 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8491 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8493 # Example: see GEOM_TestAll.py
8494 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8496 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8497 theFactorX, theFactorY, theFactorZ)
8499 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8500 theFactorX, theFactorY, theFactorZ)
8501 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8502 anObj.SetParameters(Parameters)
8505 ## Scale the given object by different factors along coordinate axes,
8506 # creating its copy before the scaling.
8507 # @param theObject The object to be scaled.
8508 # @param thePoint Center point for scaling.
8509 # Passing None for it means scaling relatively the origin of global CS.
8510 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8511 # @param theName Object name; when specified, this parameter is used
8512 # for result publication in the study. Otherwise, if automatic
8513 # publication is switched on, default value is used for result name.
8515 # @return New GEOM.GEOM_Object, containing the scaled shape.
8517 # @ref swig_scale "Example"
8518 @ManageTransactions("TrsfOp")
8519 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8521 Scale the given object by different factors along coordinate axes,
8522 creating its copy before the scaling.
8525 theObject The object to be scaled.
8526 thePoint Center point for scaling.
8527 Passing None for it means scaling relatively the origin of global CS.
8528 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8529 theName Object name; when specified, this parameter is used
8530 for result publication in the study. Otherwise, if automatic
8531 publication is switched on, default value is used for result name.
8534 New GEOM.GEOM_Object, containing the scaled shape.
8536 # Example: see GEOM_TestAll.py
8537 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8538 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8539 theFactorX, theFactorY, theFactorZ)
8540 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8541 anObj.SetParameters(Parameters)
8542 self._autoPublish(anObj, theName, "scaled")
8545 ## Mirror an object relatively the given plane.
8546 # @param theObject The object to be mirrored.
8547 # @param thePlane Plane of symmetry.
8548 # @param theCopy Flag used to mirror object itself or create a copy.
8549 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8550 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8551 @ManageTransactions("TrsfOp")
8552 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8554 Mirror an object relatively the given plane.
8557 theObject The object to be mirrored.
8558 thePlane Plane of symmetry.
8559 theCopy Flag used to mirror object itself or create a copy.
8562 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8563 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8566 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8568 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8569 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8572 ## Create an object, symmetrical
8573 # to the given one relatively the given plane.
8574 # @param theObject The object to be mirrored.
8575 # @param thePlane Plane of symmetry.
8576 # @param theName Object name; when specified, this parameter is used
8577 # for result publication in the study. Otherwise, if automatic
8578 # publication is switched on, default value is used for result name.
8580 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8582 # @ref tui_mirror "Example"
8583 @ManageTransactions("TrsfOp")
8584 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8586 Create an object, symmetrical to the given one relatively the given plane.
8589 theObject The object to be mirrored.
8590 thePlane Plane of symmetry.
8591 theName Object name; when specified, this parameter is used
8592 for result publication in the study. Otherwise, if automatic
8593 publication is switched on, default value is used for result name.
8596 New GEOM.GEOM_Object, containing the mirrored shape.
8598 # Example: see GEOM_TestAll.py
8599 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8600 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8601 self._autoPublish(anObj, theName, "mirrored")
8604 ## Mirror an object relatively the given axis.
8605 # @param theObject The object to be mirrored.
8606 # @param theAxis Axis of symmetry.
8607 # @param theCopy Flag used to mirror object itself or create a copy.
8608 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8609 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8610 @ManageTransactions("TrsfOp")
8611 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8613 Mirror an object relatively the given axis.
8616 theObject The object to be mirrored.
8617 theAxis Axis of symmetry.
8618 theCopy Flag used to mirror object itself or create a copy.
8621 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8622 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8625 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8627 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8628 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8631 ## Create an object, symmetrical
8632 # to the given one relatively the given axis.
8633 # @param theObject The object to be mirrored.
8634 # @param theAxis Axis of symmetry.
8635 # @param theName Object name; when specified, this parameter is used
8636 # for result publication in the study. Otherwise, if automatic
8637 # publication is switched on, default value is used for result name.
8639 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8641 # @ref tui_mirror "Example"
8642 @ManageTransactions("TrsfOp")
8643 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8645 Create an object, symmetrical to the given one relatively the given axis.
8648 theObject The object to be mirrored.
8649 theAxis Axis of symmetry.
8650 theName Object name; when specified, this parameter is used
8651 for result publication in the study. Otherwise, if automatic
8652 publication is switched on, default value is used for result name.
8655 New GEOM.GEOM_Object, containing the mirrored shape.
8657 # Example: see GEOM_TestAll.py
8658 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8659 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8660 self._autoPublish(anObj, theName, "mirrored")
8663 ## Mirror an object relatively the given point.
8664 # @param theObject The object to be mirrored.
8665 # @param thePoint Point of symmetry.
8666 # @param theCopy Flag used to mirror object itself or create a copy.
8667 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8668 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8669 @ManageTransactions("TrsfOp")
8670 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8672 Mirror an object relatively the given point.
8675 theObject The object to be mirrored.
8676 thePoint Point of symmetry.
8677 theCopy Flag used to mirror object itself or create a copy.
8680 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8681 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8683 # Example: see GEOM_TestAll.py
8685 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8687 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8688 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8691 ## Create an object, symmetrical
8692 # to the given one relatively the given point.
8693 # @param theObject The object to be mirrored.
8694 # @param thePoint Point of symmetry.
8695 # @param theName Object name; when specified, this parameter is used
8696 # for result publication in the study. Otherwise, if automatic
8697 # publication is switched on, default value is used for result name.
8699 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8701 # @ref tui_mirror "Example"
8702 @ManageTransactions("TrsfOp")
8703 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8705 Create an object, symmetrical
8706 to the given one relatively the given point.
8709 theObject The object to be mirrored.
8710 thePoint Point of symmetry.
8711 theName Object name; when specified, this parameter is used
8712 for result publication in the study. Otherwise, if automatic
8713 publication is switched on, default value is used for result name.
8716 New GEOM.GEOM_Object, containing the mirrored shape.
8718 # Example: see GEOM_TestAll.py
8719 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8720 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8721 self._autoPublish(anObj, theName, "mirrored")
8724 ## Modify the location of the given object.
8725 # @param theObject The object to be displaced.
8726 # @param theStartLCS Coordinate system to perform displacement from it.\n
8727 # If \a theStartLCS is NULL, displacement
8728 # will be performed from global CS.\n
8729 # If \a theObject itself is used as \a theStartLCS,
8730 # its location will be changed to \a theEndLCS.
8731 # @param theEndLCS Coordinate system to perform displacement to it.
8732 # @param theCopy Flag used to displace object itself or create a copy.
8733 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8734 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8735 @ManageTransactions("TrsfOp")
8736 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8738 Modify the Location of the given object by LCS, creating its copy before the setting.
8741 theObject The object to be displaced.
8742 theStartLCS Coordinate system to perform displacement from it.
8743 If theStartLCS is NULL, displacement
8744 will be performed from global CS.
8745 If theObject itself is used as theStartLCS,
8746 its location will be changed to theEndLCS.
8747 theEndLCS Coordinate system to perform displacement to it.
8748 theCopy Flag used to displace object itself or create a copy.
8751 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8752 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8754 # Example: see GEOM_TestAll.py
8756 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8758 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8759 RaiseIfFailed("Displace", self.TrsfOp)
8762 ## Modify the Location of the given object by LCS,
8763 # creating its copy before the setting.
8764 # @param theObject The object to be displaced.
8765 # @param theStartLCS Coordinate system to perform displacement from it.\n
8766 # If \a theStartLCS is NULL, displacement
8767 # will be performed from global CS.\n
8768 # If \a theObject itself is used as \a theStartLCS,
8769 # its location will be changed to \a theEndLCS.
8770 # @param theEndLCS Coordinate system to perform displacement to it.
8771 # @param theName Object name; when specified, this parameter is used
8772 # for result publication in the study. Otherwise, if automatic
8773 # publication is switched on, default value is used for result name.
8775 # @return New GEOM.GEOM_Object, containing the displaced shape.
8777 # @ref tui_modify_location "Example"
8778 @ManageTransactions("TrsfOp")
8779 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8781 Modify the Location of the given object by LCS, creating its copy before the setting.
8784 theObject The object to be displaced.
8785 theStartLCS Coordinate system to perform displacement from it.
8786 If theStartLCS is NULL, displacement
8787 will be performed from global CS.
8788 If theObject itself is used as theStartLCS,
8789 its location will be changed to theEndLCS.
8790 theEndLCS Coordinate system to perform displacement to it.
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 displaced shape.
8799 # create local coordinate systems
8800 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8801 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8802 # modify the location of the given object
8803 position = geompy.MakePosition(cylinder, cs1, cs2)
8805 # Example: see GEOM_TestAll.py
8806 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8807 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8808 self._autoPublish(anObj, theName, "displaced")
8811 ## Modify the Location of the given object by Path.
8812 # @param theObject The object to be displaced.
8813 # @param thePath Wire or Edge along that the object will be translated.
8814 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8815 # @param theCopy is to create a copy objects if true.
8816 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8817 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8818 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8820 # @ref tui_modify_location "Example"
8821 @ManageTransactions("TrsfOp")
8822 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8824 Modify the Location of the given object by Path.
8827 theObject The object to be displaced.
8828 thePath Wire or Edge along that the object will be translated.
8829 theDistance progress of Path (0 = start location, 1 = end of path location).
8830 theCopy is to create a copy objects if true.
8831 theReverse 0 - for usual direction, 1 - to reverse path direction.
8834 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8835 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8838 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8840 # Example: see GEOM_TestAll.py
8841 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8842 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8845 ## Modify the Location of the given object by Path, creating its copy before the operation.
8846 # @param theObject The object to be displaced.
8847 # @param thePath Wire or Edge along that the object will be translated.
8848 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8849 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8850 # @param theName Object name; when specified, this parameter is used
8851 # for result publication in the study. Otherwise, if automatic
8852 # publication is switched on, default value is used for result name.
8854 # @return New GEOM.GEOM_Object, containing the displaced shape.
8855 @ManageTransactions("TrsfOp")
8856 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8858 Modify the Location of the given object by Path, creating its copy before the operation.
8861 theObject The object to be displaced.
8862 thePath Wire or Edge along that the object will be translated.
8863 theDistance progress of Path (0 = start location, 1 = end of path location).
8864 theReverse 0 - for usual direction, 1 - to reverse path direction.
8865 theName Object name; when specified, this parameter is used
8866 for result publication in the study. Otherwise, if automatic
8867 publication is switched on, default value is used for result name.
8870 New GEOM.GEOM_Object, containing the displaced shape.
8872 # Example: see GEOM_TestAll.py
8873 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8874 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8875 self._autoPublish(anObj, theName, "displaced")
8878 ## Offset given shape.
8879 # @param theObject The base object for the offset.
8880 # @param theOffset Offset value.
8881 # @param theCopy Flag used to offset object itself or create a copy.
8882 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8883 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8884 @ManageTransactions("TrsfOp")
8885 def Offset(self, theObject, theOffset, theCopy=False):
8890 theObject The base object for the offset.
8891 theOffset Offset value.
8892 theCopy Flag used to offset object itself or create a copy.
8895 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8896 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8898 theOffset, Parameters = ParseParameters(theOffset)
8900 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8902 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8903 RaiseIfFailed("Offset", self.TrsfOp)
8904 anObj.SetParameters(Parameters)
8907 ## Create new object as offset of the given one.
8908 # @param theObject The base object for the offset.
8909 # @param theOffset Offset value.
8910 # @param theName Object name; when specified, this parameter is used
8911 # for result publication in the study. Otherwise, if automatic
8912 # publication is switched on, default value is used for result name.
8914 # @return New GEOM.GEOM_Object, containing the offset object.
8916 # @ref tui_offset "Example"
8917 @ManageTransactions("TrsfOp")
8918 def MakeOffset(self, theObject, theOffset, theName=None):
8920 Create new object as offset of the given one.
8923 theObject The base object for the offset.
8924 theOffset Offset value.
8925 theName Object name; when specified, this parameter is used
8926 for result publication in the study. Otherwise, if automatic
8927 publication is switched on, default value is used for result name.
8930 New GEOM.GEOM_Object, containing the offset object.
8933 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8934 # create a new object as offset of the given object
8935 offset = geompy.MakeOffset(box, 70.)
8937 # Example: see GEOM_TestAll.py
8938 theOffset, Parameters = ParseParameters(theOffset)
8939 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8940 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8941 anObj.SetParameters(Parameters)
8942 self._autoPublish(anObj, theName, "offset")
8945 ## Create new object as projection of the given one on another.
8946 # @param theSource The source object for the projection. It can be a point, edge or wire.
8947 # Edge and wire are acceptable if @a theTarget is a face.
8948 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
8949 # @param theName Object name; when specified, this parameter is used
8950 # for result publication in the study. Otherwise, if automatic
8951 # publication is switched on, default value is used for result name.
8953 # @return New GEOM.GEOM_Object, containing the projection.
8955 # @ref tui_projection "Example"
8956 @ManageTransactions("TrsfOp")
8957 def MakeProjection(self, theSource, theTarget, theName=None):
8959 Create new object as projection of the given one on another.
8962 theSource The source object for the projection. It can be a point, edge or wire.
8963 Edge and wire are acceptable if theTarget is a face.
8964 theTarget The target object. It can be planar or cylindrical face, edge or wire.
8965 theName Object name; when specified, this parameter is used
8966 for result publication in the study. Otherwise, if automatic
8967 publication is switched on, default value is used for result name.
8970 New GEOM.GEOM_Object, containing the projection.
8972 # Example: see GEOM_TestAll.py
8973 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8974 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8975 self._autoPublish(anObj, theName, "projection")
8978 ## Create a projection projection of the given point on a wire or an edge.
8979 # If there are no solutions or there are 2 or more solutions It throws an
8981 # @param thePoint the point to be projected.
8982 # @param theWire the wire. The edge is accepted as well.
8983 # @param theName Object name; when specified, this parameter is used
8984 # for result publication in the study. Otherwise, if automatic
8985 # publication is switched on, default value is used for result name.
8987 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8988 # \n \a u: The parameter of projection point on edge.
8989 # \n \a PointOnEdge: The projection point.
8990 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8992 # @ref tui_projection "Example"
8993 @ManageTransactions("TrsfOp")
8994 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8996 Create a projection projection of the given point on a wire or an edge.
8997 If there are no solutions or there are 2 or more solutions It throws an
9001 thePoint the point to be projected.
9002 theWire the wire. The edge is accepted as well.
9003 theName Object name; when specified, this parameter is used
9004 for result publication in the study. Otherwise, if automatic
9005 publication is switched on, default value is used for result name.
9008 [u, PointOnEdge, EdgeInWireIndex]
9009 u: The parameter of projection point on edge.
9010 PointOnEdge: The projection point.
9011 EdgeInWireIndex: The index of an edge in a wire.
9013 # Example: see GEOM_TestAll.py
9014 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9015 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9016 self._autoPublish(anObj[1], theName, "projection")
9019 # -----------------------------------------------------------------------------
9021 # -----------------------------------------------------------------------------
9023 ## Translate the given object along the given vector a given number times
9024 # @param theObject The object to be translated.
9025 # @param theVector Direction of the translation. DX if None.
9026 # @param theStep Distance to translate on.
9027 # @param theNbTimes Quantity of translations to be done.
9028 # @param theName Object name; when specified, this parameter is used
9029 # for result publication in the study. Otherwise, if automatic
9030 # publication is switched on, default value is used for result name.
9032 # @return New GEOM.GEOM_Object, containing compound of all
9033 # the shapes, obtained after each translation.
9035 # @ref tui_multi_translation "Example"
9036 @ManageTransactions("TrsfOp")
9037 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9039 Translate the given object along the given vector a given number times
9042 theObject The object to be translated.
9043 theVector Direction of the translation. DX if None.
9044 theStep Distance to translate on.
9045 theNbTimes Quantity of translations to be done.
9046 theName Object name; when specified, this parameter is used
9047 for result publication in the study. Otherwise, if automatic
9048 publication is switched on, default value is used for result name.
9051 New GEOM.GEOM_Object, containing compound of all
9052 the shapes, obtained after each translation.
9055 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9057 # Example: see GEOM_TestAll.py
9058 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9059 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9060 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9061 anObj.SetParameters(Parameters)
9062 self._autoPublish(anObj, theName, "multitranslation")
9065 ## Conseqently apply two specified translations to theObject specified number of times.
9066 # @param theObject The object to be translated.
9067 # @param theVector1 Direction of the first translation. DX if None.
9068 # @param theStep1 Step of the first translation.
9069 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9070 # @param theVector2 Direction of the second translation. DY if None.
9071 # @param theStep2 Step of the second translation.
9072 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9073 # @param theName Object name; when specified, this parameter is used
9074 # for result publication in the study. Otherwise, if automatic
9075 # publication is switched on, default value is used for result name.
9077 # @return New GEOM.GEOM_Object, containing compound of all
9078 # the shapes, obtained after each translation.
9080 # @ref tui_multi_translation "Example"
9081 @ManageTransactions("TrsfOp")
9082 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9083 theVector2, theStep2, theNbTimes2, theName=None):
9085 Conseqently apply two specified translations to theObject specified number of times.
9088 theObject The object to be translated.
9089 theVector1 Direction of the first translation. DX if None.
9090 theStep1 Step of the first translation.
9091 theNbTimes1 Quantity of translations to be done along theVector1.
9092 theVector2 Direction of the second translation. DY if None.
9093 theStep2 Step of the second translation.
9094 theNbTimes2 Quantity of translations to be done along theVector2.
9095 theName Object name; when specified, this parameter is used
9096 for result publication in the study. Otherwise, if automatic
9097 publication is switched on, default value is used for result name.
9100 New GEOM.GEOM_Object, containing compound of all
9101 the shapes, obtained after each translation.
9104 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9106 # Example: see GEOM_TestAll.py
9107 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9108 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9109 theVector2, theStep2, theNbTimes2)
9110 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9111 anObj.SetParameters(Parameters)
9112 self._autoPublish(anObj, theName, "multitranslation")
9115 ## Rotate the given object around the given axis a given number times.
9116 # Rotation angle will be 2*PI/theNbTimes.
9117 # @param theObject The object to be rotated.
9118 # @param theAxis The rotation axis. DZ if None.
9119 # @param theNbTimes Quantity of rotations to be done.
9120 # @param theName Object name; when specified, this parameter is used
9121 # for result publication in the study. Otherwise, if automatic
9122 # publication is switched on, default value is used for result name.
9124 # @return New GEOM.GEOM_Object, containing compound of all the
9125 # shapes, obtained after each rotation.
9127 # @ref tui_multi_rotation "Example"
9128 @ManageTransactions("TrsfOp")
9129 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9131 Rotate the given object around the given axis a given number times.
9132 Rotation angle will be 2*PI/theNbTimes.
9135 theObject The object to be rotated.
9136 theAxis The rotation axis. DZ if None.
9137 theNbTimes Quantity of rotations to be done.
9138 theName Object name; when specified, this parameter is used
9139 for result publication in the study. Otherwise, if automatic
9140 publication is switched on, default value is used for result name.
9143 New GEOM.GEOM_Object, containing compound of all the
9144 shapes, obtained after each rotation.
9147 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9149 # Example: see GEOM_TestAll.py
9150 theNbTimes, Parameters = ParseParameters(theNbTimes)
9151 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9152 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9153 anObj.SetParameters(Parameters)
9154 self._autoPublish(anObj, theName, "multirotation")
9157 ## Rotate the given object around the given axis
9158 # a given number times on the given angle.
9159 # @param theObject The object to be rotated.
9160 # @param theAxis The rotation axis. DZ if None.
9161 # @param theAngleStep Rotation angle in radians.
9162 # @param theNbTimes Quantity of rotations to be done.
9163 # @param theName Object name; when specified, this parameter is used
9164 # for result publication in the study. Otherwise, if automatic
9165 # publication is switched on, default value is used for result name.
9167 # @return New GEOM.GEOM_Object, containing compound of all the
9168 # shapes, obtained after each rotation.
9170 # @ref tui_multi_rotation "Example"
9171 @ManageTransactions("TrsfOp")
9172 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9174 Rotate the given object around the given axis
9175 a given number times on the given angle.
9178 theObject The object to be rotated.
9179 theAxis The rotation axis. DZ if None.
9180 theAngleStep Rotation angle in radians.
9181 theNbTimes Quantity of rotations to be done.
9182 theName Object name; when specified, this parameter is used
9183 for result publication in the study. Otherwise, if automatic
9184 publication is switched on, default value is used for result name.
9187 New GEOM.GEOM_Object, containing compound of all the
9188 shapes, obtained after each rotation.
9191 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9193 # Example: see GEOM_TestAll.py
9194 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9195 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9196 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9197 anObj.SetParameters(Parameters)
9198 self._autoPublish(anObj, theName, "multirotation")
9201 ## Rotate the given object around the given axis a given
9202 # number times and multi-translate each rotation result.
9203 # Rotation angle will be 2*PI/theNbTimes1.
9204 # Translation direction passes through center of gravity
9205 # of rotated shape and its projection on the rotation axis.
9206 # @param theObject The object to be rotated.
9207 # @param theAxis Rotation axis. DZ if None.
9208 # @param theNbTimes1 Quantity of rotations to be done.
9209 # @param theRadialStep Translation distance.
9210 # @param theNbTimes2 Quantity of translations to be done.
9211 # @param theName Object name; when specified, this parameter is used
9212 # for result publication in the study. Otherwise, if automatic
9213 # publication is switched on, default value is used for result name.
9215 # @return New GEOM.GEOM_Object, containing compound of all the
9216 # shapes, obtained after each transformation.
9218 # @ref tui_multi_rotation "Example"
9219 @ManageTransactions("TrsfOp")
9220 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9222 Rotate the given object around the
9223 given axis on the given angle a given number
9224 times and multi-translate each rotation result.
9225 Translation direction passes through center of gravity
9226 of rotated shape and its projection on the rotation axis.
9229 theObject The object to be rotated.
9230 theAxis Rotation axis. DZ if None.
9231 theNbTimes1 Quantity of rotations to be done.
9232 theRadialStep Translation distance.
9233 theNbTimes2 Quantity of translations to be done.
9234 theName Object name; when specified, this parameter is used
9235 for result publication in the study. Otherwise, if automatic
9236 publication is switched on, default value is used for result name.
9239 New GEOM.GEOM_Object, containing compound of all the
9240 shapes, obtained after each transformation.
9243 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9245 # Example: see GEOM_TestAll.py
9246 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9247 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9248 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9249 anObj.SetParameters(Parameters)
9250 self._autoPublish(anObj, theName, "multirotation")
9253 ## Rotate the given object around the
9254 # given axis on the given angle a given number
9255 # times and multi-translate each rotation result.
9256 # Translation direction passes through center of gravity
9257 # of rotated shape and its projection on the rotation axis.
9258 # @param theObject The object to be rotated.
9259 # @param theAxis Rotation axis. DZ if None.
9260 # @param theAngleStep Rotation angle in radians.
9261 # @param theNbTimes1 Quantity of rotations to be done.
9262 # @param theRadialStep Translation distance.
9263 # @param theNbTimes2 Quantity of translations to be done.
9264 # @param theName Object name; when specified, this parameter is used
9265 # for result publication in the study. Otherwise, if automatic
9266 # publication is switched on, default value is used for result name.
9268 # @return New GEOM.GEOM_Object, containing compound of all the
9269 # shapes, obtained after each transformation.
9271 # @ref tui_multi_rotation "Example"
9272 @ManageTransactions("TrsfOp")
9273 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9275 Rotate the given object around the
9276 given axis on the given angle a given number
9277 times and multi-translate each rotation result.
9278 Translation direction passes through center of gravity
9279 of rotated shape and its projection on the rotation axis.
9282 theObject The object to be rotated.
9283 theAxis Rotation axis. DZ if None.
9284 theAngleStep Rotation angle in radians.
9285 theNbTimes1 Quantity of rotations to be done.
9286 theRadialStep Translation distance.
9287 theNbTimes2 Quantity of translations to be done.
9288 theName Object name; when specified, this parameter is used
9289 for result publication in the study. Otherwise, if automatic
9290 publication is switched on, default value is used for result name.
9293 New GEOM.GEOM_Object, containing compound of all the
9294 shapes, obtained after each transformation.
9297 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9299 # Example: see GEOM_TestAll.py
9300 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9301 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9302 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9303 anObj.SetParameters(Parameters)
9304 self._autoPublish(anObj, theName, "multirotation")
9307 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9309 # @ref swig_MakeMultiRotation "Example"
9310 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9312 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9315 pz = geompy.MakeVertex(0, 0, 100)
9316 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9317 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9319 # Example: see GEOM_TestOthers.py
9320 aVec = self.MakeLine(aPoint,aDir)
9321 # note: auto-publishing is done in self.MultiRotate1D()
9322 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9325 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9327 # @ref swig_MakeMultiRotation "Example"
9328 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9330 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9333 pz = geompy.MakeVertex(0, 0, 100)
9334 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9335 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9337 # Example: see GEOM_TestOthers.py
9338 aVec = self.MakeLine(aPoint,aDir)
9339 # note: auto-publishing is done in self.MultiRotate1D()
9340 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9343 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9345 # @ref swig_MakeMultiRotation "Example"
9346 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9348 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9351 pz = geompy.MakeVertex(0, 0, 100)
9352 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9353 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9355 # Example: see GEOM_TestOthers.py
9356 aVec = self.MakeLine(aPoint,aDir)
9357 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9358 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9361 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9363 # @ref swig_MakeMultiRotation "Example"
9364 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9366 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9369 pz = geompy.MakeVertex(0, 0, 100)
9370 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9371 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9373 # Example: see GEOM_TestOthers.py
9374 aVec = self.MakeLine(aPoint,aDir)
9375 # note: auto-publishing is done in self.MultiRotate2D()
9376 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9379 # end of l3_transform
9382 ## @addtogroup l3_transform_d
9385 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9386 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9388 Deprecated method. Use MultiRotate1DNbTimes instead.
9390 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9391 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9393 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9394 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9395 @ManageTransactions("TrsfOp")
9396 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9398 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9399 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9402 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9404 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9405 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9406 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9407 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9408 anObj.SetParameters(Parameters)
9409 self._autoPublish(anObj, theName, "multirotation")
9412 ## The same, as MultiRotate1D(), but axis is given by direction and point
9413 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9414 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9416 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9417 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9420 pz = geompy.MakeVertex(0, 0, 100)
9421 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9422 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9424 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9425 aVec = self.MakeLine(aPoint,aDir)
9426 # note: auto-publishing is done in self.MultiRotate1D()
9427 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9430 ## The same, as MultiRotate2D(), but axis is given by direction and point
9431 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9432 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9434 The same, as MultiRotate2D(), but axis is given by direction and point
9435 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9438 pz = geompy.MakeVertex(0, 0, 100)
9439 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9440 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9442 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9443 aVec = self.MakeLine(aPoint,aDir)
9444 # note: auto-publishing is done in self.MultiRotate2D()
9445 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9448 # end of l3_transform_d
9451 ## @addtogroup l3_local
9454 ## Perform a fillet on all edges of the given shape.
9455 # @param theShape Shape, to perform fillet on.
9456 # @param theR Fillet radius.
9457 # @param theName Object name; when specified, this parameter is used
9458 # for result publication in the study. Otherwise, if automatic
9459 # publication is switched on, default value is used for result name.
9461 # @return New GEOM.GEOM_Object, containing the result shape.
9463 # @ref tui_fillet "Example 1"
9464 # \n @ref swig_MakeFilletAll "Example 2"
9465 @ManageTransactions("LocalOp")
9466 def MakeFilletAll(self, theShape, theR, theName=None):
9468 Perform a fillet on all edges of the given shape.
9471 theShape Shape, to perform fillet on.
9473 theName Object name; when specified, this parameter is used
9474 for result publication in the study. Otherwise, if automatic
9475 publication is switched on, default value is used for result name.
9478 New GEOM.GEOM_Object, containing the result shape.
9481 filletall = geompy.MakeFilletAll(prism, 10.)
9483 # Example: see GEOM_TestOthers.py
9484 theR,Parameters = ParseParameters(theR)
9485 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9486 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9487 anObj.SetParameters(Parameters)
9488 self._autoPublish(anObj, theName, "fillet")
9491 ## Perform a fillet on the specified edges/faces of the given shape
9492 # @param theShape Shape, to perform fillet on.
9493 # @param theR Fillet radius.
9494 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9495 # @param theListShapes Global indices of edges/faces to perform fillet on.
9496 # @param theName Object name; when specified, this parameter is used
9497 # for result publication in the study. Otherwise, if automatic
9498 # publication is switched on, default value is used for result name.
9500 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9502 # @return New GEOM.GEOM_Object, containing the result shape.
9504 # @ref tui_fillet "Example"
9505 @ManageTransactions("LocalOp")
9506 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9508 Perform a fillet on the specified edges/faces of the given shape
9511 theShape Shape, to perform fillet on.
9513 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9514 theListShapes Global indices of edges/faces to perform fillet on.
9515 theName Object name; when specified, this parameter is used
9516 for result publication in the study. Otherwise, if automatic
9517 publication is switched on, default value is used for result name.
9520 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9523 New GEOM.GEOM_Object, containing the result shape.
9526 # get the list of IDs (IDList) for the fillet
9527 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9529 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9530 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9531 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9532 # make a fillet on the specified edges of the given shape
9533 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9535 # Example: see GEOM_TestAll.py
9536 theR,Parameters = ParseParameters(theR)
9538 if theShapeType == self.ShapeType["EDGE"]:
9539 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9540 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9542 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9543 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9544 anObj.SetParameters(Parameters)
9545 self._autoPublish(anObj, theName, "fillet")
9548 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9549 @ManageTransactions("LocalOp")
9550 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9552 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9555 # get the list of IDs (IDList) for the fillet
9556 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9558 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9559 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9560 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9561 # make a fillet on the specified edges of the given shape
9562 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9564 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9566 if theShapeType == self.ShapeType["EDGE"]:
9567 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9568 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9570 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9571 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9572 anObj.SetParameters(Parameters)
9573 self._autoPublish(anObj, theName, "fillet")
9576 ## Perform a fillet on the specified edges of the given shape
9577 # @param theShape Wire Shape to perform fillet on.
9578 # @param theR Fillet radius.
9579 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9580 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9581 # \note The list of vertices could be empty,
9582 # in this case fillet will done done at all vertices in wire
9583 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9584 # by the length of the edges, nearest to the fillet vertex.
9585 # But sometimes the next edge is C1 continuous with the one, nearest to
9586 # the fillet point, and such two (or more) edges can be united to allow
9587 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9588 # thus ignoring the secant vertex (vertices).
9589 # @param theName Object name; when specified, this parameter is used
9590 # for result publication in the study. Otherwise, if automatic
9591 # publication is switched on, default value is used for result name.
9593 # @return New GEOM.GEOM_Object, containing the result shape.
9595 # @ref tui_fillet2d "Example"
9596 @ManageTransactions("LocalOp")
9597 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9599 Perform a fillet on the specified edges of the given shape
9602 theShape Wire Shape to perform fillet on.
9604 theListOfVertexes Global indices of vertexes to perform fillet on.
9605 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9606 by the length of the edges, nearest to the fillet vertex.
9607 But sometimes the next edge is C1 continuous with the one, nearest to
9608 the fillet point, and such two (or more) edges can be united to allow
9609 bigger radius. Set this flag to TRUE to allow collinear edges union,
9610 thus ignoring the secant vertex (vertices).
9611 theName Object name; when specified, this parameter is used
9612 for result publication in the study. Otherwise, if automatic
9613 publication is switched on, default value is used for result name.
9615 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9617 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9620 New GEOM.GEOM_Object, containing the result shape.
9624 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9625 # make fillet at given wire vertices with giver radius
9626 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9628 # Example: see GEOM_TestAll.py
9629 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9630 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9631 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9632 anObj.SetParameters(Parameters)
9633 self._autoPublish(anObj, theName, "fillet")
9636 ## Perform a fillet at the specified vertices of the given face/shell.
9637 # @param theShape Face or Shell shape to perform fillet on.
9638 # @param theR Fillet radius.
9639 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9640 # @param theName Object name; when specified, this parameter is used
9641 # for result publication in the study. Otherwise, if automatic
9642 # publication is switched on, default value is used for result name.
9644 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9646 # @return New GEOM.GEOM_Object, containing the result shape.
9648 # @ref tui_fillet2d "Example"
9649 @ManageTransactions("LocalOp")
9650 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9652 Perform a fillet at the specified vertices of the given face/shell.
9655 theShape Face or Shell shape to perform fillet on.
9657 theListOfVertexes Global indices of vertexes to perform fillet on.
9658 theName Object name; when specified, this parameter is used
9659 for result publication in the study. Otherwise, if automatic
9660 publication is switched on, default value is used for result name.
9662 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9665 New GEOM.GEOM_Object, containing the result shape.
9668 face = geompy.MakeFaceHW(100, 100, 1)
9669 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9671 # Example: see GEOM_TestAll.py
9672 theR,Parameters = ParseParameters(theR)
9673 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9674 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9675 anObj.SetParameters(Parameters)
9676 self._autoPublish(anObj, theName, "fillet")
9679 ## Perform a symmetric chamfer on all edges of the given shape.
9680 # @param theShape Shape, to perform chamfer on.
9681 # @param theD Chamfer size along each face.
9682 # @param theName Object name; when specified, this parameter is used
9683 # for result publication in the study. Otherwise, if automatic
9684 # publication is switched on, default value is used for result name.
9686 # @return New GEOM.GEOM_Object, containing the result shape.
9688 # @ref tui_chamfer "Example 1"
9689 # \n @ref swig_MakeChamferAll "Example 2"
9690 @ManageTransactions("LocalOp")
9691 def MakeChamferAll(self, theShape, theD, theName=None):
9693 Perform a symmetric chamfer on all edges of the given shape.
9696 theShape Shape, to perform chamfer on.
9697 theD Chamfer size along each face.
9698 theName Object name; when specified, this parameter is used
9699 for result publication in the study. Otherwise, if automatic
9700 publication is switched on, default value is used for result name.
9703 New GEOM.GEOM_Object, containing the result shape.
9706 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9708 # Example: see GEOM_TestOthers.py
9709 theD,Parameters = ParseParameters(theD)
9710 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9711 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9712 anObj.SetParameters(Parameters)
9713 self._autoPublish(anObj, theName, "chamfer")
9716 ## Perform a chamfer on edges, common to the specified faces,
9717 # with distance D1 on the Face1
9718 # @param theShape Shape, to perform chamfer on.
9719 # @param theD1 Chamfer size along \a theFace1.
9720 # @param theD2 Chamfer size along \a theFace2.
9721 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9722 # @param theName Object name; when specified, this parameter is used
9723 # for result publication in the study. Otherwise, if automatic
9724 # publication is switched on, default value is used for result name.
9726 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9728 # @return New GEOM.GEOM_Object, containing the result shape.
9730 # @ref tui_chamfer "Example"
9731 @ManageTransactions("LocalOp")
9732 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9734 Perform a chamfer on edges, common to the specified faces,
9735 with distance D1 on the Face1
9738 theShape Shape, to perform chamfer on.
9739 theD1 Chamfer size along theFace1.
9740 theD2 Chamfer size along theFace2.
9741 theFace1,theFace2 Global indices of two faces of theShape.
9742 theName Object name; when specified, this parameter is used
9743 for result publication in the study. Otherwise, if automatic
9744 publication is switched on, default value is used for result name.
9747 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9750 New GEOM.GEOM_Object, containing the result shape.
9753 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9754 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9755 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9756 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9758 # Example: see GEOM_TestAll.py
9759 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9760 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9761 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9762 anObj.SetParameters(Parameters)
9763 self._autoPublish(anObj, theName, "chamfer")
9766 ## Perform a chamfer on edges
9767 # @param theShape Shape, to perform chamfer on.
9768 # @param theD Chamfer length
9769 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9770 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9771 # @param theName Object name; when specified, this parameter is used
9772 # for result publication in the study. Otherwise, if automatic
9773 # publication is switched on, default value is used for result name.
9775 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9777 # @return New GEOM.GEOM_Object, containing the result shape.
9778 @ManageTransactions("LocalOp")
9779 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9781 Perform a chamfer on edges
9784 theShape Shape, to perform chamfer on.
9785 theD1 Chamfer size along theFace1.
9786 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9787 theFace1,theFace2 Global indices of two faces of theShape.
9788 theName Object name; when specified, this parameter is used
9789 for result publication in the study. Otherwise, if automatic
9790 publication is switched on, default value is used for result name.
9793 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9796 New GEOM.GEOM_Object, containing the result shape.
9799 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9800 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9801 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9803 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9806 if isinstance(theAngle,str):
9808 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9810 theAngle = theAngle*math.pi/180.0
9811 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9812 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9813 anObj.SetParameters(Parameters)
9814 self._autoPublish(anObj, theName, "chamfer")
9817 ## Perform a chamfer on all edges of the specified faces,
9818 # with distance D1 on the first specified face (if several for one edge)
9819 # @param theShape Shape, to perform chamfer on.
9820 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9821 # connected to the edge, are in \a theFaces, \a theD1
9822 # will be get along face, which is nearer to \a theFaces beginning.
9823 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9824 # @param theFaces Sequence of global indices of faces of \a theShape.
9825 # @param theName Object name; when specified, this parameter is used
9826 # for result publication in the study. Otherwise, if automatic
9827 # publication is switched on, default value is used for result name.
9829 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9831 # @return New GEOM.GEOM_Object, containing the result shape.
9833 # @ref tui_chamfer "Example"
9834 @ManageTransactions("LocalOp")
9835 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9837 Perform a chamfer on all edges of the specified faces,
9838 with distance D1 on the first specified face (if several for one edge)
9841 theShape Shape, to perform chamfer on.
9842 theD1 Chamfer size along face from theFaces. If both faces,
9843 connected to the edge, are in theFaces, theD1
9844 will be get along face, which is nearer to theFaces beginning.
9845 theD2 Chamfer size along another of two faces, connected to the edge.
9846 theFaces Sequence of global indices of faces of theShape.
9847 theName Object name; when specified, this parameter is used
9848 for result publication in the study. Otherwise, if automatic
9849 publication is switched on, default value is used for result name.
9851 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9854 New GEOM.GEOM_Object, containing the result shape.
9856 # Example: see GEOM_TestAll.py
9857 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9858 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9859 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9860 anObj.SetParameters(Parameters)
9861 self._autoPublish(anObj, theName, "chamfer")
9864 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9865 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9867 # @ref swig_FilletChamfer "Example"
9868 @ManageTransactions("LocalOp")
9869 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9871 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9872 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9875 if isinstance(theAngle,str):
9877 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9879 theAngle = theAngle*math.pi/180.0
9880 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9881 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9882 anObj.SetParameters(Parameters)
9883 self._autoPublish(anObj, theName, "chamfer")
9886 ## Perform a chamfer on edges,
9887 # with distance D1 on the first specified face (if several for one edge)
9888 # @param theShape Shape, to perform chamfer on.
9889 # @param theD1,theD2 Chamfer size
9890 # @param theEdges Sequence of edges of \a theShape.
9891 # @param 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.
9895 # @return New GEOM.GEOM_Object, containing the result shape.
9897 # @ref swig_FilletChamfer "Example"
9898 @ManageTransactions("LocalOp")
9899 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9901 Perform a chamfer on edges,
9902 with distance D1 on the first specified face (if several for one edge)
9905 theShape Shape, to perform chamfer on.
9906 theD1,theD2 Chamfer size
9907 theEdges Sequence of edges of theShape.
9908 theName Object name; when specified, this parameter is used
9909 for result publication in the study. Otherwise, if automatic
9910 publication is switched on, default value is used for result name.
9913 New GEOM.GEOM_Object, containing the result shape.
9915 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9916 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9917 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9918 anObj.SetParameters(Parameters)
9919 self._autoPublish(anObj, theName, "chamfer")
9922 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9923 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9924 @ManageTransactions("LocalOp")
9925 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9927 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9928 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9931 if isinstance(theAngle,str):
9933 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9935 theAngle = theAngle*math.pi/180.0
9936 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9937 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9938 anObj.SetParameters(Parameters)
9939 self._autoPublish(anObj, theName, "chamfer")
9942 ## @sa MakeChamferEdge(), MakeChamferFaces()
9944 # @ref swig_MakeChamfer "Example"
9945 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9947 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9949 # Example: see GEOM_TestOthers.py
9951 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9952 if aShapeType == self.ShapeType["EDGE"]:
9953 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9955 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9958 ## Remove material from a solid by extrusion of the base shape on the given distance.
9959 # @param theInit Shape to remove material from. It must be a solid or
9960 # a compound made of a single solid.
9961 # @param theBase Closed edge or wire defining the base shape to be extruded.
9962 # @param theH Prism dimension along the normal to theBase
9963 # @param theAngle Draft angle in degrees.
9964 # @param theName Object name; when specified, this parameter is used
9965 # for result publication in the study. Otherwise, if automatic
9966 # publication is switched on, default value is used for result name.
9968 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9970 # @ref tui_creation_prism "Example"
9971 @ManageTransactions("PrimOp")
9972 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9974 Add material to a solid by extrusion of the base shape on the given distance.
9977 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9978 theBase Closed edge or wire defining the base shape to be extruded.
9979 theH Prism dimension along the normal to theBase
9980 theAngle Draft angle in degrees.
9981 theName Object name; when specified, this parameter is used
9982 for result publication in the study. Otherwise, if automatic
9983 publication is switched on, default value is used for result name.
9986 New GEOM.GEOM_Object, containing the initial shape with removed material.
9988 # Example: see GEOM_TestAll.py
9989 #theH,Parameters = ParseParameters(theH)
9990 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9991 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9992 #anObj.SetParameters(Parameters)
9993 self._autoPublish(anObj, theName, "extrudedCut")
9996 ## Add material to a solid by extrusion of the base shape on the given distance.
9997 # @param theInit Shape to add material to. It must be a solid or
9998 # a compound made of a single solid.
9999 # @param theBase Closed edge or wire defining the base shape to be extruded.
10000 # @param theH Prism dimension along the normal to theBase
10001 # @param theAngle Draft angle in degrees.
10002 # @param theName Object name; when specified, this parameter is used
10003 # for result publication in the study. Otherwise, if automatic
10004 # publication is switched on, default value is used for result name.
10006 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10008 # @ref tui_creation_prism "Example"
10009 @ManageTransactions("PrimOp")
10010 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
10012 Add material to a solid by extrusion of the base shape on the given distance.
10015 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10016 theBase Closed edge or wire defining the base shape to be extruded.
10017 theH Prism dimension along the normal to theBase
10018 theAngle Draft angle in degrees.
10019 theName Object name; when specified, this parameter is used
10020 for result publication in the study. Otherwise, if automatic
10021 publication is switched on, default value is used for result name.
10024 New GEOM.GEOM_Object, containing the initial shape with added material.
10026 # Example: see GEOM_TestAll.py
10027 #theH,Parameters = ParseParameters(theH)
10028 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
10029 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10030 #anObj.SetParameters(Parameters)
10031 self._autoPublish(anObj, theName, "extrudedBoss")
10037 ## @addtogroup l3_basic_op
10040 ## Perform an Archimde operation on the given shape with given parameters.
10041 # The object presenting the resulting face is returned.
10042 # @param theShape Shape to be put in water.
10043 # @param theWeight Weight of the shape.
10044 # @param theWaterDensity Density of the water.
10045 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
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 a section of \a theShape
10051 # by a plane, corresponding to water level.
10053 # @ref tui_archimede "Example"
10054 @ManageTransactions("LocalOp")
10055 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10057 Perform an Archimde operation on the given shape with given parameters.
10058 The object presenting the resulting face is returned.
10061 theShape Shape to be put in water.
10062 theWeight Weight of the shape.
10063 theWaterDensity Density of the water.
10064 theMeshDeflection Deflection of the mesh, using to compute the section.
10065 theName Object name; when specified, this parameter is used
10066 for result publication in the study. Otherwise, if automatic
10067 publication is switched on, default value is used for result name.
10070 New GEOM.GEOM_Object, containing a section of theShape
10071 by a plane, corresponding to water level.
10073 # Example: see GEOM_TestAll.py
10074 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10075 theWeight,theWaterDensity,theMeshDeflection)
10076 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10077 RaiseIfFailed("MakeArchimede", self.LocalOp)
10078 anObj.SetParameters(Parameters)
10079 self._autoPublish(anObj, theName, "archimede")
10082 # end of l3_basic_op
10085 ## @addtogroup l2_measure
10088 ## Get point coordinates
10089 # @return [x, y, z]
10091 # @ref tui_point_coordinates_page "Example"
10092 @ManageTransactions("MeasuOp")
10093 def PointCoordinates(self,Point):
10095 Get point coordinates
10100 # Example: see GEOM_TestMeasures.py
10101 aTuple = self.MeasuOp.PointCoordinates(Point)
10102 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10105 ## Get vector coordinates
10106 # @return [x, y, z]
10108 # @ref tui_measurement_tools_page "Example"
10109 def VectorCoordinates(self,Vector):
10111 Get vector coordinates
10117 p1=self.GetFirstVertex(Vector)
10118 p2=self.GetLastVertex(Vector)
10120 X1=self.PointCoordinates(p1)
10121 X2=self.PointCoordinates(p2)
10123 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10126 ## Compute cross product
10127 # @return vector w=u^v
10129 # @ref tui_measurement_tools_page "Example"
10130 def CrossProduct(self, Vector1, Vector2):
10132 Compute cross product
10134 Returns: vector w=u^v
10136 u=self.VectorCoordinates(Vector1)
10137 v=self.VectorCoordinates(Vector2)
10138 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])
10142 ## Compute cross product
10143 # @return dot product p=u.v
10145 # @ref tui_measurement_tools_page "Example"
10146 def DotProduct(self, Vector1, Vector2):
10148 Compute cross product
10150 Returns: dot product p=u.v
10152 u=self.VectorCoordinates(Vector1)
10153 v=self.VectorCoordinates(Vector2)
10154 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10159 ## Get summarized length of all wires,
10160 # area of surface and volume of the given shape.
10161 # @param theShape Shape to define properties of.
10162 # @return [theLength, theSurfArea, theVolume]\n
10163 # theLength: Summarized length of all wires of the given shape.\n
10164 # theSurfArea: Area of surface of the given shape.\n
10165 # theVolume: Volume of the given shape.
10167 # @ref tui_basic_properties_page "Example"
10168 @ManageTransactions("MeasuOp")
10169 def BasicProperties(self,theShape):
10171 Get summarized length of all wires,
10172 area of surface and volume of the given shape.
10175 theShape Shape to define properties of.
10178 [theLength, theSurfArea, theVolume]
10179 theLength: Summarized length of all wires of the given shape.
10180 theSurfArea: Area of surface of the given shape.
10181 theVolume: Volume of the given shape.
10183 # Example: see GEOM_TestMeasures.py
10184 aTuple = self.MeasuOp.GetBasicProperties(theShape)
10185 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10188 ## Get parameters of bounding box of the given shape
10189 # @param theShape Shape to obtain bounding box of.
10190 # @param precise TRUE for precise computation; FALSE for fast one.
10191 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10192 # Xmin,Xmax: Limits of shape along OX axis.
10193 # Ymin,Ymax: Limits of shape along OY axis.
10194 # Zmin,Zmax: Limits of shape along OZ axis.
10196 # @ref tui_bounding_box_page "Example"
10197 @ManageTransactions("MeasuOp")
10198 def BoundingBox (self, theShape, precise=False):
10200 Get parameters of bounding box of the given shape
10203 theShape Shape to obtain bounding box of.
10204 precise TRUE for precise computation; FALSE for fast one.
10207 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10208 Xmin,Xmax: Limits of shape along OX axis.
10209 Ymin,Ymax: Limits of shape along OY axis.
10210 Zmin,Zmax: Limits of shape along OZ axis.
10212 # Example: see GEOM_TestMeasures.py
10213 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10214 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10217 ## Get bounding box of the given shape
10218 # @param theShape Shape to obtain bounding box of.
10219 # @param precise TRUE for precise computation; FALSE for fast one.
10220 # @param theName Object name; when specified, this parameter is used
10221 # for result publication in the study. Otherwise, if automatic
10222 # publication is switched on, default value is used for result name.
10224 # @return New GEOM.GEOM_Object, containing the created box.
10226 # @ref tui_bounding_box_page "Example"
10227 @ManageTransactions("MeasuOp")
10228 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10230 Get bounding box of the given shape
10233 theShape Shape to obtain bounding box of.
10234 precise TRUE for precise computation; FALSE for fast one.
10235 theName Object name; when specified, this parameter is used
10236 for result publication in the study. Otherwise, if automatic
10237 publication is switched on, default value is used for result name.
10240 New GEOM.GEOM_Object, containing the created box.
10242 # Example: see GEOM_TestMeasures.py
10243 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10244 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10245 self._autoPublish(anObj, theName, "bndbox")
10248 ## Get inertia matrix and moments of inertia of theShape.
10249 # @param theShape Shape to calculate inertia of.
10250 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10251 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10252 # Ix,Iy,Iz: Moments of inertia of the given shape.
10254 # @ref tui_inertia_page "Example"
10255 @ManageTransactions("MeasuOp")
10256 def Inertia(self,theShape):
10258 Get inertia matrix and moments of inertia of theShape.
10261 theShape Shape to calculate inertia of.
10264 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10265 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10266 Ix,Iy,Iz: Moments of inertia of the given shape.
10268 # Example: see GEOM_TestMeasures.py
10269 aTuple = self.MeasuOp.GetInertia(theShape)
10270 RaiseIfFailed("GetInertia", self.MeasuOp)
10273 ## Get if coords are included in the shape (ST_IN or ST_ON)
10274 # @param theShape Shape
10275 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10276 # @param tolerance to be used (default is 1.0e-7)
10277 # @return list_of_boolean = [res1, res2, ...]
10278 @ManageTransactions("MeasuOp")
10279 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10281 Get if coords are included in the shape (ST_IN or ST_ON)
10285 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10286 tolerance to be used (default is 1.0e-7)
10289 list_of_boolean = [res1, res2, ...]
10291 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10293 ## Get minimal distance between the given shapes.
10294 # @param theShape1,theShape2 Shapes to find minimal distance between.
10295 # @return Value of the minimal distance between the given shapes.
10297 # @ref tui_min_distance_page "Example"
10298 @ManageTransactions("MeasuOp")
10299 def MinDistance(self, theShape1, theShape2):
10301 Get minimal distance between the given shapes.
10304 theShape1,theShape2 Shapes to find minimal distance between.
10307 Value of the minimal distance between the given shapes.
10309 # Example: see GEOM_TestMeasures.py
10310 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10311 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10314 ## Get minimal distance between the given shapes.
10315 # @param theShape1,theShape2 Shapes to find minimal distance between.
10316 # @return Value of the minimal distance between the given shapes, in form of list
10317 # [Distance, DX, DY, DZ].
10319 # @ref tui_min_distance_page "Example"
10320 @ManageTransactions("MeasuOp")
10321 def MinDistanceComponents(self, theShape1, theShape2):
10323 Get minimal distance between the given shapes.
10326 theShape1,theShape2 Shapes to find minimal distance between.
10329 Value of the minimal distance between the given shapes, in form of list
10330 [Distance, DX, DY, DZ]
10332 # Example: see GEOM_TestMeasures.py
10333 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10334 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10335 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10338 ## Get closest points of the given shapes.
10339 # @param theShape1,theShape2 Shapes to find closest points of.
10340 # @return The number of found solutions (-1 in case of infinite number of
10341 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10343 # @ref tui_min_distance_page "Example"
10344 @ManageTransactions("MeasuOp")
10345 def ClosestPoints (self, theShape1, theShape2):
10347 Get closest points of the given shapes.
10350 theShape1,theShape2 Shapes to find closest points of.
10353 The number of found solutions (-1 in case of infinite number of
10354 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10356 # Example: see GEOM_TestMeasures.py
10357 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10358 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10361 ## Get angle between the given shapes in degrees.
10362 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10363 # @note If both arguments are vectors, the angle is computed in accordance
10364 # with their orientations, otherwise the minimum angle is computed.
10365 # @return Value of the angle between the given shapes in degrees.
10367 # @ref tui_angle_page "Example"
10368 @ManageTransactions("MeasuOp")
10369 def GetAngle(self, theShape1, theShape2):
10371 Get angle between the given shapes in degrees.
10374 theShape1,theShape2 Lines or linear edges to find angle between.
10377 If both arguments are vectors, the angle is computed in accordance
10378 with their orientations, otherwise the minimum angle is computed.
10381 Value of the angle between the given shapes in degrees.
10383 # Example: see GEOM_TestMeasures.py
10384 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10385 RaiseIfFailed("GetAngle", self.MeasuOp)
10388 ## Get angle between the given shapes in radians.
10389 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10390 # @note If both arguments are vectors, the angle is computed in accordance
10391 # with their orientations, otherwise the minimum angle is computed.
10392 # @return Value of the angle between the given shapes in radians.
10394 # @ref tui_angle_page "Example"
10395 @ManageTransactions("MeasuOp")
10396 def GetAngleRadians(self, theShape1, theShape2):
10398 Get angle between the given shapes in radians.
10401 theShape1,theShape2 Lines or linear edges to find angle between.
10405 If both arguments are vectors, the angle is computed in accordance
10406 with their orientations, otherwise the minimum angle is computed.
10409 Value of the angle between the given shapes in radians.
10411 # Example: see GEOM_TestMeasures.py
10412 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10413 RaiseIfFailed("GetAngle", self.MeasuOp)
10416 ## Get angle between the given vectors in degrees.
10417 # @param theShape1,theShape2 Vectors to find angle between.
10418 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10419 # if False, the opposite vector to the normal vector is used.
10420 # @return Value of the angle between the given vectors in degrees.
10422 # @ref tui_angle_page "Example"
10423 @ManageTransactions("MeasuOp")
10424 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10426 Get angle between the given vectors in degrees.
10429 theShape1,theShape2 Vectors to find angle between.
10430 theFlag If True, the normal vector is defined by the two vectors cross,
10431 if False, the opposite vector to the normal vector is used.
10434 Value of the angle between the given vectors in degrees.
10436 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10438 anAngle = 360. - anAngle
10439 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10442 ## The same as GetAngleVectors, but the result is in radians.
10443 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10445 Get angle between the given vectors in radians.
10448 theShape1,theShape2 Vectors to find angle between.
10449 theFlag If True, the normal vector is defined by the two vectors cross,
10450 if False, the opposite vector to the normal vector is used.
10453 Value of the angle between the given vectors in radians.
10455 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10458 ## @name Curve Curvature Measurement
10459 # Methods for receiving radius of curvature of curves
10460 # in the given point
10463 ## Measure curvature of a curve at a point, set by parameter.
10464 # @param theCurve a curve.
10465 # @param theParam parameter.
10466 # @return radius of curvature of \a theCurve.
10468 # @ref swig_todo "Example"
10469 @ManageTransactions("MeasuOp")
10470 def CurveCurvatureByParam(self, theCurve, theParam):
10472 Measure curvature of a curve at a point, set by parameter.
10476 theParam parameter.
10479 radius of curvature of theCurve.
10481 # Example: see GEOM_TestMeasures.py
10482 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10483 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10486 ## Measure curvature of a curve at a point.
10487 # @param theCurve a curve.
10488 # @param thePoint given point.
10489 # @return radius of curvature of \a theCurve.
10491 # @ref swig_todo "Example"
10492 @ManageTransactions("MeasuOp")
10493 def CurveCurvatureByPoint(self, theCurve, thePoint):
10495 Measure curvature of a curve at a point.
10499 thePoint given point.
10502 radius of curvature of theCurve.
10504 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10505 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10509 ## @name Surface Curvature Measurement
10510 # Methods for receiving max and min radius of curvature of surfaces
10511 # in the given point
10514 ## Measure max radius of curvature of surface.
10515 # @param theSurf the given surface.
10516 # @param theUParam Value of U-parameter on the referenced surface.
10517 # @param theVParam Value of V-parameter on the referenced surface.
10518 # @return max radius of curvature of theSurf.
10520 ## @ref swig_todo "Example"
10521 @ManageTransactions("MeasuOp")
10522 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10524 Measure max radius of curvature of surface.
10527 theSurf the given surface.
10528 theUParam Value of U-parameter on the referenced surface.
10529 theVParam Value of V-parameter on the referenced surface.
10532 max radius of curvature of theSurf.
10534 # Example: see GEOM_TestMeasures.py
10535 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10536 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10539 ## Measure max radius of curvature of surface in the given point
10540 # @param theSurf the given surface.
10541 # @param thePoint given point.
10542 # @return max radius of curvature of theSurf.
10544 ## @ref swig_todo "Example"
10545 @ManageTransactions("MeasuOp")
10546 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10548 Measure max radius of curvature of surface in the given point.
10551 theSurf the given surface.
10552 thePoint given point.
10555 max radius of curvature of theSurf.
10557 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10558 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10561 ## Measure min radius of curvature of surface.
10562 # @param theSurf the given surface.
10563 # @param theUParam Value of U-parameter on the referenced surface.
10564 # @param theVParam Value of V-parameter on the referenced surface.
10565 # @return min radius of curvature of theSurf.
10567 ## @ref swig_todo "Example"
10568 @ManageTransactions("MeasuOp")
10569 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10571 Measure min radius of curvature of surface.
10574 theSurf the given surface.
10575 theUParam Value of U-parameter on the referenced surface.
10576 theVParam Value of V-parameter on the referenced surface.
10579 Min radius of curvature of theSurf.
10581 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10582 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10585 ## Measure min radius of curvature of surface in the given point
10586 # @param theSurf the given surface.
10587 # @param thePoint given point.
10588 # @return min radius of curvature of theSurf.
10590 ## @ref swig_todo "Example"
10591 @ManageTransactions("MeasuOp")
10592 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10594 Measure min radius of curvature of surface in the given point.
10597 theSurf the given surface.
10598 thePoint given point.
10601 Min radius of curvature of theSurf.
10603 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10604 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10608 ## Get min and max tolerances of sub-shapes of theShape
10609 # @param theShape Shape, to get tolerances of.
10610 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10611 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10612 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10613 # VertMin,VertMax: Min and max tolerances of the vertices.
10615 # @ref tui_tolerance_page "Example"
10616 @ManageTransactions("MeasuOp")
10617 def Tolerance(self,theShape):
10619 Get min and max tolerances of sub-shapes of theShape
10622 theShape Shape, to get tolerances of.
10625 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10626 FaceMin,FaceMax: Min and max tolerances of the faces.
10627 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10628 VertMin,VertMax: Min and max tolerances of the vertices.
10630 # Example: see GEOM_TestMeasures.py
10631 aTuple = self.MeasuOp.GetTolerance(theShape)
10632 RaiseIfFailed("GetTolerance", self.MeasuOp)
10635 ## Obtain description of the given shape (number of sub-shapes of each type)
10636 # @param theShape Shape to be described.
10637 # @return Description of the given shape.
10639 # @ref tui_whatis_page "Example"
10640 @ManageTransactions("MeasuOp")
10641 def WhatIs(self,theShape):
10643 Obtain description of the given shape (number of sub-shapes of each type)
10646 theShape Shape to be described.
10649 Description of the given shape.
10651 # Example: see GEOM_TestMeasures.py
10652 aDescr = self.MeasuOp.WhatIs(theShape)
10653 RaiseIfFailed("WhatIs", self.MeasuOp)
10656 ## Obtain quantity of shapes of the given type in \a theShape.
10657 # If \a theShape is of type \a theType, it is also counted.
10658 # @param theShape Shape to be described.
10659 # @param theType the given ShapeType().
10660 # @return Quantity of shapes of type \a theType in \a theShape.
10662 # @ref tui_measurement_tools_page "Example"
10663 def NbShapes (self, theShape, theType):
10665 Obtain quantity of shapes of the given type in theShape.
10666 If theShape is of type theType, it is also counted.
10669 theShape Shape to be described.
10670 theType the given geompy.ShapeType
10673 Quantity of shapes of type theType in theShape.
10675 # Example: see GEOM_TestMeasures.py
10676 listSh = self.SubShapeAllIDs(theShape, theType)
10680 ## Obtain quantity of shapes of each type in \a theShape.
10681 # The \a theShape is also counted.
10682 # @param theShape Shape to be described.
10683 # @return Dictionary of ShapeType() with bound quantities of shapes.
10685 # @ref tui_measurement_tools_page "Example"
10686 def ShapeInfo (self, theShape):
10688 Obtain quantity of shapes of each type in theShape.
10689 The theShape is also counted.
10692 theShape Shape to be described.
10695 Dictionary of geompy.ShapeType with bound quantities of shapes.
10697 # Example: see GEOM_TestMeasures.py
10699 for typeSh in self.ShapeType:
10700 if typeSh in ( "AUTO", "SHAPE" ): continue
10701 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10707 def GetCreationInformation(self, theShape):
10708 info = theShape.GetCreationInformation()
10710 opName = info.operationName
10711 if not opName: opName = "no info available"
10712 res = "Operation: " + opName
10714 for parVal in info.params:
10715 res += " \n %s = %s" % ( parVal.name, parVal.value )
10718 ## Get a point, situated at the centre of mass of theShape.
10719 # @param theShape Shape to define centre of mass of.
10720 # @param theName Object name; when specified, this parameter is used
10721 # for result publication in the study. Otherwise, if automatic
10722 # publication is switched on, default value is used for result name.
10724 # @return New GEOM.GEOM_Object, containing the created point.
10726 # @ref tui_center_of_mass_page "Example"
10727 @ManageTransactions("MeasuOp")
10728 def MakeCDG(self, theShape, theName=None):
10730 Get a point, situated at the centre of mass of theShape.
10733 theShape Shape to define centre of mass of.
10734 theName Object name; when specified, this parameter is used
10735 for result publication in the study. Otherwise, if automatic
10736 publication is switched on, default value is used for result name.
10739 New GEOM.GEOM_Object, containing the created point.
10741 # Example: see GEOM_TestMeasures.py
10742 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10743 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10744 self._autoPublish(anObj, theName, "centerOfMass")
10747 ## Get a vertex sub-shape by index depended with orientation.
10748 # @param theShape Shape to find sub-shape.
10749 # @param theIndex Index to find vertex by this index (starting from zero)
10750 # @param theName Object name; when specified, this parameter is used
10751 # for result publication in the study. Otherwise, if automatic
10752 # publication is switched on, default value is used for result name.
10754 # @return New GEOM.GEOM_Object, containing the created vertex.
10756 # @ref tui_measurement_tools_page "Example"
10757 @ManageTransactions("MeasuOp")
10758 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10760 Get a vertex sub-shape by index depended with orientation.
10763 theShape Shape to find sub-shape.
10764 theIndex Index to find vertex by this index (starting from zero)
10765 theName Object name; when specified, this parameter is used
10766 for result publication in the study. Otherwise, if automatic
10767 publication is switched on, default value is used for result name.
10770 New GEOM.GEOM_Object, containing the created vertex.
10772 # Example: see GEOM_TestMeasures.py
10773 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10774 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10775 self._autoPublish(anObj, theName, "vertex")
10778 ## Get the first vertex of wire/edge depended orientation.
10779 # @param theShape Shape to find first vertex.
10780 # @param theName Object name; when specified, this parameter is used
10781 # for result publication in the study. Otherwise, if automatic
10782 # publication is switched on, default value is used for result name.
10784 # @return New GEOM.GEOM_Object, containing the created vertex.
10786 # @ref tui_measurement_tools_page "Example"
10787 def GetFirstVertex(self, theShape, theName=None):
10789 Get the first vertex of wire/edge depended orientation.
10792 theShape Shape to find first vertex.
10793 theName Object name; when specified, this parameter is used
10794 for result publication in the study. Otherwise, if automatic
10795 publication is switched on, default value is used for result name.
10798 New GEOM.GEOM_Object, containing the created vertex.
10800 # Example: see GEOM_TestMeasures.py
10801 # note: auto-publishing is done in self.GetVertexByIndex()
10802 return self.GetVertexByIndex(theShape, 0, theName)
10804 ## Get the last vertex of wire/edge depended orientation.
10805 # @param theShape Shape to find last vertex.
10806 # @param theName Object name; when specified, this parameter is used
10807 # for result publication in the study. Otherwise, if automatic
10808 # publication is switched on, default value is used for result name.
10810 # @return New GEOM.GEOM_Object, containing the created vertex.
10812 # @ref tui_measurement_tools_page "Example"
10813 def GetLastVertex(self, theShape, theName=None):
10815 Get the last vertex of wire/edge depended orientation.
10818 theShape Shape to find last vertex.
10819 theName Object name; when specified, this parameter is used
10820 for result publication in the study. Otherwise, if automatic
10821 publication is switched on, default value is used for result name.
10824 New GEOM.GEOM_Object, containing the created vertex.
10826 # Example: see GEOM_TestMeasures.py
10827 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10828 # note: auto-publishing is done in self.GetVertexByIndex()
10829 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10831 ## Get a normale to the given face. If the point is not given,
10832 # the normale is calculated at the center of mass.
10833 # @param theFace Face to define normale of.
10834 # @param theOptionalPoint Point to compute the normale at.
10835 # @param theName Object name; when specified, this parameter is used
10836 # for result publication in the study. Otherwise, if automatic
10837 # publication is switched on, default value is used for result name.
10839 # @return New GEOM.GEOM_Object, containing the created vector.
10841 # @ref swig_todo "Example"
10842 @ManageTransactions("MeasuOp")
10843 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10845 Get a normale to the given face. If the point is not given,
10846 the normale is calculated at the center of mass.
10849 theFace Face to define normale of.
10850 theOptionalPoint Point to compute the normale at.
10851 theName Object name; when specified, this parameter is used
10852 for result publication in the study. Otherwise, if automatic
10853 publication is switched on, default value is used for result name.
10856 New GEOM.GEOM_Object, containing the created vector.
10858 # Example: see GEOM_TestMeasures.py
10859 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10860 RaiseIfFailed("GetNormal", self.MeasuOp)
10861 self._autoPublish(anObj, theName, "normal")
10864 ## Print shape errors obtained from CheckShape.
10865 # @param theShape Shape that was checked.
10866 # @param theShapeErrors the shape errors obtained by CheckShape.
10867 # @param theReturnStatus If 0 the description of problem is printed.
10868 # If 1 the description of problem is returned.
10869 # @return If theReturnStatus is equal to 1 the description is returned.
10870 # Otherwise doesn't return anything.
10872 # @ref tui_check_shape_page "Example"
10873 @ManageTransactions("MeasuOp")
10874 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10876 Print shape errors obtained from CheckShape.
10879 theShape Shape that was checked.
10880 theShapeErrors the shape errors obtained by CheckShape.
10881 theReturnStatus If 0 the description of problem is printed.
10882 If 1 the description of problem is returned.
10885 If theReturnStatus is equal to 1 the description is returned.
10886 Otherwise doesn't return anything.
10888 # Example: see GEOM_TestMeasures.py
10889 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10890 if theReturnStatus == 1:
10895 ## Check a topology of the given shape.
10896 # @param theShape Shape to check validity of.
10897 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10898 # if TRUE, the shape's geometry will be checked also.
10899 # @param theReturnStatus If 0 and if theShape is invalid, a description
10900 # of problem is printed.
10901 # If 1 isValid flag and the description of
10902 # problem is returned.
10903 # If 2 isValid flag and the list of error data
10905 # @return TRUE, if the shape "seems to be valid".
10906 # If theShape is invalid, prints a description of problem.
10907 # If theReturnStatus is equal to 1 the description is returned
10908 # along with IsValid flag.
10909 # If theReturnStatus is equal to 2 the list of error data is
10910 # returned along with IsValid flag.
10912 # @ref tui_check_shape_page "Example"
10913 @ManageTransactions("MeasuOp")
10914 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10916 Check a topology of the given shape.
10919 theShape Shape to check validity of.
10920 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10921 if TRUE, the shape's geometry will be checked also.
10922 theReturnStatus If 0 and if theShape is invalid, a description
10923 of problem is printed.
10924 If 1 IsValid flag and the description of
10925 problem is returned.
10926 If 2 IsValid flag and the list of error data
10930 TRUE, if the shape "seems to be valid".
10931 If theShape is invalid, prints a description of problem.
10932 If theReturnStatus is equal to 1 the description is returned
10933 along with IsValid flag.
10934 If theReturnStatus is equal to 2 the list of error data is
10935 returned along with IsValid flag.
10937 # Example: see GEOM_TestMeasures.py
10939 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10940 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10942 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10943 RaiseIfFailed("CheckShape", self.MeasuOp)
10945 if theReturnStatus == 0:
10946 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10948 if theReturnStatus == 1:
10949 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10950 return (IsValid, Descr)
10951 elif theReturnStatus == 2:
10952 return (IsValid, ShapeErrors)
10955 ## Detect self-intersections in the given shape.
10956 # @param theShape Shape to check.
10957 # @param theCheckLevel is the level of self-intersection check.
10958 # Possible input values are:
10959 # - GEOM.SI_V_V(0) - only V/V interferences
10960 # - GEOM.SI_V_E(1) - V/V and V/E interferences
10961 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
10962 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
10963 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
10964 # - GEOM.SI_ALL(5) - all interferences.
10965 # @return TRUE, if the shape contains no self-intersections.
10967 # @ref tui_check_self_intersections_page "Example"
10968 @ManageTransactions("MeasuOp")
10969 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
10971 Detect self-intersections in the given shape.
10974 theShape Shape to check.
10975 theCheckLevel is the level of self-intersection check.
10976 Possible input values are:
10977 - GEOM.SI_V_V(0) - only V/V interferences
10978 - GEOM.SI_V_E(1) - V/V and V/E interferences
10979 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
10980 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
10981 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
10982 - GEOM.SI_ALL(5) - all interferences.
10985 TRUE, if the shape contains no self-intersections.
10987 # Example: see GEOM_TestMeasures.py
10988 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
10989 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10992 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
10993 # @param theShape1 First source object
10994 # @param theShape2 Second source object
10995 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
10996 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
10997 # - if \a theTolerance > 0, algorithm detects gaps
10998 # @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
10999 # - if \a theDeflection <= 0, default deflection 0.001 is used
11000 # @return TRUE, if there are intersections (gaps) between source shapes
11001 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11002 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11004 # @ref tui_fast_intersection_page "Example"
11005 @ManageTransactions("MeasuOp")
11006 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11008 Detect intersections of the given shapes with algorithm based on mesh intersections.
11011 theShape1 First source object
11012 theShape2 Second source object
11013 theTolerance Specifies a distance between shapes used for detecting gaps:
11014 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11015 - if theTolerance > 0, algorithm detects gaps
11016 theDeflection Linear deflection coefficient that specifies quality of tesselation:
11017 - if theDeflection <= 0, default deflection 0.001 is used
11020 TRUE, if there are intersections (gaps) between source shapes
11021 List of sub-shapes IDs from 1st shape that localize intersection.
11022 List of sub-shapes IDs from 2nd shape that localize intersection.
11024 # Example: see GEOM_TestMeasures.py
11025 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11026 RaiseIfFailed("FastIntersect", self.MeasuOp)
11027 return IsOk, Res1, Res2
11029 ## Get position (LCS) of theShape.
11031 # Origin of the LCS is situated at the shape's center of mass.
11032 # Axes of the LCS are obtained from shape's location or,
11033 # if the shape is a planar face, from position of its plane.
11035 # @param theShape Shape to calculate position of.
11036 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11037 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11038 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11039 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11041 # @ref swig_todo "Example"
11042 @ManageTransactions("MeasuOp")
11043 def GetPosition(self,theShape):
11045 Get position (LCS) of theShape.
11046 Origin of the LCS is situated at the shape's center of mass.
11047 Axes of the LCS are obtained from shape's location or,
11048 if the shape is a planar face, from position of its plane.
11051 theShape Shape to calculate position of.
11054 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11055 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11056 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11057 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11059 # Example: see GEOM_TestMeasures.py
11060 aTuple = self.MeasuOp.GetPosition(theShape)
11061 RaiseIfFailed("GetPosition", self.MeasuOp)
11064 ## Get kind of theShape.
11066 # @param theShape Shape to get a kind of.
11067 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11068 # and a list of parameters, describing the shape.
11069 # @note Concrete meaning of each value, returned via \a theIntegers
11070 # or \a theDoubles list depends on the kind() of the shape.
11072 # @ref swig_todo "Example"
11073 @ManageTransactions("MeasuOp")
11074 def KindOfShape(self,theShape):
11076 Get kind of theShape.
11079 theShape Shape to get a kind of.
11082 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11083 and a list of parameters, describing the shape.
11085 Concrete meaning of each value, returned via theIntegers
11086 or theDoubles list depends on the geompy.kind of the shape
11088 # Example: see GEOM_TestMeasures.py
11089 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11090 RaiseIfFailed("KindOfShape", self.MeasuOp)
11092 aKind = aRoughTuple[0]
11093 anInts = aRoughTuple[1]
11094 aDbls = aRoughTuple[2]
11096 # Now there is no exception from this rule:
11097 aKindTuple = [aKind] + aDbls + anInts
11099 # If they are we will regroup parameters for such kind of shape.
11101 #if aKind == kind.SOME_KIND:
11102 # # SOME_KIND int int double int double double
11103 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11107 ## Returns the string that describes if the shell is good for solid.
11108 # This is a support method for MakeSolid.
11110 # @param theShell the shell to be checked.
11111 # @return Returns a string that describes the shell validity for
11112 # solid construction.
11113 @ManageTransactions("MeasuOp")
11114 def _IsGoodForSolid(self, theShell):
11116 Returns the string that describes if the shell is good for solid.
11117 This is a support method for MakeSolid.
11120 theShell the shell to be checked.
11123 Returns a string that describes the shell validity for
11124 solid construction.
11126 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11129 # end of l2_measure
11132 ## @addtogroup l2_import_export
11135 ## Import a shape from the BREP, IGES, STEP or other file
11136 # (depends on given format) with given name.
11138 # Note: this function is deprecated, it is kept for backward compatibility only
11139 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11141 # @param theFileName The file, containing the shape.
11142 # @param theFormatName Specify format for the file reading.
11143 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11144 # If format 'IGES_SCALE' is used instead of 'IGES' or
11145 # format 'STEP_SCALE' is used instead of 'STEP',
11146 # length unit will be set to 'meter' and result model will be scaled.
11147 # @param theName Object name; when specified, this parameter is used
11148 # for result publication in the study. Otherwise, if automatic
11149 # publication is switched on, default value is used for result name.
11151 # @return New GEOM.GEOM_Object, containing the imported shape.
11152 # If material names are imported it returns the list of
11153 # objects. The first one is the imported object followed by
11155 # @note Auto publishing is allowed for the shape itself. Imported
11156 # material groups are not automatically published.
11158 # @ref swig_Import_Export "Example"
11159 @ManageTransactions("InsertOp")
11160 def ImportFile(self, theFileName, theFormatName, theName=None):
11162 Import a shape from the BREP, IGES, STEP or other file
11163 (depends on given format) with given name.
11165 Note: this function is deprecated, it is kept for backward compatibility only
11166 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11169 theFileName The file, containing the shape.
11170 theFormatName Specify format for the file reading.
11171 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11172 If format 'IGES_SCALE' is used instead of 'IGES' or
11173 format 'STEP_SCALE' is used instead of 'STEP',
11174 length unit will be set to 'meter' and result model will be scaled.
11175 theName Object name; when specified, this parameter is used
11176 for result publication in the study. Otherwise, if automatic
11177 publication is switched on, default value is used for result name.
11180 New GEOM.GEOM_Object, containing the imported shape.
11181 If material names are imported it returns the list of
11182 objects. The first one is the imported object followed by
11185 Auto publishing is allowed for the shape itself. Imported
11186 material groups are not automatically published.
11188 # Example: see GEOM_TestOthers.py
11190 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11191 where <FormatName> is a name of desirable format for importing.
11193 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11194 RaiseIfFailed("ImportFile", self.InsertOp)
11195 aNbObj = len(aListObj)
11197 self._autoPublish(aListObj[0], theName, "imported")
11202 ## Deprecated analog of ImportFile()
11203 def Import(self, theFileName, theFormatName, theName=None):
11205 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11207 # note: auto-publishing is done in self.ImportFile()
11208 return self.ImportFile(theFileName, theFormatName, theName)
11210 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11211 # @note This method will not be dumped to the python script by DumpStudy functionality.
11212 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
11213 # @param theStream The BRep binary stream.
11214 # @param 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.
11218 # @return New GEOM_Object, containing the shape, read from theStream.
11220 # @ref swig_Import_Export "Example"
11221 @ManageTransactions("InsertOp")
11222 def RestoreShape (self, theStream, theName=None):
11224 Read a shape from the binary stream, containing its bounding representation (BRep).
11227 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11230 theStream The BRep binary stream.
11231 theName Object name; when specified, this parameter is used
11232 for result publication in the study. Otherwise, if automatic
11233 publication is switched on, default value is used for result name.
11236 New GEOM_Object, containing the shape, read from theStream.
11238 # Example: see GEOM_TestOthers.py
11239 anObj = self.InsertOp.RestoreShape(theStream)
11240 RaiseIfFailed("RestoreShape", self.InsertOp)
11241 self._autoPublish(anObj, theName, "restored")
11244 ## Export the given shape into a file with given name.
11246 # Note: this function is deprecated, it is kept for backward compatibility only
11247 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11249 # @param theObject Shape to be stored in the file.
11250 # @param theFileName Name of the file to store the given shape in.
11251 # @param theFormatName Specify format for the shape storage.
11252 # Available formats can be obtained with
11253 # geompy.InsertOp.ExportTranslators()[0] method.
11255 # @ref swig_Import_Export "Example"
11256 @ManageTransactions("InsertOp")
11257 def Export(self, theObject, theFileName, theFormatName):
11259 Export the given shape into a file with given name.
11261 Note: this function is deprecated, it is kept for backward compatibility only
11262 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11265 theObject Shape to be stored in the file.
11266 theFileName Name of the file to store the given shape in.
11267 theFormatName Specify format for the shape storage.
11268 Available formats can be obtained with
11269 geompy.InsertOp.ExportTranslators()[0] method.
11271 # Example: see GEOM_TestOthers.py
11273 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11274 where <FormatName> is a name of desirable format for exporting.
11276 self.InsertOp.Export(theObject, theFileName, theFormatName)
11277 if self.InsertOp.IsDone() == 0:
11278 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
11282 # end of l2_import_export
11285 ## @addtogroup l3_blocks
11288 ## Create a quadrangle face from four edges. Order of Edges is not
11289 # important. It is not necessary that edges share the same vertex.
11290 # @param E1,E2,E3,E4 Edges for the face bound.
11291 # @param theName Object name; when specified, this parameter is used
11292 # for result publication in the study. Otherwise, if automatic
11293 # publication is switched on, default value is used for result name.
11295 # @return New GEOM.GEOM_Object, containing the created face.
11297 # @ref tui_building_by_blocks_page "Example"
11298 @ManageTransactions("BlocksOp")
11299 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11301 Create a quadrangle face from four edges. Order of Edges is not
11302 important. It is not necessary that edges share the same vertex.
11305 E1,E2,E3,E4 Edges for the face bound.
11306 theName Object name; when specified, this parameter is used
11307 for result publication in the study. Otherwise, if automatic
11308 publication is switched on, default value is used for result name.
11311 New GEOM.GEOM_Object, containing the created face.
11314 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11316 # Example: see GEOM_Spanner.py
11317 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11318 RaiseIfFailed("MakeQuad", self.BlocksOp)
11319 self._autoPublish(anObj, theName, "quad")
11322 ## Create a quadrangle face on two edges.
11323 # The missing edges will be built by creating the shortest ones.
11324 # @param E1,E2 Two opposite edges for the face.
11325 # @param theName Object name; when specified, this parameter is used
11326 # for result publication in the study. Otherwise, if automatic
11327 # publication is switched on, default value is used for result name.
11329 # @return New GEOM.GEOM_Object, containing the created face.
11331 # @ref tui_building_by_blocks_page "Example"
11332 @ManageTransactions("BlocksOp")
11333 def MakeQuad2Edges(self, E1, E2, theName=None):
11335 Create a quadrangle face on two edges.
11336 The missing edges will be built by creating the shortest ones.
11339 E1,E2 Two opposite edges for the face.
11340 theName Object name; when specified, this parameter is used
11341 for result publication in the study. Otherwise, if automatic
11342 publication is switched on, default value is used for result name.
11345 New GEOM.GEOM_Object, containing the created face.
11349 p1 = geompy.MakeVertex( 0., 0., 0.)
11350 p2 = geompy.MakeVertex(150., 30., 0.)
11351 p3 = geompy.MakeVertex( 0., 120., 50.)
11352 p4 = geompy.MakeVertex( 0., 40., 70.)
11354 edge1 = geompy.MakeEdge(p1, p2)
11355 edge2 = geompy.MakeEdge(p3, p4)
11356 # create a quadrangle face from two edges
11357 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11359 # Example: see GEOM_Spanner.py
11360 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11361 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11362 self._autoPublish(anObj, theName, "quad")
11365 ## Create a quadrangle face with specified corners.
11366 # The missing edges will be built by creating the shortest ones.
11367 # @param V1,V2,V3,V4 Corner vertices for the face.
11368 # @param theName Object name; when specified, this parameter is used
11369 # for result publication in the study. Otherwise, if automatic
11370 # publication is switched on, default value is used for result name.
11372 # @return New GEOM.GEOM_Object, containing the created face.
11374 # @ref tui_building_by_blocks_page "Example 1"
11375 # \n @ref swig_MakeQuad4Vertices "Example 2"
11376 @ManageTransactions("BlocksOp")
11377 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11379 Create a quadrangle face with specified corners.
11380 The missing edges will be built by creating the shortest ones.
11383 V1,V2,V3,V4 Corner vertices for the face.
11384 theName Object name; when specified, this parameter is used
11385 for result publication in the study. Otherwise, if automatic
11386 publication is switched on, default value is used for result name.
11389 New GEOM.GEOM_Object, containing the created face.
11393 p1 = geompy.MakeVertex( 0., 0., 0.)
11394 p2 = geompy.MakeVertex(150., 30., 0.)
11395 p3 = geompy.MakeVertex( 0., 120., 50.)
11396 p4 = geompy.MakeVertex( 0., 40., 70.)
11397 # create a quadrangle from four points in its corners
11398 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11400 # Example: see GEOM_Spanner.py
11401 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11402 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11403 self._autoPublish(anObj, theName, "quad")
11406 ## Create a hexahedral solid, bounded by the six given faces. Order of
11407 # faces is not important. It is not necessary that Faces share the same edge.
11408 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
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 created solid.
11415 # @ref tui_building_by_blocks_page "Example 1"
11416 # \n @ref swig_MakeHexa "Example 2"
11417 @ManageTransactions("BlocksOp")
11418 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11420 Create a hexahedral solid, bounded by the six given faces. Order of
11421 faces is not important. It is not necessary that Faces share the same edge.
11424 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11425 theName Object name; when specified, this parameter is used
11426 for result publication in the study. Otherwise, if automatic
11427 publication is switched on, default value is used for result name.
11430 New GEOM.GEOM_Object, containing the created solid.
11433 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11435 # Example: see GEOM_Spanner.py
11436 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11437 RaiseIfFailed("MakeHexa", self.BlocksOp)
11438 self._autoPublish(anObj, theName, "hexa")
11441 ## Create a hexahedral solid between two given faces.
11442 # The missing faces will be built by creating the smallest ones.
11443 # @param F1,F2 Two opposite faces for the hexahedral solid.
11444 # @param theName Object name; when specified, this parameter is used
11445 # for result publication in the study. Otherwise, if automatic
11446 # publication is switched on, default value is used for result name.
11448 # @return New GEOM.GEOM_Object, containing the created solid.
11450 # @ref tui_building_by_blocks_page "Example 1"
11451 # \n @ref swig_MakeHexa2Faces "Example 2"
11452 @ManageTransactions("BlocksOp")
11453 def MakeHexa2Faces(self, F1, F2, theName=None):
11455 Create a hexahedral solid between two given faces.
11456 The missing faces will be built by creating the smallest ones.
11459 F1,F2 Two opposite faces for the hexahedral solid.
11460 theName Object name; when specified, this parameter is used
11461 for result publication in the study. Otherwise, if automatic
11462 publication is switched on, default value is used for result name.
11465 New GEOM.GEOM_Object, containing the created solid.
11468 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11470 # Example: see GEOM_Spanner.py
11471 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11472 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11473 self._autoPublish(anObj, theName, "hexa")
11479 ## @addtogroup l3_blocks_op
11482 ## Get a vertex, found in the given shape by its coordinates.
11483 # @param theShape Block or a compound of blocks.
11484 # @param theX,theY,theZ Coordinates of the sought vertex.
11485 # @param theEpsilon Maximum allowed distance between the resulting
11486 # vertex and point with the given coordinates.
11487 # @param theName Object name; when specified, this parameter is used
11488 # for result publication in the study. Otherwise, if automatic
11489 # publication is switched on, default value is used for result name.
11491 # @return New GEOM.GEOM_Object, containing the found vertex.
11493 # @ref swig_GetPoint "Example"
11494 @ManageTransactions("BlocksOp")
11495 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11497 Get a vertex, found in the given shape by its coordinates.
11500 theShape Block or a compound of blocks.
11501 theX,theY,theZ Coordinates of the sought vertex.
11502 theEpsilon Maximum allowed distance between the resulting
11503 vertex and point with the given coordinates.
11504 theName Object name; when specified, this parameter is used
11505 for result publication in the study. Otherwise, if automatic
11506 publication is switched on, default value is used for result name.
11509 New GEOM.GEOM_Object, containing the found vertex.
11512 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11514 # Example: see GEOM_TestOthers.py
11515 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11516 RaiseIfFailed("GetPoint", self.BlocksOp)
11517 self._autoPublish(anObj, theName, "vertex")
11520 ## Find a vertex of the given shape, which has minimal distance to the given point.
11521 # @param theShape Any shape.
11522 # @param thePoint Point, close to the desired vertex.
11523 # @param theName Object name; when specified, this parameter is used
11524 # for result publication in the study. Otherwise, if automatic
11525 # publication is switched on, default value is used for result name.
11527 # @return New GEOM.GEOM_Object, containing the found vertex.
11529 # @ref swig_GetVertexNearPoint "Example"
11530 @ManageTransactions("BlocksOp")
11531 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11533 Find a vertex of the given shape, which has minimal distance to the given point.
11536 theShape Any shape.
11537 thePoint Point, close to the desired vertex.
11538 theName Object name; when specified, this parameter is used
11539 for result publication in the study. Otherwise, if automatic
11540 publication is switched on, default value is used for result name.
11543 New GEOM.GEOM_Object, containing the found vertex.
11546 pmidle = geompy.MakeVertex(50, 0, 50)
11547 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11549 # Example: see GEOM_TestOthers.py
11550 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11551 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11552 self._autoPublish(anObj, theName, "vertex")
11555 ## Get an edge, found in the given shape by two given vertices.
11556 # @param theShape Block or a compound of blocks.
11557 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11558 # @param theName Object name; when specified, this parameter is used
11559 # for result publication in the study. Otherwise, if automatic
11560 # publication is switched on, default value is used for result name.
11562 # @return New GEOM.GEOM_Object, containing the found edge.
11564 # @ref swig_GetEdge "Example"
11565 @ManageTransactions("BlocksOp")
11566 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11568 Get an edge, found in the given shape by two given vertices.
11571 theShape Block or a compound of blocks.
11572 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11573 theName Object name; when specified, this parameter is used
11574 for result publication in the study. Otherwise, if automatic
11575 publication is switched on, default value is used for result name.
11578 New GEOM.GEOM_Object, containing the found edge.
11580 # Example: see GEOM_Spanner.py
11581 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11582 RaiseIfFailed("GetEdge", self.BlocksOp)
11583 self._autoPublish(anObj, theName, "edge")
11586 ## Find an edge of the given shape, which has minimal distance to the given point.
11587 # @param theShape Block or a compound of blocks.
11588 # @param thePoint Point, close to the desired edge.
11589 # @param 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.
11593 # @return New GEOM.GEOM_Object, containing the found edge.
11595 # @ref swig_GetEdgeNearPoint "Example"
11596 @ManageTransactions("BlocksOp")
11597 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11599 Find an edge of the given shape, which has minimal distance to the given point.
11602 theShape Block or a compound of blocks.
11603 thePoint Point, close to the desired edge.
11604 theName Object name; when specified, this parameter is used
11605 for result publication in the study. Otherwise, if automatic
11606 publication is switched on, default value is used for result name.
11609 New GEOM.GEOM_Object, containing the found edge.
11611 # Example: see GEOM_TestOthers.py
11612 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11613 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11614 self._autoPublish(anObj, theName, "edge")
11617 ## Returns a face, found in the given shape by four given corner vertices.
11618 # @param theShape Block or a compound of blocks.
11619 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11620 # @param theName Object name; when specified, this parameter is used
11621 # for result publication in the study. Otherwise, if automatic
11622 # publication is switched on, default value is used for result name.
11624 # @return New GEOM.GEOM_Object, containing the found face.
11626 # @ref swig_todo "Example"
11627 @ManageTransactions("BlocksOp")
11628 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11630 Returns a face, found in the given shape by four given corner vertices.
11633 theShape Block or a compound of blocks.
11634 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11635 theName Object name; when specified, this parameter is used
11636 for result publication in the study. Otherwise, if automatic
11637 publication is switched on, default value is used for result name.
11640 New GEOM.GEOM_Object, containing the found face.
11642 # Example: see GEOM_Spanner.py
11643 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11644 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11645 self._autoPublish(anObj, theName, "face")
11648 ## Get a face of block, found in the given shape by two given edges.
11649 # @param theShape Block or a compound of blocks.
11650 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11651 # @param theName Object name; when specified, this parameter is used
11652 # for result publication in the study. Otherwise, if automatic
11653 # publication is switched on, default value is used for result name.
11655 # @return New GEOM.GEOM_Object, containing the found face.
11657 # @ref swig_todo "Example"
11658 @ManageTransactions("BlocksOp")
11659 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11661 Get a face of block, found in the given shape by two given edges.
11664 theShape Block or a compound of blocks.
11665 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11666 theName Object name; when specified, this parameter is used
11667 for result publication in the study. Otherwise, if automatic
11668 publication is switched on, default value is used for result name.
11671 New GEOM.GEOM_Object, containing the found face.
11673 # Example: see GEOM_Spanner.py
11674 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11675 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11676 self._autoPublish(anObj, theName, "face")
11679 ## Find a face, opposite to the given one in the given block.
11680 # @param theBlock Must be a hexahedral solid.
11681 # @param theFace Face of \a theBlock, opposite to the desired face.
11682 # @param theName Object name; when specified, this parameter is used
11683 # for result publication in the study. Otherwise, if automatic
11684 # publication is switched on, default value is used for result name.
11686 # @return New GEOM.GEOM_Object, containing the found face.
11688 # @ref swig_GetOppositeFace "Example"
11689 @ManageTransactions("BlocksOp")
11690 def GetOppositeFace(self, theBlock, theFace, theName=None):
11692 Find a face, opposite to the given one in the given block.
11695 theBlock Must be a hexahedral solid.
11696 theFace Face of theBlock, opposite to the desired face.
11697 theName Object name; when specified, this parameter is used
11698 for result publication in the study. Otherwise, if automatic
11699 publication is switched on, default value is used for result name.
11702 New GEOM.GEOM_Object, containing the found face.
11704 # Example: see GEOM_Spanner.py
11705 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11706 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11707 self._autoPublish(anObj, theName, "face")
11710 ## Find a face of the given shape, which has minimal distance to the given point.
11711 # @param theShape Block or a compound of blocks.
11712 # @param thePoint Point, close to the desired face.
11713 # @param theName Object name; when specified, this parameter is used
11714 # for result publication in the study. Otherwise, if automatic
11715 # publication is switched on, default value is used for result name.
11717 # @return New GEOM.GEOM_Object, containing the found face.
11719 # @ref swig_GetFaceNearPoint "Example"
11720 @ManageTransactions("BlocksOp")
11721 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11723 Find a face of the given shape, which has minimal distance to the given point.
11726 theShape Block or a compound of blocks.
11727 thePoint Point, close to the desired face.
11728 theName Object name; when specified, this parameter is used
11729 for result publication in the study. Otherwise, if automatic
11730 publication is switched on, default value is used for result name.
11733 New GEOM.GEOM_Object, containing the found face.
11735 # Example: see GEOM_Spanner.py
11736 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11737 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11738 self._autoPublish(anObj, theName, "face")
11741 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11742 # @param theBlock Block or a compound of blocks.
11743 # @param theVector Vector, close to the normale of the desired face.
11744 # @param theName Object name; when specified, this parameter is used
11745 # for result publication in the study. Otherwise, if automatic
11746 # publication is switched on, default value is used for result name.
11748 # @return New GEOM.GEOM_Object, containing the found face.
11750 # @ref swig_todo "Example"
11751 @ManageTransactions("BlocksOp")
11752 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11754 Find a face of block, whose outside normale has minimal angle with the given vector.
11757 theBlock Block or a compound of blocks.
11758 theVector Vector, close to the normale of the desired face.
11759 theName Object name; when specified, this parameter is used
11760 for result publication in the study. Otherwise, if automatic
11761 publication is switched on, default value is used for result name.
11764 New GEOM.GEOM_Object, containing the found face.
11766 # Example: see GEOM_Spanner.py
11767 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11768 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11769 self._autoPublish(anObj, theName, "face")
11772 ## Find all sub-shapes of type \a theShapeType of the given shape,
11773 # which have minimal distance to the given point.
11774 # @param theShape Any shape.
11775 # @param thePoint Point, close to the desired shape.
11776 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11777 # @param theTolerance The tolerance for distances comparison. All shapes
11778 # with distances to the given point in interval
11779 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11780 # @param theName Object name; when specified, this parameter is used
11781 # for result publication in the study. Otherwise, if automatic
11782 # publication is switched on, default value is used for result name.
11784 # @return New GEOM_Object, containing a group of all found shapes.
11786 # @ref swig_GetShapesNearPoint "Example"
11787 @ManageTransactions("BlocksOp")
11788 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11790 Find all sub-shapes of type theShapeType of the given shape,
11791 which have minimal distance to the given point.
11794 theShape Any shape.
11795 thePoint Point, close to the desired shape.
11796 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11797 theTolerance The tolerance for distances comparison. All shapes
11798 with distances to the given point in interval
11799 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11800 theName Object name; when specified, this parameter is used
11801 for result publication in the study. Otherwise, if automatic
11802 publication is switched on, default value is used for result name.
11805 New GEOM_Object, containing a group of all found shapes.
11807 # Example: see GEOM_TestOthers.py
11808 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11809 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11810 self._autoPublish(anObj, theName, "group")
11813 # end of l3_blocks_op
11816 ## @addtogroup l4_blocks_measure
11819 ## Check, if the compound of blocks is given.
11820 # To be considered as a compound of blocks, the
11821 # given shape must satisfy the following conditions:
11822 # - Each element of the compound should be a Block (6 faces).
11823 # - Each face should be a quadrangle, i.e. it should have only 1 wire
11824 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
11825 # there are more than 4 edges in the only wire of a face,
11826 # this face is considered to be quadrangle if it has 4 bounds
11827 # (1 or more edge) of C1 continuity.
11828 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11829 # - The compound should be connexe.
11830 # - The glue between two quadrangle faces should be applied.
11831 # @param theCompound The compound to check.
11832 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
11833 # taking into account C1 continuity.
11834 # @param theAngTolerance the angular tolerance to check if two neighbor
11835 # edges are codirectional in the common vertex with this
11836 # tolerance. This parameter is used only if
11837 # <VAR>theIsUseC1</VAR> is set to True.
11838 # @return TRUE, if the given shape is a compound of blocks.
11839 # If theCompound is not valid, prints all discovered errors.
11841 # @ref tui_check_compound_of_blocks_page "Example 1"
11842 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11843 @ManageTransactions("BlocksOp")
11844 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
11845 theAngTolerance = 1.e-12):
11847 Check, if the compound of blocks is given.
11848 To be considered as a compound of blocks, the
11849 given shape must satisfy the following conditions:
11850 - Each element of the compound should be a Block (6 faces).
11851 - Each face should be a quadrangle, i.e. it should have only 1 wire
11852 with 4 edges. If theIsUseC1 is set to True and
11853 there are more than 4 edges in the only wire of a face,
11854 this face is considered to be quadrangle if it has 4 bounds
11855 (1 or more edge) of C1 continuity.
11856 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11857 - The compound should be connexe.
11858 - The glue between two quadrangle faces should be applied.
11861 theCompound The compound to check.
11862 theIsUseC1 Flag to check if there are 4 bounds on a face
11863 taking into account C1 continuity.
11864 theAngTolerance the angular tolerance to check if two neighbor
11865 edges are codirectional in the common vertex with this
11866 tolerance. This parameter is used only if
11867 theIsUseC1 is set to True.
11870 TRUE, if the given shape is a compound of blocks.
11871 If theCompound is not valid, prints all discovered errors.
11873 # Example: see GEOM_Spanner.py
11876 aTolerance = theAngTolerance
11877 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
11878 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11880 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11884 ## Retrieve all non blocks solids and faces from \a theShape.
11885 # @param theShape The shape to explore.
11886 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
11887 # taking into account C1 continuity.
11888 # @param theAngTolerance the angular tolerance to check if two neighbor
11889 # edges are codirectional in the common vertex with this
11890 # tolerance. This parameter is used only if
11891 # <VAR>theIsUseC1</VAR> is set to True.
11892 # @param theName Object name; when specified, this parameter is used
11893 # for result publication in the study. Otherwise, if automatic
11894 # publication is switched on, default value is used for result name.
11896 # @return A tuple of two GEOM_Objects. The first object is a group of all
11897 # non block solids (= not 6 faces, or with 6 faces, but with the
11898 # presence of non-quadrangular faces). The second object is a
11899 # group of all non quadrangular faces (= faces with more then
11900 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
11901 # with 1 wire with not 4 edges that do not form 4 bounds of
11904 # @ref tui_get_non_blocks_page "Example 1"
11905 # \n @ref swig_GetNonBlocks "Example 2"
11906 @ManageTransactions("BlocksOp")
11907 def GetNonBlocks (self, theShape, theIsUseC1 = False,
11908 theAngTolerance = 1.e-12, theName=None):
11910 Retrieve all non blocks solids and faces from theShape.
11913 theShape The shape to explore.
11914 theIsUseC1 Flag to check if there are 4 bounds on a face
11915 taking into account C1 continuity.
11916 theAngTolerance the angular tolerance to check if two neighbor
11917 edges are codirectional in the common vertex with this
11918 tolerance. This parameter is used only if
11919 theIsUseC1 is set to True.
11920 theName Object name; when specified, this parameter is used
11921 for result publication in the study. Otherwise, if automatic
11922 publication is switched on, default value is used for result name.
11925 A tuple of two GEOM_Objects. The first object is a group of all
11926 non block solids (= not 6 faces, or with 6 faces, but with the
11927 presence of non-quadrangular faces). The second object is a
11928 group of all non quadrangular faces (= faces with more then
11929 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
11930 with 1 wire with not 4 edges that do not form 4 bounds of
11934 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11936 # Example: see GEOM_Spanner.py
11939 aTolerance = theAngTolerance
11940 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
11941 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11942 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11945 ## Remove all seam and degenerated edges from \a theShape.
11946 # Unite faces and edges, sharing one surface. It means that
11947 # this faces must have references to one C++ surface object (handle).
11948 # @param theShape The compound or single solid to remove irregular edges from.
11949 # @param doUnionFaces If True, then unite faces. If False (the default value),
11950 # do not unite faces.
11951 # @param theName Object name; when specified, this parameter is used
11952 # for result publication in the study. Otherwise, if automatic
11953 # publication is switched on, default value is used for result name.
11955 # @return Improved shape.
11957 # @ref swig_RemoveExtraEdges "Example"
11958 @ManageTransactions("BlocksOp")
11959 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11961 Remove all seam and degenerated edges from theShape.
11962 Unite faces and edges, sharing one surface. It means that
11963 this faces must have references to one C++ surface object (handle).
11966 theShape The compound or single solid to remove irregular edges from.
11967 doUnionFaces If True, then unite faces. If False (the default value),
11968 do not unite faces.
11969 theName Object name; when specified, this parameter is used
11970 for result publication in the study. Otherwise, if automatic
11971 publication is switched on, default value is used for result name.
11976 # Example: see GEOM_TestOthers.py
11977 nbFacesOptimum = -1 # -1 means do not unite faces
11978 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11979 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11980 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11981 self._autoPublish(anObj, theName, "removeExtraEdges")
11984 ## Performs union faces of \a theShape
11985 # Unite faces sharing one surface. It means that
11986 # these faces must have references to one C++ surface object (handle).
11987 # @param theShape The compound or single solid that contains faces
11988 # to perform union.
11989 # @param theName Object name; when specified, this parameter is used
11990 # for result publication in the study. Otherwise, if automatic
11991 # publication is switched on, default value is used for result name.
11993 # @return Improved shape.
11995 # @ref swig_UnionFaces "Example"
11996 @ManageTransactions("BlocksOp")
11997 def UnionFaces(self, theShape, theName=None):
11999 Performs union faces of theShape.
12000 Unite faces sharing one surface. It means that
12001 these faces must have references to one C++ surface object (handle).
12004 theShape The compound or single solid that contains faces
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.
12013 # Example: see GEOM_TestOthers.py
12014 anObj = self.BlocksOp.UnionFaces(theShape)
12015 RaiseIfFailed("UnionFaces", self.BlocksOp)
12016 self._autoPublish(anObj, theName, "unionFaces")
12019 ## Check, if the given shape is a blocks compound.
12020 # Fix all detected errors.
12021 # \note Single block can be also fixed by this method.
12022 # @param theShape The compound to check and improve.
12023 # @param theName Object name; when specified, this parameter is used
12024 # for result publication in the study. Otherwise, if automatic
12025 # publication is switched on, default value is used for result name.
12027 # @return Improved compound.
12029 # @ref swig_CheckAndImprove "Example"
12030 @ManageTransactions("BlocksOp")
12031 def CheckAndImprove(self, theShape, theName=None):
12033 Check, if the given shape is a blocks compound.
12034 Fix all detected errors.
12037 Single block can be also fixed by this method.
12040 theShape The compound to check and improve.
12041 theName Object name; when specified, this parameter is used
12042 for result publication in the study. Otherwise, if automatic
12043 publication is switched on, default value is used for result name.
12048 # Example: see GEOM_TestOthers.py
12049 anObj = self.BlocksOp.CheckAndImprove(theShape)
12050 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12051 self._autoPublish(anObj, theName, "improved")
12054 # end of l4_blocks_measure
12057 ## @addtogroup l3_blocks_op
12060 ## Get all the blocks, contained in the given compound.
12061 # @param theCompound The compound to explode.
12062 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12063 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12064 # @param theName Object name; when specified, this parameter is used
12065 # for result publication in the study. Otherwise, if automatic
12066 # publication is switched on, default value is used for result name.
12068 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12070 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12072 # @ref tui_explode_on_blocks "Example 1"
12073 # \n @ref swig_MakeBlockExplode "Example 2"
12074 @ManageTransactions("BlocksOp")
12075 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12077 Get all the blocks, contained in the given compound.
12080 theCompound The compound to explode.
12081 theMinNbFaces If solid has lower number of faces, it is not a block.
12082 theMaxNbFaces If solid has higher number of faces, it is not a block.
12083 theName Object name; when specified, this parameter is used
12084 for result publication in the study. Otherwise, if automatic
12085 publication is switched on, default value is used for result name.
12088 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12091 List of GEOM.GEOM_Object, containing the retrieved blocks.
12093 # Example: see GEOM_TestOthers.py
12094 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12095 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12096 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12097 for anObj in aList:
12098 anObj.SetParameters(Parameters)
12100 self._autoPublish(aList, theName, "block")
12103 ## Find block, containing the given point inside its volume or on boundary.
12104 # @param theCompound Compound, to find block in.
12105 # @param thePoint Point, close to the desired block. If the point lays on
12106 # boundary between some blocks, we return block with nearest center.
12107 # @param theName Object name; when specified, this parameter is used
12108 # for result publication in the study. Otherwise, if automatic
12109 # publication is switched on, default value is used for result name.
12111 # @return New GEOM.GEOM_Object, containing the found block.
12113 # @ref swig_todo "Example"
12114 @ManageTransactions("BlocksOp")
12115 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12117 Find block, containing the given point inside its volume or on boundary.
12120 theCompound Compound, to find block in.
12121 thePoint Point, close to the desired block. If the point lays on
12122 boundary between some blocks, we return block with nearest center.
12123 theName Object name; when specified, this parameter is used
12124 for result publication in the study. Otherwise, if automatic
12125 publication is switched on, default value is used for result name.
12128 New GEOM.GEOM_Object, containing the found block.
12130 # Example: see GEOM_Spanner.py
12131 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12132 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12133 self._autoPublish(anObj, theName, "block")
12136 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12137 # @param theCompound Compound, to find block in.
12138 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12139 # @param theName Object name; when specified, this parameter is used
12140 # for result publication in the study. Otherwise, if automatic
12141 # publication is switched on, default value is used for result name.
12143 # @return New GEOM.GEOM_Object, containing the found block.
12145 # @ref swig_GetBlockByParts "Example"
12146 @ManageTransactions("BlocksOp")
12147 def GetBlockByParts(self, theCompound, theParts, theName=None):
12149 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12152 theCompound Compound, to find block in.
12153 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12154 theName Object name; when specified, this parameter is used
12155 for result publication in the study. Otherwise, if automatic
12156 publication is switched on, default value is used for result name.
12159 New GEOM_Object, containing the found block.
12161 # Example: see GEOM_TestOthers.py
12162 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12163 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12164 self._autoPublish(anObj, theName, "block")
12167 ## Return all blocks, containing all the elements, passed as the parts.
12168 # @param theCompound Compound, to find blocks in.
12169 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12170 # @param theName Object name; when specified, this parameter is used
12171 # for result publication in the study. Otherwise, if automatic
12172 # publication is switched on, default value is used for result name.
12174 # @return List of GEOM.GEOM_Object, containing the found blocks.
12176 # @ref swig_todo "Example"
12177 @ManageTransactions("BlocksOp")
12178 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12180 Return all blocks, containing all the elements, passed as the parts.
12183 theCompound Compound, to find blocks in.
12184 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12185 theName Object name; when specified, this parameter is used
12186 for result publication in the study. Otherwise, if automatic
12187 publication is switched on, default value is used for result name.
12190 List of GEOM.GEOM_Object, containing the found blocks.
12192 # Example: see GEOM_Spanner.py
12193 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12194 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12195 self._autoPublish(aList, theName, "block")
12198 ## Multi-transformate block and glue the result.
12199 # Transformation is defined so, as to superpose direction faces.
12200 # @param Block Hexahedral solid to be multi-transformed.
12201 # @param DirFace1 ID of First direction face.
12202 # @param DirFace2 ID of Second direction face.
12203 # @param NbTimes Quantity of transformations to be done.
12204 # @param theName Object name; when specified, this parameter is used
12205 # for result publication in the study. Otherwise, if automatic
12206 # publication is switched on, default value is used for result name.
12208 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12210 # @return New GEOM.GEOM_Object, containing the result shape.
12212 # @ref tui_multi_transformation "Example"
12213 @ManageTransactions("BlocksOp")
12214 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12216 Multi-transformate block and glue the result.
12217 Transformation is defined so, as to superpose direction faces.
12220 Block Hexahedral solid to be multi-transformed.
12221 DirFace1 ID of First direction face.
12222 DirFace2 ID of Second direction face.
12223 NbTimes Quantity of transformations to be done.
12224 theName Object name; when specified, this parameter is used
12225 for result publication in the study. Otherwise, if automatic
12226 publication is switched on, default value is used for result name.
12229 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12232 New GEOM.GEOM_Object, containing the result shape.
12234 # Example: see GEOM_Spanner.py
12235 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12236 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12237 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12238 anObj.SetParameters(Parameters)
12239 self._autoPublish(anObj, theName, "transformed")
12242 ## Multi-transformate block and glue the result.
12243 # @param Block Hexahedral solid to be multi-transformed.
12244 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12245 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12246 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12247 # @param 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.
12251 # @return New GEOM.GEOM_Object, containing the result shape.
12253 # @ref tui_multi_transformation "Example"
12254 @ManageTransactions("BlocksOp")
12255 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12256 DirFace1V, DirFace2V, NbTimesV, theName=None):
12258 Multi-transformate block and glue the result.
12261 Block Hexahedral solid to be multi-transformed.
12262 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12263 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12264 NbTimesU,NbTimesV Quantity of transformations to be done.
12265 theName Object name; when specified, this parameter is used
12266 for result publication in the study. Otherwise, if automatic
12267 publication is switched on, default value is used for result name.
12270 New GEOM.GEOM_Object, containing the result shape.
12272 # Example: see GEOM_Spanner.py
12273 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12274 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12275 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12276 DirFace1V, DirFace2V, NbTimesV)
12277 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12278 anObj.SetParameters(Parameters)
12279 self._autoPublish(anObj, theName, "transformed")
12282 ## Build all possible propagation groups.
12283 # Propagation group is a set of all edges, opposite to one (main)
12284 # edge of this group directly or through other opposite edges.
12285 # Notion of Opposite Edge make sence only on quadrangle face.
12286 # @param theShape Shape to build propagation groups on.
12287 # @param theName Object name; when specified, this parameter is used
12288 # for result publication in the study. Otherwise, if automatic
12289 # publication is switched on, default value is used for result name.
12291 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12293 # @ref swig_Propagate "Example"
12294 @ManageTransactions("BlocksOp")
12295 def Propagate(self, theShape, theName=None):
12297 Build all possible propagation groups.
12298 Propagation group is a set of all edges, opposite to one (main)
12299 edge of this group directly or through other opposite edges.
12300 Notion of Opposite Edge make sence only on quadrangle face.
12303 theShape Shape to build propagation groups on.
12304 theName Object name; when specified, this parameter is used
12305 for result publication in the study. Otherwise, if automatic
12306 publication is switched on, default value is used for result name.
12309 List of GEOM.GEOM_Object, each of them is a propagation group.
12311 # Example: see GEOM_TestOthers.py
12312 listChains = self.BlocksOp.Propagate(theShape)
12313 RaiseIfFailed("Propagate", self.BlocksOp)
12314 self._autoPublish(listChains, theName, "propagate")
12317 # end of l3_blocks_op
12320 ## @addtogroup l3_groups
12323 ## Creates a new group which will store sub-shapes of theMainShape
12324 # @param theMainShape is a GEOM object on which the group is selected
12325 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12326 # @param theName Object name; when specified, this parameter is used
12327 # for result publication in the study. Otherwise, if automatic
12328 # publication is switched on, default value is used for result name.
12330 # @return a newly created GEOM group (GEOM.GEOM_Object)
12332 # @ref tui_working_with_groups_page "Example 1"
12333 # \n @ref swig_CreateGroup "Example 2"
12334 @ManageTransactions("GroupOp")
12335 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12337 Creates a new group which will store sub-shapes of theMainShape
12340 theMainShape is a GEOM object on which the group is selected
12341 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12342 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12343 theName Object name; when specified, this parameter is used
12344 for result publication in the study. Otherwise, if automatic
12345 publication is switched on, default value is used for result name.
12348 a newly created GEOM group
12351 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12354 # Example: see GEOM_TestOthers.py
12355 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12356 RaiseIfFailed("CreateGroup", self.GroupOp)
12357 self._autoPublish(anObj, theName, "group")
12360 ## Adds a sub-object with ID theSubShapeId to the group
12361 # @param theGroup is a GEOM group to which the new sub-shape is added
12362 # @param theSubShapeID is a sub-shape ID in the main object.
12363 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12365 # @ref tui_working_with_groups_page "Example"
12366 @ManageTransactions("GroupOp")
12367 def AddObject(self,theGroup, theSubShapeID):
12369 Adds a sub-object with ID theSubShapeId to the group
12372 theGroup is a GEOM group to which the new sub-shape is added
12373 theSubShapeID is a sub-shape ID in the main object.
12376 Use method GetSubShapeID() to get an unique ID of the sub-shape
12378 # Example: see GEOM_TestOthers.py
12379 self.GroupOp.AddObject(theGroup, theSubShapeID)
12380 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
12381 RaiseIfFailed("AddObject", self.GroupOp)
12385 ## Removes a sub-object with ID \a theSubShapeId from the group
12386 # @param theGroup is a GEOM group from which the new sub-shape is removed
12387 # @param theSubShapeID is a sub-shape ID in the main object.
12388 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12390 # @ref tui_working_with_groups_page "Example"
12391 @ManageTransactions("GroupOp")
12392 def RemoveObject(self,theGroup, theSubShapeID):
12394 Removes a sub-object with ID theSubShapeId from the group
12397 theGroup is a GEOM group from which the new sub-shape is removed
12398 theSubShapeID is a sub-shape ID in the main object.
12401 Use method GetSubShapeID() to get an unique ID of the sub-shape
12403 # Example: see GEOM_TestOthers.py
12404 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
12405 RaiseIfFailed("RemoveObject", self.GroupOp)
12408 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12409 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12410 # @param theSubShapes is a list of sub-shapes to be added.
12412 # @ref tui_working_with_groups_page "Example"
12413 @ManageTransactions("GroupOp")
12414 def UnionList (self,theGroup, theSubShapes):
12416 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12419 theGroup is a GEOM group to which the new sub-shapes are added.
12420 theSubShapes is a list of sub-shapes to be added.
12422 # Example: see GEOM_TestOthers.py
12423 self.GroupOp.UnionList(theGroup, theSubShapes)
12424 RaiseIfFailed("UnionList", self.GroupOp)
12427 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12428 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12429 # @param theSubShapes is a list of indices of sub-shapes to be added.
12431 # @ref swig_UnionIDs "Example"
12432 @ManageTransactions("GroupOp")
12433 def UnionIDs(self,theGroup, theSubShapes):
12435 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12438 theGroup is a GEOM group to which the new sub-shapes are added.
12439 theSubShapes is a list of indices of sub-shapes to be added.
12441 # Example: see GEOM_TestOthers.py
12442 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12443 RaiseIfFailed("UnionIDs", self.GroupOp)
12446 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12447 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12448 # @param theSubShapes is a list of sub-shapes to be removed.
12450 # @ref tui_working_with_groups_page "Example"
12451 @ManageTransactions("GroupOp")
12452 def DifferenceList (self,theGroup, theSubShapes):
12454 Removes from the group all the given shapes. No errors, if some shapes are not included.
12457 theGroup is a GEOM group from which the sub-shapes are removed.
12458 theSubShapes is a list of sub-shapes to be removed.
12460 # Example: see GEOM_TestOthers.py
12461 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12462 RaiseIfFailed("DifferenceList", self.GroupOp)
12465 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12466 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12467 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12469 # @ref swig_DifferenceIDs "Example"
12470 @ManageTransactions("GroupOp")
12471 def DifferenceIDs(self,theGroup, theSubShapes):
12473 Removes from the group all the given shapes. No errors, if some shapes are not included.
12476 theGroup is a GEOM group from which the sub-shapes are removed.
12477 theSubShapes is a list of indices of sub-shapes to be removed.
12479 # Example: see GEOM_TestOthers.py
12480 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12481 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12484 ## Union of two groups.
12485 # New group is created. It will contain all entities
12486 # which are present in groups theGroup1 and theGroup2.
12487 # @param theGroup1, theGroup2 are the initial GEOM groups
12488 # to create the united group from.
12489 # @param theName Object name; when specified, this parameter is used
12490 # for result publication in the study. Otherwise, if automatic
12491 # publication is switched on, default value is used for result name.
12493 # @return a newly created GEOM group.
12495 # @ref tui_union_groups_anchor "Example"
12496 @ManageTransactions("GroupOp")
12497 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12499 Union of two groups.
12500 New group is created. It will contain all entities
12501 which are present in groups theGroup1 and theGroup2.
12504 theGroup1, theGroup2 are the initial GEOM groups
12505 to create the united group from.
12506 theName Object name; when specified, this parameter is used
12507 for result publication in the study. Otherwise, if automatic
12508 publication is switched on, default value is used for result name.
12511 a newly created GEOM group.
12513 # Example: see GEOM_TestOthers.py
12514 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12515 RaiseIfFailed("UnionGroups", self.GroupOp)
12516 self._autoPublish(aGroup, theName, "group")
12519 ## Intersection of two groups.
12520 # New group is created. It will contain only those entities
12521 # which are present in both groups theGroup1 and theGroup2.
12522 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12523 # @param theName Object name; when specified, this parameter is used
12524 # for result publication in the study. Otherwise, if automatic
12525 # publication is switched on, default value is used for result name.
12527 # @return a newly created GEOM group.
12529 # @ref tui_intersect_groups_anchor "Example"
12530 @ManageTransactions("GroupOp")
12531 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12533 Intersection of two groups.
12534 New group is created. It will contain only those entities
12535 which are present in both groups theGroup1 and theGroup2.
12538 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12539 theName Object name; when specified, this parameter is used
12540 for result publication in the study. Otherwise, if automatic
12541 publication is switched on, default value is used for result name.
12544 a newly created GEOM group.
12546 # Example: see GEOM_TestOthers.py
12547 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12548 RaiseIfFailed("IntersectGroups", self.GroupOp)
12549 self._autoPublish(aGroup, theName, "group")
12552 ## Cut of two groups.
12553 # New group is created. It will contain entities which are
12554 # present in group theGroup1 but are not present in group theGroup2.
12555 # @param theGroup1 is a GEOM group to include elements of.
12556 # @param theGroup2 is a GEOM group to exclude elements of.
12557 # @param theName Object name; when specified, this parameter is used
12558 # for result publication in the study. Otherwise, if automatic
12559 # publication is switched on, default value is used for result name.
12561 # @return a newly created GEOM group.
12563 # @ref tui_cut_groups_anchor "Example"
12564 @ManageTransactions("GroupOp")
12565 def CutGroups (self, theGroup1, theGroup2, theName=None):
12568 New group is created. It will contain entities which are
12569 present in group theGroup1 but are not present in group theGroup2.
12572 theGroup1 is a GEOM group to include elements of.
12573 theGroup2 is a GEOM group to exclude elements of.
12574 theName Object name; when specified, this parameter is used
12575 for result publication in the study. Otherwise, if automatic
12576 publication is switched on, default value is used for result name.
12579 a newly created GEOM group.
12581 # Example: see GEOM_TestOthers.py
12582 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12583 RaiseIfFailed("CutGroups", self.GroupOp)
12584 self._autoPublish(aGroup, theName, "group")
12587 ## Union of list of groups.
12588 # New group is created. It will contain all entities that are
12589 # present in groups listed in theGList.
12590 # @param theGList is a list of GEOM groups to create the united group from.
12591 # @param theName Object name; when specified, this parameter is used
12592 # for result publication in the study. Otherwise, if automatic
12593 # publication is switched on, default value is used for result name.
12595 # @return a newly created GEOM group.
12597 # @ref tui_union_groups_anchor "Example"
12598 @ManageTransactions("GroupOp")
12599 def UnionListOfGroups (self, theGList, theName=None):
12601 Union of list of groups.
12602 New group is created. It will contain all entities that are
12603 present in groups listed in theGList.
12606 theGList is a list of GEOM groups to create the united group from.
12607 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.
12612 a newly created GEOM group.
12614 # Example: see GEOM_TestOthers.py
12615 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12616 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12617 self._autoPublish(aGroup, theName, "group")
12620 ## Cut of lists of groups.
12621 # New group is created. It will contain only entities
12622 # which are present in groups listed in theGList.
12623 # @param theGList is a list of GEOM groups to include elements of.
12624 # @param theName Object name; when specified, this parameter is used
12625 # for result publication in the study. Otherwise, if automatic
12626 # publication is switched on, default value is used for result name.
12628 # @return a newly created GEOM group.
12630 # @ref tui_intersect_groups_anchor "Example"
12631 @ManageTransactions("GroupOp")
12632 def IntersectListOfGroups (self, theGList, theName=None):
12634 Cut of lists of groups.
12635 New group is created. It will contain only entities
12636 which are present in groups listed in theGList.
12639 theGList is a list of GEOM groups to include elements of.
12640 theName Object name; when specified, this parameter is used
12641 for result publication in the study. Otherwise, if automatic
12642 publication is switched on, default value is used for result name.
12645 a newly created GEOM group.
12647 # Example: see GEOM_TestOthers.py
12648 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12649 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12650 self._autoPublish(aGroup, theName, "group")
12653 ## Cut of lists of groups.
12654 # New group is created. It will contain only entities
12655 # which are present in groups listed in theGList1 but
12656 # are not present in groups from theGList2.
12657 # @param theGList1 is a list of GEOM groups to include elements of.
12658 # @param theGList2 is a list of GEOM groups to exclude elements of.
12659 # @param theName Object name; when specified, this parameter is used
12660 # for result publication in the study. Otherwise, if automatic
12661 # publication is switched on, default value is used for result name.
12663 # @return a newly created GEOM group.
12665 # @ref tui_cut_groups_anchor "Example"
12666 @ManageTransactions("GroupOp")
12667 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12669 Cut of lists of groups.
12670 New group is created. It will contain only entities
12671 which are present in groups listed in theGList1 but
12672 are not present in groups from theGList2.
12675 theGList1 is a list of GEOM groups to include elements of.
12676 theGList2 is a list of GEOM groups to exclude elements of.
12677 theName Object name; when specified, this parameter is used
12678 for result publication in the study. Otherwise, if automatic
12679 publication is switched on, default value is used for result name.
12682 a newly created GEOM group.
12684 # Example: see GEOM_TestOthers.py
12685 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12686 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12687 self._autoPublish(aGroup, theName, "group")
12690 ## Returns a list of sub-objects ID stored in the group
12691 # @param theGroup is a GEOM group for which a list of IDs is requested
12693 # @ref swig_GetObjectIDs "Example"
12694 @ManageTransactions("GroupOp")
12695 def GetObjectIDs(self,theGroup):
12697 Returns a list of sub-objects ID stored in the group
12700 theGroup is a GEOM group for which a list of IDs is requested
12702 # Example: see GEOM_TestOthers.py
12703 ListIDs = self.GroupOp.GetObjects(theGroup)
12704 RaiseIfFailed("GetObjects", self.GroupOp)
12707 ## Returns a type of sub-objects stored in the group
12708 # @param theGroup is a GEOM group which type is returned.
12710 # @ref swig_GetType "Example"
12711 @ManageTransactions("GroupOp")
12712 def GetType(self,theGroup):
12714 Returns a type of sub-objects stored in the group
12717 theGroup is a GEOM group which type is returned.
12719 # Example: see GEOM_TestOthers.py
12720 aType = self.GroupOp.GetType(theGroup)
12721 RaiseIfFailed("GetType", self.GroupOp)
12724 ## Convert a type of geom object from id to string value
12725 # @param theId is a GEOM obect type id.
12726 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12727 # @ref swig_GetType "Example"
12728 def ShapeIdToType(self, theId):
12730 Convert a type of geom object from id to string value
12733 theId is a GEOM obect type id.
12736 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12763 return "REVOLUTION"
12811 return "FREE_BOUNDS"
12819 return "THRUSECTIONS"
12821 return "COMPOUNDFILTER"
12823 return "SHAPES_ON_SHAPE"
12825 return "ELLIPSE_ARC"
12827 return "3DSKETCHER"
12833 return "PIPETSHAPE"
12834 return "Shape Id not exist."
12836 ## Returns a main shape associated with the group
12837 # @param theGroup is a GEOM group for which a main shape object is requested
12838 # @return a GEOM object which is a main shape for theGroup
12840 # @ref swig_GetMainShape "Example"
12841 @ManageTransactions("GroupOp")
12842 def GetMainShape(self,theGroup):
12844 Returns a main shape associated with the group
12847 theGroup is a GEOM group for which a main shape object is requested
12850 a GEOM object which is a main shape for theGroup
12852 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12854 # Example: see GEOM_TestOthers.py
12855 anObj = self.GroupOp.GetMainShape(theGroup)
12856 RaiseIfFailed("GetMainShape", self.GroupOp)
12859 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12860 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12861 # @param theShape given shape (see GEOM.GEOM_Object)
12862 # @param min_length minimum length of edges of theShape
12863 # @param max_length maximum length of edges of theShape
12864 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12865 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12866 # @param theName Object name; when specified, this parameter is used
12867 # for result publication in the study. Otherwise, if automatic
12868 # publication is switched on, default value is used for result name.
12870 # @return a newly created GEOM group of edges
12872 # @@ref swig_todo "Example"
12873 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12875 Create group of edges of theShape, whose length is in range [min_length, max_length].
12876 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12879 theShape given shape
12880 min_length minimum length of edges of theShape
12881 max_length maximum length of edges of theShape
12882 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12883 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12884 theName Object name; when specified, this parameter is used
12885 for result publication in the study. Otherwise, if automatic
12886 publication is switched on, default value is used for result name.
12889 a newly created GEOM group of edges.
12891 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12892 edges_in_range = []
12894 Props = self.BasicProperties(edge)
12895 if min_length <= Props[0] and Props[0] <= max_length:
12896 if (not include_min) and (min_length == Props[0]):
12899 if (not include_max) and (Props[0] == max_length):
12902 edges_in_range.append(edge)
12904 if len(edges_in_range) <= 0:
12905 print "No edges found by given criteria"
12908 # note: auto-publishing is done in self.CreateGroup()
12909 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12910 self.UnionList(group_edges, edges_in_range)
12914 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12915 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12916 # @param min_length minimum length of edges of selected shape
12917 # @param max_length maximum length of edges of selected shape
12918 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12919 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12920 # @return a newly created GEOM group of edges
12921 # @ref swig_todo "Example"
12922 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12924 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12925 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12928 min_length minimum length of edges of selected shape
12929 max_length maximum length of edges of selected shape
12930 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12931 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12934 a newly created GEOM group of edges.
12936 nb_selected = sg.SelectedCount()
12937 if nb_selected < 1:
12938 print "Select a shape before calling this function, please."
12940 if nb_selected > 1:
12941 print "Only one shape must be selected"
12944 id_shape = sg.getSelected(0)
12945 shape = IDToObject( id_shape )
12947 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12951 if include_min: left_str = " <= "
12952 if include_max: right_str = " <= "
12954 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12955 + left_str + "length" + right_str + `max_length`)
12957 sg.updateObjBrowser(1)
12964 #@@ insert new functions before this line @@ do not remove this line @@#
12966 ## Create a copy of the given object
12968 # @param theOriginal geometry object for copy
12969 # @param theName Object name; when specified, this parameter is used
12970 # for result publication in the study. Otherwise, if automatic
12971 # publication is switched on, default value is used for result name.
12973 # @return New GEOM_Object, containing the copied shape.
12975 # @ingroup l1_geomBuilder_auxiliary
12976 # @ref swig_MakeCopy "Example"
12977 @ManageTransactions("InsertOp")
12978 def MakeCopy(self, theOriginal, theName=None):
12980 Create a copy of the given object
12983 theOriginal geometry object for copy
12984 theName Object name; when specified, this parameter is used
12985 for result publication in the study. Otherwise, if automatic
12986 publication is switched on, default value is used for result name.
12989 New GEOM_Object, containing the copied shape.
12991 Example of usage: Copy = geompy.MakeCopy(Box)
12993 # Example: see GEOM_TestAll.py
12994 anObj = self.InsertOp.MakeCopy(theOriginal)
12995 RaiseIfFailed("MakeCopy", self.InsertOp)
12996 self._autoPublish(anObj, theName, "copy")
12999 ## Add Path to load python scripts from
13000 # @param Path a path to load python scripts from
13001 # @ingroup l1_geomBuilder_auxiliary
13002 def addPath(self,Path):
13004 Add Path to load python scripts from
13007 Path a path to load python scripts from
13009 if (sys.path.count(Path) < 1):
13010 sys.path.append(Path)
13014 ## Load marker texture from the file
13015 # @param Path a path to the texture file
13016 # @return unique texture identifier
13017 # @ingroup l1_geomBuilder_auxiliary
13018 @ManageTransactions("InsertOp")
13019 def LoadTexture(self, Path):
13021 Load marker texture from the file
13024 Path a path to the texture file
13027 unique texture identifier
13029 # Example: see GEOM_TestAll.py
13030 ID = self.InsertOp.LoadTexture(Path)
13031 RaiseIfFailed("LoadTexture", self.InsertOp)
13034 ## Get internal name of the object based on its study entry
13035 # @note This method does not provide an unique identifier of the geometry object.
13036 # @note This is internal function of GEOM component, though it can be used outside it for
13037 # appropriate reason (e.g. for identification of geometry object).
13038 # @param obj geometry object
13039 # @return unique object identifier
13040 # @ingroup l1_geomBuilder_auxiliary
13041 def getObjectID(self, obj):
13043 Get internal name of the object based on its study entry.
13044 Note: this method does not provide an unique identifier of the geometry object.
13045 It is an internal function of GEOM component, though it can be used outside GEOM for
13046 appropriate reason (e.g. for identification of geometry object).
13049 obj geometry object
13052 unique object identifier
13055 entry = salome.ObjectToID(obj)
13056 if entry is not None:
13057 lst = entry.split(":")
13059 ID = lst[-1] # -1 means last item in the list
13060 return "GEOM_" + ID
13065 ## Add marker texture. @a Width and @a Height parameters
13066 # specify width and height of the texture in pixels.
13067 # If @a RowData is @c True, @a Texture parameter should represent texture data
13068 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13069 # parameter should be unpacked string, in which '1' symbols represent opaque
13070 # pixels and '0' represent transparent pixels of the texture bitmap.
13072 # @param Width texture width in pixels
13073 # @param Height texture height in pixels
13074 # @param Texture texture data
13075 # @param RowData if @c True, @a Texture data are packed in the byte stream
13076 # @return unique texture identifier
13077 # @ingroup l1_geomBuilder_auxiliary
13078 @ManageTransactions("InsertOp")
13079 def AddTexture(self, Width, Height, Texture, RowData=False):
13081 Add marker texture. Width and Height parameters
13082 specify width and height of the texture in pixels.
13083 If RowData is True, Texture parameter should represent texture data
13084 packed into the byte array. If RowData is False (default), Texture
13085 parameter should be unpacked string, in which '1' symbols represent opaque
13086 pixels and '0' represent transparent pixels of the texture bitmap.
13089 Width texture width in pixels
13090 Height texture height in pixels
13091 Texture texture data
13092 RowData if True, Texture data are packed in the byte stream
13095 return unique texture identifier
13097 if not RowData: Texture = PackData(Texture)
13098 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13099 RaiseIfFailed("AddTexture", self.InsertOp)
13102 ## Transfer not topological data from one GEOM object to another.
13104 # @param theObjectFrom the source object of non-topological data
13105 # @param theObjectTo the destination object of non-topological data
13106 # @param theFindMethod method to search sub-shapes of theObjectFrom
13107 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13108 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13109 # Other values of GEOM.find_shape_method are not supported.
13111 # @return True in case of success; False otherwise.
13113 # @ingroup l1_geomBuilder_auxiliary
13115 # @ref swig_TransferData "Example"
13116 @ManageTransactions("InsertOp")
13117 def TransferData(self, theObjectFrom, theObjectTo,
13118 theFindMethod=GEOM.FSM_GetInPlace):
13120 Transfer not topological data from one GEOM object to another.
13123 theObjectFrom the source object of non-topological data
13124 theObjectTo the destination object of non-topological data
13125 theFindMethod method to search sub-shapes of theObjectFrom
13126 in shape theObjectTo. Possible values are:
13127 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13128 and GEOM.FSM_GetInPlace_Old. Other values of
13129 GEOM.find_shape_method are not supported.
13132 True in case of success; False otherwise.
13134 # Example: see GEOM_TestOthers.py
13136 # Example: see GEOM_TestAll.py
13137 isOk = self.InsertOp.TransferData(theObjectFrom,
13138 theObjectTo, theFindMethod)
13139 RaiseIfFailed("TransferData", self.InsertOp)
13142 ## Creates a new folder object. It is a container for any GEOM objects.
13143 # @param Name name of the container
13144 # @param Father parent object. If None,
13145 # folder under 'Geometry' root object will be created.
13146 # @return a new created folder
13147 # @ingroup l1_publish_data
13148 def NewFolder(self, Name, Father=None):
13150 Create a new folder object. It is an auxiliary container for any GEOM objects.
13153 Name name of the container
13154 Father parent object. If None,
13155 folder under 'Geometry' root object will be created.
13158 a new created folder
13160 if not Father: Father = self.father
13161 return self.CreateFolder(Name, Father)
13163 ## Move object to the specified folder
13164 # @param Object object to move
13165 # @param Folder target folder
13166 # @ingroup l1_publish_data
13167 def PutToFolder(self, Object, Folder):
13169 Move object to the specified folder
13172 Object object to move
13173 Folder target folder
13175 self.MoveToFolder(Object, Folder)
13178 ## Move list of objects to the specified folder
13179 # @param ListOfSO list of objects to move
13180 # @param Folder target folder
13181 # @ingroup l1_publish_data
13182 def PutListToFolder(self, ListOfSO, Folder):
13184 Move list of objects to the specified folder
13187 ListOfSO list of objects to move
13188 Folder target folder
13190 self.MoveListToFolder(ListOfSO, Folder)
13193 ## @addtogroup l2_field
13197 # @param shape the shape the field lies on
13198 # @param name the field name
13199 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13200 # @param dimension dimension of the shape the field lies on
13201 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13202 # @param componentNames names of components
13203 # @return a created field
13204 @ManageTransactions("FieldOp")
13205 def CreateField(self, shape, name, type, dimension, componentNames):
13210 shape the shape the field lies on
13211 name the field name
13212 type type of field data
13213 dimension dimension of the shape the field lies on
13214 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13215 componentNames names of components
13220 if isinstance( type, int ):
13221 if type < 0 or type > 3:
13222 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
13223 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13225 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13226 RaiseIfFailed("CreateField", self.FieldOp)
13228 geom._autoPublish( f, "", name)
13231 ## Removes a field from the GEOM component
13232 # @param field the field to remove
13233 def RemoveField(self, field):
13234 "Removes a field from the GEOM component"
13236 if isinstance( field, GEOM._objref_GEOM_Field ):
13237 geom.RemoveObject( field )
13238 elif isinstance( field, geomField ):
13239 geom.RemoveObject( field.field )
13241 raise RuntimeError, "RemoveField() : the object is not a field"
13244 ## Returns number of fields on a shape
13245 @ManageTransactions("FieldOp")
13246 def CountFields(self, shape):
13247 "Returns number of fields on a shape"
13248 nb = self.FieldOp.CountFields( shape )
13249 RaiseIfFailed("CountFields", self.FieldOp)
13252 ## Returns all fields on a shape
13253 @ManageTransactions("FieldOp")
13254 def GetFields(self, shape):
13255 "Returns all fields on a shape"
13256 ff = self.FieldOp.GetFields( shape )
13257 RaiseIfFailed("GetFields", self.FieldOp)
13260 ## Returns a field on a shape by its name
13261 @ManageTransactions("FieldOp")
13262 def GetField(self, shape, name):
13263 "Returns a field on a shape by its name"
13264 f = self.FieldOp.GetField( shape, name )
13265 RaiseIfFailed("GetField", self.FieldOp)
13273 # Register the new proxy for GEOM_Gen
13274 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13277 ## Field on Geometry
13278 # @ingroup l2_field
13279 class geomField( GEOM._objref_GEOM_Field ):
13281 def __init__(self):
13282 GEOM._objref_GEOM_Field.__init__(self)
13283 self.field = GEOM._objref_GEOM_Field
13286 ## Returns the shape the field lies on
13287 def getShape(self):
13288 "Returns the shape the field lies on"
13289 return self.field.GetShape(self)
13291 ## Returns the field name
13293 "Returns the field name"
13294 return self.field.GetName(self)
13296 ## Returns type of field data as integer [0-3]
13298 "Returns type of field data"
13299 return self.field.GetDataType(self)._v
13301 ## Returns type of field data:
13302 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13303 def getTypeEnum(self):
13304 "Returns type of field data"
13305 return self.field.GetDataType(self)
13307 ## Returns dimension of the shape the field lies on:
13308 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13309 def getDimension(self):
13310 """Returns dimension of the shape the field lies on:
13311 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13312 return self.field.GetDimension(self)
13314 ## Returns names of components
13315 def getComponents(self):
13316 "Returns names of components"
13317 return self.field.GetComponents(self)
13319 ## Adds a time step to the field
13320 # @param step the time step number further used as the step identifier
13321 # @param stamp the time step time
13322 # @param values the values of the time step
13323 def addStep(self, step, stamp, values):
13324 "Adds a time step to the field"
13325 stp = self.field.AddStep( self, step, stamp )
13327 raise RuntimeError, \
13328 "Field.addStep() : Error: step %s already exists in this field"%step
13330 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13331 self.setValues( step, values )
13334 ## Remove a time step from the field
13335 def removeStep(self,step):
13336 "Remove a time step from the field"
13339 stepObj = self.field.GetStep( self, step )
13341 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13344 #traceback.print_exc()
13346 self.field.RemoveStep( self, step )
13348 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13351 ## Returns number of time steps in the field
13352 def countSteps(self):
13353 "Returns number of time steps in the field"
13354 return self.field.CountSteps(self)
13356 ## Returns a list of time step IDs in the field
13357 def getSteps(self):
13358 "Returns a list of time step IDs in the field"
13359 return self.field.GetSteps(self)
13361 ## Returns a time step by its ID
13362 def getStep(self,step):
13363 "Returns a time step by its ID"
13364 stp = self.field.GetStep(self, step)
13366 raise RuntimeError, "Step %s is missing from this field"%step
13369 ## Returns the time of the field step
13370 def getStamp(self,step):
13371 "Returns the time of the field step"
13372 return self.getStep(step).GetStamp()
13374 ## Changes the time of the field step
13375 def setStamp(self, step, stamp):
13376 "Changes the time of the field step"
13377 return self.getStep(step).SetStamp(stamp)
13379 ## Returns values of the field step
13380 def getValues(self, step):
13381 "Returns values of the field step"
13382 return self.getStep(step).GetValues()
13384 ## Changes values of the field step
13385 def setValues(self, step, values):
13386 "Changes values of the field step"
13387 stp = self.getStep(step)
13388 errBeg = "Field.setValues(values) : Error: "
13390 ok = stp.SetValues( values )
13391 except Exception, e:
13393 if excStr.find("WrongPythonType") > 0:
13394 raise RuntimeError, errBeg +\
13395 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13396 raise RuntimeError, errBeg + str(e)
13398 nbOK = self.field.GetArraySize(self)
13401 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13403 raise RuntimeError, errBeg + "failed"
13406 pass # end of class geomField
13408 # Register the new proxy for GEOM_Field
13409 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13412 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13413 # interface to GEOM operations.
13418 # salome.salome_init()
13419 # from salome.geom import geomBuilder
13420 # geompy = geomBuilder.New(salome.myStudy)
13422 # @param study SALOME study, generally obtained by salome.myStudy.
13423 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13424 # @return geomBuilder instance
13425 def New( study, instance=None):
13427 Create a new geomBuilder instance.The geomBuilder class provides the Python
13428 interface to GEOM operations.
13432 salome.salome_init()
13433 from salome.geom import geomBuilder
13434 geompy = geomBuilder.New(salome.myStudy)
13437 study SALOME study, generally obtained by salome.myStudy.
13438 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13440 geomBuilder instance
13442 #print "New geomBuilder ", study, instance
13449 geom = geomBuilder()
13450 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13451 geom.init_geom(study)
13455 # Register methods from the plug-ins in the geomBuilder class
13456 plugins_var = os.environ.get( "GEOM_PluginsList" )
13459 if plugins_var is not None:
13460 plugins = plugins_var.split( ":" )
13461 plugins=filter(lambda x: len(x)>0, plugins)
13462 if plugins is not None:
13463 for pluginName in plugins:
13464 pluginBuilderName = pluginName + "Builder"
13466 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
13467 except Exception, e:
13468 from salome_utils import verbose
13469 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
13471 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
13472 plugin = eval( pluginBuilderName )
13474 # add methods from plugin module to the geomBuilder class
13475 for k in dir( plugin ):
13476 if k[0] == '_': continue
13477 method = getattr( plugin, k )
13478 if type( method ).__name__ == 'function':
13479 if not hasattr( geomBuilder, k ):
13480 setattr( geomBuilder, k, method )