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 taking into account their gravity centers,
5792 # to provide stable order of sub-shapes.
5793 # If the shape itself matches the type, it is also returned.
5794 # @param aShape Shape to be exploded.
5795 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5796 # @param theName Object name; when specified, this parameter is used
5797 # for result publication in the study. Otherwise, if automatic
5798 # publication is switched on, default value is used for result name.
5800 # @return List of sub-shapes of type theShapeType, contained in theShape.
5802 # @ref swig_SubShapeAllSorted "Example"
5803 @ManageTransactions("ShapesOp")
5804 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5806 Explode a shape on sub-shapes of a given type.
5807 Sub-shapes will be sorted taking into account their gravity centers,
5808 to provide stable order of sub-shapes.
5809 If the shape itself matches the type, it is also returned.
5812 aShape Shape to be exploded.
5813 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5814 theName Object name; when specified, this parameter is used
5815 for result publication in the study. Otherwise, if automatic
5816 publication is switched on, default value is used for result name.
5819 List of sub-shapes of type theShapeType, contained in theShape.
5821 # Example: see GEOM_TestAll.py
5822 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5823 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5824 self._autoPublish(ListObj, theName, "subshape")
5827 ## Explode a shape on sub-shapes of a given type.
5828 # Sub-shapes will be sorted taking into account their gravity centers,
5829 # to provide stable order of sub-shapes.
5830 # @param aShape Shape to be exploded.
5831 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5832 # @return List of IDs of sub-shapes.
5834 # @ref swig_all_decompose "Example"
5835 @ManageTransactions("ShapesOp")
5836 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5838 Explode a shape on sub-shapes of a given type.
5839 Sub-shapes will be sorted taking into account their gravity centers,
5840 to provide stable order of sub-shapes.
5843 aShape Shape to be exploded.
5844 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5847 List of IDs of sub-shapes.
5849 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5850 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5853 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5854 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5855 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5856 # @param aShape Shape to get sub-shape of.
5857 # @param ListOfInd List of sub-shapes indices.
5858 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5859 # @param theName Object name; when specified, this parameter is used
5860 # for result publication in the study. Otherwise, if automatic
5861 # publication is switched on, default value is used for result name.
5863 # @return A compound of sub-shapes of aShape.
5865 # @ref swig_all_decompose "Example"
5866 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5868 Obtain a compound of sub-shapes of aShape,
5869 selected by they indices in sorted list of all sub-shapes of type aType.
5870 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5873 aShape Shape to get sub-shape of.
5874 ListOfID List of sub-shapes indices.
5875 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5876 theName Object name; when specified, this parameter is used
5877 for result publication in the study. Otherwise, if automatic
5878 publication is switched on, default value is used for result name.
5881 A compound of sub-shapes of aShape.
5883 # Example: see GEOM_TestAll.py
5885 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5886 for ind in ListOfInd:
5887 ListOfIDs.append(AllShapeIDsList[ind - 1])
5888 # note: auto-publishing is done in self.GetSubShape()
5889 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5892 ## Extract shapes (excluding the main shape) of given type.
5893 # @param aShape The shape.
5894 # @param aType The shape type (see ShapeType())
5895 # @param isSorted Boolean flag to switch sorting on/off.
5896 # @param theName Object name; when specified, this parameter is used
5897 # for result publication in the study. Otherwise, if automatic
5898 # publication is switched on, default value is used for result name.
5900 # @return List of sub-shapes of type aType, contained in aShape.
5902 # @ref swig_FilletChamfer "Example"
5903 @ManageTransactions("ShapesOp")
5904 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5906 Extract shapes (excluding the main shape) of given type.
5910 aType The shape type (see geompy.ShapeType)
5911 isSorted Boolean flag to switch sorting on/off.
5912 theName Object name; when specified, this parameter is used
5913 for result publication in the study. Otherwise, if automatic
5914 publication is switched on, default value is used for result name.
5917 List of sub-shapes of type aType, contained in aShape.
5919 # Example: see GEOM_TestAll.py
5920 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5921 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5922 self._autoPublish(ListObj, theName, "subshape")
5925 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5926 # @param aShape Main shape.
5927 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5928 # @param theName Object name; when specified, this parameter is used
5929 # for result publication in the study. Otherwise, if automatic
5930 # publication is switched on, default value is used for result name.
5931 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5933 # @ref swig_all_decompose "Example"
5934 @ManageTransactions("ShapesOp")
5935 def SubShapes(self, aShape, anIDs, theName=None):
5937 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5941 anIDs List of unique IDs of sub-shapes inside theMainShape.
5942 theName Object name; when specified, this parameter is used
5943 for result publication in the study. Otherwise, if automatic
5944 publication is switched on, default value is used for result name.
5947 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5949 # Example: see GEOM_TestAll.py
5950 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5951 RaiseIfFailed("SubShapes", self.ShapesOp)
5952 self._autoPublish(ListObj, theName, "subshape")
5955 # end of l4_decompose
5958 ## @addtogroup l4_decompose_d
5961 ## Deprecated method
5962 # It works like SubShapeAllSortedCentres(), but wrongly
5963 # defines centres of faces, shells and solids.
5964 @ManageTransactions("ShapesOp")
5965 def SubShapeAllSorted(self, aShape, aType, theName=None):
5968 It works like geompy.SubShapeAllSortedCentres, but wrongly
5969 defines centres of faces, shells and solids.
5971 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5972 RaiseIfFailed("MakeExplode", self.ShapesOp)
5973 self._autoPublish(ListObj, theName, "subshape")
5976 ## Deprecated method
5977 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5978 # defines centres of faces, shells and solids.
5979 @ManageTransactions("ShapesOp")
5980 def SubShapeAllSortedIDs(self, aShape, aType):
5983 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5984 defines centres of faces, shells and solids.
5986 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5987 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5990 ## Deprecated method
5991 # It works like SubShapeSortedCentres(), but has a bug
5992 # (wrongly defines centres of faces, shells and solids).
5993 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5996 It works like geompy.SubShapeSortedCentres, but has a bug
5997 (wrongly defines centres of faces, shells and solids).
6000 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6001 for ind in ListOfInd:
6002 ListOfIDs.append(AllShapeIDsList[ind - 1])
6003 # note: auto-publishing is done in self.GetSubShape()
6004 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6007 # end of l4_decompose_d
6010 ## @addtogroup l3_healing
6013 ## Apply a sequence of Shape Healing operators to the given object.
6014 # @param theShape Shape to be processed.
6015 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6016 # @param theParameters List of names of parameters
6017 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6018 # @param theValues List of values of parameters, in the same order
6019 # as parameters are listed in <VAR>theParameters</VAR> list.
6020 # @param theName Object name; when specified, this parameter is used
6021 # for result publication in the study. Otherwise, if automatic
6022 # publication is switched on, default value is used for result name.
6024 # <b> Operators and Parameters: </b> \n
6026 # * \b FixShape - corrects invalid shapes. \n
6027 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6028 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6030 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6031 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6032 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6033 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6035 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6036 # surfaces in segments using a certain angle. \n
6037 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6038 # if Angle=180, four if Angle=90, etc). \n
6039 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6041 # * \b SplitClosedFaces - splits closed faces in segments.
6042 # The number of segments depends on the number of splitting points.\n
6043 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6045 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6046 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6047 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6048 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6049 # This and the previous parameters can take the following values:\n
6050 # \b Parametric \b Continuity \n
6051 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6052 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6053 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6054 # ruling out sharp edges).\n
6055 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6056 # are of the same magnitude).\n
6057 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6058 # or surfaces (d/du C(u)) are the same at junction. \n
6059 # \b Geometric \b Continuity \n
6060 # \b G1: first derivatives are proportional at junction.\n
6061 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6062 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6063 # \b G2: first and second derivatives are proportional at junction.
6064 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6065 # continuity requires that the underlying parameterization was continuous as well.
6066 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6068 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6069 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6070 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6071 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6072 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6073 # with the specified parameters.\n
6074 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6075 # with the specified parameters.\n
6076 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6077 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6078 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6079 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6081 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6082 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6083 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6084 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6085 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6087 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6088 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6091 # @return New GEOM.GEOM_Object, containing processed shape.
6093 # \n @ref tui_shape_processing "Example"
6094 @ManageTransactions("HealOp")
6095 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6097 Apply a sequence of Shape Healing operators to the given object.
6100 theShape Shape to be processed.
6101 theValues List of values of parameters, in the same order
6102 as parameters are listed in theParameters list.
6103 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6104 theParameters List of names of parameters
6105 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6106 theName Object name; when specified, this parameter is used
6107 for result publication in the study. Otherwise, if automatic
6108 publication is switched on, default value is used for result name.
6110 Operators and Parameters:
6112 * FixShape - corrects invalid shapes.
6113 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6114 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6115 * FixFaceSize - removes small faces, such as spots and strips.
6116 * FixFaceSize.Tolerance - defines minimum possible face size.
6117 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6118 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6119 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6120 in segments using a certain angle.
6121 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6122 if Angle=180, four if Angle=90, etc).
6123 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6124 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6126 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6127 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6128 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6129 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6130 * SplitContinuity.CurveContinuity - required continuity for curves.
6131 This and the previous parameters can take the following values:
6133 Parametric Continuity:
6134 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6135 coincidental. The curves or surfaces may still meet at an angle,
6136 giving rise to a sharp corner or edge).
6137 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6138 are parallel, ruling out sharp edges).
6139 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6140 or surfaces are of the same magnitude).
6141 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6142 curves or surfaces (d/du C(u)) are the same at junction.
6144 Geometric Continuity:
6145 G1: first derivatives are proportional at junction.
6146 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6147 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6148 G2: first and second derivatives are proportional at junction. As the names imply,
6149 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6150 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6151 geometric continuity of order n, but not vice-versa.
6152 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6153 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6154 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6155 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6156 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6157 the specified parameters.
6158 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6159 the specified parameters.
6160 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6161 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6162 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6163 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6164 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6165 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6166 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6167 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6168 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6169 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6170 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6173 New GEOM.GEOM_Object, containing processed shape.
6175 Note: For more information look through SALOME Geometry User's Guide->
6176 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6178 # Example: see GEOM_TestHealing.py
6179 theValues,Parameters = ParseList(theValues)
6180 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6181 # To avoid script failure in case of good argument shape
6182 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6184 RaiseIfFailed("ProcessShape", self.HealOp)
6185 for string in (theOperators + theParameters):
6186 Parameters = ":" + Parameters
6188 anObj.SetParameters(Parameters)
6189 self._autoPublish(anObj, theName, "healed")
6192 ## Remove faces from the given object (shape).
6193 # @param theObject Shape to be processed.
6194 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6195 # removes ALL faces of the given object.
6196 # @param theName Object name; when specified, this parameter is used
6197 # for result publication in the study. Otherwise, if automatic
6198 # publication is switched on, default value is used for result name.
6200 # @return New GEOM.GEOM_Object, containing processed shape.
6202 # @ref tui_suppress_faces "Example"
6203 @ManageTransactions("HealOp")
6204 def SuppressFaces(self, theObject, theFaces, theName=None):
6206 Remove faces from the given object (shape).
6209 theObject Shape to be processed.
6210 theFaces Indices of faces to be removed, if EMPTY then the method
6211 removes ALL faces of the given object.
6212 theName Object name; when specified, this parameter is used
6213 for result publication in the study. Otherwise, if automatic
6214 publication is switched on, default value is used for result name.
6217 New GEOM.GEOM_Object, containing processed shape.
6219 # Example: see GEOM_TestHealing.py
6220 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6221 RaiseIfFailed("SuppressFaces", self.HealOp)
6222 self._autoPublish(anObj, theName, "suppressFaces")
6225 ## Sewing of some shapes into single shape.
6226 # @param ListShape Shapes to be processed.
6227 # @param theTolerance Required tolerance value.
6228 # @param AllowNonManifold Flag that allows non-manifold sewing.
6229 # @param theName Object name; when specified, this parameter is used
6230 # for result publication in the study. Otherwise, if automatic
6231 # publication is switched on, default value is used for result name.
6233 # @return New GEOM.GEOM_Object, containing processed shape.
6235 # @ref tui_sewing "Example"
6236 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6238 Sewing of some shapes into single shape.
6241 ListShape Shapes to be processed.
6242 theTolerance Required tolerance value.
6243 AllowNonManifold Flag that allows non-manifold sewing.
6244 theName Object name; when specified, this parameter is used
6245 for result publication in the study. Otherwise, if automatic
6246 publication is switched on, default value is used for result name.
6249 New GEOM.GEOM_Object, containing processed shape.
6251 # Example: see GEOM_TestHealing.py
6252 comp = self.MakeCompound(ListShape)
6253 # note: auto-publishing is done in self.Sew()
6254 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6257 ## Sewing of the given object.
6258 # @param theObject Shape to be processed.
6259 # @param theTolerance Required tolerance value.
6260 # @param AllowNonManifold Flag that allows non-manifold sewing.
6261 # @param theName Object name; when specified, this parameter is used
6262 # for result publication in the study. Otherwise, if automatic
6263 # publication is switched on, default value is used for result name.
6265 # @return New GEOM.GEOM_Object, containing processed shape.
6266 @ManageTransactions("HealOp")
6267 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6269 Sewing of the given object.
6272 theObject Shape to be processed.
6273 theTolerance Required tolerance value.
6274 AllowNonManifold Flag that allows non-manifold sewing.
6275 theName Object name; when specified, this parameter is used
6276 for result publication in the study. Otherwise, if automatic
6277 publication is switched on, default value is used for result name.
6280 New GEOM.GEOM_Object, containing processed shape.
6282 # Example: see MakeSewing() above
6283 theTolerance,Parameters = ParseParameters(theTolerance)
6284 if AllowNonManifold:
6285 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6287 anObj = self.HealOp.Sew(theObject, theTolerance)
6288 # To avoid script failure in case of good argument shape
6289 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6291 RaiseIfFailed("Sew", self.HealOp)
6292 anObj.SetParameters(Parameters)
6293 self._autoPublish(anObj, theName, "sewed")
6296 ## Rebuild the topology of theCompound of solids by removing
6297 # of the faces that are shared by several solids.
6298 # @param theCompound Shape to be processed.
6299 # @param theName Object name; when specified, this parameter is used
6300 # for result publication in the study. Otherwise, if automatic
6301 # publication is switched on, default value is used for result name.
6303 # @return New GEOM.GEOM_Object, containing processed shape.
6305 # @ref tui_remove_webs "Example"
6306 @ManageTransactions("HealOp")
6307 def RemoveInternalFaces (self, theCompound, theName=None):
6309 Rebuild the topology of theCompound of solids by removing
6310 of the faces that are shared by several solids.
6313 theCompound Shape to be processed.
6314 theName Object name; when specified, this parameter is used
6315 for result publication in the study. Otherwise, if automatic
6316 publication is switched on, default value is used for result name.
6319 New GEOM.GEOM_Object, containing processed shape.
6321 # Example: see GEOM_TestHealing.py
6322 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6323 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6324 self._autoPublish(anObj, theName, "removeWebs")
6327 ## Remove internal wires and edges from the given object (face).
6328 # @param theObject Shape to be processed.
6329 # @param theWires Indices of wires to be removed, if EMPTY then the method
6330 # removes ALL internal wires of the given object.
6331 # @param theName Object name; when specified, this parameter is used
6332 # for result publication in the study. Otherwise, if automatic
6333 # publication is switched on, default value is used for result name.
6335 # @return New GEOM.GEOM_Object, containing processed shape.
6337 # @ref tui_suppress_internal_wires "Example"
6338 @ManageTransactions("HealOp")
6339 def SuppressInternalWires(self, theObject, theWires, theName=None):
6341 Remove internal wires and edges from the given object (face).
6344 theObject Shape to be processed.
6345 theWires Indices of wires to be removed, if EMPTY then the method
6346 removes ALL internal wires of the given object.
6347 theName Object name; when specified, this parameter is used
6348 for result publication in the study. Otherwise, if automatic
6349 publication is switched on, default value is used for result name.
6352 New GEOM.GEOM_Object, containing processed shape.
6354 # Example: see GEOM_TestHealing.py
6355 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6356 RaiseIfFailed("RemoveIntWires", self.HealOp)
6357 self._autoPublish(anObj, theName, "suppressWires")
6360 ## Remove internal closed contours (holes) from the given object.
6361 # @param theObject Shape to be processed.
6362 # @param theWires Indices of wires to be removed, if EMPTY then the method
6363 # removes ALL internal holes of the given object
6364 # @param theName Object name; when specified, this parameter is used
6365 # for result publication in the study. Otherwise, if automatic
6366 # publication is switched on, default value is used for result name.
6368 # @return New GEOM.GEOM_Object, containing processed shape.
6370 # @ref tui_suppress_holes "Example"
6371 @ManageTransactions("HealOp")
6372 def SuppressHoles(self, theObject, theWires, theName=None):
6374 Remove internal closed contours (holes) from the given object.
6377 theObject Shape to be processed.
6378 theWires Indices of wires to be removed, if EMPTY then the method
6379 removes ALL internal holes of the given object
6380 theName Object name; when specified, this parameter is used
6381 for result publication in the study. Otherwise, if automatic
6382 publication is switched on, default value is used for result name.
6385 New GEOM.GEOM_Object, containing processed shape.
6387 # Example: see GEOM_TestHealing.py
6388 anObj = self.HealOp.FillHoles(theObject, theWires)
6389 RaiseIfFailed("FillHoles", self.HealOp)
6390 self._autoPublish(anObj, theName, "suppressHoles")
6393 ## Close an open wire.
6394 # @param theObject Shape to be processed.
6395 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6396 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6397 # @param isCommonVertex If True : closure by creation of a common vertex,
6398 # If False : closure by creation of an edge between ends.
6399 # @param theName Object name; when specified, this parameter is used
6400 # for result publication in the study. Otherwise, if automatic
6401 # publication is switched on, default value is used for result name.
6403 # @return New GEOM.GEOM_Object, containing processed shape.
6405 # @ref tui_close_contour "Example"
6406 @ManageTransactions("HealOp")
6407 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6412 theObject Shape to be processed.
6413 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6414 if [ ], then theObject itself is a wire.
6415 isCommonVertex If True : closure by creation of a common vertex,
6416 If False : closure by creation of an edge between ends.
6417 theName Object name; when specified, this parameter is used
6418 for result publication in the study. Otherwise, if automatic
6419 publication is switched on, default value is used for result name.
6422 New GEOM.GEOM_Object, containing processed shape.
6424 # Example: see GEOM_TestHealing.py
6425 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6426 RaiseIfFailed("CloseContour", self.HealOp)
6427 self._autoPublish(anObj, theName, "closeContour")
6430 ## Addition of a point to a given edge object.
6431 # @param theObject Shape to be processed.
6432 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6433 # if -1, then theObject itself is the edge.
6434 # @param theValue Value of parameter on edge or length parameter,
6435 # depending on \a isByParameter.
6436 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6437 # if FALSE : \a theValue is treated as a length parameter [0..1]
6438 # @param theName Object name; when specified, this parameter is used
6439 # for result publication in the study. Otherwise, if automatic
6440 # publication is switched on, default value is used for result name.
6442 # @return New GEOM.GEOM_Object, containing processed shape.
6444 # @ref tui_add_point_on_edge "Example"
6445 @ManageTransactions("HealOp")
6446 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6448 Addition of a point to a given edge object.
6451 theObject Shape to be processed.
6452 theEdgeIndex Index of edge to be divided within theObject's shape,
6453 if -1, then theObject itself is the edge.
6454 theValue Value of parameter on edge or length parameter,
6455 depending on isByParameter.
6456 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6457 if FALSE : theValue is treated as a length parameter [0..1]
6458 theName Object name; when specified, this parameter is used
6459 for result publication in the study. Otherwise, if automatic
6460 publication is switched on, default value is used for result name.
6463 New GEOM.GEOM_Object, containing processed shape.
6465 # Example: see GEOM_TestHealing.py
6466 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6467 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6468 RaiseIfFailed("DivideEdge", self.HealOp)
6469 anObj.SetParameters(Parameters)
6470 self._autoPublish(anObj, theName, "divideEdge")
6473 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6474 # @param theWire Wire to minimize the number of C1 continuous edges in.
6475 # @param theVertices A list of vertices to suppress. If the list
6476 # is empty, all vertices in a wire will be assumed.
6477 # @param theName Object name; when specified, this parameter is used
6478 # for result publication in the study. Otherwise, if automatic
6479 # publication is switched on, default value is used for result name.
6481 # @return New GEOM.GEOM_Object with modified wire.
6483 # @ref tui_fuse_collinear_edges "Example"
6484 @ManageTransactions("HealOp")
6485 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6487 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6490 theWire Wire to minimize the number of C1 continuous edges in.
6491 theVertices A list of vertices to suppress. If the list
6492 is empty, all vertices in a wire will be assumed.
6493 theName Object name; when specified, this parameter is used
6494 for result publication in the study. Otherwise, if automatic
6495 publication is switched on, default value is used for result name.
6498 New GEOM.GEOM_Object with modified wire.
6500 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6501 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6502 self._autoPublish(anObj, theName, "fuseEdges")
6505 ## Change orientation of the given object. Updates given shape.
6506 # @param theObject Shape to be processed.
6507 # @return Updated <var>theObject</var>
6509 # @ref swig_todo "Example"
6510 @ManageTransactions("HealOp")
6511 def ChangeOrientationShell(self,theObject):
6513 Change orientation of the given object. Updates given shape.
6516 theObject Shape to be processed.
6521 theObject = self.HealOp.ChangeOrientation(theObject)
6522 RaiseIfFailed("ChangeOrientation", self.HealOp)
6525 ## Change orientation of the given object.
6526 # @param theObject Shape to be processed.
6527 # @param theName Object name; when specified, this parameter is used
6528 # for result publication in the study. Otherwise, if automatic
6529 # publication is switched on, default value is used for result name.
6531 # @return New GEOM.GEOM_Object, containing processed shape.
6533 # @ref swig_todo "Example"
6534 @ManageTransactions("HealOp")
6535 def ChangeOrientationShellCopy(self, theObject, theName=None):
6537 Change orientation of the given object.
6540 theObject Shape to be processed.
6541 theName Object name; when specified, this parameter is used
6542 for result publication in the study. Otherwise, if automatic
6543 publication is switched on, default value is used for result name.
6546 New GEOM.GEOM_Object, containing processed shape.
6548 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6549 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6550 self._autoPublish(anObj, theName, "reversed")
6553 ## Try to limit tolerance of the given object by value \a theTolerance.
6554 # @param theObject Shape to be processed.
6555 # @param theTolerance Required tolerance value.
6556 # @param theName Object name; when specified, this parameter is used
6557 # for result publication in the study. Otherwise, if automatic
6558 # publication is switched on, default value is used for result name.
6560 # @return New GEOM.GEOM_Object, containing processed shape.
6562 # @ref tui_limit_tolerance "Example"
6563 @ManageTransactions("HealOp")
6564 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6566 Try to limit tolerance of the given object by value theTolerance.
6569 theObject Shape to be processed.
6570 theTolerance Required tolerance value.
6571 theName Object name; when specified, this parameter is used
6572 for result publication in the study. Otherwise, if automatic
6573 publication is switched on, default value is used for result name.
6576 New GEOM.GEOM_Object, containing processed shape.
6578 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6579 RaiseIfFailed("LimitTolerance", self.HealOp)
6580 self._autoPublish(anObj, theName, "limitTolerance")
6583 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6584 # that constitute a free boundary of the given shape.
6585 # @param theObject Shape to get free boundary of.
6586 # @param theName Object name; when specified, this parameter is used
6587 # for result publication in the study. Otherwise, if automatic
6588 # publication is switched on, default value is used for result name.
6590 # @return [\a status, \a theClosedWires, \a theOpenWires]
6591 # \n \a status: FALSE, if an error(s) occured during the method execution.
6592 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6593 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6595 # @ref tui_measurement_tools_page "Example"
6596 @ManageTransactions("HealOp")
6597 def GetFreeBoundary(self, theObject, theName=None):
6599 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6600 that constitute a free boundary of the given shape.
6603 theObject Shape to get free boundary of.
6604 theName Object name; when specified, this parameter is used
6605 for result publication in the study. Otherwise, if automatic
6606 publication is switched on, default value is used for result name.
6609 [status, theClosedWires, theOpenWires]
6610 status: FALSE, if an error(s) occured during the method execution.
6611 theClosedWires: Closed wires on the free boundary of the given shape.
6612 theOpenWires: Open wires on the free boundary of the given shape.
6614 # Example: see GEOM_TestHealing.py
6615 anObj = self.HealOp.GetFreeBoundary(theObject)
6616 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6617 self._autoPublish(anObj[1], theName, "closedWire")
6618 self._autoPublish(anObj[2], theName, "openWire")
6621 ## Replace coincident faces in theShape by one face.
6622 # @param theShape Initial shape.
6623 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6624 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6625 # otherwise all initial shapes.
6626 # @param theName Object name; when specified, this parameter is used
6627 # for result publication in the study. Otherwise, if automatic
6628 # publication is switched on, default value is used for result name.
6630 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6632 # @ref tui_glue_faces "Example"
6633 @ManageTransactions("ShapesOp")
6634 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6636 Replace coincident faces in theShape by one face.
6639 theShape Initial shape.
6640 theTolerance Maximum distance between faces, which can be considered as coincident.
6641 doKeepNonSolids If FALSE, only solids will present in the result,
6642 otherwise all initial shapes.
6643 theName Object name; when specified, this parameter is used
6644 for result publication in the study. Otherwise, if automatic
6645 publication is switched on, default value is used for result name.
6648 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6650 # Example: see GEOM_Spanner.py
6651 theTolerance,Parameters = ParseParameters(theTolerance)
6652 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6654 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6655 anObj.SetParameters(Parameters)
6656 self._autoPublish(anObj, theName, "glueFaces")
6659 ## Find coincident faces in theShape for possible gluing.
6660 # @param theShape Initial shape.
6661 # @param theTolerance Maximum distance between faces,
6662 # which can be considered as coincident.
6663 # @param theName Object name; when specified, this parameter is used
6664 # for result publication in the study. Otherwise, if automatic
6665 # publication is switched on, default value is used for result name.
6667 # @return GEOM.ListOfGO
6669 # @ref tui_glue_faces "Example"
6670 @ManageTransactions("ShapesOp")
6671 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6673 Find coincident faces in theShape for possible gluing.
6676 theShape Initial shape.
6677 theTolerance Maximum distance between faces,
6678 which can be considered as coincident.
6679 theName Object name; when specified, this parameter is used
6680 for result publication in the study. Otherwise, if automatic
6681 publication is switched on, default value is used for result name.
6686 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6687 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6688 self._autoPublish(anObj, theName, "facesToGlue")
6691 ## Replace coincident faces in theShape by one face
6692 # in compliance with given list of faces
6693 # @param theShape Initial shape.
6694 # @param theTolerance Maximum distance between faces,
6695 # which can be considered as coincident.
6696 # @param theFaces List of faces for gluing.
6697 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6698 # otherwise all initial shapes.
6699 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6700 # will be glued, otherwise only the edges,
6701 # belonging to <VAR>theFaces</VAR>.
6702 # @param theName Object name; when specified, this parameter is used
6703 # for result publication in the study. Otherwise, if automatic
6704 # publication is switched on, default value is used for result name.
6706 # @return New GEOM.GEOM_Object, containing a copy of theShape
6707 # without some faces.
6709 # @ref tui_glue_faces "Example"
6710 @ManageTransactions("ShapesOp")
6711 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6712 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6714 Replace coincident faces in theShape by one face
6715 in compliance with given list of faces
6718 theShape Initial shape.
6719 theTolerance Maximum distance between faces,
6720 which can be considered as coincident.
6721 theFaces List of faces for gluing.
6722 doKeepNonSolids If FALSE, only solids will present in the result,
6723 otherwise all initial shapes.
6724 doGlueAllEdges If TRUE, all coincident edges of theShape
6725 will be glued, otherwise only the edges,
6726 belonging to theFaces.
6727 theName Object name; when specified, this parameter is used
6728 for result publication in the study. Otherwise, if automatic
6729 publication is switched on, default value is used for result name.
6732 New GEOM.GEOM_Object, containing a copy of theShape
6735 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6736 doKeepNonSolids, doGlueAllEdges)
6738 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6739 self._autoPublish(anObj, theName, "glueFaces")
6742 ## Replace coincident edges in theShape by one edge.
6743 # @param theShape Initial shape.
6744 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6745 # @param theName Object name; when specified, this parameter is used
6746 # for result publication in the study. Otherwise, if automatic
6747 # publication is switched on, default value is used for result name.
6749 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6751 # @ref tui_glue_edges "Example"
6752 @ManageTransactions("ShapesOp")
6753 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6755 Replace coincident edges in theShape by one edge.
6758 theShape Initial shape.
6759 theTolerance Maximum distance between edges, which can be considered as coincident.
6760 theName Object name; when specified, this parameter is used
6761 for result publication in the study. Otherwise, if automatic
6762 publication is switched on, default value is used for result name.
6765 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6767 theTolerance,Parameters = ParseParameters(theTolerance)
6768 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6770 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6771 anObj.SetParameters(Parameters)
6772 self._autoPublish(anObj, theName, "glueEdges")
6775 ## Find coincident edges in theShape for possible gluing.
6776 # @param theShape Initial shape.
6777 # @param theTolerance Maximum distance between edges,
6778 # which can be considered as coincident.
6779 # @param theName Object name; when specified, this parameter is used
6780 # for result publication in the study. Otherwise, if automatic
6781 # publication is switched on, default value is used for result name.
6783 # @return GEOM.ListOfGO
6785 # @ref tui_glue_edges "Example"
6786 @ManageTransactions("ShapesOp")
6787 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6789 Find coincident edges in theShape for possible gluing.
6792 theShape Initial shape.
6793 theTolerance Maximum distance between edges,
6794 which can be considered as coincident.
6795 theName Object name; when specified, this parameter is used
6796 for result publication in the study. Otherwise, if automatic
6797 publication is switched on, default value is used for result name.
6802 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6803 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6804 self._autoPublish(anObj, theName, "edgesToGlue")
6807 ## Replace coincident edges in theShape by one edge
6808 # in compliance with given list of edges.
6809 # @param theShape Initial shape.
6810 # @param theTolerance Maximum distance between edges,
6811 # which can be considered as coincident.
6812 # @param theEdges List of edges for gluing.
6813 # @param theName Object name; when specified, this parameter is used
6814 # for result publication in the study. Otherwise, if automatic
6815 # publication is switched on, default value is used for result name.
6817 # @return New GEOM.GEOM_Object, containing a copy of theShape
6818 # without some edges.
6820 # @ref tui_glue_edges "Example"
6821 @ManageTransactions("ShapesOp")
6822 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6824 Replace coincident edges in theShape by one edge
6825 in compliance with given list of edges.
6828 theShape Initial shape.
6829 theTolerance Maximum distance between edges,
6830 which can be considered as coincident.
6831 theEdges List of edges for gluing.
6832 theName Object name; when specified, this parameter is used
6833 for result publication in the study. Otherwise, if automatic
6834 publication is switched on, default value is used for result name.
6837 New GEOM.GEOM_Object, containing a copy of theShape
6840 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6842 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6843 self._autoPublish(anObj, theName, "glueEdges")
6849 ## @addtogroup l3_boolean Boolean Operations
6852 # -----------------------------------------------------------------------------
6853 # Boolean (Common, Cut, Fuse, Section)
6854 # -----------------------------------------------------------------------------
6856 ## Perform one of boolean operations on two given shapes.
6857 # @param theShape1 First argument for boolean operation.
6858 # @param theShape2 Second argument for boolean operation.
6859 # @param theOperation Indicates the operation to be done:\n
6860 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6861 # @param checkSelfInte The flag that tells if the arguments should
6862 # be checked for self-intersection prior to the operation.
6863 # @param theName Object name; when specified, this parameter is used
6864 # for result publication in the study. Otherwise, if automatic
6865 # publication is switched on, default value is used for result name.
6867 # @note This algorithm doesn't find all types of self-intersections.
6868 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6869 # vertex/face and edge/face intersections. Face/face
6870 # intersections detection is switched off as it is a
6871 # time-consuming operation that gives an impact on performance.
6872 # To find all self-intersections please use
6873 # CheckSelfIntersections() method.
6875 # @return New GEOM.GEOM_Object, containing the result shape.
6877 # @ref tui_fuse "Example"
6878 @ManageTransactions("BoolOp")
6879 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6881 Perform one of boolean operations on two given shapes.
6884 theShape1 First argument for boolean operation.
6885 theShape2 Second argument for boolean operation.
6886 theOperation Indicates the operation to be done:
6887 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6888 checkSelfInte The flag that tells if the arguments should
6889 be checked for self-intersection prior to
6891 theName Object name; when specified, this parameter is used
6892 for result publication in the study. Otherwise, if automatic
6893 publication is switched on, default value is used for result name.
6896 This algorithm doesn't find all types of self-intersections.
6897 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6898 vertex/face and edge/face intersections. Face/face
6899 intersections detection is switched off as it is a
6900 time-consuming operation that gives an impact on performance.
6901 To find all self-intersections please use
6902 CheckSelfIntersections() method.
6905 New GEOM.GEOM_Object, containing the result shape.
6907 # Example: see GEOM_TestAll.py
6908 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6909 RaiseIfFailed("MakeBoolean", self.BoolOp)
6910 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6911 self._autoPublish(anObj, theName, def_names[theOperation])
6914 ## Perform Common boolean operation on two given shapes.
6915 # @param theShape1 First argument for boolean operation.
6916 # @param theShape2 Second argument for boolean operation.
6917 # @param checkSelfInte The flag that tells if the arguments should
6918 # be checked for self-intersection prior to the operation.
6919 # @param theName Object name; when specified, this parameter is used
6920 # for result publication in the study. Otherwise, if automatic
6921 # publication is switched on, default value is used for result name.
6923 # @note This algorithm doesn't find all types of self-intersections.
6924 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6925 # vertex/face and edge/face intersections. Face/face
6926 # intersections detection is switched off as it is a
6927 # time-consuming operation that gives an impact on performance.
6928 # To find all self-intersections please use
6929 # CheckSelfIntersections() method.
6931 # @return New GEOM.GEOM_Object, containing the result shape.
6933 # @ref tui_common "Example 1"
6934 # \n @ref swig_MakeCommon "Example 2"
6935 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6937 Perform Common boolean operation on two given shapes.
6940 theShape1 First argument for boolean operation.
6941 theShape2 Second argument for boolean operation.
6942 checkSelfInte The flag that tells if the arguments should
6943 be checked for self-intersection prior to
6945 theName Object name; when specified, this parameter is used
6946 for result publication in the study. Otherwise, if automatic
6947 publication is switched on, default value is used for result name.
6950 This algorithm doesn't find all types of self-intersections.
6951 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6952 vertex/face and edge/face intersections. Face/face
6953 intersections detection is switched off as it is a
6954 time-consuming operation that gives an impact on performance.
6955 To find all self-intersections please use
6956 CheckSelfIntersections() method.
6959 New GEOM.GEOM_Object, containing the result shape.
6961 # Example: see GEOM_TestOthers.py
6962 # note: auto-publishing is done in self.MakeBoolean()
6963 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
6965 ## Perform Cut boolean operation on two given shapes.
6966 # @param theShape1 First argument for boolean operation.
6967 # @param theShape2 Second argument for boolean operation.
6968 # @param checkSelfInte The flag that tells if the arguments should
6969 # be checked for self-intersection prior to the operation.
6970 # @param theName Object name; when specified, this parameter is used
6971 # for result publication in the study. Otherwise, if automatic
6972 # publication is switched on, default value is used for result name.
6974 # @note This algorithm doesn't find all types of self-intersections.
6975 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6976 # vertex/face and edge/face intersections. Face/face
6977 # intersections detection is switched off as it is a
6978 # time-consuming operation that gives an impact on performance.
6979 # To find all self-intersections please use
6980 # CheckSelfIntersections() method.
6982 # @return New GEOM.GEOM_Object, containing the result shape.
6984 # @ref tui_cut "Example 1"
6985 # \n @ref swig_MakeCommon "Example 2"
6986 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6988 Perform Cut boolean operation on two given shapes.
6991 theShape1 First argument for boolean operation.
6992 theShape2 Second argument for boolean operation.
6993 checkSelfInte The flag that tells if the arguments should
6994 be checked for self-intersection prior to
6996 theName Object name; when specified, this parameter is used
6997 for result publication in the study. Otherwise, if automatic
6998 publication is switched on, default value is used for result name.
7001 This algorithm doesn't find all types of self-intersections.
7002 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7003 vertex/face and edge/face intersections. Face/face
7004 intersections detection is switched off as it is a
7005 time-consuming operation that gives an impact on performance.
7006 To find all self-intersections please use
7007 CheckSelfIntersections() method.
7010 New GEOM.GEOM_Object, containing the result shape.
7013 # Example: see GEOM_TestOthers.py
7014 # note: auto-publishing is done in self.MakeBoolean()
7015 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7017 ## Perform Fuse boolean operation on two given shapes.
7018 # @param theShape1 First argument for boolean operation.
7019 # @param theShape2 Second argument for boolean operation.
7020 # @param checkSelfInte The flag that tells if the arguments should
7021 # be checked for self-intersection prior to the operation.
7022 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7023 # operation should be performed during the operation.
7024 # @param theName Object name; when specified, this parameter is used
7025 # for result publication in the study. Otherwise, if automatic
7026 # publication is switched on, default value is used for result name.
7028 # @note This algorithm doesn't find all types of self-intersections.
7029 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7030 # vertex/face and edge/face intersections. Face/face
7031 # intersections detection is switched off as it is a
7032 # time-consuming operation that gives an impact on performance.
7033 # To find all self-intersections please use
7034 # CheckSelfIntersections() method.
7036 # @return New GEOM.GEOM_Object, containing the result shape.
7038 # @ref tui_fuse "Example 1"
7039 # \n @ref swig_MakeCommon "Example 2"
7040 @ManageTransactions("BoolOp")
7041 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7042 rmExtraEdges=False, theName=None):
7044 Perform Fuse boolean operation on two given shapes.
7047 theShape1 First argument for boolean operation.
7048 theShape2 Second argument for boolean operation.
7049 checkSelfInte The flag that tells if the arguments should
7050 be checked for self-intersection prior to
7052 rmExtraEdges The flag that tells if Remove Extra Edges
7053 operation should be performed during the operation.
7054 theName Object name; when specified, this parameter is used
7055 for result publication in the study. Otherwise, if automatic
7056 publication is switched on, default value is used for result name.
7059 This algorithm doesn't find all types of self-intersections.
7060 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7061 vertex/face and edge/face intersections. Face/face
7062 intersections detection is switched off as it is a
7063 time-consuming operation that gives an impact on performance.
7064 To find all self-intersections please use
7065 CheckSelfIntersections() method.
7068 New GEOM.GEOM_Object, containing the result shape.
7071 # Example: see GEOM_TestOthers.py
7072 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7073 checkSelfInte, rmExtraEdges)
7074 RaiseIfFailed("MakeFuse", self.BoolOp)
7075 self._autoPublish(anObj, theName, "fuse")
7078 ## Perform Section boolean operation on two given shapes.
7079 # @param theShape1 First argument for boolean operation.
7080 # @param theShape2 Second argument for boolean operation.
7081 # @param checkSelfInte The flag that tells if the arguments should
7082 # be checked for self-intersection prior to the operation.
7083 # @param theName Object name; when specified, this parameter is used
7084 # for result publication in the study. Otherwise, if automatic
7085 # publication is switched on, default value is used for result name.
7087 # @note This algorithm doesn't find all types of self-intersections.
7088 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7089 # vertex/face and edge/face intersections. Face/face
7090 # intersections detection is switched off as it is a
7091 # time-consuming operation that gives an impact on performance.
7092 # To find all self-intersections please use
7093 # CheckSelfIntersections() method.
7095 # @return New GEOM.GEOM_Object, containing the result shape.
7097 # @ref tui_section "Example 1"
7098 # \n @ref swig_MakeCommon "Example 2"
7099 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7101 Perform Section boolean operation on two given shapes.
7104 theShape1 First argument for boolean operation.
7105 theShape2 Second argument for boolean operation.
7106 checkSelfInte The flag that tells if the arguments should
7107 be checked for self-intersection prior to
7109 theName Object name; when specified, this parameter is used
7110 for result publication in the study. Otherwise, if automatic
7111 publication is switched on, default value is used for result name.
7114 This algorithm doesn't find all types of self-intersections.
7115 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7116 vertex/face and edge/face intersections. Face/face
7117 intersections detection is switched off as it is a
7118 time-consuming operation that gives an impact on performance.
7119 To find all self-intersections please use
7120 CheckSelfIntersections() method.
7123 New GEOM.GEOM_Object, containing the result shape.
7126 # Example: see GEOM_TestOthers.py
7127 # note: auto-publishing is done in self.MakeBoolean()
7128 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7130 ## Perform Fuse boolean operation on the list of shapes.
7131 # @param theShapesList Shapes to be fused.
7132 # @param checkSelfInte The flag that tells if the arguments should
7133 # be checked for self-intersection prior to the operation.
7134 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7135 # operation should be performed during the operation.
7136 # @param theName Object name; when specified, this parameter is used
7137 # for result publication in the study. Otherwise, if automatic
7138 # publication is switched on, default value is used for result name.
7140 # @note This algorithm doesn't find all types of self-intersections.
7141 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7142 # vertex/face and edge/face intersections. Face/face
7143 # intersections detection is switched off as it is a
7144 # time-consuming operation that gives an impact on performance.
7145 # To find all self-intersections please use
7146 # CheckSelfIntersections() method.
7148 # @return New GEOM.GEOM_Object, containing the result shape.
7150 # @ref tui_fuse "Example 1"
7151 # \n @ref swig_MakeCommon "Example 2"
7152 @ManageTransactions("BoolOp")
7153 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7154 rmExtraEdges=False, theName=None):
7156 Perform Fuse boolean operation on the list of shapes.
7159 theShapesList Shapes to be fused.
7160 checkSelfInte The flag that tells if the arguments should
7161 be checked for self-intersection prior to
7163 rmExtraEdges The flag that tells if Remove Extra Edges
7164 operation should be performed during the operation.
7165 theName Object name; when specified, this parameter is used
7166 for result publication in the study. Otherwise, if automatic
7167 publication is switched on, default value is used for result name.
7170 This algorithm doesn't find all types of self-intersections.
7171 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7172 vertex/face and edge/face intersections. Face/face
7173 intersections detection is switched off as it is a
7174 time-consuming operation that gives an impact on performance.
7175 To find all self-intersections please use
7176 CheckSelfIntersections() method.
7179 New GEOM.GEOM_Object, containing the result shape.
7182 # Example: see GEOM_TestOthers.py
7183 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7185 RaiseIfFailed("MakeFuseList", self.BoolOp)
7186 self._autoPublish(anObj, theName, "fuse")
7189 ## Perform Common boolean operation on the list of shapes.
7190 # @param theShapesList Shapes for Common operation.
7191 # @param checkSelfInte The flag that tells if the arguments should
7192 # be checked for self-intersection prior to the operation.
7193 # @param theName Object name; when specified, this parameter is used
7194 # for result publication in the study. Otherwise, if automatic
7195 # publication is switched on, default value is used for result name.
7197 # @note This algorithm doesn't find all types of self-intersections.
7198 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7199 # vertex/face and edge/face intersections. Face/face
7200 # intersections detection is switched off as it is a
7201 # time-consuming operation that gives an impact on performance.
7202 # To find all self-intersections please use
7203 # CheckSelfIntersections() method.
7205 # @return New GEOM.GEOM_Object, containing the result shape.
7207 # @ref tui_common "Example 1"
7208 # \n @ref swig_MakeCommon "Example 2"
7209 @ManageTransactions("BoolOp")
7210 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7212 Perform Common boolean operation on the list of shapes.
7215 theShapesList Shapes for Common operation.
7216 checkSelfInte The flag that tells if the arguments should
7217 be checked for self-intersection prior to
7219 theName Object name; when specified, this parameter is used
7220 for result publication in the study. Otherwise, if automatic
7221 publication is switched on, default value is used for result name.
7224 This algorithm doesn't find all types of self-intersections.
7225 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7226 vertex/face and edge/face intersections. Face/face
7227 intersections detection is switched off as it is a
7228 time-consuming operation that gives an impact on performance.
7229 To find all self-intersections please use
7230 CheckSelfIntersections() method.
7233 New GEOM.GEOM_Object, containing the result shape.
7236 # Example: see GEOM_TestOthers.py
7237 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7238 RaiseIfFailed("MakeCommonList", self.BoolOp)
7239 self._autoPublish(anObj, theName, "common")
7242 ## Perform Cut boolean operation on one object and the list of tools.
7243 # @param theMainShape The object of the operation.
7244 # @param theShapesList The list of tools of the operation.
7245 # @param checkSelfInte The flag that tells if the arguments should
7246 # be checked for self-intersection prior to the operation.
7247 # @param theName Object name; when specified, this parameter is used
7248 # for result publication in the study. Otherwise, if automatic
7249 # publication is switched on, default value is used for result name.
7251 # @note This algorithm doesn't find all types of self-intersections.
7252 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7253 # vertex/face and edge/face intersections. Face/face
7254 # intersections detection is switched off as it is a
7255 # time-consuming operation that gives an impact on performance.
7256 # To find all self-intersections please use
7257 # CheckSelfIntersections() method.
7259 # @return New GEOM.GEOM_Object, containing the result shape.
7261 # @ref tui_cut "Example 1"
7262 # \n @ref swig_MakeCommon "Example 2"
7263 @ManageTransactions("BoolOp")
7264 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7266 Perform Cut boolean operation on one object and the list of tools.
7269 theMainShape The object of the operation.
7270 theShapesList The list of tools of the operation.
7271 checkSelfInte The flag that tells if the arguments should
7272 be checked for self-intersection prior to
7274 theName Object name; when specified, this parameter is used
7275 for result publication in the study. Otherwise, if automatic
7276 publication is switched on, default value is used for result name.
7279 This algorithm doesn't find all types of self-intersections.
7280 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7281 vertex/face and edge/face intersections. Face/face
7282 intersections detection is switched off as it is a
7283 time-consuming operation that gives an impact on performance.
7284 To find all self-intersections please use
7285 CheckSelfIntersections() method.
7288 New GEOM.GEOM_Object, containing the result shape.
7291 # Example: see GEOM_TestOthers.py
7292 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7293 RaiseIfFailed("MakeCutList", self.BoolOp)
7294 self._autoPublish(anObj, theName, "cut")
7300 ## @addtogroup l3_basic_op
7303 ## Perform partition operation.
7304 # @param ListShapes Shapes to be intersected.
7305 # @param ListTools Shapes to intersect theShapes.
7306 # @param Limit Type of resulting shapes (see ShapeType()).\n
7307 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7308 # type will be detected automatically.
7309 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7310 # target type (equal to Limit) are kept in the result,
7311 # else standalone shapes of lower dimension
7312 # are kept also (if they exist).
7314 # @param theName Object name; when specified, this parameter is used
7315 # for result publication in the study. Otherwise, if automatic
7316 # publication is switched on, default value is used for result name.
7318 # @note Each compound from ListShapes and ListTools will be exploded
7319 # in order to avoid possible intersection between shapes from this compound.
7321 # After implementation new version of PartitionAlgo (October 2006)
7322 # other parameters are ignored by current functionality. They are kept
7323 # in this function only for support old versions.
7324 # @param ListKeepInside Shapes, outside which the results will be deleted.
7325 # Each shape from theKeepInside must belong to theShapes also.
7326 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7327 # Each shape from theRemoveInside must belong to theShapes also.
7328 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7329 # @param ListMaterials Material indices for each shape. Make sence,
7330 # only if theRemoveWebs is TRUE.
7332 # @return New GEOM.GEOM_Object, containing the result shapes.
7334 # @ref tui_partition "Example"
7335 @ManageTransactions("BoolOp")
7336 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7337 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7338 KeepNonlimitShapes=0, theName=None):
7340 Perform partition operation.
7343 ListShapes Shapes to be intersected.
7344 ListTools Shapes to intersect theShapes.
7345 Limit Type of resulting shapes (see geompy.ShapeType)
7346 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7347 type will be detected automatically.
7348 KeepNonlimitShapes if this parameter == 0, then only shapes of
7349 target type (equal to Limit) are kept in the result,
7350 else standalone shapes of lower dimension
7351 are kept also (if they exist).
7353 theName Object name; when specified, this parameter is used
7354 for result publication in the study. Otherwise, if automatic
7355 publication is switched on, default value is used for result name.
7357 Each compound from ListShapes and ListTools will be exploded
7358 in order to avoid possible intersection between shapes from
7361 After implementation new version of PartitionAlgo (October 2006) other
7362 parameters are ignored by current functionality. They are kept in this
7363 function only for support old versions.
7366 ListKeepInside Shapes, outside which the results will be deleted.
7367 Each shape from theKeepInside must belong to theShapes also.
7368 ListRemoveInside Shapes, inside which the results will be deleted.
7369 Each shape from theRemoveInside must belong to theShapes also.
7370 RemoveWebs If TRUE, perform Glue 3D algorithm.
7371 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7374 New GEOM.GEOM_Object, containing the result shapes.
7376 # Example: see GEOM_TestAll.py
7377 if Limit == self.ShapeType["AUTO"]:
7378 # automatic detection of the most appropriate shape limit type
7380 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7381 Limit = EnumToLong(lim)
7383 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7384 ListKeepInside, ListRemoveInside,
7385 Limit, RemoveWebs, ListMaterials,
7386 KeepNonlimitShapes);
7387 RaiseIfFailed("MakePartition", self.BoolOp)
7388 self._autoPublish(anObj, theName, "partition")
7391 ## Perform partition operation.
7392 # This method may be useful if it is needed to make a partition for
7393 # compound contains nonintersected shapes. Performance will be better
7394 # since intersection between shapes from compound is not performed.
7396 # Description of all parameters as in previous method MakePartition().
7397 # One additional parameter is provided:
7398 # @param checkSelfInte The flag that tells if the arguments should
7399 # be checked for self-intersection prior to the operation.
7401 # @note This algorithm doesn't find all types of self-intersections.
7402 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7403 # vertex/face and edge/face intersections. Face/face
7404 # intersections detection is switched off as it is a
7405 # time-consuming operation that gives an impact on performance.
7406 # To find all self-intersections please use
7407 # CheckSelfIntersections() method.
7409 # @note Passed compounds (via ListShapes or via ListTools)
7410 # have to consist of nonintersecting shapes.
7412 # @return New GEOM.GEOM_Object, containing the result shapes.
7414 # @ref swig_todo "Example"
7415 @ManageTransactions("BoolOp")
7416 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7417 ListKeepInside=[], ListRemoveInside=[],
7418 Limit=ShapeType["AUTO"], RemoveWebs=0,
7419 ListMaterials=[], KeepNonlimitShapes=0,
7420 checkSelfInte=False, theName=None):
7422 Perform partition operation.
7423 This method may be useful if it is needed to make a partition for
7424 compound contains nonintersected shapes. Performance will be better
7425 since intersection between shapes from compound is not performed.
7428 Description of all parameters as in method geompy.MakePartition.
7429 One additional parameter is provided:
7430 checkSelfInte The flag that tells if the arguments should
7431 be checked for self-intersection prior to
7435 This algorithm doesn't find all types of self-intersections.
7436 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7437 vertex/face and edge/face intersections. Face/face
7438 intersections detection is switched off as it is a
7439 time-consuming operation that gives an impact on performance.
7440 To find all self-intersections please use
7441 CheckSelfIntersections() method.
7444 Passed compounds (via ListShapes or via ListTools)
7445 have to consist of nonintersecting shapes.
7448 New GEOM.GEOM_Object, containing the result shapes.
7450 if Limit == self.ShapeType["AUTO"]:
7451 # automatic detection of the most appropriate shape limit type
7453 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7454 Limit = EnumToLong(lim)
7456 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7457 ListKeepInside, ListRemoveInside,
7458 Limit, RemoveWebs, ListMaterials,
7459 KeepNonlimitShapes, checkSelfInte);
7460 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7461 self._autoPublish(anObj, theName, "partition")
7464 ## See method MakePartition() for more information.
7466 # @ref tui_partition "Example 1"
7467 # \n @ref swig_Partition "Example 2"
7468 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7469 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7470 KeepNonlimitShapes=0, theName=None):
7472 See method geompy.MakePartition for more information.
7474 # Example: see GEOM_TestOthers.py
7475 # note: auto-publishing is done in self.MakePartition()
7476 anObj = self.MakePartition(ListShapes, ListTools,
7477 ListKeepInside, ListRemoveInside,
7478 Limit, RemoveWebs, ListMaterials,
7479 KeepNonlimitShapes, theName);
7482 ## Perform partition of the Shape with the Plane
7483 # @param theShape Shape to be intersected.
7484 # @param thePlane Tool shape, to intersect theShape.
7485 # @param theName Object name; when specified, this parameter is used
7486 # for result publication in the study. Otherwise, if automatic
7487 # publication is switched on, default value is used for result name.
7489 # @return New GEOM.GEOM_Object, containing the result shape.
7491 # @ref tui_partition "Example"
7492 @ManageTransactions("BoolOp")
7493 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7495 Perform partition of the Shape with the Plane
7498 theShape Shape to be intersected.
7499 thePlane Tool shape, to intersect theShape.
7500 theName Object name; when specified, this parameter is used
7501 for result publication in the study. Otherwise, if automatic
7502 publication is switched on, default value is used for result name.
7505 New GEOM.GEOM_Object, containing the result shape.
7507 # Example: see GEOM_TestAll.py
7508 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7509 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7510 self._autoPublish(anObj, theName, "partition")
7513 # end of l3_basic_op
7516 ## @addtogroup l3_transform
7519 ## Translate the given object along the vector, specified
7520 # by its end points.
7521 # @param theObject The object to be translated.
7522 # @param thePoint1 Start point of translation vector.
7523 # @param thePoint2 End point of translation vector.
7524 # @param theCopy Flag used to translate object itself or create a copy.
7525 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7526 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7527 @ManageTransactions("TrsfOp")
7528 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7530 Translate the given object along the vector, specified by its end points.
7533 theObject The object to be translated.
7534 thePoint1 Start point of translation vector.
7535 thePoint2 End point of translation vector.
7536 theCopy Flag used to translate object itself or create a copy.
7539 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7540 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7543 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7545 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7546 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7549 ## Translate the given object along the vector, specified
7550 # by its end points, creating its copy before the translation.
7551 # @param theObject The object to be translated.
7552 # @param thePoint1 Start point of translation vector.
7553 # @param thePoint2 End point of translation vector.
7554 # @param theName Object name; when specified, this parameter is used
7555 # for result publication in the study. Otherwise, if automatic
7556 # publication is switched on, default value is used for result name.
7558 # @return New GEOM.GEOM_Object, containing the translated object.
7560 # @ref tui_translation "Example 1"
7561 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7562 @ManageTransactions("TrsfOp")
7563 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7565 Translate the given object along the vector, specified
7566 by its end points, creating its copy before the translation.
7569 theObject The object to be translated.
7570 thePoint1 Start point of translation vector.
7571 thePoint2 End point of translation vector.
7572 theName Object name; when specified, this parameter is used
7573 for result publication in the study. Otherwise, if automatic
7574 publication is switched on, default value is used for result name.
7577 New GEOM.GEOM_Object, containing the translated object.
7579 # Example: see GEOM_TestAll.py
7580 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7581 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7582 self._autoPublish(anObj, theName, "translated")
7585 ## Translate the given object along the vector, specified by its components.
7586 # @param theObject The object to be translated.
7587 # @param theDX,theDY,theDZ Components of translation vector.
7588 # @param theCopy Flag used to translate object itself or create a copy.
7589 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7590 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7592 # @ref tui_translation "Example"
7593 @ManageTransactions("TrsfOp")
7594 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7596 Translate the given object along the vector, specified by its components.
7599 theObject The object to be translated.
7600 theDX,theDY,theDZ Components of translation vector.
7601 theCopy Flag used to translate object itself or create a copy.
7604 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7605 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7607 # Example: see GEOM_TestAll.py
7608 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7610 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7612 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7613 anObj.SetParameters(Parameters)
7614 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7617 ## Translate the given object along the vector, specified
7618 # by its components, creating its copy before the translation.
7619 # @param theObject The object to be translated.
7620 # @param theDX,theDY,theDZ Components of translation vector.
7621 # @param theName Object name; when specified, this parameter is used
7622 # for result publication in the study. Otherwise, if automatic
7623 # publication is switched on, default value is used for result name.
7625 # @return New GEOM.GEOM_Object, containing the translated object.
7627 # @ref tui_translation "Example"
7628 @ManageTransactions("TrsfOp")
7629 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7631 Translate the given object along the vector, specified
7632 by its components, creating its copy before the translation.
7635 theObject The object to be translated.
7636 theDX,theDY,theDZ Components of translation vector.
7637 theName Object name; when specified, this parameter is used
7638 for result publication in the study. Otherwise, if automatic
7639 publication is switched on, default value is used for result name.
7642 New GEOM.GEOM_Object, containing the translated object.
7644 # Example: see GEOM_TestAll.py
7645 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7646 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7647 anObj.SetParameters(Parameters)
7648 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7649 self._autoPublish(anObj, theName, "translated")
7652 ## Translate the given object along the given vector.
7653 # @param theObject The object to be translated.
7654 # @param theVector The translation vector.
7655 # @param theCopy Flag used to translate object itself or create a copy.
7656 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7657 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7658 @ManageTransactions("TrsfOp")
7659 def TranslateVector(self, theObject, theVector, theCopy=False):
7661 Translate the given object along the given vector.
7664 theObject The object to be translated.
7665 theVector The translation vector.
7666 theCopy Flag used to translate object itself or create a copy.
7669 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7670 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7673 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7675 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7676 RaiseIfFailed("TranslateVector", self.TrsfOp)
7679 ## Translate the given object along the given vector,
7680 # creating its copy before the translation.
7681 # @param theObject The object to be translated.
7682 # @param theVector The translation vector.
7683 # @param theName Object name; when specified, this parameter is used
7684 # for result publication in the study. Otherwise, if automatic
7685 # publication is switched on, default value is used for result name.
7687 # @return New GEOM.GEOM_Object, containing the translated object.
7689 # @ref tui_translation "Example"
7690 @ManageTransactions("TrsfOp")
7691 def MakeTranslationVector(self, theObject, theVector, theName=None):
7693 Translate the given object along the given vector,
7694 creating its copy before the translation.
7697 theObject The object to be translated.
7698 theVector The translation vector.
7699 theName Object name; when specified, this parameter is used
7700 for result publication in the study. Otherwise, if automatic
7701 publication is switched on, default value is used for result name.
7704 New GEOM.GEOM_Object, containing the translated object.
7706 # Example: see GEOM_TestAll.py
7707 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7708 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7709 self._autoPublish(anObj, theName, "translated")
7712 ## Translate the given object along the given vector on given distance.
7713 # @param theObject The object to be translated.
7714 # @param theVector The translation vector.
7715 # @param theDistance The translation distance.
7716 # @param theCopy Flag used to translate object itself or create a copy.
7717 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7718 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7720 # @ref tui_translation "Example"
7721 @ManageTransactions("TrsfOp")
7722 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7724 Translate the given object along the given vector on given distance.
7727 theObject The object to be translated.
7728 theVector The translation vector.
7729 theDistance The translation distance.
7730 theCopy Flag used to translate object itself or create a copy.
7733 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7734 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7736 # Example: see GEOM_TestAll.py
7737 theDistance,Parameters = ParseParameters(theDistance)
7738 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7739 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7740 anObj.SetParameters(Parameters)
7743 ## Translate the given object along the given vector on given distance,
7744 # creating its copy before the translation.
7745 # @param theObject The object to be translated.
7746 # @param theVector The translation vector.
7747 # @param theDistance The translation distance.
7748 # @param theName Object name; when specified, this parameter is used
7749 # for result publication in the study. Otherwise, if automatic
7750 # publication is switched on, default value is used for result name.
7752 # @return New GEOM.GEOM_Object, containing the translated object.
7754 # @ref tui_translation "Example"
7755 @ManageTransactions("TrsfOp")
7756 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7758 Translate the given object along the given vector on given distance,
7759 creating its copy before the translation.
7762 theObject The object to be translated.
7763 theVector The translation vector.
7764 theDistance The translation distance.
7765 theName Object name; when specified, this parameter is used
7766 for result publication in the study. Otherwise, if automatic
7767 publication is switched on, default value is used for result name.
7770 New GEOM.GEOM_Object, containing the translated object.
7772 # Example: see GEOM_TestAll.py
7773 theDistance,Parameters = ParseParameters(theDistance)
7774 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7775 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7776 anObj.SetParameters(Parameters)
7777 self._autoPublish(anObj, theName, "translated")
7780 ## Rotate the given object around the given axis on the given angle.
7781 # @param theObject The object to be rotated.
7782 # @param theAxis Rotation axis.
7783 # @param theAngle Rotation angle in radians.
7784 # @param theCopy Flag used to rotate object itself or create a copy.
7786 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7787 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7789 # @ref tui_rotation "Example"
7790 @ManageTransactions("TrsfOp")
7791 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7793 Rotate the given object around the given axis on the given angle.
7796 theObject The object to be rotated.
7797 theAxis Rotation axis.
7798 theAngle Rotation angle in radians.
7799 theCopy Flag used to rotate object itself or create a copy.
7802 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7803 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7805 # Example: see GEOM_TestAll.py
7807 if isinstance(theAngle,str):
7809 theAngle, Parameters = ParseParameters(theAngle)
7811 theAngle = theAngle*math.pi/180.0
7813 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7815 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7816 RaiseIfFailed("Rotate", self.TrsfOp)
7817 anObj.SetParameters(Parameters)
7820 ## Rotate the given object around the given axis
7821 # on the given angle, creating its copy before the rotatation.
7822 # @param theObject The object to be rotated.
7823 # @param theAxis Rotation axis.
7824 # @param theAngle Rotation angle in radians.
7825 # @param theName Object name; when specified, this parameter is used
7826 # for result publication in the study. Otherwise, if automatic
7827 # publication is switched on, default value is used for result name.
7829 # @return New GEOM.GEOM_Object, containing the rotated object.
7831 # @ref tui_rotation "Example"
7832 @ManageTransactions("TrsfOp")
7833 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7835 Rotate the given object around the given axis
7836 on the given angle, creating its copy before the rotatation.
7839 theObject The object to be rotated.
7840 theAxis Rotation axis.
7841 theAngle Rotation angle in radians.
7842 theName Object name; when specified, this parameter is used
7843 for result publication in the study. Otherwise, if automatic
7844 publication is switched on, default value is used for result name.
7847 New GEOM.GEOM_Object, containing the rotated object.
7849 # Example: see GEOM_TestAll.py
7851 if isinstance(theAngle,str):
7853 theAngle, Parameters = ParseParameters(theAngle)
7855 theAngle = theAngle*math.pi/180.0
7856 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7857 RaiseIfFailed("RotateCopy", self.TrsfOp)
7858 anObj.SetParameters(Parameters)
7859 self._autoPublish(anObj, theName, "rotated")
7862 ## Rotate given object around vector perpendicular to plane
7863 # containing three points.
7864 # @param theObject The object to be rotated.
7865 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7866 # containing the three points.
7867 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7868 # @param theCopy Flag used to rotate object itself or create a copy.
7869 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7870 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7871 @ManageTransactions("TrsfOp")
7872 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7874 Rotate given object around vector perpendicular to plane
7875 containing three points.
7878 theObject The object to be rotated.
7879 theCentPoint central point the axis is the vector perpendicular to the plane
7880 containing the three points.
7881 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7882 theCopy Flag used to rotate object itself or create a copy.
7885 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7886 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7889 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7891 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7892 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7895 ## Rotate given object around vector perpendicular to plane
7896 # containing three points, creating its copy before the rotatation.
7897 # @param theObject The object to be rotated.
7898 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7899 # containing the three points.
7900 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7901 # @param theName Object name; when specified, this parameter is used
7902 # for result publication in the study. Otherwise, if automatic
7903 # publication is switched on, default value is used for result name.
7905 # @return New GEOM.GEOM_Object, containing the rotated object.
7907 # @ref tui_rotation "Example"
7908 @ManageTransactions("TrsfOp")
7909 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7911 Rotate given object around vector perpendicular to plane
7912 containing three points, creating its copy before the rotatation.
7915 theObject The object to be rotated.
7916 theCentPoint central point the axis is the vector perpendicular to the plane
7917 containing the three points.
7918 thePoint1,thePoint2 in a perpendicular plane of the axis.
7919 theName Object name; when specified, this parameter is used
7920 for result publication in the study. Otherwise, if automatic
7921 publication is switched on, default value is used for result name.
7924 New GEOM.GEOM_Object, containing the rotated object.
7926 # Example: see GEOM_TestAll.py
7927 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7928 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7929 self._autoPublish(anObj, theName, "rotated")
7932 ## Scale the given object by the specified factor.
7933 # @param theObject The object to be scaled.
7934 # @param thePoint Center point for scaling.
7935 # Passing None for it means scaling relatively the origin of global CS.
7936 # @param theFactor Scaling factor value.
7937 # @param theCopy Flag used to scale object itself or create a copy.
7938 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7939 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7940 @ManageTransactions("TrsfOp")
7941 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7943 Scale the given object by the specified factor.
7946 theObject The object to be scaled.
7947 thePoint Center point for scaling.
7948 Passing None for it means scaling relatively the origin of global CS.
7949 theFactor Scaling factor value.
7950 theCopy Flag used to scale object itself or create a copy.
7953 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7954 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7956 # Example: see GEOM_TestAll.py
7957 theFactor, Parameters = ParseParameters(theFactor)
7959 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7961 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7962 RaiseIfFailed("Scale", self.TrsfOp)
7963 anObj.SetParameters(Parameters)
7966 ## Scale the given object by the factor, creating its copy before the scaling.
7967 # @param theObject The object to be scaled.
7968 # @param thePoint Center point for scaling.
7969 # Passing None for it means scaling relatively the origin of global CS.
7970 # @param theFactor Scaling factor value.
7971 # @param theName Object name; when specified, this parameter is used
7972 # for result publication in the study. Otherwise, if automatic
7973 # publication is switched on, default value is used for result name.
7975 # @return New GEOM.GEOM_Object, containing the scaled shape.
7977 # @ref tui_scale "Example"
7978 @ManageTransactions("TrsfOp")
7979 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7981 Scale the given object by the factor, creating its copy before the scaling.
7984 theObject The object to be scaled.
7985 thePoint Center point for scaling.
7986 Passing None for it means scaling relatively the origin of global CS.
7987 theFactor Scaling factor value.
7988 theName Object name; when specified, this parameter is used
7989 for result publication in the study. Otherwise, if automatic
7990 publication is switched on, default value is used for result name.
7993 New GEOM.GEOM_Object, containing the scaled shape.
7995 # Example: see GEOM_TestAll.py
7996 theFactor, Parameters = ParseParameters(theFactor)
7997 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7998 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7999 anObj.SetParameters(Parameters)
8000 self._autoPublish(anObj, theName, "scaled")
8003 ## Scale the given object by different factors along coordinate axes.
8004 # @param theObject The object to be scaled.
8005 # @param thePoint Center point for scaling.
8006 # Passing None for it means scaling relatively the origin of global CS.
8007 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8008 # @param theCopy Flag used to scale object itself or create a copy.
8009 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8010 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8011 @ManageTransactions("TrsfOp")
8012 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8014 Scale the given object by different factors along coordinate axes.
8017 theObject The object to be scaled.
8018 thePoint Center point for scaling.
8019 Passing None for it means scaling relatively the origin of global CS.
8020 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8021 theCopy Flag used to scale object itself or create a copy.
8024 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8025 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8027 # Example: see GEOM_TestAll.py
8028 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8030 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8031 theFactorX, theFactorY, theFactorZ)
8033 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8034 theFactorX, theFactorY, theFactorZ)
8035 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8036 anObj.SetParameters(Parameters)
8039 ## Scale the given object by different factors along coordinate axes,
8040 # creating its copy before the scaling.
8041 # @param theObject The object to be scaled.
8042 # @param thePoint Center point for scaling.
8043 # Passing None for it means scaling relatively the origin of global CS.
8044 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8045 # @param theName Object name; when specified, this parameter is used
8046 # for result publication in the study. Otherwise, if automatic
8047 # publication is switched on, default value is used for result name.
8049 # @return New GEOM.GEOM_Object, containing the scaled shape.
8051 # @ref swig_scale "Example"
8052 @ManageTransactions("TrsfOp")
8053 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8055 Scale the given object by different factors along coordinate axes,
8056 creating its copy before the scaling.
8059 theObject The object to be scaled.
8060 thePoint Center point for scaling.
8061 Passing None for it means scaling relatively the origin of global CS.
8062 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8063 theName Object name; when specified, this parameter is used
8064 for result publication in the study. Otherwise, if automatic
8065 publication is switched on, default value is used for result name.
8068 New GEOM.GEOM_Object, containing the scaled shape.
8070 # Example: see GEOM_TestAll.py
8071 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8072 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8073 theFactorX, theFactorY, theFactorZ)
8074 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8075 anObj.SetParameters(Parameters)
8076 self._autoPublish(anObj, theName, "scaled")
8079 ## Mirror an object relatively the given plane.
8080 # @param theObject The object to be mirrored.
8081 # @param thePlane Plane of symmetry.
8082 # @param theCopy Flag used to mirror object itself or create a copy.
8083 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8084 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8085 @ManageTransactions("TrsfOp")
8086 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8088 Mirror an object relatively the given plane.
8091 theObject The object to be mirrored.
8092 thePlane Plane of symmetry.
8093 theCopy Flag used to mirror object itself or create a copy.
8096 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8097 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8100 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8102 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8103 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8106 ## Create an object, symmetrical
8107 # to the given one relatively the given plane.
8108 # @param theObject The object to be mirrored.
8109 # @param thePlane Plane of symmetry.
8110 # @param theName Object name; when specified, this parameter is used
8111 # for result publication in the study. Otherwise, if automatic
8112 # publication is switched on, default value is used for result name.
8114 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8116 # @ref tui_mirror "Example"
8117 @ManageTransactions("TrsfOp")
8118 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8120 Create an object, symmetrical to the given one relatively the given plane.
8123 theObject The object to be mirrored.
8124 thePlane Plane of symmetry.
8125 theName Object name; when specified, this parameter is used
8126 for result publication in the study. Otherwise, if automatic
8127 publication is switched on, default value is used for result name.
8130 New GEOM.GEOM_Object, containing the mirrored shape.
8132 # Example: see GEOM_TestAll.py
8133 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8134 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8135 self._autoPublish(anObj, theName, "mirrored")
8138 ## Mirror an object relatively the given axis.
8139 # @param theObject The object to be mirrored.
8140 # @param theAxis Axis of symmetry.
8141 # @param theCopy Flag used to mirror object itself or create a copy.
8142 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8143 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8144 @ManageTransactions("TrsfOp")
8145 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8147 Mirror an object relatively the given axis.
8150 theObject The object to be mirrored.
8151 theAxis Axis of symmetry.
8152 theCopy Flag used to mirror object itself or create a copy.
8155 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8156 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8159 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8161 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8162 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8165 ## Create an object, symmetrical
8166 # to the given one relatively the given axis.
8167 # @param theObject The object to be mirrored.
8168 # @param theAxis Axis of symmetry.
8169 # @param theName Object name; when specified, this parameter is used
8170 # for result publication in the study. Otherwise, if automatic
8171 # publication is switched on, default value is used for result name.
8173 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8175 # @ref tui_mirror "Example"
8176 @ManageTransactions("TrsfOp")
8177 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8179 Create an object, symmetrical to the given one relatively the given axis.
8182 theObject The object to be mirrored.
8183 theAxis Axis of symmetry.
8184 theName Object name; when specified, this parameter is used
8185 for result publication in the study. Otherwise, if automatic
8186 publication is switched on, default value is used for result name.
8189 New GEOM.GEOM_Object, containing the mirrored shape.
8191 # Example: see GEOM_TestAll.py
8192 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8193 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8194 self._autoPublish(anObj, theName, "mirrored")
8197 ## Mirror an object relatively the given point.
8198 # @param theObject The object to be mirrored.
8199 # @param thePoint Point of symmetry.
8200 # @param theCopy Flag used to mirror object itself or create a copy.
8201 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8202 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8203 @ManageTransactions("TrsfOp")
8204 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8206 Mirror an object relatively the given point.
8209 theObject The object to be mirrored.
8210 thePoint Point of symmetry.
8211 theCopy Flag used to mirror object itself or create a copy.
8214 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8215 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8217 # Example: see GEOM_TestAll.py
8219 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8221 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8222 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8225 ## Create an object, symmetrical
8226 # to the given one relatively the given point.
8227 # @param theObject The object to be mirrored.
8228 # @param thePoint Point of symmetry.
8229 # @param theName Object name; when specified, this parameter is used
8230 # for result publication in the study. Otherwise, if automatic
8231 # publication is switched on, default value is used for result name.
8233 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8235 # @ref tui_mirror "Example"
8236 @ManageTransactions("TrsfOp")
8237 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8239 Create an object, symmetrical
8240 to the given one relatively the given point.
8243 theObject The object to be mirrored.
8244 thePoint Point of symmetry.
8245 theName Object name; when specified, this parameter is used
8246 for result publication in the study. Otherwise, if automatic
8247 publication is switched on, default value is used for result name.
8250 New GEOM.GEOM_Object, containing the mirrored shape.
8252 # Example: see GEOM_TestAll.py
8253 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8254 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8255 self._autoPublish(anObj, theName, "mirrored")
8258 ## Modify the location of the given object.
8259 # @param theObject The object to be displaced.
8260 # @param theStartLCS Coordinate system to perform displacement from it.\n
8261 # If \a theStartLCS is NULL, displacement
8262 # will be performed from global CS.\n
8263 # If \a theObject itself is used as \a theStartLCS,
8264 # its location will be changed to \a theEndLCS.
8265 # @param theEndLCS Coordinate system to perform displacement to it.
8266 # @param theCopy Flag used to displace object itself or create a copy.
8267 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8268 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8269 @ManageTransactions("TrsfOp")
8270 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8272 Modify the Location of the given object by LCS, creating its copy before the setting.
8275 theObject The object to be displaced.
8276 theStartLCS Coordinate system to perform displacement from it.
8277 If theStartLCS is NULL, displacement
8278 will be performed from global CS.
8279 If theObject itself is used as theStartLCS,
8280 its location will be changed to theEndLCS.
8281 theEndLCS Coordinate system to perform displacement to it.
8282 theCopy Flag used to displace object itself or create a copy.
8285 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8286 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8288 # Example: see GEOM_TestAll.py
8290 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8292 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8293 RaiseIfFailed("Displace", self.TrsfOp)
8296 ## Modify the Location of the given object by LCS,
8297 # creating its copy before the setting.
8298 # @param theObject The object to be displaced.
8299 # @param theStartLCS Coordinate system to perform displacement from it.\n
8300 # If \a theStartLCS is NULL, displacement
8301 # will be performed from global CS.\n
8302 # If \a theObject itself is used as \a theStartLCS,
8303 # its location will be changed to \a theEndLCS.
8304 # @param theEndLCS Coordinate system to perform displacement to it.
8305 # @param theName Object name; when specified, this parameter is used
8306 # for result publication in the study. Otherwise, if automatic
8307 # publication is switched on, default value is used for result name.
8309 # @return New GEOM.GEOM_Object, containing the displaced shape.
8311 # @ref tui_modify_location "Example"
8312 @ManageTransactions("TrsfOp")
8313 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8315 Modify the Location of the given object by LCS, creating its copy before the setting.
8318 theObject The object to be displaced.
8319 theStartLCS Coordinate system to perform displacement from it.
8320 If theStartLCS is NULL, displacement
8321 will be performed from global CS.
8322 If theObject itself is used as theStartLCS,
8323 its location will be changed to theEndLCS.
8324 theEndLCS Coordinate system to perform displacement to it.
8325 theName Object name; when specified, this parameter is used
8326 for result publication in the study. Otherwise, if automatic
8327 publication is switched on, default value is used for result name.
8330 New GEOM.GEOM_Object, containing the displaced shape.
8333 # create local coordinate systems
8334 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8335 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8336 # modify the location of the given object
8337 position = geompy.MakePosition(cylinder, cs1, cs2)
8339 # Example: see GEOM_TestAll.py
8340 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8341 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8342 self._autoPublish(anObj, theName, "displaced")
8345 ## Modify the Location of the given object by Path.
8346 # @param theObject The object to be displaced.
8347 # @param thePath Wire or Edge along that the object will be translated.
8348 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8349 # @param theCopy is to create a copy objects if true.
8350 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8351 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8352 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8354 # @ref tui_modify_location "Example"
8355 @ManageTransactions("TrsfOp")
8356 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8358 Modify the Location of the given object by Path.
8361 theObject The object to be displaced.
8362 thePath Wire or Edge along that the object will be translated.
8363 theDistance progress of Path (0 = start location, 1 = end of path location).
8364 theCopy is to create a copy objects if true.
8365 theReverse 0 - for usual direction, 1 - to reverse path direction.
8368 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8369 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8372 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8374 # Example: see GEOM_TestAll.py
8375 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8376 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8379 ## Modify the Location of the given object by Path, creating its copy before the operation.
8380 # @param theObject The object to be displaced.
8381 # @param thePath Wire or Edge along that the object will be translated.
8382 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8383 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8384 # @param theName Object name; when specified, this parameter is used
8385 # for result publication in the study. Otherwise, if automatic
8386 # publication is switched on, default value is used for result name.
8388 # @return New GEOM.GEOM_Object, containing the displaced shape.
8389 @ManageTransactions("TrsfOp")
8390 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8392 Modify the Location of the given object by Path, creating its copy before the operation.
8395 theObject The object to be displaced.
8396 thePath Wire or Edge along that the object will be translated.
8397 theDistance progress of Path (0 = start location, 1 = end of path location).
8398 theReverse 0 - for usual direction, 1 - to reverse path direction.
8399 theName Object name; when specified, this parameter is used
8400 for result publication in the study. Otherwise, if automatic
8401 publication is switched on, default value is used for result name.
8404 New GEOM.GEOM_Object, containing the displaced shape.
8406 # Example: see GEOM_TestAll.py
8407 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8408 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8409 self._autoPublish(anObj, theName, "displaced")
8412 ## Offset given shape.
8413 # @param theObject The base object for the offset.
8414 # @param theOffset Offset value.
8415 # @param theCopy Flag used to offset object itself or create a copy.
8416 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8417 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8418 @ManageTransactions("TrsfOp")
8419 def Offset(self, theObject, theOffset, theCopy=False):
8424 theObject The base object for the offset.
8425 theOffset Offset value.
8426 theCopy Flag used to offset object itself or create a copy.
8429 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8430 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8432 theOffset, Parameters = ParseParameters(theOffset)
8434 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8436 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8437 RaiseIfFailed("Offset", self.TrsfOp)
8438 anObj.SetParameters(Parameters)
8441 ## Create new object as offset of the given one.
8442 # @param theObject The base object for the offset.
8443 # @param theOffset Offset value.
8444 # @param theName Object name; when specified, this parameter is used
8445 # for result publication in the study. Otherwise, if automatic
8446 # publication is switched on, default value is used for result name.
8448 # @return New GEOM.GEOM_Object, containing the offset object.
8450 # @ref tui_offset "Example"
8451 @ManageTransactions("TrsfOp")
8452 def MakeOffset(self, theObject, theOffset, theName=None):
8454 Create new object as offset of the given one.
8457 theObject The base object for the offset.
8458 theOffset Offset value.
8459 theName Object name; when specified, this parameter is used
8460 for result publication in the study. Otherwise, if automatic
8461 publication is switched on, default value is used for result name.
8464 New GEOM.GEOM_Object, containing the offset object.
8467 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8468 # create a new object as offset of the given object
8469 offset = geompy.MakeOffset(box, 70.)
8471 # Example: see GEOM_TestAll.py
8472 theOffset, Parameters = ParseParameters(theOffset)
8473 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8474 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8475 anObj.SetParameters(Parameters)
8476 self._autoPublish(anObj, theName, "offset")
8479 ## Create new object as projection of the given one on a 2D surface.
8480 # @param theSource The source object for the projection. It can be a point, edge or wire.
8481 # @param theTarget The target object. It can be planar or cylindrical face.
8482 # @param theName Object name; when specified, this parameter is used
8483 # for result publication in the study. Otherwise, if automatic
8484 # publication is switched on, default value is used for result name.
8486 # @return New GEOM.GEOM_Object, containing the projection.
8488 # @ref tui_projection "Example"
8489 @ManageTransactions("TrsfOp")
8490 def MakeProjection(self, theSource, theTarget, theName=None):
8492 Create new object as projection of the given one on a 2D surface.
8495 theSource The source object for the projection. It can be a point, edge or wire.
8496 theTarget The target object. It can be planar or cylindrical face.
8497 theName Object name; when specified, this parameter is used
8498 for result publication in the study. Otherwise, if automatic
8499 publication is switched on, default value is used for result name.
8502 New GEOM.GEOM_Object, containing the projection.
8504 # Example: see GEOM_TestAll.py
8505 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8506 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8507 self._autoPublish(anObj, theName, "projection")
8510 ## Create a projection projection of the given point on a wire or an edge.
8511 # If there are no solutions or there are 2 or more solutions It throws an
8513 # @param thePoint the point to be projected.
8514 # @param theWire the wire. The edge is accepted as well.
8515 # @param theName Object name; when specified, this parameter is used
8516 # for result publication in the study. Otherwise, if automatic
8517 # publication is switched on, default value is used for result name.
8519 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8520 # \n \a u: The parameter of projection point on edge.
8521 # \n \a PointOnEdge: The projection point.
8522 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8524 # @ref tui_projection "Example"
8525 @ManageTransactions("TrsfOp")
8526 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8528 Create a projection projection of the given point on a wire or an edge.
8529 If there are no solutions or there are 2 or more solutions It throws an
8533 thePoint the point to be projected.
8534 theWire the wire. The edge is accepted as well.
8535 theName Object name; when specified, this parameter is used
8536 for result publication in the study. Otherwise, if automatic
8537 publication is switched on, default value is used for result name.
8540 [u, PointOnEdge, EdgeInWireIndex]
8541 u: The parameter of projection point on edge.
8542 PointOnEdge: The projection point.
8543 EdgeInWireIndex: The index of an edge in a wire.
8545 # Example: see GEOM_TestAll.py
8546 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8547 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8548 self._autoPublish(anObj[1], theName, "projection")
8551 # -----------------------------------------------------------------------------
8553 # -----------------------------------------------------------------------------
8555 ## Translate the given object along the given vector a given number times
8556 # @param theObject The object to be translated.
8557 # @param theVector Direction of the translation. DX if None.
8558 # @param theStep Distance to translate on.
8559 # @param theNbTimes Quantity of translations to be done.
8560 # @param theName Object name; when specified, this parameter is used
8561 # for result publication in the study. Otherwise, if automatic
8562 # publication is switched on, default value is used for result name.
8564 # @return New GEOM.GEOM_Object, containing compound of all
8565 # the shapes, obtained after each translation.
8567 # @ref tui_multi_translation "Example"
8568 @ManageTransactions("TrsfOp")
8569 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8571 Translate the given object along the given vector a given number times
8574 theObject The object to be translated.
8575 theVector Direction of the translation. DX if None.
8576 theStep Distance to translate on.
8577 theNbTimes Quantity of translations to be done.
8578 theName Object name; when specified, this parameter is used
8579 for result publication in the study. Otherwise, if automatic
8580 publication is switched on, default value is used for result name.
8583 New GEOM.GEOM_Object, containing compound of all
8584 the shapes, obtained after each translation.
8587 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8589 # Example: see GEOM_TestAll.py
8590 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8591 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8592 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8593 anObj.SetParameters(Parameters)
8594 self._autoPublish(anObj, theName, "multitranslation")
8597 ## Conseqently apply two specified translations to theObject specified number of times.
8598 # @param theObject The object to be translated.
8599 # @param theVector1 Direction of the first translation. DX if None.
8600 # @param theStep1 Step of the first translation.
8601 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8602 # @param theVector2 Direction of the second translation. DY if None.
8603 # @param theStep2 Step of the second translation.
8604 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8605 # @param theName Object name; when specified, this parameter is used
8606 # for result publication in the study. Otherwise, if automatic
8607 # publication is switched on, default value is used for result name.
8609 # @return New GEOM.GEOM_Object, containing compound of all
8610 # the shapes, obtained after each translation.
8612 # @ref tui_multi_translation "Example"
8613 @ManageTransactions("TrsfOp")
8614 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8615 theVector2, theStep2, theNbTimes2, theName=None):
8617 Conseqently apply two specified translations to theObject specified number of times.
8620 theObject The object to be translated.
8621 theVector1 Direction of the first translation. DX if None.
8622 theStep1 Step of the first translation.
8623 theNbTimes1 Quantity of translations to be done along theVector1.
8624 theVector2 Direction of the second translation. DY if None.
8625 theStep2 Step of the second translation.
8626 theNbTimes2 Quantity of translations to be done along theVector2.
8627 theName Object name; when specified, this parameter is used
8628 for result publication in the study. Otherwise, if automatic
8629 publication is switched on, default value is used for result name.
8632 New GEOM.GEOM_Object, containing compound of all
8633 the shapes, obtained after each translation.
8636 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8638 # Example: see GEOM_TestAll.py
8639 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8640 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8641 theVector2, theStep2, theNbTimes2)
8642 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8643 anObj.SetParameters(Parameters)
8644 self._autoPublish(anObj, theName, "multitranslation")
8647 ## Rotate the given object around the given axis a given number times.
8648 # Rotation angle will be 2*PI/theNbTimes.
8649 # @param theObject The object to be rotated.
8650 # @param theAxis The rotation axis. DZ if None.
8651 # @param theNbTimes Quantity of rotations to be done.
8652 # @param theName Object name; when specified, this parameter is used
8653 # for result publication in the study. Otherwise, if automatic
8654 # publication is switched on, default value is used for result name.
8656 # @return New GEOM.GEOM_Object, containing compound of all the
8657 # shapes, obtained after each rotation.
8659 # @ref tui_multi_rotation "Example"
8660 @ManageTransactions("TrsfOp")
8661 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8663 Rotate the given object around the given axis a given number times.
8664 Rotation angle will be 2*PI/theNbTimes.
8667 theObject The object to be rotated.
8668 theAxis The rotation axis. DZ if None.
8669 theNbTimes Quantity of rotations to be done.
8670 theName Object name; when specified, this parameter is used
8671 for result publication in the study. Otherwise, if automatic
8672 publication is switched on, default value is used for result name.
8675 New GEOM.GEOM_Object, containing compound of all the
8676 shapes, obtained after each rotation.
8679 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8681 # Example: see GEOM_TestAll.py
8682 theNbTimes, Parameters = ParseParameters(theNbTimes)
8683 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8684 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8685 anObj.SetParameters(Parameters)
8686 self._autoPublish(anObj, theName, "multirotation")
8689 ## Rotate the given object around the given axis
8690 # a given number times on the given angle.
8691 # @param theObject The object to be rotated.
8692 # @param theAxis The rotation axis. DZ if None.
8693 # @param theAngleStep Rotation angle in radians.
8694 # @param theNbTimes Quantity of rotations to be done.
8695 # @param theName Object name; when specified, this parameter is used
8696 # for result publication in the study. Otherwise, if automatic
8697 # publication is switched on, default value is used for result name.
8699 # @return New GEOM.GEOM_Object, containing compound of all the
8700 # shapes, obtained after each rotation.
8702 # @ref tui_multi_rotation "Example"
8703 @ManageTransactions("TrsfOp")
8704 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8706 Rotate the given object around the given axis
8707 a given number times on the given angle.
8710 theObject The object to be rotated.
8711 theAxis The rotation axis. DZ if None.
8712 theAngleStep Rotation angle in radians.
8713 theNbTimes Quantity of rotations to be done.
8714 theName Object name; when specified, this parameter is used
8715 for result publication in the study. Otherwise, if automatic
8716 publication is switched on, default value is used for result name.
8719 New GEOM.GEOM_Object, containing compound of all the
8720 shapes, obtained after each rotation.
8723 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8725 # Example: see GEOM_TestAll.py
8726 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8727 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8728 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8729 anObj.SetParameters(Parameters)
8730 self._autoPublish(anObj, theName, "multirotation")
8733 ## Rotate the given object around the given axis a given
8734 # number times and multi-translate each rotation result.
8735 # Rotation angle will be 2*PI/theNbTimes1.
8736 # Translation direction passes through center of gravity
8737 # of rotated shape and its projection on the rotation axis.
8738 # @param theObject The object to be rotated.
8739 # @param theAxis Rotation axis. DZ if None.
8740 # @param theNbTimes1 Quantity of rotations to be done.
8741 # @param theRadialStep Translation distance.
8742 # @param theNbTimes2 Quantity of translations to be done.
8743 # @param theName Object name; when specified, this parameter is used
8744 # for result publication in the study. Otherwise, if automatic
8745 # publication is switched on, default value is used for result name.
8747 # @return New GEOM.GEOM_Object, containing compound of all the
8748 # shapes, obtained after each transformation.
8750 # @ref tui_multi_rotation "Example"
8751 @ManageTransactions("TrsfOp")
8752 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8754 Rotate the given object around the
8755 given axis on the given angle a given number
8756 times and multi-translate each rotation result.
8757 Translation direction passes through center of gravity
8758 of rotated shape and its projection on the rotation axis.
8761 theObject The object to be rotated.
8762 theAxis Rotation axis. DZ if None.
8763 theNbTimes1 Quantity of rotations to be done.
8764 theRadialStep Translation distance.
8765 theNbTimes2 Quantity of translations to be done.
8766 theName Object name; when specified, this parameter is used
8767 for result publication in the study. Otherwise, if automatic
8768 publication is switched on, default value is used for result name.
8771 New GEOM.GEOM_Object, containing compound of all the
8772 shapes, obtained after each transformation.
8775 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8777 # Example: see GEOM_TestAll.py
8778 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8779 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8780 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8781 anObj.SetParameters(Parameters)
8782 self._autoPublish(anObj, theName, "multirotation")
8785 ## Rotate the given object around the
8786 # given axis on the given angle a given number
8787 # times and multi-translate each rotation result.
8788 # Translation direction passes through center of gravity
8789 # of rotated shape and its projection on the rotation axis.
8790 # @param theObject The object to be rotated.
8791 # @param theAxis Rotation axis. DZ if None.
8792 # @param theAngleStep Rotation angle in radians.
8793 # @param theNbTimes1 Quantity of rotations to be done.
8794 # @param theRadialStep Translation distance.
8795 # @param theNbTimes2 Quantity of translations to be done.
8796 # @param theName Object name; when specified, this parameter is used
8797 # for result publication in the study. Otherwise, if automatic
8798 # publication is switched on, default value is used for result name.
8800 # @return New GEOM.GEOM_Object, containing compound of all the
8801 # shapes, obtained after each transformation.
8803 # @ref tui_multi_rotation "Example"
8804 @ManageTransactions("TrsfOp")
8805 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8807 Rotate the given object around the
8808 given axis on the given angle a given number
8809 times and multi-translate each rotation result.
8810 Translation direction passes through center of gravity
8811 of rotated shape and its projection on the rotation axis.
8814 theObject The object to be rotated.
8815 theAxis Rotation axis. DZ if None.
8816 theAngleStep Rotation angle in radians.
8817 theNbTimes1 Quantity of rotations to be done.
8818 theRadialStep Translation distance.
8819 theNbTimes2 Quantity of translations to be done.
8820 theName Object name; when specified, this parameter is used
8821 for result publication in the study. Otherwise, if automatic
8822 publication is switched on, default value is used for result name.
8825 New GEOM.GEOM_Object, containing compound of all the
8826 shapes, obtained after each transformation.
8829 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8831 # Example: see GEOM_TestAll.py
8832 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8833 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8834 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8835 anObj.SetParameters(Parameters)
8836 self._autoPublish(anObj, theName, "multirotation")
8839 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8841 # @ref swig_MakeMultiRotation "Example"
8842 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8844 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8847 pz = geompy.MakeVertex(0, 0, 100)
8848 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8849 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8851 # Example: see GEOM_TestOthers.py
8852 aVec = self.MakeLine(aPoint,aDir)
8853 # note: auto-publishing is done in self.MultiRotate1D()
8854 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8857 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8859 # @ref swig_MakeMultiRotation "Example"
8860 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8862 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8865 pz = geompy.MakeVertex(0, 0, 100)
8866 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8867 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8869 # Example: see GEOM_TestOthers.py
8870 aVec = self.MakeLine(aPoint,aDir)
8871 # note: auto-publishing is done in self.MultiRotate1D()
8872 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8875 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8877 # @ref swig_MakeMultiRotation "Example"
8878 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8880 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8883 pz = geompy.MakeVertex(0, 0, 100)
8884 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8885 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8887 # Example: see GEOM_TestOthers.py
8888 aVec = self.MakeLine(aPoint,aDir)
8889 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8890 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8893 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8895 # @ref swig_MakeMultiRotation "Example"
8896 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8898 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8901 pz = geompy.MakeVertex(0, 0, 100)
8902 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8903 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8905 # Example: see GEOM_TestOthers.py
8906 aVec = self.MakeLine(aPoint,aDir)
8907 # note: auto-publishing is done in self.MultiRotate2D()
8908 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8911 # end of l3_transform
8914 ## @addtogroup l3_transform_d
8917 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8918 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8920 Deprecated method. Use MultiRotate1DNbTimes instead.
8922 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8923 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8925 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8926 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8927 @ManageTransactions("TrsfOp")
8928 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8930 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8931 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8934 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8936 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8937 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8938 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8939 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8940 anObj.SetParameters(Parameters)
8941 self._autoPublish(anObj, theName, "multirotation")
8944 ## The same, as MultiRotate1D(), but axis is given by direction and point
8945 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8946 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8948 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8949 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8952 pz = geompy.MakeVertex(0, 0, 100)
8953 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8954 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8956 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8957 aVec = self.MakeLine(aPoint,aDir)
8958 # note: auto-publishing is done in self.MultiRotate1D()
8959 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8962 ## The same, as MultiRotate2D(), but axis is given by direction and point
8963 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8964 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8966 The same, as MultiRotate2D(), but axis is given by direction and point
8967 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8970 pz = geompy.MakeVertex(0, 0, 100)
8971 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8972 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8974 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8975 aVec = self.MakeLine(aPoint,aDir)
8976 # note: auto-publishing is done in self.MultiRotate2D()
8977 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8980 # end of l3_transform_d
8983 ## @addtogroup l3_local
8986 ## Perform a fillet on all edges of the given shape.
8987 # @param theShape Shape, to perform fillet on.
8988 # @param theR Fillet radius.
8989 # @param theName Object name; when specified, this parameter is used
8990 # for result publication in the study. Otherwise, if automatic
8991 # publication is switched on, default value is used for result name.
8993 # @return New GEOM.GEOM_Object, containing the result shape.
8995 # @ref tui_fillet "Example 1"
8996 # \n @ref swig_MakeFilletAll "Example 2"
8997 @ManageTransactions("LocalOp")
8998 def MakeFilletAll(self, theShape, theR, theName=None):
9000 Perform a fillet on all edges of the given shape.
9003 theShape Shape, to perform fillet on.
9005 theName Object name; when specified, this parameter is used
9006 for result publication in the study. Otherwise, if automatic
9007 publication is switched on, default value is used for result name.
9010 New GEOM.GEOM_Object, containing the result shape.
9013 filletall = geompy.MakeFilletAll(prism, 10.)
9015 # Example: see GEOM_TestOthers.py
9016 theR,Parameters = ParseParameters(theR)
9017 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9018 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9019 anObj.SetParameters(Parameters)
9020 self._autoPublish(anObj, theName, "fillet")
9023 ## Perform a fillet on the specified edges/faces of the given shape
9024 # @param theShape Shape, to perform fillet on.
9025 # @param theR Fillet radius.
9026 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9027 # @param theListShapes Global indices of edges/faces to perform fillet on.
9028 # @param theName Object name; when specified, this parameter is used
9029 # for result publication in the study. Otherwise, if automatic
9030 # publication is switched on, default value is used for result name.
9032 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9034 # @return New GEOM.GEOM_Object, containing the result shape.
9036 # @ref tui_fillet "Example"
9037 @ManageTransactions("LocalOp")
9038 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9040 Perform a fillet on the specified edges/faces of the given shape
9043 theShape Shape, to perform fillet on.
9045 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9046 theListShapes Global indices of edges/faces to perform fillet on.
9047 theName Object name; when specified, this parameter is used
9048 for result publication in the study. Otherwise, if automatic
9049 publication is switched on, default value is used for result name.
9052 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9055 New GEOM.GEOM_Object, containing the result shape.
9058 # get the list of IDs (IDList) for the fillet
9059 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9061 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9062 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9063 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9064 # make a fillet on the specified edges of the given shape
9065 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9067 # Example: see GEOM_TestAll.py
9068 theR,Parameters = ParseParameters(theR)
9070 if theShapeType == self.ShapeType["EDGE"]:
9071 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9072 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9074 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9075 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9076 anObj.SetParameters(Parameters)
9077 self._autoPublish(anObj, theName, "fillet")
9080 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9081 @ManageTransactions("LocalOp")
9082 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9084 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9087 # get the list of IDs (IDList) for the fillet
9088 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9090 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9091 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9092 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9093 # make a fillet on the specified edges of the given shape
9094 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9096 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9098 if theShapeType == self.ShapeType["EDGE"]:
9099 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9100 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9102 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9103 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9104 anObj.SetParameters(Parameters)
9105 self._autoPublish(anObj, theName, "fillet")
9108 ## Perform a fillet on the specified edges of the given shape
9109 # @param theShape Wire Shape to perform fillet on.
9110 # @param theR Fillet radius.
9111 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9112 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9113 # \note The list of vertices could be empty,
9114 # in this case fillet will done done at all vertices in wire
9115 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9116 # by the length of the edges, nearest to the fillet vertex.
9117 # But sometimes the next edge is C1 continuous with the one, nearest to
9118 # the fillet point, and such two (or more) edges can be united to allow
9119 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9120 # thus ignoring the secant vertex (vertices).
9121 # @param theName Object name; when specified, this parameter is used
9122 # for result publication in the study. Otherwise, if automatic
9123 # publication is switched on, default value is used for result name.
9125 # @return New GEOM.GEOM_Object, containing the result shape.
9127 # @ref tui_fillet2d "Example"
9128 @ManageTransactions("LocalOp")
9129 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9131 Perform a fillet on the specified edges of the given shape
9134 theShape Wire Shape to perform fillet on.
9136 theListOfVertexes Global indices of vertexes to perform fillet on.
9137 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9138 by the length of the edges, nearest to the fillet vertex.
9139 But sometimes the next edge is C1 continuous with the one, nearest to
9140 the fillet point, and such two (or more) edges can be united to allow
9141 bigger radius. Set this flag to TRUE to allow collinear edges union,
9142 thus ignoring the secant vertex (vertices).
9143 theName Object name; when specified, this parameter is used
9144 for result publication in the study. Otherwise, if automatic
9145 publication is switched on, default value is used for result name.
9147 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9149 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9152 New GEOM.GEOM_Object, containing the result shape.
9156 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9157 # make fillet at given wire vertices with giver radius
9158 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9160 # Example: see GEOM_TestAll.py
9161 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9162 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9163 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9164 anObj.SetParameters(Parameters)
9165 self._autoPublish(anObj, theName, "fillet")
9168 ## Perform a fillet at the specified vertices of the given face/shell.
9169 # @param theShape Face or Shell shape to perform fillet on.
9170 # @param theR Fillet radius.
9171 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9172 # @param theName Object name; when specified, this parameter is used
9173 # for result publication in the study. Otherwise, if automatic
9174 # publication is switched on, default value is used for result name.
9176 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9178 # @return New GEOM.GEOM_Object, containing the result shape.
9180 # @ref tui_fillet2d "Example"
9181 @ManageTransactions("LocalOp")
9182 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9184 Perform a fillet at the specified vertices of the given face/shell.
9187 theShape Face or Shell shape to perform fillet on.
9189 theListOfVertexes Global indices of vertexes to perform fillet on.
9190 theName Object name; when specified, this parameter is used
9191 for result publication in the study. Otherwise, if automatic
9192 publication is switched on, default value is used for result name.
9194 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9197 New GEOM.GEOM_Object, containing the result shape.
9200 face = geompy.MakeFaceHW(100, 100, 1)
9201 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9203 # Example: see GEOM_TestAll.py
9204 theR,Parameters = ParseParameters(theR)
9205 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9206 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9207 anObj.SetParameters(Parameters)
9208 self._autoPublish(anObj, theName, "fillet")
9211 ## Perform a symmetric chamfer on all edges of the given shape.
9212 # @param theShape Shape, to perform chamfer on.
9213 # @param theD Chamfer size along each face.
9214 # @param theName Object name; when specified, this parameter is used
9215 # for result publication in the study. Otherwise, if automatic
9216 # publication is switched on, default value is used for result name.
9218 # @return New GEOM.GEOM_Object, containing the result shape.
9220 # @ref tui_chamfer "Example 1"
9221 # \n @ref swig_MakeChamferAll "Example 2"
9222 @ManageTransactions("LocalOp")
9223 def MakeChamferAll(self, theShape, theD, theName=None):
9225 Perform a symmetric chamfer on all edges of the given shape.
9228 theShape Shape, to perform chamfer on.
9229 theD Chamfer size along each face.
9230 theName Object name; when specified, this parameter is used
9231 for result publication in the study. Otherwise, if automatic
9232 publication is switched on, default value is used for result name.
9235 New GEOM.GEOM_Object, containing the result shape.
9238 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9240 # Example: see GEOM_TestOthers.py
9241 theD,Parameters = ParseParameters(theD)
9242 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9243 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9244 anObj.SetParameters(Parameters)
9245 self._autoPublish(anObj, theName, "chamfer")
9248 ## Perform a chamfer on edges, common to the specified faces,
9249 # with distance D1 on the Face1
9250 # @param theShape Shape, to perform chamfer on.
9251 # @param theD1 Chamfer size along \a theFace1.
9252 # @param theD2 Chamfer size along \a theFace2.
9253 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9254 # @param theName Object name; when specified, this parameter is used
9255 # for result publication in the study. Otherwise, if automatic
9256 # publication is switched on, default value is used for result name.
9258 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9260 # @return New GEOM.GEOM_Object, containing the result shape.
9262 # @ref tui_chamfer "Example"
9263 @ManageTransactions("LocalOp")
9264 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9266 Perform a chamfer on edges, common to the specified faces,
9267 with distance D1 on the Face1
9270 theShape Shape, to perform chamfer on.
9271 theD1 Chamfer size along theFace1.
9272 theD2 Chamfer size along theFace2.
9273 theFace1,theFace2 Global indices of two faces of theShape.
9274 theName Object name; when specified, this parameter is used
9275 for result publication in the study. Otherwise, if automatic
9276 publication is switched on, default value is used for result name.
9279 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9282 New GEOM.GEOM_Object, containing the result shape.
9285 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9286 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9287 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9288 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9290 # Example: see GEOM_TestAll.py
9291 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9292 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9293 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9294 anObj.SetParameters(Parameters)
9295 self._autoPublish(anObj, theName, "chamfer")
9298 ## Perform a chamfer on edges
9299 # @param theShape Shape, to perform chamfer on.
9300 # @param theD Chamfer length
9301 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9302 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9303 # @param theName Object name; when specified, this parameter is used
9304 # for result publication in the study. Otherwise, if automatic
9305 # publication is switched on, default value is used for result name.
9307 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9309 # @return New GEOM.GEOM_Object, containing the result shape.
9310 @ManageTransactions("LocalOp")
9311 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9313 Perform a chamfer on edges
9316 theShape Shape, to perform chamfer on.
9317 theD1 Chamfer size along theFace1.
9318 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9319 theFace1,theFace2 Global indices of two faces of theShape.
9320 theName Object name; when specified, this parameter is used
9321 for result publication in the study. Otherwise, if automatic
9322 publication is switched on, default value is used for result name.
9325 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9328 New GEOM.GEOM_Object, containing the result shape.
9331 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9332 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9333 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9335 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9338 if isinstance(theAngle,str):
9340 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9342 theAngle = theAngle*math.pi/180.0
9343 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9344 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9345 anObj.SetParameters(Parameters)
9346 self._autoPublish(anObj, theName, "chamfer")
9349 ## Perform a chamfer on all edges of the specified faces,
9350 # with distance D1 on the first specified face (if several for one edge)
9351 # @param theShape Shape, to perform chamfer on.
9352 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9353 # connected to the edge, are in \a theFaces, \a theD1
9354 # will be get along face, which is nearer to \a theFaces beginning.
9355 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9356 # @param theFaces Sequence of global indices of faces of \a theShape.
9357 # @param theName Object name; when specified, this parameter is used
9358 # for result publication in the study. Otherwise, if automatic
9359 # publication is switched on, default value is used for result name.
9361 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9363 # @return New GEOM.GEOM_Object, containing the result shape.
9365 # @ref tui_chamfer "Example"
9366 @ManageTransactions("LocalOp")
9367 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9369 Perform a chamfer on all edges of the specified faces,
9370 with distance D1 on the first specified face (if several for one edge)
9373 theShape Shape, to perform chamfer on.
9374 theD1 Chamfer size along face from theFaces. If both faces,
9375 connected to the edge, are in theFaces, theD1
9376 will be get along face, which is nearer to theFaces beginning.
9377 theD2 Chamfer size along another of two faces, connected to the edge.
9378 theFaces Sequence of global indices of faces of theShape.
9379 theName Object name; when specified, this parameter is used
9380 for result publication in the study. Otherwise, if automatic
9381 publication is switched on, default value is used for result name.
9383 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9386 New GEOM.GEOM_Object, containing the result shape.
9388 # Example: see GEOM_TestAll.py
9389 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9390 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9391 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9392 anObj.SetParameters(Parameters)
9393 self._autoPublish(anObj, theName, "chamfer")
9396 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9397 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9399 # @ref swig_FilletChamfer "Example"
9400 @ManageTransactions("LocalOp")
9401 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9403 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9404 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9407 if isinstance(theAngle,str):
9409 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9411 theAngle = theAngle*math.pi/180.0
9412 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9413 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9414 anObj.SetParameters(Parameters)
9415 self._autoPublish(anObj, theName, "chamfer")
9418 ## Perform a chamfer on edges,
9419 # with distance D1 on the first specified face (if several for one edge)
9420 # @param theShape Shape, to perform chamfer on.
9421 # @param theD1,theD2 Chamfer size
9422 # @param theEdges Sequence of edges of \a theShape.
9423 # @param theName Object name; when specified, this parameter is used
9424 # for result publication in the study. Otherwise, if automatic
9425 # publication is switched on, default value is used for result name.
9427 # @return New GEOM.GEOM_Object, containing the result shape.
9429 # @ref swig_FilletChamfer "Example"
9430 @ManageTransactions("LocalOp")
9431 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9433 Perform a chamfer on edges,
9434 with distance D1 on the first specified face (if several for one edge)
9437 theShape Shape, to perform chamfer on.
9438 theD1,theD2 Chamfer size
9439 theEdges Sequence of edges of theShape.
9440 theName Object name; when specified, this parameter is used
9441 for result publication in the study. Otherwise, if automatic
9442 publication is switched on, default value is used for result name.
9445 New GEOM.GEOM_Object, containing the result shape.
9447 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9448 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9449 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9450 anObj.SetParameters(Parameters)
9451 self._autoPublish(anObj, theName, "chamfer")
9454 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9455 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9456 @ManageTransactions("LocalOp")
9457 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9459 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9460 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9463 if isinstance(theAngle,str):
9465 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9467 theAngle = theAngle*math.pi/180.0
9468 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9469 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9470 anObj.SetParameters(Parameters)
9471 self._autoPublish(anObj, theName, "chamfer")
9474 ## @sa MakeChamferEdge(), MakeChamferFaces()
9476 # @ref swig_MakeChamfer "Example"
9477 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9479 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9481 # Example: see GEOM_TestOthers.py
9483 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9484 if aShapeType == self.ShapeType["EDGE"]:
9485 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9487 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9490 ## Remove material from a solid by extrusion of the base shape on the given distance.
9491 # @param theInit Shape to remove material from. It must be a solid or
9492 # a compound made of a single solid.
9493 # @param theBase Closed edge or wire defining the base shape to be extruded.
9494 # @param theH Prism dimension along the normal to theBase
9495 # @param theAngle Draft angle in degrees.
9496 # @param theName Object name; when specified, this parameter is used
9497 # for result publication in the study. Otherwise, if automatic
9498 # publication is switched on, default value is used for result name.
9500 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9502 # @ref tui_creation_prism "Example"
9503 @ManageTransactions("PrimOp")
9504 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9506 Add material to a solid by extrusion of the base shape on the given distance.
9509 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9510 theBase Closed edge or wire defining the base shape to be extruded.
9511 theH Prism dimension along the normal to theBase
9512 theAngle Draft angle in degrees.
9513 theName Object name; when specified, this parameter is used
9514 for result publication in the study. Otherwise, if automatic
9515 publication is switched on, default value is used for result name.
9518 New GEOM.GEOM_Object, containing the initial shape with removed material.
9520 # Example: see GEOM_TestAll.py
9521 #theH,Parameters = ParseParameters(theH)
9522 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9523 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9524 #anObj.SetParameters(Parameters)
9525 self._autoPublish(anObj, theName, "extrudedCut")
9528 ## Add material to a solid by extrusion of the base shape on the given distance.
9529 # @param theInit Shape to add material to. It must be a solid or
9530 # a compound made of a single solid.
9531 # @param theBase Closed edge or wire defining the base shape to be extruded.
9532 # @param theH Prism dimension along the normal to theBase
9533 # @param theAngle Draft angle in degrees.
9534 # @param theName Object name; when specified, this parameter is used
9535 # for result publication in the study. Otherwise, if automatic
9536 # publication is switched on, default value is used for result name.
9538 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9540 # @ref tui_creation_prism "Example"
9541 @ManageTransactions("PrimOp")
9542 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9544 Add material to a solid by extrusion of the base shape on the given distance.
9547 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9548 theBase Closed edge or wire defining the base shape to be extruded.
9549 theH Prism dimension along the normal to theBase
9550 theAngle Draft angle in degrees.
9551 theName Object name; when specified, this parameter is used
9552 for result publication in the study. Otherwise, if automatic
9553 publication is switched on, default value is used for result name.
9556 New GEOM.GEOM_Object, containing the initial shape with added material.
9558 # Example: see GEOM_TestAll.py
9559 #theH,Parameters = ParseParameters(theH)
9560 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9561 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9562 #anObj.SetParameters(Parameters)
9563 self._autoPublish(anObj, theName, "extrudedBoss")
9569 ## @addtogroup l3_basic_op
9572 ## Perform an Archimde operation on the given shape with given parameters.
9573 # The object presenting the resulting face is returned.
9574 # @param theShape Shape to be put in water.
9575 # @param theWeight Weight og the shape.
9576 # @param theWaterDensity Density of the water.
9577 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9578 # @param theName Object name; when specified, this parameter is used
9579 # for result publication in the study. Otherwise, if automatic
9580 # publication is switched on, default value is used for result name.
9582 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9583 # by a plane, corresponding to water level.
9585 # @ref tui_archimede "Example"
9586 @ManageTransactions("LocalOp")
9587 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9589 Perform an Archimde operation on the given shape with given parameters.
9590 The object presenting the resulting face is returned.
9593 theShape Shape to be put in water.
9594 theWeight Weight og the shape.
9595 theWaterDensity Density of the water.
9596 theMeshDeflection Deflection of the mesh, using to compute the section.
9597 theName Object name; when specified, this parameter is used
9598 for result publication in the study. Otherwise, if automatic
9599 publication is switched on, default value is used for result name.
9602 New GEOM.GEOM_Object, containing a section of theShape
9603 by a plane, corresponding to water level.
9605 # Example: see GEOM_TestAll.py
9606 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9607 theWeight,theWaterDensity,theMeshDeflection)
9608 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9609 RaiseIfFailed("MakeArchimede", self.LocalOp)
9610 anObj.SetParameters(Parameters)
9611 self._autoPublish(anObj, theName, "archimede")
9614 # end of l3_basic_op
9617 ## @addtogroup l2_measure
9620 ## Get point coordinates
9623 # @ref tui_measurement_tools_page "Example"
9624 @ManageTransactions("MeasuOp")
9625 def PointCoordinates(self,Point):
9627 Get point coordinates
9632 # Example: see GEOM_TestMeasures.py
9633 aTuple = self.MeasuOp.PointCoordinates(Point)
9634 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9637 ## Get vector coordinates
9640 # @ref tui_measurement_tools_page "Example"
9641 def VectorCoordinates(self,Vector):
9643 Get vector coordinates
9649 p1=self.GetFirstVertex(Vector)
9650 p2=self.GetLastVertex(Vector)
9652 X1=self.PointCoordinates(p1)
9653 X2=self.PointCoordinates(p2)
9655 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9658 ## Compute cross product
9659 # @return vector w=u^v
9661 # @ref tui_measurement_tools_page "Example"
9662 def CrossProduct(self, Vector1, Vector2):
9664 Compute cross product
9666 Returns: vector w=u^v
9668 u=self.VectorCoordinates(Vector1)
9669 v=self.VectorCoordinates(Vector2)
9670 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])
9674 ## Compute cross product
9675 # @return dot product p=u.v
9677 # @ref tui_measurement_tools_page "Example"
9678 def DotProduct(self, Vector1, Vector2):
9680 Compute cross product
9682 Returns: dot product p=u.v
9684 u=self.VectorCoordinates(Vector1)
9685 v=self.VectorCoordinates(Vector2)
9686 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9691 ## Get summarized length of all wires,
9692 # area of surface and volume of the given shape.
9693 # @param theShape Shape to define properties of.
9694 # @return [theLength, theSurfArea, theVolume]\n
9695 # theLength: Summarized length of all wires of the given shape.\n
9696 # theSurfArea: Area of surface of the given shape.\n
9697 # theVolume: Volume of the given shape.
9699 # @ref tui_measurement_tools_page "Example"
9700 @ManageTransactions("MeasuOp")
9701 def BasicProperties(self,theShape):
9703 Get summarized length of all wires,
9704 area of surface and volume of the given shape.
9707 theShape Shape to define properties of.
9710 [theLength, theSurfArea, theVolume]
9711 theLength: Summarized length of all wires of the given shape.
9712 theSurfArea: Area of surface of the given shape.
9713 theVolume: Volume of the given shape.
9715 # Example: see GEOM_TestMeasures.py
9716 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9717 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9720 ## Get parameters of bounding box of the given shape
9721 # @param theShape Shape to obtain bounding box of.
9722 # @param precise TRUE for precise computation; FALSE for fast one.
9723 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9724 # Xmin,Xmax: Limits of shape along OX axis.
9725 # Ymin,Ymax: Limits of shape along OY axis.
9726 # Zmin,Zmax: Limits of shape along OZ axis.
9728 # @ref tui_measurement_tools_page "Example"
9729 @ManageTransactions("MeasuOp")
9730 def BoundingBox (self, theShape, precise=False):
9732 Get parameters of bounding box of the given shape
9735 theShape Shape to obtain bounding box of.
9736 precise TRUE for precise computation; FALSE for fast one.
9739 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9740 Xmin,Xmax: Limits of shape along OX axis.
9741 Ymin,Ymax: Limits of shape along OY axis.
9742 Zmin,Zmax: Limits of shape along OZ axis.
9744 # Example: see GEOM_TestMeasures.py
9745 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9746 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9749 ## Get bounding box of the given shape
9750 # @param theShape Shape to obtain bounding box of.
9751 # @param precise TRUE for precise computation; FALSE for fast one.
9752 # @param theName Object name; when specified, this parameter is used
9753 # for result publication in the study. Otherwise, if automatic
9754 # publication is switched on, default value is used for result name.
9756 # @return New GEOM.GEOM_Object, containing the created box.
9758 # @ref tui_measurement_tools_page "Example"
9759 @ManageTransactions("MeasuOp")
9760 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9762 Get bounding box of the given shape
9765 theShape Shape to obtain bounding box of.
9766 precise TRUE for precise computation; FALSE for fast one.
9767 theName Object name; when specified, this parameter is used
9768 for result publication in the study. Otherwise, if automatic
9769 publication is switched on, default value is used for result name.
9772 New GEOM.GEOM_Object, containing the created box.
9774 # Example: see GEOM_TestMeasures.py
9775 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9776 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9777 self._autoPublish(anObj, theName, "bndbox")
9780 ## Get inertia matrix and moments of inertia of theShape.
9781 # @param theShape Shape to calculate inertia of.
9782 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9783 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9784 # Ix,Iy,Iz: Moments of inertia of the given shape.
9786 # @ref tui_measurement_tools_page "Example"
9787 @ManageTransactions("MeasuOp")
9788 def Inertia(self,theShape):
9790 Get inertia matrix and moments of inertia of theShape.
9793 theShape Shape to calculate inertia of.
9796 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9797 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9798 Ix,Iy,Iz: Moments of inertia of the given shape.
9800 # Example: see GEOM_TestMeasures.py
9801 aTuple = self.MeasuOp.GetInertia(theShape)
9802 RaiseIfFailed("GetInertia", self.MeasuOp)
9805 ## Get if coords are included in the shape (ST_IN or ST_ON)
9806 # @param theShape Shape
9807 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9808 # @param tolerance to be used (default is 1.0e-7)
9809 # @return list_of_boolean = [res1, res2, ...]
9810 @ManageTransactions("MeasuOp")
9811 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9813 Get if coords are included in the shape (ST_IN or ST_ON)
9817 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9818 tolerance to be used (default is 1.0e-7)
9821 list_of_boolean = [res1, res2, ...]
9823 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9825 ## Get minimal distance between the given shapes.
9826 # @param theShape1,theShape2 Shapes to find minimal distance between.
9827 # @return Value of the minimal distance between the given shapes.
9829 # @ref tui_measurement_tools_page "Example"
9830 @ManageTransactions("MeasuOp")
9831 def MinDistance(self, theShape1, theShape2):
9833 Get minimal distance between the given shapes.
9836 theShape1,theShape2 Shapes to find minimal distance between.
9839 Value of the minimal distance between the given shapes.
9841 # Example: see GEOM_TestMeasures.py
9842 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9843 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9846 ## Get minimal distance between the given shapes.
9847 # @param theShape1,theShape2 Shapes to find minimal distance between.
9848 # @return Value of the minimal distance between the given shapes, in form of list
9849 # [Distance, DX, DY, DZ].
9851 # @ref swig_all_measure "Example"
9852 @ManageTransactions("MeasuOp")
9853 def MinDistanceComponents(self, theShape1, theShape2):
9855 Get minimal distance between the given shapes.
9858 theShape1,theShape2 Shapes to find minimal distance between.
9861 Value of the minimal distance between the given shapes, in form of list
9862 [Distance, DX, DY, DZ]
9864 # Example: see GEOM_TestMeasures.py
9865 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9866 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9867 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9870 ## Get closest points of the given shapes.
9871 # @param theShape1,theShape2 Shapes to find closest points of.
9872 # @return The number of found solutions (-1 in case of infinite number of
9873 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9875 # @ref tui_measurement_tools_page "Example"
9876 @ManageTransactions("MeasuOp")
9877 def ClosestPoints (self, theShape1, theShape2):
9879 Get closest points of the given shapes.
9882 theShape1,theShape2 Shapes to find closest points of.
9885 The number of found solutions (-1 in case of infinite number of
9886 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9888 # Example: see GEOM_TestMeasures.py
9889 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9890 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9893 ## Get angle between the given shapes in degrees.
9894 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9895 # @note If both arguments are vectors, the angle is computed in accordance
9896 # with their orientations, otherwise the minimum angle is computed.
9897 # @return Value of the angle between the given shapes in degrees.
9899 # @ref tui_measurement_tools_page "Example"
9900 @ManageTransactions("MeasuOp")
9901 def GetAngle(self, theShape1, theShape2):
9903 Get angle between the given shapes in degrees.
9906 theShape1,theShape2 Lines or linear edges to find angle between.
9909 If both arguments are vectors, the angle is computed in accordance
9910 with their orientations, otherwise the minimum angle is computed.
9913 Value of the angle between the given shapes in degrees.
9915 # Example: see GEOM_TestMeasures.py
9916 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9917 RaiseIfFailed("GetAngle", self.MeasuOp)
9920 ## Get angle between the given shapes in radians.
9921 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9922 # @note If both arguments are vectors, the angle is computed in accordance
9923 # with their orientations, otherwise the minimum angle is computed.
9924 # @return Value of the angle between the given shapes in radians.
9926 # @ref tui_measurement_tools_page "Example"
9927 @ManageTransactions("MeasuOp")
9928 def GetAngleRadians(self, theShape1, theShape2):
9930 Get angle between the given shapes in radians.
9933 theShape1,theShape2 Lines or linear edges to find angle between.
9937 If both arguments are vectors, the angle is computed in accordance
9938 with their orientations, otherwise the minimum angle is computed.
9941 Value of the angle between the given shapes in radians.
9943 # Example: see GEOM_TestMeasures.py
9944 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9945 RaiseIfFailed("GetAngle", self.MeasuOp)
9948 ## Get angle between the given vectors in degrees.
9949 # @param theShape1,theShape2 Vectors to find angle between.
9950 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9951 # if False, the opposite vector to the normal vector is used.
9952 # @return Value of the angle between the given vectors in degrees.
9954 # @ref tui_measurement_tools_page "Example"
9955 @ManageTransactions("MeasuOp")
9956 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9958 Get angle between the given vectors in degrees.
9961 theShape1,theShape2 Vectors to find angle between.
9962 theFlag If True, the normal vector is defined by the two vectors cross,
9963 if False, the opposite vector to the normal vector is used.
9966 Value of the angle between the given vectors in degrees.
9968 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9970 anAngle = 360. - anAngle
9971 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9974 ## The same as GetAngleVectors, but the result is in radians.
9975 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9977 Get angle between the given vectors in radians.
9980 theShape1,theShape2 Vectors to find angle between.
9981 theFlag If True, the normal vector is defined by the two vectors cross,
9982 if False, the opposite vector to the normal vector is used.
9985 Value of the angle between the given vectors in radians.
9987 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9990 ## @name Curve Curvature Measurement
9991 # Methods for receiving radius of curvature of curves
9992 # in the given point
9995 ## Measure curvature of a curve at a point, set by parameter.
9996 # @param theCurve a curve.
9997 # @param theParam parameter.
9998 # @return radius of curvature of \a theCurve.
10000 # @ref swig_todo "Example"
10001 @ManageTransactions("MeasuOp")
10002 def CurveCurvatureByParam(self, theCurve, theParam):
10004 Measure curvature of a curve at a point, set by parameter.
10008 theParam parameter.
10011 radius of curvature of theCurve.
10013 # Example: see GEOM_TestMeasures.py
10014 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10015 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10018 ## Measure curvature of a curve at a point.
10019 # @param theCurve a curve.
10020 # @param thePoint given point.
10021 # @return radius of curvature of \a theCurve.
10023 # @ref swig_todo "Example"
10024 @ManageTransactions("MeasuOp")
10025 def CurveCurvatureByPoint(self, theCurve, thePoint):
10027 Measure curvature of a curve at a point.
10031 thePoint given point.
10034 radius of curvature of theCurve.
10036 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10037 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10041 ## @name Surface Curvature Measurement
10042 # Methods for receiving max and min radius of curvature of surfaces
10043 # in the given point
10046 ## Measure max radius of curvature of surface.
10047 # @param theSurf the given surface.
10048 # @param theUParam Value of U-parameter on the referenced surface.
10049 # @param theVParam Value of V-parameter on the referenced surface.
10050 # @return max radius of curvature of theSurf.
10052 ## @ref swig_todo "Example"
10053 @ManageTransactions("MeasuOp")
10054 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10056 Measure max radius of curvature of surface.
10059 theSurf the given surface.
10060 theUParam Value of U-parameter on the referenced surface.
10061 theVParam Value of V-parameter on the referenced surface.
10064 max radius of curvature of theSurf.
10066 # Example: see GEOM_TestMeasures.py
10067 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10068 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10071 ## Measure max radius of curvature of surface in the given point
10072 # @param theSurf the given surface.
10073 # @param thePoint given point.
10074 # @return max radius of curvature of theSurf.
10076 ## @ref swig_todo "Example"
10077 @ManageTransactions("MeasuOp")
10078 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10080 Measure max radius of curvature of surface in the given point.
10083 theSurf the given surface.
10084 thePoint given point.
10087 max radius of curvature of theSurf.
10089 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10090 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10093 ## Measure min radius of curvature of surface.
10094 # @param theSurf the given surface.
10095 # @param theUParam Value of U-parameter on the referenced surface.
10096 # @param theVParam Value of V-parameter on the referenced surface.
10097 # @return min radius of curvature of theSurf.
10099 ## @ref swig_todo "Example"
10100 @ManageTransactions("MeasuOp")
10101 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10103 Measure min radius of curvature of surface.
10106 theSurf the given surface.
10107 theUParam Value of U-parameter on the referenced surface.
10108 theVParam Value of V-parameter on the referenced surface.
10111 Min radius of curvature of theSurf.
10113 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10114 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10117 ## Measure min radius of curvature of surface in the given point
10118 # @param theSurf the given surface.
10119 # @param thePoint given point.
10120 # @return min radius of curvature of theSurf.
10122 ## @ref swig_todo "Example"
10123 @ManageTransactions("MeasuOp")
10124 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10126 Measure min radius of curvature of surface in the given point.
10129 theSurf the given surface.
10130 thePoint given point.
10133 Min radius of curvature of theSurf.
10135 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10136 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10140 ## Get min and max tolerances of sub-shapes of theShape
10141 # @param theShape Shape, to get tolerances of.
10142 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10143 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10144 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10145 # VertMin,VertMax: Min and max tolerances of the vertices.
10147 # @ref tui_measurement_tools_page "Example"
10148 @ManageTransactions("MeasuOp")
10149 def Tolerance(self,theShape):
10151 Get min and max tolerances of sub-shapes of theShape
10154 theShape Shape, to get tolerances of.
10157 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10158 FaceMin,FaceMax: Min and max tolerances of the faces.
10159 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10160 VertMin,VertMax: Min and max tolerances of the vertices.
10162 # Example: see GEOM_TestMeasures.py
10163 aTuple = self.MeasuOp.GetTolerance(theShape)
10164 RaiseIfFailed("GetTolerance", self.MeasuOp)
10167 ## Obtain description of the given shape (number of sub-shapes of each type)
10168 # @param theShape Shape to be described.
10169 # @return Description of the given shape.
10171 # @ref tui_measurement_tools_page "Example"
10172 @ManageTransactions("MeasuOp")
10173 def WhatIs(self,theShape):
10175 Obtain description of the given shape (number of sub-shapes of each type)
10178 theShape Shape to be described.
10181 Description of the given shape.
10183 # Example: see GEOM_TestMeasures.py
10184 aDescr = self.MeasuOp.WhatIs(theShape)
10185 RaiseIfFailed("WhatIs", self.MeasuOp)
10188 ## Obtain quantity of shapes of the given type in \a theShape.
10189 # If \a theShape is of type \a theType, it is also counted.
10190 # @param theShape Shape to be described.
10191 # @param theType the given ShapeType().
10192 # @return Quantity of shapes of type \a theType in \a theShape.
10194 # @ref tui_measurement_tools_page "Example"
10195 def NbShapes (self, theShape, theType):
10197 Obtain quantity of shapes of the given type in theShape.
10198 If theShape is of type theType, it is also counted.
10201 theShape Shape to be described.
10202 theType the given geompy.ShapeType
10205 Quantity of shapes of type theType in theShape.
10207 # Example: see GEOM_TestMeasures.py
10208 listSh = self.SubShapeAllIDs(theShape, theType)
10212 ## Obtain quantity of shapes of each type in \a theShape.
10213 # The \a theShape is also counted.
10214 # @param theShape Shape to be described.
10215 # @return Dictionary of ShapeType() with bound quantities of shapes.
10217 # @ref tui_measurement_tools_page "Example"
10218 def ShapeInfo (self, theShape):
10220 Obtain quantity of shapes of each type in theShape.
10221 The theShape is also counted.
10224 theShape Shape to be described.
10227 Dictionary of geompy.ShapeType with bound quantities of shapes.
10229 # Example: see GEOM_TestMeasures.py
10231 for typeSh in self.ShapeType:
10232 if typeSh in ( "AUTO", "SHAPE" ): continue
10233 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10239 def GetCreationInformation(self, theShape):
10240 info = theShape.GetCreationInformation()
10242 opName = info.operationName
10243 if not opName: opName = "no info available"
10244 res = "Operation: " + opName
10246 for parVal in info.params:
10247 res += " \n %s = %s" % ( parVal.name, parVal.value )
10250 ## Get a point, situated at the centre of mass of theShape.
10251 # @param theShape Shape to define centre of mass of.
10252 # @param theName Object name; when specified, this parameter is used
10253 # for result publication in the study. Otherwise, if automatic
10254 # publication is switched on, default value is used for result name.
10256 # @return New GEOM.GEOM_Object, containing the created point.
10258 # @ref tui_measurement_tools_page "Example"
10259 @ManageTransactions("MeasuOp")
10260 def MakeCDG(self, theShape, theName=None):
10262 Get a point, situated at the centre of mass of theShape.
10265 theShape Shape to define centre of mass of.
10266 theName Object name; when specified, this parameter is used
10267 for result publication in the study. Otherwise, if automatic
10268 publication is switched on, default value is used for result name.
10271 New GEOM.GEOM_Object, containing the created point.
10273 # Example: see GEOM_TestMeasures.py
10274 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10275 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10276 self._autoPublish(anObj, theName, "centerOfMass")
10279 ## Get a vertex sub-shape by index depended with orientation.
10280 # @param theShape Shape to find sub-shape.
10281 # @param theIndex Index to find vertex by this index (starting from zero)
10282 # @param theName Object name; when specified, this parameter is used
10283 # for result publication in the study. Otherwise, if automatic
10284 # publication is switched on, default value is used for result name.
10286 # @return New GEOM.GEOM_Object, containing the created vertex.
10288 # @ref tui_measurement_tools_page "Example"
10289 @ManageTransactions("MeasuOp")
10290 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10292 Get a vertex sub-shape by index depended with orientation.
10295 theShape Shape to find sub-shape.
10296 theIndex Index to find vertex by this index (starting from zero)
10297 theName Object name; when specified, this parameter is used
10298 for result publication in the study. Otherwise, if automatic
10299 publication is switched on, default value is used for result name.
10302 New GEOM.GEOM_Object, containing the created vertex.
10304 # Example: see GEOM_TestMeasures.py
10305 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10306 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10307 self._autoPublish(anObj, theName, "vertex")
10310 ## Get the first vertex of wire/edge depended orientation.
10311 # @param theShape Shape to find first vertex.
10312 # @param theName Object name; when specified, this parameter is used
10313 # for result publication in the study. Otherwise, if automatic
10314 # publication is switched on, default value is used for result name.
10316 # @return New GEOM.GEOM_Object, containing the created vertex.
10318 # @ref tui_measurement_tools_page "Example"
10319 def GetFirstVertex(self, theShape, theName=None):
10321 Get the first vertex of wire/edge depended orientation.
10324 theShape Shape to find first vertex.
10325 theName Object name; when specified, this parameter is used
10326 for result publication in the study. Otherwise, if automatic
10327 publication is switched on, default value is used for result name.
10330 New GEOM.GEOM_Object, containing the created vertex.
10332 # Example: see GEOM_TestMeasures.py
10333 # note: auto-publishing is done in self.GetVertexByIndex()
10334 return self.GetVertexByIndex(theShape, 0, theName)
10336 ## Get the last vertex of wire/edge depended orientation.
10337 # @param theShape Shape to find last vertex.
10338 # @param theName Object name; when specified, this parameter is used
10339 # for result publication in the study. Otherwise, if automatic
10340 # publication is switched on, default value is used for result name.
10342 # @return New GEOM.GEOM_Object, containing the created vertex.
10344 # @ref tui_measurement_tools_page "Example"
10345 def GetLastVertex(self, theShape, theName=None):
10347 Get the last vertex of wire/edge depended orientation.
10350 theShape Shape to find last vertex.
10351 theName Object name; when specified, this parameter is used
10352 for result publication in the study. Otherwise, if automatic
10353 publication is switched on, default value is used for result name.
10356 New GEOM.GEOM_Object, containing the created vertex.
10358 # Example: see GEOM_TestMeasures.py
10359 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10360 # note: auto-publishing is done in self.GetVertexByIndex()
10361 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10363 ## Get a normale to the given face. If the point is not given,
10364 # the normale is calculated at the center of mass.
10365 # @param theFace Face to define normale of.
10366 # @param theOptionalPoint Point to compute the normale at.
10367 # @param theName Object name; when specified, this parameter is used
10368 # for result publication in the study. Otherwise, if automatic
10369 # publication is switched on, default value is used for result name.
10371 # @return New GEOM.GEOM_Object, containing the created vector.
10373 # @ref swig_todo "Example"
10374 @ManageTransactions("MeasuOp")
10375 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10377 Get a normale to the given face. If the point is not given,
10378 the normale is calculated at the center of mass.
10381 theFace Face to define normale of.
10382 theOptionalPoint Point to compute the normale at.
10383 theName Object name; when specified, this parameter is used
10384 for result publication in the study. Otherwise, if automatic
10385 publication is switched on, default value is used for result name.
10388 New GEOM.GEOM_Object, containing the created vector.
10390 # Example: see GEOM_TestMeasures.py
10391 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10392 RaiseIfFailed("GetNormal", self.MeasuOp)
10393 self._autoPublish(anObj, theName, "normal")
10396 ## Print shape errors obtained from CheckShape.
10397 # @param theShape Shape that was checked.
10398 # @param theShapeErrors the shape errors obtained by CheckShape.
10399 # @param theReturnStatus If 0 the description of problem is printed.
10400 # If 1 the description of problem is returned.
10401 # @return If theReturnStatus is equal to 1 the description is returned.
10402 # Otherwise doesn't return anything.
10404 # @ref tui_measurement_tools_page "Example"
10405 @ManageTransactions("MeasuOp")
10406 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10408 Print shape errors obtained from CheckShape.
10411 theShape Shape that was checked.
10412 theShapeErrors the shape errors obtained by CheckShape.
10413 theReturnStatus If 0 the description of problem is printed.
10414 If 1 the description of problem is returned.
10417 If theReturnStatus is equal to 1 the description is returned.
10418 Otherwise doesn't return anything.
10420 # Example: see GEOM_TestMeasures.py
10421 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10422 if theReturnStatus == 1:
10427 ## Check a topology of the given shape.
10428 # @param theShape Shape to check validity of.
10429 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10430 # if TRUE, the shape's geometry will be checked also.
10431 # @param theReturnStatus If 0 and if theShape is invalid, a description
10432 # of problem is printed.
10433 # If 1 isValid flag and the description of
10434 # problem is returned.
10435 # If 2 isValid flag and the list of error data
10437 # @return TRUE, if the shape "seems to be valid".
10438 # If theShape is invalid, prints a description of problem.
10439 # If theReturnStatus is equal to 1 the description is returned
10440 # along with IsValid flag.
10441 # If theReturnStatus is equal to 2 the list of error data is
10442 # returned along with IsValid flag.
10444 # @ref tui_measurement_tools_page "Example"
10445 @ManageTransactions("MeasuOp")
10446 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10448 Check a topology of the given shape.
10451 theShape Shape to check validity of.
10452 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10453 if TRUE, the shape's geometry will be checked also.
10454 theReturnStatus If 0 and if theShape is invalid, a description
10455 of problem is printed.
10456 If 1 IsValid flag and the description of
10457 problem is returned.
10458 If 2 IsValid flag and the list of error data
10462 TRUE, if the shape "seems to be valid".
10463 If theShape is invalid, prints a description of problem.
10464 If theReturnStatus is equal to 1 the description is returned
10465 along with IsValid flag.
10466 If theReturnStatus is equal to 2 the list of error data is
10467 returned along with IsValid flag.
10469 # Example: see GEOM_TestMeasures.py
10471 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10472 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10474 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10475 RaiseIfFailed("CheckShape", self.MeasuOp)
10477 if theReturnStatus == 0:
10478 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10480 if theReturnStatus == 1:
10481 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10482 return (IsValid, Descr)
10483 elif theReturnStatus == 2:
10484 return (IsValid, ShapeErrors)
10487 ## Detect self-intersections in the given shape.
10488 # @param theShape Shape to check.
10489 # @return TRUE, if the shape contains no self-intersections.
10491 # @ref tui_measurement_tools_page "Example"
10492 @ManageTransactions("MeasuOp")
10493 def CheckSelfIntersections(self, theShape):
10495 Detect self-intersections in the given shape.
10498 theShape Shape to check.
10501 TRUE, if the shape contains no self-intersections.
10503 # Example: see GEOM_TestMeasures.py
10504 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10505 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10508 ## Get position (LCS) of theShape.
10510 # Origin of the LCS is situated at the shape's center of mass.
10511 # Axes of the LCS are obtained from shape's location or,
10512 # if the shape is a planar face, from position of its plane.
10514 # @param theShape Shape to calculate position of.
10515 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10516 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10517 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10518 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10520 # @ref swig_todo "Example"
10521 @ManageTransactions("MeasuOp")
10522 def GetPosition(self,theShape):
10524 Get position (LCS) of theShape.
10525 Origin of the LCS is situated at the shape's center of mass.
10526 Axes of the LCS are obtained from shape's location or,
10527 if the shape is a planar face, from position of its plane.
10530 theShape Shape to calculate position of.
10533 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10534 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10535 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10536 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10538 # Example: see GEOM_TestMeasures.py
10539 aTuple = self.MeasuOp.GetPosition(theShape)
10540 RaiseIfFailed("GetPosition", self.MeasuOp)
10543 ## Get kind of theShape.
10545 # @param theShape Shape to get a kind of.
10546 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10547 # and a list of parameters, describing the shape.
10548 # @note Concrete meaning of each value, returned via \a theIntegers
10549 # or \a theDoubles list depends on the kind() of the shape.
10551 # @ref swig_todo "Example"
10552 @ManageTransactions("MeasuOp")
10553 def KindOfShape(self,theShape):
10555 Get kind of theShape.
10558 theShape Shape to get a kind of.
10561 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10562 and a list of parameters, describing the shape.
10564 Concrete meaning of each value, returned via theIntegers
10565 or theDoubles list depends on the geompy.kind of the shape
10567 # Example: see GEOM_TestMeasures.py
10568 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10569 RaiseIfFailed("KindOfShape", self.MeasuOp)
10571 aKind = aRoughTuple[0]
10572 anInts = aRoughTuple[1]
10573 aDbls = aRoughTuple[2]
10575 # Now there is no exception from this rule:
10576 aKindTuple = [aKind] + aDbls + anInts
10578 # If they are we will regroup parameters for such kind of shape.
10580 #if aKind == kind.SOME_KIND:
10581 # # SOME_KIND int int double int double double
10582 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10586 ## Returns the string that describes if the shell is good for solid.
10587 # This is a support method for MakeSolid.
10589 # @param theShell the shell to be checked.
10590 # @return Returns a string that describes the shell validity for
10591 # solid construction.
10592 @ManageTransactions("MeasuOp")
10593 def _IsGoodForSolid(self, theShell):
10595 Returns the string that describes if the shell is good for solid.
10596 This is a support method for MakeSolid.
10599 theShell the shell to be checked.
10602 Returns a string that describes the shell validity for
10603 solid construction.
10605 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10608 # end of l2_measure
10611 ## @addtogroup l2_import_export
10614 ## Import a shape from the BREP or IGES or STEP file
10615 # (depends on given format) with given name.
10616 # @param theFileName The file, containing the shape.
10617 # @param theFormatName Specify format for the file reading.
10618 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10619 # If format 'IGES_SCALE' is used instead of 'IGES' or
10620 # format 'STEP_SCALE' is used instead of 'STEP',
10621 # length unit will be set to 'meter' and result model will be scaled.
10622 # @param theName Object name; when specified, this parameter is used
10623 # for result publication in the study. Otherwise, if automatic
10624 # publication is switched on, default value is used for result name.
10626 # @return New GEOM.GEOM_Object, containing the imported shape.
10627 # If material names are imported it returns the list of
10628 # objects. The first one is the imported object followed by
10630 # @note Auto publishing is allowed for the shape itself. Imported
10631 # material groups are not automatically published.
10633 # @ref swig_Import_Export "Example"
10634 @ManageTransactions("InsertOp")
10635 def ImportFile(self, theFileName, theFormatName, theName=None):
10637 Import a shape from the BREP or IGES or STEP file
10638 (depends on given format) with given name.
10641 theFileName The file, containing the shape.
10642 theFormatName Specify format for the file reading.
10643 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10644 If format 'IGES_SCALE' is used instead of 'IGES' or
10645 format 'STEP_SCALE' is used instead of 'STEP',
10646 length unit will be set to 'meter' and result model will be scaled.
10647 theName Object name; when specified, this parameter is used
10648 for result publication in the study. Otherwise, if automatic
10649 publication is switched on, default value is used for result name.
10652 New GEOM.GEOM_Object, containing the imported shape.
10653 If material names are imported it returns the list of
10654 objects. The first one is the imported object followed by
10657 Auto publishing is allowed for the shape itself. Imported
10658 material groups are not automatically published.
10660 # Example: see GEOM_TestOthers.py
10661 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10662 RaiseIfFailed("ImportFile", self.InsertOp)
10663 aNbObj = len(aListObj)
10665 self._autoPublish(aListObj[0], theName, "imported")
10670 ## Deprecated analog of ImportFile()
10671 def Import(self, theFileName, theFormatName, theName=None):
10673 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10675 print "WARNING: Function Import is deprecated, use ImportFile instead"
10676 # note: auto-publishing is done in self.ImportFile()
10677 return self.ImportFile(theFileName, theFormatName, theName)
10679 ## Shortcut to ImportFile() for BREP format.
10680 # Import a shape from the BREP file with given name.
10681 # @param theFileName The file, containing the shape.
10682 # @param theName Object name; when specified, this parameter is used
10683 # for result publication in the study. Otherwise, if automatic
10684 # publication is switched on, default value is used for result name.
10686 # @return New GEOM.GEOM_Object, containing the imported shape.
10688 # @ref swig_Import_Export "Example"
10689 def ImportBREP(self, theFileName, theName=None):
10691 geompy.ImportFile(...) function for BREP format
10692 Import a shape from the BREP file with given name.
10695 theFileName The file, containing the shape.
10696 theName Object name; when specified, this parameter is used
10697 for result publication in the study. Otherwise, if automatic
10698 publication is switched on, default value is used for result name.
10701 New GEOM.GEOM_Object, containing the imported shape.
10703 # Example: see GEOM_TestOthers.py
10704 # note: auto-publishing is done in self.ImportFile()
10705 return self.ImportFile(theFileName, "BREP", theName)
10707 ## Shortcut to ImportFile() for IGES format
10708 # Import a shape from the IGES file with given name.
10709 # @param theFileName The file, containing the shape.
10710 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10711 # and result model will be scaled, if its units are not meters.
10712 # If False (default), file length units will be taken into account.
10713 # @param theName Object name; when specified, this parameter is used
10714 # for result publication in the study. Otherwise, if automatic
10715 # publication is switched on, default value is used for result name.
10717 # @return New GEOM.GEOM_Object, containing the imported shape.
10719 # @ref swig_Import_Export "Example"
10720 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10722 geompy.ImportFile(...) function for IGES format
10725 theFileName The file, containing the shape.
10726 ignoreUnits If True, file length units will be ignored (set to 'meter')
10727 and result model will be scaled, if its units are not meters.
10728 If False (default), file length units will be taken into account.
10729 theName Object name; when specified, this parameter is used
10730 for result publication in the study. Otherwise, if automatic
10731 publication is switched on, default value is used for result name.
10734 New GEOM.GEOM_Object, containing the imported shape.
10736 # Example: see GEOM_TestOthers.py
10737 # note: auto-publishing is done in self.ImportFile()
10739 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10740 return self.ImportFile(theFileName, "IGES", theName)
10742 ## Return length unit from given IGES file
10743 # @param theFileName The file, containing the shape.
10744 # @return String, containing the units name.
10746 # @ref swig_Import_Export "Example"
10747 @ManageTransactions("InsertOp")
10748 def GetIGESUnit(self, theFileName):
10750 Return length units from given IGES file
10753 theFileName The file, containing the shape.
10756 String, containing the units name.
10758 # Example: see GEOM_TestOthers.py
10759 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10762 ## Shortcut to ImportFile() for STEP format
10763 # Import a shape from the STEP file with given name.
10764 # @param theFileName The file, containing the shape.
10765 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10766 # and result model will be scaled, if its units are not meters.
10767 # If False (default), file length units will be taken into account.
10768 # @param theName Object name; when specified, this parameter is used
10769 # for result publication in the study. Otherwise, if automatic
10770 # publication is switched on, default value is used for result name.
10772 # @return New GEOM.GEOM_Object, containing the imported shape.
10773 # If material names are imported it returns the list of
10774 # objects. The first one is the imported object followed by
10776 # @note Auto publishing is allowed for the shape itself. Imported
10777 # material groups are not automatically published.
10779 # @ref swig_Import_Export "Example"
10780 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10782 geompy.ImportFile(...) function for STEP format
10785 theFileName The file, containing the shape.
10786 ignoreUnits If True, file length units will be ignored (set to 'meter')
10787 and result model will be scaled, if its units are not meters.
10788 If False (default), file length units will be taken into account.
10789 theName Object name; when specified, this parameter is used
10790 for result publication in the study. Otherwise, if automatic
10791 publication is switched on, default value is used for result name.
10794 New GEOM.GEOM_Object, containing the imported shape.
10795 If material names are imported it returns the list of
10796 objects. The first one is the imported object followed by
10799 Auto publishing is allowed for the shape itself. Imported
10800 material groups are not automatically published.
10802 # Example: see GEOM_TestOthers.py
10803 # note: auto-publishing is done in self.ImportFile()
10805 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10806 return self.ImportFile(theFileName, "STEP", theName)
10808 ## Return length unit from given IGES or STEP file
10809 # @param theFileName The file, containing the shape.
10810 # @return String, containing the units name.
10812 # @ref swig_Import_Export "Example"
10813 @ManageTransactions("InsertOp")
10814 def GetSTEPUnit(self, theFileName):
10816 Return length units from given STEP file
10819 theFileName The file, containing the shape.
10822 String, containing the units name.
10824 # Example: see GEOM_TestOthers.py
10825 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10828 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10829 # @note This method will not be dumped to the python script by DumpStudy functionality.
10830 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10831 # @param theStream The BRep binary stream.
10832 # @param theName Object name; when specified, this parameter is used
10833 # for result publication in the study. Otherwise, if automatic
10834 # publication is switched on, default value is used for result name.
10836 # @return New GEOM_Object, containing the shape, read from theStream.
10838 # @ref swig_Import_Export "Example"
10839 @ManageTransactions("InsertOp")
10840 def RestoreShape (self, theStream, theName=None):
10842 Read a shape from the binary stream, containing its bounding representation (BRep).
10845 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10848 theStream The BRep binary stream.
10849 theName Object name; when specified, this parameter is used
10850 for result publication in the study. Otherwise, if automatic
10851 publication is switched on, default value is used for result name.
10854 New GEOM_Object, containing the shape, read from theStream.
10856 # Example: see GEOM_TestOthers.py
10857 anObj = self.InsertOp.RestoreShape(theStream)
10858 RaiseIfFailed("RestoreShape", self.InsertOp)
10859 self._autoPublish(anObj, theName, "restored")
10862 ## Export the given shape into a file with given name.
10863 # @param theObject Shape to be stored in the file.
10864 # @param theFileName Name of the file to store the given shape in.
10865 # @param theFormatName Specify format for the shape storage.
10866 # Available formats can be obtained with
10867 # geompy.InsertOp.ExportTranslators()[0] method.
10869 # @ref swig_Import_Export "Example"
10870 @ManageTransactions("InsertOp")
10871 def Export(self, theObject, theFileName, theFormatName):
10873 Export the given shape into a file with given name.
10876 theObject Shape to be stored in the file.
10877 theFileName Name of the file to store the given shape in.
10878 theFormatName Specify format for the shape storage.
10879 Available formats can be obtained with
10880 geompy.InsertOp.ExportTranslators()[0] method.
10882 # Example: see GEOM_TestOthers.py
10883 self.InsertOp.Export(theObject, theFileName, theFormatName)
10884 if self.InsertOp.IsDone() == 0:
10885 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10889 ## Shortcut to Export() for BREP format
10891 # @ref swig_Import_Export "Example"
10892 def ExportBREP(self,theObject, theFileName):
10894 geompy.Export(...) function for BREP format
10896 # Example: see GEOM_TestOthers.py
10897 return self.Export(theObject, theFileName, "BREP")
10899 ## Shortcut to Export() for IGES format
10901 # @ref swig_Import_Export "Example"
10902 def ExportIGES(self,theObject, theFileName):
10904 geompy.Export(...) function for IGES format
10906 # Example: see GEOM_TestOthers.py
10907 return self.Export(theObject, theFileName, "IGES")
10909 ## Shortcut to Export() for STEP format
10911 # @ref swig_Import_Export "Example"
10912 def ExportSTEP(self,theObject, theFileName):
10914 geompy.Export(...) function for STEP format
10916 # Example: see GEOM_TestOthers.py
10917 return self.Export(theObject, theFileName, "STEP")
10919 # end of l2_import_export
10922 ## @addtogroup l3_blocks
10925 ## Create a quadrangle face from four edges. Order of Edges is not
10926 # important. It is not necessary that edges share the same vertex.
10927 # @param E1,E2,E3,E4 Edges for the face bound.
10928 # @param theName Object name; when specified, this parameter is used
10929 # for result publication in the study. Otherwise, if automatic
10930 # publication is switched on, default value is used for result name.
10932 # @return New GEOM.GEOM_Object, containing the created face.
10934 # @ref tui_building_by_blocks_page "Example"
10935 @ManageTransactions("BlocksOp")
10936 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10938 Create a quadrangle face from four edges. Order of Edges is not
10939 important. It is not necessary that edges share the same vertex.
10942 E1,E2,E3,E4 Edges for the face bound.
10943 theName Object name; when specified, this parameter is used
10944 for result publication in the study. Otherwise, if automatic
10945 publication is switched on, default value is used for result name.
10948 New GEOM.GEOM_Object, containing the created face.
10951 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10953 # Example: see GEOM_Spanner.py
10954 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10955 RaiseIfFailed("MakeQuad", self.BlocksOp)
10956 self._autoPublish(anObj, theName, "quad")
10959 ## Create a quadrangle face on two edges.
10960 # The missing edges will be built by creating the shortest ones.
10961 # @param E1,E2 Two opposite edges for the face.
10962 # @param theName Object name; when specified, this parameter is used
10963 # for result publication in the study. Otherwise, if automatic
10964 # publication is switched on, default value is used for result name.
10966 # @return New GEOM.GEOM_Object, containing the created face.
10968 # @ref tui_building_by_blocks_page "Example"
10969 @ManageTransactions("BlocksOp")
10970 def MakeQuad2Edges(self, E1, E2, theName=None):
10972 Create a quadrangle face on two edges.
10973 The missing edges will be built by creating the shortest ones.
10976 E1,E2 Two opposite edges for the face.
10977 theName Object name; when specified, this parameter is used
10978 for result publication in the study. Otherwise, if automatic
10979 publication is switched on, default value is used for result name.
10982 New GEOM.GEOM_Object, containing the created face.
10986 p1 = geompy.MakeVertex( 0., 0., 0.)
10987 p2 = geompy.MakeVertex(150., 30., 0.)
10988 p3 = geompy.MakeVertex( 0., 120., 50.)
10989 p4 = geompy.MakeVertex( 0., 40., 70.)
10991 edge1 = geompy.MakeEdge(p1, p2)
10992 edge2 = geompy.MakeEdge(p3, p4)
10993 # create a quadrangle face from two edges
10994 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10996 # Example: see GEOM_Spanner.py
10997 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10998 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10999 self._autoPublish(anObj, theName, "quad")
11002 ## Create a quadrangle face with specified corners.
11003 # The missing edges will be built by creating the shortest ones.
11004 # @param V1,V2,V3,V4 Corner vertices for the face.
11005 # @param theName Object name; when specified, this parameter is used
11006 # for result publication in the study. Otherwise, if automatic
11007 # publication is switched on, default value is used for result name.
11009 # @return New GEOM.GEOM_Object, containing the created face.
11011 # @ref tui_building_by_blocks_page "Example 1"
11012 # \n @ref swig_MakeQuad4Vertices "Example 2"
11013 @ManageTransactions("BlocksOp")
11014 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11016 Create a quadrangle face with specified corners.
11017 The missing edges will be built by creating the shortest ones.
11020 V1,V2,V3,V4 Corner vertices for the face.
11021 theName Object name; when specified, this parameter is used
11022 for result publication in the study. Otherwise, if automatic
11023 publication is switched on, default value is used for result name.
11026 New GEOM.GEOM_Object, containing the created face.
11030 p1 = geompy.MakeVertex( 0., 0., 0.)
11031 p2 = geompy.MakeVertex(150., 30., 0.)
11032 p3 = geompy.MakeVertex( 0., 120., 50.)
11033 p4 = geompy.MakeVertex( 0., 40., 70.)
11034 # create a quadrangle from four points in its corners
11035 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11037 # Example: see GEOM_Spanner.py
11038 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11039 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11040 self._autoPublish(anObj, theName, "quad")
11043 ## Create a hexahedral solid, bounded by the six given faces. Order of
11044 # faces is not important. It is not necessary that Faces share the same edge.
11045 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11046 # @param theName Object name; when specified, this parameter is used
11047 # for result publication in the study. Otherwise, if automatic
11048 # publication is switched on, default value is used for result name.
11050 # @return New GEOM.GEOM_Object, containing the created solid.
11052 # @ref tui_building_by_blocks_page "Example 1"
11053 # \n @ref swig_MakeHexa "Example 2"
11054 @ManageTransactions("BlocksOp")
11055 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11057 Create a hexahedral solid, bounded by the six given faces. Order of
11058 faces is not important. It is not necessary that Faces share the same edge.
11061 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11062 theName Object name; when specified, this parameter is used
11063 for result publication in the study. Otherwise, if automatic
11064 publication is switched on, default value is used for result name.
11067 New GEOM.GEOM_Object, containing the created solid.
11070 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11072 # Example: see GEOM_Spanner.py
11073 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11074 RaiseIfFailed("MakeHexa", self.BlocksOp)
11075 self._autoPublish(anObj, theName, "hexa")
11078 ## Create a hexahedral solid between two given faces.
11079 # The missing faces will be built by creating the smallest ones.
11080 # @param F1,F2 Two opposite faces for the hexahedral solid.
11081 # @param theName Object name; when specified, this parameter is used
11082 # for result publication in the study. Otherwise, if automatic
11083 # publication is switched on, default value is used for result name.
11085 # @return New GEOM.GEOM_Object, containing the created solid.
11087 # @ref tui_building_by_blocks_page "Example 1"
11088 # \n @ref swig_MakeHexa2Faces "Example 2"
11089 @ManageTransactions("BlocksOp")
11090 def MakeHexa2Faces(self, F1, F2, theName=None):
11092 Create a hexahedral solid between two given faces.
11093 The missing faces will be built by creating the smallest ones.
11096 F1,F2 Two opposite faces for the hexahedral solid.
11097 theName Object name; when specified, this parameter is used
11098 for result publication in the study. Otherwise, if automatic
11099 publication is switched on, default value is used for result name.
11102 New GEOM.GEOM_Object, containing the created solid.
11105 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11107 # Example: see GEOM_Spanner.py
11108 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11109 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11110 self._autoPublish(anObj, theName, "hexa")
11116 ## @addtogroup l3_blocks_op
11119 ## Get a vertex, found in the given shape by its coordinates.
11120 # @param theShape Block or a compound of blocks.
11121 # @param theX,theY,theZ Coordinates of the sought vertex.
11122 # @param theEpsilon Maximum allowed distance between the resulting
11123 # vertex and point with the given coordinates.
11124 # @param theName Object name; when specified, this parameter is used
11125 # for result publication in the study. Otherwise, if automatic
11126 # publication is switched on, default value is used for result name.
11128 # @return New GEOM.GEOM_Object, containing the found vertex.
11130 # @ref swig_GetPoint "Example"
11131 @ManageTransactions("BlocksOp")
11132 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11134 Get a vertex, found in the given shape by its coordinates.
11137 theShape Block or a compound of blocks.
11138 theX,theY,theZ Coordinates of the sought vertex.
11139 theEpsilon Maximum allowed distance between the resulting
11140 vertex and point with the given coordinates.
11141 theName Object name; when specified, this parameter is used
11142 for result publication in the study. Otherwise, if automatic
11143 publication is switched on, default value is used for result name.
11146 New GEOM.GEOM_Object, containing the found vertex.
11149 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11151 # Example: see GEOM_TestOthers.py
11152 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11153 RaiseIfFailed("GetPoint", self.BlocksOp)
11154 self._autoPublish(anObj, theName, "vertex")
11157 ## Find a vertex of the given shape, which has minimal distance to the given point.
11158 # @param theShape Any shape.
11159 # @param thePoint Point, close to the desired vertex.
11160 # @param theName Object name; when specified, this parameter is used
11161 # for result publication in the study. Otherwise, if automatic
11162 # publication is switched on, default value is used for result name.
11164 # @return New GEOM.GEOM_Object, containing the found vertex.
11166 # @ref swig_GetVertexNearPoint "Example"
11167 @ManageTransactions("BlocksOp")
11168 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11170 Find a vertex of the given shape, which has minimal distance to the given point.
11173 theShape Any shape.
11174 thePoint Point, close to the desired vertex.
11175 theName Object name; when specified, this parameter is used
11176 for result publication in the study. Otherwise, if automatic
11177 publication is switched on, default value is used for result name.
11180 New GEOM.GEOM_Object, containing the found vertex.
11183 pmidle = geompy.MakeVertex(50, 0, 50)
11184 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11186 # Example: see GEOM_TestOthers.py
11187 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11188 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11189 self._autoPublish(anObj, theName, "vertex")
11192 ## Get an edge, found in the given shape by two given vertices.
11193 # @param theShape Block or a compound of blocks.
11194 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11195 # @param theName Object name; when specified, this parameter is used
11196 # for result publication in the study. Otherwise, if automatic
11197 # publication is switched on, default value is used for result name.
11199 # @return New GEOM.GEOM_Object, containing the found edge.
11201 # @ref swig_GetEdge "Example"
11202 @ManageTransactions("BlocksOp")
11203 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11205 Get an edge, found in the given shape by two given vertices.
11208 theShape Block or a compound of blocks.
11209 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11210 theName Object name; when specified, this parameter is used
11211 for result publication in the study. Otherwise, if automatic
11212 publication is switched on, default value is used for result name.
11215 New GEOM.GEOM_Object, containing the found edge.
11217 # Example: see GEOM_Spanner.py
11218 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11219 RaiseIfFailed("GetEdge", self.BlocksOp)
11220 self._autoPublish(anObj, theName, "edge")
11223 ## Find an edge of the given shape, which has minimal distance to the given point.
11224 # @param theShape Block or a compound of blocks.
11225 # @param thePoint Point, close to the desired edge.
11226 # @param theName Object name; when specified, this parameter is used
11227 # for result publication in the study. Otherwise, if automatic
11228 # publication is switched on, default value is used for result name.
11230 # @return New GEOM.GEOM_Object, containing the found edge.
11232 # @ref swig_GetEdgeNearPoint "Example"
11233 @ManageTransactions("BlocksOp")
11234 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11236 Find an edge of the given shape, which has minimal distance to the given point.
11239 theShape Block or a compound of blocks.
11240 thePoint Point, close to the desired edge.
11241 theName Object name; when specified, this parameter is used
11242 for result publication in the study. Otherwise, if automatic
11243 publication is switched on, default value is used for result name.
11246 New GEOM.GEOM_Object, containing the found edge.
11248 # Example: see GEOM_TestOthers.py
11249 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11250 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11251 self._autoPublish(anObj, theName, "edge")
11254 ## Returns a face, found in the given shape by four given corner vertices.
11255 # @param theShape Block or a compound of blocks.
11256 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11257 # @param theName Object name; when specified, this parameter is used
11258 # for result publication in the study. Otherwise, if automatic
11259 # publication is switched on, default value is used for result name.
11261 # @return New GEOM.GEOM_Object, containing the found face.
11263 # @ref swig_todo "Example"
11264 @ManageTransactions("BlocksOp")
11265 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11267 Returns a face, found in the given shape by four given corner vertices.
11270 theShape Block or a compound of blocks.
11271 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11272 theName Object name; when specified, this parameter is used
11273 for result publication in the study. Otherwise, if automatic
11274 publication is switched on, default value is used for result name.
11277 New GEOM.GEOM_Object, containing the found face.
11279 # Example: see GEOM_Spanner.py
11280 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11281 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11282 self._autoPublish(anObj, theName, "face")
11285 ## Get a face of block, found in the given shape by two given edges.
11286 # @param theShape Block or a compound of blocks.
11287 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11288 # @param theName Object name; when specified, this parameter is used
11289 # for result publication in the study. Otherwise, if automatic
11290 # publication is switched on, default value is used for result name.
11292 # @return New GEOM.GEOM_Object, containing the found face.
11294 # @ref swig_todo "Example"
11295 @ManageTransactions("BlocksOp")
11296 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11298 Get a face of block, found in the given shape by two given edges.
11301 theShape Block or a compound of blocks.
11302 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11303 theName Object name; when specified, this parameter is used
11304 for result publication in the study. Otherwise, if automatic
11305 publication is switched on, default value is used for result name.
11308 New GEOM.GEOM_Object, containing the found face.
11310 # Example: see GEOM_Spanner.py
11311 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11312 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11313 self._autoPublish(anObj, theName, "face")
11316 ## Find a face, opposite to the given one in the given block.
11317 # @param theBlock Must be a hexahedral solid.
11318 # @param theFace Face of \a theBlock, opposite to the desired face.
11319 # @param theName Object name; when specified, this parameter is used
11320 # for result publication in the study. Otherwise, if automatic
11321 # publication is switched on, default value is used for result name.
11323 # @return New GEOM.GEOM_Object, containing the found face.
11325 # @ref swig_GetOppositeFace "Example"
11326 @ManageTransactions("BlocksOp")
11327 def GetOppositeFace(self, theBlock, theFace, theName=None):
11329 Find a face, opposite to the given one in the given block.
11332 theBlock Must be a hexahedral solid.
11333 theFace Face of theBlock, opposite to the desired face.
11334 theName Object name; when specified, this parameter is used
11335 for result publication in the study. Otherwise, if automatic
11336 publication is switched on, default value is used for result name.
11339 New GEOM.GEOM_Object, containing the found face.
11341 # Example: see GEOM_Spanner.py
11342 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11343 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11344 self._autoPublish(anObj, theName, "face")
11347 ## Find a face of the given shape, which has minimal distance to the given point.
11348 # @param theShape Block or a compound of blocks.
11349 # @param thePoint Point, close to the desired face.
11350 # @param theName Object name; when specified, this parameter is used
11351 # for result publication in the study. Otherwise, if automatic
11352 # publication is switched on, default value is used for result name.
11354 # @return New GEOM.GEOM_Object, containing the found face.
11356 # @ref swig_GetFaceNearPoint "Example"
11357 @ManageTransactions("BlocksOp")
11358 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11360 Find a face of the given shape, which has minimal distance to the given point.
11363 theShape Block or a compound of blocks.
11364 thePoint Point, close to the desired face.
11365 theName Object name; when specified, this parameter is used
11366 for result publication in the study. Otherwise, if automatic
11367 publication is switched on, default value is used for result name.
11370 New GEOM.GEOM_Object, containing the found face.
11372 # Example: see GEOM_Spanner.py
11373 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11374 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11375 self._autoPublish(anObj, theName, "face")
11378 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11379 # @param theBlock Block or a compound of blocks.
11380 # @param theVector Vector, close to the normale of the desired face.
11381 # @param theName Object name; when specified, this parameter is used
11382 # for result publication in the study. Otherwise, if automatic
11383 # publication is switched on, default value is used for result name.
11385 # @return New GEOM.GEOM_Object, containing the found face.
11387 # @ref swig_todo "Example"
11388 @ManageTransactions("BlocksOp")
11389 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11391 Find a face of block, whose outside normale has minimal angle with the given vector.
11394 theBlock Block or a compound of blocks.
11395 theVector Vector, close to the normale of the desired face.
11396 theName Object name; when specified, this parameter is used
11397 for result publication in the study. Otherwise, if automatic
11398 publication is switched on, default value is used for result name.
11401 New GEOM.GEOM_Object, containing the found face.
11403 # Example: see GEOM_Spanner.py
11404 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11405 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11406 self._autoPublish(anObj, theName, "face")
11409 ## Find all sub-shapes of type \a theShapeType of the given shape,
11410 # which have minimal distance to the given point.
11411 # @param theShape Any shape.
11412 # @param thePoint Point, close to the desired shape.
11413 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11414 # @param theTolerance The tolerance for distances comparison. All shapes
11415 # with distances to the given point in interval
11416 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11417 # @param theName Object name; when specified, this parameter is used
11418 # for result publication in the study. Otherwise, if automatic
11419 # publication is switched on, default value is used for result name.
11421 # @return New GEOM_Object, containing a group of all found shapes.
11423 # @ref swig_GetShapesNearPoint "Example"
11424 @ManageTransactions("BlocksOp")
11425 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11427 Find all sub-shapes of type theShapeType of the given shape,
11428 which have minimal distance to the given point.
11431 theShape Any shape.
11432 thePoint Point, close to the desired shape.
11433 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11434 theTolerance The tolerance for distances comparison. All shapes
11435 with distances to the given point in interval
11436 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11437 theName Object name; when specified, this parameter is used
11438 for result publication in the study. Otherwise, if automatic
11439 publication is switched on, default value is used for result name.
11442 New GEOM_Object, containing a group of all found shapes.
11444 # Example: see GEOM_TestOthers.py
11445 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11446 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11447 self._autoPublish(anObj, theName, "group")
11450 # end of l3_blocks_op
11453 ## @addtogroup l4_blocks_measure
11456 ## Check, if the compound of blocks is given.
11457 # To be considered as a compound of blocks, the
11458 # given shape must satisfy the following conditions:
11459 # - Each element of the compound should be a Block (6 faces and 12 edges).
11460 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11461 # - The compound should be connexe.
11462 # - The glue between two quadrangle faces should be applied.
11463 # @param theCompound The compound to check.
11464 # @return TRUE, if the given shape is a compound of blocks.
11465 # If theCompound is not valid, prints all discovered errors.
11467 # @ref tui_measurement_tools_page "Example 1"
11468 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11469 @ManageTransactions("BlocksOp")
11470 def CheckCompoundOfBlocks(self,theCompound):
11472 Check, if the compound of blocks is given.
11473 To be considered as a compound of blocks, the
11474 given shape must satisfy the following conditions:
11475 - Each element of the compound should be a Block (6 faces and 12 edges).
11476 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11477 - The compound should be connexe.
11478 - The glue between two quadrangle faces should be applied.
11481 theCompound The compound to check.
11484 TRUE, if the given shape is a compound of blocks.
11485 If theCompound is not valid, prints all discovered errors.
11487 # Example: see GEOM_Spanner.py
11488 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11489 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11491 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11495 ## Retrieve all non blocks solids and faces from \a theShape.
11496 # @param theShape The shape to explore.
11497 # @param theName Object name; when specified, this parameter is used
11498 # for result publication in the study. Otherwise, if automatic
11499 # publication is switched on, default value is used for result name.
11501 # @return A tuple of two GEOM_Objects. The first object is a group of all
11502 # non block solids (= not 6 faces, or with 6 faces, but with the
11503 # presence of non-quadrangular faces). The second object is a
11504 # group of all non quadrangular faces.
11506 # @ref tui_measurement_tools_page "Example 1"
11507 # \n @ref swig_GetNonBlocks "Example 2"
11508 @ManageTransactions("BlocksOp")
11509 def GetNonBlocks (self, theShape, theName=None):
11511 Retrieve all non blocks solids and faces from theShape.
11514 theShape The shape to explore.
11515 theName Object name; when specified, this parameter is used
11516 for result publication in the study. Otherwise, if automatic
11517 publication is switched on, default value is used for result name.
11520 A tuple of two GEOM_Objects. The first object is a group of all
11521 non block solids (= not 6 faces, or with 6 faces, but with the
11522 presence of non-quadrangular faces). The second object is a
11523 group of all non quadrangular faces.
11526 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11528 # Example: see GEOM_Spanner.py
11529 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11530 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11531 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11534 ## Remove all seam and degenerated edges from \a theShape.
11535 # Unite faces and edges, sharing one surface. It means that
11536 # this faces must have references to one C++ surface object (handle).
11537 # @param theShape The compound or single solid to remove irregular edges from.
11538 # @param doUnionFaces If True, then unite faces. If False (the default value),
11539 # do not unite faces.
11540 # @param theName Object name; when specified, this parameter is used
11541 # for result publication in the study. Otherwise, if automatic
11542 # publication is switched on, default value is used for result name.
11544 # @return Improved shape.
11546 # @ref swig_RemoveExtraEdges "Example"
11547 @ManageTransactions("BlocksOp")
11548 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11550 Remove all seam and degenerated edges from theShape.
11551 Unite faces and edges, sharing one surface. It means that
11552 this faces must have references to one C++ surface object (handle).
11555 theShape The compound or single solid to remove irregular edges from.
11556 doUnionFaces If True, then unite faces. If False (the default value),
11557 do not unite faces.
11558 theName Object name; when specified, this parameter is used
11559 for result publication in the study. Otherwise, if automatic
11560 publication is switched on, default value is used for result name.
11565 # Example: see GEOM_TestOthers.py
11566 nbFacesOptimum = -1 # -1 means do not unite faces
11567 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11568 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11569 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11570 self._autoPublish(anObj, theName, "removeExtraEdges")
11573 ## Performs union faces of \a theShape
11574 # Unite faces sharing one surface. It means that
11575 # these faces must have references to one C++ surface object (handle).
11576 # @param theShape The compound or single solid that contains faces
11577 # to perform union.
11578 # @param theName Object name; when specified, this parameter is used
11579 # for result publication in the study. Otherwise, if automatic
11580 # publication is switched on, default value is used for result name.
11582 # @return Improved shape.
11584 # @ref swig_UnionFaces "Example"
11585 @ManageTransactions("BlocksOp")
11586 def UnionFaces(self, theShape, theName=None):
11588 Performs union faces of theShape.
11589 Unite faces sharing one surface. It means that
11590 these faces must have references to one C++ surface object (handle).
11593 theShape The compound or single solid that contains faces
11595 theName Object name; when specified, this parameter is used
11596 for result publication in the study. Otherwise, if automatic
11597 publication is switched on, default value is used for result name.
11602 # Example: see GEOM_TestOthers.py
11603 anObj = self.BlocksOp.UnionFaces(theShape)
11604 RaiseIfFailed("UnionFaces", self.BlocksOp)
11605 self._autoPublish(anObj, theName, "unionFaces")
11608 ## Check, if the given shape is a blocks compound.
11609 # Fix all detected errors.
11610 # \note Single block can be also fixed by this method.
11611 # @param theShape The compound to check and improve.
11612 # @param theName Object name; when specified, this parameter is used
11613 # for result publication in the study. Otherwise, if automatic
11614 # publication is switched on, default value is used for result name.
11616 # @return Improved compound.
11618 # @ref swig_CheckAndImprove "Example"
11619 @ManageTransactions("BlocksOp")
11620 def CheckAndImprove(self, theShape, theName=None):
11622 Check, if the given shape is a blocks compound.
11623 Fix all detected errors.
11626 Single block can be also fixed by this method.
11629 theShape The compound to check and improve.
11630 theName Object name; when specified, this parameter is used
11631 for result publication in the study. Otherwise, if automatic
11632 publication is switched on, default value is used for result name.
11637 # Example: see GEOM_TestOthers.py
11638 anObj = self.BlocksOp.CheckAndImprove(theShape)
11639 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11640 self._autoPublish(anObj, theName, "improved")
11643 # end of l4_blocks_measure
11646 ## @addtogroup l3_blocks_op
11649 ## Get all the blocks, contained in the given compound.
11650 # @param theCompound The compound to explode.
11651 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11652 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11653 # @param theName Object name; when specified, this parameter is used
11654 # for result publication in the study. Otherwise, if automatic
11655 # publication is switched on, default value is used for result name.
11657 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11659 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11661 # @ref tui_explode_on_blocks "Example 1"
11662 # \n @ref swig_MakeBlockExplode "Example 2"
11663 @ManageTransactions("BlocksOp")
11664 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11666 Get all the blocks, contained in the given compound.
11669 theCompound The compound to explode.
11670 theMinNbFaces If solid has lower number of faces, it is not a block.
11671 theMaxNbFaces If solid has higher number of faces, it is not a block.
11672 theName Object name; when specified, this parameter is used
11673 for result publication in the study. Otherwise, if automatic
11674 publication is switched on, default value is used for result name.
11677 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11680 List of GEOM.GEOM_Object, containing the retrieved blocks.
11682 # Example: see GEOM_TestOthers.py
11683 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11684 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11685 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11686 for anObj in aList:
11687 anObj.SetParameters(Parameters)
11689 self._autoPublish(aList, theName, "block")
11692 ## Find block, containing the given point inside its volume or on boundary.
11693 # @param theCompound Compound, to find block in.
11694 # @param thePoint Point, close to the desired block. If the point lays on
11695 # boundary between some blocks, we return block with nearest center.
11696 # @param theName Object name; when specified, this parameter is used
11697 # for result publication in the study. Otherwise, if automatic
11698 # publication is switched on, default value is used for result name.
11700 # @return New GEOM.GEOM_Object, containing the found block.
11702 # @ref swig_todo "Example"
11703 @ManageTransactions("BlocksOp")
11704 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11706 Find block, containing the given point inside its volume or on boundary.
11709 theCompound Compound, to find block in.
11710 thePoint Point, close to the desired block. If the point lays on
11711 boundary between some blocks, we return block with nearest center.
11712 theName Object name; when specified, this parameter is used
11713 for result publication in the study. Otherwise, if automatic
11714 publication is switched on, default value is used for result name.
11717 New GEOM.GEOM_Object, containing the found block.
11719 # Example: see GEOM_Spanner.py
11720 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11721 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11722 self._autoPublish(anObj, theName, "block")
11725 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11726 # @param theCompound Compound, to find block in.
11727 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11728 # @param theName Object name; when specified, this parameter is used
11729 # for result publication in the study. Otherwise, if automatic
11730 # publication is switched on, default value is used for result name.
11732 # @return New GEOM.GEOM_Object, containing the found block.
11734 # @ref swig_GetBlockByParts "Example"
11735 @ManageTransactions("BlocksOp")
11736 def GetBlockByParts(self, theCompound, theParts, theName=None):
11738 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11741 theCompound Compound, to find block in.
11742 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11743 theName Object name; when specified, this parameter is used
11744 for result publication in the study. Otherwise, if automatic
11745 publication is switched on, default value is used for result name.
11748 New GEOM_Object, containing the found block.
11750 # Example: see GEOM_TestOthers.py
11751 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11752 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11753 self._autoPublish(anObj, theName, "block")
11756 ## Return all blocks, containing all the elements, passed as the parts.
11757 # @param theCompound Compound, to find blocks in.
11758 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11759 # @param theName Object name; when specified, this parameter is used
11760 # for result publication in the study. Otherwise, if automatic
11761 # publication is switched on, default value is used for result name.
11763 # @return List of GEOM.GEOM_Object, containing the found blocks.
11765 # @ref swig_todo "Example"
11766 @ManageTransactions("BlocksOp")
11767 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11769 Return all blocks, containing all the elements, passed as the parts.
11772 theCompound Compound, to find blocks in.
11773 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11774 theName Object name; when specified, this parameter is used
11775 for result publication in the study. Otherwise, if automatic
11776 publication is switched on, default value is used for result name.
11779 List of GEOM.GEOM_Object, containing the found blocks.
11781 # Example: see GEOM_Spanner.py
11782 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11783 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11784 self._autoPublish(aList, theName, "block")
11787 ## Multi-transformate block and glue the result.
11788 # Transformation is defined so, as to superpose direction faces.
11789 # @param Block Hexahedral solid to be multi-transformed.
11790 # @param DirFace1 ID of First direction face.
11791 # @param DirFace2 ID of Second direction face.
11792 # @param NbTimes Quantity of transformations to be done.
11793 # @param theName Object name; when specified, this parameter is used
11794 # for result publication in the study. Otherwise, if automatic
11795 # publication is switched on, default value is used for result name.
11797 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11799 # @return New GEOM.GEOM_Object, containing the result shape.
11801 # @ref tui_multi_transformation "Example"
11802 @ManageTransactions("BlocksOp")
11803 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11805 Multi-transformate block and glue the result.
11806 Transformation is defined so, as to superpose direction faces.
11809 Block Hexahedral solid to be multi-transformed.
11810 DirFace1 ID of First direction face.
11811 DirFace2 ID of Second direction face.
11812 NbTimes Quantity of transformations to be done.
11813 theName Object name; when specified, this parameter is used
11814 for result publication in the study. Otherwise, if automatic
11815 publication is switched on, default value is used for result name.
11818 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11821 New GEOM.GEOM_Object, containing the result shape.
11823 # Example: see GEOM_Spanner.py
11824 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11825 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11826 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11827 anObj.SetParameters(Parameters)
11828 self._autoPublish(anObj, theName, "transformed")
11831 ## Multi-transformate block and glue the result.
11832 # @param Block Hexahedral solid to be multi-transformed.
11833 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11834 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11835 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11836 # @param theName Object name; when specified, this parameter is used
11837 # for result publication in the study. Otherwise, if automatic
11838 # publication is switched on, default value is used for result name.
11840 # @return New GEOM.GEOM_Object, containing the result shape.
11842 # @ref tui_multi_transformation "Example"
11843 @ManageTransactions("BlocksOp")
11844 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11845 DirFace1V, DirFace2V, NbTimesV, theName=None):
11847 Multi-transformate block and glue the result.
11850 Block Hexahedral solid to be multi-transformed.
11851 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11852 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11853 NbTimesU,NbTimesV Quantity of transformations to be done.
11854 theName Object name; when specified, this parameter is used
11855 for result publication in the study. Otherwise, if automatic
11856 publication is switched on, default value is used for result name.
11859 New GEOM.GEOM_Object, containing the result shape.
11861 # Example: see GEOM_Spanner.py
11862 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11863 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11864 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11865 DirFace1V, DirFace2V, NbTimesV)
11866 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11867 anObj.SetParameters(Parameters)
11868 self._autoPublish(anObj, theName, "transformed")
11871 ## Build all possible propagation groups.
11872 # Propagation group is a set of all edges, opposite to one (main)
11873 # edge of this group directly or through other opposite edges.
11874 # Notion of Opposite Edge make sence only on quadrangle face.
11875 # @param theShape Shape to build propagation groups on.
11876 # @param theName Object name; when specified, this parameter is used
11877 # for result publication in the study. Otherwise, if automatic
11878 # publication is switched on, default value is used for result name.
11880 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11882 # @ref swig_Propagate "Example"
11883 @ManageTransactions("BlocksOp")
11884 def Propagate(self, theShape, theName=None):
11886 Build all possible propagation groups.
11887 Propagation group is a set of all edges, opposite to one (main)
11888 edge of this group directly or through other opposite edges.
11889 Notion of Opposite Edge make sence only on quadrangle face.
11892 theShape Shape to build propagation groups on.
11893 theName Object name; when specified, this parameter is used
11894 for result publication in the study. Otherwise, if automatic
11895 publication is switched on, default value is used for result name.
11898 List of GEOM.GEOM_Object, each of them is a propagation group.
11900 # Example: see GEOM_TestOthers.py
11901 listChains = self.BlocksOp.Propagate(theShape)
11902 RaiseIfFailed("Propagate", self.BlocksOp)
11903 self._autoPublish(listChains, theName, "propagate")
11906 # end of l3_blocks_op
11909 ## @addtogroup l3_groups
11912 ## Creates a new group which will store sub-shapes of theMainShape
11913 # @param theMainShape is a GEOM object on which the group is selected
11914 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11915 # @param theName Object name; when specified, this parameter is used
11916 # for result publication in the study. Otherwise, if automatic
11917 # publication is switched on, default value is used for result name.
11919 # @return a newly created GEOM group (GEOM.GEOM_Object)
11921 # @ref tui_working_with_groups_page "Example 1"
11922 # \n @ref swig_CreateGroup "Example 2"
11923 @ManageTransactions("GroupOp")
11924 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11926 Creates a new group which will store sub-shapes of theMainShape
11929 theMainShape is a GEOM object on which the group is selected
11930 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11931 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11932 theName Object name; when specified, this parameter is used
11933 for result publication in the study. Otherwise, if automatic
11934 publication is switched on, default value is used for result name.
11937 a newly created GEOM group
11940 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11943 # Example: see GEOM_TestOthers.py
11944 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11945 RaiseIfFailed("CreateGroup", self.GroupOp)
11946 self._autoPublish(anObj, theName, "group")
11949 ## Adds a sub-object with ID theSubShapeId to the group
11950 # @param theGroup is a GEOM group to which the new sub-shape is added
11951 # @param theSubShapeID is a sub-shape ID in the main object.
11952 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11954 # @ref tui_working_with_groups_page "Example"
11955 @ManageTransactions("GroupOp")
11956 def AddObject(self,theGroup, theSubShapeID):
11958 Adds a sub-object with ID theSubShapeId to the group
11961 theGroup is a GEOM group to which the new sub-shape is added
11962 theSubShapeID is a sub-shape ID in the main object.
11965 Use method GetSubShapeID() to get an unique ID of the sub-shape
11967 # Example: see GEOM_TestOthers.py
11968 self.GroupOp.AddObject(theGroup, theSubShapeID)
11969 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11970 RaiseIfFailed("AddObject", self.GroupOp)
11974 ## Removes a sub-object with ID \a theSubShapeId from the group
11975 # @param theGroup is a GEOM group from which the new sub-shape is removed
11976 # @param theSubShapeID is a sub-shape ID in the main object.
11977 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11979 # @ref tui_working_with_groups_page "Example"
11980 @ManageTransactions("GroupOp")
11981 def RemoveObject(self,theGroup, theSubShapeID):
11983 Removes a sub-object with ID theSubShapeId from the group
11986 theGroup is a GEOM group from which the new sub-shape is removed
11987 theSubShapeID is a sub-shape ID in the main object.
11990 Use method GetSubShapeID() to get an unique ID of the sub-shape
11992 # Example: see GEOM_TestOthers.py
11993 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11994 RaiseIfFailed("RemoveObject", self.GroupOp)
11997 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11998 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11999 # @param theSubShapes is a list of sub-shapes to be added.
12001 # @ref tui_working_with_groups_page "Example"
12002 @ManageTransactions("GroupOp")
12003 def UnionList (self,theGroup, theSubShapes):
12005 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12008 theGroup is a GEOM group to which the new sub-shapes are added.
12009 theSubShapes is a list of sub-shapes to be added.
12011 # Example: see GEOM_TestOthers.py
12012 self.GroupOp.UnionList(theGroup, theSubShapes)
12013 RaiseIfFailed("UnionList", self.GroupOp)
12016 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12017 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12018 # @param theSubShapes is a list of indices of sub-shapes to be added.
12020 # @ref swig_UnionIDs "Example"
12021 @ManageTransactions("GroupOp")
12022 def UnionIDs(self,theGroup, theSubShapes):
12024 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12027 theGroup is a GEOM group to which the new sub-shapes are added.
12028 theSubShapes is a list of indices of sub-shapes to be added.
12030 # Example: see GEOM_TestOthers.py
12031 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12032 RaiseIfFailed("UnionIDs", self.GroupOp)
12035 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12036 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12037 # @param theSubShapes is a list of sub-shapes to be removed.
12039 # @ref tui_working_with_groups_page "Example"
12040 @ManageTransactions("GroupOp")
12041 def DifferenceList (self,theGroup, theSubShapes):
12043 Removes from the group all the given shapes. No errors, if some shapes are not included.
12046 theGroup is a GEOM group from which the sub-shapes are removed.
12047 theSubShapes is a list of sub-shapes to be removed.
12049 # Example: see GEOM_TestOthers.py
12050 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12051 RaiseIfFailed("DifferenceList", self.GroupOp)
12054 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12055 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12056 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12058 # @ref swig_DifferenceIDs "Example"
12059 @ManageTransactions("GroupOp")
12060 def DifferenceIDs(self,theGroup, theSubShapes):
12062 Removes from the group all the given shapes. No errors, if some shapes are not included.
12065 theGroup is a GEOM group from which the sub-shapes are removed.
12066 theSubShapes is a list of indices of sub-shapes to be removed.
12068 # Example: see GEOM_TestOthers.py
12069 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12070 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12073 ## Union of two groups.
12074 # New group is created. It will contain all entities
12075 # which are present in groups theGroup1 and theGroup2.
12076 # @param theGroup1, theGroup2 are the initial GEOM groups
12077 # to create the united group from.
12078 # @param theName Object name; when specified, this parameter is used
12079 # for result publication in the study. Otherwise, if automatic
12080 # publication is switched on, default value is used for result name.
12082 # @return a newly created GEOM group.
12084 # @ref tui_union_groups_anchor "Example"
12085 @ManageTransactions("GroupOp")
12086 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12088 Union of two groups.
12089 New group is created. It will contain all entities
12090 which are present in groups theGroup1 and theGroup2.
12093 theGroup1, theGroup2 are the initial GEOM groups
12094 to create the united group from.
12095 theName Object name; when specified, this parameter is used
12096 for result publication in the study. Otherwise, if automatic
12097 publication is switched on, default value is used for result name.
12100 a newly created GEOM group.
12102 # Example: see GEOM_TestOthers.py
12103 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12104 RaiseIfFailed("UnionGroups", self.GroupOp)
12105 self._autoPublish(aGroup, theName, "group")
12108 ## Intersection of two groups.
12109 # New group is created. It will contain only those entities
12110 # which are present in both groups theGroup1 and theGroup2.
12111 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12112 # @param theName Object name; when specified, this parameter is used
12113 # for result publication in the study. Otherwise, if automatic
12114 # publication is switched on, default value is used for result name.
12116 # @return a newly created GEOM group.
12118 # @ref tui_intersect_groups_anchor "Example"
12119 @ManageTransactions("GroupOp")
12120 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12122 Intersection of two groups.
12123 New group is created. It will contain only those entities
12124 which are present in both groups theGroup1 and theGroup2.
12127 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12128 theName Object name; when specified, this parameter is used
12129 for result publication in the study. Otherwise, if automatic
12130 publication is switched on, default value is used for result name.
12133 a newly created GEOM group.
12135 # Example: see GEOM_TestOthers.py
12136 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12137 RaiseIfFailed("IntersectGroups", self.GroupOp)
12138 self._autoPublish(aGroup, theName, "group")
12141 ## Cut of two groups.
12142 # New group is created. It will contain entities which are
12143 # present in group theGroup1 but are not present in group theGroup2.
12144 # @param theGroup1 is a GEOM group to include elements of.
12145 # @param theGroup2 is a GEOM group to exclude elements of.
12146 # @param theName Object name; when specified, this parameter is used
12147 # for result publication in the study. Otherwise, if automatic
12148 # publication is switched on, default value is used for result name.
12150 # @return a newly created GEOM group.
12152 # @ref tui_cut_groups_anchor "Example"
12153 @ManageTransactions("GroupOp")
12154 def CutGroups (self, theGroup1, theGroup2, theName=None):
12157 New group is created. It will contain entities which are
12158 present in group theGroup1 but are not present in group theGroup2.
12161 theGroup1 is a GEOM group to include elements of.
12162 theGroup2 is a GEOM group to exclude elements of.
12163 theName Object name; when specified, this parameter is used
12164 for result publication in the study. Otherwise, if automatic
12165 publication is switched on, default value is used for result name.
12168 a newly created GEOM group.
12170 # Example: see GEOM_TestOthers.py
12171 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12172 RaiseIfFailed("CutGroups", self.GroupOp)
12173 self._autoPublish(aGroup, theName, "group")
12176 ## Union of list of groups.
12177 # New group is created. It will contain all entities that are
12178 # present in groups listed in theGList.
12179 # @param theGList is a list of GEOM groups to create the united group from.
12180 # @param theName Object name; when specified, this parameter is used
12181 # for result publication in the study. Otherwise, if automatic
12182 # publication is switched on, default value is used for result name.
12184 # @return a newly created GEOM group.
12186 # @ref tui_union_groups_anchor "Example"
12187 @ManageTransactions("GroupOp")
12188 def UnionListOfGroups (self, theGList, theName=None):
12190 Union of list of groups.
12191 New group is created. It will contain all entities that are
12192 present in groups listed in theGList.
12195 theGList is a list of GEOM groups to create the united group from.
12196 theName Object name; when specified, this parameter is used
12197 for result publication in the study. Otherwise, if automatic
12198 publication is switched on, default value is used for result name.
12201 a newly created GEOM group.
12203 # Example: see GEOM_TestOthers.py
12204 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12205 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12206 self._autoPublish(aGroup, theName, "group")
12209 ## Cut of lists of groups.
12210 # New group is created. It will contain only entities
12211 # which are present in groups listed in theGList.
12212 # @param theGList is a list of GEOM groups to include elements of.
12213 # @param theName Object name; when specified, this parameter is used
12214 # for result publication in the study. Otherwise, if automatic
12215 # publication is switched on, default value is used for result name.
12217 # @return a newly created GEOM group.
12219 # @ref tui_intersect_groups_anchor "Example"
12220 @ManageTransactions("GroupOp")
12221 def IntersectListOfGroups (self, theGList, theName=None):
12223 Cut of lists of groups.
12224 New group is created. It will contain only entities
12225 which are present in groups listed in theGList.
12228 theGList is a list of GEOM groups to include elements of.
12229 theName Object name; when specified, this parameter is used
12230 for result publication in the study. Otherwise, if automatic
12231 publication is switched on, default value is used for result name.
12234 a newly created GEOM group.
12236 # Example: see GEOM_TestOthers.py
12237 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12238 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12239 self._autoPublish(aGroup, theName, "group")
12242 ## Cut of lists of groups.
12243 # New group is created. It will contain only entities
12244 # which are present in groups listed in theGList1 but
12245 # are not present in groups from theGList2.
12246 # @param theGList1 is a list of GEOM groups to include elements of.
12247 # @param theGList2 is a list of GEOM groups to exclude elements of.
12248 # @param theName Object name; when specified, this parameter is used
12249 # for result publication in the study. Otherwise, if automatic
12250 # publication is switched on, default value is used for result name.
12252 # @return a newly created GEOM group.
12254 # @ref tui_cut_groups_anchor "Example"
12255 @ManageTransactions("GroupOp")
12256 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12258 Cut of lists of groups.
12259 New group is created. It will contain only entities
12260 which are present in groups listed in theGList1 but
12261 are not present in groups from theGList2.
12264 theGList1 is a list of GEOM groups to include elements of.
12265 theGList2 is a list of GEOM groups to exclude elements of.
12266 theName Object name; when specified, this parameter is used
12267 for result publication in the study. Otherwise, if automatic
12268 publication is switched on, default value is used for result name.
12271 a newly created GEOM group.
12273 # Example: see GEOM_TestOthers.py
12274 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12275 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12276 self._autoPublish(aGroup, theName, "group")
12279 ## Returns a list of sub-objects ID stored in the group
12280 # @param theGroup is a GEOM group for which a list of IDs is requested
12282 # @ref swig_GetObjectIDs "Example"
12283 @ManageTransactions("GroupOp")
12284 def GetObjectIDs(self,theGroup):
12286 Returns a list of sub-objects ID stored in the group
12289 theGroup is a GEOM group for which a list of IDs is requested
12291 # Example: see GEOM_TestOthers.py
12292 ListIDs = self.GroupOp.GetObjects(theGroup)
12293 RaiseIfFailed("GetObjects", self.GroupOp)
12296 ## Returns a type of sub-objects stored in the group
12297 # @param theGroup is a GEOM group which type is returned.
12299 # @ref swig_GetType "Example"
12300 @ManageTransactions("GroupOp")
12301 def GetType(self,theGroup):
12303 Returns a type of sub-objects stored in the group
12306 theGroup is a GEOM group which type is returned.
12308 # Example: see GEOM_TestOthers.py
12309 aType = self.GroupOp.GetType(theGroup)
12310 RaiseIfFailed("GetType", self.GroupOp)
12313 ## Convert a type of geom object from id to string value
12314 # @param theId is a GEOM obect type id.
12315 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12316 # @ref swig_GetType "Example"
12317 def ShapeIdToType(self, theId):
12319 Convert a type of geom object from id to string value
12322 theId is a GEOM obect type id.
12325 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12352 return "REVOLUTION"
12400 return "FREE_BOUNDS"
12408 return "THRUSECTIONS"
12410 return "COMPOUNDFILTER"
12412 return "SHAPES_ON_SHAPE"
12414 return "ELLIPSE_ARC"
12416 return "3DSKETCHER"
12422 return "PIPETSHAPE"
12423 return "Shape Id not exist."
12425 ## Returns a main shape associated with the group
12426 # @param theGroup is a GEOM group for which a main shape object is requested
12427 # @return a GEOM object which is a main shape for theGroup
12429 # @ref swig_GetMainShape "Example"
12430 @ManageTransactions("GroupOp")
12431 def GetMainShape(self,theGroup):
12433 Returns a main shape associated with the group
12436 theGroup is a GEOM group for which a main shape object is requested
12439 a GEOM object which is a main shape for theGroup
12441 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12443 # Example: see GEOM_TestOthers.py
12444 anObj = self.GroupOp.GetMainShape(theGroup)
12445 RaiseIfFailed("GetMainShape", self.GroupOp)
12448 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12449 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12450 # @param theShape given shape (see GEOM.GEOM_Object)
12451 # @param min_length minimum length of edges of theShape
12452 # @param max_length maximum length of edges of theShape
12453 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12454 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12455 # @param theName Object name; when specified, this parameter is used
12456 # for result publication in the study. Otherwise, if automatic
12457 # publication is switched on, default value is used for result name.
12459 # @return a newly created GEOM group of edges
12461 # @@ref swig_todo "Example"
12462 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12464 Create group of edges of theShape, whose length is in range [min_length, max_length].
12465 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12468 theShape given shape
12469 min_length minimum length of edges of theShape
12470 max_length maximum length of edges of theShape
12471 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12472 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12473 theName Object name; when specified, this parameter is used
12474 for result publication in the study. Otherwise, if automatic
12475 publication is switched on, default value is used for result name.
12478 a newly created GEOM group of edges.
12480 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12481 edges_in_range = []
12483 Props = self.BasicProperties(edge)
12484 if min_length <= Props[0] and Props[0] <= max_length:
12485 if (not include_min) and (min_length == Props[0]):
12488 if (not include_max) and (Props[0] == max_length):
12491 edges_in_range.append(edge)
12493 if len(edges_in_range) <= 0:
12494 print "No edges found by given criteria"
12497 # note: auto-publishing is done in self.CreateGroup()
12498 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12499 self.UnionList(group_edges, edges_in_range)
12503 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12504 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12505 # @param min_length minimum length of edges of selected shape
12506 # @param max_length maximum length of edges of selected shape
12507 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12508 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12509 # @return a newly created GEOM group of edges
12510 # @ref swig_todo "Example"
12511 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12513 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12514 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12517 min_length minimum length of edges of selected shape
12518 max_length maximum length of edges of selected shape
12519 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12520 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12523 a newly created GEOM group of edges.
12525 nb_selected = sg.SelectedCount()
12526 if nb_selected < 1:
12527 print "Select a shape before calling this function, please."
12529 if nb_selected > 1:
12530 print "Only one shape must be selected"
12533 id_shape = sg.getSelected(0)
12534 shape = IDToObject( id_shape )
12536 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12540 if include_min: left_str = " <= "
12541 if include_max: right_str = " <= "
12543 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12544 + left_str + "length" + right_str + `max_length`)
12546 sg.updateObjBrowser(1)
12553 ## @addtogroup l4_advanced
12556 ## Create a T-shape object with specified caracteristics for the main
12557 # and the incident pipes (radius, width, half-length).
12558 # The extremities of the main pipe are located on junctions points P1 and P2.
12559 # The extremity of the incident pipe is located on junction point P3.
12560 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12561 # the main plane of the T-shape is XOY.
12563 # @param theR1 Internal radius of main pipe
12564 # @param theW1 Width of main pipe
12565 # @param theL1 Half-length of main pipe
12566 # @param theR2 Internal radius of incident pipe (R2 < R1)
12567 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12568 # @param theL2 Half-length of incident pipe
12570 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12571 # @param theP1 1st junction point of main pipe
12572 # @param theP2 2nd junction point of main pipe
12573 # @param theP3 Junction point of incident pipe
12575 # @param theRL Internal radius of left thickness reduction
12576 # @param theWL Width of left thickness reduction
12577 # @param theLtransL Length of left transition part
12578 # @param theLthinL Length of left thin part
12580 # @param theRR Internal radius of right thickness reduction
12581 # @param theWR Width of right thickness reduction
12582 # @param theLtransR Length of right transition part
12583 # @param theLthinR Length of right thin part
12585 # @param theRI Internal radius of incident thickness reduction
12586 # @param theWI Width of incident thickness reduction
12587 # @param theLtransI Length of incident transition part
12588 # @param theLthinI Length of incident thin part
12590 # @param theName Object name; when specified, this parameter is used
12591 # for result publication in the study. Otherwise, if automatic
12592 # publication is switched on, default value is used for result name.
12594 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12596 # @ref tui_creation_pipetshape "Example"
12597 @ManageTransactions("AdvOp")
12598 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
12599 theHexMesh=True, theP1=None, theP2=None, theP3=None,
12600 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12601 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12602 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12605 Create a T-shape object with specified caracteristics for the main
12606 and the incident pipes (radius, width, half-length).
12607 The extremities of the main pipe are located on junctions points P1 and P2.
12608 The extremity of the incident pipe is located on junction point P3.
12609 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12610 the main plane of the T-shape is XOY.
12613 theR1 Internal radius of main pipe
12614 theW1 Width of main pipe
12615 theL1 Half-length of main pipe
12616 theR2 Internal radius of incident pipe (R2 < R1)
12617 theW2 Width of incident pipe (R2+W2 < R1+W1)
12618 theL2 Half-length of incident pipe
12619 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12620 theP1 1st junction point of main pipe
12621 theP2 2nd junction point of main pipe
12622 theP3 Junction point of incident pipe
12624 theRL Internal radius of left thickness reduction
12625 theWL Width of left thickness reduction
12626 theLtransL Length of left transition part
12627 theLthinL Length of left thin part
12629 theRR Internal radius of right thickness reduction
12630 theWR Width of right thickness reduction
12631 theLtransR Length of right transition part
12632 theLthinR Length of right thin part
12634 theRI Internal radius of incident thickness reduction
12635 theWI Width of incident thickness reduction
12636 theLtransI Length of incident transition part
12637 theLthinI Length of incident thin part
12639 theName Object name; when specified, this parameter is used
12640 for result publication in the study. Otherwise, if automatic
12641 publication is switched on, default value is used for result name.
12644 List of GEOM_Object, containing the created shape and propagation groups.
12647 # create PipeTShape object
12648 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12649 # create PipeTShape object with position
12650 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12651 # create PipeTShape object with left thickness reduction
12652 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12654 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)
12655 if (theP1 and theP2 and theP3):
12656 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12657 theRL, theWL, theLtransL, theLthinL,
12658 theRR, theWR, theLtransR, theLthinR,
12659 theRI, theWI, theLtransI, theLthinI,
12660 theHexMesh, theP1, theP2, theP3)
12662 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12663 theRL, theWL, theLtransL, theLthinL,
12664 theRR, theWR, theLtransR, theLthinR,
12665 theRI, theWI, theLtransI, theLthinI,
12667 RaiseIfFailed("MakePipeTShape", self.AdvOp)
12668 if Parameters: anObj[0].SetParameters(Parameters)
12669 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12670 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12673 ## Create a T-shape object with chamfer and with specified caracteristics for the main
12674 # and the incident pipes (radius, width, half-length). The chamfer is
12675 # created on the junction of the pipes.
12676 # The extremities of the main pipe are located on junctions points P1 and P2.
12677 # The extremity of the incident pipe is located on junction point P3.
12678 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12679 # the main plane of the T-shape is XOY.
12680 # @param theR1 Internal radius of main pipe
12681 # @param theW1 Width of main pipe
12682 # @param theL1 Half-length of main pipe
12683 # @param theR2 Internal radius of incident pipe (R2 < R1)
12684 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12685 # @param theL2 Half-length of incident pipe
12686 # @param theH Height of the chamfer.
12687 # @param theW Width of the chamfer.
12688 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12689 # @param theP1 1st junction point of main pipe
12690 # @param theP2 2nd junction point of main pipe
12691 # @param theP3 Junction point of incident pipe
12693 # @param theRL Internal radius of left thickness reduction
12694 # @param theWL Width of left thickness reduction
12695 # @param theLtransL Length of left transition part
12696 # @param theLthinL Length of left thin part
12698 # @param theRR Internal radius of right thickness reduction
12699 # @param theWR Width of right thickness reduction
12700 # @param theLtransR Length of right transition part
12701 # @param theLthinR Length of right thin part
12703 # @param theRI Internal radius of incident thickness reduction
12704 # @param theWI Width of incident thickness reduction
12705 # @param theLtransI Length of incident transition part
12706 # @param theLthinI Length of incident thin part
12708 # @param theName Object name; when specified, this parameter is used
12709 # for result publication in the study. Otherwise, if automatic
12710 # publication is switched on, default value is used for result name.
12712 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12714 # @ref tui_creation_pipetshape "Example"
12715 @ManageTransactions("AdvOp")
12716 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12717 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12718 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12719 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12720 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12723 Create a T-shape object with chamfer and with specified caracteristics for the main
12724 and the incident pipes (radius, width, half-length). The chamfer is
12725 created on the junction of the pipes.
12726 The extremities of the main pipe are located on junctions points P1 and P2.
12727 The extremity of the incident pipe is located on junction point P3.
12728 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12729 the main plane of the T-shape is XOY.
12732 theR1 Internal radius of main pipe
12733 theW1 Width of main pipe
12734 theL1 Half-length of main pipe
12735 theR2 Internal radius of incident pipe (R2 < R1)
12736 theW2 Width of incident pipe (R2+W2 < R1+W1)
12737 theL2 Half-length of incident pipe
12738 theH Height of the chamfer.
12739 theW Width of the chamfer.
12740 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12741 theP1 1st junction point of main pipe
12742 theP2 2nd junction point of main pipe
12743 theP3 Junction point of incident pipe
12745 theRL Internal radius of left thickness reduction
12746 theWL Width of left thickness reduction
12747 theLtransL Length of left transition part
12748 theLthinL Length of left thin part
12750 theRR Internal radius of right thickness reduction
12751 theWR Width of right thickness reduction
12752 theLtransR Length of right transition part
12753 theLthinR Length of right thin part
12755 theRI Internal radius of incident thickness reduction
12756 theWI Width of incident thickness reduction
12757 theLtransI Length of incident transition part
12758 theLthinI Length of incident thin part
12760 theName Object name; when specified, this parameter is used
12761 for result publication in the study. Otherwise, if automatic
12762 publication is switched on, default value is used for result name.
12765 List of GEOM_Object, containing the created shape and propagation groups.
12768 # create PipeTShape with chamfer object
12769 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12770 # create PipeTShape with chamfer object with position
12771 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12772 # create PipeTShape with chamfer object with left thickness reduction
12773 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)
12775 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)
12776 if (theP1 and theP2 and theP3):
12777 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12778 theRL, theWL, theLtransL, theLthinL,
12779 theRR, theWR, theLtransR, theLthinR,
12780 theRI, theWI, theLtransI, theLthinI,
12781 theH, theW, theHexMesh, theP1, theP2, theP3)
12783 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12784 theRL, theWL, theLtransL, theLthinL,
12785 theRR, theWR, theLtransR, theLthinR,
12786 theRI, theWI, theLtransI, theLthinI,
12787 theH, theW, theHexMesh)
12788 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12789 if Parameters: anObj[0].SetParameters(Parameters)
12790 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12791 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12794 ## Create a T-shape object with fillet and with specified caracteristics for the main
12795 # and the incident pipes (radius, width, half-length). The fillet is
12796 # created on the junction of the pipes.
12797 # The extremities of the main pipe are located on junctions points P1 and P2.
12798 # The extremity of the incident pipe is located on junction point P3.
12799 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12800 # the main plane of the T-shape is XOY.
12801 # @param theR1 Internal radius of main pipe
12802 # @param theW1 Width of main pipe
12803 # @param theL1 Half-length of main pipe
12804 # @param theR2 Internal radius of incident pipe (R2 < R1)
12805 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12806 # @param theL2 Half-length of incident pipe
12807 # @param theRF Radius of curvature of fillet.
12808 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12809 # @param theP1 1st junction point of main pipe
12810 # @param theP2 2nd junction point of main pipe
12811 # @param theP3 Junction point of incident pipe
12813 # @param theRL Internal radius of left thickness reduction
12814 # @param theWL Width of left thickness reduction
12815 # @param theLtransL Length of left transition part
12816 # @param theLthinL Length of left thin part
12818 # @param theRR Internal radius of right thickness reduction
12819 # @param theWR Width of right thickness reduction
12820 # @param theLtransR Length of right transition part
12821 # @param theLthinR Length of right thin part
12823 # @param theRI Internal radius of incident thickness reduction
12824 # @param theWI Width of incident thickness reduction
12825 # @param theLtransI Length of incident transition part
12826 # @param theLthinI Length of incident thin part
12828 # @param theName Object name; when specified, this parameter is used
12829 # for result publication in the study. Otherwise, if automatic
12830 # publication is switched on, default value is used for result name.
12832 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12834 # @ref tui_creation_pipetshape "Example"
12835 @ManageTransactions("AdvOp")
12836 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12837 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12838 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12839 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12840 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12843 Create a T-shape object with fillet and with specified caracteristics for the main
12844 and the incident pipes (radius, width, half-length). The fillet is
12845 created on the junction of the pipes.
12846 The extremities of the main pipe are located on junctions points P1 and P2.
12847 The extremity of the incident pipe is located on junction point P3.
12850 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12851 the main plane of the T-shape is XOY.
12852 theR1 Internal radius of main pipe
12853 theW1 Width of main pipe
12854 heL1 Half-length of main pipe
12855 theR2 Internal radius of incident pipe (R2 < R1)
12856 theW2 Width of incident pipe (R2+W2 < R1+W1)
12857 theL2 Half-length of incident pipe
12858 theRF Radius of curvature of fillet.
12859 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12860 theP1 1st junction point of main pipe
12861 theP2 2nd junction point of main pipe
12862 theP3 Junction point of incident pipe
12864 theRL Internal radius of left thickness reduction
12865 theWL Width of left thickness reduction
12866 theLtransL Length of left transition part
12867 theLthinL Length of left thin part
12869 theRR Internal radius of right thickness reduction
12870 theWR Width of right thickness reduction
12871 theLtransR Length of right transition part
12872 theLthinR Length of right thin part
12874 theRI Internal radius of incident thickness reduction
12875 theWI Width of incident thickness reduction
12876 theLtransI Length of incident transition part
12877 theLthinI Length of incident thin part
12879 theName Object name; when specified, this parameter is used
12880 for result publication in the study. Otherwise, if automatic
12881 publication is switched on, default value is used for result name.
12884 List of GEOM_Object, containing the created shape and propagation groups.
12887 # create PipeTShape with fillet object
12888 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12889 # create PipeTShape with fillet object with position
12890 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12891 # create PipeTShape with fillet object with left thickness reduction
12892 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)
12894 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)
12895 if (theP1 and theP2 and theP3):
12896 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12897 theRL, theWL, theLtransL, theLthinL,
12898 theRR, theWR, theLtransR, theLthinR,
12899 theRI, theWI, theLtransI, theLthinI,
12900 theRF, theHexMesh, theP1, theP2, theP3)
12902 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12903 theRL, theWL, theLtransL, theLthinL,
12904 theRR, theWR, theLtransR, theLthinR,
12905 theRI, theWI, theLtransI, theLthinI,
12907 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12908 if Parameters: anObj[0].SetParameters(Parameters)
12909 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12910 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12913 ## This function allows creating a disk already divided into blocks. It
12914 # can be used to create divided pipes for later meshing in hexaedra.
12915 # @param theR Radius of the disk
12916 # @param theOrientation Orientation of the plane on which the disk will be built
12917 # 1 = XOY, 2 = OYZ, 3 = OZX
12918 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12919 # @param theName Object name; when specified, this parameter is used
12920 # for result publication in the study. Otherwise, if automatic
12921 # publication is switched on, default value is used for result name.
12923 # @return New GEOM_Object, containing the created shape.
12925 # @ref tui_creation_divideddisk "Example"
12926 @ManageTransactions("AdvOp")
12927 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12929 Creates a disk, divided into blocks. It can be used to create divided pipes
12930 for later meshing in hexaedra.
12933 theR Radius of the disk
12934 theOrientation Orientation of the plane on which the disk will be built:
12935 1 = XOY, 2 = OYZ, 3 = OZX
12936 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12937 theName Object name; when specified, this parameter is used
12938 for result publication in the study. Otherwise, if automatic
12939 publication is switched on, default value is used for result name.
12942 New GEOM_Object, containing the created shape.
12944 theR, Parameters = ParseParameters(theR)
12945 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12946 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12947 if Parameters: anObj.SetParameters(Parameters)
12948 self._autoPublish(anObj, theName, "dividedDisk")
12951 ## This function allows creating a disk already divided into blocks. It
12952 # can be used to create divided pipes for later meshing in hexaedra.
12953 # @param theCenter Center of the disk
12954 # @param theVector Normal vector to the plane of the created disk
12955 # @param theRadius Radius of the disk
12956 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12957 # @param theName Object name; when specified, this parameter is used
12958 # for result publication in the study. Otherwise, if automatic
12959 # publication is switched on, default value is used for result name.
12961 # @return New GEOM_Object, containing the created shape.
12963 # @ref tui_creation_divideddisk "Example"
12964 @ManageTransactions("AdvOp")
12965 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12967 Creates a disk already divided into blocks. It can be used to create divided pipes
12968 for later meshing in hexaedra.
12971 theCenter Center of the disk
12972 theVector Normal vector to the plane of the created disk
12973 theRadius Radius of the disk
12974 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12975 theName Object name; when specified, this parameter is used
12976 for result publication in the study. Otherwise, if automatic
12977 publication is switched on, default value is used for result name.
12980 New GEOM_Object, containing the created shape.
12982 theRadius, Parameters = ParseParameters(theRadius)
12983 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12984 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12985 if Parameters: anObj.SetParameters(Parameters)
12986 self._autoPublish(anObj, theName, "dividedDisk")
12989 ## Builds a cylinder prepared for hexa meshes
12990 # @param theR Radius of the cylinder
12991 # @param theH Height of the cylinder
12992 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12993 # @param theName Object name; when specified, this parameter is used
12994 # for result publication in the study. Otherwise, if automatic
12995 # publication is switched on, default value is used for result name.
12997 # @return New GEOM_Object, containing the created shape.
12999 # @ref tui_creation_dividedcylinder "Example"
13000 @ManageTransactions("AdvOp")
13001 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
13003 Builds a cylinder prepared for hexa meshes
13006 theR Radius of the cylinder
13007 theH Height of the cylinder
13008 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
13009 theName Object name; when specified, this parameter is used
13010 for result publication in the study. Otherwise, if automatic
13011 publication is switched on, default value is used for result name.
13014 New GEOM_Object, containing the created shape.
13016 theR, theH, Parameters = ParseParameters(theR, theH)
13017 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
13018 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
13019 if Parameters: anObj.SetParameters(Parameters)
13020 self._autoPublish(anObj, theName, "dividedCylinder")
13023 ## Create a surface from a cloud of points
13024 # @param thelPoints list of points. Compounds of points are
13025 # accepted as well.
13026 # @param theNbMax maximum number of Bezier pieces in the resulting
13028 # @param theDegMax maximum degree of the resulting BSpline surface.
13029 # @param theDMax 3D tolerance of initial approximation.
13030 # @param theName Object name; when specified, this parameter is used
13031 # for result publication in the study. Otherwise, if automatic
13032 # publication is switched on, default value is used for result name.
13033 # @return New GEOM_Object, containing the created shape.
13034 # @note 3D tolerance of initial approximation represents a tolerance of
13035 # initial plate surface approximation. If this parameter is equal
13036 # to 0 (default value) it is computed. In this case an error of
13037 # initial plate surface computation is used as the approximation
13038 # tolerance. This error represents a maximal distance between
13039 # computed plate surface and given points.
13041 # @ref tui_creation_smoothingsurface "Example"
13042 @ManageTransactions("AdvOp")
13043 def MakeSmoothingSurface(self, thelPoints, theNbMax=2, theDegMax=8,
13044 theDMax=0.0, theName=None):
13046 Create a surface from a cloud of points
13049 thelPoints list of points. Compounds of points are
13051 theNbMax maximum number of Bezier pieces in the resulting
13053 theDegMax maximum degree of the resulting BSpline surface.
13054 theDMax 3D tolerance of initial approximation.
13055 theName Object name; when specified, this parameter is used
13056 for result publication in the study. Otherwise, if automatic
13057 publication is switched on, default value is used for result name.
13060 New GEOM_Object, containing the created shape.
13063 3D tolerance of initial approximation represents a tolerance of
13064 initial plate surface approximation. If this parameter is equal
13065 to 0 (default value) it is computed. In this case an error of
13066 initial plate surface computation is used as the approximation
13067 tolerance. This error represents a maximal distance between
13068 computed plate surface and given points.
13070 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints, theNbMax,
13071 theDegMax, theDMax)
13072 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
13073 self._autoPublish(anObj, theName, "smoothing")
13076 ## Export a shape to XAO format
13077 # @param shape The shape to export
13078 # @param groups The list of groups to export
13079 # @param fields The list of fields to export
13080 # @param author The author of the export
13081 # @param fileName The name of the file to export
13084 # @ref tui_exportxao "Example"
13085 @ManageTransactions("InsertOp")
13086 def ExportXAO(self, shape, groups, fields, author, fileName):
13087 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
13088 RaiseIfFailed("ExportXAO", self.InsertOp)
13091 ## Import a shape from XAO format
13092 # @param shape Shape to export
13093 # @param fileName The name of the file to import
13094 # @return tuple (res, shape, subShapes, groups, fields)
13095 # res Flag indicating if the import was successful
13096 # shape The imported shape
13097 # subShapes The list of imported subShapes
13098 # groups The list of imported groups
13099 # fields The list of imported fields
13101 # @ref tui_importxao "Example"
13102 @ManageTransactions("InsertOp")
13103 def ImportXAO(self, fileName):
13104 res = self.InsertOp.ImportXAO(fileName)
13105 RaiseIfFailed("ImportXAO", self.InsertOp)
13108 #@@ insert new functions before this line @@ do not remove this line @@#
13110 # end of l4_advanced
13113 ## Create a copy of the given object
13115 # @param theOriginal geometry object for copy
13116 # @param theName Object name; when specified, this parameter is used
13117 # for result publication in the study. Otherwise, if automatic
13118 # publication is switched on, default value is used for result name.
13120 # @return New GEOM_Object, containing the copied shape.
13122 # @ingroup l1_geomBuilder_auxiliary
13123 # @ref swig_MakeCopy "Example"
13124 @ManageTransactions("InsertOp")
13125 def MakeCopy(self, theOriginal, theName=None):
13127 Create a copy of the given object
13130 theOriginal geometry object for copy
13131 theName Object name; when specified, this parameter is used
13132 for result publication in the study. Otherwise, if automatic
13133 publication is switched on, default value is used for result name.
13136 New GEOM_Object, containing the copied shape.
13138 Example of usage: Copy = geompy.MakeCopy(Box)
13140 # Example: see GEOM_TestAll.py
13141 anObj = self.InsertOp.MakeCopy(theOriginal)
13142 RaiseIfFailed("MakeCopy", self.InsertOp)
13143 self._autoPublish(anObj, theName, "copy")
13146 ## Add Path to load python scripts from
13147 # @param Path a path to load python scripts from
13148 # @ingroup l1_geomBuilder_auxiliary
13149 def addPath(self,Path):
13151 Add Path to load python scripts from
13154 Path a path to load python scripts from
13156 if (sys.path.count(Path) < 1):
13157 sys.path.append(Path)
13161 ## Load marker texture from the file
13162 # @param Path a path to the texture file
13163 # @return unique texture identifier
13164 # @ingroup l1_geomBuilder_auxiliary
13165 @ManageTransactions("InsertOp")
13166 def LoadTexture(self, Path):
13168 Load marker texture from the file
13171 Path a path to the texture file
13174 unique texture identifier
13176 # Example: see GEOM_TestAll.py
13177 ID = self.InsertOp.LoadTexture(Path)
13178 RaiseIfFailed("LoadTexture", self.InsertOp)
13181 ## Get internal name of the object based on its study entry
13182 # @note This method does not provide an unique identifier of the geometry object.
13183 # @note This is internal function of GEOM component, though it can be used outside it for
13184 # appropriate reason (e.g. for identification of geometry object).
13185 # @param obj geometry object
13186 # @return unique object identifier
13187 # @ingroup l1_geomBuilder_auxiliary
13188 def getObjectID(self, obj):
13190 Get internal name of the object based on its study entry.
13191 Note: this method does not provide an unique identifier of the geometry object.
13192 It is an internal function of GEOM component, though it can be used outside GEOM for
13193 appropriate reason (e.g. for identification of geometry object).
13196 obj geometry object
13199 unique object identifier
13202 entry = salome.ObjectToID(obj)
13203 if entry is not None:
13204 lst = entry.split(":")
13206 ID = lst[-1] # -1 means last item in the list
13207 return "GEOM_" + ID
13212 ## Add marker texture. @a Width and @a Height parameters
13213 # specify width and height of the texture in pixels.
13214 # If @a RowData is @c True, @a Texture parameter should represent texture data
13215 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13216 # parameter should be unpacked string, in which '1' symbols represent opaque
13217 # pixels and '0' represent transparent pixels of the texture bitmap.
13219 # @param Width texture width in pixels
13220 # @param Height texture height in pixels
13221 # @param Texture texture data
13222 # @param RowData if @c True, @a Texture data are packed in the byte stream
13223 # @return unique texture identifier
13224 # @ingroup l1_geomBuilder_auxiliary
13225 @ManageTransactions("InsertOp")
13226 def AddTexture(self, Width, Height, Texture, RowData=False):
13228 Add marker texture. Width and Height parameters
13229 specify width and height of the texture in pixels.
13230 If RowData is True, Texture parameter should represent texture data
13231 packed into the byte array. If RowData is False (default), Texture
13232 parameter should be unpacked string, in which '1' symbols represent opaque
13233 pixels and '0' represent transparent pixels of the texture bitmap.
13236 Width texture width in pixels
13237 Height texture height in pixels
13238 Texture texture data
13239 RowData if True, Texture data are packed in the byte stream
13242 return unique texture identifier
13244 if not RowData: Texture = PackData(Texture)
13245 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13246 RaiseIfFailed("AddTexture", self.InsertOp)
13249 ## Creates a new folder object. It is a container for any GEOM objects.
13250 # @param Name name of the container
13251 # @param Father parent object. If None,
13252 # folder under 'Geometry' root object will be created.
13253 # @return a new created folder
13254 # @ingroup l1_publish_data
13255 def NewFolder(self, Name, Father=None):
13257 Create a new folder object. It is an auxiliary container for any GEOM objects.
13260 Name name of the container
13261 Father parent object. If None,
13262 folder under 'Geometry' root object will be created.
13265 a new created folder
13267 if not Father: Father = self.father
13268 return self.CreateFolder(Name, Father)
13270 ## Move object to the specified folder
13271 # @param Object object to move
13272 # @param Folder target folder
13273 # @ingroup l1_publish_data
13274 def PutToFolder(self, Object, Folder):
13276 Move object to the specified folder
13279 Object object to move
13280 Folder target folder
13282 self.MoveToFolder(Object, Folder)
13285 ## Move list of objects to the specified folder
13286 # @param ListOfSO list of objects to move
13287 # @param Folder target folder
13288 # @ingroup l1_publish_data
13289 def PutListToFolder(self, ListOfSO, Folder):
13291 Move list of objects to the specified folder
13294 ListOfSO list of objects to move
13295 Folder target folder
13297 self.MoveListToFolder(ListOfSO, Folder)
13300 ## @addtogroup l2_field
13304 # @param shape the shape the field lies on
13305 # @param name the field name
13306 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13307 # @param dimension dimension of the shape the field lies on
13308 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13309 # @param componentNames names of components
13310 # @return a created field
13311 @ManageTransactions("FieldOp")
13312 def CreateField(self, shape, name, type, dimension, componentNames):
13317 shape the shape the field lies on
13318 name the field name
13319 type type of field data
13320 dimension dimension of the shape the field lies on
13321 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13322 componentNames names of components
13327 if isinstance( type, int ):
13328 if type < 0 or type > 3:
13329 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
13330 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13332 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13333 RaiseIfFailed("CreateField", self.FieldOp)
13335 geom._autoPublish( f, "", name)
13338 ## Removes a field from the GEOM component
13339 # @param field the field to remove
13340 def RemoveField(self, field):
13341 "Removes a field from the GEOM component"
13343 if isinstance( field, GEOM._objref_GEOM_Field ):
13344 geom.RemoveObject( field )
13345 elif isinstance( field, geomField ):
13346 geom.RemoveObject( field.field )
13348 raise RuntimeError, "RemoveField() : the object is not a field"
13351 ## Returns number of fields on a shape
13352 @ManageTransactions("FieldOp")
13353 def CountFields(self, shape):
13354 "Returns number of fields on a shape"
13355 nb = self.FieldOp.CountFields( shape )
13356 RaiseIfFailed("CountFields", self.FieldOp)
13359 ## Returns all fields on a shape
13360 @ManageTransactions("FieldOp")
13361 def GetFields(self, shape):
13362 "Returns all fields on a shape"
13363 ff = self.FieldOp.GetFields( shape )
13364 RaiseIfFailed("GetFields", self.FieldOp)
13367 ## Returns a field on a shape by its name
13368 @ManageTransactions("FieldOp")
13369 def GetField(self, shape, name):
13370 "Returns a field on a shape by its name"
13371 f = self.FieldOp.GetField( shape, name )
13372 RaiseIfFailed("GetField", self.FieldOp)
13380 # Register the new proxy for GEOM_Gen
13381 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13384 ## Field on Geometry
13385 # @ingroup l2_field
13386 class geomField( GEOM._objref_GEOM_Field ):
13388 def __init__(self):
13389 GEOM._objref_GEOM_Field.__init__(self)
13390 self.field = GEOM._objref_GEOM_Field
13393 ## Returns the shape the field lies on
13394 def getShape(self):
13395 "Returns the shape the field lies on"
13396 return self.field.GetShape(self)
13398 ## Returns the field name
13400 "Returns the field name"
13401 return self.field.GetName(self)
13403 ## Returns type of field data as integer [0-3]
13405 "Returns type of field data"
13406 return self.field.GetDataType(self)._v
13408 ## Returns type of field data:
13409 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13410 def getTypeEnum(self):
13411 "Returns type of field data"
13412 return self.field.GetDataType(self)
13414 ## Returns dimension of the shape the field lies on:
13415 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13416 def getDimension(self):
13417 """Returns dimension of the shape the field lies on:
13418 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13419 return self.field.GetDimension(self)
13421 ## Returns names of components
13422 def getComponents(self):
13423 "Returns names of components"
13424 return self.field.GetComponents(self)
13426 ## Adds a time step to the field
13427 # @param step the time step number further used as the step identifier
13428 # @param stamp the time step time
13429 # @param values the values of the time step
13430 def addStep(self, step, stamp, values):
13431 "Adds a time step to the field"
13432 stp = self.field.AddStep( self, step, stamp )
13434 raise RuntimeError, \
13435 "Field.addStep() : Error: step %s already exists in this field"%step
13437 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13438 self.setValues( step, values )
13441 ## Remove a time step from the field
13442 def removeStep(self,step):
13443 "Remove a time step from the field"
13446 stepObj = self.field.GetStep( self, step )
13448 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13451 #traceback.print_exc()
13453 self.field.RemoveStep( self, step )
13455 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13458 ## Returns number of time steps in the field
13459 def countSteps(self):
13460 "Returns number of time steps in the field"
13461 return self.field.CountSteps(self)
13463 ## Returns a list of time step IDs in the field
13464 def getSteps(self):
13465 "Returns a list of time step IDs in the field"
13466 return self.field.GetSteps(self)
13468 ## Returns a time step by its ID
13469 def getStep(self,step):
13470 "Returns a time step by its ID"
13471 stp = self.field.GetStep(self, step)
13473 raise RuntimeError, "Step %s is missing from this field"%step
13476 ## Returns the time of the field step
13477 def getStamp(self,step):
13478 "Returns the time of the field step"
13479 return self.getStep(step).GetStamp()
13481 ## Changes the time of the field step
13482 def setStamp(self, step, stamp):
13483 "Changes the time of the field step"
13484 return self.getStep(step).SetStamp(stamp)
13486 ## Returns values of the field step
13487 def getValues(self, step):
13488 "Returns values of the field step"
13489 return self.getStep(step).GetValues()
13491 ## Changes values of the field step
13492 def setValues(self, step, values):
13493 "Changes values of the field step"
13494 stp = self.getStep(step)
13495 errBeg = "Field.setValues(values) : Error: "
13497 ok = stp.SetValues( values )
13498 except Exception, e:
13500 if excStr.find("WrongPythonType") > 0:
13501 raise RuntimeError, errBeg +\
13502 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13503 raise RuntimeError, errBeg + str(e)
13505 nbOK = self.field.GetArraySize(self)
13508 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13510 raise RuntimeError, errBeg + "failed"
13513 pass # end of class geomField
13515 # Register the new proxy for GEOM_Field
13516 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13519 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13520 # interface to GEOM operations.
13525 # salome.salome_init()
13526 # from salome.geom import geomBuilder
13527 # geompy = geomBuilder.New(salome.myStudy)
13529 # @param study SALOME study, generally obtained by salome.myStudy.
13530 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13531 # @return geomBuilder instance
13532 def New( study, instance=None):
13534 Create a new geomBuilder instance.The geomBuilder class provides the Python
13535 interface to GEOM operations.
13539 salome.salome_init()
13540 from salome.geom import geomBuilder
13541 geompy = geomBuilder.New(salome.myStudy)
13544 study SALOME study, generally obtained by salome.myStudy.
13545 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13547 geomBuilder instance
13549 #print "New geomBuilder ", study, instance
13556 geom = geomBuilder()
13557 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13558 geom.init_geom(study)