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)
958 # hide references if any
959 vso = self.myStudy.FindDependances(aSObject);
961 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
962 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
963 drwAttribute.SetDrawable(False)
967 # end of l1_geomBuilder_auxiliary
970 ## @addtogroup l3_restore_ss
973 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
974 # To be used from python scripts out of addToStudy() (non-default usage)
975 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
976 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
977 # If this list is empty, all operation arguments will be published
978 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
979 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
980 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
981 # Do not publish sub-shapes in place of arguments, but only
982 # in place of sub-shapes of the first argument,
983 # because the whole shape corresponds to the first argument.
984 # Mainly to be used after transformations, but it also can be
985 # usefull after partition with one object shape, and some other
986 # operations, where only the first argument has to be considered.
987 # If theObject has only one argument shape, this flag is automatically
988 # considered as True, not regarding really passed value.
989 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
990 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
991 # \return list of published sub-shapes
993 # @ref tui_restore_prs_params "Example"
994 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
995 theInheritFirstArg=False, theAddPrefix=True):
997 Publish sub-shapes, standing for arguments and sub-shapes of arguments
998 To be used from python scripts out of geompy.addToStudy (non-default usage)
1001 theObject published GEOM.GEOM_Object, arguments of which will be published
1002 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1003 If this list is empty, all operation arguments will be published
1004 theFindMethod method to search sub-shapes, corresponding to arguments and
1005 their sub-shapes. Value from enumeration GEOM.find_shape_method.
1006 theInheritFirstArg set properties of the first argument for theObject.
1007 Do not publish sub-shapes in place of arguments, but only
1008 in place of sub-shapes of the first argument,
1009 because the whole shape corresponds to the first argument.
1010 Mainly to be used after transformations, but it also can be
1011 usefull after partition with one object shape, and some other
1012 operations, where only the first argument has to be considered.
1013 If theObject has only one argument shape, this flag is automatically
1014 considered as True, not regarding really passed value.
1015 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1016 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1018 list of published sub-shapes
1020 # Example: see GEOM_TestAll.py
1021 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1022 theFindMethod, theInheritFirstArg, theAddPrefix)
1024 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1025 # To be used from python scripts out of addToStudy() (non-default usage)
1026 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1027 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1028 # If this list is empty, all operation arguments will be published
1029 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1030 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1031 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1032 # Do not publish sub-shapes in place of arguments, but only
1033 # in place of sub-shapes of the first argument,
1034 # because the whole shape corresponds to the first argument.
1035 # Mainly to be used after transformations, but it also can be
1036 # usefull after partition with one object shape, and some other
1037 # operations, where only the first argument has to be considered.
1038 # If theObject has only one argument shape, this flag is automatically
1039 # considered as True, not regarding really passed value.
1040 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1041 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1042 # \return list of published sub-shapes
1044 # @ref tui_restore_prs_params "Example"
1045 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1046 theInheritFirstArg=False, theAddPrefix=True):
1048 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1049 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1052 theObject published GEOM.GEOM_Object, arguments of which will be published
1053 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1054 If this list is empty, all operation arguments will be published
1055 theFindMethod method to search sub-shapes, corresponding to arguments and
1056 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1057 theInheritFirstArg set properties of the first argument for theObject.
1058 Do not publish sub-shapes in place of arguments, but only
1059 in place of sub-shapes of the first argument,
1060 because the whole shape corresponds to the first argument.
1061 Mainly to be used after transformations, but it also can be
1062 usefull after partition with one object shape, and some other
1063 operations, where only the first argument has to be considered.
1064 If theObject has only one argument shape, this flag is automatically
1065 considered as True, not regarding really passed value.
1066 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1067 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1070 list of published sub-shapes
1072 # Example: see GEOM_TestAll.py
1073 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1074 theFindMethod, theInheritFirstArg, theAddPrefix)
1076 # end of l3_restore_ss
1079 ## @addtogroup l3_basic_go
1082 ## Create point by three coordinates.
1083 # @param theX The X coordinate of the point.
1084 # @param theY The Y coordinate of the point.
1085 # @param theZ The Z coordinate of the point.
1086 # @param theName Object name; when specified, this parameter is used
1087 # for result publication in the study. Otherwise, if automatic
1088 # publication is switched on, default value is used for result name.
1090 # @return New GEOM.GEOM_Object, containing the created point.
1092 # @ref tui_creation_point "Example"
1093 @ManageTransactions("BasicOp")
1094 def MakeVertex(self, theX, theY, theZ, theName=None):
1096 Create point by three coordinates.
1099 theX The X coordinate of the point.
1100 theY The Y coordinate of the point.
1101 theZ The Z coordinate of the point.
1102 theName Object name; when specified, this parameter is used
1103 for result publication in the study. Otherwise, if automatic
1104 publication is switched on, default value is used for result name.
1107 New GEOM.GEOM_Object, containing the created point.
1109 # Example: see GEOM_TestAll.py
1110 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1111 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1112 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1113 anObj.SetParameters(Parameters)
1114 self._autoPublish(anObj, theName, "vertex")
1117 ## Create a point, distant from the referenced point
1118 # on the given distances along the coordinate axes.
1119 # @param theReference The referenced point.
1120 # @param theX Displacement from the referenced point along OX axis.
1121 # @param theY Displacement from the referenced point along OY axis.
1122 # @param theZ Displacement from the referenced point along OZ axis.
1123 # @param theName Object name; when specified, this parameter is used
1124 # for result publication in the study. Otherwise, if automatic
1125 # publication is switched on, default value is used for result name.
1127 # @return New GEOM.GEOM_Object, containing the created point.
1129 # @ref tui_creation_point "Example"
1130 @ManageTransactions("BasicOp")
1131 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1133 Create a point, distant from the referenced point
1134 on the given distances along the coordinate axes.
1137 theReference The referenced point.
1138 theX Displacement from the referenced point along OX axis.
1139 theY Displacement from the referenced point along OY axis.
1140 theZ Displacement from the referenced point along OZ axis.
1141 theName Object name; when specified, this parameter is used
1142 for result publication in the study. Otherwise, if automatic
1143 publication is switched on, default value is used for result name.
1146 New GEOM.GEOM_Object, containing the created point.
1148 # Example: see GEOM_TestAll.py
1149 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1150 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1151 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1152 anObj.SetParameters(Parameters)
1153 self._autoPublish(anObj, theName, "vertex")
1156 ## Create a point, corresponding to the given parameter on the given curve.
1157 # @param theRefCurve The referenced curve.
1158 # @param theParameter Value of parameter on the referenced curve.
1159 # @param theName Object name; when specified, this parameter is used
1160 # for result publication in the study. Otherwise, if automatic
1161 # publication is switched on, default value is used for result name.
1163 # @return New GEOM.GEOM_Object, containing the created point.
1165 # @ref tui_creation_point "Example"
1166 @ManageTransactions("BasicOp")
1167 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1169 Create a point, corresponding to the given parameter on the given curve.
1172 theRefCurve The referenced curve.
1173 theParameter Value of parameter on the referenced curve.
1174 theName Object name; when specified, this parameter is used
1175 for result publication in the study. Otherwise, if automatic
1176 publication is switched on, default value is used for result name.
1179 New GEOM.GEOM_Object, containing the created point.
1182 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1184 # Example: see GEOM_TestAll.py
1185 theParameter, Parameters = ParseParameters(theParameter)
1186 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1187 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1188 anObj.SetParameters(Parameters)
1189 self._autoPublish(anObj, theName, "vertex")
1192 ## Create a point by projection give coordinates on the given curve
1193 # @param theRefCurve The referenced curve.
1194 # @param theX X-coordinate in 3D space
1195 # @param theY Y-coordinate in 3D space
1196 # @param theZ Z-coordinate in 3D space
1197 # @param theName Object name; when specified, this parameter is used
1198 # for result publication in the study. Otherwise, if automatic
1199 # publication is switched on, default value is used for result name.
1201 # @return New GEOM.GEOM_Object, containing the created point.
1203 # @ref tui_creation_point "Example"
1204 @ManageTransactions("BasicOp")
1205 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1207 Create a point by projection give coordinates on the given curve
1210 theRefCurve The referenced curve.
1211 theX X-coordinate in 3D space
1212 theY Y-coordinate in 3D space
1213 theZ Z-coordinate in 3D space
1214 theName Object name; when specified, this parameter is used
1215 for result publication in the study. Otherwise, if automatic
1216 publication is switched on, default value is used for result name.
1219 New GEOM.GEOM_Object, containing the created point.
1222 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1224 # Example: see GEOM_TestAll.py
1225 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1226 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1227 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1228 anObj.SetParameters(Parameters)
1229 self._autoPublish(anObj, theName, "vertex")
1232 ## Create a point, corresponding to the given length on the given curve.
1233 # @param theRefCurve The referenced curve.
1234 # @param theLength Length on the referenced curve. It can be negative.
1235 # @param theStartPoint Point allowing to choose the direction for the calculation
1236 # of the length. If None, start from the first point of theRefCurve.
1237 # @param theName Object name; when specified, this parameter is used
1238 # for result publication in the study. Otherwise, if automatic
1239 # publication is switched on, default value is used for result name.
1241 # @return New GEOM.GEOM_Object, containing the created point.
1243 # @ref tui_creation_point "Example"
1244 @ManageTransactions("BasicOp")
1245 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1247 Create a point, corresponding to the given length on the given curve.
1250 theRefCurve The referenced curve.
1251 theLength Length on the referenced curve. It can be negative.
1252 theStartPoint Point allowing to choose the direction for the calculation
1253 of the length. If None, start from the first point of theRefCurve.
1254 theName Object name; when specified, this parameter is used
1255 for result publication in the study. Otherwise, if automatic
1256 publication is switched on, default value is used for result name.
1259 New GEOM.GEOM_Object, containing the created point.
1261 # Example: see GEOM_TestAll.py
1262 theLength, Parameters = ParseParameters(theLength)
1263 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1264 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1265 anObj.SetParameters(Parameters)
1266 self._autoPublish(anObj, theName, "vertex")
1269 ## Create a point, corresponding to the given parameters on the
1271 # @param theRefSurf The referenced surface.
1272 # @param theUParameter Value of U-parameter on the referenced surface.
1273 # @param theVParameter Value of V-parameter on the referenced surface.
1274 # @param theName Object name; when specified, this parameter is used
1275 # for result publication in the study. Otherwise, if automatic
1276 # publication is switched on, default value is used for result name.
1278 # @return New GEOM.GEOM_Object, containing the created point.
1280 # @ref swig_MakeVertexOnSurface "Example"
1281 @ManageTransactions("BasicOp")
1282 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1284 Create a point, corresponding to the given parameters on the
1288 theRefSurf The referenced surface.
1289 theUParameter Value of U-parameter on the referenced surface.
1290 theVParameter Value of V-parameter on the referenced surface.
1291 theName Object name; when specified, this parameter is used
1292 for result publication in the study. Otherwise, if automatic
1293 publication is switched on, default value is used for result name.
1296 New GEOM.GEOM_Object, containing the created point.
1299 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1301 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1302 # Example: see GEOM_TestAll.py
1303 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1304 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1305 anObj.SetParameters(Parameters);
1306 self._autoPublish(anObj, theName, "vertex")
1309 ## Create a point by projection give coordinates on the given surface
1310 # @param theRefSurf The referenced surface.
1311 # @param theX X-coordinate in 3D space
1312 # @param theY Y-coordinate in 3D space
1313 # @param theZ Z-coordinate in 3D space
1314 # @param theName Object name; when specified, this parameter is used
1315 # for result publication in the study. Otherwise, if automatic
1316 # publication is switched on, default value is used for result name.
1318 # @return New GEOM.GEOM_Object, containing the created point.
1320 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1321 @ManageTransactions("BasicOp")
1322 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1324 Create a point by projection give coordinates on the given surface
1327 theRefSurf The referenced surface.
1328 theX X-coordinate in 3D space
1329 theY Y-coordinate in 3D space
1330 theZ Z-coordinate in 3D space
1331 theName Object name; when specified, this parameter is used
1332 for result publication in the study. Otherwise, if automatic
1333 publication is switched on, default value is used for result name.
1336 New GEOM.GEOM_Object, containing the created point.
1339 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1341 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1342 # Example: see GEOM_TestAll.py
1343 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1344 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1345 anObj.SetParameters(Parameters);
1346 self._autoPublish(anObj, theName, "vertex")
1349 ## Create a point, which lays on the given face.
1350 # The point will lay in arbitrary place of the face.
1351 # The only condition on it is a non-zero distance to the face boundary.
1352 # Such point can be used to uniquely identify the face inside any
1353 # shape in case, when the shape does not contain overlapped faces.
1354 # @param theFace The referenced face.
1355 # @param theName Object name; when specified, this parameter is used
1356 # for result publication in the study. Otherwise, if automatic
1357 # publication is switched on, default value is used for result name.
1359 # @return New GEOM.GEOM_Object, containing the created point.
1361 # @ref swig_MakeVertexInsideFace "Example"
1362 @ManageTransactions("BasicOp")
1363 def MakeVertexInsideFace (self, theFace, theName=None):
1365 Create a point, which lays on the given face.
1366 The point will lay in arbitrary place of the face.
1367 The only condition on it is a non-zero distance to the face boundary.
1368 Such point can be used to uniquely identify the face inside any
1369 shape in case, when the shape does not contain overlapped faces.
1372 theFace The referenced face.
1373 theName Object name; when specified, this parameter is used
1374 for result publication in the study. Otherwise, if automatic
1375 publication is switched on, default value is used for result name.
1378 New GEOM.GEOM_Object, containing the created point.
1381 p_on_face = geompy.MakeVertexInsideFace(Face)
1383 # Example: see GEOM_TestAll.py
1384 anObj = self.BasicOp.MakePointOnFace(theFace)
1385 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1386 self._autoPublish(anObj, theName, "vertex")
1389 ## Create a point on intersection of two lines.
1390 # @param theRefLine1, theRefLine2 The referenced lines.
1391 # @param theName Object name; when specified, this parameter is used
1392 # for result publication in the study. Otherwise, if automatic
1393 # publication is switched on, default value is used for result name.
1395 # @return New GEOM.GEOM_Object, containing the created point.
1397 # @ref swig_MakeVertexOnLinesIntersection "Example"
1398 @ManageTransactions("BasicOp")
1399 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1401 Create a point on intersection of two lines.
1404 theRefLine1, theRefLine2 The referenced lines.
1405 theName Object name; when specified, this parameter is used
1406 for result publication in the study. Otherwise, if automatic
1407 publication is switched on, default value is used for result name.
1410 New GEOM.GEOM_Object, containing the created point.
1412 # Example: see GEOM_TestAll.py
1413 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1414 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1415 self._autoPublish(anObj, theName, "vertex")
1418 ## Create a tangent, corresponding to the given parameter on the given curve.
1419 # @param theRefCurve The referenced curve.
1420 # @param theParameter Value of parameter on the referenced curve.
1421 # @param theName Object name; when specified, this parameter is used
1422 # for result publication in the study. Otherwise, if automatic
1423 # publication is switched on, default value is used for result name.
1425 # @return New GEOM.GEOM_Object, containing the created tangent.
1427 # @ref swig_MakeTangentOnCurve "Example"
1428 @ManageTransactions("BasicOp")
1429 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1431 Create a tangent, corresponding to the given parameter on the given curve.
1434 theRefCurve The referenced curve.
1435 theParameter Value of parameter on the referenced curve.
1436 theName Object name; when specified, this parameter is used
1437 for result publication in the study. Otherwise, if automatic
1438 publication is switched on, default value is used for result name.
1441 New GEOM.GEOM_Object, containing the created tangent.
1444 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1446 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1447 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1448 self._autoPublish(anObj, theName, "tangent")
1451 ## Create a tangent plane, corresponding to the given parameter on the given face.
1452 # @param theFace The face for which tangent plane should be built.
1453 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1454 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1455 # @param theTrimSize the size of plane.
1456 # @param theName Object name; when specified, this parameter is used
1457 # for result publication in the study. Otherwise, if automatic
1458 # publication is switched on, default value is used for result name.
1460 # @return New GEOM.GEOM_Object, containing the created tangent.
1462 # @ref swig_MakeTangentPlaneOnFace "Example"
1463 @ManageTransactions("BasicOp")
1464 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1466 Create a tangent plane, corresponding to the given parameter on the given face.
1469 theFace The face for which tangent plane should be built.
1470 theParameterV vertical value of the center point (0.0 - 1.0).
1471 theParameterU horisontal value of the center point (0.0 - 1.0).
1472 theTrimSize the size of plane.
1473 theName Object name; when specified, this parameter is used
1474 for result publication in the study. Otherwise, if automatic
1475 publication is switched on, default value is used for result name.
1478 New GEOM.GEOM_Object, containing the created tangent.
1481 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1483 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1484 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1485 self._autoPublish(anObj, theName, "tangent")
1488 ## Create a vector with the given components.
1489 # @param theDX X component of the vector.
1490 # @param theDY Y component of the vector.
1491 # @param theDZ Z component of the vector.
1492 # @param theName Object name; when specified, this parameter is used
1493 # for result publication in the study. Otherwise, if automatic
1494 # publication is switched on, default value is used for result name.
1496 # @return New GEOM.GEOM_Object, containing the created vector.
1498 # @ref tui_creation_vector "Example"
1499 @ManageTransactions("BasicOp")
1500 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1502 Create a vector with the given components.
1505 theDX X component of the vector.
1506 theDY Y component of the vector.
1507 theDZ Z component of the vector.
1508 theName Object name; when specified, this parameter is used
1509 for result publication in the study. Otherwise, if automatic
1510 publication is switched on, default value is used for result name.
1513 New GEOM.GEOM_Object, containing the created vector.
1515 # Example: see GEOM_TestAll.py
1516 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1517 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1518 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1519 anObj.SetParameters(Parameters)
1520 self._autoPublish(anObj, theName, "vector")
1523 ## Create a vector between two points.
1524 # @param thePnt1 Start point for the vector.
1525 # @param thePnt2 End point for the vector.
1526 # @param theName Object name; when specified, this parameter is used
1527 # for result publication in the study. Otherwise, if automatic
1528 # publication is switched on, default value is used for result name.
1530 # @return New GEOM.GEOM_Object, containing the created vector.
1532 # @ref tui_creation_vector "Example"
1533 @ManageTransactions("BasicOp")
1534 def MakeVector(self, thePnt1, thePnt2, theName=None):
1536 Create a vector between two points.
1539 thePnt1 Start point for the vector.
1540 thePnt2 End point for the vector.
1541 theName Object name; when specified, this parameter is used
1542 for result publication in the study. Otherwise, if automatic
1543 publication is switched on, default value is used for result name.
1546 New GEOM.GEOM_Object, containing the created vector.
1548 # Example: see GEOM_TestAll.py
1549 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1550 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1551 self._autoPublish(anObj, theName, "vector")
1554 ## Create a line, passing through the given point
1555 # and parrallel to the given direction
1556 # @param thePnt Point. The resulting line will pass through it.
1557 # @param theDir Direction. The resulting line will be parallel to it.
1558 # @param theName Object name; when specified, this parameter is used
1559 # for result publication in the study. Otherwise, if automatic
1560 # publication is switched on, default value is used for result name.
1562 # @return New GEOM.GEOM_Object, containing the created line.
1564 # @ref tui_creation_line "Example"
1565 @ManageTransactions("BasicOp")
1566 def MakeLine(self, thePnt, theDir, theName=None):
1568 Create a line, passing through the given point
1569 and parrallel to the given direction
1572 thePnt Point. The resulting line will pass through it.
1573 theDir Direction. The resulting line will be parallel to it.
1574 theName Object name; when specified, this parameter is used
1575 for result publication in the study. Otherwise, if automatic
1576 publication is switched on, default value is used for result name.
1579 New GEOM.GEOM_Object, containing the created line.
1581 # Example: see GEOM_TestAll.py
1582 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1583 RaiseIfFailed("MakeLine", self.BasicOp)
1584 self._autoPublish(anObj, theName, "line")
1587 ## Create a line, passing through the given points
1588 # @param thePnt1 First of two points, defining the line.
1589 # @param thePnt2 Second of two points, defining the line.
1590 # @param theName Object name; when specified, this parameter is used
1591 # for result publication in the study. Otherwise, if automatic
1592 # publication is switched on, default value is used for result name.
1594 # @return New GEOM.GEOM_Object, containing the created line.
1596 # @ref tui_creation_line "Example"
1597 @ManageTransactions("BasicOp")
1598 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1600 Create a line, passing through the given points
1603 thePnt1 First of two points, defining the line.
1604 thePnt2 Second of two points, defining the line.
1605 theName Object name; when specified, this parameter is used
1606 for result publication in the study. Otherwise, if automatic
1607 publication is switched on, default value is used for result name.
1610 New GEOM.GEOM_Object, containing the created line.
1612 # Example: see GEOM_TestAll.py
1613 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1614 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1615 self._autoPublish(anObj, theName, "line")
1618 ## Create a line on two faces intersection.
1619 # @param theFace1 First of two faces, defining the line.
1620 # @param theFace2 Second of two faces, defining the line.
1621 # @param theName Object name; when specified, this parameter is used
1622 # for result publication in the study. Otherwise, if automatic
1623 # publication is switched on, default value is used for result name.
1625 # @return New GEOM.GEOM_Object, containing the created line.
1627 # @ref swig_MakeLineTwoFaces "Example"
1628 @ManageTransactions("BasicOp")
1629 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1631 Create a line on two faces intersection.
1634 theFace1 First of two faces, defining the line.
1635 theFace2 Second of two faces, defining the line.
1636 theName Object name; when specified, this parameter is used
1637 for result publication in the study. Otherwise, if automatic
1638 publication is switched on, default value is used for result name.
1641 New GEOM.GEOM_Object, containing the created line.
1643 # Example: see GEOM_TestAll.py
1644 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1645 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1646 self._autoPublish(anObj, theName, "line")
1649 ## Create a plane, passing through the given point
1650 # and normal to the given vector.
1651 # @param thePnt Point, the plane has to pass through.
1652 # @param theVec Vector, defining the plane normal direction.
1653 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1654 # @param theName Object name; when specified, this parameter is used
1655 # for result publication in the study. Otherwise, if automatic
1656 # publication is switched on, default value is used for result name.
1658 # @return New GEOM.GEOM_Object, containing the created plane.
1660 # @ref tui_creation_plane "Example"
1661 @ManageTransactions("BasicOp")
1662 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1664 Create a plane, passing through the given point
1665 and normal to the given vector.
1668 thePnt Point, the plane has to pass through.
1669 theVec Vector, defining the plane normal direction.
1670 theTrimSize Half size of a side of quadrangle face, representing the plane.
1671 theName Object name; when specified, this parameter is used
1672 for result publication in the study. Otherwise, if automatic
1673 publication is switched on, default value is used for result name.
1676 New GEOM.GEOM_Object, containing the created plane.
1678 # Example: see GEOM_TestAll.py
1679 theTrimSize, Parameters = ParseParameters(theTrimSize);
1680 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1681 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1682 anObj.SetParameters(Parameters)
1683 self._autoPublish(anObj, theName, "plane")
1686 ## Create a plane, passing through the three given points
1687 # @param thePnt1 First of three points, defining the plane.
1688 # @param thePnt2 Second of three points, defining the plane.
1689 # @param thePnt3 Fird of three points, defining the plane.
1690 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1691 # @param theName Object name; when specified, this parameter is used
1692 # for result publication in the study. Otherwise, if automatic
1693 # publication is switched on, default value is used for result name.
1695 # @return New GEOM.GEOM_Object, containing the created plane.
1697 # @ref tui_creation_plane "Example"
1698 @ManageTransactions("BasicOp")
1699 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1701 Create a plane, passing through the three given points
1704 thePnt1 First of three points, defining the plane.
1705 thePnt2 Second of three points, defining the plane.
1706 thePnt3 Fird of three points, defining the plane.
1707 theTrimSize Half size of a side of quadrangle face, representing the plane.
1708 theName Object name; when specified, this parameter is used
1709 for result publication in the study. Otherwise, if automatic
1710 publication is switched on, default value is used for result name.
1713 New GEOM.GEOM_Object, containing the created plane.
1715 # Example: see GEOM_TestAll.py
1716 theTrimSize, Parameters = ParseParameters(theTrimSize);
1717 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1718 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1719 anObj.SetParameters(Parameters)
1720 self._autoPublish(anObj, theName, "plane")
1723 ## Create a plane, similar to the existing one, but with another size of representing face.
1724 # @param theFace Referenced plane or LCS(Marker).
1725 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1726 # @param theName Object name; when specified, this parameter is used
1727 # for result publication in the study. Otherwise, if automatic
1728 # publication is switched on, default value is used for result name.
1730 # @return New GEOM.GEOM_Object, containing the created plane.
1732 # @ref tui_creation_plane "Example"
1733 @ManageTransactions("BasicOp")
1734 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1736 Create a plane, similar to the existing one, but with another size of representing face.
1739 theFace Referenced plane or LCS(Marker).
1740 theTrimSize New half size of a side of quadrangle face, representing the plane.
1741 theName Object name; when specified, this parameter is used
1742 for result publication in the study. Otherwise, if automatic
1743 publication is switched on, default value is used for result name.
1746 New GEOM.GEOM_Object, containing the created plane.
1748 # Example: see GEOM_TestAll.py
1749 theTrimSize, Parameters = ParseParameters(theTrimSize);
1750 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1751 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1752 anObj.SetParameters(Parameters)
1753 self._autoPublish(anObj, theName, "plane")
1756 ## Create a plane, passing through the 2 vectors
1757 # with center in a start point of the first vector.
1758 # @param theVec1 Vector, defining center point and plane direction.
1759 # @param theVec2 Vector, defining the plane normal direction.
1760 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1761 # @param theName Object name; when specified, this parameter is used
1762 # for result publication in the study. Otherwise, if automatic
1763 # publication is switched on, default value is used for result name.
1765 # @return New GEOM.GEOM_Object, containing the created plane.
1767 # @ref tui_creation_plane "Example"
1768 @ManageTransactions("BasicOp")
1769 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1771 Create a plane, passing through the 2 vectors
1772 with center in a start point of the first vector.
1775 theVec1 Vector, defining center point and plane direction.
1776 theVec2 Vector, defining the plane normal direction.
1777 theTrimSize Half size of a side of quadrangle face, representing the plane.
1778 theName Object name; when specified, this parameter is used
1779 for result publication in the study. Otherwise, if automatic
1780 publication is switched on, default value is used for result name.
1783 New GEOM.GEOM_Object, containing the created plane.
1785 # Example: see GEOM_TestAll.py
1786 theTrimSize, Parameters = ParseParameters(theTrimSize);
1787 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1788 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1789 anObj.SetParameters(Parameters)
1790 self._autoPublish(anObj, theName, "plane")
1793 ## Create a plane, based on a Local coordinate system.
1794 # @param theLCS coordinate system, defining plane.
1795 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1796 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1797 # @param theName Object name; when specified, this parameter is used
1798 # for result publication in the study. Otherwise, if automatic
1799 # publication is switched on, default value is used for result name.
1801 # @return New GEOM.GEOM_Object, containing the created plane.
1803 # @ref tui_creation_plane "Example"
1804 @ManageTransactions("BasicOp")
1805 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1807 Create a plane, based on a Local coordinate system.
1810 theLCS coordinate system, defining plane.
1811 theTrimSize Half size of a side of quadrangle face, representing the plane.
1812 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1813 theName Object name; when specified, this parameter is used
1814 for result publication in the study. Otherwise, if automatic
1815 publication is switched on, default value is used for result name.
1818 New GEOM.GEOM_Object, containing the created plane.
1820 # Example: see GEOM_TestAll.py
1821 theTrimSize, Parameters = ParseParameters(theTrimSize);
1822 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1823 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1824 anObj.SetParameters(Parameters)
1825 self._autoPublish(anObj, theName, "plane")
1828 ## Create a local coordinate system.
1829 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1830 # @param XDX,XDY,XDZ Three components of OX direction
1831 # @param YDX,YDY,YDZ Three components of OY direction
1832 # @param theName Object name; when specified, this parameter is used
1833 # for result publication in the study. Otherwise, if automatic
1834 # publication is switched on, default value is used for result name.
1836 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1838 # @ref swig_MakeMarker "Example"
1839 @ManageTransactions("BasicOp")
1840 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1842 Create a local coordinate system.
1845 OX,OY,OZ Three coordinates of coordinate system origin.
1846 XDX,XDY,XDZ Three components of OX direction
1847 YDX,YDY,YDZ Three components of OY direction
1848 theName Object name; when specified, this parameter is used
1849 for result publication in the study. Otherwise, if automatic
1850 publication is switched on, default value is used for result name.
1853 New GEOM.GEOM_Object, containing the created coordinate system.
1855 # Example: see GEOM_TestAll.py
1856 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1857 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1858 RaiseIfFailed("MakeMarker", self.BasicOp)
1859 anObj.SetParameters(Parameters)
1860 self._autoPublish(anObj, theName, "lcs")
1863 ## Create a local coordinate system from shape.
1864 # @param theShape The initial shape to detect the coordinate system.
1865 # @param theName Object name; when specified, this parameter is used
1866 # for result publication in the study. Otherwise, if automatic
1867 # publication is switched on, default value is used for result name.
1869 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1871 # @ref tui_creation_lcs "Example"
1872 @ManageTransactions("BasicOp")
1873 def MakeMarkerFromShape(self, theShape, theName=None):
1875 Create a local coordinate system from shape.
1878 theShape The initial shape to detect the coordinate system.
1879 theName Object name; when specified, this parameter is used
1880 for result publication in the study. Otherwise, if automatic
1881 publication is switched on, default value is used for result name.
1884 New GEOM.GEOM_Object, containing the created coordinate system.
1886 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1887 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1888 self._autoPublish(anObj, theName, "lcs")
1891 ## Create a local coordinate system from point and two vectors.
1892 # @param theOrigin Point of coordinate system origin.
1893 # @param theXVec Vector of X direction
1894 # @param theYVec Vector of Y direction
1895 # @param theName Object name; when specified, this parameter is used
1896 # for result publication in the study. Otherwise, if automatic
1897 # publication is switched on, default value is used for result name.
1899 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1901 # @ref tui_creation_lcs "Example"
1902 @ManageTransactions("BasicOp")
1903 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1905 Create a local coordinate system from point and two vectors.
1908 theOrigin Point of coordinate system origin.
1909 theXVec Vector of X direction
1910 theYVec Vector of Y direction
1911 theName Object name; when specified, this parameter is used
1912 for result publication in the study. Otherwise, if automatic
1913 publication is switched on, default value is used for result name.
1916 New GEOM.GEOM_Object, containing the created coordinate system.
1919 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1920 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1921 self._autoPublish(anObj, theName, "lcs")
1924 # end of l3_basic_go
1927 ## @addtogroup l4_curves
1930 ## Create an arc of circle, passing through three given points.
1931 # @param thePnt1 Start point of the arc.
1932 # @param thePnt2 Middle point of the arc.
1933 # @param thePnt3 End point of the arc.
1934 # @param theName Object name; when specified, this parameter is used
1935 # for result publication in the study. Otherwise, if automatic
1936 # publication is switched on, default value is used for result name.
1938 # @return New GEOM.GEOM_Object, containing the created arc.
1940 # @ref swig_MakeArc "Example"
1941 @ManageTransactions("CurvesOp")
1942 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1944 Create an arc of circle, passing through three given points.
1947 thePnt1 Start point of the arc.
1948 thePnt2 Middle point of the arc.
1949 thePnt3 End point of the arc.
1950 theName Object name; when specified, this parameter is used
1951 for result publication in the study. Otherwise, if automatic
1952 publication is switched on, default value is used for result name.
1955 New GEOM.GEOM_Object, containing the created arc.
1957 # Example: see GEOM_TestAll.py
1958 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1959 RaiseIfFailed("MakeArc", self.CurvesOp)
1960 self._autoPublish(anObj, theName, "arc")
1963 ## Create an arc of circle from a center and 2 points.
1964 # @param thePnt1 Center of the arc
1965 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1966 # @param thePnt3 End point of the arc (Gives also a direction)
1967 # @param theSense Orientation of the arc
1968 # @param theName Object name; when specified, this parameter is used
1969 # for result publication in the study. Otherwise, if automatic
1970 # publication is switched on, default value is used for result name.
1972 # @return New GEOM.GEOM_Object, containing the created arc.
1974 # @ref swig_MakeArc "Example"
1975 @ManageTransactions("CurvesOp")
1976 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1978 Create an arc of circle from a center and 2 points.
1981 thePnt1 Center of the arc
1982 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1983 thePnt3 End point of the arc (Gives also a direction)
1984 theSense Orientation of the arc
1985 theName Object name; when specified, this parameter is used
1986 for result publication in the study. Otherwise, if automatic
1987 publication is switched on, default value is used for result name.
1990 New GEOM.GEOM_Object, containing the created arc.
1992 # Example: see GEOM_TestAll.py
1993 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1994 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1995 self._autoPublish(anObj, theName, "arc")
1998 ## Create an arc of ellipse, of center and two points.
1999 # @param theCenter Center of the arc.
2000 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2001 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2002 # @param theName Object name; when specified, this parameter is used
2003 # for result publication in the study. Otherwise, if automatic
2004 # publication is switched on, default value is used for result name.
2006 # @return New GEOM.GEOM_Object, containing the created arc.
2008 # @ref swig_MakeArc "Example"
2009 @ManageTransactions("CurvesOp")
2010 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2012 Create an arc of ellipse, of center and two points.
2015 theCenter Center of the arc.
2016 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2017 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2018 theName Object name; when specified, this parameter is used
2019 for result publication in the study. Otherwise, if automatic
2020 publication is switched on, default value is used for result name.
2023 New GEOM.GEOM_Object, containing the created arc.
2025 # Example: see GEOM_TestAll.py
2026 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2027 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2028 self._autoPublish(anObj, theName, "arc")
2031 ## Create a circle with given center, normal vector and radius.
2032 # @param thePnt Circle center.
2033 # @param theVec Vector, normal to the plane of the circle.
2034 # @param theR Circle radius.
2035 # @param theName Object name; when specified, this parameter is used
2036 # for result publication in the study. Otherwise, if automatic
2037 # publication is switched on, default value is used for result name.
2039 # @return New GEOM.GEOM_Object, containing the created circle.
2041 # @ref tui_creation_circle "Example"
2042 @ManageTransactions("CurvesOp")
2043 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2045 Create a circle with given center, normal vector and radius.
2048 thePnt Circle center.
2049 theVec Vector, normal to the plane of the circle.
2051 theName Object name; when specified, this parameter is used
2052 for result publication in the study. Otherwise, if automatic
2053 publication is switched on, default value is used for result name.
2056 New GEOM.GEOM_Object, containing the created circle.
2058 # Example: see GEOM_TestAll.py
2059 theR, Parameters = ParseParameters(theR)
2060 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2061 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2062 anObj.SetParameters(Parameters)
2063 self._autoPublish(anObj, theName, "circle")
2066 ## Create a circle with given radius.
2067 # Center of the circle will be in the origin of global
2068 # coordinate system and normal vector will be codirected with Z axis
2069 # @param theR Circle radius.
2070 # @param theName Object name; when specified, this parameter is used
2071 # for result publication in the study. Otherwise, if automatic
2072 # publication is switched on, default value is used for result name.
2074 # @return New GEOM.GEOM_Object, containing the created circle.
2075 @ManageTransactions("CurvesOp")
2076 def MakeCircleR(self, theR, theName=None):
2078 Create a circle with given radius.
2079 Center of the circle will be in the origin of global
2080 coordinate system and normal vector will be codirected with Z axis
2084 theName Object name; when specified, this parameter is used
2085 for result publication in the study. Otherwise, if automatic
2086 publication is switched on, default value is used for result name.
2089 New GEOM.GEOM_Object, containing the created circle.
2091 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2092 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2093 self._autoPublish(anObj, theName, "circle")
2096 ## Create a circle, passing through three given points
2097 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2098 # @param theName Object name; when specified, this parameter is used
2099 # for result publication in the study. Otherwise, if automatic
2100 # publication is switched on, default value is used for result name.
2102 # @return New GEOM.GEOM_Object, containing the created circle.
2104 # @ref tui_creation_circle "Example"
2105 @ManageTransactions("CurvesOp")
2106 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2108 Create a circle, passing through three given points
2111 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2112 theName Object name; when specified, this parameter is used
2113 for result publication in the study. Otherwise, if automatic
2114 publication is switched on, default value is used for result name.
2117 New GEOM.GEOM_Object, containing the created circle.
2119 # Example: see GEOM_TestAll.py
2120 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2121 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2122 self._autoPublish(anObj, theName, "circle")
2125 ## Create a circle, with given point1 as center,
2126 # passing through the point2 as radius and laying in the plane,
2127 # defined by all three given points.
2128 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2129 # @param theName Object name; when specified, this parameter is used
2130 # for result publication in the study. Otherwise, if automatic
2131 # publication is switched on, default value is used for result name.
2133 # @return New GEOM.GEOM_Object, containing the created circle.
2135 # @ref swig_MakeCircle "Example"
2136 @ManageTransactions("CurvesOp")
2137 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2139 Create a circle, with given point1 as center,
2140 passing through the point2 as radius and laying in the plane,
2141 defined by all three given points.
2144 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2145 theName Object name; when specified, this parameter is used
2146 for result publication in the study. Otherwise, if automatic
2147 publication is switched on, default value is used for result name.
2150 New GEOM.GEOM_Object, containing the created circle.
2152 # Example: see GEOM_example6.py
2153 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2154 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2155 self._autoPublish(anObj, theName, "circle")
2158 ## Create an ellipse with given center, normal vector and radiuses.
2159 # @param thePnt Ellipse center.
2160 # @param theVec Vector, normal to the plane of the ellipse.
2161 # @param theRMajor Major ellipse radius.
2162 # @param theRMinor Minor ellipse radius.
2163 # @param theVecMaj Vector, direction of the ellipse's main axis.
2164 # @param theName Object name; when specified, this parameter is used
2165 # for result publication in the study. Otherwise, if automatic
2166 # publication is switched on, default value is used for result name.
2168 # @return New GEOM.GEOM_Object, containing the created ellipse.
2170 # @ref tui_creation_ellipse "Example"
2171 @ManageTransactions("CurvesOp")
2172 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2174 Create an ellipse with given center, normal vector and radiuses.
2177 thePnt Ellipse center.
2178 theVec Vector, normal to the plane of the ellipse.
2179 theRMajor Major ellipse radius.
2180 theRMinor Minor ellipse radius.
2181 theVecMaj Vector, direction of the ellipse's main axis.
2182 theName Object name; when specified, this parameter is used
2183 for result publication in the study. Otherwise, if automatic
2184 publication is switched on, default value is used for result name.
2187 New GEOM.GEOM_Object, containing the created ellipse.
2189 # Example: see GEOM_TestAll.py
2190 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2191 if theVecMaj is not None:
2192 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2194 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2196 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2197 anObj.SetParameters(Parameters)
2198 self._autoPublish(anObj, theName, "ellipse")
2201 ## Create an ellipse with given radiuses.
2202 # Center of the ellipse will be in the origin of global
2203 # coordinate system and normal vector will be codirected with Z axis
2204 # @param theRMajor Major ellipse radius.
2205 # @param theRMinor Minor ellipse radius.
2206 # @param theName Object name; when specified, this parameter is used
2207 # for result publication in the study. Otherwise, if automatic
2208 # publication is switched on, default value is used for result name.
2210 # @return New GEOM.GEOM_Object, containing the created ellipse.
2211 @ManageTransactions("CurvesOp")
2212 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2214 Create an ellipse with given radiuses.
2215 Center of the ellipse will be in the origin of global
2216 coordinate system and normal vector will be codirected with Z axis
2219 theRMajor Major ellipse radius.
2220 theRMinor Minor ellipse radius.
2221 theName Object name; when specified, this parameter is used
2222 for result publication in the study. Otherwise, if automatic
2223 publication is switched on, default value is used for result name.
2226 New GEOM.GEOM_Object, containing the created ellipse.
2228 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2229 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2230 self._autoPublish(anObj, theName, "ellipse")
2233 ## Create a polyline on the set of points.
2234 # @param thePoints Sequence of points for the polyline.
2235 # @param theIsClosed If True, build a closed wire.
2236 # @param theName Object name; when specified, this parameter is used
2237 # for result publication in the study. Otherwise, if automatic
2238 # publication is switched on, default value is used for result name.
2240 # @return New GEOM.GEOM_Object, containing the created polyline.
2242 # @ref tui_creation_curve "Example"
2243 @ManageTransactions("CurvesOp")
2244 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2246 Create a polyline on the set of points.
2249 thePoints Sequence of points for the polyline.
2250 theIsClosed If True, build a closed wire.
2251 theName Object name; when specified, this parameter is used
2252 for result publication in the study. Otherwise, if automatic
2253 publication is switched on, default value is used for result name.
2256 New GEOM.GEOM_Object, containing the created polyline.
2258 # Example: see GEOM_TestAll.py
2259 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2260 RaiseIfFailed("MakePolyline", self.CurvesOp)
2261 self._autoPublish(anObj, theName, "polyline")
2264 ## Create bezier curve on the set of points.
2265 # @param thePoints Sequence of points for the bezier curve.
2266 # @param theIsClosed If True, build a closed curve.
2267 # @param theName Object name; when specified, this parameter is used
2268 # for result publication in the study. Otherwise, if automatic
2269 # publication is switched on, default value is used for result name.
2271 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2273 # @ref tui_creation_curve "Example"
2274 @ManageTransactions("CurvesOp")
2275 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2277 Create bezier curve on the set of points.
2280 thePoints Sequence of points for the bezier curve.
2281 theIsClosed If True, build a closed curve.
2282 theName Object name; when specified, this parameter is used
2283 for result publication in the study. Otherwise, if automatic
2284 publication is switched on, default value is used for result name.
2287 New GEOM.GEOM_Object, containing the created bezier curve.
2289 # Example: see GEOM_TestAll.py
2290 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2291 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2292 self._autoPublish(anObj, theName, "bezier")
2295 ## Create B-Spline curve on the set of points.
2296 # @param thePoints Sequence of points for the B-Spline curve.
2297 # @param theIsClosed If True, build a closed curve.
2298 # @param theDoReordering If TRUE, the algo does not follow the order of
2299 # \a thePoints but searches for the closest vertex.
2300 # @param theName Object name; when specified, this parameter is used
2301 # for result publication in the study. Otherwise, if automatic
2302 # publication is switched on, default value is used for result name.
2304 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2306 # @ref tui_creation_curve "Example"
2307 @ManageTransactions("CurvesOp")
2308 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2310 Create B-Spline curve on the set of points.
2313 thePoints Sequence of points for the B-Spline curve.
2314 theIsClosed If True, build a closed curve.
2315 theDoReordering If True, the algo does not follow the order of
2316 thePoints but searches for the closest vertex.
2317 theName Object name; when specified, this parameter is used
2318 for result publication in the study. Otherwise, if automatic
2319 publication is switched on, default value is used for result name.
2322 New GEOM.GEOM_Object, containing the created B-Spline curve.
2324 # Example: see GEOM_TestAll.py
2325 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2326 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2327 self._autoPublish(anObj, theName, "bspline")
2330 ## Create B-Spline curve on the set of points.
2331 # @param thePoints Sequence of points for the B-Spline curve.
2332 # @param theFirstVec Vector object, defining the curve direction at its first point.
2333 # @param theLastVec Vector object, defining the curve direction at its last point.
2334 # @param theName Object name; when specified, this parameter is used
2335 # for result publication in the study. Otherwise, if automatic
2336 # publication is switched on, default value is used for result name.
2338 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2340 # @ref tui_creation_curve "Example"
2341 @ManageTransactions("CurvesOp")
2342 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2344 Create B-Spline curve on the set of points.
2347 thePoints Sequence of points for the B-Spline curve.
2348 theFirstVec Vector object, defining the curve direction at its first point.
2349 theLastVec Vector object, defining the curve direction at its last point.
2350 theName Object name; when specified, this parameter is used
2351 for result publication in the study. Otherwise, if automatic
2352 publication is switched on, default value is used for result name.
2355 New GEOM.GEOM_Object, containing the created B-Spline curve.
2357 # Example: see GEOM_TestAll.py
2358 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2359 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2360 self._autoPublish(anObj, theName, "bspline")
2363 ## Creates a curve using the parametric definition of the basic points.
2364 # @param thexExpr parametric equation of the coordinates X.
2365 # @param theyExpr parametric equation of the coordinates Y.
2366 # @param thezExpr parametric equation of the coordinates Z.
2367 # @param theParamMin the minimal value of the parameter.
2368 # @param theParamMax the maximum value of the parameter.
2369 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2370 # @param theCurveType the type of the curve,
2371 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2372 # @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.
2373 # @param theName Object name; when specified, this parameter is used
2374 # for result publication in the study. Otherwise, if automatic
2375 # publication is switched on, default value is used for result name.
2377 # @return New GEOM.GEOM_Object, containing the created curve.
2379 # @ref tui_creation_curve "Example"
2380 @ManageTransactions("CurvesOp")
2381 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2382 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2384 Creates a curve using the parametric definition of the basic points.
2387 thexExpr parametric equation of the coordinates X.
2388 theyExpr parametric equation of the coordinates Y.
2389 thezExpr parametric equation of the coordinates Z.
2390 theParamMin the minimal value of the parameter.
2391 theParamMax the maximum value of the parameter.
2392 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2393 theCurveType the type of the curve,
2394 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2395 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2396 method is used which can lead to a bug.
2397 theName Object name; when specified, this parameter is used
2398 for result publication in the study. Otherwise, if automatic
2399 publication is switched on, default value is used for result name.
2402 New GEOM.GEOM_Object, containing the created curve.
2404 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2406 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2408 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2409 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2410 anObj.SetParameters(Parameters)
2411 self._autoPublish(anObj, theName, "curve")
2414 ## Create an isoline curve on a face.
2415 # @param theFace the face for which an isoline is created.
2416 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2418 # @param theParameter the U parameter for U-isoline or V parameter
2420 # @param theName Object name; when specified, this parameter is used
2421 # for result publication in the study. Otherwise, if automatic
2422 # publication is switched on, default value is used for result name.
2424 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2425 # a compound of edges.
2427 # @ref tui_creation_curve "Example"
2428 @ManageTransactions("CurvesOp")
2429 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2431 Create an isoline curve on a face.
2434 theFace the face for which an isoline is created.
2435 IsUIsoline True for U-isoline creation; False for V-isoline
2437 theParameter the U parameter for U-isoline or V parameter
2439 theName Object name; when specified, this parameter is used
2440 for result publication in the study. Otherwise, if automatic
2441 publication is switched on, default value is used for result name.
2444 New GEOM.GEOM_Object, containing the created isoline edge or a
2447 # Example: see GEOM_TestAll.py
2448 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2449 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2451 self._autoPublish(anObj, theName, "U-Isoline")
2453 self._autoPublish(anObj, theName, "V-Isoline")
2459 ## @addtogroup l3_sketcher
2462 ## Create a sketcher (wire or face), following the textual description,
2463 # passed through <VAR>theCommand</VAR> argument. \n
2464 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2465 # Format of the description string have to be the following:
2467 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2470 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2472 # - "R angle" : Set the direction by angle
2473 # - "D dx dy" : Set the direction by DX & DY
2476 # - "TT x y" : Create segment by point at X & Y
2477 # - "T dx dy" : Create segment by point with DX & DY
2478 # - "L length" : Create segment by direction & Length
2479 # - "IX x" : Create segment by direction & Intersect. X
2480 # - "IY y" : Create segment by direction & Intersect. Y
2483 # - "C radius length" : Create arc by direction, radius and length(in degree)
2484 # - "AA x y": Create arc by point at X & Y
2485 # - "A dx dy" : Create arc by point with DX & DY
2486 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2487 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2488 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2489 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2492 # - "WW" : Close Wire (to finish)
2493 # - "WF" : Close Wire and build face (to finish)
2496 # - Flag1 (= reverse) is 0 or 2 ...
2497 # - if 0 the drawn arc is the one of lower angle (< Pi)
2498 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2501 # - Flag2 (= control tolerance) is 0 or 1 ...
2502 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2503 # - if 1 the wire is built only if the end point is on the arc
2504 # with a tolerance of 10^-7 on the distance else the creation fails
2506 # @param theCommand String, defining the sketcher in local
2507 # coordinates of the working plane.
2508 # @param theWorkingPlane Nine double values, defining origin,
2509 # OZ and OX directions of the working plane.
2510 # @param theName Object name; when specified, this parameter is used
2511 # for result publication in the study. Otherwise, if automatic
2512 # publication is switched on, default value is used for result name.
2514 # @return New GEOM.GEOM_Object, containing the created wire.
2516 # @ref tui_sketcher_page "Example"
2517 @ManageTransactions("CurvesOp")
2518 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2520 Create a sketcher (wire or face), following the textual description, passed
2521 through theCommand argument.
2522 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2523 Format of the description string have to be the following:
2524 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2526 - x1, y1 are coordinates of the first sketcher point (zero by default),
2528 - "R angle" : Set the direction by angle
2529 - "D dx dy" : Set the direction by DX & DY
2531 - "TT x y" : Create segment by point at X & Y
2532 - "T dx dy" : Create segment by point with DX & DY
2533 - "L length" : Create segment by direction & Length
2534 - "IX x" : Create segment by direction & Intersect. X
2535 - "IY y" : Create segment by direction & Intersect. Y
2537 - "C radius length" : Create arc by direction, radius and length(in degree)
2538 - "AA x y": Create arc by point at X & Y
2539 - "A dx dy" : Create arc by point with DX & DY
2540 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2541 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2542 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2543 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2545 - "WW" : Close Wire (to finish)
2546 - "WF" : Close Wire and build face (to finish)
2548 - Flag1 (= reverse) is 0 or 2 ...
2549 - if 0 the drawn arc is the one of lower angle (< Pi)
2550 - if 2 the drawn arc ius the one of greater angle (> Pi)
2552 - Flag2 (= control tolerance) is 0 or 1 ...
2553 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2554 - if 1 the wire is built only if the end point is on the arc
2555 with a tolerance of 10^-7 on the distance else the creation fails
2558 theCommand String, defining the sketcher in local
2559 coordinates of the working plane.
2560 theWorkingPlane Nine double values, defining origin,
2561 OZ and OX directions of the working plane.
2562 theName Object name; when specified, this parameter is used
2563 for result publication in the study. Otherwise, if automatic
2564 publication is switched on, default value is used for result name.
2567 New GEOM.GEOM_Object, containing the created wire.
2569 # Example: see GEOM_TestAll.py
2570 theCommand,Parameters = ParseSketcherCommand(theCommand)
2571 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2572 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2573 anObj.SetParameters(Parameters)
2574 self._autoPublish(anObj, theName, "wire")
2577 ## Create a sketcher (wire or face), following the textual description,
2578 # passed through <VAR>theCommand</VAR> argument. \n
2579 # For format of the description string see MakeSketcher() method.\n
2580 # @param theCommand String, defining the sketcher in local
2581 # coordinates of the working plane.
2582 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2583 # @param theName Object name; when specified, this parameter is used
2584 # for result publication in the study. Otherwise, if automatic
2585 # publication is switched on, default value is used for result name.
2587 # @return New GEOM.GEOM_Object, containing the created wire.
2589 # @ref tui_sketcher_page "Example"
2590 @ManageTransactions("CurvesOp")
2591 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2593 Create a sketcher (wire or face), following the textual description,
2594 passed through theCommand argument.
2595 For format of the description string see geompy.MakeSketcher() method.
2598 theCommand String, defining the sketcher in local
2599 coordinates of the working plane.
2600 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2601 theName Object name; when specified, this parameter is used
2602 for result publication in the study. Otherwise, if automatic
2603 publication is switched on, default value is used for result name.
2606 New GEOM.GEOM_Object, containing the created wire.
2608 theCommand,Parameters = ParseSketcherCommand(theCommand)
2609 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2610 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2611 anObj.SetParameters(Parameters)
2612 self._autoPublish(anObj, theName, "wire")
2615 ## Obtain a 2D sketcher interface
2616 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2617 def Sketcher2D (self):
2619 Obtain a 2D sketcher interface.
2622 sk = geompy.Sketcher2D()
2624 sk.addSegmentRelative(15, 70)
2625 sk.addSegmentPerpY(50)
2626 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2627 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2628 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2630 Sketch_1 = sk.wire(geomObj_1)
2632 sk = Sketcher2D (self)
2635 ## Create a sketcher wire, following the numerical description,
2636 # passed through <VAR>theCoordinates</VAR> argument. \n
2637 # @param theCoordinates double values, defining points to create a wire,
2639 # @param theName Object name; when specified, this parameter is used
2640 # for result publication in the study. Otherwise, if automatic
2641 # publication is switched on, default value is used for result name.
2643 # @return New GEOM.GEOM_Object, containing the created wire.
2645 # @ref tui_3dsketcher_page "Example"
2646 @ManageTransactions("CurvesOp")
2647 def Make3DSketcher(self, theCoordinates, theName=None):
2649 Create a sketcher wire, following the numerical description,
2650 passed through theCoordinates argument.
2653 theCoordinates double values, defining points to create a wire,
2655 theName Object name; when specified, this parameter is used
2656 for result publication in the study. Otherwise, if automatic
2657 publication is switched on, default value is used for result name.
2660 New GEOM_Object, containing the created wire.
2662 theCoordinates,Parameters = ParseParameters(theCoordinates)
2663 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2664 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2665 anObj.SetParameters(Parameters)
2666 self._autoPublish(anObj, theName, "wire")
2669 ## Obtain a 3D sketcher interface
2670 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2672 # @ref tui_3dsketcher_page "Example"
2673 def Sketcher3D (self):
2675 Obtain a 3D sketcher interface.
2678 sk = geompy.Sketcher3D()
2679 sk.addPointsAbsolute(0,0,0, 70,0,0)
2680 sk.addPointsRelative(0, 0, 130)
2681 sk.addPointAnglesLength("OXY", 50, 0, 100)
2682 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2684 a3D_Sketcher_1 = sk.wire()
2686 sk = Sketcher3D (self)
2689 # end of l3_sketcher
2692 ## @addtogroup l3_3d_primitives
2695 ## Create a box by coordinates of two opposite vertices.
2697 # @param x1,y1,z1 double values, defining first point it.
2698 # @param x2,y2,z2 double values, defining first point it.
2699 # @param theName Object name; when specified, this parameter is used
2700 # for result publication in the study. Otherwise, if automatic
2701 # publication is switched on, default value is used for result name.
2703 # @return New GEOM.GEOM_Object, containing the created box.
2705 # @ref tui_creation_box "Example"
2706 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2708 Create a box by coordinates of two opposite vertices.
2711 x1,y1,z1 double values, defining first point.
2712 x2,y2,z2 double values, defining second point.
2713 theName Object name; when specified, this parameter is used
2714 for result publication in the study. Otherwise, if automatic
2715 publication is switched on, default value is used for result name.
2718 New GEOM.GEOM_Object, containing the created box.
2720 # Example: see GEOM_TestAll.py
2721 pnt1 = self.MakeVertex(x1,y1,z1)
2722 pnt2 = self.MakeVertex(x2,y2,z2)
2723 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2724 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2726 ## Create a box with specified dimensions along the coordinate axes
2727 # and with edges, parallel to the coordinate axes.
2728 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2729 # @param theDX Length of Box edges, parallel to OX axis.
2730 # @param theDY Length of Box edges, parallel to OY axis.
2731 # @param theDZ Length of Box edges, parallel to OZ axis.
2732 # @param theName Object name; when specified, this parameter is used
2733 # for result publication in the study. Otherwise, if automatic
2734 # publication is switched on, default value is used for result name.
2736 # @return New GEOM.GEOM_Object, containing the created box.
2738 # @ref tui_creation_box "Example"
2739 @ManageTransactions("PrimOp")
2740 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2742 Create a box with specified dimensions along the coordinate axes
2743 and with edges, parallel to the coordinate axes.
2744 Center of the box will be at point (DX/2, DY/2, DZ/2).
2747 theDX Length of Box edges, parallel to OX axis.
2748 theDY Length of Box edges, parallel to OY axis.
2749 theDZ Length of Box edges, parallel to OZ axis.
2750 theName Object name; when specified, this parameter is used
2751 for result publication in the study. Otherwise, if automatic
2752 publication is switched on, default value is used for result name.
2755 New GEOM.GEOM_Object, containing the created box.
2757 # Example: see GEOM_TestAll.py
2758 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2759 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2760 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2761 anObj.SetParameters(Parameters)
2762 self._autoPublish(anObj, theName, "box")
2765 ## Create a box with two specified opposite vertices,
2766 # and with edges, parallel to the coordinate axes
2767 # @param thePnt1 First of two opposite vertices.
2768 # @param thePnt2 Second of two opposite vertices.
2769 # @param theName Object name; when specified, this parameter is used
2770 # for result publication in the study. Otherwise, if automatic
2771 # publication is switched on, default value is used for result name.
2773 # @return New GEOM.GEOM_Object, containing the created box.
2775 # @ref tui_creation_box "Example"
2776 @ManageTransactions("PrimOp")
2777 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2779 Create a box with two specified opposite vertices,
2780 and with edges, parallel to the coordinate axes
2783 thePnt1 First of two opposite vertices.
2784 thePnt2 Second of two opposite vertices.
2785 theName Object name; when specified, this parameter is used
2786 for result publication in the study. Otherwise, if automatic
2787 publication is switched on, default value is used for result name.
2790 New GEOM.GEOM_Object, containing the created box.
2792 # Example: see GEOM_TestAll.py
2793 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2794 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2795 self._autoPublish(anObj, theName, "box")
2798 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2799 # @param theH height of Face.
2800 # @param theW width of Face.
2801 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2802 # @param theName Object name; when specified, this parameter is used
2803 # for result publication in the study. Otherwise, if automatic
2804 # publication is switched on, default value is used for result name.
2806 # @return New GEOM.GEOM_Object, containing the created face.
2808 # @ref tui_creation_face "Example"
2809 @ManageTransactions("PrimOp")
2810 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2812 Create a face with specified dimensions with edges parallel to coordinate axes.
2815 theH height of Face.
2817 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2818 theName Object name; when specified, this parameter is used
2819 for result publication in the study. Otherwise, if automatic
2820 publication is switched on, default value is used for result name.
2823 New GEOM.GEOM_Object, containing the created face.
2825 # Example: see GEOM_TestAll.py
2826 theH,theW,Parameters = ParseParameters(theH, theW)
2827 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2828 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2829 anObj.SetParameters(Parameters)
2830 self._autoPublish(anObj, theName, "rectangle")
2833 ## Create a face from another plane and two sizes,
2834 # vertical size and horisontal size.
2835 # @param theObj Normale vector to the creating face or
2837 # @param theH Height (vertical size).
2838 # @param theW Width (horisontal size).
2839 # @param theName Object name; when specified, this parameter is used
2840 # for result publication in the study. Otherwise, if automatic
2841 # publication is switched on, default value is used for result name.
2843 # @return New GEOM.GEOM_Object, containing the created face.
2845 # @ref tui_creation_face "Example"
2846 @ManageTransactions("PrimOp")
2847 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2849 Create a face from another plane and two sizes,
2850 vertical size and horisontal size.
2853 theObj Normale vector to the creating face or
2855 theH Height (vertical size).
2856 theW Width (horisontal size).
2857 theName Object name; when specified, this parameter is used
2858 for result publication in the study. Otherwise, if automatic
2859 publication is switched on, default value is used for result name.
2862 New GEOM_Object, containing the created face.
2864 # Example: see GEOM_TestAll.py
2865 theH,theW,Parameters = ParseParameters(theH, theW)
2866 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2867 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2868 anObj.SetParameters(Parameters)
2869 self._autoPublish(anObj, theName, "rectangle")
2872 ## Create a disk with given center, normal vector and radius.
2873 # @param thePnt Disk center.
2874 # @param theVec Vector, normal to the plane of the disk.
2875 # @param theR Disk radius.
2876 # @param theName Object name; when specified, this parameter is used
2877 # for result publication in the study. Otherwise, if automatic
2878 # publication is switched on, default value is used for result name.
2880 # @return New GEOM.GEOM_Object, containing the created disk.
2882 # @ref tui_creation_disk "Example"
2883 @ManageTransactions("PrimOp")
2884 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2886 Create a disk with given center, normal vector and radius.
2890 theVec Vector, normal to the plane of the disk.
2892 theName Object name; when specified, this parameter is used
2893 for result publication in the study. Otherwise, if automatic
2894 publication is switched on, default value is used for result name.
2897 New GEOM.GEOM_Object, containing the created disk.
2899 # Example: see GEOM_TestAll.py
2900 theR,Parameters = ParseParameters(theR)
2901 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2902 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2903 anObj.SetParameters(Parameters)
2904 self._autoPublish(anObj, theName, "disk")
2907 ## Create a disk, passing through three given points
2908 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2909 # @param theName Object name; when specified, this parameter is used
2910 # for result publication in the study. Otherwise, if automatic
2911 # publication is switched on, default value is used for result name.
2913 # @return New GEOM.GEOM_Object, containing the created disk.
2915 # @ref tui_creation_disk "Example"
2916 @ManageTransactions("PrimOp")
2917 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2919 Create a disk, passing through three given points
2922 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2923 theName Object name; when specified, this parameter is used
2924 for result publication in the study. Otherwise, if automatic
2925 publication is switched on, default value is used for result name.
2928 New GEOM.GEOM_Object, containing the created disk.
2930 # Example: see GEOM_TestAll.py
2931 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2932 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2933 self._autoPublish(anObj, theName, "disk")
2936 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2937 # @param theR Radius of Face.
2938 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2939 # @param theName Object name; when specified, this parameter is used
2940 # for result publication in the study. Otherwise, if automatic
2941 # publication is switched on, default value is used for result name.
2943 # @return New GEOM.GEOM_Object, containing the created disk.
2945 # @ref tui_creation_face "Example"
2946 @ManageTransactions("PrimOp")
2947 def MakeDiskR(self, theR, theOrientation, theName=None):
2949 Create a disk with specified dimensions along OX-OY coordinate axes.
2952 theR Radius of Face.
2953 theOrientation set the orientation belong axis OXY or OYZ or OZX
2954 theName Object name; when specified, this parameter is used
2955 for result publication in the study. Otherwise, if automatic
2956 publication is switched on, default value is used for result name.
2959 New GEOM.GEOM_Object, containing the created disk.
2962 Disk3 = geompy.MakeDiskR(100., 1)
2964 # Example: see GEOM_TestAll.py
2965 theR,Parameters = ParseParameters(theR)
2966 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2967 RaiseIfFailed("MakeDiskR", self.PrimOp)
2968 anObj.SetParameters(Parameters)
2969 self._autoPublish(anObj, theName, "disk")
2972 ## Create a cylinder with given base point, axis, radius and height.
2973 # @param thePnt Central point of cylinder base.
2974 # @param theAxis Cylinder axis.
2975 # @param theR Cylinder radius.
2976 # @param theH Cylinder height.
2977 # @param theName Object name; when specified, this parameter is used
2978 # for result publication in the study. Otherwise, if automatic
2979 # publication is switched on, default value is used for result name.
2981 # @return New GEOM.GEOM_Object, containing the created cylinder.
2983 # @ref tui_creation_cylinder "Example"
2984 @ManageTransactions("PrimOp")
2985 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2987 Create a cylinder with given base point, axis, radius and height.
2990 thePnt Central point of cylinder base.
2991 theAxis Cylinder axis.
2992 theR Cylinder radius.
2993 theH Cylinder height.
2994 theName Object name; when specified, this parameter is used
2995 for result publication in the study. Otherwise, if automatic
2996 publication is switched on, default value is used for result name.
2999 New GEOM.GEOM_Object, containing the created cylinder.
3001 # Example: see GEOM_TestAll.py
3002 theR,theH,Parameters = ParseParameters(theR, theH)
3003 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3004 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3005 anObj.SetParameters(Parameters)
3006 self._autoPublish(anObj, theName, "cylinder")
3009 ## Create a cylinder with given radius and height at
3010 # the origin of coordinate system. Axis of the cylinder
3011 # will be collinear to the OZ axis of the coordinate system.
3012 # @param theR Cylinder radius.
3013 # @param theH Cylinder height.
3014 # @param theName Object name; when specified, this parameter is used
3015 # for result publication in the study. Otherwise, if automatic
3016 # publication is switched on, default value is used for result name.
3018 # @return New GEOM.GEOM_Object, containing the created cylinder.
3020 # @ref tui_creation_cylinder "Example"
3021 @ManageTransactions("PrimOp")
3022 def MakeCylinderRH(self, theR, theH, theName=None):
3024 Create a cylinder with given radius and height at
3025 the origin of coordinate system. Axis of the cylinder
3026 will be collinear to the OZ axis of the coordinate system.
3029 theR Cylinder radius.
3030 theH Cylinder height.
3031 theName Object name; when specified, this parameter is used
3032 for result publication in the study. Otherwise, if automatic
3033 publication is switched on, default value is used for result name.
3036 New GEOM.GEOM_Object, containing the created cylinder.
3038 # Example: see GEOM_TestAll.py
3039 theR,theH,Parameters = ParseParameters(theR, theH)
3040 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3041 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3042 anObj.SetParameters(Parameters)
3043 self._autoPublish(anObj, theName, "cylinder")
3046 ## Create a sphere with given center and radius.
3047 # @param thePnt Sphere center.
3048 # @param theR Sphere radius.
3049 # @param theName Object name; when specified, this parameter is used
3050 # for result publication in the study. Otherwise, if automatic
3051 # publication is switched on, default value is used for result name.
3053 # @return New GEOM.GEOM_Object, containing the created sphere.
3055 # @ref tui_creation_sphere "Example"
3056 @ManageTransactions("PrimOp")
3057 def MakeSpherePntR(self, thePnt, theR, theName=None):
3059 Create a sphere with given center and radius.
3062 thePnt Sphere center.
3064 theName Object name; when specified, this parameter is used
3065 for result publication in the study. Otherwise, if automatic
3066 publication is switched on, default value is used for result name.
3069 New GEOM.GEOM_Object, containing the created sphere.
3071 # Example: see GEOM_TestAll.py
3072 theR,Parameters = ParseParameters(theR)
3073 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3074 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3075 anObj.SetParameters(Parameters)
3076 self._autoPublish(anObj, theName, "sphere")
3079 ## Create a sphere with given center and radius.
3080 # @param x,y,z Coordinates of sphere center.
3081 # @param theR Sphere radius.
3082 # @param theName Object name; when specified, this parameter is used
3083 # for result publication in the study. Otherwise, if automatic
3084 # publication is switched on, default value is used for result name.
3086 # @return New GEOM.GEOM_Object, containing the created sphere.
3088 # @ref tui_creation_sphere "Example"
3089 def MakeSphere(self, x, y, z, theR, theName=None):
3091 Create a sphere with given center and radius.
3094 x,y,z Coordinates of sphere center.
3096 theName Object name; when specified, this parameter is used
3097 for result publication in the study. Otherwise, if automatic
3098 publication is switched on, default value is used for result name.
3101 New GEOM.GEOM_Object, containing the created sphere.
3103 # Example: see GEOM_TestAll.py
3104 point = self.MakeVertex(x, y, z)
3105 # note: auto-publishing is done in self.MakeSpherePntR()
3106 anObj = self.MakeSpherePntR(point, theR, theName)
3109 ## Create a sphere with given radius at the origin of coordinate system.
3110 # @param theR Sphere radius.
3111 # @param theName Object name; when specified, this parameter is used
3112 # for result publication in the study. Otherwise, if automatic
3113 # publication is switched on, default value is used for result name.
3115 # @return New GEOM.GEOM_Object, containing the created sphere.
3117 # @ref tui_creation_sphere "Example"
3118 @ManageTransactions("PrimOp")
3119 def MakeSphereR(self, theR, theName=None):
3121 Create a sphere with given radius at the origin of coordinate system.
3125 theName Object name; when specified, this parameter is used
3126 for result publication in the study. Otherwise, if automatic
3127 publication is switched on, default value is used for result name.
3130 New GEOM.GEOM_Object, containing the created sphere.
3132 # Example: see GEOM_TestAll.py
3133 theR,Parameters = ParseParameters(theR)
3134 anObj = self.PrimOp.MakeSphereR(theR)
3135 RaiseIfFailed("MakeSphereR", self.PrimOp)
3136 anObj.SetParameters(Parameters)
3137 self._autoPublish(anObj, theName, "sphere")
3140 ## Create a cone with given base point, axis, height and radiuses.
3141 # @param thePnt Central point of the first cone base.
3142 # @param theAxis Cone axis.
3143 # @param theR1 Radius of the first cone base.
3144 # @param theR2 Radius of the second cone base.
3145 # \note If both radiuses are non-zero, the cone will be truncated.
3146 # \note If the radiuses are equal, a cylinder will be created instead.
3147 # @param theH Cone height.
3148 # @param theName Object name; when specified, this parameter is used
3149 # for result publication in the study. Otherwise, if automatic
3150 # publication is switched on, default value is used for result name.
3152 # @return New GEOM.GEOM_Object, containing the created cone.
3154 # @ref tui_creation_cone "Example"
3155 @ManageTransactions("PrimOp")
3156 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3158 Create a cone with given base point, axis, height and radiuses.
3161 thePnt Central point of the first cone base.
3163 theR1 Radius of the first cone base.
3164 theR2 Radius of the second cone base.
3166 theName Object name; when specified, this parameter is used
3167 for result publication in the study. Otherwise, if automatic
3168 publication is switched on, default value is used for result name.
3171 If both radiuses are non-zero, the cone will be truncated.
3172 If the radiuses are equal, a cylinder will be created instead.
3175 New GEOM.GEOM_Object, containing the created cone.
3177 # Example: see GEOM_TestAll.py
3178 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3179 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3180 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3181 anObj.SetParameters(Parameters)
3182 self._autoPublish(anObj, theName, "cone")
3185 ## Create a cone with given height and radiuses at
3186 # the origin of coordinate system. Axis of the cone will
3187 # be collinear to the OZ axis of the coordinate system.
3188 # @param theR1 Radius of the first cone base.
3189 # @param theR2 Radius of the second cone base.
3190 # \note If both radiuses are non-zero, the cone will be truncated.
3191 # \note If the radiuses are equal, a cylinder will be created instead.
3192 # @param theH Cone height.
3193 # @param theName Object name; when specified, this parameter is used
3194 # for result publication in the study. Otherwise, if automatic
3195 # publication is switched on, default value is used for result name.
3197 # @return New GEOM.GEOM_Object, containing the created cone.
3199 # @ref tui_creation_cone "Example"
3200 @ManageTransactions("PrimOp")
3201 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3203 Create a cone with given height and radiuses at
3204 the origin of coordinate system. Axis of the cone will
3205 be collinear to the OZ axis of the coordinate system.
3208 theR1 Radius of the first cone base.
3209 theR2 Radius of the second cone base.
3211 theName Object name; when specified, this parameter is used
3212 for result publication in the study. Otherwise, if automatic
3213 publication is switched on, default value is used for result name.
3216 If both radiuses are non-zero, the cone will be truncated.
3217 If the radiuses are equal, a cylinder will be created instead.
3220 New GEOM.GEOM_Object, containing the created cone.
3222 # Example: see GEOM_TestAll.py
3223 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3224 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3225 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3226 anObj.SetParameters(Parameters)
3227 self._autoPublish(anObj, theName, "cone")
3230 ## Create a torus with given center, normal vector and radiuses.
3231 # @param thePnt Torus central point.
3232 # @param theVec Torus axis of symmetry.
3233 # @param theRMajor Torus major radius.
3234 # @param theRMinor Torus minor radius.
3235 # @param theName Object name; when specified, this parameter is used
3236 # for result publication in the study. Otherwise, if automatic
3237 # publication is switched on, default value is used for result name.
3239 # @return New GEOM.GEOM_Object, containing the created torus.
3241 # @ref tui_creation_torus "Example"
3242 @ManageTransactions("PrimOp")
3243 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3245 Create a torus with given center, normal vector and radiuses.
3248 thePnt Torus central point.
3249 theVec Torus axis of symmetry.
3250 theRMajor Torus major radius.
3251 theRMinor Torus minor radius.
3252 theName Object name; when specified, this parameter is used
3253 for result publication in the study. Otherwise, if automatic
3254 publication is switched on, default value is used for result name.
3257 New GEOM.GEOM_Object, containing the created torus.
3259 # Example: see GEOM_TestAll.py
3260 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3261 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3262 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3263 anObj.SetParameters(Parameters)
3264 self._autoPublish(anObj, theName, "torus")
3267 ## Create a torus with given radiuses at the origin of coordinate system.
3268 # @param theRMajor Torus major radius.
3269 # @param theRMinor Torus minor radius.
3270 # @param theName Object name; when specified, this parameter is used
3271 # for result publication in the study. Otherwise, if automatic
3272 # publication is switched on, default value is used for result name.
3274 # @return New GEOM.GEOM_Object, containing the created torus.
3276 # @ref tui_creation_torus "Example"
3277 @ManageTransactions("PrimOp")
3278 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3280 Create a torus with given radiuses at the origin of coordinate system.
3283 theRMajor Torus major radius.
3284 theRMinor Torus minor radius.
3285 theName Object name; when specified, this parameter is used
3286 for result publication in the study. Otherwise, if automatic
3287 publication is switched on, default value is used for result name.
3290 New GEOM.GEOM_Object, containing the created torus.
3292 # Example: see GEOM_TestAll.py
3293 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3294 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3295 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3296 anObj.SetParameters(Parameters)
3297 self._autoPublish(anObj, theName, "torus")
3300 # end of l3_3d_primitives
3303 ## @addtogroup l3_complex
3306 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3307 # @param theBase Base shape to be extruded.
3308 # @param thePoint1 First end of extrusion vector.
3309 # @param thePoint2 Second end of extrusion vector.
3310 # @param theScaleFactor Use it to make prism with scaled second base.
3311 # Nagative value means not scaled second base.
3312 # @param theName Object name; when specified, this parameter is used
3313 # for result publication in the study. Otherwise, if automatic
3314 # publication is switched on, default value is used for result name.
3316 # @return New GEOM.GEOM_Object, containing the created prism.
3318 # @ref tui_creation_prism "Example"
3319 @ManageTransactions("PrimOp")
3320 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3322 Create a shape by extrusion of the base shape along a vector, defined by two points.
3325 theBase Base shape to be extruded.
3326 thePoint1 First end of extrusion vector.
3327 thePoint2 Second end of extrusion vector.
3328 theScaleFactor Use it to make prism with scaled second base.
3329 Nagative value means not scaled second base.
3330 theName Object name; when specified, this parameter is used
3331 for result publication in the study. Otherwise, if automatic
3332 publication is switched on, default value is used for result name.
3335 New GEOM.GEOM_Object, containing the created prism.
3337 # Example: see GEOM_TestAll.py
3340 if theScaleFactor > 0:
3341 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3342 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3344 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3345 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3346 anObj.SetParameters(Parameters)
3347 self._autoPublish(anObj, theName, "prism")
3350 ## Create a shape by extrusion of the base shape along a
3351 # vector, defined by two points, in 2 Ways (forward/backward).
3352 # @param theBase Base shape to be extruded.
3353 # @param thePoint1 First end of extrusion vector.
3354 # @param thePoint2 Second end of extrusion vector.
3355 # @param theName Object name; when specified, this parameter is used
3356 # for result publication in the study. Otherwise, if automatic
3357 # publication is switched on, default value is used for result name.
3359 # @return New GEOM.GEOM_Object, containing the created prism.
3361 # @ref tui_creation_prism "Example"
3362 @ManageTransactions("PrimOp")
3363 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3365 Create a shape by extrusion of the base shape along a
3366 vector, defined by two points, in 2 Ways (forward/backward).
3369 theBase Base shape to be extruded.
3370 thePoint1 First end of extrusion vector.
3371 thePoint2 Second end of extrusion vector.
3372 theName Object name; when specified, this parameter is used
3373 for result publication in the study. Otherwise, if automatic
3374 publication is switched on, default value is used for result name.
3377 New GEOM.GEOM_Object, containing the created prism.
3379 # Example: see GEOM_TestAll.py
3380 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3381 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3382 self._autoPublish(anObj, theName, "prism")
3385 ## Create a shape by extrusion of the base shape along the vector,
3386 # i.e. all the space, transfixed by the base shape during its translation
3387 # along the vector on the given distance.
3388 # @param theBase Base shape to be extruded.
3389 # @param theVec Direction of extrusion.
3390 # @param theH Prism dimension along theVec.
3391 # @param theScaleFactor Use it to make prism with scaled second base.
3392 # Negative value means not scaled second base.
3393 # @param theName Object name; when specified, this parameter is used
3394 # for result publication in the study. Otherwise, if automatic
3395 # publication is switched on, default value is used for result name.
3397 # @return New GEOM.GEOM_Object, containing the created prism.
3399 # @ref tui_creation_prism "Example"
3400 @ManageTransactions("PrimOp")
3401 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3403 Create a shape by extrusion of the base shape along the vector,
3404 i.e. all the space, transfixed by the base shape during its translation
3405 along the vector on the given distance.
3408 theBase Base shape to be extruded.
3409 theVec Direction of extrusion.
3410 theH Prism dimension along theVec.
3411 theScaleFactor Use it to make prism with scaled second base.
3412 Negative value means not scaled second base.
3413 theName Object name; when specified, this parameter is used
3414 for result publication in the study. Otherwise, if automatic
3415 publication is switched on, default value is used for result name.
3418 New GEOM.GEOM_Object, containing the created prism.
3420 # Example: see GEOM_TestAll.py
3423 if theScaleFactor > 0:
3424 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3425 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3427 theH,Parameters = ParseParameters(theH)
3428 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3429 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3430 anObj.SetParameters(Parameters)
3431 self._autoPublish(anObj, theName, "prism")
3434 ## Create a shape by extrusion of the base shape along the vector,
3435 # i.e. all the space, transfixed by the base shape during its translation
3436 # along the vector on the given distance in 2 Ways (forward/backward).
3437 # @param theBase Base shape to be extruded.
3438 # @param theVec Direction of extrusion.
3439 # @param theH Prism dimension along theVec in forward direction.
3440 # @param theName Object name; when specified, this parameter is used
3441 # for result publication in the study. Otherwise, if automatic
3442 # publication is switched on, default value is used for result name.
3444 # @return New GEOM.GEOM_Object, containing the created prism.
3446 # @ref tui_creation_prism "Example"
3447 @ManageTransactions("PrimOp")
3448 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3450 Create a shape by extrusion of the base shape along the vector,
3451 i.e. all the space, transfixed by the base shape during its translation
3452 along the vector on the given distance in 2 Ways (forward/backward).
3455 theBase Base shape to be extruded.
3456 theVec Direction of extrusion.
3457 theH Prism dimension along theVec in forward direction.
3458 theName Object name; when specified, this parameter is used
3459 for result publication in the study. Otherwise, if automatic
3460 publication is switched on, default value is used for result name.
3463 New GEOM.GEOM_Object, containing the created prism.
3465 # Example: see GEOM_TestAll.py
3466 theH,Parameters = ParseParameters(theH)
3467 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3468 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3469 anObj.SetParameters(Parameters)
3470 self._autoPublish(anObj, theName, "prism")
3473 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3474 # @param theBase Base shape to be extruded.
3475 # @param theDX, theDY, theDZ Directions of extrusion.
3476 # @param theScaleFactor Use it to make prism with scaled second base.
3477 # Nagative value means not scaled second base.
3478 # @param theName Object name; when specified, this parameter is used
3479 # for result publication in the study. Otherwise, if automatic
3480 # publication is switched on, default value is used for result name.
3482 # @return New GEOM.GEOM_Object, containing the created prism.
3484 # @ref tui_creation_prism "Example"
3485 @ManageTransactions("PrimOp")
3486 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3488 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3491 theBase Base shape to be extruded.
3492 theDX, theDY, theDZ Directions of extrusion.
3493 theScaleFactor Use it to make prism with scaled second base.
3494 Nagative value means not scaled second base.
3495 theName Object name; when specified, this parameter is used
3496 for result publication in the study. Otherwise, if automatic
3497 publication is switched on, default value is used for result name.
3500 New GEOM.GEOM_Object, containing the created prism.
3502 # Example: see GEOM_TestAll.py
3505 if theScaleFactor > 0:
3506 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3507 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3509 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3510 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3511 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3512 anObj.SetParameters(Parameters)
3513 self._autoPublish(anObj, theName, "prism")
3516 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3517 # i.e. all the space, transfixed by the base shape during its translation
3518 # along the vector on the given distance in 2 Ways (forward/backward).
3519 # @param theBase Base shape to be extruded.
3520 # @param theDX, theDY, theDZ Directions of extrusion.
3521 # @param theName Object name; when specified, this parameter is used
3522 # for result publication in the study. Otherwise, if automatic
3523 # publication is switched on, default value is used for result name.
3525 # @return New GEOM.GEOM_Object, containing the created prism.
3527 # @ref tui_creation_prism "Example"
3528 @ManageTransactions("PrimOp")
3529 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3531 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3532 i.e. all the space, transfixed by the base shape during its translation
3533 along the vector on the given distance in 2 Ways (forward/backward).
3536 theBase Base shape to be extruded.
3537 theDX, theDY, theDZ Directions of extrusion.
3538 theName Object name; when specified, this parameter is used
3539 for result publication in the study. Otherwise, if automatic
3540 publication is switched on, default value is used for result name.
3543 New GEOM.GEOM_Object, containing the created prism.
3545 # Example: see GEOM_TestAll.py
3546 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3547 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3548 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3549 anObj.SetParameters(Parameters)
3550 self._autoPublish(anObj, theName, "prism")
3553 ## Create a shape by revolution of the base shape around the axis
3554 # on the given angle, i.e. all the space, transfixed by the base
3555 # shape during its rotation around the axis on the given angle.
3556 # @param theBase Base shape to be rotated.
3557 # @param theAxis Rotation axis.
3558 # @param theAngle Rotation angle in radians.
3559 # @param theName Object name; when specified, this parameter is used
3560 # for result publication in the study. Otherwise, if automatic
3561 # publication is switched on, default value is used for result name.
3563 # @return New GEOM.GEOM_Object, containing the created revolution.
3565 # @ref tui_creation_revolution "Example"
3566 @ManageTransactions("PrimOp")
3567 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3569 Create a shape by revolution of the base shape around the axis
3570 on the given angle, i.e. all the space, transfixed by the base
3571 shape during its rotation around the axis on the given angle.
3574 theBase Base shape to be rotated.
3575 theAxis Rotation axis.
3576 theAngle Rotation angle in radians.
3577 theName Object name; when specified, this parameter is used
3578 for result publication in the study. Otherwise, if automatic
3579 publication is switched on, default value is used for result name.
3582 New GEOM.GEOM_Object, containing the created revolution.
3584 # Example: see GEOM_TestAll.py
3585 theAngle,Parameters = ParseParameters(theAngle)
3586 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3587 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3588 anObj.SetParameters(Parameters)
3589 self._autoPublish(anObj, theName, "revolution")
3592 ## Create a shape by revolution of the base shape around the axis
3593 # on the given angle, i.e. all the space, transfixed by the base
3594 # shape during its rotation around the axis on the given angle in
3595 # both directions (forward/backward)
3596 # @param theBase Base shape to be rotated.
3597 # @param theAxis Rotation axis.
3598 # @param theAngle Rotation angle in radians.
3599 # @param theName Object name; when specified, this parameter is used
3600 # for result publication in the study. Otherwise, if automatic
3601 # publication is switched on, default value is used for result name.
3603 # @return New GEOM.GEOM_Object, containing the created revolution.
3605 # @ref tui_creation_revolution "Example"
3606 @ManageTransactions("PrimOp")
3607 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3609 Create a shape by revolution of the base shape around the axis
3610 on the given angle, i.e. all the space, transfixed by the base
3611 shape during its rotation around the axis on the given angle in
3612 both directions (forward/backward).
3615 theBase Base shape to be rotated.
3616 theAxis Rotation axis.
3617 theAngle Rotation angle in radians.
3618 theName Object name; when specified, this parameter is used
3619 for result publication in the study. Otherwise, if automatic
3620 publication is switched on, default value is used for result name.
3623 New GEOM.GEOM_Object, containing the created revolution.
3625 theAngle,Parameters = ParseParameters(theAngle)
3626 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3627 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3628 anObj.SetParameters(Parameters)
3629 self._autoPublish(anObj, theName, "revolution")
3632 ## Create a filling from the given compound of contours.
3633 # @param theShape the compound of contours
3634 # @param theMinDeg a minimal degree of BSpline surface to create
3635 # @param theMaxDeg a maximal degree of BSpline surface to create
3636 # @param theTol2D a 2d tolerance to be reached
3637 # @param theTol3D a 3d tolerance to be reached
3638 # @param theNbIter a number of iteration of approximation algorithm
3639 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3640 # @param isApprox if True, BSpline curves are generated in the process
3641 # of surface construction. By default it is False, that means
3642 # the surface is created using given curves. The usage of
3643 # Approximation makes the algorithm work slower, but allows
3644 # building the surface for rather complex cases.
3645 # @param theName Object name; when specified, this parameter is used
3646 # for result publication in the study. Otherwise, if automatic
3647 # publication is switched on, default value is used for result name.
3649 # @return New GEOM.GEOM_Object, containing the created filling surface.
3651 # @ref tui_creation_filling "Example"
3652 @ManageTransactions("PrimOp")
3653 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3654 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3656 Create a filling from the given compound of contours.
3659 theShape the compound of contours
3660 theMinDeg a minimal degree of BSpline surface to create
3661 theMaxDeg a maximal degree of BSpline surface to create
3662 theTol2D a 2d tolerance to be reached
3663 theTol3D a 3d tolerance to be reached
3664 theNbIter a number of iteration of approximation algorithm
3665 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3666 isApprox if True, BSpline curves are generated in the process
3667 of surface construction. By default it is False, that means
3668 the surface is created using given curves. The usage of
3669 Approximation makes the algorithm work slower, but allows
3670 building the surface for rather complex cases
3671 theName Object name; when specified, this parameter is used
3672 for result publication in the study. Otherwise, if automatic
3673 publication is switched on, default value is used for result name.
3676 New GEOM.GEOM_Object, containing the created filling surface.
3679 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3681 # Example: see GEOM_TestAll.py
3682 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3683 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3684 theTol2D, theTol3D, theNbIter,
3685 theMethod, isApprox)
3686 RaiseIfFailed("MakeFilling", self.PrimOp)
3687 anObj.SetParameters(Parameters)
3688 self._autoPublish(anObj, theName, "filling")
3692 ## Create a filling from the given compound of contours.
3693 # This method corresponds to MakeFilling with isApprox=True
3694 # @param theShape the compound of contours
3695 # @param theMinDeg a minimal degree of BSpline surface to create
3696 # @param theMaxDeg a maximal degree of BSpline surface to create
3697 # @param theTol3D a 3d tolerance to be reached
3698 # @param theName Object name; when specified, this parameter is used
3699 # for result publication in the study. Otherwise, if automatic
3700 # publication is switched on, default value is used for result name.
3702 # @return New GEOM.GEOM_Object, containing the created filling surface.
3704 # @ref tui_creation_filling "Example"
3705 @ManageTransactions("PrimOp")
3706 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3708 Create a filling from the given compound of contours.
3709 This method corresponds to MakeFilling with isApprox=True
3712 theShape the compound of contours
3713 theMinDeg a minimal degree of BSpline surface to create
3714 theMaxDeg a maximal degree of BSpline surface to create
3715 theTol3D a 3d tolerance to be reached
3716 theName Object name; when specified, this parameter is used
3717 for result publication in the study. Otherwise, if automatic
3718 publication is switched on, default value is used for result name.
3721 New GEOM.GEOM_Object, containing the created filling surface.
3724 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3726 # Example: see GEOM_TestAll.py
3727 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3728 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3729 0, theTol3D, 0, GEOM.FOM_Default, True)
3730 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3731 anObj.SetParameters(Parameters)
3732 self._autoPublish(anObj, theName, "filling")
3735 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3736 # @param theSeqSections - set of specified sections.
3737 # @param theModeSolid - mode defining building solid or shell
3738 # @param thePreci - precision 3D used for smoothing
3739 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3740 # @param theName Object name; when specified, this parameter is used
3741 # for result publication in the study. Otherwise, if automatic
3742 # publication is switched on, default value is used for result name.
3744 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3746 # @ref swig_todo "Example"
3747 @ManageTransactions("PrimOp")
3748 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3750 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3753 theSeqSections - set of specified sections.
3754 theModeSolid - mode defining building solid or shell
3755 thePreci - precision 3D used for smoothing
3756 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3757 theName Object name; when specified, this parameter is used
3758 for result publication in the study. Otherwise, if automatic
3759 publication is switched on, default value is used for result name.
3762 New GEOM.GEOM_Object, containing the created shell or solid.
3764 # Example: see GEOM_TestAll.py
3765 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3766 RaiseIfFailed("MakeThruSections", self.PrimOp)
3767 self._autoPublish(anObj, theName, "filling")
3770 ## Create a shape by extrusion of the base shape along
3771 # the path shape. The path shape can be a wire or an edge.
3772 # @param theBase Base shape to be extruded.
3773 # @param thePath Path shape to extrude the base shape along it.
3774 # @param theName Object name; when specified, this parameter is used
3775 # for result publication in the study. Otherwise, if automatic
3776 # publication is switched on, default value is used for result name.
3778 # @return New GEOM.GEOM_Object, containing the created pipe.
3780 # @ref tui_creation_pipe "Example"
3781 @ManageTransactions("PrimOp")
3782 def MakePipe(self, theBase, thePath, theName=None):
3784 Create a shape by extrusion of the base shape along
3785 the path shape. The path shape can be a wire or an edge.
3788 theBase Base shape to be extruded.
3789 thePath Path shape to extrude the base shape along it.
3790 theName Object name; when specified, this parameter is used
3791 for result publication in the study. Otherwise, if automatic
3792 publication is switched on, default value is used for result name.
3795 New GEOM.GEOM_Object, containing the created pipe.
3797 # Example: see GEOM_TestAll.py
3798 anObj = self.PrimOp.MakePipe(theBase, thePath)
3799 RaiseIfFailed("MakePipe", self.PrimOp)
3800 self._autoPublish(anObj, theName, "pipe")
3803 ## Create a shape by extrusion of the profile shape along
3804 # the path shape. The path shape can be a wire or an edge.
3805 # the several profiles can be specified in the several locations of path.
3806 # @param theSeqBases - list of Bases shape to be extruded.
3807 # @param theLocations - list of locations on the path corresponding
3808 # specified list of the Bases shapes. Number of locations
3809 # should be equal to number of bases or list of locations can be empty.
3810 # @param thePath - Path shape to extrude the base shape along it.
3811 # @param theWithContact - the mode defining that the section is translated to be in
3812 # contact with the spine.
3813 # @param theWithCorrection - defining that the section is rotated to be
3814 # orthogonal to the spine tangent in the correspondent point
3815 # @param theName Object name; when specified, this parameter is used
3816 # for result publication in the study. Otherwise, if automatic
3817 # publication is switched on, default value is used for result name.
3819 # @return New GEOM.GEOM_Object, containing the created pipe.
3821 # @ref tui_creation_pipe_with_diff_sec "Example"
3822 @ManageTransactions("PrimOp")
3823 def MakePipeWithDifferentSections(self, theSeqBases,
3824 theLocations, thePath,
3825 theWithContact, theWithCorrection, theName=None):
3827 Create a shape by extrusion of the profile shape along
3828 the path shape. The path shape can be a wire or an edge.
3829 the several profiles can be specified in the several locations of path.
3832 theSeqBases - list of Bases shape to be extruded.
3833 theLocations - list of locations on the path corresponding
3834 specified list of the Bases shapes. Number of locations
3835 should be equal to number of bases or list of locations can be empty.
3836 thePath - Path shape to extrude the base shape along it.
3837 theWithContact - the mode defining that the section is translated to be in
3838 contact with the spine(0/1)
3839 theWithCorrection - defining that the section is rotated to be
3840 orthogonal to the spine tangent in the correspondent point (0/1)
3841 theName Object name; when specified, this parameter is used
3842 for result publication in the study. Otherwise, if automatic
3843 publication is switched on, default value is used for result name.
3846 New GEOM.GEOM_Object, containing the created pipe.
3848 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3849 theLocations, thePath,
3850 theWithContact, theWithCorrection)
3851 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3852 self._autoPublish(anObj, theName, "pipe")
3855 ## Create a shape by extrusion of the profile shape along
3856 # the path shape. The path shape can be a wire or a edge.
3857 # the several profiles can be specified in the several locations of path.
3858 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3859 # shell or face. If number of faces in neighbour sections
3860 # aren't coincided result solid between such sections will
3861 # be created using external boundaries of this shells.
3862 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3863 # This list is used for searching correspondences between
3864 # faces in the sections. Size of this list must be equal
3865 # to size of list of base shapes.
3866 # @param theLocations - list of locations on the path corresponding
3867 # specified list of the Bases shapes. Number of locations
3868 # should be equal to number of bases. First and last
3869 # locations must be coincided with first and last vertexes
3870 # of path correspondingly.
3871 # @param thePath - Path shape to extrude the base shape along it.
3872 # @param theWithContact - the mode defining that the section is translated to be in
3873 # contact with the spine.
3874 # @param theWithCorrection - defining that the section is rotated to be
3875 # orthogonal to the spine tangent in the correspondent point
3876 # @param theName Object name; when specified, this parameter is used
3877 # for result publication in the study. Otherwise, if automatic
3878 # publication is switched on, default value is used for result name.
3880 # @return New GEOM.GEOM_Object, containing the created solids.
3882 # @ref tui_creation_pipe_with_shell_sec "Example"
3883 @ManageTransactions("PrimOp")
3884 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3885 theLocations, thePath,
3886 theWithContact, theWithCorrection, theName=None):
3888 Create a shape by extrusion of the profile shape along
3889 the path shape. The path shape can be a wire or a edge.
3890 the several profiles can be specified in the several locations of path.
3893 theSeqBases - list of Bases shape to be extruded. Base shape must be
3894 shell or face. If number of faces in neighbour sections
3895 aren't coincided result solid between such sections will
3896 be created using external boundaries of this shells.
3897 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3898 This list is used for searching correspondences between
3899 faces in the sections. Size of this list must be equal
3900 to size of list of base shapes.
3901 theLocations - list of locations on the path corresponding
3902 specified list of the Bases shapes. Number of locations
3903 should be equal to number of bases. First and last
3904 locations must be coincided with first and last vertexes
3905 of path correspondingly.
3906 thePath - Path shape to extrude the base shape along it.
3907 theWithContact - the mode defining that the section is translated to be in
3908 contact with the spine (0/1)
3909 theWithCorrection - defining that the section is rotated to be
3910 orthogonal to the spine tangent in the correspondent point (0/1)
3911 theName Object name; when specified, this parameter is used
3912 for result publication in the study. Otherwise, if automatic
3913 publication is switched on, default value is used for result name.
3916 New GEOM.GEOM_Object, containing the created solids.
3918 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3919 theLocations, thePath,
3920 theWithContact, theWithCorrection)
3921 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3922 self._autoPublish(anObj, theName, "pipe")
3925 ## Create a shape by extrusion of the profile shape along
3926 # the path shape. This function is used only for debug pipe
3927 # functionality - it is a version of function MakePipeWithShellSections()
3928 # which give a possibility to recieve information about
3929 # creating pipe between each pair of sections step by step.
3930 @ManageTransactions("PrimOp")
3931 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3932 theLocations, thePath,
3933 theWithContact, theWithCorrection, theName=None):
3935 Create a shape by extrusion of the profile shape along
3936 the path shape. This function is used only for debug pipe
3937 functionality - it is a version of previous function
3938 geompy.MakePipeWithShellSections() which give a possibility to
3939 recieve information about creating pipe between each pair of
3940 sections step by step.
3943 nbsect = len(theSeqBases)
3944 nbsubsect = len(theSeqSubBases)
3945 #print "nbsect = ",nbsect
3946 for i in range(1,nbsect):
3948 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3949 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3951 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3952 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3953 tmpLocations, thePath,
3954 theWithContact, theWithCorrection)
3955 if self.PrimOp.IsDone() == 0:
3956 print "Problems with pipe creation between ",i," and ",i+1," sections"
3957 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3960 print "Pipe between ",i," and ",i+1," sections is OK"
3965 resc = self.MakeCompound(res)
3966 #resc = self.MakeSewing(res, 0.001)
3967 #print "resc: ",resc
3968 self._autoPublish(resc, theName, "pipe")
3971 ## Create solids between given sections
3972 # @param theSeqBases - list of sections (shell or face).
3973 # @param theLocations - list of corresponding vertexes
3974 # @param theName Object name; when specified, this parameter is used
3975 # for result publication in the study. Otherwise, if automatic
3976 # publication is switched on, default value is used for result name.
3978 # @return New GEOM.GEOM_Object, containing the created solids.
3980 # @ref tui_creation_pipe_without_path "Example"
3981 @ManageTransactions("PrimOp")
3982 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3984 Create solids between given sections
3987 theSeqBases - list of sections (shell or face).
3988 theLocations - list of corresponding vertexes
3989 theName Object name; when specified, this parameter is used
3990 for result publication in the study. Otherwise, if automatic
3991 publication is switched on, default value is used for result name.
3994 New GEOM.GEOM_Object, containing the created solids.
3996 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3997 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3998 self._autoPublish(anObj, theName, "pipe")
4001 ## Create a shape by extrusion of the base shape along
4002 # the path shape with constant bi-normal direction along the given vector.
4003 # The path shape can be a wire or an edge.
4004 # @param theBase Base shape to be extruded.
4005 # @param thePath Path shape to extrude the base shape along it.
4006 # @param theVec Vector defines a constant binormal direction to keep the
4007 # same angle beetween the direction and the sections
4008 # along the sweep surface.
4009 # @param theName Object name; when specified, this parameter is used
4010 # for result publication in the study. Otherwise, if automatic
4011 # publication is switched on, default value is used for result name.
4013 # @return New GEOM.GEOM_Object, containing the created pipe.
4015 # @ref tui_creation_pipe "Example"
4016 @ManageTransactions("PrimOp")
4017 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4019 Create a shape by extrusion of the base shape along
4020 the path shape with constant bi-normal direction along the given vector.
4021 The path shape can be a wire or an edge.
4024 theBase Base shape to be extruded.
4025 thePath Path shape to extrude the base shape along it.
4026 theVec Vector defines a constant binormal direction to keep the
4027 same angle beetween the direction and the sections
4028 along the sweep surface.
4029 theName Object name; when specified, this parameter is used
4030 for result publication in the study. Otherwise, if automatic
4031 publication is switched on, default value is used for result name.
4034 New GEOM.GEOM_Object, containing the created pipe.
4036 # Example: see GEOM_TestAll.py
4037 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4038 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4039 self._autoPublish(anObj, theName, "pipe")
4042 ## Makes a thick solid from a face or a shell
4043 # @param theShape Face or Shell to be thicken
4044 # @param theThickness Thickness of the resulting solid
4045 # @param theName Object name; when specified, this parameter is used
4046 # for result publication in the study. Otherwise, if automatic
4047 # publication is switched on, default value is used for result name.
4049 # @return New GEOM.GEOM_Object, containing the created solid
4051 @ManageTransactions("PrimOp")
4052 def MakeThickSolid(self, theShape, theThickness, theName=None):
4054 Make a thick solid from a face or a shell
4057 theShape Face or Shell to be thicken
4058 theThickness Thickness of the resulting solid
4059 theName Object name; when specified, this parameter is used
4060 for result publication in the study. Otherwise, if automatic
4061 publication is switched on, default value is used for result name.
4064 New GEOM.GEOM_Object, containing the created solid
4066 # Example: see GEOM_TestAll.py
4067 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4068 RaiseIfFailed("MakeThickening", self.PrimOp)
4069 self._autoPublish(anObj, theName, "pipe")
4073 ## Modifies a face or a shell to make it a thick solid
4074 # @param theShape Face or Shell to be thicken
4075 # @param theThickness Thickness of the resulting solid
4077 # @return The modified shape
4079 @ManageTransactions("PrimOp")
4080 def Thicken(self, theShape, theThickness):
4082 Modifies a face or a shell to make it a thick solid
4085 theBase Base shape to be extruded.
4086 thePath Path shape to extrude the base shape along it.
4087 theName Object name; when specified, this parameter is used
4088 for result publication in the study. Otherwise, if automatic
4089 publication is switched on, default value is used for result name.
4094 # Example: see GEOM_TestAll.py
4095 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4096 RaiseIfFailed("MakeThickening", self.PrimOp)
4099 ## Build a middle path of a pipe-like shape.
4100 # The path shape can be a wire or an edge.
4101 # @param theShape It can be closed or unclosed pipe-like shell
4102 # or a pipe-like solid.
4103 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4104 # should be wires or faces of theShape.
4105 # @param theName Object name; when specified, this parameter is used
4106 # for result publication in the study. Otherwise, if automatic
4107 # publication is switched on, default value is used for result name.
4109 # @note It is not assumed that exact or approximate copy of theShape
4110 # can be obtained by applying existing Pipe operation on the
4111 # resulting "Path" wire taking theBase1 as the base - it is not
4112 # always possible; though in some particular cases it might work
4113 # it is not guaranteed. Thus, RestorePath function should not be
4114 # considered as an exact reverse operation of the Pipe.
4116 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4117 # source pipe's "path".
4119 # @ref tui_creation_pipe_path "Example"
4120 @ManageTransactions("PrimOp")
4121 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4123 Build a middle path of a pipe-like shape.
4124 The path shape can be a wire or an edge.
4127 theShape It can be closed or unclosed pipe-like shell
4128 or a pipe-like solid.
4129 theBase1, theBase2 Two bases of the supposed pipe. This
4130 should be wires or faces of theShape.
4131 theName Object name; when specified, this parameter is used
4132 for result publication in the study. Otherwise, if automatic
4133 publication is switched on, default value is used for result name.
4136 New GEOM_Object, containing an edge or wire that represent
4139 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4140 RaiseIfFailed("RestorePath", self.PrimOp)
4141 self._autoPublish(anObj, theName, "path")
4144 ## Build a middle path of a pipe-like shape.
4145 # The path shape can be a wire or an edge.
4146 # @param theShape It can be closed or unclosed pipe-like shell
4147 # or a pipe-like solid.
4148 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4149 # should be lists of edges of theShape.
4150 # @param theName Object name; when specified, this parameter is used
4151 # for result publication in the study. Otherwise, if automatic
4152 # publication is switched on, default value is used for result name.
4154 # @note It is not assumed that exact or approximate copy of theShape
4155 # can be obtained by applying existing Pipe operation on the
4156 # resulting "Path" wire taking theBase1 as the base - it is not
4157 # always possible; though in some particular cases it might work
4158 # it is not guaranteed. Thus, RestorePath function should not be
4159 # considered as an exact reverse operation of the Pipe.
4161 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4162 # source pipe's "path".
4164 # @ref tui_creation_pipe_path "Example"
4165 @ManageTransactions("PrimOp")
4166 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4168 Build a middle path of a pipe-like shape.
4169 The path shape can be a wire or an edge.
4172 theShape It can be closed or unclosed pipe-like shell
4173 or a pipe-like solid.
4174 listEdges1, listEdges2 Two bases of the supposed pipe. This
4175 should be lists of edges of theShape.
4176 theName Object name; when specified, this parameter is used
4177 for result publication in the study. Otherwise, if automatic
4178 publication is switched on, default value is used for result name.
4181 New GEOM_Object, containing an edge or wire that represent
4184 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4185 RaiseIfFailed("RestorePath", self.PrimOp)
4186 self._autoPublish(anObj, theName, "path")
4192 ## @addtogroup l3_advanced
4195 ## Create a linear edge with specified ends.
4196 # @param thePnt1 Point for the first end of edge.
4197 # @param thePnt2 Point for the second end of edge.
4198 # @param theName Object name; when specified, this parameter is used
4199 # for result publication in the study. Otherwise, if automatic
4200 # publication is switched on, default value is used for result name.
4202 # @return New GEOM.GEOM_Object, containing the created edge.
4204 # @ref tui_creation_edge "Example"
4205 @ManageTransactions("ShapesOp")
4206 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4208 Create a linear edge with specified ends.
4211 thePnt1 Point for the first end of edge.
4212 thePnt2 Point for the second end of edge.
4213 theName Object name; when specified, this parameter is used
4214 for result publication in the study. Otherwise, if automatic
4215 publication is switched on, default value is used for result name.
4218 New GEOM.GEOM_Object, containing the created edge.
4220 # Example: see GEOM_TestAll.py
4221 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4222 RaiseIfFailed("MakeEdge", self.ShapesOp)
4223 self._autoPublish(anObj, theName, "edge")
4226 ## Create a new edge, corresponding to the given length on the given curve.
4227 # @param theRefCurve The referenced curve (edge).
4228 # @param theLength Length on the referenced curve. It can be negative.
4229 # @param theStartPoint Any point can be selected for it, the new edge will begin
4230 # at the end of \a theRefCurve, close to the selected point.
4231 # If None, start from the first point of \a theRefCurve.
4232 # @param theName Object name; when specified, this parameter is used
4233 # for result publication in the study. Otherwise, if automatic
4234 # publication is switched on, default value is used for result name.
4236 # @return New GEOM.GEOM_Object, containing the created edge.
4238 # @ref tui_creation_edge "Example"
4239 @ManageTransactions("ShapesOp")
4240 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4242 Create a new edge, corresponding to the given length on the given curve.
4245 theRefCurve The referenced curve (edge).
4246 theLength Length on the referenced curve. It can be negative.
4247 theStartPoint Any point can be selected for it, the new edge will begin
4248 at the end of theRefCurve, close to the selected point.
4249 If None, start from the first point of theRefCurve.
4250 theName Object name; when specified, this parameter is used
4251 for result publication in the study. Otherwise, if automatic
4252 publication is switched on, default value is used for result name.
4255 New GEOM.GEOM_Object, containing the created edge.
4257 # Example: see GEOM_TestAll.py
4258 theLength, Parameters = ParseParameters(theLength)
4259 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4260 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4261 anObj.SetParameters(Parameters)
4262 self._autoPublish(anObj, theName, "edge")
4265 ## Create an edge from specified wire.
4266 # @param theWire source Wire
4267 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4268 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4269 # @param theName Object name; when specified, this parameter is used
4270 # for result publication in the study. Otherwise, if automatic
4271 # publication is switched on, default value is used for result name.
4273 # @return New GEOM.GEOM_Object, containing the created edge.
4275 # @ref tui_creation_edge "Example"
4276 @ManageTransactions("ShapesOp")
4277 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4279 Create an edge from specified wire.
4283 theLinearTolerance linear tolerance value (default = 1e-07)
4284 theAngularTolerance angular tolerance value (default = 1e-12)
4285 theName Object name; when specified, this parameter is used
4286 for result publication in the study. Otherwise, if automatic
4287 publication is switched on, default value is used for result name.
4290 New GEOM.GEOM_Object, containing the created edge.
4292 # Example: see GEOM_TestAll.py
4293 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4294 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4295 self._autoPublish(anObj, theName, "edge")
4298 ## Create a wire from the set of edges and wires.
4299 # @param theEdgesAndWires List of edges and/or wires.
4300 # @param theTolerance Maximum distance between vertices, that will be merged.
4301 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4302 # @param theName Object name; when specified, this parameter is used
4303 # for result publication in the study. Otherwise, if automatic
4304 # publication is switched on, default value is used for result name.
4306 # @return New GEOM.GEOM_Object, containing the created wire.
4308 # @ref tui_creation_wire "Example"
4309 @ManageTransactions("ShapesOp")
4310 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4312 Create a wire from the set of edges and wires.
4315 theEdgesAndWires List of edges and/or wires.
4316 theTolerance Maximum distance between vertices, that will be merged.
4317 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4318 theName Object name; when specified, this parameter is used
4319 for result publication in the study. Otherwise, if automatic
4320 publication is switched on, default value is used for result name.
4323 New GEOM.GEOM_Object, containing the created wire.
4325 # Example: see GEOM_TestAll.py
4326 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4327 RaiseIfFailed("MakeWire", self.ShapesOp)
4328 self._autoPublish(anObj, theName, "wire")
4331 ## Create a face on the given wire.
4332 # @param theWire closed Wire or Edge to build the face on.
4333 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4334 # If the tolerance of the obtained planar face is less
4335 # than 1e-06, this face will be returned, otherwise the
4336 # algorithm tries to build any suitable face on the given
4337 # wire and prints a warning message.
4338 # @param theName Object name; when specified, this parameter is used
4339 # for result publication in the study. Otherwise, if automatic
4340 # publication is switched on, default value is used for result name.
4342 # @return New GEOM.GEOM_Object, containing the created face.
4344 # @ref tui_creation_face "Example"
4345 @ManageTransactions("ShapesOp")
4346 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4348 Create a face on the given wire.
4351 theWire closed Wire or Edge to build the face on.
4352 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4353 If the tolerance of the obtained planar face is less
4354 than 1e-06, this face will be returned, otherwise the
4355 algorithm tries to build any suitable face on the given
4356 wire and prints a warning message.
4357 theName Object name; when specified, this parameter is used
4358 for result publication in the study. Otherwise, if automatic
4359 publication is switched on, default value is used for result name.
4362 New GEOM.GEOM_Object, containing the created face.
4364 # Example: see GEOM_TestAll.py
4365 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4366 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4367 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4369 RaiseIfFailed("MakeFace", self.ShapesOp)
4370 self._autoPublish(anObj, theName, "face")
4373 ## Create a face on the given wires set.
4374 # @param theWires List of closed wires or edges to build the face on.
4375 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4376 # If the tolerance of the obtained planar face is less
4377 # than 1e-06, this face will be returned, otherwise the
4378 # algorithm tries to build any suitable face on the given
4379 # wire and prints a warning message.
4380 # @param theName Object name; when specified, this parameter is used
4381 # for result publication in the study. Otherwise, if automatic
4382 # publication is switched on, default value is used for result name.
4384 # @return New GEOM.GEOM_Object, containing the created face.
4386 # @ref tui_creation_face "Example"
4387 @ManageTransactions("ShapesOp")
4388 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4390 Create a face on the given wires set.
4393 theWires List of closed wires or edges to build the face on.
4394 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4395 If the tolerance of the obtained planar face is less
4396 than 1e-06, this face will be returned, otherwise the
4397 algorithm tries to build any suitable face on the given
4398 wire and prints a warning message.
4399 theName Object name; when specified, this parameter is used
4400 for result publication in the study. Otherwise, if automatic
4401 publication is switched on, default value is used for result name.
4404 New GEOM.GEOM_Object, containing the created face.
4406 # Example: see GEOM_TestAll.py
4407 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4408 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4409 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4411 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4412 self._autoPublish(anObj, theName, "face")
4415 ## See MakeFaceWires() method for details.
4417 # @ref tui_creation_face "Example 1"
4418 # \n @ref swig_MakeFaces "Example 2"
4419 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4421 See geompy.MakeFaceWires() method for details.
4423 # Example: see GEOM_TestOthers.py
4424 # note: auto-publishing is done in self.MakeFaceWires()
4425 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4428 ## Create a shell from the set of faces and shells.
4429 # @param theFacesAndShells List of faces and/or shells.
4430 # @param theName Object name; when specified, this parameter is used
4431 # for result publication in the study. Otherwise, if automatic
4432 # publication is switched on, default value is used for result name.
4434 # @return New GEOM.GEOM_Object, containing the created shell.
4436 # @ref tui_creation_shell "Example"
4437 @ManageTransactions("ShapesOp")
4438 def MakeShell(self, theFacesAndShells, theName=None):
4440 Create a shell from the set of faces and shells.
4443 theFacesAndShells List of faces and/or shells.
4444 theName Object name; when specified, this parameter is used
4445 for result publication in the study. Otherwise, if automatic
4446 publication is switched on, default value is used for result name.
4449 New GEOM.GEOM_Object, containing the created shell.
4451 # Example: see GEOM_TestAll.py
4452 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4453 RaiseIfFailed("MakeShell", self.ShapesOp)
4454 self._autoPublish(anObj, theName, "shell")
4457 ## Create a solid, bounded by the given shells.
4458 # @param theShells Sequence of bounding shells.
4459 # @param theName Object name; when specified, this parameter is used
4460 # for result publication in the study. Otherwise, if automatic
4461 # publication is switched on, default value is used for result name.
4463 # @return New GEOM.GEOM_Object, containing the created solid.
4465 # @ref tui_creation_solid "Example"
4466 @ManageTransactions("ShapesOp")
4467 def MakeSolid(self, theShells, theName=None):
4469 Create a solid, bounded by the given shells.
4472 theShells Sequence of bounding shells.
4473 theName Object name; when specified, this parameter is used
4474 for result publication in the study. Otherwise, if automatic
4475 publication is switched on, default value is used for result name.
4478 New GEOM.GEOM_Object, containing the created solid.
4480 # Example: see GEOM_TestAll.py
4481 if len(theShells) == 1:
4482 descr = self._IsGoodForSolid(theShells[0])
4484 # raise RuntimeError, "MakeSolidShells : " + descr
4485 if descr == "WRN_SHAPE_UNCLOSED":
4486 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4487 anObj = self.ShapesOp.MakeSolidShells(theShells)
4488 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4489 self._autoPublish(anObj, theName, "solid")
4492 ## Create a compound of the given shapes.
4493 # @param theShapes List of shapes to put in compound.
4494 # @param theName Object name; when specified, this parameter is used
4495 # for result publication in the study. Otherwise, if automatic
4496 # publication is switched on, default value is used for result name.
4498 # @return New GEOM.GEOM_Object, containing the created compound.
4500 # @ref tui_creation_compound "Example"
4501 @ManageTransactions("ShapesOp")
4502 def MakeCompound(self, theShapes, theName=None):
4504 Create a compound of the given shapes.
4507 theShapes List of shapes to put in compound.
4508 theName Object name; when specified, this parameter is used
4509 for result publication in the study. Otherwise, if automatic
4510 publication is switched on, default value is used for result name.
4513 New GEOM.GEOM_Object, containing the created compound.
4515 # Example: see GEOM_TestAll.py
4516 anObj = self.ShapesOp.MakeCompound(theShapes)
4517 RaiseIfFailed("MakeCompound", self.ShapesOp)
4518 self._autoPublish(anObj, theName, "compound")
4521 # end of l3_advanced
4524 ## @addtogroup l2_measure
4527 ## Gives quantity of faces in the given shape.
4528 # @param theShape Shape to count faces of.
4529 # @return Quantity of faces.
4531 # @ref swig_NumberOf "Example"
4532 @ManageTransactions("ShapesOp")
4533 def NumberOfFaces(self, theShape):
4535 Gives quantity of faces in the given shape.
4538 theShape Shape to count faces of.
4543 # Example: see GEOM_TestOthers.py
4544 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4545 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4548 ## Gives quantity of edges in the given shape.
4549 # @param theShape Shape to count edges of.
4550 # @return Quantity of edges.
4552 # @ref swig_NumberOf "Example"
4553 @ManageTransactions("ShapesOp")
4554 def NumberOfEdges(self, theShape):
4556 Gives quantity of edges in the given shape.
4559 theShape Shape to count edges of.
4564 # Example: see GEOM_TestOthers.py
4565 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4566 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4569 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4570 # @param theShape Shape to count sub-shapes of.
4571 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4572 # @return Quantity of sub-shapes of given type.
4574 # @ref swig_NumberOf "Example"
4575 @ManageTransactions("ShapesOp")
4576 def NumberOfSubShapes(self, theShape, theShapeType):
4578 Gives quantity of sub-shapes of type theShapeType in the given shape.
4581 theShape Shape to count sub-shapes of.
4582 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4585 Quantity of sub-shapes of given type.
4587 # Example: see GEOM_TestOthers.py
4588 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4589 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4592 ## Gives quantity of solids in the given shape.
4593 # @param theShape Shape to count solids in.
4594 # @return Quantity of solids.
4596 # @ref swig_NumberOf "Example"
4597 @ManageTransactions("ShapesOp")
4598 def NumberOfSolids(self, theShape):
4600 Gives quantity of solids in the given shape.
4603 theShape Shape to count solids in.
4608 # Example: see GEOM_TestOthers.py
4609 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4610 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4616 ## @addtogroup l3_healing
4619 ## Reverses an orientation the given shape.
4620 # @param theShape Shape to be reversed.
4621 # @param theName Object name; when specified, this parameter is used
4622 # for result publication in the study. Otherwise, if automatic
4623 # publication is switched on, default value is used for result name.
4625 # @return The reversed copy of theShape.
4627 # @ref swig_ChangeOrientation "Example"
4628 @ManageTransactions("ShapesOp")
4629 def ChangeOrientation(self, theShape, theName=None):
4631 Reverses an orientation the given shape.
4634 theShape Shape to be reversed.
4635 theName Object name; when specified, this parameter is used
4636 for result publication in the study. Otherwise, if automatic
4637 publication is switched on, default value is used for result name.
4640 The reversed copy of theShape.
4642 # Example: see GEOM_TestAll.py
4643 anObj = self.ShapesOp.ChangeOrientation(theShape)
4644 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4645 self._autoPublish(anObj, theName, "reversed")
4648 ## See ChangeOrientation() method for details.
4650 # @ref swig_OrientationChange "Example"
4651 def OrientationChange(self, theShape, theName=None):
4653 See geompy.ChangeOrientation method for details.
4655 # Example: see GEOM_TestOthers.py
4656 # note: auto-publishing is done in self.ChangeOrientation()
4657 anObj = self.ChangeOrientation(theShape, theName)
4663 ## @addtogroup l4_obtain
4666 ## Retrieve all free faces from the given shape.
4667 # Free face is a face, which is not shared between two shells of the shape.
4668 # @param theShape Shape to find free faces in.
4669 # @return List of IDs of all free faces, contained in theShape.
4671 # @ref tui_measurement_tools_page "Example"
4672 @ManageTransactions("ShapesOp")
4673 def GetFreeFacesIDs(self,theShape):
4675 Retrieve all free faces from the given shape.
4676 Free face is a face, which is not shared between two shells of the shape.
4679 theShape Shape to find free faces in.
4682 List of IDs of all free faces, contained in theShape.
4684 # Example: see GEOM_TestOthers.py
4685 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4686 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4689 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4690 # @param theShape1 Shape to find sub-shapes in.
4691 # @param theShape2 Shape to find shared sub-shapes with.
4692 # @param theShapeType Type of sub-shapes to be retrieved.
4693 # @param theName Object name; when specified, this parameter is used
4694 # for result publication in the study. Otherwise, if automatic
4695 # publication is switched on, default value is used for result name.
4697 # @return List of sub-shapes of theShape1, shared with theShape2.
4699 # @ref swig_GetSharedShapes "Example"
4700 @ManageTransactions("ShapesOp")
4701 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4703 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4706 theShape1 Shape to find sub-shapes in.
4707 theShape2 Shape to find shared sub-shapes with.
4708 theShapeType Type of sub-shapes to be retrieved.
4709 theName Object name; when specified, this parameter is used
4710 for result publication in the study. Otherwise, if automatic
4711 publication is switched on, default value is used for result name.
4714 List of sub-shapes of theShape1, shared with theShape2.
4716 # Example: see GEOM_TestOthers.py
4717 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4718 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4719 self._autoPublish(aList, theName, "shared")
4722 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4723 # @param theShapes Shapes to find common sub-shapes of.
4724 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4725 # @param theName Object name; when specified, this parameter is used
4726 # for result publication in the study. Otherwise, if automatic
4727 # publication is switched on, default value is used for result name.
4729 # @return List of objects, that are sub-shapes of all given shapes.
4731 # @ref swig_GetSharedShapes "Example"
4732 @ManageTransactions("ShapesOp")
4733 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4735 Get all sub-shapes, shared by all shapes in the list theShapes.
4738 theShapes Shapes to find common sub-shapes of.
4739 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4740 theName Object name; when specified, this parameter is used
4741 for result publication in the study. Otherwise, if automatic
4742 publication is switched on, default value is used for result name.
4745 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4747 # Example: see GEOM_TestOthers.py
4748 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4749 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4750 self._autoPublish(aList, theName, "shared")
4753 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4754 # situated relatively the specified plane by the certain way,
4755 # defined through <VAR>theState</VAR> parameter.
4756 # @param theShape Shape to find sub-shapes of.
4757 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4758 # @param theAx1 Vector (or line, or linear edge), specifying normal
4759 # direction and location of the plane to find shapes on.
4760 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4761 # @param theName Object name; when specified, this parameter is used
4762 # for result publication in the study. Otherwise, if automatic
4763 # publication is switched on, default value is used for result name.
4765 # @return List of all found sub-shapes.
4767 # @ref swig_GetShapesOnPlane "Example"
4768 @ManageTransactions("ShapesOp")
4769 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4771 Find in theShape all sub-shapes of type theShapeType,
4772 situated relatively the specified plane by the certain way,
4773 defined through theState parameter.
4776 theShape Shape to find sub-shapes of.
4777 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4778 theAx1 Vector (or line, or linear edge), specifying normal
4779 direction and location of the plane to find shapes on.
4780 theState The state of the sub-shapes to find (see GEOM::shape_state)
4781 theName Object name; when specified, this parameter is used
4782 for result publication in the study. Otherwise, if automatic
4783 publication is switched on, default value is used for result name.
4786 List of all found sub-shapes.
4788 # Example: see GEOM_TestOthers.py
4789 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4790 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4791 self._autoPublish(aList, theName, "shapeOnPlane")
4794 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4795 # situated relatively the specified plane by the certain way,
4796 # defined through <VAR>theState</VAR> parameter.
4797 # @param theShape Shape to find sub-shapes of.
4798 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4799 # @param theAx1 Vector (or line, or linear edge), specifying normal
4800 # direction and location of the plane to find shapes on.
4801 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4803 # @return List of all found sub-shapes indices.
4805 # @ref swig_GetShapesOnPlaneIDs "Example"
4806 @ManageTransactions("ShapesOp")
4807 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4809 Find in theShape all sub-shapes of type theShapeType,
4810 situated relatively the specified plane by the certain way,
4811 defined through theState parameter.
4814 theShape Shape to find sub-shapes of.
4815 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4816 theAx1 Vector (or line, or linear edge), specifying normal
4817 direction and location of the plane to find shapes on.
4818 theState The state of the sub-shapes to find (see GEOM::shape_state)
4821 List of all found sub-shapes indices.
4823 # Example: see GEOM_TestOthers.py
4824 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4825 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4828 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4829 # situated relatively the specified plane by the certain way,
4830 # defined through <VAR>theState</VAR> parameter.
4831 # @param theShape Shape to find sub-shapes of.
4832 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4833 # @param theAx1 Vector (or line, or linear edge), specifying normal
4834 # direction of the plane to find shapes on.
4835 # @param thePnt Point specifying location of the plane to find shapes on.
4836 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4837 # @param theName Object name; when specified, this parameter is used
4838 # for result publication in the study. Otherwise, if automatic
4839 # publication is switched on, default value is used for result name.
4841 # @return List of all found sub-shapes.
4843 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4844 @ManageTransactions("ShapesOp")
4845 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4847 Find in theShape all sub-shapes of type theShapeType,
4848 situated relatively the specified plane by the certain way,
4849 defined through theState parameter.
4852 theShape Shape to find sub-shapes of.
4853 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4854 theAx1 Vector (or line, or linear edge), specifying normal
4855 direction and location of the plane to find shapes on.
4856 thePnt Point specifying location of the plane to find shapes on.
4857 theState The state of the sub-shapes to find (see GEOM::shape_state)
4858 theName Object name; when specified, this parameter is used
4859 for result publication in the study. Otherwise, if automatic
4860 publication is switched on, default value is used for result name.
4863 List of all found sub-shapes.
4865 # Example: see GEOM_TestOthers.py
4866 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4867 theAx1, thePnt, theState)
4868 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4869 self._autoPublish(aList, theName, "shapeOnPlane")
4872 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4873 # situated relatively the specified plane by the certain way,
4874 # defined through <VAR>theState</VAR> parameter.
4875 # @param theShape Shape to find sub-shapes of.
4876 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4877 # @param theAx1 Vector (or line, or linear edge), specifying normal
4878 # direction of the plane to find shapes on.
4879 # @param thePnt Point specifying location of the plane to find shapes on.
4880 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4882 # @return List of all found sub-shapes indices.
4884 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4885 @ManageTransactions("ShapesOp")
4886 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4888 Find in theShape all sub-shapes of type theShapeType,
4889 situated relatively the specified plane by the certain way,
4890 defined through theState parameter.
4893 theShape Shape to find sub-shapes of.
4894 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4895 theAx1 Vector (or line, or linear edge), specifying normal
4896 direction and location of the plane to find shapes on.
4897 thePnt Point specifying location of the plane to find shapes on.
4898 theState The state of the sub-shapes to find (see GEOM::shape_state)
4901 List of all found sub-shapes indices.
4903 # Example: see GEOM_TestOthers.py
4904 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4905 theAx1, thePnt, theState)
4906 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4909 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4910 # the specified cylinder by the certain way, defined through \a theState parameter.
4911 # @param theShape Shape to find sub-shapes of.
4912 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4913 # @param theAxis Vector (or line, or linear edge), specifying
4914 # axis of the cylinder to find shapes on.
4915 # @param theRadius Radius of the cylinder to find shapes on.
4916 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4917 # @param theName Object name; when specified, this parameter is used
4918 # for result publication in the study. Otherwise, if automatic
4919 # publication is switched on, default value is used for result name.
4921 # @return List of all found sub-shapes.
4923 # @ref swig_GetShapesOnCylinder "Example"
4924 @ManageTransactions("ShapesOp")
4925 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4927 Find in theShape all sub-shapes of type theShapeType, situated relatively
4928 the specified cylinder by the certain way, defined through theState parameter.
4931 theShape Shape to find sub-shapes of.
4932 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4933 theAxis Vector (or line, or linear edge), specifying
4934 axis of the cylinder to find shapes on.
4935 theRadius Radius of the cylinder to find shapes on.
4936 theState The state of the sub-shapes to find (see GEOM::shape_state)
4937 theName Object name; when specified, this parameter is used
4938 for result publication in the study. Otherwise, if automatic
4939 publication is switched on, default value is used for result name.
4942 List of all found sub-shapes.
4944 # Example: see GEOM_TestOthers.py
4945 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4946 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4947 self._autoPublish(aList, theName, "shapeOnCylinder")
4950 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4951 # the specified cylinder by the certain way, defined through \a theState parameter.
4952 # @param theShape Shape to find sub-shapes of.
4953 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4954 # @param theAxis Vector (or line, or linear edge), specifying
4955 # axis of the cylinder to find shapes on.
4956 # @param theRadius Radius of the cylinder to find shapes on.
4957 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4959 # @return List of all found sub-shapes indices.
4961 # @ref swig_GetShapesOnCylinderIDs "Example"
4962 @ManageTransactions("ShapesOp")
4963 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4965 Find in theShape all sub-shapes of type theShapeType, situated relatively
4966 the specified cylinder by the certain way, defined through theState parameter.
4969 theShape Shape to find sub-shapes of.
4970 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4971 theAxis Vector (or line, or linear edge), specifying
4972 axis of the cylinder to find shapes on.
4973 theRadius Radius of the cylinder to find shapes on.
4974 theState The state of the sub-shapes to find (see GEOM::shape_state)
4977 List of all found sub-shapes indices.
4979 # Example: see GEOM_TestOthers.py
4980 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4981 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4984 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4985 # the specified cylinder by the certain way, defined through \a theState parameter.
4986 # @param theShape Shape to find sub-shapes of.
4987 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4988 # @param theAxis Vector (or line, or linear edge), specifying
4989 # axis of the cylinder to find shapes on.
4990 # @param thePnt Point specifying location of the bottom of the cylinder.
4991 # @param theRadius Radius of the cylinder to find shapes on.
4992 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4993 # @param theName Object name; when specified, this parameter is used
4994 # for result publication in the study. Otherwise, if automatic
4995 # publication is switched on, default value is used for result name.
4997 # @return List of all found sub-shapes.
4999 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5000 @ManageTransactions("ShapesOp")
5001 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5003 Find in theShape all sub-shapes of type theShapeType, situated relatively
5004 the specified cylinder by the certain way, defined through theState parameter.
5007 theShape Shape to find sub-shapes of.
5008 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5009 theAxis Vector (or line, or linear edge), specifying
5010 axis of the cylinder to find shapes on.
5011 theRadius Radius of the cylinder to find shapes on.
5012 theState The state of the sub-shapes to find (see GEOM::shape_state)
5013 theName Object name; when specified, this parameter is used
5014 for result publication in the study. Otherwise, if automatic
5015 publication is switched on, default value is used for result name.
5018 List of all found sub-shapes.
5020 # Example: see GEOM_TestOthers.py
5021 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5022 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5023 self._autoPublish(aList, theName, "shapeOnCylinder")
5026 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5027 # the specified cylinder by the certain way, defined through \a theState parameter.
5028 # @param theShape Shape to find sub-shapes of.
5029 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5030 # @param theAxis Vector (or line, or linear edge), specifying
5031 # axis of the cylinder to find shapes on.
5032 # @param thePnt Point specifying location of the bottom of the cylinder.
5033 # @param theRadius Radius of the cylinder to find shapes on.
5034 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5036 # @return List of all found sub-shapes indices
5038 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5039 @ManageTransactions("ShapesOp")
5040 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5042 Find in theShape all sub-shapes of type theShapeType, situated relatively
5043 the specified cylinder by the certain way, defined through theState parameter.
5046 theShape Shape to find sub-shapes of.
5047 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5048 theAxis Vector (or line, or linear edge), specifying
5049 axis of the cylinder to find shapes on.
5050 theRadius Radius of the cylinder to find shapes on.
5051 theState The state of the sub-shapes to find (see GEOM::shape_state)
5054 List of all found sub-shapes indices.
5056 # Example: see GEOM_TestOthers.py
5057 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5058 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5061 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5062 # the specified sphere by the certain way, defined through \a theState parameter.
5063 # @param theShape Shape to find sub-shapes of.
5064 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5065 # @param theCenter Point, specifying center of the sphere to find shapes on.
5066 # @param theRadius Radius of the sphere to find shapes on.
5067 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5068 # @param theName Object name; when specified, this parameter is used
5069 # for result publication in the study. Otherwise, if automatic
5070 # publication is switched on, default value is used for result name.
5072 # @return List of all found sub-shapes.
5074 # @ref swig_GetShapesOnSphere "Example"
5075 @ManageTransactions("ShapesOp")
5076 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5078 Find in theShape all sub-shapes of type theShapeType, situated relatively
5079 the specified sphere by the certain way, defined through theState parameter.
5082 theShape Shape to find sub-shapes of.
5083 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5084 theCenter Point, specifying center of the sphere to find shapes on.
5085 theRadius Radius of the sphere to find shapes on.
5086 theState The state of the sub-shapes to find (see GEOM::shape_state)
5087 theName Object name; when specified, this parameter is used
5088 for result publication in the study. Otherwise, if automatic
5089 publication is switched on, default value is used for result name.
5092 List of all found sub-shapes.
5094 # Example: see GEOM_TestOthers.py
5095 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5096 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5097 self._autoPublish(aList, theName, "shapeOnSphere")
5100 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5101 # the specified sphere by the certain way, defined through \a theState parameter.
5102 # @param theShape Shape to find sub-shapes of.
5103 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5104 # @param theCenter Point, specifying center of the sphere to find shapes on.
5105 # @param theRadius Radius of the sphere to find shapes on.
5106 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5108 # @return List of all found sub-shapes indices.
5110 # @ref swig_GetShapesOnSphereIDs "Example"
5111 @ManageTransactions("ShapesOp")
5112 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5114 Find in theShape all sub-shapes of type theShapeType, situated relatively
5115 the specified sphere by the certain way, defined through theState parameter.
5118 theShape Shape to find sub-shapes of.
5119 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5120 theCenter Point, specifying center of the sphere to find shapes on.
5121 theRadius Radius of the sphere to find shapes on.
5122 theState The state of the sub-shapes to find (see GEOM::shape_state)
5125 List of all found sub-shapes indices.
5127 # Example: see GEOM_TestOthers.py
5128 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5129 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5132 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5133 # the specified quadrangle by the certain way, defined through \a theState parameter.
5134 # @param theShape Shape to find sub-shapes of.
5135 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5136 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5137 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5138 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5139 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5140 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5141 # @param theName Object name; when specified, this parameter is used
5142 # for result publication in the study. Otherwise, if automatic
5143 # publication is switched on, default value is used for result name.
5145 # @return List of all found sub-shapes.
5147 # @ref swig_GetShapesOnQuadrangle "Example"
5148 @ManageTransactions("ShapesOp")
5149 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5150 theTopLeftPoint, theTopRigthPoint,
5151 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5153 Find in theShape all sub-shapes of type theShapeType, situated relatively
5154 the specified quadrangle by the certain way, defined through theState parameter.
5157 theShape Shape to find sub-shapes of.
5158 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5159 theTopLeftPoint Point, specifying top left corner of a quadrangle
5160 theTopRigthPoint Point, specifying top right corner of a quadrangle
5161 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5162 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5163 theState The state of the sub-shapes to find (see GEOM::shape_state)
5164 theName Object name; when specified, this parameter is used
5165 for result publication in the study. Otherwise, if automatic
5166 publication is switched on, default value is used for result name.
5169 List of all found sub-shapes.
5171 # Example: see GEOM_TestOthers.py
5172 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5173 theTopLeftPoint, theTopRigthPoint,
5174 theBottomLeftPoint, theBottomRigthPoint, theState)
5175 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5176 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5179 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5180 # the specified quadrangle by the certain way, defined through \a theState parameter.
5181 # @param theShape Shape to find sub-shapes of.
5182 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5183 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5184 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5185 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5186 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5187 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5189 # @return List of all found sub-shapes indices.
5191 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5192 @ManageTransactions("ShapesOp")
5193 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5194 theTopLeftPoint, theTopRigthPoint,
5195 theBottomLeftPoint, theBottomRigthPoint, theState):
5197 Find in theShape all sub-shapes of type theShapeType, situated relatively
5198 the specified quadrangle by the certain way, defined through theState parameter.
5201 theShape Shape to find sub-shapes of.
5202 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5203 theTopLeftPoint Point, specifying top left corner of a quadrangle
5204 theTopRigthPoint Point, specifying top right corner of a quadrangle
5205 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5206 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5207 theState The state of the sub-shapes to find (see GEOM::shape_state)
5210 List of all found sub-shapes indices.
5213 # Example: see GEOM_TestOthers.py
5214 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5215 theTopLeftPoint, theTopRigthPoint,
5216 theBottomLeftPoint, theBottomRigthPoint, theState)
5217 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5220 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5221 # the specified \a theBox by the certain way, defined through \a theState parameter.
5222 # @param theBox Shape for relative comparing.
5223 # @param theShape Shape to find sub-shapes of.
5224 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5225 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5226 # @param theName Object name; when specified, this parameter is used
5227 # for result publication in the study. Otherwise, if automatic
5228 # publication is switched on, default value is used for result name.
5230 # @return List of all found sub-shapes.
5232 # @ref swig_GetShapesOnBox "Example"
5233 @ManageTransactions("ShapesOp")
5234 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5236 Find in theShape all sub-shapes of type theShapeType, situated relatively
5237 the specified theBox by the certain way, defined through theState parameter.
5240 theBox Shape for relative comparing.
5241 theShape Shape to find sub-shapes of.
5242 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5243 theState The state of the sub-shapes to find (see GEOM::shape_state)
5244 theName Object name; when specified, this parameter is used
5245 for result publication in the study. Otherwise, if automatic
5246 publication is switched on, default value is used for result name.
5249 List of all found sub-shapes.
5251 # Example: see GEOM_TestOthers.py
5252 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5253 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5254 self._autoPublish(aList, theName, "shapeOnBox")
5257 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5258 # the specified \a theBox by the certain way, defined through \a theState parameter.
5259 # @param theBox Shape for relative comparing.
5260 # @param theShape Shape to find sub-shapes of.
5261 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5262 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5264 # @return List of all found sub-shapes indices.
5266 # @ref swig_GetShapesOnBoxIDs "Example"
5267 @ManageTransactions("ShapesOp")
5268 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5270 Find in theShape all sub-shapes of type theShapeType, situated relatively
5271 the specified theBox by the certain way, defined through theState parameter.
5274 theBox Shape for relative comparing.
5275 theShape Shape to find sub-shapes of.
5276 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5277 theState The state of the sub-shapes to find (see GEOM::shape_state)
5280 List of all found sub-shapes indices.
5282 # Example: see GEOM_TestOthers.py
5283 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5284 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5287 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5288 # situated relatively the specified \a theCheckShape by the
5289 # certain way, defined through \a theState parameter.
5290 # @param theCheckShape Shape for relative comparing. It must be a solid.
5291 # @param theShape Shape to find sub-shapes of.
5292 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5293 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5294 # @param theName Object name; when specified, this parameter is used
5295 # for result publication in the study. Otherwise, if automatic
5296 # publication is switched on, default value is used for result name.
5298 # @return List of all found sub-shapes.
5300 # @ref swig_GetShapesOnShape "Example"
5301 @ManageTransactions("ShapesOp")
5302 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5304 Find in theShape all sub-shapes of type theShapeType,
5305 situated relatively the specified theCheckShape by the
5306 certain way, defined through theState parameter.
5309 theCheckShape Shape for relative comparing. It must be a solid.
5310 theShape Shape to find sub-shapes of.
5311 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5312 theState The state of the sub-shapes to find (see GEOM::shape_state)
5313 theName Object name; when specified, this parameter is used
5314 for result publication in the study. Otherwise, if automatic
5315 publication is switched on, default value is used for result name.
5318 List of all found sub-shapes.
5320 # Example: see GEOM_TestOthers.py
5321 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5322 theShapeType, theState)
5323 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5324 self._autoPublish(aList, theName, "shapeOnShape")
5327 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5328 # situated relatively the specified \a theCheckShape by the
5329 # certain way, defined through \a theState parameter.
5330 # @param theCheckShape Shape for relative comparing. It must be a solid.
5331 # @param theShape Shape to find sub-shapes of.
5332 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5333 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5334 # @param theName Object name; when specified, this parameter is used
5335 # for result publication in the study. Otherwise, if automatic
5336 # publication is switched on, default value is used for result name.
5338 # @return All found sub-shapes as compound.
5340 # @ref swig_GetShapesOnShapeAsCompound "Example"
5341 @ManageTransactions("ShapesOp")
5342 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5344 Find in theShape all sub-shapes of type theShapeType,
5345 situated relatively the specified theCheckShape by the
5346 certain way, defined through theState parameter.
5349 theCheckShape Shape for relative comparing. It must be a solid.
5350 theShape Shape to find sub-shapes of.
5351 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5352 theState The state of the sub-shapes to find (see GEOM::shape_state)
5353 theName Object name; when specified, this parameter is used
5354 for result publication in the study. Otherwise, if automatic
5355 publication is switched on, default value is used for result name.
5358 All found sub-shapes as compound.
5360 # Example: see GEOM_TestOthers.py
5361 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5362 theShapeType, theState)
5363 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5364 self._autoPublish(anObj, theName, "shapeOnShape")
5367 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5368 # situated relatively the specified \a theCheckShape by the
5369 # certain way, defined through \a theState parameter.
5370 # @param theCheckShape Shape for relative comparing. It must be a solid.
5371 # @param theShape Shape to find sub-shapes of.
5372 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5373 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5375 # @return List of all found sub-shapes indices.
5377 # @ref swig_GetShapesOnShapeIDs "Example"
5378 @ManageTransactions("ShapesOp")
5379 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5381 Find in theShape all sub-shapes of type theShapeType,
5382 situated relatively the specified theCheckShape by the
5383 certain way, defined through theState parameter.
5386 theCheckShape Shape for relative comparing. It must be a solid.
5387 theShape Shape to find sub-shapes of.
5388 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5389 theState The state of the sub-shapes to find (see GEOM::shape_state)
5392 List of all found sub-shapes indices.
5394 # Example: see GEOM_TestOthers.py
5395 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5396 theShapeType, theState)
5397 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5400 ## Get sub-shape(s) of theShapeWhere, which are
5401 # coincident with \a theShapeWhat or could be a part of it.
5402 # @param theShapeWhere Shape to find sub-shapes of.
5403 # @param theShapeWhat Shape, specifying what to find.
5404 # @param isNewImplementation implementation of GetInPlace functionality
5405 # (default = False, old alghorithm based on shape properties)
5406 # @param theName Object name; when specified, this parameter is used
5407 # for result publication in the study. Otherwise, if automatic
5408 # publication is switched on, default value is used for result name.
5410 # @return Group of all found sub-shapes or a single found sub-shape.
5412 # @note This function has a restriction on argument shapes.
5413 # If \a theShapeWhere has curved parts with significantly
5414 # outstanding centres (i.e. the mass centre of a part is closer to
5415 # \a theShapeWhat than to the part), such parts will not be found.
5416 # @image html get_in_place_lost_part.png
5418 # @ref swig_GetInPlace "Example"
5419 @ManageTransactions("ShapesOp")
5420 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5422 Get sub-shape(s) of theShapeWhere, which are
5423 coincident with theShapeWhat or could be a part of it.
5426 theShapeWhere Shape to find sub-shapes of.
5427 theShapeWhat Shape, specifying what to find.
5428 isNewImplementation Implementation of GetInPlace functionality
5429 (default = False, old alghorithm based on shape properties)
5430 theName Object name; when specified, this parameter is used
5431 for result publication in the study. Otherwise, if automatic
5432 publication is switched on, default value is used for result name.
5435 Group of all found sub-shapes or a single found sub-shape.
5439 This function has a restriction on argument shapes.
5440 If theShapeWhere has curved parts with significantly
5441 outstanding centres (i.e. the mass centre of a part is closer to
5442 theShapeWhat than to the part), such parts will not be found.
5444 # Example: see GEOM_TestOthers.py
5446 if isNewImplementation:
5447 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5449 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5451 RaiseIfFailed("GetInPlace", self.ShapesOp)
5452 self._autoPublish(anObj, theName, "inplace")
5455 ## Get sub-shape(s) of \a theShapeWhere, which are
5456 # coincident with \a theShapeWhat or could be a part of it.
5458 # Implementation of this method is based on a saved history of an operation,
5459 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5460 # arguments (an argument shape or a sub-shape of an argument shape).
5461 # The operation could be the Partition or one of boolean operations,
5462 # performed on simple shapes (not on compounds).
5464 # @param theShapeWhere Shape to find sub-shapes of.
5465 # @param theShapeWhat Shape, specifying what to find (must be in the
5466 # building history of the ShapeWhere).
5467 # @param theName Object name; when specified, this parameter is used
5468 # for result publication in the study. Otherwise, if automatic
5469 # publication is switched on, default value is used for result name.
5471 # @return Group of all found sub-shapes or a single found sub-shape.
5473 # @ref swig_GetInPlace "Example"
5474 @ManageTransactions("ShapesOp")
5475 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5477 Implementation of this method is based on a saved history of an operation,
5478 produced theShapeWhere. The theShapeWhat must be among this operation's
5479 arguments (an argument shape or a sub-shape of an argument shape).
5480 The operation could be the Partition or one of boolean operations,
5481 performed on simple shapes (not on compounds).
5484 theShapeWhere Shape to find sub-shapes of.
5485 theShapeWhat Shape, specifying what to find (must be in the
5486 building history of the ShapeWhere).
5487 theName Object name; when specified, this parameter is used
5488 for result publication in the study. Otherwise, if automatic
5489 publication is switched on, default value is used for result name.
5492 Group of all found sub-shapes or a single found sub-shape.
5494 # Example: see GEOM_TestOthers.py
5495 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5496 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5497 self._autoPublish(anObj, theName, "inplace")
5500 ## Get sub-shape of theShapeWhere, which is
5501 # equal to \a theShapeWhat.
5502 # @param theShapeWhere Shape to find sub-shape of.
5503 # @param theShapeWhat Shape, specifying what to find.
5504 # @param theName Object name; when specified, this parameter is used
5505 # for result publication in the study. Otherwise, if automatic
5506 # publication is switched on, default value is used for result name.
5508 # @return New GEOM.GEOM_Object for found sub-shape.
5510 # @ref swig_GetSame "Example"
5511 @ManageTransactions("ShapesOp")
5512 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5514 Get sub-shape of theShapeWhere, which is
5515 equal to theShapeWhat.
5518 theShapeWhere Shape to find sub-shape of.
5519 theShapeWhat Shape, specifying what to find.
5520 theName Object name; when specified, this parameter is used
5521 for result publication in the study. Otherwise, if automatic
5522 publication is switched on, default value is used for result name.
5525 New GEOM.GEOM_Object for found sub-shape.
5527 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5528 RaiseIfFailed("GetSame", self.ShapesOp)
5529 self._autoPublish(anObj, theName, "sameShape")
5533 ## Get sub-shape indices of theShapeWhere, which is
5534 # equal to \a theShapeWhat.
5535 # @param theShapeWhere Shape to find sub-shape of.
5536 # @param theShapeWhat Shape, specifying what to find.
5537 # @return List of all found sub-shapes indices.
5539 # @ref swig_GetSame "Example"
5540 @ManageTransactions("ShapesOp")
5541 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5543 Get sub-shape indices of theShapeWhere, which is
5544 equal to theShapeWhat.
5547 theShapeWhere Shape to find sub-shape of.
5548 theShapeWhat Shape, specifying what to find.
5551 List of all found sub-shapes indices.
5553 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5554 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5561 ## @addtogroup l4_access
5564 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5565 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5566 # @param aShape Shape to get sub-shape of.
5567 # @param ListOfID List of sub-shapes indices.
5568 # @param theName Object name; when specified, this parameter is used
5569 # for result publication in the study. Otherwise, if automatic
5570 # publication is switched on, default value is used for result name.
5572 # @return Found sub-shape.
5574 # @ref swig_all_decompose "Example"
5575 def GetSubShape(self, aShape, ListOfID, theName=None):
5577 Obtain a composite sub-shape of aShape, composed from sub-shapes
5578 of aShape, selected by their unique IDs inside aShape
5581 aShape Shape to get sub-shape of.
5582 ListOfID List of sub-shapes indices.
5583 theName Object name; when specified, this parameter is used
5584 for result publication in the study. Otherwise, if automatic
5585 publication is switched on, default value is used for result name.
5590 # Example: see GEOM_TestAll.py
5591 anObj = self.AddSubShape(aShape,ListOfID)
5592 self._autoPublish(anObj, theName, "subshape")
5595 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5596 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5597 # @param aShape Shape to get sub-shape of.
5598 # @param aSubShape Sub-shapes of aShape.
5599 # @return ID of found sub-shape.
5601 # @ref swig_all_decompose "Example"
5602 @ManageTransactions("LocalOp")
5603 def GetSubShapeID(self, aShape, aSubShape):
5605 Obtain unique ID of sub-shape aSubShape inside aShape
5606 of aShape, selected by their unique IDs inside aShape
5609 aShape Shape to get sub-shape of.
5610 aSubShape Sub-shapes of aShape.
5613 ID of found sub-shape.
5615 # Example: see GEOM_TestAll.py
5616 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5617 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5620 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5621 # This function is provided for performance purpose. The complexity is O(n) with n
5622 # the number of subobjects of aShape
5623 # @param aShape Shape to get sub-shape of.
5624 # @param aSubShapes Sub-shapes of aShape.
5625 # @return list of IDs of found sub-shapes.
5627 # @ref swig_all_decompose "Example"
5628 @ManageTransactions("ShapesOp")
5629 def GetSubShapesIDs(self, aShape, aSubShapes):
5631 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5632 This function is provided for performance purpose. The complexity is O(n) with n
5633 the number of subobjects of aShape
5636 aShape Shape to get sub-shape of.
5637 aSubShapes Sub-shapes of aShape.
5640 List of IDs of found sub-shape.
5642 # Example: see GEOM_TestAll.py
5643 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5644 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5650 ## @addtogroup l4_decompose
5653 ## Get all sub-shapes and groups of \a theShape,
5654 # that were created already by any other methods.
5655 # @param theShape Any shape.
5656 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5657 # returned, else all found sub-shapes and groups.
5658 # @return List of existing sub-objects of \a theShape.
5660 # @ref swig_all_decompose "Example"
5661 @ManageTransactions("ShapesOp")
5662 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5664 Get all sub-shapes and groups of theShape,
5665 that were created already by any other methods.
5669 theGroupsOnly If this parameter is TRUE, only groups will be
5670 returned, else all found sub-shapes and groups.
5673 List of existing sub-objects of theShape.
5675 # Example: see GEOM_TestAll.py
5676 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5677 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5680 ## Get all groups of \a theShape,
5681 # that were created already by any other methods.
5682 # @param theShape Any shape.
5683 # @return List of existing groups of \a theShape.
5685 # @ref swig_all_decompose "Example"
5686 @ManageTransactions("ShapesOp")
5687 def GetGroups(self, theShape):
5689 Get all groups of theShape,
5690 that were created already by any other methods.
5696 List of existing groups of theShape.
5698 # Example: see GEOM_TestAll.py
5699 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5700 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5703 ## Explode a shape on sub-shapes of a given type.
5704 # If the shape itself matches the type, it is also returned.
5705 # @param aShape Shape to be exploded.
5706 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5707 # @param theName Object name; when specified, this parameter is used
5708 # for result publication in the study. Otherwise, if automatic
5709 # publication is switched on, default value is used for result name.
5711 # @return List of sub-shapes of type theShapeType, contained in theShape.
5713 # @ref swig_all_decompose "Example"
5714 @ManageTransactions("ShapesOp")
5715 def SubShapeAll(self, aShape, aType, theName=None):
5717 Explode a shape on sub-shapes of a given type.
5718 If the shape itself matches the type, it is also returned.
5721 aShape Shape to be exploded.
5722 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5723 theName Object name; when specified, this parameter is used
5724 for result publication in the study. Otherwise, if automatic
5725 publication is switched on, default value is used for result name.
5728 List of sub-shapes of type theShapeType, contained in theShape.
5730 # Example: see GEOM_TestAll.py
5731 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5732 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5733 self._autoPublish(ListObj, theName, "subshape")
5736 ## Explode a shape on sub-shapes of a given type.
5737 # @param aShape Shape to be exploded.
5738 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5739 # @return List of IDs of sub-shapes.
5741 # @ref swig_all_decompose "Example"
5742 @ManageTransactions("ShapesOp")
5743 def SubShapeAllIDs(self, aShape, aType):
5745 Explode a shape on sub-shapes of a given type.
5748 aShape Shape to be exploded (see geompy.ShapeType)
5749 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5752 List of IDs of sub-shapes.
5754 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5755 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5758 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5759 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5760 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5761 # @param aShape Shape to get sub-shape of.
5762 # @param ListOfInd List of sub-shapes indices.
5763 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5764 # @param theName Object name; when specified, this parameter is used
5765 # for result publication in the study. Otherwise, if automatic
5766 # publication is switched on, default value is used for result name.
5768 # @return A compound of sub-shapes of aShape.
5770 # @ref swig_all_decompose "Example"
5771 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5773 Obtain a compound of sub-shapes of aShape,
5774 selected by their indices in list of all sub-shapes of type aType.
5775 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5778 aShape Shape to get sub-shape of.
5779 ListOfID List of sub-shapes indices.
5780 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5781 theName Object name; when specified, this parameter is used
5782 for result publication in the study. Otherwise, if automatic
5783 publication is switched on, default value is used for result name.
5786 A compound of sub-shapes of aShape.
5788 # Example: see GEOM_TestAll.py
5790 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5791 for ind in ListOfInd:
5792 ListOfIDs.append(AllShapeIDsList[ind - 1])
5793 # note: auto-publishing is done in self.GetSubShape()
5794 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5797 ## Explode a shape on sub-shapes of a given type.
5798 # Sub-shapes will be sorted taking into account their gravity centers,
5799 # to provide stable order of sub-shapes.
5800 # If the shape itself matches the type, it is also returned.
5801 # @param aShape Shape to be exploded.
5802 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5803 # @param theName Object name; when specified, this parameter is used
5804 # for result publication in the study. Otherwise, if automatic
5805 # publication is switched on, default value is used for result name.
5807 # @return List of sub-shapes of type theShapeType, contained in theShape.
5809 # @ref swig_SubShapeAllSorted "Example"
5810 @ManageTransactions("ShapesOp")
5811 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5813 Explode a shape on sub-shapes of a given type.
5814 Sub-shapes will be sorted taking into account their gravity centers,
5815 to provide stable order of sub-shapes.
5816 If the shape itself matches the type, it is also returned.
5819 aShape Shape to be exploded.
5820 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5821 theName Object name; when specified, this parameter is used
5822 for result publication in the study. Otherwise, if automatic
5823 publication is switched on, default value is used for result name.
5826 List of sub-shapes of type theShapeType, contained in theShape.
5828 # Example: see GEOM_TestAll.py
5829 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5830 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5831 self._autoPublish(ListObj, theName, "subshape")
5834 ## Explode a shape on sub-shapes of a given type.
5835 # Sub-shapes will be sorted taking into account their gravity centers,
5836 # to provide stable order of sub-shapes.
5837 # @param aShape Shape to be exploded.
5838 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5839 # @return List of IDs of sub-shapes.
5841 # @ref swig_all_decompose "Example"
5842 @ManageTransactions("ShapesOp")
5843 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5845 Explode a shape on sub-shapes of a given type.
5846 Sub-shapes will be sorted taking into account their gravity centers,
5847 to provide stable order of sub-shapes.
5850 aShape Shape to be exploded.
5851 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5854 List of IDs of sub-shapes.
5856 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5857 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5860 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5861 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5862 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5863 # @param aShape Shape to get sub-shape of.
5864 # @param ListOfInd List of sub-shapes indices.
5865 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5866 # @param theName Object name; when specified, this parameter is used
5867 # for result publication in the study. Otherwise, if automatic
5868 # publication is switched on, default value is used for result name.
5870 # @return A compound of sub-shapes of aShape.
5872 # @ref swig_all_decompose "Example"
5873 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5875 Obtain a compound of sub-shapes of aShape,
5876 selected by they indices in sorted list of all sub-shapes of type aType.
5877 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5880 aShape Shape to get sub-shape of.
5881 ListOfID List of sub-shapes indices.
5882 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5883 theName Object name; when specified, this parameter is used
5884 for result publication in the study. Otherwise, if automatic
5885 publication is switched on, default value is used for result name.
5888 A compound of sub-shapes of aShape.
5890 # Example: see GEOM_TestAll.py
5892 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5893 for ind in ListOfInd:
5894 ListOfIDs.append(AllShapeIDsList[ind - 1])
5895 # note: auto-publishing is done in self.GetSubShape()
5896 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5899 ## Extract shapes (excluding the main shape) of given type.
5900 # @param aShape The shape.
5901 # @param aType The shape type (see ShapeType())
5902 # @param isSorted Boolean flag to switch sorting on/off.
5903 # @param theName Object name; when specified, this parameter is used
5904 # for result publication in the study. Otherwise, if automatic
5905 # publication is switched on, default value is used for result name.
5907 # @return List of sub-shapes of type aType, contained in aShape.
5909 # @ref swig_FilletChamfer "Example"
5910 @ManageTransactions("ShapesOp")
5911 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5913 Extract shapes (excluding the main shape) of given type.
5917 aType The shape type (see geompy.ShapeType)
5918 isSorted Boolean flag to switch sorting on/off.
5919 theName Object name; when specified, this parameter is used
5920 for result publication in the study. Otherwise, if automatic
5921 publication is switched on, default value is used for result name.
5924 List of sub-shapes of type aType, contained in aShape.
5926 # Example: see GEOM_TestAll.py
5927 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5928 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5929 self._autoPublish(ListObj, theName, "subshape")
5932 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5933 # @param aShape Main shape.
5934 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5935 # @param theName Object name; when specified, this parameter is used
5936 # for result publication in the study. Otherwise, if automatic
5937 # publication is switched on, default value is used for result name.
5938 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5940 # @ref swig_all_decompose "Example"
5941 @ManageTransactions("ShapesOp")
5942 def SubShapes(self, aShape, anIDs, theName=None):
5944 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5948 anIDs List of unique IDs of sub-shapes inside theMainShape.
5949 theName Object name; when specified, this parameter is used
5950 for result publication in the study. Otherwise, if automatic
5951 publication is switched on, default value is used for result name.
5954 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5956 # Example: see GEOM_TestAll.py
5957 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5958 RaiseIfFailed("SubShapes", self.ShapesOp)
5959 self._autoPublish(ListObj, theName, "subshape")
5962 # end of l4_decompose
5965 ## @addtogroup l4_decompose_d
5968 ## Deprecated method
5969 # It works like SubShapeAllSortedCentres(), but wrongly
5970 # defines centres of faces, shells and solids.
5971 @ManageTransactions("ShapesOp")
5972 def SubShapeAllSorted(self, aShape, aType, theName=None):
5975 It works like geompy.SubShapeAllSortedCentres, but wrongly
5976 defines centres of faces, shells and solids.
5978 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5979 RaiseIfFailed("MakeExplode", self.ShapesOp)
5980 self._autoPublish(ListObj, theName, "subshape")
5983 ## Deprecated method
5984 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5985 # defines centres of faces, shells and solids.
5986 @ManageTransactions("ShapesOp")
5987 def SubShapeAllSortedIDs(self, aShape, aType):
5990 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5991 defines centres of faces, shells and solids.
5993 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5994 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5997 ## Deprecated method
5998 # It works like SubShapeSortedCentres(), but has a bug
5999 # (wrongly defines centres of faces, shells and solids).
6000 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6003 It works like geompy.SubShapeSortedCentres, but has a bug
6004 (wrongly defines centres of faces, shells and solids).
6007 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6008 for ind in ListOfInd:
6009 ListOfIDs.append(AllShapeIDsList[ind - 1])
6010 # note: auto-publishing is done in self.GetSubShape()
6011 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6014 # end of l4_decompose_d
6017 ## @addtogroup l3_healing
6020 ## Apply a sequence of Shape Healing operators to the given object.
6021 # @param theShape Shape to be processed.
6022 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6023 # @param theParameters List of names of parameters
6024 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6025 # @param theValues List of values of parameters, in the same order
6026 # as parameters are listed in <VAR>theParameters</VAR> list.
6027 # @param theName Object name; when specified, this parameter is used
6028 # for result publication in the study. Otherwise, if automatic
6029 # publication is switched on, default value is used for result name.
6031 # <b> Operators and Parameters: </b> \n
6033 # * \b FixShape - corrects invalid shapes. \n
6034 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6035 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6037 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6038 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6039 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6040 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6042 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6043 # surfaces in segments using a certain angle. \n
6044 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6045 # if Angle=180, four if Angle=90, etc). \n
6046 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6048 # * \b SplitClosedFaces - splits closed faces in segments.
6049 # The number of segments depends on the number of splitting points.\n
6050 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6052 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6053 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6054 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6055 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6056 # This and the previous parameters can take the following values:\n
6057 # \b Parametric \b Continuity \n
6058 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6059 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6060 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6061 # ruling out sharp edges).\n
6062 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6063 # are of the same magnitude).\n
6064 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6065 # or surfaces (d/du C(u)) are the same at junction. \n
6066 # \b Geometric \b Continuity \n
6067 # \b G1: first derivatives are proportional at junction.\n
6068 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6069 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6070 # \b G2: first and second derivatives are proportional at junction.
6071 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6072 # continuity requires that the underlying parameterization was continuous as well.
6073 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6075 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6076 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6077 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6078 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6079 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6080 # with the specified parameters.\n
6081 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6082 # with the specified parameters.\n
6083 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6084 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6085 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6086 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6088 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6089 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6090 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6091 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6092 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6094 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6095 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6098 # @return New GEOM.GEOM_Object, containing processed shape.
6100 # \n @ref tui_shape_processing "Example"
6101 @ManageTransactions("HealOp")
6102 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6104 Apply a sequence of Shape Healing operators to the given object.
6107 theShape Shape to be processed.
6108 theValues List of values of parameters, in the same order
6109 as parameters are listed in theParameters list.
6110 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6111 theParameters List of names of parameters
6112 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6113 theName Object name; when specified, this parameter is used
6114 for result publication in the study. Otherwise, if automatic
6115 publication is switched on, default value is used for result name.
6117 Operators and Parameters:
6119 * FixShape - corrects invalid shapes.
6120 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6121 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6122 * FixFaceSize - removes small faces, such as spots and strips.
6123 * FixFaceSize.Tolerance - defines minimum possible face size.
6124 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6125 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6126 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6127 in segments using a certain angle.
6128 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6129 if Angle=180, four if Angle=90, etc).
6130 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6131 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6133 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6134 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6135 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6136 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6137 * SplitContinuity.CurveContinuity - required continuity for curves.
6138 This and the previous parameters can take the following values:
6140 Parametric Continuity:
6141 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6142 coincidental. The curves or surfaces may still meet at an angle,
6143 giving rise to a sharp corner or edge).
6144 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6145 are parallel, ruling out sharp edges).
6146 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6147 or surfaces are of the same magnitude).
6148 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6149 curves or surfaces (d/du C(u)) are the same at junction.
6151 Geometric Continuity:
6152 G1: first derivatives are proportional at junction.
6153 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6154 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6155 G2: first and second derivatives are proportional at junction. As the names imply,
6156 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6157 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6158 geometric continuity of order n, but not vice-versa.
6159 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6160 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6161 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6162 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6163 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6164 the specified parameters.
6165 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6166 the specified parameters.
6167 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6168 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6169 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6170 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6171 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6172 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6173 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6174 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6175 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6176 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6177 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6180 New GEOM.GEOM_Object, containing processed shape.
6182 Note: For more information look through SALOME Geometry User's Guide->
6183 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6185 # Example: see GEOM_TestHealing.py
6186 theValues,Parameters = ParseList(theValues)
6187 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6188 # To avoid script failure in case of good argument shape
6189 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6191 RaiseIfFailed("ProcessShape", self.HealOp)
6192 for string in (theOperators + theParameters):
6193 Parameters = ":" + Parameters
6195 anObj.SetParameters(Parameters)
6196 self._autoPublish(anObj, theName, "healed")
6199 ## Remove faces from the given object (shape).
6200 # @param theObject Shape to be processed.
6201 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6202 # removes ALL faces of the given object.
6203 # @param theName Object name; when specified, this parameter is used
6204 # for result publication in the study. Otherwise, if automatic
6205 # publication is switched on, default value is used for result name.
6207 # @return New GEOM.GEOM_Object, containing processed shape.
6209 # @ref tui_suppress_faces "Example"
6210 @ManageTransactions("HealOp")
6211 def SuppressFaces(self, theObject, theFaces, theName=None):
6213 Remove faces from the given object (shape).
6216 theObject Shape to be processed.
6217 theFaces Indices of faces to be removed, if EMPTY then the method
6218 removes ALL faces of the given object.
6219 theName Object name; when specified, this parameter is used
6220 for result publication in the study. Otherwise, if automatic
6221 publication is switched on, default value is used for result name.
6224 New GEOM.GEOM_Object, containing processed shape.
6226 # Example: see GEOM_TestHealing.py
6227 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6228 RaiseIfFailed("SuppressFaces", self.HealOp)
6229 self._autoPublish(anObj, theName, "suppressFaces")
6232 ## Sewing of some shapes into single shape.
6233 # @param ListShape Shapes to be processed.
6234 # @param theTolerance Required tolerance value.
6235 # @param AllowNonManifold Flag that allows non-manifold sewing.
6236 # @param theName Object name; when specified, this parameter is used
6237 # for result publication in the study. Otherwise, if automatic
6238 # publication is switched on, default value is used for result name.
6240 # @return New GEOM.GEOM_Object, containing processed shape.
6242 # @ref tui_sewing "Example"
6243 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6245 Sewing of some shapes into single shape.
6248 ListShape Shapes to be processed.
6249 theTolerance Required tolerance value.
6250 AllowNonManifold Flag that allows non-manifold sewing.
6251 theName Object name; when specified, this parameter is used
6252 for result publication in the study. Otherwise, if automatic
6253 publication is switched on, default value is used for result name.
6256 New GEOM.GEOM_Object, containing processed shape.
6258 # Example: see GEOM_TestHealing.py
6259 comp = self.MakeCompound(ListShape)
6260 # note: auto-publishing is done in self.Sew()
6261 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6264 ## Sewing of the given object.
6265 # @param theObject Shape to be processed.
6266 # @param theTolerance Required tolerance value.
6267 # @param AllowNonManifold Flag that allows non-manifold sewing.
6268 # @param theName Object name; when specified, this parameter is used
6269 # for result publication in the study. Otherwise, if automatic
6270 # publication is switched on, default value is used for result name.
6272 # @return New GEOM.GEOM_Object, containing processed shape.
6273 @ManageTransactions("HealOp")
6274 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6276 Sewing of the given object.
6279 theObject Shape to be processed.
6280 theTolerance Required tolerance value.
6281 AllowNonManifold Flag that allows non-manifold sewing.
6282 theName Object name; when specified, this parameter is used
6283 for result publication in the study. Otherwise, if automatic
6284 publication is switched on, default value is used for result name.
6287 New GEOM.GEOM_Object, containing processed shape.
6289 # Example: see MakeSewing() above
6290 theTolerance,Parameters = ParseParameters(theTolerance)
6291 if AllowNonManifold:
6292 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6294 anObj = self.HealOp.Sew(theObject, theTolerance)
6295 # To avoid script failure in case of good argument shape
6296 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6298 RaiseIfFailed("Sew", self.HealOp)
6299 anObj.SetParameters(Parameters)
6300 self._autoPublish(anObj, theName, "sewed")
6303 ## Rebuild the topology of theCompound of solids by removing
6304 # of the faces that are shared by several solids.
6305 # @param theCompound Shape to be processed.
6306 # @param theName Object name; when specified, this parameter is used
6307 # for result publication in the study. Otherwise, if automatic
6308 # publication is switched on, default value is used for result name.
6310 # @return New GEOM.GEOM_Object, containing processed shape.
6312 # @ref tui_remove_webs "Example"
6313 @ManageTransactions("HealOp")
6314 def RemoveInternalFaces (self, theCompound, theName=None):
6316 Rebuild the topology of theCompound of solids by removing
6317 of the faces that are shared by several solids.
6320 theCompound Shape to be processed.
6321 theName Object name; when specified, this parameter is used
6322 for result publication in the study. Otherwise, if automatic
6323 publication is switched on, default value is used for result name.
6326 New GEOM.GEOM_Object, containing processed shape.
6328 # Example: see GEOM_TestHealing.py
6329 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6330 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6331 self._autoPublish(anObj, theName, "removeWebs")
6334 ## Remove internal wires and edges from the given object (face).
6335 # @param theObject Shape to be processed.
6336 # @param theWires Indices of wires to be removed, if EMPTY then the method
6337 # removes ALL internal wires of the given object.
6338 # @param theName Object name; when specified, this parameter is used
6339 # for result publication in the study. Otherwise, if automatic
6340 # publication is switched on, default value is used for result name.
6342 # @return New GEOM.GEOM_Object, containing processed shape.
6344 # @ref tui_suppress_internal_wires "Example"
6345 @ManageTransactions("HealOp")
6346 def SuppressInternalWires(self, theObject, theWires, theName=None):
6348 Remove internal wires and edges from the given object (face).
6351 theObject Shape to be processed.
6352 theWires Indices of wires to be removed, if EMPTY then the method
6353 removes ALL internal wires of the given object.
6354 theName Object name; when specified, this parameter is used
6355 for result publication in the study. Otherwise, if automatic
6356 publication is switched on, default value is used for result name.
6359 New GEOM.GEOM_Object, containing processed shape.
6361 # Example: see GEOM_TestHealing.py
6362 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6363 RaiseIfFailed("RemoveIntWires", self.HealOp)
6364 self._autoPublish(anObj, theName, "suppressWires")
6367 ## Remove internal closed contours (holes) from the given object.
6368 # @param theObject Shape to be processed.
6369 # @param theWires Indices of wires to be removed, if EMPTY then the method
6370 # removes ALL internal holes of the given object
6371 # @param theName Object name; when specified, this parameter is used
6372 # for result publication in the study. Otherwise, if automatic
6373 # publication is switched on, default value is used for result name.
6375 # @return New GEOM.GEOM_Object, containing processed shape.
6377 # @ref tui_suppress_holes "Example"
6378 @ManageTransactions("HealOp")
6379 def SuppressHoles(self, theObject, theWires, theName=None):
6381 Remove internal closed contours (holes) from the given object.
6384 theObject Shape to be processed.
6385 theWires Indices of wires to be removed, if EMPTY then the method
6386 removes ALL internal holes of the given object
6387 theName Object name; when specified, this parameter is used
6388 for result publication in the study. Otherwise, if automatic
6389 publication is switched on, default value is used for result name.
6392 New GEOM.GEOM_Object, containing processed shape.
6394 # Example: see GEOM_TestHealing.py
6395 anObj = self.HealOp.FillHoles(theObject, theWires)
6396 RaiseIfFailed("FillHoles", self.HealOp)
6397 self._autoPublish(anObj, theName, "suppressHoles")
6400 ## Close an open wire.
6401 # @param theObject Shape to be processed.
6402 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6403 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6404 # @param isCommonVertex If True : closure by creation of a common vertex,
6405 # If False : closure by creation of an edge between ends.
6406 # @param theName Object name; when specified, this parameter is used
6407 # for result publication in the study. Otherwise, if automatic
6408 # publication is switched on, default value is used for result name.
6410 # @return New GEOM.GEOM_Object, containing processed shape.
6412 # @ref tui_close_contour "Example"
6413 @ManageTransactions("HealOp")
6414 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6419 theObject Shape to be processed.
6420 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6421 if [ ], then theObject itself is a wire.
6422 isCommonVertex If True : closure by creation of a common vertex,
6423 If False : closure by creation of an edge between ends.
6424 theName Object name; when specified, this parameter is used
6425 for result publication in the study. Otherwise, if automatic
6426 publication is switched on, default value is used for result name.
6429 New GEOM.GEOM_Object, containing processed shape.
6431 # Example: see GEOM_TestHealing.py
6432 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6433 RaiseIfFailed("CloseContour", self.HealOp)
6434 self._autoPublish(anObj, theName, "closeContour")
6437 ## Addition of a point to a given edge object.
6438 # @param theObject Shape to be processed.
6439 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6440 # if -1, then theObject itself is the edge.
6441 # @param theValue Value of parameter on edge or length parameter,
6442 # depending on \a isByParameter.
6443 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6444 # if FALSE : \a theValue is treated as a length parameter [0..1]
6445 # @param theName Object name; when specified, this parameter is used
6446 # for result publication in the study. Otherwise, if automatic
6447 # publication is switched on, default value is used for result name.
6449 # @return New GEOM.GEOM_Object, containing processed shape.
6451 # @ref tui_add_point_on_edge "Example"
6452 @ManageTransactions("HealOp")
6453 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6455 Addition of a point to a given edge object.
6458 theObject Shape to be processed.
6459 theEdgeIndex Index of edge to be divided within theObject's shape,
6460 if -1, then theObject itself is the edge.
6461 theValue Value of parameter on edge or length parameter,
6462 depending on isByParameter.
6463 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6464 if FALSE : theValue is treated as a length parameter [0..1]
6465 theName Object name; when specified, this parameter is used
6466 for result publication in the study. Otherwise, if automatic
6467 publication is switched on, default value is used for result name.
6470 New GEOM.GEOM_Object, containing processed shape.
6472 # Example: see GEOM_TestHealing.py
6473 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6474 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6475 RaiseIfFailed("DivideEdge", self.HealOp)
6476 anObj.SetParameters(Parameters)
6477 self._autoPublish(anObj, theName, "divideEdge")
6480 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6481 # @param theWire Wire to minimize the number of C1 continuous edges in.
6482 # @param theVertices A list of vertices to suppress. If the list
6483 # is empty, all vertices in a wire will be assumed.
6484 # @param theName Object name; when specified, this parameter is used
6485 # for result publication in the study. Otherwise, if automatic
6486 # publication is switched on, default value is used for result name.
6488 # @return New GEOM.GEOM_Object with modified wire.
6490 # @ref tui_fuse_collinear_edges "Example"
6491 @ManageTransactions("HealOp")
6492 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6494 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6497 theWire Wire to minimize the number of C1 continuous edges in.
6498 theVertices A list of vertices to suppress. If the list
6499 is empty, all vertices in a wire will be assumed.
6500 theName Object name; when specified, this parameter is used
6501 for result publication in the study. Otherwise, if automatic
6502 publication is switched on, default value is used for result name.
6505 New GEOM.GEOM_Object with modified wire.
6507 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6508 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6509 self._autoPublish(anObj, theName, "fuseEdges")
6512 ## Change orientation of the given object. Updates given shape.
6513 # @param theObject Shape to be processed.
6514 # @return Updated <var>theObject</var>
6516 # @ref swig_todo "Example"
6517 @ManageTransactions("HealOp")
6518 def ChangeOrientationShell(self,theObject):
6520 Change orientation of the given object. Updates given shape.
6523 theObject Shape to be processed.
6528 theObject = self.HealOp.ChangeOrientation(theObject)
6529 RaiseIfFailed("ChangeOrientation", self.HealOp)
6532 ## Change orientation of the given object.
6533 # @param theObject Shape to be processed.
6534 # @param theName Object name; when specified, this parameter is used
6535 # for result publication in the study. Otherwise, if automatic
6536 # publication is switched on, default value is used for result name.
6538 # @return New GEOM.GEOM_Object, containing processed shape.
6540 # @ref swig_todo "Example"
6541 @ManageTransactions("HealOp")
6542 def ChangeOrientationShellCopy(self, theObject, theName=None):
6544 Change orientation of the given object.
6547 theObject Shape to be processed.
6548 theName Object name; when specified, this parameter is used
6549 for result publication in the study. Otherwise, if automatic
6550 publication is switched on, default value is used for result name.
6553 New GEOM.GEOM_Object, containing processed shape.
6555 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6556 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6557 self._autoPublish(anObj, theName, "reversed")
6560 ## Try to limit tolerance of the given object by value \a theTolerance.
6561 # @param theObject Shape to be processed.
6562 # @param theTolerance Required tolerance value.
6563 # @param theName Object name; when specified, this parameter is used
6564 # for result publication in the study. Otherwise, if automatic
6565 # publication is switched on, default value is used for result name.
6567 # @return New GEOM.GEOM_Object, containing processed shape.
6569 # @ref tui_limit_tolerance "Example"
6570 @ManageTransactions("HealOp")
6571 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6573 Try to limit tolerance of the given object by value theTolerance.
6576 theObject Shape to be processed.
6577 theTolerance Required tolerance value.
6578 theName Object name; when specified, this parameter is used
6579 for result publication in the study. Otherwise, if automatic
6580 publication is switched on, default value is used for result name.
6583 New GEOM.GEOM_Object, containing processed shape.
6585 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6586 RaiseIfFailed("LimitTolerance", self.HealOp)
6587 self._autoPublish(anObj, theName, "limitTolerance")
6590 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6591 # that constitute a free boundary of the given shape.
6592 # @param theObject Shape to get free boundary of.
6593 # @param theName Object name; when specified, this parameter is used
6594 # for result publication in the study. Otherwise, if automatic
6595 # publication is switched on, default value is used for result name.
6597 # @return [\a status, \a theClosedWires, \a theOpenWires]
6598 # \n \a status: FALSE, if an error(s) occured during the method execution.
6599 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6600 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6602 # @ref tui_measurement_tools_page "Example"
6603 @ManageTransactions("HealOp")
6604 def GetFreeBoundary(self, theObject, theName=None):
6606 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6607 that constitute a free boundary of the given shape.
6610 theObject Shape to get free boundary of.
6611 theName Object name; when specified, this parameter is used
6612 for result publication in the study. Otherwise, if automatic
6613 publication is switched on, default value is used for result name.
6616 [status, theClosedWires, theOpenWires]
6617 status: FALSE, if an error(s) occured during the method execution.
6618 theClosedWires: Closed wires on the free boundary of the given shape.
6619 theOpenWires: Open wires on the free boundary of the given shape.
6621 # Example: see GEOM_TestHealing.py
6622 anObj = self.HealOp.GetFreeBoundary(theObject)
6623 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6624 self._autoPublish(anObj[1], theName, "closedWire")
6625 self._autoPublish(anObj[2], theName, "openWire")
6628 ## Replace coincident faces in theShape by one face.
6629 # @param theShape Initial shape.
6630 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6631 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6632 # otherwise all initial shapes.
6633 # @param theName Object name; when specified, this parameter is used
6634 # for result publication in the study. Otherwise, if automatic
6635 # publication is switched on, default value is used for result name.
6637 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6639 # @ref tui_glue_faces "Example"
6640 @ManageTransactions("ShapesOp")
6641 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6643 Replace coincident faces in theShape by one face.
6646 theShape Initial shape.
6647 theTolerance Maximum distance between faces, which can be considered as coincident.
6648 doKeepNonSolids If FALSE, only solids will present in the result,
6649 otherwise all initial shapes.
6650 theName Object name; when specified, this parameter is used
6651 for result publication in the study. Otherwise, if automatic
6652 publication is switched on, default value is used for result name.
6655 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6657 # Example: see GEOM_Spanner.py
6658 theTolerance,Parameters = ParseParameters(theTolerance)
6659 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6661 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6662 anObj.SetParameters(Parameters)
6663 self._autoPublish(anObj, theName, "glueFaces")
6666 ## Find coincident faces in theShape for possible gluing.
6667 # @param theShape Initial shape.
6668 # @param theTolerance Maximum distance between faces,
6669 # which can be considered as coincident.
6670 # @param theName Object name; when specified, this parameter is used
6671 # for result publication in the study. Otherwise, if automatic
6672 # publication is switched on, default value is used for result name.
6674 # @return GEOM.ListOfGO
6676 # @ref tui_glue_faces "Example"
6677 @ManageTransactions("ShapesOp")
6678 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6680 Find coincident faces in theShape for possible gluing.
6683 theShape Initial shape.
6684 theTolerance Maximum distance between faces,
6685 which can be considered as coincident.
6686 theName Object name; when specified, this parameter is used
6687 for result publication in the study. Otherwise, if automatic
6688 publication is switched on, default value is used for result name.
6693 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6694 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6695 self._autoPublish(anObj, theName, "facesToGlue")
6698 ## Replace coincident faces in theShape by one face
6699 # in compliance with given list of faces
6700 # @param theShape Initial shape.
6701 # @param theTolerance Maximum distance between faces,
6702 # which can be considered as coincident.
6703 # @param theFaces List of faces for gluing.
6704 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6705 # otherwise all initial shapes.
6706 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6707 # will be glued, otherwise only the edges,
6708 # belonging to <VAR>theFaces</VAR>.
6709 # @param theName Object name; when specified, this parameter is used
6710 # for result publication in the study. Otherwise, if automatic
6711 # publication is switched on, default value is used for result name.
6713 # @return New GEOM.GEOM_Object, containing a copy of theShape
6714 # without some faces.
6716 # @ref tui_glue_faces "Example"
6717 @ManageTransactions("ShapesOp")
6718 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6719 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6721 Replace coincident faces in theShape by one face
6722 in compliance with given list of faces
6725 theShape Initial shape.
6726 theTolerance Maximum distance between faces,
6727 which can be considered as coincident.
6728 theFaces List of faces for gluing.
6729 doKeepNonSolids If FALSE, only solids will present in the result,
6730 otherwise all initial shapes.
6731 doGlueAllEdges If TRUE, all coincident edges of theShape
6732 will be glued, otherwise only the edges,
6733 belonging to theFaces.
6734 theName Object name; when specified, this parameter is used
6735 for result publication in the study. Otherwise, if automatic
6736 publication is switched on, default value is used for result name.
6739 New GEOM.GEOM_Object, containing a copy of theShape
6742 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6743 doKeepNonSolids, doGlueAllEdges)
6745 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6746 self._autoPublish(anObj, theName, "glueFaces")
6749 ## Replace coincident edges in theShape by one edge.
6750 # @param theShape Initial shape.
6751 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6752 # @param theName Object name; when specified, this parameter is used
6753 # for result publication in the study. Otherwise, if automatic
6754 # publication is switched on, default value is used for result name.
6756 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6758 # @ref tui_glue_edges "Example"
6759 @ManageTransactions("ShapesOp")
6760 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6762 Replace coincident edges in theShape by one edge.
6765 theShape Initial shape.
6766 theTolerance Maximum distance between edges, which can be considered as coincident.
6767 theName Object name; when specified, this parameter is used
6768 for result publication in the study. Otherwise, if automatic
6769 publication is switched on, default value is used for result name.
6772 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6774 theTolerance,Parameters = ParseParameters(theTolerance)
6775 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6777 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6778 anObj.SetParameters(Parameters)
6779 self._autoPublish(anObj, theName, "glueEdges")
6782 ## Find coincident edges in theShape for possible gluing.
6783 # @param theShape Initial shape.
6784 # @param theTolerance Maximum distance between edges,
6785 # which can be considered as coincident.
6786 # @param theName Object name; when specified, this parameter is used
6787 # for result publication in the study. Otherwise, if automatic
6788 # publication is switched on, default value is used for result name.
6790 # @return GEOM.ListOfGO
6792 # @ref tui_glue_edges "Example"
6793 @ManageTransactions("ShapesOp")
6794 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6796 Find coincident edges in theShape for possible gluing.
6799 theShape Initial shape.
6800 theTolerance Maximum distance between edges,
6801 which can be considered as coincident.
6802 theName Object name; when specified, this parameter is used
6803 for result publication in the study. Otherwise, if automatic
6804 publication is switched on, default value is used for result name.
6809 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6810 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6811 self._autoPublish(anObj, theName, "edgesToGlue")
6814 ## Replace coincident edges in theShape by one edge
6815 # in compliance with given list of edges.
6816 # @param theShape Initial shape.
6817 # @param theTolerance Maximum distance between edges,
6818 # which can be considered as coincident.
6819 # @param theEdges List of edges for gluing.
6820 # @param theName Object name; when specified, this parameter is used
6821 # for result publication in the study. Otherwise, if automatic
6822 # publication is switched on, default value is used for result name.
6824 # @return New GEOM.GEOM_Object, containing a copy of theShape
6825 # without some edges.
6827 # @ref tui_glue_edges "Example"
6828 @ManageTransactions("ShapesOp")
6829 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6831 Replace coincident edges in theShape by one edge
6832 in compliance with given list of edges.
6835 theShape Initial shape.
6836 theTolerance Maximum distance between edges,
6837 which can be considered as coincident.
6838 theEdges List of edges for gluing.
6839 theName Object name; when specified, this parameter is used
6840 for result publication in the study. Otherwise, if automatic
6841 publication is switched on, default value is used for result name.
6844 New GEOM.GEOM_Object, containing a copy of theShape
6847 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6849 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6850 self._autoPublish(anObj, theName, "glueEdges")
6856 ## @addtogroup l3_boolean Boolean Operations
6859 # -----------------------------------------------------------------------------
6860 # Boolean (Common, Cut, Fuse, Section)
6861 # -----------------------------------------------------------------------------
6863 ## Perform one of boolean operations on two given shapes.
6864 # @param theShape1 First argument for boolean operation.
6865 # @param theShape2 Second argument for boolean operation.
6866 # @param theOperation Indicates the operation to be done:\n
6867 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6868 # @param checkSelfInte The flag that tells if the arguments should
6869 # be checked for self-intersection prior to the operation.
6870 # @param theName Object name; when specified, this parameter is used
6871 # for result publication in the study. Otherwise, if automatic
6872 # publication is switched on, default value is used for result name.
6874 # @note This algorithm doesn't find all types of self-intersections.
6875 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6876 # vertex/face and edge/face intersections. Face/face
6877 # intersections detection is switched off as it is a
6878 # time-consuming operation that gives an impact on performance.
6879 # To find all self-intersections please use
6880 # CheckSelfIntersections() method.
6882 # @return New GEOM.GEOM_Object, containing the result shape.
6884 # @ref tui_fuse "Example"
6885 @ManageTransactions("BoolOp")
6886 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6888 Perform one of boolean operations on two given shapes.
6891 theShape1 First argument for boolean operation.
6892 theShape2 Second argument for boolean operation.
6893 theOperation Indicates the operation to be done:
6894 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6895 checkSelfInte The flag that tells if the arguments should
6896 be checked for self-intersection prior to
6898 theName Object name; when specified, this parameter is used
6899 for result publication in the study. Otherwise, if automatic
6900 publication is switched on, default value is used for result name.
6903 This algorithm doesn't find all types of self-intersections.
6904 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6905 vertex/face and edge/face intersections. Face/face
6906 intersections detection is switched off as it is a
6907 time-consuming operation that gives an impact on performance.
6908 To find all self-intersections please use
6909 CheckSelfIntersections() method.
6912 New GEOM.GEOM_Object, containing the result shape.
6914 # Example: see GEOM_TestAll.py
6915 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6916 RaiseIfFailed("MakeBoolean", self.BoolOp)
6917 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6918 self._autoPublish(anObj, theName, def_names[theOperation])
6921 ## Perform Common boolean operation on two given shapes.
6922 # @param theShape1 First argument for boolean operation.
6923 # @param theShape2 Second argument for boolean operation.
6924 # @param checkSelfInte The flag that tells if the arguments should
6925 # be checked for self-intersection prior to the operation.
6926 # @param theName Object name; when specified, this parameter is used
6927 # for result publication in the study. Otherwise, if automatic
6928 # publication is switched on, default value is used for result name.
6930 # @note This algorithm doesn't find all types of self-intersections.
6931 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6932 # vertex/face and edge/face intersections. Face/face
6933 # intersections detection is switched off as it is a
6934 # time-consuming operation that gives an impact on performance.
6935 # To find all self-intersections please use
6936 # CheckSelfIntersections() method.
6938 # @return New GEOM.GEOM_Object, containing the result shape.
6940 # @ref tui_common "Example 1"
6941 # \n @ref swig_MakeCommon "Example 2"
6942 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6944 Perform Common boolean operation on two given shapes.
6947 theShape1 First argument for boolean operation.
6948 theShape2 Second argument for boolean operation.
6949 checkSelfInte The flag that tells if the arguments should
6950 be checked for self-intersection prior to
6952 theName Object name; when specified, this parameter is used
6953 for result publication in the study. Otherwise, if automatic
6954 publication is switched on, default value is used for result name.
6957 This algorithm doesn't find all types of self-intersections.
6958 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6959 vertex/face and edge/face intersections. Face/face
6960 intersections detection is switched off as it is a
6961 time-consuming operation that gives an impact on performance.
6962 To find all self-intersections please use
6963 CheckSelfIntersections() method.
6966 New GEOM.GEOM_Object, containing the result shape.
6968 # Example: see GEOM_TestOthers.py
6969 # note: auto-publishing is done in self.MakeBoolean()
6970 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
6972 ## Perform Cut boolean operation on two given shapes.
6973 # @param theShape1 First argument for boolean operation.
6974 # @param theShape2 Second argument for boolean operation.
6975 # @param checkSelfInte The flag that tells if the arguments should
6976 # be checked for self-intersection prior to the operation.
6977 # @param theName Object name; when specified, this parameter is used
6978 # for result publication in the study. Otherwise, if automatic
6979 # publication is switched on, default value is used for result name.
6981 # @note This algorithm doesn't find all types of self-intersections.
6982 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6983 # vertex/face and edge/face intersections. Face/face
6984 # intersections detection is switched off as it is a
6985 # time-consuming operation that gives an impact on performance.
6986 # To find all self-intersections please use
6987 # CheckSelfIntersections() method.
6989 # @return New GEOM.GEOM_Object, containing the result shape.
6991 # @ref tui_cut "Example 1"
6992 # \n @ref swig_MakeCommon "Example 2"
6993 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6995 Perform Cut boolean operation on two given shapes.
6998 theShape1 First argument for boolean operation.
6999 theShape2 Second argument for boolean operation.
7000 checkSelfInte The flag that tells if the arguments should
7001 be checked for self-intersection prior to
7003 theName Object name; when specified, this parameter is used
7004 for result publication in the study. Otherwise, if automatic
7005 publication is switched on, default value is used for result name.
7008 This algorithm doesn't find all types of self-intersections.
7009 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7010 vertex/face and edge/face intersections. Face/face
7011 intersections detection is switched off as it is a
7012 time-consuming operation that gives an impact on performance.
7013 To find all self-intersections please use
7014 CheckSelfIntersections() method.
7017 New GEOM.GEOM_Object, containing the result shape.
7020 # Example: see GEOM_TestOthers.py
7021 # note: auto-publishing is done in self.MakeBoolean()
7022 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7024 ## Perform Fuse boolean operation on two given shapes.
7025 # @param theShape1 First argument for boolean operation.
7026 # @param theShape2 Second argument for boolean operation.
7027 # @param checkSelfInte The flag that tells if the arguments should
7028 # be checked for self-intersection prior to the operation.
7029 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7030 # operation should be performed during the operation.
7031 # @param theName Object name; when specified, this parameter is used
7032 # for result publication in the study. Otherwise, if automatic
7033 # publication is switched on, default value is used for result name.
7035 # @note This algorithm doesn't find all types of self-intersections.
7036 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7037 # vertex/face and edge/face intersections. Face/face
7038 # intersections detection is switched off as it is a
7039 # time-consuming operation that gives an impact on performance.
7040 # To find all self-intersections please use
7041 # CheckSelfIntersections() method.
7043 # @return New GEOM.GEOM_Object, containing the result shape.
7045 # @ref tui_fuse "Example 1"
7046 # \n @ref swig_MakeCommon "Example 2"
7047 @ManageTransactions("BoolOp")
7048 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7049 rmExtraEdges=False, theName=None):
7051 Perform Fuse boolean operation on two given shapes.
7054 theShape1 First argument for boolean operation.
7055 theShape2 Second argument for boolean operation.
7056 checkSelfInte The flag that tells if the arguments should
7057 be checked for self-intersection prior to
7059 rmExtraEdges The flag that tells if Remove Extra Edges
7060 operation should be performed during the operation.
7061 theName Object name; when specified, this parameter is used
7062 for result publication in the study. Otherwise, if automatic
7063 publication is switched on, default value is used for result name.
7066 This algorithm doesn't find all types of self-intersections.
7067 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7068 vertex/face and edge/face intersections. Face/face
7069 intersections detection is switched off as it is a
7070 time-consuming operation that gives an impact on performance.
7071 To find all self-intersections please use
7072 CheckSelfIntersections() method.
7075 New GEOM.GEOM_Object, containing the result shape.
7078 # Example: see GEOM_TestOthers.py
7079 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7080 checkSelfInte, rmExtraEdges)
7081 RaiseIfFailed("MakeFuse", self.BoolOp)
7082 self._autoPublish(anObj, theName, "fuse")
7085 ## Perform Section boolean operation on two given shapes.
7086 # @param theShape1 First argument for boolean operation.
7087 # @param theShape2 Second argument for boolean operation.
7088 # @param checkSelfInte The flag that tells if the arguments should
7089 # be checked for self-intersection prior to the operation.
7090 # @param theName Object name; when specified, this parameter is used
7091 # for result publication in the study. Otherwise, if automatic
7092 # publication is switched on, default value is used for result name.
7094 # @note This algorithm doesn't find all types of self-intersections.
7095 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7096 # vertex/face and edge/face intersections. Face/face
7097 # intersections detection is switched off as it is a
7098 # time-consuming operation that gives an impact on performance.
7099 # To find all self-intersections please use
7100 # CheckSelfIntersections() method.
7102 # @return New GEOM.GEOM_Object, containing the result shape.
7104 # @ref tui_section "Example 1"
7105 # \n @ref swig_MakeCommon "Example 2"
7106 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7108 Perform Section boolean operation on two given shapes.
7111 theShape1 First argument for boolean operation.
7112 theShape2 Second argument for boolean operation.
7113 checkSelfInte The flag that tells if the arguments should
7114 be checked for self-intersection prior to
7116 theName Object name; when specified, this parameter is used
7117 for result publication in the study. Otherwise, if automatic
7118 publication is switched on, default value is used for result name.
7121 This algorithm doesn't find all types of self-intersections.
7122 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7123 vertex/face and edge/face intersections. Face/face
7124 intersections detection is switched off as it is a
7125 time-consuming operation that gives an impact on performance.
7126 To find all self-intersections please use
7127 CheckSelfIntersections() method.
7130 New GEOM.GEOM_Object, containing the result shape.
7133 # Example: see GEOM_TestOthers.py
7134 # note: auto-publishing is done in self.MakeBoolean()
7135 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7137 ## Perform Fuse boolean operation on the list of shapes.
7138 # @param theShapesList Shapes to be fused.
7139 # @param checkSelfInte The flag that tells if the arguments should
7140 # be checked for self-intersection prior to the operation.
7141 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7142 # operation should be performed during the operation.
7143 # @param theName Object name; when specified, this parameter is used
7144 # for result publication in the study. Otherwise, if automatic
7145 # publication is switched on, default value is used for result name.
7147 # @note This algorithm doesn't find all types of self-intersections.
7148 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7149 # vertex/face and edge/face intersections. Face/face
7150 # intersections detection is switched off as it is a
7151 # time-consuming operation that gives an impact on performance.
7152 # To find all self-intersections please use
7153 # CheckSelfIntersections() method.
7155 # @return New GEOM.GEOM_Object, containing the result shape.
7157 # @ref tui_fuse "Example 1"
7158 # \n @ref swig_MakeCommon "Example 2"
7159 @ManageTransactions("BoolOp")
7160 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7161 rmExtraEdges=False, theName=None):
7163 Perform Fuse boolean operation on the list of shapes.
7166 theShapesList Shapes to be fused.
7167 checkSelfInte The flag that tells if the arguments should
7168 be checked for self-intersection prior to
7170 rmExtraEdges The flag that tells if Remove Extra Edges
7171 operation should be performed during the operation.
7172 theName Object name; when specified, this parameter is used
7173 for result publication in the study. Otherwise, if automatic
7174 publication is switched on, default value is used for result name.
7177 This algorithm doesn't find all types of self-intersections.
7178 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7179 vertex/face and edge/face intersections. Face/face
7180 intersections detection is switched off as it is a
7181 time-consuming operation that gives an impact on performance.
7182 To find all self-intersections please use
7183 CheckSelfIntersections() method.
7186 New GEOM.GEOM_Object, containing the result shape.
7189 # Example: see GEOM_TestOthers.py
7190 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7192 RaiseIfFailed("MakeFuseList", self.BoolOp)
7193 self._autoPublish(anObj, theName, "fuse")
7196 ## Perform Common boolean operation on the list of shapes.
7197 # @param theShapesList Shapes for Common operation.
7198 # @param checkSelfInte The flag that tells if the arguments should
7199 # be checked for self-intersection prior to the operation.
7200 # @param theName Object name; when specified, this parameter is used
7201 # for result publication in the study. Otherwise, if automatic
7202 # publication is switched on, default value is used for result name.
7204 # @note This algorithm doesn't find all types of self-intersections.
7205 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7206 # vertex/face and edge/face intersections. Face/face
7207 # intersections detection is switched off as it is a
7208 # time-consuming operation that gives an impact on performance.
7209 # To find all self-intersections please use
7210 # CheckSelfIntersections() method.
7212 # @return New GEOM.GEOM_Object, containing the result shape.
7214 # @ref tui_common "Example 1"
7215 # \n @ref swig_MakeCommon "Example 2"
7216 @ManageTransactions("BoolOp")
7217 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7219 Perform Common boolean operation on the list of shapes.
7222 theShapesList Shapes for Common operation.
7223 checkSelfInte The flag that tells if the arguments should
7224 be checked for self-intersection prior to
7226 theName Object name; when specified, this parameter is used
7227 for result publication in the study. Otherwise, if automatic
7228 publication is switched on, default value is used for result name.
7231 This algorithm doesn't find all types of self-intersections.
7232 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7233 vertex/face and edge/face intersections. Face/face
7234 intersections detection is switched off as it is a
7235 time-consuming operation that gives an impact on performance.
7236 To find all self-intersections please use
7237 CheckSelfIntersections() method.
7240 New GEOM.GEOM_Object, containing the result shape.
7243 # Example: see GEOM_TestOthers.py
7244 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7245 RaiseIfFailed("MakeCommonList", self.BoolOp)
7246 self._autoPublish(anObj, theName, "common")
7249 ## Perform Cut boolean operation on one object and the list of tools.
7250 # @param theMainShape The object of the operation.
7251 # @param theShapesList The list of tools of the operation.
7252 # @param checkSelfInte The flag that tells if the arguments should
7253 # be checked for self-intersection prior to the operation.
7254 # @param theName Object name; when specified, this parameter is used
7255 # for result publication in the study. Otherwise, if automatic
7256 # publication is switched on, default value is used for result name.
7258 # @note This algorithm doesn't find all types of self-intersections.
7259 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7260 # vertex/face and edge/face intersections. Face/face
7261 # intersections detection is switched off as it is a
7262 # time-consuming operation that gives an impact on performance.
7263 # To find all self-intersections please use
7264 # CheckSelfIntersections() method.
7266 # @return New GEOM.GEOM_Object, containing the result shape.
7268 # @ref tui_cut "Example 1"
7269 # \n @ref swig_MakeCommon "Example 2"
7270 @ManageTransactions("BoolOp")
7271 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7273 Perform Cut boolean operation on one object and the list of tools.
7276 theMainShape The object of the operation.
7277 theShapesList The list of tools of the operation.
7278 checkSelfInte The flag that tells if the arguments should
7279 be checked for self-intersection prior to
7281 theName Object name; when specified, this parameter is used
7282 for result publication in the study. Otherwise, if automatic
7283 publication is switched on, default value is used for result name.
7286 This algorithm doesn't find all types of self-intersections.
7287 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7288 vertex/face and edge/face intersections. Face/face
7289 intersections detection is switched off as it is a
7290 time-consuming operation that gives an impact on performance.
7291 To find all self-intersections please use
7292 CheckSelfIntersections() method.
7295 New GEOM.GEOM_Object, containing the result shape.
7298 # Example: see GEOM_TestOthers.py
7299 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7300 RaiseIfFailed("MakeCutList", self.BoolOp)
7301 self._autoPublish(anObj, theName, "cut")
7307 ## @addtogroup l3_basic_op
7310 ## Perform partition operation.
7311 # @param ListShapes Shapes to be intersected.
7312 # @param ListTools Shapes to intersect theShapes.
7313 # @param Limit Type of resulting shapes (see ShapeType()).\n
7314 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7315 # type will be detected automatically.
7316 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7317 # target type (equal to Limit) are kept in the result,
7318 # else standalone shapes of lower dimension
7319 # are kept also (if they exist).
7321 # @param theName Object name; when specified, this parameter is used
7322 # for result publication in the study. Otherwise, if automatic
7323 # publication is switched on, default value is used for result name.
7325 # @note Each compound from ListShapes and ListTools will be exploded
7326 # in order to avoid possible intersection between shapes from this compound.
7328 # After implementation new version of PartitionAlgo (October 2006)
7329 # other parameters are ignored by current functionality. They are kept
7330 # in this function only for support old versions.
7331 # @param ListKeepInside Shapes, outside which the results will be deleted.
7332 # Each shape from theKeepInside must belong to theShapes also.
7333 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7334 # Each shape from theRemoveInside must belong to theShapes also.
7335 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7336 # @param ListMaterials Material indices for each shape. Make sence,
7337 # only if theRemoveWebs is TRUE.
7339 # @return New GEOM.GEOM_Object, containing the result shapes.
7341 # @ref tui_partition "Example"
7342 @ManageTransactions("BoolOp")
7343 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7344 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7345 KeepNonlimitShapes=0, theName=None):
7347 Perform partition operation.
7350 ListShapes Shapes to be intersected.
7351 ListTools Shapes to intersect theShapes.
7352 Limit Type of resulting shapes (see geompy.ShapeType)
7353 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7354 type will be detected automatically.
7355 KeepNonlimitShapes if this parameter == 0, then only shapes of
7356 target type (equal to Limit) are kept in the result,
7357 else standalone shapes of lower dimension
7358 are kept also (if they exist).
7360 theName Object name; when specified, this parameter is used
7361 for result publication in the study. Otherwise, if automatic
7362 publication is switched on, default value is used for result name.
7364 Each compound from ListShapes and ListTools will be exploded
7365 in order to avoid possible intersection between shapes from
7368 After implementation new version of PartitionAlgo (October 2006) other
7369 parameters are ignored by current functionality. They are kept in this
7370 function only for support old versions.
7373 ListKeepInside Shapes, outside which the results will be deleted.
7374 Each shape from theKeepInside must belong to theShapes also.
7375 ListRemoveInside Shapes, inside which the results will be deleted.
7376 Each shape from theRemoveInside must belong to theShapes also.
7377 RemoveWebs If TRUE, perform Glue 3D algorithm.
7378 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7381 New GEOM.GEOM_Object, containing the result shapes.
7383 # Example: see GEOM_TestAll.py
7384 if Limit == self.ShapeType["AUTO"]:
7385 # automatic detection of the most appropriate shape limit type
7387 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7388 Limit = EnumToLong(lim)
7390 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7391 ListKeepInside, ListRemoveInside,
7392 Limit, RemoveWebs, ListMaterials,
7393 KeepNonlimitShapes);
7394 RaiseIfFailed("MakePartition", self.BoolOp)
7395 self._autoPublish(anObj, theName, "partition")
7398 ## Perform partition operation.
7399 # This method may be useful if it is needed to make a partition for
7400 # compound contains nonintersected shapes. Performance will be better
7401 # since intersection between shapes from compound is not performed.
7403 # Description of all parameters as in previous method MakePartition().
7404 # One additional parameter is provided:
7405 # @param checkSelfInte The flag that tells if the arguments should
7406 # be checked for self-intersection prior to the operation.
7408 # @note This algorithm doesn't find all types of self-intersections.
7409 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7410 # vertex/face and edge/face intersections. Face/face
7411 # intersections detection is switched off as it is a
7412 # time-consuming operation that gives an impact on performance.
7413 # To find all self-intersections please use
7414 # CheckSelfIntersections() method.
7416 # @note Passed compounds (via ListShapes or via ListTools)
7417 # have to consist of nonintersecting shapes.
7419 # @return New GEOM.GEOM_Object, containing the result shapes.
7421 # @ref swig_todo "Example"
7422 @ManageTransactions("BoolOp")
7423 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7424 ListKeepInside=[], ListRemoveInside=[],
7425 Limit=ShapeType["AUTO"], RemoveWebs=0,
7426 ListMaterials=[], KeepNonlimitShapes=0,
7427 checkSelfInte=False, theName=None):
7429 Perform partition operation.
7430 This method may be useful if it is needed to make a partition for
7431 compound contains nonintersected shapes. Performance will be better
7432 since intersection between shapes from compound is not performed.
7435 Description of all parameters as in method geompy.MakePartition.
7436 One additional parameter is provided:
7437 checkSelfInte The flag that tells if the arguments should
7438 be checked for self-intersection prior to
7442 This algorithm doesn't find all types of self-intersections.
7443 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7444 vertex/face and edge/face intersections. Face/face
7445 intersections detection is switched off as it is a
7446 time-consuming operation that gives an impact on performance.
7447 To find all self-intersections please use
7448 CheckSelfIntersections() method.
7451 Passed compounds (via ListShapes or via ListTools)
7452 have to consist of nonintersecting shapes.
7455 New GEOM.GEOM_Object, containing the result shapes.
7457 if Limit == self.ShapeType["AUTO"]:
7458 # automatic detection of the most appropriate shape limit type
7460 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7461 Limit = EnumToLong(lim)
7463 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7464 ListKeepInside, ListRemoveInside,
7465 Limit, RemoveWebs, ListMaterials,
7466 KeepNonlimitShapes, checkSelfInte);
7467 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7468 self._autoPublish(anObj, theName, "partition")
7471 ## See method MakePartition() for more information.
7473 # @ref tui_partition "Example 1"
7474 # \n @ref swig_Partition "Example 2"
7475 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7476 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7477 KeepNonlimitShapes=0, theName=None):
7479 See method geompy.MakePartition for more information.
7481 # Example: see GEOM_TestOthers.py
7482 # note: auto-publishing is done in self.MakePartition()
7483 anObj = self.MakePartition(ListShapes, ListTools,
7484 ListKeepInside, ListRemoveInside,
7485 Limit, RemoveWebs, ListMaterials,
7486 KeepNonlimitShapes, theName);
7489 ## Perform partition of the Shape with the Plane
7490 # @param theShape Shape to be intersected.
7491 # @param thePlane Tool shape, to intersect theShape.
7492 # @param theName Object name; when specified, this parameter is used
7493 # for result publication in the study. Otherwise, if automatic
7494 # publication is switched on, default value is used for result name.
7496 # @return New GEOM.GEOM_Object, containing the result shape.
7498 # @ref tui_partition "Example"
7499 @ManageTransactions("BoolOp")
7500 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7502 Perform partition of the Shape with the Plane
7505 theShape Shape to be intersected.
7506 thePlane Tool shape, to intersect theShape.
7507 theName Object name; when specified, this parameter is used
7508 for result publication in the study. Otherwise, if automatic
7509 publication is switched on, default value is used for result name.
7512 New GEOM.GEOM_Object, containing the result shape.
7514 # Example: see GEOM_TestAll.py
7515 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7516 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7517 self._autoPublish(anObj, theName, "partition")
7520 # end of l3_basic_op
7523 ## @addtogroup l3_transform
7526 ## Translate the given object along the vector, specified
7527 # by its end points.
7528 # @param theObject The object to be translated.
7529 # @param thePoint1 Start point of translation vector.
7530 # @param thePoint2 End point of translation vector.
7531 # @param theCopy Flag used to translate object itself or create a copy.
7532 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7533 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7534 @ManageTransactions("TrsfOp")
7535 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7537 Translate the given object along the vector, specified by its end points.
7540 theObject The object to be translated.
7541 thePoint1 Start point of translation vector.
7542 thePoint2 End point of translation vector.
7543 theCopy Flag used to translate object itself or create a copy.
7546 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7547 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7550 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7552 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7553 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7556 ## Translate the given object along the vector, specified
7557 # by its end points, creating its copy before the translation.
7558 # @param theObject The object to be translated.
7559 # @param thePoint1 Start point of translation vector.
7560 # @param thePoint2 End point of translation vector.
7561 # @param theName Object name; when specified, this parameter is used
7562 # for result publication in the study. Otherwise, if automatic
7563 # publication is switched on, default value is used for result name.
7565 # @return New GEOM.GEOM_Object, containing the translated object.
7567 # @ref tui_translation "Example 1"
7568 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7569 @ManageTransactions("TrsfOp")
7570 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7572 Translate the given object along the vector, specified
7573 by its end points, creating its copy before the translation.
7576 theObject The object to be translated.
7577 thePoint1 Start point of translation vector.
7578 thePoint2 End point of translation vector.
7579 theName Object name; when specified, this parameter is used
7580 for result publication in the study. Otherwise, if automatic
7581 publication is switched on, default value is used for result name.
7584 New GEOM.GEOM_Object, containing the translated object.
7586 # Example: see GEOM_TestAll.py
7587 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7588 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7589 self._autoPublish(anObj, theName, "translated")
7592 ## Translate the given object along the vector, specified by its components.
7593 # @param theObject The object to be translated.
7594 # @param theDX,theDY,theDZ Components of translation vector.
7595 # @param theCopy Flag used to translate object itself or create a copy.
7596 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7597 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7599 # @ref tui_translation "Example"
7600 @ManageTransactions("TrsfOp")
7601 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7603 Translate the given object along the vector, specified by its components.
7606 theObject The object to be translated.
7607 theDX,theDY,theDZ Components of translation vector.
7608 theCopy Flag used to translate object itself or create a copy.
7611 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7612 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7614 # Example: see GEOM_TestAll.py
7615 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7617 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7619 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7620 anObj.SetParameters(Parameters)
7621 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7624 ## Translate the given object along the vector, specified
7625 # by its components, creating its copy before the translation.
7626 # @param theObject The object to be translated.
7627 # @param theDX,theDY,theDZ Components of translation vector.
7628 # @param theName Object name; when specified, this parameter is used
7629 # for result publication in the study. Otherwise, if automatic
7630 # publication is switched on, default value is used for result name.
7632 # @return New GEOM.GEOM_Object, containing the translated object.
7634 # @ref tui_translation "Example"
7635 @ManageTransactions("TrsfOp")
7636 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7638 Translate the given object along the vector, specified
7639 by its components, creating its copy before the translation.
7642 theObject The object to be translated.
7643 theDX,theDY,theDZ Components of translation vector.
7644 theName Object name; when specified, this parameter is used
7645 for result publication in the study. Otherwise, if automatic
7646 publication is switched on, default value is used for result name.
7649 New GEOM.GEOM_Object, containing the translated object.
7651 # Example: see GEOM_TestAll.py
7652 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7653 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7654 anObj.SetParameters(Parameters)
7655 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7656 self._autoPublish(anObj, theName, "translated")
7659 ## Translate the given object along the given vector.
7660 # @param theObject The object to be translated.
7661 # @param theVector The translation vector.
7662 # @param theCopy Flag used to translate object itself or create a copy.
7663 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7664 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7665 @ManageTransactions("TrsfOp")
7666 def TranslateVector(self, theObject, theVector, theCopy=False):
7668 Translate the given object along the given vector.
7671 theObject The object to be translated.
7672 theVector The translation vector.
7673 theCopy Flag used to translate object itself or create a copy.
7676 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7677 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7680 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7682 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7683 RaiseIfFailed("TranslateVector", self.TrsfOp)
7686 ## Translate the given object along the given vector,
7687 # creating its copy before the translation.
7688 # @param theObject The object to be translated.
7689 # @param theVector The translation vector.
7690 # @param theName Object name; when specified, this parameter is used
7691 # for result publication in the study. Otherwise, if automatic
7692 # publication is switched on, default value is used for result name.
7694 # @return New GEOM.GEOM_Object, containing the translated object.
7696 # @ref tui_translation "Example"
7697 @ManageTransactions("TrsfOp")
7698 def MakeTranslationVector(self, theObject, theVector, theName=None):
7700 Translate the given object along the given vector,
7701 creating its copy before the translation.
7704 theObject The object to be translated.
7705 theVector The translation vector.
7706 theName Object name; when specified, this parameter is used
7707 for result publication in the study. Otherwise, if automatic
7708 publication is switched on, default value is used for result name.
7711 New GEOM.GEOM_Object, containing the translated object.
7713 # Example: see GEOM_TestAll.py
7714 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7715 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7716 self._autoPublish(anObj, theName, "translated")
7719 ## Translate the given object along the given vector on given distance.
7720 # @param theObject The object to be translated.
7721 # @param theVector The translation vector.
7722 # @param theDistance The translation distance.
7723 # @param theCopy Flag used to translate object itself or create a copy.
7724 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7725 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7727 # @ref tui_translation "Example"
7728 @ManageTransactions("TrsfOp")
7729 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7731 Translate the given object along the given vector on given distance.
7734 theObject The object to be translated.
7735 theVector The translation vector.
7736 theDistance The translation distance.
7737 theCopy Flag used to translate object itself or create a copy.
7740 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7741 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7743 # Example: see GEOM_TestAll.py
7744 theDistance,Parameters = ParseParameters(theDistance)
7745 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7746 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7747 anObj.SetParameters(Parameters)
7750 ## Translate the given object along the given vector on given distance,
7751 # creating its copy before the translation.
7752 # @param theObject The object to be translated.
7753 # @param theVector The translation vector.
7754 # @param theDistance The translation distance.
7755 # @param theName Object name; when specified, this parameter is used
7756 # for result publication in the study. Otherwise, if automatic
7757 # publication is switched on, default value is used for result name.
7759 # @return New GEOM.GEOM_Object, containing the translated object.
7761 # @ref tui_translation "Example"
7762 @ManageTransactions("TrsfOp")
7763 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7765 Translate the given object along the given vector on given distance,
7766 creating its copy before the translation.
7769 theObject The object to be translated.
7770 theVector The translation vector.
7771 theDistance The translation distance.
7772 theName Object name; when specified, this parameter is used
7773 for result publication in the study. Otherwise, if automatic
7774 publication is switched on, default value is used for result name.
7777 New GEOM.GEOM_Object, containing the translated object.
7779 # Example: see GEOM_TestAll.py
7780 theDistance,Parameters = ParseParameters(theDistance)
7781 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7782 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7783 anObj.SetParameters(Parameters)
7784 self._autoPublish(anObj, theName, "translated")
7787 ## Rotate the given object around the given axis on the given angle.
7788 # @param theObject The object to be rotated.
7789 # @param theAxis Rotation axis.
7790 # @param theAngle Rotation angle in radians.
7791 # @param theCopy Flag used to rotate object itself or create a copy.
7793 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7794 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7796 # @ref tui_rotation "Example"
7797 @ManageTransactions("TrsfOp")
7798 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7800 Rotate the given object around the given axis on the given angle.
7803 theObject The object to be rotated.
7804 theAxis Rotation axis.
7805 theAngle Rotation angle in radians.
7806 theCopy Flag used to rotate object itself or create a copy.
7809 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7810 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7812 # Example: see GEOM_TestAll.py
7814 if isinstance(theAngle,str):
7816 theAngle, Parameters = ParseParameters(theAngle)
7818 theAngle = theAngle*math.pi/180.0
7820 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7822 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7823 RaiseIfFailed("Rotate", self.TrsfOp)
7824 anObj.SetParameters(Parameters)
7827 ## Rotate the given object around the given axis
7828 # on the given angle, creating its copy before the rotatation.
7829 # @param theObject The object to be rotated.
7830 # @param theAxis Rotation axis.
7831 # @param theAngle Rotation angle in radians.
7832 # @param theName Object name; when specified, this parameter is used
7833 # for result publication in the study. Otherwise, if automatic
7834 # publication is switched on, default value is used for result name.
7836 # @return New GEOM.GEOM_Object, containing the rotated object.
7838 # @ref tui_rotation "Example"
7839 @ManageTransactions("TrsfOp")
7840 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7842 Rotate the given object around the given axis
7843 on the given angle, creating its copy before the rotatation.
7846 theObject The object to be rotated.
7847 theAxis Rotation axis.
7848 theAngle Rotation angle in radians.
7849 theName Object name; when specified, this parameter is used
7850 for result publication in the study. Otherwise, if automatic
7851 publication is switched on, default value is used for result name.
7854 New GEOM.GEOM_Object, containing the rotated object.
7856 # Example: see GEOM_TestAll.py
7858 if isinstance(theAngle,str):
7860 theAngle, Parameters = ParseParameters(theAngle)
7862 theAngle = theAngle*math.pi/180.0
7863 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7864 RaiseIfFailed("RotateCopy", self.TrsfOp)
7865 anObj.SetParameters(Parameters)
7866 self._autoPublish(anObj, theName, "rotated")
7869 ## Rotate given object around vector perpendicular to plane
7870 # containing three points.
7871 # @param theObject The object to be rotated.
7872 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7873 # containing the three points.
7874 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7875 # @param theCopy Flag used to rotate object itself or create a copy.
7876 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7877 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7878 @ManageTransactions("TrsfOp")
7879 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7881 Rotate given object around vector perpendicular to plane
7882 containing three points.
7885 theObject The object to be rotated.
7886 theCentPoint central point the axis is the vector perpendicular to the plane
7887 containing the three points.
7888 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7889 theCopy Flag used to rotate object itself or create a copy.
7892 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7893 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7896 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7898 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7899 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7902 ## Rotate given object around vector perpendicular to plane
7903 # containing three points, creating its copy before the rotatation.
7904 # @param theObject The object to be rotated.
7905 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7906 # containing the three points.
7907 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7908 # @param theName Object name; when specified, this parameter is used
7909 # for result publication in the study. Otherwise, if automatic
7910 # publication is switched on, default value is used for result name.
7912 # @return New GEOM.GEOM_Object, containing the rotated object.
7914 # @ref tui_rotation "Example"
7915 @ManageTransactions("TrsfOp")
7916 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7918 Rotate given object around vector perpendicular to plane
7919 containing three points, creating its copy before the rotatation.
7922 theObject The object to be rotated.
7923 theCentPoint central point the axis is the vector perpendicular to the plane
7924 containing the three points.
7925 thePoint1,thePoint2 in a perpendicular plane of the axis.
7926 theName Object name; when specified, this parameter is used
7927 for result publication in the study. Otherwise, if automatic
7928 publication is switched on, default value is used for result name.
7931 New GEOM.GEOM_Object, containing the rotated object.
7933 # Example: see GEOM_TestAll.py
7934 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7935 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7936 self._autoPublish(anObj, theName, "rotated")
7939 ## Scale the given object by the specified factor.
7940 # @param theObject The object to be scaled.
7941 # @param thePoint Center point for scaling.
7942 # Passing None for it means scaling relatively the origin of global CS.
7943 # @param theFactor Scaling factor value.
7944 # @param theCopy Flag used to scale object itself or create a copy.
7945 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7946 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7947 @ManageTransactions("TrsfOp")
7948 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7950 Scale the given object by the specified factor.
7953 theObject The object to be scaled.
7954 thePoint Center point for scaling.
7955 Passing None for it means scaling relatively the origin of global CS.
7956 theFactor Scaling factor value.
7957 theCopy Flag used to scale object itself or create a copy.
7960 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7961 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7963 # Example: see GEOM_TestAll.py
7964 theFactor, Parameters = ParseParameters(theFactor)
7966 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7968 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7969 RaiseIfFailed("Scale", self.TrsfOp)
7970 anObj.SetParameters(Parameters)
7973 ## Scale the given object by the factor, creating its copy before the scaling.
7974 # @param theObject The object to be scaled.
7975 # @param thePoint Center point for scaling.
7976 # Passing None for it means scaling relatively the origin of global CS.
7977 # @param theFactor Scaling factor value.
7978 # @param theName Object name; when specified, this parameter is used
7979 # for result publication in the study. Otherwise, if automatic
7980 # publication is switched on, default value is used for result name.
7982 # @return New GEOM.GEOM_Object, containing the scaled shape.
7984 # @ref tui_scale "Example"
7985 @ManageTransactions("TrsfOp")
7986 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7988 Scale the given object by the factor, creating its copy before the scaling.
7991 theObject The object to be scaled.
7992 thePoint Center point for scaling.
7993 Passing None for it means scaling relatively the origin of global CS.
7994 theFactor Scaling factor value.
7995 theName Object name; when specified, this parameter is used
7996 for result publication in the study. Otherwise, if automatic
7997 publication is switched on, default value is used for result name.
8000 New GEOM.GEOM_Object, containing the scaled shape.
8002 # Example: see GEOM_TestAll.py
8003 theFactor, Parameters = ParseParameters(theFactor)
8004 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8005 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8006 anObj.SetParameters(Parameters)
8007 self._autoPublish(anObj, theName, "scaled")
8010 ## Scale the given object by different factors along coordinate axes.
8011 # @param theObject The object to be scaled.
8012 # @param thePoint Center point for scaling.
8013 # Passing None for it means scaling relatively the origin of global CS.
8014 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8015 # @param theCopy Flag used to scale object itself or create a copy.
8016 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8017 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8018 @ManageTransactions("TrsfOp")
8019 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8021 Scale the given object by different factors along coordinate axes.
8024 theObject The object to be scaled.
8025 thePoint Center point for scaling.
8026 Passing None for it means scaling relatively the origin of global CS.
8027 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8028 theCopy Flag used to scale object itself or create a copy.
8031 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8032 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8034 # Example: see GEOM_TestAll.py
8035 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8037 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8038 theFactorX, theFactorY, theFactorZ)
8040 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8041 theFactorX, theFactorY, theFactorZ)
8042 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8043 anObj.SetParameters(Parameters)
8046 ## Scale the given object by different factors along coordinate axes,
8047 # creating its copy before the scaling.
8048 # @param theObject The object to be scaled.
8049 # @param thePoint Center point for scaling.
8050 # Passing None for it means scaling relatively the origin of global CS.
8051 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8052 # @param theName Object name; when specified, this parameter is used
8053 # for result publication in the study. Otherwise, if automatic
8054 # publication is switched on, default value is used for result name.
8056 # @return New GEOM.GEOM_Object, containing the scaled shape.
8058 # @ref swig_scale "Example"
8059 @ManageTransactions("TrsfOp")
8060 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8062 Scale the given object by different factors along coordinate axes,
8063 creating its copy before the scaling.
8066 theObject The object to be scaled.
8067 thePoint Center point for scaling.
8068 Passing None for it means scaling relatively the origin of global CS.
8069 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8070 theName Object name; when specified, this parameter is used
8071 for result publication in the study. Otherwise, if automatic
8072 publication is switched on, default value is used for result name.
8075 New GEOM.GEOM_Object, containing the scaled shape.
8077 # Example: see GEOM_TestAll.py
8078 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8079 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8080 theFactorX, theFactorY, theFactorZ)
8081 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8082 anObj.SetParameters(Parameters)
8083 self._autoPublish(anObj, theName, "scaled")
8086 ## Mirror an object relatively the given plane.
8087 # @param theObject The object to be mirrored.
8088 # @param thePlane Plane of symmetry.
8089 # @param theCopy Flag used to mirror object itself or create a copy.
8090 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8091 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8092 @ManageTransactions("TrsfOp")
8093 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8095 Mirror an object relatively the given plane.
8098 theObject The object to be mirrored.
8099 thePlane Plane of symmetry.
8100 theCopy Flag used to mirror object itself or create a copy.
8103 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8104 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8107 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8109 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8110 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8113 ## Create an object, symmetrical
8114 # to the given one relatively the given plane.
8115 # @param theObject The object to be mirrored.
8116 # @param thePlane Plane of symmetry.
8117 # @param theName Object name; when specified, this parameter is used
8118 # for result publication in the study. Otherwise, if automatic
8119 # publication is switched on, default value is used for result name.
8121 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8123 # @ref tui_mirror "Example"
8124 @ManageTransactions("TrsfOp")
8125 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8127 Create an object, symmetrical to the given one relatively the given plane.
8130 theObject The object to be mirrored.
8131 thePlane Plane of symmetry.
8132 theName Object name; when specified, this parameter is used
8133 for result publication in the study. Otherwise, if automatic
8134 publication is switched on, default value is used for result name.
8137 New GEOM.GEOM_Object, containing the mirrored shape.
8139 # Example: see GEOM_TestAll.py
8140 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8141 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8142 self._autoPublish(anObj, theName, "mirrored")
8145 ## Mirror an object relatively the given axis.
8146 # @param theObject The object to be mirrored.
8147 # @param theAxis Axis of symmetry.
8148 # @param theCopy Flag used to mirror object itself or create a copy.
8149 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8150 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8151 @ManageTransactions("TrsfOp")
8152 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8154 Mirror an object relatively the given axis.
8157 theObject The object to be mirrored.
8158 theAxis Axis of symmetry.
8159 theCopy Flag used to mirror object itself or create a copy.
8162 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8163 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8166 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8168 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8169 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8172 ## Create an object, symmetrical
8173 # to the given one relatively the given axis.
8174 # @param theObject The object to be mirrored.
8175 # @param theAxis Axis of symmetry.
8176 # @param theName Object name; when specified, this parameter is used
8177 # for result publication in the study. Otherwise, if automatic
8178 # publication is switched on, default value is used for result name.
8180 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8182 # @ref tui_mirror "Example"
8183 @ManageTransactions("TrsfOp")
8184 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8186 Create an object, symmetrical to the given one relatively the given axis.
8189 theObject The object to be mirrored.
8190 theAxis Axis of symmetry.
8191 theName Object name; when specified, this parameter is used
8192 for result publication in the study. Otherwise, if automatic
8193 publication is switched on, default value is used for result name.
8196 New GEOM.GEOM_Object, containing the mirrored shape.
8198 # Example: see GEOM_TestAll.py
8199 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8200 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8201 self._autoPublish(anObj, theName, "mirrored")
8204 ## Mirror an object relatively the given point.
8205 # @param theObject The object to be mirrored.
8206 # @param thePoint Point of symmetry.
8207 # @param theCopy Flag used to mirror object itself or create a copy.
8208 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8209 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8210 @ManageTransactions("TrsfOp")
8211 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8213 Mirror an object relatively the given point.
8216 theObject The object to be mirrored.
8217 thePoint Point of symmetry.
8218 theCopy Flag used to mirror object itself or create a copy.
8221 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8222 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8224 # Example: see GEOM_TestAll.py
8226 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8228 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8229 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8232 ## Create an object, symmetrical
8233 # to the given one relatively the given point.
8234 # @param theObject The object to be mirrored.
8235 # @param thePoint Point of symmetry.
8236 # @param theName Object name; when specified, this parameter is used
8237 # for result publication in the study. Otherwise, if automatic
8238 # publication is switched on, default value is used for result name.
8240 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8242 # @ref tui_mirror "Example"
8243 @ManageTransactions("TrsfOp")
8244 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8246 Create an object, symmetrical
8247 to the given one relatively the given point.
8250 theObject The object to be mirrored.
8251 thePoint Point of symmetry.
8252 theName Object name; when specified, this parameter is used
8253 for result publication in the study. Otherwise, if automatic
8254 publication is switched on, default value is used for result name.
8257 New GEOM.GEOM_Object, containing the mirrored shape.
8259 # Example: see GEOM_TestAll.py
8260 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8261 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8262 self._autoPublish(anObj, theName, "mirrored")
8265 ## Modify the location of the given object.
8266 # @param theObject The object to be displaced.
8267 # @param theStartLCS Coordinate system to perform displacement from it.\n
8268 # If \a theStartLCS is NULL, displacement
8269 # will be performed from global CS.\n
8270 # If \a theObject itself is used as \a theStartLCS,
8271 # its location will be changed to \a theEndLCS.
8272 # @param theEndLCS Coordinate system to perform displacement to it.
8273 # @param theCopy Flag used to displace object itself or create a copy.
8274 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8275 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8276 @ManageTransactions("TrsfOp")
8277 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8279 Modify the Location of the given object by LCS, creating its copy before the setting.
8282 theObject The object to be displaced.
8283 theStartLCS Coordinate system to perform displacement from it.
8284 If theStartLCS is NULL, displacement
8285 will be performed from global CS.
8286 If theObject itself is used as theStartLCS,
8287 its location will be changed to theEndLCS.
8288 theEndLCS Coordinate system to perform displacement to it.
8289 theCopy Flag used to displace object itself or create a copy.
8292 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8293 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8295 # Example: see GEOM_TestAll.py
8297 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8299 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8300 RaiseIfFailed("Displace", self.TrsfOp)
8303 ## Modify the Location of the given object by LCS,
8304 # creating its copy before the setting.
8305 # @param theObject The object to be displaced.
8306 # @param theStartLCS Coordinate system to perform displacement from it.\n
8307 # If \a theStartLCS is NULL, displacement
8308 # will be performed from global CS.\n
8309 # If \a theObject itself is used as \a theStartLCS,
8310 # its location will be changed to \a theEndLCS.
8311 # @param theEndLCS Coordinate system to perform displacement to it.
8312 # @param theName Object name; when specified, this parameter is used
8313 # for result publication in the study. Otherwise, if automatic
8314 # publication is switched on, default value is used for result name.
8316 # @return New GEOM.GEOM_Object, containing the displaced shape.
8318 # @ref tui_modify_location "Example"
8319 @ManageTransactions("TrsfOp")
8320 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8322 Modify the Location of the given object by LCS, creating its copy before the setting.
8325 theObject The object to be displaced.
8326 theStartLCS Coordinate system to perform displacement from it.
8327 If theStartLCS is NULL, displacement
8328 will be performed from global CS.
8329 If theObject itself is used as theStartLCS,
8330 its location will be changed to theEndLCS.
8331 theEndLCS Coordinate system to perform displacement to it.
8332 theName Object name; when specified, this parameter is used
8333 for result publication in the study. Otherwise, if automatic
8334 publication is switched on, default value is used for result name.
8337 New GEOM.GEOM_Object, containing the displaced shape.
8340 # create local coordinate systems
8341 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8342 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8343 # modify the location of the given object
8344 position = geompy.MakePosition(cylinder, cs1, cs2)
8346 # Example: see GEOM_TestAll.py
8347 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8348 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8349 self._autoPublish(anObj, theName, "displaced")
8352 ## Modify the Location of the given object by Path.
8353 # @param theObject The object to be displaced.
8354 # @param thePath Wire or Edge along that the object will be translated.
8355 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8356 # @param theCopy is to create a copy objects if true.
8357 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8358 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8359 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8361 # @ref tui_modify_location "Example"
8362 @ManageTransactions("TrsfOp")
8363 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8365 Modify the Location of the given object by Path.
8368 theObject The object to be displaced.
8369 thePath Wire or Edge along that the object will be translated.
8370 theDistance progress of Path (0 = start location, 1 = end of path location).
8371 theCopy is to create a copy objects if true.
8372 theReverse 0 - for usual direction, 1 - to reverse path direction.
8375 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8376 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8379 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8381 # Example: see GEOM_TestAll.py
8382 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8383 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8386 ## Modify the Location of the given object by Path, creating its copy before the operation.
8387 # @param theObject The object to be displaced.
8388 # @param thePath Wire or Edge along that the object will be translated.
8389 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8390 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8391 # @param theName Object name; when specified, this parameter is used
8392 # for result publication in the study. Otherwise, if automatic
8393 # publication is switched on, default value is used for result name.
8395 # @return New GEOM.GEOM_Object, containing the displaced shape.
8396 @ManageTransactions("TrsfOp")
8397 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8399 Modify the Location of the given object by Path, creating its copy before the operation.
8402 theObject The object to be displaced.
8403 thePath Wire or Edge along that the object will be translated.
8404 theDistance progress of Path (0 = start location, 1 = end of path location).
8405 theReverse 0 - for usual direction, 1 - to reverse path direction.
8406 theName Object name; when specified, this parameter is used
8407 for result publication in the study. Otherwise, if automatic
8408 publication is switched on, default value is used for result name.
8411 New GEOM.GEOM_Object, containing the displaced shape.
8413 # Example: see GEOM_TestAll.py
8414 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8415 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8416 self._autoPublish(anObj, theName, "displaced")
8419 ## Offset given shape.
8420 # @param theObject The base object for the offset.
8421 # @param theOffset Offset value.
8422 # @param theCopy Flag used to offset object itself or create a copy.
8423 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8424 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8425 @ManageTransactions("TrsfOp")
8426 def Offset(self, theObject, theOffset, theCopy=False):
8431 theObject The base object for the offset.
8432 theOffset Offset value.
8433 theCopy Flag used to offset object itself or create a copy.
8436 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8437 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8439 theOffset, Parameters = ParseParameters(theOffset)
8441 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8443 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8444 RaiseIfFailed("Offset", self.TrsfOp)
8445 anObj.SetParameters(Parameters)
8448 ## Create new object as offset of the given one.
8449 # @param theObject The base object for the offset.
8450 # @param theOffset Offset value.
8451 # @param theName Object name; when specified, this parameter is used
8452 # for result publication in the study. Otherwise, if automatic
8453 # publication is switched on, default value is used for result name.
8455 # @return New GEOM.GEOM_Object, containing the offset object.
8457 # @ref tui_offset "Example"
8458 @ManageTransactions("TrsfOp")
8459 def MakeOffset(self, theObject, theOffset, theName=None):
8461 Create new object as offset of the given one.
8464 theObject The base object for the offset.
8465 theOffset Offset value.
8466 theName Object name; when specified, this parameter is used
8467 for result publication in the study. Otherwise, if automatic
8468 publication is switched on, default value is used for result name.
8471 New GEOM.GEOM_Object, containing the offset object.
8474 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8475 # create a new object as offset of the given object
8476 offset = geompy.MakeOffset(box, 70.)
8478 # Example: see GEOM_TestAll.py
8479 theOffset, Parameters = ParseParameters(theOffset)
8480 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8481 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8482 anObj.SetParameters(Parameters)
8483 self._autoPublish(anObj, theName, "offset")
8486 ## Create new object as projection of the given one on a 2D surface.
8487 # @param theSource The source object for the projection. It can be a point, edge or wire.
8488 # @param theTarget The target object. It can be planar or cylindrical face.
8489 # @param theName Object name; when specified, this parameter is used
8490 # for result publication in the study. Otherwise, if automatic
8491 # publication is switched on, default value is used for result name.
8493 # @return New GEOM.GEOM_Object, containing the projection.
8495 # @ref tui_projection "Example"
8496 @ManageTransactions("TrsfOp")
8497 def MakeProjection(self, theSource, theTarget, theName=None):
8499 Create new object as projection of the given one on a 2D surface.
8502 theSource The source object for the projection. It can be a point, edge or wire.
8503 theTarget The target object. It can be planar or cylindrical face.
8504 theName Object name; when specified, this parameter is used
8505 for result publication in the study. Otherwise, if automatic
8506 publication is switched on, default value is used for result name.
8509 New GEOM.GEOM_Object, containing the projection.
8511 # Example: see GEOM_TestAll.py
8512 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8513 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8514 self._autoPublish(anObj, theName, "projection")
8517 ## Create a projection projection of the given point on a wire or an edge.
8518 # If there are no solutions or there are 2 or more solutions It throws an
8520 # @param thePoint the point to be projected.
8521 # @param theWire the wire. The edge is accepted as well.
8522 # @param theName Object name; when specified, this parameter is used
8523 # for result publication in the study. Otherwise, if automatic
8524 # publication is switched on, default value is used for result name.
8526 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8527 # \n \a u: The parameter of projection point on edge.
8528 # \n \a PointOnEdge: The projection point.
8529 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8531 # @ref tui_projection "Example"
8532 @ManageTransactions("TrsfOp")
8533 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8535 Create a projection projection of the given point on a wire or an edge.
8536 If there are no solutions or there are 2 or more solutions It throws an
8540 thePoint the point to be projected.
8541 theWire the wire. The edge is accepted as well.
8542 theName Object name; when specified, this parameter is used
8543 for result publication in the study. Otherwise, if automatic
8544 publication is switched on, default value is used for result name.
8547 [u, PointOnEdge, EdgeInWireIndex]
8548 u: The parameter of projection point on edge.
8549 PointOnEdge: The projection point.
8550 EdgeInWireIndex: The index of an edge in a wire.
8552 # Example: see GEOM_TestAll.py
8553 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8554 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8555 self._autoPublish(anObj[1], theName, "projection")
8558 # -----------------------------------------------------------------------------
8560 # -----------------------------------------------------------------------------
8562 ## Translate the given object along the given vector a given number times
8563 # @param theObject The object to be translated.
8564 # @param theVector Direction of the translation. DX if None.
8565 # @param theStep Distance to translate on.
8566 # @param theNbTimes Quantity of translations to be done.
8567 # @param theName Object name; when specified, this parameter is used
8568 # for result publication in the study. Otherwise, if automatic
8569 # publication is switched on, default value is used for result name.
8571 # @return New GEOM.GEOM_Object, containing compound of all
8572 # the shapes, obtained after each translation.
8574 # @ref tui_multi_translation "Example"
8575 @ManageTransactions("TrsfOp")
8576 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8578 Translate the given object along the given vector a given number times
8581 theObject The object to be translated.
8582 theVector Direction of the translation. DX if None.
8583 theStep Distance to translate on.
8584 theNbTimes Quantity of translations to be done.
8585 theName Object name; when specified, this parameter is used
8586 for result publication in the study. Otherwise, if automatic
8587 publication is switched on, default value is used for result name.
8590 New GEOM.GEOM_Object, containing compound of all
8591 the shapes, obtained after each translation.
8594 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8596 # Example: see GEOM_TestAll.py
8597 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8598 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8599 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8600 anObj.SetParameters(Parameters)
8601 self._autoPublish(anObj, theName, "multitranslation")
8604 ## Conseqently apply two specified translations to theObject specified number of times.
8605 # @param theObject The object to be translated.
8606 # @param theVector1 Direction of the first translation. DX if None.
8607 # @param theStep1 Step of the first translation.
8608 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8609 # @param theVector2 Direction of the second translation. DY if None.
8610 # @param theStep2 Step of the second translation.
8611 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8612 # @param theName Object name; when specified, this parameter is used
8613 # for result publication in the study. Otherwise, if automatic
8614 # publication is switched on, default value is used for result name.
8616 # @return New GEOM.GEOM_Object, containing compound of all
8617 # the shapes, obtained after each translation.
8619 # @ref tui_multi_translation "Example"
8620 @ManageTransactions("TrsfOp")
8621 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8622 theVector2, theStep2, theNbTimes2, theName=None):
8624 Conseqently apply two specified translations to theObject specified number of times.
8627 theObject The object to be translated.
8628 theVector1 Direction of the first translation. DX if None.
8629 theStep1 Step of the first translation.
8630 theNbTimes1 Quantity of translations to be done along theVector1.
8631 theVector2 Direction of the second translation. DY if None.
8632 theStep2 Step of the second translation.
8633 theNbTimes2 Quantity of translations to be done along theVector2.
8634 theName Object name; when specified, this parameter is used
8635 for result publication in the study. Otherwise, if automatic
8636 publication is switched on, default value is used for result name.
8639 New GEOM.GEOM_Object, containing compound of all
8640 the shapes, obtained after each translation.
8643 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8645 # Example: see GEOM_TestAll.py
8646 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8647 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8648 theVector2, theStep2, theNbTimes2)
8649 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8650 anObj.SetParameters(Parameters)
8651 self._autoPublish(anObj, theName, "multitranslation")
8654 ## Rotate the given object around the given axis a given number times.
8655 # Rotation angle will be 2*PI/theNbTimes.
8656 # @param theObject The object to be rotated.
8657 # @param theAxis The rotation axis. DZ if None.
8658 # @param theNbTimes Quantity of rotations to be done.
8659 # @param theName Object name; when specified, this parameter is used
8660 # for result publication in the study. Otherwise, if automatic
8661 # publication is switched on, default value is used for result name.
8663 # @return New GEOM.GEOM_Object, containing compound of all the
8664 # shapes, obtained after each rotation.
8666 # @ref tui_multi_rotation "Example"
8667 @ManageTransactions("TrsfOp")
8668 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8670 Rotate the given object around the given axis a given number times.
8671 Rotation angle will be 2*PI/theNbTimes.
8674 theObject The object to be rotated.
8675 theAxis The rotation axis. DZ if None.
8676 theNbTimes Quantity of rotations to be done.
8677 theName Object name; when specified, this parameter is used
8678 for result publication in the study. Otherwise, if automatic
8679 publication is switched on, default value is used for result name.
8682 New GEOM.GEOM_Object, containing compound of all the
8683 shapes, obtained after each rotation.
8686 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8688 # Example: see GEOM_TestAll.py
8689 theNbTimes, Parameters = ParseParameters(theNbTimes)
8690 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8691 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8692 anObj.SetParameters(Parameters)
8693 self._autoPublish(anObj, theName, "multirotation")
8696 ## Rotate the given object around the given axis
8697 # a given number times on the given angle.
8698 # @param theObject The object to be rotated.
8699 # @param theAxis The rotation axis. DZ if None.
8700 # @param theAngleStep Rotation angle in radians.
8701 # @param theNbTimes Quantity of rotations to be done.
8702 # @param theName Object name; when specified, this parameter is used
8703 # for result publication in the study. Otherwise, if automatic
8704 # publication is switched on, default value is used for result name.
8706 # @return New GEOM.GEOM_Object, containing compound of all the
8707 # shapes, obtained after each rotation.
8709 # @ref tui_multi_rotation "Example"
8710 @ManageTransactions("TrsfOp")
8711 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8713 Rotate the given object around the given axis
8714 a given number times on the given angle.
8717 theObject The object to be rotated.
8718 theAxis The rotation axis. DZ if None.
8719 theAngleStep Rotation angle in radians.
8720 theNbTimes Quantity of rotations to be done.
8721 theName Object name; when specified, this parameter is used
8722 for result publication in the study. Otherwise, if automatic
8723 publication is switched on, default value is used for result name.
8726 New GEOM.GEOM_Object, containing compound of all the
8727 shapes, obtained after each rotation.
8730 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8732 # Example: see GEOM_TestAll.py
8733 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8734 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8735 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8736 anObj.SetParameters(Parameters)
8737 self._autoPublish(anObj, theName, "multirotation")
8740 ## Rotate the given object around the given axis a given
8741 # number times and multi-translate each rotation result.
8742 # Rotation angle will be 2*PI/theNbTimes1.
8743 # Translation direction passes through center of gravity
8744 # of rotated shape and its projection on the rotation axis.
8745 # @param theObject The object to be rotated.
8746 # @param theAxis Rotation axis. DZ if None.
8747 # @param theNbTimes1 Quantity of rotations to be done.
8748 # @param theRadialStep Translation distance.
8749 # @param theNbTimes2 Quantity of translations to be done.
8750 # @param theName Object name; when specified, this parameter is used
8751 # for result publication in the study. Otherwise, if automatic
8752 # publication is switched on, default value is used for result name.
8754 # @return New GEOM.GEOM_Object, containing compound of all the
8755 # shapes, obtained after each transformation.
8757 # @ref tui_multi_rotation "Example"
8758 @ManageTransactions("TrsfOp")
8759 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8761 Rotate the given object around the
8762 given axis on the given angle a given number
8763 times and multi-translate each rotation result.
8764 Translation direction passes through center of gravity
8765 of rotated shape and its projection on the rotation axis.
8768 theObject The object to be rotated.
8769 theAxis Rotation axis. DZ if None.
8770 theNbTimes1 Quantity of rotations to be done.
8771 theRadialStep Translation distance.
8772 theNbTimes2 Quantity of translations to be done.
8773 theName Object name; when specified, this parameter is used
8774 for result publication in the study. Otherwise, if automatic
8775 publication is switched on, default value is used for result name.
8778 New GEOM.GEOM_Object, containing compound of all the
8779 shapes, obtained after each transformation.
8782 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8784 # Example: see GEOM_TestAll.py
8785 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8786 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8787 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8788 anObj.SetParameters(Parameters)
8789 self._autoPublish(anObj, theName, "multirotation")
8792 ## Rotate the given object around the
8793 # given axis on the given angle a given number
8794 # times and multi-translate each rotation result.
8795 # Translation direction passes through center of gravity
8796 # of rotated shape and its projection on the rotation axis.
8797 # @param theObject The object to be rotated.
8798 # @param theAxis Rotation axis. DZ if None.
8799 # @param theAngleStep Rotation angle in radians.
8800 # @param theNbTimes1 Quantity of rotations to be done.
8801 # @param theRadialStep Translation distance.
8802 # @param theNbTimes2 Quantity of translations to be done.
8803 # @param theName Object name; when specified, this parameter is used
8804 # for result publication in the study. Otherwise, if automatic
8805 # publication is switched on, default value is used for result name.
8807 # @return New GEOM.GEOM_Object, containing compound of all the
8808 # shapes, obtained after each transformation.
8810 # @ref tui_multi_rotation "Example"
8811 @ManageTransactions("TrsfOp")
8812 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8814 Rotate the given object around the
8815 given axis on the given angle a given number
8816 times and multi-translate each rotation result.
8817 Translation direction passes through center of gravity
8818 of rotated shape and its projection on the rotation axis.
8821 theObject The object to be rotated.
8822 theAxis Rotation axis. DZ if None.
8823 theAngleStep Rotation angle in radians.
8824 theNbTimes1 Quantity of rotations to be done.
8825 theRadialStep Translation distance.
8826 theNbTimes2 Quantity of translations to be done.
8827 theName Object name; when specified, this parameter is used
8828 for result publication in the study. Otherwise, if automatic
8829 publication is switched on, default value is used for result name.
8832 New GEOM.GEOM_Object, containing compound of all the
8833 shapes, obtained after each transformation.
8836 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8838 # Example: see GEOM_TestAll.py
8839 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8840 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8841 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8842 anObj.SetParameters(Parameters)
8843 self._autoPublish(anObj, theName, "multirotation")
8846 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8848 # @ref swig_MakeMultiRotation "Example"
8849 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8851 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8854 pz = geompy.MakeVertex(0, 0, 100)
8855 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8856 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8858 # Example: see GEOM_TestOthers.py
8859 aVec = self.MakeLine(aPoint,aDir)
8860 # note: auto-publishing is done in self.MultiRotate1D()
8861 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8864 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8866 # @ref swig_MakeMultiRotation "Example"
8867 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8869 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8872 pz = geompy.MakeVertex(0, 0, 100)
8873 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8874 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8876 # Example: see GEOM_TestOthers.py
8877 aVec = self.MakeLine(aPoint,aDir)
8878 # note: auto-publishing is done in self.MultiRotate1D()
8879 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8882 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8884 # @ref swig_MakeMultiRotation "Example"
8885 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8887 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8890 pz = geompy.MakeVertex(0, 0, 100)
8891 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8892 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8894 # Example: see GEOM_TestOthers.py
8895 aVec = self.MakeLine(aPoint,aDir)
8896 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8897 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8900 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8902 # @ref swig_MakeMultiRotation "Example"
8903 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8905 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8908 pz = geompy.MakeVertex(0, 0, 100)
8909 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8910 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8912 # Example: see GEOM_TestOthers.py
8913 aVec = self.MakeLine(aPoint,aDir)
8914 # note: auto-publishing is done in self.MultiRotate2D()
8915 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8918 # end of l3_transform
8921 ## @addtogroup l3_transform_d
8924 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8925 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8927 Deprecated method. Use MultiRotate1DNbTimes instead.
8929 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8930 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8932 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8933 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8934 @ManageTransactions("TrsfOp")
8935 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8937 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8938 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8941 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8943 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8944 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8945 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8946 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8947 anObj.SetParameters(Parameters)
8948 self._autoPublish(anObj, theName, "multirotation")
8951 ## The same, as MultiRotate1D(), but axis is given by direction and point
8952 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8953 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8955 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8956 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8959 pz = geompy.MakeVertex(0, 0, 100)
8960 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8961 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8963 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8964 aVec = self.MakeLine(aPoint,aDir)
8965 # note: auto-publishing is done in self.MultiRotate1D()
8966 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8969 ## The same, as MultiRotate2D(), but axis is given by direction and point
8970 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8971 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8973 The same, as MultiRotate2D(), but axis is given by direction and point
8974 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8977 pz = geompy.MakeVertex(0, 0, 100)
8978 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8979 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8981 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8982 aVec = self.MakeLine(aPoint,aDir)
8983 # note: auto-publishing is done in self.MultiRotate2D()
8984 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8987 # end of l3_transform_d
8990 ## @addtogroup l3_local
8993 ## Perform a fillet on all edges of the given shape.
8994 # @param theShape Shape, to perform fillet on.
8995 # @param theR Fillet radius.
8996 # @param theName Object name; when specified, this parameter is used
8997 # for result publication in the study. Otherwise, if automatic
8998 # publication is switched on, default value is used for result name.
9000 # @return New GEOM.GEOM_Object, containing the result shape.
9002 # @ref tui_fillet "Example 1"
9003 # \n @ref swig_MakeFilletAll "Example 2"
9004 @ManageTransactions("LocalOp")
9005 def MakeFilletAll(self, theShape, theR, theName=None):
9007 Perform a fillet on all edges of the given shape.
9010 theShape Shape, to perform fillet on.
9012 theName Object name; when specified, this parameter is used
9013 for result publication in the study. Otherwise, if automatic
9014 publication is switched on, default value is used for result name.
9017 New GEOM.GEOM_Object, containing the result shape.
9020 filletall = geompy.MakeFilletAll(prism, 10.)
9022 # Example: see GEOM_TestOthers.py
9023 theR,Parameters = ParseParameters(theR)
9024 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9025 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9026 anObj.SetParameters(Parameters)
9027 self._autoPublish(anObj, theName, "fillet")
9030 ## Perform a fillet on the specified edges/faces of the given shape
9031 # @param theShape Shape, to perform fillet on.
9032 # @param theR Fillet radius.
9033 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9034 # @param theListShapes Global indices of edges/faces to perform fillet on.
9035 # @param theName Object name; when specified, this parameter is used
9036 # for result publication in the study. Otherwise, if automatic
9037 # publication is switched on, default value is used for result name.
9039 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9041 # @return New GEOM.GEOM_Object, containing the result shape.
9043 # @ref tui_fillet "Example"
9044 @ManageTransactions("LocalOp")
9045 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9047 Perform a fillet on the specified edges/faces of the given shape
9050 theShape Shape, to perform fillet on.
9052 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9053 theListShapes Global indices of edges/faces to perform fillet on.
9054 theName Object name; when specified, this parameter is used
9055 for result publication in the study. Otherwise, if automatic
9056 publication is switched on, default value is used for result name.
9059 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9062 New GEOM.GEOM_Object, containing the result shape.
9065 # get the list of IDs (IDList) for the fillet
9066 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9068 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9069 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9070 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9071 # make a fillet on the specified edges of the given shape
9072 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9074 # Example: see GEOM_TestAll.py
9075 theR,Parameters = ParseParameters(theR)
9077 if theShapeType == self.ShapeType["EDGE"]:
9078 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9079 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9081 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9082 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9083 anObj.SetParameters(Parameters)
9084 self._autoPublish(anObj, theName, "fillet")
9087 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9088 @ManageTransactions("LocalOp")
9089 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9091 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9094 # get the list of IDs (IDList) for the fillet
9095 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9097 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9098 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9099 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9100 # make a fillet on the specified edges of the given shape
9101 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9103 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9105 if theShapeType == self.ShapeType["EDGE"]:
9106 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9107 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9109 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9110 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9111 anObj.SetParameters(Parameters)
9112 self._autoPublish(anObj, theName, "fillet")
9115 ## Perform a fillet on the specified edges of the given shape
9116 # @param theShape Wire Shape to perform fillet on.
9117 # @param theR Fillet radius.
9118 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9119 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9120 # \note The list of vertices could be empty,
9121 # in this case fillet will done done at all vertices in wire
9122 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9123 # by the length of the edges, nearest to the fillet vertex.
9124 # But sometimes the next edge is C1 continuous with the one, nearest to
9125 # the fillet point, and such two (or more) edges can be united to allow
9126 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9127 # thus ignoring the secant vertex (vertices).
9128 # @param theName Object name; when specified, this parameter is used
9129 # for result publication in the study. Otherwise, if automatic
9130 # publication is switched on, default value is used for result name.
9132 # @return New GEOM.GEOM_Object, containing the result shape.
9134 # @ref tui_fillet2d "Example"
9135 @ManageTransactions("LocalOp")
9136 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9138 Perform a fillet on the specified edges of the given shape
9141 theShape Wire Shape to perform fillet on.
9143 theListOfVertexes Global indices of vertexes to perform fillet on.
9144 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9145 by the length of the edges, nearest to the fillet vertex.
9146 But sometimes the next edge is C1 continuous with the one, nearest to
9147 the fillet point, and such two (or more) edges can be united to allow
9148 bigger radius. Set this flag to TRUE to allow collinear edges union,
9149 thus ignoring the secant vertex (vertices).
9150 theName Object name; when specified, this parameter is used
9151 for result publication in the study. Otherwise, if automatic
9152 publication is switched on, default value is used for result name.
9154 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9156 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9159 New GEOM.GEOM_Object, containing the result shape.
9163 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9164 # make fillet at given wire vertices with giver radius
9165 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9167 # Example: see GEOM_TestAll.py
9168 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9169 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9170 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9171 anObj.SetParameters(Parameters)
9172 self._autoPublish(anObj, theName, "fillet")
9175 ## Perform a fillet at the specified vertices of the given face/shell.
9176 # @param theShape Face or Shell shape to perform fillet on.
9177 # @param theR Fillet radius.
9178 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9179 # @param theName Object name; when specified, this parameter is used
9180 # for result publication in the study. Otherwise, if automatic
9181 # publication is switched on, default value is used for result name.
9183 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9185 # @return New GEOM.GEOM_Object, containing the result shape.
9187 # @ref tui_fillet2d "Example"
9188 @ManageTransactions("LocalOp")
9189 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9191 Perform a fillet at the specified vertices of the given face/shell.
9194 theShape Face or Shell shape to perform fillet on.
9196 theListOfVertexes Global indices of vertexes to perform fillet on.
9197 theName Object name; when specified, this parameter is used
9198 for result publication in the study. Otherwise, if automatic
9199 publication is switched on, default value is used for result name.
9201 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9204 New GEOM.GEOM_Object, containing the result shape.
9207 face = geompy.MakeFaceHW(100, 100, 1)
9208 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9210 # Example: see GEOM_TestAll.py
9211 theR,Parameters = ParseParameters(theR)
9212 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9213 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9214 anObj.SetParameters(Parameters)
9215 self._autoPublish(anObj, theName, "fillet")
9218 ## Perform a symmetric chamfer on all edges of the given shape.
9219 # @param theShape Shape, to perform chamfer on.
9220 # @param theD Chamfer size along each face.
9221 # @param theName Object name; when specified, this parameter is used
9222 # for result publication in the study. Otherwise, if automatic
9223 # publication is switched on, default value is used for result name.
9225 # @return New GEOM.GEOM_Object, containing the result shape.
9227 # @ref tui_chamfer "Example 1"
9228 # \n @ref swig_MakeChamferAll "Example 2"
9229 @ManageTransactions("LocalOp")
9230 def MakeChamferAll(self, theShape, theD, theName=None):
9232 Perform a symmetric chamfer on all edges of the given shape.
9235 theShape Shape, to perform chamfer on.
9236 theD Chamfer size along each face.
9237 theName Object name; when specified, this parameter is used
9238 for result publication in the study. Otherwise, if automatic
9239 publication is switched on, default value is used for result name.
9242 New GEOM.GEOM_Object, containing the result shape.
9245 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9247 # Example: see GEOM_TestOthers.py
9248 theD,Parameters = ParseParameters(theD)
9249 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9250 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9251 anObj.SetParameters(Parameters)
9252 self._autoPublish(anObj, theName, "chamfer")
9255 ## Perform a chamfer on edges, common to the specified faces,
9256 # with distance D1 on the Face1
9257 # @param theShape Shape, to perform chamfer on.
9258 # @param theD1 Chamfer size along \a theFace1.
9259 # @param theD2 Chamfer size along \a theFace2.
9260 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9261 # @param theName Object name; when specified, this parameter is used
9262 # for result publication in the study. Otherwise, if automatic
9263 # publication is switched on, default value is used for result name.
9265 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9267 # @return New GEOM.GEOM_Object, containing the result shape.
9269 # @ref tui_chamfer "Example"
9270 @ManageTransactions("LocalOp")
9271 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9273 Perform a chamfer on edges, common to the specified faces,
9274 with distance D1 on the Face1
9277 theShape Shape, to perform chamfer on.
9278 theD1 Chamfer size along theFace1.
9279 theD2 Chamfer size along theFace2.
9280 theFace1,theFace2 Global indices of two faces of theShape.
9281 theName Object name; when specified, this parameter is used
9282 for result publication in the study. Otherwise, if automatic
9283 publication is switched on, default value is used for result name.
9286 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9289 New GEOM.GEOM_Object, containing the result shape.
9292 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9293 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9294 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9295 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9297 # Example: see GEOM_TestAll.py
9298 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9299 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9300 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9301 anObj.SetParameters(Parameters)
9302 self._autoPublish(anObj, theName, "chamfer")
9305 ## Perform a chamfer on edges
9306 # @param theShape Shape, to perform chamfer on.
9307 # @param theD Chamfer length
9308 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9309 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9310 # @param theName Object name; when specified, this parameter is used
9311 # for result publication in the study. Otherwise, if automatic
9312 # publication is switched on, default value is used for result name.
9314 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9316 # @return New GEOM.GEOM_Object, containing the result shape.
9317 @ManageTransactions("LocalOp")
9318 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9320 Perform a chamfer on edges
9323 theShape Shape, to perform chamfer on.
9324 theD1 Chamfer size along theFace1.
9325 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9326 theFace1,theFace2 Global indices of two faces of theShape.
9327 theName Object name; when specified, this parameter is used
9328 for result publication in the study. Otherwise, if automatic
9329 publication is switched on, default value is used for result name.
9332 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9335 New GEOM.GEOM_Object, containing the result shape.
9338 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9339 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9340 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9342 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9345 if isinstance(theAngle,str):
9347 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9349 theAngle = theAngle*math.pi/180.0
9350 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9351 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9352 anObj.SetParameters(Parameters)
9353 self._autoPublish(anObj, theName, "chamfer")
9356 ## Perform a chamfer on all edges of the specified faces,
9357 # with distance D1 on the first specified face (if several for one edge)
9358 # @param theShape Shape, to perform chamfer on.
9359 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9360 # connected to the edge, are in \a theFaces, \a theD1
9361 # will be get along face, which is nearer to \a theFaces beginning.
9362 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9363 # @param theFaces Sequence of global indices of faces of \a theShape.
9364 # @param theName Object name; when specified, this parameter is used
9365 # for result publication in the study. Otherwise, if automatic
9366 # publication is switched on, default value is used for result name.
9368 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9370 # @return New GEOM.GEOM_Object, containing the result shape.
9372 # @ref tui_chamfer "Example"
9373 @ManageTransactions("LocalOp")
9374 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9376 Perform a chamfer on all edges of the specified faces,
9377 with distance D1 on the first specified face (if several for one edge)
9380 theShape Shape, to perform chamfer on.
9381 theD1 Chamfer size along face from theFaces. If both faces,
9382 connected to the edge, are in theFaces, theD1
9383 will be get along face, which is nearer to theFaces beginning.
9384 theD2 Chamfer size along another of two faces, connected to the edge.
9385 theFaces Sequence of global indices of faces of theShape.
9386 theName Object name; when specified, this parameter is used
9387 for result publication in the study. Otherwise, if automatic
9388 publication is switched on, default value is used for result name.
9390 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9393 New GEOM.GEOM_Object, containing the result shape.
9395 # Example: see GEOM_TestAll.py
9396 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9397 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9398 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9399 anObj.SetParameters(Parameters)
9400 self._autoPublish(anObj, theName, "chamfer")
9403 ## The Same that 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)
9406 # @ref swig_FilletChamfer "Example"
9407 @ManageTransactions("LocalOp")
9408 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9410 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9411 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9414 if isinstance(theAngle,str):
9416 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9418 theAngle = theAngle*math.pi/180.0
9419 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9420 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9421 anObj.SetParameters(Parameters)
9422 self._autoPublish(anObj, theName, "chamfer")
9425 ## Perform a chamfer on edges,
9426 # with distance D1 on the first specified face (if several for one edge)
9427 # @param theShape Shape, to perform chamfer on.
9428 # @param theD1,theD2 Chamfer size
9429 # @param theEdges Sequence of edges of \a theShape.
9430 # @param theName Object name; when specified, this parameter is used
9431 # for result publication in the study. Otherwise, if automatic
9432 # publication is switched on, default value is used for result name.
9434 # @return New GEOM.GEOM_Object, containing the result shape.
9436 # @ref swig_FilletChamfer "Example"
9437 @ManageTransactions("LocalOp")
9438 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9440 Perform a chamfer on edges,
9441 with distance D1 on the first specified face (if several for one edge)
9444 theShape Shape, to perform chamfer on.
9445 theD1,theD2 Chamfer size
9446 theEdges Sequence of edges of theShape.
9447 theName Object name; when specified, this parameter is used
9448 for result publication in the study. Otherwise, if automatic
9449 publication is switched on, default value is used for result name.
9452 New GEOM.GEOM_Object, containing the result shape.
9454 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9455 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9456 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9457 anObj.SetParameters(Parameters)
9458 self._autoPublish(anObj, theName, "chamfer")
9461 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9462 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9463 @ManageTransactions("LocalOp")
9464 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9466 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9467 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9470 if isinstance(theAngle,str):
9472 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9474 theAngle = theAngle*math.pi/180.0
9475 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9476 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9477 anObj.SetParameters(Parameters)
9478 self._autoPublish(anObj, theName, "chamfer")
9481 ## @sa MakeChamferEdge(), MakeChamferFaces()
9483 # @ref swig_MakeChamfer "Example"
9484 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9486 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9488 # Example: see GEOM_TestOthers.py
9490 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9491 if aShapeType == self.ShapeType["EDGE"]:
9492 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9494 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9497 ## Remove material from a solid by extrusion of the base shape on the given distance.
9498 # @param theInit Shape to remove material from. It must be a solid or
9499 # a compound made of a single solid.
9500 # @param theBase Closed edge or wire defining the base shape to be extruded.
9501 # @param theH Prism dimension along the normal to theBase
9502 # @param theAngle Draft angle in degrees.
9503 # @param theName Object name; when specified, this parameter is used
9504 # for result publication in the study. Otherwise, if automatic
9505 # publication is switched on, default value is used for result name.
9507 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9509 # @ref tui_creation_prism "Example"
9510 @ManageTransactions("PrimOp")
9511 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9513 Add material to a solid by extrusion of the base shape on the given distance.
9516 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9517 theBase Closed edge or wire defining the base shape to be extruded.
9518 theH Prism dimension along the normal to theBase
9519 theAngle Draft angle in degrees.
9520 theName Object name; when specified, this parameter is used
9521 for result publication in the study. Otherwise, if automatic
9522 publication is switched on, default value is used for result name.
9525 New GEOM.GEOM_Object, containing the initial shape with removed material.
9527 # Example: see GEOM_TestAll.py
9528 #theH,Parameters = ParseParameters(theH)
9529 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9530 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9531 #anObj.SetParameters(Parameters)
9532 self._autoPublish(anObj, theName, "extrudedCut")
9535 ## Add material to a solid by extrusion of the base shape on the given distance.
9536 # @param theInit Shape to add material to. It must be a solid or
9537 # a compound made of a single solid.
9538 # @param theBase Closed edge or wire defining the base shape to be extruded.
9539 # @param theH Prism dimension along the normal to theBase
9540 # @param theAngle Draft angle in degrees.
9541 # @param theName Object name; when specified, this parameter is used
9542 # for result publication in the study. Otherwise, if automatic
9543 # publication is switched on, default value is used for result name.
9545 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9547 # @ref tui_creation_prism "Example"
9548 @ManageTransactions("PrimOp")
9549 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9551 Add material to a solid by extrusion of the base shape on the given distance.
9554 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9555 theBase Closed edge or wire defining the base shape to be extruded.
9556 theH Prism dimension along the normal to theBase
9557 theAngle Draft angle in degrees.
9558 theName Object name; when specified, this parameter is used
9559 for result publication in the study. Otherwise, if automatic
9560 publication is switched on, default value is used for result name.
9563 New GEOM.GEOM_Object, containing the initial shape with added material.
9565 # Example: see GEOM_TestAll.py
9566 #theH,Parameters = ParseParameters(theH)
9567 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9568 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9569 #anObj.SetParameters(Parameters)
9570 self._autoPublish(anObj, theName, "extrudedBoss")
9576 ## @addtogroup l3_basic_op
9579 ## Perform an Archimde operation on the given shape with given parameters.
9580 # The object presenting the resulting face is returned.
9581 # @param theShape Shape to be put in water.
9582 # @param theWeight Weight og the shape.
9583 # @param theWaterDensity Density of the water.
9584 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9585 # @param theName Object name; when specified, this parameter is used
9586 # for result publication in the study. Otherwise, if automatic
9587 # publication is switched on, default value is used for result name.
9589 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9590 # by a plane, corresponding to water level.
9592 # @ref tui_archimede "Example"
9593 @ManageTransactions("LocalOp")
9594 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9596 Perform an Archimde operation on the given shape with given parameters.
9597 The object presenting the resulting face is returned.
9600 theShape Shape to be put in water.
9601 theWeight Weight og the shape.
9602 theWaterDensity Density of the water.
9603 theMeshDeflection Deflection of the mesh, using to compute the section.
9604 theName Object name; when specified, this parameter is used
9605 for result publication in the study. Otherwise, if automatic
9606 publication is switched on, default value is used for result name.
9609 New GEOM.GEOM_Object, containing a section of theShape
9610 by a plane, corresponding to water level.
9612 # Example: see GEOM_TestAll.py
9613 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9614 theWeight,theWaterDensity,theMeshDeflection)
9615 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9616 RaiseIfFailed("MakeArchimede", self.LocalOp)
9617 anObj.SetParameters(Parameters)
9618 self._autoPublish(anObj, theName, "archimede")
9621 # end of l3_basic_op
9624 ## @addtogroup l2_measure
9627 ## Get point coordinates
9630 # @ref tui_measurement_tools_page "Example"
9631 @ManageTransactions("MeasuOp")
9632 def PointCoordinates(self,Point):
9634 Get point coordinates
9639 # Example: see GEOM_TestMeasures.py
9640 aTuple = self.MeasuOp.PointCoordinates(Point)
9641 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9644 ## Get vector coordinates
9647 # @ref tui_measurement_tools_page "Example"
9648 def VectorCoordinates(self,Vector):
9650 Get vector coordinates
9656 p1=self.GetFirstVertex(Vector)
9657 p2=self.GetLastVertex(Vector)
9659 X1=self.PointCoordinates(p1)
9660 X2=self.PointCoordinates(p2)
9662 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9665 ## Compute cross product
9666 # @return vector w=u^v
9668 # @ref tui_measurement_tools_page "Example"
9669 def CrossProduct(self, Vector1, Vector2):
9671 Compute cross product
9673 Returns: vector w=u^v
9675 u=self.VectorCoordinates(Vector1)
9676 v=self.VectorCoordinates(Vector2)
9677 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])
9681 ## Compute cross product
9682 # @return dot product p=u.v
9684 # @ref tui_measurement_tools_page "Example"
9685 def DotProduct(self, Vector1, Vector2):
9687 Compute cross product
9689 Returns: dot product p=u.v
9691 u=self.VectorCoordinates(Vector1)
9692 v=self.VectorCoordinates(Vector2)
9693 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9698 ## Get summarized length of all wires,
9699 # area of surface and volume of the given shape.
9700 # @param theShape Shape to define properties of.
9701 # @return [theLength, theSurfArea, theVolume]\n
9702 # theLength: Summarized length of all wires of the given shape.\n
9703 # theSurfArea: Area of surface of the given shape.\n
9704 # theVolume: Volume of the given shape.
9706 # @ref tui_measurement_tools_page "Example"
9707 @ManageTransactions("MeasuOp")
9708 def BasicProperties(self,theShape):
9710 Get summarized length of all wires,
9711 area of surface and volume of the given shape.
9714 theShape Shape to define properties of.
9717 [theLength, theSurfArea, theVolume]
9718 theLength: Summarized length of all wires of the given shape.
9719 theSurfArea: Area of surface of the given shape.
9720 theVolume: Volume of the given shape.
9722 # Example: see GEOM_TestMeasures.py
9723 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9724 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9727 ## Get parameters of bounding box of the given shape
9728 # @param theShape Shape to obtain bounding box of.
9729 # @param precise TRUE for precise computation; FALSE for fast one.
9730 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9731 # Xmin,Xmax: Limits of shape along OX axis.
9732 # Ymin,Ymax: Limits of shape along OY axis.
9733 # Zmin,Zmax: Limits of shape along OZ axis.
9735 # @ref tui_measurement_tools_page "Example"
9736 @ManageTransactions("MeasuOp")
9737 def BoundingBox (self, theShape, precise=False):
9739 Get parameters of bounding box of the given shape
9742 theShape Shape to obtain bounding box of.
9743 precise TRUE for precise computation; FALSE for fast one.
9746 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9747 Xmin,Xmax: Limits of shape along OX axis.
9748 Ymin,Ymax: Limits of shape along OY axis.
9749 Zmin,Zmax: Limits of shape along OZ axis.
9751 # Example: see GEOM_TestMeasures.py
9752 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9753 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9756 ## Get bounding box of the given shape
9757 # @param theShape Shape to obtain bounding box of.
9758 # @param precise TRUE for precise computation; FALSE for fast one.
9759 # @param theName Object name; when specified, this parameter is used
9760 # for result publication in the study. Otherwise, if automatic
9761 # publication is switched on, default value is used for result name.
9763 # @return New GEOM.GEOM_Object, containing the created box.
9765 # @ref tui_measurement_tools_page "Example"
9766 @ManageTransactions("MeasuOp")
9767 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9769 Get bounding box of the given shape
9772 theShape Shape to obtain bounding box of.
9773 precise TRUE for precise computation; FALSE for fast one.
9774 theName Object name; when specified, this parameter is used
9775 for result publication in the study. Otherwise, if automatic
9776 publication is switched on, default value is used for result name.
9779 New GEOM.GEOM_Object, containing the created box.
9781 # Example: see GEOM_TestMeasures.py
9782 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9783 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9784 self._autoPublish(anObj, theName, "bndbox")
9787 ## Get inertia matrix and moments of inertia of theShape.
9788 # @param theShape Shape to calculate inertia of.
9789 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9790 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9791 # Ix,Iy,Iz: Moments of inertia of the given shape.
9793 # @ref tui_measurement_tools_page "Example"
9794 @ManageTransactions("MeasuOp")
9795 def Inertia(self,theShape):
9797 Get inertia matrix and moments of inertia of theShape.
9800 theShape Shape to calculate inertia of.
9803 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9804 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9805 Ix,Iy,Iz: Moments of inertia of the given shape.
9807 # Example: see GEOM_TestMeasures.py
9808 aTuple = self.MeasuOp.GetInertia(theShape)
9809 RaiseIfFailed("GetInertia", self.MeasuOp)
9812 ## Get if coords are included in the shape (ST_IN or ST_ON)
9813 # @param theShape Shape
9814 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9815 # @param tolerance to be used (default is 1.0e-7)
9816 # @return list_of_boolean = [res1, res2, ...]
9817 @ManageTransactions("MeasuOp")
9818 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9820 Get if coords are included in the shape (ST_IN or ST_ON)
9824 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9825 tolerance to be used (default is 1.0e-7)
9828 list_of_boolean = [res1, res2, ...]
9830 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9832 ## Get minimal distance between the given shapes.
9833 # @param theShape1,theShape2 Shapes to find minimal distance between.
9834 # @return Value of the minimal distance between the given shapes.
9836 # @ref tui_measurement_tools_page "Example"
9837 @ManageTransactions("MeasuOp")
9838 def MinDistance(self, theShape1, theShape2):
9840 Get minimal distance between the given shapes.
9843 theShape1,theShape2 Shapes to find minimal distance between.
9846 Value of the minimal distance between the given shapes.
9848 # Example: see GEOM_TestMeasures.py
9849 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9850 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9853 ## Get minimal distance between the given shapes.
9854 # @param theShape1,theShape2 Shapes to find minimal distance between.
9855 # @return Value of the minimal distance between the given shapes, in form of list
9856 # [Distance, DX, DY, DZ].
9858 # @ref swig_all_measure "Example"
9859 @ManageTransactions("MeasuOp")
9860 def MinDistanceComponents(self, theShape1, theShape2):
9862 Get minimal distance between the given shapes.
9865 theShape1,theShape2 Shapes to find minimal distance between.
9868 Value of the minimal distance between the given shapes, in form of list
9869 [Distance, DX, DY, DZ]
9871 # Example: see GEOM_TestMeasures.py
9872 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9873 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9874 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9877 ## Get closest points of the given shapes.
9878 # @param theShape1,theShape2 Shapes to find closest points of.
9879 # @return The number of found solutions (-1 in case of infinite number of
9880 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9882 # @ref tui_measurement_tools_page "Example"
9883 @ManageTransactions("MeasuOp")
9884 def ClosestPoints (self, theShape1, theShape2):
9886 Get closest points of the given shapes.
9889 theShape1,theShape2 Shapes to find closest points of.
9892 The number of found solutions (-1 in case of infinite number of
9893 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9895 # Example: see GEOM_TestMeasures.py
9896 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9897 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9900 ## Get angle between the given shapes in degrees.
9901 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9902 # @note If both arguments are vectors, the angle is computed in accordance
9903 # with their orientations, otherwise the minimum angle is computed.
9904 # @return Value of the angle between the given shapes in degrees.
9906 # @ref tui_measurement_tools_page "Example"
9907 @ManageTransactions("MeasuOp")
9908 def GetAngle(self, theShape1, theShape2):
9910 Get angle between the given shapes in degrees.
9913 theShape1,theShape2 Lines or linear edges to find angle between.
9916 If both arguments are vectors, the angle is computed in accordance
9917 with their orientations, otherwise the minimum angle is computed.
9920 Value of the angle between the given shapes in degrees.
9922 # Example: see GEOM_TestMeasures.py
9923 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9924 RaiseIfFailed("GetAngle", self.MeasuOp)
9927 ## Get angle between the given shapes in radians.
9928 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9929 # @note If both arguments are vectors, the angle is computed in accordance
9930 # with their orientations, otherwise the minimum angle is computed.
9931 # @return Value of the angle between the given shapes in radians.
9933 # @ref tui_measurement_tools_page "Example"
9934 @ManageTransactions("MeasuOp")
9935 def GetAngleRadians(self, theShape1, theShape2):
9937 Get angle between the given shapes in radians.
9940 theShape1,theShape2 Lines or linear edges to find angle between.
9944 If both arguments are vectors, the angle is computed in accordance
9945 with their orientations, otherwise the minimum angle is computed.
9948 Value of the angle between the given shapes in radians.
9950 # Example: see GEOM_TestMeasures.py
9951 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9952 RaiseIfFailed("GetAngle", self.MeasuOp)
9955 ## Get angle between the given vectors in degrees.
9956 # @param theShape1,theShape2 Vectors to find angle between.
9957 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9958 # if False, the opposite vector to the normal vector is used.
9959 # @return Value of the angle between the given vectors in degrees.
9961 # @ref tui_measurement_tools_page "Example"
9962 @ManageTransactions("MeasuOp")
9963 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9965 Get angle between the given vectors in degrees.
9968 theShape1,theShape2 Vectors to find angle between.
9969 theFlag If True, the normal vector is defined by the two vectors cross,
9970 if False, the opposite vector to the normal vector is used.
9973 Value of the angle between the given vectors in degrees.
9975 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9977 anAngle = 360. - anAngle
9978 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9981 ## The same as GetAngleVectors, but the result is in radians.
9982 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9984 Get angle between the given vectors in radians.
9987 theShape1,theShape2 Vectors to find angle between.
9988 theFlag If True, the normal vector is defined by the two vectors cross,
9989 if False, the opposite vector to the normal vector is used.
9992 Value of the angle between the given vectors in radians.
9994 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9997 ## @name Curve Curvature Measurement
9998 # Methods for receiving radius of curvature of curves
9999 # in the given point
10002 ## Measure curvature of a curve at a point, set by parameter.
10003 # @param theCurve a curve.
10004 # @param theParam parameter.
10005 # @return radius of curvature of \a theCurve.
10007 # @ref swig_todo "Example"
10008 @ManageTransactions("MeasuOp")
10009 def CurveCurvatureByParam(self, theCurve, theParam):
10011 Measure curvature of a curve at a point, set by parameter.
10015 theParam parameter.
10018 radius of curvature of theCurve.
10020 # Example: see GEOM_TestMeasures.py
10021 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10022 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10025 ## Measure curvature of a curve at a point.
10026 # @param theCurve a curve.
10027 # @param thePoint given point.
10028 # @return radius of curvature of \a theCurve.
10030 # @ref swig_todo "Example"
10031 @ManageTransactions("MeasuOp")
10032 def CurveCurvatureByPoint(self, theCurve, thePoint):
10034 Measure curvature of a curve at a point.
10038 thePoint given point.
10041 radius of curvature of theCurve.
10043 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10044 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10048 ## @name Surface Curvature Measurement
10049 # Methods for receiving max and min radius of curvature of surfaces
10050 # in the given point
10053 ## Measure max radius of curvature of surface.
10054 # @param theSurf the given surface.
10055 # @param theUParam Value of U-parameter on the referenced surface.
10056 # @param theVParam Value of V-parameter on the referenced surface.
10057 # @return max radius of curvature of theSurf.
10059 ## @ref swig_todo "Example"
10060 @ManageTransactions("MeasuOp")
10061 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10063 Measure max radius of curvature of surface.
10066 theSurf the given surface.
10067 theUParam Value of U-parameter on the referenced surface.
10068 theVParam Value of V-parameter on the referenced surface.
10071 max radius of curvature of theSurf.
10073 # Example: see GEOM_TestMeasures.py
10074 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10075 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10078 ## Measure max radius of curvature of surface in the given point
10079 # @param theSurf the given surface.
10080 # @param thePoint given point.
10081 # @return max radius of curvature of theSurf.
10083 ## @ref swig_todo "Example"
10084 @ManageTransactions("MeasuOp")
10085 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10087 Measure max radius of curvature of surface in the given point.
10090 theSurf the given surface.
10091 thePoint given point.
10094 max radius of curvature of theSurf.
10096 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10097 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10100 ## Measure min radius of curvature of surface.
10101 # @param theSurf the given surface.
10102 # @param theUParam Value of U-parameter on the referenced surface.
10103 # @param theVParam Value of V-parameter on the referenced surface.
10104 # @return min radius of curvature of theSurf.
10106 ## @ref swig_todo "Example"
10107 @ManageTransactions("MeasuOp")
10108 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10110 Measure min radius of curvature of surface.
10113 theSurf the given surface.
10114 theUParam Value of U-parameter on the referenced surface.
10115 theVParam Value of V-parameter on the referenced surface.
10118 Min radius of curvature of theSurf.
10120 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10121 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10124 ## Measure min radius of curvature of surface in the given point
10125 # @param theSurf the given surface.
10126 # @param thePoint given point.
10127 # @return min radius of curvature of theSurf.
10129 ## @ref swig_todo "Example"
10130 @ManageTransactions("MeasuOp")
10131 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10133 Measure min radius of curvature of surface in the given point.
10136 theSurf the given surface.
10137 thePoint given point.
10140 Min radius of curvature of theSurf.
10142 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10143 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10147 ## Get min and max tolerances of sub-shapes of theShape
10148 # @param theShape Shape, to get tolerances of.
10149 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10150 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10151 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10152 # VertMin,VertMax: Min and max tolerances of the vertices.
10154 # @ref tui_measurement_tools_page "Example"
10155 @ManageTransactions("MeasuOp")
10156 def Tolerance(self,theShape):
10158 Get min and max tolerances of sub-shapes of theShape
10161 theShape Shape, to get tolerances of.
10164 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10165 FaceMin,FaceMax: Min and max tolerances of the faces.
10166 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10167 VertMin,VertMax: Min and max tolerances of the vertices.
10169 # Example: see GEOM_TestMeasures.py
10170 aTuple = self.MeasuOp.GetTolerance(theShape)
10171 RaiseIfFailed("GetTolerance", self.MeasuOp)
10174 ## Obtain description of the given shape (number of sub-shapes of each type)
10175 # @param theShape Shape to be described.
10176 # @return Description of the given shape.
10178 # @ref tui_measurement_tools_page "Example"
10179 @ManageTransactions("MeasuOp")
10180 def WhatIs(self,theShape):
10182 Obtain description of the given shape (number of sub-shapes of each type)
10185 theShape Shape to be described.
10188 Description of the given shape.
10190 # Example: see GEOM_TestMeasures.py
10191 aDescr = self.MeasuOp.WhatIs(theShape)
10192 RaiseIfFailed("WhatIs", self.MeasuOp)
10195 ## Obtain quantity of shapes of the given type in \a theShape.
10196 # If \a theShape is of type \a theType, it is also counted.
10197 # @param theShape Shape to be described.
10198 # @param theType the given ShapeType().
10199 # @return Quantity of shapes of type \a theType in \a theShape.
10201 # @ref tui_measurement_tools_page "Example"
10202 def NbShapes (self, theShape, theType):
10204 Obtain quantity of shapes of the given type in theShape.
10205 If theShape is of type theType, it is also counted.
10208 theShape Shape to be described.
10209 theType the given geompy.ShapeType
10212 Quantity of shapes of type theType in theShape.
10214 # Example: see GEOM_TestMeasures.py
10215 listSh = self.SubShapeAllIDs(theShape, theType)
10219 ## Obtain quantity of shapes of each type in \a theShape.
10220 # The \a theShape is also counted.
10221 # @param theShape Shape to be described.
10222 # @return Dictionary of ShapeType() with bound quantities of shapes.
10224 # @ref tui_measurement_tools_page "Example"
10225 def ShapeInfo (self, theShape):
10227 Obtain quantity of shapes of each type in theShape.
10228 The theShape is also counted.
10231 theShape Shape to be described.
10234 Dictionary of geompy.ShapeType with bound quantities of shapes.
10236 # Example: see GEOM_TestMeasures.py
10238 for typeSh in self.ShapeType:
10239 if typeSh in ( "AUTO", "SHAPE" ): continue
10240 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10246 def GetCreationInformation(self, theShape):
10247 info = theShape.GetCreationInformation()
10249 opName = info.operationName
10250 if not opName: opName = "no info available"
10251 res = "Operation: " + opName
10253 for parVal in info.params:
10254 res += " \n %s = %s" % ( parVal.name, parVal.value )
10257 ## Get a point, situated at the centre of mass of theShape.
10258 # @param theShape Shape to define centre of mass of.
10259 # @param theName Object name; when specified, this parameter is used
10260 # for result publication in the study. Otherwise, if automatic
10261 # publication is switched on, default value is used for result name.
10263 # @return New GEOM.GEOM_Object, containing the created point.
10265 # @ref tui_measurement_tools_page "Example"
10266 @ManageTransactions("MeasuOp")
10267 def MakeCDG(self, theShape, theName=None):
10269 Get a point, situated at the centre of mass of theShape.
10272 theShape Shape to define centre of mass of.
10273 theName Object name; when specified, this parameter is used
10274 for result publication in the study. Otherwise, if automatic
10275 publication is switched on, default value is used for result name.
10278 New GEOM.GEOM_Object, containing the created point.
10280 # Example: see GEOM_TestMeasures.py
10281 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10282 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10283 self._autoPublish(anObj, theName, "centerOfMass")
10286 ## Get a vertex sub-shape by index depended with orientation.
10287 # @param theShape Shape to find sub-shape.
10288 # @param theIndex Index to find vertex by this index (starting from zero)
10289 # @param theName Object name; when specified, this parameter is used
10290 # for result publication in the study. Otherwise, if automatic
10291 # publication is switched on, default value is used for result name.
10293 # @return New GEOM.GEOM_Object, containing the created vertex.
10295 # @ref tui_measurement_tools_page "Example"
10296 @ManageTransactions("MeasuOp")
10297 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10299 Get a vertex sub-shape by index depended with orientation.
10302 theShape Shape to find sub-shape.
10303 theIndex Index to find vertex by this index (starting from zero)
10304 theName Object name; when specified, this parameter is used
10305 for result publication in the study. Otherwise, if automatic
10306 publication is switched on, default value is used for result name.
10309 New GEOM.GEOM_Object, containing the created vertex.
10311 # Example: see GEOM_TestMeasures.py
10312 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10313 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10314 self._autoPublish(anObj, theName, "vertex")
10317 ## Get the first vertex of wire/edge depended orientation.
10318 # @param theShape Shape to find first vertex.
10319 # @param theName Object name; when specified, this parameter is used
10320 # for result publication in the study. Otherwise, if automatic
10321 # publication is switched on, default value is used for result name.
10323 # @return New GEOM.GEOM_Object, containing the created vertex.
10325 # @ref tui_measurement_tools_page "Example"
10326 def GetFirstVertex(self, theShape, theName=None):
10328 Get the first vertex of wire/edge depended orientation.
10331 theShape Shape to find first vertex.
10332 theName Object name; when specified, this parameter is used
10333 for result publication in the study. Otherwise, if automatic
10334 publication is switched on, default value is used for result name.
10337 New GEOM.GEOM_Object, containing the created vertex.
10339 # Example: see GEOM_TestMeasures.py
10340 # note: auto-publishing is done in self.GetVertexByIndex()
10341 return self.GetVertexByIndex(theShape, 0, theName)
10343 ## Get the last vertex of wire/edge depended orientation.
10344 # @param theShape Shape to find last vertex.
10345 # @param theName Object name; when specified, this parameter is used
10346 # for result publication in the study. Otherwise, if automatic
10347 # publication is switched on, default value is used for result name.
10349 # @return New GEOM.GEOM_Object, containing the created vertex.
10351 # @ref tui_measurement_tools_page "Example"
10352 def GetLastVertex(self, theShape, theName=None):
10354 Get the last vertex of wire/edge depended orientation.
10357 theShape Shape to find last vertex.
10358 theName Object name; when specified, this parameter is used
10359 for result publication in the study. Otherwise, if automatic
10360 publication is switched on, default value is used for result name.
10363 New GEOM.GEOM_Object, containing the created vertex.
10365 # Example: see GEOM_TestMeasures.py
10366 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10367 # note: auto-publishing is done in self.GetVertexByIndex()
10368 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10370 ## Get a normale to the given face. If the point is not given,
10371 # the normale is calculated at the center of mass.
10372 # @param theFace Face to define normale of.
10373 # @param theOptionalPoint Point to compute the normale at.
10374 # @param theName Object name; when specified, this parameter is used
10375 # for result publication in the study. Otherwise, if automatic
10376 # publication is switched on, default value is used for result name.
10378 # @return New GEOM.GEOM_Object, containing the created vector.
10380 # @ref swig_todo "Example"
10381 @ManageTransactions("MeasuOp")
10382 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10384 Get a normale to the given face. If the point is not given,
10385 the normale is calculated at the center of mass.
10388 theFace Face to define normale of.
10389 theOptionalPoint Point to compute the normale at.
10390 theName Object name; when specified, this parameter is used
10391 for result publication in the study. Otherwise, if automatic
10392 publication is switched on, default value is used for result name.
10395 New GEOM.GEOM_Object, containing the created vector.
10397 # Example: see GEOM_TestMeasures.py
10398 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10399 RaiseIfFailed("GetNormal", self.MeasuOp)
10400 self._autoPublish(anObj, theName, "normal")
10403 ## Print shape errors obtained from CheckShape.
10404 # @param theShape Shape that was checked.
10405 # @param theShapeErrors the shape errors obtained by CheckShape.
10406 # @param theReturnStatus If 0 the description of problem is printed.
10407 # If 1 the description of problem is returned.
10408 # @return If theReturnStatus is equal to 1 the description is returned.
10409 # Otherwise doesn't return anything.
10411 # @ref tui_measurement_tools_page "Example"
10412 @ManageTransactions("MeasuOp")
10413 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10415 Print shape errors obtained from CheckShape.
10418 theShape Shape that was checked.
10419 theShapeErrors the shape errors obtained by CheckShape.
10420 theReturnStatus If 0 the description of problem is printed.
10421 If 1 the description of problem is returned.
10424 If theReturnStatus is equal to 1 the description is returned.
10425 Otherwise doesn't return anything.
10427 # Example: see GEOM_TestMeasures.py
10428 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10429 if theReturnStatus == 1:
10434 ## Check a topology of the given shape.
10435 # @param theShape Shape to check validity of.
10436 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10437 # if TRUE, the shape's geometry will be checked also.
10438 # @param theReturnStatus If 0 and if theShape is invalid, a description
10439 # of problem is printed.
10440 # If 1 isValid flag and the description of
10441 # problem is returned.
10442 # If 2 isValid flag and the list of error data
10444 # @return TRUE, if the shape "seems to be valid".
10445 # If theShape is invalid, prints a description of problem.
10446 # If theReturnStatus is equal to 1 the description is returned
10447 # along with IsValid flag.
10448 # If theReturnStatus is equal to 2 the list of error data is
10449 # returned along with IsValid flag.
10451 # @ref tui_measurement_tools_page "Example"
10452 @ManageTransactions("MeasuOp")
10453 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10455 Check a topology of the given shape.
10458 theShape Shape to check validity of.
10459 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10460 if TRUE, the shape's geometry will be checked also.
10461 theReturnStatus If 0 and if theShape is invalid, a description
10462 of problem is printed.
10463 If 1 IsValid flag and the description of
10464 problem is returned.
10465 If 2 IsValid flag and the list of error data
10469 TRUE, if the shape "seems to be valid".
10470 If theShape is invalid, prints a description of problem.
10471 If theReturnStatus is equal to 1 the description is returned
10472 along with IsValid flag.
10473 If theReturnStatus is equal to 2 the list of error data is
10474 returned along with IsValid flag.
10476 # Example: see GEOM_TestMeasures.py
10478 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10479 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10481 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10482 RaiseIfFailed("CheckShape", self.MeasuOp)
10484 if theReturnStatus == 0:
10485 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10487 if theReturnStatus == 1:
10488 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10489 return (IsValid, Descr)
10490 elif theReturnStatus == 2:
10491 return (IsValid, ShapeErrors)
10494 ## Detect self-intersections in the given shape.
10495 # @param theShape Shape to check.
10496 # @return TRUE, if the shape contains no self-intersections.
10498 # @ref tui_measurement_tools_page "Example"
10499 @ManageTransactions("MeasuOp")
10500 def CheckSelfIntersections(self, theShape):
10502 Detect self-intersections in the given shape.
10505 theShape Shape to check.
10508 TRUE, if the shape contains no self-intersections.
10510 # Example: see GEOM_TestMeasures.py
10511 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10512 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10515 ## Get position (LCS) of theShape.
10517 # Origin of the LCS is situated at the shape's center of mass.
10518 # Axes of the LCS are obtained from shape's location or,
10519 # if the shape is a planar face, from position of its plane.
10521 # @param theShape Shape to calculate position of.
10522 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10523 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10524 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10525 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10527 # @ref swig_todo "Example"
10528 @ManageTransactions("MeasuOp")
10529 def GetPosition(self,theShape):
10531 Get position (LCS) of theShape.
10532 Origin of the LCS is situated at the shape's center of mass.
10533 Axes of the LCS are obtained from shape's location or,
10534 if the shape is a planar face, from position of its plane.
10537 theShape Shape to calculate position of.
10540 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10541 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10542 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10543 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10545 # Example: see GEOM_TestMeasures.py
10546 aTuple = self.MeasuOp.GetPosition(theShape)
10547 RaiseIfFailed("GetPosition", self.MeasuOp)
10550 ## Get kind of theShape.
10552 # @param theShape Shape to get a kind of.
10553 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10554 # and a list of parameters, describing the shape.
10555 # @note Concrete meaning of each value, returned via \a theIntegers
10556 # or \a theDoubles list depends on the kind() of the shape.
10558 # @ref swig_todo "Example"
10559 @ManageTransactions("MeasuOp")
10560 def KindOfShape(self,theShape):
10562 Get kind of theShape.
10565 theShape Shape to get a kind of.
10568 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10569 and a list of parameters, describing the shape.
10571 Concrete meaning of each value, returned via theIntegers
10572 or theDoubles list depends on the geompy.kind of the shape
10574 # Example: see GEOM_TestMeasures.py
10575 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10576 RaiseIfFailed("KindOfShape", self.MeasuOp)
10578 aKind = aRoughTuple[0]
10579 anInts = aRoughTuple[1]
10580 aDbls = aRoughTuple[2]
10582 # Now there is no exception from this rule:
10583 aKindTuple = [aKind] + aDbls + anInts
10585 # If they are we will regroup parameters for such kind of shape.
10587 #if aKind == kind.SOME_KIND:
10588 # # SOME_KIND int int double int double double
10589 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10593 ## Returns the string that describes if the shell is good for solid.
10594 # This is a support method for MakeSolid.
10596 # @param theShell the shell to be checked.
10597 # @return Returns a string that describes the shell validity for
10598 # solid construction.
10599 @ManageTransactions("MeasuOp")
10600 def _IsGoodForSolid(self, theShell):
10602 Returns the string that describes if the shell is good for solid.
10603 This is a support method for MakeSolid.
10606 theShell the shell to be checked.
10609 Returns a string that describes the shell validity for
10610 solid construction.
10612 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10615 # end of l2_measure
10618 ## @addtogroup l2_import_export
10621 ## Import a shape from the BREP or IGES or STEP file
10622 # (depends on given format) with given name.
10623 # @param theFileName The file, containing the shape.
10624 # @param theFormatName Specify format for the file reading.
10625 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10626 # If format 'IGES_SCALE' is used instead of 'IGES' or
10627 # format 'STEP_SCALE' is used instead of 'STEP',
10628 # length unit will be set to 'meter' and result model will be scaled.
10629 # @param theName Object name; when specified, this parameter is used
10630 # for result publication in the study. Otherwise, if automatic
10631 # publication is switched on, default value is used for result name.
10633 # @return New GEOM.GEOM_Object, containing the imported shape.
10634 # If material names are imported it returns the list of
10635 # objects. The first one is the imported object followed by
10637 # @note Auto publishing is allowed for the shape itself. Imported
10638 # material groups are not automatically published.
10640 # @ref swig_Import_Export "Example"
10641 @ManageTransactions("InsertOp")
10642 def ImportFile(self, theFileName, theFormatName, theName=None):
10644 Import a shape from the BREP or IGES or STEP file
10645 (depends on given format) with given name.
10648 theFileName The file, containing the shape.
10649 theFormatName Specify format for the file reading.
10650 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10651 If format 'IGES_SCALE' is used instead of 'IGES' or
10652 format 'STEP_SCALE' is used instead of 'STEP',
10653 length unit will be set to 'meter' and result model will be scaled.
10654 theName Object name; when specified, this parameter is used
10655 for result publication in the study. Otherwise, if automatic
10656 publication is switched on, default value is used for result name.
10659 New GEOM.GEOM_Object, containing the imported shape.
10660 If material names are imported it returns the list of
10661 objects. The first one is the imported object followed by
10664 Auto publishing is allowed for the shape itself. Imported
10665 material groups are not automatically published.
10667 # Example: see GEOM_TestOthers.py
10668 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10669 RaiseIfFailed("ImportFile", self.InsertOp)
10670 aNbObj = len(aListObj)
10672 self._autoPublish(aListObj[0], theName, "imported")
10677 ## Deprecated analog of ImportFile()
10678 def Import(self, theFileName, theFormatName, theName=None):
10680 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10682 print "WARNING: Function Import is deprecated, use ImportFile instead"
10683 # note: auto-publishing is done in self.ImportFile()
10684 return self.ImportFile(theFileName, theFormatName, theName)
10686 ## Shortcut to ImportFile() for BREP format.
10687 # Import a shape from the BREP file with given name.
10688 # @param theFileName The file, containing the shape.
10689 # @param theName Object name; when specified, this parameter is used
10690 # for result publication in the study. Otherwise, if automatic
10691 # publication is switched on, default value is used for result name.
10693 # @return New GEOM.GEOM_Object, containing the imported shape.
10695 # @ref swig_Import_Export "Example"
10696 def ImportBREP(self, theFileName, theName=None):
10698 geompy.ImportFile(...) function for BREP format
10699 Import a shape from the BREP file with given name.
10702 theFileName The file, containing the shape.
10703 theName Object name; when specified, this parameter is used
10704 for result publication in the study. Otherwise, if automatic
10705 publication is switched on, default value is used for result name.
10708 New GEOM.GEOM_Object, containing the imported shape.
10710 # Example: see GEOM_TestOthers.py
10711 # note: auto-publishing is done in self.ImportFile()
10712 return self.ImportFile(theFileName, "BREP", theName)
10714 ## Shortcut to ImportFile() for IGES format
10715 # Import a shape from the IGES file with given name.
10716 # @param theFileName The file, containing the shape.
10717 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10718 # and result model will be scaled, if its units are not meters.
10719 # If False (default), file length units will be taken into account.
10720 # @param theName Object name; when specified, this parameter is used
10721 # for result publication in the study. Otherwise, if automatic
10722 # publication is switched on, default value is used for result name.
10724 # @return New GEOM.GEOM_Object, containing the imported shape.
10726 # @ref swig_Import_Export "Example"
10727 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10729 geompy.ImportFile(...) function for IGES format
10732 theFileName The file, containing the shape.
10733 ignoreUnits If True, file length units will be ignored (set to 'meter')
10734 and result model will be scaled, if its units are not meters.
10735 If False (default), file length units will be taken into account.
10736 theName Object name; when specified, this parameter is used
10737 for result publication in the study. Otherwise, if automatic
10738 publication is switched on, default value is used for result name.
10741 New GEOM.GEOM_Object, containing the imported shape.
10743 # Example: see GEOM_TestOthers.py
10744 # note: auto-publishing is done in self.ImportFile()
10746 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10747 return self.ImportFile(theFileName, "IGES", theName)
10749 ## Return length unit from given IGES file
10750 # @param theFileName The file, containing the shape.
10751 # @return String, containing the units name.
10753 # @ref swig_Import_Export "Example"
10754 @ManageTransactions("InsertOp")
10755 def GetIGESUnit(self, theFileName):
10757 Return length units from given IGES file
10760 theFileName The file, containing the shape.
10763 String, containing the units name.
10765 # Example: see GEOM_TestOthers.py
10766 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10769 ## Shortcut to ImportFile() for STEP format
10770 # Import a shape from the STEP file with given name.
10771 # @param theFileName The file, containing the shape.
10772 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10773 # and result model will be scaled, if its units are not meters.
10774 # If False (default), file length units will be taken into account.
10775 # @param theName Object name; when specified, this parameter is used
10776 # for result publication in the study. Otherwise, if automatic
10777 # publication is switched on, default value is used for result name.
10779 # @return New GEOM.GEOM_Object, containing the imported shape.
10780 # If material names are imported it returns the list of
10781 # objects. The first one is the imported object followed by
10783 # @note Auto publishing is allowed for the shape itself. Imported
10784 # material groups are not automatically published.
10786 # @ref swig_Import_Export "Example"
10787 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10789 geompy.ImportFile(...) function for STEP format
10792 theFileName The file, containing the shape.
10793 ignoreUnits If True, file length units will be ignored (set to 'meter')
10794 and result model will be scaled, if its units are not meters.
10795 If False (default), file length units will be taken into account.
10796 theName Object name; when specified, this parameter is used
10797 for result publication in the study. Otherwise, if automatic
10798 publication is switched on, default value is used for result name.
10801 New GEOM.GEOM_Object, containing the imported shape.
10802 If material names are imported it returns the list of
10803 objects. The first one is the imported object followed by
10806 Auto publishing is allowed for the shape itself. Imported
10807 material groups are not automatically published.
10809 # Example: see GEOM_TestOthers.py
10810 # note: auto-publishing is done in self.ImportFile()
10812 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10813 return self.ImportFile(theFileName, "STEP", theName)
10815 ## Return length unit from given IGES or STEP file
10816 # @param theFileName The file, containing the shape.
10817 # @return String, containing the units name.
10819 # @ref swig_Import_Export "Example"
10820 @ManageTransactions("InsertOp")
10821 def GetSTEPUnit(self, theFileName):
10823 Return length units from given STEP file
10826 theFileName The file, containing the shape.
10829 String, containing the units name.
10831 # Example: see GEOM_TestOthers.py
10832 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10835 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10836 # @note This method will not be dumped to the python script by DumpStudy functionality.
10837 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10838 # @param theStream The BRep binary stream.
10839 # @param theName Object name; when specified, this parameter is used
10840 # for result publication in the study. Otherwise, if automatic
10841 # publication is switched on, default value is used for result name.
10843 # @return New GEOM_Object, containing the shape, read from theStream.
10845 # @ref swig_Import_Export "Example"
10846 @ManageTransactions("InsertOp")
10847 def RestoreShape (self, theStream, theName=None):
10849 Read a shape from the binary stream, containing its bounding representation (BRep).
10852 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10855 theStream The BRep binary stream.
10856 theName Object name; when specified, this parameter is used
10857 for result publication in the study. Otherwise, if automatic
10858 publication is switched on, default value is used for result name.
10861 New GEOM_Object, containing the shape, read from theStream.
10863 # Example: see GEOM_TestOthers.py
10864 anObj = self.InsertOp.RestoreShape(theStream)
10865 RaiseIfFailed("RestoreShape", self.InsertOp)
10866 self._autoPublish(anObj, theName, "restored")
10869 ## Export the given shape into a file with given name.
10870 # @param theObject Shape to be stored in the file.
10871 # @param theFileName Name of the file to store the given shape in.
10872 # @param theFormatName Specify format for the shape storage.
10873 # Available formats can be obtained with
10874 # geompy.InsertOp.ExportTranslators()[0] method.
10876 # @ref swig_Import_Export "Example"
10877 @ManageTransactions("InsertOp")
10878 def Export(self, theObject, theFileName, theFormatName):
10880 Export the given shape into a file with given name.
10883 theObject Shape to be stored in the file.
10884 theFileName Name of the file to store the given shape in.
10885 theFormatName Specify format for the shape storage.
10886 Available formats can be obtained with
10887 geompy.InsertOp.ExportTranslators()[0] method.
10889 # Example: see GEOM_TestOthers.py
10890 self.InsertOp.Export(theObject, theFileName, theFormatName)
10891 if self.InsertOp.IsDone() == 0:
10892 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10896 ## Shortcut to Export() for BREP format
10898 # @ref swig_Import_Export "Example"
10899 def ExportBREP(self,theObject, theFileName):
10901 geompy.Export(...) function for BREP format
10903 # Example: see GEOM_TestOthers.py
10904 return self.Export(theObject, theFileName, "BREP")
10906 ## Shortcut to Export() for IGES format
10908 # @ref swig_Import_Export "Example"
10909 def ExportIGES(self,theObject, theFileName):
10911 geompy.Export(...) function for IGES format
10913 # Example: see GEOM_TestOthers.py
10914 return self.Export(theObject, theFileName, "IGES")
10916 ## Shortcut to Export() for STEP format
10918 # @ref swig_Import_Export "Example"
10919 def ExportSTEP(self,theObject, theFileName):
10921 geompy.Export(...) function for STEP format
10923 # Example: see GEOM_TestOthers.py
10924 return self.Export(theObject, theFileName, "STEP")
10926 # end of l2_import_export
10929 ## @addtogroup l3_blocks
10932 ## Create a quadrangle face from four edges. Order of Edges is not
10933 # important. It is not necessary that edges share the same vertex.
10934 # @param E1,E2,E3,E4 Edges for the face bound.
10935 # @param theName Object name; when specified, this parameter is used
10936 # for result publication in the study. Otherwise, if automatic
10937 # publication is switched on, default value is used for result name.
10939 # @return New GEOM.GEOM_Object, containing the created face.
10941 # @ref tui_building_by_blocks_page "Example"
10942 @ManageTransactions("BlocksOp")
10943 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10945 Create a quadrangle face from four edges. Order of Edges is not
10946 important. It is not necessary that edges share the same vertex.
10949 E1,E2,E3,E4 Edges for the face bound.
10950 theName Object name; when specified, this parameter is used
10951 for result publication in the study. Otherwise, if automatic
10952 publication is switched on, default value is used for result name.
10955 New GEOM.GEOM_Object, containing the created face.
10958 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10960 # Example: see GEOM_Spanner.py
10961 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10962 RaiseIfFailed("MakeQuad", self.BlocksOp)
10963 self._autoPublish(anObj, theName, "quad")
10966 ## Create a quadrangle face on two edges.
10967 # The missing edges will be built by creating the shortest ones.
10968 # @param E1,E2 Two opposite edges for the face.
10969 # @param theName Object name; when specified, this parameter is used
10970 # for result publication in the study. Otherwise, if automatic
10971 # publication is switched on, default value is used for result name.
10973 # @return New GEOM.GEOM_Object, containing the created face.
10975 # @ref tui_building_by_blocks_page "Example"
10976 @ManageTransactions("BlocksOp")
10977 def MakeQuad2Edges(self, E1, E2, theName=None):
10979 Create a quadrangle face on two edges.
10980 The missing edges will be built by creating the shortest ones.
10983 E1,E2 Two opposite edges for the face.
10984 theName Object name; when specified, this parameter is used
10985 for result publication in the study. Otherwise, if automatic
10986 publication is switched on, default value is used for result name.
10989 New GEOM.GEOM_Object, containing the created face.
10993 p1 = geompy.MakeVertex( 0., 0., 0.)
10994 p2 = geompy.MakeVertex(150., 30., 0.)
10995 p3 = geompy.MakeVertex( 0., 120., 50.)
10996 p4 = geompy.MakeVertex( 0., 40., 70.)
10998 edge1 = geompy.MakeEdge(p1, p2)
10999 edge2 = geompy.MakeEdge(p3, p4)
11000 # create a quadrangle face from two edges
11001 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11003 # Example: see GEOM_Spanner.py
11004 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11005 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11006 self._autoPublish(anObj, theName, "quad")
11009 ## Create a quadrangle face with specified corners.
11010 # The missing edges will be built by creating the shortest ones.
11011 # @param V1,V2,V3,V4 Corner vertices for the face.
11012 # @param theName Object name; when specified, this parameter is used
11013 # for result publication in the study. Otherwise, if automatic
11014 # publication is switched on, default value is used for result name.
11016 # @return New GEOM.GEOM_Object, containing the created face.
11018 # @ref tui_building_by_blocks_page "Example 1"
11019 # \n @ref swig_MakeQuad4Vertices "Example 2"
11020 @ManageTransactions("BlocksOp")
11021 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11023 Create a quadrangle face with specified corners.
11024 The missing edges will be built by creating the shortest ones.
11027 V1,V2,V3,V4 Corner vertices for the face.
11028 theName Object name; when specified, this parameter is used
11029 for result publication in the study. Otherwise, if automatic
11030 publication is switched on, default value is used for result name.
11033 New GEOM.GEOM_Object, containing the created face.
11037 p1 = geompy.MakeVertex( 0., 0., 0.)
11038 p2 = geompy.MakeVertex(150., 30., 0.)
11039 p3 = geompy.MakeVertex( 0., 120., 50.)
11040 p4 = geompy.MakeVertex( 0., 40., 70.)
11041 # create a quadrangle from four points in its corners
11042 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11044 # Example: see GEOM_Spanner.py
11045 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11046 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11047 self._autoPublish(anObj, theName, "quad")
11050 ## Create a hexahedral solid, bounded by the six given faces. Order of
11051 # faces is not important. It is not necessary that Faces share the same edge.
11052 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11053 # @param theName Object name; when specified, this parameter is used
11054 # for result publication in the study. Otherwise, if automatic
11055 # publication is switched on, default value is used for result name.
11057 # @return New GEOM.GEOM_Object, containing the created solid.
11059 # @ref tui_building_by_blocks_page "Example 1"
11060 # \n @ref swig_MakeHexa "Example 2"
11061 @ManageTransactions("BlocksOp")
11062 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11064 Create a hexahedral solid, bounded by the six given faces. Order of
11065 faces is not important. It is not necessary that Faces share the same edge.
11068 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11069 theName Object name; when specified, this parameter is used
11070 for result publication in the study. Otherwise, if automatic
11071 publication is switched on, default value is used for result name.
11074 New GEOM.GEOM_Object, containing the created solid.
11077 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11079 # Example: see GEOM_Spanner.py
11080 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11081 RaiseIfFailed("MakeHexa", self.BlocksOp)
11082 self._autoPublish(anObj, theName, "hexa")
11085 ## Create a hexahedral solid between two given faces.
11086 # The missing faces will be built by creating the smallest ones.
11087 # @param F1,F2 Two opposite faces for the hexahedral solid.
11088 # @param theName Object name; when specified, this parameter is used
11089 # for result publication in the study. Otherwise, if automatic
11090 # publication is switched on, default value is used for result name.
11092 # @return New GEOM.GEOM_Object, containing the created solid.
11094 # @ref tui_building_by_blocks_page "Example 1"
11095 # \n @ref swig_MakeHexa2Faces "Example 2"
11096 @ManageTransactions("BlocksOp")
11097 def MakeHexa2Faces(self, F1, F2, theName=None):
11099 Create a hexahedral solid between two given faces.
11100 The missing faces will be built by creating the smallest ones.
11103 F1,F2 Two opposite faces for the hexahedral solid.
11104 theName Object name; when specified, this parameter is used
11105 for result publication in the study. Otherwise, if automatic
11106 publication is switched on, default value is used for result name.
11109 New GEOM.GEOM_Object, containing the created solid.
11112 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11114 # Example: see GEOM_Spanner.py
11115 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11116 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11117 self._autoPublish(anObj, theName, "hexa")
11123 ## @addtogroup l3_blocks_op
11126 ## Get a vertex, found in the given shape by its coordinates.
11127 # @param theShape Block or a compound of blocks.
11128 # @param theX,theY,theZ Coordinates of the sought vertex.
11129 # @param theEpsilon Maximum allowed distance between the resulting
11130 # vertex and point with the given coordinates.
11131 # @param theName Object name; when specified, this parameter is used
11132 # for result publication in the study. Otherwise, if automatic
11133 # publication is switched on, default value is used for result name.
11135 # @return New GEOM.GEOM_Object, containing the found vertex.
11137 # @ref swig_GetPoint "Example"
11138 @ManageTransactions("BlocksOp")
11139 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11141 Get a vertex, found in the given shape by its coordinates.
11144 theShape Block or a compound of blocks.
11145 theX,theY,theZ Coordinates of the sought vertex.
11146 theEpsilon Maximum allowed distance between the resulting
11147 vertex and point with the given coordinates.
11148 theName Object name; when specified, this parameter is used
11149 for result publication in the study. Otherwise, if automatic
11150 publication is switched on, default value is used for result name.
11153 New GEOM.GEOM_Object, containing the found vertex.
11156 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11158 # Example: see GEOM_TestOthers.py
11159 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11160 RaiseIfFailed("GetPoint", self.BlocksOp)
11161 self._autoPublish(anObj, theName, "vertex")
11164 ## Find a vertex of the given shape, which has minimal distance to the given point.
11165 # @param theShape Any shape.
11166 # @param thePoint Point, close to the desired vertex.
11167 # @param theName Object name; when specified, this parameter is used
11168 # for result publication in the study. Otherwise, if automatic
11169 # publication is switched on, default value is used for result name.
11171 # @return New GEOM.GEOM_Object, containing the found vertex.
11173 # @ref swig_GetVertexNearPoint "Example"
11174 @ManageTransactions("BlocksOp")
11175 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11177 Find a vertex of the given shape, which has minimal distance to the given point.
11180 theShape Any shape.
11181 thePoint Point, close to the desired vertex.
11182 theName Object name; when specified, this parameter is used
11183 for result publication in the study. Otherwise, if automatic
11184 publication is switched on, default value is used for result name.
11187 New GEOM.GEOM_Object, containing the found vertex.
11190 pmidle = geompy.MakeVertex(50, 0, 50)
11191 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11193 # Example: see GEOM_TestOthers.py
11194 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11195 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11196 self._autoPublish(anObj, theName, "vertex")
11199 ## Get an edge, found in the given shape by two given vertices.
11200 # @param theShape Block or a compound of blocks.
11201 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11202 # @param theName Object name; when specified, this parameter is used
11203 # for result publication in the study. Otherwise, if automatic
11204 # publication is switched on, default value is used for result name.
11206 # @return New GEOM.GEOM_Object, containing the found edge.
11208 # @ref swig_GetEdge "Example"
11209 @ManageTransactions("BlocksOp")
11210 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11212 Get an edge, found in the given shape by two given vertices.
11215 theShape Block or a compound of blocks.
11216 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11217 theName Object name; when specified, this parameter is used
11218 for result publication in the study. Otherwise, if automatic
11219 publication is switched on, default value is used for result name.
11222 New GEOM.GEOM_Object, containing the found edge.
11224 # Example: see GEOM_Spanner.py
11225 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11226 RaiseIfFailed("GetEdge", self.BlocksOp)
11227 self._autoPublish(anObj, theName, "edge")
11230 ## Find an edge of the given shape, which has minimal distance to the given point.
11231 # @param theShape Block or a compound of blocks.
11232 # @param thePoint Point, close to the desired edge.
11233 # @param theName Object name; when specified, this parameter is used
11234 # for result publication in the study. Otherwise, if automatic
11235 # publication is switched on, default value is used for result name.
11237 # @return New GEOM.GEOM_Object, containing the found edge.
11239 # @ref swig_GetEdgeNearPoint "Example"
11240 @ManageTransactions("BlocksOp")
11241 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11243 Find an edge of the given shape, which has minimal distance to the given point.
11246 theShape Block or a compound of blocks.
11247 thePoint Point, close to the desired edge.
11248 theName Object name; when specified, this parameter is used
11249 for result publication in the study. Otherwise, if automatic
11250 publication is switched on, default value is used for result name.
11253 New GEOM.GEOM_Object, containing the found edge.
11255 # Example: see GEOM_TestOthers.py
11256 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11257 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11258 self._autoPublish(anObj, theName, "edge")
11261 ## Returns a face, found in the given shape by four given corner vertices.
11262 # @param theShape Block or a compound of blocks.
11263 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11264 # @param theName Object name; when specified, this parameter is used
11265 # for result publication in the study. Otherwise, if automatic
11266 # publication is switched on, default value is used for result name.
11268 # @return New GEOM.GEOM_Object, containing the found face.
11270 # @ref swig_todo "Example"
11271 @ManageTransactions("BlocksOp")
11272 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11274 Returns a face, found in the given shape by four given corner vertices.
11277 theShape Block or a compound of blocks.
11278 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11279 theName Object name; when specified, this parameter is used
11280 for result publication in the study. Otherwise, if automatic
11281 publication is switched on, default value is used for result name.
11284 New GEOM.GEOM_Object, containing the found face.
11286 # Example: see GEOM_Spanner.py
11287 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11288 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11289 self._autoPublish(anObj, theName, "face")
11292 ## Get a face of block, found in the given shape by two given edges.
11293 # @param theShape Block or a compound of blocks.
11294 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11295 # @param theName Object name; when specified, this parameter is used
11296 # for result publication in the study. Otherwise, if automatic
11297 # publication is switched on, default value is used for result name.
11299 # @return New GEOM.GEOM_Object, containing the found face.
11301 # @ref swig_todo "Example"
11302 @ManageTransactions("BlocksOp")
11303 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11305 Get a face of block, found in the given shape by two given edges.
11308 theShape Block or a compound of blocks.
11309 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11310 theName Object name; when specified, this parameter is used
11311 for result publication in the study. Otherwise, if automatic
11312 publication is switched on, default value is used for result name.
11315 New GEOM.GEOM_Object, containing the found face.
11317 # Example: see GEOM_Spanner.py
11318 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11319 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11320 self._autoPublish(anObj, theName, "face")
11323 ## Find a face, opposite to the given one in the given block.
11324 # @param theBlock Must be a hexahedral solid.
11325 # @param theFace Face of \a theBlock, opposite to the desired face.
11326 # @param theName Object name; when specified, this parameter is used
11327 # for result publication in the study. Otherwise, if automatic
11328 # publication is switched on, default value is used for result name.
11330 # @return New GEOM.GEOM_Object, containing the found face.
11332 # @ref swig_GetOppositeFace "Example"
11333 @ManageTransactions("BlocksOp")
11334 def GetOppositeFace(self, theBlock, theFace, theName=None):
11336 Find a face, opposite to the given one in the given block.
11339 theBlock Must be a hexahedral solid.
11340 theFace Face of theBlock, opposite to the desired face.
11341 theName Object name; when specified, this parameter is used
11342 for result publication in the study. Otherwise, if automatic
11343 publication is switched on, default value is used for result name.
11346 New GEOM.GEOM_Object, containing the found face.
11348 # Example: see GEOM_Spanner.py
11349 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11350 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11351 self._autoPublish(anObj, theName, "face")
11354 ## Find a face of the given shape, which has minimal distance to the given point.
11355 # @param theShape Block or a compound of blocks.
11356 # @param thePoint Point, close to the desired face.
11357 # @param theName Object name; when specified, this parameter is used
11358 # for result publication in the study. Otherwise, if automatic
11359 # publication is switched on, default value is used for result name.
11361 # @return New GEOM.GEOM_Object, containing the found face.
11363 # @ref swig_GetFaceNearPoint "Example"
11364 @ManageTransactions("BlocksOp")
11365 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11367 Find a face of the given shape, which has minimal distance to the given point.
11370 theShape Block or a compound of blocks.
11371 thePoint Point, close to the desired face.
11372 theName Object name; when specified, this parameter is used
11373 for result publication in the study. Otherwise, if automatic
11374 publication is switched on, default value is used for result name.
11377 New GEOM.GEOM_Object, containing the found face.
11379 # Example: see GEOM_Spanner.py
11380 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11381 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11382 self._autoPublish(anObj, theName, "face")
11385 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11386 # @param theBlock Block or a compound of blocks.
11387 # @param theVector Vector, close to the normale of the desired face.
11388 # @param theName Object name; when specified, this parameter is used
11389 # for result publication in the study. Otherwise, if automatic
11390 # publication is switched on, default value is used for result name.
11392 # @return New GEOM.GEOM_Object, containing the found face.
11394 # @ref swig_todo "Example"
11395 @ManageTransactions("BlocksOp")
11396 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11398 Find a face of block, whose outside normale has minimal angle with the given vector.
11401 theBlock Block or a compound of blocks.
11402 theVector Vector, close to the normale of the desired face.
11403 theName Object name; when specified, this parameter is used
11404 for result publication in the study. Otherwise, if automatic
11405 publication is switched on, default value is used for result name.
11408 New GEOM.GEOM_Object, containing the found face.
11410 # Example: see GEOM_Spanner.py
11411 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11412 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11413 self._autoPublish(anObj, theName, "face")
11416 ## Find all sub-shapes of type \a theShapeType of the given shape,
11417 # which have minimal distance to the given point.
11418 # @param theShape Any shape.
11419 # @param thePoint Point, close to the desired shape.
11420 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11421 # @param theTolerance The tolerance for distances comparison. All shapes
11422 # with distances to the given point in interval
11423 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11424 # @param theName Object name; when specified, this parameter is used
11425 # for result publication in the study. Otherwise, if automatic
11426 # publication is switched on, default value is used for result name.
11428 # @return New GEOM_Object, containing a group of all found shapes.
11430 # @ref swig_GetShapesNearPoint "Example"
11431 @ManageTransactions("BlocksOp")
11432 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11434 Find all sub-shapes of type theShapeType of the given shape,
11435 which have minimal distance to the given point.
11438 theShape Any shape.
11439 thePoint Point, close to the desired shape.
11440 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11441 theTolerance The tolerance for distances comparison. All shapes
11442 with distances to the given point in interval
11443 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11444 theName Object name; when specified, this parameter is used
11445 for result publication in the study. Otherwise, if automatic
11446 publication is switched on, default value is used for result name.
11449 New GEOM_Object, containing a group of all found shapes.
11451 # Example: see GEOM_TestOthers.py
11452 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11453 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11454 self._autoPublish(anObj, theName, "group")
11457 # end of l3_blocks_op
11460 ## @addtogroup l4_blocks_measure
11463 ## Check, if the compound of blocks is given.
11464 # To be considered as a compound of blocks, the
11465 # given shape must satisfy the following conditions:
11466 # - Each element of the compound should be a Block (6 faces and 12 edges).
11467 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11468 # - The compound should be connexe.
11469 # - The glue between two quadrangle faces should be applied.
11470 # @param theCompound The compound to check.
11471 # @return TRUE, if the given shape is a compound of blocks.
11472 # If theCompound is not valid, prints all discovered errors.
11474 # @ref tui_measurement_tools_page "Example 1"
11475 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11476 @ManageTransactions("BlocksOp")
11477 def CheckCompoundOfBlocks(self,theCompound):
11479 Check, if the compound of blocks is given.
11480 To be considered as a compound of blocks, the
11481 given shape must satisfy the following conditions:
11482 - Each element of the compound should be a Block (6 faces and 12 edges).
11483 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11484 - The compound should be connexe.
11485 - The glue between two quadrangle faces should be applied.
11488 theCompound The compound to check.
11491 TRUE, if the given shape is a compound of blocks.
11492 If theCompound is not valid, prints all discovered errors.
11494 # Example: see GEOM_Spanner.py
11495 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11496 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11498 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11502 ## Retrieve all non blocks solids and faces from \a theShape.
11503 # @param theShape The shape to explore.
11504 # @param theName Object name; when specified, this parameter is used
11505 # for result publication in the study. Otherwise, if automatic
11506 # publication is switched on, default value is used for result name.
11508 # @return A tuple of two GEOM_Objects. The first object is a group of all
11509 # non block solids (= not 6 faces, or with 6 faces, but with the
11510 # presence of non-quadrangular faces). The second object is a
11511 # group of all non quadrangular faces.
11513 # @ref tui_measurement_tools_page "Example 1"
11514 # \n @ref swig_GetNonBlocks "Example 2"
11515 @ManageTransactions("BlocksOp")
11516 def GetNonBlocks (self, theShape, theName=None):
11518 Retrieve all non blocks solids and faces from theShape.
11521 theShape The shape to explore.
11522 theName Object name; when specified, this parameter is used
11523 for result publication in the study. Otherwise, if automatic
11524 publication is switched on, default value is used for result name.
11527 A tuple of two GEOM_Objects. The first object is a group of all
11528 non block solids (= not 6 faces, or with 6 faces, but with the
11529 presence of non-quadrangular faces). The second object is a
11530 group of all non quadrangular faces.
11533 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11535 # Example: see GEOM_Spanner.py
11536 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11537 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11538 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11541 ## Remove all seam and degenerated edges from \a theShape.
11542 # Unite faces and edges, sharing one surface. It means that
11543 # this faces must have references to one C++ surface object (handle).
11544 # @param theShape The compound or single solid to remove irregular edges from.
11545 # @param doUnionFaces If True, then unite faces. If False (the default value),
11546 # do not unite faces.
11547 # @param theName Object name; when specified, this parameter is used
11548 # for result publication in the study. Otherwise, if automatic
11549 # publication is switched on, default value is used for result name.
11551 # @return Improved shape.
11553 # @ref swig_RemoveExtraEdges "Example"
11554 @ManageTransactions("BlocksOp")
11555 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11557 Remove all seam and degenerated edges from theShape.
11558 Unite faces and edges, sharing one surface. It means that
11559 this faces must have references to one C++ surface object (handle).
11562 theShape The compound or single solid to remove irregular edges from.
11563 doUnionFaces If True, then unite faces. If False (the default value),
11564 do not unite faces.
11565 theName Object name; when specified, this parameter is used
11566 for result publication in the study. Otherwise, if automatic
11567 publication is switched on, default value is used for result name.
11572 # Example: see GEOM_TestOthers.py
11573 nbFacesOptimum = -1 # -1 means do not unite faces
11574 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11575 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11576 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11577 self._autoPublish(anObj, theName, "removeExtraEdges")
11580 ## Performs union faces of \a theShape
11581 # Unite faces sharing one surface. It means that
11582 # these faces must have references to one C++ surface object (handle).
11583 # @param theShape The compound or single solid that contains faces
11584 # to perform union.
11585 # @param theName Object name; when specified, this parameter is used
11586 # for result publication in the study. Otherwise, if automatic
11587 # publication is switched on, default value is used for result name.
11589 # @return Improved shape.
11591 # @ref swig_UnionFaces "Example"
11592 @ManageTransactions("BlocksOp")
11593 def UnionFaces(self, theShape, theName=None):
11595 Performs union faces of theShape.
11596 Unite faces sharing one surface. It means that
11597 these faces must have references to one C++ surface object (handle).
11600 theShape The compound or single solid that contains faces
11602 theName Object name; when specified, this parameter is used
11603 for result publication in the study. Otherwise, if automatic
11604 publication is switched on, default value is used for result name.
11609 # Example: see GEOM_TestOthers.py
11610 anObj = self.BlocksOp.UnionFaces(theShape)
11611 RaiseIfFailed("UnionFaces", self.BlocksOp)
11612 self._autoPublish(anObj, theName, "unionFaces")
11615 ## Check, if the given shape is a blocks compound.
11616 # Fix all detected errors.
11617 # \note Single block can be also fixed by this method.
11618 # @param theShape The compound to check and improve.
11619 # @param theName Object name; when specified, this parameter is used
11620 # for result publication in the study. Otherwise, if automatic
11621 # publication is switched on, default value is used for result name.
11623 # @return Improved compound.
11625 # @ref swig_CheckAndImprove "Example"
11626 @ManageTransactions("BlocksOp")
11627 def CheckAndImprove(self, theShape, theName=None):
11629 Check, if the given shape is a blocks compound.
11630 Fix all detected errors.
11633 Single block can be also fixed by this method.
11636 theShape The compound to check and improve.
11637 theName Object name; when specified, this parameter is used
11638 for result publication in the study. Otherwise, if automatic
11639 publication is switched on, default value is used for result name.
11644 # Example: see GEOM_TestOthers.py
11645 anObj = self.BlocksOp.CheckAndImprove(theShape)
11646 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11647 self._autoPublish(anObj, theName, "improved")
11650 # end of l4_blocks_measure
11653 ## @addtogroup l3_blocks_op
11656 ## Get all the blocks, contained in the given compound.
11657 # @param theCompound The compound to explode.
11658 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11659 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11660 # @param theName Object name; when specified, this parameter is used
11661 # for result publication in the study. Otherwise, if automatic
11662 # publication is switched on, default value is used for result name.
11664 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11666 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11668 # @ref tui_explode_on_blocks "Example 1"
11669 # \n @ref swig_MakeBlockExplode "Example 2"
11670 @ManageTransactions("BlocksOp")
11671 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11673 Get all the blocks, contained in the given compound.
11676 theCompound The compound to explode.
11677 theMinNbFaces If solid has lower number of faces, it is not a block.
11678 theMaxNbFaces If solid has higher number of faces, it is not a block.
11679 theName Object name; when specified, this parameter is used
11680 for result publication in the study. Otherwise, if automatic
11681 publication is switched on, default value is used for result name.
11684 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11687 List of GEOM.GEOM_Object, containing the retrieved blocks.
11689 # Example: see GEOM_TestOthers.py
11690 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11691 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11692 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11693 for anObj in aList:
11694 anObj.SetParameters(Parameters)
11696 self._autoPublish(aList, theName, "block")
11699 ## Find block, containing the given point inside its volume or on boundary.
11700 # @param theCompound Compound, to find block in.
11701 # @param thePoint Point, close to the desired block. If the point lays on
11702 # boundary between some blocks, we return block with nearest center.
11703 # @param theName Object name; when specified, this parameter is used
11704 # for result publication in the study. Otherwise, if automatic
11705 # publication is switched on, default value is used for result name.
11707 # @return New GEOM.GEOM_Object, containing the found block.
11709 # @ref swig_todo "Example"
11710 @ManageTransactions("BlocksOp")
11711 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11713 Find block, containing the given point inside its volume or on boundary.
11716 theCompound Compound, to find block in.
11717 thePoint Point, close to the desired block. If the point lays on
11718 boundary between some blocks, we return block with nearest center.
11719 theName Object name; when specified, this parameter is used
11720 for result publication in the study. Otherwise, if automatic
11721 publication is switched on, default value is used for result name.
11724 New GEOM.GEOM_Object, containing the found block.
11726 # Example: see GEOM_Spanner.py
11727 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11728 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11729 self._autoPublish(anObj, theName, "block")
11732 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11733 # @param theCompound Compound, to find block in.
11734 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11735 # @param theName Object name; when specified, this parameter is used
11736 # for result publication in the study. Otherwise, if automatic
11737 # publication is switched on, default value is used for result name.
11739 # @return New GEOM.GEOM_Object, containing the found block.
11741 # @ref swig_GetBlockByParts "Example"
11742 @ManageTransactions("BlocksOp")
11743 def GetBlockByParts(self, theCompound, theParts, theName=None):
11745 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11748 theCompound Compound, to find block in.
11749 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11750 theName Object name; when specified, this parameter is used
11751 for result publication in the study. Otherwise, if automatic
11752 publication is switched on, default value is used for result name.
11755 New GEOM_Object, containing the found block.
11757 # Example: see GEOM_TestOthers.py
11758 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11759 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11760 self._autoPublish(anObj, theName, "block")
11763 ## Return all blocks, containing all the elements, passed as the parts.
11764 # @param theCompound Compound, to find blocks in.
11765 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11766 # @param theName Object name; when specified, this parameter is used
11767 # for result publication in the study. Otherwise, if automatic
11768 # publication is switched on, default value is used for result name.
11770 # @return List of GEOM.GEOM_Object, containing the found blocks.
11772 # @ref swig_todo "Example"
11773 @ManageTransactions("BlocksOp")
11774 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11776 Return all blocks, containing all the elements, passed as the parts.
11779 theCompound Compound, to find blocks in.
11780 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11781 theName Object name; when specified, this parameter is used
11782 for result publication in the study. Otherwise, if automatic
11783 publication is switched on, default value is used for result name.
11786 List of GEOM.GEOM_Object, containing the found blocks.
11788 # Example: see GEOM_Spanner.py
11789 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11790 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11791 self._autoPublish(aList, theName, "block")
11794 ## Multi-transformate block and glue the result.
11795 # Transformation is defined so, as to superpose direction faces.
11796 # @param Block Hexahedral solid to be multi-transformed.
11797 # @param DirFace1 ID of First direction face.
11798 # @param DirFace2 ID of Second direction face.
11799 # @param NbTimes Quantity of transformations to be done.
11800 # @param theName Object name; when specified, this parameter is used
11801 # for result publication in the study. Otherwise, if automatic
11802 # publication is switched on, default value is used for result name.
11804 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11806 # @return New GEOM.GEOM_Object, containing the result shape.
11808 # @ref tui_multi_transformation "Example"
11809 @ManageTransactions("BlocksOp")
11810 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11812 Multi-transformate block and glue the result.
11813 Transformation is defined so, as to superpose direction faces.
11816 Block Hexahedral solid to be multi-transformed.
11817 DirFace1 ID of First direction face.
11818 DirFace2 ID of Second direction face.
11819 NbTimes Quantity of transformations to be done.
11820 theName Object name; when specified, this parameter is used
11821 for result publication in the study. Otherwise, if automatic
11822 publication is switched on, default value is used for result name.
11825 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11828 New GEOM.GEOM_Object, containing the result shape.
11830 # Example: see GEOM_Spanner.py
11831 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11832 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11833 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11834 anObj.SetParameters(Parameters)
11835 self._autoPublish(anObj, theName, "transformed")
11838 ## Multi-transformate block and glue the result.
11839 # @param Block Hexahedral solid to be multi-transformed.
11840 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11841 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11842 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11843 # @param theName Object name; when specified, this parameter is used
11844 # for result publication in the study. Otherwise, if automatic
11845 # publication is switched on, default value is used for result name.
11847 # @return New GEOM.GEOM_Object, containing the result shape.
11849 # @ref tui_multi_transformation "Example"
11850 @ManageTransactions("BlocksOp")
11851 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11852 DirFace1V, DirFace2V, NbTimesV, theName=None):
11854 Multi-transformate block and glue the result.
11857 Block Hexahedral solid to be multi-transformed.
11858 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11859 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11860 NbTimesU,NbTimesV Quantity of transformations to be done.
11861 theName Object name; when specified, this parameter is used
11862 for result publication in the study. Otherwise, if automatic
11863 publication is switched on, default value is used for result name.
11866 New GEOM.GEOM_Object, containing the result shape.
11868 # Example: see GEOM_Spanner.py
11869 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11870 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11871 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11872 DirFace1V, DirFace2V, NbTimesV)
11873 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11874 anObj.SetParameters(Parameters)
11875 self._autoPublish(anObj, theName, "transformed")
11878 ## Build all possible propagation groups.
11879 # Propagation group is a set of all edges, opposite to one (main)
11880 # edge of this group directly or through other opposite edges.
11881 # Notion of Opposite Edge make sence only on quadrangle face.
11882 # @param theShape Shape to build propagation groups on.
11883 # @param theName Object name; when specified, this parameter is used
11884 # for result publication in the study. Otherwise, if automatic
11885 # publication is switched on, default value is used for result name.
11887 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11889 # @ref swig_Propagate "Example"
11890 @ManageTransactions("BlocksOp")
11891 def Propagate(self, theShape, theName=None):
11893 Build all possible propagation groups.
11894 Propagation group is a set of all edges, opposite to one (main)
11895 edge of this group directly or through other opposite edges.
11896 Notion of Opposite Edge make sence only on quadrangle face.
11899 theShape Shape to build propagation groups on.
11900 theName Object name; when specified, this parameter is used
11901 for result publication in the study. Otherwise, if automatic
11902 publication is switched on, default value is used for result name.
11905 List of GEOM.GEOM_Object, each of them is a propagation group.
11907 # Example: see GEOM_TestOthers.py
11908 listChains = self.BlocksOp.Propagate(theShape)
11909 RaiseIfFailed("Propagate", self.BlocksOp)
11910 self._autoPublish(listChains, theName, "propagate")
11913 # end of l3_blocks_op
11916 ## @addtogroup l3_groups
11919 ## Creates a new group which will store sub-shapes of theMainShape
11920 # @param theMainShape is a GEOM object on which the group is selected
11921 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11922 # @param theName Object name; when specified, this parameter is used
11923 # for result publication in the study. Otherwise, if automatic
11924 # publication is switched on, default value is used for result name.
11926 # @return a newly created GEOM group (GEOM.GEOM_Object)
11928 # @ref tui_working_with_groups_page "Example 1"
11929 # \n @ref swig_CreateGroup "Example 2"
11930 @ManageTransactions("GroupOp")
11931 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11933 Creates a new group which will store sub-shapes of theMainShape
11936 theMainShape is a GEOM object on which the group is selected
11937 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11938 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11939 theName Object name; when specified, this parameter is used
11940 for result publication in the study. Otherwise, if automatic
11941 publication is switched on, default value is used for result name.
11944 a newly created GEOM group
11947 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11950 # Example: see GEOM_TestOthers.py
11951 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11952 RaiseIfFailed("CreateGroup", self.GroupOp)
11953 self._autoPublish(anObj, theName, "group")
11956 ## Adds a sub-object with ID theSubShapeId to the group
11957 # @param theGroup is a GEOM group to which the new sub-shape is added
11958 # @param theSubShapeID is a sub-shape ID in the main object.
11959 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11961 # @ref tui_working_with_groups_page "Example"
11962 @ManageTransactions("GroupOp")
11963 def AddObject(self,theGroup, theSubShapeID):
11965 Adds a sub-object with ID theSubShapeId to the group
11968 theGroup is a GEOM group to which the new sub-shape is added
11969 theSubShapeID is a sub-shape ID in the main object.
11972 Use method GetSubShapeID() to get an unique ID of the sub-shape
11974 # Example: see GEOM_TestOthers.py
11975 self.GroupOp.AddObject(theGroup, theSubShapeID)
11976 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11977 RaiseIfFailed("AddObject", self.GroupOp)
11981 ## Removes a sub-object with ID \a theSubShapeId from the group
11982 # @param theGroup is a GEOM group from which the new sub-shape is removed
11983 # @param theSubShapeID is a sub-shape ID in the main object.
11984 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11986 # @ref tui_working_with_groups_page "Example"
11987 @ManageTransactions("GroupOp")
11988 def RemoveObject(self,theGroup, theSubShapeID):
11990 Removes a sub-object with ID theSubShapeId from the group
11993 theGroup is a GEOM group from which the new sub-shape is removed
11994 theSubShapeID is a sub-shape ID in the main object.
11997 Use method GetSubShapeID() to get an unique ID of the sub-shape
11999 # Example: see GEOM_TestOthers.py
12000 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
12001 RaiseIfFailed("RemoveObject", self.GroupOp)
12004 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12005 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12006 # @param theSubShapes is a list of sub-shapes to be added.
12008 # @ref tui_working_with_groups_page "Example"
12009 @ManageTransactions("GroupOp")
12010 def UnionList (self,theGroup, theSubShapes):
12012 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12015 theGroup is a GEOM group to which the new sub-shapes are added.
12016 theSubShapes is a list of sub-shapes to be added.
12018 # Example: see GEOM_TestOthers.py
12019 self.GroupOp.UnionList(theGroup, theSubShapes)
12020 RaiseIfFailed("UnionList", self.GroupOp)
12023 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12024 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12025 # @param theSubShapes is a list of indices of sub-shapes to be added.
12027 # @ref swig_UnionIDs "Example"
12028 @ManageTransactions("GroupOp")
12029 def UnionIDs(self,theGroup, theSubShapes):
12031 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12034 theGroup is a GEOM group to which the new sub-shapes are added.
12035 theSubShapes is a list of indices of sub-shapes to be added.
12037 # Example: see GEOM_TestOthers.py
12038 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12039 RaiseIfFailed("UnionIDs", self.GroupOp)
12042 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12043 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12044 # @param theSubShapes is a list of sub-shapes to be removed.
12046 # @ref tui_working_with_groups_page "Example"
12047 @ManageTransactions("GroupOp")
12048 def DifferenceList (self,theGroup, theSubShapes):
12050 Removes from the group all the given shapes. No errors, if some shapes are not included.
12053 theGroup is a GEOM group from which the sub-shapes are removed.
12054 theSubShapes is a list of sub-shapes to be removed.
12056 # Example: see GEOM_TestOthers.py
12057 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12058 RaiseIfFailed("DifferenceList", self.GroupOp)
12061 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12062 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12063 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12065 # @ref swig_DifferenceIDs "Example"
12066 @ManageTransactions("GroupOp")
12067 def DifferenceIDs(self,theGroup, theSubShapes):
12069 Removes from the group all the given shapes. No errors, if some shapes are not included.
12072 theGroup is a GEOM group from which the sub-shapes are removed.
12073 theSubShapes is a list of indices of sub-shapes to be removed.
12075 # Example: see GEOM_TestOthers.py
12076 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12077 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12080 ## Union of two groups.
12081 # New group is created. It will contain all entities
12082 # which are present in groups theGroup1 and theGroup2.
12083 # @param theGroup1, theGroup2 are the initial GEOM groups
12084 # to create the united group from.
12085 # @param theName Object name; when specified, this parameter is used
12086 # for result publication in the study. Otherwise, if automatic
12087 # publication is switched on, default value is used for result name.
12089 # @return a newly created GEOM group.
12091 # @ref tui_union_groups_anchor "Example"
12092 @ManageTransactions("GroupOp")
12093 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12095 Union of two groups.
12096 New group is created. It will contain all entities
12097 which are present in groups theGroup1 and theGroup2.
12100 theGroup1, theGroup2 are the initial GEOM groups
12101 to create the united group from.
12102 theName Object name; when specified, this parameter is used
12103 for result publication in the study. Otherwise, if automatic
12104 publication is switched on, default value is used for result name.
12107 a newly created GEOM group.
12109 # Example: see GEOM_TestOthers.py
12110 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12111 RaiseIfFailed("UnionGroups", self.GroupOp)
12112 self._autoPublish(aGroup, theName, "group")
12115 ## Intersection of two groups.
12116 # New group is created. It will contain only those entities
12117 # which are present in both groups theGroup1 and theGroup2.
12118 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12119 # @param theName Object name; when specified, this parameter is used
12120 # for result publication in the study. Otherwise, if automatic
12121 # publication is switched on, default value is used for result name.
12123 # @return a newly created GEOM group.
12125 # @ref tui_intersect_groups_anchor "Example"
12126 @ManageTransactions("GroupOp")
12127 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12129 Intersection of two groups.
12130 New group is created. It will contain only those entities
12131 which are present in both groups theGroup1 and theGroup2.
12134 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12135 theName Object name; when specified, this parameter is used
12136 for result publication in the study. Otherwise, if automatic
12137 publication is switched on, default value is used for result name.
12140 a newly created GEOM group.
12142 # Example: see GEOM_TestOthers.py
12143 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12144 RaiseIfFailed("IntersectGroups", self.GroupOp)
12145 self._autoPublish(aGroup, theName, "group")
12148 ## Cut of two groups.
12149 # New group is created. It will contain entities which are
12150 # present in group theGroup1 but are not present in group theGroup2.
12151 # @param theGroup1 is a GEOM group to include elements of.
12152 # @param theGroup2 is a GEOM group to exclude elements of.
12153 # @param theName Object name; when specified, this parameter is used
12154 # for result publication in the study. Otherwise, if automatic
12155 # publication is switched on, default value is used for result name.
12157 # @return a newly created GEOM group.
12159 # @ref tui_cut_groups_anchor "Example"
12160 @ManageTransactions("GroupOp")
12161 def CutGroups (self, theGroup1, theGroup2, theName=None):
12164 New group is created. It will contain entities which are
12165 present in group theGroup1 but are not present in group theGroup2.
12168 theGroup1 is a GEOM group to include elements of.
12169 theGroup2 is a GEOM group to exclude elements of.
12170 theName Object name; when specified, this parameter is used
12171 for result publication in the study. Otherwise, if automatic
12172 publication is switched on, default value is used for result name.
12175 a newly created GEOM group.
12177 # Example: see GEOM_TestOthers.py
12178 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12179 RaiseIfFailed("CutGroups", self.GroupOp)
12180 self._autoPublish(aGroup, theName, "group")
12183 ## Union of list of groups.
12184 # New group is created. It will contain all entities that are
12185 # present in groups listed in theGList.
12186 # @param theGList is a list of GEOM groups to create the united group from.
12187 # @param theName Object name; when specified, this parameter is used
12188 # for result publication in the study. Otherwise, if automatic
12189 # publication is switched on, default value is used for result name.
12191 # @return a newly created GEOM group.
12193 # @ref tui_union_groups_anchor "Example"
12194 @ManageTransactions("GroupOp")
12195 def UnionListOfGroups (self, theGList, theName=None):
12197 Union of list of groups.
12198 New group is created. It will contain all entities that are
12199 present in groups listed in theGList.
12202 theGList is a list of GEOM groups to create the united group from.
12203 theName Object name; when specified, this parameter is used
12204 for result publication in the study. Otherwise, if automatic
12205 publication is switched on, default value is used for result name.
12208 a newly created GEOM group.
12210 # Example: see GEOM_TestOthers.py
12211 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12212 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12213 self._autoPublish(aGroup, theName, "group")
12216 ## Cut of lists of groups.
12217 # New group is created. It will contain only entities
12218 # which are present in groups listed in theGList.
12219 # @param theGList is a list of GEOM groups to include elements of.
12220 # @param theName Object name; when specified, this parameter is used
12221 # for result publication in the study. Otherwise, if automatic
12222 # publication is switched on, default value is used for result name.
12224 # @return a newly created GEOM group.
12226 # @ref tui_intersect_groups_anchor "Example"
12227 @ManageTransactions("GroupOp")
12228 def IntersectListOfGroups (self, theGList, theName=None):
12230 Cut of lists of groups.
12231 New group is created. It will contain only entities
12232 which are present in groups listed in theGList.
12235 theGList is a list of GEOM groups to include elements of.
12236 theName Object name; when specified, this parameter is used
12237 for result publication in the study. Otherwise, if automatic
12238 publication is switched on, default value is used for result name.
12241 a newly created GEOM group.
12243 # Example: see GEOM_TestOthers.py
12244 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12245 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12246 self._autoPublish(aGroup, theName, "group")
12249 ## Cut of lists of groups.
12250 # New group is created. It will contain only entities
12251 # which are present in groups listed in theGList1 but
12252 # are not present in groups from theGList2.
12253 # @param theGList1 is a list of GEOM groups to include elements of.
12254 # @param theGList2 is a list of GEOM groups to exclude elements of.
12255 # @param theName Object name; when specified, this parameter is used
12256 # for result publication in the study. Otherwise, if automatic
12257 # publication is switched on, default value is used for result name.
12259 # @return a newly created GEOM group.
12261 # @ref tui_cut_groups_anchor "Example"
12262 @ManageTransactions("GroupOp")
12263 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12265 Cut of lists of groups.
12266 New group is created. It will contain only entities
12267 which are present in groups listed in theGList1 but
12268 are not present in groups from theGList2.
12271 theGList1 is a list of GEOM groups to include elements of.
12272 theGList2 is a list of GEOM groups to exclude elements of.
12273 theName Object name; when specified, this parameter is used
12274 for result publication in the study. Otherwise, if automatic
12275 publication is switched on, default value is used for result name.
12278 a newly created GEOM group.
12280 # Example: see GEOM_TestOthers.py
12281 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12282 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12283 self._autoPublish(aGroup, theName, "group")
12286 ## Returns a list of sub-objects ID stored in the group
12287 # @param theGroup is a GEOM group for which a list of IDs is requested
12289 # @ref swig_GetObjectIDs "Example"
12290 @ManageTransactions("GroupOp")
12291 def GetObjectIDs(self,theGroup):
12293 Returns a list of sub-objects ID stored in the group
12296 theGroup is a GEOM group for which a list of IDs is requested
12298 # Example: see GEOM_TestOthers.py
12299 ListIDs = self.GroupOp.GetObjects(theGroup)
12300 RaiseIfFailed("GetObjects", self.GroupOp)
12303 ## Returns a type of sub-objects stored in the group
12304 # @param theGroup is a GEOM group which type is returned.
12306 # @ref swig_GetType "Example"
12307 @ManageTransactions("GroupOp")
12308 def GetType(self,theGroup):
12310 Returns a type of sub-objects stored in the group
12313 theGroup is a GEOM group which type is returned.
12315 # Example: see GEOM_TestOthers.py
12316 aType = self.GroupOp.GetType(theGroup)
12317 RaiseIfFailed("GetType", self.GroupOp)
12320 ## Convert a type of geom object from id to string value
12321 # @param theId is a GEOM obect type id.
12322 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12323 # @ref swig_GetType "Example"
12324 def ShapeIdToType(self, theId):
12326 Convert a type of geom object from id to string value
12329 theId is a GEOM obect type id.
12332 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12359 return "REVOLUTION"
12407 return "FREE_BOUNDS"
12415 return "THRUSECTIONS"
12417 return "COMPOUNDFILTER"
12419 return "SHAPES_ON_SHAPE"
12421 return "ELLIPSE_ARC"
12423 return "3DSKETCHER"
12429 return "PIPETSHAPE"
12430 return "Shape Id not exist."
12432 ## Returns a main shape associated with the group
12433 # @param theGroup is a GEOM group for which a main shape object is requested
12434 # @return a GEOM object which is a main shape for theGroup
12436 # @ref swig_GetMainShape "Example"
12437 @ManageTransactions("GroupOp")
12438 def GetMainShape(self,theGroup):
12440 Returns a main shape associated with the group
12443 theGroup is a GEOM group for which a main shape object is requested
12446 a GEOM object which is a main shape for theGroup
12448 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12450 # Example: see GEOM_TestOthers.py
12451 anObj = self.GroupOp.GetMainShape(theGroup)
12452 RaiseIfFailed("GetMainShape", self.GroupOp)
12455 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12456 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12457 # @param theShape given shape (see GEOM.GEOM_Object)
12458 # @param min_length minimum length of edges of theShape
12459 # @param max_length maximum length of edges of theShape
12460 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12461 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12462 # @param theName Object name; when specified, this parameter is used
12463 # for result publication in the study. Otherwise, if automatic
12464 # publication is switched on, default value is used for result name.
12466 # @return a newly created GEOM group of edges
12468 # @@ref swig_todo "Example"
12469 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12471 Create group of edges of theShape, whose length is in range [min_length, max_length].
12472 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12475 theShape given shape
12476 min_length minimum length of edges of theShape
12477 max_length maximum length of edges of theShape
12478 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12479 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12480 theName Object name; when specified, this parameter is used
12481 for result publication in the study. Otherwise, if automatic
12482 publication is switched on, default value is used for result name.
12485 a newly created GEOM group of edges.
12487 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12488 edges_in_range = []
12490 Props = self.BasicProperties(edge)
12491 if min_length <= Props[0] and Props[0] <= max_length:
12492 if (not include_min) and (min_length == Props[0]):
12495 if (not include_max) and (Props[0] == max_length):
12498 edges_in_range.append(edge)
12500 if len(edges_in_range) <= 0:
12501 print "No edges found by given criteria"
12504 # note: auto-publishing is done in self.CreateGroup()
12505 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12506 self.UnionList(group_edges, edges_in_range)
12510 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12511 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12512 # @param min_length minimum length of edges of selected shape
12513 # @param max_length maximum length of edges of selected shape
12514 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12515 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12516 # @return a newly created GEOM group of edges
12517 # @ref swig_todo "Example"
12518 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12520 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12521 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12524 min_length minimum length of edges of selected shape
12525 max_length maximum length of edges of selected shape
12526 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12527 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12530 a newly created GEOM group of edges.
12532 nb_selected = sg.SelectedCount()
12533 if nb_selected < 1:
12534 print "Select a shape before calling this function, please."
12536 if nb_selected > 1:
12537 print "Only one shape must be selected"
12540 id_shape = sg.getSelected(0)
12541 shape = IDToObject( id_shape )
12543 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12547 if include_min: left_str = " <= "
12548 if include_max: right_str = " <= "
12550 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12551 + left_str + "length" + right_str + `max_length`)
12553 sg.updateObjBrowser(1)
12560 ## @addtogroup l4_advanced
12563 ## Create a T-shape object with specified caracteristics for the main
12564 # and the incident pipes (radius, width, half-length).
12565 # The extremities of the main pipe are located on junctions points P1 and P2.
12566 # The extremity of the incident pipe is located on junction point P3.
12567 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12568 # the main plane of the T-shape is XOY.
12570 # @param theR1 Internal radius of main pipe
12571 # @param theW1 Width of main pipe
12572 # @param theL1 Half-length of main pipe
12573 # @param theR2 Internal radius of incident pipe (R2 < R1)
12574 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12575 # @param theL2 Half-length of incident pipe
12577 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12578 # @param theP1 1st junction point of main pipe
12579 # @param theP2 2nd junction point of main pipe
12580 # @param theP3 Junction point of incident pipe
12582 # @param theRL Internal radius of left thickness reduction
12583 # @param theWL Width of left thickness reduction
12584 # @param theLtransL Length of left transition part
12585 # @param theLthinL Length of left thin part
12587 # @param theRR Internal radius of right thickness reduction
12588 # @param theWR Width of right thickness reduction
12589 # @param theLtransR Length of right transition part
12590 # @param theLthinR Length of right thin part
12592 # @param theRI Internal radius of incident thickness reduction
12593 # @param theWI Width of incident thickness reduction
12594 # @param theLtransI Length of incident transition part
12595 # @param theLthinI Length of incident thin part
12597 # @param theName Object name; when specified, this parameter is used
12598 # for result publication in the study. Otherwise, if automatic
12599 # publication is switched on, default value is used for result name.
12601 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12603 # @ref tui_creation_pipetshape "Example"
12604 @ManageTransactions("AdvOp")
12605 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
12606 theHexMesh=True, theP1=None, theP2=None, theP3=None,
12607 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12608 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12609 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12612 Create a T-shape object with specified caracteristics for the main
12613 and the incident pipes (radius, width, half-length).
12614 The extremities of the main pipe are located on junctions points P1 and P2.
12615 The extremity of the incident pipe is located on junction point P3.
12616 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12617 the main plane of the T-shape is XOY.
12620 theR1 Internal radius of main pipe
12621 theW1 Width of main pipe
12622 theL1 Half-length of main pipe
12623 theR2 Internal radius of incident pipe (R2 < R1)
12624 theW2 Width of incident pipe (R2+W2 < R1+W1)
12625 theL2 Half-length of incident pipe
12626 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12627 theP1 1st junction point of main pipe
12628 theP2 2nd junction point of main pipe
12629 theP3 Junction point of incident pipe
12631 theRL Internal radius of left thickness reduction
12632 theWL Width of left thickness reduction
12633 theLtransL Length of left transition part
12634 theLthinL Length of left thin part
12636 theRR Internal radius of right thickness reduction
12637 theWR Width of right thickness reduction
12638 theLtransR Length of right transition part
12639 theLthinR Length of right thin part
12641 theRI Internal radius of incident thickness reduction
12642 theWI Width of incident thickness reduction
12643 theLtransI Length of incident transition part
12644 theLthinI Length of incident thin part
12646 theName Object name; when specified, this parameter is used
12647 for result publication in the study. Otherwise, if automatic
12648 publication is switched on, default value is used for result name.
12651 List of GEOM_Object, containing the created shape and propagation groups.
12654 # create PipeTShape object
12655 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12656 # create PipeTShape object with position
12657 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12658 # create PipeTShape object with left thickness reduction
12659 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12661 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)
12662 if (theP1 and theP2 and theP3):
12663 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12664 theRL, theWL, theLtransL, theLthinL,
12665 theRR, theWR, theLtransR, theLthinR,
12666 theRI, theWI, theLtransI, theLthinI,
12667 theHexMesh, theP1, theP2, theP3)
12669 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12670 theRL, theWL, theLtransL, theLthinL,
12671 theRR, theWR, theLtransR, theLthinR,
12672 theRI, theWI, theLtransI, theLthinI,
12674 RaiseIfFailed("MakePipeTShape", self.AdvOp)
12675 if Parameters: anObj[0].SetParameters(Parameters)
12676 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12677 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12680 ## Create a T-shape object with chamfer and with specified caracteristics for the main
12681 # and the incident pipes (radius, width, half-length). The chamfer is
12682 # created on the junction of the pipes.
12683 # The extremities of the main pipe are located on junctions points P1 and P2.
12684 # The extremity of the incident pipe is located on junction point P3.
12685 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12686 # the main plane of the T-shape is XOY.
12687 # @param theR1 Internal radius of main pipe
12688 # @param theW1 Width of main pipe
12689 # @param theL1 Half-length of main pipe
12690 # @param theR2 Internal radius of incident pipe (R2 < R1)
12691 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12692 # @param theL2 Half-length of incident pipe
12693 # @param theH Height of the chamfer.
12694 # @param theW Width of the chamfer.
12695 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12696 # @param theP1 1st junction point of main pipe
12697 # @param theP2 2nd junction point of main pipe
12698 # @param theP3 Junction point of incident pipe
12700 # @param theRL Internal radius of left thickness reduction
12701 # @param theWL Width of left thickness reduction
12702 # @param theLtransL Length of left transition part
12703 # @param theLthinL Length of left thin part
12705 # @param theRR Internal radius of right thickness reduction
12706 # @param theWR Width of right thickness reduction
12707 # @param theLtransR Length of right transition part
12708 # @param theLthinR Length of right thin part
12710 # @param theRI Internal radius of incident thickness reduction
12711 # @param theWI Width of incident thickness reduction
12712 # @param theLtransI Length of incident transition part
12713 # @param theLthinI Length of incident thin part
12715 # @param theName Object name; when specified, this parameter is used
12716 # for result publication in the study. Otherwise, if automatic
12717 # publication is switched on, default value is used for result name.
12719 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12721 # @ref tui_creation_pipetshape "Example"
12722 @ManageTransactions("AdvOp")
12723 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12724 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12725 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12726 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12727 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12730 Create a T-shape object with chamfer and with specified caracteristics for the main
12731 and the incident pipes (radius, width, half-length). The chamfer is
12732 created on the junction of the pipes.
12733 The extremities of the main pipe are located on junctions points P1 and P2.
12734 The extremity of the incident pipe is located on junction point P3.
12735 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12736 the main plane of the T-shape is XOY.
12739 theR1 Internal radius of main pipe
12740 theW1 Width of main pipe
12741 theL1 Half-length of main pipe
12742 theR2 Internal radius of incident pipe (R2 < R1)
12743 theW2 Width of incident pipe (R2+W2 < R1+W1)
12744 theL2 Half-length of incident pipe
12745 theH Height of the chamfer.
12746 theW Width of the chamfer.
12747 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12748 theP1 1st junction point of main pipe
12749 theP2 2nd junction point of main pipe
12750 theP3 Junction point of incident pipe
12752 theRL Internal radius of left thickness reduction
12753 theWL Width of left thickness reduction
12754 theLtransL Length of left transition part
12755 theLthinL Length of left thin part
12757 theRR Internal radius of right thickness reduction
12758 theWR Width of right thickness reduction
12759 theLtransR Length of right transition part
12760 theLthinR Length of right thin part
12762 theRI Internal radius of incident thickness reduction
12763 theWI Width of incident thickness reduction
12764 theLtransI Length of incident transition part
12765 theLthinI Length of incident thin part
12767 theName Object name; when specified, this parameter is used
12768 for result publication in the study. Otherwise, if automatic
12769 publication is switched on, default value is used for result name.
12772 List of GEOM_Object, containing the created shape and propagation groups.
12775 # create PipeTShape with chamfer object
12776 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12777 # create PipeTShape with chamfer object with position
12778 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12779 # create PipeTShape with chamfer object with left thickness reduction
12780 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)
12782 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)
12783 if (theP1 and theP2 and theP3):
12784 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12785 theRL, theWL, theLtransL, theLthinL,
12786 theRR, theWR, theLtransR, theLthinR,
12787 theRI, theWI, theLtransI, theLthinI,
12788 theH, theW, theHexMesh, theP1, theP2, theP3)
12790 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12791 theRL, theWL, theLtransL, theLthinL,
12792 theRR, theWR, theLtransR, theLthinR,
12793 theRI, theWI, theLtransI, theLthinI,
12794 theH, theW, theHexMesh)
12795 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12796 if Parameters: anObj[0].SetParameters(Parameters)
12797 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12798 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12801 ## Create a T-shape object with fillet and with specified caracteristics for the main
12802 # and the incident pipes (radius, width, half-length). The fillet is
12803 # created on the junction of the pipes.
12804 # The extremities of the main pipe are located on junctions points P1 and P2.
12805 # The extremity of the incident pipe is located on junction point P3.
12806 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12807 # the main plane of the T-shape is XOY.
12808 # @param theR1 Internal radius of main pipe
12809 # @param theW1 Width of main pipe
12810 # @param theL1 Half-length of main pipe
12811 # @param theR2 Internal radius of incident pipe (R2 < R1)
12812 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12813 # @param theL2 Half-length of incident pipe
12814 # @param theRF Radius of curvature of fillet.
12815 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12816 # @param theP1 1st junction point of main pipe
12817 # @param theP2 2nd junction point of main pipe
12818 # @param theP3 Junction point of incident pipe
12820 # @param theRL Internal radius of left thickness reduction
12821 # @param theWL Width of left thickness reduction
12822 # @param theLtransL Length of left transition part
12823 # @param theLthinL Length of left thin part
12825 # @param theRR Internal radius of right thickness reduction
12826 # @param theWR Width of right thickness reduction
12827 # @param theLtransR Length of right transition part
12828 # @param theLthinR Length of right thin part
12830 # @param theRI Internal radius of incident thickness reduction
12831 # @param theWI Width of incident thickness reduction
12832 # @param theLtransI Length of incident transition part
12833 # @param theLthinI Length of incident thin part
12835 # @param theName Object name; when specified, this parameter is used
12836 # for result publication in the study. Otherwise, if automatic
12837 # publication is switched on, default value is used for result name.
12839 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12841 # @ref tui_creation_pipetshape "Example"
12842 @ManageTransactions("AdvOp")
12843 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12844 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12845 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12846 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12847 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12850 Create a T-shape object with fillet and with specified caracteristics for the main
12851 and the incident pipes (radius, width, half-length). The fillet is
12852 created on the junction of the pipes.
12853 The extremities of the main pipe are located on junctions points P1 and P2.
12854 The extremity of the incident pipe is located on junction point P3.
12857 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12858 the main plane of the T-shape is XOY.
12859 theR1 Internal radius of main pipe
12860 theW1 Width of main pipe
12861 heL1 Half-length of main pipe
12862 theR2 Internal radius of incident pipe (R2 < R1)
12863 theW2 Width of incident pipe (R2+W2 < R1+W1)
12864 theL2 Half-length of incident pipe
12865 theRF Radius of curvature of fillet.
12866 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12867 theP1 1st junction point of main pipe
12868 theP2 2nd junction point of main pipe
12869 theP3 Junction point of incident pipe
12871 theRL Internal radius of left thickness reduction
12872 theWL Width of left thickness reduction
12873 theLtransL Length of left transition part
12874 theLthinL Length of left thin part
12876 theRR Internal radius of right thickness reduction
12877 theWR Width of right thickness reduction
12878 theLtransR Length of right transition part
12879 theLthinR Length of right thin part
12881 theRI Internal radius of incident thickness reduction
12882 theWI Width of incident thickness reduction
12883 theLtransI Length of incident transition part
12884 theLthinI Length of incident thin part
12886 theName Object name; when specified, this parameter is used
12887 for result publication in the study. Otherwise, if automatic
12888 publication is switched on, default value is used for result name.
12891 List of GEOM_Object, containing the created shape and propagation groups.
12894 # create PipeTShape with fillet object
12895 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12896 # create PipeTShape with fillet object with position
12897 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12898 # create PipeTShape with fillet object with left thickness reduction
12899 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)
12901 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)
12902 if (theP1 and theP2 and theP3):
12903 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12904 theRL, theWL, theLtransL, theLthinL,
12905 theRR, theWR, theLtransR, theLthinR,
12906 theRI, theWI, theLtransI, theLthinI,
12907 theRF, theHexMesh, theP1, theP2, theP3)
12909 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12910 theRL, theWL, theLtransL, theLthinL,
12911 theRR, theWR, theLtransR, theLthinR,
12912 theRI, theWI, theLtransI, theLthinI,
12914 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12915 if Parameters: anObj[0].SetParameters(Parameters)
12916 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12917 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12920 ## This function allows creating a disk already divided into blocks. It
12921 # can be used to create divided pipes for later meshing in hexaedra.
12922 # @param theR Radius of the disk
12923 # @param theOrientation Orientation of the plane on which the disk will be built
12924 # 1 = XOY, 2 = OYZ, 3 = OZX
12925 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12926 # @param theName Object name; when specified, this parameter is used
12927 # for result publication in the study. Otherwise, if automatic
12928 # publication is switched on, default value is used for result name.
12930 # @return New GEOM_Object, containing the created shape.
12932 # @ref tui_creation_divideddisk "Example"
12933 @ManageTransactions("AdvOp")
12934 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12936 Creates a disk, divided into blocks. It can be used to create divided pipes
12937 for later meshing in hexaedra.
12940 theR Radius of the disk
12941 theOrientation Orientation of the plane on which the disk will be built:
12942 1 = XOY, 2 = OYZ, 3 = OZX
12943 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12944 theName Object name; when specified, this parameter is used
12945 for result publication in the study. Otherwise, if automatic
12946 publication is switched on, default value is used for result name.
12949 New GEOM_Object, containing the created shape.
12951 theR, Parameters = ParseParameters(theR)
12952 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12953 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12954 if Parameters: anObj.SetParameters(Parameters)
12955 self._autoPublish(anObj, theName, "dividedDisk")
12958 ## This function allows creating a disk already divided into blocks. It
12959 # can be used to create divided pipes for later meshing in hexaedra.
12960 # @param theCenter Center of the disk
12961 # @param theVector Normal vector to the plane of the created disk
12962 # @param theRadius Radius of the disk
12963 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12964 # @param theName Object name; when specified, this parameter is used
12965 # for result publication in the study. Otherwise, if automatic
12966 # publication is switched on, default value is used for result name.
12968 # @return New GEOM_Object, containing the created shape.
12970 # @ref tui_creation_divideddisk "Example"
12971 @ManageTransactions("AdvOp")
12972 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12974 Creates a disk already divided into blocks. It can be used to create divided pipes
12975 for later meshing in hexaedra.
12978 theCenter Center of the disk
12979 theVector Normal vector to the plane of the created disk
12980 theRadius Radius of the disk
12981 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12982 theName Object name; when specified, this parameter is used
12983 for result publication in the study. Otherwise, if automatic
12984 publication is switched on, default value is used for result name.
12987 New GEOM_Object, containing the created shape.
12989 theRadius, Parameters = ParseParameters(theRadius)
12990 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12991 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12992 if Parameters: anObj.SetParameters(Parameters)
12993 self._autoPublish(anObj, theName, "dividedDisk")
12996 ## Builds a cylinder prepared for hexa meshes
12997 # @param theR Radius of the cylinder
12998 # @param theH Height of the cylinder
12999 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
13000 # @param theName Object name; when specified, this parameter is used
13001 # for result publication in the study. Otherwise, if automatic
13002 # publication is switched on, default value is used for result name.
13004 # @return New GEOM_Object, containing the created shape.
13006 # @ref tui_creation_dividedcylinder "Example"
13007 @ManageTransactions("AdvOp")
13008 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
13010 Builds a cylinder prepared for hexa meshes
13013 theR Radius of the cylinder
13014 theH Height of the cylinder
13015 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
13016 theName Object name; when specified, this parameter is used
13017 for result publication in the study. Otherwise, if automatic
13018 publication is switched on, default value is used for result name.
13021 New GEOM_Object, containing the created shape.
13023 theR, theH, Parameters = ParseParameters(theR, theH)
13024 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
13025 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
13026 if Parameters: anObj.SetParameters(Parameters)
13027 self._autoPublish(anObj, theName, "dividedCylinder")
13030 ## Create a surface from a cloud of points
13031 # @param thelPoints list of points. Compounds of points are
13032 # accepted as well.
13033 # @param theNbMax maximum number of Bezier pieces in the resulting
13035 # @param theDegMax maximum degree of the resulting BSpline surface.
13036 # @param theDMax 3D tolerance of initial approximation.
13037 # @param theName Object name; when specified, this parameter is used
13038 # for result publication in the study. Otherwise, if automatic
13039 # publication is switched on, default value is used for result name.
13040 # @return New GEOM_Object, containing the created shape.
13041 # @note 3D tolerance of initial approximation represents a tolerance of
13042 # initial plate surface approximation. If this parameter is equal
13043 # to 0 (default value) it is computed. In this case an error of
13044 # initial plate surface computation is used as the approximation
13045 # tolerance. This error represents a maximal distance between
13046 # computed plate surface and given points.
13048 # @ref tui_creation_smoothingsurface "Example"
13049 @ManageTransactions("AdvOp")
13050 def MakeSmoothingSurface(self, thelPoints, theNbMax=2, theDegMax=8,
13051 theDMax=0.0, theName=None):
13053 Create a surface from a cloud of points
13056 thelPoints list of points. Compounds of points are
13058 theNbMax maximum number of Bezier pieces in the resulting
13060 theDegMax maximum degree of the resulting BSpline surface.
13061 theDMax 3D tolerance of initial approximation.
13062 theName Object name; when specified, this parameter is used
13063 for result publication in the study. Otherwise, if automatic
13064 publication is switched on, default value is used for result name.
13067 New GEOM_Object, containing the created shape.
13070 3D tolerance of initial approximation represents a tolerance of
13071 initial plate surface approximation. If this parameter is equal
13072 to 0 (default value) it is computed. In this case an error of
13073 initial plate surface computation is used as the approximation
13074 tolerance. This error represents a maximal distance between
13075 computed plate surface and given points.
13077 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints, theNbMax,
13078 theDegMax, theDMax)
13079 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
13080 self._autoPublish(anObj, theName, "smoothing")
13083 ## Export a shape to XAO format
13084 # @param shape The shape to export
13085 # @param groups The list of groups to export
13086 # @param fields The list of fields to export
13087 # @param author The author of the export
13088 # @param fileName The name of the file to export
13091 # @ref tui_exportxao "Example"
13092 @ManageTransactions("InsertOp")
13093 def ExportXAO(self, shape, groups, fields, author, fileName):
13094 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
13095 RaiseIfFailed("ExportXAO", self.InsertOp)
13098 ## Import a shape from XAO format
13099 # @param shape Shape to export
13100 # @param fileName The name of the file to import
13101 # @return tuple (res, shape, subShapes, groups, fields)
13102 # res Flag indicating if the import was successful
13103 # shape The imported shape
13104 # subShapes The list of imported subShapes
13105 # groups The list of imported groups
13106 # fields The list of imported fields
13108 # @ref tui_importxao "Example"
13109 @ManageTransactions("InsertOp")
13110 def ImportXAO(self, fileName):
13111 res = self.InsertOp.ImportXAO(fileName)
13112 RaiseIfFailed("ImportXAO", self.InsertOp)
13115 #@@ insert new functions before this line @@ do not remove this line @@#
13117 # end of l4_advanced
13120 ## Create a copy of the given object
13122 # @param theOriginal geometry object for copy
13123 # @param theName Object name; when specified, this parameter is used
13124 # for result publication in the study. Otherwise, if automatic
13125 # publication is switched on, default value is used for result name.
13127 # @return New GEOM_Object, containing the copied shape.
13129 # @ingroup l1_geomBuilder_auxiliary
13130 # @ref swig_MakeCopy "Example"
13131 @ManageTransactions("InsertOp")
13132 def MakeCopy(self, theOriginal, theName=None):
13134 Create a copy of the given object
13137 theOriginal geometry object for copy
13138 theName Object name; when specified, this parameter is used
13139 for result publication in the study. Otherwise, if automatic
13140 publication is switched on, default value is used for result name.
13143 New GEOM_Object, containing the copied shape.
13145 Example of usage: Copy = geompy.MakeCopy(Box)
13147 # Example: see GEOM_TestAll.py
13148 anObj = self.InsertOp.MakeCopy(theOriginal)
13149 RaiseIfFailed("MakeCopy", self.InsertOp)
13150 self._autoPublish(anObj, theName, "copy")
13153 ## Add Path to load python scripts from
13154 # @param Path a path to load python scripts from
13155 # @ingroup l1_geomBuilder_auxiliary
13156 def addPath(self,Path):
13158 Add Path to load python scripts from
13161 Path a path to load python scripts from
13163 if (sys.path.count(Path) < 1):
13164 sys.path.append(Path)
13168 ## Load marker texture from the file
13169 # @param Path a path to the texture file
13170 # @return unique texture identifier
13171 # @ingroup l1_geomBuilder_auxiliary
13172 @ManageTransactions("InsertOp")
13173 def LoadTexture(self, Path):
13175 Load marker texture from the file
13178 Path a path to the texture file
13181 unique texture identifier
13183 # Example: see GEOM_TestAll.py
13184 ID = self.InsertOp.LoadTexture(Path)
13185 RaiseIfFailed("LoadTexture", self.InsertOp)
13188 ## Get internal name of the object based on its study entry
13189 # @note This method does not provide an unique identifier of the geometry object.
13190 # @note This is internal function of GEOM component, though it can be used outside it for
13191 # appropriate reason (e.g. for identification of geometry object).
13192 # @param obj geometry object
13193 # @return unique object identifier
13194 # @ingroup l1_geomBuilder_auxiliary
13195 def getObjectID(self, obj):
13197 Get internal name of the object based on its study entry.
13198 Note: this method does not provide an unique identifier of the geometry object.
13199 It is an internal function of GEOM component, though it can be used outside GEOM for
13200 appropriate reason (e.g. for identification of geometry object).
13203 obj geometry object
13206 unique object identifier
13209 entry = salome.ObjectToID(obj)
13210 if entry is not None:
13211 lst = entry.split(":")
13213 ID = lst[-1] # -1 means last item in the list
13214 return "GEOM_" + ID
13219 ## Add marker texture. @a Width and @a Height parameters
13220 # specify width and height of the texture in pixels.
13221 # If @a RowData is @c True, @a Texture parameter should represent texture data
13222 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13223 # parameter should be unpacked string, in which '1' symbols represent opaque
13224 # pixels and '0' represent transparent pixels of the texture bitmap.
13226 # @param Width texture width in pixels
13227 # @param Height texture height in pixels
13228 # @param Texture texture data
13229 # @param RowData if @c True, @a Texture data are packed in the byte stream
13230 # @return unique texture identifier
13231 # @ingroup l1_geomBuilder_auxiliary
13232 @ManageTransactions("InsertOp")
13233 def AddTexture(self, Width, Height, Texture, RowData=False):
13235 Add marker texture. Width and Height parameters
13236 specify width and height of the texture in pixels.
13237 If RowData is True, Texture parameter should represent texture data
13238 packed into the byte array. If RowData is False (default), Texture
13239 parameter should be unpacked string, in which '1' symbols represent opaque
13240 pixels and '0' represent transparent pixels of the texture bitmap.
13243 Width texture width in pixels
13244 Height texture height in pixels
13245 Texture texture data
13246 RowData if True, Texture data are packed in the byte stream
13249 return unique texture identifier
13251 if not RowData: Texture = PackData(Texture)
13252 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13253 RaiseIfFailed("AddTexture", self.InsertOp)
13256 ## Creates a new folder object. It is a container for any GEOM objects.
13257 # @param Name name of the container
13258 # @param Father parent object. If None,
13259 # folder under 'Geometry' root object will be created.
13260 # @return a new created folder
13261 # @ingroup l1_publish_data
13262 def NewFolder(self, Name, Father=None):
13264 Create a new folder object. It is an auxiliary container for any GEOM objects.
13267 Name name of the container
13268 Father parent object. If None,
13269 folder under 'Geometry' root object will be created.
13272 a new created folder
13274 if not Father: Father = self.father
13275 return self.CreateFolder(Name, Father)
13277 ## Move object to the specified folder
13278 # @param Object object to move
13279 # @param Folder target folder
13280 # @ingroup l1_publish_data
13281 def PutToFolder(self, Object, Folder):
13283 Move object to the specified folder
13286 Object object to move
13287 Folder target folder
13289 self.MoveToFolder(Object, Folder)
13292 ## Move list of objects to the specified folder
13293 # @param ListOfSO list of objects to move
13294 # @param Folder target folder
13295 # @ingroup l1_publish_data
13296 def PutListToFolder(self, ListOfSO, Folder):
13298 Move list of objects to the specified folder
13301 ListOfSO list of objects to move
13302 Folder target folder
13304 self.MoveListToFolder(ListOfSO, Folder)
13307 ## @addtogroup l2_field
13311 # @param shape the shape the field lies on
13312 # @param name the field name
13313 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13314 # @param dimension dimension of the shape the field lies on
13315 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13316 # @param componentNames names of components
13317 # @return a created field
13318 @ManageTransactions("FieldOp")
13319 def CreateField(self, shape, name, type, dimension, componentNames):
13324 shape the shape the field lies on
13325 name the field name
13326 type type of field data
13327 dimension dimension of the shape the field lies on
13328 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13329 componentNames names of components
13334 if isinstance( type, int ):
13335 if type < 0 or type > 3:
13336 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
13337 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13339 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13340 RaiseIfFailed("CreateField", self.FieldOp)
13342 geom._autoPublish( f, "", name)
13345 ## Removes a field from the GEOM component
13346 # @param field the field to remove
13347 def RemoveField(self, field):
13348 "Removes a field from the GEOM component"
13350 if isinstance( field, GEOM._objref_GEOM_Field ):
13351 geom.RemoveObject( field )
13352 elif isinstance( field, geomField ):
13353 geom.RemoveObject( field.field )
13355 raise RuntimeError, "RemoveField() : the object is not a field"
13358 ## Returns number of fields on a shape
13359 @ManageTransactions("FieldOp")
13360 def CountFields(self, shape):
13361 "Returns number of fields on a shape"
13362 nb = self.FieldOp.CountFields( shape )
13363 RaiseIfFailed("CountFields", self.FieldOp)
13366 ## Returns all fields on a shape
13367 @ManageTransactions("FieldOp")
13368 def GetFields(self, shape):
13369 "Returns all fields on a shape"
13370 ff = self.FieldOp.GetFields( shape )
13371 RaiseIfFailed("GetFields", self.FieldOp)
13374 ## Returns a field on a shape by its name
13375 @ManageTransactions("FieldOp")
13376 def GetField(self, shape, name):
13377 "Returns a field on a shape by its name"
13378 f = self.FieldOp.GetField( shape, name )
13379 RaiseIfFailed("GetField", self.FieldOp)
13387 # Register the new proxy for GEOM_Gen
13388 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13391 ## Field on Geometry
13392 # @ingroup l2_field
13393 class geomField( GEOM._objref_GEOM_Field ):
13395 def __init__(self):
13396 GEOM._objref_GEOM_Field.__init__(self)
13397 self.field = GEOM._objref_GEOM_Field
13400 ## Returns the shape the field lies on
13401 def getShape(self):
13402 "Returns the shape the field lies on"
13403 return self.field.GetShape(self)
13405 ## Returns the field name
13407 "Returns the field name"
13408 return self.field.GetName(self)
13410 ## Returns type of field data as integer [0-3]
13412 "Returns type of field data"
13413 return self.field.GetDataType(self)._v
13415 ## Returns type of field data:
13416 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13417 def getTypeEnum(self):
13418 "Returns type of field data"
13419 return self.field.GetDataType(self)
13421 ## Returns dimension of the shape the field lies on:
13422 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13423 def getDimension(self):
13424 """Returns dimension of the shape the field lies on:
13425 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13426 return self.field.GetDimension(self)
13428 ## Returns names of components
13429 def getComponents(self):
13430 "Returns names of components"
13431 return self.field.GetComponents(self)
13433 ## Adds a time step to the field
13434 # @param step the time step number further used as the step identifier
13435 # @param stamp the time step time
13436 # @param values the values of the time step
13437 def addStep(self, step, stamp, values):
13438 "Adds a time step to the field"
13439 stp = self.field.AddStep( self, step, stamp )
13441 raise RuntimeError, \
13442 "Field.addStep() : Error: step %s already exists in this field"%step
13444 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13445 self.setValues( step, values )
13448 ## Remove a time step from the field
13449 def removeStep(self,step):
13450 "Remove a time step from the field"
13453 stepObj = self.field.GetStep( self, step )
13455 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13458 #traceback.print_exc()
13460 self.field.RemoveStep( self, step )
13462 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13465 ## Returns number of time steps in the field
13466 def countSteps(self):
13467 "Returns number of time steps in the field"
13468 return self.field.CountSteps(self)
13470 ## Returns a list of time step IDs in the field
13471 def getSteps(self):
13472 "Returns a list of time step IDs in the field"
13473 return self.field.GetSteps(self)
13475 ## Returns a time step by its ID
13476 def getStep(self,step):
13477 "Returns a time step by its ID"
13478 stp = self.field.GetStep(self, step)
13480 raise RuntimeError, "Step %s is missing from this field"%step
13483 ## Returns the time of the field step
13484 def getStamp(self,step):
13485 "Returns the time of the field step"
13486 return self.getStep(step).GetStamp()
13488 ## Changes the time of the field step
13489 def setStamp(self, step, stamp):
13490 "Changes the time of the field step"
13491 return self.getStep(step).SetStamp(stamp)
13493 ## Returns values of the field step
13494 def getValues(self, step):
13495 "Returns values of the field step"
13496 return self.getStep(step).GetValues()
13498 ## Changes values of the field step
13499 def setValues(self, step, values):
13500 "Changes values of the field step"
13501 stp = self.getStep(step)
13502 errBeg = "Field.setValues(values) : Error: "
13504 ok = stp.SetValues( values )
13505 except Exception, e:
13507 if excStr.find("WrongPythonType") > 0:
13508 raise RuntimeError, errBeg +\
13509 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13510 raise RuntimeError, errBeg + str(e)
13512 nbOK = self.field.GetArraySize(self)
13515 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13517 raise RuntimeError, errBeg + "failed"
13520 pass # end of class geomField
13522 # Register the new proxy for GEOM_Field
13523 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13526 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13527 # interface to GEOM operations.
13532 # salome.salome_init()
13533 # from salome.geom import geomBuilder
13534 # geompy = geomBuilder.New(salome.myStudy)
13536 # @param study SALOME study, generally obtained by salome.myStudy.
13537 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13538 # @return geomBuilder instance
13539 def New( study, instance=None):
13541 Create a new geomBuilder instance.The geomBuilder class provides the Python
13542 interface to GEOM operations.
13546 salome.salome_init()
13547 from salome.geom import geomBuilder
13548 geompy = geomBuilder.New(salome.myStudy)
13551 study SALOME study, generally obtained by salome.myStudy.
13552 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13554 geomBuilder instance
13556 #print "New geomBuilder ", study, instance
13563 geom = geomBuilder()
13564 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13565 geom.init_geom(study)