1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup geomBuilder geomBuilder Python module
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New(salome.myStudy)
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New(salome.myStudy)
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New(salome.myStudy)
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
243 # initialize SALOME session in try/except block
244 # to avoid problems in some cases, e.g. when generating documentation
252 from salome_notebook import *
259 from salome.geom.gsketcher import Sketcher3D, Sketcher2D
262 def _toListOfNames(_names, _size=-1):
265 if type(_names) in [types.ListType, types.TupleType]:
266 for i in _names: l.append(i)
269 if l and len(l) < _size:
270 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
273 # Decorator function to manage transactions for all geometric operations.
274 def ManageTransactions(theOpeName):
275 def MTDecorator(theFunction):
276 # To keep the original function name an documentation.
277 @functools.wraps(theFunction)
278 def OpenCallClose(self, *args, **kwargs):
280 anOperation = getattr(self, theOpeName)
281 anOperation.StartOperation()
284 res = theFunction(self, *args, **kwargs)
286 anOperation.FinishOperation()
290 anOperation.AbortOperation()
295 ## Raise an Error, containing the Method_name, if Operation is Failed
296 ## @ingroup l1_geomBuilder_auxiliary
297 def RaiseIfFailed (Method_name, Operation):
298 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
299 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
301 ## Return list of variables value from salome notebook
302 ## @ingroup l1_geomBuilder_auxiliary
303 def ParseParameters(*parameters):
306 for parameter in parameters:
307 if isinstance(parameter, list):
308 lResults = ParseParameters(*parameter)
309 if len(lResults) > 0:
310 Result.append(lResults[:-1])
311 StringResult += lResults[-1].split(":")
315 if isinstance(parameter,str):
316 if notebook.isVariable(parameter):
317 Result.append(notebook.get(parameter))
319 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
322 Result.append(parameter)
324 StringResult.append(str(parameter))
328 Result.append(":".join(StringResult))
330 Result = ":".join(StringResult)
333 ## Return list of variables value from salome notebook
334 ## @ingroup l1_geomBuilder_auxiliary
338 for parameter in list:
339 if isinstance(parameter,str) and notebook.isVariable(parameter):
340 Result.append(str(notebook.get(parameter)))
343 Result.append(str(parameter))
346 StringResult = StringResult + str(parameter)
347 StringResult = StringResult + ":"
349 StringResult = StringResult[:len(StringResult)-1]
350 return Result, StringResult
352 ## Return list of variables value from salome notebook
353 ## @ingroup l1_geomBuilder_auxiliary
354 def ParseSketcherCommand(command):
357 sections = command.split(":")
358 for section in sections:
359 parameters = section.split(" ")
361 for parameter in parameters:
362 if paramIndex > 1 and parameter.find("'") != -1:
363 parameter = parameter.replace("'","")
364 if notebook.isVariable(parameter):
365 Result = Result + str(notebook.get(parameter)) + " "
368 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
372 Result = Result + str(parameter) + " "
375 StringResult = StringResult + parameter
376 StringResult = StringResult + ":"
378 paramIndex = paramIndex + 1
380 Result = Result[:len(Result)-1] + ":"
382 Result = Result[:len(Result)-1]
383 return Result, StringResult
385 ## Helper function which can be used to pack the passed string to the byte data.
386 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
387 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
390 ## val = PackData("10001110") # val = 0xAE
391 ## val = PackData("1") # val = 0x80
393 ## @param data unpacked data - a string containing '1' and '0' symbols
394 ## @return data packed to the byte stream
395 ## @ingroup l1_geomBuilder_auxiliary
398 Helper function which can be used to pack the passed string to the byte data.
399 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
400 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
403 data unpacked data - a string containing '1' and '0' symbols
406 data packed to the byte stream
409 val = PackData("10001110") # val = 0xAE
410 val = PackData("1") # val = 0x80
413 if len(data)%8: bytes += 1
415 for b in range(bytes):
416 d = data[b*8:(b+1)*8]
421 if d[i] == "1": val += 1
423 raise "Invalid symbol %s" % d[i]
430 ## Read bitmap texture from the text file.
431 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
432 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
433 ## The function returns width and height of the pixmap in pixels and byte stream representing
434 ## texture bitmap itself.
436 ## This function can be used to read the texture to the byte stream in order to pass it to
437 ## the AddTexture() function of geomBuilder class.
440 ## from salome.geom import geomBuilder
441 ## geompy = geomBuilder.New(salome.myStudy)
442 ## texture = geompy.readtexture('mytexture.dat')
443 ## texture = geompy.AddTexture(*texture)
444 ## obj.SetMarkerTexture(texture)
446 ## @param fname texture file name
447 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
448 ## @ingroup l1_geomBuilder_auxiliary
449 def ReadTexture(fname):
451 Read bitmap texture from the text file.
452 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
453 A zero symbol ('0') represents transparent pixel of the texture bitmap.
454 The function returns width and height of the pixmap in pixels and byte stream representing
455 texture bitmap itself.
456 This function can be used to read the texture to the byte stream in order to pass it to
457 the AddTexture() function of geomBuilder class.
460 fname texture file name
463 sequence of tree values: texture's width, height in pixels and its byte stream
466 from salome.geom import geomBuilder
467 geompy = geomBuilder.New(salome.myStudy)
468 texture = geompy.readtexture('mytexture.dat')
469 texture = geompy.AddTexture(*texture)
470 obj.SetMarkerTexture(texture)
474 lines = [ l.strip() for l in f.readlines()]
477 if lines: maxlen = max([len(x) for x in lines])
479 if maxlen%8: lenbytes += 1
483 lenline = (len(line)/8+1)*8
486 lenline = (len(line)/8)*8
488 for i in range(lenline/8):
491 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
494 bytedata += PackData(byte)
496 for i in range(lenline/8, lenbytes):
497 bytedata += PackData("0")
499 return lenbytes*8, len(lines), bytedata
504 ## Returns a long value from enumeration type
505 # Can be used for CORBA enumerator types like GEOM.shape_type
506 # @param theItem enumeration type
507 # @ingroup l1_geomBuilder_auxiliary
508 def EnumToLong(theItem):
510 Returns a long value from enumeration type
511 Can be used for CORBA enumerator types like geomBuilder.ShapeType
514 theItem enumeration type
517 if hasattr(theItem, "_v"): ret = theItem._v
520 ## Information about closed/unclosed state of shell or wire
521 # @ingroup l1_geomBuilder_auxiliary
524 Information about closed/unclosed state of shell or wire
530 ## Private class used to bind calls of plugin operations to geomBuilder
531 class PluginOperation:
532 def __init__(self, operation, function):
533 self.operation = operation
534 self.function = function
537 @ManageTransactions("operation")
538 def __call__(self, *args):
539 res = self.function(self.operation, *args)
540 RaiseIfFailed(self.function.__name__, self.operation)
543 # Warning: geom is a singleton
549 class geomBuilder(object, GEOM._objref_GEOM_Gen):
551 ## Enumeration ShapeType as a dictionary. \n
552 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
553 # @ingroup l1_geomBuilder_auxiliary
554 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
556 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
557 # and a list of parameters, describing the shape.
558 # List of parameters, describing the shape:
559 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
560 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
562 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
564 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
566 # - SPHERE: [xc yc zc R]
567 # - CYLINDER: [xb yb zb dx dy dz R H]
568 # - BOX: [xc yc zc ax ay az]
569 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
570 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
571 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
572 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
573 # - SOLID: [nb_faces nb_edges nb_vertices]
575 # - SPHERE2D: [xc yc zc R]
576 # - CYLINDER2D: [xb yb zb dx dy dz R H]
577 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
578 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
579 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
580 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
581 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
582 # - PLANE: [xo yo zo dx dy dz]
583 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
584 # - FACE: [nb_edges nb_vertices]
586 # - CIRCLE: [xc yc zc dx dy dz R]
587 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
588 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
589 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
590 # - LINE: [xo yo zo dx dy dz]
591 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
592 # - EDGE: [nb_vertices]
595 # @ingroup l1_geomBuilder_auxiliary
596 kind = GEOM.GEOM_IKindOfShape
603 #print "==== __new__ ", engine, geom, doLcc, created
605 # geom engine is either retrieved from engine, or created
607 # Following test avoids a recursive loop
610 # geom engine not created: existing engine found
612 if doLcc and not created:
614 # FindOrLoadComponent called:
615 # 1. CORBA resolution of server
616 # 2. the __new__ method is called again
617 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
618 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
621 # FindOrLoadComponent not called
623 # geomBuilder instance is created from lcc.FindOrLoadComponent
624 #print "==== super ", engine, geom, doLcc, created
625 geom = super(geomBuilder,cls).__new__(cls)
628 # geom engine not created: existing engine found
629 #print "==== existing ", engine, geom, doLcc, created
631 #print "return geom 1 ", geom
634 #print "return geom 2 ", geom
639 #print "-------- geomBuilder __init__ --- ", created, self
642 GEOM._objref_GEOM_Gen.__init__(self)
643 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
644 self.myBuilder = None
664 ## Process object publication in the study, as follows:
665 # - if @a theName is specified (not None), the object is published in the study
666 # with this name, not taking into account "auto-publishing" option;
667 # - if @a theName is NOT specified, the object is published in the study
668 # (using default name, which can be customized using @a theDefaultName parameter)
669 # only if auto-publishing is switched on.
671 # @param theObj object, a subject for publishing
672 # @param theName object name for study
673 # @param theDefaultName default name for the auto-publishing
675 # @sa addToStudyAuto()
676 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
678 def _item_name(_names, _defname, _idx=-1):
679 if not _names: _names = _defname
680 if type(_names) in [types.ListType, types.TupleType]:
682 if _idx >= len(_names) or not _names[_idx]:
683 if type(_defname) not in [types.ListType, types.TupleType]:
684 _name = "%s_%d"%(_defname, _idx+1)
685 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
686 _name = _defname[_idx]
688 _name = "%noname_%d"%(dn, _idx+1)
694 # must be wrong usage
699 _name = "%s_%d"%(_names, _idx+1)
705 def _publish( _name, _obj ):
707 if isinstance( _obj, GEOM._objref_GEOM_Field ):
708 fatherObj = _obj.GetShape()
709 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
710 fatherObj = _obj.GetField()
711 elif not _obj.IsMainShape():
712 fatherObj = _obj.GetMainShape()
714 if fatherObj and fatherObj.GetStudyEntry():
715 self.addToStudyInFather(fatherObj, _obj, _name)
717 self.addToStudy(_obj, _name)
723 if not theName and not self.myMaxNbSubShapesAllowed:
724 return # nothing to do: auto-publishing is disabled
725 if not theName and not theDefaultName:
726 return # neither theName nor theDefaultName is given
728 if type(theObj) in [types.ListType, types.TupleType]:
729 # list of objects is being published
732 if not obj: continue # bad object
733 name = _item_name(theName, theDefaultName, idx)
734 _publish( name, obj )
736 if not theName and idx == self.myMaxNbSubShapesAllowed: break
740 # single object is published
741 name = _item_name(theName, theDefaultName)
742 _publish( name, theObj )
745 ## @addtogroup l1_geomBuilder_auxiliary
747 def init_geom(self,theStudy):
748 self.myStudy = theStudy
749 self.myStudyId = self.myStudy._get_StudyId()
750 self.myBuilder = self.myStudy.NewBuilder()
751 self.father = self.myStudy.FindComponent("GEOM")
752 notebook.myStudy = theStudy
753 if self.father is None:
754 self.father = self.myBuilder.NewComponent("GEOM")
755 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
756 FName = A1._narrow(SALOMEDS.AttributeName)
757 FName.SetValue("Geometry")
758 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
759 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
760 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
761 self.myBuilder.DefineComponentInstance(self.father,self)
763 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
764 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
765 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
766 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
767 self.HealOp = self.GetIHealingOperations (self.myStudyId)
768 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
769 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
770 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
771 self.LocalOp = self.GetILocalOperations (self.myStudyId)
772 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
773 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
774 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
775 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
777 # The below line is a right way to map all plugin functions to geomBuilder,
778 # but AdvancedOperations are already mapped, that is why this line is commented
779 # and presents here only as an axample
780 #self.AdvOp = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
782 # self.AdvOp is used by functions MakePipeTShape*, MakeDividedDisk, etc.
783 self.AdvOp = GEOM._objref_GEOM_Gen.GetPluginOperations (self, self.myStudyId, "AdvancedEngine")
785 # set GEOM as root in the use case tree
786 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
787 self.myUseCaseBuilder.SetRootCurrent()
788 self.myUseCaseBuilder.Append(self.father)
791 def GetPluginOperations(self, studyID, libraryName):
792 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
794 # bind methods of operations to self
795 methods = op.__class__.__dict__['__methods__']
796 avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
797 for meth_name in methods:
798 if not meth_name in avoid_methods: # avoid basic methods
799 function = getattr(op.__class__, meth_name)
800 if callable(function):
801 #self.__dict__[meth_name] = self.__PluginOperation(op, function)
802 self.__dict__[meth_name] = PluginOperation(op, function)
805 ## Enable / disable results auto-publishing
807 # The automatic publishing is managed in the following way:
808 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
809 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
810 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
811 # value passed as parameter has the same effect.
812 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
813 # maximum number of sub-shapes allowed for publishing is set to specified value.
815 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
816 # @ingroup l1_publish_data
817 def addToStudyAuto(self, maxNbSubShapes=-1):
819 Enable / disable results auto-publishing
821 The automatic publishing is managed in the following way:
822 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
823 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
824 maximum number of sub-shapes allowed for publishing is unlimited; any negative
825 value passed as parameter has the same effect.
826 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
827 maximum number of sub-shapes allowed for publishing is set to this value.
830 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
833 geompy.addToStudyAuto() # enable auto-publishing
834 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
835 geompy.addToStudyAuto(0) # disable auto-publishing
837 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
840 ## Dump component to the Python script
841 # This method overrides IDL function to allow default values for the parameters.
842 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
844 Dump component to the Python script
845 This method overrides IDL function to allow default values for the parameters.
847 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
849 ## Get name for sub-shape aSubObj of shape aMainObj
851 # @ref swig_SubShapeName "Example"
852 @ManageTransactions("ShapesOp")
853 def SubShapeName(self,aSubObj, aMainObj):
855 Get name for sub-shape aSubObj of shape aMainObj
857 # Example: see GEOM_TestAll.py
859 #aSubId = orb.object_to_string(aSubObj)
860 #aMainId = orb.object_to_string(aMainObj)
861 #index = gg.getIndexTopology(aSubId, aMainId)
862 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
863 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
864 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
867 ## Publish in study aShape with name aName
869 # \param aShape the shape to be published
870 # \param aName the name for the shape
871 # \param doRestoreSubShapes if True, finds and publishes also
872 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
873 # and published sub-shapes of arguments
874 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
875 # these arguments description
876 # \return study entry of the published shape in form of string
878 # @ingroup l1_publish_data
879 # @ref swig_all_addtostudy "Example"
880 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
881 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
883 Publish in study aShape with name aName
886 aShape the shape to be published
887 aName the name for the shape
888 doRestoreSubShapes if True, finds and publishes also
889 sub-shapes of aShape, corresponding to its arguments
890 and published sub-shapes of arguments
891 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
892 these arguments description
895 study entry of the published shape in form of string
898 id_block1 = geompy.addToStudy(Block1, "Block 1")
900 # Example: see GEOM_TestAll.py
902 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
903 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
904 if doRestoreSubShapes:
905 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
906 theFindMethod, theInheritFirstArg, True )
908 print "addToStudy() failed"
910 return aShape.GetStudyEntry()
912 ## Publish in study aShape with name aName as sub-object of previously published aFather
913 # \param aFather previously published object
914 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
915 # \param aName the name for the shape
917 # \return study entry of the published shape in form of string
919 # @ingroup l1_publish_data
920 # @ref swig_all_addtostudyInFather "Example"
921 def addToStudyInFather(self, aFather, aShape, aName):
923 Publish in study aShape with name aName as sub-object of previously published aFather
926 aFather previously published object
927 aShape the shape to be published as sub-object of aFather
928 aName the name for the shape
931 study entry of the published shape in form of string
933 # Example: see GEOM_TestAll.py
935 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
936 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
938 print "addToStudyInFather() failed"
940 return aShape.GetStudyEntry()
942 ## Unpublish object in study
944 # \param obj the object to be unpublished
945 def hideInStudy(self, obj):
947 Unpublish object in study
950 obj the object to be unpublished
952 ior = salome.orb.object_to_string(obj)
953 aSObject = self.myStudy.FindObjectIOR(ior)
954 if aSObject is not None:
955 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
956 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
957 drwAttribute.SetDrawable(False)
960 # end of l1_geomBuilder_auxiliary
963 ## @addtogroup l3_restore_ss
966 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
967 # To be used from python scripts out of addToStudy() (non-default usage)
968 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
969 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
970 # If this list is empty, all operation arguments will be published
971 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
972 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
973 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
974 # Do not publish sub-shapes in place of arguments, but only
975 # in place of sub-shapes of the first argument,
976 # because the whole shape corresponds to the first argument.
977 # Mainly to be used after transformations, but it also can be
978 # usefull after partition with one object shape, and some other
979 # operations, where only the first argument has to be considered.
980 # If theObject has only one argument shape, this flag is automatically
981 # considered as True, not regarding really passed value.
982 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
983 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
984 # \return list of published sub-shapes
986 # @ref tui_restore_prs_params "Example"
987 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
988 theInheritFirstArg=False, theAddPrefix=True):
990 Publish sub-shapes, standing for arguments and sub-shapes of arguments
991 To be used from python scripts out of geompy.addToStudy (non-default usage)
994 theObject published GEOM.GEOM_Object, arguments of which will be published
995 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
996 If this list is empty, all operation arguments will be published
997 theFindMethod method to search sub-shapes, corresponding to arguments and
998 their sub-shapes. Value from enumeration GEOM.find_shape_method.
999 theInheritFirstArg set properties of the first argument for theObject.
1000 Do not publish sub-shapes in place of arguments, but only
1001 in place of sub-shapes of the first argument,
1002 because the whole shape corresponds to the first argument.
1003 Mainly to be used after transformations, but it also can be
1004 usefull after partition with one object shape, and some other
1005 operations, where only the first argument has to be considered.
1006 If theObject has only one argument shape, this flag is automatically
1007 considered as True, not regarding really passed value.
1008 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1009 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1011 list of published sub-shapes
1013 # Example: see GEOM_TestAll.py
1014 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1015 theFindMethod, theInheritFirstArg, theAddPrefix)
1017 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1018 # To be used from python scripts out of addToStudy() (non-default usage)
1019 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1020 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1021 # If this list is empty, all operation arguments will be published
1022 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1023 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1024 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1025 # Do not publish sub-shapes in place of arguments, but only
1026 # in place of sub-shapes of the first argument,
1027 # because the whole shape corresponds to the first argument.
1028 # Mainly to be used after transformations, but it also can be
1029 # usefull after partition with one object shape, and some other
1030 # operations, where only the first argument has to be considered.
1031 # If theObject has only one argument shape, this flag is automatically
1032 # considered as True, not regarding really passed value.
1033 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1034 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1035 # \return list of published sub-shapes
1037 # @ref tui_restore_prs_params "Example"
1038 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1039 theInheritFirstArg=False, theAddPrefix=True):
1041 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1042 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1045 theObject published GEOM.GEOM_Object, arguments of which will be published
1046 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1047 If this list is empty, all operation arguments will be published
1048 theFindMethod method to search sub-shapes, corresponding to arguments and
1049 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1050 theInheritFirstArg set properties of the first argument for theObject.
1051 Do not publish sub-shapes in place of arguments, but only
1052 in place of sub-shapes of the first argument,
1053 because the whole shape corresponds to the first argument.
1054 Mainly to be used after transformations, but it also can be
1055 usefull after partition with one object shape, and some other
1056 operations, where only the first argument has to be considered.
1057 If theObject has only one argument shape, this flag is automatically
1058 considered as True, not regarding really passed value.
1059 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1060 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1063 list of published sub-shapes
1065 # Example: see GEOM_TestAll.py
1066 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1067 theFindMethod, theInheritFirstArg, theAddPrefix)
1069 # end of l3_restore_ss
1072 ## @addtogroup l3_basic_go
1075 ## Create point by three coordinates.
1076 # @param theX The X coordinate of the point.
1077 # @param theY The Y coordinate of the point.
1078 # @param theZ The Z coordinate of the point.
1079 # @param theName Object name; when specified, this parameter is used
1080 # for result publication in the study. Otherwise, if automatic
1081 # publication is switched on, default value is used for result name.
1083 # @return New GEOM.GEOM_Object, containing the created point.
1085 # @ref tui_creation_point "Example"
1086 @ManageTransactions("BasicOp")
1087 def MakeVertex(self, theX, theY, theZ, theName=None):
1089 Create point by three coordinates.
1092 theX The X coordinate of the point.
1093 theY The Y coordinate of the point.
1094 theZ The Z coordinate of the point.
1095 theName Object name; when specified, this parameter is used
1096 for result publication in the study. Otherwise, if automatic
1097 publication is switched on, default value is used for result name.
1100 New GEOM.GEOM_Object, containing the created point.
1102 # Example: see GEOM_TestAll.py
1103 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1104 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1105 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1106 anObj.SetParameters(Parameters)
1107 self._autoPublish(anObj, theName, "vertex")
1110 ## Create a point, distant from the referenced point
1111 # on the given distances along the coordinate axes.
1112 # @param theReference The referenced point.
1113 # @param theX Displacement from the referenced point along OX axis.
1114 # @param theY Displacement from the referenced point along OY axis.
1115 # @param theZ Displacement from the referenced point along OZ axis.
1116 # @param theName Object name; when specified, this parameter is used
1117 # for result publication in the study. Otherwise, if automatic
1118 # publication is switched on, default value is used for result name.
1120 # @return New GEOM.GEOM_Object, containing the created point.
1122 # @ref tui_creation_point "Example"
1123 @ManageTransactions("BasicOp")
1124 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1126 Create a point, distant from the referenced point
1127 on the given distances along the coordinate axes.
1130 theReference The referenced point.
1131 theX Displacement from the referenced point along OX axis.
1132 theY Displacement from the referenced point along OY axis.
1133 theZ Displacement from the referenced point along OZ axis.
1134 theName Object name; when specified, this parameter is used
1135 for result publication in the study. Otherwise, if automatic
1136 publication is switched on, default value is used for result name.
1139 New GEOM.GEOM_Object, containing the created point.
1141 # Example: see GEOM_TestAll.py
1142 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1143 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1144 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1145 anObj.SetParameters(Parameters)
1146 self._autoPublish(anObj, theName, "vertex")
1149 ## Create a point, corresponding to the given parameter on the given curve.
1150 # @param theRefCurve The referenced curve.
1151 # @param theParameter Value of parameter on the referenced curve.
1152 # @param theName Object name; when specified, this parameter is used
1153 # for result publication in the study. Otherwise, if automatic
1154 # publication is switched on, default value is used for result name.
1156 # @return New GEOM.GEOM_Object, containing the created point.
1158 # @ref tui_creation_point "Example"
1159 @ManageTransactions("BasicOp")
1160 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1162 Create a point, corresponding to the given parameter on the given curve.
1165 theRefCurve The referenced curve.
1166 theParameter Value of parameter on the referenced curve.
1167 theName Object name; when specified, this parameter is used
1168 for result publication in the study. Otherwise, if automatic
1169 publication is switched on, default value is used for result name.
1172 New GEOM.GEOM_Object, containing the created point.
1175 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1177 # Example: see GEOM_TestAll.py
1178 theParameter, Parameters = ParseParameters(theParameter)
1179 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1180 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1181 anObj.SetParameters(Parameters)
1182 self._autoPublish(anObj, theName, "vertex")
1185 ## Create a point by projection give coordinates on the given curve
1186 # @param theRefCurve The referenced curve.
1187 # @param theX X-coordinate in 3D space
1188 # @param theY Y-coordinate in 3D space
1189 # @param theZ Z-coordinate in 3D space
1190 # @param theName Object name; when specified, this parameter is used
1191 # for result publication in the study. Otherwise, if automatic
1192 # publication is switched on, default value is used for result name.
1194 # @return New GEOM.GEOM_Object, containing the created point.
1196 # @ref tui_creation_point "Example"
1197 @ManageTransactions("BasicOp")
1198 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1200 Create a point by projection give coordinates on the given curve
1203 theRefCurve The referenced curve.
1204 theX X-coordinate in 3D space
1205 theY Y-coordinate in 3D space
1206 theZ Z-coordinate in 3D space
1207 theName Object name; when specified, this parameter is used
1208 for result publication in the study. Otherwise, if automatic
1209 publication is switched on, default value is used for result name.
1212 New GEOM.GEOM_Object, containing the created point.
1215 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1217 # Example: see GEOM_TestAll.py
1218 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1219 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1220 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1221 anObj.SetParameters(Parameters)
1222 self._autoPublish(anObj, theName, "vertex")
1225 ## Create a point, corresponding to the given length on the given curve.
1226 # @param theRefCurve The referenced curve.
1227 # @param theLength Length on the referenced curve. It can be negative.
1228 # @param theStartPoint Point allowing to choose the direction for the calculation
1229 # of the length. If None, start from the first point of theRefCurve.
1230 # @param theName Object name; when specified, this parameter is used
1231 # for result publication in the study. Otherwise, if automatic
1232 # publication is switched on, default value is used for result name.
1234 # @return New GEOM.GEOM_Object, containing the created point.
1236 # @ref tui_creation_point "Example"
1237 @ManageTransactions("BasicOp")
1238 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1240 Create a point, corresponding to the given length on the given curve.
1243 theRefCurve The referenced curve.
1244 theLength Length on the referenced curve. It can be negative.
1245 theStartPoint Point allowing to choose the direction for the calculation
1246 of the length. If None, start from the first point of theRefCurve.
1247 theName Object name; when specified, this parameter is used
1248 for result publication in the study. Otherwise, if automatic
1249 publication is switched on, default value is used for result name.
1252 New GEOM.GEOM_Object, containing the created point.
1254 # Example: see GEOM_TestAll.py
1255 theLength, Parameters = ParseParameters(theLength)
1256 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1257 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1258 anObj.SetParameters(Parameters)
1259 self._autoPublish(anObj, theName, "vertex")
1262 ## Create a point, corresponding to the given parameters on the
1264 # @param theRefSurf The referenced surface.
1265 # @param theUParameter Value of U-parameter on the referenced surface.
1266 # @param theVParameter Value of V-parameter on the referenced surface.
1267 # @param theName Object name; when specified, this parameter is used
1268 # for result publication in the study. Otherwise, if automatic
1269 # publication is switched on, default value is used for result name.
1271 # @return New GEOM.GEOM_Object, containing the created point.
1273 # @ref swig_MakeVertexOnSurface "Example"
1274 @ManageTransactions("BasicOp")
1275 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1277 Create a point, corresponding to the given parameters on the
1281 theRefSurf The referenced surface.
1282 theUParameter Value of U-parameter on the referenced surface.
1283 theVParameter Value of V-parameter on the referenced surface.
1284 theName Object name; when specified, this parameter is used
1285 for result publication in the study. Otherwise, if automatic
1286 publication is switched on, default value is used for result name.
1289 New GEOM.GEOM_Object, containing the created point.
1292 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1294 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1295 # Example: see GEOM_TestAll.py
1296 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1297 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1298 anObj.SetParameters(Parameters);
1299 self._autoPublish(anObj, theName, "vertex")
1302 ## Create a point by projection give coordinates on the given surface
1303 # @param theRefSurf The referenced surface.
1304 # @param theX X-coordinate in 3D space
1305 # @param theY Y-coordinate in 3D space
1306 # @param theZ Z-coordinate in 3D space
1307 # @param theName Object name; when specified, this parameter is used
1308 # for result publication in the study. Otherwise, if automatic
1309 # publication is switched on, default value is used for result name.
1311 # @return New GEOM.GEOM_Object, containing the created point.
1313 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1314 @ManageTransactions("BasicOp")
1315 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1317 Create a point by projection give coordinates on the given surface
1320 theRefSurf The referenced surface.
1321 theX X-coordinate in 3D space
1322 theY Y-coordinate in 3D space
1323 theZ Z-coordinate in 3D space
1324 theName Object name; when specified, this parameter is used
1325 for result publication in the study. Otherwise, if automatic
1326 publication is switched on, default value is used for result name.
1329 New GEOM.GEOM_Object, containing the created point.
1332 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1334 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1335 # Example: see GEOM_TestAll.py
1336 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1337 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1338 anObj.SetParameters(Parameters);
1339 self._autoPublish(anObj, theName, "vertex")
1342 ## Create a point, which lays on the given face.
1343 # The point will lay in arbitrary place of the face.
1344 # The only condition on it is a non-zero distance to the face boundary.
1345 # Such point can be used to uniquely identify the face inside any
1346 # shape in case, when the shape does not contain overlapped faces.
1347 # @param theFace The referenced face.
1348 # @param theName Object name; when specified, this parameter is used
1349 # for result publication in the study. Otherwise, if automatic
1350 # publication is switched on, default value is used for result name.
1352 # @return New GEOM.GEOM_Object, containing the created point.
1354 # @ref swig_MakeVertexInsideFace "Example"
1355 @ManageTransactions("BasicOp")
1356 def MakeVertexInsideFace (self, theFace, theName=None):
1358 Create a point, which lays on the given face.
1359 The point will lay in arbitrary place of the face.
1360 The only condition on it is a non-zero distance to the face boundary.
1361 Such point can be used to uniquely identify the face inside any
1362 shape in case, when the shape does not contain overlapped faces.
1365 theFace The referenced face.
1366 theName Object name; when specified, this parameter is used
1367 for result publication in the study. Otherwise, if automatic
1368 publication is switched on, default value is used for result name.
1371 New GEOM.GEOM_Object, containing the created point.
1374 p_on_face = geompy.MakeVertexInsideFace(Face)
1376 # Example: see GEOM_TestAll.py
1377 anObj = self.BasicOp.MakePointOnFace(theFace)
1378 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1379 self._autoPublish(anObj, theName, "vertex")
1382 ## Create a point on intersection of two lines.
1383 # @param theRefLine1, theRefLine2 The referenced lines.
1384 # @param theName Object name; when specified, this parameter is used
1385 # for result publication in the study. Otherwise, if automatic
1386 # publication is switched on, default value is used for result name.
1388 # @return New GEOM.GEOM_Object, containing the created point.
1390 # @ref swig_MakeVertexOnLinesIntersection "Example"
1391 @ManageTransactions("BasicOp")
1392 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1394 Create a point on intersection of two lines.
1397 theRefLine1, theRefLine2 The referenced lines.
1398 theName Object name; when specified, this parameter is used
1399 for result publication in the study. Otherwise, if automatic
1400 publication is switched on, default value is used for result name.
1403 New GEOM.GEOM_Object, containing the created point.
1405 # Example: see GEOM_TestAll.py
1406 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1407 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1408 self._autoPublish(anObj, theName, "vertex")
1411 ## Create a tangent, corresponding to the given parameter on the given curve.
1412 # @param theRefCurve The referenced curve.
1413 # @param theParameter Value of parameter on the referenced curve.
1414 # @param theName Object name; when specified, this parameter is used
1415 # for result publication in the study. Otherwise, if automatic
1416 # publication is switched on, default value is used for result name.
1418 # @return New GEOM.GEOM_Object, containing the created tangent.
1420 # @ref swig_MakeTangentOnCurve "Example"
1421 @ManageTransactions("BasicOp")
1422 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1424 Create a tangent, corresponding to the given parameter on the given curve.
1427 theRefCurve The referenced curve.
1428 theParameter Value of parameter on the referenced curve.
1429 theName Object name; when specified, this parameter is used
1430 for result publication in the study. Otherwise, if automatic
1431 publication is switched on, default value is used for result name.
1434 New GEOM.GEOM_Object, containing the created tangent.
1437 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1439 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1440 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1441 self._autoPublish(anObj, theName, "tangent")
1444 ## Create a tangent plane, corresponding to the given parameter on the given face.
1445 # @param theFace The face for which tangent plane should be built.
1446 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1447 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1448 # @param theTrimSize the size of plane.
1449 # @param theName Object name; when specified, this parameter is used
1450 # for result publication in the study. Otherwise, if automatic
1451 # publication is switched on, default value is used for result name.
1453 # @return New GEOM.GEOM_Object, containing the created tangent.
1455 # @ref swig_MakeTangentPlaneOnFace "Example"
1456 @ManageTransactions("BasicOp")
1457 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1459 Create a tangent plane, corresponding to the given parameter on the given face.
1462 theFace The face for which tangent plane should be built.
1463 theParameterV vertical value of the center point (0.0 - 1.0).
1464 theParameterU horisontal value of the center point (0.0 - 1.0).
1465 theTrimSize the size of plane.
1466 theName Object name; when specified, this parameter is used
1467 for result publication in the study. Otherwise, if automatic
1468 publication is switched on, default value is used for result name.
1471 New GEOM.GEOM_Object, containing the created tangent.
1474 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1476 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1477 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1478 self._autoPublish(anObj, theName, "tangent")
1481 ## Create a vector with the given components.
1482 # @param theDX X component of the vector.
1483 # @param theDY Y component of the vector.
1484 # @param theDZ Z component of the vector.
1485 # @param theName Object name; when specified, this parameter is used
1486 # for result publication in the study. Otherwise, if automatic
1487 # publication is switched on, default value is used for result name.
1489 # @return New GEOM.GEOM_Object, containing the created vector.
1491 # @ref tui_creation_vector "Example"
1492 @ManageTransactions("BasicOp")
1493 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1495 Create a vector with the given components.
1498 theDX X component of the vector.
1499 theDY Y component of the vector.
1500 theDZ Z component of the vector.
1501 theName Object name; when specified, this parameter is used
1502 for result publication in the study. Otherwise, if automatic
1503 publication is switched on, default value is used for result name.
1506 New GEOM.GEOM_Object, containing the created vector.
1508 # Example: see GEOM_TestAll.py
1509 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1510 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1511 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1512 anObj.SetParameters(Parameters)
1513 self._autoPublish(anObj, theName, "vector")
1516 ## Create a vector between two points.
1517 # @param thePnt1 Start point for the vector.
1518 # @param thePnt2 End point for the vector.
1519 # @param theName Object name; when specified, this parameter is used
1520 # for result publication in the study. Otherwise, if automatic
1521 # publication is switched on, default value is used for result name.
1523 # @return New GEOM.GEOM_Object, containing the created vector.
1525 # @ref tui_creation_vector "Example"
1526 @ManageTransactions("BasicOp")
1527 def MakeVector(self, thePnt1, thePnt2, theName=None):
1529 Create a vector between two points.
1532 thePnt1 Start point for the vector.
1533 thePnt2 End point for the vector.
1534 theName Object name; when specified, this parameter is used
1535 for result publication in the study. Otherwise, if automatic
1536 publication is switched on, default value is used for result name.
1539 New GEOM.GEOM_Object, containing the created vector.
1541 # Example: see GEOM_TestAll.py
1542 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1543 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1544 self._autoPublish(anObj, theName, "vector")
1547 ## Create a line, passing through the given point
1548 # and parrallel to the given direction
1549 # @param thePnt Point. The resulting line will pass through it.
1550 # @param theDir Direction. The resulting line will be parallel to it.
1551 # @param theName Object name; when specified, this parameter is used
1552 # for result publication in the study. Otherwise, if automatic
1553 # publication is switched on, default value is used for result name.
1555 # @return New GEOM.GEOM_Object, containing the created line.
1557 # @ref tui_creation_line "Example"
1558 @ManageTransactions("BasicOp")
1559 def MakeLine(self, thePnt, theDir, theName=None):
1561 Create a line, passing through the given point
1562 and parrallel to the given direction
1565 thePnt Point. The resulting line will pass through it.
1566 theDir Direction. The resulting line will be parallel to it.
1567 theName Object name; when specified, this parameter is used
1568 for result publication in the study. Otherwise, if automatic
1569 publication is switched on, default value is used for result name.
1572 New GEOM.GEOM_Object, containing the created line.
1574 # Example: see GEOM_TestAll.py
1575 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1576 RaiseIfFailed("MakeLine", self.BasicOp)
1577 self._autoPublish(anObj, theName, "line")
1580 ## Create a line, passing through the given points
1581 # @param thePnt1 First of two points, defining the line.
1582 # @param thePnt2 Second of two points, defining the line.
1583 # @param theName Object name; when specified, this parameter is used
1584 # for result publication in the study. Otherwise, if automatic
1585 # publication is switched on, default value is used for result name.
1587 # @return New GEOM.GEOM_Object, containing the created line.
1589 # @ref tui_creation_line "Example"
1590 @ManageTransactions("BasicOp")
1591 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1593 Create a line, passing through the given points
1596 thePnt1 First of two points, defining the line.
1597 thePnt2 Second of two points, defining the line.
1598 theName Object name; when specified, this parameter is used
1599 for result publication in the study. Otherwise, if automatic
1600 publication is switched on, default value is used for result name.
1603 New GEOM.GEOM_Object, containing the created line.
1605 # Example: see GEOM_TestAll.py
1606 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1607 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1608 self._autoPublish(anObj, theName, "line")
1611 ## Create a line on two faces intersection.
1612 # @param theFace1 First of two faces, defining the line.
1613 # @param theFace2 Second of two faces, defining the line.
1614 # @param theName Object name; when specified, this parameter is used
1615 # for result publication in the study. Otherwise, if automatic
1616 # publication is switched on, default value is used for result name.
1618 # @return New GEOM.GEOM_Object, containing the created line.
1620 # @ref swig_MakeLineTwoFaces "Example"
1621 @ManageTransactions("BasicOp")
1622 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1624 Create a line on two faces intersection.
1627 theFace1 First of two faces, defining the line.
1628 theFace2 Second of two faces, defining the line.
1629 theName Object name; when specified, this parameter is used
1630 for result publication in the study. Otherwise, if automatic
1631 publication is switched on, default value is used for result name.
1634 New GEOM.GEOM_Object, containing the created line.
1636 # Example: see GEOM_TestAll.py
1637 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1638 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1639 self._autoPublish(anObj, theName, "line")
1642 ## Create a plane, passing through the given point
1643 # and normal to the given vector.
1644 # @param thePnt Point, the plane has to pass through.
1645 # @param theVec Vector, defining the plane normal direction.
1646 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1647 # @param theName Object name; when specified, this parameter is used
1648 # for result publication in the study. Otherwise, if automatic
1649 # publication is switched on, default value is used for result name.
1651 # @return New GEOM.GEOM_Object, containing the created plane.
1653 # @ref tui_creation_plane "Example"
1654 @ManageTransactions("BasicOp")
1655 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1657 Create a plane, passing through the given point
1658 and normal to the given vector.
1661 thePnt Point, the plane has to pass through.
1662 theVec Vector, defining the plane normal direction.
1663 theTrimSize Half size of a side of quadrangle face, representing the plane.
1664 theName Object name; when specified, this parameter is used
1665 for result publication in the study. Otherwise, if automatic
1666 publication is switched on, default value is used for result name.
1669 New GEOM.GEOM_Object, containing the created plane.
1671 # Example: see GEOM_TestAll.py
1672 theTrimSize, Parameters = ParseParameters(theTrimSize);
1673 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1674 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1675 anObj.SetParameters(Parameters)
1676 self._autoPublish(anObj, theName, "plane")
1679 ## Create a plane, passing through the three given points
1680 # @param thePnt1 First of three points, defining the plane.
1681 # @param thePnt2 Second of three points, defining the plane.
1682 # @param thePnt3 Fird of three points, defining the plane.
1683 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1684 # @param theName Object name; when specified, this parameter is used
1685 # for result publication in the study. Otherwise, if automatic
1686 # publication is switched on, default value is used for result name.
1688 # @return New GEOM.GEOM_Object, containing the created plane.
1690 # @ref tui_creation_plane "Example"
1691 @ManageTransactions("BasicOp")
1692 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1694 Create a plane, passing through the three given points
1697 thePnt1 First of three points, defining the plane.
1698 thePnt2 Second of three points, defining the plane.
1699 thePnt3 Fird of three points, defining the plane.
1700 theTrimSize Half size of a side of quadrangle face, representing the plane.
1701 theName Object name; when specified, this parameter is used
1702 for result publication in the study. Otherwise, if automatic
1703 publication is switched on, default value is used for result name.
1706 New GEOM.GEOM_Object, containing the created plane.
1708 # Example: see GEOM_TestAll.py
1709 theTrimSize, Parameters = ParseParameters(theTrimSize);
1710 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1711 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1712 anObj.SetParameters(Parameters)
1713 self._autoPublish(anObj, theName, "plane")
1716 ## Create a plane, similar to the existing one, but with another size of representing face.
1717 # @param theFace Referenced plane or LCS(Marker).
1718 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1719 # @param theName Object name; when specified, this parameter is used
1720 # for result publication in the study. Otherwise, if automatic
1721 # publication is switched on, default value is used for result name.
1723 # @return New GEOM.GEOM_Object, containing the created plane.
1725 # @ref tui_creation_plane "Example"
1726 @ManageTransactions("BasicOp")
1727 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1729 Create a plane, similar to the existing one, but with another size of representing face.
1732 theFace Referenced plane or LCS(Marker).
1733 theTrimSize New half size of a side of quadrangle face, representing the plane.
1734 theName Object name; when specified, this parameter is used
1735 for result publication in the study. Otherwise, if automatic
1736 publication is switched on, default value is used for result name.
1739 New GEOM.GEOM_Object, containing the created plane.
1741 # Example: see GEOM_TestAll.py
1742 theTrimSize, Parameters = ParseParameters(theTrimSize);
1743 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1744 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1745 anObj.SetParameters(Parameters)
1746 self._autoPublish(anObj, theName, "plane")
1749 ## Create a plane, passing through the 2 vectors
1750 # with center in a start point of the first vector.
1751 # @param theVec1 Vector, defining center point and plane direction.
1752 # @param theVec2 Vector, defining the plane normal direction.
1753 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1754 # @param theName Object name; when specified, this parameter is used
1755 # for result publication in the study. Otherwise, if automatic
1756 # publication is switched on, default value is used for result name.
1758 # @return New GEOM.GEOM_Object, containing the created plane.
1760 # @ref tui_creation_plane "Example"
1761 @ManageTransactions("BasicOp")
1762 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1764 Create a plane, passing through the 2 vectors
1765 with center in a start point of the first vector.
1768 theVec1 Vector, defining center point and plane direction.
1769 theVec2 Vector, defining the plane normal direction.
1770 theTrimSize Half size of a side of quadrangle face, representing the plane.
1771 theName Object name; when specified, this parameter is used
1772 for result publication in the study. Otherwise, if automatic
1773 publication is switched on, default value is used for result name.
1776 New GEOM.GEOM_Object, containing the created plane.
1778 # Example: see GEOM_TestAll.py
1779 theTrimSize, Parameters = ParseParameters(theTrimSize);
1780 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1781 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1782 anObj.SetParameters(Parameters)
1783 self._autoPublish(anObj, theName, "plane")
1786 ## Create a plane, based on a Local coordinate system.
1787 # @param theLCS coordinate system, defining plane.
1788 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1789 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1790 # @param theName Object name; when specified, this parameter is used
1791 # for result publication in the study. Otherwise, if automatic
1792 # publication is switched on, default value is used for result name.
1794 # @return New GEOM.GEOM_Object, containing the created plane.
1796 # @ref tui_creation_plane "Example"
1797 @ManageTransactions("BasicOp")
1798 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1800 Create a plane, based on a Local coordinate system.
1803 theLCS coordinate system, defining plane.
1804 theTrimSize Half size of a side of quadrangle face, representing the plane.
1805 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1806 theName Object name; when specified, this parameter is used
1807 for result publication in the study. Otherwise, if automatic
1808 publication is switched on, default value is used for result name.
1811 New GEOM.GEOM_Object, containing the created plane.
1813 # Example: see GEOM_TestAll.py
1814 theTrimSize, Parameters = ParseParameters(theTrimSize);
1815 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1816 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1817 anObj.SetParameters(Parameters)
1818 self._autoPublish(anObj, theName, "plane")
1821 ## Create a local coordinate system.
1822 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1823 # @param XDX,XDY,XDZ Three components of OX direction
1824 # @param YDX,YDY,YDZ Three components of OY direction
1825 # @param theName Object name; when specified, this parameter is used
1826 # for result publication in the study. Otherwise, if automatic
1827 # publication is switched on, default value is used for result name.
1829 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1831 # @ref swig_MakeMarker "Example"
1832 @ManageTransactions("BasicOp")
1833 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1835 Create a local coordinate system.
1838 OX,OY,OZ Three coordinates of coordinate system origin.
1839 XDX,XDY,XDZ Three components of OX direction
1840 YDX,YDY,YDZ Three components of OY direction
1841 theName Object name; when specified, this parameter is used
1842 for result publication in the study. Otherwise, if automatic
1843 publication is switched on, default value is used for result name.
1846 New GEOM.GEOM_Object, containing the created coordinate system.
1848 # Example: see GEOM_TestAll.py
1849 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1850 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1851 RaiseIfFailed("MakeMarker", self.BasicOp)
1852 anObj.SetParameters(Parameters)
1853 self._autoPublish(anObj, theName, "lcs")
1856 ## Create a local coordinate system from shape.
1857 # @param theShape The initial shape to detect the coordinate system.
1858 # @param theName Object name; when specified, this parameter is used
1859 # for result publication in the study. Otherwise, if automatic
1860 # publication is switched on, default value is used for result name.
1862 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1864 # @ref tui_creation_lcs "Example"
1865 @ManageTransactions("BasicOp")
1866 def MakeMarkerFromShape(self, theShape, theName=None):
1868 Create a local coordinate system from shape.
1871 theShape The initial shape to detect the coordinate system.
1872 theName Object name; when specified, this parameter is used
1873 for result publication in the study. Otherwise, if automatic
1874 publication is switched on, default value is used for result name.
1877 New GEOM.GEOM_Object, containing the created coordinate system.
1879 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1880 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1881 self._autoPublish(anObj, theName, "lcs")
1884 ## Create a local coordinate system from point and two vectors.
1885 # @param theOrigin Point of coordinate system origin.
1886 # @param theXVec Vector of X direction
1887 # @param theYVec Vector of Y direction
1888 # @param theName Object name; when specified, this parameter is used
1889 # for result publication in the study. Otherwise, if automatic
1890 # publication is switched on, default value is used for result name.
1892 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1894 # @ref tui_creation_lcs "Example"
1895 @ManageTransactions("BasicOp")
1896 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1898 Create a local coordinate system from point and two vectors.
1901 theOrigin Point of coordinate system origin.
1902 theXVec Vector of X direction
1903 theYVec Vector of Y direction
1904 theName Object name; when specified, this parameter is used
1905 for result publication in the study. Otherwise, if automatic
1906 publication is switched on, default value is used for result name.
1909 New GEOM.GEOM_Object, containing the created coordinate system.
1912 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1913 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1914 self._autoPublish(anObj, theName, "lcs")
1917 # end of l3_basic_go
1920 ## @addtogroup l4_curves
1923 ## Create an arc of circle, passing through three given points.
1924 # @param thePnt1 Start point of the arc.
1925 # @param thePnt2 Middle point of the arc.
1926 # @param thePnt3 End point of the arc.
1927 # @param theName Object name; when specified, this parameter is used
1928 # for result publication in the study. Otherwise, if automatic
1929 # publication is switched on, default value is used for result name.
1931 # @return New GEOM.GEOM_Object, containing the created arc.
1933 # @ref swig_MakeArc "Example"
1934 @ManageTransactions("CurvesOp")
1935 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1937 Create an arc of circle, passing through three given points.
1940 thePnt1 Start point of the arc.
1941 thePnt2 Middle point of the arc.
1942 thePnt3 End point of the arc.
1943 theName Object name; when specified, this parameter is used
1944 for result publication in the study. Otherwise, if automatic
1945 publication is switched on, default value is used for result name.
1948 New GEOM.GEOM_Object, containing the created arc.
1950 # Example: see GEOM_TestAll.py
1951 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1952 RaiseIfFailed("MakeArc", self.CurvesOp)
1953 self._autoPublish(anObj, theName, "arc")
1956 ## Create an arc of circle from a center and 2 points.
1957 # @param thePnt1 Center of the arc
1958 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1959 # @param thePnt3 End point of the arc (Gives also a direction)
1960 # @param theSense Orientation of the arc
1961 # @param theName Object name; when specified, this parameter is used
1962 # for result publication in the study. Otherwise, if automatic
1963 # publication is switched on, default value is used for result name.
1965 # @return New GEOM.GEOM_Object, containing the created arc.
1967 # @ref swig_MakeArc "Example"
1968 @ManageTransactions("CurvesOp")
1969 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1971 Create an arc of circle from a center and 2 points.
1974 thePnt1 Center of the arc
1975 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1976 thePnt3 End point of the arc (Gives also a direction)
1977 theSense Orientation of the arc
1978 theName Object name; when specified, this parameter is used
1979 for result publication in the study. Otherwise, if automatic
1980 publication is switched on, default value is used for result name.
1983 New GEOM.GEOM_Object, containing the created arc.
1985 # Example: see GEOM_TestAll.py
1986 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1987 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1988 self._autoPublish(anObj, theName, "arc")
1991 ## Create an arc of ellipse, of center and two points.
1992 # @param theCenter Center of the arc.
1993 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1994 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1995 # @param theName Object name; when specified, this parameter is used
1996 # for result publication in the study. Otherwise, if automatic
1997 # publication is switched on, default value is used for result name.
1999 # @return New GEOM.GEOM_Object, containing the created arc.
2001 # @ref swig_MakeArc "Example"
2002 @ManageTransactions("CurvesOp")
2003 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2005 Create an arc of ellipse, of center and two points.
2008 theCenter Center of the arc.
2009 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2010 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2011 theName Object name; when specified, this parameter is used
2012 for result publication in the study. Otherwise, if automatic
2013 publication is switched on, default value is used for result name.
2016 New GEOM.GEOM_Object, containing the created arc.
2018 # Example: see GEOM_TestAll.py
2019 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2020 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2021 self._autoPublish(anObj, theName, "arc")
2024 ## Create a circle with given center, normal vector and radius.
2025 # @param thePnt Circle center.
2026 # @param theVec Vector, normal to the plane of the circle.
2027 # @param theR Circle radius.
2028 # @param theName Object name; when specified, this parameter is used
2029 # for result publication in the study. Otherwise, if automatic
2030 # publication is switched on, default value is used for result name.
2032 # @return New GEOM.GEOM_Object, containing the created circle.
2034 # @ref tui_creation_circle "Example"
2035 @ManageTransactions("CurvesOp")
2036 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2038 Create a circle with given center, normal vector and radius.
2041 thePnt Circle center.
2042 theVec Vector, normal to the plane of the circle.
2044 theName Object name; when specified, this parameter is used
2045 for result publication in the study. Otherwise, if automatic
2046 publication is switched on, default value is used for result name.
2049 New GEOM.GEOM_Object, containing the created circle.
2051 # Example: see GEOM_TestAll.py
2052 theR, Parameters = ParseParameters(theR)
2053 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2054 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2055 anObj.SetParameters(Parameters)
2056 self._autoPublish(anObj, theName, "circle")
2059 ## Create a circle with given radius.
2060 # Center of the circle will be in the origin of global
2061 # coordinate system and normal vector will be codirected with Z axis
2062 # @param theR Circle radius.
2063 # @param theName Object name; when specified, this parameter is used
2064 # for result publication in the study. Otherwise, if automatic
2065 # publication is switched on, default value is used for result name.
2067 # @return New GEOM.GEOM_Object, containing the created circle.
2068 @ManageTransactions("CurvesOp")
2069 def MakeCircleR(self, theR, theName=None):
2071 Create a circle with given radius.
2072 Center of the circle will be in the origin of global
2073 coordinate system and normal vector will be codirected with Z axis
2077 theName Object name; when specified, this parameter is used
2078 for result publication in the study. Otherwise, if automatic
2079 publication is switched on, default value is used for result name.
2082 New GEOM.GEOM_Object, containing the created circle.
2084 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2085 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2086 self._autoPublish(anObj, theName, "circle")
2089 ## Create a circle, passing through three given points
2090 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2091 # @param theName Object name; when specified, this parameter is used
2092 # for result publication in the study. Otherwise, if automatic
2093 # publication is switched on, default value is used for result name.
2095 # @return New GEOM.GEOM_Object, containing the created circle.
2097 # @ref tui_creation_circle "Example"
2098 @ManageTransactions("CurvesOp")
2099 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2101 Create a circle, passing through three given points
2104 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2105 theName Object name; when specified, this parameter is used
2106 for result publication in the study. Otherwise, if automatic
2107 publication is switched on, default value is used for result name.
2110 New GEOM.GEOM_Object, containing the created circle.
2112 # Example: see GEOM_TestAll.py
2113 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2114 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2115 self._autoPublish(anObj, theName, "circle")
2118 ## Create a circle, with given point1 as center,
2119 # passing through the point2 as radius and laying in the plane,
2120 # defined by all three given points.
2121 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2122 # @param theName Object name; when specified, this parameter is used
2123 # for result publication in the study. Otherwise, if automatic
2124 # publication is switched on, default value is used for result name.
2126 # @return New GEOM.GEOM_Object, containing the created circle.
2128 # @ref swig_MakeCircle "Example"
2129 @ManageTransactions("CurvesOp")
2130 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2132 Create a circle, with given point1 as center,
2133 passing through the point2 as radius and laying in the plane,
2134 defined by all three given points.
2137 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2138 theName Object name; when specified, this parameter is used
2139 for result publication in the study. Otherwise, if automatic
2140 publication is switched on, default value is used for result name.
2143 New GEOM.GEOM_Object, containing the created circle.
2145 # Example: see GEOM_example6.py
2146 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2147 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2148 self._autoPublish(anObj, theName, "circle")
2151 ## Create an ellipse with given center, normal vector and radiuses.
2152 # @param thePnt Ellipse center.
2153 # @param theVec Vector, normal to the plane of the ellipse.
2154 # @param theRMajor Major ellipse radius.
2155 # @param theRMinor Minor ellipse radius.
2156 # @param theVecMaj Vector, direction of the ellipse's main axis.
2157 # @param theName Object name; when specified, this parameter is used
2158 # for result publication in the study. Otherwise, if automatic
2159 # publication is switched on, default value is used for result name.
2161 # @return New GEOM.GEOM_Object, containing the created ellipse.
2163 # @ref tui_creation_ellipse "Example"
2164 @ManageTransactions("CurvesOp")
2165 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2167 Create an ellipse with given center, normal vector and radiuses.
2170 thePnt Ellipse center.
2171 theVec Vector, normal to the plane of the ellipse.
2172 theRMajor Major ellipse radius.
2173 theRMinor Minor ellipse radius.
2174 theVecMaj Vector, direction of the ellipse's main axis.
2175 theName Object name; when specified, this parameter is used
2176 for result publication in the study. Otherwise, if automatic
2177 publication is switched on, default value is used for result name.
2180 New GEOM.GEOM_Object, containing the created ellipse.
2182 # Example: see GEOM_TestAll.py
2183 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2184 if theVecMaj is not None:
2185 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2187 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2189 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2190 anObj.SetParameters(Parameters)
2191 self._autoPublish(anObj, theName, "ellipse")
2194 ## Create an ellipse with given radiuses.
2195 # Center of the ellipse will be in the origin of global
2196 # coordinate system and normal vector will be codirected with Z axis
2197 # @param theRMajor Major ellipse radius.
2198 # @param theRMinor Minor ellipse radius.
2199 # @param theName Object name; when specified, this parameter is used
2200 # for result publication in the study. Otherwise, if automatic
2201 # publication is switched on, default value is used for result name.
2203 # @return New GEOM.GEOM_Object, containing the created ellipse.
2204 @ManageTransactions("CurvesOp")
2205 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2207 Create an ellipse with given radiuses.
2208 Center of the ellipse will be in the origin of global
2209 coordinate system and normal vector will be codirected with Z axis
2212 theRMajor Major ellipse radius.
2213 theRMinor Minor ellipse radius.
2214 theName Object name; when specified, this parameter is used
2215 for result publication in the study. Otherwise, if automatic
2216 publication is switched on, default value is used for result name.
2219 New GEOM.GEOM_Object, containing the created ellipse.
2221 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2222 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2223 self._autoPublish(anObj, theName, "ellipse")
2226 ## Create a polyline on the set of points.
2227 # @param thePoints Sequence of points for the polyline.
2228 # @param theIsClosed If True, build a closed wire.
2229 # @param theName Object name; when specified, this parameter is used
2230 # for result publication in the study. Otherwise, if automatic
2231 # publication is switched on, default value is used for result name.
2233 # @return New GEOM.GEOM_Object, containing the created polyline.
2235 # @ref tui_creation_curve "Example"
2236 @ManageTransactions("CurvesOp")
2237 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2239 Create a polyline on the set of points.
2242 thePoints Sequence of points for the polyline.
2243 theIsClosed If True, build a closed wire.
2244 theName Object name; when specified, this parameter is used
2245 for result publication in the study. Otherwise, if automatic
2246 publication is switched on, default value is used for result name.
2249 New GEOM.GEOM_Object, containing the created polyline.
2251 # Example: see GEOM_TestAll.py
2252 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2253 RaiseIfFailed("MakePolyline", self.CurvesOp)
2254 self._autoPublish(anObj, theName, "polyline")
2257 ## Create bezier curve on the set of points.
2258 # @param thePoints Sequence of points for the bezier curve.
2259 # @param theIsClosed If True, build a closed curve.
2260 # @param theName Object name; when specified, this parameter is used
2261 # for result publication in the study. Otherwise, if automatic
2262 # publication is switched on, default value is used for result name.
2264 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2266 # @ref tui_creation_curve "Example"
2267 @ManageTransactions("CurvesOp")
2268 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2270 Create bezier curve on the set of points.
2273 thePoints Sequence of points for the bezier curve.
2274 theIsClosed If True, build a closed curve.
2275 theName Object name; when specified, this parameter is used
2276 for result publication in the study. Otherwise, if automatic
2277 publication is switched on, default value is used for result name.
2280 New GEOM.GEOM_Object, containing the created bezier curve.
2282 # Example: see GEOM_TestAll.py
2283 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2284 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2285 self._autoPublish(anObj, theName, "bezier")
2288 ## Create B-Spline curve on the set of points.
2289 # @param thePoints Sequence of points for the B-Spline curve.
2290 # @param theIsClosed If True, build a closed curve.
2291 # @param theDoReordering If TRUE, the algo does not follow the order of
2292 # \a thePoints but searches for the closest vertex.
2293 # @param theName Object name; when specified, this parameter is used
2294 # for result publication in the study. Otherwise, if automatic
2295 # publication is switched on, default value is used for result name.
2297 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2299 # @ref tui_creation_curve "Example"
2300 @ManageTransactions("CurvesOp")
2301 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2303 Create B-Spline curve on the set of points.
2306 thePoints Sequence of points for the B-Spline curve.
2307 theIsClosed If True, build a closed curve.
2308 theDoReordering If True, the algo does not follow the order of
2309 thePoints but searches for the closest vertex.
2310 theName Object name; when specified, this parameter is used
2311 for result publication in the study. Otherwise, if automatic
2312 publication is switched on, default value is used for result name.
2315 New GEOM.GEOM_Object, containing the created B-Spline curve.
2317 # Example: see GEOM_TestAll.py
2318 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2319 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2320 self._autoPublish(anObj, theName, "bspline")
2323 ## Create B-Spline curve on the set of points.
2324 # @param thePoints Sequence of points for the B-Spline curve.
2325 # @param theFirstVec Vector object, defining the curve direction at its first point.
2326 # @param theLastVec Vector object, defining the curve direction at its last point.
2327 # @param theName Object name; when specified, this parameter is used
2328 # for result publication in the study. Otherwise, if automatic
2329 # publication is switched on, default value is used for result name.
2331 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2333 # @ref tui_creation_curve "Example"
2334 @ManageTransactions("CurvesOp")
2335 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2337 Create B-Spline curve on the set of points.
2340 thePoints Sequence of points for the B-Spline curve.
2341 theFirstVec Vector object, defining the curve direction at its first point.
2342 theLastVec Vector object, defining the curve direction at its last point.
2343 theName Object name; when specified, this parameter is used
2344 for result publication in the study. Otherwise, if automatic
2345 publication is switched on, default value is used for result name.
2348 New GEOM.GEOM_Object, containing the created B-Spline curve.
2350 # Example: see GEOM_TestAll.py
2351 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2352 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2353 self._autoPublish(anObj, theName, "bspline")
2356 ## Creates a curve using the parametric definition of the basic points.
2357 # @param thexExpr parametric equation of the coordinates X.
2358 # @param theyExpr parametric equation of the coordinates Y.
2359 # @param thezExpr parametric equation of the coordinates Z.
2360 # @param theParamMin the minimal value of the parameter.
2361 # @param theParamMax the maximum value of the parameter.
2362 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2363 # @param theCurveType the type of the curve,
2364 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2365 # @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.
2366 # @param theName Object name; when specified, this parameter is used
2367 # for result publication in the study. Otherwise, if automatic
2368 # publication is switched on, default value is used for result name.
2370 # @return New GEOM.GEOM_Object, containing the created curve.
2372 # @ref tui_creation_curve "Example"
2373 @ManageTransactions("CurvesOp")
2374 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2375 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2377 Creates a curve using the parametric definition of the basic points.
2380 thexExpr parametric equation of the coordinates X.
2381 theyExpr parametric equation of the coordinates Y.
2382 thezExpr parametric equation of the coordinates Z.
2383 theParamMin the minimal value of the parameter.
2384 theParamMax the maximum value of the parameter.
2385 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2386 theCurveType the type of the curve,
2387 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2388 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2389 method is used which can lead to a bug.
2390 theName Object name; when specified, this parameter is used
2391 for result publication in the study. Otherwise, if automatic
2392 publication is switched on, default value is used for result name.
2395 New GEOM.GEOM_Object, containing the created curve.
2397 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2399 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2401 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2402 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2403 anObj.SetParameters(Parameters)
2404 self._autoPublish(anObj, theName, "curve")
2407 ## Create an isoline curve on a face.
2408 # @param theFace the face for which an isoline is created.
2409 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2411 # @param theParameter the U parameter for U-isoline or V parameter
2413 # @param theName Object name; when specified, this parameter is used
2414 # for result publication in the study. Otherwise, if automatic
2415 # publication is switched on, default value is used for result name.
2417 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2418 # a compound of edges.
2420 # @ref tui_creation_curve "Example"
2421 @ManageTransactions("CurvesOp")
2422 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2424 Create an isoline curve on a face.
2427 theFace the face for which an isoline is created.
2428 IsUIsoline True for U-isoline creation; False for V-isoline
2430 theParameter the U parameter for U-isoline or V parameter
2432 theName Object name; when specified, this parameter is used
2433 for result publication in the study. Otherwise, if automatic
2434 publication is switched on, default value is used for result name.
2437 New GEOM.GEOM_Object, containing the created isoline edge or a
2440 # Example: see GEOM_TestAll.py
2441 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2442 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2444 self._autoPublish(anObj, theName, "U-Isoline")
2446 self._autoPublish(anObj, theName, "V-Isoline")
2452 ## @addtogroup l3_sketcher
2455 ## Create a sketcher (wire or face), following the textual description,
2456 # passed through <VAR>theCommand</VAR> argument. \n
2457 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2458 # Format of the description string have to be the following:
2460 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2463 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2465 # - "R angle" : Set the direction by angle
2466 # - "D dx dy" : Set the direction by DX & DY
2469 # - "TT x y" : Create segment by point at X & Y
2470 # - "T dx dy" : Create segment by point with DX & DY
2471 # - "L length" : Create segment by direction & Length
2472 # - "IX x" : Create segment by direction & Intersect. X
2473 # - "IY y" : Create segment by direction & Intersect. Y
2476 # - "C radius length" : Create arc by direction, radius and length(in degree)
2477 # - "AA x y": Create arc by point at X & Y
2478 # - "A dx dy" : Create arc by point with DX & DY
2479 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2480 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2481 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2482 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2485 # - "WW" : Close Wire (to finish)
2486 # - "WF" : Close Wire and build face (to finish)
2489 # - Flag1 (= reverse) is 0 or 2 ...
2490 # - if 0 the drawn arc is the one of lower angle (< Pi)
2491 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2494 # - Flag2 (= control tolerance) is 0 or 1 ...
2495 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2496 # - if 1 the wire is built only if the end point is on the arc
2497 # with a tolerance of 10^-7 on the distance else the creation fails
2499 # @param theCommand String, defining the sketcher in local
2500 # coordinates of the working plane.
2501 # @param theWorkingPlane Nine double values, defining origin,
2502 # OZ and OX directions of the working plane.
2503 # @param theName Object name; when specified, this parameter is used
2504 # for result publication in the study. Otherwise, if automatic
2505 # publication is switched on, default value is used for result name.
2507 # @return New GEOM.GEOM_Object, containing the created wire.
2509 # @ref tui_sketcher_page "Example"
2510 @ManageTransactions("CurvesOp")
2511 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2513 Create a sketcher (wire or face), following the textual description, passed
2514 through theCommand argument.
2515 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2516 Format of the description string have to be the following:
2517 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2519 - x1, y1 are coordinates of the first sketcher point (zero by default),
2521 - "R angle" : Set the direction by angle
2522 - "D dx dy" : Set the direction by DX & DY
2524 - "TT x y" : Create segment by point at X & Y
2525 - "T dx dy" : Create segment by point with DX & DY
2526 - "L length" : Create segment by direction & Length
2527 - "IX x" : Create segment by direction & Intersect. X
2528 - "IY y" : Create segment by direction & Intersect. Y
2530 - "C radius length" : Create arc by direction, radius and length(in degree)
2531 - "AA x y": Create arc by point at X & Y
2532 - "A dx dy" : Create arc by point with DX & DY
2533 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2534 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2535 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2536 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2538 - "WW" : Close Wire (to finish)
2539 - "WF" : Close Wire and build face (to finish)
2541 - Flag1 (= reverse) is 0 or 2 ...
2542 - if 0 the drawn arc is the one of lower angle (< Pi)
2543 - if 2 the drawn arc ius the one of greater angle (> Pi)
2545 - Flag2 (= control tolerance) is 0 or 1 ...
2546 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2547 - if 1 the wire is built only if the end point is on the arc
2548 with a tolerance of 10^-7 on the distance else the creation fails
2551 theCommand String, defining the sketcher in local
2552 coordinates of the working plane.
2553 theWorkingPlane Nine double values, defining origin,
2554 OZ and OX directions of the working plane.
2555 theName Object name; when specified, this parameter is used
2556 for result publication in the study. Otherwise, if automatic
2557 publication is switched on, default value is used for result name.
2560 New GEOM.GEOM_Object, containing the created wire.
2562 # Example: see GEOM_TestAll.py
2563 theCommand,Parameters = ParseSketcherCommand(theCommand)
2564 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2565 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2566 anObj.SetParameters(Parameters)
2567 self._autoPublish(anObj, theName, "wire")
2570 ## Create a sketcher (wire or face), following the textual description,
2571 # passed through <VAR>theCommand</VAR> argument. \n
2572 # For format of the description string see MakeSketcher() method.\n
2573 # @param theCommand String, defining the sketcher in local
2574 # coordinates of the working plane.
2575 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2576 # @param theName Object name; when specified, this parameter is used
2577 # for result publication in the study. Otherwise, if automatic
2578 # publication is switched on, default value is used for result name.
2580 # @return New GEOM.GEOM_Object, containing the created wire.
2582 # @ref tui_sketcher_page "Example"
2583 @ManageTransactions("CurvesOp")
2584 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2586 Create a sketcher (wire or face), following the textual description,
2587 passed through theCommand argument.
2588 For format of the description string see geompy.MakeSketcher() method.
2591 theCommand String, defining the sketcher in local
2592 coordinates of the working plane.
2593 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2594 theName Object name; when specified, this parameter is used
2595 for result publication in the study. Otherwise, if automatic
2596 publication is switched on, default value is used for result name.
2599 New GEOM.GEOM_Object, containing the created wire.
2601 theCommand,Parameters = ParseSketcherCommand(theCommand)
2602 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2603 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2604 anObj.SetParameters(Parameters)
2605 self._autoPublish(anObj, theName, "wire")
2608 ## Obtain a 2D sketcher interface
2609 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2610 def Sketcher2D (self):
2612 Obtain a 2D sketcher interface.
2615 sk = geompy.Sketcher2D()
2617 sk.addSegmentRelative(15, 70)
2618 sk.addSegmentPerpY(50)
2619 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2620 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2621 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2623 Sketch_1 = sk.wire(geomObj_1)
2625 sk = Sketcher2D (self)
2628 ## Create a sketcher wire, following the numerical description,
2629 # passed through <VAR>theCoordinates</VAR> argument. \n
2630 # @param theCoordinates double values, defining points to create a wire,
2632 # @param theName Object name; when specified, this parameter is used
2633 # for result publication in the study. Otherwise, if automatic
2634 # publication is switched on, default value is used for result name.
2636 # @return New GEOM.GEOM_Object, containing the created wire.
2638 # @ref tui_3dsketcher_page "Example"
2639 @ManageTransactions("CurvesOp")
2640 def Make3DSketcher(self, theCoordinates, theName=None):
2642 Create a sketcher wire, following the numerical description,
2643 passed through theCoordinates argument.
2646 theCoordinates double values, defining points to create a wire,
2648 theName Object name; when specified, this parameter is used
2649 for result publication in the study. Otherwise, if automatic
2650 publication is switched on, default value is used for result name.
2653 New GEOM_Object, containing the created wire.
2655 theCoordinates,Parameters = ParseParameters(theCoordinates)
2656 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2657 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2658 anObj.SetParameters(Parameters)
2659 self._autoPublish(anObj, theName, "wire")
2662 ## Obtain a 3D sketcher interface
2663 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2665 # @ref tui_3dsketcher_page "Example"
2666 def Sketcher3D (self):
2668 Obtain a 3D sketcher interface.
2671 sk = geompy.Sketcher3D()
2672 sk.addPointsAbsolute(0,0,0, 70,0,0)
2673 sk.addPointsRelative(0, 0, 130)
2674 sk.addPointAnglesLength("OXY", 50, 0, 100)
2675 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2677 a3D_Sketcher_1 = sk.wire()
2679 sk = Sketcher3D (self)
2682 # end of l3_sketcher
2685 ## @addtogroup l3_3d_primitives
2688 ## Create a box by coordinates of two opposite vertices.
2690 # @param x1,y1,z1 double values, defining first point it.
2691 # @param x2,y2,z2 double values, defining first point it.
2692 # @param theName Object name; when specified, this parameter is used
2693 # for result publication in the study. Otherwise, if automatic
2694 # publication is switched on, default value is used for result name.
2696 # @return New GEOM.GEOM_Object, containing the created box.
2698 # @ref tui_creation_box "Example"
2699 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2701 Create a box by coordinates of two opposite vertices.
2704 x1,y1,z1 double values, defining first point.
2705 x2,y2,z2 double values, defining second point.
2706 theName Object name; when specified, this parameter is used
2707 for result publication in the study. Otherwise, if automatic
2708 publication is switched on, default value is used for result name.
2711 New GEOM.GEOM_Object, containing the created box.
2713 # Example: see GEOM_TestAll.py
2714 pnt1 = self.MakeVertex(x1,y1,z1)
2715 pnt2 = self.MakeVertex(x2,y2,z2)
2716 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2717 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2719 ## Create a box with specified dimensions along the coordinate axes
2720 # and with edges, parallel to the coordinate axes.
2721 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2722 # @param theDX Length of Box edges, parallel to OX axis.
2723 # @param theDY Length of Box edges, parallel to OY axis.
2724 # @param theDZ Length of Box edges, parallel to OZ axis.
2725 # @param theName Object name; when specified, this parameter is used
2726 # for result publication in the study. Otherwise, if automatic
2727 # publication is switched on, default value is used for result name.
2729 # @return New GEOM.GEOM_Object, containing the created box.
2731 # @ref tui_creation_box "Example"
2732 @ManageTransactions("PrimOp")
2733 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2735 Create a box with specified dimensions along the coordinate axes
2736 and with edges, parallel to the coordinate axes.
2737 Center of the box will be at point (DX/2, DY/2, DZ/2).
2740 theDX Length of Box edges, parallel to OX axis.
2741 theDY Length of Box edges, parallel to OY axis.
2742 theDZ Length of Box edges, parallel to OZ axis.
2743 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.
2748 New GEOM.GEOM_Object, containing the created box.
2750 # Example: see GEOM_TestAll.py
2751 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2752 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2753 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2754 anObj.SetParameters(Parameters)
2755 self._autoPublish(anObj, theName, "box")
2758 ## Create a box with two specified opposite vertices,
2759 # and with edges, parallel to the coordinate axes
2760 # @param thePnt1 First of two opposite vertices.
2761 # @param thePnt2 Second of two opposite vertices.
2762 # @param theName Object name; when specified, this parameter is used
2763 # for result publication in the study. Otherwise, if automatic
2764 # publication is switched on, default value is used for result name.
2766 # @return New GEOM.GEOM_Object, containing the created box.
2768 # @ref tui_creation_box "Example"
2769 @ManageTransactions("PrimOp")
2770 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2772 Create a box with two specified opposite vertices,
2773 and with edges, parallel to the coordinate axes
2776 thePnt1 First of two opposite vertices.
2777 thePnt2 Second of two opposite vertices.
2778 theName Object name; when specified, this parameter is used
2779 for result publication in the study. Otherwise, if automatic
2780 publication is switched on, default value is used for result name.
2783 New GEOM.GEOM_Object, containing the created box.
2785 # Example: see GEOM_TestAll.py
2786 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2787 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2788 self._autoPublish(anObj, theName, "box")
2791 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2792 # @param theH height of Face.
2793 # @param theW width of Face.
2794 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2795 # @param theName Object name; when specified, this parameter is used
2796 # for result publication in the study. Otherwise, if automatic
2797 # publication is switched on, default value is used for result name.
2799 # @return New GEOM.GEOM_Object, containing the created face.
2801 # @ref tui_creation_face "Example"
2802 @ManageTransactions("PrimOp")
2803 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2805 Create a face with specified dimensions with edges parallel to coordinate axes.
2808 theH height of Face.
2810 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2811 theName Object name; when specified, this parameter is used
2812 for result publication in the study. Otherwise, if automatic
2813 publication is switched on, default value is used for result name.
2816 New GEOM.GEOM_Object, containing the created face.
2818 # Example: see GEOM_TestAll.py
2819 theH,theW,Parameters = ParseParameters(theH, theW)
2820 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2821 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2822 anObj.SetParameters(Parameters)
2823 self._autoPublish(anObj, theName, "rectangle")
2826 ## Create a face from another plane and two sizes,
2827 # vertical size and horisontal size.
2828 # @param theObj Normale vector to the creating face or
2830 # @param theH Height (vertical size).
2831 # @param theW Width (horisontal size).
2832 # @param theName Object name; when specified, this parameter is used
2833 # for result publication in the study. Otherwise, if automatic
2834 # publication is switched on, default value is used for result name.
2836 # @return New GEOM.GEOM_Object, containing the created face.
2838 # @ref tui_creation_face "Example"
2839 @ManageTransactions("PrimOp")
2840 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2842 Create a face from another plane and two sizes,
2843 vertical size and horisontal size.
2846 theObj Normale vector to the creating face or
2848 theH Height (vertical size).
2849 theW Width (horisontal size).
2850 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.
2855 New GEOM_Object, containing the created face.
2857 # Example: see GEOM_TestAll.py
2858 theH,theW,Parameters = ParseParameters(theH, theW)
2859 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2860 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2861 anObj.SetParameters(Parameters)
2862 self._autoPublish(anObj, theName, "rectangle")
2865 ## Create a disk with given center, normal vector and radius.
2866 # @param thePnt Disk center.
2867 # @param theVec Vector, normal to the plane of the disk.
2868 # @param theR Disk radius.
2869 # @param theName Object name; when specified, this parameter is used
2870 # for result publication in the study. Otherwise, if automatic
2871 # publication is switched on, default value is used for result name.
2873 # @return New GEOM.GEOM_Object, containing the created disk.
2875 # @ref tui_creation_disk "Example"
2876 @ManageTransactions("PrimOp")
2877 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2879 Create a disk with given center, normal vector and radius.
2883 theVec Vector, normal to the plane of the disk.
2885 theName Object name; when specified, this parameter is used
2886 for result publication in the study. Otherwise, if automatic
2887 publication is switched on, default value is used for result name.
2890 New GEOM.GEOM_Object, containing the created disk.
2892 # Example: see GEOM_TestAll.py
2893 theR,Parameters = ParseParameters(theR)
2894 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2895 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2896 anObj.SetParameters(Parameters)
2897 self._autoPublish(anObj, theName, "disk")
2900 ## Create a disk, passing through three given points
2901 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2902 # @param theName Object name; when specified, this parameter is used
2903 # for result publication in the study. Otherwise, if automatic
2904 # publication is switched on, default value is used for result name.
2906 # @return New GEOM.GEOM_Object, containing the created disk.
2908 # @ref tui_creation_disk "Example"
2909 @ManageTransactions("PrimOp")
2910 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2912 Create a disk, passing through three given points
2915 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2916 theName Object name; when specified, this parameter is used
2917 for result publication in the study. Otherwise, if automatic
2918 publication is switched on, default value is used for result name.
2921 New GEOM.GEOM_Object, containing the created disk.
2923 # Example: see GEOM_TestAll.py
2924 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2925 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2926 self._autoPublish(anObj, theName, "disk")
2929 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2930 # @param theR Radius of Face.
2931 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2932 # @param theName Object name; when specified, this parameter is used
2933 # for result publication in the study. Otherwise, if automatic
2934 # publication is switched on, default value is used for result name.
2936 # @return New GEOM.GEOM_Object, containing the created disk.
2938 # @ref tui_creation_face "Example"
2939 @ManageTransactions("PrimOp")
2940 def MakeDiskR(self, theR, theOrientation, theName=None):
2942 Create a disk with specified dimensions along OX-OY coordinate axes.
2945 theR Radius of Face.
2946 theOrientation set the orientation belong axis OXY or OYZ or OZX
2947 theName Object name; when specified, this parameter is used
2948 for result publication in the study. Otherwise, if automatic
2949 publication is switched on, default value is used for result name.
2952 New GEOM.GEOM_Object, containing the created disk.
2955 Disk3 = geompy.MakeDiskR(100., 1)
2957 # Example: see GEOM_TestAll.py
2958 theR,Parameters = ParseParameters(theR)
2959 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2960 RaiseIfFailed("MakeDiskR", self.PrimOp)
2961 anObj.SetParameters(Parameters)
2962 self._autoPublish(anObj, theName, "disk")
2965 ## Create a cylinder with given base point, axis, radius and height.
2966 # @param thePnt Central point of cylinder base.
2967 # @param theAxis Cylinder axis.
2968 # @param theR Cylinder radius.
2969 # @param theH Cylinder height.
2970 # @param theName Object name; when specified, this parameter is used
2971 # for result publication in the study. Otherwise, if automatic
2972 # publication is switched on, default value is used for result name.
2974 # @return New GEOM.GEOM_Object, containing the created cylinder.
2976 # @ref tui_creation_cylinder "Example"
2977 @ManageTransactions("PrimOp")
2978 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2980 Create a cylinder with given base point, axis, radius and height.
2983 thePnt Central point of cylinder base.
2984 theAxis Cylinder axis.
2985 theR Cylinder radius.
2986 theH Cylinder height.
2987 theName Object name; when specified, this parameter is used
2988 for result publication in the study. Otherwise, if automatic
2989 publication is switched on, default value is used for result name.
2992 New GEOM.GEOM_Object, containing the created cylinder.
2994 # Example: see GEOM_TestAll.py
2995 theR,theH,Parameters = ParseParameters(theR, theH)
2996 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2997 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2998 anObj.SetParameters(Parameters)
2999 self._autoPublish(anObj, theName, "cylinder")
3002 ## Create a cylinder with given radius and height at
3003 # the origin of coordinate system. Axis of the cylinder
3004 # will be collinear to the OZ axis of the coordinate system.
3005 # @param theR Cylinder radius.
3006 # @param theH Cylinder height.
3007 # @param theName Object name; when specified, this parameter is used
3008 # for result publication in the study. Otherwise, if automatic
3009 # publication is switched on, default value is used for result name.
3011 # @return New GEOM.GEOM_Object, containing the created cylinder.
3013 # @ref tui_creation_cylinder "Example"
3014 @ManageTransactions("PrimOp")
3015 def MakeCylinderRH(self, theR, theH, theName=None):
3017 Create a cylinder with given radius and height at
3018 the origin of coordinate system. Axis of the cylinder
3019 will be collinear to the OZ axis of the coordinate system.
3022 theR Cylinder radius.
3023 theH Cylinder height.
3024 theName Object name; when specified, this parameter is used
3025 for result publication in the study. Otherwise, if automatic
3026 publication is switched on, default value is used for result name.
3029 New GEOM.GEOM_Object, containing the created cylinder.
3031 # Example: see GEOM_TestAll.py
3032 theR,theH,Parameters = ParseParameters(theR, theH)
3033 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3034 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3035 anObj.SetParameters(Parameters)
3036 self._autoPublish(anObj, theName, "cylinder")
3039 ## Create a sphere with given center and radius.
3040 # @param thePnt Sphere center.
3041 # @param theR Sphere radius.
3042 # @param theName Object name; when specified, this parameter is used
3043 # for result publication in the study. Otherwise, if automatic
3044 # publication is switched on, default value is used for result name.
3046 # @return New GEOM.GEOM_Object, containing the created sphere.
3048 # @ref tui_creation_sphere "Example"
3049 @ManageTransactions("PrimOp")
3050 def MakeSpherePntR(self, thePnt, theR, theName=None):
3052 Create a sphere with given center and radius.
3055 thePnt Sphere center.
3057 theName Object name; when specified, this parameter is used
3058 for result publication in the study. Otherwise, if automatic
3059 publication is switched on, default value is used for result name.
3062 New GEOM.GEOM_Object, containing the created sphere.
3064 # Example: see GEOM_TestAll.py
3065 theR,Parameters = ParseParameters(theR)
3066 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3067 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3068 anObj.SetParameters(Parameters)
3069 self._autoPublish(anObj, theName, "sphere")
3072 ## Create a sphere with given center and radius.
3073 # @param x,y,z Coordinates of sphere center.
3074 # @param theR Sphere radius.
3075 # @param theName Object name; when specified, this parameter is used
3076 # for result publication in the study. Otherwise, if automatic
3077 # publication is switched on, default value is used for result name.
3079 # @return New GEOM.GEOM_Object, containing the created sphere.
3081 # @ref tui_creation_sphere "Example"
3082 def MakeSphere(self, x, y, z, theR, theName=None):
3084 Create a sphere with given center and radius.
3087 x,y,z Coordinates of sphere center.
3089 theName Object name; when specified, this parameter is used
3090 for result publication in the study. Otherwise, if automatic
3091 publication is switched on, default value is used for result name.
3094 New GEOM.GEOM_Object, containing the created sphere.
3096 # Example: see GEOM_TestAll.py
3097 point = self.MakeVertex(x, y, z)
3098 # note: auto-publishing is done in self.MakeSpherePntR()
3099 anObj = self.MakeSpherePntR(point, theR, theName)
3102 ## Create a sphere with given radius at the origin of coordinate system.
3103 # @param theR Sphere radius.
3104 # @param theName Object name; when specified, this parameter is used
3105 # for result publication in the study. Otherwise, if automatic
3106 # publication is switched on, default value is used for result name.
3108 # @return New GEOM.GEOM_Object, containing the created sphere.
3110 # @ref tui_creation_sphere "Example"
3111 @ManageTransactions("PrimOp")
3112 def MakeSphereR(self, theR, theName=None):
3114 Create a sphere with given radius at the origin of coordinate system.
3118 theName Object name; when specified, this parameter is used
3119 for result publication in the study. Otherwise, if automatic
3120 publication is switched on, default value is used for result name.
3123 New GEOM.GEOM_Object, containing the created sphere.
3125 # Example: see GEOM_TestAll.py
3126 theR,Parameters = ParseParameters(theR)
3127 anObj = self.PrimOp.MakeSphereR(theR)
3128 RaiseIfFailed("MakeSphereR", self.PrimOp)
3129 anObj.SetParameters(Parameters)
3130 self._autoPublish(anObj, theName, "sphere")
3133 ## Create a cone with given base point, axis, height and radiuses.
3134 # @param thePnt Central point of the first cone base.
3135 # @param theAxis Cone axis.
3136 # @param theR1 Radius of the first cone base.
3137 # @param theR2 Radius of the second cone base.
3138 # \note If both radiuses are non-zero, the cone will be truncated.
3139 # \note If the radiuses are equal, a cylinder will be created instead.
3140 # @param theH Cone height.
3141 # @param theName Object name; when specified, this parameter is used
3142 # for result publication in the study. Otherwise, if automatic
3143 # publication is switched on, default value is used for result name.
3145 # @return New GEOM.GEOM_Object, containing the created cone.
3147 # @ref tui_creation_cone "Example"
3148 @ManageTransactions("PrimOp")
3149 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3151 Create a cone with given base point, axis, height and radiuses.
3154 thePnt Central point of the first cone base.
3156 theR1 Radius of the first cone base.
3157 theR2 Radius of the second cone base.
3159 theName Object name; when specified, this parameter is used
3160 for result publication in the study. Otherwise, if automatic
3161 publication is switched on, default value is used for result name.
3164 If both radiuses are non-zero, the cone will be truncated.
3165 If the radiuses are equal, a cylinder will be created instead.
3168 New GEOM.GEOM_Object, containing the created cone.
3170 # Example: see GEOM_TestAll.py
3171 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3172 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3173 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3174 anObj.SetParameters(Parameters)
3175 self._autoPublish(anObj, theName, "cone")
3178 ## Create a cone with given height and radiuses at
3179 # the origin of coordinate system. Axis of the cone will
3180 # be collinear to the OZ axis of the coordinate system.
3181 # @param theR1 Radius of the first cone base.
3182 # @param theR2 Radius of the second cone base.
3183 # \note If both radiuses are non-zero, the cone will be truncated.
3184 # \note If the radiuses are equal, a cylinder will be created instead.
3185 # @param theH Cone height.
3186 # @param theName Object name; when specified, this parameter is used
3187 # for result publication in the study. Otherwise, if automatic
3188 # publication is switched on, default value is used for result name.
3190 # @return New GEOM.GEOM_Object, containing the created cone.
3192 # @ref tui_creation_cone "Example"
3193 @ManageTransactions("PrimOp")
3194 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3196 Create a cone with given height and radiuses at
3197 the origin of coordinate system. Axis of the cone will
3198 be collinear to the OZ axis of the coordinate system.
3201 theR1 Radius of the first cone base.
3202 theR2 Radius of the second cone base.
3204 theName Object name; when specified, this parameter is used
3205 for result publication in the study. Otherwise, if automatic
3206 publication is switched on, default value is used for result name.
3209 If both radiuses are non-zero, the cone will be truncated.
3210 If the radiuses are equal, a cylinder will be created instead.
3213 New GEOM.GEOM_Object, containing the created cone.
3215 # Example: see GEOM_TestAll.py
3216 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3217 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3218 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3219 anObj.SetParameters(Parameters)
3220 self._autoPublish(anObj, theName, "cone")
3223 ## Create a torus with given center, normal vector and radiuses.
3224 # @param thePnt Torus central point.
3225 # @param theVec Torus axis of symmetry.
3226 # @param theRMajor Torus major radius.
3227 # @param theRMinor Torus minor radius.
3228 # @param theName Object name; when specified, this parameter is used
3229 # for result publication in the study. Otherwise, if automatic
3230 # publication is switched on, default value is used for result name.
3232 # @return New GEOM.GEOM_Object, containing the created torus.
3234 # @ref tui_creation_torus "Example"
3235 @ManageTransactions("PrimOp")
3236 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3238 Create a torus with given center, normal vector and radiuses.
3241 thePnt Torus central point.
3242 theVec Torus axis of symmetry.
3243 theRMajor Torus major radius.
3244 theRMinor Torus minor radius.
3245 theName Object name; when specified, this parameter is used
3246 for result publication in the study. Otherwise, if automatic
3247 publication is switched on, default value is used for result name.
3250 New GEOM.GEOM_Object, containing the created torus.
3252 # Example: see GEOM_TestAll.py
3253 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3254 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3255 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3256 anObj.SetParameters(Parameters)
3257 self._autoPublish(anObj, theName, "torus")
3260 ## Create a torus with given radiuses at the origin of coordinate system.
3261 # @param theRMajor Torus major radius.
3262 # @param theRMinor Torus minor radius.
3263 # @param theName Object name; when specified, this parameter is used
3264 # for result publication in the study. Otherwise, if automatic
3265 # publication is switched on, default value is used for result name.
3267 # @return New GEOM.GEOM_Object, containing the created torus.
3269 # @ref tui_creation_torus "Example"
3270 @ManageTransactions("PrimOp")
3271 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3273 Create a torus with given radiuses at the origin of coordinate system.
3276 theRMajor Torus major radius.
3277 theRMinor Torus minor radius.
3278 theName Object name; when specified, this parameter is used
3279 for result publication in the study. Otherwise, if automatic
3280 publication is switched on, default value is used for result name.
3283 New GEOM.GEOM_Object, containing the created torus.
3285 # Example: see GEOM_TestAll.py
3286 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3287 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3288 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3289 anObj.SetParameters(Parameters)
3290 self._autoPublish(anObj, theName, "torus")
3293 # end of l3_3d_primitives
3296 ## @addtogroup l3_complex
3299 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3300 # @param theBase Base shape to be extruded.
3301 # @param thePoint1 First end of extrusion vector.
3302 # @param thePoint2 Second end of extrusion vector.
3303 # @param theScaleFactor Use it to make prism with scaled second base.
3304 # Nagative value means not scaled second base.
3305 # @param theName Object name; when specified, this parameter is used
3306 # for result publication in the study. Otherwise, if automatic
3307 # publication is switched on, default value is used for result name.
3309 # @return New GEOM.GEOM_Object, containing the created prism.
3311 # @ref tui_creation_prism "Example"
3312 @ManageTransactions("PrimOp")
3313 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3315 Create a shape by extrusion of the base shape along a vector, defined by two points.
3318 theBase Base shape to be extruded.
3319 thePoint1 First end of extrusion vector.
3320 thePoint2 Second end of extrusion vector.
3321 theScaleFactor Use it to make prism with scaled second base.
3322 Nagative value means not scaled second base.
3323 theName Object name; when specified, this parameter is used
3324 for result publication in the study. Otherwise, if automatic
3325 publication is switched on, default value is used for result name.
3328 New GEOM.GEOM_Object, containing the created prism.
3330 # Example: see GEOM_TestAll.py
3333 if theScaleFactor > 0:
3334 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3335 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3337 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3338 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3339 anObj.SetParameters(Parameters)
3340 self._autoPublish(anObj, theName, "prism")
3343 ## Create a shape by extrusion of the base shape along a
3344 # vector, defined by two points, in 2 Ways (forward/backward).
3345 # @param theBase Base shape to be extruded.
3346 # @param thePoint1 First end of extrusion vector.
3347 # @param thePoint2 Second end of extrusion vector.
3348 # @param theName Object name; when specified, this parameter is used
3349 # for result publication in the study. Otherwise, if automatic
3350 # publication is switched on, default value is used for result name.
3352 # @return New GEOM.GEOM_Object, containing the created prism.
3354 # @ref tui_creation_prism "Example"
3355 @ManageTransactions("PrimOp")
3356 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3358 Create a shape by extrusion of the base shape along a
3359 vector, defined by two points, in 2 Ways (forward/backward).
3362 theBase Base shape to be extruded.
3363 thePoint1 First end of extrusion vector.
3364 thePoint2 Second end of extrusion vector.
3365 theName Object name; when specified, this parameter is used
3366 for result publication in the study. Otherwise, if automatic
3367 publication is switched on, default value is used for result name.
3370 New GEOM.GEOM_Object, containing the created prism.
3372 # Example: see GEOM_TestAll.py
3373 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3374 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3375 self._autoPublish(anObj, theName, "prism")
3378 ## Create a shape by extrusion of the base shape along the vector,
3379 # i.e. all the space, transfixed by the base shape during its translation
3380 # along the vector on the given distance.
3381 # @param theBase Base shape to be extruded.
3382 # @param theVec Direction of extrusion.
3383 # @param theH Prism dimension along theVec.
3384 # @param theScaleFactor Use it to make prism with scaled second base.
3385 # Negative value means not scaled second base.
3386 # @param theName Object name; when specified, this parameter is used
3387 # for result publication in the study. Otherwise, if automatic
3388 # publication is switched on, default value is used for result name.
3390 # @return New GEOM.GEOM_Object, containing the created prism.
3392 # @ref tui_creation_prism "Example"
3393 @ManageTransactions("PrimOp")
3394 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3396 Create a shape by extrusion of the base shape along the vector,
3397 i.e. all the space, transfixed by the base shape during its translation
3398 along the vector on the given distance.
3401 theBase Base shape to be extruded.
3402 theVec Direction of extrusion.
3403 theH Prism dimension along theVec.
3404 theScaleFactor Use it to make prism with scaled second base.
3405 Negative value means not scaled second base.
3406 theName Object name; when specified, this parameter is used
3407 for result publication in the study. Otherwise, if automatic
3408 publication is switched on, default value is used for result name.
3411 New GEOM.GEOM_Object, containing the created prism.
3413 # Example: see GEOM_TestAll.py
3416 if theScaleFactor > 0:
3417 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3418 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3420 theH,Parameters = ParseParameters(theH)
3421 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3422 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3423 anObj.SetParameters(Parameters)
3424 self._autoPublish(anObj, theName, "prism")
3427 ## Create a shape by extrusion of the base shape along the vector,
3428 # i.e. all the space, transfixed by the base shape during its translation
3429 # along the vector on the given distance in 2 Ways (forward/backward).
3430 # @param theBase Base shape to be extruded.
3431 # @param theVec Direction of extrusion.
3432 # @param theH Prism dimension along theVec in forward direction.
3433 # @param theName Object name; when specified, this parameter is used
3434 # for result publication in the study. Otherwise, if automatic
3435 # publication is switched on, default value is used for result name.
3437 # @return New GEOM.GEOM_Object, containing the created prism.
3439 # @ref tui_creation_prism "Example"
3440 @ManageTransactions("PrimOp")
3441 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3443 Create a shape by extrusion of the base shape along the vector,
3444 i.e. all the space, transfixed by the base shape during its translation
3445 along the vector on the given distance in 2 Ways (forward/backward).
3448 theBase Base shape to be extruded.
3449 theVec Direction of extrusion.
3450 theH Prism dimension along theVec in forward direction.
3451 theName Object name; when specified, this parameter is used
3452 for result publication in the study. Otherwise, if automatic
3453 publication is switched on, default value is used for result name.
3456 New GEOM.GEOM_Object, containing the created prism.
3458 # Example: see GEOM_TestAll.py
3459 theH,Parameters = ParseParameters(theH)
3460 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3461 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3462 anObj.SetParameters(Parameters)
3463 self._autoPublish(anObj, theName, "prism")
3466 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3467 # @param theBase Base shape to be extruded.
3468 # @param theDX, theDY, theDZ Directions of extrusion.
3469 # @param theScaleFactor Use it to make prism with scaled second base.
3470 # Nagative value means not scaled second base.
3471 # @param 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.
3475 # @return New GEOM.GEOM_Object, containing the created prism.
3477 # @ref tui_creation_prism "Example"
3478 @ManageTransactions("PrimOp")
3479 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3481 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3484 theBase Base shape to be extruded.
3485 theDX, theDY, theDZ Directions of extrusion.
3486 theScaleFactor Use it to make prism with scaled second base.
3487 Nagative value means not scaled second base.
3488 theName Object name; when specified, this parameter is used
3489 for result publication in the study. Otherwise, if automatic
3490 publication is switched on, default value is used for result name.
3493 New GEOM.GEOM_Object, containing the created prism.
3495 # Example: see GEOM_TestAll.py
3498 if theScaleFactor > 0:
3499 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3500 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3502 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3503 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3504 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3505 anObj.SetParameters(Parameters)
3506 self._autoPublish(anObj, theName, "prism")
3509 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3510 # i.e. all the space, transfixed by the base shape during its translation
3511 # along the vector on the given distance in 2 Ways (forward/backward).
3512 # @param theBase Base shape to be extruded.
3513 # @param theDX, theDY, theDZ Directions of extrusion.
3514 # @param theName Object name; when specified, this parameter is used
3515 # for result publication in the study. Otherwise, if automatic
3516 # publication is switched on, default value is used for result name.
3518 # @return New GEOM.GEOM_Object, containing the created prism.
3520 # @ref tui_creation_prism "Example"
3521 @ManageTransactions("PrimOp")
3522 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3524 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3525 i.e. all the space, transfixed by the base shape during its translation
3526 along the vector on the given distance in 2 Ways (forward/backward).
3529 theBase Base shape to be extruded.
3530 theDX, theDY, theDZ Directions of extrusion.
3531 theName Object name; when specified, this parameter is used
3532 for result publication in the study. Otherwise, if automatic
3533 publication is switched on, default value is used for result name.
3536 New GEOM.GEOM_Object, containing the created prism.
3538 # Example: see GEOM_TestAll.py
3539 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3540 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3541 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3542 anObj.SetParameters(Parameters)
3543 self._autoPublish(anObj, theName, "prism")
3546 ## Create a shape by revolution of the base shape around the axis
3547 # on the given angle, i.e. all the space, transfixed by the base
3548 # shape during its rotation around the axis on the given angle.
3549 # @param theBase Base shape to be rotated.
3550 # @param theAxis Rotation axis.
3551 # @param theAngle Rotation angle in radians.
3552 # @param theName Object name; when specified, this parameter is used
3553 # for result publication in the study. Otherwise, if automatic
3554 # publication is switched on, default value is used for result name.
3556 # @return New GEOM.GEOM_Object, containing the created revolution.
3558 # @ref tui_creation_revolution "Example"
3559 @ManageTransactions("PrimOp")
3560 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3562 Create a shape by revolution of the base shape around the axis
3563 on the given angle, i.e. all the space, transfixed by the base
3564 shape during its rotation around the axis on the given angle.
3567 theBase Base shape to be rotated.
3568 theAxis Rotation axis.
3569 theAngle Rotation angle in radians.
3570 theName Object name; when specified, this parameter is used
3571 for result publication in the study. Otherwise, if automatic
3572 publication is switched on, default value is used for result name.
3575 New GEOM.GEOM_Object, containing the created revolution.
3577 # Example: see GEOM_TestAll.py
3578 theAngle,Parameters = ParseParameters(theAngle)
3579 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3580 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3581 anObj.SetParameters(Parameters)
3582 self._autoPublish(anObj, theName, "revolution")
3585 ## Create a shape by revolution of the base shape around the axis
3586 # on the given angle, i.e. all the space, transfixed by the base
3587 # shape during its rotation around the axis on the given angle in
3588 # both directions (forward/backward)
3589 # @param theBase Base shape to be rotated.
3590 # @param theAxis Rotation axis.
3591 # @param theAngle Rotation angle in radians.
3592 # @param theName Object name; when specified, this parameter is used
3593 # for result publication in the study. Otherwise, if automatic
3594 # publication is switched on, default value is used for result name.
3596 # @return New GEOM.GEOM_Object, containing the created revolution.
3598 # @ref tui_creation_revolution "Example"
3599 @ManageTransactions("PrimOp")
3600 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3602 Create a shape by revolution of the base shape around the axis
3603 on the given angle, i.e. all the space, transfixed by the base
3604 shape during its rotation around the axis on the given angle in
3605 both directions (forward/backward).
3608 theBase Base shape to be rotated.
3609 theAxis Rotation axis.
3610 theAngle Rotation angle in radians.
3611 theName Object name; when specified, this parameter is used
3612 for result publication in the study. Otherwise, if automatic
3613 publication is switched on, default value is used for result name.
3616 New GEOM.GEOM_Object, containing the created revolution.
3618 theAngle,Parameters = ParseParameters(theAngle)
3619 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3620 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3621 anObj.SetParameters(Parameters)
3622 self._autoPublish(anObj, theName, "revolution")
3625 ## Create a filling from the given compound of contours.
3626 # @param theShape the compound of contours
3627 # @param theMinDeg a minimal degree of BSpline surface to create
3628 # @param theMaxDeg a maximal degree of BSpline surface to create
3629 # @param theTol2D a 2d tolerance to be reached
3630 # @param theTol3D a 3d tolerance to be reached
3631 # @param theNbIter a number of iteration of approximation algorithm
3632 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3633 # @param isApprox if True, BSpline curves are generated in the process
3634 # of surface construction. By default it is False, that means
3635 # the surface is created using given curves. The usage of
3636 # Approximation makes the algorithm work slower, but allows
3637 # building the surface for rather complex cases.
3638 # @param theName Object name; when specified, this parameter is used
3639 # for result publication in the study. Otherwise, if automatic
3640 # publication is switched on, default value is used for result name.
3642 # @return New GEOM.GEOM_Object, containing the created filling surface.
3644 # @ref tui_creation_filling "Example"
3645 @ManageTransactions("PrimOp")
3646 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3647 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3649 Create a filling from the given compound of contours.
3652 theShape the compound of contours
3653 theMinDeg a minimal degree of BSpline surface to create
3654 theMaxDeg a maximal degree of BSpline surface to create
3655 theTol2D a 2d tolerance to be reached
3656 theTol3D a 3d tolerance to be reached
3657 theNbIter a number of iteration of approximation algorithm
3658 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3659 isApprox if True, BSpline curves are generated in the process
3660 of surface construction. By default it is False, that means
3661 the surface is created using given curves. The usage of
3662 Approximation makes the algorithm work slower, but allows
3663 building the surface for rather complex cases
3664 theName Object name; when specified, this parameter is used
3665 for result publication in the study. Otherwise, if automatic
3666 publication is switched on, default value is used for result name.
3669 New GEOM.GEOM_Object, containing the created filling surface.
3672 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3674 # Example: see GEOM_TestAll.py
3675 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3676 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3677 theTol2D, theTol3D, theNbIter,
3678 theMethod, isApprox)
3679 RaiseIfFailed("MakeFilling", self.PrimOp)
3680 anObj.SetParameters(Parameters)
3681 self._autoPublish(anObj, theName, "filling")
3685 ## Create a filling from the given compound of contours.
3686 # This method corresponds to MakeFilling with isApprox=True
3687 # @param theShape the compound of contours
3688 # @param theMinDeg a minimal degree of BSpline surface to create
3689 # @param theMaxDeg a maximal degree of BSpline surface to create
3690 # @param theTol3D a 3d tolerance to be reached
3691 # @param theName Object name; when specified, this parameter is used
3692 # for result publication in the study. Otherwise, if automatic
3693 # publication is switched on, default value is used for result name.
3695 # @return New GEOM.GEOM_Object, containing the created filling surface.
3697 # @ref tui_creation_filling "Example"
3698 @ManageTransactions("PrimOp")
3699 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3701 Create a filling from the given compound of contours.
3702 This method corresponds to MakeFilling with isApprox=True
3705 theShape the compound of contours
3706 theMinDeg a minimal degree of BSpline surface to create
3707 theMaxDeg a maximal degree of BSpline surface to create
3708 theTol3D a 3d tolerance to be reached
3709 theName Object name; when specified, this parameter is used
3710 for result publication in the study. Otherwise, if automatic
3711 publication is switched on, default value is used for result name.
3714 New GEOM.GEOM_Object, containing the created filling surface.
3717 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3719 # Example: see GEOM_TestAll.py
3720 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3721 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3722 0, theTol3D, 0, GEOM.FOM_Default, True)
3723 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3724 anObj.SetParameters(Parameters)
3725 self._autoPublish(anObj, theName, "filling")
3728 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3729 # @param theSeqSections - set of specified sections.
3730 # @param theModeSolid - mode defining building solid or shell
3731 # @param thePreci - precision 3D used for smoothing
3732 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3733 # @param theName Object name; when specified, this parameter is used
3734 # for result publication in the study. Otherwise, if automatic
3735 # publication is switched on, default value is used for result name.
3737 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3739 # @ref swig_todo "Example"
3740 @ManageTransactions("PrimOp")
3741 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3743 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3746 theSeqSections - set of specified sections.
3747 theModeSolid - mode defining building solid or shell
3748 thePreci - precision 3D used for smoothing
3749 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3750 theName Object name; when specified, this parameter is used
3751 for result publication in the study. Otherwise, if automatic
3752 publication is switched on, default value is used for result name.
3755 New GEOM.GEOM_Object, containing the created shell or solid.
3757 # Example: see GEOM_TestAll.py
3758 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3759 RaiseIfFailed("MakeThruSections", self.PrimOp)
3760 self._autoPublish(anObj, theName, "filling")
3763 ## Create a shape by extrusion of the base shape along
3764 # the path shape. The path shape can be a wire or an edge.
3765 # @param theBase Base shape to be extruded.
3766 # @param thePath Path shape to extrude the base shape along it.
3767 # @param theName Object name; when specified, this parameter is used
3768 # for result publication in the study. Otherwise, if automatic
3769 # publication is switched on, default value is used for result name.
3771 # @return New GEOM.GEOM_Object, containing the created pipe.
3773 # @ref tui_creation_pipe "Example"
3774 @ManageTransactions("PrimOp")
3775 def MakePipe(self, theBase, thePath, theName=None):
3777 Create a shape by extrusion of the base shape along
3778 the path shape. The path shape can be a wire or an edge.
3781 theBase Base shape to be extruded.
3782 thePath Path shape to extrude the base shape along it.
3783 theName Object name; when specified, this parameter is used
3784 for result publication in the study. Otherwise, if automatic
3785 publication is switched on, default value is used for result name.
3788 New GEOM.GEOM_Object, containing the created pipe.
3790 # Example: see GEOM_TestAll.py
3791 anObj = self.PrimOp.MakePipe(theBase, thePath)
3792 RaiseIfFailed("MakePipe", self.PrimOp)
3793 self._autoPublish(anObj, theName, "pipe")
3796 ## Create a shape by extrusion of the profile shape along
3797 # the path shape. The path shape can be a wire or an edge.
3798 # the several profiles can be specified in the several locations of path.
3799 # @param theSeqBases - list of Bases shape to be extruded.
3800 # @param theLocations - list of locations on the path corresponding
3801 # specified list of the Bases shapes. Number of locations
3802 # should be equal to number of bases or list of locations can be empty.
3803 # @param thePath - Path shape to extrude the base shape along it.
3804 # @param theWithContact - the mode defining that the section is translated to be in
3805 # contact with the spine.
3806 # @param theWithCorrection - defining that the section is rotated to be
3807 # orthogonal to the spine tangent in the correspondent point
3808 # @param theName Object name; when specified, this parameter is used
3809 # for result publication in the study. Otherwise, if automatic
3810 # publication is switched on, default value is used for result name.
3812 # @return New GEOM.GEOM_Object, containing the created pipe.
3814 # @ref tui_creation_pipe_with_diff_sec "Example"
3815 @ManageTransactions("PrimOp")
3816 def MakePipeWithDifferentSections(self, theSeqBases,
3817 theLocations, thePath,
3818 theWithContact, theWithCorrection, theName=None):
3820 Create a shape by extrusion of the profile shape along
3821 the path shape. The path shape can be a wire or an edge.
3822 the several profiles can be specified in the several locations of path.
3825 theSeqBases - list of Bases shape to be extruded.
3826 theLocations - list of locations on the path corresponding
3827 specified list of the Bases shapes. Number of locations
3828 should be equal to number of bases or list of locations can be empty.
3829 thePath - Path shape to extrude the base shape along it.
3830 theWithContact - the mode defining that the section is translated to be in
3831 contact with the spine(0/1)
3832 theWithCorrection - defining that the section is rotated to be
3833 orthogonal to the spine tangent in the correspondent point (0/1)
3834 theName Object name; when specified, this parameter is used
3835 for result publication in the study. Otherwise, if automatic
3836 publication is switched on, default value is used for result name.
3839 New GEOM.GEOM_Object, containing the created pipe.
3841 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3842 theLocations, thePath,
3843 theWithContact, theWithCorrection)
3844 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3845 self._autoPublish(anObj, theName, "pipe")
3848 ## Create a shape by extrusion of the profile shape along
3849 # the path shape. The path shape can be a wire or a edge.
3850 # the several profiles can be specified in the several locations of path.
3851 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3852 # shell or face. If number of faces in neighbour sections
3853 # aren't coincided result solid between such sections will
3854 # be created using external boundaries of this shells.
3855 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3856 # This list is used for searching correspondences between
3857 # faces in the sections. Size of this list must be equal
3858 # to size of list of base shapes.
3859 # @param theLocations - list of locations on the path corresponding
3860 # specified list of the Bases shapes. Number of locations
3861 # should be equal to number of bases. First and last
3862 # locations must be coincided with first and last vertexes
3863 # of path correspondingly.
3864 # @param thePath - Path shape to extrude the base shape along it.
3865 # @param theWithContact - the mode defining that the section is translated to be in
3866 # contact with the spine.
3867 # @param theWithCorrection - defining that the section is rotated to be
3868 # orthogonal to the spine tangent in the correspondent point
3869 # @param theName Object name; when specified, this parameter is used
3870 # for result publication in the study. Otherwise, if automatic
3871 # publication is switched on, default value is used for result name.
3873 # @return New GEOM.GEOM_Object, containing the created solids.
3875 # @ref tui_creation_pipe_with_shell_sec "Example"
3876 @ManageTransactions("PrimOp")
3877 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3878 theLocations, thePath,
3879 theWithContact, theWithCorrection, theName=None):
3881 Create a shape by extrusion of the profile shape along
3882 the path shape. The path shape can be a wire or a edge.
3883 the several profiles can be specified in the several locations of path.
3886 theSeqBases - list of Bases shape to be extruded. Base shape must be
3887 shell or face. If number of faces in neighbour sections
3888 aren't coincided result solid between such sections will
3889 be created using external boundaries of this shells.
3890 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3891 This list is used for searching correspondences between
3892 faces in the sections. Size of this list must be equal
3893 to size of list of base shapes.
3894 theLocations - list of locations on the path corresponding
3895 specified list of the Bases shapes. Number of locations
3896 should be equal to number of bases. First and last
3897 locations must be coincided with first and last vertexes
3898 of path correspondingly.
3899 thePath - Path shape to extrude the base shape along it.
3900 theWithContact - the mode defining that the section is translated to be in
3901 contact with the spine (0/1)
3902 theWithCorrection - defining that the section is rotated to be
3903 orthogonal to the spine tangent in the correspondent point (0/1)
3904 theName Object name; when specified, this parameter is used
3905 for result publication in the study. Otherwise, if automatic
3906 publication is switched on, default value is used for result name.
3909 New GEOM.GEOM_Object, containing the created solids.
3911 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3912 theLocations, thePath,
3913 theWithContact, theWithCorrection)
3914 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3915 self._autoPublish(anObj, theName, "pipe")
3918 ## Create a shape by extrusion of the profile shape along
3919 # the path shape. This function is used only for debug pipe
3920 # functionality - it is a version of function MakePipeWithShellSections()
3921 # which give a possibility to recieve information about
3922 # creating pipe between each pair of sections step by step.
3923 @ManageTransactions("PrimOp")
3924 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3925 theLocations, thePath,
3926 theWithContact, theWithCorrection, theName=None):
3928 Create a shape by extrusion of the profile shape along
3929 the path shape. This function is used only for debug pipe
3930 functionality - it is a version of previous function
3931 geompy.MakePipeWithShellSections() which give a possibility to
3932 recieve information about creating pipe between each pair of
3933 sections step by step.
3936 nbsect = len(theSeqBases)
3937 nbsubsect = len(theSeqSubBases)
3938 #print "nbsect = ",nbsect
3939 for i in range(1,nbsect):
3941 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3942 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3944 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3945 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3946 tmpLocations, thePath,
3947 theWithContact, theWithCorrection)
3948 if self.PrimOp.IsDone() == 0:
3949 print "Problems with pipe creation between ",i," and ",i+1," sections"
3950 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3953 print "Pipe between ",i," and ",i+1," sections is OK"
3958 resc = self.MakeCompound(res)
3959 #resc = self.MakeSewing(res, 0.001)
3960 #print "resc: ",resc
3961 self._autoPublish(resc, theName, "pipe")
3964 ## Create solids between given sections
3965 # @param theSeqBases - list of sections (shell or face).
3966 # @param theLocations - list of corresponding vertexes
3967 # @param theName Object name; when specified, this parameter is used
3968 # for result publication in the study. Otherwise, if automatic
3969 # publication is switched on, default value is used for result name.
3971 # @return New GEOM.GEOM_Object, containing the created solids.
3973 # @ref tui_creation_pipe_without_path "Example"
3974 @ManageTransactions("PrimOp")
3975 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3977 Create solids between given sections
3980 theSeqBases - list of sections (shell or face).
3981 theLocations - list of corresponding vertexes
3982 theName Object name; when specified, this parameter is used
3983 for result publication in the study. Otherwise, if automatic
3984 publication is switched on, default value is used for result name.
3987 New GEOM.GEOM_Object, containing the created solids.
3989 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3990 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3991 self._autoPublish(anObj, theName, "pipe")
3994 ## Create a shape by extrusion of the base shape along
3995 # the path shape with constant bi-normal direction along the given vector.
3996 # The path shape can be a wire or an edge.
3997 # @param theBase Base shape to be extruded.
3998 # @param thePath Path shape to extrude the base shape along it.
3999 # @param theVec Vector defines a constant binormal direction to keep the
4000 # same angle beetween the direction and the sections
4001 # along the sweep surface.
4002 # @param theName Object name; when specified, this parameter is used
4003 # for result publication in the study. Otherwise, if automatic
4004 # publication is switched on, default value is used for result name.
4006 # @return New GEOM.GEOM_Object, containing the created pipe.
4008 # @ref tui_creation_pipe "Example"
4009 @ManageTransactions("PrimOp")
4010 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4012 Create a shape by extrusion of the base shape along
4013 the path shape with constant bi-normal direction along the given vector.
4014 The path shape can be a wire or an edge.
4017 theBase Base shape to be extruded.
4018 thePath Path shape to extrude the base shape along it.
4019 theVec Vector defines a constant binormal direction to keep the
4020 same angle beetween the direction and the sections
4021 along the sweep surface.
4022 theName Object name; when specified, this parameter is used
4023 for result publication in the study. Otherwise, if automatic
4024 publication is switched on, default value is used for result name.
4027 New GEOM.GEOM_Object, containing the created pipe.
4029 # Example: see GEOM_TestAll.py
4030 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4031 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4032 self._autoPublish(anObj, theName, "pipe")
4035 ## Makes a thick solid from a face or a shell
4036 # @param theShape Face or Shell to be thicken
4037 # @param theThickness Thickness of the resulting solid
4038 # @param theName Object name; when specified, this parameter is used
4039 # for result publication in the study. Otherwise, if automatic
4040 # publication is switched on, default value is used for result name.
4042 # @return New GEOM.GEOM_Object, containing the created solid
4044 @ManageTransactions("PrimOp")
4045 def MakeThickSolid(self, theShape, theThickness, theName=None):
4047 Make a thick solid from a face or a shell
4050 theShape Face or Shell to be thicken
4051 theThickness Thickness of the resulting solid
4052 theName Object name; when specified, this parameter is used
4053 for result publication in the study. Otherwise, if automatic
4054 publication is switched on, default value is used for result name.
4057 New GEOM.GEOM_Object, containing the created solid
4059 # Example: see GEOM_TestAll.py
4060 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4061 RaiseIfFailed("MakeThickening", self.PrimOp)
4062 self._autoPublish(anObj, theName, "pipe")
4066 ## Modifies a face or a shell to make it a thick solid
4067 # @param theShape Face or Shell to be thicken
4068 # @param theThickness Thickness of the resulting solid
4070 # @return The modified shape
4072 @ManageTransactions("PrimOp")
4073 def Thicken(self, theShape, theThickness):
4075 Modifies a face or a shell to make it a thick solid
4078 theBase Base shape to be extruded.
4079 thePath Path shape to extrude the base shape along it.
4080 theName Object name; when specified, this parameter is used
4081 for result publication in the study. Otherwise, if automatic
4082 publication is switched on, default value is used for result name.
4087 # Example: see GEOM_TestAll.py
4088 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4089 RaiseIfFailed("MakeThickening", self.PrimOp)
4092 ## Build a middle path of a pipe-like shape.
4093 # The path shape can be a wire or an edge.
4094 # @param theShape It can be closed or unclosed pipe-like shell
4095 # or a pipe-like solid.
4096 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4097 # should be wires or faces of theShape.
4098 # @param theName Object name; when specified, this parameter is used
4099 # for result publication in the study. Otherwise, if automatic
4100 # publication is switched on, default value is used for result name.
4102 # @note It is not assumed that exact or approximate copy of theShape
4103 # can be obtained by applying existing Pipe operation on the
4104 # resulting "Path" wire taking theBase1 as the base - it is not
4105 # always possible; though in some particular cases it might work
4106 # it is not guaranteed. Thus, RestorePath function should not be
4107 # considered as an exact reverse operation of the Pipe.
4109 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4110 # source pipe's "path".
4112 # @ref tui_creation_pipe_path "Example"
4113 @ManageTransactions("PrimOp")
4114 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4116 Build a middle path of a pipe-like shape.
4117 The path shape can be a wire or an edge.
4120 theShape It can be closed or unclosed pipe-like shell
4121 or a pipe-like solid.
4122 theBase1, theBase2 Two bases of the supposed pipe. This
4123 should be wires or faces of theShape.
4124 theName Object name; when specified, this parameter is used
4125 for result publication in the study. Otherwise, if automatic
4126 publication is switched on, default value is used for result name.
4129 New GEOM_Object, containing an edge or wire that represent
4132 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4133 RaiseIfFailed("RestorePath", self.PrimOp)
4134 self._autoPublish(anObj, theName, "path")
4137 ## Build a middle path of a pipe-like shape.
4138 # The path shape can be a wire or an edge.
4139 # @param theShape It can be closed or unclosed pipe-like shell
4140 # or a pipe-like solid.
4141 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4142 # should be lists of edges of theShape.
4143 # @param theName Object name; when specified, this parameter is used
4144 # for result publication in the study. Otherwise, if automatic
4145 # publication is switched on, default value is used for result name.
4147 # @note It is not assumed that exact or approximate copy of theShape
4148 # can be obtained by applying existing Pipe operation on the
4149 # resulting "Path" wire taking theBase1 as the base - it is not
4150 # always possible; though in some particular cases it might work
4151 # it is not guaranteed. Thus, RestorePath function should not be
4152 # considered as an exact reverse operation of the Pipe.
4154 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4155 # source pipe's "path".
4157 # @ref tui_creation_pipe_path "Example"
4158 @ManageTransactions("PrimOp")
4159 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4161 Build a middle path of a pipe-like shape.
4162 The path shape can be a wire or an edge.
4165 theShape It can be closed or unclosed pipe-like shell
4166 or a pipe-like solid.
4167 listEdges1, listEdges2 Two bases of the supposed pipe. This
4168 should be lists of edges of theShape.
4169 theName Object name; when specified, this parameter is used
4170 for result publication in the study. Otherwise, if automatic
4171 publication is switched on, default value is used for result name.
4174 New GEOM_Object, containing an edge or wire that represent
4177 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4178 RaiseIfFailed("RestorePath", self.PrimOp)
4179 self._autoPublish(anObj, theName, "path")
4185 ## @addtogroup l3_advanced
4188 ## Create a linear edge with specified ends.
4189 # @param thePnt1 Point for the first end of edge.
4190 # @param thePnt2 Point for the second end of edge.
4191 # @param theName Object name; when specified, this parameter is used
4192 # for result publication in the study. Otherwise, if automatic
4193 # publication is switched on, default value is used for result name.
4195 # @return New GEOM.GEOM_Object, containing the created edge.
4197 # @ref tui_creation_edge "Example"
4198 @ManageTransactions("ShapesOp")
4199 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4201 Create a linear edge with specified ends.
4204 thePnt1 Point for the first end of edge.
4205 thePnt2 Point for the second end of edge.
4206 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.
4211 New GEOM.GEOM_Object, containing the created edge.
4213 # Example: see GEOM_TestAll.py
4214 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4215 RaiseIfFailed("MakeEdge", self.ShapesOp)
4216 self._autoPublish(anObj, theName, "edge")
4219 ## Create a new edge, corresponding to the given length on the given curve.
4220 # @param theRefCurve The referenced curve (edge).
4221 # @param theLength Length on the referenced curve. It can be negative.
4222 # @param theStartPoint Any point can be selected for it, the new edge will begin
4223 # at the end of \a theRefCurve, close to the selected point.
4224 # If None, start from the first point of \a theRefCurve.
4225 # @param theName Object name; when specified, this parameter is used
4226 # for result publication in the study. Otherwise, if automatic
4227 # publication is switched on, default value is used for result name.
4229 # @return New GEOM.GEOM_Object, containing the created edge.
4231 # @ref tui_creation_edge "Example"
4232 @ManageTransactions("ShapesOp")
4233 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4235 Create a new edge, corresponding to the given length on the given curve.
4238 theRefCurve The referenced curve (edge).
4239 theLength Length on the referenced curve. It can be negative.
4240 theStartPoint Any point can be selected for it, the new edge will begin
4241 at the end of theRefCurve, close to the selected point.
4242 If None, start from the first point of theRefCurve.
4243 theName Object name; when specified, this parameter is used
4244 for result publication in the study. Otherwise, if automatic
4245 publication is switched on, default value is used for result name.
4248 New GEOM.GEOM_Object, containing the created edge.
4250 # Example: see GEOM_TestAll.py
4251 theLength, Parameters = ParseParameters(theLength)
4252 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4253 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4254 anObj.SetParameters(Parameters)
4255 self._autoPublish(anObj, theName, "edge")
4258 ## Create an edge from specified wire.
4259 # @param theWire source Wire
4260 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4261 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4262 # @param theName Object name; when specified, this parameter is used
4263 # for result publication in the study. Otherwise, if automatic
4264 # publication is switched on, default value is used for result name.
4266 # @return New GEOM.GEOM_Object, containing the created edge.
4268 # @ref tui_creation_edge "Example"
4269 @ManageTransactions("ShapesOp")
4270 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4272 Create an edge from specified wire.
4276 theLinearTolerance linear tolerance value (default = 1e-07)
4277 theAngularTolerance angular tolerance value (default = 1e-12)
4278 theName Object name; when specified, this parameter is used
4279 for result publication in the study. Otherwise, if automatic
4280 publication is switched on, default value is used for result name.
4283 New GEOM.GEOM_Object, containing the created edge.
4285 # Example: see GEOM_TestAll.py
4286 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4287 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4288 self._autoPublish(anObj, theName, "edge")
4291 ## Create a wire from the set of edges and wires.
4292 # @param theEdgesAndWires List of edges and/or wires.
4293 # @param theTolerance Maximum distance between vertices, that will be merged.
4294 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4295 # @param theName Object name; when specified, this parameter is used
4296 # for result publication in the study. Otherwise, if automatic
4297 # publication is switched on, default value is used for result name.
4299 # @return New GEOM.GEOM_Object, containing the created wire.
4301 # @ref tui_creation_wire "Example"
4302 @ManageTransactions("ShapesOp")
4303 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4305 Create a wire from the set of edges and wires.
4308 theEdgesAndWires List of edges and/or wires.
4309 theTolerance Maximum distance between vertices, that will be merged.
4310 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4311 theName Object name; when specified, this parameter is used
4312 for result publication in the study. Otherwise, if automatic
4313 publication is switched on, default value is used for result name.
4316 New GEOM.GEOM_Object, containing the created wire.
4318 # Example: see GEOM_TestAll.py
4319 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4320 RaiseIfFailed("MakeWire", self.ShapesOp)
4321 self._autoPublish(anObj, theName, "wire")
4324 ## Create a face on the given wire.
4325 # @param theWire closed Wire or Edge to build the face on.
4326 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4327 # If the tolerance of the obtained planar face is less
4328 # than 1e-06, this face will be returned, otherwise the
4329 # algorithm tries to build any suitable face on the given
4330 # wire and prints a warning message.
4331 # @param theName Object name; when specified, this parameter is used
4332 # for result publication in the study. Otherwise, if automatic
4333 # publication is switched on, default value is used for result name.
4335 # @return New GEOM.GEOM_Object, containing the created face.
4337 # @ref tui_creation_face "Example"
4338 @ManageTransactions("ShapesOp")
4339 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4341 Create a face on the given wire.
4344 theWire closed Wire or Edge to build the face on.
4345 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4346 If the tolerance of the obtained planar face is less
4347 than 1e-06, this face will be returned, otherwise the
4348 algorithm tries to build any suitable face on the given
4349 wire and prints a warning message.
4350 theName Object name; when specified, this parameter is used
4351 for result publication in the study. Otherwise, if automatic
4352 publication is switched on, default value is used for result name.
4355 New GEOM.GEOM_Object, containing the created face.
4357 # Example: see GEOM_TestAll.py
4358 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4359 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4360 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4362 RaiseIfFailed("MakeFace", self.ShapesOp)
4363 self._autoPublish(anObj, theName, "face")
4366 ## Create a face on the given wires set.
4367 # @param theWires List of closed wires or edges to build the face on.
4368 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4369 # If the tolerance of the obtained planar face is less
4370 # than 1e-06, this face will be returned, otherwise the
4371 # algorithm tries to build any suitable face on the given
4372 # wire and prints a warning message.
4373 # @param theName Object name; when specified, this parameter is used
4374 # for result publication in the study. Otherwise, if automatic
4375 # publication is switched on, default value is used for result name.
4377 # @return New GEOM.GEOM_Object, containing the created face.
4379 # @ref tui_creation_face "Example"
4380 @ManageTransactions("ShapesOp")
4381 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4383 Create a face on the given wires set.
4386 theWires List of closed wires or edges to build the face on.
4387 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4388 If the tolerance of the obtained planar face is less
4389 than 1e-06, this face will be returned, otherwise the
4390 algorithm tries to build any suitable face on the given
4391 wire and prints a warning message.
4392 theName Object name; when specified, this parameter is used
4393 for result publication in the study. Otherwise, if automatic
4394 publication is switched on, default value is used for result name.
4397 New GEOM.GEOM_Object, containing the created face.
4399 # Example: see GEOM_TestAll.py
4400 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4401 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4402 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4404 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4405 self._autoPublish(anObj, theName, "face")
4408 ## See MakeFaceWires() method for details.
4410 # @ref tui_creation_face "Example 1"
4411 # \n @ref swig_MakeFaces "Example 2"
4412 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4414 See geompy.MakeFaceWires() method for details.
4416 # Example: see GEOM_TestOthers.py
4417 # note: auto-publishing is done in self.MakeFaceWires()
4418 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4421 ## Create a shell from the set of faces and shells.
4422 # @param theFacesAndShells List of faces and/or shells.
4423 # @param theName Object name; when specified, this parameter is used
4424 # for result publication in the study. Otherwise, if automatic
4425 # publication is switched on, default value is used for result name.
4427 # @return New GEOM.GEOM_Object, containing the created shell.
4429 # @ref tui_creation_shell "Example"
4430 @ManageTransactions("ShapesOp")
4431 def MakeShell(self, theFacesAndShells, theName=None):
4433 Create a shell from the set of faces and shells.
4436 theFacesAndShells List of faces and/or shells.
4437 theName Object name; when specified, this parameter is used
4438 for result publication in the study. Otherwise, if automatic
4439 publication is switched on, default value is used for result name.
4442 New GEOM.GEOM_Object, containing the created shell.
4444 # Example: see GEOM_TestAll.py
4445 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4446 RaiseIfFailed("MakeShell", self.ShapesOp)
4447 self._autoPublish(anObj, theName, "shell")
4450 ## Create a solid, bounded by the given shells.
4451 # @param theShells Sequence of bounding shells.
4452 # @param theName Object name; when specified, this parameter is used
4453 # for result publication in the study. Otherwise, if automatic
4454 # publication is switched on, default value is used for result name.
4456 # @return New GEOM.GEOM_Object, containing the created solid.
4458 # @ref tui_creation_solid "Example"
4459 @ManageTransactions("ShapesOp")
4460 def MakeSolid(self, theShells, theName=None):
4462 Create a solid, bounded by the given shells.
4465 theShells Sequence of bounding shells.
4466 theName Object name; when specified, this parameter is used
4467 for result publication in the study. Otherwise, if automatic
4468 publication is switched on, default value is used for result name.
4471 New GEOM.GEOM_Object, containing the created solid.
4473 # Example: see GEOM_TestAll.py
4474 if len(theShells) == 1:
4475 descr = self._IsGoodForSolid(theShells[0])
4477 # raise RuntimeError, "MakeSolidShells : " + descr
4478 if descr == "WRN_SHAPE_UNCLOSED":
4479 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4480 anObj = self.ShapesOp.MakeSolidShells(theShells)
4481 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4482 self._autoPublish(anObj, theName, "solid")
4485 ## Create a compound of the given shapes.
4486 # @param theShapes List of shapes to put in compound.
4487 # @param theName Object name; when specified, this parameter is used
4488 # for result publication in the study. Otherwise, if automatic
4489 # publication is switched on, default value is used for result name.
4491 # @return New GEOM.GEOM_Object, containing the created compound.
4493 # @ref tui_creation_compound "Example"
4494 @ManageTransactions("ShapesOp")
4495 def MakeCompound(self, theShapes, theName=None):
4497 Create a compound of the given shapes.
4500 theShapes List of shapes to put in compound.
4501 theName Object name; when specified, this parameter is used
4502 for result publication in the study. Otherwise, if automatic
4503 publication is switched on, default value is used for result name.
4506 New GEOM.GEOM_Object, containing the created compound.
4508 # Example: see GEOM_TestAll.py
4509 anObj = self.ShapesOp.MakeCompound(theShapes)
4510 RaiseIfFailed("MakeCompound", self.ShapesOp)
4511 self._autoPublish(anObj, theName, "compound")
4514 # end of l3_advanced
4517 ## @addtogroup l2_measure
4520 ## Gives quantity of faces in the given shape.
4521 # @param theShape Shape to count faces of.
4522 # @return Quantity of faces.
4524 # @ref swig_NumberOf "Example"
4525 @ManageTransactions("ShapesOp")
4526 def NumberOfFaces(self, theShape):
4528 Gives quantity of faces in the given shape.
4531 theShape Shape to count faces of.
4536 # Example: see GEOM_TestOthers.py
4537 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4538 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4541 ## Gives quantity of edges in the given shape.
4542 # @param theShape Shape to count edges of.
4543 # @return Quantity of edges.
4545 # @ref swig_NumberOf "Example"
4546 @ManageTransactions("ShapesOp")
4547 def NumberOfEdges(self, theShape):
4549 Gives quantity of edges in the given shape.
4552 theShape Shape to count edges of.
4557 # Example: see GEOM_TestOthers.py
4558 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4559 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4562 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4563 # @param theShape Shape to count sub-shapes of.
4564 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4565 # @return Quantity of sub-shapes of given type.
4567 # @ref swig_NumberOf "Example"
4568 @ManageTransactions("ShapesOp")
4569 def NumberOfSubShapes(self, theShape, theShapeType):
4571 Gives quantity of sub-shapes of type theShapeType in the given shape.
4574 theShape Shape to count sub-shapes of.
4575 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4578 Quantity of sub-shapes of given type.
4580 # Example: see GEOM_TestOthers.py
4581 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4582 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4585 ## Gives quantity of solids in the given shape.
4586 # @param theShape Shape to count solids in.
4587 # @return Quantity of solids.
4589 # @ref swig_NumberOf "Example"
4590 @ManageTransactions("ShapesOp")
4591 def NumberOfSolids(self, theShape):
4593 Gives quantity of solids in the given shape.
4596 theShape Shape to count solids in.
4601 # Example: see GEOM_TestOthers.py
4602 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4603 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4609 ## @addtogroup l3_healing
4612 ## Reverses an orientation the given shape.
4613 # @param theShape Shape to be reversed.
4614 # @param 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.
4618 # @return The reversed copy of theShape.
4620 # @ref swig_ChangeOrientation "Example"
4621 @ManageTransactions("ShapesOp")
4622 def ChangeOrientation(self, theShape, theName=None):
4624 Reverses an orientation the given shape.
4627 theShape Shape to be reversed.
4628 theName Object name; when specified, this parameter is used
4629 for result publication in the study. Otherwise, if automatic
4630 publication is switched on, default value is used for result name.
4633 The reversed copy of theShape.
4635 # Example: see GEOM_TestAll.py
4636 anObj = self.ShapesOp.ChangeOrientation(theShape)
4637 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4638 self._autoPublish(anObj, theName, "reversed")
4641 ## See ChangeOrientation() method for details.
4643 # @ref swig_OrientationChange "Example"
4644 def OrientationChange(self, theShape, theName=None):
4646 See geompy.ChangeOrientation method for details.
4648 # Example: see GEOM_TestOthers.py
4649 # note: auto-publishing is done in self.ChangeOrientation()
4650 anObj = self.ChangeOrientation(theShape, theName)
4656 ## @addtogroup l4_obtain
4659 ## Retrieve all free faces from the given shape.
4660 # Free face is a face, which is not shared between two shells of the shape.
4661 # @param theShape Shape to find free faces in.
4662 # @return List of IDs of all free faces, contained in theShape.
4664 # @ref tui_measurement_tools_page "Example"
4665 @ManageTransactions("ShapesOp")
4666 def GetFreeFacesIDs(self,theShape):
4668 Retrieve all free faces from the given shape.
4669 Free face is a face, which is not shared between two shells of the shape.
4672 theShape Shape to find free faces in.
4675 List of IDs of all free faces, contained in theShape.
4677 # Example: see GEOM_TestOthers.py
4678 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4679 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4682 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4683 # @param theShape1 Shape to find sub-shapes in.
4684 # @param theShape2 Shape to find shared sub-shapes with.
4685 # @param theShapeType Type of sub-shapes to be retrieved.
4686 # @param theName Object name; when specified, this parameter is used
4687 # for result publication in the study. Otherwise, if automatic
4688 # publication is switched on, default value is used for result name.
4690 # @return List of sub-shapes of theShape1, shared with theShape2.
4692 # @ref swig_GetSharedShapes "Example"
4693 @ManageTransactions("ShapesOp")
4694 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4696 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4699 theShape1 Shape to find sub-shapes in.
4700 theShape2 Shape to find shared sub-shapes with.
4701 theShapeType Type of sub-shapes to be retrieved.
4702 theName Object name; when specified, this parameter is used
4703 for result publication in the study. Otherwise, if automatic
4704 publication is switched on, default value is used for result name.
4707 List of sub-shapes of theShape1, shared with theShape2.
4709 # Example: see GEOM_TestOthers.py
4710 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4711 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4712 self._autoPublish(aList, theName, "shared")
4715 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4716 # @param theShapes Shapes to find common sub-shapes of.
4717 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4718 # @param theName Object name; when specified, this parameter is used
4719 # for result publication in the study. Otherwise, if automatic
4720 # publication is switched on, default value is used for result name.
4722 # @return List of objects, that are sub-shapes of all given shapes.
4724 # @ref swig_GetSharedShapes "Example"
4725 @ManageTransactions("ShapesOp")
4726 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4728 Get all sub-shapes, shared by all shapes in the list theShapes.
4731 theShapes Shapes to find common sub-shapes of.
4732 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4733 theName Object name; when specified, this parameter is used
4734 for result publication in the study. Otherwise, if automatic
4735 publication is switched on, default value is used for result name.
4738 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4740 # Example: see GEOM_TestOthers.py
4741 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4742 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4743 self._autoPublish(aList, theName, "shared")
4746 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4747 # situated relatively the specified plane by the certain way,
4748 # defined through <VAR>theState</VAR> parameter.
4749 # @param theShape Shape to find sub-shapes of.
4750 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4751 # @param theAx1 Vector (or line, or linear edge), specifying normal
4752 # direction and location of the plane to find shapes on.
4753 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4754 # @param theName Object name; when specified, this parameter is used
4755 # for result publication in the study. Otherwise, if automatic
4756 # publication is switched on, default value is used for result name.
4758 # @return List of all found sub-shapes.
4760 # @ref swig_GetShapesOnPlane "Example"
4761 @ManageTransactions("ShapesOp")
4762 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4764 Find in theShape all sub-shapes of type theShapeType,
4765 situated relatively the specified plane by the certain way,
4766 defined through theState parameter.
4769 theShape Shape to find sub-shapes of.
4770 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4771 theAx1 Vector (or line, or linear edge), specifying normal
4772 direction and location of the plane to find shapes on.
4773 theState The state of the sub-shapes to find (see GEOM::shape_state)
4774 theName Object name; when specified, this parameter is used
4775 for result publication in the study. Otherwise, if automatic
4776 publication is switched on, default value is used for result name.
4779 List of all found sub-shapes.
4781 # Example: see GEOM_TestOthers.py
4782 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4783 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4784 self._autoPublish(aList, theName, "shapeOnPlane")
4787 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4788 # situated relatively the specified plane by the certain way,
4789 # defined through <VAR>theState</VAR> parameter.
4790 # @param theShape Shape to find sub-shapes of.
4791 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4792 # @param theAx1 Vector (or line, or linear edge), specifying normal
4793 # direction and location of the plane to find shapes on.
4794 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4796 # @return List of all found sub-shapes indices.
4798 # @ref swig_GetShapesOnPlaneIDs "Example"
4799 @ManageTransactions("ShapesOp")
4800 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4802 Find in theShape all sub-shapes of type theShapeType,
4803 situated relatively the specified plane by the certain way,
4804 defined through theState parameter.
4807 theShape Shape to find sub-shapes of.
4808 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4809 theAx1 Vector (or line, or linear edge), specifying normal
4810 direction and location of the plane to find shapes on.
4811 theState The state of the sub-shapes to find (see GEOM::shape_state)
4814 List of all found sub-shapes indices.
4816 # Example: see GEOM_TestOthers.py
4817 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4818 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4821 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4822 # situated relatively the specified plane by the certain way,
4823 # defined through <VAR>theState</VAR> parameter.
4824 # @param theShape Shape to find sub-shapes of.
4825 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4826 # @param theAx1 Vector (or line, or linear edge), specifying normal
4827 # direction of the plane to find shapes on.
4828 # @param thePnt Point specifying location of the plane to find shapes on.
4829 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4830 # @param theName Object name; when specified, this parameter is used
4831 # for result publication in the study. Otherwise, if automatic
4832 # publication is switched on, default value is used for result name.
4834 # @return List of all found sub-shapes.
4836 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4837 @ManageTransactions("ShapesOp")
4838 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4840 Find in theShape all sub-shapes of type theShapeType,
4841 situated relatively the specified plane by the certain way,
4842 defined through theState parameter.
4845 theShape Shape to find sub-shapes of.
4846 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4847 theAx1 Vector (or line, or linear edge), specifying normal
4848 direction and location of the plane to find shapes on.
4849 thePnt Point specifying location of the plane to find shapes on.
4850 theState The state of the sub-shapes to find (see GEOM::shape_state)
4851 theName Object name; when specified, this parameter is used
4852 for result publication in the study. Otherwise, if automatic
4853 publication is switched on, default value is used for result name.
4856 List of all found sub-shapes.
4858 # Example: see GEOM_TestOthers.py
4859 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4860 theAx1, thePnt, theState)
4861 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4862 self._autoPublish(aList, theName, "shapeOnPlane")
4865 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4866 # situated relatively the specified plane by the certain way,
4867 # defined through <VAR>theState</VAR> parameter.
4868 # @param theShape Shape to find sub-shapes of.
4869 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4870 # @param theAx1 Vector (or line, or linear edge), specifying normal
4871 # direction of the plane to find shapes on.
4872 # @param thePnt Point specifying location of the plane to find shapes on.
4873 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4875 # @return List of all found sub-shapes indices.
4877 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4878 @ManageTransactions("ShapesOp")
4879 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4881 Find in theShape all sub-shapes of type theShapeType,
4882 situated relatively the specified plane by the certain way,
4883 defined through theState parameter.
4886 theShape Shape to find sub-shapes of.
4887 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4888 theAx1 Vector (or line, or linear edge), specifying normal
4889 direction and location of the plane to find shapes on.
4890 thePnt Point specifying location of the plane to find shapes on.
4891 theState The state of the sub-shapes to find (see GEOM::shape_state)
4894 List of all found sub-shapes indices.
4896 # Example: see GEOM_TestOthers.py
4897 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4898 theAx1, thePnt, theState)
4899 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4902 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4903 # the specified cylinder by the certain way, defined through \a theState parameter.
4904 # @param theShape Shape to find sub-shapes of.
4905 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4906 # @param theAxis Vector (or line, or linear edge), specifying
4907 # axis of the cylinder to find shapes on.
4908 # @param theRadius Radius of the cylinder to find shapes on.
4909 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4910 # @param theName Object name; when specified, this parameter is used
4911 # for result publication in the study. Otherwise, if automatic
4912 # publication is switched on, default value is used for result name.
4914 # @return List of all found sub-shapes.
4916 # @ref swig_GetShapesOnCylinder "Example"
4917 @ManageTransactions("ShapesOp")
4918 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4920 Find in theShape all sub-shapes of type theShapeType, situated relatively
4921 the specified cylinder by the certain way, defined through theState parameter.
4924 theShape Shape to find sub-shapes of.
4925 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4926 theAxis Vector (or line, or linear edge), specifying
4927 axis of the cylinder to find shapes on.
4928 theRadius Radius of the cylinder to find shapes on.
4929 theState The state of the sub-shapes to find (see GEOM::shape_state)
4930 theName Object name; when specified, this parameter is used
4931 for result publication in the study. Otherwise, if automatic
4932 publication is switched on, default value is used for result name.
4935 List of all found sub-shapes.
4937 # Example: see GEOM_TestOthers.py
4938 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4939 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4940 self._autoPublish(aList, theName, "shapeOnCylinder")
4943 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4944 # the specified cylinder by the certain way, defined through \a theState parameter.
4945 # @param theShape Shape to find sub-shapes of.
4946 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4947 # @param theAxis Vector (or line, or linear edge), specifying
4948 # axis of the cylinder to find shapes on.
4949 # @param theRadius Radius of the cylinder to find shapes on.
4950 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4952 # @return List of all found sub-shapes indices.
4954 # @ref swig_GetShapesOnCylinderIDs "Example"
4955 @ManageTransactions("ShapesOp")
4956 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4958 Find in theShape all sub-shapes of type theShapeType, situated relatively
4959 the specified cylinder by the certain way, defined through theState parameter.
4962 theShape Shape to find sub-shapes of.
4963 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4964 theAxis Vector (or line, or linear edge), specifying
4965 axis of the cylinder to find shapes on.
4966 theRadius Radius of the cylinder to find shapes on.
4967 theState The state of the sub-shapes to find (see GEOM::shape_state)
4970 List of all found sub-shapes indices.
4972 # Example: see GEOM_TestOthers.py
4973 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4974 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4977 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4978 # the specified cylinder by the certain way, defined through \a theState parameter.
4979 # @param theShape Shape to find sub-shapes of.
4980 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4981 # @param theAxis Vector (or line, or linear edge), specifying
4982 # axis of the cylinder to find shapes on.
4983 # @param thePnt Point specifying location of the bottom of the cylinder.
4984 # @param theRadius Radius of the cylinder to find shapes on.
4985 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4986 # @param theName Object name; when specified, this parameter is used
4987 # for result publication in the study. Otherwise, if automatic
4988 # publication is switched on, default value is used for result name.
4990 # @return List of all found sub-shapes.
4992 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4993 @ManageTransactions("ShapesOp")
4994 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4996 Find in theShape all sub-shapes of type theShapeType, situated relatively
4997 the specified cylinder by the certain way, defined through theState parameter.
5000 theShape Shape to find sub-shapes of.
5001 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5002 theAxis Vector (or line, or linear edge), specifying
5003 axis of the cylinder to find shapes on.
5004 theRadius Radius of the cylinder to find shapes on.
5005 theState The state of the sub-shapes to find (see GEOM::shape_state)
5006 theName Object name; when specified, this parameter is used
5007 for result publication in the study. Otherwise, if automatic
5008 publication is switched on, default value is used for result name.
5011 List of all found sub-shapes.
5013 # Example: see GEOM_TestOthers.py
5014 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5015 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5016 self._autoPublish(aList, theName, "shapeOnCylinder")
5019 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5020 # the specified cylinder by the certain way, defined through \a theState parameter.
5021 # @param theShape Shape to find sub-shapes of.
5022 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5023 # @param theAxis Vector (or line, or linear edge), specifying
5024 # axis of the cylinder to find shapes on.
5025 # @param thePnt Point specifying location of the bottom of the cylinder.
5026 # @param theRadius Radius of the cylinder to find shapes on.
5027 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5029 # @return List of all found sub-shapes indices
5031 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5032 @ManageTransactions("ShapesOp")
5033 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5035 Find in theShape all sub-shapes of type theShapeType, situated relatively
5036 the specified cylinder by the certain way, defined through theState parameter.
5039 theShape Shape to find sub-shapes of.
5040 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5041 theAxis Vector (or line, or linear edge), specifying
5042 axis of the cylinder to find shapes on.
5043 theRadius Radius of the cylinder to find shapes on.
5044 theState The state of the sub-shapes to find (see GEOM::shape_state)
5047 List of all found sub-shapes indices.
5049 # Example: see GEOM_TestOthers.py
5050 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5051 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5054 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5055 # the specified sphere by the certain way, defined through \a theState parameter.
5056 # @param theShape Shape to find sub-shapes of.
5057 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5058 # @param theCenter Point, specifying center of the sphere to find shapes on.
5059 # @param theRadius Radius of the sphere to find shapes on.
5060 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5061 # @param theName Object name; when specified, this parameter is used
5062 # for result publication in the study. Otherwise, if automatic
5063 # publication is switched on, default value is used for result name.
5065 # @return List of all found sub-shapes.
5067 # @ref swig_GetShapesOnSphere "Example"
5068 @ManageTransactions("ShapesOp")
5069 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5071 Find in theShape all sub-shapes of type theShapeType, situated relatively
5072 the specified sphere by the certain way, defined through theState parameter.
5075 theShape Shape to find sub-shapes of.
5076 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5077 theCenter Point, specifying center of the sphere to find shapes on.
5078 theRadius Radius of the sphere to find shapes on.
5079 theState The state of the sub-shapes to find (see GEOM::shape_state)
5080 theName Object name; when specified, this parameter is used
5081 for result publication in the study. Otherwise, if automatic
5082 publication is switched on, default value is used for result name.
5085 List of all found sub-shapes.
5087 # Example: see GEOM_TestOthers.py
5088 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5089 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5090 self._autoPublish(aList, theName, "shapeOnSphere")
5093 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5094 # the specified sphere by the certain way, defined through \a theState parameter.
5095 # @param theShape Shape to find sub-shapes of.
5096 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5097 # @param theCenter Point, specifying center of the sphere to find shapes on.
5098 # @param theRadius Radius of the sphere to find shapes on.
5099 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5101 # @return List of all found sub-shapes indices.
5103 # @ref swig_GetShapesOnSphereIDs "Example"
5104 @ManageTransactions("ShapesOp")
5105 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5107 Find in theShape all sub-shapes of type theShapeType, situated relatively
5108 the specified sphere by the certain way, defined through theState parameter.
5111 theShape Shape to find sub-shapes of.
5112 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5113 theCenter Point, specifying center of the sphere to find shapes on.
5114 theRadius Radius of the sphere to find shapes on.
5115 theState The state of the sub-shapes to find (see GEOM::shape_state)
5118 List of all found sub-shapes indices.
5120 # Example: see GEOM_TestOthers.py
5121 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5122 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5125 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5126 # the specified quadrangle by the certain way, defined through \a theState parameter.
5127 # @param theShape Shape to find sub-shapes of.
5128 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5129 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5130 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5131 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5132 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5133 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5134 # @param theName Object name; when specified, this parameter is used
5135 # for result publication in the study. Otherwise, if automatic
5136 # publication is switched on, default value is used for result name.
5138 # @return List of all found sub-shapes.
5140 # @ref swig_GetShapesOnQuadrangle "Example"
5141 @ManageTransactions("ShapesOp")
5142 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5143 theTopLeftPoint, theTopRigthPoint,
5144 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5146 Find in theShape all sub-shapes of type theShapeType, situated relatively
5147 the specified quadrangle by the certain way, defined through theState parameter.
5150 theShape Shape to find sub-shapes of.
5151 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5152 theTopLeftPoint Point, specifying top left corner of a quadrangle
5153 theTopRigthPoint Point, specifying top right corner of a quadrangle
5154 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5155 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
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.GetShapesOnQuadrangle(theShape, theShapeType,
5166 theTopLeftPoint, theTopRigthPoint,
5167 theBottomLeftPoint, theBottomRigthPoint, theState)
5168 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5169 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5172 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5173 # the specified quadrangle by the certain way, defined through \a theState parameter.
5174 # @param theShape Shape to find sub-shapes of.
5175 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5176 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5177 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5178 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5179 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5180 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5182 # @return List of all found sub-shapes indices.
5184 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5185 @ManageTransactions("ShapesOp")
5186 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5187 theTopLeftPoint, theTopRigthPoint,
5188 theBottomLeftPoint, theBottomRigthPoint, theState):
5190 Find in theShape all sub-shapes of type theShapeType, situated relatively
5191 the specified quadrangle by the certain way, defined through theState parameter.
5194 theShape Shape to find sub-shapes of.
5195 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5196 theTopLeftPoint Point, specifying top left corner of a quadrangle
5197 theTopRigthPoint Point, specifying top right corner of a quadrangle
5198 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5199 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5200 theState The state of the sub-shapes to find (see GEOM::shape_state)
5203 List of all found sub-shapes indices.
5206 # Example: see GEOM_TestOthers.py
5207 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5208 theTopLeftPoint, theTopRigthPoint,
5209 theBottomLeftPoint, theBottomRigthPoint, theState)
5210 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5213 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5214 # the specified \a theBox by the certain way, defined through \a theState parameter.
5215 # @param theBox Shape for relative comparing.
5216 # @param theShape Shape to find sub-shapes of.
5217 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5218 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5219 # @param theName Object name; when specified, this parameter is used
5220 # for result publication in the study. Otherwise, if automatic
5221 # publication is switched on, default value is used for result name.
5223 # @return List of all found sub-shapes.
5225 # @ref swig_GetShapesOnBox "Example"
5226 @ManageTransactions("ShapesOp")
5227 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5229 Find in theShape all sub-shapes of type theShapeType, situated relatively
5230 the specified theBox by the certain way, defined through theState parameter.
5233 theBox Shape for relative comparing.
5234 theShape Shape to find sub-shapes of.
5235 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5236 theState The state of the sub-shapes to find (see GEOM::shape_state)
5237 theName Object name; when specified, this parameter is used
5238 for result publication in the study. Otherwise, if automatic
5239 publication is switched on, default value is used for result name.
5242 List of all found sub-shapes.
5244 # Example: see GEOM_TestOthers.py
5245 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5246 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5247 self._autoPublish(aList, theName, "shapeOnBox")
5250 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5251 # the specified \a theBox by the certain way, defined through \a theState parameter.
5252 # @param theBox Shape for relative comparing.
5253 # @param theShape Shape to find sub-shapes of.
5254 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5255 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5257 # @return List of all found sub-shapes indices.
5259 # @ref swig_GetShapesOnBoxIDs "Example"
5260 @ManageTransactions("ShapesOp")
5261 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5263 Find in theShape all sub-shapes of type theShapeType, situated relatively
5264 the specified theBox by the certain way, defined through theState parameter.
5267 theBox Shape for relative comparing.
5268 theShape Shape to find sub-shapes of.
5269 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5270 theState The state of the sub-shapes to find (see GEOM::shape_state)
5273 List of all found sub-shapes indices.
5275 # Example: see GEOM_TestOthers.py
5276 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5277 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5280 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5281 # situated relatively the specified \a theCheckShape by the
5282 # certain way, defined through \a theState parameter.
5283 # @param theCheckShape Shape for relative comparing. It must be a solid.
5284 # @param theShape Shape to find sub-shapes of.
5285 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5286 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5287 # @param theName Object name; when specified, this parameter is used
5288 # for result publication in the study. Otherwise, if automatic
5289 # publication is switched on, default value is used for result name.
5291 # @return List of all found sub-shapes.
5293 # @ref swig_GetShapesOnShape "Example"
5294 @ManageTransactions("ShapesOp")
5295 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5297 Find in theShape all sub-shapes of type theShapeType,
5298 situated relatively the specified theCheckShape by the
5299 certain way, defined through theState parameter.
5302 theCheckShape Shape for relative comparing. It must be a solid.
5303 theShape Shape to find sub-shapes of.
5304 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5305 theState The state of the sub-shapes to find (see GEOM::shape_state)
5306 theName Object name; when specified, this parameter is used
5307 for result publication in the study. Otherwise, if automatic
5308 publication is switched on, default value is used for result name.
5311 List of all found sub-shapes.
5313 # Example: see GEOM_TestOthers.py
5314 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5315 theShapeType, theState)
5316 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5317 self._autoPublish(aList, theName, "shapeOnShape")
5320 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5321 # situated relatively the specified \a theCheckShape by the
5322 # certain way, defined through \a theState parameter.
5323 # @param theCheckShape Shape for relative comparing. It must be a solid.
5324 # @param theShape Shape to find sub-shapes of.
5325 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5326 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5327 # @param theName Object name; when specified, this parameter is used
5328 # for result publication in the study. Otherwise, if automatic
5329 # publication is switched on, default value is used for result name.
5331 # @return All found sub-shapes as compound.
5333 # @ref swig_GetShapesOnShapeAsCompound "Example"
5334 @ManageTransactions("ShapesOp")
5335 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5337 Find in theShape all sub-shapes of type theShapeType,
5338 situated relatively the specified theCheckShape by the
5339 certain way, defined through theState parameter.
5342 theCheckShape Shape for relative comparing. It must be a solid.
5343 theShape Shape to find sub-shapes of.
5344 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5345 theState The state of the sub-shapes to find (see GEOM::shape_state)
5346 theName Object name; when specified, this parameter is used
5347 for result publication in the study. Otherwise, if automatic
5348 publication is switched on, default value is used for result name.
5351 All found sub-shapes as compound.
5353 # Example: see GEOM_TestOthers.py
5354 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5355 theShapeType, theState)
5356 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5357 self._autoPublish(anObj, theName, "shapeOnShape")
5360 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5361 # situated relatively the specified \a theCheckShape by the
5362 # certain way, defined through \a theState parameter.
5363 # @param theCheckShape Shape for relative comparing. It must be a solid.
5364 # @param theShape Shape to find sub-shapes of.
5365 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5366 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5368 # @return List of all found sub-shapes indices.
5370 # @ref swig_GetShapesOnShapeIDs "Example"
5371 @ManageTransactions("ShapesOp")
5372 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5374 Find in theShape all sub-shapes of type theShapeType,
5375 situated relatively the specified theCheckShape by the
5376 certain way, defined through theState parameter.
5379 theCheckShape Shape for relative comparing. It must be a solid.
5380 theShape Shape to find sub-shapes of.
5381 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5382 theState The state of the sub-shapes to find (see GEOM::shape_state)
5385 List of all found sub-shapes indices.
5387 # Example: see GEOM_TestOthers.py
5388 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5389 theShapeType, theState)
5390 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5393 ## Get sub-shape(s) of theShapeWhere, which are
5394 # coincident with \a theShapeWhat or could be a part of it.
5395 # @param theShapeWhere Shape to find sub-shapes of.
5396 # @param theShapeWhat Shape, specifying what to find.
5397 # @param isNewImplementation implementation of GetInPlace functionality
5398 # (default = False, old alghorithm based on shape properties)
5399 # @param theName Object name; when specified, this parameter is used
5400 # for result publication in the study. Otherwise, if automatic
5401 # publication is switched on, default value is used for result name.
5403 # @return Group of all found sub-shapes or a single found sub-shape.
5405 # @note This function has a restriction on argument shapes.
5406 # If \a theShapeWhere has curved parts with significantly
5407 # outstanding centres (i.e. the mass centre of a part is closer to
5408 # \a theShapeWhat than to the part), such parts will not be found.
5409 # @image html get_in_place_lost_part.png
5411 # @ref swig_GetInPlace "Example"
5412 @ManageTransactions("ShapesOp")
5413 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5415 Get sub-shape(s) of theShapeWhere, which are
5416 coincident with theShapeWhat or could be a part of it.
5419 theShapeWhere Shape to find sub-shapes of.
5420 theShapeWhat Shape, specifying what to find.
5421 isNewImplementation Implementation of GetInPlace functionality
5422 (default = False, old alghorithm based on shape properties)
5423 theName Object name; when specified, this parameter is used
5424 for result publication in the study. Otherwise, if automatic
5425 publication is switched on, default value is used for result name.
5428 Group of all found sub-shapes or a single found sub-shape.
5432 This function has a restriction on argument shapes.
5433 If theShapeWhere has curved parts with significantly
5434 outstanding centres (i.e. the mass centre of a part is closer to
5435 theShapeWhat than to the part), such parts will not be found.
5437 # Example: see GEOM_TestOthers.py
5439 if isNewImplementation:
5440 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5442 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5444 RaiseIfFailed("GetInPlace", self.ShapesOp)
5445 self._autoPublish(anObj, theName, "inplace")
5448 ## Get sub-shape(s) of \a theShapeWhere, which are
5449 # coincident with \a theShapeWhat or could be a part of it.
5451 # Implementation of this method is based on a saved history of an operation,
5452 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5453 # arguments (an argument shape or a sub-shape of an argument shape).
5454 # The operation could be the Partition or one of boolean operations,
5455 # performed on simple shapes (not on compounds).
5457 # @param theShapeWhere Shape to find sub-shapes of.
5458 # @param theShapeWhat Shape, specifying what to find (must be in the
5459 # building history of the ShapeWhere).
5460 # @param theName Object name; when specified, this parameter is used
5461 # for result publication in the study. Otherwise, if automatic
5462 # publication is switched on, default value is used for result name.
5464 # @return Group of all found sub-shapes or a single found sub-shape.
5466 # @ref swig_GetInPlace "Example"
5467 @ManageTransactions("ShapesOp")
5468 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5470 Implementation of this method is based on a saved history of an operation,
5471 produced theShapeWhere. The theShapeWhat must be among this operation's
5472 arguments (an argument shape or a sub-shape of an argument shape).
5473 The operation could be the Partition or one of boolean operations,
5474 performed on simple shapes (not on compounds).
5477 theShapeWhere Shape to find sub-shapes of.
5478 theShapeWhat Shape, specifying what to find (must be in the
5479 building history of the ShapeWhere).
5480 theName Object name; when specified, this parameter is used
5481 for result publication in the study. Otherwise, if automatic
5482 publication is switched on, default value is used for result name.
5485 Group of all found sub-shapes or a single found sub-shape.
5487 # Example: see GEOM_TestOthers.py
5488 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5489 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5490 self._autoPublish(anObj, theName, "inplace")
5493 ## Get sub-shape of theShapeWhere, which is
5494 # equal to \a theShapeWhat.
5495 # @param theShapeWhere Shape to find sub-shape of.
5496 # @param theShapeWhat Shape, specifying what to find.
5497 # @param theName Object name; when specified, this parameter is used
5498 # for result publication in the study. Otherwise, if automatic
5499 # publication is switched on, default value is used for result name.
5501 # @return New GEOM.GEOM_Object for found sub-shape.
5503 # @ref swig_GetSame "Example"
5504 @ManageTransactions("ShapesOp")
5505 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5507 Get sub-shape of theShapeWhere, which is
5508 equal to theShapeWhat.
5511 theShapeWhere Shape to find sub-shape of.
5512 theShapeWhat Shape, specifying what to find.
5513 theName Object name; when specified, this parameter is used
5514 for result publication in the study. Otherwise, if automatic
5515 publication is switched on, default value is used for result name.
5518 New GEOM.GEOM_Object for found sub-shape.
5520 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5521 RaiseIfFailed("GetSame", self.ShapesOp)
5522 self._autoPublish(anObj, theName, "sameShape")
5526 ## Get sub-shape indices of theShapeWhere, which is
5527 # equal to \a theShapeWhat.
5528 # @param theShapeWhere Shape to find sub-shape of.
5529 # @param theShapeWhat Shape, specifying what to find.
5530 # @return List of all found sub-shapes indices.
5532 # @ref swig_GetSame "Example"
5533 @ManageTransactions("ShapesOp")
5534 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5536 Get sub-shape indices of theShapeWhere, which is
5537 equal to theShapeWhat.
5540 theShapeWhere Shape to find sub-shape of.
5541 theShapeWhat Shape, specifying what to find.
5544 List of all found sub-shapes indices.
5546 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5547 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5554 ## @addtogroup l4_access
5557 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5558 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5559 # @param aShape Shape to get sub-shape of.
5560 # @param ListOfID List of sub-shapes indices.
5561 # @param theName Object name; when specified, this parameter is used
5562 # for result publication in the study. Otherwise, if automatic
5563 # publication is switched on, default value is used for result name.
5565 # @return Found sub-shape.
5567 # @ref swig_all_decompose "Example"
5568 def GetSubShape(self, aShape, ListOfID, theName=None):
5570 Obtain a composite sub-shape of aShape, composed from sub-shapes
5571 of aShape, selected by their unique IDs inside aShape
5574 aShape Shape to get sub-shape of.
5575 ListOfID List of sub-shapes indices.
5576 theName Object name; when specified, this parameter is used
5577 for result publication in the study. Otherwise, if automatic
5578 publication is switched on, default value is used for result name.
5583 # Example: see GEOM_TestAll.py
5584 anObj = self.AddSubShape(aShape,ListOfID)
5585 self._autoPublish(anObj, theName, "subshape")
5588 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5589 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5590 # @param aShape Shape to get sub-shape of.
5591 # @param aSubShape Sub-shapes of aShape.
5592 # @return ID of found sub-shape.
5594 # @ref swig_all_decompose "Example"
5595 @ManageTransactions("LocalOp")
5596 def GetSubShapeID(self, aShape, aSubShape):
5598 Obtain unique ID of sub-shape aSubShape inside aShape
5599 of aShape, selected by their unique IDs inside aShape
5602 aShape Shape to get sub-shape of.
5603 aSubShape Sub-shapes of aShape.
5606 ID of found sub-shape.
5608 # Example: see GEOM_TestAll.py
5609 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5610 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5613 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5614 # This function is provided for performance purpose. The complexity is O(n) with n
5615 # the number of subobjects of aShape
5616 # @param aShape Shape to get sub-shape of.
5617 # @param aSubShapes Sub-shapes of aShape.
5618 # @return list of IDs of found sub-shapes.
5620 # @ref swig_all_decompose "Example"
5621 @ManageTransactions("ShapesOp")
5622 def GetSubShapesIDs(self, aShape, aSubShapes):
5624 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5625 This function is provided for performance purpose. The complexity is O(n) with n
5626 the number of subobjects of aShape
5629 aShape Shape to get sub-shape of.
5630 aSubShapes Sub-shapes of aShape.
5633 List of IDs of found sub-shape.
5635 # Example: see GEOM_TestAll.py
5636 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5637 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5643 ## @addtogroup l4_decompose
5646 ## Get all sub-shapes and groups of \a theShape,
5647 # that were created already by any other methods.
5648 # @param theShape Any shape.
5649 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5650 # returned, else all found sub-shapes and groups.
5651 # @return List of existing sub-objects of \a theShape.
5653 # @ref swig_all_decompose "Example"
5654 @ManageTransactions("ShapesOp")
5655 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5657 Get all sub-shapes and groups of theShape,
5658 that were created already by any other methods.
5662 theGroupsOnly If this parameter is TRUE, only groups will be
5663 returned, else all found sub-shapes and groups.
5666 List of existing sub-objects of theShape.
5668 # Example: see GEOM_TestAll.py
5669 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5670 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5673 ## Get all groups of \a theShape,
5674 # that were created already by any other methods.
5675 # @param theShape Any shape.
5676 # @return List of existing groups of \a theShape.
5678 # @ref swig_all_decompose "Example"
5679 @ManageTransactions("ShapesOp")
5680 def GetGroups(self, theShape):
5682 Get all groups of theShape,
5683 that were created already by any other methods.
5689 List of existing groups of theShape.
5691 # Example: see GEOM_TestAll.py
5692 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5693 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5696 ## Explode a shape on sub-shapes of a given type.
5697 # If the shape itself matches the type, it is also returned.
5698 # @param aShape Shape to be exploded.
5699 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5700 # @param theName Object name; when specified, this parameter is used
5701 # for result publication in the study. Otherwise, if automatic
5702 # publication is switched on, default value is used for result name.
5704 # @return List of sub-shapes of type theShapeType, contained in theShape.
5706 # @ref swig_all_decompose "Example"
5707 @ManageTransactions("ShapesOp")
5708 def SubShapeAll(self, aShape, aType, theName=None):
5710 Explode a shape on sub-shapes of a given type.
5711 If the shape itself matches the type, it is also returned.
5714 aShape Shape to be exploded.
5715 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5716 theName Object name; when specified, this parameter is used
5717 for result publication in the study. Otherwise, if automatic
5718 publication is switched on, default value is used for result name.
5721 List of sub-shapes of type theShapeType, contained in theShape.
5723 # Example: see GEOM_TestAll.py
5724 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5725 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5726 self._autoPublish(ListObj, theName, "subshape")
5729 ## Explode a shape on sub-shapes of a given type.
5730 # @param aShape Shape to be exploded.
5731 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5732 # @return List of IDs of sub-shapes.
5734 # @ref swig_all_decompose "Example"
5735 @ManageTransactions("ShapesOp")
5736 def SubShapeAllIDs(self, aShape, aType):
5738 Explode a shape on sub-shapes of a given type.
5741 aShape Shape to be exploded (see geompy.ShapeType)
5742 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5745 List of IDs of sub-shapes.
5747 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5748 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5751 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5752 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5753 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5754 # @param aShape Shape to get sub-shape of.
5755 # @param ListOfInd List of sub-shapes indices.
5756 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5757 # @param theName Object name; when specified, this parameter is used
5758 # for result publication in the study. Otherwise, if automatic
5759 # publication is switched on, default value is used for result name.
5761 # @return A compound of sub-shapes of aShape.
5763 # @ref swig_all_decompose "Example"
5764 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5766 Obtain a compound of sub-shapes of aShape,
5767 selected by their indices in list of all sub-shapes of type aType.
5768 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5771 aShape Shape to get sub-shape of.
5772 ListOfID List of sub-shapes indices.
5773 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5774 theName Object name; when specified, this parameter is used
5775 for result publication in the study. Otherwise, if automatic
5776 publication is switched on, default value is used for result name.
5779 A compound of sub-shapes of aShape.
5781 # Example: see GEOM_TestAll.py
5783 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5784 for ind in ListOfInd:
5785 ListOfIDs.append(AllShapeIDsList[ind - 1])
5786 # note: auto-publishing is done in self.GetSubShape()
5787 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5790 ## Explode a shape on sub-shapes of a given type.
5791 # Sub-shapes will be sorted by coordinates of their gravity centers.
5792 # If the shape itself matches the type, it is also returned.
5793 # @param aShape Shape to be exploded.
5794 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5795 # @param theName Object name; when specified, this parameter is used
5796 # for result publication in the study. Otherwise, if automatic
5797 # publication is switched on, default value is used for result name.
5799 # @return List of sub-shapes of type theShapeType, contained in theShape.
5801 # @ref swig_SubShapeAllSorted "Example"
5802 @ManageTransactions("ShapesOp")
5803 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5805 Explode a shape on sub-shapes of a given type.
5806 Sub-shapes will be sorted by coordinates of their gravity centers.
5807 If the shape itself matches the type, it is also returned.
5810 aShape Shape to be exploded.
5811 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5812 theName Object name; when specified, this parameter is used
5813 for result publication in the study. Otherwise, if automatic
5814 publication is switched on, default value is used for result name.
5817 List of sub-shapes of type theShapeType, contained in theShape.
5819 # Example: see GEOM_TestAll.py
5820 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5821 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5822 self._autoPublish(ListObj, theName, "subshape")
5825 ## Explode a shape on sub-shapes of a given type.
5826 # Sub-shapes will be sorted by coordinates of their gravity centers.
5827 # @param aShape Shape to be exploded.
5828 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5829 # @return List of IDs of sub-shapes.
5831 # @ref swig_all_decompose "Example"
5832 @ManageTransactions("ShapesOp")
5833 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5835 Explode a shape on sub-shapes of a given type.
5836 Sub-shapes will be sorted by coordinates of their gravity centers.
5839 aShape Shape to be exploded.
5840 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5843 List of IDs of sub-shapes.
5845 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5846 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5849 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5850 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5851 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5852 # @param aShape Shape to get sub-shape of.
5853 # @param ListOfInd List of sub-shapes indices.
5854 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5855 # @param theName Object name; when specified, this parameter is used
5856 # for result publication in the study. Otherwise, if automatic
5857 # publication is switched on, default value is used for result name.
5859 # @return A compound of sub-shapes of aShape.
5861 # @ref swig_all_decompose "Example"
5862 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5864 Obtain a compound of sub-shapes of aShape,
5865 selected by they indices in sorted list of all sub-shapes of type aType.
5866 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5869 aShape Shape to get sub-shape of.
5870 ListOfID List of sub-shapes indices.
5871 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5872 theName Object name; when specified, this parameter is used
5873 for result publication in the study. Otherwise, if automatic
5874 publication is switched on, default value is used for result name.
5877 A compound of sub-shapes of aShape.
5879 # Example: see GEOM_TestAll.py
5881 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5882 for ind in ListOfInd:
5883 ListOfIDs.append(AllShapeIDsList[ind - 1])
5884 # note: auto-publishing is done in self.GetSubShape()
5885 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5888 ## Extract shapes (excluding the main shape) of given type.
5889 # @param aShape The shape.
5890 # @param aType The shape type (see ShapeType())
5891 # @param isSorted Boolean flag to switch sorting on/off.
5892 # @param theName Object name; when specified, this parameter is used
5893 # for result publication in the study. Otherwise, if automatic
5894 # publication is switched on, default value is used for result name.
5896 # @return List of sub-shapes of type aType, contained in aShape.
5898 # @ref swig_FilletChamfer "Example"
5899 @ManageTransactions("ShapesOp")
5900 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5902 Extract shapes (excluding the main shape) of given type.
5906 aType The shape type (see geompy.ShapeType)
5907 isSorted Boolean flag to switch sorting on/off.
5908 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.
5913 List of sub-shapes of type aType, contained in aShape.
5915 # Example: see GEOM_TestAll.py
5916 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5917 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5918 self._autoPublish(ListObj, theName, "subshape")
5921 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5922 # @param aShape Main shape.
5923 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5924 # @param theName Object name; when specified, this parameter is used
5925 # for result publication in the study. Otherwise, if automatic
5926 # publication is switched on, default value is used for result name.
5927 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5929 # @ref swig_all_decompose "Example"
5930 @ManageTransactions("ShapesOp")
5931 def SubShapes(self, aShape, anIDs, theName=None):
5933 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5937 anIDs List of unique IDs of sub-shapes inside theMainShape.
5938 theName Object name; when specified, this parameter is used
5939 for result publication in the study. Otherwise, if automatic
5940 publication is switched on, default value is used for result name.
5943 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5945 # Example: see GEOM_TestAll.py
5946 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5947 RaiseIfFailed("SubShapes", self.ShapesOp)
5948 self._autoPublish(ListObj, theName, "subshape")
5951 # end of l4_decompose
5954 ## @addtogroup l4_decompose_d
5957 ## Deprecated method
5958 # It works like SubShapeAllSortedCentres(), but wrongly
5959 # defines centres of faces, shells and solids.
5960 @ManageTransactions("ShapesOp")
5961 def SubShapeAllSorted(self, aShape, aType, theName=None):
5964 It works like geompy.SubShapeAllSortedCentres, but wrongly
5965 defines centres of faces, shells and solids.
5967 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5968 RaiseIfFailed("MakeExplode", self.ShapesOp)
5969 self._autoPublish(ListObj, theName, "subshape")
5972 ## Deprecated method
5973 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5974 # defines centres of faces, shells and solids.
5975 @ManageTransactions("ShapesOp")
5976 def SubShapeAllSortedIDs(self, aShape, aType):
5979 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5980 defines centres of faces, shells and solids.
5982 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5983 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5986 ## Deprecated method
5987 # It works like SubShapeSortedCentres(), but has a bug
5988 # (wrongly defines centres of faces, shells and solids).
5989 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5992 It works like geompy.SubShapeSortedCentres, but has a bug
5993 (wrongly defines centres of faces, shells and solids).
5996 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5997 for ind in ListOfInd:
5998 ListOfIDs.append(AllShapeIDsList[ind - 1])
5999 # note: auto-publishing is done in self.GetSubShape()
6000 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6003 # end of l4_decompose_d
6006 ## @addtogroup l3_healing
6009 ## Apply a sequence of Shape Healing operators to the given object.
6010 # @param theShape Shape to be processed.
6011 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6012 # @param theParameters List of names of parameters
6013 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6014 # @param theValues List of values of parameters, in the same order
6015 # as parameters are listed in <VAR>theParameters</VAR> list.
6016 # @param theName Object name; when specified, this parameter is used
6017 # for result publication in the study. Otherwise, if automatic
6018 # publication is switched on, default value is used for result name.
6020 # <b> Operators and Parameters: </b> \n
6022 # * \b FixShape - corrects invalid shapes. \n
6023 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6024 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6026 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6027 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6028 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6029 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6031 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6032 # surfaces in segments using a certain angle. \n
6033 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6034 # if Angle=180, four if Angle=90, etc). \n
6035 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6037 # * \b SplitClosedFaces - splits closed faces in segments.
6038 # The number of segments depends on the number of splitting points.\n
6039 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6041 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6042 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6043 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6044 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6045 # This and the previous parameters can take the following values:\n
6046 # \b Parametric \b Continuity \n
6047 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6048 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6049 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6050 # ruling out sharp edges).\n
6051 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6052 # are of the same magnitude).\n
6053 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6054 # or surfaces (d/du C(u)) are the same at junction. \n
6055 # \b Geometric \b Continuity \n
6056 # \b G1: first derivatives are proportional at junction.\n
6057 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6058 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6059 # \b G2: first and second derivatives are proportional at junction.
6060 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6061 # continuity requires that the underlying parameterization was continuous as well.
6062 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6064 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6065 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6066 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6067 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6068 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6069 # with the specified parameters.\n
6070 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6071 # with the specified parameters.\n
6072 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6073 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6074 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6075 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6077 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6078 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6079 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6080 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6081 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6083 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6084 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6087 # @return New GEOM.GEOM_Object, containing processed shape.
6089 # \n @ref tui_shape_processing "Example"
6090 @ManageTransactions("HealOp")
6091 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6093 Apply a sequence of Shape Healing operators to the given object.
6096 theShape Shape to be processed.
6097 theValues List of values of parameters, in the same order
6098 as parameters are listed in theParameters list.
6099 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6100 theParameters List of names of parameters
6101 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6102 theName Object name; when specified, this parameter is used
6103 for result publication in the study. Otherwise, if automatic
6104 publication is switched on, default value is used for result name.
6106 Operators and Parameters:
6108 * FixShape - corrects invalid shapes.
6109 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6110 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6111 * FixFaceSize - removes small faces, such as spots and strips.
6112 * FixFaceSize.Tolerance - defines minimum possible face size.
6113 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6114 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6115 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6116 in segments using a certain angle.
6117 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6118 if Angle=180, four if Angle=90, etc).
6119 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6120 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6122 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6123 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6124 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6125 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6126 * SplitContinuity.CurveContinuity - required continuity for curves.
6127 This and the previous parameters can take the following values:
6129 Parametric Continuity:
6130 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6131 coincidental. The curves or surfaces may still meet at an angle,
6132 giving rise to a sharp corner or edge).
6133 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6134 are parallel, ruling out sharp edges).
6135 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6136 or surfaces are of the same magnitude).
6137 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6138 curves or surfaces (d/du C(u)) are the same at junction.
6140 Geometric Continuity:
6141 G1: first derivatives are proportional at junction.
6142 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6143 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6144 G2: first and second derivatives are proportional at junction. As the names imply,
6145 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6146 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6147 geometric continuity of order n, but not vice-versa.
6148 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6149 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6150 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6151 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6152 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6153 the specified parameters.
6154 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6155 the specified parameters.
6156 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6157 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6158 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6159 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6160 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6161 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6162 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6163 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6164 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6165 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6166 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6169 New GEOM.GEOM_Object, containing processed shape.
6171 Note: For more information look through SALOME Geometry User's Guide->
6172 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6174 # Example: see GEOM_TestHealing.py
6175 theValues,Parameters = ParseList(theValues)
6176 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6177 # To avoid script failure in case of good argument shape
6178 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6180 RaiseIfFailed("ProcessShape", self.HealOp)
6181 for string in (theOperators + theParameters):
6182 Parameters = ":" + Parameters
6184 anObj.SetParameters(Parameters)
6185 self._autoPublish(anObj, theName, "healed")
6188 ## Remove faces from the given object (shape).
6189 # @param theObject Shape to be processed.
6190 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6191 # removes ALL faces of the given object.
6192 # @param theName Object name; when specified, this parameter is used
6193 # for result publication in the study. Otherwise, if automatic
6194 # publication is switched on, default value is used for result name.
6196 # @return New GEOM.GEOM_Object, containing processed shape.
6198 # @ref tui_suppress_faces "Example"
6199 @ManageTransactions("HealOp")
6200 def SuppressFaces(self, theObject, theFaces, theName=None):
6202 Remove faces from the given object (shape).
6205 theObject Shape to be processed.
6206 theFaces Indices of faces to be removed, if EMPTY then the method
6207 removes ALL faces of the given object.
6208 theName Object name; when specified, this parameter is used
6209 for result publication in the study. Otherwise, if automatic
6210 publication is switched on, default value is used for result name.
6213 New GEOM.GEOM_Object, containing processed shape.
6215 # Example: see GEOM_TestHealing.py
6216 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6217 RaiseIfFailed("SuppressFaces", self.HealOp)
6218 self._autoPublish(anObj, theName, "suppressFaces")
6221 ## Sewing of some shapes into single shape.
6222 # @param ListShape Shapes to be processed.
6223 # @param theTolerance Required tolerance value.
6224 # @param AllowNonManifold Flag that allows non-manifold sewing.
6225 # @param theName Object name; when specified, this parameter is used
6226 # for result publication in the study. Otherwise, if automatic
6227 # publication is switched on, default value is used for result name.
6229 # @return New GEOM.GEOM_Object, containing processed shape.
6231 # @ref tui_sewing "Example"
6232 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6234 Sewing of some shapes into single shape.
6237 ListShape Shapes to be processed.
6238 theTolerance Required tolerance value.
6239 AllowNonManifold Flag that allows non-manifold sewing.
6240 theName Object name; when specified, this parameter is used
6241 for result publication in the study. Otherwise, if automatic
6242 publication is switched on, default value is used for result name.
6245 New GEOM.GEOM_Object, containing processed shape.
6247 # Example: see GEOM_TestHealing.py
6248 comp = self.MakeCompound(ListShape)
6249 # note: auto-publishing is done in self.Sew()
6250 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6253 ## Sewing of the given object.
6254 # @param theObject Shape to be processed.
6255 # @param theTolerance Required tolerance value.
6256 # @param AllowNonManifold Flag that allows non-manifold sewing.
6257 # @param theName Object name; when specified, this parameter is used
6258 # for result publication in the study. Otherwise, if automatic
6259 # publication is switched on, default value is used for result name.
6261 # @return New GEOM.GEOM_Object, containing processed shape.
6262 @ManageTransactions("HealOp")
6263 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6265 Sewing of the given object.
6268 theObject Shape to be processed.
6269 theTolerance Required tolerance value.
6270 AllowNonManifold Flag that allows non-manifold sewing.
6271 theName Object name; when specified, this parameter is used
6272 for result publication in the study. Otherwise, if automatic
6273 publication is switched on, default value is used for result name.
6276 New GEOM.GEOM_Object, containing processed shape.
6278 # Example: see MakeSewing() above
6279 theTolerance,Parameters = ParseParameters(theTolerance)
6280 if AllowNonManifold:
6281 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6283 anObj = self.HealOp.Sew(theObject, theTolerance)
6284 # To avoid script failure in case of good argument shape
6285 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6287 RaiseIfFailed("Sew", self.HealOp)
6288 anObj.SetParameters(Parameters)
6289 self._autoPublish(anObj, theName, "sewed")
6292 ## Rebuild the topology of theCompound of solids by removing
6293 # of the faces that are shared by several solids.
6294 # @param theCompound Shape to be processed.
6295 # @param theName Object name; when specified, this parameter is used
6296 # for result publication in the study. Otherwise, if automatic
6297 # publication is switched on, default value is used for result name.
6299 # @return New GEOM.GEOM_Object, containing processed shape.
6301 # @ref tui_remove_webs "Example"
6302 @ManageTransactions("HealOp")
6303 def RemoveInternalFaces (self, theCompound, theName=None):
6305 Rebuild the topology of theCompound of solids by removing
6306 of the faces that are shared by several solids.
6309 theCompound Shape to be processed.
6310 theName Object name; when specified, this parameter is used
6311 for result publication in the study. Otherwise, if automatic
6312 publication is switched on, default value is used for result name.
6315 New GEOM.GEOM_Object, containing processed shape.
6317 # Example: see GEOM_TestHealing.py
6318 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6319 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6320 self._autoPublish(anObj, theName, "removeWebs")
6323 ## Remove internal wires and edges from the given object (face).
6324 # @param theObject Shape to be processed.
6325 # @param theWires Indices of wires to be removed, if EMPTY then the method
6326 # removes ALL internal wires of the given object.
6327 # @param theName Object name; when specified, this parameter is used
6328 # for result publication in the study. Otherwise, if automatic
6329 # publication is switched on, default value is used for result name.
6331 # @return New GEOM.GEOM_Object, containing processed shape.
6333 # @ref tui_suppress_internal_wires "Example"
6334 @ManageTransactions("HealOp")
6335 def SuppressInternalWires(self, theObject, theWires, theName=None):
6337 Remove internal wires and edges from the given object (face).
6340 theObject Shape to be processed.
6341 theWires Indices of wires to be removed, if EMPTY then the method
6342 removes ALL internal wires of the given object.
6343 theName Object name; when specified, this parameter is used
6344 for result publication in the study. Otherwise, if automatic
6345 publication is switched on, default value is used for result name.
6348 New GEOM.GEOM_Object, containing processed shape.
6350 # Example: see GEOM_TestHealing.py
6351 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6352 RaiseIfFailed("RemoveIntWires", self.HealOp)
6353 self._autoPublish(anObj, theName, "suppressWires")
6356 ## Remove internal closed contours (holes) from the given object.
6357 # @param theObject Shape to be processed.
6358 # @param theWires Indices of wires to be removed, if EMPTY then the method
6359 # removes ALL internal holes of the given object
6360 # @param theName Object name; when specified, this parameter is used
6361 # for result publication in the study. Otherwise, if automatic
6362 # publication is switched on, default value is used for result name.
6364 # @return New GEOM.GEOM_Object, containing processed shape.
6366 # @ref tui_suppress_holes "Example"
6367 @ManageTransactions("HealOp")
6368 def SuppressHoles(self, theObject, theWires, theName=None):
6370 Remove internal closed contours (holes) from the given object.
6373 theObject Shape to be processed.
6374 theWires Indices of wires to be removed, if EMPTY then the method
6375 removes ALL internal holes of the given object
6376 theName Object name; when specified, this parameter is used
6377 for result publication in the study. Otherwise, if automatic
6378 publication is switched on, default value is used for result name.
6381 New GEOM.GEOM_Object, containing processed shape.
6383 # Example: see GEOM_TestHealing.py
6384 anObj = self.HealOp.FillHoles(theObject, theWires)
6385 RaiseIfFailed("FillHoles", self.HealOp)
6386 self._autoPublish(anObj, theName, "suppressHoles")
6389 ## Close an open wire.
6390 # @param theObject Shape to be processed.
6391 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6392 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6393 # @param isCommonVertex If True : closure by creation of a common vertex,
6394 # If False : closure by creation of an edge between ends.
6395 # @param theName Object name; when specified, this parameter is used
6396 # for result publication in the study. Otherwise, if automatic
6397 # publication is switched on, default value is used for result name.
6399 # @return New GEOM.GEOM_Object, containing processed shape.
6401 # @ref tui_close_contour "Example"
6402 @ManageTransactions("HealOp")
6403 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6408 theObject Shape to be processed.
6409 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6410 if [ ], then theObject itself is a wire.
6411 isCommonVertex If True : closure by creation of a common vertex,
6412 If False : closure by creation of an edge between ends.
6413 theName Object name; when specified, this parameter is used
6414 for result publication in the study. Otherwise, if automatic
6415 publication is switched on, default value is used for result name.
6418 New GEOM.GEOM_Object, containing processed shape.
6420 # Example: see GEOM_TestHealing.py
6421 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6422 RaiseIfFailed("CloseContour", self.HealOp)
6423 self._autoPublish(anObj, theName, "closeContour")
6426 ## Addition of a point to a given edge object.
6427 # @param theObject Shape to be processed.
6428 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6429 # if -1, then theObject itself is the edge.
6430 # @param theValue Value of parameter on edge or length parameter,
6431 # depending on \a isByParameter.
6432 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6433 # if FALSE : \a theValue is treated as a length parameter [0..1]
6434 # @param theName Object name; when specified, this parameter is used
6435 # for result publication in the study. Otherwise, if automatic
6436 # publication is switched on, default value is used for result name.
6438 # @return New GEOM.GEOM_Object, containing processed shape.
6440 # @ref tui_add_point_on_edge "Example"
6441 @ManageTransactions("HealOp")
6442 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6444 Addition of a point to a given edge object.
6447 theObject Shape to be processed.
6448 theEdgeIndex Index of edge to be divided within theObject's shape,
6449 if -1, then theObject itself is the edge.
6450 theValue Value of parameter on edge or length parameter,
6451 depending on isByParameter.
6452 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6453 if FALSE : theValue is treated as a length parameter [0..1]
6454 theName Object name; when specified, this parameter is used
6455 for result publication in the study. Otherwise, if automatic
6456 publication is switched on, default value is used for result name.
6459 New GEOM.GEOM_Object, containing processed shape.
6461 # Example: see GEOM_TestHealing.py
6462 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6463 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6464 RaiseIfFailed("DivideEdge", self.HealOp)
6465 anObj.SetParameters(Parameters)
6466 self._autoPublish(anObj, theName, "divideEdge")
6469 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6470 # @param theWire Wire to minimize the number of C1 continuous edges in.
6471 # @param theVertices A list of vertices to suppress. If the list
6472 # is empty, all vertices in a wire will be assumed.
6473 # @param theName Object name; when specified, this parameter is used
6474 # for result publication in the study. Otherwise, if automatic
6475 # publication is switched on, default value is used for result name.
6477 # @return New GEOM.GEOM_Object with modified wire.
6479 # @ref tui_fuse_collinear_edges "Example"
6480 @ManageTransactions("HealOp")
6481 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6483 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6486 theWire Wire to minimize the number of C1 continuous edges in.
6487 theVertices A list of vertices to suppress. If the list
6488 is empty, all vertices in a wire will be assumed.
6489 theName Object name; when specified, this parameter is used
6490 for result publication in the study. Otherwise, if automatic
6491 publication is switched on, default value is used for result name.
6494 New GEOM.GEOM_Object with modified wire.
6496 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6497 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6498 self._autoPublish(anObj, theName, "fuseEdges")
6501 ## Change orientation of the given object. Updates given shape.
6502 # @param theObject Shape to be processed.
6503 # @return Updated <var>theObject</var>
6505 # @ref swig_todo "Example"
6506 @ManageTransactions("HealOp")
6507 def ChangeOrientationShell(self,theObject):
6509 Change orientation of the given object. Updates given shape.
6512 theObject Shape to be processed.
6517 theObject = self.HealOp.ChangeOrientation(theObject)
6518 RaiseIfFailed("ChangeOrientation", self.HealOp)
6521 ## Change orientation of the given object.
6522 # @param theObject Shape to be processed.
6523 # @param theName Object name; when specified, this parameter is used
6524 # for result publication in the study. Otherwise, if automatic
6525 # publication is switched on, default value is used for result name.
6527 # @return New GEOM.GEOM_Object, containing processed shape.
6529 # @ref swig_todo "Example"
6530 @ManageTransactions("HealOp")
6531 def ChangeOrientationShellCopy(self, theObject, theName=None):
6533 Change orientation of the given object.
6536 theObject Shape to be processed.
6537 theName Object name; when specified, this parameter is used
6538 for result publication in the study. Otherwise, if automatic
6539 publication is switched on, default value is used for result name.
6542 New GEOM.GEOM_Object, containing processed shape.
6544 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6545 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6546 self._autoPublish(anObj, theName, "reversed")
6549 ## Try to limit tolerance of the given object by value \a theTolerance.
6550 # @param theObject Shape to be processed.
6551 # @param theTolerance Required tolerance value.
6552 # @param theName Object name; when specified, this parameter is used
6553 # for result publication in the study. Otherwise, if automatic
6554 # publication is switched on, default value is used for result name.
6556 # @return New GEOM.GEOM_Object, containing processed shape.
6558 # @ref tui_limit_tolerance "Example"
6559 @ManageTransactions("HealOp")
6560 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6562 Try to limit tolerance of the given object by value theTolerance.
6565 theObject Shape to be processed.
6566 theTolerance Required tolerance value.
6567 theName Object name; when specified, this parameter is used
6568 for result publication in the study. Otherwise, if automatic
6569 publication is switched on, default value is used for result name.
6572 New GEOM.GEOM_Object, containing processed shape.
6574 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6575 RaiseIfFailed("LimitTolerance", self.HealOp)
6576 self._autoPublish(anObj, theName, "limitTolerance")
6579 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6580 # that constitute a free boundary of the given shape.
6581 # @param theObject Shape to get free boundary of.
6582 # @param theName Object name; when specified, this parameter is used
6583 # for result publication in the study. Otherwise, if automatic
6584 # publication is switched on, default value is used for result name.
6586 # @return [\a status, \a theClosedWires, \a theOpenWires]
6587 # \n \a status: FALSE, if an error(s) occured during the method execution.
6588 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6589 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6591 # @ref tui_measurement_tools_page "Example"
6592 @ManageTransactions("HealOp")
6593 def GetFreeBoundary(self, theObject, theName=None):
6595 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6596 that constitute a free boundary of the given shape.
6599 theObject Shape to get free boundary of.
6600 theName Object name; when specified, this parameter is used
6601 for result publication in the study. Otherwise, if automatic
6602 publication is switched on, default value is used for result name.
6605 [status, theClosedWires, theOpenWires]
6606 status: FALSE, if an error(s) occured during the method execution.
6607 theClosedWires: Closed wires on the free boundary of the given shape.
6608 theOpenWires: Open wires on the free boundary of the given shape.
6610 # Example: see GEOM_TestHealing.py
6611 anObj = self.HealOp.GetFreeBoundary(theObject)
6612 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6613 self._autoPublish(anObj[1], theName, "closedWire")
6614 self._autoPublish(anObj[2], theName, "openWire")
6617 ## Replace coincident faces in theShape by one face.
6618 # @param theShape Initial shape.
6619 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6620 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6621 # otherwise all initial shapes.
6622 # @param theName Object name; when specified, this parameter is used
6623 # for result publication in the study. Otherwise, if automatic
6624 # publication is switched on, default value is used for result name.
6626 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6628 # @ref tui_glue_faces "Example"
6629 @ManageTransactions("ShapesOp")
6630 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6632 Replace coincident faces in theShape by one face.
6635 theShape Initial shape.
6636 theTolerance Maximum distance between faces, which can be considered as coincident.
6637 doKeepNonSolids If FALSE, only solids will present in the result,
6638 otherwise all initial shapes.
6639 theName Object name; when specified, this parameter is used
6640 for result publication in the study. Otherwise, if automatic
6641 publication is switched on, default value is used for result name.
6644 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6646 # Example: see GEOM_Spanner.py
6647 theTolerance,Parameters = ParseParameters(theTolerance)
6648 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6650 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6651 anObj.SetParameters(Parameters)
6652 self._autoPublish(anObj, theName, "glueFaces")
6655 ## Find coincident faces in theShape for possible gluing.
6656 # @param theShape Initial shape.
6657 # @param theTolerance Maximum distance between faces,
6658 # which can be considered as coincident.
6659 # @param theName Object name; when specified, this parameter is used
6660 # for result publication in the study. Otherwise, if automatic
6661 # publication is switched on, default value is used for result name.
6663 # @return GEOM.ListOfGO
6665 # @ref tui_glue_faces "Example"
6666 @ManageTransactions("ShapesOp")
6667 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6669 Find coincident faces in theShape for possible gluing.
6672 theShape Initial shape.
6673 theTolerance Maximum distance between faces,
6674 which can be considered as coincident.
6675 theName Object name; when specified, this parameter is used
6676 for result publication in the study. Otherwise, if automatic
6677 publication is switched on, default value is used for result name.
6682 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6683 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6684 self._autoPublish(anObj, theName, "facesToGlue")
6687 ## Replace coincident faces in theShape by one face
6688 # in compliance with given list of faces
6689 # @param theShape Initial shape.
6690 # @param theTolerance Maximum distance between faces,
6691 # which can be considered as coincident.
6692 # @param theFaces List of faces for gluing.
6693 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6694 # otherwise all initial shapes.
6695 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6696 # will be glued, otherwise only the edges,
6697 # belonging to <VAR>theFaces</VAR>.
6698 # @param theName Object name; when specified, this parameter is used
6699 # for result publication in the study. Otherwise, if automatic
6700 # publication is switched on, default value is used for result name.
6702 # @return New GEOM.GEOM_Object, containing a copy of theShape
6703 # without some faces.
6705 # @ref tui_glue_faces "Example"
6706 @ManageTransactions("ShapesOp")
6707 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6708 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6710 Replace coincident faces in theShape by one face
6711 in compliance with given list of faces
6714 theShape Initial shape.
6715 theTolerance Maximum distance between faces,
6716 which can be considered as coincident.
6717 theFaces List of faces for gluing.
6718 doKeepNonSolids If FALSE, only solids will present in the result,
6719 otherwise all initial shapes.
6720 doGlueAllEdges If TRUE, all coincident edges of theShape
6721 will be glued, otherwise only the edges,
6722 belonging to theFaces.
6723 theName Object name; when specified, this parameter is used
6724 for result publication in the study. Otherwise, if automatic
6725 publication is switched on, default value is used for result name.
6728 New GEOM.GEOM_Object, containing a copy of theShape
6731 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6732 doKeepNonSolids, doGlueAllEdges)
6734 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6735 self._autoPublish(anObj, theName, "glueFaces")
6738 ## Replace coincident edges in theShape by one edge.
6739 # @param theShape Initial shape.
6740 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6741 # @param theName Object name; when specified, this parameter is used
6742 # for result publication in the study. Otherwise, if automatic
6743 # publication is switched on, default value is used for result name.
6745 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6747 # @ref tui_glue_edges "Example"
6748 @ManageTransactions("ShapesOp")
6749 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6751 Replace coincident edges in theShape by one edge.
6754 theShape Initial shape.
6755 theTolerance Maximum distance between edges, which can be considered as coincident.
6756 theName Object name; when specified, this parameter is used
6757 for result publication in the study. Otherwise, if automatic
6758 publication is switched on, default value is used for result name.
6761 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6763 theTolerance,Parameters = ParseParameters(theTolerance)
6764 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6766 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6767 anObj.SetParameters(Parameters)
6768 self._autoPublish(anObj, theName, "glueEdges")
6771 ## Find coincident edges in theShape for possible gluing.
6772 # @param theShape Initial shape.
6773 # @param theTolerance Maximum distance between edges,
6774 # which can be considered as coincident.
6775 # @param theName Object name; when specified, this parameter is used
6776 # for result publication in the study. Otherwise, if automatic
6777 # publication is switched on, default value is used for result name.
6779 # @return GEOM.ListOfGO
6781 # @ref tui_glue_edges "Example"
6782 @ManageTransactions("ShapesOp")
6783 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6785 Find coincident edges in theShape for possible gluing.
6788 theShape Initial shape.
6789 theTolerance Maximum distance between edges,
6790 which can be considered as coincident.
6791 theName Object name; when specified, this parameter is used
6792 for result publication in the study. Otherwise, if automatic
6793 publication is switched on, default value is used for result name.
6798 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6799 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6800 self._autoPublish(anObj, theName, "edgesToGlue")
6803 ## Replace coincident edges in theShape by one edge
6804 # in compliance with given list of edges.
6805 # @param theShape Initial shape.
6806 # @param theTolerance Maximum distance between edges,
6807 # which can be considered as coincident.
6808 # @param theEdges List of edges for gluing.
6809 # @param theName Object name; when specified, this parameter is used
6810 # for result publication in the study. Otherwise, if automatic
6811 # publication is switched on, default value is used for result name.
6813 # @return New GEOM.GEOM_Object, containing a copy of theShape
6814 # without some edges.
6816 # @ref tui_glue_edges "Example"
6817 @ManageTransactions("ShapesOp")
6818 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6820 Replace coincident edges in theShape by one edge
6821 in compliance with given list of edges.
6824 theShape Initial shape.
6825 theTolerance Maximum distance between edges,
6826 which can be considered as coincident.
6827 theEdges List of edges for gluing.
6828 theName Object name; when specified, this parameter is used
6829 for result publication in the study. Otherwise, if automatic
6830 publication is switched on, default value is used for result name.
6833 New GEOM.GEOM_Object, containing a copy of theShape
6836 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6838 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6839 self._autoPublish(anObj, theName, "glueEdges")
6845 ## @addtogroup l3_boolean Boolean Operations
6848 # -----------------------------------------------------------------------------
6849 # Boolean (Common, Cut, Fuse, Section)
6850 # -----------------------------------------------------------------------------
6852 ## Perform one of boolean operations on two given shapes.
6853 # @param theShape1 First argument for boolean operation.
6854 # @param theShape2 Second argument for boolean operation.
6855 # @param theOperation Indicates the operation to be done:\n
6856 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6857 # @param checkSelfInte The flag that tells if the arguments should
6858 # be checked for self-intersection prior to the operation.
6859 # @param theName Object name; when specified, this parameter is used
6860 # for result publication in the study. Otherwise, if automatic
6861 # publication is switched on, default value is used for result name.
6863 # @note This algorithm doesn't find all types of self-intersections.
6864 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6865 # vertex/face and edge/face intersections. Face/face
6866 # intersections detection is switched off as it is a
6867 # time-consuming operation that gives an impact on performance.
6868 # To find all self-intersections please use
6869 # CheckSelfIntersections() method.
6871 # @return New GEOM.GEOM_Object, containing the result shape.
6873 # @ref tui_fuse "Example"
6874 @ManageTransactions("BoolOp")
6875 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6877 Perform one of boolean operations on two given shapes.
6880 theShape1 First argument for boolean operation.
6881 theShape2 Second argument for boolean operation.
6882 theOperation Indicates the operation to be done:
6883 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6884 checkSelfInte The flag that tells if the arguments should
6885 be checked for self-intersection prior to
6887 theName Object name; when specified, this parameter is used
6888 for result publication in the study. Otherwise, if automatic
6889 publication is switched on, default value is used for result name.
6892 This algorithm doesn't find all types of self-intersections.
6893 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6894 vertex/face and edge/face intersections. Face/face
6895 intersections detection is switched off as it is a
6896 time-consuming operation that gives an impact on performance.
6897 To find all self-intersections please use
6898 CheckSelfIntersections() method.
6901 New GEOM.GEOM_Object, containing the result shape.
6903 # Example: see GEOM_TestAll.py
6904 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6905 RaiseIfFailed("MakeBoolean", self.BoolOp)
6906 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6907 self._autoPublish(anObj, theName, def_names[theOperation])
6910 ## Perform Common boolean operation on two given shapes.
6911 # @param theShape1 First argument for boolean operation.
6912 # @param theShape2 Second argument for boolean operation.
6913 # @param checkSelfInte The flag that tells if the arguments should
6914 # be checked for self-intersection prior to the operation.
6915 # @param theName Object name; when specified, this parameter is used
6916 # for result publication in the study. Otherwise, if automatic
6917 # publication is switched on, default value is used for result name.
6919 # @note This algorithm doesn't find all types of self-intersections.
6920 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6921 # vertex/face and edge/face intersections. Face/face
6922 # intersections detection is switched off as it is a
6923 # time-consuming operation that gives an impact on performance.
6924 # To find all self-intersections please use
6925 # CheckSelfIntersections() method.
6927 # @return New GEOM.GEOM_Object, containing the result shape.
6929 # @ref tui_common "Example 1"
6930 # \n @ref swig_MakeCommon "Example 2"
6931 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6933 Perform Common boolean operation on two given shapes.
6936 theShape1 First argument for boolean operation.
6937 theShape2 Second argument for boolean operation.
6938 checkSelfInte The flag that tells if the arguments should
6939 be checked for self-intersection prior to
6941 theName Object name; when specified, this parameter is used
6942 for result publication in the study. Otherwise, if automatic
6943 publication is switched on, default value is used for result name.
6946 This algorithm doesn't find all types of self-intersections.
6947 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6948 vertex/face and edge/face intersections. Face/face
6949 intersections detection is switched off as it is a
6950 time-consuming operation that gives an impact on performance.
6951 To find all self-intersections please use
6952 CheckSelfIntersections() method.
6955 New GEOM.GEOM_Object, containing the result shape.
6957 # Example: see GEOM_TestOthers.py
6958 # note: auto-publishing is done in self.MakeBoolean()
6959 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
6961 ## Perform Cut boolean operation on two given shapes.
6962 # @param theShape1 First argument for boolean operation.
6963 # @param theShape2 Second argument for boolean operation.
6964 # @param checkSelfInte The flag that tells if the arguments should
6965 # be checked for self-intersection prior to the operation.
6966 # @param theName Object name; when specified, this parameter is used
6967 # for result publication in the study. Otherwise, if automatic
6968 # publication is switched on, default value is used for result name.
6970 # @note This algorithm doesn't find all types of self-intersections.
6971 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6972 # vertex/face and edge/face intersections. Face/face
6973 # intersections detection is switched off as it is a
6974 # time-consuming operation that gives an impact on performance.
6975 # To find all self-intersections please use
6976 # CheckSelfIntersections() method.
6978 # @return New GEOM.GEOM_Object, containing the result shape.
6980 # @ref tui_cut "Example 1"
6981 # \n @ref swig_MakeCommon "Example 2"
6982 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6984 Perform Cut boolean operation on two given shapes.
6987 theShape1 First argument for boolean operation.
6988 theShape2 Second argument for boolean operation.
6989 checkSelfInte The flag that tells if the arguments should
6990 be checked for self-intersection prior to
6992 theName Object name; when specified, this parameter is used
6993 for result publication in the study. Otherwise, if automatic
6994 publication is switched on, default value is used for result name.
6997 This algorithm doesn't find all types of self-intersections.
6998 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6999 vertex/face and edge/face intersections. Face/face
7000 intersections detection is switched off as it is a
7001 time-consuming operation that gives an impact on performance.
7002 To find all self-intersections please use
7003 CheckSelfIntersections() method.
7006 New GEOM.GEOM_Object, containing the result shape.
7009 # Example: see GEOM_TestOthers.py
7010 # note: auto-publishing is done in self.MakeBoolean()
7011 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7013 ## Perform Fuse boolean operation on two given shapes.
7014 # @param theShape1 First argument for boolean operation.
7015 # @param theShape2 Second argument for boolean operation.
7016 # @param checkSelfInte The flag that tells if the arguments should
7017 # be checked for self-intersection prior to the operation.
7018 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7019 # operation should be performed during the operation.
7020 # @param theName Object name; when specified, this parameter is used
7021 # for result publication in the study. Otherwise, if automatic
7022 # publication is switched on, default value is used for result name.
7024 # @note This algorithm doesn't find all types of self-intersections.
7025 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7026 # vertex/face and edge/face intersections. Face/face
7027 # intersections detection is switched off as it is a
7028 # time-consuming operation that gives an impact on performance.
7029 # To find all self-intersections please use
7030 # CheckSelfIntersections() method.
7032 # @return New GEOM.GEOM_Object, containing the result shape.
7034 # @ref tui_fuse "Example 1"
7035 # \n @ref swig_MakeCommon "Example 2"
7036 @ManageTransactions("BoolOp")
7037 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7038 rmExtraEdges=False, theName=None):
7040 Perform Fuse boolean operation on two given shapes.
7043 theShape1 First argument for boolean operation.
7044 theShape2 Second argument for boolean operation.
7045 checkSelfInte The flag that tells if the arguments should
7046 be checked for self-intersection prior to
7048 rmExtraEdges The flag that tells if Remove Extra Edges
7049 operation should be performed during the operation.
7050 theName Object name; when specified, this parameter is used
7051 for result publication in the study. Otherwise, if automatic
7052 publication is switched on, default value is used for result name.
7055 This algorithm doesn't find all types of self-intersections.
7056 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7057 vertex/face and edge/face intersections. Face/face
7058 intersections detection is switched off as it is a
7059 time-consuming operation that gives an impact on performance.
7060 To find all self-intersections please use
7061 CheckSelfIntersections() method.
7064 New GEOM.GEOM_Object, containing the result shape.
7067 # Example: see GEOM_TestOthers.py
7068 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7069 checkSelfInte, rmExtraEdges)
7070 RaiseIfFailed("MakeFuse", self.BoolOp)
7071 self._autoPublish(anObj, theName, "fuse")
7074 ## Perform Section boolean operation on two given shapes.
7075 # @param theShape1 First argument for boolean operation.
7076 # @param theShape2 Second argument for boolean operation.
7077 # @param checkSelfInte The flag that tells if the arguments should
7078 # be checked for self-intersection prior to the operation.
7079 # @param theName Object name; when specified, this parameter is used
7080 # for result publication in the study. Otherwise, if automatic
7081 # publication is switched on, default value is used for result name.
7083 # @note This algorithm doesn't find all types of self-intersections.
7084 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7085 # vertex/face and edge/face intersections. Face/face
7086 # intersections detection is switched off as it is a
7087 # time-consuming operation that gives an impact on performance.
7088 # To find all self-intersections please use
7089 # CheckSelfIntersections() method.
7091 # @return New GEOM.GEOM_Object, containing the result shape.
7093 # @ref tui_section "Example 1"
7094 # \n @ref swig_MakeCommon "Example 2"
7095 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7097 Perform Section boolean operation on two given shapes.
7100 theShape1 First argument for boolean operation.
7101 theShape2 Second argument for boolean operation.
7102 checkSelfInte The flag that tells if the arguments should
7103 be checked for self-intersection prior to
7105 theName Object name; when specified, this parameter is used
7106 for result publication in the study. Otherwise, if automatic
7107 publication is switched on, default value is used for result name.
7110 This algorithm doesn't find all types of self-intersections.
7111 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7112 vertex/face and edge/face intersections. Face/face
7113 intersections detection is switched off as it is a
7114 time-consuming operation that gives an impact on performance.
7115 To find all self-intersections please use
7116 CheckSelfIntersections() method.
7119 New GEOM.GEOM_Object, containing the result shape.
7122 # Example: see GEOM_TestOthers.py
7123 # note: auto-publishing is done in self.MakeBoolean()
7124 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7126 ## Perform Fuse boolean operation on the list of shapes.
7127 # @param theShapesList Shapes to be fused.
7128 # @param checkSelfInte The flag that tells if the arguments should
7129 # be checked for self-intersection prior to the operation.
7130 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7131 # operation should be performed during the operation.
7132 # @param theName Object name; when specified, this parameter is used
7133 # for result publication in the study. Otherwise, if automatic
7134 # publication is switched on, default value is used for result name.
7136 # @note This algorithm doesn't find all types of self-intersections.
7137 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7138 # vertex/face and edge/face intersections. Face/face
7139 # intersections detection is switched off as it is a
7140 # time-consuming operation that gives an impact on performance.
7141 # To find all self-intersections please use
7142 # CheckSelfIntersections() method.
7144 # @return New GEOM.GEOM_Object, containing the result shape.
7146 # @ref tui_fuse "Example 1"
7147 # \n @ref swig_MakeCommon "Example 2"
7148 @ManageTransactions("BoolOp")
7149 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7150 rmExtraEdges=False, theName=None):
7152 Perform Fuse boolean operation on the list of shapes.
7155 theShapesList Shapes to be fused.
7156 checkSelfInte The flag that tells if the arguments should
7157 be checked for self-intersection prior to
7159 rmExtraEdges The flag that tells if Remove Extra Edges
7160 operation should be performed during the operation.
7161 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.
7166 This algorithm doesn't find all types of self-intersections.
7167 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7168 vertex/face and edge/face intersections. Face/face
7169 intersections detection is switched off as it is a
7170 time-consuming operation that gives an impact on performance.
7171 To find all self-intersections please use
7172 CheckSelfIntersections() method.
7175 New GEOM.GEOM_Object, containing the result shape.
7178 # Example: see GEOM_TestOthers.py
7179 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7181 RaiseIfFailed("MakeFuseList", self.BoolOp)
7182 self._autoPublish(anObj, theName, "fuse")
7185 ## Perform Common boolean operation on the list of shapes.
7186 # @param theShapesList Shapes for Common operation.
7187 # @param checkSelfInte The flag that tells if the arguments should
7188 # be checked for self-intersection prior to the operation.
7189 # @param theName Object name; when specified, this parameter is used
7190 # for result publication in the study. Otherwise, if automatic
7191 # publication is switched on, default value is used for result name.
7193 # @note This algorithm doesn't find all types of self-intersections.
7194 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7195 # vertex/face and edge/face intersections. Face/face
7196 # intersections detection is switched off as it is a
7197 # time-consuming operation that gives an impact on performance.
7198 # To find all self-intersections please use
7199 # CheckSelfIntersections() method.
7201 # @return New GEOM.GEOM_Object, containing the result shape.
7203 # @ref tui_common "Example 1"
7204 # \n @ref swig_MakeCommon "Example 2"
7205 @ManageTransactions("BoolOp")
7206 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7208 Perform Common boolean operation on the list of shapes.
7211 theShapesList Shapes for Common operation.
7212 checkSelfInte The flag that tells if the arguments should
7213 be checked for self-intersection prior to
7215 theName Object name; when specified, this parameter is used
7216 for result publication in the study. Otherwise, if automatic
7217 publication is switched on, default value is used for result name.
7220 This algorithm doesn't find all types of self-intersections.
7221 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7222 vertex/face and edge/face intersections. Face/face
7223 intersections detection is switched off as it is a
7224 time-consuming operation that gives an impact on performance.
7225 To find all self-intersections please use
7226 CheckSelfIntersections() method.
7229 New GEOM.GEOM_Object, containing the result shape.
7232 # Example: see GEOM_TestOthers.py
7233 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7234 RaiseIfFailed("MakeCommonList", self.BoolOp)
7235 self._autoPublish(anObj, theName, "common")
7238 ## Perform Cut boolean operation on one object and the list of tools.
7239 # @param theMainShape The object of the operation.
7240 # @param theShapesList The list of tools of the operation.
7241 # @param checkSelfInte The flag that tells if the arguments should
7242 # be checked for self-intersection prior to the operation.
7243 # @param theName Object name; when specified, this parameter is used
7244 # for result publication in the study. Otherwise, if automatic
7245 # publication is switched on, default value is used for result name.
7247 # @note This algorithm doesn't find all types of self-intersections.
7248 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7249 # vertex/face and edge/face intersections. Face/face
7250 # intersections detection is switched off as it is a
7251 # time-consuming operation that gives an impact on performance.
7252 # To find all self-intersections please use
7253 # CheckSelfIntersections() method.
7255 # @return New GEOM.GEOM_Object, containing the result shape.
7257 # @ref tui_cut "Example 1"
7258 # \n @ref swig_MakeCommon "Example 2"
7259 @ManageTransactions("BoolOp")
7260 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7262 Perform Cut boolean operation on one object and the list of tools.
7265 theMainShape The object of the operation.
7266 theShapesList The list of tools of the operation.
7267 checkSelfInte The flag that tells if the arguments should
7268 be checked for self-intersection prior to
7270 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.
7275 This algorithm doesn't find all types of self-intersections.
7276 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7277 vertex/face and edge/face intersections. Face/face
7278 intersections detection is switched off as it is a
7279 time-consuming operation that gives an impact on performance.
7280 To find all self-intersections please use
7281 CheckSelfIntersections() method.
7284 New GEOM.GEOM_Object, containing the result shape.
7287 # Example: see GEOM_TestOthers.py
7288 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7289 RaiseIfFailed("MakeCutList", self.BoolOp)
7290 self._autoPublish(anObj, theName, "cut")
7296 ## @addtogroup l3_basic_op
7299 ## Perform partition operation.
7300 # @param ListShapes Shapes to be intersected.
7301 # @param ListTools Shapes to intersect theShapes.
7302 # @param Limit Type of resulting shapes (see ShapeType()).\n
7303 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7304 # type will be detected automatically.
7305 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7306 # target type (equal to Limit) are kept in the result,
7307 # else standalone shapes of lower dimension
7308 # are kept also (if they exist).
7310 # @param theName Object name; when specified, this parameter is used
7311 # for result publication in the study. Otherwise, if automatic
7312 # publication is switched on, default value is used for result name.
7314 # @note Each compound from ListShapes and ListTools will be exploded
7315 # in order to avoid possible intersection between shapes from this compound.
7317 # After implementation new version of PartitionAlgo (October 2006)
7318 # other parameters are ignored by current functionality. They are kept
7319 # in this function only for support old versions.
7320 # @param ListKeepInside Shapes, outside which the results will be deleted.
7321 # Each shape from theKeepInside must belong to theShapes also.
7322 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7323 # Each shape from theRemoveInside must belong to theShapes also.
7324 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7325 # @param ListMaterials Material indices for each shape. Make sence,
7326 # only if theRemoveWebs is TRUE.
7328 # @return New GEOM.GEOM_Object, containing the result shapes.
7330 # @ref tui_partition "Example"
7331 @ManageTransactions("BoolOp")
7332 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7333 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7334 KeepNonlimitShapes=0, theName=None):
7336 Perform partition operation.
7339 ListShapes Shapes to be intersected.
7340 ListTools Shapes to intersect theShapes.
7341 Limit Type of resulting shapes (see geompy.ShapeType)
7342 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7343 type will be detected automatically.
7344 KeepNonlimitShapes if this parameter == 0, then only shapes of
7345 target type (equal to Limit) are kept in the result,
7346 else standalone shapes of lower dimension
7347 are kept also (if they exist).
7349 theName Object name; when specified, this parameter is used
7350 for result publication in the study. Otherwise, if automatic
7351 publication is switched on, default value is used for result name.
7353 Each compound from ListShapes and ListTools will be exploded
7354 in order to avoid possible intersection between shapes from
7357 After implementation new version of PartitionAlgo (October 2006) other
7358 parameters are ignored by current functionality. They are kept in this
7359 function only for support old versions.
7362 ListKeepInside Shapes, outside which the results will be deleted.
7363 Each shape from theKeepInside must belong to theShapes also.
7364 ListRemoveInside Shapes, inside which the results will be deleted.
7365 Each shape from theRemoveInside must belong to theShapes also.
7366 RemoveWebs If TRUE, perform Glue 3D algorithm.
7367 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7370 New GEOM.GEOM_Object, containing the result shapes.
7372 # Example: see GEOM_TestAll.py
7373 if Limit == self.ShapeType["AUTO"]:
7374 # automatic detection of the most appropriate shape limit type
7376 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7377 Limit = EnumToLong(lim)
7379 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7380 ListKeepInside, ListRemoveInside,
7381 Limit, RemoveWebs, ListMaterials,
7382 KeepNonlimitShapes);
7383 RaiseIfFailed("MakePartition", self.BoolOp)
7384 self._autoPublish(anObj, theName, "partition")
7387 ## Perform partition operation.
7388 # This method may be useful if it is needed to make a partition for
7389 # compound contains nonintersected shapes. Performance will be better
7390 # since intersection between shapes from compound is not performed.
7392 # Description of all parameters as in previous method MakePartition().
7393 # One additional parameter is provided:
7394 # @param checkSelfInte The flag that tells if the arguments should
7395 # be checked for self-intersection prior to the operation.
7397 # @note This algorithm doesn't find all types of self-intersections.
7398 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7399 # vertex/face and edge/face intersections. Face/face
7400 # intersections detection is switched off as it is a
7401 # time-consuming operation that gives an impact on performance.
7402 # To find all self-intersections please use
7403 # CheckSelfIntersections() method.
7405 # @note Passed compounds (via ListShapes or via ListTools)
7406 # have to consist of nonintersecting shapes.
7408 # @return New GEOM.GEOM_Object, containing the result shapes.
7410 # @ref swig_todo "Example"
7411 @ManageTransactions("BoolOp")
7412 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7413 ListKeepInside=[], ListRemoveInside=[],
7414 Limit=ShapeType["AUTO"], RemoveWebs=0,
7415 ListMaterials=[], KeepNonlimitShapes=0,
7416 checkSelfInte=False, theName=None):
7418 Perform partition operation.
7419 This method may be useful if it is needed to make a partition for
7420 compound contains nonintersected shapes. Performance will be better
7421 since intersection between shapes from compound is not performed.
7424 Description of all parameters as in method geompy.MakePartition.
7425 One additional parameter is provided:
7426 checkSelfInte The flag that tells if the arguments should
7427 be checked for self-intersection prior to
7431 This algorithm doesn't find all types of self-intersections.
7432 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7433 vertex/face and edge/face intersections. Face/face
7434 intersections detection is switched off as it is a
7435 time-consuming operation that gives an impact on performance.
7436 To find all self-intersections please use
7437 CheckSelfIntersections() method.
7440 Passed compounds (via ListShapes or via ListTools)
7441 have to consist of nonintersecting shapes.
7444 New GEOM.GEOM_Object, containing the result shapes.
7446 if Limit == self.ShapeType["AUTO"]:
7447 # automatic detection of the most appropriate shape limit type
7449 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7450 Limit = EnumToLong(lim)
7452 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7453 ListKeepInside, ListRemoveInside,
7454 Limit, RemoveWebs, ListMaterials,
7455 KeepNonlimitShapes, checkSelfInte);
7456 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7457 self._autoPublish(anObj, theName, "partition")
7460 ## See method MakePartition() for more information.
7462 # @ref tui_partition "Example 1"
7463 # \n @ref swig_Partition "Example 2"
7464 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7465 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7466 KeepNonlimitShapes=0, theName=None):
7468 See method geompy.MakePartition for more information.
7470 # Example: see GEOM_TestOthers.py
7471 # note: auto-publishing is done in self.MakePartition()
7472 anObj = self.MakePartition(ListShapes, ListTools,
7473 ListKeepInside, ListRemoveInside,
7474 Limit, RemoveWebs, ListMaterials,
7475 KeepNonlimitShapes, theName);
7478 ## Perform partition of the Shape with the Plane
7479 # @param theShape Shape to be intersected.
7480 # @param thePlane Tool shape, to intersect theShape.
7481 # @param theName Object name; when specified, this parameter is used
7482 # for result publication in the study. Otherwise, if automatic
7483 # publication is switched on, default value is used for result name.
7485 # @return New GEOM.GEOM_Object, containing the result shape.
7487 # @ref tui_partition "Example"
7488 @ManageTransactions("BoolOp")
7489 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7491 Perform partition of the Shape with the Plane
7494 theShape Shape to be intersected.
7495 thePlane Tool shape, to intersect theShape.
7496 theName Object name; when specified, this parameter is used
7497 for result publication in the study. Otherwise, if automatic
7498 publication is switched on, default value is used for result name.
7501 New GEOM.GEOM_Object, containing the result shape.
7503 # Example: see GEOM_TestAll.py
7504 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7505 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7506 self._autoPublish(anObj, theName, "partition")
7509 # end of l3_basic_op
7512 ## @addtogroup l3_transform
7515 ## Translate the given object along the vector, specified
7516 # by its end points.
7517 # @param theObject The object to be translated.
7518 # @param thePoint1 Start point of translation vector.
7519 # @param thePoint2 End point of translation vector.
7520 # @param theCopy Flag used to translate object itself or create a copy.
7521 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7522 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7523 @ManageTransactions("TrsfOp")
7524 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7526 Translate the given object along the vector, specified by its end points.
7529 theObject The object to be translated.
7530 thePoint1 Start point of translation vector.
7531 thePoint2 End point of translation vector.
7532 theCopy Flag used to translate object itself or create a copy.
7535 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7536 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7539 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7541 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7542 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7545 ## Translate the given object along the vector, specified
7546 # by its end points, creating its copy before the translation.
7547 # @param theObject The object to be translated.
7548 # @param thePoint1 Start point of translation vector.
7549 # @param thePoint2 End point of translation vector.
7550 # @param theName Object name; when specified, this parameter is used
7551 # for result publication in the study. Otherwise, if automatic
7552 # publication is switched on, default value is used for result name.
7554 # @return New GEOM.GEOM_Object, containing the translated object.
7556 # @ref tui_translation "Example 1"
7557 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7558 @ManageTransactions("TrsfOp")
7559 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7561 Translate the given object along the vector, specified
7562 by its end points, creating its copy before the translation.
7565 theObject The object to be translated.
7566 thePoint1 Start point of translation vector.
7567 thePoint2 End point of translation vector.
7568 theName Object name; when specified, this parameter is used
7569 for result publication in the study. Otherwise, if automatic
7570 publication is switched on, default value is used for result name.
7573 New GEOM.GEOM_Object, containing the translated object.
7575 # Example: see GEOM_TestAll.py
7576 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7577 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7578 self._autoPublish(anObj, theName, "translated")
7581 ## Translate the given object along the vector, specified by its components.
7582 # @param theObject The object to be translated.
7583 # @param theDX,theDY,theDZ Components of translation vector.
7584 # @param theCopy Flag used to translate object itself or create a copy.
7585 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7586 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7588 # @ref tui_translation "Example"
7589 @ManageTransactions("TrsfOp")
7590 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7592 Translate the given object along the vector, specified by its components.
7595 theObject The object to be translated.
7596 theDX,theDY,theDZ Components of translation vector.
7597 theCopy Flag used to translate object itself or create a copy.
7600 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7601 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7603 # Example: see GEOM_TestAll.py
7604 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7606 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7608 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7609 anObj.SetParameters(Parameters)
7610 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7613 ## Translate the given object along the vector, specified
7614 # by its components, creating its copy before the translation.
7615 # @param theObject The object to be translated.
7616 # @param theDX,theDY,theDZ Components of translation vector.
7617 # @param theName Object name; when specified, this parameter is used
7618 # for result publication in the study. Otherwise, if automatic
7619 # publication is switched on, default value is used for result name.
7621 # @return New GEOM.GEOM_Object, containing the translated object.
7623 # @ref tui_translation "Example"
7624 @ManageTransactions("TrsfOp")
7625 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7627 Translate the given object along the vector, specified
7628 by its components, creating its copy before the translation.
7631 theObject The object to be translated.
7632 theDX,theDY,theDZ Components of translation vector.
7633 theName Object name; when specified, this parameter is used
7634 for result publication in the study. Otherwise, if automatic
7635 publication is switched on, default value is used for result name.
7638 New GEOM.GEOM_Object, containing the translated object.
7640 # Example: see GEOM_TestAll.py
7641 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7642 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7643 anObj.SetParameters(Parameters)
7644 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7645 self._autoPublish(anObj, theName, "translated")
7648 ## Translate the given object along the given vector.
7649 # @param theObject The object to be translated.
7650 # @param theVector The translation vector.
7651 # @param theCopy Flag used to translate object itself or create a copy.
7652 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7653 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7654 @ManageTransactions("TrsfOp")
7655 def TranslateVector(self, theObject, theVector, theCopy=False):
7657 Translate the given object along the given vector.
7660 theObject The object to be translated.
7661 theVector The translation vector.
7662 theCopy Flag used to translate object itself or create a copy.
7665 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7666 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7669 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7671 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7672 RaiseIfFailed("TranslateVector", self.TrsfOp)
7675 ## Translate the given object along the given vector,
7676 # creating its copy before the translation.
7677 # @param theObject The object to be translated.
7678 # @param theVector The translation vector.
7679 # @param theName Object name; when specified, this parameter is used
7680 # for result publication in the study. Otherwise, if automatic
7681 # publication is switched on, default value is used for result name.
7683 # @return New GEOM.GEOM_Object, containing the translated object.
7685 # @ref tui_translation "Example"
7686 @ManageTransactions("TrsfOp")
7687 def MakeTranslationVector(self, theObject, theVector, theName=None):
7689 Translate the given object along the given vector,
7690 creating its copy before the translation.
7693 theObject The object to be translated.
7694 theVector The translation vector.
7695 theName Object name; when specified, this parameter is used
7696 for result publication in the study. Otherwise, if automatic
7697 publication is switched on, default value is used for result name.
7700 New GEOM.GEOM_Object, containing the translated object.
7702 # Example: see GEOM_TestAll.py
7703 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7704 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7705 self._autoPublish(anObj, theName, "translated")
7708 ## Translate the given object along the given vector on given distance.
7709 # @param theObject The object to be translated.
7710 # @param theVector The translation vector.
7711 # @param theDistance The translation distance.
7712 # @param theCopy Flag used to translate object itself or create a copy.
7713 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7714 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7716 # @ref tui_translation "Example"
7717 @ManageTransactions("TrsfOp")
7718 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7720 Translate the given object along the given vector on given distance.
7723 theObject The object to be translated.
7724 theVector The translation vector.
7725 theDistance The translation distance.
7726 theCopy Flag used to translate object itself or create a copy.
7729 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7730 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7732 # Example: see GEOM_TestAll.py
7733 theDistance,Parameters = ParseParameters(theDistance)
7734 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7735 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7736 anObj.SetParameters(Parameters)
7739 ## Translate the given object along the given vector on given distance,
7740 # creating its copy before the translation.
7741 # @param theObject The object to be translated.
7742 # @param theVector The translation vector.
7743 # @param theDistance The translation distance.
7744 # @param theName Object name; when specified, this parameter is used
7745 # for result publication in the study. Otherwise, if automatic
7746 # publication is switched on, default value is used for result name.
7748 # @return New GEOM.GEOM_Object, containing the translated object.
7750 # @ref tui_translation "Example"
7751 @ManageTransactions("TrsfOp")
7752 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7754 Translate the given object along the given vector on given distance,
7755 creating its copy before the translation.
7758 theObject The object to be translated.
7759 theVector The translation vector.
7760 theDistance The translation distance.
7761 theName Object name; when specified, this parameter is used
7762 for result publication in the study. Otherwise, if automatic
7763 publication is switched on, default value is used for result name.
7766 New GEOM.GEOM_Object, containing the translated object.
7768 # Example: see GEOM_TestAll.py
7769 theDistance,Parameters = ParseParameters(theDistance)
7770 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7771 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7772 anObj.SetParameters(Parameters)
7773 self._autoPublish(anObj, theName, "translated")
7776 ## Rotate the given object around the given axis on the given angle.
7777 # @param theObject The object to be rotated.
7778 # @param theAxis Rotation axis.
7779 # @param theAngle Rotation angle in radians.
7780 # @param theCopy Flag used to rotate object itself or create a copy.
7782 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7783 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7785 # @ref tui_rotation "Example"
7786 @ManageTransactions("TrsfOp")
7787 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7789 Rotate the given object around the given axis on the given angle.
7792 theObject The object to be rotated.
7793 theAxis Rotation axis.
7794 theAngle Rotation angle in radians.
7795 theCopy Flag used to rotate object itself or create a copy.
7798 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7799 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7801 # Example: see GEOM_TestAll.py
7803 if isinstance(theAngle,str):
7805 theAngle, Parameters = ParseParameters(theAngle)
7807 theAngle = theAngle*math.pi/180.0
7809 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7811 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7812 RaiseIfFailed("Rotate", self.TrsfOp)
7813 anObj.SetParameters(Parameters)
7816 ## Rotate the given object around the given axis
7817 # on the given angle, creating its copy before the rotatation.
7818 # @param theObject The object to be rotated.
7819 # @param theAxis Rotation axis.
7820 # @param theAngle Rotation angle in radians.
7821 # @param theName Object name; when specified, this parameter is used
7822 # for result publication in the study. Otherwise, if automatic
7823 # publication is switched on, default value is used for result name.
7825 # @return New GEOM.GEOM_Object, containing the rotated object.
7827 # @ref tui_rotation "Example"
7828 @ManageTransactions("TrsfOp")
7829 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7831 Rotate the given object around the given axis
7832 on the given angle, creating its copy before the rotatation.
7835 theObject The object to be rotated.
7836 theAxis Rotation axis.
7837 theAngle Rotation angle in radians.
7838 theName Object name; when specified, this parameter is used
7839 for result publication in the study. Otherwise, if automatic
7840 publication is switched on, default value is used for result name.
7843 New GEOM.GEOM_Object, containing the rotated object.
7845 # Example: see GEOM_TestAll.py
7847 if isinstance(theAngle,str):
7849 theAngle, Parameters = ParseParameters(theAngle)
7851 theAngle = theAngle*math.pi/180.0
7852 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7853 RaiseIfFailed("RotateCopy", self.TrsfOp)
7854 anObj.SetParameters(Parameters)
7855 self._autoPublish(anObj, theName, "rotated")
7858 ## Rotate given object around vector perpendicular to plane
7859 # containing three points.
7860 # @param theObject The object to be rotated.
7861 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7862 # containing the three points.
7863 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7864 # @param theCopy Flag used to rotate object itself or create a copy.
7865 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7866 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7867 @ManageTransactions("TrsfOp")
7868 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7870 Rotate given object around vector perpendicular to plane
7871 containing three points.
7874 theObject The object to be rotated.
7875 theCentPoint central point the axis is the vector perpendicular to the plane
7876 containing the three points.
7877 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7878 theCopy Flag used to rotate object itself or create a copy.
7881 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7882 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7885 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7887 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7888 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7891 ## Rotate given object around vector perpendicular to plane
7892 # containing three points, creating its copy before the rotatation.
7893 # @param theObject The object to be rotated.
7894 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7895 # containing the three points.
7896 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7897 # @param theName Object name; when specified, this parameter is used
7898 # for result publication in the study. Otherwise, if automatic
7899 # publication is switched on, default value is used for result name.
7901 # @return New GEOM.GEOM_Object, containing the rotated object.
7903 # @ref tui_rotation "Example"
7904 @ManageTransactions("TrsfOp")
7905 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7907 Rotate given object around vector perpendicular to plane
7908 containing three points, creating its copy before the rotatation.
7911 theObject The object to be rotated.
7912 theCentPoint central point the axis is the vector perpendicular to the plane
7913 containing the three points.
7914 thePoint1,thePoint2 in a perpendicular plane of the axis.
7915 theName Object name; when specified, this parameter is used
7916 for result publication in the study. Otherwise, if automatic
7917 publication is switched on, default value is used for result name.
7920 New GEOM.GEOM_Object, containing the rotated object.
7922 # Example: see GEOM_TestAll.py
7923 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7924 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7925 self._autoPublish(anObj, theName, "rotated")
7928 ## Scale the given object by the specified factor.
7929 # @param theObject The object to be scaled.
7930 # @param thePoint Center point for scaling.
7931 # Passing None for it means scaling relatively the origin of global CS.
7932 # @param theFactor Scaling factor value.
7933 # @param theCopy Flag used to scale object itself or create a copy.
7934 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7935 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7936 @ManageTransactions("TrsfOp")
7937 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7939 Scale the given object by the specified factor.
7942 theObject The object to be scaled.
7943 thePoint Center point for scaling.
7944 Passing None for it means scaling relatively the origin of global CS.
7945 theFactor Scaling factor value.
7946 theCopy Flag used to scale object itself or create a copy.
7949 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7950 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7952 # Example: see GEOM_TestAll.py
7953 theFactor, Parameters = ParseParameters(theFactor)
7955 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7957 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7958 RaiseIfFailed("Scale", self.TrsfOp)
7959 anObj.SetParameters(Parameters)
7962 ## Scale the given object by the factor, creating its copy before the scaling.
7963 # @param theObject The object to be scaled.
7964 # @param thePoint Center point for scaling.
7965 # Passing None for it means scaling relatively the origin of global CS.
7966 # @param theFactor Scaling factor value.
7967 # @param theName Object name; when specified, this parameter is used
7968 # for result publication in the study. Otherwise, if automatic
7969 # publication is switched on, default value is used for result name.
7971 # @return New GEOM.GEOM_Object, containing the scaled shape.
7973 # @ref tui_scale "Example"
7974 @ManageTransactions("TrsfOp")
7975 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7977 Scale the given object by the factor, creating its copy before the scaling.
7980 theObject The object to be scaled.
7981 thePoint Center point for scaling.
7982 Passing None for it means scaling relatively the origin of global CS.
7983 theFactor Scaling factor value.
7984 theName Object name; when specified, this parameter is used
7985 for result publication in the study. Otherwise, if automatic
7986 publication is switched on, default value is used for result name.
7989 New GEOM.GEOM_Object, containing the scaled shape.
7991 # Example: see GEOM_TestAll.py
7992 theFactor, Parameters = ParseParameters(theFactor)
7993 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7994 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7995 anObj.SetParameters(Parameters)
7996 self._autoPublish(anObj, theName, "scaled")
7999 ## Scale the given object by different factors along coordinate axes.
8000 # @param theObject The object to be scaled.
8001 # @param thePoint Center point for scaling.
8002 # Passing None for it means scaling relatively the origin of global CS.
8003 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8004 # @param theCopy Flag used to scale object itself or create a copy.
8005 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8006 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8007 @ManageTransactions("TrsfOp")
8008 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8010 Scale the given object by different factors along coordinate axes.
8013 theObject The object to be scaled.
8014 thePoint Center point for scaling.
8015 Passing None for it means scaling relatively the origin of global CS.
8016 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8017 theCopy Flag used to scale object itself or create a copy.
8020 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8021 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8023 # Example: see GEOM_TestAll.py
8024 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8026 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8027 theFactorX, theFactorY, theFactorZ)
8029 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8030 theFactorX, theFactorY, theFactorZ)
8031 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8032 anObj.SetParameters(Parameters)
8035 ## Scale the given object by different factors along coordinate axes,
8036 # creating its copy before the scaling.
8037 # @param theObject The object to be scaled.
8038 # @param thePoint Center point for scaling.
8039 # Passing None for it means scaling relatively the origin of global CS.
8040 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8041 # @param theName Object name; when specified, this parameter is used
8042 # for result publication in the study. Otherwise, if automatic
8043 # publication is switched on, default value is used for result name.
8045 # @return New GEOM.GEOM_Object, containing the scaled shape.
8047 # @ref swig_scale "Example"
8048 @ManageTransactions("TrsfOp")
8049 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8051 Scale the given object by different factors along coordinate axes,
8052 creating its copy before the scaling.
8055 theObject The object to be scaled.
8056 thePoint Center point for scaling.
8057 Passing None for it means scaling relatively the origin of global CS.
8058 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8059 theName Object name; when specified, this parameter is used
8060 for result publication in the study. Otherwise, if automatic
8061 publication is switched on, default value is used for result name.
8064 New GEOM.GEOM_Object, containing the scaled shape.
8066 # Example: see GEOM_TestAll.py
8067 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8068 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8069 theFactorX, theFactorY, theFactorZ)
8070 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8071 anObj.SetParameters(Parameters)
8072 self._autoPublish(anObj, theName, "scaled")
8075 ## Mirror an object relatively the given plane.
8076 # @param theObject The object to be mirrored.
8077 # @param thePlane Plane of symmetry.
8078 # @param theCopy Flag used to mirror object itself or create a copy.
8079 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8080 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8081 @ManageTransactions("TrsfOp")
8082 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8084 Mirror an object relatively the given plane.
8087 theObject The object to be mirrored.
8088 thePlane Plane of symmetry.
8089 theCopy Flag used to mirror object itself or create a copy.
8092 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8093 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8096 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8098 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8099 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8102 ## Create an object, symmetrical
8103 # to the given one relatively the given plane.
8104 # @param theObject The object to be mirrored.
8105 # @param thePlane Plane of symmetry.
8106 # @param theName Object name; when specified, this parameter is used
8107 # for result publication in the study. Otherwise, if automatic
8108 # publication is switched on, default value is used for result name.
8110 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8112 # @ref tui_mirror "Example"
8113 @ManageTransactions("TrsfOp")
8114 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8116 Create an object, symmetrical to the given one relatively the given plane.
8119 theObject The object to be mirrored.
8120 thePlane Plane of symmetry.
8121 theName Object name; when specified, this parameter is used
8122 for result publication in the study. Otherwise, if automatic
8123 publication is switched on, default value is used for result name.
8126 New GEOM.GEOM_Object, containing the mirrored shape.
8128 # Example: see GEOM_TestAll.py
8129 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8130 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8131 self._autoPublish(anObj, theName, "mirrored")
8134 ## Mirror an object relatively the given axis.
8135 # @param theObject The object to be mirrored.
8136 # @param theAxis Axis of symmetry.
8137 # @param theCopy Flag used to mirror object itself or create a copy.
8138 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8139 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8140 @ManageTransactions("TrsfOp")
8141 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8143 Mirror an object relatively the given axis.
8146 theObject The object to be mirrored.
8147 theAxis Axis of symmetry.
8148 theCopy Flag used to mirror object itself or create a copy.
8151 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8152 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8155 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8157 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8158 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8161 ## Create an object, symmetrical
8162 # to the given one relatively the given axis.
8163 # @param theObject The object to be mirrored.
8164 # @param theAxis Axis of symmetry.
8165 # @param 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.
8169 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8171 # @ref tui_mirror "Example"
8172 @ManageTransactions("TrsfOp")
8173 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8175 Create an object, symmetrical to the given one relatively the given axis.
8178 theObject The object to be mirrored.
8179 theAxis Axis of symmetry.
8180 theName Object name; when specified, this parameter is used
8181 for result publication in the study. Otherwise, if automatic
8182 publication is switched on, default value is used for result name.
8185 New GEOM.GEOM_Object, containing the mirrored shape.
8187 # Example: see GEOM_TestAll.py
8188 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8189 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8190 self._autoPublish(anObj, theName, "mirrored")
8193 ## Mirror an object relatively the given point.
8194 # @param theObject The object to be mirrored.
8195 # @param thePoint Point of symmetry.
8196 # @param theCopy Flag used to mirror object itself or create a copy.
8197 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8198 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8199 @ManageTransactions("TrsfOp")
8200 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8202 Mirror an object relatively the given point.
8205 theObject The object to be mirrored.
8206 thePoint Point of symmetry.
8207 theCopy Flag used to mirror object itself or create a copy.
8210 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8211 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8213 # Example: see GEOM_TestAll.py
8215 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8217 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8218 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8221 ## Create an object, symmetrical
8222 # to the given one relatively the given point.
8223 # @param theObject The object to be mirrored.
8224 # @param thePoint Point of symmetry.
8225 # @param theName Object name; when specified, this parameter is used
8226 # for result publication in the study. Otherwise, if automatic
8227 # publication is switched on, default value is used for result name.
8229 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8231 # @ref tui_mirror "Example"
8232 @ManageTransactions("TrsfOp")
8233 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8235 Create an object, symmetrical
8236 to the given one relatively the given point.
8239 theObject The object to be mirrored.
8240 thePoint Point of symmetry.
8241 theName Object name; when specified, this parameter is used
8242 for result publication in the study. Otherwise, if automatic
8243 publication is switched on, default value is used for result name.
8246 New GEOM.GEOM_Object, containing the mirrored shape.
8248 # Example: see GEOM_TestAll.py
8249 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8250 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8251 self._autoPublish(anObj, theName, "mirrored")
8254 ## Modify the location of the given object.
8255 # @param theObject The object to be displaced.
8256 # @param theStartLCS Coordinate system to perform displacement from it.\n
8257 # If \a theStartLCS is NULL, displacement
8258 # will be performed from global CS.\n
8259 # If \a theObject itself is used as \a theStartLCS,
8260 # its location will be changed to \a theEndLCS.
8261 # @param theEndLCS Coordinate system to perform displacement to it.
8262 # @param theCopy Flag used to displace object itself or create a copy.
8263 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8264 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8265 @ManageTransactions("TrsfOp")
8266 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8268 Modify the Location of the given object by LCS, creating its copy before the setting.
8271 theObject The object to be displaced.
8272 theStartLCS Coordinate system to perform displacement from it.
8273 If theStartLCS is NULL, displacement
8274 will be performed from global CS.
8275 If theObject itself is used as theStartLCS,
8276 its location will be changed to theEndLCS.
8277 theEndLCS Coordinate system to perform displacement to it.
8278 theCopy Flag used to displace object itself or create a copy.
8281 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8282 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8284 # Example: see GEOM_TestAll.py
8286 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8288 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8289 RaiseIfFailed("Displace", self.TrsfOp)
8292 ## Modify the Location of the given object by LCS,
8293 # creating its copy before the setting.
8294 # @param theObject The object to be displaced.
8295 # @param theStartLCS Coordinate system to perform displacement from it.\n
8296 # If \a theStartLCS is NULL, displacement
8297 # will be performed from global CS.\n
8298 # If \a theObject itself is used as \a theStartLCS,
8299 # its location will be changed to \a theEndLCS.
8300 # @param theEndLCS Coordinate system to perform displacement to it.
8301 # @param theName Object name; when specified, this parameter is used
8302 # for result publication in the study. Otherwise, if automatic
8303 # publication is switched on, default value is used for result name.
8305 # @return New GEOM.GEOM_Object, containing the displaced shape.
8307 # @ref tui_modify_location "Example"
8308 @ManageTransactions("TrsfOp")
8309 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8311 Modify the Location of the given object by LCS, creating its copy before the setting.
8314 theObject The object to be displaced.
8315 theStartLCS Coordinate system to perform displacement from it.
8316 If theStartLCS is NULL, displacement
8317 will be performed from global CS.
8318 If theObject itself is used as theStartLCS,
8319 its location will be changed to theEndLCS.
8320 theEndLCS Coordinate system to perform displacement to it.
8321 theName Object name; when specified, this parameter is used
8322 for result publication in the study. Otherwise, if automatic
8323 publication is switched on, default value is used for result name.
8326 New GEOM.GEOM_Object, containing the displaced shape.
8329 # create local coordinate systems
8330 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8331 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8332 # modify the location of the given object
8333 position = geompy.MakePosition(cylinder, cs1, cs2)
8335 # Example: see GEOM_TestAll.py
8336 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8337 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8338 self._autoPublish(anObj, theName, "displaced")
8341 ## Modify the Location of the given object by Path.
8342 # @param theObject The object to be displaced.
8343 # @param thePath Wire or Edge along that the object will be translated.
8344 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8345 # @param theCopy is to create a copy objects if true.
8346 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8347 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8348 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8350 # @ref tui_modify_location "Example"
8351 @ManageTransactions("TrsfOp")
8352 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8354 Modify the Location of the given object by Path.
8357 theObject The object to be displaced.
8358 thePath Wire or Edge along that the object will be translated.
8359 theDistance progress of Path (0 = start location, 1 = end of path location).
8360 theCopy is to create a copy objects if true.
8361 theReverse 0 - for usual direction, 1 - to reverse path direction.
8364 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8365 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8368 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8370 # Example: see GEOM_TestAll.py
8371 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8372 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8375 ## Modify the Location of the given object by Path, creating its copy before the operation.
8376 # @param theObject The object to be displaced.
8377 # @param thePath Wire or Edge along that the object will be translated.
8378 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8379 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8380 # @param theName Object name; when specified, this parameter is used
8381 # for result publication in the study. Otherwise, if automatic
8382 # publication is switched on, default value is used for result name.
8384 # @return New GEOM.GEOM_Object, containing the displaced shape.
8385 @ManageTransactions("TrsfOp")
8386 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8388 Modify the Location of the given object by Path, creating its copy before the operation.
8391 theObject The object to be displaced.
8392 thePath Wire or Edge along that the object will be translated.
8393 theDistance progress of Path (0 = start location, 1 = end of path location).
8394 theReverse 0 - for usual direction, 1 - to reverse path direction.
8395 theName Object name; when specified, this parameter is used
8396 for result publication in the study. Otherwise, if automatic
8397 publication is switched on, default value is used for result name.
8400 New GEOM.GEOM_Object, containing the displaced shape.
8402 # Example: see GEOM_TestAll.py
8403 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8404 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8405 self._autoPublish(anObj, theName, "displaced")
8408 ## Offset given shape.
8409 # @param theObject The base object for the offset.
8410 # @param theOffset Offset value.
8411 # @param theCopy Flag used to offset object itself or create a copy.
8412 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8413 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8414 @ManageTransactions("TrsfOp")
8415 def Offset(self, theObject, theOffset, theCopy=False):
8420 theObject The base object for the offset.
8421 theOffset Offset value.
8422 theCopy Flag used to offset object itself or create a copy.
8425 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8426 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8428 theOffset, Parameters = ParseParameters(theOffset)
8430 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8432 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8433 RaiseIfFailed("Offset", self.TrsfOp)
8434 anObj.SetParameters(Parameters)
8437 ## Create new object as offset of the given one.
8438 # @param theObject The base object for the offset.
8439 # @param theOffset Offset value.
8440 # @param theName Object name; when specified, this parameter is used
8441 # for result publication in the study. Otherwise, if automatic
8442 # publication is switched on, default value is used for result name.
8444 # @return New GEOM.GEOM_Object, containing the offset object.
8446 # @ref tui_offset "Example"
8447 @ManageTransactions("TrsfOp")
8448 def MakeOffset(self, theObject, theOffset, theName=None):
8450 Create new object as offset of the given one.
8453 theObject The base object for the offset.
8454 theOffset Offset value.
8455 theName Object name; when specified, this parameter is used
8456 for result publication in the study. Otherwise, if automatic
8457 publication is switched on, default value is used for result name.
8460 New GEOM.GEOM_Object, containing the offset object.
8463 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8464 # create a new object as offset of the given object
8465 offset = geompy.MakeOffset(box, 70.)
8467 # Example: see GEOM_TestAll.py
8468 theOffset, Parameters = ParseParameters(theOffset)
8469 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8470 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8471 anObj.SetParameters(Parameters)
8472 self._autoPublish(anObj, theName, "offset")
8475 ## Create new object as projection of the given one on a 2D surface.
8476 # @param theSource The source object for the projection. It can be a point, edge or wire.
8477 # @param theTarget The target object. It can be planar or cylindrical face.
8478 # @param theName Object name; when specified, this parameter is used
8479 # for result publication in the study. Otherwise, if automatic
8480 # publication is switched on, default value is used for result name.
8482 # @return New GEOM.GEOM_Object, containing the projection.
8484 # @ref tui_projection "Example"
8485 @ManageTransactions("TrsfOp")
8486 def MakeProjection(self, theSource, theTarget, theName=None):
8488 Create new object as projection of the given one on a 2D surface.
8491 theSource The source object for the projection. It can be a point, edge or wire.
8492 theTarget The target object. It can be planar or cylindrical face.
8493 theName Object name; when specified, this parameter is used
8494 for result publication in the study. Otherwise, if automatic
8495 publication is switched on, default value is used for result name.
8498 New GEOM.GEOM_Object, containing the projection.
8500 # Example: see GEOM_TestAll.py
8501 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8502 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8503 self._autoPublish(anObj, theName, "projection")
8506 ## Create a projection projection of the given point on a wire or an edge.
8507 # If there are no solutions or there are 2 or more solutions It throws an
8509 # @param thePoint the point to be projected.
8510 # @param theWire the wire. The edge is accepted as well.
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 [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8516 # \n \a u: The parameter of projection point on edge.
8517 # \n \a PointOnEdge: The projection point.
8518 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8520 # @ref tui_projection "Example"
8521 @ManageTransactions("TrsfOp")
8522 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8524 Create a projection projection of the given point on a wire or an edge.
8525 If there are no solutions or there are 2 or more solutions It throws an
8529 thePoint the point to be projected.
8530 theWire the wire. The edge is accepted as well.
8531 theName Object name; when specified, this parameter is used
8532 for result publication in the study. Otherwise, if automatic
8533 publication is switched on, default value is used for result name.
8536 [u, PointOnEdge, EdgeInWireIndex]
8537 u: The parameter of projection point on edge.
8538 PointOnEdge: The projection point.
8539 EdgeInWireIndex: The index of an edge in a wire.
8541 # Example: see GEOM_TestAll.py
8542 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8543 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8544 self._autoPublish(anObj[1], theName, "projection")
8547 # -----------------------------------------------------------------------------
8549 # -----------------------------------------------------------------------------
8551 ## Translate the given object along the given vector a given number times
8552 # @param theObject The object to be translated.
8553 # @param theVector Direction of the translation. DX if None.
8554 # @param theStep Distance to translate on.
8555 # @param theNbTimes Quantity of translations to be done.
8556 # @param theName Object name; when specified, this parameter is used
8557 # for result publication in the study. Otherwise, if automatic
8558 # publication is switched on, default value is used for result name.
8560 # @return New GEOM.GEOM_Object, containing compound of all
8561 # the shapes, obtained after each translation.
8563 # @ref tui_multi_translation "Example"
8564 @ManageTransactions("TrsfOp")
8565 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8567 Translate the given object along the given vector a given number times
8570 theObject The object to be translated.
8571 theVector Direction of the translation. DX if None.
8572 theStep Distance to translate on.
8573 theNbTimes Quantity of translations to be done.
8574 theName Object name; when specified, this parameter is used
8575 for result publication in the study. Otherwise, if automatic
8576 publication is switched on, default value is used for result name.
8579 New GEOM.GEOM_Object, containing compound of all
8580 the shapes, obtained after each translation.
8583 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8585 # Example: see GEOM_TestAll.py
8586 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8587 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8588 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8589 anObj.SetParameters(Parameters)
8590 self._autoPublish(anObj, theName, "multitranslation")
8593 ## Conseqently apply two specified translations to theObject specified number of times.
8594 # @param theObject The object to be translated.
8595 # @param theVector1 Direction of the first translation. DX if None.
8596 # @param theStep1 Step of the first translation.
8597 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8598 # @param theVector2 Direction of the second translation. DY if None.
8599 # @param theStep2 Step of the second translation.
8600 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8601 # @param theName Object name; when specified, this parameter is used
8602 # for result publication in the study. Otherwise, if automatic
8603 # publication is switched on, default value is used for result name.
8605 # @return New GEOM.GEOM_Object, containing compound of all
8606 # the shapes, obtained after each translation.
8608 # @ref tui_multi_translation "Example"
8609 @ManageTransactions("TrsfOp")
8610 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8611 theVector2, theStep2, theNbTimes2, theName=None):
8613 Conseqently apply two specified translations to theObject specified number of times.
8616 theObject The object to be translated.
8617 theVector1 Direction of the first translation. DX if None.
8618 theStep1 Step of the first translation.
8619 theNbTimes1 Quantity of translations to be done along theVector1.
8620 theVector2 Direction of the second translation. DY if None.
8621 theStep2 Step of the second translation.
8622 theNbTimes2 Quantity of translations to be done along theVector2.
8623 theName Object name; when specified, this parameter is used
8624 for result publication in the study. Otherwise, if automatic
8625 publication is switched on, default value is used for result name.
8628 New GEOM.GEOM_Object, containing compound of all
8629 the shapes, obtained after each translation.
8632 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8634 # Example: see GEOM_TestAll.py
8635 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8636 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8637 theVector2, theStep2, theNbTimes2)
8638 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8639 anObj.SetParameters(Parameters)
8640 self._autoPublish(anObj, theName, "multitranslation")
8643 ## Rotate the given object around the given axis a given number times.
8644 # Rotation angle will be 2*PI/theNbTimes.
8645 # @param theObject The object to be rotated.
8646 # @param theAxis The rotation axis. DZ if None.
8647 # @param theNbTimes Quantity of rotations to be done.
8648 # @param theName Object name; when specified, this parameter is used
8649 # for result publication in the study. Otherwise, if automatic
8650 # publication is switched on, default value is used for result name.
8652 # @return New GEOM.GEOM_Object, containing compound of all the
8653 # shapes, obtained after each rotation.
8655 # @ref tui_multi_rotation "Example"
8656 @ManageTransactions("TrsfOp")
8657 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8659 Rotate the given object around the given axis a given number times.
8660 Rotation angle will be 2*PI/theNbTimes.
8663 theObject The object to be rotated.
8664 theAxis The rotation axis. DZ if None.
8665 theNbTimes Quantity of rotations to be done.
8666 theName Object name; when specified, this parameter is used
8667 for result publication in the study. Otherwise, if automatic
8668 publication is switched on, default value is used for result name.
8671 New GEOM.GEOM_Object, containing compound of all the
8672 shapes, obtained after each rotation.
8675 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8677 # Example: see GEOM_TestAll.py
8678 theNbTimes, Parameters = ParseParameters(theNbTimes)
8679 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8680 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8681 anObj.SetParameters(Parameters)
8682 self._autoPublish(anObj, theName, "multirotation")
8685 ## Rotate the given object around the given axis
8686 # a given number times on the given angle.
8687 # @param theObject The object to be rotated.
8688 # @param theAxis The rotation axis. DZ if None.
8689 # @param theAngleStep Rotation angle in radians.
8690 # @param theNbTimes Quantity of rotations to be done.
8691 # @param theName Object name; when specified, this parameter is used
8692 # for result publication in the study. Otherwise, if automatic
8693 # publication is switched on, default value is used for result name.
8695 # @return New GEOM.GEOM_Object, containing compound of all the
8696 # shapes, obtained after each rotation.
8698 # @ref tui_multi_rotation "Example"
8699 @ManageTransactions("TrsfOp")
8700 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8702 Rotate the given object around the given axis
8703 a given number times on the given angle.
8706 theObject The object to be rotated.
8707 theAxis The rotation axis. DZ if None.
8708 theAngleStep Rotation angle in radians.
8709 theNbTimes Quantity of rotations to be done.
8710 theName Object name; when specified, this parameter is used
8711 for result publication in the study. Otherwise, if automatic
8712 publication is switched on, default value is used for result name.
8715 New GEOM.GEOM_Object, containing compound of all the
8716 shapes, obtained after each rotation.
8719 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8721 # Example: see GEOM_TestAll.py
8722 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8723 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8724 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8725 anObj.SetParameters(Parameters)
8726 self._autoPublish(anObj, theName, "multirotation")
8729 ## Rotate the given object around the given axis a given
8730 # number times and multi-translate each rotation result.
8731 # Rotation angle will be 2*PI/theNbTimes1.
8732 # Translation direction passes through center of gravity
8733 # of rotated shape and its projection on the rotation axis.
8734 # @param theObject The object to be rotated.
8735 # @param theAxis Rotation axis. DZ if None.
8736 # @param theNbTimes1 Quantity of rotations to be done.
8737 # @param theRadialStep Translation distance.
8738 # @param theNbTimes2 Quantity of translations to be done.
8739 # @param theName Object name; when specified, this parameter is used
8740 # for result publication in the study. Otherwise, if automatic
8741 # publication is switched on, default value is used for result name.
8743 # @return New GEOM.GEOM_Object, containing compound of all the
8744 # shapes, obtained after each transformation.
8746 # @ref tui_multi_rotation "Example"
8747 @ManageTransactions("TrsfOp")
8748 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8750 Rotate the given object around the
8751 given axis on the given angle a given number
8752 times and multi-translate each rotation result.
8753 Translation direction passes through center of gravity
8754 of rotated shape and its projection on the rotation axis.
8757 theObject The object to be rotated.
8758 theAxis Rotation axis. DZ if None.
8759 theNbTimes1 Quantity of rotations to be done.
8760 theRadialStep Translation distance.
8761 theNbTimes2 Quantity of translations to be done.
8762 theName Object name; when specified, this parameter is used
8763 for result publication in the study. Otherwise, if automatic
8764 publication is switched on, default value is used for result name.
8767 New GEOM.GEOM_Object, containing compound of all the
8768 shapes, obtained after each transformation.
8771 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8773 # Example: see GEOM_TestAll.py
8774 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8775 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8776 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8777 anObj.SetParameters(Parameters)
8778 self._autoPublish(anObj, theName, "multirotation")
8781 ## Rotate the given object around the
8782 # given axis on the given angle a given number
8783 # times and multi-translate each rotation result.
8784 # Translation direction passes through center of gravity
8785 # of rotated shape and its projection on the rotation axis.
8786 # @param theObject The object to be rotated.
8787 # @param theAxis Rotation axis. DZ if None.
8788 # @param theAngleStep Rotation angle in radians.
8789 # @param theNbTimes1 Quantity of rotations to be done.
8790 # @param theRadialStep Translation distance.
8791 # @param theNbTimes2 Quantity of translations to be done.
8792 # @param theName Object name; when specified, this parameter is used
8793 # for result publication in the study. Otherwise, if automatic
8794 # publication is switched on, default value is used for result name.
8796 # @return New GEOM.GEOM_Object, containing compound of all the
8797 # shapes, obtained after each transformation.
8799 # @ref tui_multi_rotation "Example"
8800 @ManageTransactions("TrsfOp")
8801 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8803 Rotate the given object around the
8804 given axis on the given angle a given number
8805 times and multi-translate each rotation result.
8806 Translation direction passes through center of gravity
8807 of rotated shape and its projection on the rotation axis.
8810 theObject The object to be rotated.
8811 theAxis Rotation axis. DZ if None.
8812 theAngleStep Rotation angle in radians.
8813 theNbTimes1 Quantity of rotations to be done.
8814 theRadialStep Translation distance.
8815 theNbTimes2 Quantity of translations to be done.
8816 theName Object name; when specified, this parameter is used
8817 for result publication in the study. Otherwise, if automatic
8818 publication is switched on, default value is used for result name.
8821 New GEOM.GEOM_Object, containing compound of all the
8822 shapes, obtained after each transformation.
8825 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8827 # Example: see GEOM_TestAll.py
8828 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8829 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8830 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8831 anObj.SetParameters(Parameters)
8832 self._autoPublish(anObj, theName, "multirotation")
8835 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8837 # @ref swig_MakeMultiRotation "Example"
8838 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8840 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8843 pz = geompy.MakeVertex(0, 0, 100)
8844 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8845 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8847 # Example: see GEOM_TestOthers.py
8848 aVec = self.MakeLine(aPoint,aDir)
8849 # note: auto-publishing is done in self.MultiRotate1D()
8850 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8853 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8855 # @ref swig_MakeMultiRotation "Example"
8856 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8858 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8861 pz = geompy.MakeVertex(0, 0, 100)
8862 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8863 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8865 # Example: see GEOM_TestOthers.py
8866 aVec = self.MakeLine(aPoint,aDir)
8867 # note: auto-publishing is done in self.MultiRotate1D()
8868 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8871 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8873 # @ref swig_MakeMultiRotation "Example"
8874 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8876 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8879 pz = geompy.MakeVertex(0, 0, 100)
8880 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8881 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8883 # Example: see GEOM_TestOthers.py
8884 aVec = self.MakeLine(aPoint,aDir)
8885 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8886 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8889 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8891 # @ref swig_MakeMultiRotation "Example"
8892 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8894 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8897 pz = geompy.MakeVertex(0, 0, 100)
8898 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8899 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8901 # Example: see GEOM_TestOthers.py
8902 aVec = self.MakeLine(aPoint,aDir)
8903 # note: auto-publishing is done in self.MultiRotate2D()
8904 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8907 # end of l3_transform
8910 ## @addtogroup l3_transform_d
8913 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8914 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8916 Deprecated method. Use MultiRotate1DNbTimes instead.
8918 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8919 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8921 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8922 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8923 @ManageTransactions("TrsfOp")
8924 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8926 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8927 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8930 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8932 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8933 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8934 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8935 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8936 anObj.SetParameters(Parameters)
8937 self._autoPublish(anObj, theName, "multirotation")
8940 ## The same, as MultiRotate1D(), but axis is given by direction and point
8941 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8942 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8944 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8945 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8948 pz = geompy.MakeVertex(0, 0, 100)
8949 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8950 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8952 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8953 aVec = self.MakeLine(aPoint,aDir)
8954 # note: auto-publishing is done in self.MultiRotate1D()
8955 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8958 ## The same, as MultiRotate2D(), but axis is given by direction and point
8959 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8960 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8962 The same, as MultiRotate2D(), but axis is given by direction and point
8963 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8966 pz = geompy.MakeVertex(0, 0, 100)
8967 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8968 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8970 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8971 aVec = self.MakeLine(aPoint,aDir)
8972 # note: auto-publishing is done in self.MultiRotate2D()
8973 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8976 # end of l3_transform_d
8979 ## @addtogroup l3_local
8982 ## Perform a fillet on all edges of the given shape.
8983 # @param theShape Shape, to perform fillet on.
8984 # @param theR Fillet radius.
8985 # @param theName Object name; when specified, this parameter is used
8986 # for result publication in the study. Otherwise, if automatic
8987 # publication is switched on, default value is used for result name.
8989 # @return New GEOM.GEOM_Object, containing the result shape.
8991 # @ref tui_fillet "Example 1"
8992 # \n @ref swig_MakeFilletAll "Example 2"
8993 @ManageTransactions("LocalOp")
8994 def MakeFilletAll(self, theShape, theR, theName=None):
8996 Perform a fillet on all edges of the given shape.
8999 theShape Shape, to perform fillet on.
9001 theName Object name; when specified, this parameter is used
9002 for result publication in the study. Otherwise, if automatic
9003 publication is switched on, default value is used for result name.
9006 New GEOM.GEOM_Object, containing the result shape.
9009 filletall = geompy.MakeFilletAll(prism, 10.)
9011 # Example: see GEOM_TestOthers.py
9012 theR,Parameters = ParseParameters(theR)
9013 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9014 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9015 anObj.SetParameters(Parameters)
9016 self._autoPublish(anObj, theName, "fillet")
9019 ## Perform a fillet on the specified edges/faces of the given shape
9020 # @param theShape Shape, to perform fillet on.
9021 # @param theR Fillet radius.
9022 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9023 # @param theListShapes Global indices of edges/faces to perform fillet on.
9024 # @param theName Object name; when specified, this parameter is used
9025 # for result publication in the study. Otherwise, if automatic
9026 # publication is switched on, default value is used for result name.
9028 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9030 # @return New GEOM.GEOM_Object, containing the result shape.
9032 # @ref tui_fillet "Example"
9033 @ManageTransactions("LocalOp")
9034 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9036 Perform a fillet on the specified edges/faces of the given shape
9039 theShape Shape, to perform fillet on.
9041 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9042 theListShapes Global indices of edges/faces to perform fillet on.
9043 theName Object name; when specified, this parameter is used
9044 for result publication in the study. Otherwise, if automatic
9045 publication is switched on, default value is used for result name.
9048 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9051 New GEOM.GEOM_Object, containing the result shape.
9054 # get the list of IDs (IDList) for the fillet
9055 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9057 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9058 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9059 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9060 # make a fillet on the specified edges of the given shape
9061 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9063 # Example: see GEOM_TestAll.py
9064 theR,Parameters = ParseParameters(theR)
9066 if theShapeType == self.ShapeType["EDGE"]:
9067 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9068 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9070 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9071 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9072 anObj.SetParameters(Parameters)
9073 self._autoPublish(anObj, theName, "fillet")
9076 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9077 @ManageTransactions("LocalOp")
9078 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9080 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9083 # get the list of IDs (IDList) for the fillet
9084 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9086 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9087 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9088 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9089 # make a fillet on the specified edges of the given shape
9090 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9092 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9094 if theShapeType == self.ShapeType["EDGE"]:
9095 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9096 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9098 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9099 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9100 anObj.SetParameters(Parameters)
9101 self._autoPublish(anObj, theName, "fillet")
9104 ## Perform a fillet on the specified edges of the given shape
9105 # @param theShape Wire Shape to perform fillet on.
9106 # @param theR Fillet radius.
9107 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9108 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9109 # \note The list of vertices could be empty,
9110 # in this case fillet will done done at all vertices in wire
9111 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9112 # by the length of the edges, nearest to the fillet vertex.
9113 # But sometimes the next edge is C1 continuous with the one, nearest to
9114 # the fillet point, and such two (or more) edges can be united to allow
9115 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9116 # thus ignoring the secant vertex (vertices).
9117 # @param theName Object name; when specified, this parameter is used
9118 # for result publication in the study. Otherwise, if automatic
9119 # publication is switched on, default value is used for result name.
9121 # @return New GEOM.GEOM_Object, containing the result shape.
9123 # @ref tui_fillet2d "Example"
9124 @ManageTransactions("LocalOp")
9125 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9127 Perform a fillet on the specified edges of the given shape
9130 theShape Wire Shape to perform fillet on.
9132 theListOfVertexes Global indices of vertexes to perform fillet on.
9133 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9134 by the length of the edges, nearest to the fillet vertex.
9135 But sometimes the next edge is C1 continuous with the one, nearest to
9136 the fillet point, and such two (or more) edges can be united to allow
9137 bigger radius. Set this flag to TRUE to allow collinear edges union,
9138 thus ignoring the secant vertex (vertices).
9139 theName Object name; when specified, this parameter is used
9140 for result publication in the study. Otherwise, if automatic
9141 publication is switched on, default value is used for result name.
9143 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9145 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9148 New GEOM.GEOM_Object, containing the result shape.
9152 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9153 # make fillet at given wire vertices with giver radius
9154 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9156 # Example: see GEOM_TestAll.py
9157 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9158 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9159 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9160 anObj.SetParameters(Parameters)
9161 self._autoPublish(anObj, theName, "fillet")
9164 ## Perform a fillet at the specified vertices of the given face/shell.
9165 # @param theShape Face or Shell shape to perform fillet on.
9166 # @param theR Fillet radius.
9167 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9168 # @param theName Object name; when specified, this parameter is used
9169 # for result publication in the study. Otherwise, if automatic
9170 # publication is switched on, default value is used for result name.
9172 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9174 # @return New GEOM.GEOM_Object, containing the result shape.
9176 # @ref tui_fillet2d "Example"
9177 @ManageTransactions("LocalOp")
9178 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9180 Perform a fillet at the specified vertices of the given face/shell.
9183 theShape Face or Shell shape to perform fillet on.
9185 theListOfVertexes Global indices of vertexes to perform fillet on.
9186 theName Object name; when specified, this parameter is used
9187 for result publication in the study. Otherwise, if automatic
9188 publication is switched on, default value is used for result name.
9190 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9193 New GEOM.GEOM_Object, containing the result shape.
9196 face = geompy.MakeFaceHW(100, 100, 1)
9197 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9199 # Example: see GEOM_TestAll.py
9200 theR,Parameters = ParseParameters(theR)
9201 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9202 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9203 anObj.SetParameters(Parameters)
9204 self._autoPublish(anObj, theName, "fillet")
9207 ## Perform a symmetric chamfer on all edges of the given shape.
9208 # @param theShape Shape, to perform chamfer on.
9209 # @param theD Chamfer size along each face.
9210 # @param theName Object name; when specified, this parameter is used
9211 # for result publication in the study. Otherwise, if automatic
9212 # publication is switched on, default value is used for result name.
9214 # @return New GEOM.GEOM_Object, containing the result shape.
9216 # @ref tui_chamfer "Example 1"
9217 # \n @ref swig_MakeChamferAll "Example 2"
9218 @ManageTransactions("LocalOp")
9219 def MakeChamferAll(self, theShape, theD, theName=None):
9221 Perform a symmetric chamfer on all edges of the given shape.
9224 theShape Shape, to perform chamfer on.
9225 theD Chamfer size along each face.
9226 theName Object name; when specified, this parameter is used
9227 for result publication in the study. Otherwise, if automatic
9228 publication is switched on, default value is used for result name.
9231 New GEOM.GEOM_Object, containing the result shape.
9234 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9236 # Example: see GEOM_TestOthers.py
9237 theD,Parameters = ParseParameters(theD)
9238 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9239 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9240 anObj.SetParameters(Parameters)
9241 self._autoPublish(anObj, theName, "chamfer")
9244 ## Perform a chamfer on edges, common to the specified faces,
9245 # with distance D1 on the Face1
9246 # @param theShape Shape, to perform chamfer on.
9247 # @param theD1 Chamfer size along \a theFace1.
9248 # @param theD2 Chamfer size along \a theFace2.
9249 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9250 # @param theName Object name; when specified, this parameter is used
9251 # for result publication in the study. Otherwise, if automatic
9252 # publication is switched on, default value is used for result name.
9254 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9256 # @return New GEOM.GEOM_Object, containing the result shape.
9258 # @ref tui_chamfer "Example"
9259 @ManageTransactions("LocalOp")
9260 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9262 Perform a chamfer on edges, common to the specified faces,
9263 with distance D1 on the Face1
9266 theShape Shape, to perform chamfer on.
9267 theD1 Chamfer size along theFace1.
9268 theD2 Chamfer size along theFace2.
9269 theFace1,theFace2 Global indices of two faces of theShape.
9270 theName Object name; when specified, this parameter is used
9271 for result publication in the study. Otherwise, if automatic
9272 publication is switched on, default value is used for result name.
9275 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9278 New GEOM.GEOM_Object, containing the result shape.
9281 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9282 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9283 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9284 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9286 # Example: see GEOM_TestAll.py
9287 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9288 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9289 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9290 anObj.SetParameters(Parameters)
9291 self._autoPublish(anObj, theName, "chamfer")
9294 ## Perform a chamfer on edges
9295 # @param theShape Shape, to perform chamfer on.
9296 # @param theD Chamfer length
9297 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9298 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9299 # @param theName Object name; when specified, this parameter is used
9300 # for result publication in the study. Otherwise, if automatic
9301 # publication is switched on, default value is used for result name.
9303 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9305 # @return New GEOM.GEOM_Object, containing the result shape.
9306 @ManageTransactions("LocalOp")
9307 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9309 Perform a chamfer on edges
9312 theShape Shape, to perform chamfer on.
9313 theD1 Chamfer size along theFace1.
9314 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9315 theFace1,theFace2 Global indices of two faces of theShape.
9316 theName Object name; when specified, this parameter is used
9317 for result publication in the study. Otherwise, if automatic
9318 publication is switched on, default value is used for result name.
9321 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9324 New GEOM.GEOM_Object, containing the result shape.
9327 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9328 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9329 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9331 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9334 if isinstance(theAngle,str):
9336 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9338 theAngle = theAngle*math.pi/180.0
9339 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9340 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9341 anObj.SetParameters(Parameters)
9342 self._autoPublish(anObj, theName, "chamfer")
9345 ## Perform a chamfer on all edges of the specified faces,
9346 # with distance D1 on the first specified face (if several for one edge)
9347 # @param theShape Shape, to perform chamfer on.
9348 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9349 # connected to the edge, are in \a theFaces, \a theD1
9350 # will be get along face, which is nearer to \a theFaces beginning.
9351 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9352 # @param theFaces Sequence of global indices of faces of \a theShape.
9353 # @param theName Object name; when specified, this parameter is used
9354 # for result publication in the study. Otherwise, if automatic
9355 # publication is switched on, default value is used for result name.
9357 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9359 # @return New GEOM.GEOM_Object, containing the result shape.
9361 # @ref tui_chamfer "Example"
9362 @ManageTransactions("LocalOp")
9363 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9365 Perform a chamfer on all edges of the specified faces,
9366 with distance D1 on the first specified face (if several for one edge)
9369 theShape Shape, to perform chamfer on.
9370 theD1 Chamfer size along face from theFaces. If both faces,
9371 connected to the edge, are in theFaces, theD1
9372 will be get along face, which is nearer to theFaces beginning.
9373 theD2 Chamfer size along another of two faces, connected to the edge.
9374 theFaces Sequence of global indices of faces of theShape.
9375 theName Object name; when specified, this parameter is used
9376 for result publication in the study. Otherwise, if automatic
9377 publication is switched on, default value is used for result name.
9379 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9382 New GEOM.GEOM_Object, containing the result shape.
9384 # Example: see GEOM_TestAll.py
9385 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9386 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9387 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9388 anObj.SetParameters(Parameters)
9389 self._autoPublish(anObj, theName, "chamfer")
9392 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9393 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9395 # @ref swig_FilletChamfer "Example"
9396 @ManageTransactions("LocalOp")
9397 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9399 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9400 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9403 if isinstance(theAngle,str):
9405 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9407 theAngle = theAngle*math.pi/180.0
9408 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9409 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9410 anObj.SetParameters(Parameters)
9411 self._autoPublish(anObj, theName, "chamfer")
9414 ## Perform a chamfer on edges,
9415 # with distance D1 on the first specified face (if several for one edge)
9416 # @param theShape Shape, to perform chamfer on.
9417 # @param theD1,theD2 Chamfer size
9418 # @param theEdges Sequence of edges of \a theShape.
9419 # @param theName Object name; when specified, this parameter is used
9420 # for result publication in the study. Otherwise, if automatic
9421 # publication is switched on, default value is used for result name.
9423 # @return New GEOM.GEOM_Object, containing the result shape.
9425 # @ref swig_FilletChamfer "Example"
9426 @ManageTransactions("LocalOp")
9427 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9429 Perform a chamfer on edges,
9430 with distance D1 on the first specified face (if several for one edge)
9433 theShape Shape, to perform chamfer on.
9434 theD1,theD2 Chamfer size
9435 theEdges Sequence of edges of theShape.
9436 theName Object name; when specified, this parameter is used
9437 for result publication in the study. Otherwise, if automatic
9438 publication is switched on, default value is used for result name.
9441 New GEOM.GEOM_Object, containing the result shape.
9443 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9444 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9445 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9446 anObj.SetParameters(Parameters)
9447 self._autoPublish(anObj, theName, "chamfer")
9450 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9451 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9452 @ManageTransactions("LocalOp")
9453 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9455 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9456 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9459 if isinstance(theAngle,str):
9461 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9463 theAngle = theAngle*math.pi/180.0
9464 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9465 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9466 anObj.SetParameters(Parameters)
9467 self._autoPublish(anObj, theName, "chamfer")
9470 ## @sa MakeChamferEdge(), MakeChamferFaces()
9472 # @ref swig_MakeChamfer "Example"
9473 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9475 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9477 # Example: see GEOM_TestOthers.py
9479 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9480 if aShapeType == self.ShapeType["EDGE"]:
9481 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9483 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9486 ## Remove material from a solid by extrusion of the base shape on the given distance.
9487 # @param theInit Shape to remove material from. It must be a solid or
9488 # a compound made of a single solid.
9489 # @param theBase Closed edge or wire defining the base shape to be extruded.
9490 # @param theH Prism dimension along the normal to theBase
9491 # @param theAngle Draft angle in degrees.
9492 # @param theName Object name; when specified, this parameter is used
9493 # for result publication in the study. Otherwise, if automatic
9494 # publication is switched on, default value is used for result name.
9496 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9498 # @ref tui_creation_prism "Example"
9499 @ManageTransactions("PrimOp")
9500 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9502 Add material to a solid by extrusion of the base shape on the given distance.
9505 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9506 theBase Closed edge or wire defining the base shape to be extruded.
9507 theH Prism dimension along the normal to theBase
9508 theAngle Draft angle in degrees.
9509 theName Object name; when specified, this parameter is used
9510 for result publication in the study. Otherwise, if automatic
9511 publication is switched on, default value is used for result name.
9514 New GEOM.GEOM_Object, containing the initial shape with removed material.
9516 # Example: see GEOM_TestAll.py
9517 #theH,Parameters = ParseParameters(theH)
9518 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9519 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9520 #anObj.SetParameters(Parameters)
9521 self._autoPublish(anObj, theName, "extrudedCut")
9524 ## Add material to a solid by extrusion of the base shape on the given distance.
9525 # @param theInit Shape to add material to. It must be a solid or
9526 # a compound made of a single solid.
9527 # @param theBase Closed edge or wire defining the base shape to be extruded.
9528 # @param theH Prism dimension along the normal to theBase
9529 # @param theAngle Draft angle in degrees.
9530 # @param theName Object name; when specified, this parameter is used
9531 # for result publication in the study. Otherwise, if automatic
9532 # publication is switched on, default value is used for result name.
9534 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9536 # @ref tui_creation_prism "Example"
9537 @ManageTransactions("PrimOp")
9538 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9540 Add material to a solid by extrusion of the base shape on the given distance.
9543 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9544 theBase Closed edge or wire defining the base shape to be extruded.
9545 theH Prism dimension along the normal to theBase
9546 theAngle Draft angle in degrees.
9547 theName Object name; when specified, this parameter is used
9548 for result publication in the study. Otherwise, if automatic
9549 publication is switched on, default value is used for result name.
9552 New GEOM.GEOM_Object, containing the initial shape with added material.
9554 # Example: see GEOM_TestAll.py
9555 #theH,Parameters = ParseParameters(theH)
9556 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9557 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9558 #anObj.SetParameters(Parameters)
9559 self._autoPublish(anObj, theName, "extrudedBoss")
9565 ## @addtogroup l3_basic_op
9568 ## Perform an Archimde operation on the given shape with given parameters.
9569 # The object presenting the resulting face is returned.
9570 # @param theShape Shape to be put in water.
9571 # @param theWeight Weight og the shape.
9572 # @param theWaterDensity Density of the water.
9573 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9574 # @param theName Object name; when specified, this parameter is used
9575 # for result publication in the study. Otherwise, if automatic
9576 # publication is switched on, default value is used for result name.
9578 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9579 # by a plane, corresponding to water level.
9581 # @ref tui_archimede "Example"
9582 @ManageTransactions("LocalOp")
9583 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9585 Perform an Archimde operation on the given shape with given parameters.
9586 The object presenting the resulting face is returned.
9589 theShape Shape to be put in water.
9590 theWeight Weight og the shape.
9591 theWaterDensity Density of the water.
9592 theMeshDeflection Deflection of the mesh, using to compute the section.
9593 theName Object name; when specified, this parameter is used
9594 for result publication in the study. Otherwise, if automatic
9595 publication is switched on, default value is used for result name.
9598 New GEOM.GEOM_Object, containing a section of theShape
9599 by a plane, corresponding to water level.
9601 # Example: see GEOM_TestAll.py
9602 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9603 theWeight,theWaterDensity,theMeshDeflection)
9604 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9605 RaiseIfFailed("MakeArchimede", self.LocalOp)
9606 anObj.SetParameters(Parameters)
9607 self._autoPublish(anObj, theName, "archimede")
9610 # end of l3_basic_op
9613 ## @addtogroup l2_measure
9616 ## Get point coordinates
9619 # @ref tui_measurement_tools_page "Example"
9620 @ManageTransactions("MeasuOp")
9621 def PointCoordinates(self,Point):
9623 Get point coordinates
9628 # Example: see GEOM_TestMeasures.py
9629 aTuple = self.MeasuOp.PointCoordinates(Point)
9630 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9633 ## Get vector coordinates
9636 # @ref tui_measurement_tools_page "Example"
9637 def VectorCoordinates(self,Vector):
9639 Get vector coordinates
9645 p1=self.GetFirstVertex(Vector)
9646 p2=self.GetLastVertex(Vector)
9648 X1=self.PointCoordinates(p1)
9649 X2=self.PointCoordinates(p2)
9651 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9654 ## Compute cross product
9655 # @return vector w=u^v
9657 # @ref tui_measurement_tools_page "Example"
9658 def CrossProduct(self, Vector1, Vector2):
9660 Compute cross product
9662 Returns: vector w=u^v
9664 u=self.VectorCoordinates(Vector1)
9665 v=self.VectorCoordinates(Vector2)
9666 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])
9670 ## Compute cross product
9671 # @return dot product p=u.v
9673 # @ref tui_measurement_tools_page "Example"
9674 def DotProduct(self, Vector1, Vector2):
9676 Compute cross product
9678 Returns: dot product p=u.v
9680 u=self.VectorCoordinates(Vector1)
9681 v=self.VectorCoordinates(Vector2)
9682 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9687 ## Get summarized length of all wires,
9688 # area of surface and volume of the given shape.
9689 # @param theShape Shape to define properties of.
9690 # @return [theLength, theSurfArea, theVolume]\n
9691 # theLength: Summarized length of all wires of the given shape.\n
9692 # theSurfArea: Area of surface of the given shape.\n
9693 # theVolume: Volume of the given shape.
9695 # @ref tui_measurement_tools_page "Example"
9696 @ManageTransactions("MeasuOp")
9697 def BasicProperties(self,theShape):
9699 Get summarized length of all wires,
9700 area of surface and volume of the given shape.
9703 theShape Shape to define properties of.
9706 [theLength, theSurfArea, theVolume]
9707 theLength: Summarized length of all wires of the given shape.
9708 theSurfArea: Area of surface of the given shape.
9709 theVolume: Volume of the given shape.
9711 # Example: see GEOM_TestMeasures.py
9712 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9713 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9716 ## Get parameters of bounding box of the given shape
9717 # @param theShape Shape to obtain bounding box of.
9718 # @param precise TRUE for precise computation; FALSE for fast one.
9719 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9720 # Xmin,Xmax: Limits of shape along OX axis.
9721 # Ymin,Ymax: Limits of shape along OY axis.
9722 # Zmin,Zmax: Limits of shape along OZ axis.
9724 # @ref tui_measurement_tools_page "Example"
9725 @ManageTransactions("MeasuOp")
9726 def BoundingBox (self, theShape, precise=False):
9728 Get parameters of bounding box of the given shape
9731 theShape Shape to obtain bounding box of.
9732 precise TRUE for precise computation; FALSE for fast one.
9735 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9736 Xmin,Xmax: Limits of shape along OX axis.
9737 Ymin,Ymax: Limits of shape along OY axis.
9738 Zmin,Zmax: Limits of shape along OZ axis.
9740 # Example: see GEOM_TestMeasures.py
9741 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9742 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9745 ## Get bounding box of the given shape
9746 # @param theShape Shape to obtain bounding box of.
9747 # @param precise TRUE for precise computation; FALSE for fast one.
9748 # @param theName Object name; when specified, this parameter is used
9749 # for result publication in the study. Otherwise, if automatic
9750 # publication is switched on, default value is used for result name.
9752 # @return New GEOM.GEOM_Object, containing the created box.
9754 # @ref tui_measurement_tools_page "Example"
9755 @ManageTransactions("MeasuOp")
9756 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9758 Get bounding box of the given shape
9761 theShape Shape to obtain bounding box of.
9762 precise TRUE for precise computation; FALSE for fast one.
9763 theName Object name; when specified, this parameter is used
9764 for result publication in the study. Otherwise, if automatic
9765 publication is switched on, default value is used for result name.
9768 New GEOM.GEOM_Object, containing the created box.
9770 # Example: see GEOM_TestMeasures.py
9771 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9772 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9773 self._autoPublish(anObj, theName, "bndbox")
9776 ## Get inertia matrix and moments of inertia of theShape.
9777 # @param theShape Shape to calculate inertia of.
9778 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9779 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9780 # Ix,Iy,Iz: Moments of inertia of the given shape.
9782 # @ref tui_measurement_tools_page "Example"
9783 @ManageTransactions("MeasuOp")
9784 def Inertia(self,theShape):
9786 Get inertia matrix and moments of inertia of theShape.
9789 theShape Shape to calculate inertia of.
9792 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9793 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9794 Ix,Iy,Iz: Moments of inertia of the given shape.
9796 # Example: see GEOM_TestMeasures.py
9797 aTuple = self.MeasuOp.GetInertia(theShape)
9798 RaiseIfFailed("GetInertia", self.MeasuOp)
9801 ## Get if coords are included in the shape (ST_IN or ST_ON)
9802 # @param theShape Shape
9803 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9804 # @param tolerance to be used (default is 1.0e-7)
9805 # @return list_of_boolean = [res1, res2, ...]
9806 @ManageTransactions("MeasuOp")
9807 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9809 Get if coords are included in the shape (ST_IN or ST_ON)
9813 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9814 tolerance to be used (default is 1.0e-7)
9817 list_of_boolean = [res1, res2, ...]
9819 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9821 ## Get minimal distance between the given shapes.
9822 # @param theShape1,theShape2 Shapes to find minimal distance between.
9823 # @return Value of the minimal distance between the given shapes.
9825 # @ref tui_measurement_tools_page "Example"
9826 @ManageTransactions("MeasuOp")
9827 def MinDistance(self, theShape1, theShape2):
9829 Get minimal distance between the given shapes.
9832 theShape1,theShape2 Shapes to find minimal distance between.
9835 Value of the minimal distance between the given shapes.
9837 # Example: see GEOM_TestMeasures.py
9838 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9839 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9842 ## Get minimal distance between the given shapes.
9843 # @param theShape1,theShape2 Shapes to find minimal distance between.
9844 # @return Value of the minimal distance between the given shapes, in form of list
9845 # [Distance, DX, DY, DZ].
9847 # @ref swig_all_measure "Example"
9848 @ManageTransactions("MeasuOp")
9849 def MinDistanceComponents(self, theShape1, theShape2):
9851 Get minimal distance between the given shapes.
9854 theShape1,theShape2 Shapes to find minimal distance between.
9857 Value of the minimal distance between the given shapes, in form of list
9858 [Distance, DX, DY, DZ]
9860 # Example: see GEOM_TestMeasures.py
9861 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9862 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9863 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9866 ## Get closest points of the given shapes.
9867 # @param theShape1,theShape2 Shapes to find closest points of.
9868 # @return The number of found solutions (-1 in case of infinite number of
9869 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9871 # @ref tui_measurement_tools_page "Example"
9872 @ManageTransactions("MeasuOp")
9873 def ClosestPoints (self, theShape1, theShape2):
9875 Get closest points of the given shapes.
9878 theShape1,theShape2 Shapes to find closest points of.
9881 The number of found solutions (-1 in case of infinite number of
9882 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9884 # Example: see GEOM_TestMeasures.py
9885 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9886 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9889 ## Get angle between the given shapes in degrees.
9890 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9891 # @note If both arguments are vectors, the angle is computed in accordance
9892 # with their orientations, otherwise the minimum angle is computed.
9893 # @return Value of the angle between the given shapes in degrees.
9895 # @ref tui_measurement_tools_page "Example"
9896 @ManageTransactions("MeasuOp")
9897 def GetAngle(self, theShape1, theShape2):
9899 Get angle between the given shapes in degrees.
9902 theShape1,theShape2 Lines or linear edges to find angle between.
9905 If both arguments are vectors, the angle is computed in accordance
9906 with their orientations, otherwise the minimum angle is computed.
9909 Value of the angle between the given shapes in degrees.
9911 # Example: see GEOM_TestMeasures.py
9912 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9913 RaiseIfFailed("GetAngle", self.MeasuOp)
9916 ## Get angle between the given shapes in radians.
9917 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9918 # @note If both arguments are vectors, the angle is computed in accordance
9919 # with their orientations, otherwise the minimum angle is computed.
9920 # @return Value of the angle between the given shapes in radians.
9922 # @ref tui_measurement_tools_page "Example"
9923 @ManageTransactions("MeasuOp")
9924 def GetAngleRadians(self, theShape1, theShape2):
9926 Get angle between the given shapes in radians.
9929 theShape1,theShape2 Lines or linear edges to find angle between.
9933 If both arguments are vectors, the angle is computed in accordance
9934 with their orientations, otherwise the minimum angle is computed.
9937 Value of the angle between the given shapes in radians.
9939 # Example: see GEOM_TestMeasures.py
9940 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9941 RaiseIfFailed("GetAngle", self.MeasuOp)
9944 ## Get angle between the given vectors in degrees.
9945 # @param theShape1,theShape2 Vectors to find angle between.
9946 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9947 # if False, the opposite vector to the normal vector is used.
9948 # @return Value of the angle between the given vectors in degrees.
9950 # @ref tui_measurement_tools_page "Example"
9951 @ManageTransactions("MeasuOp")
9952 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9954 Get angle between the given vectors in degrees.
9957 theShape1,theShape2 Vectors to find angle between.
9958 theFlag If True, the normal vector is defined by the two vectors cross,
9959 if False, the opposite vector to the normal vector is used.
9962 Value of the angle between the given vectors in degrees.
9964 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9966 anAngle = 360. - anAngle
9967 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9970 ## The same as GetAngleVectors, but the result is in radians.
9971 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9973 Get angle between the given vectors in radians.
9976 theShape1,theShape2 Vectors to find angle between.
9977 theFlag If True, the normal vector is defined by the two vectors cross,
9978 if False, the opposite vector to the normal vector is used.
9981 Value of the angle between the given vectors in radians.
9983 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9986 ## @name Curve Curvature Measurement
9987 # Methods for receiving radius of curvature of curves
9988 # in the given point
9991 ## Measure curvature of a curve at a point, set by parameter.
9992 # @param theCurve a curve.
9993 # @param theParam parameter.
9994 # @return radius of curvature of \a theCurve.
9996 # @ref swig_todo "Example"
9997 @ManageTransactions("MeasuOp")
9998 def CurveCurvatureByParam(self, theCurve, theParam):
10000 Measure curvature of a curve at a point, set by parameter.
10004 theParam parameter.
10007 radius of curvature of theCurve.
10009 # Example: see GEOM_TestMeasures.py
10010 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10011 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10014 ## Measure curvature of a curve at a point.
10015 # @param theCurve a curve.
10016 # @param thePoint given point.
10017 # @return radius of curvature of \a theCurve.
10019 # @ref swig_todo "Example"
10020 @ManageTransactions("MeasuOp")
10021 def CurveCurvatureByPoint(self, theCurve, thePoint):
10023 Measure curvature of a curve at a point.
10027 thePoint given point.
10030 radius of curvature of theCurve.
10032 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10033 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10037 ## @name Surface Curvature Measurement
10038 # Methods for receiving max and min radius of curvature of surfaces
10039 # in the given point
10042 ## Measure max radius of curvature of surface.
10043 # @param theSurf the given surface.
10044 # @param theUParam Value of U-parameter on the referenced surface.
10045 # @param theVParam Value of V-parameter on the referenced surface.
10046 # @return max radius of curvature of theSurf.
10048 ## @ref swig_todo "Example"
10049 @ManageTransactions("MeasuOp")
10050 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10052 Measure max radius of curvature of surface.
10055 theSurf the given surface.
10056 theUParam Value of U-parameter on the referenced surface.
10057 theVParam Value of V-parameter on the referenced surface.
10060 max radius of curvature of theSurf.
10062 # Example: see GEOM_TestMeasures.py
10063 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10064 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10067 ## Measure max radius of curvature of surface in the given point
10068 # @param theSurf the given surface.
10069 # @param thePoint given point.
10070 # @return max radius of curvature of theSurf.
10072 ## @ref swig_todo "Example"
10073 @ManageTransactions("MeasuOp")
10074 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10076 Measure max radius of curvature of surface in the given point.
10079 theSurf the given surface.
10080 thePoint given point.
10083 max radius of curvature of theSurf.
10085 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10086 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10089 ## Measure min radius of curvature of surface.
10090 # @param theSurf the given surface.
10091 # @param theUParam Value of U-parameter on the referenced surface.
10092 # @param theVParam Value of V-parameter on the referenced surface.
10093 # @return min radius of curvature of theSurf.
10095 ## @ref swig_todo "Example"
10096 @ManageTransactions("MeasuOp")
10097 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10099 Measure min radius of curvature of surface.
10102 theSurf the given surface.
10103 theUParam Value of U-parameter on the referenced surface.
10104 theVParam Value of V-parameter on the referenced surface.
10107 Min radius of curvature of theSurf.
10109 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10110 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10113 ## Measure min radius of curvature of surface in the given point
10114 # @param theSurf the given surface.
10115 # @param thePoint given point.
10116 # @return min radius of curvature of theSurf.
10118 ## @ref swig_todo "Example"
10119 @ManageTransactions("MeasuOp")
10120 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10122 Measure min radius of curvature of surface in the given point.
10125 theSurf the given surface.
10126 thePoint given point.
10129 Min radius of curvature of theSurf.
10131 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10132 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10136 ## Get min and max tolerances of sub-shapes of theShape
10137 # @param theShape Shape, to get tolerances of.
10138 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10139 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10140 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10141 # VertMin,VertMax: Min and max tolerances of the vertices.
10143 # @ref tui_measurement_tools_page "Example"
10144 @ManageTransactions("MeasuOp")
10145 def Tolerance(self,theShape):
10147 Get min and max tolerances of sub-shapes of theShape
10150 theShape Shape, to get tolerances of.
10153 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10154 FaceMin,FaceMax: Min and max tolerances of the faces.
10155 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10156 VertMin,VertMax: Min and max tolerances of the vertices.
10158 # Example: see GEOM_TestMeasures.py
10159 aTuple = self.MeasuOp.GetTolerance(theShape)
10160 RaiseIfFailed("GetTolerance", self.MeasuOp)
10163 ## Obtain description of the given shape (number of sub-shapes of each type)
10164 # @param theShape Shape to be described.
10165 # @return Description of the given shape.
10167 # @ref tui_measurement_tools_page "Example"
10168 @ManageTransactions("MeasuOp")
10169 def WhatIs(self,theShape):
10171 Obtain description of the given shape (number of sub-shapes of each type)
10174 theShape Shape to be described.
10177 Description of the given shape.
10179 # Example: see GEOM_TestMeasures.py
10180 aDescr = self.MeasuOp.WhatIs(theShape)
10181 RaiseIfFailed("WhatIs", self.MeasuOp)
10184 ## Obtain quantity of shapes of the given type in \a theShape.
10185 # If \a theShape is of type \a theType, it is also counted.
10186 # @param theShape Shape to be described.
10187 # @param theType the given ShapeType().
10188 # @return Quantity of shapes of type \a theType in \a theShape.
10190 # @ref tui_measurement_tools_page "Example"
10191 def NbShapes (self, theShape, theType):
10193 Obtain quantity of shapes of the given type in theShape.
10194 If theShape is of type theType, it is also counted.
10197 theShape Shape to be described.
10198 theType the given geompy.ShapeType
10201 Quantity of shapes of type theType in theShape.
10203 # Example: see GEOM_TestMeasures.py
10204 listSh = self.SubShapeAllIDs(theShape, theType)
10208 ## Obtain quantity of shapes of each type in \a theShape.
10209 # The \a theShape is also counted.
10210 # @param theShape Shape to be described.
10211 # @return Dictionary of ShapeType() with bound quantities of shapes.
10213 # @ref tui_measurement_tools_page "Example"
10214 def ShapeInfo (self, theShape):
10216 Obtain quantity of shapes of each type in theShape.
10217 The theShape is also counted.
10220 theShape Shape to be described.
10223 Dictionary of geompy.ShapeType with bound quantities of shapes.
10225 # Example: see GEOM_TestMeasures.py
10227 for typeSh in self.ShapeType:
10228 if typeSh in ( "AUTO", "SHAPE" ): continue
10229 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10235 def GetCreationInformation(self, theShape):
10236 info = theShape.GetCreationInformation()
10238 opName = info.operationName
10239 if not opName: opName = "no info available"
10240 res = "Operation: " + opName
10242 for parVal in info.params:
10243 res += " \n %s = %s" % ( parVal.name, parVal.value )
10246 ## Get a point, situated at the centre of mass of theShape.
10247 # @param theShape Shape to define centre of mass of.
10248 # @param theName Object name; when specified, this parameter is used
10249 # for result publication in the study. Otherwise, if automatic
10250 # publication is switched on, default value is used for result name.
10252 # @return New GEOM.GEOM_Object, containing the created point.
10254 # @ref tui_measurement_tools_page "Example"
10255 @ManageTransactions("MeasuOp")
10256 def MakeCDG(self, theShape, theName=None):
10258 Get a point, situated at the centre of mass of theShape.
10261 theShape Shape to define centre of mass of.
10262 theName Object name; when specified, this parameter is used
10263 for result publication in the study. Otherwise, if automatic
10264 publication is switched on, default value is used for result name.
10267 New GEOM.GEOM_Object, containing the created point.
10269 # Example: see GEOM_TestMeasures.py
10270 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10271 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10272 self._autoPublish(anObj, theName, "centerOfMass")
10275 ## Get a vertex sub-shape by index depended with orientation.
10276 # @param theShape Shape to find sub-shape.
10277 # @param theIndex Index to find vertex by this index (starting from zero)
10278 # @param theName Object name; when specified, this parameter is used
10279 # for result publication in the study. Otherwise, if automatic
10280 # publication is switched on, default value is used for result name.
10282 # @return New GEOM.GEOM_Object, containing the created vertex.
10284 # @ref tui_measurement_tools_page "Example"
10285 @ManageTransactions("MeasuOp")
10286 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10288 Get a vertex sub-shape by index depended with orientation.
10291 theShape Shape to find sub-shape.
10292 theIndex Index to find vertex by this index (starting from zero)
10293 theName Object name; when specified, this parameter is used
10294 for result publication in the study. Otherwise, if automatic
10295 publication is switched on, default value is used for result name.
10298 New GEOM.GEOM_Object, containing the created vertex.
10300 # Example: see GEOM_TestMeasures.py
10301 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10302 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10303 self._autoPublish(anObj, theName, "vertex")
10306 ## Get the first vertex of wire/edge depended orientation.
10307 # @param theShape Shape to find first vertex.
10308 # @param theName Object name; when specified, this parameter is used
10309 # for result publication in the study. Otherwise, if automatic
10310 # publication is switched on, default value is used for result name.
10312 # @return New GEOM.GEOM_Object, containing the created vertex.
10314 # @ref tui_measurement_tools_page "Example"
10315 def GetFirstVertex(self, theShape, theName=None):
10317 Get the first vertex of wire/edge depended orientation.
10320 theShape Shape to find first vertex.
10321 theName Object name; when specified, this parameter is used
10322 for result publication in the study. Otherwise, if automatic
10323 publication is switched on, default value is used for result name.
10326 New GEOM.GEOM_Object, containing the created vertex.
10328 # Example: see GEOM_TestMeasures.py
10329 # note: auto-publishing is done in self.GetVertexByIndex()
10330 return self.GetVertexByIndex(theShape, 0, theName)
10332 ## Get the last vertex of wire/edge depended orientation.
10333 # @param theShape Shape to find last vertex.
10334 # @param theName Object name; when specified, this parameter is used
10335 # for result publication in the study. Otherwise, if automatic
10336 # publication is switched on, default value is used for result name.
10338 # @return New GEOM.GEOM_Object, containing the created vertex.
10340 # @ref tui_measurement_tools_page "Example"
10341 def GetLastVertex(self, theShape, theName=None):
10343 Get the last vertex of wire/edge depended orientation.
10346 theShape Shape to find last vertex.
10347 theName Object name; when specified, this parameter is used
10348 for result publication in the study. Otherwise, if automatic
10349 publication is switched on, default value is used for result name.
10352 New GEOM.GEOM_Object, containing the created vertex.
10354 # Example: see GEOM_TestMeasures.py
10355 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10356 # note: auto-publishing is done in self.GetVertexByIndex()
10357 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10359 ## Get a normale to the given face. If the point is not given,
10360 # the normale is calculated at the center of mass.
10361 # @param theFace Face to define normale of.
10362 # @param theOptionalPoint Point to compute the normale at.
10363 # @param theName Object name; when specified, this parameter is used
10364 # for result publication in the study. Otherwise, if automatic
10365 # publication is switched on, default value is used for result name.
10367 # @return New GEOM.GEOM_Object, containing the created vector.
10369 # @ref swig_todo "Example"
10370 @ManageTransactions("MeasuOp")
10371 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10373 Get a normale to the given face. If the point is not given,
10374 the normale is calculated at the center of mass.
10377 theFace Face to define normale of.
10378 theOptionalPoint Point to compute the normale at.
10379 theName Object name; when specified, this parameter is used
10380 for result publication in the study. Otherwise, if automatic
10381 publication is switched on, default value is used for result name.
10384 New GEOM.GEOM_Object, containing the created vector.
10386 # Example: see GEOM_TestMeasures.py
10387 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10388 RaiseIfFailed("GetNormal", self.MeasuOp)
10389 self._autoPublish(anObj, theName, "normal")
10392 ## Print shape errors obtained from CheckShape.
10393 # @param theShape Shape that was checked.
10394 # @param theShapeErrors the shape errors obtained by CheckShape.
10395 # @param theReturnStatus If 0 the description of problem is printed.
10396 # If 1 the description of problem is returned.
10397 # @return If theReturnStatus is equal to 1 the description is returned.
10398 # Otherwise doesn't return anything.
10400 # @ref tui_measurement_tools_page "Example"
10401 @ManageTransactions("MeasuOp")
10402 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10404 Print shape errors obtained from CheckShape.
10407 theShape Shape that was checked.
10408 theShapeErrors the shape errors obtained by CheckShape.
10409 theReturnStatus If 0 the description of problem is printed.
10410 If 1 the description of problem is returned.
10413 If theReturnStatus is equal to 1 the description is returned.
10414 Otherwise doesn't return anything.
10416 # Example: see GEOM_TestMeasures.py
10417 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10418 if theReturnStatus == 1:
10423 ## Check a topology of the given shape.
10424 # @param theShape Shape to check validity of.
10425 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10426 # if TRUE, the shape's geometry will be checked also.
10427 # @param theReturnStatus If 0 and if theShape is invalid, a description
10428 # of problem is printed.
10429 # If 1 isValid flag and the description of
10430 # problem is returned.
10431 # If 2 isValid flag and the list of error data
10433 # @return TRUE, if the shape "seems to be valid".
10434 # If theShape is invalid, prints a description of problem.
10435 # If theReturnStatus is equal to 1 the description is returned
10436 # along with IsValid flag.
10437 # If theReturnStatus is equal to 2 the list of error data is
10438 # returned along with IsValid flag.
10440 # @ref tui_measurement_tools_page "Example"
10441 @ManageTransactions("MeasuOp")
10442 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10444 Check a topology of the given shape.
10447 theShape Shape to check validity of.
10448 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10449 if TRUE, the shape's geometry will be checked also.
10450 theReturnStatus If 0 and if theShape is invalid, a description
10451 of problem is printed.
10452 If 1 IsValid flag and the description of
10453 problem is returned.
10454 If 2 IsValid flag and the list of error data
10458 TRUE, if the shape "seems to be valid".
10459 If theShape is invalid, prints a description of problem.
10460 If theReturnStatus is equal to 1 the description is returned
10461 along with IsValid flag.
10462 If theReturnStatus is equal to 2 the list of error data is
10463 returned along with IsValid flag.
10465 # Example: see GEOM_TestMeasures.py
10467 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10468 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10470 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10471 RaiseIfFailed("CheckShape", self.MeasuOp)
10473 if theReturnStatus == 0:
10474 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10476 if theReturnStatus == 1:
10477 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10478 return (IsValid, Descr)
10479 elif theReturnStatus == 2:
10480 return (IsValid, ShapeErrors)
10483 ## Detect self-intersections in the given shape.
10484 # @param theShape Shape to check.
10485 # @return TRUE, if the shape contains no self-intersections.
10487 # @ref tui_measurement_tools_page "Example"
10488 @ManageTransactions("MeasuOp")
10489 def CheckSelfIntersections(self, theShape):
10491 Detect self-intersections in the given shape.
10494 theShape Shape to check.
10497 TRUE, if the shape contains no self-intersections.
10499 # Example: see GEOM_TestMeasures.py
10500 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10501 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10504 ## Get position (LCS) of theShape.
10506 # Origin of the LCS is situated at the shape's center of mass.
10507 # Axes of the LCS are obtained from shape's location or,
10508 # if the shape is a planar face, from position of its plane.
10510 # @param theShape Shape to calculate position of.
10511 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10512 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10513 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10514 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10516 # @ref swig_todo "Example"
10517 @ManageTransactions("MeasuOp")
10518 def GetPosition(self,theShape):
10520 Get position (LCS) of theShape.
10521 Origin of the LCS is situated at the shape's center of mass.
10522 Axes of the LCS are obtained from shape's location or,
10523 if the shape is a planar face, from position of its plane.
10526 theShape Shape to calculate position of.
10529 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10530 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10531 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10532 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10534 # Example: see GEOM_TestMeasures.py
10535 aTuple = self.MeasuOp.GetPosition(theShape)
10536 RaiseIfFailed("GetPosition", self.MeasuOp)
10539 ## Get kind of theShape.
10541 # @param theShape Shape to get a kind of.
10542 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10543 # and a list of parameters, describing the shape.
10544 # @note Concrete meaning of each value, returned via \a theIntegers
10545 # or \a theDoubles list depends on the kind() of the shape.
10547 # @ref swig_todo "Example"
10548 @ManageTransactions("MeasuOp")
10549 def KindOfShape(self,theShape):
10551 Get kind of theShape.
10554 theShape Shape to get a kind of.
10557 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10558 and a list of parameters, describing the shape.
10560 Concrete meaning of each value, returned via theIntegers
10561 or theDoubles list depends on the geompy.kind of the shape
10563 # Example: see GEOM_TestMeasures.py
10564 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10565 RaiseIfFailed("KindOfShape", self.MeasuOp)
10567 aKind = aRoughTuple[0]
10568 anInts = aRoughTuple[1]
10569 aDbls = aRoughTuple[2]
10571 # Now there is no exception from this rule:
10572 aKindTuple = [aKind] + aDbls + anInts
10574 # If they are we will regroup parameters for such kind of shape.
10576 #if aKind == kind.SOME_KIND:
10577 # # SOME_KIND int int double int double double
10578 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10582 ## Returns the string that describes if the shell is good for solid.
10583 # This is a support method for MakeSolid.
10585 # @param theShell the shell to be checked.
10586 # @return Returns a string that describes the shell validity for
10587 # solid construction.
10588 @ManageTransactions("MeasuOp")
10589 def _IsGoodForSolid(self, theShell):
10591 Returns the string that describes if the shell is good for solid.
10592 This is a support method for MakeSolid.
10595 theShell the shell to be checked.
10598 Returns a string that describes the shell validity for
10599 solid construction.
10601 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10604 # end of l2_measure
10607 ## @addtogroup l2_import_export
10610 ## Import a shape from the BREP or IGES or STEP file
10611 # (depends on given format) with given name.
10612 # @param theFileName The file, containing the shape.
10613 # @param theFormatName Specify format for the file reading.
10614 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10615 # If format 'IGES_SCALE' is used instead of 'IGES' or
10616 # format 'STEP_SCALE' is used instead of 'STEP',
10617 # length unit will be set to 'meter' and result model will be scaled.
10618 # @param theName Object name; when specified, this parameter is used
10619 # for result publication in the study. Otherwise, if automatic
10620 # publication is switched on, default value is used for result name.
10622 # @return New GEOM.GEOM_Object, containing the imported shape.
10623 # If material names are imported it returns the list of
10624 # objects. The first one is the imported object followed by
10626 # @note Auto publishing is allowed for the shape itself. Imported
10627 # material groups are not automatically published.
10629 # @ref swig_Import_Export "Example"
10630 @ManageTransactions("InsertOp")
10631 def ImportFile(self, theFileName, theFormatName, theName=None):
10633 Import a shape from the BREP or IGES or STEP file
10634 (depends on given format) with given name.
10637 theFileName The file, containing the shape.
10638 theFormatName Specify format for the file reading.
10639 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10640 If format 'IGES_SCALE' is used instead of 'IGES' or
10641 format 'STEP_SCALE' is used instead of 'STEP',
10642 length unit will be set to 'meter' and result model will be scaled.
10643 theName Object name; when specified, this parameter is used
10644 for result publication in the study. Otherwise, if automatic
10645 publication is switched on, default value is used for result name.
10648 New GEOM.GEOM_Object, containing the imported shape.
10649 If material names are imported it returns the list of
10650 objects. The first one is the imported object followed by
10653 Auto publishing is allowed for the shape itself. Imported
10654 material groups are not automatically published.
10656 # Example: see GEOM_TestOthers.py
10657 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10658 RaiseIfFailed("ImportFile", self.InsertOp)
10659 aNbObj = len(aListObj)
10661 self._autoPublish(aListObj[0], theName, "imported")
10666 ## Deprecated analog of ImportFile()
10667 def Import(self, theFileName, theFormatName, theName=None):
10669 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10671 print "WARNING: Function Import is deprecated, use ImportFile instead"
10672 # note: auto-publishing is done in self.ImportFile()
10673 return self.ImportFile(theFileName, theFormatName, theName)
10675 ## Shortcut to ImportFile() for BREP format.
10676 # Import a shape from the BREP file with given name.
10677 # @param theFileName The file, containing the shape.
10678 # @param theName Object name; when specified, this parameter is used
10679 # for result publication in the study. Otherwise, if automatic
10680 # publication is switched on, default value is used for result name.
10682 # @return New GEOM.GEOM_Object, containing the imported shape.
10684 # @ref swig_Import_Export "Example"
10685 def ImportBREP(self, theFileName, theName=None):
10687 geompy.ImportFile(...) function for BREP format
10688 Import a shape from the BREP file with given name.
10691 theFileName The file, containing the shape.
10692 theName Object name; when specified, this parameter is used
10693 for result publication in the study. Otherwise, if automatic
10694 publication is switched on, default value is used for result name.
10697 New GEOM.GEOM_Object, containing the imported shape.
10699 # Example: see GEOM_TestOthers.py
10700 # note: auto-publishing is done in self.ImportFile()
10701 return self.ImportFile(theFileName, "BREP", theName)
10703 ## Shortcut to ImportFile() for IGES format
10704 # Import a shape from the IGES file with given name.
10705 # @param theFileName The file, containing the shape.
10706 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10707 # and result model will be scaled, if its units are not meters.
10708 # If False (default), file length units will be taken into account.
10709 # @param theName Object name; when specified, this parameter is used
10710 # for result publication in the study. Otherwise, if automatic
10711 # publication is switched on, default value is used for result name.
10713 # @return New GEOM.GEOM_Object, containing the imported shape.
10715 # @ref swig_Import_Export "Example"
10716 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10718 geompy.ImportFile(...) function for IGES format
10721 theFileName The file, containing the shape.
10722 ignoreUnits If True, file length units will be ignored (set to 'meter')
10723 and result model will be scaled, if its units are not meters.
10724 If False (default), file length units will be taken into account.
10725 theName Object name; when specified, this parameter is used
10726 for result publication in the study. Otherwise, if automatic
10727 publication is switched on, default value is used for result name.
10730 New GEOM.GEOM_Object, containing the imported shape.
10732 # Example: see GEOM_TestOthers.py
10733 # note: auto-publishing is done in self.ImportFile()
10735 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10736 return self.ImportFile(theFileName, "IGES", theName)
10738 ## Return length unit from given IGES file
10739 # @param theFileName The file, containing the shape.
10740 # @return String, containing the units name.
10742 # @ref swig_Import_Export "Example"
10743 @ManageTransactions("InsertOp")
10744 def GetIGESUnit(self, theFileName):
10746 Return length units from given IGES file
10749 theFileName The file, containing the shape.
10752 String, containing the units name.
10754 # Example: see GEOM_TestOthers.py
10755 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10758 ## Shortcut to ImportFile() for STEP format
10759 # Import a shape from the STEP file with given name.
10760 # @param theFileName The file, containing the shape.
10761 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10762 # and result model will be scaled, if its units are not meters.
10763 # If False (default), file length units will be taken into account.
10764 # @param theName Object name; when specified, this parameter is used
10765 # for result publication in the study. Otherwise, if automatic
10766 # publication is switched on, default value is used for result name.
10768 # @return New GEOM.GEOM_Object, containing the imported shape.
10769 # If material names are imported it returns the list of
10770 # objects. The first one is the imported object followed by
10772 # @note Auto publishing is allowed for the shape itself. Imported
10773 # material groups are not automatically published.
10775 # @ref swig_Import_Export "Example"
10776 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10778 geompy.ImportFile(...) function for STEP format
10781 theFileName The file, containing the shape.
10782 ignoreUnits If True, file length units will be ignored (set to 'meter')
10783 and result model will be scaled, if its units are not meters.
10784 If False (default), file length units will be taken into account.
10785 theName Object name; when specified, this parameter is used
10786 for result publication in the study. Otherwise, if automatic
10787 publication is switched on, default value is used for result name.
10790 New GEOM.GEOM_Object, containing the imported shape.
10791 If material names are imported it returns the list of
10792 objects. The first one is the imported object followed by
10795 Auto publishing is allowed for the shape itself. Imported
10796 material groups are not automatically published.
10798 # Example: see GEOM_TestOthers.py
10799 # note: auto-publishing is done in self.ImportFile()
10801 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10802 return self.ImportFile(theFileName, "STEP", theName)
10804 ## Return length unit from given IGES or STEP file
10805 # @param theFileName The file, containing the shape.
10806 # @return String, containing the units name.
10808 # @ref swig_Import_Export "Example"
10809 @ManageTransactions("InsertOp")
10810 def GetSTEPUnit(self, theFileName):
10812 Return length units from given STEP file
10815 theFileName The file, containing the shape.
10818 String, containing the units name.
10820 # Example: see GEOM_TestOthers.py
10821 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10824 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10825 # @note This method will not be dumped to the python script by DumpStudy functionality.
10826 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10827 # @param theStream The BRep binary stream.
10828 # @param theName Object name; when specified, this parameter is used
10829 # for result publication in the study. Otherwise, if automatic
10830 # publication is switched on, default value is used for result name.
10832 # @return New GEOM_Object, containing the shape, read from theStream.
10834 # @ref swig_Import_Export "Example"
10835 @ManageTransactions("InsertOp")
10836 def RestoreShape (self, theStream, theName=None):
10838 Read a shape from the binary stream, containing its bounding representation (BRep).
10841 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10844 theStream The BRep binary stream.
10845 theName Object name; when specified, this parameter is used
10846 for result publication in the study. Otherwise, if automatic
10847 publication is switched on, default value is used for result name.
10850 New GEOM_Object, containing the shape, read from theStream.
10852 # Example: see GEOM_TestOthers.py
10853 anObj = self.InsertOp.RestoreShape(theStream)
10854 RaiseIfFailed("RestoreShape", self.InsertOp)
10855 self._autoPublish(anObj, theName, "restored")
10858 ## Export the given shape into a file with given name.
10859 # @param theObject Shape to be stored in the file.
10860 # @param theFileName Name of the file to store the given shape in.
10861 # @param theFormatName Specify format for the shape storage.
10862 # Available formats can be obtained with
10863 # geompy.InsertOp.ExportTranslators()[0] method.
10865 # @ref swig_Import_Export "Example"
10866 @ManageTransactions("InsertOp")
10867 def Export(self, theObject, theFileName, theFormatName):
10869 Export the given shape into a file with given name.
10872 theObject Shape to be stored in the file.
10873 theFileName Name of the file to store the given shape in.
10874 theFormatName Specify format for the shape storage.
10875 Available formats can be obtained with
10876 geompy.InsertOp.ExportTranslators()[0] method.
10878 # Example: see GEOM_TestOthers.py
10879 self.InsertOp.Export(theObject, theFileName, theFormatName)
10880 if self.InsertOp.IsDone() == 0:
10881 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10885 ## Shortcut to Export() for BREP format
10887 # @ref swig_Import_Export "Example"
10888 def ExportBREP(self,theObject, theFileName):
10890 geompy.Export(...) function for BREP format
10892 # Example: see GEOM_TestOthers.py
10893 return self.Export(theObject, theFileName, "BREP")
10895 ## Shortcut to Export() for IGES format
10897 # @ref swig_Import_Export "Example"
10898 def ExportIGES(self,theObject, theFileName):
10900 geompy.Export(...) function for IGES format
10902 # Example: see GEOM_TestOthers.py
10903 return self.Export(theObject, theFileName, "IGES")
10905 ## Shortcut to Export() for STEP format
10907 # @ref swig_Import_Export "Example"
10908 def ExportSTEP(self,theObject, theFileName):
10910 geompy.Export(...) function for STEP format
10912 # Example: see GEOM_TestOthers.py
10913 return self.Export(theObject, theFileName, "STEP")
10915 # end of l2_import_export
10918 ## @addtogroup l3_blocks
10921 ## Create a quadrangle face from four edges. Order of Edges is not
10922 # important. It is not necessary that edges share the same vertex.
10923 # @param E1,E2,E3,E4 Edges for the face bound.
10924 # @param theName Object name; when specified, this parameter is used
10925 # for result publication in the study. Otherwise, if automatic
10926 # publication is switched on, default value is used for result name.
10928 # @return New GEOM.GEOM_Object, containing the created face.
10930 # @ref tui_building_by_blocks_page "Example"
10931 @ManageTransactions("BlocksOp")
10932 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10934 Create a quadrangle face from four edges. Order of Edges is not
10935 important. It is not necessary that edges share the same vertex.
10938 E1,E2,E3,E4 Edges for the face bound.
10939 theName Object name; when specified, this parameter is used
10940 for result publication in the study. Otherwise, if automatic
10941 publication is switched on, default value is used for result name.
10944 New GEOM.GEOM_Object, containing the created face.
10947 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10949 # Example: see GEOM_Spanner.py
10950 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10951 RaiseIfFailed("MakeQuad", self.BlocksOp)
10952 self._autoPublish(anObj, theName, "quad")
10955 ## Create a quadrangle face on two edges.
10956 # The missing edges will be built by creating the shortest ones.
10957 # @param E1,E2 Two opposite edges for the face.
10958 # @param theName Object name; when specified, this parameter is used
10959 # for result publication in the study. Otherwise, if automatic
10960 # publication is switched on, default value is used for result name.
10962 # @return New GEOM.GEOM_Object, containing the created face.
10964 # @ref tui_building_by_blocks_page "Example"
10965 @ManageTransactions("BlocksOp")
10966 def MakeQuad2Edges(self, E1, E2, theName=None):
10968 Create a quadrangle face on two edges.
10969 The missing edges will be built by creating the shortest ones.
10972 E1,E2 Two opposite edges for the face.
10973 theName Object name; when specified, this parameter is used
10974 for result publication in the study. Otherwise, if automatic
10975 publication is switched on, default value is used for result name.
10978 New GEOM.GEOM_Object, containing the created face.
10982 p1 = geompy.MakeVertex( 0., 0., 0.)
10983 p2 = geompy.MakeVertex(150., 30., 0.)
10984 p3 = geompy.MakeVertex( 0., 120., 50.)
10985 p4 = geompy.MakeVertex( 0., 40., 70.)
10987 edge1 = geompy.MakeEdge(p1, p2)
10988 edge2 = geompy.MakeEdge(p3, p4)
10989 # create a quadrangle face from two edges
10990 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10992 # Example: see GEOM_Spanner.py
10993 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10994 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10995 self._autoPublish(anObj, theName, "quad")
10998 ## Create a quadrangle face with specified corners.
10999 # The missing edges will be built by creating the shortest ones.
11000 # @param V1,V2,V3,V4 Corner vertices for the face.
11001 # @param theName Object name; when specified, this parameter is used
11002 # for result publication in the study. Otherwise, if automatic
11003 # publication is switched on, default value is used for result name.
11005 # @return New GEOM.GEOM_Object, containing the created face.
11007 # @ref tui_building_by_blocks_page "Example 1"
11008 # \n @ref swig_MakeQuad4Vertices "Example 2"
11009 @ManageTransactions("BlocksOp")
11010 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11012 Create a quadrangle face with specified corners.
11013 The missing edges will be built by creating the shortest ones.
11016 V1,V2,V3,V4 Corner vertices for the face.
11017 theName Object name; when specified, this parameter is used
11018 for result publication in the study. Otherwise, if automatic
11019 publication is switched on, default value is used for result name.
11022 New GEOM.GEOM_Object, containing the created face.
11026 p1 = geompy.MakeVertex( 0., 0., 0.)
11027 p2 = geompy.MakeVertex(150., 30., 0.)
11028 p3 = geompy.MakeVertex( 0., 120., 50.)
11029 p4 = geompy.MakeVertex( 0., 40., 70.)
11030 # create a quadrangle from four points in its corners
11031 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11033 # Example: see GEOM_Spanner.py
11034 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11035 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11036 self._autoPublish(anObj, theName, "quad")
11039 ## Create a hexahedral solid, bounded by the six given faces. Order of
11040 # faces is not important. It is not necessary that Faces share the same edge.
11041 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11042 # @param theName Object name; when specified, this parameter is used
11043 # for result publication in the study. Otherwise, if automatic
11044 # publication is switched on, default value is used for result name.
11046 # @return New GEOM.GEOM_Object, containing the created solid.
11048 # @ref tui_building_by_blocks_page "Example 1"
11049 # \n @ref swig_MakeHexa "Example 2"
11050 @ManageTransactions("BlocksOp")
11051 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11053 Create a hexahedral solid, bounded by the six given faces. Order of
11054 faces is not important. It is not necessary that Faces share the same edge.
11057 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11058 theName Object name; when specified, this parameter is used
11059 for result publication in the study. Otherwise, if automatic
11060 publication is switched on, default value is used for result name.
11063 New GEOM.GEOM_Object, containing the created solid.
11066 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11068 # Example: see GEOM_Spanner.py
11069 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11070 RaiseIfFailed("MakeHexa", self.BlocksOp)
11071 self._autoPublish(anObj, theName, "hexa")
11074 ## Create a hexahedral solid between two given faces.
11075 # The missing faces will be built by creating the smallest ones.
11076 # @param F1,F2 Two opposite faces for the hexahedral solid.
11077 # @param theName Object name; when specified, this parameter is used
11078 # for result publication in the study. Otherwise, if automatic
11079 # publication is switched on, default value is used for result name.
11081 # @return New GEOM.GEOM_Object, containing the created solid.
11083 # @ref tui_building_by_blocks_page "Example 1"
11084 # \n @ref swig_MakeHexa2Faces "Example 2"
11085 @ManageTransactions("BlocksOp")
11086 def MakeHexa2Faces(self, F1, F2, theName=None):
11088 Create a hexahedral solid between two given faces.
11089 The missing faces will be built by creating the smallest ones.
11092 F1,F2 Two opposite faces for the hexahedral solid.
11093 theName Object name; when specified, this parameter is used
11094 for result publication in the study. Otherwise, if automatic
11095 publication is switched on, default value is used for result name.
11098 New GEOM.GEOM_Object, containing the created solid.
11101 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11103 # Example: see GEOM_Spanner.py
11104 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11105 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11106 self._autoPublish(anObj, theName, "hexa")
11112 ## @addtogroup l3_blocks_op
11115 ## Get a vertex, found in the given shape by its coordinates.
11116 # @param theShape Block or a compound of blocks.
11117 # @param theX,theY,theZ Coordinates of the sought vertex.
11118 # @param theEpsilon Maximum allowed distance between the resulting
11119 # vertex and point with the given coordinates.
11120 # @param theName Object name; when specified, this parameter is used
11121 # for result publication in the study. Otherwise, if automatic
11122 # publication is switched on, default value is used for result name.
11124 # @return New GEOM.GEOM_Object, containing the found vertex.
11126 # @ref swig_GetPoint "Example"
11127 @ManageTransactions("BlocksOp")
11128 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11130 Get a vertex, found in the given shape by its coordinates.
11133 theShape Block or a compound of blocks.
11134 theX,theY,theZ Coordinates of the sought vertex.
11135 theEpsilon Maximum allowed distance between the resulting
11136 vertex and point with the given coordinates.
11137 theName Object name; when specified, this parameter is used
11138 for result publication in the study. Otherwise, if automatic
11139 publication is switched on, default value is used for result name.
11142 New GEOM.GEOM_Object, containing the found vertex.
11145 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11147 # Example: see GEOM_TestOthers.py
11148 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11149 RaiseIfFailed("GetPoint", self.BlocksOp)
11150 self._autoPublish(anObj, theName, "vertex")
11153 ## Find a vertex of the given shape, which has minimal distance to the given point.
11154 # @param theShape Any shape.
11155 # @param thePoint Point, close to the desired vertex.
11156 # @param theName Object name; when specified, this parameter is used
11157 # for result publication in the study. Otherwise, if automatic
11158 # publication is switched on, default value is used for result name.
11160 # @return New GEOM.GEOM_Object, containing the found vertex.
11162 # @ref swig_GetVertexNearPoint "Example"
11163 @ManageTransactions("BlocksOp")
11164 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11166 Find a vertex of the given shape, which has minimal distance to the given point.
11169 theShape Any shape.
11170 thePoint Point, close to the desired vertex.
11171 theName Object name; when specified, this parameter is used
11172 for result publication in the study. Otherwise, if automatic
11173 publication is switched on, default value is used for result name.
11176 New GEOM.GEOM_Object, containing the found vertex.
11179 pmidle = geompy.MakeVertex(50, 0, 50)
11180 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11182 # Example: see GEOM_TestOthers.py
11183 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11184 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11185 self._autoPublish(anObj, theName, "vertex")
11188 ## Get an edge, found in the given shape by two given vertices.
11189 # @param theShape Block or a compound of blocks.
11190 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11191 # @param theName Object name; when specified, this parameter is used
11192 # for result publication in the study. Otherwise, if automatic
11193 # publication is switched on, default value is used for result name.
11195 # @return New GEOM.GEOM_Object, containing the found edge.
11197 # @ref swig_GetEdge "Example"
11198 @ManageTransactions("BlocksOp")
11199 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11201 Get an edge, found in the given shape by two given vertices.
11204 theShape Block or a compound of blocks.
11205 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11206 theName Object name; when specified, this parameter is used
11207 for result publication in the study. Otherwise, if automatic
11208 publication is switched on, default value is used for result name.
11211 New GEOM.GEOM_Object, containing the found edge.
11213 # Example: see GEOM_Spanner.py
11214 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11215 RaiseIfFailed("GetEdge", self.BlocksOp)
11216 self._autoPublish(anObj, theName, "edge")
11219 ## Find an edge of the given shape, which has minimal distance to the given point.
11220 # @param theShape Block or a compound of blocks.
11221 # @param thePoint Point, close to the desired edge.
11222 # @param theName Object name; when specified, this parameter is used
11223 # for result publication in the study. Otherwise, if automatic
11224 # publication is switched on, default value is used for result name.
11226 # @return New GEOM.GEOM_Object, containing the found edge.
11228 # @ref swig_GetEdgeNearPoint "Example"
11229 @ManageTransactions("BlocksOp")
11230 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11232 Find an edge of the given shape, which has minimal distance to the given point.
11235 theShape Block or a compound of blocks.
11236 thePoint Point, close to the desired edge.
11237 theName Object name; when specified, this parameter is used
11238 for result publication in the study. Otherwise, if automatic
11239 publication is switched on, default value is used for result name.
11242 New GEOM.GEOM_Object, containing the found edge.
11244 # Example: see GEOM_TestOthers.py
11245 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11246 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11247 self._autoPublish(anObj, theName, "edge")
11250 ## Returns a face, found in the given shape by four given corner vertices.
11251 # @param theShape Block or a compound of blocks.
11252 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11253 # @param theName Object name; when specified, this parameter is used
11254 # for result publication in the study. Otherwise, if automatic
11255 # publication is switched on, default value is used for result name.
11257 # @return New GEOM.GEOM_Object, containing the found face.
11259 # @ref swig_todo "Example"
11260 @ManageTransactions("BlocksOp")
11261 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11263 Returns a face, found in the given shape by four given corner vertices.
11266 theShape Block or a compound of blocks.
11267 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11268 theName Object name; when specified, this parameter is used
11269 for result publication in the study. Otherwise, if automatic
11270 publication is switched on, default value is used for result name.
11273 New GEOM.GEOM_Object, containing the found face.
11275 # Example: see GEOM_Spanner.py
11276 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11277 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11278 self._autoPublish(anObj, theName, "face")
11281 ## Get a face of block, found in the given shape by two given edges.
11282 # @param theShape Block or a compound of blocks.
11283 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11284 # @param theName Object name; when specified, this parameter is used
11285 # for result publication in the study. Otherwise, if automatic
11286 # publication is switched on, default value is used for result name.
11288 # @return New GEOM.GEOM_Object, containing the found face.
11290 # @ref swig_todo "Example"
11291 @ManageTransactions("BlocksOp")
11292 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11294 Get a face of block, found in the given shape by two given edges.
11297 theShape Block or a compound of blocks.
11298 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11299 theName Object name; when specified, this parameter is used
11300 for result publication in the study. Otherwise, if automatic
11301 publication is switched on, default value is used for result name.
11304 New GEOM.GEOM_Object, containing the found face.
11306 # Example: see GEOM_Spanner.py
11307 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11308 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11309 self._autoPublish(anObj, theName, "face")
11312 ## Find a face, opposite to the given one in the given block.
11313 # @param theBlock Must be a hexahedral solid.
11314 # @param theFace Face of \a theBlock, opposite to the desired face.
11315 # @param theName Object name; when specified, this parameter is used
11316 # for result publication in the study. Otherwise, if automatic
11317 # publication is switched on, default value is used for result name.
11319 # @return New GEOM.GEOM_Object, containing the found face.
11321 # @ref swig_GetOppositeFace "Example"
11322 @ManageTransactions("BlocksOp")
11323 def GetOppositeFace(self, theBlock, theFace, theName=None):
11325 Find a face, opposite to the given one in the given block.
11328 theBlock Must be a hexahedral solid.
11329 theFace Face of theBlock, opposite to the desired face.
11330 theName Object name; when specified, this parameter is used
11331 for result publication in the study. Otherwise, if automatic
11332 publication is switched on, default value is used for result name.
11335 New GEOM.GEOM_Object, containing the found face.
11337 # Example: see GEOM_Spanner.py
11338 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11339 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11340 self._autoPublish(anObj, theName, "face")
11343 ## Find a face of the given shape, which has minimal distance to the given point.
11344 # @param theShape Block or a compound of blocks.
11345 # @param thePoint Point, close to the desired face.
11346 # @param theName Object name; when specified, this parameter is used
11347 # for result publication in the study. Otherwise, if automatic
11348 # publication is switched on, default value is used for result name.
11350 # @return New GEOM.GEOM_Object, containing the found face.
11352 # @ref swig_GetFaceNearPoint "Example"
11353 @ManageTransactions("BlocksOp")
11354 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11356 Find a face of the given shape, which has minimal distance to the given point.
11359 theShape Block or a compound of blocks.
11360 thePoint Point, close to the desired face.
11361 theName Object name; when specified, this parameter is used
11362 for result publication in the study. Otherwise, if automatic
11363 publication is switched on, default value is used for result name.
11366 New GEOM.GEOM_Object, containing the found face.
11368 # Example: see GEOM_Spanner.py
11369 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11370 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11371 self._autoPublish(anObj, theName, "face")
11374 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11375 # @param theBlock Block or a compound of blocks.
11376 # @param theVector Vector, close to the normale of the desired face.
11377 # @param theName Object name; when specified, this parameter is used
11378 # for result publication in the study. Otherwise, if automatic
11379 # publication is switched on, default value is used for result name.
11381 # @return New GEOM.GEOM_Object, containing the found face.
11383 # @ref swig_todo "Example"
11384 @ManageTransactions("BlocksOp")
11385 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11387 Find a face of block, whose outside normale has minimal angle with the given vector.
11390 theBlock Block or a compound of blocks.
11391 theVector Vector, close to the normale of the desired face.
11392 theName Object name; when specified, this parameter is used
11393 for result publication in the study. Otherwise, if automatic
11394 publication is switched on, default value is used for result name.
11397 New GEOM.GEOM_Object, containing the found face.
11399 # Example: see GEOM_Spanner.py
11400 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11401 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11402 self._autoPublish(anObj, theName, "face")
11405 ## Find all sub-shapes of type \a theShapeType of the given shape,
11406 # which have minimal distance to the given point.
11407 # @param theShape Any shape.
11408 # @param thePoint Point, close to the desired shape.
11409 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11410 # @param theTolerance The tolerance for distances comparison. All shapes
11411 # with distances to the given point in interval
11412 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11413 # @param theName Object name; when specified, this parameter is used
11414 # for result publication in the study. Otherwise, if automatic
11415 # publication is switched on, default value is used for result name.
11417 # @return New GEOM_Object, containing a group of all found shapes.
11419 # @ref swig_GetShapesNearPoint "Example"
11420 @ManageTransactions("BlocksOp")
11421 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11423 Find all sub-shapes of type theShapeType of the given shape,
11424 which have minimal distance to the given point.
11427 theShape Any shape.
11428 thePoint Point, close to the desired shape.
11429 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11430 theTolerance The tolerance for distances comparison. All shapes
11431 with distances to the given point in interval
11432 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11433 theName Object name; when specified, this parameter is used
11434 for result publication in the study. Otherwise, if automatic
11435 publication is switched on, default value is used for result name.
11438 New GEOM_Object, containing a group of all found shapes.
11440 # Example: see GEOM_TestOthers.py
11441 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11442 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11443 self._autoPublish(anObj, theName, "group")
11446 # end of l3_blocks_op
11449 ## @addtogroup l4_blocks_measure
11452 ## Check, if the compound of blocks is given.
11453 # To be considered as a compound of blocks, the
11454 # given shape must satisfy the following conditions:
11455 # - Each element of the compound should be a Block (6 faces and 12 edges).
11456 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11457 # - The compound should be connexe.
11458 # - The glue between two quadrangle faces should be applied.
11459 # @param theCompound The compound to check.
11460 # @return TRUE, if the given shape is a compound of blocks.
11461 # If theCompound is not valid, prints all discovered errors.
11463 # @ref tui_measurement_tools_page "Example 1"
11464 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11465 @ManageTransactions("BlocksOp")
11466 def CheckCompoundOfBlocks(self,theCompound):
11468 Check, if the compound of blocks is given.
11469 To be considered as a compound of blocks, the
11470 given shape must satisfy the following conditions:
11471 - Each element of the compound should be a Block (6 faces and 12 edges).
11472 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11473 - The compound should be connexe.
11474 - The glue between two quadrangle faces should be applied.
11477 theCompound The compound to check.
11480 TRUE, if the given shape is a compound of blocks.
11481 If theCompound is not valid, prints all discovered errors.
11483 # Example: see GEOM_Spanner.py
11484 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11485 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11487 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11491 ## Retrieve all non blocks solids and faces from \a theShape.
11492 # @param theShape The shape to explore.
11493 # @param theName Object name; when specified, this parameter is used
11494 # for result publication in the study. Otherwise, if automatic
11495 # publication is switched on, default value is used for result name.
11497 # @return A tuple of two GEOM_Objects. The first object is a group of all
11498 # non block solids (= not 6 faces, or with 6 faces, but with the
11499 # presence of non-quadrangular faces). The second object is a
11500 # group of all non quadrangular faces.
11502 # @ref tui_measurement_tools_page "Example 1"
11503 # \n @ref swig_GetNonBlocks "Example 2"
11504 @ManageTransactions("BlocksOp")
11505 def GetNonBlocks (self, theShape, theName=None):
11507 Retrieve all non blocks solids and faces from theShape.
11510 theShape The shape to explore.
11511 theName Object name; when specified, this parameter is used
11512 for result publication in the study. Otherwise, if automatic
11513 publication is switched on, default value is used for result name.
11516 A tuple of two GEOM_Objects. The first object is a group of all
11517 non block solids (= not 6 faces, or with 6 faces, but with the
11518 presence of non-quadrangular faces). The second object is a
11519 group of all non quadrangular faces.
11522 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11524 # Example: see GEOM_Spanner.py
11525 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11526 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11527 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11530 ## Remove all seam and degenerated edges from \a theShape.
11531 # Unite faces and edges, sharing one surface. It means that
11532 # this faces must have references to one C++ surface object (handle).
11533 # @param theShape The compound or single solid to remove irregular edges from.
11534 # @param doUnionFaces If True, then unite faces. If False (the default value),
11535 # do not unite faces.
11536 # @param theName Object name; when specified, this parameter is used
11537 # for result publication in the study. Otherwise, if automatic
11538 # publication is switched on, default value is used for result name.
11540 # @return Improved shape.
11542 # @ref swig_RemoveExtraEdges "Example"
11543 @ManageTransactions("BlocksOp")
11544 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11546 Remove all seam and degenerated edges from theShape.
11547 Unite faces and edges, sharing one surface. It means that
11548 this faces must have references to one C++ surface object (handle).
11551 theShape The compound or single solid to remove irregular edges from.
11552 doUnionFaces If True, then unite faces. If False (the default value),
11553 do not unite faces.
11554 theName Object name; when specified, this parameter is used
11555 for result publication in the study. Otherwise, if automatic
11556 publication is switched on, default value is used for result name.
11561 # Example: see GEOM_TestOthers.py
11562 nbFacesOptimum = -1 # -1 means do not unite faces
11563 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11564 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11565 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11566 self._autoPublish(anObj, theName, "removeExtraEdges")
11569 ## Performs union faces of \a theShape
11570 # Unite faces sharing one surface. It means that
11571 # these faces must have references to one C++ surface object (handle).
11572 # @param theShape The compound or single solid that contains faces
11573 # to perform union.
11574 # @param theName Object name; when specified, this parameter is used
11575 # for result publication in the study. Otherwise, if automatic
11576 # publication is switched on, default value is used for result name.
11578 # @return Improved shape.
11580 # @ref swig_UnionFaces "Example"
11581 @ManageTransactions("BlocksOp")
11582 def UnionFaces(self, theShape, theName=None):
11584 Performs union faces of theShape.
11585 Unite faces sharing one surface. It means that
11586 these faces must have references to one C++ surface object (handle).
11589 theShape The compound or single solid that contains faces
11591 theName Object name; when specified, this parameter is used
11592 for result publication in the study. Otherwise, if automatic
11593 publication is switched on, default value is used for result name.
11598 # Example: see GEOM_TestOthers.py
11599 anObj = self.BlocksOp.UnionFaces(theShape)
11600 RaiseIfFailed("UnionFaces", self.BlocksOp)
11601 self._autoPublish(anObj, theName, "unionFaces")
11604 ## Check, if the given shape is a blocks compound.
11605 # Fix all detected errors.
11606 # \note Single block can be also fixed by this method.
11607 # @param theShape The compound to check and improve.
11608 # @param theName Object name; when specified, this parameter is used
11609 # for result publication in the study. Otherwise, if automatic
11610 # publication is switched on, default value is used for result name.
11612 # @return Improved compound.
11614 # @ref swig_CheckAndImprove "Example"
11615 @ManageTransactions("BlocksOp")
11616 def CheckAndImprove(self, theShape, theName=None):
11618 Check, if the given shape is a blocks compound.
11619 Fix all detected errors.
11622 Single block can be also fixed by this method.
11625 theShape The compound to check and improve.
11626 theName Object name; when specified, this parameter is used
11627 for result publication in the study. Otherwise, if automatic
11628 publication is switched on, default value is used for result name.
11633 # Example: see GEOM_TestOthers.py
11634 anObj = self.BlocksOp.CheckAndImprove(theShape)
11635 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11636 self._autoPublish(anObj, theName, "improved")
11639 # end of l4_blocks_measure
11642 ## @addtogroup l3_blocks_op
11645 ## Get all the blocks, contained in the given compound.
11646 # @param theCompound The compound to explode.
11647 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11648 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11649 # @param theName Object name; when specified, this parameter is used
11650 # for result publication in the study. Otherwise, if automatic
11651 # publication is switched on, default value is used for result name.
11653 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11655 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11657 # @ref tui_explode_on_blocks "Example 1"
11658 # \n @ref swig_MakeBlockExplode "Example 2"
11659 @ManageTransactions("BlocksOp")
11660 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11662 Get all the blocks, contained in the given compound.
11665 theCompound The compound to explode.
11666 theMinNbFaces If solid has lower number of faces, it is not a block.
11667 theMaxNbFaces If solid has higher number of faces, it is not a block.
11668 theName Object name; when specified, this parameter is used
11669 for result publication in the study. Otherwise, if automatic
11670 publication is switched on, default value is used for result name.
11673 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11676 List of GEOM.GEOM_Object, containing the retrieved blocks.
11678 # Example: see GEOM_TestOthers.py
11679 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11680 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11681 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11682 for anObj in aList:
11683 anObj.SetParameters(Parameters)
11685 self._autoPublish(aList, theName, "block")
11688 ## Find block, containing the given point inside its volume or on boundary.
11689 # @param theCompound Compound, to find block in.
11690 # @param thePoint Point, close to the desired block. If the point lays on
11691 # boundary between some blocks, we return block with nearest center.
11692 # @param theName Object name; when specified, this parameter is used
11693 # for result publication in the study. Otherwise, if automatic
11694 # publication is switched on, default value is used for result name.
11696 # @return New GEOM.GEOM_Object, containing the found block.
11698 # @ref swig_todo "Example"
11699 @ManageTransactions("BlocksOp")
11700 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11702 Find block, containing the given point inside its volume or on boundary.
11705 theCompound Compound, to find block in.
11706 thePoint Point, close to the desired block. If the point lays on
11707 boundary between some blocks, we return block with nearest center.
11708 theName Object name; when specified, this parameter is used
11709 for result publication in the study. Otherwise, if automatic
11710 publication is switched on, default value is used for result name.
11713 New GEOM.GEOM_Object, containing the found block.
11715 # Example: see GEOM_Spanner.py
11716 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11717 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11718 self._autoPublish(anObj, theName, "block")
11721 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11722 # @param theCompound Compound, to find block in.
11723 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11724 # @param theName Object name; when specified, this parameter is used
11725 # for result publication in the study. Otherwise, if automatic
11726 # publication is switched on, default value is used for result name.
11728 # @return New GEOM.GEOM_Object, containing the found block.
11730 # @ref swig_GetBlockByParts "Example"
11731 @ManageTransactions("BlocksOp")
11732 def GetBlockByParts(self, theCompound, theParts, theName=None):
11734 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11737 theCompound Compound, to find block in.
11738 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11739 theName Object name; when specified, this parameter is used
11740 for result publication in the study. Otherwise, if automatic
11741 publication is switched on, default value is used for result name.
11744 New GEOM_Object, containing the found block.
11746 # Example: see GEOM_TestOthers.py
11747 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11748 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11749 self._autoPublish(anObj, theName, "block")
11752 ## Return all blocks, containing all the elements, passed as the parts.
11753 # @param theCompound Compound, to find blocks in.
11754 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11755 # @param theName Object name; when specified, this parameter is used
11756 # for result publication in the study. Otherwise, if automatic
11757 # publication is switched on, default value is used for result name.
11759 # @return List of GEOM.GEOM_Object, containing the found blocks.
11761 # @ref swig_todo "Example"
11762 @ManageTransactions("BlocksOp")
11763 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11765 Return all blocks, containing all the elements, passed as the parts.
11768 theCompound Compound, to find blocks in.
11769 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11770 theName Object name; when specified, this parameter is used
11771 for result publication in the study. Otherwise, if automatic
11772 publication is switched on, default value is used for result name.
11775 List of GEOM.GEOM_Object, containing the found blocks.
11777 # Example: see GEOM_Spanner.py
11778 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11779 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11780 self._autoPublish(aList, theName, "block")
11783 ## Multi-transformate block and glue the result.
11784 # Transformation is defined so, as to superpose direction faces.
11785 # @param Block Hexahedral solid to be multi-transformed.
11786 # @param DirFace1 ID of First direction face.
11787 # @param DirFace2 ID of Second direction face.
11788 # @param NbTimes Quantity of transformations to be done.
11789 # @param theName Object name; when specified, this parameter is used
11790 # for result publication in the study. Otherwise, if automatic
11791 # publication is switched on, default value is used for result name.
11793 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11795 # @return New GEOM.GEOM_Object, containing the result shape.
11797 # @ref tui_multi_transformation "Example"
11798 @ManageTransactions("BlocksOp")
11799 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11801 Multi-transformate block and glue the result.
11802 Transformation is defined so, as to superpose direction faces.
11805 Block Hexahedral solid to be multi-transformed.
11806 DirFace1 ID of First direction face.
11807 DirFace2 ID of Second direction face.
11808 NbTimes Quantity of transformations to be done.
11809 theName Object name; when specified, this parameter is used
11810 for result publication in the study. Otherwise, if automatic
11811 publication is switched on, default value is used for result name.
11814 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11817 New GEOM.GEOM_Object, containing the result shape.
11819 # Example: see GEOM_Spanner.py
11820 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11821 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11822 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11823 anObj.SetParameters(Parameters)
11824 self._autoPublish(anObj, theName, "transformed")
11827 ## Multi-transformate block and glue the result.
11828 # @param Block Hexahedral solid to be multi-transformed.
11829 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11830 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11831 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11832 # @param theName Object name; when specified, this parameter is used
11833 # for result publication in the study. Otherwise, if automatic
11834 # publication is switched on, default value is used for result name.
11836 # @return New GEOM.GEOM_Object, containing the result shape.
11838 # @ref tui_multi_transformation "Example"
11839 @ManageTransactions("BlocksOp")
11840 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11841 DirFace1V, DirFace2V, NbTimesV, theName=None):
11843 Multi-transformate block and glue the result.
11846 Block Hexahedral solid to be multi-transformed.
11847 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11848 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11849 NbTimesU,NbTimesV Quantity of transformations to be done.
11850 theName Object name; when specified, this parameter is used
11851 for result publication in the study. Otherwise, if automatic
11852 publication is switched on, default value is used for result name.
11855 New GEOM.GEOM_Object, containing the result shape.
11857 # Example: see GEOM_Spanner.py
11858 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11859 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11860 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11861 DirFace1V, DirFace2V, NbTimesV)
11862 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11863 anObj.SetParameters(Parameters)
11864 self._autoPublish(anObj, theName, "transformed")
11867 ## Build all possible propagation groups.
11868 # Propagation group is a set of all edges, opposite to one (main)
11869 # edge of this group directly or through other opposite edges.
11870 # Notion of Opposite Edge make sence only on quadrangle face.
11871 # @param theShape Shape to build propagation groups on.
11872 # @param theName Object name; when specified, this parameter is used
11873 # for result publication in the study. Otherwise, if automatic
11874 # publication is switched on, default value is used for result name.
11876 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11878 # @ref swig_Propagate "Example"
11879 @ManageTransactions("BlocksOp")
11880 def Propagate(self, theShape, theName=None):
11882 Build all possible propagation groups.
11883 Propagation group is a set of all edges, opposite to one (main)
11884 edge of this group directly or through other opposite edges.
11885 Notion of Opposite Edge make sence only on quadrangle face.
11888 theShape Shape to build propagation groups on.
11889 theName Object name; when specified, this parameter is used
11890 for result publication in the study. Otherwise, if automatic
11891 publication is switched on, default value is used for result name.
11894 List of GEOM.GEOM_Object, each of them is a propagation group.
11896 # Example: see GEOM_TestOthers.py
11897 listChains = self.BlocksOp.Propagate(theShape)
11898 RaiseIfFailed("Propagate", self.BlocksOp)
11899 self._autoPublish(listChains, theName, "propagate")
11902 # end of l3_blocks_op
11905 ## @addtogroup l3_groups
11908 ## Creates a new group which will store sub-shapes of theMainShape
11909 # @param theMainShape is a GEOM object on which the group is selected
11910 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11911 # @param theName Object name; when specified, this parameter is used
11912 # for result publication in the study. Otherwise, if automatic
11913 # publication is switched on, default value is used for result name.
11915 # @return a newly created GEOM group (GEOM.GEOM_Object)
11917 # @ref tui_working_with_groups_page "Example 1"
11918 # \n @ref swig_CreateGroup "Example 2"
11919 @ManageTransactions("GroupOp")
11920 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11922 Creates a new group which will store sub-shapes of theMainShape
11925 theMainShape is a GEOM object on which the group is selected
11926 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11927 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11928 theName Object name; when specified, this parameter is used
11929 for result publication in the study. Otherwise, if automatic
11930 publication is switched on, default value is used for result name.
11933 a newly created GEOM group
11936 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11939 # Example: see GEOM_TestOthers.py
11940 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11941 RaiseIfFailed("CreateGroup", self.GroupOp)
11942 self._autoPublish(anObj, theName, "group")
11945 ## Adds a sub-object with ID theSubShapeId to the group
11946 # @param theGroup is a GEOM group to which the new sub-shape is added
11947 # @param theSubShapeID is a sub-shape ID in the main object.
11948 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11950 # @ref tui_working_with_groups_page "Example"
11951 @ManageTransactions("GroupOp")
11952 def AddObject(self,theGroup, theSubShapeID):
11954 Adds a sub-object with ID theSubShapeId to the group
11957 theGroup is a GEOM group to which the new sub-shape is added
11958 theSubShapeID is a sub-shape ID in the main object.
11961 Use method GetSubShapeID() to get an unique ID of the sub-shape
11963 # Example: see GEOM_TestOthers.py
11964 self.GroupOp.AddObject(theGroup, theSubShapeID)
11965 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11966 RaiseIfFailed("AddObject", self.GroupOp)
11970 ## Removes a sub-object with ID \a theSubShapeId from the group
11971 # @param theGroup is a GEOM group from which the new sub-shape is removed
11972 # @param theSubShapeID is a sub-shape ID in the main object.
11973 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11975 # @ref tui_working_with_groups_page "Example"
11976 @ManageTransactions("GroupOp")
11977 def RemoveObject(self,theGroup, theSubShapeID):
11979 Removes a sub-object with ID theSubShapeId from the group
11982 theGroup is a GEOM group from which the new sub-shape is removed
11983 theSubShapeID is a sub-shape ID in the main object.
11986 Use method GetSubShapeID() to get an unique ID of the sub-shape
11988 # Example: see GEOM_TestOthers.py
11989 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11990 RaiseIfFailed("RemoveObject", self.GroupOp)
11993 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11994 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11995 # @param theSubShapes is a list of sub-shapes to be added.
11997 # @ref tui_working_with_groups_page "Example"
11998 @ManageTransactions("GroupOp")
11999 def UnionList (self,theGroup, theSubShapes):
12001 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12004 theGroup is a GEOM group to which the new sub-shapes are added.
12005 theSubShapes is a list of sub-shapes to be added.
12007 # Example: see GEOM_TestOthers.py
12008 self.GroupOp.UnionList(theGroup, theSubShapes)
12009 RaiseIfFailed("UnionList", self.GroupOp)
12012 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12013 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12014 # @param theSubShapes is a list of indices of sub-shapes to be added.
12016 # @ref swig_UnionIDs "Example"
12017 @ManageTransactions("GroupOp")
12018 def UnionIDs(self,theGroup, theSubShapes):
12020 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12023 theGroup is a GEOM group to which the new sub-shapes are added.
12024 theSubShapes is a list of indices of sub-shapes to be added.
12026 # Example: see GEOM_TestOthers.py
12027 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12028 RaiseIfFailed("UnionIDs", self.GroupOp)
12031 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12032 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12033 # @param theSubShapes is a list of sub-shapes to be removed.
12035 # @ref tui_working_with_groups_page "Example"
12036 @ManageTransactions("GroupOp")
12037 def DifferenceList (self,theGroup, theSubShapes):
12039 Removes from the group all the given shapes. No errors, if some shapes are not included.
12042 theGroup is a GEOM group from which the sub-shapes are removed.
12043 theSubShapes is a list of sub-shapes to be removed.
12045 # Example: see GEOM_TestOthers.py
12046 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12047 RaiseIfFailed("DifferenceList", self.GroupOp)
12050 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12051 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12052 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12054 # @ref swig_DifferenceIDs "Example"
12055 @ManageTransactions("GroupOp")
12056 def DifferenceIDs(self,theGroup, theSubShapes):
12058 Removes from the group all the given shapes. No errors, if some shapes are not included.
12061 theGroup is a GEOM group from which the sub-shapes are removed.
12062 theSubShapes is a list of indices of sub-shapes to be removed.
12064 # Example: see GEOM_TestOthers.py
12065 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12066 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12069 ## Union of two groups.
12070 # New group is created. It will contain all entities
12071 # which are present in groups theGroup1 and theGroup2.
12072 # @param theGroup1, theGroup2 are the initial GEOM groups
12073 # to create the united group from.
12074 # @param theName Object name; when specified, this parameter is used
12075 # for result publication in the study. Otherwise, if automatic
12076 # publication is switched on, default value is used for result name.
12078 # @return a newly created GEOM group.
12080 # @ref tui_union_groups_anchor "Example"
12081 @ManageTransactions("GroupOp")
12082 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12084 Union of two groups.
12085 New group is created. It will contain all entities
12086 which are present in groups theGroup1 and theGroup2.
12089 theGroup1, theGroup2 are the initial GEOM groups
12090 to create the united group from.
12091 theName Object name; when specified, this parameter is used
12092 for result publication in the study. Otherwise, if automatic
12093 publication is switched on, default value is used for result name.
12096 a newly created GEOM group.
12098 # Example: see GEOM_TestOthers.py
12099 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12100 RaiseIfFailed("UnionGroups", self.GroupOp)
12101 self._autoPublish(aGroup, theName, "group")
12104 ## Intersection of two groups.
12105 # New group is created. It will contain only those entities
12106 # which are present in both groups theGroup1 and theGroup2.
12107 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12108 # @param theName Object name; when specified, this parameter is used
12109 # for result publication in the study. Otherwise, if automatic
12110 # publication is switched on, default value is used for result name.
12112 # @return a newly created GEOM group.
12114 # @ref tui_intersect_groups_anchor "Example"
12115 @ManageTransactions("GroupOp")
12116 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12118 Intersection of two groups.
12119 New group is created. It will contain only those entities
12120 which are present in both groups theGroup1 and theGroup2.
12123 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12124 theName Object name; when specified, this parameter is used
12125 for result publication in the study. Otherwise, if automatic
12126 publication is switched on, default value is used for result name.
12129 a newly created GEOM group.
12131 # Example: see GEOM_TestOthers.py
12132 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12133 RaiseIfFailed("IntersectGroups", self.GroupOp)
12134 self._autoPublish(aGroup, theName, "group")
12137 ## Cut of two groups.
12138 # New group is created. It will contain entities which are
12139 # present in group theGroup1 but are not present in group theGroup2.
12140 # @param theGroup1 is a GEOM group to include elements of.
12141 # @param theGroup2 is a GEOM group to exclude elements of.
12142 # @param theName Object name; when specified, this parameter is used
12143 # for result publication in the study. Otherwise, if automatic
12144 # publication is switched on, default value is used for result name.
12146 # @return a newly created GEOM group.
12148 # @ref tui_cut_groups_anchor "Example"
12149 @ManageTransactions("GroupOp")
12150 def CutGroups (self, theGroup1, theGroup2, theName=None):
12153 New group is created. It will contain entities which are
12154 present in group theGroup1 but are not present in group theGroup2.
12157 theGroup1 is a GEOM group to include elements of.
12158 theGroup2 is a GEOM group to exclude elements of.
12159 theName Object name; when specified, this parameter is used
12160 for result publication in the study. Otherwise, if automatic
12161 publication is switched on, default value is used for result name.
12164 a newly created GEOM group.
12166 # Example: see GEOM_TestOthers.py
12167 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12168 RaiseIfFailed("CutGroups", self.GroupOp)
12169 self._autoPublish(aGroup, theName, "group")
12172 ## Union of list of groups.
12173 # New group is created. It will contain all entities that are
12174 # present in groups listed in theGList.
12175 # @param theGList is a list of GEOM groups to create the united group from.
12176 # @param theName Object name; when specified, this parameter is used
12177 # for result publication in the study. Otherwise, if automatic
12178 # publication is switched on, default value is used for result name.
12180 # @return a newly created GEOM group.
12182 # @ref tui_union_groups_anchor "Example"
12183 @ManageTransactions("GroupOp")
12184 def UnionListOfGroups (self, theGList, theName=None):
12186 Union of list of groups.
12187 New group is created. It will contain all entities that are
12188 present in groups listed in theGList.
12191 theGList is a list of GEOM groups to create the united group from.
12192 theName Object name; when specified, this parameter is used
12193 for result publication in the study. Otherwise, if automatic
12194 publication is switched on, default value is used for result name.
12197 a newly created GEOM group.
12199 # Example: see GEOM_TestOthers.py
12200 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12201 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12202 self._autoPublish(aGroup, theName, "group")
12205 ## Cut of lists of groups.
12206 # New group is created. It will contain only entities
12207 # which are present in groups listed in theGList.
12208 # @param theGList is a list of GEOM groups to include elements of.
12209 # @param theName Object name; when specified, this parameter is used
12210 # for result publication in the study. Otherwise, if automatic
12211 # publication is switched on, default value is used for result name.
12213 # @return a newly created GEOM group.
12215 # @ref tui_intersect_groups_anchor "Example"
12216 @ManageTransactions("GroupOp")
12217 def IntersectListOfGroups (self, theGList, theName=None):
12219 Cut of lists of groups.
12220 New group is created. It will contain only entities
12221 which are present in groups listed in theGList.
12224 theGList is a list of GEOM groups to include elements of.
12225 theName Object name; when specified, this parameter is used
12226 for result publication in the study. Otherwise, if automatic
12227 publication is switched on, default value is used for result name.
12230 a newly created GEOM group.
12232 # Example: see GEOM_TestOthers.py
12233 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12234 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12235 self._autoPublish(aGroup, theName, "group")
12238 ## Cut of lists of groups.
12239 # New group is created. It will contain only entities
12240 # which are present in groups listed in theGList1 but
12241 # are not present in groups from theGList2.
12242 # @param theGList1 is a list of GEOM groups to include elements of.
12243 # @param theGList2 is a list of GEOM groups to exclude elements of.
12244 # @param theName Object name; when specified, this parameter is used
12245 # for result publication in the study. Otherwise, if automatic
12246 # publication is switched on, default value is used for result name.
12248 # @return a newly created GEOM group.
12250 # @ref tui_cut_groups_anchor "Example"
12251 @ManageTransactions("GroupOp")
12252 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12254 Cut of lists of groups.
12255 New group is created. It will contain only entities
12256 which are present in groups listed in theGList1 but
12257 are not present in groups from theGList2.
12260 theGList1 is a list of GEOM groups to include elements of.
12261 theGList2 is a list of GEOM groups to exclude elements of.
12262 theName Object name; when specified, this parameter is used
12263 for result publication in the study. Otherwise, if automatic
12264 publication is switched on, default value is used for result name.
12267 a newly created GEOM group.
12269 # Example: see GEOM_TestOthers.py
12270 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12271 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12272 self._autoPublish(aGroup, theName, "group")
12275 ## Returns a list of sub-objects ID stored in the group
12276 # @param theGroup is a GEOM group for which a list of IDs is requested
12278 # @ref swig_GetObjectIDs "Example"
12279 @ManageTransactions("GroupOp")
12280 def GetObjectIDs(self,theGroup):
12282 Returns a list of sub-objects ID stored in the group
12285 theGroup is a GEOM group for which a list of IDs is requested
12287 # Example: see GEOM_TestOthers.py
12288 ListIDs = self.GroupOp.GetObjects(theGroup)
12289 RaiseIfFailed("GetObjects", self.GroupOp)
12292 ## Returns a type of sub-objects stored in the group
12293 # @param theGroup is a GEOM group which type is returned.
12295 # @ref swig_GetType "Example"
12296 @ManageTransactions("GroupOp")
12297 def GetType(self,theGroup):
12299 Returns a type of sub-objects stored in the group
12302 theGroup is a GEOM group which type is returned.
12304 # Example: see GEOM_TestOthers.py
12305 aType = self.GroupOp.GetType(theGroup)
12306 RaiseIfFailed("GetType", self.GroupOp)
12309 ## Convert a type of geom object from id to string value
12310 # @param theId is a GEOM obect type id.
12311 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12312 # @ref swig_GetType "Example"
12313 def ShapeIdToType(self, theId):
12315 Convert a type of geom object from id to string value
12318 theId is a GEOM obect type id.
12321 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12348 return "REVOLUTION"
12396 return "FREE_BOUNDS"
12404 return "THRUSECTIONS"
12406 return "COMPOUNDFILTER"
12408 return "SHAPES_ON_SHAPE"
12410 return "ELLIPSE_ARC"
12412 return "3DSKETCHER"
12418 return "PIPETSHAPE"
12419 return "Shape Id not exist."
12421 ## Returns a main shape associated with the group
12422 # @param theGroup is a GEOM group for which a main shape object is requested
12423 # @return a GEOM object which is a main shape for theGroup
12425 # @ref swig_GetMainShape "Example"
12426 @ManageTransactions("GroupOp")
12427 def GetMainShape(self,theGroup):
12429 Returns a main shape associated with the group
12432 theGroup is a GEOM group for which a main shape object is requested
12435 a GEOM object which is a main shape for theGroup
12437 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12439 # Example: see GEOM_TestOthers.py
12440 anObj = self.GroupOp.GetMainShape(theGroup)
12441 RaiseIfFailed("GetMainShape", self.GroupOp)
12444 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12445 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12446 # @param theShape given shape (see GEOM.GEOM_Object)
12447 # @param min_length minimum length of edges of theShape
12448 # @param max_length maximum length of edges of theShape
12449 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12450 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12451 # @param theName Object name; when specified, this parameter is used
12452 # for result publication in the study. Otherwise, if automatic
12453 # publication is switched on, default value is used for result name.
12455 # @return a newly created GEOM group of edges
12457 # @@ref swig_todo "Example"
12458 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12460 Create group of edges of theShape, whose length is in range [min_length, max_length].
12461 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12464 theShape given shape
12465 min_length minimum length of edges of theShape
12466 max_length maximum length of edges of theShape
12467 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12468 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12469 theName Object name; when specified, this parameter is used
12470 for result publication in the study. Otherwise, if automatic
12471 publication is switched on, default value is used for result name.
12474 a newly created GEOM group of edges.
12476 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12477 edges_in_range = []
12479 Props = self.BasicProperties(edge)
12480 if min_length <= Props[0] and Props[0] <= max_length:
12481 if (not include_min) and (min_length == Props[0]):
12484 if (not include_max) and (Props[0] == max_length):
12487 edges_in_range.append(edge)
12489 if len(edges_in_range) <= 0:
12490 print "No edges found by given criteria"
12493 # note: auto-publishing is done in self.CreateGroup()
12494 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12495 self.UnionList(group_edges, edges_in_range)
12499 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12500 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12501 # @param min_length minimum length of edges of selected shape
12502 # @param max_length maximum length of edges of selected shape
12503 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12504 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12505 # @return a newly created GEOM group of edges
12506 # @ref swig_todo "Example"
12507 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12509 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12510 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12513 min_length minimum length of edges of selected shape
12514 max_length maximum length of edges of selected shape
12515 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12516 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12519 a newly created GEOM group of edges.
12521 nb_selected = sg.SelectedCount()
12522 if nb_selected < 1:
12523 print "Select a shape before calling this function, please."
12525 if nb_selected > 1:
12526 print "Only one shape must be selected"
12529 id_shape = sg.getSelected(0)
12530 shape = IDToObject( id_shape )
12532 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12536 if include_min: left_str = " <= "
12537 if include_max: right_str = " <= "
12539 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12540 + left_str + "length" + right_str + `max_length`)
12542 sg.updateObjBrowser(1)
12549 ## @addtogroup l4_advanced
12552 ## Create a T-shape object with specified caracteristics for the main
12553 # and the incident pipes (radius, width, half-length).
12554 # The extremities of the main pipe are located on junctions points P1 and P2.
12555 # The extremity of the incident pipe is located on junction point P3.
12556 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12557 # the main plane of the T-shape is XOY.
12559 # @param theR1 Internal radius of main pipe
12560 # @param theW1 Width of main pipe
12561 # @param theL1 Half-length of main pipe
12562 # @param theR2 Internal radius of incident pipe (R2 < R1)
12563 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12564 # @param theL2 Half-length of incident pipe
12566 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12567 # @param theP1 1st junction point of main pipe
12568 # @param theP2 2nd junction point of main pipe
12569 # @param theP3 Junction point of incident pipe
12571 # @param theRL Internal radius of left thickness reduction
12572 # @param theWL Width of left thickness reduction
12573 # @param theLtransL Length of left transition part
12574 # @param theLthinL Length of left thin part
12576 # @param theRR Internal radius of right thickness reduction
12577 # @param theWR Width of right thickness reduction
12578 # @param theLtransR Length of right transition part
12579 # @param theLthinR Length of right thin part
12581 # @param theRI Internal radius of incident thickness reduction
12582 # @param theWI Width of incident thickness reduction
12583 # @param theLtransI Length of incident transition part
12584 # @param theLthinI Length of incident thin part
12586 # @param theName Object name; when specified, this parameter is used
12587 # for result publication in the study. Otherwise, if automatic
12588 # publication is switched on, default value is used for result name.
12590 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12592 # @ref tui_creation_pipetshape "Example"
12593 @ManageTransactions("AdvOp")
12594 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
12595 theHexMesh=True, theP1=None, theP2=None, theP3=None,
12596 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12597 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12598 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12601 Create a T-shape object with specified caracteristics for the main
12602 and the incident pipes (radius, width, half-length).
12603 The extremities of the main pipe are located on junctions points P1 and P2.
12604 The extremity of the incident pipe is located on junction point P3.
12605 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12606 the main plane of the T-shape is XOY.
12609 theR1 Internal radius of main pipe
12610 theW1 Width of main pipe
12611 theL1 Half-length of main pipe
12612 theR2 Internal radius of incident pipe (R2 < R1)
12613 theW2 Width of incident pipe (R2+W2 < R1+W1)
12614 theL2 Half-length of incident pipe
12615 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12616 theP1 1st junction point of main pipe
12617 theP2 2nd junction point of main pipe
12618 theP3 Junction point of incident pipe
12620 theRL Internal radius of left thickness reduction
12621 theWL Width of left thickness reduction
12622 theLtransL Length of left transition part
12623 theLthinL Length of left thin part
12625 theRR Internal radius of right thickness reduction
12626 theWR Width of right thickness reduction
12627 theLtransR Length of right transition part
12628 theLthinR Length of right thin part
12630 theRI Internal radius of incident thickness reduction
12631 theWI Width of incident thickness reduction
12632 theLtransI Length of incident transition part
12633 theLthinI Length of incident thin part
12635 theName Object name; when specified, this parameter is used
12636 for result publication in the study. Otherwise, if automatic
12637 publication is switched on, default value is used for result name.
12640 List of GEOM_Object, containing the created shape and propagation groups.
12643 # create PipeTShape object
12644 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12645 # create PipeTShape object with position
12646 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12647 # create PipeTShape object with left thickness reduction
12648 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12650 theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
12651 if (theP1 and theP2 and theP3):
12652 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12653 theRL, theWL, theLtransL, theLthinL,
12654 theRR, theWR, theLtransR, theLthinR,
12655 theRI, theWI, theLtransI, theLthinI,
12656 theHexMesh, theP1, theP2, theP3)
12658 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12659 theRL, theWL, theLtransL, theLthinL,
12660 theRR, theWR, theLtransR, theLthinR,
12661 theRI, theWI, theLtransI, theLthinI,
12663 RaiseIfFailed("MakePipeTShape", self.AdvOp)
12664 if Parameters: anObj[0].SetParameters(Parameters)
12665 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12666 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12669 ## Create a T-shape object with chamfer and with specified caracteristics for the main
12670 # and the incident pipes (radius, width, half-length). The chamfer is
12671 # created on the junction of the pipes.
12672 # The extremities of the main pipe are located on junctions points P1 and P2.
12673 # The extremity of the incident pipe is located on junction point P3.
12674 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12675 # the main plane of the T-shape is XOY.
12676 # @param theR1 Internal radius of main pipe
12677 # @param theW1 Width of main pipe
12678 # @param theL1 Half-length of main pipe
12679 # @param theR2 Internal radius of incident pipe (R2 < R1)
12680 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12681 # @param theL2 Half-length of incident pipe
12682 # @param theH Height of the chamfer.
12683 # @param theW Width of the chamfer.
12684 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12685 # @param theP1 1st junction point of main pipe
12686 # @param theP2 2nd junction point of main pipe
12687 # @param theP3 Junction point of incident pipe
12689 # @param theRL Internal radius of left thickness reduction
12690 # @param theWL Width of left thickness reduction
12691 # @param theLtransL Length of left transition part
12692 # @param theLthinL Length of left thin part
12694 # @param theRR Internal radius of right thickness reduction
12695 # @param theWR Width of right thickness reduction
12696 # @param theLtransR Length of right transition part
12697 # @param theLthinR Length of right thin part
12699 # @param theRI Internal radius of incident thickness reduction
12700 # @param theWI Width of incident thickness reduction
12701 # @param theLtransI Length of incident transition part
12702 # @param theLthinI Length of incident thin part
12704 # @param theName Object name; when specified, this parameter is used
12705 # for result publication in the study. Otherwise, if automatic
12706 # publication is switched on, default value is used for result name.
12708 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12710 # @ref tui_creation_pipetshape "Example"
12711 @ManageTransactions("AdvOp")
12712 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12713 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12714 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12715 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12716 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12719 Create a T-shape object with chamfer and with specified caracteristics for the main
12720 and the incident pipes (radius, width, half-length). The chamfer is
12721 created on the junction of the pipes.
12722 The extremities of the main pipe are located on junctions points P1 and P2.
12723 The extremity of the incident pipe is located on junction point P3.
12724 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12725 the main plane of the T-shape is XOY.
12728 theR1 Internal radius of main pipe
12729 theW1 Width of main pipe
12730 theL1 Half-length of main pipe
12731 theR2 Internal radius of incident pipe (R2 < R1)
12732 theW2 Width of incident pipe (R2+W2 < R1+W1)
12733 theL2 Half-length of incident pipe
12734 theH Height of the chamfer.
12735 theW Width of the chamfer.
12736 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12737 theP1 1st junction point of main pipe
12738 theP2 2nd junction point of main pipe
12739 theP3 Junction point of incident pipe
12741 theRL Internal radius of left thickness reduction
12742 theWL Width of left thickness reduction
12743 theLtransL Length of left transition part
12744 theLthinL Length of left thin part
12746 theRR Internal radius of right thickness reduction
12747 theWR Width of right thickness reduction
12748 theLtransR Length of right transition part
12749 theLthinR Length of right thin part
12751 theRI Internal radius of incident thickness reduction
12752 theWI Width of incident thickness reduction
12753 theLtransI Length of incident transition part
12754 theLthinI Length of incident thin part
12756 theName Object name; when specified, this parameter is used
12757 for result publication in the study. Otherwise, if automatic
12758 publication is switched on, default value is used for result name.
12761 List of GEOM_Object, containing the created shape and propagation groups.
12764 # create PipeTShape with chamfer object
12765 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12766 # create PipeTShape with chamfer object with position
12767 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12768 # create PipeTShape with chamfer object with left thickness reduction
12769 pipetshapechamfer_thr = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12771 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
12772 if (theP1 and theP2 and theP3):
12773 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12774 theRL, theWL, theLtransL, theLthinL,
12775 theRR, theWR, theLtransR, theLthinR,
12776 theRI, theWI, theLtransI, theLthinI,
12777 theH, theW, theHexMesh, theP1, theP2, theP3)
12779 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12780 theRL, theWL, theLtransL, theLthinL,
12781 theRR, theWR, theLtransR, theLthinR,
12782 theRI, theWI, theLtransI, theLthinI,
12783 theH, theW, theHexMesh)
12784 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12785 if Parameters: anObj[0].SetParameters(Parameters)
12786 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12787 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12790 ## Create a T-shape object with fillet and with specified caracteristics for the main
12791 # and the incident pipes (radius, width, half-length). The fillet is
12792 # created on the junction of the pipes.
12793 # The extremities of the main pipe are located on junctions points P1 and P2.
12794 # The extremity of the incident pipe is located on junction point P3.
12795 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12796 # the main plane of the T-shape is XOY.
12797 # @param theR1 Internal radius of main pipe
12798 # @param theW1 Width of main pipe
12799 # @param theL1 Half-length of main pipe
12800 # @param theR2 Internal radius of incident pipe (R2 < R1)
12801 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12802 # @param theL2 Half-length of incident pipe
12803 # @param theRF Radius of curvature of fillet.
12804 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12805 # @param theP1 1st junction point of main pipe
12806 # @param theP2 2nd junction point of main pipe
12807 # @param theP3 Junction point of incident pipe
12809 # @param theRL Internal radius of left thickness reduction
12810 # @param theWL Width of left thickness reduction
12811 # @param theLtransL Length of left transition part
12812 # @param theLthinL Length of left thin part
12814 # @param theRR Internal radius of right thickness reduction
12815 # @param theWR Width of right thickness reduction
12816 # @param theLtransR Length of right transition part
12817 # @param theLthinR Length of right thin part
12819 # @param theRI Internal radius of incident thickness reduction
12820 # @param theWI Width of incident thickness reduction
12821 # @param theLtransI Length of incident transition part
12822 # @param theLthinI Length of incident thin part
12824 # @param theName Object name; when specified, this parameter is used
12825 # for result publication in the study. Otherwise, if automatic
12826 # publication is switched on, default value is used for result name.
12828 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12830 # @ref tui_creation_pipetshape "Example"
12831 @ManageTransactions("AdvOp")
12832 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12833 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12834 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12835 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12836 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12839 Create a T-shape object with fillet and with specified caracteristics for the main
12840 and the incident pipes (radius, width, half-length). The fillet is
12841 created on the junction of the pipes.
12842 The extremities of the main pipe are located on junctions points P1 and P2.
12843 The extremity of the incident pipe is located on junction point P3.
12846 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12847 the main plane of the T-shape is XOY.
12848 theR1 Internal radius of main pipe
12849 theW1 Width of main pipe
12850 heL1 Half-length of main pipe
12851 theR2 Internal radius of incident pipe (R2 < R1)
12852 theW2 Width of incident pipe (R2+W2 < R1+W1)
12853 theL2 Half-length of incident pipe
12854 theRF Radius of curvature of fillet.
12855 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12856 theP1 1st junction point of main pipe
12857 theP2 2nd junction point of main pipe
12858 theP3 Junction point of incident pipe
12860 theRL Internal radius of left thickness reduction
12861 theWL Width of left thickness reduction
12862 theLtransL Length of left transition part
12863 theLthinL Length of left thin part
12865 theRR Internal radius of right thickness reduction
12866 theWR Width of right thickness reduction
12867 theLtransR Length of right transition part
12868 theLthinR Length of right thin part
12870 theRI Internal radius of incident thickness reduction
12871 theWI Width of incident thickness reduction
12872 theLtransI Length of incident transition part
12873 theLthinI Length of incident thin part
12875 theName Object name; when specified, this parameter is used
12876 for result publication in the study. Otherwise, if automatic
12877 publication is switched on, default value is used for result name.
12880 List of GEOM_Object, containing the created shape and propagation groups.
12883 # create PipeTShape with fillet object
12884 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12885 # create PipeTShape with fillet object with position
12886 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12887 # create PipeTShape with fillet object with left thickness reduction
12888 pipetshapefillet_thr = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12890 theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
12891 if (theP1 and theP2 and theP3):
12892 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12893 theRL, theWL, theLtransL, theLthinL,
12894 theRR, theWR, theLtransR, theLthinR,
12895 theRI, theWI, theLtransI, theLthinI,
12896 theRF, theHexMesh, theP1, theP2, theP3)
12898 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12899 theRL, theWL, theLtransL, theLthinL,
12900 theRR, theWR, theLtransR, theLthinR,
12901 theRI, theWI, theLtransI, theLthinI,
12903 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12904 if Parameters: anObj[0].SetParameters(Parameters)
12905 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12906 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12909 ## This function allows creating a disk already divided into blocks. It
12910 # can be used to create divided pipes for later meshing in hexaedra.
12911 # @param theR Radius of the disk
12912 # @param theOrientation Orientation of the plane on which the disk will be built
12913 # 1 = XOY, 2 = OYZ, 3 = OZX
12914 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12915 # @param theName Object name; when specified, this parameter is used
12916 # for result publication in the study. Otherwise, if automatic
12917 # publication is switched on, default value is used for result name.
12919 # @return New GEOM_Object, containing the created shape.
12921 # @ref tui_creation_divideddisk "Example"
12922 @ManageTransactions("AdvOp")
12923 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12925 Creates a disk, divided into blocks. It can be used to create divided pipes
12926 for later meshing in hexaedra.
12929 theR Radius of the disk
12930 theOrientation Orientation of the plane on which the disk will be built:
12931 1 = XOY, 2 = OYZ, 3 = OZX
12932 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12933 theName Object name; when specified, this parameter is used
12934 for result publication in the study. Otherwise, if automatic
12935 publication is switched on, default value is used for result name.
12938 New GEOM_Object, containing the created shape.
12940 theR, Parameters = ParseParameters(theR)
12941 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12942 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12943 if Parameters: anObj.SetParameters(Parameters)
12944 self._autoPublish(anObj, theName, "dividedDisk")
12947 ## This function allows creating a disk already divided into blocks. It
12948 # can be used to create divided pipes for later meshing in hexaedra.
12949 # @param theCenter Center of the disk
12950 # @param theVector Normal vector to the plane of the created disk
12951 # @param theRadius Radius of the disk
12952 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12953 # @param theName Object name; when specified, this parameter is used
12954 # for result publication in the study. Otherwise, if automatic
12955 # publication is switched on, default value is used for result name.
12957 # @return New GEOM_Object, containing the created shape.
12959 # @ref tui_creation_divideddisk "Example"
12960 @ManageTransactions("AdvOp")
12961 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12963 Creates a disk already divided into blocks. It can be used to create divided pipes
12964 for later meshing in hexaedra.
12967 theCenter Center of the disk
12968 theVector Normal vector to the plane of the created disk
12969 theRadius Radius of the disk
12970 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12971 theName Object name; when specified, this parameter is used
12972 for result publication in the study. Otherwise, if automatic
12973 publication is switched on, default value is used for result name.
12976 New GEOM_Object, containing the created shape.
12978 theRadius, Parameters = ParseParameters(theRadius)
12979 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12980 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12981 if Parameters: anObj.SetParameters(Parameters)
12982 self._autoPublish(anObj, theName, "dividedDisk")
12985 ## Builds a cylinder prepared for hexa meshes
12986 # @param theR Radius of the cylinder
12987 # @param theH Height of the cylinder
12988 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12989 # @param theName Object name; when specified, this parameter is used
12990 # for result publication in the study. Otherwise, if automatic
12991 # publication is switched on, default value is used for result name.
12993 # @return New GEOM_Object, containing the created shape.
12995 # @ref tui_creation_dividedcylinder "Example"
12996 @ManageTransactions("AdvOp")
12997 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
12999 Builds a cylinder prepared for hexa meshes
13002 theR Radius of the cylinder
13003 theH Height of the cylinder
13004 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
13005 theName Object name; when specified, this parameter is used
13006 for result publication in the study. Otherwise, if automatic
13007 publication is switched on, default value is used for result name.
13010 New GEOM_Object, containing the created shape.
13012 theR, theH, Parameters = ParseParameters(theR, theH)
13013 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
13014 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
13015 if Parameters: anObj.SetParameters(Parameters)
13016 self._autoPublish(anObj, theName, "dividedCylinder")
13019 ## Create a surface from a cloud of points
13020 # @param thelPoints list of points. Compounds of points are
13021 # accepted as well.
13022 # @param theNbMax maximum number of Bezier pieces in the resulting
13024 # @param theDegMax maximum degree of the resulting BSpline surface.
13025 # @param theDMax 3D tolerance of initial approximation.
13026 # @param theName Object name; when specified, this parameter is used
13027 # for result publication in the study. Otherwise, if automatic
13028 # publication is switched on, default value is used for result name.
13029 # @return New GEOM_Object, containing the created shape.
13030 # @note 3D tolerance of initial approximation represents a tolerance of
13031 # initial plate surface approximation. If this parameter is equal
13032 # to 0 (default value) it is computed. In this case an error of
13033 # initial plate surface computation is used as the approximation
13034 # tolerance. This error represents a maximal distance between
13035 # computed plate surface and given points.
13037 # @ref tui_creation_smoothingsurface "Example"
13038 @ManageTransactions("AdvOp")
13039 def MakeSmoothingSurface(self, thelPoints, theNbMax=2, theDegMax=8,
13040 theDMax=0.0, theName=None):
13042 Create a surface from a cloud of points
13045 thelPoints list of points. Compounds of points are
13047 theNbMax maximum number of Bezier pieces in the resulting
13049 theDegMax maximum degree of the resulting BSpline surface.
13050 theDMax 3D tolerance of initial approximation.
13051 theName Object name; when specified, this parameter is used
13052 for result publication in the study. Otherwise, if automatic
13053 publication is switched on, default value is used for result name.
13056 New GEOM_Object, containing the created shape.
13059 3D tolerance of initial approximation represents a tolerance of
13060 initial plate surface approximation. If this parameter is equal
13061 to 0 (default value) it is computed. In this case an error of
13062 initial plate surface computation is used as the approximation
13063 tolerance. This error represents a maximal distance between
13064 computed plate surface and given points.
13066 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints, theNbMax,
13067 theDegMax, theDMax)
13068 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
13069 self._autoPublish(anObj, theName, "smoothing")
13072 ## Export a shape to XAO format
13073 # @param shape The shape to export
13074 # @param groups The list of groups to export
13075 # @param fields The list of fields to export
13076 # @param author The author of the export
13077 # @param fileName The name of the file to export
13080 # @ref tui_exportxao "Example"
13081 @ManageTransactions("InsertOp")
13082 def ExportXAO(self, shape, groups, fields, author, fileName):
13083 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
13084 RaiseIfFailed("ExportXAO", self.InsertOp)
13087 ## Import a shape from XAO format
13088 # @param shape Shape to export
13089 # @param fileName The name of the file to import
13090 # @return tuple (res, shape, subShapes, groups, fields)
13091 # res Flag indicating if the import was successful
13092 # shape The imported shape
13093 # subShapes The list of imported subShapes
13094 # groups The list of imported groups
13095 # fields The list of imported fields
13097 # @ref tui_importxao "Example"
13098 @ManageTransactions("InsertOp")
13099 def ImportXAO(self, fileName):
13100 res = self.InsertOp.ImportXAO(fileName)
13101 RaiseIfFailed("ImportXAO", self.InsertOp)
13104 #@@ insert new functions before this line @@ do not remove this line @@#
13106 # end of l4_advanced
13109 ## Create a copy of the given object
13111 # @param theOriginal geometry object for copy
13112 # @param theName Object name; when specified, this parameter is used
13113 # for result publication in the study. Otherwise, if automatic
13114 # publication is switched on, default value is used for result name.
13116 # @return New GEOM_Object, containing the copied shape.
13118 # @ingroup l1_geomBuilder_auxiliary
13119 # @ref swig_MakeCopy "Example"
13120 @ManageTransactions("InsertOp")
13121 def MakeCopy(self, theOriginal, theName=None):
13123 Create a copy of the given object
13126 theOriginal geometry object for copy
13127 theName Object name; when specified, this parameter is used
13128 for result publication in the study. Otherwise, if automatic
13129 publication is switched on, default value is used for result name.
13132 New GEOM_Object, containing the copied shape.
13134 Example of usage: Copy = geompy.MakeCopy(Box)
13136 # Example: see GEOM_TestAll.py
13137 anObj = self.InsertOp.MakeCopy(theOriginal)
13138 RaiseIfFailed("MakeCopy", self.InsertOp)
13139 self._autoPublish(anObj, theName, "copy")
13142 ## Add Path to load python scripts from
13143 # @param Path a path to load python scripts from
13144 # @ingroup l1_geomBuilder_auxiliary
13145 def addPath(self,Path):
13147 Add Path to load python scripts from
13150 Path a path to load python scripts from
13152 if (sys.path.count(Path) < 1):
13153 sys.path.append(Path)
13157 ## Load marker texture from the file
13158 # @param Path a path to the texture file
13159 # @return unique texture identifier
13160 # @ingroup l1_geomBuilder_auxiliary
13161 @ManageTransactions("InsertOp")
13162 def LoadTexture(self, Path):
13164 Load marker texture from the file
13167 Path a path to the texture file
13170 unique texture identifier
13172 # Example: see GEOM_TestAll.py
13173 ID = self.InsertOp.LoadTexture(Path)
13174 RaiseIfFailed("LoadTexture", self.InsertOp)
13177 ## Get internal name of the object based on its study entry
13178 # @note This method does not provide an unique identifier of the geometry object.
13179 # @note This is internal function of GEOM component, though it can be used outside it for
13180 # appropriate reason (e.g. for identification of geometry object).
13181 # @param obj geometry object
13182 # @return unique object identifier
13183 # @ingroup l1_geomBuilder_auxiliary
13184 def getObjectID(self, obj):
13186 Get internal name of the object based on its study entry.
13187 Note: this method does not provide an unique identifier of the geometry object.
13188 It is an internal function of GEOM component, though it can be used outside GEOM for
13189 appropriate reason (e.g. for identification of geometry object).
13192 obj geometry object
13195 unique object identifier
13198 entry = salome.ObjectToID(obj)
13199 if entry is not None:
13200 lst = entry.split(":")
13202 ID = lst[-1] # -1 means last item in the list
13203 return "GEOM_" + ID
13208 ## Add marker texture. @a Width and @a Height parameters
13209 # specify width and height of the texture in pixels.
13210 # If @a RowData is @c True, @a Texture parameter should represent texture data
13211 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13212 # parameter should be unpacked string, in which '1' symbols represent opaque
13213 # pixels and '0' represent transparent pixels of the texture bitmap.
13215 # @param Width texture width in pixels
13216 # @param Height texture height in pixels
13217 # @param Texture texture data
13218 # @param RowData if @c True, @a Texture data are packed in the byte stream
13219 # @return unique texture identifier
13220 # @ingroup l1_geomBuilder_auxiliary
13221 @ManageTransactions("InsertOp")
13222 def AddTexture(self, Width, Height, Texture, RowData=False):
13224 Add marker texture. Width and Height parameters
13225 specify width and height of the texture in pixels.
13226 If RowData is True, Texture parameter should represent texture data
13227 packed into the byte array. If RowData is False (default), Texture
13228 parameter should be unpacked string, in which '1' symbols represent opaque
13229 pixels and '0' represent transparent pixels of the texture bitmap.
13232 Width texture width in pixels
13233 Height texture height in pixels
13234 Texture texture data
13235 RowData if True, Texture data are packed in the byte stream
13238 return unique texture identifier
13240 if not RowData: Texture = PackData(Texture)
13241 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13242 RaiseIfFailed("AddTexture", self.InsertOp)
13245 ## Creates a new folder object. It is a container for any GEOM objects.
13246 # @param Name name of the container
13247 # @param Father parent object. If None,
13248 # folder under 'Geometry' root object will be created.
13249 # @return a new created folder
13250 # @ingroup l1_publish_data
13251 def NewFolder(self, Name, Father=None):
13253 Create a new folder object. It is an auxiliary container for any GEOM objects.
13256 Name name of the container
13257 Father parent object. If None,
13258 folder under 'Geometry' root object will be created.
13261 a new created folder
13263 if not Father: Father = self.father
13264 return self.CreateFolder(Name, Father)
13266 ## Move object to the specified folder
13267 # @param Object object to move
13268 # @param Folder target folder
13269 # @ingroup l1_publish_data
13270 def PutToFolder(self, Object, Folder):
13272 Move object to the specified folder
13275 Object object to move
13276 Folder target folder
13278 self.MoveToFolder(Object, Folder)
13281 ## Move list of objects to the specified folder
13282 # @param ListOfSO list of objects to move
13283 # @param Folder target folder
13284 # @ingroup l1_publish_data
13285 def PutListToFolder(self, ListOfSO, Folder):
13287 Move list of objects to the specified folder
13290 ListOfSO list of objects to move
13291 Folder target folder
13293 self.MoveListToFolder(ListOfSO, Folder)
13296 ## @addtogroup l2_field
13300 # @param shape the shape the field lies on
13301 # @param name the field name
13302 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13303 # @param dimension dimension of the shape the field lies on
13304 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13305 # @param componentNames names of components
13306 # @return a created field
13307 @ManageTransactions("FieldOp")
13308 def CreateField(self, shape, name, type, dimension, componentNames):
13313 shape the shape the field lies on
13314 name the field name
13315 type type of field data
13316 dimension dimension of the shape the field lies on
13317 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13318 componentNames names of components
13323 if isinstance( type, int ):
13324 if type < 0 or type > 3:
13325 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
13326 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13328 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13329 RaiseIfFailed("CreateField", self.FieldOp)
13331 geom._autoPublish( f, "", name)
13334 ## Removes a field from the GEOM component
13335 # @param field the field to remove
13336 def RemoveField(self, field):
13337 "Removes a field from the GEOM component"
13339 if isinstance( field, GEOM._objref_GEOM_Field ):
13340 geom.RemoveObject( field )
13341 elif isinstance( field, geomField ):
13342 geom.RemoveObject( field.field )
13344 raise RuntimeError, "RemoveField() : the object is not a field"
13347 ## Returns number of fields on a shape
13348 @ManageTransactions("FieldOp")
13349 def CountFields(self, shape):
13350 "Returns number of fields on a shape"
13351 nb = self.FieldOp.CountFields( shape )
13352 RaiseIfFailed("CountFields", self.FieldOp)
13355 ## Returns all fields on a shape
13356 @ManageTransactions("FieldOp")
13357 def GetFields(self, shape):
13358 "Returns all fields on a shape"
13359 ff = self.FieldOp.GetFields( shape )
13360 RaiseIfFailed("GetFields", self.FieldOp)
13363 ## Returns a field on a shape by its name
13364 @ManageTransactions("FieldOp")
13365 def GetField(self, shape, name):
13366 "Returns a field on a shape by its name"
13367 f = self.FieldOp.GetField( shape, name )
13368 RaiseIfFailed("GetField", self.FieldOp)
13376 # Register the new proxy for GEOM_Gen
13377 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13380 ## Field on Geometry
13381 # @ingroup l2_field
13382 class geomField( GEOM._objref_GEOM_Field ):
13384 def __init__(self):
13385 GEOM._objref_GEOM_Field.__init__(self)
13386 self.field = GEOM._objref_GEOM_Field
13389 ## Returns the shape the field lies on
13390 def getShape(self):
13391 "Returns the shape the field lies on"
13392 return self.field.GetShape(self)
13394 ## Returns the field name
13396 "Returns the field name"
13397 return self.field.GetName(self)
13399 ## Returns type of field data as integer [0-3]
13401 "Returns type of field data"
13402 return self.field.GetDataType(self)._v
13404 ## Returns type of field data:
13405 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13406 def getTypeEnum(self):
13407 "Returns type of field data"
13408 return self.field.GetDataType(self)
13410 ## Returns dimension of the shape the field lies on:
13411 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13412 def getDimension(self):
13413 """Returns dimension of the shape the field lies on:
13414 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13415 return self.field.GetDimension(self)
13417 ## Returns names of components
13418 def getComponents(self):
13419 "Returns names of components"
13420 return self.field.GetComponents(self)
13422 ## Adds a time step to the field
13423 # @param step the time step number further used as the step identifier
13424 # @param stamp the time step time
13425 # @param values the values of the time step
13426 def addStep(self, step, stamp, values):
13427 "Adds a time step to the field"
13428 stp = self.field.AddStep( self, step, stamp )
13430 raise RuntimeError, \
13431 "Field.addStep() : Error: step %s already exists in this field"%step
13433 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13434 self.setValues( step, values )
13437 ## Remove a time step from the field
13438 def removeStep(self,step):
13439 "Remove a time step from the field"
13442 stepObj = self.field.GetStep( self, step )
13444 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13447 #traceback.print_exc()
13449 self.field.RemoveStep( self, step )
13451 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13454 ## Returns number of time steps in the field
13455 def countSteps(self):
13456 "Returns number of time steps in the field"
13457 return self.field.CountSteps(self)
13459 ## Returns a list of time step IDs in the field
13460 def getSteps(self):
13461 "Returns a list of time step IDs in the field"
13462 return self.field.GetSteps(self)
13464 ## Returns a time step by its ID
13465 def getStep(self,step):
13466 "Returns a time step by its ID"
13467 stp = self.field.GetStep(self, step)
13469 raise RuntimeError, "Step %s is missing from this field"%step
13472 ## Returns the time of the field step
13473 def getStamp(self,step):
13474 "Returns the time of the field step"
13475 return self.getStep(step).GetStamp()
13477 ## Changes the time of the field step
13478 def setStamp(self, step, stamp):
13479 "Changes the time of the field step"
13480 return self.getStep(step).SetStamp(stamp)
13482 ## Returns values of the field step
13483 def getValues(self, step):
13484 "Returns values of the field step"
13485 return self.getStep(step).GetValues()
13487 ## Changes values of the field step
13488 def setValues(self, step, values):
13489 "Changes values of the field step"
13490 stp = self.getStep(step)
13491 errBeg = "Field.setValues(values) : Error: "
13493 ok = stp.SetValues( values )
13494 except Exception, e:
13496 if excStr.find("WrongPythonType") > 0:
13497 raise RuntimeError, errBeg +\
13498 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13499 raise RuntimeError, errBeg + str(e)
13501 nbOK = self.field.GetArraySize(self)
13504 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13506 raise RuntimeError, errBeg + "failed"
13509 pass # end of class geomField
13511 # Register the new proxy for GEOM_Field
13512 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13515 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13516 # interface to GEOM operations.
13521 # salome.salome_init()
13522 # from salome.geom import geomBuilder
13523 # geompy = geomBuilder.New(salome.myStudy)
13525 # @param study SALOME study, generally obtained by salome.myStudy.
13526 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13527 # @return geomBuilder instance
13528 def New( study, instance=None):
13530 Create a new geomBuilder instance.The geomBuilder class provides the Python
13531 interface to GEOM operations.
13535 salome.salome_init()
13536 from salome.geom import geomBuilder
13537 geompy = geomBuilder.New(salome.myStudy)
13540 study SALOME study, generally obtained by salome.myStudy.
13541 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13543 geomBuilder instance
13545 #print "New geomBuilder ", study, instance
13552 geom = geomBuilder()
13553 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13554 geom.init_geom(study)