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, height and angle (for a portion of cylinder).
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 theA Cylinder angle in radian.
2978 # @param theName Object name; when specified, this parameter is used
2979 # for result publication in the study. Otherwise, if automatic
2980 # publication is switched on, default value is used for result name.
2982 # @return New GEOM.GEOM_Object, containing the created cylinder.
2984 # @ref tui_creation_cylinder "Example"
2985 @ManageTransactions("PrimOp")
2986 def MakeCylinder(self, thePnt, theAxis, theR, theH, theA=2*math.pi, theName=None):
2988 Create a cylinder with given base point, axis, radius, height and angle (for a portion of cylinder).
2991 thePnt Central point of cylinder base.
2992 theAxis Cylinder axis.
2993 theR Cylinder radius.
2994 theH Cylinder height.
2995 theA Cylinder angle in radian.
2996 theName Object name; when specified, this parameter is used
2997 for result publication in the study. Otherwise, if automatic
2998 publication is switched on, default value is used for result name.
3001 New GEOM.GEOM_Object, containing the created cylinder.
3003 # Example: see GEOM_TestAll.py
3004 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3005 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH, theA)
3007 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3008 anObj.SetParameters(Parameters)
3009 self._autoPublish(anObj, theName, "cylinder")
3012 ## Create a cylinder with given radius, height and angle (for a portion of cylinder) at
3013 # the origin of coordinate system. Axis of the cylinder
3014 # will be collinear to the OZ axis of the coordinate system.
3015 # @param theR Cylinder radius.
3016 # @param theH Cylinder height.
3017 # @param theA Cylinder angle in radian.
3018 # @param theName Object name; when specified, this parameter is used
3019 # for result publication in the study. Otherwise, if automatic
3020 # publication is switched on, default value is used for result name.
3022 # @return New GEOM.GEOM_Object, containing the created cylinder.
3024 # @ref tui_creation_cylinder "Example"
3025 @ManageTransactions("PrimOp")
3026 def MakeCylinderRH(self, theR, theH, theA=2*math.pi, theName=None):
3028 Create a cylinder with given radius, height and angle (for a portion of cylinder)at
3029 the origin of coordinate system. Axis of the cylinder
3030 will be collinear to the OZ axis of the coordinate system.
3033 theR Cylinder radius.
3034 theH Cylinder height.
3035 theA Cylinder angle in radian.
3036 theName Object name; when specified, this parameter is used
3037 for result publication in the study. Otherwise, if automatic
3038 publication is switched on, default value is used for result name.
3041 New GEOM.GEOM_Object, containing the created cylinder.
3043 # Example: see GEOM_TestAll.py
3044 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3045 anObj = self.PrimOp.MakeCylinderRH(theR, theH, theA)
3047 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3048 anObj.SetParameters(Parameters)
3049 self._autoPublish(anObj, theName, "cylinder")
3052 ## Create a sphere with given center and radius.
3053 # @param thePnt Sphere center.
3054 # @param theR Sphere radius.
3055 # @param theName Object name; when specified, this parameter is used
3056 # for result publication in the study. Otherwise, if automatic
3057 # publication is switched on, default value is used for result name.
3059 # @return New GEOM.GEOM_Object, containing the created sphere.
3061 # @ref tui_creation_sphere "Example"
3062 @ManageTransactions("PrimOp")
3063 def MakeSpherePntR(self, thePnt, theR, theName=None):
3065 Create a sphere with given center and radius.
3068 thePnt Sphere center.
3070 theName Object name; when specified, this parameter is used
3071 for result publication in the study. Otherwise, if automatic
3072 publication is switched on, default value is used for result name.
3075 New GEOM.GEOM_Object, containing the created sphere.
3077 # Example: see GEOM_TestAll.py
3078 theR,Parameters = ParseParameters(theR)
3079 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3080 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3081 anObj.SetParameters(Parameters)
3082 self._autoPublish(anObj, theName, "sphere")
3085 ## Create a sphere with given center and radius.
3086 # @param x,y,z Coordinates of sphere center.
3087 # @param theR Sphere radius.
3088 # @param theName Object name; when specified, this parameter is used
3089 # for result publication in the study. Otherwise, if automatic
3090 # publication is switched on, default value is used for result name.
3092 # @return New GEOM.GEOM_Object, containing the created sphere.
3094 # @ref tui_creation_sphere "Example"
3095 def MakeSphere(self, x, y, z, theR, theName=None):
3097 Create a sphere with given center and radius.
3100 x,y,z Coordinates of sphere center.
3102 theName Object name; when specified, this parameter is used
3103 for result publication in the study. Otherwise, if automatic
3104 publication is switched on, default value is used for result name.
3107 New GEOM.GEOM_Object, containing the created sphere.
3109 # Example: see GEOM_TestAll.py
3110 point = self.MakeVertex(x, y, z)
3111 # note: auto-publishing is done in self.MakeSpherePntR()
3112 anObj = self.MakeSpherePntR(point, theR, theName)
3115 ## Create a sphere with given radius at the origin of coordinate system.
3116 # @param theR Sphere radius.
3117 # @param theName Object name; when specified, this parameter is used
3118 # for result publication in the study. Otherwise, if automatic
3119 # publication is switched on, default value is used for result name.
3121 # @return New GEOM.GEOM_Object, containing the created sphere.
3123 # @ref tui_creation_sphere "Example"
3124 @ManageTransactions("PrimOp")
3125 def MakeSphereR(self, theR, theName=None):
3127 Create a sphere with given radius at the origin of coordinate system.
3131 theName Object name; when specified, this parameter is used
3132 for result publication in the study. Otherwise, if automatic
3133 publication is switched on, default value is used for result name.
3136 New GEOM.GEOM_Object, containing the created sphere.
3138 # Example: see GEOM_TestAll.py
3139 theR,Parameters = ParseParameters(theR)
3140 anObj = self.PrimOp.MakeSphereR(theR)
3141 RaiseIfFailed("MakeSphereR", self.PrimOp)
3142 anObj.SetParameters(Parameters)
3143 self._autoPublish(anObj, theName, "sphere")
3146 ## Create a cone with given base point, axis, height and radiuses.
3147 # @param thePnt Central point of the first cone base.
3148 # @param theAxis Cone axis.
3149 # @param theR1 Radius of the first cone base.
3150 # @param theR2 Radius of the second cone base.
3151 # \note If both radiuses are non-zero, the cone will be truncated.
3152 # \note If the radiuses are equal, a cylinder will be created instead.
3153 # @param theH Cone height.
3154 # @param theName Object name; when specified, this parameter is used
3155 # for result publication in the study. Otherwise, if automatic
3156 # publication is switched on, default value is used for result name.
3158 # @return New GEOM.GEOM_Object, containing the created cone.
3160 # @ref tui_creation_cone "Example"
3161 @ManageTransactions("PrimOp")
3162 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3164 Create a cone with given base point, axis, height and radiuses.
3167 thePnt Central point of the first cone base.
3169 theR1 Radius of the first cone base.
3170 theR2 Radius of the second cone base.
3172 theName Object name; when specified, this parameter is used
3173 for result publication in the study. Otherwise, if automatic
3174 publication is switched on, default value is used for result name.
3177 If both radiuses are non-zero, the cone will be truncated.
3178 If the radiuses are equal, a cylinder will be created instead.
3181 New GEOM.GEOM_Object, containing the created cone.
3183 # Example: see GEOM_TestAll.py
3184 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3185 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3186 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3187 anObj.SetParameters(Parameters)
3188 self._autoPublish(anObj, theName, "cone")
3191 ## Create a cone with given height and radiuses at
3192 # the origin of coordinate system. Axis of the cone will
3193 # be collinear to the OZ axis of the coordinate system.
3194 # @param theR1 Radius of the first cone base.
3195 # @param theR2 Radius of the second cone base.
3196 # \note If both radiuses are non-zero, the cone will be truncated.
3197 # \note If the radiuses are equal, a cylinder will be created instead.
3198 # @param theH Cone height.
3199 # @param theName Object name; when specified, this parameter is used
3200 # for result publication in the study. Otherwise, if automatic
3201 # publication is switched on, default value is used for result name.
3203 # @return New GEOM.GEOM_Object, containing the created cone.
3205 # @ref tui_creation_cone "Example"
3206 @ManageTransactions("PrimOp")
3207 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3209 Create a cone with given height and radiuses at
3210 the origin of coordinate system. Axis of the cone will
3211 be collinear to the OZ axis of the coordinate system.
3214 theR1 Radius of the first cone base.
3215 theR2 Radius of the second cone base.
3217 theName Object name; when specified, this parameter is used
3218 for result publication in the study. Otherwise, if automatic
3219 publication is switched on, default value is used for result name.
3222 If both radiuses are non-zero, the cone will be truncated.
3223 If the radiuses are equal, a cylinder will be created instead.
3226 New GEOM.GEOM_Object, containing the created cone.
3228 # Example: see GEOM_TestAll.py
3229 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3230 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3231 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3232 anObj.SetParameters(Parameters)
3233 self._autoPublish(anObj, theName, "cone")
3236 ## Create a torus with given center, normal vector and radiuses.
3237 # @param thePnt Torus central point.
3238 # @param theVec Torus axis of symmetry.
3239 # @param theRMajor Torus major radius.
3240 # @param theRMinor Torus minor radius.
3241 # @param theName Object name; when specified, this parameter is used
3242 # for result publication in the study. Otherwise, if automatic
3243 # publication is switched on, default value is used for result name.
3245 # @return New GEOM.GEOM_Object, containing the created torus.
3247 # @ref tui_creation_torus "Example"
3248 @ManageTransactions("PrimOp")
3249 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3251 Create a torus with given center, normal vector and radiuses.
3254 thePnt Torus central point.
3255 theVec Torus axis of symmetry.
3256 theRMajor Torus major radius.
3257 theRMinor Torus minor radius.
3258 theName Object name; when specified, this parameter is used
3259 for result publication in the study. Otherwise, if automatic
3260 publication is switched on, default value is used for result name.
3263 New GEOM.GEOM_Object, containing the created torus.
3265 # Example: see GEOM_TestAll.py
3266 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3267 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3268 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3269 anObj.SetParameters(Parameters)
3270 self._autoPublish(anObj, theName, "torus")
3273 ## Create a torus with given radiuses at the origin of coordinate system.
3274 # @param theRMajor Torus major radius.
3275 # @param theRMinor Torus minor radius.
3276 # @param theName Object name; when specified, this parameter is used
3277 # for result publication in the study. Otherwise, if automatic
3278 # publication is switched on, default value is used for result name.
3280 # @return New GEOM.GEOM_Object, containing the created torus.
3282 # @ref tui_creation_torus "Example"
3283 @ManageTransactions("PrimOp")
3284 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3286 Create a torus with given radiuses at the origin of coordinate system.
3289 theRMajor Torus major radius.
3290 theRMinor Torus minor radius.
3291 theName Object name; when specified, this parameter is used
3292 for result publication in the study. Otherwise, if automatic
3293 publication is switched on, default value is used for result name.
3296 New GEOM.GEOM_Object, containing the created torus.
3298 # Example: see GEOM_TestAll.py
3299 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3300 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3301 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3302 anObj.SetParameters(Parameters)
3303 self._autoPublish(anObj, theName, "torus")
3306 # end of l3_3d_primitives
3309 ## @addtogroup l3_complex
3312 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3313 # @param theBase Base shape to be extruded.
3314 # @param thePoint1 First end of extrusion vector.
3315 # @param thePoint2 Second end of extrusion vector.
3316 # @param theScaleFactor Use it to make prism with scaled second base.
3317 # Nagative value means not scaled second base.
3318 # @param theName Object name; when specified, this parameter is used
3319 # for result publication in the study. Otherwise, if automatic
3320 # publication is switched on, default value is used for result name.
3322 # @return New GEOM.GEOM_Object, containing the created prism.
3324 # @ref tui_creation_prism "Example"
3325 @ManageTransactions("PrimOp")
3326 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3328 Create a shape by extrusion of the base shape along a vector, defined by two points.
3331 theBase Base shape to be extruded.
3332 thePoint1 First end of extrusion vector.
3333 thePoint2 Second end of extrusion vector.
3334 theScaleFactor Use it to make prism with scaled second base.
3335 Nagative value means not scaled second base.
3336 theName Object name; when specified, this parameter is used
3337 for result publication in the study. Otherwise, if automatic
3338 publication is switched on, default value is used for result name.
3341 New GEOM.GEOM_Object, containing the created prism.
3343 # Example: see GEOM_TestAll.py
3346 if theScaleFactor > 0:
3347 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3348 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3350 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3351 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3352 anObj.SetParameters(Parameters)
3353 self._autoPublish(anObj, theName, "prism")
3356 ## Create a shape by extrusion of the base shape along a
3357 # vector, defined by two points, in 2 Ways (forward/backward).
3358 # @param theBase Base shape to be extruded.
3359 # @param thePoint1 First end of extrusion vector.
3360 # @param thePoint2 Second end of extrusion vector.
3361 # @param theName Object name; when specified, this parameter is used
3362 # for result publication in the study. Otherwise, if automatic
3363 # publication is switched on, default value is used for result name.
3365 # @return New GEOM.GEOM_Object, containing the created prism.
3367 # @ref tui_creation_prism "Example"
3368 @ManageTransactions("PrimOp")
3369 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3371 Create a shape by extrusion of the base shape along a
3372 vector, defined by two points, in 2 Ways (forward/backward).
3375 theBase Base shape to be extruded.
3376 thePoint1 First end of extrusion vector.
3377 thePoint2 Second end of extrusion vector.
3378 theName Object name; when specified, this parameter is used
3379 for result publication in the study. Otherwise, if automatic
3380 publication is switched on, default value is used for result name.
3383 New GEOM.GEOM_Object, containing the created prism.
3385 # Example: see GEOM_TestAll.py
3386 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3387 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3388 self._autoPublish(anObj, theName, "prism")
3391 ## Create a shape by extrusion of the base shape along the vector,
3392 # i.e. all the space, transfixed by the base shape during its translation
3393 # along the vector on the given distance.
3394 # @param theBase Base shape to be extruded.
3395 # @param theVec Direction of extrusion.
3396 # @param theH Prism dimension along theVec.
3397 # @param theScaleFactor Use it to make prism with scaled second base.
3398 # Negative value means not scaled second base.
3399 # @param theName Object name; when specified, this parameter is used
3400 # for result publication in the study. Otherwise, if automatic
3401 # publication is switched on, default value is used for result name.
3403 # @return New GEOM.GEOM_Object, containing the created prism.
3405 # @ref tui_creation_prism "Example"
3406 @ManageTransactions("PrimOp")
3407 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3409 Create a shape by extrusion of the base shape along the vector,
3410 i.e. all the space, transfixed by the base shape during its translation
3411 along the vector on the given distance.
3414 theBase Base shape to be extruded.
3415 theVec Direction of extrusion.
3416 theH Prism dimension along theVec.
3417 theScaleFactor Use it to make prism with scaled second base.
3418 Negative value means not scaled second base.
3419 theName Object name; when specified, this parameter is used
3420 for result publication in the study. Otherwise, if automatic
3421 publication is switched on, default value is used for result name.
3424 New GEOM.GEOM_Object, containing the created prism.
3426 # Example: see GEOM_TestAll.py
3429 if theScaleFactor > 0:
3430 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3431 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3433 theH,Parameters = ParseParameters(theH)
3434 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3435 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3436 anObj.SetParameters(Parameters)
3437 self._autoPublish(anObj, theName, "prism")
3440 ## Create a shape by extrusion of the base shape along the vector,
3441 # i.e. all the space, transfixed by the base shape during its translation
3442 # along the vector on the given distance in 2 Ways (forward/backward).
3443 # @param theBase Base shape to be extruded.
3444 # @param theVec Direction of extrusion.
3445 # @param theH Prism dimension along theVec in forward direction.
3446 # @param theName Object name; when specified, this parameter is used
3447 # for result publication in the study. Otherwise, if automatic
3448 # publication is switched on, default value is used for result name.
3450 # @return New GEOM.GEOM_Object, containing the created prism.
3452 # @ref tui_creation_prism "Example"
3453 @ManageTransactions("PrimOp")
3454 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3456 Create a shape by extrusion of the base shape along the vector,
3457 i.e. all the space, transfixed by the base shape during its translation
3458 along the vector on the given distance in 2 Ways (forward/backward).
3461 theBase Base shape to be extruded.
3462 theVec Direction of extrusion.
3463 theH Prism dimension along theVec in forward direction.
3464 theName Object name; when specified, this parameter is used
3465 for result publication in the study. Otherwise, if automatic
3466 publication is switched on, default value is used for result name.
3469 New GEOM.GEOM_Object, containing the created prism.
3471 # Example: see GEOM_TestAll.py
3472 theH,Parameters = ParseParameters(theH)
3473 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3474 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3475 anObj.SetParameters(Parameters)
3476 self._autoPublish(anObj, theName, "prism")
3479 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3480 # @param theBase Base shape to be extruded.
3481 # @param theDX, theDY, theDZ Directions of extrusion.
3482 # @param theScaleFactor Use it to make prism with scaled second base.
3483 # Nagative value means not scaled second base.
3484 # @param theName Object name; when specified, this parameter is used
3485 # for result publication in the study. Otherwise, if automatic
3486 # publication is switched on, default value is used for result name.
3488 # @return New GEOM.GEOM_Object, containing the created prism.
3490 # @ref tui_creation_prism "Example"
3491 @ManageTransactions("PrimOp")
3492 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3494 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3497 theBase Base shape to be extruded.
3498 theDX, theDY, theDZ Directions of extrusion.
3499 theScaleFactor Use it to make prism with scaled second base.
3500 Nagative value means not scaled second base.
3501 theName Object name; when specified, this parameter is used
3502 for result publication in the study. Otherwise, if automatic
3503 publication is switched on, default value is used for result name.
3506 New GEOM.GEOM_Object, containing the created prism.
3508 # Example: see GEOM_TestAll.py
3511 if theScaleFactor > 0:
3512 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3513 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3515 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3516 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3517 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3518 anObj.SetParameters(Parameters)
3519 self._autoPublish(anObj, theName, "prism")
3522 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3523 # i.e. all the space, transfixed by the base shape during its translation
3524 # along the vector on the given distance in 2 Ways (forward/backward).
3525 # @param theBase Base shape to be extruded.
3526 # @param theDX, theDY, theDZ Directions of extrusion.
3527 # @param theName Object name; when specified, this parameter is used
3528 # for result publication in the study. Otherwise, if automatic
3529 # publication is switched on, default value is used for result name.
3531 # @return New GEOM.GEOM_Object, containing the created prism.
3533 # @ref tui_creation_prism "Example"
3534 @ManageTransactions("PrimOp")
3535 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3537 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3538 i.e. all the space, transfixed by the base shape during its translation
3539 along the vector on the given distance in 2 Ways (forward/backward).
3542 theBase Base shape to be extruded.
3543 theDX, theDY, theDZ Directions of extrusion.
3544 theName Object name; when specified, this parameter is used
3545 for result publication in the study. Otherwise, if automatic
3546 publication is switched on, default value is used for result name.
3549 New GEOM.GEOM_Object, containing the created prism.
3551 # Example: see GEOM_TestAll.py
3552 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3553 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3554 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3555 anObj.SetParameters(Parameters)
3556 self._autoPublish(anObj, theName, "prism")
3559 ## Create a shape by revolution of the base shape around the axis
3560 # on the given angle, i.e. all the space, transfixed by the base
3561 # shape during its rotation around the axis on the given angle.
3562 # @param theBase Base shape to be rotated.
3563 # @param theAxis Rotation axis.
3564 # @param theAngle Rotation angle in radians.
3565 # @param theName Object name; when specified, this parameter is used
3566 # for result publication in the study. Otherwise, if automatic
3567 # publication is switched on, default value is used for result name.
3569 # @return New GEOM.GEOM_Object, containing the created revolution.
3571 # @ref tui_creation_revolution "Example"
3572 @ManageTransactions("PrimOp")
3573 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3575 Create a shape by revolution of the base shape around the axis
3576 on the given angle, i.e. all the space, transfixed by the base
3577 shape during its rotation around the axis on the given angle.
3580 theBase Base shape to be rotated.
3581 theAxis Rotation axis.
3582 theAngle Rotation angle in radians.
3583 theName Object name; when specified, this parameter is used
3584 for result publication in the study. Otherwise, if automatic
3585 publication is switched on, default value is used for result name.
3588 New GEOM.GEOM_Object, containing the created revolution.
3590 # Example: see GEOM_TestAll.py
3591 theAngle,Parameters = ParseParameters(theAngle)
3592 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3593 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3594 anObj.SetParameters(Parameters)
3595 self._autoPublish(anObj, theName, "revolution")
3598 ## Create a shape by revolution of the base shape around the axis
3599 # on the given angle, i.e. all the space, transfixed by the base
3600 # shape during its rotation around the axis on the given angle in
3601 # both directions (forward/backward)
3602 # @param theBase Base shape to be rotated.
3603 # @param theAxis Rotation axis.
3604 # @param theAngle Rotation angle in radians.
3605 # @param theName Object name; when specified, this parameter is used
3606 # for result publication in the study. Otherwise, if automatic
3607 # publication is switched on, default value is used for result name.
3609 # @return New GEOM.GEOM_Object, containing the created revolution.
3611 # @ref tui_creation_revolution "Example"
3612 @ManageTransactions("PrimOp")
3613 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3615 Create a shape by revolution of the base shape around the axis
3616 on the given angle, i.e. all the space, transfixed by the base
3617 shape during its rotation around the axis on the given angle in
3618 both directions (forward/backward).
3621 theBase Base shape to be rotated.
3622 theAxis Rotation axis.
3623 theAngle Rotation angle in radians.
3624 theName Object name; when specified, this parameter is used
3625 for result publication in the study. Otherwise, if automatic
3626 publication is switched on, default value is used for result name.
3629 New GEOM.GEOM_Object, containing the created revolution.
3631 theAngle,Parameters = ParseParameters(theAngle)
3632 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3633 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3634 anObj.SetParameters(Parameters)
3635 self._autoPublish(anObj, theName, "revolution")
3638 ## Create a filling from the given compound of contours.
3639 # @param theShape the compound of contours
3640 # @param theMinDeg a minimal degree of BSpline surface to create
3641 # @param theMaxDeg a maximal degree of BSpline surface to create
3642 # @param theTol2D a 2d tolerance to be reached
3643 # @param theTol3D a 3d tolerance to be reached
3644 # @param theNbIter a number of iteration of approximation algorithm
3645 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3646 # @param isApprox if True, BSpline curves are generated in the process
3647 # of surface construction. By default it is False, that means
3648 # the surface is created using given curves. The usage of
3649 # Approximation makes the algorithm work slower, but allows
3650 # building the surface for rather complex cases.
3651 # @param theName Object name; when specified, this parameter is used
3652 # for result publication in the study. Otherwise, if automatic
3653 # publication is switched on, default value is used for result name.
3655 # @return New GEOM.GEOM_Object, containing the created filling surface.
3657 # @ref tui_creation_filling "Example"
3658 @ManageTransactions("PrimOp")
3659 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3660 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3662 Create a filling from the given compound of contours.
3665 theShape the compound of contours
3666 theMinDeg a minimal degree of BSpline surface to create
3667 theMaxDeg a maximal degree of BSpline surface to create
3668 theTol2D a 2d tolerance to be reached
3669 theTol3D a 3d tolerance to be reached
3670 theNbIter a number of iteration of approximation algorithm
3671 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3672 isApprox if True, BSpline curves are generated in the process
3673 of surface construction. By default it is False, that means
3674 the surface is created using given curves. The usage of
3675 Approximation makes the algorithm work slower, but allows
3676 building the surface for rather complex cases
3677 theName Object name; when specified, this parameter is used
3678 for result publication in the study. Otherwise, if automatic
3679 publication is switched on, default value is used for result name.
3682 New GEOM.GEOM_Object, containing the created filling surface.
3685 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3687 # Example: see GEOM_TestAll.py
3688 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3689 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3690 theTol2D, theTol3D, theNbIter,
3691 theMethod, isApprox)
3692 RaiseIfFailed("MakeFilling", self.PrimOp)
3693 anObj.SetParameters(Parameters)
3694 self._autoPublish(anObj, theName, "filling")
3698 ## Create a filling from the given compound of contours.
3699 # This method corresponds to MakeFilling with isApprox=True
3700 # @param theShape the compound of contours
3701 # @param theMinDeg a minimal degree of BSpline surface to create
3702 # @param theMaxDeg a maximal degree of BSpline surface to create
3703 # @param theTol3D a 3d tolerance to be reached
3704 # @param theName Object name; when specified, this parameter is used
3705 # for result publication in the study. Otherwise, if automatic
3706 # publication is switched on, default value is used for result name.
3708 # @return New GEOM.GEOM_Object, containing the created filling surface.
3710 # @ref tui_creation_filling "Example"
3711 @ManageTransactions("PrimOp")
3712 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3714 Create a filling from the given compound of contours.
3715 This method corresponds to MakeFilling with isApprox=True
3718 theShape the compound of contours
3719 theMinDeg a minimal degree of BSpline surface to create
3720 theMaxDeg a maximal degree of BSpline surface to create
3721 theTol3D a 3d tolerance to be reached
3722 theName Object name; when specified, this parameter is used
3723 for result publication in the study. Otherwise, if automatic
3724 publication is switched on, default value is used for result name.
3727 New GEOM.GEOM_Object, containing the created filling surface.
3730 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3732 # Example: see GEOM_TestAll.py
3733 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3734 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3735 0, theTol3D, 0, GEOM.FOM_Default, True)
3736 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3737 anObj.SetParameters(Parameters)
3738 self._autoPublish(anObj, theName, "filling")
3741 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3742 # @param theSeqSections - set of specified sections.
3743 # @param theModeSolid - mode defining building solid or shell
3744 # @param thePreci - precision 3D used for smoothing
3745 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3746 # @param theName Object name; when specified, this parameter is used
3747 # for result publication in the study. Otherwise, if automatic
3748 # publication is switched on, default value is used for result name.
3750 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3752 # @ref swig_todo "Example"
3753 @ManageTransactions("PrimOp")
3754 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3756 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3759 theSeqSections - set of specified sections.
3760 theModeSolid - mode defining building solid or shell
3761 thePreci - precision 3D used for smoothing
3762 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3763 theName Object name; when specified, this parameter is used
3764 for result publication in the study. Otherwise, if automatic
3765 publication is switched on, default value is used for result name.
3768 New GEOM.GEOM_Object, containing the created shell or solid.
3770 # Example: see GEOM_TestAll.py
3771 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3772 RaiseIfFailed("MakeThruSections", self.PrimOp)
3773 self._autoPublish(anObj, theName, "filling")
3776 ## Create a shape by extrusion of the base shape along
3777 # the path shape. The path shape can be a wire or an edge.
3778 # @param theBase Base shape to be extruded.
3779 # @param thePath Path shape to extrude the base shape along it.
3780 # @param theName Object name; when specified, this parameter is used
3781 # for result publication in the study. Otherwise, if automatic
3782 # publication is switched on, default value is used for result name.
3784 # @return New GEOM.GEOM_Object, containing the created pipe.
3786 # @ref tui_creation_pipe "Example"
3787 @ManageTransactions("PrimOp")
3788 def MakePipe(self, theBase, thePath, theName=None):
3790 Create a shape by extrusion of the base shape along
3791 the path shape. The path shape can be a wire or an edge.
3794 theBase Base shape to be extruded.
3795 thePath Path shape to extrude the base shape along it.
3796 theName Object name; when specified, this parameter is used
3797 for result publication in the study. Otherwise, if automatic
3798 publication is switched on, default value is used for result name.
3801 New GEOM.GEOM_Object, containing the created pipe.
3803 # Example: see GEOM_TestAll.py
3804 anObj = self.PrimOp.MakePipe(theBase, thePath)
3805 RaiseIfFailed("MakePipe", self.PrimOp)
3806 self._autoPublish(anObj, theName, "pipe")
3809 ## Create a shape by extrusion of the profile shape along
3810 # the path shape. The path shape can be a wire or an edge.
3811 # the several profiles can be specified in the several locations of path.
3812 # @param theSeqBases - list of Bases shape to be extruded.
3813 # @param theLocations - list of locations on the path corresponding
3814 # specified list of the Bases shapes. Number of locations
3815 # should be equal to number of bases or list of locations can be empty.
3816 # @param thePath - Path shape to extrude the base shape along it.
3817 # @param theWithContact - the mode defining that the section is translated to be in
3818 # contact with the spine.
3819 # @param theWithCorrection - defining that the section is rotated to be
3820 # orthogonal to the spine tangent in the correspondent point
3821 # @param theName Object name; when specified, this parameter is used
3822 # for result publication in the study. Otherwise, if automatic
3823 # publication is switched on, default value is used for result name.
3825 # @return New GEOM.GEOM_Object, containing the created pipe.
3827 # @ref tui_creation_pipe_with_diff_sec "Example"
3828 @ManageTransactions("PrimOp")
3829 def MakePipeWithDifferentSections(self, theSeqBases,
3830 theLocations, thePath,
3831 theWithContact, theWithCorrection, theName=None):
3833 Create a shape by extrusion of the profile shape along
3834 the path shape. The path shape can be a wire or an edge.
3835 the several profiles can be specified in the several locations of path.
3838 theSeqBases - list of Bases shape to be extruded.
3839 theLocations - list of locations on the path corresponding
3840 specified list of the Bases shapes. Number of locations
3841 should be equal to number of bases or list of locations can be empty.
3842 thePath - Path shape to extrude the base shape along it.
3843 theWithContact - the mode defining that the section is translated to be in
3844 contact with the spine(0/1)
3845 theWithCorrection - defining that the section is rotated to be
3846 orthogonal to the spine tangent in the correspondent point (0/1)
3847 theName Object name; when specified, this parameter is used
3848 for result publication in the study. Otherwise, if automatic
3849 publication is switched on, default value is used for result name.
3852 New GEOM.GEOM_Object, containing the created pipe.
3854 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3855 theLocations, thePath,
3856 theWithContact, theWithCorrection)
3857 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3858 self._autoPublish(anObj, theName, "pipe")
3861 ## Create a shape by extrusion of the profile shape along
3862 # the path shape. The path shape can be a wire or a edge.
3863 # the several profiles can be specified in the several locations of path.
3864 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3865 # shell or face. If number of faces in neighbour sections
3866 # aren't coincided result solid between such sections will
3867 # be created using external boundaries of this shells.
3868 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3869 # This list is used for searching correspondences between
3870 # faces in the sections. Size of this list must be equal
3871 # to size of list of base shapes.
3872 # @param theLocations - list of locations on the path corresponding
3873 # specified list of the Bases shapes. Number of locations
3874 # should be equal to number of bases. First and last
3875 # locations must be coincided with first and last vertexes
3876 # of path correspondingly.
3877 # @param thePath - Path shape to extrude the base shape along it.
3878 # @param theWithContact - the mode defining that the section is translated to be in
3879 # contact with the spine.
3880 # @param theWithCorrection - defining that the section is rotated to be
3881 # orthogonal to the spine tangent in the correspondent point
3882 # @param theName Object name; when specified, this parameter is used
3883 # for result publication in the study. Otherwise, if automatic
3884 # publication is switched on, default value is used for result name.
3886 # @return New GEOM.GEOM_Object, containing the created solids.
3888 # @ref tui_creation_pipe_with_shell_sec "Example"
3889 @ManageTransactions("PrimOp")
3890 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3891 theLocations, thePath,
3892 theWithContact, theWithCorrection, theName=None):
3894 Create a shape by extrusion of the profile shape along
3895 the path shape. The path shape can be a wire or a edge.
3896 the several profiles can be specified in the several locations of path.
3899 theSeqBases - list of Bases shape to be extruded. Base shape must be
3900 shell or face. If number of faces in neighbour sections
3901 aren't coincided result solid between such sections will
3902 be created using external boundaries of this shells.
3903 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3904 This list is used for searching correspondences between
3905 faces in the sections. Size of this list must be equal
3906 to size of list of base shapes.
3907 theLocations - list of locations on the path corresponding
3908 specified list of the Bases shapes. Number of locations
3909 should be equal to number of bases. First and last
3910 locations must be coincided with first and last vertexes
3911 of path correspondingly.
3912 thePath - Path shape to extrude the base shape along it.
3913 theWithContact - the mode defining that the section is translated to be in
3914 contact with the spine (0/1)
3915 theWithCorrection - defining that the section is rotated to be
3916 orthogonal to the spine tangent in the correspondent point (0/1)
3917 theName Object name; when specified, this parameter is used
3918 for result publication in the study. Otherwise, if automatic
3919 publication is switched on, default value is used for result name.
3922 New GEOM.GEOM_Object, containing the created solids.
3924 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3925 theLocations, thePath,
3926 theWithContact, theWithCorrection)
3927 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3928 self._autoPublish(anObj, theName, "pipe")
3931 ## Create a shape by extrusion of the profile shape along
3932 # the path shape. This function is used only for debug pipe
3933 # functionality - it is a version of function MakePipeWithShellSections()
3934 # which give a possibility to recieve information about
3935 # creating pipe between each pair of sections step by step.
3936 @ManageTransactions("PrimOp")
3937 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3938 theLocations, thePath,
3939 theWithContact, theWithCorrection, theName=None):
3941 Create a shape by extrusion of the profile shape along
3942 the path shape. This function is used only for debug pipe
3943 functionality - it is a version of previous function
3944 geompy.MakePipeWithShellSections() which give a possibility to
3945 recieve information about creating pipe between each pair of
3946 sections step by step.
3949 nbsect = len(theSeqBases)
3950 nbsubsect = len(theSeqSubBases)
3951 #print "nbsect = ",nbsect
3952 for i in range(1,nbsect):
3954 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3955 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3957 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3958 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3959 tmpLocations, thePath,
3960 theWithContact, theWithCorrection)
3961 if self.PrimOp.IsDone() == 0:
3962 print "Problems with pipe creation between ",i," and ",i+1," sections"
3963 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3966 print "Pipe between ",i," and ",i+1," sections is OK"
3971 resc = self.MakeCompound(res)
3972 #resc = self.MakeSewing(res, 0.001)
3973 #print "resc: ",resc
3974 self._autoPublish(resc, theName, "pipe")
3977 ## Create solids between given sections
3978 # @param theSeqBases - list of sections (shell or face).
3979 # @param theLocations - list of corresponding vertexes
3980 # @param theName Object name; when specified, this parameter is used
3981 # for result publication in the study. Otherwise, if automatic
3982 # publication is switched on, default value is used for result name.
3984 # @return New GEOM.GEOM_Object, containing the created solids.
3986 # @ref tui_creation_pipe_without_path "Example"
3987 @ManageTransactions("PrimOp")
3988 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3990 Create solids between given sections
3993 theSeqBases - list of sections (shell or face).
3994 theLocations - list of corresponding vertexes
3995 theName Object name; when specified, this parameter is used
3996 for result publication in the study. Otherwise, if automatic
3997 publication is switched on, default value is used for result name.
4000 New GEOM.GEOM_Object, containing the created solids.
4002 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4003 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4004 self._autoPublish(anObj, theName, "pipe")
4007 ## Create a shape by extrusion of the base shape along
4008 # the path shape with constant bi-normal direction along the given vector.
4009 # The path shape can be a wire or an edge.
4010 # @param theBase Base shape to be extruded.
4011 # @param thePath Path shape to extrude the base shape along it.
4012 # @param theVec Vector defines a constant binormal direction to keep the
4013 # same angle beetween the direction and the sections
4014 # along the sweep surface.
4015 # @param theName Object name; when specified, this parameter is used
4016 # for result publication in the study. Otherwise, if automatic
4017 # publication is switched on, default value is used for result name.
4019 # @return New GEOM.GEOM_Object, containing the created pipe.
4021 # @ref tui_creation_pipe "Example"
4022 @ManageTransactions("PrimOp")
4023 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4025 Create a shape by extrusion of the base shape along
4026 the path shape with constant bi-normal direction along the given vector.
4027 The path shape can be a wire or an edge.
4030 theBase Base shape to be extruded.
4031 thePath Path shape to extrude the base shape along it.
4032 theVec Vector defines a constant binormal direction to keep the
4033 same angle beetween the direction and the sections
4034 along the sweep surface.
4035 theName Object name; when specified, this parameter is used
4036 for result publication in the study. Otherwise, if automatic
4037 publication is switched on, default value is used for result name.
4040 New GEOM.GEOM_Object, containing the created pipe.
4042 # Example: see GEOM_TestAll.py
4043 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4044 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4045 self._autoPublish(anObj, theName, "pipe")
4048 ## Makes a thick solid from a face or a shell
4049 # @param theShape Face or Shell to be thicken
4050 # @param theThickness Thickness of the resulting solid
4051 # @param theName Object name; when specified, this parameter is used
4052 # for result publication in the study. Otherwise, if automatic
4053 # publication is switched on, default value is used for result name.
4055 # @return New GEOM.GEOM_Object, containing the created solid
4057 @ManageTransactions("PrimOp")
4058 def MakeThickSolid(self, theShape, theThickness, theName=None):
4060 Make a thick solid from a face or a shell
4063 theShape Face or Shell to be thicken
4064 theThickness Thickness of the resulting solid
4065 theName Object name; when specified, this parameter is used
4066 for result publication in the study. Otherwise, if automatic
4067 publication is switched on, default value is used for result name.
4070 New GEOM.GEOM_Object, containing the created solid
4072 # Example: see GEOM_TestAll.py
4073 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4074 RaiseIfFailed("MakeThickening", self.PrimOp)
4075 self._autoPublish(anObj, theName, "pipe")
4079 ## Modifies a face or a shell to make it a thick solid
4080 # @param theShape Face or Shell to be thicken
4081 # @param theThickness Thickness of the resulting solid
4083 # @return The modified shape
4085 @ManageTransactions("PrimOp")
4086 def Thicken(self, theShape, theThickness):
4088 Modifies a face or a shell to make it a thick solid
4091 theBase Base shape to be extruded.
4092 thePath Path shape to extrude the base shape along it.
4093 theName Object name; when specified, this parameter is used
4094 for result publication in the study. Otherwise, if automatic
4095 publication is switched on, default value is used for result name.
4100 # Example: see GEOM_TestAll.py
4101 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4102 RaiseIfFailed("MakeThickening", self.PrimOp)
4105 ## Build a middle path of a pipe-like shape.
4106 # The path shape can be a wire or an edge.
4107 # @param theShape It can be closed or unclosed pipe-like shell
4108 # or a pipe-like solid.
4109 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4110 # should be wires or faces of theShape.
4111 # @param theName Object name; when specified, this parameter is used
4112 # for result publication in the study. Otherwise, if automatic
4113 # publication is switched on, default value is used for result name.
4115 # @note It is not assumed that exact or approximate copy of theShape
4116 # can be obtained by applying existing Pipe operation on the
4117 # resulting "Path" wire taking theBase1 as the base - it is not
4118 # always possible; though in some particular cases it might work
4119 # it is not guaranteed. Thus, RestorePath function should not be
4120 # considered as an exact reverse operation of the Pipe.
4122 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4123 # source pipe's "path".
4125 # @ref tui_creation_pipe_path "Example"
4126 @ManageTransactions("PrimOp")
4127 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4129 Build a middle path of a pipe-like shape.
4130 The path shape can be a wire or an edge.
4133 theShape It can be closed or unclosed pipe-like shell
4134 or a pipe-like solid.
4135 theBase1, theBase2 Two bases of the supposed pipe. This
4136 should be wires or faces of theShape.
4137 theName Object name; when specified, this parameter is used
4138 for result publication in the study. Otherwise, if automatic
4139 publication is switched on, default value is used for result name.
4142 New GEOM_Object, containing an edge or wire that represent
4145 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4146 RaiseIfFailed("RestorePath", self.PrimOp)
4147 self._autoPublish(anObj, theName, "path")
4150 ## Build a middle path of a pipe-like shape.
4151 # The path shape can be a wire or an edge.
4152 # @param theShape It can be closed or unclosed pipe-like shell
4153 # or a pipe-like solid.
4154 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4155 # should be lists of edges of theShape.
4156 # @param theName Object name; when specified, this parameter is used
4157 # for result publication in the study. Otherwise, if automatic
4158 # publication is switched on, default value is used for result name.
4160 # @note It is not assumed that exact or approximate copy of theShape
4161 # can be obtained by applying existing Pipe operation on the
4162 # resulting "Path" wire taking theBase1 as the base - it is not
4163 # always possible; though in some particular cases it might work
4164 # it is not guaranteed. Thus, RestorePath function should not be
4165 # considered as an exact reverse operation of the Pipe.
4167 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4168 # source pipe's "path".
4170 # @ref tui_creation_pipe_path "Example"
4171 @ManageTransactions("PrimOp")
4172 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4174 Build a middle path of a pipe-like shape.
4175 The path shape can be a wire or an edge.
4178 theShape It can be closed or unclosed pipe-like shell
4179 or a pipe-like solid.
4180 listEdges1, listEdges2 Two bases of the supposed pipe. This
4181 should be lists of edges of theShape.
4182 theName Object name; when specified, this parameter is used
4183 for result publication in the study. Otherwise, if automatic
4184 publication is switched on, default value is used for result name.
4187 New GEOM_Object, containing an edge or wire that represent
4190 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4191 RaiseIfFailed("RestorePath", self.PrimOp)
4192 self._autoPublish(anObj, theName, "path")
4198 ## @addtogroup l3_advanced
4201 ## Create a linear edge with specified ends.
4202 # @param thePnt1 Point for the first end of edge.
4203 # @param thePnt2 Point for the second end of edge.
4204 # @param theName Object name; when specified, this parameter is used
4205 # for result publication in the study. Otherwise, if automatic
4206 # publication is switched on, default value is used for result name.
4208 # @return New GEOM.GEOM_Object, containing the created edge.
4210 # @ref tui_creation_edge "Example"
4211 @ManageTransactions("ShapesOp")
4212 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4214 Create a linear edge with specified ends.
4217 thePnt1 Point for the first end of edge.
4218 thePnt2 Point for the second end of edge.
4219 theName Object name; when specified, this parameter is used
4220 for result publication in the study. Otherwise, if automatic
4221 publication is switched on, default value is used for result name.
4224 New GEOM.GEOM_Object, containing the created edge.
4226 # Example: see GEOM_TestAll.py
4227 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4228 RaiseIfFailed("MakeEdge", self.ShapesOp)
4229 self._autoPublish(anObj, theName, "edge")
4232 ## Create a new edge, corresponding to the given length on the given curve.
4233 # @param theRefCurve The referenced curve (edge).
4234 # @param theLength Length on the referenced curve. It can be negative.
4235 # @param theStartPoint Any point can be selected for it, the new edge will begin
4236 # at the end of \a theRefCurve, close to the selected point.
4237 # If None, start from the first point of \a theRefCurve.
4238 # @param theName Object name; when specified, this parameter is used
4239 # for result publication in the study. Otherwise, if automatic
4240 # publication is switched on, default value is used for result name.
4242 # @return New GEOM.GEOM_Object, containing the created edge.
4244 # @ref tui_creation_edge "Example"
4245 @ManageTransactions("ShapesOp")
4246 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4248 Create a new edge, corresponding to the given length on the given curve.
4251 theRefCurve The referenced curve (edge).
4252 theLength Length on the referenced curve. It can be negative.
4253 theStartPoint Any point can be selected for it, the new edge will begin
4254 at the end of theRefCurve, close to the selected point.
4255 If None, start from the first point of theRefCurve.
4256 theName Object name; when specified, this parameter is used
4257 for result publication in the study. Otherwise, if automatic
4258 publication is switched on, default value is used for result name.
4261 New GEOM.GEOM_Object, containing the created edge.
4263 # Example: see GEOM_TestAll.py
4264 theLength, Parameters = ParseParameters(theLength)
4265 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4266 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4267 anObj.SetParameters(Parameters)
4268 self._autoPublish(anObj, theName, "edge")
4271 ## Create an edge from specified wire.
4272 # @param theWire source Wire
4273 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4274 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4275 # @param theName Object name; when specified, this parameter is used
4276 # for result publication in the study. Otherwise, if automatic
4277 # publication is switched on, default value is used for result name.
4279 # @return New GEOM.GEOM_Object, containing the created edge.
4281 # @ref tui_creation_edge "Example"
4282 @ManageTransactions("ShapesOp")
4283 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4285 Create an edge from specified wire.
4289 theLinearTolerance linear tolerance value (default = 1e-07)
4290 theAngularTolerance angular tolerance value (default = 1e-12)
4291 theName Object name; when specified, this parameter is used
4292 for result publication in the study. Otherwise, if automatic
4293 publication is switched on, default value is used for result name.
4296 New GEOM.GEOM_Object, containing the created edge.
4298 # Example: see GEOM_TestAll.py
4299 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4300 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4301 self._autoPublish(anObj, theName, "edge")
4304 ## Create a wire from the set of edges and wires.
4305 # @param theEdgesAndWires List of edges and/or wires.
4306 # @param theTolerance Maximum distance between vertices, that will be merged.
4307 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4308 # @param theName Object name; when specified, this parameter is used
4309 # for result publication in the study. Otherwise, if automatic
4310 # publication is switched on, default value is used for result name.
4312 # @return New GEOM.GEOM_Object, containing the created wire.
4314 # @ref tui_creation_wire "Example"
4315 @ManageTransactions("ShapesOp")
4316 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4318 Create a wire from the set of edges and wires.
4321 theEdgesAndWires List of edges and/or wires.
4322 theTolerance Maximum distance between vertices, that will be merged.
4323 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4324 theName Object name; when specified, this parameter is used
4325 for result publication in the study. Otherwise, if automatic
4326 publication is switched on, default value is used for result name.
4329 New GEOM.GEOM_Object, containing the created wire.
4331 # Example: see GEOM_TestAll.py
4332 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4333 RaiseIfFailed("MakeWire", self.ShapesOp)
4334 self._autoPublish(anObj, theName, "wire")
4337 ## Create a face on the given wire.
4338 # @param theWire closed Wire or Edge to build the face on.
4339 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4340 # If the tolerance of the obtained planar face is less
4341 # than 1e-06, this face will be returned, otherwise the
4342 # algorithm tries to build any suitable face on the given
4343 # wire and prints a warning message.
4344 # @param theName Object name; when specified, this parameter is used
4345 # for result publication in the study. Otherwise, if automatic
4346 # publication is switched on, default value is used for result name.
4348 # @return New GEOM.GEOM_Object, containing the created face.
4350 # @ref tui_creation_face "Example"
4351 @ManageTransactions("ShapesOp")
4352 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4354 Create a face on the given wire.
4357 theWire closed Wire or Edge to build the face on.
4358 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4359 If the tolerance of the obtained planar face is less
4360 than 1e-06, this face will be returned, otherwise the
4361 algorithm tries to build any suitable face on the given
4362 wire and prints a warning message.
4363 theName Object name; when specified, this parameter is used
4364 for result publication in the study. Otherwise, if automatic
4365 publication is switched on, default value is used for result name.
4368 New GEOM.GEOM_Object, containing the created face.
4370 # Example: see GEOM_TestAll.py
4371 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4372 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4373 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4375 RaiseIfFailed("MakeFace", self.ShapesOp)
4376 self._autoPublish(anObj, theName, "face")
4379 ## Create a face on the given wires set.
4380 # @param theWires List of closed wires or edges to build the face on.
4381 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4382 # If the tolerance of the obtained planar face is less
4383 # than 1e-06, this face will be returned, otherwise the
4384 # algorithm tries to build any suitable face on the given
4385 # wire and prints a warning message.
4386 # @param theName Object name; when specified, this parameter is used
4387 # for result publication in the study. Otherwise, if automatic
4388 # publication is switched on, default value is used for result name.
4390 # @return New GEOM.GEOM_Object, containing the created face.
4392 # @ref tui_creation_face "Example"
4393 @ManageTransactions("ShapesOp")
4394 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4396 Create a face on the given wires set.
4399 theWires List of closed wires or edges to build the face on.
4400 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4401 If the tolerance of the obtained planar face is less
4402 than 1e-06, this face will be returned, otherwise the
4403 algorithm tries to build any suitable face on the given
4404 wire and prints a warning message.
4405 theName Object name; when specified, this parameter is used
4406 for result publication in the study. Otherwise, if automatic
4407 publication is switched on, default value is used for result name.
4410 New GEOM.GEOM_Object, containing the created face.
4412 # Example: see GEOM_TestAll.py
4413 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4414 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4415 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4417 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4418 self._autoPublish(anObj, theName, "face")
4421 ## See MakeFaceWires() method for details.
4423 # @ref tui_creation_face "Example 1"
4424 # \n @ref swig_MakeFaces "Example 2"
4425 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4427 See geompy.MakeFaceWires() method for details.
4429 # Example: see GEOM_TestOthers.py
4430 # note: auto-publishing is done in self.MakeFaceWires()
4431 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4434 ## Create a shell from the set of faces and shells.
4435 # @param theFacesAndShells List of faces and/or shells.
4436 # @param theName Object name; when specified, this parameter is used
4437 # for result publication in the study. Otherwise, if automatic
4438 # publication is switched on, default value is used for result name.
4440 # @return New GEOM.GEOM_Object, containing the created shell.
4442 # @ref tui_creation_shell "Example"
4443 @ManageTransactions("ShapesOp")
4444 def MakeShell(self, theFacesAndShells, theName=None):
4446 Create a shell from the set of faces and shells.
4449 theFacesAndShells List of faces and/or shells.
4450 theName Object name; when specified, this parameter is used
4451 for result publication in the study. Otherwise, if automatic
4452 publication is switched on, default value is used for result name.
4455 New GEOM.GEOM_Object, containing the created shell.
4457 # Example: see GEOM_TestAll.py
4458 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4459 RaiseIfFailed("MakeShell", self.ShapesOp)
4460 self._autoPublish(anObj, theName, "shell")
4463 ## Create a solid, bounded by the given shells.
4464 # @param theShells Sequence of bounding shells.
4465 # @param theName Object name; when specified, this parameter is used
4466 # for result publication in the study. Otherwise, if automatic
4467 # publication is switched on, default value is used for result name.
4469 # @return New GEOM.GEOM_Object, containing the created solid.
4471 # @ref tui_creation_solid "Example"
4472 @ManageTransactions("ShapesOp")
4473 def MakeSolid(self, theShells, theName=None):
4475 Create a solid, bounded by the given shells.
4478 theShells Sequence of bounding shells.
4479 theName Object name; when specified, this parameter is used
4480 for result publication in the study. Otherwise, if automatic
4481 publication is switched on, default value is used for result name.
4484 New GEOM.GEOM_Object, containing the created solid.
4486 # Example: see GEOM_TestAll.py
4487 if len(theShells) == 1:
4488 descr = self._IsGoodForSolid(theShells[0])
4490 # raise RuntimeError, "MakeSolidShells : " + descr
4491 if descr == "WRN_SHAPE_UNCLOSED":
4492 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4493 anObj = self.ShapesOp.MakeSolidShells(theShells)
4494 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4495 self._autoPublish(anObj, theName, "solid")
4498 ## Create a compound of the given shapes.
4499 # @param theShapes List of shapes to put in compound.
4500 # @param theName Object name; when specified, this parameter is used
4501 # for result publication in the study. Otherwise, if automatic
4502 # publication is switched on, default value is used for result name.
4504 # @return New GEOM.GEOM_Object, containing the created compound.
4506 # @ref tui_creation_compound "Example"
4507 @ManageTransactions("ShapesOp")
4508 def MakeCompound(self, theShapes, theName=None):
4510 Create a compound of the given shapes.
4513 theShapes List of shapes to put in compound.
4514 theName Object name; when specified, this parameter is used
4515 for result publication in the study. Otherwise, if automatic
4516 publication is switched on, default value is used for result name.
4519 New GEOM.GEOM_Object, containing the created compound.
4521 # Example: see GEOM_TestAll.py
4522 anObj = self.ShapesOp.MakeCompound(theShapes)
4523 RaiseIfFailed("MakeCompound", self.ShapesOp)
4524 self._autoPublish(anObj, theName, "compound")
4527 # end of l3_advanced
4530 ## @addtogroup l2_measure
4533 ## Gives quantity of faces in the given shape.
4534 # @param theShape Shape to count faces of.
4535 # @return Quantity of faces.
4537 # @ref swig_NumberOf "Example"
4538 @ManageTransactions("ShapesOp")
4539 def NumberOfFaces(self, theShape):
4541 Gives quantity of faces in the given shape.
4544 theShape Shape to count faces of.
4549 # Example: see GEOM_TestOthers.py
4550 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4551 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4554 ## Gives quantity of edges in the given shape.
4555 # @param theShape Shape to count edges of.
4556 # @return Quantity of edges.
4558 # @ref swig_NumberOf "Example"
4559 @ManageTransactions("ShapesOp")
4560 def NumberOfEdges(self, theShape):
4562 Gives quantity of edges in the given shape.
4565 theShape Shape to count edges of.
4570 # Example: see GEOM_TestOthers.py
4571 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4572 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4575 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4576 # @param theShape Shape to count sub-shapes of.
4577 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4578 # @return Quantity of sub-shapes of given type.
4580 # @ref swig_NumberOf "Example"
4581 @ManageTransactions("ShapesOp")
4582 def NumberOfSubShapes(self, theShape, theShapeType):
4584 Gives quantity of sub-shapes of type theShapeType in the given shape.
4587 theShape Shape to count sub-shapes of.
4588 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4591 Quantity of sub-shapes of given type.
4593 # Example: see GEOM_TestOthers.py
4594 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4595 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4598 ## Gives quantity of solids in the given shape.
4599 # @param theShape Shape to count solids in.
4600 # @return Quantity of solids.
4602 # @ref swig_NumberOf "Example"
4603 @ManageTransactions("ShapesOp")
4604 def NumberOfSolids(self, theShape):
4606 Gives quantity of solids in the given shape.
4609 theShape Shape to count solids in.
4614 # Example: see GEOM_TestOthers.py
4615 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4616 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4622 ## @addtogroup l3_healing
4625 ## Reverses an orientation the given shape.
4626 # @param theShape Shape to be reversed.
4627 # @param theName Object name; when specified, this parameter is used
4628 # for result publication in the study. Otherwise, if automatic
4629 # publication is switched on, default value is used for result name.
4631 # @return The reversed copy of theShape.
4633 # @ref swig_ChangeOrientation "Example"
4634 @ManageTransactions("ShapesOp")
4635 def ChangeOrientation(self, theShape, theName=None):
4637 Reverses an orientation the given shape.
4640 theShape Shape to be reversed.
4641 theName Object name; when specified, this parameter is used
4642 for result publication in the study. Otherwise, if automatic
4643 publication is switched on, default value is used for result name.
4646 The reversed copy of theShape.
4648 # Example: see GEOM_TestAll.py
4649 anObj = self.ShapesOp.ChangeOrientation(theShape)
4650 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4651 self._autoPublish(anObj, theName, "reversed")
4654 ## See ChangeOrientation() method for details.
4656 # @ref swig_OrientationChange "Example"
4657 def OrientationChange(self, theShape, theName=None):
4659 See geompy.ChangeOrientation method for details.
4661 # Example: see GEOM_TestOthers.py
4662 # note: auto-publishing is done in self.ChangeOrientation()
4663 anObj = self.ChangeOrientation(theShape, theName)
4669 ## @addtogroup l4_obtain
4672 ## Retrieve all free faces from the given shape.
4673 # Free face is a face, which is not shared between two shells of the shape.
4674 # @param theShape Shape to find free faces in.
4675 # @return List of IDs of all free faces, contained in theShape.
4677 # @ref tui_measurement_tools_page "Example"
4678 @ManageTransactions("ShapesOp")
4679 def GetFreeFacesIDs(self,theShape):
4681 Retrieve all free faces from the given shape.
4682 Free face is a face, which is not shared between two shells of the shape.
4685 theShape Shape to find free faces in.
4688 List of IDs of all free faces, contained in theShape.
4690 # Example: see GEOM_TestOthers.py
4691 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4692 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4695 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4696 # @param theShape1 Shape to find sub-shapes in.
4697 # @param theShape2 Shape to find shared sub-shapes with.
4698 # @param theShapeType Type of sub-shapes to be retrieved.
4699 # @param theName Object name; when specified, this parameter is used
4700 # for result publication in the study. Otherwise, if automatic
4701 # publication is switched on, default value is used for result name.
4703 # @return List of sub-shapes of theShape1, shared with theShape2.
4705 # @ref swig_GetSharedShapes "Example"
4706 @ManageTransactions("ShapesOp")
4707 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4709 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4712 theShape1 Shape to find sub-shapes in.
4713 theShape2 Shape to find shared sub-shapes with.
4714 theShapeType Type of sub-shapes to be retrieved.
4715 theName Object name; when specified, this parameter is used
4716 for result publication in the study. Otherwise, if automatic
4717 publication is switched on, default value is used for result name.
4720 List of sub-shapes of theShape1, shared with theShape2.
4722 # Example: see GEOM_TestOthers.py
4723 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4724 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4725 self._autoPublish(aList, theName, "shared")
4728 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4729 # @param theShapes Shapes to find common sub-shapes of.
4730 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4731 # @param theName Object name; when specified, this parameter is used
4732 # for result publication in the study. Otherwise, if automatic
4733 # publication is switched on, default value is used for result name.
4735 # @return List of objects, that are sub-shapes of all given shapes.
4737 # @ref swig_GetSharedShapes "Example"
4738 @ManageTransactions("ShapesOp")
4739 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4741 Get all sub-shapes, shared by all shapes in the list theShapes.
4744 theShapes Shapes to find common sub-shapes of.
4745 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4746 theName Object name; when specified, this parameter is used
4747 for result publication in the study. Otherwise, if automatic
4748 publication is switched on, default value is used for result name.
4751 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4753 # Example: see GEOM_TestOthers.py
4754 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4755 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4756 self._autoPublish(aList, theName, "shared")
4759 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4760 # situated relatively the specified plane by the certain way,
4761 # defined through <VAR>theState</VAR> parameter.
4762 # @param theShape Shape to find sub-shapes of.
4763 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4764 # @param theAx1 Vector (or line, or linear edge), specifying normal
4765 # direction and location of the plane to find shapes on.
4766 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4767 # @param theName Object name; when specified, this parameter is used
4768 # for result publication in the study. Otherwise, if automatic
4769 # publication is switched on, default value is used for result name.
4771 # @return List of all found sub-shapes.
4773 # @ref swig_GetShapesOnPlane "Example"
4774 @ManageTransactions("ShapesOp")
4775 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4777 Find in theShape all sub-shapes of type theShapeType,
4778 situated relatively the specified plane by the certain way,
4779 defined through theState parameter.
4782 theShape Shape to find sub-shapes of.
4783 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4784 theAx1 Vector (or line, or linear edge), specifying normal
4785 direction and location of the plane to find shapes on.
4786 theState The state of the sub-shapes to find (see GEOM::shape_state)
4787 theName Object name; when specified, this parameter is used
4788 for result publication in the study. Otherwise, if automatic
4789 publication is switched on, default value is used for result name.
4792 List of all found sub-shapes.
4794 # Example: see GEOM_TestOthers.py
4795 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4796 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4797 self._autoPublish(aList, theName, "shapeOnPlane")
4800 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4801 # situated relatively the specified plane by the certain way,
4802 # defined through <VAR>theState</VAR> parameter.
4803 # @param theShape Shape to find sub-shapes of.
4804 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4805 # @param theAx1 Vector (or line, or linear edge), specifying normal
4806 # direction and location of the plane to find shapes on.
4807 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4809 # @return List of all found sub-shapes indices.
4811 # @ref swig_GetShapesOnPlaneIDs "Example"
4812 @ManageTransactions("ShapesOp")
4813 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4815 Find in theShape all sub-shapes of type theShapeType,
4816 situated relatively the specified plane by the certain way,
4817 defined through theState parameter.
4820 theShape Shape to find sub-shapes of.
4821 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4822 theAx1 Vector (or line, or linear edge), specifying normal
4823 direction and location of the plane to find shapes on.
4824 theState The state of the sub-shapes to find (see GEOM::shape_state)
4827 List of all found sub-shapes indices.
4829 # Example: see GEOM_TestOthers.py
4830 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4831 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4834 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4835 # situated relatively the specified plane by the certain way,
4836 # defined through <VAR>theState</VAR> parameter.
4837 # @param theShape Shape to find sub-shapes of.
4838 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4839 # @param theAx1 Vector (or line, or linear edge), specifying normal
4840 # direction of the plane to find shapes on.
4841 # @param thePnt Point specifying location of the plane to find shapes on.
4842 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4843 # @param theName Object name; when specified, this parameter is used
4844 # for result publication in the study. Otherwise, if automatic
4845 # publication is switched on, default value is used for result name.
4847 # @return List of all found sub-shapes.
4849 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4850 @ManageTransactions("ShapesOp")
4851 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4853 Find in theShape all sub-shapes of type theShapeType,
4854 situated relatively the specified plane by the certain way,
4855 defined through theState parameter.
4858 theShape Shape to find sub-shapes of.
4859 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4860 theAx1 Vector (or line, or linear edge), specifying normal
4861 direction and location of the plane to find shapes on.
4862 thePnt Point specifying location of the plane to find shapes on.
4863 theState The state of the sub-shapes to find (see GEOM::shape_state)
4864 theName Object name; when specified, this parameter is used
4865 for result publication in the study. Otherwise, if automatic
4866 publication is switched on, default value is used for result name.
4869 List of all found sub-shapes.
4871 # Example: see GEOM_TestOthers.py
4872 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4873 theAx1, thePnt, theState)
4874 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4875 self._autoPublish(aList, theName, "shapeOnPlane")
4878 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4879 # situated relatively the specified plane by the certain way,
4880 # defined through <VAR>theState</VAR> parameter.
4881 # @param theShape Shape to find sub-shapes of.
4882 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4883 # @param theAx1 Vector (or line, or linear edge), specifying normal
4884 # direction of the plane to find shapes on.
4885 # @param thePnt Point specifying location of the plane to find shapes on.
4886 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4888 # @return List of all found sub-shapes indices.
4890 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4891 @ManageTransactions("ShapesOp")
4892 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4894 Find in theShape all sub-shapes of type theShapeType,
4895 situated relatively the specified plane by the certain way,
4896 defined through theState parameter.
4899 theShape Shape to find sub-shapes of.
4900 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4901 theAx1 Vector (or line, or linear edge), specifying normal
4902 direction and location of the plane to find shapes on.
4903 thePnt Point specifying location of the plane to find shapes on.
4904 theState The state of the sub-shapes to find (see GEOM::shape_state)
4907 List of all found sub-shapes indices.
4909 # Example: see GEOM_TestOthers.py
4910 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4911 theAx1, thePnt, theState)
4912 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4915 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4916 # the specified cylinder by the certain way, defined through \a theState parameter.
4917 # @param theShape Shape to find sub-shapes of.
4918 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4919 # @param theAxis Vector (or line, or linear edge), specifying
4920 # axis of the cylinder to find shapes on.
4921 # @param theRadius Radius of the cylinder to find shapes on.
4922 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4923 # @param theName Object name; when specified, this parameter is used
4924 # for result publication in the study. Otherwise, if automatic
4925 # publication is switched on, default value is used for result name.
4927 # @return List of all found sub-shapes.
4929 # @ref swig_GetShapesOnCylinder "Example"
4930 @ManageTransactions("ShapesOp")
4931 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4933 Find in theShape all sub-shapes of type theShapeType, situated relatively
4934 the specified cylinder by the certain way, defined through theState parameter.
4937 theShape Shape to find sub-shapes of.
4938 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4939 theAxis Vector (or line, or linear edge), specifying
4940 axis of the cylinder to find shapes on.
4941 theRadius Radius of the cylinder to find shapes on.
4942 theState The state of the sub-shapes to find (see GEOM::shape_state)
4943 theName Object name; when specified, this parameter is used
4944 for result publication in the study. Otherwise, if automatic
4945 publication is switched on, default value is used for result name.
4948 List of all found sub-shapes.
4950 # Example: see GEOM_TestOthers.py
4951 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4952 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4953 self._autoPublish(aList, theName, "shapeOnCylinder")
4956 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4957 # the specified cylinder by the certain way, defined through \a theState parameter.
4958 # @param theShape Shape to find sub-shapes of.
4959 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4960 # @param theAxis Vector (or line, or linear edge), specifying
4961 # axis of the cylinder to find shapes on.
4962 # @param theRadius Radius of the cylinder to find shapes on.
4963 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4965 # @return List of all found sub-shapes indices.
4967 # @ref swig_GetShapesOnCylinderIDs "Example"
4968 @ManageTransactions("ShapesOp")
4969 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4971 Find in theShape all sub-shapes of type theShapeType, situated relatively
4972 the specified cylinder by the certain way, defined through theState parameter.
4975 theShape Shape to find sub-shapes of.
4976 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4977 theAxis Vector (or line, or linear edge), specifying
4978 axis of the cylinder to find shapes on.
4979 theRadius Radius of the cylinder to find shapes on.
4980 theState The state of the sub-shapes to find (see GEOM::shape_state)
4983 List of all found sub-shapes indices.
4985 # Example: see GEOM_TestOthers.py
4986 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4987 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4990 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4991 # the specified cylinder by the certain way, defined through \a theState parameter.
4992 # @param theShape Shape to find sub-shapes of.
4993 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4994 # @param theAxis Vector (or line, or linear edge), specifying
4995 # axis of the cylinder to find shapes on.
4996 # @param thePnt Point specifying location of the bottom of the cylinder.
4997 # @param theRadius Radius of the cylinder to find shapes on.
4998 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4999 # @param theName Object name; when specified, this parameter is used
5000 # for result publication in the study. Otherwise, if automatic
5001 # publication is switched on, default value is used for result name.
5003 # @return List of all found sub-shapes.
5005 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5006 @ManageTransactions("ShapesOp")
5007 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5009 Find in theShape all sub-shapes of type theShapeType, situated relatively
5010 the specified cylinder by the certain way, defined through theState parameter.
5013 theShape Shape to find sub-shapes of.
5014 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5015 theAxis Vector (or line, or linear edge), specifying
5016 axis of the cylinder to find shapes on.
5017 theRadius Radius of the cylinder to find shapes on.
5018 theState The state of the sub-shapes to find (see GEOM::shape_state)
5019 theName Object name; when specified, this parameter is used
5020 for result publication in the study. Otherwise, if automatic
5021 publication is switched on, default value is used for result name.
5024 List of all found sub-shapes.
5026 # Example: see GEOM_TestOthers.py
5027 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5028 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5029 self._autoPublish(aList, theName, "shapeOnCylinder")
5032 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5033 # the specified cylinder by the certain way, defined through \a theState parameter.
5034 # @param theShape Shape to find sub-shapes of.
5035 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5036 # @param theAxis Vector (or line, or linear edge), specifying
5037 # axis of the cylinder to find shapes on.
5038 # @param thePnt Point specifying location of the bottom of the cylinder.
5039 # @param theRadius Radius of the cylinder to find shapes on.
5040 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5042 # @return List of all found sub-shapes indices
5044 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5045 @ManageTransactions("ShapesOp")
5046 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5048 Find in theShape all sub-shapes of type theShapeType, situated relatively
5049 the specified cylinder by the certain way, defined through theState parameter.
5052 theShape Shape to find sub-shapes of.
5053 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5054 theAxis Vector (or line, or linear edge), specifying
5055 axis of the cylinder to find shapes on.
5056 theRadius Radius of the cylinder to find shapes on.
5057 theState The state of the sub-shapes to find (see GEOM::shape_state)
5060 List of all found sub-shapes indices.
5062 # Example: see GEOM_TestOthers.py
5063 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5064 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5067 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5068 # the specified sphere by the certain way, defined through \a theState parameter.
5069 # @param theShape Shape to find sub-shapes of.
5070 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5071 # @param theCenter Point, specifying center of the sphere to find shapes on.
5072 # @param theRadius Radius of the sphere to find shapes on.
5073 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5074 # @param theName Object name; when specified, this parameter is used
5075 # for result publication in the study. Otherwise, if automatic
5076 # publication is switched on, default value is used for result name.
5078 # @return List of all found sub-shapes.
5080 # @ref swig_GetShapesOnSphere "Example"
5081 @ManageTransactions("ShapesOp")
5082 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5084 Find in theShape all sub-shapes of type theShapeType, situated relatively
5085 the specified sphere by the certain way, defined through theState parameter.
5088 theShape Shape to find sub-shapes of.
5089 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5090 theCenter Point, specifying center of the sphere to find shapes on.
5091 theRadius Radius of the sphere to find shapes on.
5092 theState The state of the sub-shapes to find (see GEOM::shape_state)
5093 theName Object name; when specified, this parameter is used
5094 for result publication in the study. Otherwise, if automatic
5095 publication is switched on, default value is used for result name.
5098 List of all found sub-shapes.
5100 # Example: see GEOM_TestOthers.py
5101 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5102 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5103 self._autoPublish(aList, theName, "shapeOnSphere")
5106 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5107 # the specified sphere by the certain way, defined through \a theState parameter.
5108 # @param theShape Shape to find sub-shapes of.
5109 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5110 # @param theCenter Point, specifying center of the sphere to find shapes on.
5111 # @param theRadius Radius of the sphere to find shapes on.
5112 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5114 # @return List of all found sub-shapes indices.
5116 # @ref swig_GetShapesOnSphereIDs "Example"
5117 @ManageTransactions("ShapesOp")
5118 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5120 Find in theShape all sub-shapes of type theShapeType, situated relatively
5121 the specified sphere by the certain way, defined through theState parameter.
5124 theShape Shape to find sub-shapes of.
5125 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5126 theCenter Point, specifying center of the sphere to find shapes on.
5127 theRadius Radius of the sphere to find shapes on.
5128 theState The state of the sub-shapes to find (see GEOM::shape_state)
5131 List of all found sub-shapes indices.
5133 # Example: see GEOM_TestOthers.py
5134 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5135 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5138 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5139 # the specified quadrangle by the certain way, defined through \a theState parameter.
5140 # @param theShape Shape to find sub-shapes of.
5141 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5142 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5143 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5144 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5145 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5146 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5147 # @param theName Object name; when specified, this parameter is used
5148 # for result publication in the study. Otherwise, if automatic
5149 # publication is switched on, default value is used for result name.
5151 # @return List of all found sub-shapes.
5153 # @ref swig_GetShapesOnQuadrangle "Example"
5154 @ManageTransactions("ShapesOp")
5155 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5156 theTopLeftPoint, theTopRigthPoint,
5157 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5159 Find in theShape all sub-shapes of type theShapeType, situated relatively
5160 the specified quadrangle by the certain way, defined through theState parameter.
5163 theShape Shape to find sub-shapes of.
5164 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5165 theTopLeftPoint Point, specifying top left corner of a quadrangle
5166 theTopRigthPoint Point, specifying top right corner of a quadrangle
5167 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5168 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5169 theState The state of the sub-shapes to find (see GEOM::shape_state)
5170 theName Object name; when specified, this parameter is used
5171 for result publication in the study. Otherwise, if automatic
5172 publication is switched on, default value is used for result name.
5175 List of all found sub-shapes.
5177 # Example: see GEOM_TestOthers.py
5178 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5179 theTopLeftPoint, theTopRigthPoint,
5180 theBottomLeftPoint, theBottomRigthPoint, theState)
5181 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5182 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5185 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5186 # the specified quadrangle by the certain way, defined through \a theState parameter.
5187 # @param theShape Shape to find sub-shapes of.
5188 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5189 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5190 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5191 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5192 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5193 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5195 # @return List of all found sub-shapes indices.
5197 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5198 @ManageTransactions("ShapesOp")
5199 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5200 theTopLeftPoint, theTopRigthPoint,
5201 theBottomLeftPoint, theBottomRigthPoint, theState):
5203 Find in theShape all sub-shapes of type theShapeType, situated relatively
5204 the specified quadrangle by the certain way, defined through theState parameter.
5207 theShape Shape to find sub-shapes of.
5208 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5209 theTopLeftPoint Point, specifying top left corner of a quadrangle
5210 theTopRigthPoint Point, specifying top right corner of a quadrangle
5211 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5212 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5213 theState The state of the sub-shapes to find (see GEOM::shape_state)
5216 List of all found sub-shapes indices.
5219 # Example: see GEOM_TestOthers.py
5220 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5221 theTopLeftPoint, theTopRigthPoint,
5222 theBottomLeftPoint, theBottomRigthPoint, theState)
5223 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5226 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5227 # the specified \a theBox by the certain way, defined through \a theState parameter.
5228 # @param theBox Shape for relative comparing.
5229 # @param theShape Shape to find sub-shapes of.
5230 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5231 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5232 # @param theName Object name; when specified, this parameter is used
5233 # for result publication in the study. Otherwise, if automatic
5234 # publication is switched on, default value is used for result name.
5236 # @return List of all found sub-shapes.
5238 # @ref swig_GetShapesOnBox "Example"
5239 @ManageTransactions("ShapesOp")
5240 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5242 Find in theShape all sub-shapes of type theShapeType, situated relatively
5243 the specified theBox by the certain way, defined through theState parameter.
5246 theBox Shape for relative comparing.
5247 theShape Shape to find sub-shapes of.
5248 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5249 theState The state of the sub-shapes to find (see GEOM::shape_state)
5250 theName Object name; when specified, this parameter is used
5251 for result publication in the study. Otherwise, if automatic
5252 publication is switched on, default value is used for result name.
5255 List of all found sub-shapes.
5257 # Example: see GEOM_TestOthers.py
5258 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5259 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5260 self._autoPublish(aList, theName, "shapeOnBox")
5263 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5264 # the specified \a theBox by the certain way, defined through \a theState parameter.
5265 # @param theBox Shape for relative comparing.
5266 # @param theShape Shape to find sub-shapes of.
5267 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5268 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5270 # @return List of all found sub-shapes indices.
5272 # @ref swig_GetShapesOnBoxIDs "Example"
5273 @ManageTransactions("ShapesOp")
5274 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5276 Find in theShape all sub-shapes of type theShapeType, situated relatively
5277 the specified theBox by the certain way, defined through theState parameter.
5280 theBox Shape for relative comparing.
5281 theShape Shape to find sub-shapes of.
5282 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5283 theState The state of the sub-shapes to find (see GEOM::shape_state)
5286 List of all found sub-shapes indices.
5288 # Example: see GEOM_TestOthers.py
5289 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5290 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5293 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5294 # situated relatively the specified \a theCheckShape by the
5295 # certain way, defined through \a theState parameter.
5296 # @param theCheckShape Shape for relative comparing. It must be a solid.
5297 # @param theShape Shape to find sub-shapes of.
5298 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5299 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5300 # @param theName Object name; when specified, this parameter is used
5301 # for result publication in the study. Otherwise, if automatic
5302 # publication is switched on, default value is used for result name.
5304 # @return List of all found sub-shapes.
5306 # @ref swig_GetShapesOnShape "Example"
5307 @ManageTransactions("ShapesOp")
5308 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5310 Find in theShape all sub-shapes of type theShapeType,
5311 situated relatively the specified theCheckShape by the
5312 certain way, defined through theState parameter.
5315 theCheckShape Shape for relative comparing. It must be a solid.
5316 theShape Shape to find sub-shapes of.
5317 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5318 theState The state of the sub-shapes to find (see GEOM::shape_state)
5319 theName Object name; when specified, this parameter is used
5320 for result publication in the study. Otherwise, if automatic
5321 publication is switched on, default value is used for result name.
5324 List of all found sub-shapes.
5326 # Example: see GEOM_TestOthers.py
5327 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5328 theShapeType, theState)
5329 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5330 self._autoPublish(aList, theName, "shapeOnShape")
5333 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5334 # situated relatively the specified \a theCheckShape by the
5335 # certain way, defined through \a theState parameter.
5336 # @param theCheckShape Shape for relative comparing. It must be a solid.
5337 # @param theShape Shape to find sub-shapes of.
5338 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5339 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5340 # @param theName Object name; when specified, this parameter is used
5341 # for result publication in the study. Otherwise, if automatic
5342 # publication is switched on, default value is used for result name.
5344 # @return All found sub-shapes as compound.
5346 # @ref swig_GetShapesOnShapeAsCompound "Example"
5347 @ManageTransactions("ShapesOp")
5348 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5350 Find in theShape all sub-shapes of type theShapeType,
5351 situated relatively the specified theCheckShape by the
5352 certain way, defined through theState parameter.
5355 theCheckShape Shape for relative comparing. It must be a solid.
5356 theShape Shape to find sub-shapes of.
5357 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5358 theState The state of the sub-shapes to find (see GEOM::shape_state)
5359 theName Object name; when specified, this parameter is used
5360 for result publication in the study. Otherwise, if automatic
5361 publication is switched on, default value is used for result name.
5364 All found sub-shapes as compound.
5366 # Example: see GEOM_TestOthers.py
5367 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5368 theShapeType, theState)
5369 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5370 self._autoPublish(anObj, theName, "shapeOnShape")
5373 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5374 # situated relatively the specified \a theCheckShape by the
5375 # certain way, defined through \a theState parameter.
5376 # @param theCheckShape Shape for relative comparing. It must be a solid.
5377 # @param theShape Shape to find sub-shapes of.
5378 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5379 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5381 # @return List of all found sub-shapes indices.
5383 # @ref swig_GetShapesOnShapeIDs "Example"
5384 @ManageTransactions("ShapesOp")
5385 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5387 Find in theShape all sub-shapes of type theShapeType,
5388 situated relatively the specified theCheckShape by the
5389 certain way, defined through theState parameter.
5392 theCheckShape Shape for relative comparing. It must be a solid.
5393 theShape Shape to find sub-shapes of.
5394 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5395 theState The state of the sub-shapes to find (see GEOM::shape_state)
5398 List of all found sub-shapes indices.
5400 # Example: see GEOM_TestOthers.py
5401 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5402 theShapeType, theState)
5403 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5406 ## Get sub-shape(s) of theShapeWhere, which are
5407 # coincident with \a theShapeWhat or could be a part of it.
5408 # @param theShapeWhere Shape to find sub-shapes of.
5409 # @param theShapeWhat Shape, specifying what to find.
5410 # @param isNewImplementation implementation of GetInPlace functionality
5411 # (default = False, old alghorithm based on shape properties)
5412 # @param theName Object name; when specified, this parameter is used
5413 # for result publication in the study. Otherwise, if automatic
5414 # publication is switched on, default value is used for result name.
5416 # @return Group of all found sub-shapes or a single found sub-shape.
5418 # @note This function has a restriction on argument shapes.
5419 # If \a theShapeWhere has curved parts with significantly
5420 # outstanding centres (i.e. the mass centre of a part is closer to
5421 # \a theShapeWhat than to the part), such parts will not be found.
5422 # @image html get_in_place_lost_part.png
5424 # @ref swig_GetInPlace "Example"
5425 @ManageTransactions("ShapesOp")
5426 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5428 Get sub-shape(s) of theShapeWhere, which are
5429 coincident with theShapeWhat or could be a part of it.
5432 theShapeWhere Shape to find sub-shapes of.
5433 theShapeWhat Shape, specifying what to find.
5434 isNewImplementation Implementation of GetInPlace functionality
5435 (default = False, old alghorithm based on shape properties)
5436 theName Object name; when specified, this parameter is used
5437 for result publication in the study. Otherwise, if automatic
5438 publication is switched on, default value is used for result name.
5441 Group of all found sub-shapes or a single found sub-shape.
5445 This function has a restriction on argument shapes.
5446 If theShapeWhere has curved parts with significantly
5447 outstanding centres (i.e. the mass centre of a part is closer to
5448 theShapeWhat than to the part), such parts will not be found.
5450 # Example: see GEOM_TestOthers.py
5452 if isNewImplementation:
5453 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5455 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5457 RaiseIfFailed("GetInPlace", self.ShapesOp)
5458 self._autoPublish(anObj, theName, "inplace")
5461 ## Get sub-shape(s) of \a theShapeWhere, which are
5462 # coincident with \a theShapeWhat or could be a part of it.
5464 # Implementation of this method is based on a saved history of an operation,
5465 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5466 # arguments (an argument shape or a sub-shape of an argument shape).
5467 # The operation could be the Partition or one of boolean operations,
5468 # performed on simple shapes (not on compounds).
5470 # @param theShapeWhere Shape to find sub-shapes of.
5471 # @param theShapeWhat Shape, specifying what to find (must be in the
5472 # building history of the ShapeWhere).
5473 # @param theName Object name; when specified, this parameter is used
5474 # for result publication in the study. Otherwise, if automatic
5475 # publication is switched on, default value is used for result name.
5477 # @return Group of all found sub-shapes or a single found sub-shape.
5479 # @ref swig_GetInPlace "Example"
5480 @ManageTransactions("ShapesOp")
5481 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5483 Implementation of this method is based on a saved history of an operation,
5484 produced theShapeWhere. The theShapeWhat must be among this operation's
5485 arguments (an argument shape or a sub-shape of an argument shape).
5486 The operation could be the Partition or one of boolean operations,
5487 performed on simple shapes (not on compounds).
5490 theShapeWhere Shape to find sub-shapes of.
5491 theShapeWhat Shape, specifying what to find (must be in the
5492 building history of the ShapeWhere).
5493 theName Object name; when specified, this parameter is used
5494 for result publication in the study. Otherwise, if automatic
5495 publication is switched on, default value is used for result name.
5498 Group of all found sub-shapes or a single found sub-shape.
5500 # Example: see GEOM_TestOthers.py
5501 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5502 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5503 self._autoPublish(anObj, theName, "inplace")
5506 ## Get sub-shape of theShapeWhere, which is
5507 # equal to \a theShapeWhat.
5508 # @param theShapeWhere Shape to find sub-shape of.
5509 # @param theShapeWhat Shape, specifying what to find.
5510 # @param theName Object name; when specified, this parameter is used
5511 # for result publication in the study. Otherwise, if automatic
5512 # publication is switched on, default value is used for result name.
5514 # @return New GEOM.GEOM_Object for found sub-shape.
5516 # @ref swig_GetSame "Example"
5517 @ManageTransactions("ShapesOp")
5518 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5520 Get sub-shape of theShapeWhere, which is
5521 equal to theShapeWhat.
5524 theShapeWhere Shape to find sub-shape of.
5525 theShapeWhat Shape, specifying what to find.
5526 theName Object name; when specified, this parameter is used
5527 for result publication in the study. Otherwise, if automatic
5528 publication is switched on, default value is used for result name.
5531 New GEOM.GEOM_Object for found sub-shape.
5533 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5534 RaiseIfFailed("GetSame", self.ShapesOp)
5535 self._autoPublish(anObj, theName, "sameShape")
5539 ## Get sub-shape indices of theShapeWhere, which is
5540 # equal to \a theShapeWhat.
5541 # @param theShapeWhere Shape to find sub-shape of.
5542 # @param theShapeWhat Shape, specifying what to find.
5543 # @return List of all found sub-shapes indices.
5545 # @ref swig_GetSame "Example"
5546 @ManageTransactions("ShapesOp")
5547 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5549 Get sub-shape indices of theShapeWhere, which is
5550 equal to theShapeWhat.
5553 theShapeWhere Shape to find sub-shape of.
5554 theShapeWhat Shape, specifying what to find.
5557 List of all found sub-shapes indices.
5559 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5560 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5567 ## @addtogroup l4_access
5570 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5571 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5572 # @param aShape Shape to get sub-shape of.
5573 # @param ListOfID List of sub-shapes indices.
5574 # @param theName Object name; when specified, this parameter is used
5575 # for result publication in the study. Otherwise, if automatic
5576 # publication is switched on, default value is used for result name.
5578 # @return Found sub-shape.
5580 # @ref swig_all_decompose "Example"
5581 def GetSubShape(self, aShape, ListOfID, theName=None):
5583 Obtain a composite sub-shape of aShape, composed from sub-shapes
5584 of aShape, selected by their unique IDs inside aShape
5587 aShape Shape to get sub-shape of.
5588 ListOfID List of sub-shapes indices.
5589 theName Object name; when specified, this parameter is used
5590 for result publication in the study. Otherwise, if automatic
5591 publication is switched on, default value is used for result name.
5596 # Example: see GEOM_TestAll.py
5597 anObj = self.AddSubShape(aShape,ListOfID)
5598 self._autoPublish(anObj, theName, "subshape")
5601 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5602 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5603 # @param aShape Shape to get sub-shape of.
5604 # @param aSubShape Sub-shapes of aShape.
5605 # @return ID of found sub-shape.
5607 # @ref swig_all_decompose "Example"
5608 @ManageTransactions("LocalOp")
5609 def GetSubShapeID(self, aShape, aSubShape):
5611 Obtain unique ID of sub-shape aSubShape inside aShape
5612 of aShape, selected by their unique IDs inside aShape
5615 aShape Shape to get sub-shape of.
5616 aSubShape Sub-shapes of aShape.
5619 ID of found sub-shape.
5621 # Example: see GEOM_TestAll.py
5622 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5623 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5626 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5627 # This function is provided for performance purpose. The complexity is O(n) with n
5628 # the number of subobjects of aShape
5629 # @param aShape Shape to get sub-shape of.
5630 # @param aSubShapes Sub-shapes of aShape.
5631 # @return list of IDs of found sub-shapes.
5633 # @ref swig_all_decompose "Example"
5634 @ManageTransactions("ShapesOp")
5635 def GetSubShapesIDs(self, aShape, aSubShapes):
5637 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5638 This function is provided for performance purpose. The complexity is O(n) with n
5639 the number of subobjects of aShape
5642 aShape Shape to get sub-shape of.
5643 aSubShapes Sub-shapes of aShape.
5646 List of IDs of found sub-shape.
5648 # Example: see GEOM_TestAll.py
5649 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5650 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5656 ## @addtogroup l4_decompose
5659 ## Get all sub-shapes and groups of \a theShape,
5660 # that were created already by any other methods.
5661 # @param theShape Any shape.
5662 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5663 # returned, else all found sub-shapes and groups.
5664 # @return List of existing sub-objects of \a theShape.
5666 # @ref swig_all_decompose "Example"
5667 @ManageTransactions("ShapesOp")
5668 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5670 Get all sub-shapes and groups of theShape,
5671 that were created already by any other methods.
5675 theGroupsOnly If this parameter is TRUE, only groups will be
5676 returned, else all found sub-shapes and groups.
5679 List of existing sub-objects of theShape.
5681 # Example: see GEOM_TestAll.py
5682 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5683 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5686 ## Get all groups of \a theShape,
5687 # that were created already by any other methods.
5688 # @param theShape Any shape.
5689 # @return List of existing groups of \a theShape.
5691 # @ref swig_all_decompose "Example"
5692 @ManageTransactions("ShapesOp")
5693 def GetGroups(self, theShape):
5695 Get all groups of theShape,
5696 that were created already by any other methods.
5702 List of existing groups of theShape.
5704 # Example: see GEOM_TestAll.py
5705 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5706 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5709 ## Explode a shape on sub-shapes of a given type.
5710 # If the shape itself matches the type, it is also returned.
5711 # @param aShape Shape to be exploded.
5712 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5713 # @param theName Object name; when specified, this parameter is used
5714 # for result publication in the study. Otherwise, if automatic
5715 # publication is switched on, default value is used for result name.
5717 # @return List of sub-shapes of type theShapeType, contained in theShape.
5719 # @ref swig_all_decompose "Example"
5720 @ManageTransactions("ShapesOp")
5721 def SubShapeAll(self, aShape, aType, theName=None):
5723 Explode a shape on sub-shapes of a given type.
5724 If the shape itself matches the type, it is also returned.
5727 aShape Shape to be exploded.
5728 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5729 theName Object name; when specified, this parameter is used
5730 for result publication in the study. Otherwise, if automatic
5731 publication is switched on, default value is used for result name.
5734 List of sub-shapes of type theShapeType, contained in theShape.
5736 # Example: see GEOM_TestAll.py
5737 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5738 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5739 self._autoPublish(ListObj, theName, "subshape")
5742 ## Explode a shape on sub-shapes of a given type.
5743 # @param aShape Shape to be exploded.
5744 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5745 # @return List of IDs of sub-shapes.
5747 # @ref swig_all_decompose "Example"
5748 @ManageTransactions("ShapesOp")
5749 def SubShapeAllIDs(self, aShape, aType):
5751 Explode a shape on sub-shapes of a given type.
5754 aShape Shape to be exploded (see geompy.ShapeType)
5755 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5758 List of IDs of sub-shapes.
5760 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5761 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5764 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5765 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5766 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5767 # @param aShape Shape to get sub-shape of.
5768 # @param ListOfInd List of sub-shapes indices.
5769 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5770 # @param theName Object name; when specified, this parameter is used
5771 # for result publication in the study. Otherwise, if automatic
5772 # publication is switched on, default value is used for result name.
5774 # @return A compound of sub-shapes of aShape.
5776 # @ref swig_all_decompose "Example"
5777 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5779 Obtain a compound of sub-shapes of aShape,
5780 selected by their indices in list of all sub-shapes of type aType.
5781 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5784 aShape Shape to get sub-shape of.
5785 ListOfID List of sub-shapes indices.
5786 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5787 theName Object name; when specified, this parameter is used
5788 for result publication in the study. Otherwise, if automatic
5789 publication is switched on, default value is used for result name.
5792 A compound of sub-shapes of aShape.
5794 # Example: see GEOM_TestAll.py
5796 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5797 for ind in ListOfInd:
5798 ListOfIDs.append(AllShapeIDsList[ind - 1])
5799 # note: auto-publishing is done in self.GetSubShape()
5800 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5803 ## Explode a shape on sub-shapes of a given type.
5804 # Sub-shapes will be sorted taking into account their gravity centers,
5805 # to provide stable order of sub-shapes.
5806 # If the shape itself matches the type, it is also returned.
5807 # @param aShape Shape to be exploded.
5808 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5809 # @param theName Object name; when specified, this parameter is used
5810 # for result publication in the study. Otherwise, if automatic
5811 # publication is switched on, default value is used for result name.
5813 # @return List of sub-shapes of type theShapeType, contained in theShape.
5815 # @ref swig_SubShapeAllSorted "Example"
5816 @ManageTransactions("ShapesOp")
5817 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5819 Explode a shape on sub-shapes of a given type.
5820 Sub-shapes will be sorted taking into account their gravity centers,
5821 to provide stable order of sub-shapes.
5822 If the shape itself matches the type, it is also returned.
5825 aShape Shape to be exploded.
5826 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5827 theName Object name; when specified, this parameter is used
5828 for result publication in the study. Otherwise, if automatic
5829 publication is switched on, default value is used for result name.
5832 List of sub-shapes of type theShapeType, contained in theShape.
5834 # Example: see GEOM_TestAll.py
5835 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5836 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5837 self._autoPublish(ListObj, theName, "subshape")
5840 ## Explode a shape on sub-shapes of a given type.
5841 # Sub-shapes will be sorted taking into account their gravity centers,
5842 # to provide stable order of sub-shapes.
5843 # @param aShape Shape to be exploded.
5844 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5845 # @return List of IDs of sub-shapes.
5847 # @ref swig_all_decompose "Example"
5848 @ManageTransactions("ShapesOp")
5849 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5851 Explode a shape on sub-shapes of a given type.
5852 Sub-shapes will be sorted taking into account their gravity centers,
5853 to provide stable order of sub-shapes.
5856 aShape Shape to be exploded.
5857 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5860 List of IDs of sub-shapes.
5862 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5863 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5866 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5867 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5868 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5869 # @param aShape Shape to get sub-shape of.
5870 # @param ListOfInd List of sub-shapes indices.
5871 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5872 # @param theName Object name; when specified, this parameter is used
5873 # for result publication in the study. Otherwise, if automatic
5874 # publication is switched on, default value is used for result name.
5876 # @return A compound of sub-shapes of aShape.
5878 # @ref swig_all_decompose "Example"
5879 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5881 Obtain a compound of sub-shapes of aShape,
5882 selected by they indices in sorted list of all sub-shapes of type aType.
5883 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5886 aShape Shape to get sub-shape of.
5887 ListOfID List of sub-shapes indices.
5888 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5889 theName Object name; when specified, this parameter is used
5890 for result publication in the study. Otherwise, if automatic
5891 publication is switched on, default value is used for result name.
5894 A compound of sub-shapes of aShape.
5896 # Example: see GEOM_TestAll.py
5898 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5899 for ind in ListOfInd:
5900 ListOfIDs.append(AllShapeIDsList[ind - 1])
5901 # note: auto-publishing is done in self.GetSubShape()
5902 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5905 ## Extract shapes (excluding the main shape) of given type.
5906 # @param aShape The shape.
5907 # @param aType The shape type (see ShapeType())
5908 # @param isSorted Boolean flag to switch sorting on/off.
5909 # @param theName Object name; when specified, this parameter is used
5910 # for result publication in the study. Otherwise, if automatic
5911 # publication is switched on, default value is used for result name.
5913 # @return List of sub-shapes of type aType, contained in aShape.
5915 # @ref swig_FilletChamfer "Example"
5916 @ManageTransactions("ShapesOp")
5917 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5919 Extract shapes (excluding the main shape) of given type.
5923 aType The shape type (see geompy.ShapeType)
5924 isSorted Boolean flag to switch sorting on/off.
5925 theName Object name; when specified, this parameter is used
5926 for result publication in the study. Otherwise, if automatic
5927 publication is switched on, default value is used for result name.
5930 List of sub-shapes of type aType, contained in aShape.
5932 # Example: see GEOM_TestAll.py
5933 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5934 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5935 self._autoPublish(ListObj, theName, "subshape")
5938 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5939 # @param aShape Main shape.
5940 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5941 # @param theName Object name; when specified, this parameter is used
5942 # for result publication in the study. Otherwise, if automatic
5943 # publication is switched on, default value is used for result name.
5944 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5946 # @ref swig_all_decompose "Example"
5947 @ManageTransactions("ShapesOp")
5948 def SubShapes(self, aShape, anIDs, theName=None):
5950 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5954 anIDs List of unique IDs of sub-shapes inside theMainShape.
5955 theName Object name; when specified, this parameter is used
5956 for result publication in the study. Otherwise, if automatic
5957 publication is switched on, default value is used for result name.
5960 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5962 # Example: see GEOM_TestAll.py
5963 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5964 RaiseIfFailed("SubShapes", self.ShapesOp)
5965 self._autoPublish(ListObj, theName, "subshape")
5968 # end of l4_decompose
5971 ## @addtogroup l4_decompose_d
5974 ## Deprecated method
5975 # It works like SubShapeAllSortedCentres(), but wrongly
5976 # defines centres of faces, shells and solids.
5977 @ManageTransactions("ShapesOp")
5978 def SubShapeAllSorted(self, aShape, aType, theName=None):
5981 It works like geompy.SubShapeAllSortedCentres, but wrongly
5982 defines centres of faces, shells and solids.
5984 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5985 RaiseIfFailed("MakeExplode", self.ShapesOp)
5986 self._autoPublish(ListObj, theName, "subshape")
5989 ## Deprecated method
5990 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5991 # defines centres of faces, shells and solids.
5992 @ManageTransactions("ShapesOp")
5993 def SubShapeAllSortedIDs(self, aShape, aType):
5996 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5997 defines centres of faces, shells and solids.
5999 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6000 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6003 ## Deprecated method
6004 # It works like SubShapeSortedCentres(), but has a bug
6005 # (wrongly defines centres of faces, shells and solids).
6006 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6009 It works like geompy.SubShapeSortedCentres, but has a bug
6010 (wrongly defines centres of faces, shells and solids).
6013 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6014 for ind in ListOfInd:
6015 ListOfIDs.append(AllShapeIDsList[ind - 1])
6016 # note: auto-publishing is done in self.GetSubShape()
6017 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6020 # end of l4_decompose_d
6023 ## @addtogroup l3_healing
6026 ## Apply a sequence of Shape Healing operators to the given object.
6027 # @param theShape Shape to be processed.
6028 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6029 # @param theParameters List of names of parameters
6030 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6031 # @param theValues List of values of parameters, in the same order
6032 # as parameters are listed in <VAR>theParameters</VAR> list.
6033 # @param theName Object name; when specified, this parameter is used
6034 # for result publication in the study. Otherwise, if automatic
6035 # publication is switched on, default value is used for result name.
6037 # <b> Operators and Parameters: </b> \n
6039 # * \b FixShape - corrects invalid shapes. \n
6040 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6041 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6043 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6044 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6045 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6046 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6048 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6049 # surfaces in segments using a certain angle. \n
6050 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6051 # if Angle=180, four if Angle=90, etc). \n
6052 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6054 # * \b SplitClosedFaces - splits closed faces in segments.
6055 # The number of segments depends on the number of splitting points.\n
6056 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6058 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6059 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6060 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6061 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6062 # This and the previous parameters can take the following values:\n
6063 # \b Parametric \b Continuity \n
6064 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6065 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6066 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6067 # ruling out sharp edges).\n
6068 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6069 # are of the same magnitude).\n
6070 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6071 # or surfaces (d/du C(u)) are the same at junction. \n
6072 # \b Geometric \b Continuity \n
6073 # \b G1: first derivatives are proportional at junction.\n
6074 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6075 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6076 # \b G2: first and second derivatives are proportional at junction.
6077 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6078 # continuity requires that the underlying parameterization was continuous as well.
6079 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6081 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6082 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6083 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6084 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6085 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6086 # with the specified parameters.\n
6087 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6088 # with the specified parameters.\n
6089 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6090 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6091 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6092 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6094 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6095 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6096 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6097 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6098 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6100 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6101 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6104 # @return New GEOM.GEOM_Object, containing processed shape.
6106 # \n @ref tui_shape_processing "Example"
6107 @ManageTransactions("HealOp")
6108 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6110 Apply a sequence of Shape Healing operators to the given object.
6113 theShape Shape to be processed.
6114 theValues List of values of parameters, in the same order
6115 as parameters are listed in theParameters list.
6116 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6117 theParameters List of names of parameters
6118 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6119 theName Object name; when specified, this parameter is used
6120 for result publication in the study. Otherwise, if automatic
6121 publication is switched on, default value is used for result name.
6123 Operators and Parameters:
6125 * FixShape - corrects invalid shapes.
6126 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6127 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6128 * FixFaceSize - removes small faces, such as spots and strips.
6129 * FixFaceSize.Tolerance - defines minimum possible face size.
6130 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6131 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6132 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6133 in segments using a certain angle.
6134 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6135 if Angle=180, four if Angle=90, etc).
6136 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6137 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6139 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6140 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6141 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6142 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6143 * SplitContinuity.CurveContinuity - required continuity for curves.
6144 This and the previous parameters can take the following values:
6146 Parametric Continuity:
6147 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6148 coincidental. The curves or surfaces may still meet at an angle,
6149 giving rise to a sharp corner or edge).
6150 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6151 are parallel, ruling out sharp edges).
6152 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6153 or surfaces are of the same magnitude).
6154 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6155 curves or surfaces (d/du C(u)) are the same at junction.
6157 Geometric Continuity:
6158 G1: first derivatives are proportional at junction.
6159 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6160 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6161 G2: first and second derivatives are proportional at junction. As the names imply,
6162 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6163 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6164 geometric continuity of order n, but not vice-versa.
6165 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6166 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6167 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6168 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6169 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6170 the specified parameters.
6171 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6172 the specified parameters.
6173 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6174 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6175 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6176 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6177 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6178 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6179 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6180 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6181 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6182 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6183 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6186 New GEOM.GEOM_Object, containing processed shape.
6188 Note: For more information look through SALOME Geometry User's Guide->
6189 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6191 # Example: see GEOM_TestHealing.py
6192 theValues,Parameters = ParseList(theValues)
6193 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6194 # To avoid script failure in case of good argument shape
6195 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6197 RaiseIfFailed("ProcessShape", self.HealOp)
6198 for string in (theOperators + theParameters):
6199 Parameters = ":" + Parameters
6201 anObj.SetParameters(Parameters)
6202 self._autoPublish(anObj, theName, "healed")
6205 ## Remove faces from the given object (shape).
6206 # @param theObject Shape to be processed.
6207 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6208 # removes ALL faces of the given object.
6209 # @param theName Object name; when specified, this parameter is used
6210 # for result publication in the study. Otherwise, if automatic
6211 # publication is switched on, default value is used for result name.
6213 # @return New GEOM.GEOM_Object, containing processed shape.
6215 # @ref tui_suppress_faces "Example"
6216 @ManageTransactions("HealOp")
6217 def SuppressFaces(self, theObject, theFaces, theName=None):
6219 Remove faces from the given object (shape).
6222 theObject Shape to be processed.
6223 theFaces Indices of faces to be removed, if EMPTY then the method
6224 removes ALL faces of the given object.
6225 theName Object name; when specified, this parameter is used
6226 for result publication in the study. Otherwise, if automatic
6227 publication is switched on, default value is used for result name.
6230 New GEOM.GEOM_Object, containing processed shape.
6232 # Example: see GEOM_TestHealing.py
6233 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6234 RaiseIfFailed("SuppressFaces", self.HealOp)
6235 self._autoPublish(anObj, theName, "suppressFaces")
6238 ## Sewing of some shapes into single shape.
6239 # @param ListShape Shapes to be processed.
6240 # @param theTolerance Required tolerance value.
6241 # @param AllowNonManifold Flag that allows non-manifold sewing.
6242 # @param theName Object name; when specified, this parameter is used
6243 # for result publication in the study. Otherwise, if automatic
6244 # publication is switched on, default value is used for result name.
6246 # @return New GEOM.GEOM_Object, containing processed shape.
6248 # @ref tui_sewing "Example"
6249 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6251 Sewing of some shapes into single shape.
6254 ListShape Shapes to be processed.
6255 theTolerance Required tolerance value.
6256 AllowNonManifold Flag that allows non-manifold sewing.
6257 theName Object name; when specified, this parameter is used
6258 for result publication in the study. Otherwise, if automatic
6259 publication is switched on, default value is used for result name.
6262 New GEOM.GEOM_Object, containing processed shape.
6264 # Example: see GEOM_TestHealing.py
6265 comp = self.MakeCompound(ListShape)
6266 # note: auto-publishing is done in self.Sew()
6267 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6270 ## Sewing of the given object.
6271 # @param theObject Shape to be processed.
6272 # @param theTolerance Required tolerance value.
6273 # @param AllowNonManifold Flag that allows non-manifold sewing.
6274 # @param theName Object name; when specified, this parameter is used
6275 # for result publication in the study. Otherwise, if automatic
6276 # publication is switched on, default value is used for result name.
6278 # @return New GEOM.GEOM_Object, containing processed shape.
6279 @ManageTransactions("HealOp")
6280 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6282 Sewing of the given object.
6285 theObject Shape to be processed.
6286 theTolerance Required tolerance value.
6287 AllowNonManifold Flag that allows non-manifold sewing.
6288 theName Object name; when specified, this parameter is used
6289 for result publication in the study. Otherwise, if automatic
6290 publication is switched on, default value is used for result name.
6293 New GEOM.GEOM_Object, containing processed shape.
6295 # Example: see MakeSewing() above
6296 theTolerance,Parameters = ParseParameters(theTolerance)
6297 if AllowNonManifold:
6298 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6300 anObj = self.HealOp.Sew(theObject, theTolerance)
6301 # To avoid script failure in case of good argument shape
6302 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6304 RaiseIfFailed("Sew", self.HealOp)
6305 anObj.SetParameters(Parameters)
6306 self._autoPublish(anObj, theName, "sewed")
6309 ## Rebuild the topology of theCompound of solids by removing
6310 # of the faces that are shared by several solids.
6311 # @param theCompound Shape to be processed.
6312 # @param theName Object name; when specified, this parameter is used
6313 # for result publication in the study. Otherwise, if automatic
6314 # publication is switched on, default value is used for result name.
6316 # @return New GEOM.GEOM_Object, containing processed shape.
6318 # @ref tui_remove_webs "Example"
6319 @ManageTransactions("HealOp")
6320 def RemoveInternalFaces (self, theCompound, theName=None):
6322 Rebuild the topology of theCompound of solids by removing
6323 of the faces that are shared by several solids.
6326 theCompound Shape to be processed.
6327 theName Object name; when specified, this parameter is used
6328 for result publication in the study. Otherwise, if automatic
6329 publication is switched on, default value is used for result name.
6332 New GEOM.GEOM_Object, containing processed shape.
6334 # Example: see GEOM_TestHealing.py
6335 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6336 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6337 self._autoPublish(anObj, theName, "removeWebs")
6340 ## Remove internal wires and edges from the given object (face).
6341 # @param theObject Shape to be processed.
6342 # @param theWires Indices of wires to be removed, if EMPTY then the method
6343 # removes ALL internal wires of the given object.
6344 # @param theName Object name; when specified, this parameter is used
6345 # for result publication in the study. Otherwise, if automatic
6346 # publication is switched on, default value is used for result name.
6348 # @return New GEOM.GEOM_Object, containing processed shape.
6350 # @ref tui_suppress_internal_wires "Example"
6351 @ManageTransactions("HealOp")
6352 def SuppressInternalWires(self, theObject, theWires, theName=None):
6354 Remove internal wires and edges from the given object (face).
6357 theObject Shape to be processed.
6358 theWires Indices of wires to be removed, if EMPTY then the method
6359 removes ALL internal wires of the given object.
6360 theName Object name; when specified, this parameter is used
6361 for result publication in the study. Otherwise, if automatic
6362 publication is switched on, default value is used for result name.
6365 New GEOM.GEOM_Object, containing processed shape.
6367 # Example: see GEOM_TestHealing.py
6368 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6369 RaiseIfFailed("RemoveIntWires", self.HealOp)
6370 self._autoPublish(anObj, theName, "suppressWires")
6373 ## Remove internal closed contours (holes) from the given object.
6374 # @param theObject Shape to be processed.
6375 # @param theWires Indices of wires to be removed, if EMPTY then the method
6376 # removes ALL internal holes of the given object
6377 # @param theName Object name; when specified, this parameter is used
6378 # for result publication in the study. Otherwise, if automatic
6379 # publication is switched on, default value is used for result name.
6381 # @return New GEOM.GEOM_Object, containing processed shape.
6383 # @ref tui_suppress_holes "Example"
6384 @ManageTransactions("HealOp")
6385 def SuppressHoles(self, theObject, theWires, theName=None):
6387 Remove internal closed contours (holes) from the given object.
6390 theObject Shape to be processed.
6391 theWires Indices of wires to be removed, if EMPTY then the method
6392 removes ALL internal holes of the given object
6393 theName Object name; when specified, this parameter is used
6394 for result publication in the study. Otherwise, if automatic
6395 publication is switched on, default value is used for result name.
6398 New GEOM.GEOM_Object, containing processed shape.
6400 # Example: see GEOM_TestHealing.py
6401 anObj = self.HealOp.FillHoles(theObject, theWires)
6402 RaiseIfFailed("FillHoles", self.HealOp)
6403 self._autoPublish(anObj, theName, "suppressHoles")
6406 ## Close an open wire.
6407 # @param theObject Shape to be processed.
6408 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6409 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6410 # @param isCommonVertex If True : closure by creation of a common vertex,
6411 # If False : closure by creation of an edge between ends.
6412 # @param theName Object name; when specified, this parameter is used
6413 # for result publication in the study. Otherwise, if automatic
6414 # publication is switched on, default value is used for result name.
6416 # @return New GEOM.GEOM_Object, containing processed shape.
6418 # @ref tui_close_contour "Example"
6419 @ManageTransactions("HealOp")
6420 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6425 theObject Shape to be processed.
6426 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6427 if [ ], then theObject itself is a wire.
6428 isCommonVertex If True : closure by creation of a common vertex,
6429 If False : closure by creation of an edge between ends.
6430 theName Object name; when specified, this parameter is used
6431 for result publication in the study. Otherwise, if automatic
6432 publication is switched on, default value is used for result name.
6435 New GEOM.GEOM_Object, containing processed shape.
6437 # Example: see GEOM_TestHealing.py
6438 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6439 RaiseIfFailed("CloseContour", self.HealOp)
6440 self._autoPublish(anObj, theName, "closeContour")
6443 ## Addition of a point to a given edge object.
6444 # @param theObject Shape to be processed.
6445 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6446 # if -1, then theObject itself is the edge.
6447 # @param theValue Value of parameter on edge or length parameter,
6448 # depending on \a isByParameter.
6449 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6450 # if FALSE : \a theValue is treated as a length parameter [0..1]
6451 # @param theName Object name; when specified, this parameter is used
6452 # for result publication in the study. Otherwise, if automatic
6453 # publication is switched on, default value is used for result name.
6455 # @return New GEOM.GEOM_Object, containing processed shape.
6457 # @ref tui_add_point_on_edge "Example"
6458 @ManageTransactions("HealOp")
6459 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6461 Addition of a point to a given edge object.
6464 theObject Shape to be processed.
6465 theEdgeIndex Index of edge to be divided within theObject's shape,
6466 if -1, then theObject itself is the edge.
6467 theValue Value of parameter on edge or length parameter,
6468 depending on isByParameter.
6469 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6470 if FALSE : theValue is treated as a length parameter [0..1]
6471 theName Object name; when specified, this parameter is used
6472 for result publication in the study. Otherwise, if automatic
6473 publication is switched on, default value is used for result name.
6476 New GEOM.GEOM_Object, containing processed shape.
6478 # Example: see GEOM_TestHealing.py
6479 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6480 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6481 RaiseIfFailed("DivideEdge", self.HealOp)
6482 anObj.SetParameters(Parameters)
6483 self._autoPublish(anObj, theName, "divideEdge")
6486 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6487 # @param theWire Wire to minimize the number of C1 continuous edges in.
6488 # @param theVertices A list of vertices to suppress. If the list
6489 # is empty, all vertices in a wire will be assumed.
6490 # @param theName Object name; when specified, this parameter is used
6491 # for result publication in the study. Otherwise, if automatic
6492 # publication is switched on, default value is used for result name.
6494 # @return New GEOM.GEOM_Object with modified wire.
6496 # @ref tui_fuse_collinear_edges "Example"
6497 @ManageTransactions("HealOp")
6498 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6500 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6503 theWire Wire to minimize the number of C1 continuous edges in.
6504 theVertices A list of vertices to suppress. If the list
6505 is empty, all vertices in a wire will be assumed.
6506 theName Object name; when specified, this parameter is used
6507 for result publication in the study. Otherwise, if automatic
6508 publication is switched on, default value is used for result name.
6511 New GEOM.GEOM_Object with modified wire.
6513 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6514 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6515 self._autoPublish(anObj, theName, "fuseEdges")
6518 ## Change orientation of the given object. Updates given shape.
6519 # @param theObject Shape to be processed.
6520 # @return Updated <var>theObject</var>
6522 # @ref swig_todo "Example"
6523 @ManageTransactions("HealOp")
6524 def ChangeOrientationShell(self,theObject):
6526 Change orientation of the given object. Updates given shape.
6529 theObject Shape to be processed.
6534 theObject = self.HealOp.ChangeOrientation(theObject)
6535 RaiseIfFailed("ChangeOrientation", self.HealOp)
6538 ## Change orientation of the given object.
6539 # @param theObject Shape to be processed.
6540 # @param theName Object name; when specified, this parameter is used
6541 # for result publication in the study. Otherwise, if automatic
6542 # publication is switched on, default value is used for result name.
6544 # @return New GEOM.GEOM_Object, containing processed shape.
6546 # @ref swig_todo "Example"
6547 @ManageTransactions("HealOp")
6548 def ChangeOrientationShellCopy(self, theObject, theName=None):
6550 Change orientation of the given object.
6553 theObject Shape to be processed.
6554 theName Object name; when specified, this parameter is used
6555 for result publication in the study. Otherwise, if automatic
6556 publication is switched on, default value is used for result name.
6559 New GEOM.GEOM_Object, containing processed shape.
6561 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6562 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6563 self._autoPublish(anObj, theName, "reversed")
6566 ## Try to limit tolerance of the given object by value \a theTolerance.
6567 # @param theObject Shape to be processed.
6568 # @param theTolerance Required tolerance value.
6569 # @param theName Object name; when specified, this parameter is used
6570 # for result publication in the study. Otherwise, if automatic
6571 # publication is switched on, default value is used for result name.
6573 # @return New GEOM.GEOM_Object, containing processed shape.
6575 # @ref tui_limit_tolerance "Example"
6576 @ManageTransactions("HealOp")
6577 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6579 Try to limit tolerance of the given object by value theTolerance.
6582 theObject Shape to be processed.
6583 theTolerance Required tolerance value.
6584 theName Object name; when specified, this parameter is used
6585 for result publication in the study. Otherwise, if automatic
6586 publication is switched on, default value is used for result name.
6589 New GEOM.GEOM_Object, containing processed shape.
6591 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6592 RaiseIfFailed("LimitTolerance", self.HealOp)
6593 self._autoPublish(anObj, theName, "limitTolerance")
6596 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6597 # that constitute a free boundary of the given shape.
6598 # @param theObject Shape to get free boundary of.
6599 # @param theName Object name; when specified, this parameter is used
6600 # for result publication in the study. Otherwise, if automatic
6601 # publication is switched on, default value is used for result name.
6603 # @return [\a status, \a theClosedWires, \a theOpenWires]
6604 # \n \a status: FALSE, if an error(s) occured during the method execution.
6605 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6606 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6608 # @ref tui_measurement_tools_page "Example"
6609 @ManageTransactions("HealOp")
6610 def GetFreeBoundary(self, theObject, theName=None):
6612 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6613 that constitute a free boundary of the given shape.
6616 theObject Shape to get free boundary of.
6617 theName Object name; when specified, this parameter is used
6618 for result publication in the study. Otherwise, if automatic
6619 publication is switched on, default value is used for result name.
6622 [status, theClosedWires, theOpenWires]
6623 status: FALSE, if an error(s) occured during the method execution.
6624 theClosedWires: Closed wires on the free boundary of the given shape.
6625 theOpenWires: Open wires on the free boundary of the given shape.
6627 # Example: see GEOM_TestHealing.py
6628 anObj = self.HealOp.GetFreeBoundary(theObject)
6629 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6630 self._autoPublish(anObj[1], theName, "closedWire")
6631 self._autoPublish(anObj[2], theName, "openWire")
6634 ## Replace coincident faces in theShape by one face.
6635 # @param theShape Initial shape.
6636 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6637 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6638 # otherwise all initial shapes.
6639 # @param theName Object name; when specified, this parameter is used
6640 # for result publication in the study. Otherwise, if automatic
6641 # publication is switched on, default value is used for result name.
6643 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6645 # @ref tui_glue_faces "Example"
6646 @ManageTransactions("ShapesOp")
6647 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6649 Replace coincident faces in theShape by one face.
6652 theShape Initial shape.
6653 theTolerance Maximum distance between faces, which can be considered as coincident.
6654 doKeepNonSolids If FALSE, only solids will present in the result,
6655 otherwise all initial shapes.
6656 theName Object name; when specified, this parameter is used
6657 for result publication in the study. Otherwise, if automatic
6658 publication is switched on, default value is used for result name.
6661 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6663 # Example: see GEOM_Spanner.py
6664 theTolerance,Parameters = ParseParameters(theTolerance)
6665 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6667 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6668 anObj.SetParameters(Parameters)
6669 self._autoPublish(anObj, theName, "glueFaces")
6672 ## Find coincident faces in theShape for possible gluing.
6673 # @param theShape Initial shape.
6674 # @param theTolerance Maximum distance between faces,
6675 # which can be considered as coincident.
6676 # @param theName Object name; when specified, this parameter is used
6677 # for result publication in the study. Otherwise, if automatic
6678 # publication is switched on, default value is used for result name.
6680 # @return GEOM.ListOfGO
6682 # @ref tui_glue_faces "Example"
6683 @ManageTransactions("ShapesOp")
6684 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6686 Find coincident faces in theShape for possible gluing.
6689 theShape Initial shape.
6690 theTolerance Maximum distance between faces,
6691 which can be considered as coincident.
6692 theName Object name; when specified, this parameter is used
6693 for result publication in the study. Otherwise, if automatic
6694 publication is switched on, default value is used for result name.
6699 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6700 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6701 self._autoPublish(anObj, theName, "facesToGlue")
6704 ## Replace coincident faces in theShape by one face
6705 # in compliance with given list of faces
6706 # @param theShape Initial shape.
6707 # @param theTolerance Maximum distance between faces,
6708 # which can be considered as coincident.
6709 # @param theFaces List of faces for gluing.
6710 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6711 # otherwise all initial shapes.
6712 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6713 # will be glued, otherwise only the edges,
6714 # belonging to <VAR>theFaces</VAR>.
6715 # @param theName Object name; when specified, this parameter is used
6716 # for result publication in the study. Otherwise, if automatic
6717 # publication is switched on, default value is used for result name.
6719 # @return New GEOM.GEOM_Object, containing a copy of theShape
6720 # without some faces.
6722 # @ref tui_glue_faces "Example"
6723 @ManageTransactions("ShapesOp")
6724 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6725 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6727 Replace coincident faces in theShape by one face
6728 in compliance with given list of faces
6731 theShape Initial shape.
6732 theTolerance Maximum distance between faces,
6733 which can be considered as coincident.
6734 theFaces List of faces for gluing.
6735 doKeepNonSolids If FALSE, only solids will present in the result,
6736 otherwise all initial shapes.
6737 doGlueAllEdges If TRUE, all coincident edges of theShape
6738 will be glued, otherwise only the edges,
6739 belonging to theFaces.
6740 theName Object name; when specified, this parameter is used
6741 for result publication in the study. Otherwise, if automatic
6742 publication is switched on, default value is used for result name.
6745 New GEOM.GEOM_Object, containing a copy of theShape
6748 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6749 doKeepNonSolids, doGlueAllEdges)
6751 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6752 self._autoPublish(anObj, theName, "glueFaces")
6755 ## Replace coincident edges in theShape by one edge.
6756 # @param theShape Initial shape.
6757 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6758 # @param theName Object name; when specified, this parameter is used
6759 # for result publication in the study. Otherwise, if automatic
6760 # publication is switched on, default value is used for result name.
6762 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6764 # @ref tui_glue_edges "Example"
6765 @ManageTransactions("ShapesOp")
6766 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6768 Replace coincident edges in theShape by one edge.
6771 theShape Initial shape.
6772 theTolerance Maximum distance between edges, which can be considered as coincident.
6773 theName Object name; when specified, this parameter is used
6774 for result publication in the study. Otherwise, if automatic
6775 publication is switched on, default value is used for result name.
6778 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6780 theTolerance,Parameters = ParseParameters(theTolerance)
6781 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6783 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6784 anObj.SetParameters(Parameters)
6785 self._autoPublish(anObj, theName, "glueEdges")
6788 ## Find coincident edges in theShape for possible gluing.
6789 # @param theShape Initial shape.
6790 # @param theTolerance Maximum distance between edges,
6791 # which can be considered as coincident.
6792 # @param theName Object name; when specified, this parameter is used
6793 # for result publication in the study. Otherwise, if automatic
6794 # publication is switched on, default value is used for result name.
6796 # @return GEOM.ListOfGO
6798 # @ref tui_glue_edges "Example"
6799 @ManageTransactions("ShapesOp")
6800 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6802 Find coincident edges in theShape for possible gluing.
6805 theShape Initial shape.
6806 theTolerance Maximum distance between edges,
6807 which can be considered as coincident.
6808 theName Object name; when specified, this parameter is used
6809 for result publication in the study. Otherwise, if automatic
6810 publication is switched on, default value is used for result name.
6815 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6816 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6817 self._autoPublish(anObj, theName, "edgesToGlue")
6820 ## Replace coincident edges in theShape by one edge
6821 # in compliance with given list of edges.
6822 # @param theShape Initial shape.
6823 # @param theTolerance Maximum distance between edges,
6824 # which can be considered as coincident.
6825 # @param theEdges List of edges for gluing.
6826 # @param theName Object name; when specified, this parameter is used
6827 # for result publication in the study. Otherwise, if automatic
6828 # publication is switched on, default value is used for result name.
6830 # @return New GEOM.GEOM_Object, containing a copy of theShape
6831 # without some edges.
6833 # @ref tui_glue_edges "Example"
6834 @ManageTransactions("ShapesOp")
6835 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6837 Replace coincident edges in theShape by one edge
6838 in compliance with given list of edges.
6841 theShape Initial shape.
6842 theTolerance Maximum distance between edges,
6843 which can be considered as coincident.
6844 theEdges List of edges for gluing.
6845 theName Object name; when specified, this parameter is used
6846 for result publication in the study. Otherwise, if automatic
6847 publication is switched on, default value is used for result name.
6850 New GEOM.GEOM_Object, containing a copy of theShape
6853 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6855 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6856 self._autoPublish(anObj, theName, "glueEdges")
6862 ## @addtogroup l3_boolean Boolean Operations
6865 # -----------------------------------------------------------------------------
6866 # Boolean (Common, Cut, Fuse, Section)
6867 # -----------------------------------------------------------------------------
6869 ## Perform one of boolean operations on two given shapes.
6870 # @param theShape1 First argument for boolean operation.
6871 # @param theShape2 Second argument for boolean operation.
6872 # @param theOperation Indicates the operation to be done:\n
6873 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6874 # @param checkSelfInte The flag that tells if the arguments should
6875 # be checked for self-intersection prior to the operation.
6876 # @param theName Object name; when specified, this parameter is used
6877 # for result publication in the study. Otherwise, if automatic
6878 # publication is switched on, default value is used for result name.
6880 # @note This algorithm doesn't find all types of self-intersections.
6881 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6882 # vertex/face and edge/face intersections. Face/face
6883 # intersections detection is switched off as it is a
6884 # time-consuming operation that gives an impact on performance.
6885 # To find all self-intersections please use
6886 # CheckSelfIntersections() method.
6888 # @return New GEOM.GEOM_Object, containing the result shape.
6890 # @ref tui_fuse "Example"
6891 @ManageTransactions("BoolOp")
6892 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6894 Perform one of boolean operations on two given shapes.
6897 theShape1 First argument for boolean operation.
6898 theShape2 Second argument for boolean operation.
6899 theOperation Indicates the operation to be done:
6900 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6901 checkSelfInte The flag that tells if the arguments should
6902 be checked for self-intersection prior to
6904 theName Object name; when specified, this parameter is used
6905 for result publication in the study. Otherwise, if automatic
6906 publication is switched on, default value is used for result name.
6909 This algorithm doesn't find all types of self-intersections.
6910 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6911 vertex/face and edge/face intersections. Face/face
6912 intersections detection is switched off as it is a
6913 time-consuming operation that gives an impact on performance.
6914 To find all self-intersections please use
6915 CheckSelfIntersections() method.
6918 New GEOM.GEOM_Object, containing the result shape.
6920 # Example: see GEOM_TestAll.py
6921 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6922 RaiseIfFailed("MakeBoolean", self.BoolOp)
6923 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6924 self._autoPublish(anObj, theName, def_names[theOperation])
6927 ## Perform Common boolean operation on two given shapes.
6928 # @param theShape1 First argument for boolean operation.
6929 # @param theShape2 Second argument for boolean operation.
6930 # @param checkSelfInte The flag that tells if the arguments should
6931 # be checked for self-intersection prior to the operation.
6932 # @param theName Object name; when specified, this parameter is used
6933 # for result publication in the study. Otherwise, if automatic
6934 # publication is switched on, default value is used for result name.
6936 # @note This algorithm doesn't find all types of self-intersections.
6937 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6938 # vertex/face and edge/face intersections. Face/face
6939 # intersections detection is switched off as it is a
6940 # time-consuming operation that gives an impact on performance.
6941 # To find all self-intersections please use
6942 # CheckSelfIntersections() method.
6944 # @return New GEOM.GEOM_Object, containing the result shape.
6946 # @ref tui_common "Example 1"
6947 # \n @ref swig_MakeCommon "Example 2"
6948 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
6950 Perform Common boolean operation on two given shapes.
6953 theShape1 First argument for boolean operation.
6954 theShape2 Second argument for boolean operation.
6955 checkSelfInte The flag that tells if the arguments should
6956 be checked for self-intersection prior to
6958 theName Object name; when specified, this parameter is used
6959 for result publication in the study. Otherwise, if automatic
6960 publication is switched on, default value is used for result name.
6963 This algorithm doesn't find all types of self-intersections.
6964 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6965 vertex/face and edge/face intersections. Face/face
6966 intersections detection is switched off as it is a
6967 time-consuming operation that gives an impact on performance.
6968 To find all self-intersections please use
6969 CheckSelfIntersections() method.
6972 New GEOM.GEOM_Object, containing the result shape.
6974 # Example: see GEOM_TestOthers.py
6975 # note: auto-publishing is done in self.MakeBoolean()
6976 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
6978 ## Perform Cut boolean operation on two given shapes.
6979 # @param theShape1 First argument for boolean operation.
6980 # @param theShape2 Second argument for boolean operation.
6981 # @param checkSelfInte The flag that tells if the arguments should
6982 # be checked for self-intersection prior to the operation.
6983 # @param theName Object name; when specified, this parameter is used
6984 # for result publication in the study. Otherwise, if automatic
6985 # publication is switched on, default value is used for result name.
6987 # @note This algorithm doesn't find all types of self-intersections.
6988 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6989 # vertex/face and edge/face intersections. Face/face
6990 # intersections detection is switched off as it is a
6991 # time-consuming operation that gives an impact on performance.
6992 # To find all self-intersections please use
6993 # CheckSelfIntersections() method.
6995 # @return New GEOM.GEOM_Object, containing the result shape.
6997 # @ref tui_cut "Example 1"
6998 # \n @ref swig_MakeCommon "Example 2"
6999 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7001 Perform Cut boolean operation on two given shapes.
7004 theShape1 First argument for boolean operation.
7005 theShape2 Second argument for boolean operation.
7006 checkSelfInte The flag that tells if the arguments should
7007 be checked for self-intersection prior to
7009 theName Object name; when specified, this parameter is used
7010 for result publication in the study. Otherwise, if automatic
7011 publication is switched on, default value is used for result name.
7014 This algorithm doesn't find all types of self-intersections.
7015 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7016 vertex/face and edge/face intersections. Face/face
7017 intersections detection is switched off as it is a
7018 time-consuming operation that gives an impact on performance.
7019 To find all self-intersections please use
7020 CheckSelfIntersections() method.
7023 New GEOM.GEOM_Object, containing the result shape.
7026 # Example: see GEOM_TestOthers.py
7027 # note: auto-publishing is done in self.MakeBoolean()
7028 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7030 ## Perform Fuse boolean operation on two given shapes.
7031 # @param theShape1 First argument for boolean operation.
7032 # @param theShape2 Second argument for boolean operation.
7033 # @param checkSelfInte The flag that tells if the arguments should
7034 # be checked for self-intersection prior to the operation.
7035 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7036 # operation should be performed during the operation.
7037 # @param theName Object name; when specified, this parameter is used
7038 # for result publication in the study. Otherwise, if automatic
7039 # publication is switched on, default value is used for result name.
7041 # @note This algorithm doesn't find all types of self-intersections.
7042 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7043 # vertex/face and edge/face intersections. Face/face
7044 # intersections detection is switched off as it is a
7045 # time-consuming operation that gives an impact on performance.
7046 # To find all self-intersections please use
7047 # CheckSelfIntersections() method.
7049 # @return New GEOM.GEOM_Object, containing the result shape.
7051 # @ref tui_fuse "Example 1"
7052 # \n @ref swig_MakeCommon "Example 2"
7053 @ManageTransactions("BoolOp")
7054 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7055 rmExtraEdges=False, theName=None):
7057 Perform Fuse boolean operation on two given shapes.
7060 theShape1 First argument for boolean operation.
7061 theShape2 Second argument for boolean operation.
7062 checkSelfInte The flag that tells if the arguments should
7063 be checked for self-intersection prior to
7065 rmExtraEdges The flag that tells if Remove Extra Edges
7066 operation should be performed during the operation.
7067 theName Object name; when specified, this parameter is used
7068 for result publication in the study. Otherwise, if automatic
7069 publication is switched on, default value is used for result name.
7072 This algorithm doesn't find all types of self-intersections.
7073 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7074 vertex/face and edge/face intersections. Face/face
7075 intersections detection is switched off as it is a
7076 time-consuming operation that gives an impact on performance.
7077 To find all self-intersections please use
7078 CheckSelfIntersections() method.
7081 New GEOM.GEOM_Object, containing the result shape.
7084 # Example: see GEOM_TestOthers.py
7085 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7086 checkSelfInte, rmExtraEdges)
7087 RaiseIfFailed("MakeFuse", self.BoolOp)
7088 self._autoPublish(anObj, theName, "fuse")
7091 ## Perform Section boolean operation on two given shapes.
7092 # @param theShape1 First argument for boolean operation.
7093 # @param theShape2 Second argument for boolean operation.
7094 # @param checkSelfInte The flag that tells if the arguments should
7095 # be checked for self-intersection prior to the operation.
7096 # @param theName Object name; when specified, this parameter is used
7097 # for result publication in the study. Otherwise, if automatic
7098 # publication is switched on, default value is used for result name.
7100 # @note This algorithm doesn't find all types of self-intersections.
7101 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7102 # vertex/face and edge/face intersections. Face/face
7103 # intersections detection is switched off as it is a
7104 # time-consuming operation that gives an impact on performance.
7105 # To find all self-intersections please use
7106 # CheckSelfIntersections() method.
7108 # @return New GEOM.GEOM_Object, containing the result shape.
7110 # @ref tui_section "Example 1"
7111 # \n @ref swig_MakeCommon "Example 2"
7112 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7114 Perform Section boolean operation on two given shapes.
7117 theShape1 First argument for boolean operation.
7118 theShape2 Second argument for boolean operation.
7119 checkSelfInte The flag that tells if the arguments should
7120 be checked for self-intersection prior to
7122 theName Object name; when specified, this parameter is used
7123 for result publication in the study. Otherwise, if automatic
7124 publication is switched on, default value is used for result name.
7127 This algorithm doesn't find all types of self-intersections.
7128 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7129 vertex/face and edge/face intersections. Face/face
7130 intersections detection is switched off as it is a
7131 time-consuming operation that gives an impact on performance.
7132 To find all self-intersections please use
7133 CheckSelfIntersections() method.
7136 New GEOM.GEOM_Object, containing the result shape.
7139 # Example: see GEOM_TestOthers.py
7140 # note: auto-publishing is done in self.MakeBoolean()
7141 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7143 ## Perform Fuse boolean operation on the list of shapes.
7144 # @param theShapesList Shapes to be fused.
7145 # @param checkSelfInte The flag that tells if the arguments should
7146 # be checked for self-intersection prior to the operation.
7147 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7148 # operation should be performed during the operation.
7149 # @param theName Object name; when specified, this parameter is used
7150 # for result publication in the study. Otherwise, if automatic
7151 # publication is switched on, default value is used for result name.
7153 # @note This algorithm doesn't find all types of self-intersections.
7154 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7155 # vertex/face and edge/face intersections. Face/face
7156 # intersections detection is switched off as it is a
7157 # time-consuming operation that gives an impact on performance.
7158 # To find all self-intersections please use
7159 # CheckSelfIntersections() method.
7161 # @return New GEOM.GEOM_Object, containing the result shape.
7163 # @ref tui_fuse "Example 1"
7164 # \n @ref swig_MakeCommon "Example 2"
7165 @ManageTransactions("BoolOp")
7166 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7167 rmExtraEdges=False, theName=None):
7169 Perform Fuse boolean operation on the list of shapes.
7172 theShapesList Shapes to be fused.
7173 checkSelfInte The flag that tells if the arguments should
7174 be checked for self-intersection prior to
7176 rmExtraEdges The flag that tells if Remove Extra Edges
7177 operation should be performed during the operation.
7178 theName Object name; when specified, this parameter is used
7179 for result publication in the study. Otherwise, if automatic
7180 publication is switched on, default value is used for result name.
7183 This algorithm doesn't find all types of self-intersections.
7184 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7185 vertex/face and edge/face intersections. Face/face
7186 intersections detection is switched off as it is a
7187 time-consuming operation that gives an impact on performance.
7188 To find all self-intersections please use
7189 CheckSelfIntersections() method.
7192 New GEOM.GEOM_Object, containing the result shape.
7195 # Example: see GEOM_TestOthers.py
7196 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7198 RaiseIfFailed("MakeFuseList", self.BoolOp)
7199 self._autoPublish(anObj, theName, "fuse")
7202 ## Perform Common boolean operation on the list of shapes.
7203 # @param theShapesList Shapes for Common operation.
7204 # @param checkSelfInte The flag that tells if the arguments should
7205 # be checked for self-intersection prior to the operation.
7206 # @param theName Object name; when specified, this parameter is used
7207 # for result publication in the study. Otherwise, if automatic
7208 # publication is switched on, default value is used for result name.
7210 # @note This algorithm doesn't find all types of self-intersections.
7211 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7212 # vertex/face and edge/face intersections. Face/face
7213 # intersections detection is switched off as it is a
7214 # time-consuming operation that gives an impact on performance.
7215 # To find all self-intersections please use
7216 # CheckSelfIntersections() method.
7218 # @return New GEOM.GEOM_Object, containing the result shape.
7220 # @ref tui_common "Example 1"
7221 # \n @ref swig_MakeCommon "Example 2"
7222 @ManageTransactions("BoolOp")
7223 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7225 Perform Common boolean operation on the list of shapes.
7228 theShapesList Shapes for Common operation.
7229 checkSelfInte The flag that tells if the arguments should
7230 be checked for self-intersection prior to
7232 theName Object name; when specified, this parameter is used
7233 for result publication in the study. Otherwise, if automatic
7234 publication is switched on, default value is used for result name.
7237 This algorithm doesn't find all types of self-intersections.
7238 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7239 vertex/face and edge/face intersections. Face/face
7240 intersections detection is switched off as it is a
7241 time-consuming operation that gives an impact on performance.
7242 To find all self-intersections please use
7243 CheckSelfIntersections() method.
7246 New GEOM.GEOM_Object, containing the result shape.
7249 # Example: see GEOM_TestOthers.py
7250 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7251 RaiseIfFailed("MakeCommonList", self.BoolOp)
7252 self._autoPublish(anObj, theName, "common")
7255 ## Perform Cut boolean operation on one object and the list of tools.
7256 # @param theMainShape The object of the operation.
7257 # @param theShapesList The list of tools of the operation.
7258 # @param checkSelfInte The flag that tells if the arguments should
7259 # be checked for self-intersection prior to the operation.
7260 # @param theName Object name; when specified, this parameter is used
7261 # for result publication in the study. Otherwise, if automatic
7262 # publication is switched on, default value is used for result name.
7264 # @note This algorithm doesn't find all types of self-intersections.
7265 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7266 # vertex/face and edge/face intersections. Face/face
7267 # intersections detection is switched off as it is a
7268 # time-consuming operation that gives an impact on performance.
7269 # To find all self-intersections please use
7270 # CheckSelfIntersections() method.
7272 # @return New GEOM.GEOM_Object, containing the result shape.
7274 # @ref tui_cut "Example 1"
7275 # \n @ref swig_MakeCommon "Example 2"
7276 @ManageTransactions("BoolOp")
7277 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7279 Perform Cut boolean operation on one object and the list of tools.
7282 theMainShape The object of the operation.
7283 theShapesList The list of tools of the operation.
7284 checkSelfInte The flag that tells if the arguments should
7285 be checked for self-intersection prior to
7287 theName Object name; when specified, this parameter is used
7288 for result publication in the study. Otherwise, if automatic
7289 publication is switched on, default value is used for result name.
7292 This algorithm doesn't find all types of self-intersections.
7293 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7294 vertex/face and edge/face intersections. Face/face
7295 intersections detection is switched off as it is a
7296 time-consuming operation that gives an impact on performance.
7297 To find all self-intersections please use
7298 CheckSelfIntersections() method.
7301 New GEOM.GEOM_Object, containing the result shape.
7304 # Example: see GEOM_TestOthers.py
7305 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7306 RaiseIfFailed("MakeCutList", self.BoolOp)
7307 self._autoPublish(anObj, theName, "cut")
7313 ## @addtogroup l3_basic_op
7316 ## Perform partition operation.
7317 # @param ListShapes Shapes to be intersected.
7318 # @param ListTools Shapes to intersect theShapes.
7319 # @param Limit Type of resulting shapes (see ShapeType()).\n
7320 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7321 # type will be detected automatically.
7322 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7323 # target type (equal to Limit) are kept in the result,
7324 # else standalone shapes of lower dimension
7325 # are kept also (if they exist).
7327 # @param theName Object name; when specified, this parameter is used
7328 # for result publication in the study. Otherwise, if automatic
7329 # publication is switched on, default value is used for result name.
7331 # @note Each compound from ListShapes and ListTools will be exploded
7332 # in order to avoid possible intersection between shapes from this compound.
7334 # After implementation new version of PartitionAlgo (October 2006)
7335 # other parameters are ignored by current functionality. They are kept
7336 # in this function only for support old versions.
7337 # @param ListKeepInside Shapes, outside which the results will be deleted.
7338 # Each shape from theKeepInside must belong to theShapes also.
7339 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7340 # Each shape from theRemoveInside must belong to theShapes also.
7341 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7342 # @param ListMaterials Material indices for each shape. Make sence,
7343 # only if theRemoveWebs is TRUE.
7345 # @return New GEOM.GEOM_Object, containing the result shapes.
7347 # @ref tui_partition "Example"
7348 @ManageTransactions("BoolOp")
7349 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7350 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7351 KeepNonlimitShapes=0, theName=None):
7353 Perform partition operation.
7356 ListShapes Shapes to be intersected.
7357 ListTools Shapes to intersect theShapes.
7358 Limit Type of resulting shapes (see geompy.ShapeType)
7359 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7360 type will be detected automatically.
7361 KeepNonlimitShapes if this parameter == 0, then only shapes of
7362 target type (equal to Limit) are kept in the result,
7363 else standalone shapes of lower dimension
7364 are kept also (if they exist).
7366 theName Object name; when specified, this parameter is used
7367 for result publication in the study. Otherwise, if automatic
7368 publication is switched on, default value is used for result name.
7370 Each compound from ListShapes and ListTools will be exploded
7371 in order to avoid possible intersection between shapes from
7374 After implementation new version of PartitionAlgo (October 2006) other
7375 parameters are ignored by current functionality. They are kept in this
7376 function only for support old versions.
7379 ListKeepInside Shapes, outside which the results will be deleted.
7380 Each shape from theKeepInside must belong to theShapes also.
7381 ListRemoveInside Shapes, inside which the results will be deleted.
7382 Each shape from theRemoveInside must belong to theShapes also.
7383 RemoveWebs If TRUE, perform Glue 3D algorithm.
7384 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7387 New GEOM.GEOM_Object, containing the result shapes.
7389 # Example: see GEOM_TestAll.py
7390 if Limit == self.ShapeType["AUTO"]:
7391 # automatic detection of the most appropriate shape limit type
7393 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7394 Limit = EnumToLong(lim)
7396 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7397 ListKeepInside, ListRemoveInside,
7398 Limit, RemoveWebs, ListMaterials,
7399 KeepNonlimitShapes);
7400 RaiseIfFailed("MakePartition", self.BoolOp)
7401 self._autoPublish(anObj, theName, "partition")
7404 ## Perform partition operation.
7405 # This method may be useful if it is needed to make a partition for
7406 # compound contains nonintersected shapes. Performance will be better
7407 # since intersection between shapes from compound is not performed.
7409 # Description of all parameters as in previous method MakePartition().
7410 # One additional parameter is provided:
7411 # @param checkSelfInte The flag that tells if the arguments should
7412 # be checked for self-intersection prior to the operation.
7414 # @note This algorithm doesn't find all types of self-intersections.
7415 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7416 # vertex/face and edge/face intersections. Face/face
7417 # intersections detection is switched off as it is a
7418 # time-consuming operation that gives an impact on performance.
7419 # To find all self-intersections please use
7420 # CheckSelfIntersections() method.
7422 # @note Passed compounds (via ListShapes or via ListTools)
7423 # have to consist of nonintersecting shapes.
7425 # @return New GEOM.GEOM_Object, containing the result shapes.
7427 # @ref swig_todo "Example"
7428 @ManageTransactions("BoolOp")
7429 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7430 ListKeepInside=[], ListRemoveInside=[],
7431 Limit=ShapeType["AUTO"], RemoveWebs=0,
7432 ListMaterials=[], KeepNonlimitShapes=0,
7433 checkSelfInte=False, theName=None):
7435 Perform partition operation.
7436 This method may be useful if it is needed to make a partition for
7437 compound contains nonintersected shapes. Performance will be better
7438 since intersection between shapes from compound is not performed.
7441 Description of all parameters as in method geompy.MakePartition.
7442 One additional parameter is provided:
7443 checkSelfInte The flag that tells if the arguments should
7444 be checked for self-intersection prior to
7448 This algorithm doesn't find all types of self-intersections.
7449 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7450 vertex/face and edge/face intersections. Face/face
7451 intersections detection is switched off as it is a
7452 time-consuming operation that gives an impact on performance.
7453 To find all self-intersections please use
7454 CheckSelfIntersections() method.
7457 Passed compounds (via ListShapes or via ListTools)
7458 have to consist of nonintersecting shapes.
7461 New GEOM.GEOM_Object, containing the result shapes.
7463 if Limit == self.ShapeType["AUTO"]:
7464 # automatic detection of the most appropriate shape limit type
7466 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7467 Limit = EnumToLong(lim)
7469 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7470 ListKeepInside, ListRemoveInside,
7471 Limit, RemoveWebs, ListMaterials,
7472 KeepNonlimitShapes, checkSelfInte);
7473 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7474 self._autoPublish(anObj, theName, "partition")
7477 ## See method MakePartition() for more information.
7479 # @ref tui_partition "Example 1"
7480 # \n @ref swig_Partition "Example 2"
7481 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7482 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7483 KeepNonlimitShapes=0, theName=None):
7485 See method geompy.MakePartition for more information.
7487 # Example: see GEOM_TestOthers.py
7488 # note: auto-publishing is done in self.MakePartition()
7489 anObj = self.MakePartition(ListShapes, ListTools,
7490 ListKeepInside, ListRemoveInside,
7491 Limit, RemoveWebs, ListMaterials,
7492 KeepNonlimitShapes, theName);
7495 ## Perform partition of the Shape with the Plane
7496 # @param theShape Shape to be intersected.
7497 # @param thePlane Tool shape, to intersect theShape.
7498 # @param theName Object name; when specified, this parameter is used
7499 # for result publication in the study. Otherwise, if automatic
7500 # publication is switched on, default value is used for result name.
7502 # @return New GEOM.GEOM_Object, containing the result shape.
7504 # @ref tui_partition "Example"
7505 @ManageTransactions("BoolOp")
7506 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7508 Perform partition of the Shape with the Plane
7511 theShape Shape to be intersected.
7512 thePlane Tool shape, to intersect theShape.
7513 theName Object name; when specified, this parameter is used
7514 for result publication in the study. Otherwise, if automatic
7515 publication is switched on, default value is used for result name.
7518 New GEOM.GEOM_Object, containing the result shape.
7520 # Example: see GEOM_TestAll.py
7521 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7522 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7523 self._autoPublish(anObj, theName, "partition")
7526 # end of l3_basic_op
7529 ## @addtogroup l3_transform
7532 ## Translate the given object along the vector, specified
7533 # by its end points.
7534 # @param theObject The object to be translated.
7535 # @param thePoint1 Start point of translation vector.
7536 # @param thePoint2 End point of translation vector.
7537 # @param theCopy Flag used to translate object itself or create a copy.
7538 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7539 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7540 @ManageTransactions("TrsfOp")
7541 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7543 Translate the given object along the vector, specified by its end points.
7546 theObject The object to be translated.
7547 thePoint1 Start point of translation vector.
7548 thePoint2 End point of translation vector.
7549 theCopy Flag used to translate object itself or create a copy.
7552 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7553 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7556 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7558 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7559 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7562 ## Translate the given object along the vector, specified
7563 # by its end points, creating its copy before the translation.
7564 # @param theObject The object to be translated.
7565 # @param thePoint1 Start point of translation vector.
7566 # @param thePoint2 End point of translation vector.
7567 # @param theName Object name; when specified, this parameter is used
7568 # for result publication in the study. Otherwise, if automatic
7569 # publication is switched on, default value is used for result name.
7571 # @return New GEOM.GEOM_Object, containing the translated object.
7573 # @ref tui_translation "Example 1"
7574 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7575 @ManageTransactions("TrsfOp")
7576 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7578 Translate the given object along the vector, specified
7579 by its end points, creating its copy before the translation.
7582 theObject The object to be translated.
7583 thePoint1 Start point of translation vector.
7584 thePoint2 End point of translation vector.
7585 theName Object name; when specified, this parameter is used
7586 for result publication in the study. Otherwise, if automatic
7587 publication is switched on, default value is used for result name.
7590 New GEOM.GEOM_Object, containing the translated object.
7592 # Example: see GEOM_TestAll.py
7593 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7594 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7595 self._autoPublish(anObj, theName, "translated")
7598 ## Translate the given object along the vector, specified by its components.
7599 # @param theObject The object to be translated.
7600 # @param theDX,theDY,theDZ Components of translation vector.
7601 # @param theCopy Flag used to translate object itself or create a copy.
7602 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7603 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7605 # @ref tui_translation "Example"
7606 @ManageTransactions("TrsfOp")
7607 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7609 Translate the given object along the vector, specified by its components.
7612 theObject The object to be translated.
7613 theDX,theDY,theDZ Components of translation vector.
7614 theCopy Flag used to translate object itself or create a copy.
7617 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7618 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7620 # Example: see GEOM_TestAll.py
7621 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7623 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7625 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7626 anObj.SetParameters(Parameters)
7627 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7630 ## Translate the given object along the vector, specified
7631 # by its components, creating its copy before the translation.
7632 # @param theObject The object to be translated.
7633 # @param theDX,theDY,theDZ Components of translation vector.
7634 # @param theName Object name; when specified, this parameter is used
7635 # for result publication in the study. Otherwise, if automatic
7636 # publication is switched on, default value is used for result name.
7638 # @return New GEOM.GEOM_Object, containing the translated object.
7640 # @ref tui_translation "Example"
7641 @ManageTransactions("TrsfOp")
7642 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7644 Translate the given object along the vector, specified
7645 by its components, creating its copy before the translation.
7648 theObject The object to be translated.
7649 theDX,theDY,theDZ Components of translation vector.
7650 theName Object name; when specified, this parameter is used
7651 for result publication in the study. Otherwise, if automatic
7652 publication is switched on, default value is used for result name.
7655 New GEOM.GEOM_Object, containing the translated object.
7657 # Example: see GEOM_TestAll.py
7658 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7659 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7660 anObj.SetParameters(Parameters)
7661 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7662 self._autoPublish(anObj, theName, "translated")
7665 ## Translate the given object along the given vector.
7666 # @param theObject The object to be translated.
7667 # @param theVector The translation vector.
7668 # @param theCopy Flag used to translate object itself or create a copy.
7669 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7670 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7671 @ManageTransactions("TrsfOp")
7672 def TranslateVector(self, theObject, theVector, theCopy=False):
7674 Translate the given object along the given vector.
7677 theObject The object to be translated.
7678 theVector The translation vector.
7679 theCopy Flag used to translate object itself or create a copy.
7682 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7683 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7686 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7688 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7689 RaiseIfFailed("TranslateVector", self.TrsfOp)
7692 ## Translate the given object along the given vector,
7693 # creating its copy before the translation.
7694 # @param theObject The object to be translated.
7695 # @param theVector The translation vector.
7696 # @param theName Object name; when specified, this parameter is used
7697 # for result publication in the study. Otherwise, if automatic
7698 # publication is switched on, default value is used for result name.
7700 # @return New GEOM.GEOM_Object, containing the translated object.
7702 # @ref tui_translation "Example"
7703 @ManageTransactions("TrsfOp")
7704 def MakeTranslationVector(self, theObject, theVector, theName=None):
7706 Translate the given object along the given vector,
7707 creating its copy before the translation.
7710 theObject The object to be translated.
7711 theVector The translation vector.
7712 theName Object name; when specified, this parameter is used
7713 for result publication in the study. Otherwise, if automatic
7714 publication is switched on, default value is used for result name.
7717 New GEOM.GEOM_Object, containing the translated object.
7719 # Example: see GEOM_TestAll.py
7720 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7721 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7722 self._autoPublish(anObj, theName, "translated")
7725 ## Translate the given object along the given vector on given distance.
7726 # @param theObject The object to be translated.
7727 # @param theVector The translation vector.
7728 # @param theDistance The translation distance.
7729 # @param theCopy Flag used to translate object itself or create a copy.
7730 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7731 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7733 # @ref tui_translation "Example"
7734 @ManageTransactions("TrsfOp")
7735 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7737 Translate the given object along the given vector on given distance.
7740 theObject The object to be translated.
7741 theVector The translation vector.
7742 theDistance The translation distance.
7743 theCopy Flag used to translate object itself or create a copy.
7746 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7747 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7749 # Example: see GEOM_TestAll.py
7750 theDistance,Parameters = ParseParameters(theDistance)
7751 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7752 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7753 anObj.SetParameters(Parameters)
7756 ## Translate the given object along the given vector on given distance,
7757 # creating its copy before the translation.
7758 # @param theObject The object to be translated.
7759 # @param theVector The translation vector.
7760 # @param theDistance The translation distance.
7761 # @param theName Object name; when specified, this parameter is used
7762 # for result publication in the study. Otherwise, if automatic
7763 # publication is switched on, default value is used for result name.
7765 # @return New GEOM.GEOM_Object, containing the translated object.
7767 # @ref tui_translation "Example"
7768 @ManageTransactions("TrsfOp")
7769 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7771 Translate the given object along the given vector on given distance,
7772 creating its copy before the translation.
7775 theObject The object to be translated.
7776 theVector The translation vector.
7777 theDistance The translation distance.
7778 theName Object name; when specified, this parameter is used
7779 for result publication in the study. Otherwise, if automatic
7780 publication is switched on, default value is used for result name.
7783 New GEOM.GEOM_Object, containing the translated object.
7785 # Example: see GEOM_TestAll.py
7786 theDistance,Parameters = ParseParameters(theDistance)
7787 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7788 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7789 anObj.SetParameters(Parameters)
7790 self._autoPublish(anObj, theName, "translated")
7793 ## Rotate the given object around the given axis on the given angle.
7794 # @param theObject The object to be rotated.
7795 # @param theAxis Rotation axis.
7796 # @param theAngle Rotation angle in radians.
7797 # @param theCopy Flag used to rotate object itself or create a copy.
7799 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7800 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7802 # @ref tui_rotation "Example"
7803 @ManageTransactions("TrsfOp")
7804 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7806 Rotate the given object around the given axis on the given angle.
7809 theObject The object to be rotated.
7810 theAxis Rotation axis.
7811 theAngle Rotation angle in radians.
7812 theCopy Flag used to rotate object itself or create a copy.
7815 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7816 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7818 # Example: see GEOM_TestAll.py
7820 if isinstance(theAngle,str):
7822 theAngle, Parameters = ParseParameters(theAngle)
7824 theAngle = theAngle*math.pi/180.0
7826 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7828 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7829 RaiseIfFailed("Rotate", self.TrsfOp)
7830 anObj.SetParameters(Parameters)
7833 ## Rotate the given object around the given axis
7834 # on the given angle, creating its copy before the rotatation.
7835 # @param theObject The object to be rotated.
7836 # @param theAxis Rotation axis.
7837 # @param theAngle Rotation angle in radians.
7838 # @param theName Object name; when specified, this parameter is used
7839 # for result publication in the study. Otherwise, if automatic
7840 # publication is switched on, default value is used for result name.
7842 # @return New GEOM.GEOM_Object, containing the rotated object.
7844 # @ref tui_rotation "Example"
7845 @ManageTransactions("TrsfOp")
7846 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7848 Rotate the given object around the given axis
7849 on the given angle, creating its copy before the rotatation.
7852 theObject The object to be rotated.
7853 theAxis Rotation axis.
7854 theAngle Rotation angle in radians.
7855 theName Object name; when specified, this parameter is used
7856 for result publication in the study. Otherwise, if automatic
7857 publication is switched on, default value is used for result name.
7860 New GEOM.GEOM_Object, containing the rotated object.
7862 # Example: see GEOM_TestAll.py
7864 if isinstance(theAngle,str):
7866 theAngle, Parameters = ParseParameters(theAngle)
7868 theAngle = theAngle*math.pi/180.0
7869 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7870 RaiseIfFailed("RotateCopy", self.TrsfOp)
7871 anObj.SetParameters(Parameters)
7872 self._autoPublish(anObj, theName, "rotated")
7875 ## Rotate given object around vector perpendicular to plane
7876 # containing three points.
7877 # @param theObject The object to be rotated.
7878 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7879 # containing the three points.
7880 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7881 # @param theCopy Flag used to rotate object itself or create a copy.
7882 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7883 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7884 @ManageTransactions("TrsfOp")
7885 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7887 Rotate given object around vector perpendicular to plane
7888 containing three points.
7891 theObject The object to be rotated.
7892 theCentPoint central point the axis is the vector perpendicular to the plane
7893 containing the three points.
7894 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7895 theCopy Flag used to rotate object itself or create a copy.
7898 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7899 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7902 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7904 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7905 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7908 ## Rotate given object around vector perpendicular to plane
7909 # containing three points, creating its copy before the rotatation.
7910 # @param theObject The object to be rotated.
7911 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7912 # containing the three points.
7913 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7914 # @param theName Object name; when specified, this parameter is used
7915 # for result publication in the study. Otherwise, if automatic
7916 # publication is switched on, default value is used for result name.
7918 # @return New GEOM.GEOM_Object, containing the rotated object.
7920 # @ref tui_rotation "Example"
7921 @ManageTransactions("TrsfOp")
7922 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7924 Rotate given object around vector perpendicular to plane
7925 containing three points, creating its copy before the rotatation.
7928 theObject The object to be rotated.
7929 theCentPoint central point the axis is the vector perpendicular to the plane
7930 containing the three points.
7931 thePoint1,thePoint2 in a perpendicular plane of the axis.
7932 theName Object name; when specified, this parameter is used
7933 for result publication in the study. Otherwise, if automatic
7934 publication is switched on, default value is used for result name.
7937 New GEOM.GEOM_Object, containing the rotated object.
7939 # Example: see GEOM_TestAll.py
7940 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7941 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7942 self._autoPublish(anObj, theName, "rotated")
7945 ## Scale the given object by the specified factor.
7946 # @param theObject The object to be scaled.
7947 # @param thePoint Center point for scaling.
7948 # Passing None for it means scaling relatively the origin of global CS.
7949 # @param theFactor Scaling factor value.
7950 # @param theCopy Flag used to scale object itself or create a copy.
7951 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7952 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7953 @ManageTransactions("TrsfOp")
7954 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7956 Scale the given object by the specified factor.
7959 theObject The object to be scaled.
7960 thePoint Center point for scaling.
7961 Passing None for it means scaling relatively the origin of global CS.
7962 theFactor Scaling factor value.
7963 theCopy Flag used to scale object itself or create a copy.
7966 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7967 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7969 # Example: see GEOM_TestAll.py
7970 theFactor, Parameters = ParseParameters(theFactor)
7972 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7974 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7975 RaiseIfFailed("Scale", self.TrsfOp)
7976 anObj.SetParameters(Parameters)
7979 ## Scale the given object by the factor, creating its copy before the scaling.
7980 # @param theObject The object to be scaled.
7981 # @param thePoint Center point for scaling.
7982 # Passing None for it means scaling relatively the origin of global CS.
7983 # @param theFactor Scaling factor value.
7984 # @param theName Object name; when specified, this parameter is used
7985 # for result publication in the study. Otherwise, if automatic
7986 # publication is switched on, default value is used for result name.
7988 # @return New GEOM.GEOM_Object, containing the scaled shape.
7990 # @ref tui_scale "Example"
7991 @ManageTransactions("TrsfOp")
7992 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7994 Scale the given object by the factor, creating its copy before the scaling.
7997 theObject The object to be scaled.
7998 thePoint Center point for scaling.
7999 Passing None for it means scaling relatively the origin of global CS.
8000 theFactor Scaling factor value.
8001 theName Object name; when specified, this parameter is used
8002 for result publication in the study. Otherwise, if automatic
8003 publication is switched on, default value is used for result name.
8006 New GEOM.GEOM_Object, containing the scaled shape.
8008 # Example: see GEOM_TestAll.py
8009 theFactor, Parameters = ParseParameters(theFactor)
8010 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8011 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8012 anObj.SetParameters(Parameters)
8013 self._autoPublish(anObj, theName, "scaled")
8016 ## Scale the given object by different factors along coordinate axes.
8017 # @param theObject The object to be scaled.
8018 # @param thePoint Center point for scaling.
8019 # Passing None for it means scaling relatively the origin of global CS.
8020 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8021 # @param theCopy Flag used to scale object itself or create a copy.
8022 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8023 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8024 @ManageTransactions("TrsfOp")
8025 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8027 Scale the given object by different factors along coordinate axes.
8030 theObject The object to be scaled.
8031 thePoint Center point for scaling.
8032 Passing None for it means scaling relatively the origin of global CS.
8033 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8034 theCopy Flag used to scale object itself or create a copy.
8037 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8038 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8040 # Example: see GEOM_TestAll.py
8041 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8043 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8044 theFactorX, theFactorY, theFactorZ)
8046 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8047 theFactorX, theFactorY, theFactorZ)
8048 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8049 anObj.SetParameters(Parameters)
8052 ## Scale the given object by different factors along coordinate axes,
8053 # creating its copy before the scaling.
8054 # @param theObject The object to be scaled.
8055 # @param thePoint Center point for scaling.
8056 # Passing None for it means scaling relatively the origin of global CS.
8057 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8058 # @param theName Object name; when specified, this parameter is used
8059 # for result publication in the study. Otherwise, if automatic
8060 # publication is switched on, default value is used for result name.
8062 # @return New GEOM.GEOM_Object, containing the scaled shape.
8064 # @ref swig_scale "Example"
8065 @ManageTransactions("TrsfOp")
8066 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8068 Scale the given object by different factors along coordinate axes,
8069 creating its copy before the scaling.
8072 theObject The object to be scaled.
8073 thePoint Center point for scaling.
8074 Passing None for it means scaling relatively the origin of global CS.
8075 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8076 theName Object name; when specified, this parameter is used
8077 for result publication in the study. Otherwise, if automatic
8078 publication is switched on, default value is used for result name.
8081 New GEOM.GEOM_Object, containing the scaled shape.
8083 # Example: see GEOM_TestAll.py
8084 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8085 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8086 theFactorX, theFactorY, theFactorZ)
8087 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8088 anObj.SetParameters(Parameters)
8089 self._autoPublish(anObj, theName, "scaled")
8092 ## Mirror an object relatively the given plane.
8093 # @param theObject The object to be mirrored.
8094 # @param thePlane Plane of symmetry.
8095 # @param theCopy Flag used to mirror object itself or create a copy.
8096 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8097 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8098 @ManageTransactions("TrsfOp")
8099 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8101 Mirror an object relatively the given plane.
8104 theObject The object to be mirrored.
8105 thePlane Plane of symmetry.
8106 theCopy Flag used to mirror object itself or create a copy.
8109 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8110 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8113 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8115 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8116 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8119 ## Create an object, symmetrical
8120 # to the given one relatively the given plane.
8121 # @param theObject The object to be mirrored.
8122 # @param thePlane Plane of symmetry.
8123 # @param theName Object name; when specified, this parameter is used
8124 # for result publication in the study. Otherwise, if automatic
8125 # publication is switched on, default value is used for result name.
8127 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8129 # @ref tui_mirror "Example"
8130 @ManageTransactions("TrsfOp")
8131 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8133 Create an object, symmetrical to the given one relatively the given plane.
8136 theObject The object to be mirrored.
8137 thePlane Plane of symmetry.
8138 theName Object name; when specified, this parameter is used
8139 for result publication in the study. Otherwise, if automatic
8140 publication is switched on, default value is used for result name.
8143 New GEOM.GEOM_Object, containing the mirrored shape.
8145 # Example: see GEOM_TestAll.py
8146 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8147 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8148 self._autoPublish(anObj, theName, "mirrored")
8151 ## Mirror an object relatively the given axis.
8152 # @param theObject The object to be mirrored.
8153 # @param theAxis Axis of symmetry.
8154 # @param theCopy Flag used to mirror object itself or create a copy.
8155 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8156 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8157 @ManageTransactions("TrsfOp")
8158 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8160 Mirror an object relatively the given axis.
8163 theObject The object to be mirrored.
8164 theAxis Axis of symmetry.
8165 theCopy Flag used to mirror object itself or create a copy.
8168 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8169 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8172 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8174 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8175 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8178 ## Create an object, symmetrical
8179 # to the given one relatively the given axis.
8180 # @param theObject The object to be mirrored.
8181 # @param theAxis Axis of symmetry.
8182 # @param theName Object name; when specified, this parameter is used
8183 # for result publication in the study. Otherwise, if automatic
8184 # publication is switched on, default value is used for result name.
8186 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8188 # @ref tui_mirror "Example"
8189 @ManageTransactions("TrsfOp")
8190 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8192 Create an object, symmetrical to the given one relatively the given axis.
8195 theObject The object to be mirrored.
8196 theAxis Axis of symmetry.
8197 theName Object name; when specified, this parameter is used
8198 for result publication in the study. Otherwise, if automatic
8199 publication is switched on, default value is used for result name.
8202 New GEOM.GEOM_Object, containing the mirrored shape.
8204 # Example: see GEOM_TestAll.py
8205 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8206 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8207 self._autoPublish(anObj, theName, "mirrored")
8210 ## Mirror an object relatively the given point.
8211 # @param theObject The object to be mirrored.
8212 # @param thePoint Point of symmetry.
8213 # @param theCopy Flag used to mirror object itself or create a copy.
8214 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8215 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8216 @ManageTransactions("TrsfOp")
8217 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8219 Mirror an object relatively the given point.
8222 theObject The object to be mirrored.
8223 thePoint Point of symmetry.
8224 theCopy Flag used to mirror object itself or create a copy.
8227 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8228 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8230 # Example: see GEOM_TestAll.py
8232 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8234 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8235 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8238 ## Create an object, symmetrical
8239 # to the given one relatively the given point.
8240 # @param theObject The object to be mirrored.
8241 # @param thePoint Point of symmetry.
8242 # @param theName Object name; when specified, this parameter is used
8243 # for result publication in the study. Otherwise, if automatic
8244 # publication is switched on, default value is used for result name.
8246 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8248 # @ref tui_mirror "Example"
8249 @ManageTransactions("TrsfOp")
8250 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8252 Create an object, symmetrical
8253 to the given one relatively the given point.
8256 theObject The object to be mirrored.
8257 thePoint Point of symmetry.
8258 theName Object name; when specified, this parameter is used
8259 for result publication in the study. Otherwise, if automatic
8260 publication is switched on, default value is used for result name.
8263 New GEOM.GEOM_Object, containing the mirrored shape.
8265 # Example: see GEOM_TestAll.py
8266 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8267 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8268 self._autoPublish(anObj, theName, "mirrored")
8271 ## Modify the location of the given object.
8272 # @param theObject The object to be displaced.
8273 # @param theStartLCS Coordinate system to perform displacement from it.\n
8274 # If \a theStartLCS is NULL, displacement
8275 # will be performed from global CS.\n
8276 # If \a theObject itself is used as \a theStartLCS,
8277 # its location will be changed to \a theEndLCS.
8278 # @param theEndLCS Coordinate system to perform displacement to it.
8279 # @param theCopy Flag used to displace object itself or create a copy.
8280 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8281 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8282 @ManageTransactions("TrsfOp")
8283 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8285 Modify the Location of the given object by LCS, creating its copy before the setting.
8288 theObject The object to be displaced.
8289 theStartLCS Coordinate system to perform displacement from it.
8290 If theStartLCS is NULL, displacement
8291 will be performed from global CS.
8292 If theObject itself is used as theStartLCS,
8293 its location will be changed to theEndLCS.
8294 theEndLCS Coordinate system to perform displacement to it.
8295 theCopy Flag used to displace object itself or create a copy.
8298 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8299 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8301 # Example: see GEOM_TestAll.py
8303 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8305 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8306 RaiseIfFailed("Displace", self.TrsfOp)
8309 ## Modify the Location of the given object by LCS,
8310 # creating its copy before the setting.
8311 # @param theObject The object to be displaced.
8312 # @param theStartLCS Coordinate system to perform displacement from it.\n
8313 # If \a theStartLCS is NULL, displacement
8314 # will be performed from global CS.\n
8315 # If \a theObject itself is used as \a theStartLCS,
8316 # its location will be changed to \a theEndLCS.
8317 # @param theEndLCS Coordinate system to perform displacement to it.
8318 # @param theName Object name; when specified, this parameter is used
8319 # for result publication in the study. Otherwise, if automatic
8320 # publication is switched on, default value is used for result name.
8322 # @return New GEOM.GEOM_Object, containing the displaced shape.
8324 # @ref tui_modify_location "Example"
8325 @ManageTransactions("TrsfOp")
8326 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8328 Modify the Location of the given object by LCS, creating its copy before the setting.
8331 theObject The object to be displaced.
8332 theStartLCS Coordinate system to perform displacement from it.
8333 If theStartLCS is NULL, displacement
8334 will be performed from global CS.
8335 If theObject itself is used as theStartLCS,
8336 its location will be changed to theEndLCS.
8337 theEndLCS Coordinate system to perform displacement to it.
8338 theName Object name; when specified, this parameter is used
8339 for result publication in the study. Otherwise, if automatic
8340 publication is switched on, default value is used for result name.
8343 New GEOM.GEOM_Object, containing the displaced shape.
8346 # create local coordinate systems
8347 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8348 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8349 # modify the location of the given object
8350 position = geompy.MakePosition(cylinder, cs1, cs2)
8352 # Example: see GEOM_TestAll.py
8353 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8354 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8355 self._autoPublish(anObj, theName, "displaced")
8358 ## Modify the Location of the given object by Path.
8359 # @param theObject The object to be displaced.
8360 # @param thePath Wire or Edge along that the object will be translated.
8361 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8362 # @param theCopy is to create a copy objects if true.
8363 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8364 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8365 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8367 # @ref tui_modify_location "Example"
8368 @ManageTransactions("TrsfOp")
8369 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8371 Modify the Location of the given object by Path.
8374 theObject The object to be displaced.
8375 thePath Wire or Edge along that the object will be translated.
8376 theDistance progress of Path (0 = start location, 1 = end of path location).
8377 theCopy is to create a copy objects if true.
8378 theReverse 0 - for usual direction, 1 - to reverse path direction.
8381 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8382 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8385 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8387 # Example: see GEOM_TestAll.py
8388 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8389 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8392 ## Modify the Location of the given object by Path, creating its copy before the operation.
8393 # @param theObject The object to be displaced.
8394 # @param thePath Wire or Edge along that the object will be translated.
8395 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8396 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8397 # @param theName Object name; when specified, this parameter is used
8398 # for result publication in the study. Otherwise, if automatic
8399 # publication is switched on, default value is used for result name.
8401 # @return New GEOM.GEOM_Object, containing the displaced shape.
8402 @ManageTransactions("TrsfOp")
8403 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8405 Modify the Location of the given object by Path, creating its copy before the operation.
8408 theObject The object to be displaced.
8409 thePath Wire or Edge along that the object will be translated.
8410 theDistance progress of Path (0 = start location, 1 = end of path location).
8411 theReverse 0 - for usual direction, 1 - to reverse path direction.
8412 theName Object name; when specified, this parameter is used
8413 for result publication in the study. Otherwise, if automatic
8414 publication is switched on, default value is used for result name.
8417 New GEOM.GEOM_Object, containing the displaced shape.
8419 # Example: see GEOM_TestAll.py
8420 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8421 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8422 self._autoPublish(anObj, theName, "displaced")
8425 ## Offset given shape.
8426 # @param theObject The base object for the offset.
8427 # @param theOffset Offset value.
8428 # @param theCopy Flag used to offset object itself or create a copy.
8429 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8430 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8431 @ManageTransactions("TrsfOp")
8432 def Offset(self, theObject, theOffset, theCopy=False):
8437 theObject The base object for the offset.
8438 theOffset Offset value.
8439 theCopy Flag used to offset object itself or create a copy.
8442 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8443 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8445 theOffset, Parameters = ParseParameters(theOffset)
8447 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8449 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8450 RaiseIfFailed("Offset", self.TrsfOp)
8451 anObj.SetParameters(Parameters)
8454 ## Create new object as offset of the given one.
8455 # @param theObject The base object for the offset.
8456 # @param theOffset Offset value.
8457 # @param theName Object name; when specified, this parameter is used
8458 # for result publication in the study. Otherwise, if automatic
8459 # publication is switched on, default value is used for result name.
8461 # @return New GEOM.GEOM_Object, containing the offset object.
8463 # @ref tui_offset "Example"
8464 @ManageTransactions("TrsfOp")
8465 def MakeOffset(self, theObject, theOffset, theName=None):
8467 Create new object as offset of the given one.
8470 theObject The base object for the offset.
8471 theOffset Offset value.
8472 theName Object name; when specified, this parameter is used
8473 for result publication in the study. Otherwise, if automatic
8474 publication is switched on, default value is used for result name.
8477 New GEOM.GEOM_Object, containing the offset object.
8480 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8481 # create a new object as offset of the given object
8482 offset = geompy.MakeOffset(box, 70.)
8484 # Example: see GEOM_TestAll.py
8485 theOffset, Parameters = ParseParameters(theOffset)
8486 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8487 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8488 anObj.SetParameters(Parameters)
8489 self._autoPublish(anObj, theName, "offset")
8492 ## Create new object as projection of the given one on a 2D surface.
8493 # @param theSource The source object for the projection. It can be a point, edge or wire.
8494 # @param theTarget The target object. It can be planar or cylindrical face.
8495 # @param theName Object name; when specified, this parameter is used
8496 # for result publication in the study. Otherwise, if automatic
8497 # publication is switched on, default value is used for result name.
8499 # @return New GEOM.GEOM_Object, containing the projection.
8501 # @ref tui_projection "Example"
8502 @ManageTransactions("TrsfOp")
8503 def MakeProjection(self, theSource, theTarget, theName=None):
8505 Create new object as projection of the given one on a 2D surface.
8508 theSource The source object for the projection. It can be a point, edge or wire.
8509 theTarget The target object. It can be planar or cylindrical face.
8510 theName Object name; when specified, this parameter is used
8511 for result publication in the study. Otherwise, if automatic
8512 publication is switched on, default value is used for result name.
8515 New GEOM.GEOM_Object, containing the projection.
8517 # Example: see GEOM_TestAll.py
8518 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8519 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8520 self._autoPublish(anObj, theName, "projection")
8523 ## Create a projection projection of the given point on a wire or an edge.
8524 # If there are no solutions or there are 2 or more solutions It throws an
8526 # @param thePoint the point to be projected.
8527 # @param theWire the wire. The edge is accepted as well.
8528 # @param theName Object name; when specified, this parameter is used
8529 # for result publication in the study. Otherwise, if automatic
8530 # publication is switched on, default value is used for result name.
8532 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8533 # \n \a u: The parameter of projection point on edge.
8534 # \n \a PointOnEdge: The projection point.
8535 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8537 # @ref tui_projection "Example"
8538 @ManageTransactions("TrsfOp")
8539 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8541 Create a projection projection of the given point on a wire or an edge.
8542 If there are no solutions or there are 2 or more solutions It throws an
8546 thePoint the point to be projected.
8547 theWire the wire. The edge is accepted as well.
8548 theName Object name; when specified, this parameter is used
8549 for result publication in the study. Otherwise, if automatic
8550 publication is switched on, default value is used for result name.
8553 [u, PointOnEdge, EdgeInWireIndex]
8554 u: The parameter of projection point on edge.
8555 PointOnEdge: The projection point.
8556 EdgeInWireIndex: The index of an edge in a wire.
8558 # Example: see GEOM_TestAll.py
8559 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8560 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8561 self._autoPublish(anObj[1], theName, "projection")
8564 # -----------------------------------------------------------------------------
8566 # -----------------------------------------------------------------------------
8568 ## Translate the given object along the given vector a given number times
8569 # @param theObject The object to be translated.
8570 # @param theVector Direction of the translation. DX if None.
8571 # @param theStep Distance to translate on.
8572 # @param theNbTimes Quantity of translations to be done.
8573 # @param theName Object name; when specified, this parameter is used
8574 # for result publication in the study. Otherwise, if automatic
8575 # publication is switched on, default value is used for result name.
8577 # @return New GEOM.GEOM_Object, containing compound of all
8578 # the shapes, obtained after each translation.
8580 # @ref tui_multi_translation "Example"
8581 @ManageTransactions("TrsfOp")
8582 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8584 Translate the given object along the given vector a given number times
8587 theObject The object to be translated.
8588 theVector Direction of the translation. DX if None.
8589 theStep Distance to translate on.
8590 theNbTimes Quantity of translations to be done.
8591 theName Object name; when specified, this parameter is used
8592 for result publication in the study. Otherwise, if automatic
8593 publication is switched on, default value is used for result name.
8596 New GEOM.GEOM_Object, containing compound of all
8597 the shapes, obtained after each translation.
8600 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8602 # Example: see GEOM_TestAll.py
8603 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8604 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8605 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8606 anObj.SetParameters(Parameters)
8607 self._autoPublish(anObj, theName, "multitranslation")
8610 ## Conseqently apply two specified translations to theObject specified number of times.
8611 # @param theObject The object to be translated.
8612 # @param theVector1 Direction of the first translation. DX if None.
8613 # @param theStep1 Step of the first translation.
8614 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8615 # @param theVector2 Direction of the second translation. DY if None.
8616 # @param theStep2 Step of the second translation.
8617 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8618 # @param theName Object name; when specified, this parameter is used
8619 # for result publication in the study. Otherwise, if automatic
8620 # publication is switched on, default value is used for result name.
8622 # @return New GEOM.GEOM_Object, containing compound of all
8623 # the shapes, obtained after each translation.
8625 # @ref tui_multi_translation "Example"
8626 @ManageTransactions("TrsfOp")
8627 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8628 theVector2, theStep2, theNbTimes2, theName=None):
8630 Conseqently apply two specified translations to theObject specified number of times.
8633 theObject The object to be translated.
8634 theVector1 Direction of the first translation. DX if None.
8635 theStep1 Step of the first translation.
8636 theNbTimes1 Quantity of translations to be done along theVector1.
8637 theVector2 Direction of the second translation. DY if None.
8638 theStep2 Step of the second translation.
8639 theNbTimes2 Quantity of translations to be done along theVector2.
8640 theName Object name; when specified, this parameter is used
8641 for result publication in the study. Otherwise, if automatic
8642 publication is switched on, default value is used for result name.
8645 New GEOM.GEOM_Object, containing compound of all
8646 the shapes, obtained after each translation.
8649 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8651 # Example: see GEOM_TestAll.py
8652 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8653 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8654 theVector2, theStep2, theNbTimes2)
8655 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8656 anObj.SetParameters(Parameters)
8657 self._autoPublish(anObj, theName, "multitranslation")
8660 ## Rotate the given object around the given axis a given number times.
8661 # Rotation angle will be 2*PI/theNbTimes.
8662 # @param theObject The object to be rotated.
8663 # @param theAxis The rotation axis. DZ if None.
8664 # @param theNbTimes Quantity of rotations to be done.
8665 # @param theName Object name; when specified, this parameter is used
8666 # for result publication in the study. Otherwise, if automatic
8667 # publication is switched on, default value is used for result name.
8669 # @return New GEOM.GEOM_Object, containing compound of all the
8670 # shapes, obtained after each rotation.
8672 # @ref tui_multi_rotation "Example"
8673 @ManageTransactions("TrsfOp")
8674 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8676 Rotate the given object around the given axis a given number times.
8677 Rotation angle will be 2*PI/theNbTimes.
8680 theObject The object to be rotated.
8681 theAxis The rotation axis. DZ if None.
8682 theNbTimes Quantity of rotations to be done.
8683 theName Object name; when specified, this parameter is used
8684 for result publication in the study. Otherwise, if automatic
8685 publication is switched on, default value is used for result name.
8688 New GEOM.GEOM_Object, containing compound of all the
8689 shapes, obtained after each rotation.
8692 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8694 # Example: see GEOM_TestAll.py
8695 theNbTimes, Parameters = ParseParameters(theNbTimes)
8696 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8697 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8698 anObj.SetParameters(Parameters)
8699 self._autoPublish(anObj, theName, "multirotation")
8702 ## Rotate the given object around the given axis
8703 # a given number times on the given angle.
8704 # @param theObject The object to be rotated.
8705 # @param theAxis The rotation axis. DZ if None.
8706 # @param theAngleStep Rotation angle in radians.
8707 # @param theNbTimes Quantity of rotations to be done.
8708 # @param theName Object name; when specified, this parameter is used
8709 # for result publication in the study. Otherwise, if automatic
8710 # publication is switched on, default value is used for result name.
8712 # @return New GEOM.GEOM_Object, containing compound of all the
8713 # shapes, obtained after each rotation.
8715 # @ref tui_multi_rotation "Example"
8716 @ManageTransactions("TrsfOp")
8717 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8719 Rotate the given object around the given axis
8720 a given number times on the given angle.
8723 theObject The object to be rotated.
8724 theAxis The rotation axis. DZ if None.
8725 theAngleStep Rotation angle in radians.
8726 theNbTimes Quantity of rotations to be done.
8727 theName Object name; when specified, this parameter is used
8728 for result publication in the study. Otherwise, if automatic
8729 publication is switched on, default value is used for result name.
8732 New GEOM.GEOM_Object, containing compound of all the
8733 shapes, obtained after each rotation.
8736 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8738 # Example: see GEOM_TestAll.py
8739 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8740 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8741 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8742 anObj.SetParameters(Parameters)
8743 self._autoPublish(anObj, theName, "multirotation")
8746 ## Rotate the given object around the given axis a given
8747 # number times and multi-translate each rotation result.
8748 # Rotation angle will be 2*PI/theNbTimes1.
8749 # Translation direction passes through center of gravity
8750 # of rotated shape and its projection on the rotation axis.
8751 # @param theObject The object to be rotated.
8752 # @param theAxis Rotation axis. DZ if None.
8753 # @param theNbTimes1 Quantity of rotations to be done.
8754 # @param theRadialStep Translation distance.
8755 # @param theNbTimes2 Quantity of translations to be done.
8756 # @param theName Object name; when specified, this parameter is used
8757 # for result publication in the study. Otherwise, if automatic
8758 # publication is switched on, default value is used for result name.
8760 # @return New GEOM.GEOM_Object, containing compound of all the
8761 # shapes, obtained after each transformation.
8763 # @ref tui_multi_rotation "Example"
8764 @ManageTransactions("TrsfOp")
8765 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8767 Rotate the given object around the
8768 given axis on the given angle a given number
8769 times and multi-translate each rotation result.
8770 Translation direction passes through center of gravity
8771 of rotated shape and its projection on the rotation axis.
8774 theObject The object to be rotated.
8775 theAxis Rotation axis. DZ if None.
8776 theNbTimes1 Quantity of rotations to be done.
8777 theRadialStep Translation distance.
8778 theNbTimes2 Quantity of translations to be done.
8779 theName Object name; when specified, this parameter is used
8780 for result publication in the study. Otherwise, if automatic
8781 publication is switched on, default value is used for result name.
8784 New GEOM.GEOM_Object, containing compound of all the
8785 shapes, obtained after each transformation.
8788 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8790 # Example: see GEOM_TestAll.py
8791 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8792 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8793 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8794 anObj.SetParameters(Parameters)
8795 self._autoPublish(anObj, theName, "multirotation")
8798 ## Rotate the given object around the
8799 # given axis on the given angle a given number
8800 # times and multi-translate each rotation result.
8801 # Translation direction passes through center of gravity
8802 # of rotated shape and its projection on the rotation axis.
8803 # @param theObject The object to be rotated.
8804 # @param theAxis Rotation axis. DZ if None.
8805 # @param theAngleStep Rotation angle in radians.
8806 # @param theNbTimes1 Quantity of rotations to be done.
8807 # @param theRadialStep Translation distance.
8808 # @param theNbTimes2 Quantity of translations to be done.
8809 # @param theName Object name; when specified, this parameter is used
8810 # for result publication in the study. Otherwise, if automatic
8811 # publication is switched on, default value is used for result name.
8813 # @return New GEOM.GEOM_Object, containing compound of all the
8814 # shapes, obtained after each transformation.
8816 # @ref tui_multi_rotation "Example"
8817 @ManageTransactions("TrsfOp")
8818 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8820 Rotate the given object around the
8821 given axis on the given angle a given number
8822 times and multi-translate each rotation result.
8823 Translation direction passes through center of gravity
8824 of rotated shape and its projection on the rotation axis.
8827 theObject The object to be rotated.
8828 theAxis Rotation axis. DZ if None.
8829 theAngleStep Rotation angle in radians.
8830 theNbTimes1 Quantity of rotations to be done.
8831 theRadialStep Translation distance.
8832 theNbTimes2 Quantity of translations to be done.
8833 theName Object name; when specified, this parameter is used
8834 for result publication in the study. Otherwise, if automatic
8835 publication is switched on, default value is used for result name.
8838 New GEOM.GEOM_Object, containing compound of all the
8839 shapes, obtained after each transformation.
8842 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8844 # Example: see GEOM_TestAll.py
8845 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8846 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8847 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8848 anObj.SetParameters(Parameters)
8849 self._autoPublish(anObj, theName, "multirotation")
8852 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8854 # @ref swig_MakeMultiRotation "Example"
8855 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8857 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8860 pz = geompy.MakeVertex(0, 0, 100)
8861 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8862 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8864 # Example: see GEOM_TestOthers.py
8865 aVec = self.MakeLine(aPoint,aDir)
8866 # note: auto-publishing is done in self.MultiRotate1D()
8867 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8870 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8872 # @ref swig_MakeMultiRotation "Example"
8873 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8875 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8878 pz = geompy.MakeVertex(0, 0, 100)
8879 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8880 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8882 # Example: see GEOM_TestOthers.py
8883 aVec = self.MakeLine(aPoint,aDir)
8884 # note: auto-publishing is done in self.MultiRotate1D()
8885 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8888 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8890 # @ref swig_MakeMultiRotation "Example"
8891 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8893 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8896 pz = geompy.MakeVertex(0, 0, 100)
8897 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8898 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8900 # Example: see GEOM_TestOthers.py
8901 aVec = self.MakeLine(aPoint,aDir)
8902 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8903 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8906 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8908 # @ref swig_MakeMultiRotation "Example"
8909 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8911 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8914 pz = geompy.MakeVertex(0, 0, 100)
8915 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8916 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8918 # Example: see GEOM_TestOthers.py
8919 aVec = self.MakeLine(aPoint,aDir)
8920 # note: auto-publishing is done in self.MultiRotate2D()
8921 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8924 # end of l3_transform
8927 ## @addtogroup l3_transform_d
8930 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8931 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8933 Deprecated method. Use MultiRotate1DNbTimes instead.
8935 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8936 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8938 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8939 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8940 @ManageTransactions("TrsfOp")
8941 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8943 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8944 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8947 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8949 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8950 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8951 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8952 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8953 anObj.SetParameters(Parameters)
8954 self._autoPublish(anObj, theName, "multirotation")
8957 ## The same, as MultiRotate1D(), but axis is given by direction and point
8958 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8959 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8961 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8962 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8965 pz = geompy.MakeVertex(0, 0, 100)
8966 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8967 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8969 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8970 aVec = self.MakeLine(aPoint,aDir)
8971 # note: auto-publishing is done in self.MultiRotate1D()
8972 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8975 ## The same, as MultiRotate2D(), but axis is given by direction and point
8976 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8977 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8979 The same, as MultiRotate2D(), but axis is given by direction and point
8980 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8983 pz = geompy.MakeVertex(0, 0, 100)
8984 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8985 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8987 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8988 aVec = self.MakeLine(aPoint,aDir)
8989 # note: auto-publishing is done in self.MultiRotate2D()
8990 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8993 # end of l3_transform_d
8996 ## @addtogroup l3_local
8999 ## Perform a fillet on all edges of the given shape.
9000 # @param theShape Shape, to perform fillet on.
9001 # @param theR Fillet radius.
9002 # @param theName Object name; when specified, this parameter is used
9003 # for result publication in the study. Otherwise, if automatic
9004 # publication is switched on, default value is used for result name.
9006 # @return New GEOM.GEOM_Object, containing the result shape.
9008 # @ref tui_fillet "Example 1"
9009 # \n @ref swig_MakeFilletAll "Example 2"
9010 @ManageTransactions("LocalOp")
9011 def MakeFilletAll(self, theShape, theR, theName=None):
9013 Perform a fillet on all edges of the given shape.
9016 theShape Shape, to perform fillet on.
9018 theName Object name; when specified, this parameter is used
9019 for result publication in the study. Otherwise, if automatic
9020 publication is switched on, default value is used for result name.
9023 New GEOM.GEOM_Object, containing the result shape.
9026 filletall = geompy.MakeFilletAll(prism, 10.)
9028 # Example: see GEOM_TestOthers.py
9029 theR,Parameters = ParseParameters(theR)
9030 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9031 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9032 anObj.SetParameters(Parameters)
9033 self._autoPublish(anObj, theName, "fillet")
9036 ## Perform a fillet on the specified edges/faces of the given shape
9037 # @param theShape Shape, to perform fillet on.
9038 # @param theR Fillet radius.
9039 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9040 # @param theListShapes Global indices of edges/faces to perform fillet on.
9041 # @param theName Object name; when specified, this parameter is used
9042 # for result publication in the study. Otherwise, if automatic
9043 # publication is switched on, default value is used for result name.
9045 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9047 # @return New GEOM.GEOM_Object, containing the result shape.
9049 # @ref tui_fillet "Example"
9050 @ManageTransactions("LocalOp")
9051 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9053 Perform a fillet on the specified edges/faces of the given shape
9056 theShape Shape, to perform fillet on.
9058 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9059 theListShapes Global indices of edges/faces to perform fillet on.
9060 theName Object name; when specified, this parameter is used
9061 for result publication in the study. Otherwise, if automatic
9062 publication is switched on, default value is used for result name.
9065 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9068 New GEOM.GEOM_Object, containing the result shape.
9071 # get the list of IDs (IDList) for the fillet
9072 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9074 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9075 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9076 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9077 # make a fillet on the specified edges of the given shape
9078 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9080 # Example: see GEOM_TestAll.py
9081 theR,Parameters = ParseParameters(theR)
9083 if theShapeType == self.ShapeType["EDGE"]:
9084 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9085 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9087 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9088 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9089 anObj.SetParameters(Parameters)
9090 self._autoPublish(anObj, theName, "fillet")
9093 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9094 @ManageTransactions("LocalOp")
9095 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9097 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9100 # get the list of IDs (IDList) for the fillet
9101 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9103 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9104 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9105 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9106 # make a fillet on the specified edges of the given shape
9107 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9109 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9111 if theShapeType == self.ShapeType["EDGE"]:
9112 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9113 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9115 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9116 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9117 anObj.SetParameters(Parameters)
9118 self._autoPublish(anObj, theName, "fillet")
9121 ## Perform a fillet on the specified edges of the given shape
9122 # @param theShape Wire Shape to perform fillet on.
9123 # @param theR Fillet radius.
9124 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9125 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9126 # \note The list of vertices could be empty,
9127 # in this case fillet will done done at all vertices in wire
9128 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9129 # by the length of the edges, nearest to the fillet vertex.
9130 # But sometimes the next edge is C1 continuous with the one, nearest to
9131 # the fillet point, and such two (or more) edges can be united to allow
9132 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9133 # thus ignoring the secant vertex (vertices).
9134 # @param theName Object name; when specified, this parameter is used
9135 # for result publication in the study. Otherwise, if automatic
9136 # publication is switched on, default value is used for result name.
9138 # @return New GEOM.GEOM_Object, containing the result shape.
9140 # @ref tui_fillet2d "Example"
9141 @ManageTransactions("LocalOp")
9142 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9144 Perform a fillet on the specified edges of the given shape
9147 theShape Wire Shape to perform fillet on.
9149 theListOfVertexes Global indices of vertexes to perform fillet on.
9150 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9151 by the length of the edges, nearest to the fillet vertex.
9152 But sometimes the next edge is C1 continuous with the one, nearest to
9153 the fillet point, and such two (or more) edges can be united to allow
9154 bigger radius. Set this flag to TRUE to allow collinear edges union,
9155 thus ignoring the secant vertex (vertices).
9156 theName Object name; when specified, this parameter is used
9157 for result publication in the study. Otherwise, if automatic
9158 publication is switched on, default value is used for result name.
9160 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9162 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9165 New GEOM.GEOM_Object, containing the result shape.
9169 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9170 # make fillet at given wire vertices with giver radius
9171 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9173 # Example: see GEOM_TestAll.py
9174 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9175 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9176 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9177 anObj.SetParameters(Parameters)
9178 self._autoPublish(anObj, theName, "fillet")
9181 ## Perform a fillet at the specified vertices of the given face/shell.
9182 # @param theShape Face or Shell shape to perform fillet on.
9183 # @param theR Fillet radius.
9184 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9185 # @param theName Object name; when specified, this parameter is used
9186 # for result publication in the study. Otherwise, if automatic
9187 # publication is switched on, default value is used for result name.
9189 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9191 # @return New GEOM.GEOM_Object, containing the result shape.
9193 # @ref tui_fillet2d "Example"
9194 @ManageTransactions("LocalOp")
9195 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9197 Perform a fillet at the specified vertices of the given face/shell.
9200 theShape Face or Shell shape to perform fillet on.
9202 theListOfVertexes Global indices of vertexes to perform fillet on.
9203 theName Object name; when specified, this parameter is used
9204 for result publication in the study. Otherwise, if automatic
9205 publication is switched on, default value is used for result name.
9207 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9210 New GEOM.GEOM_Object, containing the result shape.
9213 face = geompy.MakeFaceHW(100, 100, 1)
9214 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9216 # Example: see GEOM_TestAll.py
9217 theR,Parameters = ParseParameters(theR)
9218 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9219 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9220 anObj.SetParameters(Parameters)
9221 self._autoPublish(anObj, theName, "fillet")
9224 ## Perform a symmetric chamfer on all edges of the given shape.
9225 # @param theShape Shape, to perform chamfer on.
9226 # @param theD Chamfer size along each face.
9227 # @param theName Object name; when specified, this parameter is used
9228 # for result publication in the study. Otherwise, if automatic
9229 # publication is switched on, default value is used for result name.
9231 # @return New GEOM.GEOM_Object, containing the result shape.
9233 # @ref tui_chamfer "Example 1"
9234 # \n @ref swig_MakeChamferAll "Example 2"
9235 @ManageTransactions("LocalOp")
9236 def MakeChamferAll(self, theShape, theD, theName=None):
9238 Perform a symmetric chamfer on all edges of the given shape.
9241 theShape Shape, to perform chamfer on.
9242 theD Chamfer size along each face.
9243 theName Object name; when specified, this parameter is used
9244 for result publication in the study. Otherwise, if automatic
9245 publication is switched on, default value is used for result name.
9248 New GEOM.GEOM_Object, containing the result shape.
9251 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9253 # Example: see GEOM_TestOthers.py
9254 theD,Parameters = ParseParameters(theD)
9255 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9256 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9257 anObj.SetParameters(Parameters)
9258 self._autoPublish(anObj, theName, "chamfer")
9261 ## Perform a chamfer on edges, common to the specified faces,
9262 # with distance D1 on the Face1
9263 # @param theShape Shape, to perform chamfer on.
9264 # @param theD1 Chamfer size along \a theFace1.
9265 # @param theD2 Chamfer size along \a theFace2.
9266 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9267 # @param theName Object name; when specified, this parameter is used
9268 # for result publication in the study. Otherwise, if automatic
9269 # publication is switched on, default value is used for result name.
9271 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9273 # @return New GEOM.GEOM_Object, containing the result shape.
9275 # @ref tui_chamfer "Example"
9276 @ManageTransactions("LocalOp")
9277 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9279 Perform a chamfer on edges, common to the specified faces,
9280 with distance D1 on the Face1
9283 theShape Shape, to perform chamfer on.
9284 theD1 Chamfer size along theFace1.
9285 theD2 Chamfer size along theFace2.
9286 theFace1,theFace2 Global indices of two faces of theShape.
9287 theName Object name; when specified, this parameter is used
9288 for result publication in the study. Otherwise, if automatic
9289 publication is switched on, default value is used for result name.
9292 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9295 New GEOM.GEOM_Object, containing the result shape.
9298 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9299 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9300 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9301 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9303 # Example: see GEOM_TestAll.py
9304 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9305 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9306 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9307 anObj.SetParameters(Parameters)
9308 self._autoPublish(anObj, theName, "chamfer")
9311 ## Perform a chamfer on edges
9312 # @param theShape Shape, to perform chamfer on.
9313 # @param theD Chamfer length
9314 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9315 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9316 # @param theName Object name; when specified, this parameter is used
9317 # for result publication in the study. Otherwise, if automatic
9318 # publication is switched on, default value is used for result name.
9320 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9322 # @return New GEOM.GEOM_Object, containing the result shape.
9323 @ManageTransactions("LocalOp")
9324 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9326 Perform a chamfer on edges
9329 theShape Shape, to perform chamfer on.
9330 theD1 Chamfer size along theFace1.
9331 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9332 theFace1,theFace2 Global indices of two faces of theShape.
9333 theName Object name; when specified, this parameter is used
9334 for result publication in the study. Otherwise, if automatic
9335 publication is switched on, default value is used for result name.
9338 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9341 New GEOM.GEOM_Object, containing the result shape.
9344 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9345 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9346 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9348 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9351 if isinstance(theAngle,str):
9353 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9355 theAngle = theAngle*math.pi/180.0
9356 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9357 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9358 anObj.SetParameters(Parameters)
9359 self._autoPublish(anObj, theName, "chamfer")
9362 ## Perform a chamfer on all edges of the specified faces,
9363 # with distance D1 on the first specified face (if several for one edge)
9364 # @param theShape Shape, to perform chamfer on.
9365 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9366 # connected to the edge, are in \a theFaces, \a theD1
9367 # will be get along face, which is nearer to \a theFaces beginning.
9368 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9369 # @param theFaces Sequence of global indices of faces of \a theShape.
9370 # @param theName Object name; when specified, this parameter is used
9371 # for result publication in the study. Otherwise, if automatic
9372 # publication is switched on, default value is used for result name.
9374 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9376 # @return New GEOM.GEOM_Object, containing the result shape.
9378 # @ref tui_chamfer "Example"
9379 @ManageTransactions("LocalOp")
9380 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9382 Perform a chamfer on all edges of the specified faces,
9383 with distance D1 on the first specified face (if several for one edge)
9386 theShape Shape, to perform chamfer on.
9387 theD1 Chamfer size along face from theFaces. If both faces,
9388 connected to the edge, are in theFaces, theD1
9389 will be get along face, which is nearer to theFaces beginning.
9390 theD2 Chamfer size along another of two faces, connected to the edge.
9391 theFaces Sequence of global indices of faces of theShape.
9392 theName Object name; when specified, this parameter is used
9393 for result publication in the study. Otherwise, if automatic
9394 publication is switched on, default value is used for result name.
9396 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9399 New GEOM.GEOM_Object, containing the result shape.
9401 # Example: see GEOM_TestAll.py
9402 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9403 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9404 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9405 anObj.SetParameters(Parameters)
9406 self._autoPublish(anObj, theName, "chamfer")
9409 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9410 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9412 # @ref swig_FilletChamfer "Example"
9413 @ManageTransactions("LocalOp")
9414 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9416 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9417 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9420 if isinstance(theAngle,str):
9422 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9424 theAngle = theAngle*math.pi/180.0
9425 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9426 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9427 anObj.SetParameters(Parameters)
9428 self._autoPublish(anObj, theName, "chamfer")
9431 ## Perform a chamfer on edges,
9432 # with distance D1 on the first specified face (if several for one edge)
9433 # @param theShape Shape, to perform chamfer on.
9434 # @param theD1,theD2 Chamfer size
9435 # @param theEdges Sequence of edges of \a theShape.
9436 # @param theName Object name; when specified, this parameter is used
9437 # for result publication in the study. Otherwise, if automatic
9438 # publication is switched on, default value is used for result name.
9440 # @return New GEOM.GEOM_Object, containing the result shape.
9442 # @ref swig_FilletChamfer "Example"
9443 @ManageTransactions("LocalOp")
9444 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9446 Perform a chamfer on edges,
9447 with distance D1 on the first specified face (if several for one edge)
9450 theShape Shape, to perform chamfer on.
9451 theD1,theD2 Chamfer size
9452 theEdges Sequence of edges of theShape.
9453 theName Object name; when specified, this parameter is used
9454 for result publication in the study. Otherwise, if automatic
9455 publication is switched on, default value is used for result name.
9458 New GEOM.GEOM_Object, containing the result shape.
9460 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9461 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9462 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9463 anObj.SetParameters(Parameters)
9464 self._autoPublish(anObj, theName, "chamfer")
9467 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9468 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9469 @ManageTransactions("LocalOp")
9470 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9472 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9473 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9476 if isinstance(theAngle,str):
9478 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9480 theAngle = theAngle*math.pi/180.0
9481 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9482 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9483 anObj.SetParameters(Parameters)
9484 self._autoPublish(anObj, theName, "chamfer")
9487 ## @sa MakeChamferEdge(), MakeChamferFaces()
9489 # @ref swig_MakeChamfer "Example"
9490 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9492 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9494 # Example: see GEOM_TestOthers.py
9496 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9497 if aShapeType == self.ShapeType["EDGE"]:
9498 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9500 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9503 ## Remove material from a solid by extrusion of the base shape on the given distance.
9504 # @param theInit Shape to remove material from. It must be a solid or
9505 # a compound made of a single solid.
9506 # @param theBase Closed edge or wire defining the base shape to be extruded.
9507 # @param theH Prism dimension along the normal to theBase
9508 # @param theAngle Draft angle in degrees.
9509 # @param theName Object name; when specified, this parameter is used
9510 # for result publication in the study. Otherwise, if automatic
9511 # publication is switched on, default value is used for result name.
9513 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9515 # @ref tui_creation_prism "Example"
9516 @ManageTransactions("PrimOp")
9517 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9519 Add material to a solid by extrusion of the base shape on the given distance.
9522 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9523 theBase Closed edge or wire defining the base shape to be extruded.
9524 theH Prism dimension along the normal to theBase
9525 theAngle Draft angle in degrees.
9526 theName Object name; when specified, this parameter is used
9527 for result publication in the study. Otherwise, if automatic
9528 publication is switched on, default value is used for result name.
9531 New GEOM.GEOM_Object, containing the initial shape with removed material.
9533 # Example: see GEOM_TestAll.py
9534 #theH,Parameters = ParseParameters(theH)
9535 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9536 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9537 #anObj.SetParameters(Parameters)
9538 self._autoPublish(anObj, theName, "extrudedCut")
9541 ## Add material to a solid by extrusion of the base shape on the given distance.
9542 # @param theInit Shape to add material to. It must be a solid or
9543 # a compound made of a single solid.
9544 # @param theBase Closed edge or wire defining the base shape to be extruded.
9545 # @param theH Prism dimension along the normal to theBase
9546 # @param theAngle Draft angle in degrees.
9547 # @param theName Object name; when specified, this parameter is used
9548 # for result publication in the study. Otherwise, if automatic
9549 # publication is switched on, default value is used for result name.
9551 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9553 # @ref tui_creation_prism "Example"
9554 @ManageTransactions("PrimOp")
9555 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9557 Add material to a solid by extrusion of the base shape on the given distance.
9560 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9561 theBase Closed edge or wire defining the base shape to be extruded.
9562 theH Prism dimension along the normal to theBase
9563 theAngle Draft angle in degrees.
9564 theName Object name; when specified, this parameter is used
9565 for result publication in the study. Otherwise, if automatic
9566 publication is switched on, default value is used for result name.
9569 New GEOM.GEOM_Object, containing the initial shape with added material.
9571 # Example: see GEOM_TestAll.py
9572 #theH,Parameters = ParseParameters(theH)
9573 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9574 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9575 #anObj.SetParameters(Parameters)
9576 self._autoPublish(anObj, theName, "extrudedBoss")
9582 ## @addtogroup l3_basic_op
9585 ## Perform an Archimde operation on the given shape with given parameters.
9586 # The object presenting the resulting face is returned.
9587 # @param theShape Shape to be put in water.
9588 # @param theWeight Weight og the shape.
9589 # @param theWaterDensity Density of the water.
9590 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9591 # @param theName Object name; when specified, this parameter is used
9592 # for result publication in the study. Otherwise, if automatic
9593 # publication is switched on, default value is used for result name.
9595 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9596 # by a plane, corresponding to water level.
9598 # @ref tui_archimede "Example"
9599 @ManageTransactions("LocalOp")
9600 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9602 Perform an Archimde operation on the given shape with given parameters.
9603 The object presenting the resulting face is returned.
9606 theShape Shape to be put in water.
9607 theWeight Weight og the shape.
9608 theWaterDensity Density of the water.
9609 theMeshDeflection Deflection of the mesh, using to compute the section.
9610 theName Object name; when specified, this parameter is used
9611 for result publication in the study. Otherwise, if automatic
9612 publication is switched on, default value is used for result name.
9615 New GEOM.GEOM_Object, containing a section of theShape
9616 by a plane, corresponding to water level.
9618 # Example: see GEOM_TestAll.py
9619 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9620 theWeight,theWaterDensity,theMeshDeflection)
9621 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9622 RaiseIfFailed("MakeArchimede", self.LocalOp)
9623 anObj.SetParameters(Parameters)
9624 self._autoPublish(anObj, theName, "archimede")
9627 # end of l3_basic_op
9630 ## @addtogroup l2_measure
9633 ## Get point coordinates
9636 # @ref tui_measurement_tools_page "Example"
9637 @ManageTransactions("MeasuOp")
9638 def PointCoordinates(self,Point):
9640 Get point coordinates
9645 # Example: see GEOM_TestMeasures.py
9646 aTuple = self.MeasuOp.PointCoordinates(Point)
9647 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9650 ## Get vector coordinates
9653 # @ref tui_measurement_tools_page "Example"
9654 def VectorCoordinates(self,Vector):
9656 Get vector coordinates
9662 p1=self.GetFirstVertex(Vector)
9663 p2=self.GetLastVertex(Vector)
9665 X1=self.PointCoordinates(p1)
9666 X2=self.PointCoordinates(p2)
9668 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9671 ## Compute cross product
9672 # @return vector w=u^v
9674 # @ref tui_measurement_tools_page "Example"
9675 def CrossProduct(self, Vector1, Vector2):
9677 Compute cross product
9679 Returns: vector w=u^v
9681 u=self.VectorCoordinates(Vector1)
9682 v=self.VectorCoordinates(Vector2)
9683 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])
9687 ## Compute cross product
9688 # @return dot product p=u.v
9690 # @ref tui_measurement_tools_page "Example"
9691 def DotProduct(self, Vector1, Vector2):
9693 Compute cross product
9695 Returns: dot product p=u.v
9697 u=self.VectorCoordinates(Vector1)
9698 v=self.VectorCoordinates(Vector2)
9699 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9704 ## Get summarized length of all wires,
9705 # area of surface and volume of the given shape.
9706 # @param theShape Shape to define properties of.
9707 # @return [theLength, theSurfArea, theVolume]\n
9708 # theLength: Summarized length of all wires of the given shape.\n
9709 # theSurfArea: Area of surface of the given shape.\n
9710 # theVolume: Volume of the given shape.
9712 # @ref tui_measurement_tools_page "Example"
9713 @ManageTransactions("MeasuOp")
9714 def BasicProperties(self,theShape):
9716 Get summarized length of all wires,
9717 area of surface and volume of the given shape.
9720 theShape Shape to define properties of.
9723 [theLength, theSurfArea, theVolume]
9724 theLength: Summarized length of all wires of the given shape.
9725 theSurfArea: Area of surface of the given shape.
9726 theVolume: Volume of the given shape.
9728 # Example: see GEOM_TestMeasures.py
9729 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9730 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9733 ## Get parameters of bounding box of the given shape
9734 # @param theShape Shape to obtain bounding box of.
9735 # @param precise TRUE for precise computation; FALSE for fast one.
9736 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9737 # Xmin,Xmax: Limits of shape along OX axis.
9738 # Ymin,Ymax: Limits of shape along OY axis.
9739 # Zmin,Zmax: Limits of shape along OZ axis.
9741 # @ref tui_measurement_tools_page "Example"
9742 @ManageTransactions("MeasuOp")
9743 def BoundingBox (self, theShape, precise=False):
9745 Get parameters of bounding box of the given shape
9748 theShape Shape to obtain bounding box of.
9749 precise TRUE for precise computation; FALSE for fast one.
9752 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9753 Xmin,Xmax: Limits of shape along OX axis.
9754 Ymin,Ymax: Limits of shape along OY axis.
9755 Zmin,Zmax: Limits of shape along OZ axis.
9757 # Example: see GEOM_TestMeasures.py
9758 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9759 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9762 ## Get bounding box of the given shape
9763 # @param theShape Shape to obtain bounding box of.
9764 # @param precise TRUE for precise computation; FALSE for fast one.
9765 # @param theName Object name; when specified, this parameter is used
9766 # for result publication in the study. Otherwise, if automatic
9767 # publication is switched on, default value is used for result name.
9769 # @return New GEOM.GEOM_Object, containing the created box.
9771 # @ref tui_measurement_tools_page "Example"
9772 @ManageTransactions("MeasuOp")
9773 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9775 Get bounding box of the given shape
9778 theShape Shape to obtain bounding box of.
9779 precise TRUE for precise computation; FALSE for fast one.
9780 theName Object name; when specified, this parameter is used
9781 for result publication in the study. Otherwise, if automatic
9782 publication is switched on, default value is used for result name.
9785 New GEOM.GEOM_Object, containing the created box.
9787 # Example: see GEOM_TestMeasures.py
9788 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9789 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9790 self._autoPublish(anObj, theName, "bndbox")
9793 ## Get inertia matrix and moments of inertia of theShape.
9794 # @param theShape Shape to calculate inertia of.
9795 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9796 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9797 # Ix,Iy,Iz: Moments of inertia of the given shape.
9799 # @ref tui_measurement_tools_page "Example"
9800 @ManageTransactions("MeasuOp")
9801 def Inertia(self,theShape):
9803 Get inertia matrix and moments of inertia of theShape.
9806 theShape Shape to calculate inertia of.
9809 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9810 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9811 Ix,Iy,Iz: Moments of inertia of the given shape.
9813 # Example: see GEOM_TestMeasures.py
9814 aTuple = self.MeasuOp.GetInertia(theShape)
9815 RaiseIfFailed("GetInertia", self.MeasuOp)
9818 ## Get if coords are included in the shape (ST_IN or ST_ON)
9819 # @param theShape Shape
9820 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9821 # @param tolerance to be used (default is 1.0e-7)
9822 # @return list_of_boolean = [res1, res2, ...]
9823 @ManageTransactions("MeasuOp")
9824 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9826 Get if coords are included in the shape (ST_IN or ST_ON)
9830 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9831 tolerance to be used (default is 1.0e-7)
9834 list_of_boolean = [res1, res2, ...]
9836 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9838 ## Get minimal distance between the given shapes.
9839 # @param theShape1,theShape2 Shapes to find minimal distance between.
9840 # @return Value of the minimal distance between the given shapes.
9842 # @ref tui_measurement_tools_page "Example"
9843 @ManageTransactions("MeasuOp")
9844 def MinDistance(self, theShape1, theShape2):
9846 Get minimal distance between the given shapes.
9849 theShape1,theShape2 Shapes to find minimal distance between.
9852 Value of the minimal distance between the given shapes.
9854 # Example: see GEOM_TestMeasures.py
9855 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9856 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9859 ## Get minimal distance between the given shapes.
9860 # @param theShape1,theShape2 Shapes to find minimal distance between.
9861 # @return Value of the minimal distance between the given shapes, in form of list
9862 # [Distance, DX, DY, DZ].
9864 # @ref swig_all_measure "Example"
9865 @ManageTransactions("MeasuOp")
9866 def MinDistanceComponents(self, theShape1, theShape2):
9868 Get minimal distance between the given shapes.
9871 theShape1,theShape2 Shapes to find minimal distance between.
9874 Value of the minimal distance between the given shapes, in form of list
9875 [Distance, DX, DY, DZ]
9877 # Example: see GEOM_TestMeasures.py
9878 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9879 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9880 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9883 ## Get closest points of the given shapes.
9884 # @param theShape1,theShape2 Shapes to find closest points of.
9885 # @return The number of found solutions (-1 in case of infinite number of
9886 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9888 # @ref tui_measurement_tools_page "Example"
9889 @ManageTransactions("MeasuOp")
9890 def ClosestPoints (self, theShape1, theShape2):
9892 Get closest points of the given shapes.
9895 theShape1,theShape2 Shapes to find closest points of.
9898 The number of found solutions (-1 in case of infinite number of
9899 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9901 # Example: see GEOM_TestMeasures.py
9902 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9903 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9906 ## Get angle between the given shapes in degrees.
9907 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9908 # @note If both arguments are vectors, the angle is computed in accordance
9909 # with their orientations, otherwise the minimum angle is computed.
9910 # @return Value of the angle between the given shapes in degrees.
9912 # @ref tui_measurement_tools_page "Example"
9913 @ManageTransactions("MeasuOp")
9914 def GetAngle(self, theShape1, theShape2):
9916 Get angle between the given shapes in degrees.
9919 theShape1,theShape2 Lines or linear edges to find angle between.
9922 If both arguments are vectors, the angle is computed in accordance
9923 with their orientations, otherwise the minimum angle is computed.
9926 Value of the angle between the given shapes in degrees.
9928 # Example: see GEOM_TestMeasures.py
9929 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9930 RaiseIfFailed("GetAngle", self.MeasuOp)
9933 ## Get angle between the given shapes in radians.
9934 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9935 # @note If both arguments are vectors, the angle is computed in accordance
9936 # with their orientations, otherwise the minimum angle is computed.
9937 # @return Value of the angle between the given shapes in radians.
9939 # @ref tui_measurement_tools_page "Example"
9940 @ManageTransactions("MeasuOp")
9941 def GetAngleRadians(self, theShape1, theShape2):
9943 Get angle between the given shapes in radians.
9946 theShape1,theShape2 Lines or linear edges to find angle between.
9950 If both arguments are vectors, the angle is computed in accordance
9951 with their orientations, otherwise the minimum angle is computed.
9954 Value of the angle between the given shapes in radians.
9956 # Example: see GEOM_TestMeasures.py
9957 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9958 RaiseIfFailed("GetAngle", self.MeasuOp)
9961 ## Get angle between the given vectors in degrees.
9962 # @param theShape1,theShape2 Vectors to find angle between.
9963 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9964 # if False, the opposite vector to the normal vector is used.
9965 # @return Value of the angle between the given vectors in degrees.
9967 # @ref tui_measurement_tools_page "Example"
9968 @ManageTransactions("MeasuOp")
9969 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9971 Get angle between the given vectors in degrees.
9974 theShape1,theShape2 Vectors to find angle between.
9975 theFlag If True, the normal vector is defined by the two vectors cross,
9976 if False, the opposite vector to the normal vector is used.
9979 Value of the angle between the given vectors in degrees.
9981 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9983 anAngle = 360. - anAngle
9984 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9987 ## The same as GetAngleVectors, but the result is in radians.
9988 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9990 Get angle between the given vectors in radians.
9993 theShape1,theShape2 Vectors to find angle between.
9994 theFlag If True, the normal vector is defined by the two vectors cross,
9995 if False, the opposite vector to the normal vector is used.
9998 Value of the angle between the given vectors in radians.
10000 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10003 ## @name Curve Curvature Measurement
10004 # Methods for receiving radius of curvature of curves
10005 # in the given point
10008 ## Measure curvature of a curve at a point, set by parameter.
10009 # @param theCurve a curve.
10010 # @param theParam parameter.
10011 # @return radius of curvature of \a theCurve.
10013 # @ref swig_todo "Example"
10014 @ManageTransactions("MeasuOp")
10015 def CurveCurvatureByParam(self, theCurve, theParam):
10017 Measure curvature of a curve at a point, set by parameter.
10021 theParam parameter.
10024 radius of curvature of theCurve.
10026 # Example: see GEOM_TestMeasures.py
10027 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10028 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10031 ## Measure curvature of a curve at a point.
10032 # @param theCurve a curve.
10033 # @param thePoint given point.
10034 # @return radius of curvature of \a theCurve.
10036 # @ref swig_todo "Example"
10037 @ManageTransactions("MeasuOp")
10038 def CurveCurvatureByPoint(self, theCurve, thePoint):
10040 Measure curvature of a curve at a point.
10044 thePoint given point.
10047 radius of curvature of theCurve.
10049 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10050 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10054 ## @name Surface Curvature Measurement
10055 # Methods for receiving max and min radius of curvature of surfaces
10056 # in the given point
10059 ## Measure max radius of curvature of surface.
10060 # @param theSurf the given surface.
10061 # @param theUParam Value of U-parameter on the referenced surface.
10062 # @param theVParam Value of V-parameter on the referenced surface.
10063 # @return max radius of curvature of theSurf.
10065 ## @ref swig_todo "Example"
10066 @ManageTransactions("MeasuOp")
10067 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10069 Measure max radius of curvature of surface.
10072 theSurf the given surface.
10073 theUParam Value of U-parameter on the referenced surface.
10074 theVParam Value of V-parameter on the referenced surface.
10077 max radius of curvature of theSurf.
10079 # Example: see GEOM_TestMeasures.py
10080 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10081 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10084 ## Measure max radius of curvature of surface in the given point
10085 # @param theSurf the given surface.
10086 # @param thePoint given point.
10087 # @return max radius of curvature of theSurf.
10089 ## @ref swig_todo "Example"
10090 @ManageTransactions("MeasuOp")
10091 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10093 Measure max radius of curvature of surface in the given point.
10096 theSurf the given surface.
10097 thePoint given point.
10100 max radius of curvature of theSurf.
10102 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10103 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10106 ## Measure min radius of curvature of surface.
10107 # @param theSurf the given surface.
10108 # @param theUParam Value of U-parameter on the referenced surface.
10109 # @param theVParam Value of V-parameter on the referenced surface.
10110 # @return min radius of curvature of theSurf.
10112 ## @ref swig_todo "Example"
10113 @ManageTransactions("MeasuOp")
10114 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10116 Measure min radius of curvature of surface.
10119 theSurf the given surface.
10120 theUParam Value of U-parameter on the referenced surface.
10121 theVParam Value of V-parameter on the referenced surface.
10124 Min radius of curvature of theSurf.
10126 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10127 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10130 ## Measure min radius of curvature of surface in the given point
10131 # @param theSurf the given surface.
10132 # @param thePoint given point.
10133 # @return min radius of curvature of theSurf.
10135 ## @ref swig_todo "Example"
10136 @ManageTransactions("MeasuOp")
10137 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10139 Measure min radius of curvature of surface in the given point.
10142 theSurf the given surface.
10143 thePoint given point.
10146 Min radius of curvature of theSurf.
10148 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10149 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10153 ## Get min and max tolerances of sub-shapes of theShape
10154 # @param theShape Shape, to get tolerances of.
10155 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10156 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10157 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10158 # VertMin,VertMax: Min and max tolerances of the vertices.
10160 # @ref tui_measurement_tools_page "Example"
10161 @ManageTransactions("MeasuOp")
10162 def Tolerance(self,theShape):
10164 Get min and max tolerances of sub-shapes of theShape
10167 theShape Shape, to get tolerances of.
10170 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10171 FaceMin,FaceMax: Min and max tolerances of the faces.
10172 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10173 VertMin,VertMax: Min and max tolerances of the vertices.
10175 # Example: see GEOM_TestMeasures.py
10176 aTuple = self.MeasuOp.GetTolerance(theShape)
10177 RaiseIfFailed("GetTolerance", self.MeasuOp)
10180 ## Obtain description of the given shape (number of sub-shapes of each type)
10181 # @param theShape Shape to be described.
10182 # @return Description of the given shape.
10184 # @ref tui_measurement_tools_page "Example"
10185 @ManageTransactions("MeasuOp")
10186 def WhatIs(self,theShape):
10188 Obtain description of the given shape (number of sub-shapes of each type)
10191 theShape Shape to be described.
10194 Description of the given shape.
10196 # Example: see GEOM_TestMeasures.py
10197 aDescr = self.MeasuOp.WhatIs(theShape)
10198 RaiseIfFailed("WhatIs", self.MeasuOp)
10201 ## Obtain quantity of shapes of the given type in \a theShape.
10202 # If \a theShape is of type \a theType, it is also counted.
10203 # @param theShape Shape to be described.
10204 # @param theType the given ShapeType().
10205 # @return Quantity of shapes of type \a theType in \a theShape.
10207 # @ref tui_measurement_tools_page "Example"
10208 def NbShapes (self, theShape, theType):
10210 Obtain quantity of shapes of the given type in theShape.
10211 If theShape is of type theType, it is also counted.
10214 theShape Shape to be described.
10215 theType the given geompy.ShapeType
10218 Quantity of shapes of type theType in theShape.
10220 # Example: see GEOM_TestMeasures.py
10221 listSh = self.SubShapeAllIDs(theShape, theType)
10225 ## Obtain quantity of shapes of each type in \a theShape.
10226 # The \a theShape is also counted.
10227 # @param theShape Shape to be described.
10228 # @return Dictionary of ShapeType() with bound quantities of shapes.
10230 # @ref tui_measurement_tools_page "Example"
10231 def ShapeInfo (self, theShape):
10233 Obtain quantity of shapes of each type in theShape.
10234 The theShape is also counted.
10237 theShape Shape to be described.
10240 Dictionary of geompy.ShapeType with bound quantities of shapes.
10242 # Example: see GEOM_TestMeasures.py
10244 for typeSh in self.ShapeType:
10245 if typeSh in ( "AUTO", "SHAPE" ): continue
10246 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10252 def GetCreationInformation(self, theShape):
10253 info = theShape.GetCreationInformation()
10255 opName = info.operationName
10256 if not opName: opName = "no info available"
10257 res = "Operation: " + opName
10259 for parVal in info.params:
10260 res += " \n %s = %s" % ( parVal.name, parVal.value )
10263 ## Get a point, situated at the centre of mass of theShape.
10264 # @param theShape Shape to define centre of mass of.
10265 # @param theName Object name; when specified, this parameter is used
10266 # for result publication in the study. Otherwise, if automatic
10267 # publication is switched on, default value is used for result name.
10269 # @return New GEOM.GEOM_Object, containing the created point.
10271 # @ref tui_measurement_tools_page "Example"
10272 @ManageTransactions("MeasuOp")
10273 def MakeCDG(self, theShape, theName=None):
10275 Get a point, situated at the centre of mass of theShape.
10278 theShape Shape to define centre of mass of.
10279 theName Object name; when specified, this parameter is used
10280 for result publication in the study. Otherwise, if automatic
10281 publication is switched on, default value is used for result name.
10284 New GEOM.GEOM_Object, containing the created point.
10286 # Example: see GEOM_TestMeasures.py
10287 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10288 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10289 self._autoPublish(anObj, theName, "centerOfMass")
10292 ## Get a vertex sub-shape by index depended with orientation.
10293 # @param theShape Shape to find sub-shape.
10294 # @param theIndex Index to find vertex by this index (starting from zero)
10295 # @param theName Object name; when specified, this parameter is used
10296 # for result publication in the study. Otherwise, if automatic
10297 # publication is switched on, default value is used for result name.
10299 # @return New GEOM.GEOM_Object, containing the created vertex.
10301 # @ref tui_measurement_tools_page "Example"
10302 @ManageTransactions("MeasuOp")
10303 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10305 Get a vertex sub-shape by index depended with orientation.
10308 theShape Shape to find sub-shape.
10309 theIndex Index to find vertex by this index (starting from zero)
10310 theName Object name; when specified, this parameter is used
10311 for result publication in the study. Otherwise, if automatic
10312 publication is switched on, default value is used for result name.
10315 New GEOM.GEOM_Object, containing the created vertex.
10317 # Example: see GEOM_TestMeasures.py
10318 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10319 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10320 self._autoPublish(anObj, theName, "vertex")
10323 ## Get the first vertex of wire/edge depended orientation.
10324 # @param theShape Shape to find first vertex.
10325 # @param theName Object name; when specified, this parameter is used
10326 # for result publication in the study. Otherwise, if automatic
10327 # publication is switched on, default value is used for result name.
10329 # @return New GEOM.GEOM_Object, containing the created vertex.
10331 # @ref tui_measurement_tools_page "Example"
10332 def GetFirstVertex(self, theShape, theName=None):
10334 Get the first vertex of wire/edge depended orientation.
10337 theShape Shape to find first vertex.
10338 theName Object name; when specified, this parameter is used
10339 for result publication in the study. Otherwise, if automatic
10340 publication is switched on, default value is used for result name.
10343 New GEOM.GEOM_Object, containing the created vertex.
10345 # Example: see GEOM_TestMeasures.py
10346 # note: auto-publishing is done in self.GetVertexByIndex()
10347 return self.GetVertexByIndex(theShape, 0, theName)
10349 ## Get the last vertex of wire/edge depended orientation.
10350 # @param theShape Shape to find last vertex.
10351 # @param theName Object name; when specified, this parameter is used
10352 # for result publication in the study. Otherwise, if automatic
10353 # publication is switched on, default value is used for result name.
10355 # @return New GEOM.GEOM_Object, containing the created vertex.
10357 # @ref tui_measurement_tools_page "Example"
10358 def GetLastVertex(self, theShape, theName=None):
10360 Get the last vertex of wire/edge depended orientation.
10363 theShape Shape to find last vertex.
10364 theName Object name; when specified, this parameter is used
10365 for result publication in the study. Otherwise, if automatic
10366 publication is switched on, default value is used for result name.
10369 New GEOM.GEOM_Object, containing the created vertex.
10371 # Example: see GEOM_TestMeasures.py
10372 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10373 # note: auto-publishing is done in self.GetVertexByIndex()
10374 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10376 ## Get a normale to the given face. If the point is not given,
10377 # the normale is calculated at the center of mass.
10378 # @param theFace Face to define normale of.
10379 # @param theOptionalPoint Point to compute the normale at.
10380 # @param theName Object name; when specified, this parameter is used
10381 # for result publication in the study. Otherwise, if automatic
10382 # publication is switched on, default value is used for result name.
10384 # @return New GEOM.GEOM_Object, containing the created vector.
10386 # @ref swig_todo "Example"
10387 @ManageTransactions("MeasuOp")
10388 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10390 Get a normale to the given face. If the point is not given,
10391 the normale is calculated at the center of mass.
10394 theFace Face to define normale of.
10395 theOptionalPoint Point to compute the normale at.
10396 theName Object name; when specified, this parameter is used
10397 for result publication in the study. Otherwise, if automatic
10398 publication is switched on, default value is used for result name.
10401 New GEOM.GEOM_Object, containing the created vector.
10403 # Example: see GEOM_TestMeasures.py
10404 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10405 RaiseIfFailed("GetNormal", self.MeasuOp)
10406 self._autoPublish(anObj, theName, "normal")
10409 ## Print shape errors obtained from CheckShape.
10410 # @param theShape Shape that was checked.
10411 # @param theShapeErrors the shape errors obtained by CheckShape.
10412 # @param theReturnStatus If 0 the description of problem is printed.
10413 # If 1 the description of problem is returned.
10414 # @return If theReturnStatus is equal to 1 the description is returned.
10415 # Otherwise doesn't return anything.
10417 # @ref tui_measurement_tools_page "Example"
10418 @ManageTransactions("MeasuOp")
10419 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10421 Print shape errors obtained from CheckShape.
10424 theShape Shape that was checked.
10425 theShapeErrors the shape errors obtained by CheckShape.
10426 theReturnStatus If 0 the description of problem is printed.
10427 If 1 the description of problem is returned.
10430 If theReturnStatus is equal to 1 the description is returned.
10431 Otherwise doesn't return anything.
10433 # Example: see GEOM_TestMeasures.py
10434 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10435 if theReturnStatus == 1:
10440 ## Check a topology of the given shape.
10441 # @param theShape Shape to check validity of.
10442 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10443 # if TRUE, the shape's geometry will be checked also.
10444 # @param theReturnStatus If 0 and if theShape is invalid, a description
10445 # of problem is printed.
10446 # If 1 isValid flag and the description of
10447 # problem is returned.
10448 # If 2 isValid flag and the list of error data
10450 # @return TRUE, if the shape "seems to be valid".
10451 # If theShape is invalid, prints a description of problem.
10452 # If theReturnStatus is equal to 1 the description is returned
10453 # along with IsValid flag.
10454 # If theReturnStatus is equal to 2 the list of error data is
10455 # returned along with IsValid flag.
10457 # @ref tui_measurement_tools_page "Example"
10458 @ManageTransactions("MeasuOp")
10459 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10461 Check a topology of the given shape.
10464 theShape Shape to check validity of.
10465 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10466 if TRUE, the shape's geometry will be checked also.
10467 theReturnStatus If 0 and if theShape is invalid, a description
10468 of problem is printed.
10469 If 1 IsValid flag and the description of
10470 problem is returned.
10471 If 2 IsValid flag and the list of error data
10475 TRUE, if the shape "seems to be valid".
10476 If theShape is invalid, prints a description of problem.
10477 If theReturnStatus is equal to 1 the description is returned
10478 along with IsValid flag.
10479 If theReturnStatus is equal to 2 the list of error data is
10480 returned along with IsValid flag.
10482 # Example: see GEOM_TestMeasures.py
10484 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10485 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10487 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10488 RaiseIfFailed("CheckShape", self.MeasuOp)
10490 if theReturnStatus == 0:
10491 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10493 if theReturnStatus == 1:
10494 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10495 return (IsValid, Descr)
10496 elif theReturnStatus == 2:
10497 return (IsValid, ShapeErrors)
10500 ## Detect self-intersections in the given shape.
10501 # @param theShape Shape to check.
10502 # @return TRUE, if the shape contains no self-intersections.
10504 # @ref tui_measurement_tools_page "Example"
10505 @ManageTransactions("MeasuOp")
10506 def CheckSelfIntersections(self, theShape):
10508 Detect self-intersections in the given shape.
10511 theShape Shape to check.
10514 TRUE, if the shape contains no self-intersections.
10516 # Example: see GEOM_TestMeasures.py
10517 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10518 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10521 ## Get position (LCS) of theShape.
10523 # Origin of the LCS is situated at the shape's center of mass.
10524 # Axes of the LCS are obtained from shape's location or,
10525 # if the shape is a planar face, from position of its plane.
10527 # @param theShape Shape to calculate position of.
10528 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10529 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10530 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10531 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10533 # @ref swig_todo "Example"
10534 @ManageTransactions("MeasuOp")
10535 def GetPosition(self,theShape):
10537 Get position (LCS) of theShape.
10538 Origin of the LCS is situated at the shape's center of mass.
10539 Axes of the LCS are obtained from shape's location or,
10540 if the shape is a planar face, from position of its plane.
10543 theShape Shape to calculate position of.
10546 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10547 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10548 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10549 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10551 # Example: see GEOM_TestMeasures.py
10552 aTuple = self.MeasuOp.GetPosition(theShape)
10553 RaiseIfFailed("GetPosition", self.MeasuOp)
10556 ## Get kind of theShape.
10558 # @param theShape Shape to get a kind of.
10559 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10560 # and a list of parameters, describing the shape.
10561 # @note Concrete meaning of each value, returned via \a theIntegers
10562 # or \a theDoubles list depends on the kind() of the shape.
10564 # @ref swig_todo "Example"
10565 @ManageTransactions("MeasuOp")
10566 def KindOfShape(self,theShape):
10568 Get kind of theShape.
10571 theShape Shape to get a kind of.
10574 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10575 and a list of parameters, describing the shape.
10577 Concrete meaning of each value, returned via theIntegers
10578 or theDoubles list depends on the geompy.kind of the shape
10580 # Example: see GEOM_TestMeasures.py
10581 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10582 RaiseIfFailed("KindOfShape", self.MeasuOp)
10584 aKind = aRoughTuple[0]
10585 anInts = aRoughTuple[1]
10586 aDbls = aRoughTuple[2]
10588 # Now there is no exception from this rule:
10589 aKindTuple = [aKind] + aDbls + anInts
10591 # If they are we will regroup parameters for such kind of shape.
10593 #if aKind == kind.SOME_KIND:
10594 # # SOME_KIND int int double int double double
10595 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10599 ## Returns the string that describes if the shell is good for solid.
10600 # This is a support method for MakeSolid.
10602 # @param theShell the shell to be checked.
10603 # @return Returns a string that describes the shell validity for
10604 # solid construction.
10605 @ManageTransactions("MeasuOp")
10606 def _IsGoodForSolid(self, theShell):
10608 Returns the string that describes if the shell is good for solid.
10609 This is a support method for MakeSolid.
10612 theShell the shell to be checked.
10615 Returns a string that describes the shell validity for
10616 solid construction.
10618 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10621 # end of l2_measure
10624 ## @addtogroup l2_import_export
10627 ## Import a shape from the BREP or IGES or STEP file
10628 # (depends on given format) with given name.
10629 # @param theFileName The file, containing the shape.
10630 # @param theFormatName Specify format for the file reading.
10631 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10632 # If format 'IGES_SCALE' is used instead of 'IGES' or
10633 # format 'STEP_SCALE' is used instead of 'STEP',
10634 # length unit will be set to 'meter' and result model will be scaled.
10635 # @param theName Object name; when specified, this parameter is used
10636 # for result publication in the study. Otherwise, if automatic
10637 # publication is switched on, default value is used for result name.
10639 # @return New GEOM.GEOM_Object, containing the imported shape.
10640 # If material names are imported it returns the list of
10641 # objects. The first one is the imported object followed by
10643 # @note Auto publishing is allowed for the shape itself. Imported
10644 # material groups are not automatically published.
10646 # @ref swig_Import_Export "Example"
10647 @ManageTransactions("InsertOp")
10648 def ImportFile(self, theFileName, theFormatName, theName=None):
10650 Import a shape from the BREP or IGES or STEP file
10651 (depends on given format) with given name.
10654 theFileName The file, containing the shape.
10655 theFormatName Specify format for the file reading.
10656 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10657 If format 'IGES_SCALE' is used instead of 'IGES' or
10658 format 'STEP_SCALE' is used instead of 'STEP',
10659 length unit will be set to 'meter' and result model will be scaled.
10660 theName Object name; when specified, this parameter is used
10661 for result publication in the study. Otherwise, if automatic
10662 publication is switched on, default value is used for result name.
10665 New GEOM.GEOM_Object, containing the imported shape.
10666 If material names are imported it returns the list of
10667 objects. The first one is the imported object followed by
10670 Auto publishing is allowed for the shape itself. Imported
10671 material groups are not automatically published.
10673 # Example: see GEOM_TestOthers.py
10674 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10675 RaiseIfFailed("ImportFile", self.InsertOp)
10676 aNbObj = len(aListObj)
10678 self._autoPublish(aListObj[0], theName, "imported")
10683 ## Deprecated analog of ImportFile()
10684 def Import(self, theFileName, theFormatName, theName=None):
10686 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10688 print "WARNING: Function Import is deprecated, use ImportFile instead"
10689 # note: auto-publishing is done in self.ImportFile()
10690 return self.ImportFile(theFileName, theFormatName, theName)
10692 ## Shortcut to ImportFile() for BREP format.
10693 # Import a shape from the BREP file with given name.
10694 # @param theFileName The file, containing the shape.
10695 # @param theName Object name; when specified, this parameter is used
10696 # for result publication in the study. Otherwise, if automatic
10697 # publication is switched on, default value is used for result name.
10699 # @return New GEOM.GEOM_Object, containing the imported shape.
10701 # @ref swig_Import_Export "Example"
10702 def ImportBREP(self, theFileName, theName=None):
10704 geompy.ImportFile(...) function for BREP format
10705 Import a shape from the BREP file with given name.
10708 theFileName The file, containing the shape.
10709 theName Object name; when specified, this parameter is used
10710 for result publication in the study. Otherwise, if automatic
10711 publication is switched on, default value is used for result name.
10714 New GEOM.GEOM_Object, containing the imported shape.
10716 # Example: see GEOM_TestOthers.py
10717 # note: auto-publishing is done in self.ImportFile()
10718 return self.ImportFile(theFileName, "BREP", theName)
10720 ## Shortcut to ImportFile() for IGES format
10721 # Import a shape from the IGES file with given name.
10722 # @param theFileName The file, containing the shape.
10723 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10724 # and result model will be scaled, if its units are not meters.
10725 # If False (default), file length units will be taken into account.
10726 # @param theName Object name; when specified, this parameter is used
10727 # for result publication in the study. Otherwise, if automatic
10728 # publication is switched on, default value is used for result name.
10730 # @return New GEOM.GEOM_Object, containing the imported shape.
10732 # @ref swig_Import_Export "Example"
10733 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
10735 geompy.ImportFile(...) function for IGES format
10738 theFileName The file, containing the shape.
10739 ignoreUnits If True, file length units will be ignored (set to 'meter')
10740 and result model will be scaled, if its units are not meters.
10741 If False (default), file length units will be taken into account.
10742 theName Object name; when specified, this parameter is used
10743 for result publication in the study. Otherwise, if automatic
10744 publication is switched on, default value is used for result name.
10747 New GEOM.GEOM_Object, containing the imported shape.
10749 # Example: see GEOM_TestOthers.py
10750 # note: auto-publishing is done in self.ImportFile()
10752 return self.ImportFile(theFileName, "IGES_SCALE", theName)
10753 return self.ImportFile(theFileName, "IGES", theName)
10755 ## Return length unit from given IGES file
10756 # @param theFileName The file, containing the shape.
10757 # @return String, containing the units name.
10759 # @ref swig_Import_Export "Example"
10760 @ManageTransactions("InsertOp")
10761 def GetIGESUnit(self, theFileName):
10763 Return length units from given IGES file
10766 theFileName The file, containing the shape.
10769 String, containing the units name.
10771 # Example: see GEOM_TestOthers.py
10772 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
10775 ## Shortcut to ImportFile() for STEP format
10776 # Import a shape from the STEP file with given name.
10777 # @param theFileName The file, containing the shape.
10778 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
10779 # and result model will be scaled, if its units are not meters.
10780 # If False (default), file length units will be taken into account.
10781 # @param theName Object name; when specified, this parameter is used
10782 # for result publication in the study. Otherwise, if automatic
10783 # publication is switched on, default value is used for result name.
10785 # @return New GEOM.GEOM_Object, containing the imported shape.
10786 # If material names are imported it returns the list of
10787 # objects. The first one is the imported object followed by
10789 # @note Auto publishing is allowed for the shape itself. Imported
10790 # material groups are not automatically published.
10792 # @ref swig_Import_Export "Example"
10793 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
10795 geompy.ImportFile(...) function for STEP format
10798 theFileName The file, containing the shape.
10799 ignoreUnits If True, file length units will be ignored (set to 'meter')
10800 and result model will be scaled, if its units are not meters.
10801 If False (default), file length units will be taken into account.
10802 theName Object name; when specified, this parameter is used
10803 for result publication in the study. Otherwise, if automatic
10804 publication is switched on, default value is used for result name.
10807 New GEOM.GEOM_Object, containing the imported shape.
10808 If material names are imported it returns the list of
10809 objects. The first one is the imported object followed by
10812 Auto publishing is allowed for the shape itself. Imported
10813 material groups are not automatically published.
10815 # Example: see GEOM_TestOthers.py
10816 # note: auto-publishing is done in self.ImportFile()
10818 return self.ImportFile(theFileName, "STEP_SCALE", theName)
10819 return self.ImportFile(theFileName, "STEP", theName)
10821 ## Return length unit from given IGES or STEP file
10822 # @param theFileName The file, containing the shape.
10823 # @return String, containing the units name.
10825 # @ref swig_Import_Export "Example"
10826 @ManageTransactions("InsertOp")
10827 def GetSTEPUnit(self, theFileName):
10829 Return length units from given STEP file
10832 theFileName The file, containing the shape.
10835 String, containing the units name.
10837 # Example: see GEOM_TestOthers.py
10838 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
10841 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10842 # @note This method will not be dumped to the python script by DumpStudy functionality.
10843 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10844 # @param theStream The BRep binary stream.
10845 # @param theName Object name; when specified, this parameter is used
10846 # for result publication in the study. Otherwise, if automatic
10847 # publication is switched on, default value is used for result name.
10849 # @return New GEOM_Object, containing the shape, read from theStream.
10851 # @ref swig_Import_Export "Example"
10852 @ManageTransactions("InsertOp")
10853 def RestoreShape (self, theStream, theName=None):
10855 Read a shape from the binary stream, containing its bounding representation (BRep).
10858 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10861 theStream The BRep binary stream.
10862 theName Object name; when specified, this parameter is used
10863 for result publication in the study. Otherwise, if automatic
10864 publication is switched on, default value is used for result name.
10867 New GEOM_Object, containing the shape, read from theStream.
10869 # Example: see GEOM_TestOthers.py
10870 anObj = self.InsertOp.RestoreShape(theStream)
10871 RaiseIfFailed("RestoreShape", self.InsertOp)
10872 self._autoPublish(anObj, theName, "restored")
10875 ## Export the given shape into a file with given name.
10876 # @param theObject Shape to be stored in the file.
10877 # @param theFileName Name of the file to store the given shape in.
10878 # @param theFormatName Specify format for the shape storage.
10879 # Available formats can be obtained with
10880 # geompy.InsertOp.ExportTranslators()[0] method.
10882 # @ref swig_Import_Export "Example"
10883 @ManageTransactions("InsertOp")
10884 def Export(self, theObject, theFileName, theFormatName):
10886 Export the given shape into a file with given name.
10889 theObject Shape to be stored in the file.
10890 theFileName Name of the file to store the given shape in.
10891 theFormatName Specify format for the shape storage.
10892 Available formats can be obtained with
10893 geompy.InsertOp.ExportTranslators()[0] method.
10895 # Example: see GEOM_TestOthers.py
10896 self.InsertOp.Export(theObject, theFileName, theFormatName)
10897 if self.InsertOp.IsDone() == 0:
10898 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10902 ## Shortcut to Export() for BREP format
10904 # @ref swig_Import_Export "Example"
10905 def ExportBREP(self,theObject, theFileName):
10907 geompy.Export(...) function for BREP format
10909 # Example: see GEOM_TestOthers.py
10910 return self.Export(theObject, theFileName, "BREP")
10912 ## Shortcut to Export() for IGES format
10914 # @ref swig_Import_Export "Example"
10915 def ExportIGES(self,theObject, theFileName):
10917 geompy.Export(...) function for IGES format
10919 # Example: see GEOM_TestOthers.py
10920 return self.Export(theObject, theFileName, "IGES")
10922 ## Shortcut to Export() for STEP format
10924 # @ref swig_Import_Export "Example"
10925 def ExportSTEP(self,theObject, theFileName):
10927 geompy.Export(...) function for STEP format
10929 # Example: see GEOM_TestOthers.py
10930 return self.Export(theObject, theFileName, "STEP")
10932 # end of l2_import_export
10935 ## @addtogroup l3_blocks
10938 ## Create a quadrangle face from four edges. Order of Edges is not
10939 # important. It is not necessary that edges share the same vertex.
10940 # @param E1,E2,E3,E4 Edges for the face bound.
10941 # @param theName Object name; when specified, this parameter is used
10942 # for result publication in the study. Otherwise, if automatic
10943 # publication is switched on, default value is used for result name.
10945 # @return New GEOM.GEOM_Object, containing the created face.
10947 # @ref tui_building_by_blocks_page "Example"
10948 @ManageTransactions("BlocksOp")
10949 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10951 Create a quadrangle face from four edges. Order of Edges is not
10952 important. It is not necessary that edges share the same vertex.
10955 E1,E2,E3,E4 Edges for the face bound.
10956 theName Object name; when specified, this parameter is used
10957 for result publication in the study. Otherwise, if automatic
10958 publication is switched on, default value is used for result name.
10961 New GEOM.GEOM_Object, containing the created face.
10964 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10966 # Example: see GEOM_Spanner.py
10967 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10968 RaiseIfFailed("MakeQuad", self.BlocksOp)
10969 self._autoPublish(anObj, theName, "quad")
10972 ## Create a quadrangle face on two edges.
10973 # The missing edges will be built by creating the shortest ones.
10974 # @param E1,E2 Two opposite edges for the face.
10975 # @param theName Object name; when specified, this parameter is used
10976 # for result publication in the study. Otherwise, if automatic
10977 # publication is switched on, default value is used for result name.
10979 # @return New GEOM.GEOM_Object, containing the created face.
10981 # @ref tui_building_by_blocks_page "Example"
10982 @ManageTransactions("BlocksOp")
10983 def MakeQuad2Edges(self, E1, E2, theName=None):
10985 Create a quadrangle face on two edges.
10986 The missing edges will be built by creating the shortest ones.
10989 E1,E2 Two opposite edges for the face.
10990 theName Object name; when specified, this parameter is used
10991 for result publication in the study. Otherwise, if automatic
10992 publication is switched on, default value is used for result name.
10995 New GEOM.GEOM_Object, containing the created face.
10999 p1 = geompy.MakeVertex( 0., 0., 0.)
11000 p2 = geompy.MakeVertex(150., 30., 0.)
11001 p3 = geompy.MakeVertex( 0., 120., 50.)
11002 p4 = geompy.MakeVertex( 0., 40., 70.)
11004 edge1 = geompy.MakeEdge(p1, p2)
11005 edge2 = geompy.MakeEdge(p3, p4)
11006 # create a quadrangle face from two edges
11007 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11009 # Example: see GEOM_Spanner.py
11010 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11011 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11012 self._autoPublish(anObj, theName, "quad")
11015 ## Create a quadrangle face with specified corners.
11016 # The missing edges will be built by creating the shortest ones.
11017 # @param V1,V2,V3,V4 Corner vertices for the face.
11018 # @param theName Object name; when specified, this parameter is used
11019 # for result publication in the study. Otherwise, if automatic
11020 # publication is switched on, default value is used for result name.
11022 # @return New GEOM.GEOM_Object, containing the created face.
11024 # @ref tui_building_by_blocks_page "Example 1"
11025 # \n @ref swig_MakeQuad4Vertices "Example 2"
11026 @ManageTransactions("BlocksOp")
11027 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11029 Create a quadrangle face with specified corners.
11030 The missing edges will be built by creating the shortest ones.
11033 V1,V2,V3,V4 Corner vertices for the face.
11034 theName Object name; when specified, this parameter is used
11035 for result publication in the study. Otherwise, if automatic
11036 publication is switched on, default value is used for result name.
11039 New GEOM.GEOM_Object, containing the created face.
11043 p1 = geompy.MakeVertex( 0., 0., 0.)
11044 p2 = geompy.MakeVertex(150., 30., 0.)
11045 p3 = geompy.MakeVertex( 0., 120., 50.)
11046 p4 = geompy.MakeVertex( 0., 40., 70.)
11047 # create a quadrangle from four points in its corners
11048 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11050 # Example: see GEOM_Spanner.py
11051 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11052 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11053 self._autoPublish(anObj, theName, "quad")
11056 ## Create a hexahedral solid, bounded by the six given faces. Order of
11057 # faces is not important. It is not necessary that Faces share the same edge.
11058 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11059 # @param theName Object name; when specified, this parameter is used
11060 # for result publication in the study. Otherwise, if automatic
11061 # publication is switched on, default value is used for result name.
11063 # @return New GEOM.GEOM_Object, containing the created solid.
11065 # @ref tui_building_by_blocks_page "Example 1"
11066 # \n @ref swig_MakeHexa "Example 2"
11067 @ManageTransactions("BlocksOp")
11068 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11070 Create a hexahedral solid, bounded by the six given faces. Order of
11071 faces is not important. It is not necessary that Faces share the same edge.
11074 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11075 theName Object name; when specified, this parameter is used
11076 for result publication in the study. Otherwise, if automatic
11077 publication is switched on, default value is used for result name.
11080 New GEOM.GEOM_Object, containing the created solid.
11083 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11085 # Example: see GEOM_Spanner.py
11086 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11087 RaiseIfFailed("MakeHexa", self.BlocksOp)
11088 self._autoPublish(anObj, theName, "hexa")
11091 ## Create a hexahedral solid between two given faces.
11092 # The missing faces will be built by creating the smallest ones.
11093 # @param F1,F2 Two opposite faces for the hexahedral solid.
11094 # @param theName Object name; when specified, this parameter is used
11095 # for result publication in the study. Otherwise, if automatic
11096 # publication is switched on, default value is used for result name.
11098 # @return New GEOM.GEOM_Object, containing the created solid.
11100 # @ref tui_building_by_blocks_page "Example 1"
11101 # \n @ref swig_MakeHexa2Faces "Example 2"
11102 @ManageTransactions("BlocksOp")
11103 def MakeHexa2Faces(self, F1, F2, theName=None):
11105 Create a hexahedral solid between two given faces.
11106 The missing faces will be built by creating the smallest ones.
11109 F1,F2 Two opposite faces for the hexahedral solid.
11110 theName Object name; when specified, this parameter is used
11111 for result publication in the study. Otherwise, if automatic
11112 publication is switched on, default value is used for result name.
11115 New GEOM.GEOM_Object, containing the created solid.
11118 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11120 # Example: see GEOM_Spanner.py
11121 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11122 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11123 self._autoPublish(anObj, theName, "hexa")
11129 ## @addtogroup l3_blocks_op
11132 ## Get a vertex, found in the given shape by its coordinates.
11133 # @param theShape Block or a compound of blocks.
11134 # @param theX,theY,theZ Coordinates of the sought vertex.
11135 # @param theEpsilon Maximum allowed distance between the resulting
11136 # vertex and point with the given coordinates.
11137 # @param theName Object name; when specified, this parameter is used
11138 # for result publication in the study. Otherwise, if automatic
11139 # publication is switched on, default value is used for result name.
11141 # @return New GEOM.GEOM_Object, containing the found vertex.
11143 # @ref swig_GetPoint "Example"
11144 @ManageTransactions("BlocksOp")
11145 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11147 Get a vertex, found in the given shape by its coordinates.
11150 theShape Block or a compound of blocks.
11151 theX,theY,theZ Coordinates of the sought vertex.
11152 theEpsilon Maximum allowed distance between the resulting
11153 vertex and point with the given coordinates.
11154 theName Object name; when specified, this parameter is used
11155 for result publication in the study. Otherwise, if automatic
11156 publication is switched on, default value is used for result name.
11159 New GEOM.GEOM_Object, containing the found vertex.
11162 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11164 # Example: see GEOM_TestOthers.py
11165 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11166 RaiseIfFailed("GetPoint", self.BlocksOp)
11167 self._autoPublish(anObj, theName, "vertex")
11170 ## Find a vertex of the given shape, which has minimal distance to the given point.
11171 # @param theShape Any shape.
11172 # @param thePoint Point, close to the desired vertex.
11173 # @param theName Object name; when specified, this parameter is used
11174 # for result publication in the study. Otherwise, if automatic
11175 # publication is switched on, default value is used for result name.
11177 # @return New GEOM.GEOM_Object, containing the found vertex.
11179 # @ref swig_GetVertexNearPoint "Example"
11180 @ManageTransactions("BlocksOp")
11181 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11183 Find a vertex of the given shape, which has minimal distance to the given point.
11186 theShape Any shape.
11187 thePoint Point, close to the desired vertex.
11188 theName Object name; when specified, this parameter is used
11189 for result publication in the study. Otherwise, if automatic
11190 publication is switched on, default value is used for result name.
11193 New GEOM.GEOM_Object, containing the found vertex.
11196 pmidle = geompy.MakeVertex(50, 0, 50)
11197 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11199 # Example: see GEOM_TestOthers.py
11200 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11201 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11202 self._autoPublish(anObj, theName, "vertex")
11205 ## Get an edge, found in the given shape by two given vertices.
11206 # @param theShape Block or a compound of blocks.
11207 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11208 # @param theName Object name; when specified, this parameter is used
11209 # for result publication in the study. Otherwise, if automatic
11210 # publication is switched on, default value is used for result name.
11212 # @return New GEOM.GEOM_Object, containing the found edge.
11214 # @ref swig_GetEdge "Example"
11215 @ManageTransactions("BlocksOp")
11216 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11218 Get an edge, found in the given shape by two given vertices.
11221 theShape Block or a compound of blocks.
11222 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11223 theName Object name; when specified, this parameter is used
11224 for result publication in the study. Otherwise, if automatic
11225 publication is switched on, default value is used for result name.
11228 New GEOM.GEOM_Object, containing the found edge.
11230 # Example: see GEOM_Spanner.py
11231 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11232 RaiseIfFailed("GetEdge", self.BlocksOp)
11233 self._autoPublish(anObj, theName, "edge")
11236 ## Find an edge of the given shape, which has minimal distance to the given point.
11237 # @param theShape Block or a compound of blocks.
11238 # @param thePoint Point, close to the desired edge.
11239 # @param theName Object name; when specified, this parameter is used
11240 # for result publication in the study. Otherwise, if automatic
11241 # publication is switched on, default value is used for result name.
11243 # @return New GEOM.GEOM_Object, containing the found edge.
11245 # @ref swig_GetEdgeNearPoint "Example"
11246 @ManageTransactions("BlocksOp")
11247 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11249 Find an edge of the given shape, which has minimal distance to the given point.
11252 theShape Block or a compound of blocks.
11253 thePoint Point, close to the desired edge.
11254 theName Object name; when specified, this parameter is used
11255 for result publication in the study. Otherwise, if automatic
11256 publication is switched on, default value is used for result name.
11259 New GEOM.GEOM_Object, containing the found edge.
11261 # Example: see GEOM_TestOthers.py
11262 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11263 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11264 self._autoPublish(anObj, theName, "edge")
11267 ## Returns a face, found in the given shape by four given corner vertices.
11268 # @param theShape Block or a compound of blocks.
11269 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11270 # @param theName Object name; when specified, this parameter is used
11271 # for result publication in the study. Otherwise, if automatic
11272 # publication is switched on, default value is used for result name.
11274 # @return New GEOM.GEOM_Object, containing the found face.
11276 # @ref swig_todo "Example"
11277 @ManageTransactions("BlocksOp")
11278 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11280 Returns a face, found in the given shape by four given corner vertices.
11283 theShape Block or a compound of blocks.
11284 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11285 theName Object name; when specified, this parameter is used
11286 for result publication in the study. Otherwise, if automatic
11287 publication is switched on, default value is used for result name.
11290 New GEOM.GEOM_Object, containing the found face.
11292 # Example: see GEOM_Spanner.py
11293 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11294 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11295 self._autoPublish(anObj, theName, "face")
11298 ## Get a face of block, found in the given shape by two given edges.
11299 # @param theShape Block or a compound of blocks.
11300 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11301 # @param theName Object name; when specified, this parameter is used
11302 # for result publication in the study. Otherwise, if automatic
11303 # publication is switched on, default value is used for result name.
11305 # @return New GEOM.GEOM_Object, containing the found face.
11307 # @ref swig_todo "Example"
11308 @ManageTransactions("BlocksOp")
11309 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11311 Get a face of block, found in the given shape by two given edges.
11314 theShape Block or a compound of blocks.
11315 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11316 theName Object name; when specified, this parameter is used
11317 for result publication in the study. Otherwise, if automatic
11318 publication is switched on, default value is used for result name.
11321 New GEOM.GEOM_Object, containing the found face.
11323 # Example: see GEOM_Spanner.py
11324 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11325 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11326 self._autoPublish(anObj, theName, "face")
11329 ## Find a face, opposite to the given one in the given block.
11330 # @param theBlock Must be a hexahedral solid.
11331 # @param theFace Face of \a theBlock, opposite to the desired face.
11332 # @param theName Object name; when specified, this parameter is used
11333 # for result publication in the study. Otherwise, if automatic
11334 # publication is switched on, default value is used for result name.
11336 # @return New GEOM.GEOM_Object, containing the found face.
11338 # @ref swig_GetOppositeFace "Example"
11339 @ManageTransactions("BlocksOp")
11340 def GetOppositeFace(self, theBlock, theFace, theName=None):
11342 Find a face, opposite to the given one in the given block.
11345 theBlock Must be a hexahedral solid.
11346 theFace Face of theBlock, opposite to the desired face.
11347 theName Object name; when specified, this parameter is used
11348 for result publication in the study. Otherwise, if automatic
11349 publication is switched on, default value is used for result name.
11352 New GEOM.GEOM_Object, containing the found face.
11354 # Example: see GEOM_Spanner.py
11355 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11356 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11357 self._autoPublish(anObj, theName, "face")
11360 ## Find a face of the given shape, which has minimal distance to the given point.
11361 # @param theShape Block or a compound of blocks.
11362 # @param thePoint Point, close to the desired face.
11363 # @param theName Object name; when specified, this parameter is used
11364 # for result publication in the study. Otherwise, if automatic
11365 # publication is switched on, default value is used for result name.
11367 # @return New GEOM.GEOM_Object, containing the found face.
11369 # @ref swig_GetFaceNearPoint "Example"
11370 @ManageTransactions("BlocksOp")
11371 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11373 Find a face of the given shape, which has minimal distance to the given point.
11376 theShape Block or a compound of blocks.
11377 thePoint Point, close to the desired face.
11378 theName Object name; when specified, this parameter is used
11379 for result publication in the study. Otherwise, if automatic
11380 publication is switched on, default value is used for result name.
11383 New GEOM.GEOM_Object, containing the found face.
11385 # Example: see GEOM_Spanner.py
11386 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11387 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11388 self._autoPublish(anObj, theName, "face")
11391 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11392 # @param theBlock Block or a compound of blocks.
11393 # @param theVector Vector, close to the normale of the desired face.
11394 # @param theName Object name; when specified, this parameter is used
11395 # for result publication in the study. Otherwise, if automatic
11396 # publication is switched on, default value is used for result name.
11398 # @return New GEOM.GEOM_Object, containing the found face.
11400 # @ref swig_todo "Example"
11401 @ManageTransactions("BlocksOp")
11402 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11404 Find a face of block, whose outside normale has minimal angle with the given vector.
11407 theBlock Block or a compound of blocks.
11408 theVector Vector, close to the normale of the desired face.
11409 theName Object name; when specified, this parameter is used
11410 for result publication in the study. Otherwise, if automatic
11411 publication is switched on, default value is used for result name.
11414 New GEOM.GEOM_Object, containing the found face.
11416 # Example: see GEOM_Spanner.py
11417 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11418 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11419 self._autoPublish(anObj, theName, "face")
11422 ## Find all sub-shapes of type \a theShapeType of the given shape,
11423 # which have minimal distance to the given point.
11424 # @param theShape Any shape.
11425 # @param thePoint Point, close to the desired shape.
11426 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11427 # @param theTolerance The tolerance for distances comparison. All shapes
11428 # with distances to the given point in interval
11429 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11430 # @param theName Object name; when specified, this parameter is used
11431 # for result publication in the study. Otherwise, if automatic
11432 # publication is switched on, default value is used for result name.
11434 # @return New GEOM_Object, containing a group of all found shapes.
11436 # @ref swig_GetShapesNearPoint "Example"
11437 @ManageTransactions("BlocksOp")
11438 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11440 Find all sub-shapes of type theShapeType of the given shape,
11441 which have minimal distance to the given point.
11444 theShape Any shape.
11445 thePoint Point, close to the desired shape.
11446 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11447 theTolerance The tolerance for distances comparison. All shapes
11448 with distances to the given point in interval
11449 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11450 theName Object name; when specified, this parameter is used
11451 for result publication in the study. Otherwise, if automatic
11452 publication is switched on, default value is used for result name.
11455 New GEOM_Object, containing a group of all found shapes.
11457 # Example: see GEOM_TestOthers.py
11458 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11459 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11460 self._autoPublish(anObj, theName, "group")
11463 # end of l3_blocks_op
11466 ## @addtogroup l4_blocks_measure
11469 ## Check, if the compound of blocks is given.
11470 # To be considered as a compound of blocks, the
11471 # given shape must satisfy the following conditions:
11472 # - Each element of the compound should be a Block (6 faces and 12 edges).
11473 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11474 # - The compound should be connexe.
11475 # - The glue between two quadrangle faces should be applied.
11476 # @param theCompound The compound to check.
11477 # @return TRUE, if the given shape is a compound of blocks.
11478 # If theCompound is not valid, prints all discovered errors.
11480 # @ref tui_measurement_tools_page "Example 1"
11481 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11482 @ManageTransactions("BlocksOp")
11483 def CheckCompoundOfBlocks(self,theCompound):
11485 Check, if the compound of blocks is given.
11486 To be considered as a compound of blocks, the
11487 given shape must satisfy the following conditions:
11488 - Each element of the compound should be a Block (6 faces and 12 edges).
11489 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11490 - The compound should be connexe.
11491 - The glue between two quadrangle faces should be applied.
11494 theCompound The compound to check.
11497 TRUE, if the given shape is a compound of blocks.
11498 If theCompound is not valid, prints all discovered errors.
11500 # Example: see GEOM_Spanner.py
11501 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11502 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11504 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11508 ## Retrieve all non blocks solids and faces from \a theShape.
11509 # @param theShape The shape to explore.
11510 # @param theName Object name; when specified, this parameter is used
11511 # for result publication in the study. Otherwise, if automatic
11512 # publication is switched on, default value is used for result name.
11514 # @return A tuple of two GEOM_Objects. The first object is a group of all
11515 # non block solids (= not 6 faces, or with 6 faces, but with the
11516 # presence of non-quadrangular faces). The second object is a
11517 # group of all non quadrangular faces.
11519 # @ref tui_measurement_tools_page "Example 1"
11520 # \n @ref swig_GetNonBlocks "Example 2"
11521 @ManageTransactions("BlocksOp")
11522 def GetNonBlocks (self, theShape, theName=None):
11524 Retrieve all non blocks solids and faces from theShape.
11527 theShape The shape to explore.
11528 theName Object name; when specified, this parameter is used
11529 for result publication in the study. Otherwise, if automatic
11530 publication is switched on, default value is used for result name.
11533 A tuple of two GEOM_Objects. The first object is a group of all
11534 non block solids (= not 6 faces, or with 6 faces, but with the
11535 presence of non-quadrangular faces). The second object is a
11536 group of all non quadrangular faces.
11539 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11541 # Example: see GEOM_Spanner.py
11542 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11543 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11544 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11547 ## Remove all seam and degenerated edges from \a theShape.
11548 # Unite faces and edges, sharing one surface. It means that
11549 # this faces must have references to one C++ surface object (handle).
11550 # @param theShape The compound or single solid to remove irregular edges from.
11551 # @param doUnionFaces If True, then unite faces. If False (the default value),
11552 # do not unite faces.
11553 # @param theName Object name; when specified, this parameter is used
11554 # for result publication in the study. Otherwise, if automatic
11555 # publication is switched on, default value is used for result name.
11557 # @return Improved shape.
11559 # @ref swig_RemoveExtraEdges "Example"
11560 @ManageTransactions("BlocksOp")
11561 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11563 Remove all seam and degenerated edges from theShape.
11564 Unite faces and edges, sharing one surface. It means that
11565 this faces must have references to one C++ surface object (handle).
11568 theShape The compound or single solid to remove irregular edges from.
11569 doUnionFaces If True, then unite faces. If False (the default value),
11570 do not unite faces.
11571 theName Object name; when specified, this parameter is used
11572 for result publication in the study. Otherwise, if automatic
11573 publication is switched on, default value is used for result name.
11578 # Example: see GEOM_TestOthers.py
11579 nbFacesOptimum = -1 # -1 means do not unite faces
11580 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11581 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11582 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11583 self._autoPublish(anObj, theName, "removeExtraEdges")
11586 ## Performs union faces of \a theShape
11587 # Unite faces sharing one surface. It means that
11588 # these faces must have references to one C++ surface object (handle).
11589 # @param theShape The compound or single solid that contains faces
11590 # to perform union.
11591 # @param theName Object name; when specified, this parameter is used
11592 # for result publication in the study. Otherwise, if automatic
11593 # publication is switched on, default value is used for result name.
11595 # @return Improved shape.
11597 # @ref swig_UnionFaces "Example"
11598 @ManageTransactions("BlocksOp")
11599 def UnionFaces(self, theShape, theName=None):
11601 Performs union faces of theShape.
11602 Unite faces sharing one surface. It means that
11603 these faces must have references to one C++ surface object (handle).
11606 theShape The compound or single solid that contains faces
11608 theName Object name; when specified, this parameter is used
11609 for result publication in the study. Otherwise, if automatic
11610 publication is switched on, default value is used for result name.
11615 # Example: see GEOM_TestOthers.py
11616 anObj = self.BlocksOp.UnionFaces(theShape)
11617 RaiseIfFailed("UnionFaces", self.BlocksOp)
11618 self._autoPublish(anObj, theName, "unionFaces")
11621 ## Check, if the given shape is a blocks compound.
11622 # Fix all detected errors.
11623 # \note Single block can be also fixed by this method.
11624 # @param theShape The compound to check and improve.
11625 # @param theName Object name; when specified, this parameter is used
11626 # for result publication in the study. Otherwise, if automatic
11627 # publication is switched on, default value is used for result name.
11629 # @return Improved compound.
11631 # @ref swig_CheckAndImprove "Example"
11632 @ManageTransactions("BlocksOp")
11633 def CheckAndImprove(self, theShape, theName=None):
11635 Check, if the given shape is a blocks compound.
11636 Fix all detected errors.
11639 Single block can be also fixed by this method.
11642 theShape The compound to check and improve.
11643 theName Object name; when specified, this parameter is used
11644 for result publication in the study. Otherwise, if automatic
11645 publication is switched on, default value is used for result name.
11650 # Example: see GEOM_TestOthers.py
11651 anObj = self.BlocksOp.CheckAndImprove(theShape)
11652 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11653 self._autoPublish(anObj, theName, "improved")
11656 # end of l4_blocks_measure
11659 ## @addtogroup l3_blocks_op
11662 ## Get all the blocks, contained in the given compound.
11663 # @param theCompound The compound to explode.
11664 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11665 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11666 # @param theName Object name; when specified, this parameter is used
11667 # for result publication in the study. Otherwise, if automatic
11668 # publication is switched on, default value is used for result name.
11670 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11672 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11674 # @ref tui_explode_on_blocks "Example 1"
11675 # \n @ref swig_MakeBlockExplode "Example 2"
11676 @ManageTransactions("BlocksOp")
11677 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11679 Get all the blocks, contained in the given compound.
11682 theCompound The compound to explode.
11683 theMinNbFaces If solid has lower number of faces, it is not a block.
11684 theMaxNbFaces If solid has higher number of faces, it is not a block.
11685 theName Object name; when specified, this parameter is used
11686 for result publication in the study. Otherwise, if automatic
11687 publication is switched on, default value is used for result name.
11690 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11693 List of GEOM.GEOM_Object, containing the retrieved blocks.
11695 # Example: see GEOM_TestOthers.py
11696 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11697 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11698 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11699 for anObj in aList:
11700 anObj.SetParameters(Parameters)
11702 self._autoPublish(aList, theName, "block")
11705 ## Find block, containing the given point inside its volume or on boundary.
11706 # @param theCompound Compound, to find block in.
11707 # @param thePoint Point, close to the desired block. If the point lays on
11708 # boundary between some blocks, we return block with nearest center.
11709 # @param theName Object name; when specified, this parameter is used
11710 # for result publication in the study. Otherwise, if automatic
11711 # publication is switched on, default value is used for result name.
11713 # @return New GEOM.GEOM_Object, containing the found block.
11715 # @ref swig_todo "Example"
11716 @ManageTransactions("BlocksOp")
11717 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11719 Find block, containing the given point inside its volume or on boundary.
11722 theCompound Compound, to find block in.
11723 thePoint Point, close to the desired block. If the point lays on
11724 boundary between some blocks, we return block with nearest center.
11725 theName Object name; when specified, this parameter is used
11726 for result publication in the study. Otherwise, if automatic
11727 publication is switched on, default value is used for result name.
11730 New GEOM.GEOM_Object, containing the found block.
11732 # Example: see GEOM_Spanner.py
11733 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11734 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11735 self._autoPublish(anObj, theName, "block")
11738 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11739 # @param theCompound Compound, to find block in.
11740 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11741 # @param theName Object name; when specified, this parameter is used
11742 # for result publication in the study. Otherwise, if automatic
11743 # publication is switched on, default value is used for result name.
11745 # @return New GEOM.GEOM_Object, containing the found block.
11747 # @ref swig_GetBlockByParts "Example"
11748 @ManageTransactions("BlocksOp")
11749 def GetBlockByParts(self, theCompound, theParts, theName=None):
11751 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11754 theCompound Compound, to find block in.
11755 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11756 theName Object name; when specified, this parameter is used
11757 for result publication in the study. Otherwise, if automatic
11758 publication is switched on, default value is used for result name.
11761 New GEOM_Object, containing the found block.
11763 # Example: see GEOM_TestOthers.py
11764 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11765 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11766 self._autoPublish(anObj, theName, "block")
11769 ## Return all blocks, containing all the elements, passed as the parts.
11770 # @param theCompound Compound, to find blocks in.
11771 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11772 # @param theName Object name; when specified, this parameter is used
11773 # for result publication in the study. Otherwise, if automatic
11774 # publication is switched on, default value is used for result name.
11776 # @return List of GEOM.GEOM_Object, containing the found blocks.
11778 # @ref swig_todo "Example"
11779 @ManageTransactions("BlocksOp")
11780 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11782 Return all blocks, containing all the elements, passed as the parts.
11785 theCompound Compound, to find blocks in.
11786 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11787 theName Object name; when specified, this parameter is used
11788 for result publication in the study. Otherwise, if automatic
11789 publication is switched on, default value is used for result name.
11792 List of GEOM.GEOM_Object, containing the found blocks.
11794 # Example: see GEOM_Spanner.py
11795 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11796 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11797 self._autoPublish(aList, theName, "block")
11800 ## Multi-transformate block and glue the result.
11801 # Transformation is defined so, as to superpose direction faces.
11802 # @param Block Hexahedral solid to be multi-transformed.
11803 # @param DirFace1 ID of First direction face.
11804 # @param DirFace2 ID of Second direction face.
11805 # @param NbTimes Quantity of transformations to be done.
11806 # @param theName Object name; when specified, this parameter is used
11807 # for result publication in the study. Otherwise, if automatic
11808 # publication is switched on, default value is used for result name.
11810 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11812 # @return New GEOM.GEOM_Object, containing the result shape.
11814 # @ref tui_multi_transformation "Example"
11815 @ManageTransactions("BlocksOp")
11816 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11818 Multi-transformate block and glue the result.
11819 Transformation is defined so, as to superpose direction faces.
11822 Block Hexahedral solid to be multi-transformed.
11823 DirFace1 ID of First direction face.
11824 DirFace2 ID of Second direction face.
11825 NbTimes Quantity of transformations to be done.
11826 theName Object name; when specified, this parameter is used
11827 for result publication in the study. Otherwise, if automatic
11828 publication is switched on, default value is used for result name.
11831 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11834 New GEOM.GEOM_Object, containing the result shape.
11836 # Example: see GEOM_Spanner.py
11837 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11838 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11839 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11840 anObj.SetParameters(Parameters)
11841 self._autoPublish(anObj, theName, "transformed")
11844 ## Multi-transformate block and glue the result.
11845 # @param Block Hexahedral solid to be multi-transformed.
11846 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11847 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11848 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11849 # @param theName Object name; when specified, this parameter is used
11850 # for result publication in the study. Otherwise, if automatic
11851 # publication is switched on, default value is used for result name.
11853 # @return New GEOM.GEOM_Object, containing the result shape.
11855 # @ref tui_multi_transformation "Example"
11856 @ManageTransactions("BlocksOp")
11857 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11858 DirFace1V, DirFace2V, NbTimesV, theName=None):
11860 Multi-transformate block and glue the result.
11863 Block Hexahedral solid to be multi-transformed.
11864 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11865 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11866 NbTimesU,NbTimesV Quantity of transformations to be done.
11867 theName Object name; when specified, this parameter is used
11868 for result publication in the study. Otherwise, if automatic
11869 publication is switched on, default value is used for result name.
11872 New GEOM.GEOM_Object, containing the result shape.
11874 # Example: see GEOM_Spanner.py
11875 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11876 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11877 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11878 DirFace1V, DirFace2V, NbTimesV)
11879 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11880 anObj.SetParameters(Parameters)
11881 self._autoPublish(anObj, theName, "transformed")
11884 ## Build all possible propagation groups.
11885 # Propagation group is a set of all edges, opposite to one (main)
11886 # edge of this group directly or through other opposite edges.
11887 # Notion of Opposite Edge make sence only on quadrangle face.
11888 # @param theShape Shape to build propagation groups on.
11889 # @param theName Object name; when specified, this parameter is used
11890 # for result publication in the study. Otherwise, if automatic
11891 # publication is switched on, default value is used for result name.
11893 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11895 # @ref swig_Propagate "Example"
11896 @ManageTransactions("BlocksOp")
11897 def Propagate(self, theShape, theName=None):
11899 Build all possible propagation groups.
11900 Propagation group is a set of all edges, opposite to one (main)
11901 edge of this group directly or through other opposite edges.
11902 Notion of Opposite Edge make sence only on quadrangle face.
11905 theShape Shape to build propagation groups on.
11906 theName Object name; when specified, this parameter is used
11907 for result publication in the study. Otherwise, if automatic
11908 publication is switched on, default value is used for result name.
11911 List of GEOM.GEOM_Object, each of them is a propagation group.
11913 # Example: see GEOM_TestOthers.py
11914 listChains = self.BlocksOp.Propagate(theShape)
11915 RaiseIfFailed("Propagate", self.BlocksOp)
11916 self._autoPublish(listChains, theName, "propagate")
11919 # end of l3_blocks_op
11922 ## @addtogroup l3_groups
11925 ## Creates a new group which will store sub-shapes of theMainShape
11926 # @param theMainShape is a GEOM object on which the group is selected
11927 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11928 # @param theName Object name; when specified, this parameter is used
11929 # for result publication in the study. Otherwise, if automatic
11930 # publication is switched on, default value is used for result name.
11932 # @return a newly created GEOM group (GEOM.GEOM_Object)
11934 # @ref tui_working_with_groups_page "Example 1"
11935 # \n @ref swig_CreateGroup "Example 2"
11936 @ManageTransactions("GroupOp")
11937 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11939 Creates a new group which will store sub-shapes of theMainShape
11942 theMainShape is a GEOM object on which the group is selected
11943 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11944 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11945 theName Object name; when specified, this parameter is used
11946 for result publication in the study. Otherwise, if automatic
11947 publication is switched on, default value is used for result name.
11950 a newly created GEOM group
11953 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11956 # Example: see GEOM_TestOthers.py
11957 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11958 RaiseIfFailed("CreateGroup", self.GroupOp)
11959 self._autoPublish(anObj, theName, "group")
11962 ## Adds a sub-object with ID theSubShapeId to the group
11963 # @param theGroup is a GEOM group to which the new sub-shape is added
11964 # @param theSubShapeID is a sub-shape ID in the main object.
11965 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11967 # @ref tui_working_with_groups_page "Example"
11968 @ManageTransactions("GroupOp")
11969 def AddObject(self,theGroup, theSubShapeID):
11971 Adds a sub-object with ID theSubShapeId to the group
11974 theGroup is a GEOM group to which the new sub-shape is added
11975 theSubShapeID is a sub-shape ID in the main object.
11978 Use method GetSubShapeID() to get an unique ID of the sub-shape
11980 # Example: see GEOM_TestOthers.py
11981 self.GroupOp.AddObject(theGroup, theSubShapeID)
11982 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11983 RaiseIfFailed("AddObject", self.GroupOp)
11987 ## Removes a sub-object with ID \a theSubShapeId from the group
11988 # @param theGroup is a GEOM group from which the new sub-shape is removed
11989 # @param theSubShapeID is a sub-shape ID in the main object.
11990 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11992 # @ref tui_working_with_groups_page "Example"
11993 @ManageTransactions("GroupOp")
11994 def RemoveObject(self,theGroup, theSubShapeID):
11996 Removes a sub-object with ID theSubShapeId from the group
11999 theGroup is a GEOM group from which the new sub-shape is removed
12000 theSubShapeID is a sub-shape ID in the main object.
12003 Use method GetSubShapeID() to get an unique ID of the sub-shape
12005 # Example: see GEOM_TestOthers.py
12006 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
12007 RaiseIfFailed("RemoveObject", self.GroupOp)
12010 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12011 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12012 # @param theSubShapes is a list of sub-shapes to be added.
12014 # @ref tui_working_with_groups_page "Example"
12015 @ManageTransactions("GroupOp")
12016 def UnionList (self,theGroup, theSubShapes):
12018 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12021 theGroup is a GEOM group to which the new sub-shapes are added.
12022 theSubShapes is a list of sub-shapes to be added.
12024 # Example: see GEOM_TestOthers.py
12025 self.GroupOp.UnionList(theGroup, theSubShapes)
12026 RaiseIfFailed("UnionList", self.GroupOp)
12029 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12030 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12031 # @param theSubShapes is a list of indices of sub-shapes to be added.
12033 # @ref swig_UnionIDs "Example"
12034 @ManageTransactions("GroupOp")
12035 def UnionIDs(self,theGroup, theSubShapes):
12037 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12040 theGroup is a GEOM group to which the new sub-shapes are added.
12041 theSubShapes is a list of indices of sub-shapes to be added.
12043 # Example: see GEOM_TestOthers.py
12044 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12045 RaiseIfFailed("UnionIDs", self.GroupOp)
12048 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12049 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12050 # @param theSubShapes is a list of sub-shapes to be removed.
12052 # @ref tui_working_with_groups_page "Example"
12053 @ManageTransactions("GroupOp")
12054 def DifferenceList (self,theGroup, theSubShapes):
12056 Removes from the group all the given shapes. No errors, if some shapes are not included.
12059 theGroup is a GEOM group from which the sub-shapes are removed.
12060 theSubShapes is a list of sub-shapes to be removed.
12062 # Example: see GEOM_TestOthers.py
12063 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12064 RaiseIfFailed("DifferenceList", self.GroupOp)
12067 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12068 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12069 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12071 # @ref swig_DifferenceIDs "Example"
12072 @ManageTransactions("GroupOp")
12073 def DifferenceIDs(self,theGroup, theSubShapes):
12075 Removes from the group all the given shapes. No errors, if some shapes are not included.
12078 theGroup is a GEOM group from which the sub-shapes are removed.
12079 theSubShapes is a list of indices of sub-shapes to be removed.
12081 # Example: see GEOM_TestOthers.py
12082 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12083 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12086 ## Union of two groups.
12087 # New group is created. It will contain all entities
12088 # which are present in groups theGroup1 and theGroup2.
12089 # @param theGroup1, theGroup2 are the initial GEOM groups
12090 # to create the united group from.
12091 # @param theName Object name; when specified, this parameter is used
12092 # for result publication in the study. Otherwise, if automatic
12093 # publication is switched on, default value is used for result name.
12095 # @return a newly created GEOM group.
12097 # @ref tui_union_groups_anchor "Example"
12098 @ManageTransactions("GroupOp")
12099 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12101 Union of two groups.
12102 New group is created. It will contain all entities
12103 which are present in groups theGroup1 and theGroup2.
12106 theGroup1, theGroup2 are the initial GEOM groups
12107 to create the united group from.
12108 theName Object name; when specified, this parameter is used
12109 for result publication in the study. Otherwise, if automatic
12110 publication is switched on, default value is used for result name.
12113 a newly created GEOM group.
12115 # Example: see GEOM_TestOthers.py
12116 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12117 RaiseIfFailed("UnionGroups", self.GroupOp)
12118 self._autoPublish(aGroup, theName, "group")
12121 ## Intersection of two groups.
12122 # New group is created. It will contain only those entities
12123 # which are present in both groups theGroup1 and theGroup2.
12124 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12125 # @param theName Object name; when specified, this parameter is used
12126 # for result publication in the study. Otherwise, if automatic
12127 # publication is switched on, default value is used for result name.
12129 # @return a newly created GEOM group.
12131 # @ref tui_intersect_groups_anchor "Example"
12132 @ManageTransactions("GroupOp")
12133 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12135 Intersection of two groups.
12136 New group is created. It will contain only those entities
12137 which are present in both groups theGroup1 and theGroup2.
12140 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12141 theName Object name; when specified, this parameter is used
12142 for result publication in the study. Otherwise, if automatic
12143 publication is switched on, default value is used for result name.
12146 a newly created GEOM group.
12148 # Example: see GEOM_TestOthers.py
12149 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12150 RaiseIfFailed("IntersectGroups", self.GroupOp)
12151 self._autoPublish(aGroup, theName, "group")
12154 ## Cut of two groups.
12155 # New group is created. It will contain entities which are
12156 # present in group theGroup1 but are not present in group theGroup2.
12157 # @param theGroup1 is a GEOM group to include elements of.
12158 # @param theGroup2 is a GEOM group to exclude elements of.
12159 # @param theName Object name; when specified, this parameter is used
12160 # for result publication in the study. Otherwise, if automatic
12161 # publication is switched on, default value is used for result name.
12163 # @return a newly created GEOM group.
12165 # @ref tui_cut_groups_anchor "Example"
12166 @ManageTransactions("GroupOp")
12167 def CutGroups (self, theGroup1, theGroup2, theName=None):
12170 New group is created. It will contain entities which are
12171 present in group theGroup1 but are not present in group theGroup2.
12174 theGroup1 is a GEOM group to include elements of.
12175 theGroup2 is a GEOM group to exclude elements of.
12176 theName Object name; when specified, this parameter is used
12177 for result publication in the study. Otherwise, if automatic
12178 publication is switched on, default value is used for result name.
12181 a newly created GEOM group.
12183 # Example: see GEOM_TestOthers.py
12184 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12185 RaiseIfFailed("CutGroups", self.GroupOp)
12186 self._autoPublish(aGroup, theName, "group")
12189 ## Union of list of groups.
12190 # New group is created. It will contain all entities that are
12191 # present in groups listed in theGList.
12192 # @param theGList is a list of GEOM groups to create the united group from.
12193 # @param theName Object name; when specified, this parameter is used
12194 # for result publication in the study. Otherwise, if automatic
12195 # publication is switched on, default value is used for result name.
12197 # @return a newly created GEOM group.
12199 # @ref tui_union_groups_anchor "Example"
12200 @ManageTransactions("GroupOp")
12201 def UnionListOfGroups (self, theGList, theName=None):
12203 Union of list of groups.
12204 New group is created. It will contain all entities that are
12205 present in groups listed in theGList.
12208 theGList is a list of GEOM groups to create the united group from.
12209 theName Object name; when specified, this parameter is used
12210 for result publication in the study. Otherwise, if automatic
12211 publication is switched on, default value is used for result name.
12214 a newly created GEOM group.
12216 # Example: see GEOM_TestOthers.py
12217 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12218 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12219 self._autoPublish(aGroup, theName, "group")
12222 ## Cut of lists of groups.
12223 # New group is created. It will contain only entities
12224 # which are present in groups listed in theGList.
12225 # @param theGList is a list of GEOM groups to include elements of.
12226 # @param theName Object name; when specified, this parameter is used
12227 # for result publication in the study. Otherwise, if automatic
12228 # publication is switched on, default value is used for result name.
12230 # @return a newly created GEOM group.
12232 # @ref tui_intersect_groups_anchor "Example"
12233 @ManageTransactions("GroupOp")
12234 def IntersectListOfGroups (self, theGList, theName=None):
12236 Cut of lists of groups.
12237 New group is created. It will contain only entities
12238 which are present in groups listed in theGList.
12241 theGList is a list of GEOM groups to include elements of.
12242 theName Object name; when specified, this parameter is used
12243 for result publication in the study. Otherwise, if automatic
12244 publication is switched on, default value is used for result name.
12247 a newly created GEOM group.
12249 # Example: see GEOM_TestOthers.py
12250 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12251 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12252 self._autoPublish(aGroup, theName, "group")
12255 ## Cut of lists of groups.
12256 # New group is created. It will contain only entities
12257 # which are present in groups listed in theGList1 but
12258 # are not present in groups from theGList2.
12259 # @param theGList1 is a list of GEOM groups to include elements of.
12260 # @param theGList2 is a list of GEOM groups to exclude elements of.
12261 # @param theName Object name; when specified, this parameter is used
12262 # for result publication in the study. Otherwise, if automatic
12263 # publication is switched on, default value is used for result name.
12265 # @return a newly created GEOM group.
12267 # @ref tui_cut_groups_anchor "Example"
12268 @ManageTransactions("GroupOp")
12269 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12271 Cut of lists of groups.
12272 New group is created. It will contain only entities
12273 which are present in groups listed in theGList1 but
12274 are not present in groups from theGList2.
12277 theGList1 is a list of GEOM groups to include elements of.
12278 theGList2 is a list of GEOM groups to exclude elements of.
12279 theName Object name; when specified, this parameter is used
12280 for result publication in the study. Otherwise, if automatic
12281 publication is switched on, default value is used for result name.
12284 a newly created GEOM group.
12286 # Example: see GEOM_TestOthers.py
12287 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12288 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12289 self._autoPublish(aGroup, theName, "group")
12292 ## Returns a list of sub-objects ID stored in the group
12293 # @param theGroup is a GEOM group for which a list of IDs is requested
12295 # @ref swig_GetObjectIDs "Example"
12296 @ManageTransactions("GroupOp")
12297 def GetObjectIDs(self,theGroup):
12299 Returns a list of sub-objects ID stored in the group
12302 theGroup is a GEOM group for which a list of IDs is requested
12304 # Example: see GEOM_TestOthers.py
12305 ListIDs = self.GroupOp.GetObjects(theGroup)
12306 RaiseIfFailed("GetObjects", self.GroupOp)
12309 ## Returns a type of sub-objects stored in the group
12310 # @param theGroup is a GEOM group which type is returned.
12312 # @ref swig_GetType "Example"
12313 @ManageTransactions("GroupOp")
12314 def GetType(self,theGroup):
12316 Returns a type of sub-objects stored in the group
12319 theGroup is a GEOM group which type is returned.
12321 # Example: see GEOM_TestOthers.py
12322 aType = self.GroupOp.GetType(theGroup)
12323 RaiseIfFailed("GetType", self.GroupOp)
12326 ## Convert a type of geom object from id to string value
12327 # @param theId is a GEOM obect type id.
12328 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12329 # @ref swig_GetType "Example"
12330 def ShapeIdToType(self, theId):
12332 Convert a type of geom object from id to string value
12335 theId is a GEOM obect type id.
12338 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12365 return "REVOLUTION"
12413 return "FREE_BOUNDS"
12421 return "THRUSECTIONS"
12423 return "COMPOUNDFILTER"
12425 return "SHAPES_ON_SHAPE"
12427 return "ELLIPSE_ARC"
12429 return "3DSKETCHER"
12435 return "PIPETSHAPE"
12436 return "Shape Id not exist."
12438 ## Returns a main shape associated with the group
12439 # @param theGroup is a GEOM group for which a main shape object is requested
12440 # @return a GEOM object which is a main shape for theGroup
12442 # @ref swig_GetMainShape "Example"
12443 @ManageTransactions("GroupOp")
12444 def GetMainShape(self,theGroup):
12446 Returns a main shape associated with the group
12449 theGroup is a GEOM group for which a main shape object is requested
12452 a GEOM object which is a main shape for theGroup
12454 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12456 # Example: see GEOM_TestOthers.py
12457 anObj = self.GroupOp.GetMainShape(theGroup)
12458 RaiseIfFailed("GetMainShape", self.GroupOp)
12461 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12462 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12463 # @param theShape given shape (see GEOM.GEOM_Object)
12464 # @param min_length minimum length of edges of theShape
12465 # @param max_length maximum length of edges of theShape
12466 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12467 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12468 # @param theName Object name; when specified, this parameter is used
12469 # for result publication in the study. Otherwise, if automatic
12470 # publication is switched on, default value is used for result name.
12472 # @return a newly created GEOM group of edges
12474 # @@ref swig_todo "Example"
12475 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12477 Create group of edges of theShape, whose length is in range [min_length, max_length].
12478 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12481 theShape given shape
12482 min_length minimum length of edges of theShape
12483 max_length maximum length of edges of theShape
12484 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12485 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12486 theName Object name; when specified, this parameter is used
12487 for result publication in the study. Otherwise, if automatic
12488 publication is switched on, default value is used for result name.
12491 a newly created GEOM group of edges.
12493 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12494 edges_in_range = []
12496 Props = self.BasicProperties(edge)
12497 if min_length <= Props[0] and Props[0] <= max_length:
12498 if (not include_min) and (min_length == Props[0]):
12501 if (not include_max) and (Props[0] == max_length):
12504 edges_in_range.append(edge)
12506 if len(edges_in_range) <= 0:
12507 print "No edges found by given criteria"
12510 # note: auto-publishing is done in self.CreateGroup()
12511 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12512 self.UnionList(group_edges, edges_in_range)
12516 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12517 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12518 # @param min_length minimum length of edges of selected shape
12519 # @param max_length maximum length of edges of selected shape
12520 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12521 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12522 # @return a newly created GEOM group of edges
12523 # @ref swig_todo "Example"
12524 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12526 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12527 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12530 min_length minimum length of edges of selected shape
12531 max_length maximum length of edges of selected shape
12532 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12533 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12536 a newly created GEOM group of edges.
12538 nb_selected = sg.SelectedCount()
12539 if nb_selected < 1:
12540 print "Select a shape before calling this function, please."
12542 if nb_selected > 1:
12543 print "Only one shape must be selected"
12546 id_shape = sg.getSelected(0)
12547 shape = IDToObject( id_shape )
12549 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12553 if include_min: left_str = " <= "
12554 if include_max: right_str = " <= "
12556 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12557 + left_str + "length" + right_str + `max_length`)
12559 sg.updateObjBrowser(1)
12566 ## @addtogroup l4_advanced
12569 ## Create a T-shape object with specified caracteristics for the main
12570 # and the incident pipes (radius, width, half-length).
12571 # The extremities of the main pipe are located on junctions points P1 and P2.
12572 # The extremity of the incident pipe is located on junction point P3.
12573 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12574 # the main plane of the T-shape is XOY.
12576 # @param theR1 Internal radius of main pipe
12577 # @param theW1 Width of main pipe
12578 # @param theL1 Half-length of main pipe
12579 # @param theR2 Internal radius of incident pipe (R2 < R1)
12580 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12581 # @param theL2 Half-length of incident pipe
12583 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12584 # @param theP1 1st junction point of main pipe
12585 # @param theP2 2nd junction point of main pipe
12586 # @param theP3 Junction point of incident pipe
12588 # @param theRL Internal radius of left thickness reduction
12589 # @param theWL Width of left thickness reduction
12590 # @param theLtransL Length of left transition part
12591 # @param theLthinL Length of left thin part
12593 # @param theRR Internal radius of right thickness reduction
12594 # @param theWR Width of right thickness reduction
12595 # @param theLtransR Length of right transition part
12596 # @param theLthinR Length of right thin part
12598 # @param theRI Internal radius of incident thickness reduction
12599 # @param theWI Width of incident thickness reduction
12600 # @param theLtransI Length of incident transition part
12601 # @param theLthinI Length of incident thin part
12603 # @param theName Object name; when specified, this parameter is used
12604 # for result publication in the study. Otherwise, if automatic
12605 # publication is switched on, default value is used for result name.
12607 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12609 # @ref tui_creation_pipetshape "Example"
12610 @ManageTransactions("AdvOp")
12611 def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
12612 theHexMesh=True, theP1=None, theP2=None, theP3=None,
12613 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12614 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12615 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12618 Create a T-shape object with specified caracteristics for the main
12619 and the incident pipes (radius, width, half-length).
12620 The extremities of the main pipe are located on junctions points P1 and P2.
12621 The extremity of the incident pipe is located on junction point P3.
12622 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12623 the main plane of the T-shape is XOY.
12626 theR1 Internal radius of main pipe
12627 theW1 Width of main pipe
12628 theL1 Half-length of main pipe
12629 theR2 Internal radius of incident pipe (R2 < R1)
12630 theW2 Width of incident pipe (R2+W2 < R1+W1)
12631 theL2 Half-length of incident pipe
12632 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12633 theP1 1st junction point of main pipe
12634 theP2 2nd junction point of main pipe
12635 theP3 Junction point of incident pipe
12637 theRL Internal radius of left thickness reduction
12638 theWL Width of left thickness reduction
12639 theLtransL Length of left transition part
12640 theLthinL Length of left thin part
12642 theRR Internal radius of right thickness reduction
12643 theWR Width of right thickness reduction
12644 theLtransR Length of right transition part
12645 theLthinR Length of right thin part
12647 theRI Internal radius of incident thickness reduction
12648 theWI Width of incident thickness reduction
12649 theLtransI Length of incident transition part
12650 theLthinI Length of incident thin part
12652 theName Object name; when specified, this parameter is used
12653 for result publication in the study. Otherwise, if automatic
12654 publication is switched on, default value is used for result name.
12657 List of GEOM_Object, containing the created shape and propagation groups.
12660 # create PipeTShape object
12661 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
12662 # create PipeTShape object with position
12663 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
12664 # create PipeTShape object with left thickness reduction
12665 pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
12667 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)
12668 if (theP1 and theP2 and theP3):
12669 anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12670 theRL, theWL, theLtransL, theLthinL,
12671 theRR, theWR, theLtransR, theLthinR,
12672 theRI, theWI, theLtransI, theLthinI,
12673 theHexMesh, theP1, theP2, theP3)
12675 anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
12676 theRL, theWL, theLtransL, theLthinL,
12677 theRR, theWR, theLtransR, theLthinR,
12678 theRI, theWI, theLtransI, theLthinI,
12680 RaiseIfFailed("MakePipeTShape", self.AdvOp)
12681 if Parameters: anObj[0].SetParameters(Parameters)
12682 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12683 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12686 ## Create a T-shape object with chamfer and with specified caracteristics for the main
12687 # and the incident pipes (radius, width, half-length). The chamfer is
12688 # created on the junction of the pipes.
12689 # The extremities of the main pipe are located on junctions points P1 and P2.
12690 # The extremity of the incident pipe is located on junction point P3.
12691 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12692 # the main plane of the T-shape is XOY.
12693 # @param theR1 Internal radius of main pipe
12694 # @param theW1 Width of main pipe
12695 # @param theL1 Half-length of main pipe
12696 # @param theR2 Internal radius of incident pipe (R2 < R1)
12697 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12698 # @param theL2 Half-length of incident pipe
12699 # @param theH Height of the chamfer.
12700 # @param theW Width of the chamfer.
12701 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12702 # @param theP1 1st junction point of main pipe
12703 # @param theP2 2nd junction point of main pipe
12704 # @param theP3 Junction point of incident pipe
12706 # @param theRL Internal radius of left thickness reduction
12707 # @param theWL Width of left thickness reduction
12708 # @param theLtransL Length of left transition part
12709 # @param theLthinL Length of left thin part
12711 # @param theRR Internal radius of right thickness reduction
12712 # @param theWR Width of right thickness reduction
12713 # @param theLtransR Length of right transition part
12714 # @param theLthinR Length of right thin part
12716 # @param theRI Internal radius of incident thickness reduction
12717 # @param theWI Width of incident thickness reduction
12718 # @param theLtransI Length of incident transition part
12719 # @param theLthinI Length of incident thin part
12721 # @param theName Object name; when specified, this parameter is used
12722 # for result publication in the study. Otherwise, if automatic
12723 # publication is switched on, default value is used for result name.
12725 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12727 # @ref tui_creation_pipetshape "Example"
12728 @ManageTransactions("AdvOp")
12729 def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
12730 theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12731 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12732 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12733 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12736 Create a T-shape object with chamfer and with specified caracteristics for the main
12737 and the incident pipes (radius, width, half-length). The chamfer is
12738 created on the junction of the pipes.
12739 The extremities of the main pipe are located on junctions points P1 and P2.
12740 The extremity of the incident pipe is located on junction point P3.
12741 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12742 the main plane of the T-shape is XOY.
12745 theR1 Internal radius of main pipe
12746 theW1 Width of main pipe
12747 theL1 Half-length of main pipe
12748 theR2 Internal radius of incident pipe (R2 < R1)
12749 theW2 Width of incident pipe (R2+W2 < R1+W1)
12750 theL2 Half-length of incident pipe
12751 theH Height of the chamfer.
12752 theW Width of the chamfer.
12753 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12754 theP1 1st junction point of main pipe
12755 theP2 2nd junction point of main pipe
12756 theP3 Junction point of incident pipe
12758 theRL Internal radius of left thickness reduction
12759 theWL Width of left thickness reduction
12760 theLtransL Length of left transition part
12761 theLthinL Length of left thin part
12763 theRR Internal radius of right thickness reduction
12764 theWR Width of right thickness reduction
12765 theLtransR Length of right transition part
12766 theLthinR Length of right thin part
12768 theRI Internal radius of incident thickness reduction
12769 theWI Width of incident thickness reduction
12770 theLtransI Length of incident transition part
12771 theLthinI Length of incident thin part
12773 theName Object name; when specified, this parameter is used
12774 for result publication in the study. Otherwise, if automatic
12775 publication is switched on, default value is used for result name.
12778 List of GEOM_Object, containing the created shape and propagation groups.
12781 # create PipeTShape with chamfer object
12782 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
12783 # create PipeTShape with chamfer object with position
12784 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
12785 # create PipeTShape with chamfer object with left thickness reduction
12786 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)
12788 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)
12789 if (theP1 and theP2 and theP3):
12790 anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(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, theP1, theP2, theP3)
12796 anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
12797 theRL, theWL, theLtransL, theLthinL,
12798 theRR, theWR, theLtransR, theLthinR,
12799 theRI, theWI, theLtransI, theLthinI,
12800 theH, theW, theHexMesh)
12801 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
12802 if Parameters: anObj[0].SetParameters(Parameters)
12803 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12804 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12807 ## Create a T-shape object with fillet and with specified caracteristics for the main
12808 # and the incident pipes (radius, width, half-length). The fillet is
12809 # created on the junction of the pipes.
12810 # The extremities of the main pipe are located on junctions points P1 and P2.
12811 # The extremity of the incident pipe is located on junction point P3.
12812 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12813 # the main plane of the T-shape is XOY.
12814 # @param theR1 Internal radius of main pipe
12815 # @param theW1 Width of main pipe
12816 # @param theL1 Half-length of main pipe
12817 # @param theR2 Internal radius of incident pipe (R2 < R1)
12818 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
12819 # @param theL2 Half-length of incident pipe
12820 # @param theRF Radius of curvature of fillet.
12821 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12822 # @param theP1 1st junction point of main pipe
12823 # @param theP2 2nd junction point of main pipe
12824 # @param theP3 Junction point of incident pipe
12826 # @param theRL Internal radius of left thickness reduction
12827 # @param theWL Width of left thickness reduction
12828 # @param theLtransL Length of left transition part
12829 # @param theLthinL Length of left thin part
12831 # @param theRR Internal radius of right thickness reduction
12832 # @param theWR Width of right thickness reduction
12833 # @param theLtransR Length of right transition part
12834 # @param theLthinR Length of right thin part
12836 # @param theRI Internal radius of incident thickness reduction
12837 # @param theWI Width of incident thickness reduction
12838 # @param theLtransI Length of incident transition part
12839 # @param theLthinI Length of incident thin part
12841 # @param theName Object name; when specified, this parameter is used
12842 # for result publication in the study. Otherwise, if automatic
12843 # publication is switched on, default value is used for result name.
12845 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
12847 # @ref tui_creation_pipetshape "Example"
12848 @ManageTransactions("AdvOp")
12849 def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
12850 theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
12851 theRL=0, theWL=0, theLtransL=0, theLthinL=0,
12852 theRR=0, theWR=0, theLtransR=0, theLthinR=0,
12853 theRI=0, theWI=0, theLtransI=0, theLthinI=0,
12856 Create a T-shape object with fillet and with specified caracteristics for the main
12857 and the incident pipes (radius, width, half-length). The fillet is
12858 created on the junction of the pipes.
12859 The extremities of the main pipe are located on junctions points P1 and P2.
12860 The extremity of the incident pipe is located on junction point P3.
12863 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
12864 the main plane of the T-shape is XOY.
12865 theR1 Internal radius of main pipe
12866 theW1 Width of main pipe
12867 heL1 Half-length of main pipe
12868 theR2 Internal radius of incident pipe (R2 < R1)
12869 theW2 Width of incident pipe (R2+W2 < R1+W1)
12870 theL2 Half-length of incident pipe
12871 theRF Radius of curvature of fillet.
12872 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
12873 theP1 1st junction point of main pipe
12874 theP2 2nd junction point of main pipe
12875 theP3 Junction point of incident pipe
12877 theRL Internal radius of left thickness reduction
12878 theWL Width of left thickness reduction
12879 theLtransL Length of left transition part
12880 theLthinL Length of left thin part
12882 theRR Internal radius of right thickness reduction
12883 theWR Width of right thickness reduction
12884 theLtransR Length of right transition part
12885 theLthinR Length of right thin part
12887 theRI Internal radius of incident thickness reduction
12888 theWI Width of incident thickness reduction
12889 theLtransI Length of incident transition part
12890 theLthinI Length of incident thin part
12892 theName Object name; when specified, this parameter is used
12893 for result publication in the study. Otherwise, if automatic
12894 publication is switched on, default value is used for result name.
12897 List of GEOM_Object, containing the created shape and propagation groups.
12900 # create PipeTShape with fillet object
12901 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
12902 # create PipeTShape with fillet object with position
12903 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
12904 # create PipeTShape with fillet object with left thickness reduction
12905 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)
12907 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)
12908 if (theP1 and theP2 and theP3):
12909 anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
12910 theRL, theWL, theLtransL, theLthinL,
12911 theRR, theWR, theLtransR, theLthinR,
12912 theRI, theWI, theLtransI, theLthinI,
12913 theRF, theHexMesh, theP1, theP2, theP3)
12915 anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
12916 theRL, theWL, theLtransL, theLthinL,
12917 theRR, theWR, theLtransR, theLthinR,
12918 theRI, theWI, theLtransI, theLthinI,
12920 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
12921 if Parameters: anObj[0].SetParameters(Parameters)
12922 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
12923 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
12926 ## This function allows creating a disk already divided into blocks. It
12927 # can be used to create divided pipes for later meshing in hexaedra.
12928 # @param theR Radius of the disk
12929 # @param theOrientation Orientation of the plane on which the disk will be built
12930 # 1 = XOY, 2 = OYZ, 3 = OZX
12931 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12932 # @param theName Object name; when specified, this parameter is used
12933 # for result publication in the study. Otherwise, if automatic
12934 # publication is switched on, default value is used for result name.
12936 # @return New GEOM_Object, containing the created shape.
12938 # @ref tui_creation_divideddisk "Example"
12939 @ManageTransactions("AdvOp")
12940 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
12942 Creates a disk, divided into blocks. It can be used to create divided pipes
12943 for later meshing in hexaedra.
12946 theR Radius of the disk
12947 theOrientation Orientation of the plane on which the disk will be built:
12948 1 = XOY, 2 = OYZ, 3 = OZX
12949 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12950 theName Object name; when specified, this parameter is used
12951 for result publication in the study. Otherwise, if automatic
12952 publication is switched on, default value is used for result name.
12955 New GEOM_Object, containing the created shape.
12957 theR, Parameters = ParseParameters(theR)
12958 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
12959 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
12960 if Parameters: anObj.SetParameters(Parameters)
12961 self._autoPublish(anObj, theName, "dividedDisk")
12964 ## This function allows creating a disk already divided into blocks. It
12965 # can be used to create divided pipes for later meshing in hexaedra.
12966 # @param theCenter Center of the disk
12967 # @param theVector Normal vector to the plane of the created disk
12968 # @param theRadius Radius of the disk
12969 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12970 # @param theName Object name; when specified, this parameter is used
12971 # for result publication in the study. Otherwise, if automatic
12972 # publication is switched on, default value is used for result name.
12974 # @return New GEOM_Object, containing the created shape.
12976 # @ref tui_creation_divideddisk "Example"
12977 @ManageTransactions("AdvOp")
12978 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
12980 Creates a disk already divided into blocks. It can be used to create divided pipes
12981 for later meshing in hexaedra.
12984 theCenter Center of the disk
12985 theVector Normal vector to the plane of the created disk
12986 theRadius Radius of the disk
12987 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
12988 theName Object name; when specified, this parameter is used
12989 for result publication in the study. Otherwise, if automatic
12990 publication is switched on, default value is used for result name.
12993 New GEOM_Object, containing the created shape.
12995 theRadius, Parameters = ParseParameters(theRadius)
12996 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
12997 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
12998 if Parameters: anObj.SetParameters(Parameters)
12999 self._autoPublish(anObj, theName, "dividedDisk")
13002 ## Builds a cylinder prepared for hexa meshes
13003 # @param theR Radius of the cylinder
13004 # @param theH Height of the cylinder
13005 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
13006 # @param theName Object name; when specified, this parameter is used
13007 # for result publication in the study. Otherwise, if automatic
13008 # publication is switched on, default value is used for result name.
13010 # @return New GEOM_Object, containing the created shape.
13012 # @ref tui_creation_dividedcylinder "Example"
13013 @ManageTransactions("AdvOp")
13014 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
13016 Builds a cylinder prepared for hexa meshes
13019 theR Radius of the cylinder
13020 theH Height of the cylinder
13021 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
13022 theName Object name; when specified, this parameter is used
13023 for result publication in the study. Otherwise, if automatic
13024 publication is switched on, default value is used for result name.
13027 New GEOM_Object, containing the created shape.
13029 theR, theH, Parameters = ParseParameters(theR, theH)
13030 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
13031 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
13032 if Parameters: anObj.SetParameters(Parameters)
13033 self._autoPublish(anObj, theName, "dividedCylinder")
13036 ## Create a surface from a cloud of points
13037 # @param thelPoints list of points. Compounds of points are
13038 # accepted as well.
13039 # @param theNbMax maximum number of Bezier pieces in the resulting
13041 # @param theDegMax maximum degree of the resulting BSpline surface.
13042 # @param theDMax 3D tolerance of initial approximation.
13043 # @param theName Object name; when specified, this parameter is used
13044 # for result publication in the study. Otherwise, if automatic
13045 # publication is switched on, default value is used for result name.
13046 # @return New GEOM_Object, containing the created shape.
13047 # @note 3D tolerance of initial approximation represents a tolerance of
13048 # initial plate surface approximation. If this parameter is equal
13049 # to 0 (default value) it is computed. In this case an error of
13050 # initial plate surface computation is used as the approximation
13051 # tolerance. This error represents a maximal distance between
13052 # computed plate surface and given points.
13054 # @ref tui_creation_smoothingsurface "Example"
13055 @ManageTransactions("AdvOp")
13056 def MakeSmoothingSurface(self, thelPoints, theNbMax=2, theDegMax=8,
13057 theDMax=0.0, theName=None):
13059 Create a surface from a cloud of points
13062 thelPoints list of points. Compounds of points are
13064 theNbMax maximum number of Bezier pieces in the resulting
13066 theDegMax maximum degree of the resulting BSpline surface.
13067 theDMax 3D tolerance of initial approximation.
13068 theName Object name; when specified, this parameter is used
13069 for result publication in the study. Otherwise, if automatic
13070 publication is switched on, default value is used for result name.
13073 New GEOM_Object, containing the created shape.
13076 3D tolerance of initial approximation represents a tolerance of
13077 initial plate surface approximation. If this parameter is equal
13078 to 0 (default value) it is computed. In this case an error of
13079 initial plate surface computation is used as the approximation
13080 tolerance. This error represents a maximal distance between
13081 computed plate surface and given points.
13083 anObj = self.AdvOp.MakeSmoothingSurface(thelPoints, theNbMax,
13084 theDegMax, theDMax)
13085 RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
13086 self._autoPublish(anObj, theName, "smoothing")
13089 ## Export a shape to XAO format
13090 # @param shape The shape to export
13091 # @param groups The list of groups to export
13092 # @param fields The list of fields to export
13093 # @param author The author of the export
13094 # @param fileName The name of the file to export
13097 # @ref tui_exportxao "Example"
13098 @ManageTransactions("InsertOp")
13099 def ExportXAO(self, shape, groups, fields, author, fileName):
13100 res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
13101 RaiseIfFailed("ExportXAO", self.InsertOp)
13104 ## Import a shape from XAO format
13105 # @param shape Shape to export
13106 # @param fileName The name of the file to import
13107 # @return tuple (res, shape, subShapes, groups, fields)
13108 # res Flag indicating if the import was successful
13109 # shape The imported shape
13110 # subShapes The list of imported subShapes
13111 # groups The list of imported groups
13112 # fields The list of imported fields
13114 # @ref tui_importxao "Example"
13115 @ManageTransactions("InsertOp")
13116 def ImportXAO(self, fileName):
13117 res = self.InsertOp.ImportXAO(fileName)
13118 RaiseIfFailed("ImportXAO", self.InsertOp)
13121 #@@ insert new functions before this line @@ do not remove this line @@#
13123 # end of l4_advanced
13126 ## Create a copy of the given object
13128 # @param theOriginal geometry object for copy
13129 # @param theName Object name; when specified, this parameter is used
13130 # for result publication in the study. Otherwise, if automatic
13131 # publication is switched on, default value is used for result name.
13133 # @return New GEOM_Object, containing the copied shape.
13135 # @ingroup l1_geomBuilder_auxiliary
13136 # @ref swig_MakeCopy "Example"
13137 @ManageTransactions("InsertOp")
13138 def MakeCopy(self, theOriginal, theName=None):
13140 Create a copy of the given object
13143 theOriginal geometry object for copy
13144 theName Object name; when specified, this parameter is used
13145 for result publication in the study. Otherwise, if automatic
13146 publication is switched on, default value is used for result name.
13149 New GEOM_Object, containing the copied shape.
13151 Example of usage: Copy = geompy.MakeCopy(Box)
13153 # Example: see GEOM_TestAll.py
13154 anObj = self.InsertOp.MakeCopy(theOriginal)
13155 RaiseIfFailed("MakeCopy", self.InsertOp)
13156 self._autoPublish(anObj, theName, "copy")
13159 ## Add Path to load python scripts from
13160 # @param Path a path to load python scripts from
13161 # @ingroup l1_geomBuilder_auxiliary
13162 def addPath(self,Path):
13164 Add Path to load python scripts from
13167 Path a path to load python scripts from
13169 if (sys.path.count(Path) < 1):
13170 sys.path.append(Path)
13174 ## Load marker texture from the file
13175 # @param Path a path to the texture file
13176 # @return unique texture identifier
13177 # @ingroup l1_geomBuilder_auxiliary
13178 @ManageTransactions("InsertOp")
13179 def LoadTexture(self, Path):
13181 Load marker texture from the file
13184 Path a path to the texture file
13187 unique texture identifier
13189 # Example: see GEOM_TestAll.py
13190 ID = self.InsertOp.LoadTexture(Path)
13191 RaiseIfFailed("LoadTexture", self.InsertOp)
13194 ## Get internal name of the object based on its study entry
13195 # @note This method does not provide an unique identifier of the geometry object.
13196 # @note This is internal function of GEOM component, though it can be used outside it for
13197 # appropriate reason (e.g. for identification of geometry object).
13198 # @param obj geometry object
13199 # @return unique object identifier
13200 # @ingroup l1_geomBuilder_auxiliary
13201 def getObjectID(self, obj):
13203 Get internal name of the object based on its study entry.
13204 Note: this method does not provide an unique identifier of the geometry object.
13205 It is an internal function of GEOM component, though it can be used outside GEOM for
13206 appropriate reason (e.g. for identification of geometry object).
13209 obj geometry object
13212 unique object identifier
13215 entry = salome.ObjectToID(obj)
13216 if entry is not None:
13217 lst = entry.split(":")
13219 ID = lst[-1] # -1 means last item in the list
13220 return "GEOM_" + ID
13225 ## Add marker texture. @a Width and @a Height parameters
13226 # specify width and height of the texture in pixels.
13227 # If @a RowData is @c True, @a Texture parameter should represent texture data
13228 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13229 # parameter should be unpacked string, in which '1' symbols represent opaque
13230 # pixels and '0' represent transparent pixels of the texture bitmap.
13232 # @param Width texture width in pixels
13233 # @param Height texture height in pixels
13234 # @param Texture texture data
13235 # @param RowData if @c True, @a Texture data are packed in the byte stream
13236 # @return unique texture identifier
13237 # @ingroup l1_geomBuilder_auxiliary
13238 @ManageTransactions("InsertOp")
13239 def AddTexture(self, Width, Height, Texture, RowData=False):
13241 Add marker texture. Width and Height parameters
13242 specify width and height of the texture in pixels.
13243 If RowData is True, Texture parameter should represent texture data
13244 packed into the byte array. If RowData is False (default), Texture
13245 parameter should be unpacked string, in which '1' symbols represent opaque
13246 pixels and '0' represent transparent pixels of the texture bitmap.
13249 Width texture width in pixels
13250 Height texture height in pixels
13251 Texture texture data
13252 RowData if True, Texture data are packed in the byte stream
13255 return unique texture identifier
13257 if not RowData: Texture = PackData(Texture)
13258 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13259 RaiseIfFailed("AddTexture", self.InsertOp)
13262 ## Creates a new folder object. It is a container for any GEOM objects.
13263 # @param Name name of the container
13264 # @param Father parent object. If None,
13265 # folder under 'Geometry' root object will be created.
13266 # @return a new created folder
13267 # @ingroup l1_publish_data
13268 def NewFolder(self, Name, Father=None):
13270 Create a new folder object. It is an auxiliary container for any GEOM objects.
13273 Name name of the container
13274 Father parent object. If None,
13275 folder under 'Geometry' root object will be created.
13278 a new created folder
13280 if not Father: Father = self.father
13281 return self.CreateFolder(Name, Father)
13283 ## Move object to the specified folder
13284 # @param Object object to move
13285 # @param Folder target folder
13286 # @ingroup l1_publish_data
13287 def PutToFolder(self, Object, Folder):
13289 Move object to the specified folder
13292 Object object to move
13293 Folder target folder
13295 self.MoveToFolder(Object, Folder)
13298 ## Move list of objects to the specified folder
13299 # @param ListOfSO list of objects to move
13300 # @param Folder target folder
13301 # @ingroup l1_publish_data
13302 def PutListToFolder(self, ListOfSO, Folder):
13304 Move list of objects to the specified folder
13307 ListOfSO list of objects to move
13308 Folder target folder
13310 self.MoveListToFolder(ListOfSO, Folder)
13313 ## @addtogroup l2_field
13317 # @param shape the shape the field lies on
13318 # @param name the field name
13319 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13320 # @param dimension dimension of the shape the field lies on
13321 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13322 # @param componentNames names of components
13323 # @return a created field
13324 @ManageTransactions("FieldOp")
13325 def CreateField(self, shape, name, type, dimension, componentNames):
13330 shape the shape the field lies on
13331 name the field name
13332 type type of field data
13333 dimension dimension of the shape the field lies on
13334 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13335 componentNames names of components
13340 if isinstance( type, int ):
13341 if type < 0 or type > 3:
13342 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
13343 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13345 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13346 RaiseIfFailed("CreateField", self.FieldOp)
13348 geom._autoPublish( f, "", name)
13351 ## Removes a field from the GEOM component
13352 # @param field the field to remove
13353 def RemoveField(self, field):
13354 "Removes a field from the GEOM component"
13356 if isinstance( field, GEOM._objref_GEOM_Field ):
13357 geom.RemoveObject( field )
13358 elif isinstance( field, geomField ):
13359 geom.RemoveObject( field.field )
13361 raise RuntimeError, "RemoveField() : the object is not a field"
13364 ## Returns number of fields on a shape
13365 @ManageTransactions("FieldOp")
13366 def CountFields(self, shape):
13367 "Returns number of fields on a shape"
13368 nb = self.FieldOp.CountFields( shape )
13369 RaiseIfFailed("CountFields", self.FieldOp)
13372 ## Returns all fields on a shape
13373 @ManageTransactions("FieldOp")
13374 def GetFields(self, shape):
13375 "Returns all fields on a shape"
13376 ff = self.FieldOp.GetFields( shape )
13377 RaiseIfFailed("GetFields", self.FieldOp)
13380 ## Returns a field on a shape by its name
13381 @ManageTransactions("FieldOp")
13382 def GetField(self, shape, name):
13383 "Returns a field on a shape by its name"
13384 f = self.FieldOp.GetField( shape, name )
13385 RaiseIfFailed("GetField", self.FieldOp)
13393 # Register the new proxy for GEOM_Gen
13394 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13397 ## Field on Geometry
13398 # @ingroup l2_field
13399 class geomField( GEOM._objref_GEOM_Field ):
13401 def __init__(self):
13402 GEOM._objref_GEOM_Field.__init__(self)
13403 self.field = GEOM._objref_GEOM_Field
13406 ## Returns the shape the field lies on
13407 def getShape(self):
13408 "Returns the shape the field lies on"
13409 return self.field.GetShape(self)
13411 ## Returns the field name
13413 "Returns the field name"
13414 return self.field.GetName(self)
13416 ## Returns type of field data as integer [0-3]
13418 "Returns type of field data"
13419 return self.field.GetDataType(self)._v
13421 ## Returns type of field data:
13422 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13423 def getTypeEnum(self):
13424 "Returns type of field data"
13425 return self.field.GetDataType(self)
13427 ## Returns dimension of the shape the field lies on:
13428 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13429 def getDimension(self):
13430 """Returns dimension of the shape the field lies on:
13431 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13432 return self.field.GetDimension(self)
13434 ## Returns names of components
13435 def getComponents(self):
13436 "Returns names of components"
13437 return self.field.GetComponents(self)
13439 ## Adds a time step to the field
13440 # @param step the time step number further used as the step identifier
13441 # @param stamp the time step time
13442 # @param values the values of the time step
13443 def addStep(self, step, stamp, values):
13444 "Adds a time step to the field"
13445 stp = self.field.AddStep( self, step, stamp )
13447 raise RuntimeError, \
13448 "Field.addStep() : Error: step %s already exists in this field"%step
13450 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13451 self.setValues( step, values )
13454 ## Remove a time step from the field
13455 def removeStep(self,step):
13456 "Remove a time step from the field"
13459 stepObj = self.field.GetStep( self, step )
13461 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13464 #traceback.print_exc()
13466 self.field.RemoveStep( self, step )
13468 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13471 ## Returns number of time steps in the field
13472 def countSteps(self):
13473 "Returns number of time steps in the field"
13474 return self.field.CountSteps(self)
13476 ## Returns a list of time step IDs in the field
13477 def getSteps(self):
13478 "Returns a list of time step IDs in the field"
13479 return self.field.GetSteps(self)
13481 ## Returns a time step by its ID
13482 def getStep(self,step):
13483 "Returns a time step by its ID"
13484 stp = self.field.GetStep(self, step)
13486 raise RuntimeError, "Step %s is missing from this field"%step
13489 ## Returns the time of the field step
13490 def getStamp(self,step):
13491 "Returns the time of the field step"
13492 return self.getStep(step).GetStamp()
13494 ## Changes the time of the field step
13495 def setStamp(self, step, stamp):
13496 "Changes the time of the field step"
13497 return self.getStep(step).SetStamp(stamp)
13499 ## Returns values of the field step
13500 def getValues(self, step):
13501 "Returns values of the field step"
13502 return self.getStep(step).GetValues()
13504 ## Changes values of the field step
13505 def setValues(self, step, values):
13506 "Changes values of the field step"
13507 stp = self.getStep(step)
13508 errBeg = "Field.setValues(values) : Error: "
13510 ok = stp.SetValues( values )
13511 except Exception, e:
13513 if excStr.find("WrongPythonType") > 0:
13514 raise RuntimeError, errBeg +\
13515 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13516 raise RuntimeError, errBeg + str(e)
13518 nbOK = self.field.GetArraySize(self)
13521 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13523 raise RuntimeError, errBeg + "failed"
13526 pass # end of class geomField
13528 # Register the new proxy for GEOM_Field
13529 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13532 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13533 # interface to GEOM operations.
13538 # salome.salome_init()
13539 # from salome.geom import geomBuilder
13540 # geompy = geomBuilder.New(salome.myStudy)
13542 # @param study SALOME study, generally obtained by salome.myStudy.
13543 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13544 # @return geomBuilder instance
13545 def New( study, instance=None):
13547 Create a new geomBuilder instance.The geomBuilder class provides the Python
13548 interface to GEOM operations.
13552 salome.salome_init()
13553 from salome.geom import geomBuilder
13554 geompy = geomBuilder.New(salome.myStudy)
13557 study SALOME study, generally obtained by salome.myStudy.
13558 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13560 geomBuilder instance
13562 #print "New geomBuilder ", study, instance
13569 geom = geomBuilder()
13570 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13571 geom.init_geom(study)